Rename fdmdv2 to freedv.
authorhobbes1069 <hobbes1069@01035d8c-6547-0410-b346-abe4f91aad63>
Thu, 13 Aug 2015 13:07:43 +0000 (13:07 +0000)
committerhobbes1069 <hobbes1069@01035d8c-6547-0410-b346-abe4f91aad63>
Thu, 13 Aug 2015 13:07:43 +0000 (13:07 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@2272 01035d8c-6547-0410-b346-abe4f91aad63

788 files changed:
fdmdv2-dev/.clang/.gitignore [deleted file]
fdmdv2-dev/CMakeLists.txt [deleted file]
fdmdv2-dev/COPYING [deleted file]
fdmdv2-dev/README.txt [deleted file]
fdmdv2-dev/cmake/BuildCodec2.cmake [deleted file]
fdmdv2-dev/cmake/BuildPortaudio.cmake [deleted file]
fdmdv2-dev/cmake/BuildSamplerate.cmake [deleted file]
fdmdv2-dev/cmake/BuildSndfile.cmake [deleted file]
fdmdv2-dev/cmake/BuildSox.cmake [deleted file]
fdmdv2-dev/cmake/BuildSpeex.cmake [deleted file]
fdmdv2-dev/cmake/BuildWxWidgets.cmake [deleted file]
fdmdv2-dev/cmake/FindPortaudio.cmake [deleted file]
fdmdv2-dev/cmake/GetDependencies.cmake.in [deleted file]
fdmdv2-dev/cmake/MinGW.cmake [deleted file]
fdmdv2-dev/cmake/Toolchain-Ubuntu-mingw32.cmake [deleted file]
fdmdv2-dev/cmake/config.h.in [deleted file]
fdmdv2-dev/cmake/version.h.in [deleted file]
fdmdv2-dev/contrib/CMakeLists.txt [deleted file]
fdmdv2-dev/contrib/LICENSE [deleted file]
fdmdv2-dev/contrib/freedv.desktop [deleted file]
fdmdv2-dev/contrib/freedv.ico [deleted file]
fdmdv2-dev/contrib/freedv.rc [deleted file]
fdmdv2-dev/contrib/freedv128x128.png [deleted file]
fdmdv2-dev/contrib/freedv256x256.png [deleted file]
fdmdv2-dev/contrib/freedv48x48.png [deleted file]
fdmdv2-dev/contrib/freedv64x64.png [deleted file]
fdmdv2-dev/credits.txt [deleted file]
fdmdv2-dev/db/current [deleted file]
fdmdv2-dev/db/format [deleted file]
fdmdv2-dev/db/fs-type [deleted file]
fdmdv2-dev/db/fsfs.conf [deleted file]
fdmdv2-dev/db/min-unpacked-rev [deleted file]
fdmdv2-dev/db/rep-cache.db [deleted file]
fdmdv2-dev/db/revprops/0/0 [deleted file]
fdmdv2-dev/db/revprops/0/1 [deleted file]
fdmdv2-dev/db/revs/0/0 [deleted file]
fdmdv2-dev/db/revs/0/1 [deleted file]
fdmdv2-dev/db/transactions/.gitignore [deleted file]
fdmdv2-dev/db/txn-current [deleted file]
fdmdv2-dev/db/txn-current-lock [deleted file]
fdmdv2-dev/db/txn-protorevs/.gitignore [deleted file]
fdmdv2-dev/db/uuid [deleted file]
fdmdv2-dev/db/write-lock [deleted file]
fdmdv2-dev/src/CMakeLists.txt [deleted file]
fdmdv2-dev/src/Makefile.win32 [deleted file]
fdmdv2-dev/src/comp.h [deleted file]
fdmdv2-dev/src/dlg_audiooptions.cpp [deleted file]
fdmdv2-dev/src/dlg_audiooptions.h [deleted file]
fdmdv2-dev/src/dlg_filter.cpp [deleted file]
fdmdv2-dev/src/dlg_filter.h [deleted file]
fdmdv2-dev/src/dlg_options.cpp [deleted file]
fdmdv2-dev/src/dlg_options.h [deleted file]
fdmdv2-dev/src/dlg_ptt.cpp [deleted file]
fdmdv2-dev/src/dlg_ptt.h [deleted file]
fdmdv2-dev/src/fdmdv2_defines.h [deleted file]
fdmdv2-dev/src/fdmdv2_main.cpp [deleted file]
fdmdv2-dev/src/fdmdv2_main.h [deleted file]
fdmdv2-dev/src/fdmdv2_pa_wrapper.cpp [deleted file]
fdmdv2-dev/src/fdmdv2_pa_wrapper.h [deleted file]
fdmdv2-dev/src/fdmdv2_plot.cpp [deleted file]
fdmdv2-dev/src/fdmdv2_plot.h [deleted file]
fdmdv2-dev/src/fdmdv2_plot_scalar.cpp [deleted file]
fdmdv2-dev/src/fdmdv2_plot_scalar.h [deleted file]
fdmdv2-dev/src/fdmdv2_plot_scatter.cpp [deleted file]
fdmdv2-dev/src/fdmdv2_plot_scatter.h [deleted file]
fdmdv2-dev/src/fdmdv2_plot_spectrum.cpp [deleted file]
fdmdv2-dev/src/fdmdv2_plot_spectrum.h [deleted file]
fdmdv2-dev/src/fdmdv2_plot_waterfall.cpp [deleted file]
fdmdv2-dev/src/fdmdv2_plot_waterfall.h [deleted file]
fdmdv2-dev/src/hamlib.cpp [deleted file]
fdmdv2-dev/src/hamlib.h [deleted file]
fdmdv2-dev/src/sox.h [deleted file]
fdmdv2-dev/src/sox_biquad.c [deleted file]
fdmdv2-dev/src/sox_biquad.h [deleted file]
fdmdv2-dev/src/topFrame.cpp [deleted file]
fdmdv2-dev/src/topFrame.h [deleted file]
fdmdv2/branches/0.97/.clang/.gitignore [deleted file]
fdmdv2/branches/0.97/AUTHORS [deleted file]
fdmdv2/branches/0.97/CMakeLists.txt [deleted file]
fdmdv2/branches/0.97/COPYING [deleted file]
fdmdv2/branches/0.97/ChangeLog [deleted file]
fdmdv2/branches/0.97/DEBIAN_DEVEL.sh [deleted file]
fdmdv2/branches/0.97/DEBIAN_RUNTIME.sh [deleted file]
fdmdv2/branches/0.97/Desktop.ini [deleted file]
fdmdv2/branches/0.97/INSTALL [deleted file]
fdmdv2/branches/0.97/NEWS [deleted file]
fdmdv2/branches/0.97/README [deleted file]
fdmdv2/branches/0.97/README.txt [deleted file]
fdmdv2/branches/0.97/build/codelite/.clang/.gitignore [deleted file]
fdmdv2/branches/0.97/build/codelite/dbfiles/fdmdv2config.sqlite.sql [deleted file]
fdmdv2/branches/0.97/build/codelite/dbfiles/fdmdv2config.sqlite.sqlite [deleted file]
fdmdv2/branches/0.97/build/codelite/dialogtest/MainDialog.cpp [deleted file]
fdmdv2/branches/0.97/build/codelite/dialogtest/MainDialog.h [deleted file]
fdmdv2/branches/0.97/build/codelite/dialogtest/dialogTest.mk [deleted file]
fdmdv2/branches/0.97/build/codelite/dialogtest/dialogTest.project [deleted file]
fdmdv2/branches/0.97/build/codelite/dialogtest/dialogTest.txt [deleted file]
fdmdv2/branches/0.97/build/codelite/dialogtest/main.cpp [deleted file]
fdmdv2/branches/0.97/build/codelite/dialogtest/win_resources.rc [deleted file]
fdmdv2/branches/0.97/build/codelite/dialogtest/wxcrafter.cpp [deleted file]
fdmdv2/branches/0.97/build/codelite/dialogtest/wxcrafter.h [deleted file]
fdmdv2/branches/0.97/build/codelite/dialogtest/wxcrafter.wxcp [deleted file]
fdmdv2/branches/0.97/build/codelite/dialogtest/wxcrafter_bitmaps.cpp [deleted file]
fdmdv2/branches/0.97/build/codelite/dialogtest/wxcrafter_bitmaps.xrc [deleted file]
fdmdv2/branches/0.97/build/codelite/fdmdv2.mk [deleted file]
fdmdv2/branches/0.97/build/codelite/fdmdv2.project [deleted file]
fdmdv2/branches/0.97/build/codelite/fdmdv2.txt [deleted file]
fdmdv2/branches/0.97/build/codelite/fdmdv2.workspace [deleted file]
fdmdv2/branches/0.97/build/codelite/fdmdv2_copyright_block.txt [deleted file]
fdmdv2/branches/0.97/build/codelite/fdmdv2_wsp.mk [deleted file]
fdmdv2/branches/0.97/build/codelite/hamlib_trial/MainFrame.cpp [deleted file]
fdmdv2/branches/0.97/build/codelite/hamlib_trial/MainFrame.h [deleted file]
fdmdv2/branches/0.97/build/codelite/hamlib_trial/dlg_rig_ctrl.cpp [deleted file]
fdmdv2/branches/0.97/build/codelite/hamlib_trial/dlg_rig_ctrl.h [deleted file]
fdmdv2/branches/0.97/build/codelite/hamlib_trial/hamlib_trial.mk [deleted file]
fdmdv2/branches/0.97/build/codelite/hamlib_trial/hamlib_trial.project [deleted file]
fdmdv2/branches/0.97/build/codelite/hamlib_trial/hamlib_trial.txt [deleted file]
fdmdv2/branches/0.97/build/codelite/hamlib_trial/main.cpp [deleted file]
fdmdv2/branches/0.97/build/codelite/hamlib_trial/main.h [deleted file]
fdmdv2/branches/0.97/build/codelite/hamlib_trial/win_resources.rc [deleted file]
fdmdv2/branches/0.97/build/codelite/hamlib_trial/wxcrafter.cpp [deleted file]
fdmdv2/branches/0.97/build/codelite/hamlib_trial/wxcrafter.h [deleted file]
fdmdv2/branches/0.97/build/codelite/hamlib_trial/wxcrafter.wxcp [deleted file]
fdmdv2/branches/0.97/build/codelite/hamlib_trial/wxcrafter.xrc [deleted file]
fdmdv2/branches/0.97/build/codelite/hamlib_trial/wxcrafter_bitmaps.cpp [deleted file]
fdmdv2/branches/0.97/build/codelite/hamlib_trial/wxcrafter_bitmaps.xrc [deleted file]
fdmdv2/branches/0.97/build/codelite/libCTB/libCTB.mk [deleted file]
fdmdv2/branches/0.97/build/codelite/libCTB/libCTB.project [deleted file]
fdmdv2/branches/0.97/build/codelite/libPortCtrl/Debug/.d [deleted file]
fdmdv2/branches/0.97/build/codelite/libPortCtrl/Release/.d [deleted file]
fdmdv2/branches/0.97/build/codelite/libPortCtrl/freedv_osx_port.patch [deleted file]
fdmdv2/branches/0.97/build/codelite/libPortCtrl/libPortCtrl.mk [deleted file]
fdmdv2/branches/0.97/build/codelite/libPortCtrl/libPortCtrl.project [deleted file]
fdmdv2/branches/0.97/build/codelite/libPortCtrl/libPortCtrl.txt [deleted file]
fdmdv2/branches/0.97/build/codelite/wxcrafter.xrc [deleted file]
fdmdv2/branches/0.97/build/msvc/.gitignore [deleted file]
fdmdv2/branches/0.97/cmake/BuildCodec2.cmake [deleted file]
fdmdv2/branches/0.97/cmake/BuildLibctb.cmake [deleted file]
fdmdv2/branches/0.97/cmake/BuildPortaudio.cmake [deleted file]
fdmdv2/branches/0.97/cmake/BuildSamplerate.cmake [deleted file]
fdmdv2/branches/0.97/cmake/BuildSndfile.cmake [deleted file]
fdmdv2/branches/0.97/cmake/BuildSox.cmake [deleted file]
fdmdv2/branches/0.97/cmake/BuildWxWidgets.cmake [deleted file]
fdmdv2/branches/0.97/cmake/FindPortaudio.cmake [deleted file]
fdmdv2/branches/0.97/cmake/GetDependencies.cmake.in [deleted file]
fdmdv2/branches/0.97/cmake/config.h.in [deleted file]
fdmdv2/branches/0.97/conf/authz [deleted file]
fdmdv2/branches/0.97/conf/passwd [deleted file]
fdmdv2/branches/0.97/conf/svnserve.conf [deleted file]
fdmdv2/branches/0.97/contrib/CMakeLists.txt [deleted file]
fdmdv2/branches/0.97/contrib/LICENSE [deleted file]
fdmdv2/branches/0.97/contrib/freedv.desktop [deleted file]
fdmdv2/branches/0.97/contrib/freedv.ico [deleted file]
fdmdv2/branches/0.97/contrib/freedv.rc [deleted file]
fdmdv2/branches/0.97/contrib/freedv128x128.png [deleted file]
fdmdv2/branches/0.97/contrib/freedv256x256.png [deleted file]
fdmdv2/branches/0.97/contrib/freedv48x48.png [deleted file]
fdmdv2/branches/0.97/contrib/freedv64x64.png [deleted file]
fdmdv2/branches/0.97/credits.txt [deleted file]
fdmdv2/branches/0.97/db/current [deleted file]
fdmdv2/branches/0.97/db/format [deleted file]
fdmdv2/branches/0.97/db/fs-type [deleted file]
fdmdv2/branches/0.97/db/fsfs.conf [deleted file]
fdmdv2/branches/0.97/db/min-unpacked-rev [deleted file]
fdmdv2/branches/0.97/db/rep-cache.db [deleted file]
fdmdv2/branches/0.97/db/revprops/0/0 [deleted file]
fdmdv2/branches/0.97/db/revprops/0/1 [deleted file]
fdmdv2/branches/0.97/db/revs/0/0 [deleted file]
fdmdv2/branches/0.97/db/revs/0/1 [deleted file]
fdmdv2/branches/0.97/db/transactions/.gitignore [deleted file]
fdmdv2/branches/0.97/db/txn-current [deleted file]
fdmdv2/branches/0.97/db/txn-current-lock [deleted file]
fdmdv2/branches/0.97/db/txn-protorevs/.gitignore [deleted file]
fdmdv2/branches/0.97/db/uuid [deleted file]
fdmdv2/branches/0.97/db/write-lock [deleted file]
fdmdv2/branches/0.97/fdmdv2.project [deleted file]
fdmdv2/branches/0.97/format [deleted file]
fdmdv2/branches/0.97/hooks/post-commit.tmpl [deleted file]
fdmdv2/branches/0.97/hooks/post-lock.tmpl [deleted file]
fdmdv2/branches/0.97/hooks/post-revprop-change.tmpl [deleted file]
fdmdv2/branches/0.97/hooks/post-unlock.tmpl [deleted file]
fdmdv2/branches/0.97/hooks/pre-commit.tmpl [deleted file]
fdmdv2/branches/0.97/hooks/pre-lock.tmpl [deleted file]
fdmdv2/branches/0.97/hooks/pre-revprop-change.tmpl [deleted file]
fdmdv2/branches/0.97/hooks/pre-unlock.tmpl [deleted file]
fdmdv2/branches/0.97/hooks/start-commit.tmpl [deleted file]
fdmdv2/branches/0.97/locks/db-logs.lock [deleted file]
fdmdv2/branches/0.97/locks/db.lock [deleted file]
fdmdv2/branches/0.97/notes/FDMDV_build_notes.txt [deleted file]
fdmdv2/branches/0.97/notes/codec2-MinGW-build/codec2-MinGW-build.tags [deleted file]
fdmdv2/branches/0.97/notes/codec2-MinGW-build/codec2-MinGW-build.workspace [deleted file]
fdmdv2/branches/0.97/notes/codec2-MinGW-build/codec2-MinGW-build.workspace.session [deleted file]
fdmdv2/branches/0.97/notes/codec2-MinGW-build/codec2basic/codec2basic.project [deleted file]
fdmdv2/branches/0.97/notes/codec2-MinGW-build/codec2basic/main.c [deleted file]
fdmdv2/branches/0.97/notes/codec2-MinGW-build/extra-inc/endian.h [deleted file]
fdmdv2/branches/0.97/notes/codec2-MinGW-build/extra-inc/sys/sound.h [deleted file]
fdmdv2/branches/0.97/notes/codec2-MinGW-build/extra-inc/sys/soundcard.h [deleted file]
fdmdv2/branches/0.97/notes/portaudio_notes.txt [deleted file]
fdmdv2/branches/0.97/obsolete/README.Win32 [deleted file]
fdmdv2/branches/0.97/obsolete/README.linux [deleted file]
fdmdv2/branches/0.97/obsolete/README.osx [deleted file]
fdmdv2/branches/0.97/obsolete/freedv_osx_port.patch.gz [deleted file]
fdmdv2/branches/0.97/src/CMakeLists.txt [deleted file]
fdmdv2/branches/0.97/src/comp.h [deleted file]
fdmdv2/branches/0.97/src/credits.txt [deleted file]
fdmdv2/branches/0.97/src/dlg_about.cpp [deleted file]
fdmdv2/branches/0.97/src/dlg_about.h [deleted file]
fdmdv2/branches/0.97/src/dlg_audiooptions.cpp [deleted file]
fdmdv2/branches/0.97/src/dlg_audiooptions.h [deleted file]
fdmdv2/branches/0.97/src/dlg_filter.cpp [deleted file]
fdmdv2/branches/0.97/src/dlg_filter.h [deleted file]
fdmdv2/branches/0.97/src/dlg_options.cpp [deleted file]
fdmdv2/branches/0.97/src/dlg_options.h [deleted file]
fdmdv2/branches/0.97/src/dlg_ptt.cpp [deleted file]
fdmdv2/branches/0.97/src/dlg_ptt.h [deleted file]
fdmdv2/branches/0.97/src/fdmdv2_defines.h [deleted file]
fdmdv2/branches/0.97/src/fdmdv2_main.cpp [deleted file]
fdmdv2/branches/0.97/src/fdmdv2_main.h [deleted file]
fdmdv2/branches/0.97/src/fdmdv2_pa_wrapper.cpp [deleted file]
fdmdv2/branches/0.97/src/fdmdv2_pa_wrapper.h [deleted file]
fdmdv2/branches/0.97/src/fdmdv2_plot.cpp [deleted file]
fdmdv2/branches/0.97/src/fdmdv2_plot.h [deleted file]
fdmdv2/branches/0.97/src/fdmdv2_plot_scalar.cpp [deleted file]
fdmdv2/branches/0.97/src/fdmdv2_plot_scalar.h [deleted file]
fdmdv2/branches/0.97/src/fdmdv2_plot_scatter.cpp [deleted file]
fdmdv2/branches/0.97/src/fdmdv2_plot_scatter.h [deleted file]
fdmdv2/branches/0.97/src/fdmdv2_plot_spectrum.cpp [deleted file]
fdmdv2/branches/0.97/src/fdmdv2_plot_spectrum.h [deleted file]
fdmdv2/branches/0.97/src/fdmdv2_plot_waterfall.cpp [deleted file]
fdmdv2/branches/0.97/src/fdmdv2_plot_waterfall.h [deleted file]
fdmdv2/branches/0.97/src/hamlib.cpp [deleted file]
fdmdv2/branches/0.97/src/hamlib.h [deleted file]
fdmdv2/branches/0.97/src/sox.h [deleted file]
fdmdv2/branches/0.97/src/sox_biquad.c [deleted file]
fdmdv2/branches/0.97/src/sox_biquad.h [deleted file]
fdmdv2/branches/0.97/src/topFrame.cpp [deleted file]
fdmdv2/branches/0.97/src/topFrame.h [deleted file]
fdmdv2/branches/0.97/src/varicode.c [deleted file]
fdmdv2/branches/0.97/src/varicode.h [deleted file]
fdmdv2/branches/0.97/src/varicode_table.h [deleted file]
fdmdv2/branches/0.97/src/version.h [deleted file]
fdmdv2/branches/0.97/svn.ico [deleted file]
fdmdv2/branches/0.99/.clang/.gitignore [deleted file]
fdmdv2/branches/0.99/CMakeLists.txt [deleted file]
fdmdv2/branches/0.99/COPYING [deleted file]
fdmdv2/branches/0.99/README.txt [deleted file]
fdmdv2/branches/0.99/cmake/BuildCodec2.cmake [deleted file]
fdmdv2/branches/0.99/cmake/BuildPortaudio.cmake [deleted file]
fdmdv2/branches/0.99/cmake/BuildSamplerate.cmake [deleted file]
fdmdv2/branches/0.99/cmake/BuildSndfile.cmake [deleted file]
fdmdv2/branches/0.99/cmake/BuildSox.cmake [deleted file]
fdmdv2/branches/0.99/cmake/BuildSpeex.cmake [deleted file]
fdmdv2/branches/0.99/cmake/BuildWxWidgets.cmake [deleted file]
fdmdv2/branches/0.99/cmake/FindPortaudio.cmake [deleted file]
fdmdv2/branches/0.99/cmake/GetDependencies.cmake.in [deleted file]
fdmdv2/branches/0.99/cmake/MinGW.cmake [deleted file]
fdmdv2/branches/0.99/cmake/Toolchain-Ubuntu-mingw32.cmake [deleted file]
fdmdv2/branches/0.99/cmake/config.h.in [deleted file]
fdmdv2/branches/0.99/cmake/version.h.in [deleted file]
fdmdv2/branches/0.99/contrib/CMakeLists.txt [deleted file]
fdmdv2/branches/0.99/contrib/LICENSE [deleted file]
fdmdv2/branches/0.99/contrib/freedv.desktop [deleted file]
fdmdv2/branches/0.99/contrib/freedv.ico [deleted file]
fdmdv2/branches/0.99/contrib/freedv.rc [deleted file]
fdmdv2/branches/0.99/contrib/freedv128x128.png [deleted file]
fdmdv2/branches/0.99/contrib/freedv256x256.png [deleted file]
fdmdv2/branches/0.99/contrib/freedv48x48.png [deleted file]
fdmdv2/branches/0.99/contrib/freedv64x64.png [deleted file]
fdmdv2/branches/0.99/credits.txt [deleted file]
fdmdv2/branches/0.99/db/current [deleted file]
fdmdv2/branches/0.99/db/format [deleted file]
fdmdv2/branches/0.99/db/fs-type [deleted file]
fdmdv2/branches/0.99/db/fsfs.conf [deleted file]
fdmdv2/branches/0.99/db/min-unpacked-rev [deleted file]
fdmdv2/branches/0.99/db/rep-cache.db [deleted file]
fdmdv2/branches/0.99/db/revprops/0/0 [deleted file]
fdmdv2/branches/0.99/db/revprops/0/1 [deleted file]
fdmdv2/branches/0.99/db/revs/0/0 [deleted file]
fdmdv2/branches/0.99/db/revs/0/1 [deleted file]
fdmdv2/branches/0.99/db/transactions/.gitignore [deleted file]
fdmdv2/branches/0.99/db/txn-current [deleted file]
fdmdv2/branches/0.99/db/txn-current-lock [deleted file]
fdmdv2/branches/0.99/db/txn-protorevs/.gitignore [deleted file]
fdmdv2/branches/0.99/db/uuid [deleted file]
fdmdv2/branches/0.99/db/write-lock [deleted file]
fdmdv2/branches/0.99/src/CMakeLists.txt [deleted file]
fdmdv2/branches/0.99/src/Makefile.win32 [deleted file]
fdmdv2/branches/0.99/src/comp.h [deleted file]
fdmdv2/branches/0.99/src/dlg_audiooptions.cpp [deleted file]
fdmdv2/branches/0.99/src/dlg_audiooptions.h [deleted file]
fdmdv2/branches/0.99/src/dlg_filter.cpp [deleted file]
fdmdv2/branches/0.99/src/dlg_filter.h [deleted file]
fdmdv2/branches/0.99/src/dlg_options.cpp [deleted file]
fdmdv2/branches/0.99/src/dlg_options.h [deleted file]
fdmdv2/branches/0.99/src/dlg_ptt.cpp [deleted file]
fdmdv2/branches/0.99/src/dlg_ptt.h [deleted file]
fdmdv2/branches/0.99/src/fdmdv2_defines.h [deleted file]
fdmdv2/branches/0.99/src/fdmdv2_main.cpp [deleted file]
fdmdv2/branches/0.99/src/fdmdv2_main.h [deleted file]
fdmdv2/branches/0.99/src/fdmdv2_pa_wrapper.cpp [deleted file]
fdmdv2/branches/0.99/src/fdmdv2_pa_wrapper.h [deleted file]
fdmdv2/branches/0.99/src/fdmdv2_plot.cpp [deleted file]
fdmdv2/branches/0.99/src/fdmdv2_plot.h [deleted file]
fdmdv2/branches/0.99/src/fdmdv2_plot_scalar.cpp [deleted file]
fdmdv2/branches/0.99/src/fdmdv2_plot_scalar.h [deleted file]
fdmdv2/branches/0.99/src/fdmdv2_plot_scatter.cpp [deleted file]
fdmdv2/branches/0.99/src/fdmdv2_plot_scatter.h [deleted file]
fdmdv2/branches/0.99/src/fdmdv2_plot_spectrum.cpp [deleted file]
fdmdv2/branches/0.99/src/fdmdv2_plot_spectrum.h [deleted file]
fdmdv2/branches/0.99/src/fdmdv2_plot_waterfall.cpp [deleted file]
fdmdv2/branches/0.99/src/fdmdv2_plot_waterfall.h [deleted file]
fdmdv2/branches/0.99/src/hamlib.cpp [deleted file]
fdmdv2/branches/0.99/src/hamlib.h [deleted file]
fdmdv2/branches/0.99/src/sox.h [deleted file]
fdmdv2/branches/0.99/src/sox_biquad.c [deleted file]
fdmdv2/branches/0.99/src/sox_biquad.h [deleted file]
fdmdv2/branches/0.99/src/topFrame.cpp [deleted file]
fdmdv2/branches/0.99/src/topFrame.h [deleted file]
fdmdv2/cmake/.gitignore [deleted file]
fdmdv2/src/.gitignore [deleted file]
fdmdv2/tags/0.99-Beta/.clang/.gitignore [deleted file]
fdmdv2/tags/0.99-Beta/CMakeLists.txt [deleted file]
fdmdv2/tags/0.99-Beta/COPYING [deleted file]
fdmdv2/tags/0.99-Beta/README.txt [deleted file]
fdmdv2/tags/0.99-Beta/cmake/BuildCodec2.cmake [deleted file]
fdmdv2/tags/0.99-Beta/cmake/BuildPortaudio.cmake [deleted file]
fdmdv2/tags/0.99-Beta/cmake/BuildSamplerate.cmake [deleted file]
fdmdv2/tags/0.99-Beta/cmake/BuildSndfile.cmake [deleted file]
fdmdv2/tags/0.99-Beta/cmake/BuildSox.cmake [deleted file]
fdmdv2/tags/0.99-Beta/cmake/BuildSpeex.cmake [deleted file]
fdmdv2/tags/0.99-Beta/cmake/BuildWxWidgets.cmake [deleted file]
fdmdv2/tags/0.99-Beta/cmake/FindPortaudio.cmake [deleted file]
fdmdv2/tags/0.99-Beta/cmake/GetDependencies.cmake.in [deleted file]
fdmdv2/tags/0.99-Beta/cmake/MinGW.cmake [deleted file]
fdmdv2/tags/0.99-Beta/cmake/Toolchain-Ubuntu-mingw32.cmake [deleted file]
fdmdv2/tags/0.99-Beta/cmake/config.h.in [deleted file]
fdmdv2/tags/0.99-Beta/cmake/version.h.in [deleted file]
fdmdv2/tags/0.99-Beta/contrib/CMakeLists.txt [deleted file]
fdmdv2/tags/0.99-Beta/contrib/LICENSE [deleted file]
fdmdv2/tags/0.99-Beta/contrib/freedv.desktop [deleted file]
fdmdv2/tags/0.99-Beta/contrib/freedv.ico [deleted file]
fdmdv2/tags/0.99-Beta/contrib/freedv.rc [deleted file]
fdmdv2/tags/0.99-Beta/contrib/freedv128x128.png [deleted file]
fdmdv2/tags/0.99-Beta/contrib/freedv256x256.png [deleted file]
fdmdv2/tags/0.99-Beta/contrib/freedv48x48.png [deleted file]
fdmdv2/tags/0.99-Beta/contrib/freedv64x64.png [deleted file]
fdmdv2/tags/0.99-Beta/credits.txt [deleted file]
fdmdv2/tags/0.99-Beta/db/current [deleted file]
fdmdv2/tags/0.99-Beta/db/format [deleted file]
fdmdv2/tags/0.99-Beta/db/fs-type [deleted file]
fdmdv2/tags/0.99-Beta/db/fsfs.conf [deleted file]
fdmdv2/tags/0.99-Beta/db/min-unpacked-rev [deleted file]
fdmdv2/tags/0.99-Beta/db/rep-cache.db [deleted file]
fdmdv2/tags/0.99-Beta/db/revprops/0/0 [deleted file]
fdmdv2/tags/0.99-Beta/db/revprops/0/1 [deleted file]
fdmdv2/tags/0.99-Beta/db/revs/0/0 [deleted file]
fdmdv2/tags/0.99-Beta/db/revs/0/1 [deleted file]
fdmdv2/tags/0.99-Beta/db/transactions/.gitignore [deleted file]
fdmdv2/tags/0.99-Beta/db/txn-current [deleted file]
fdmdv2/tags/0.99-Beta/db/txn-current-lock [deleted file]
fdmdv2/tags/0.99-Beta/db/txn-protorevs/.gitignore [deleted file]
fdmdv2/tags/0.99-Beta/db/uuid [deleted file]
fdmdv2/tags/0.99-Beta/db/write-lock [deleted file]
fdmdv2/tags/0.99-Beta/src/CMakeLists.txt [deleted file]
fdmdv2/tags/0.99-Beta/src/Makefile.win32 [deleted file]
fdmdv2/tags/0.99-Beta/src/comp.h [deleted file]
fdmdv2/tags/0.99-Beta/src/dlg_audiooptions.cpp [deleted file]
fdmdv2/tags/0.99-Beta/src/dlg_audiooptions.h [deleted file]
fdmdv2/tags/0.99-Beta/src/dlg_filter.cpp [deleted file]
fdmdv2/tags/0.99-Beta/src/dlg_filter.h [deleted file]
fdmdv2/tags/0.99-Beta/src/dlg_options.cpp [deleted file]
fdmdv2/tags/0.99-Beta/src/dlg_options.h [deleted file]
fdmdv2/tags/0.99-Beta/src/dlg_ptt.cpp [deleted file]
fdmdv2/tags/0.99-Beta/src/dlg_ptt.h [deleted file]
fdmdv2/tags/0.99-Beta/src/fdmdv2_defines.h [deleted file]
fdmdv2/tags/0.99-Beta/src/fdmdv2_main.cpp [deleted file]
fdmdv2/tags/0.99-Beta/src/fdmdv2_main.h [deleted file]
fdmdv2/tags/0.99-Beta/src/fdmdv2_pa_wrapper.cpp [deleted file]
fdmdv2/tags/0.99-Beta/src/fdmdv2_pa_wrapper.h [deleted file]
fdmdv2/tags/0.99-Beta/src/fdmdv2_plot.cpp [deleted file]
fdmdv2/tags/0.99-Beta/src/fdmdv2_plot.h [deleted file]
fdmdv2/tags/0.99-Beta/src/fdmdv2_plot_scalar.cpp [deleted file]
fdmdv2/tags/0.99-Beta/src/fdmdv2_plot_scalar.h [deleted file]
fdmdv2/tags/0.99-Beta/src/fdmdv2_plot_scatter.cpp [deleted file]
fdmdv2/tags/0.99-Beta/src/fdmdv2_plot_scatter.h [deleted file]
fdmdv2/tags/0.99-Beta/src/fdmdv2_plot_spectrum.cpp [deleted file]
fdmdv2/tags/0.99-Beta/src/fdmdv2_plot_spectrum.h [deleted file]
fdmdv2/tags/0.99-Beta/src/fdmdv2_plot_waterfall.cpp [deleted file]
fdmdv2/tags/0.99-Beta/src/fdmdv2_plot_waterfall.h [deleted file]
fdmdv2/tags/0.99-Beta/src/hamlib.cpp [deleted file]
fdmdv2/tags/0.99-Beta/src/hamlib.h [deleted file]
fdmdv2/tags/0.99-Beta/src/sox.h [deleted file]
fdmdv2/tags/0.99-Beta/src/sox_biquad.c [deleted file]
fdmdv2/tags/0.99-Beta/src/sox_biquad.h [deleted file]
fdmdv2/tags/0.99-Beta/src/topFrame.cpp [deleted file]
fdmdv2/tags/0.99-Beta/src/topFrame.h [deleted file]
freedv-dev/.clang/.gitignore [new file with mode: 0644]
freedv-dev/CMakeLists.txt [new file with mode: 0644]
freedv-dev/COPYING [new file with mode: 0644]
freedv-dev/README.txt [new file with mode: 0644]
freedv-dev/cmake/BuildCodec2.cmake [new file with mode: 0644]
freedv-dev/cmake/BuildPortaudio.cmake [new file with mode: 0644]
freedv-dev/cmake/BuildSamplerate.cmake [new file with mode: 0644]
freedv-dev/cmake/BuildSndfile.cmake [new file with mode: 0644]
freedv-dev/cmake/BuildSox.cmake [new file with mode: 0644]
freedv-dev/cmake/BuildSpeex.cmake [new file with mode: 0644]
freedv-dev/cmake/BuildWxWidgets.cmake [new file with mode: 0644]
freedv-dev/cmake/FindPortaudio.cmake [new file with mode: 0644]
freedv-dev/cmake/GetDependencies.cmake.in [new file with mode: 0644]
freedv-dev/cmake/MinGW.cmake [new file with mode: 0644]
freedv-dev/cmake/Toolchain-Ubuntu-mingw32.cmake [new file with mode: 0644]
freedv-dev/cmake/config.h.in [new file with mode: 0644]
freedv-dev/cmake/version.h.in [new file with mode: 0644]
freedv-dev/contrib/CMakeLists.txt [new file with mode: 0644]
freedv-dev/contrib/LICENSE [new file with mode: 0644]
freedv-dev/contrib/freedv.desktop [new file with mode: 0644]
freedv-dev/contrib/freedv.ico [new file with mode: 0644]
freedv-dev/contrib/freedv.rc [new file with mode: 0644]
freedv-dev/contrib/freedv128x128.png [new file with mode: 0644]
freedv-dev/contrib/freedv256x256.png [new file with mode: 0644]
freedv-dev/contrib/freedv48x48.png [new file with mode: 0644]
freedv-dev/contrib/freedv64x64.png [new file with mode: 0644]
freedv-dev/credits.txt [new file with mode: 0644]
freedv-dev/db/current [new file with mode: 0644]
freedv-dev/db/format [new file with mode: 0644]
freedv-dev/db/fs-type [new file with mode: 0644]
freedv-dev/db/fsfs.conf [new file with mode: 0644]
freedv-dev/db/min-unpacked-rev [new file with mode: 0644]
freedv-dev/db/rep-cache.db [new file with mode: 0644]
freedv-dev/db/revprops/0/0 [new file with mode: 0644]
freedv-dev/db/revprops/0/1 [new file with mode: 0644]
freedv-dev/db/revs/0/0 [new file with mode: 0644]
freedv-dev/db/revs/0/1 [new file with mode: 0644]
freedv-dev/db/transactions/.gitignore [new file with mode: 0644]
freedv-dev/db/txn-current [new file with mode: 0644]
freedv-dev/db/txn-current-lock [new file with mode: 0644]
freedv-dev/db/txn-protorevs/.gitignore [new file with mode: 0644]
freedv-dev/db/uuid [new file with mode: 0644]
freedv-dev/db/write-lock [new file with mode: 0644]
freedv-dev/src/CMakeLists.txt [new file with mode: 0644]
freedv-dev/src/Makefile.win32 [new file with mode: 0644]
freedv-dev/src/comp.h [new file with mode: 0644]
freedv-dev/src/dlg_audiooptions.cpp [new file with mode: 0644]
freedv-dev/src/dlg_audiooptions.h [new file with mode: 0644]
freedv-dev/src/dlg_filter.cpp [new file with mode: 0644]
freedv-dev/src/dlg_filter.h [new file with mode: 0644]
freedv-dev/src/dlg_options.cpp [new file with mode: 0644]
freedv-dev/src/dlg_options.h [new file with mode: 0644]
freedv-dev/src/dlg_ptt.cpp [new file with mode: 0644]
freedv-dev/src/dlg_ptt.h [new file with mode: 0644]
freedv-dev/src/fdmdv2_defines.h [new file with mode: 0644]
freedv-dev/src/fdmdv2_main.cpp [new file with mode: 0644]
freedv-dev/src/fdmdv2_main.h [new file with mode: 0644]
freedv-dev/src/fdmdv2_pa_wrapper.cpp [new file with mode: 0644]
freedv-dev/src/fdmdv2_pa_wrapper.h [new file with mode: 0644]
freedv-dev/src/fdmdv2_plot.cpp [new file with mode: 0644]
freedv-dev/src/fdmdv2_plot.h [new file with mode: 0644]
freedv-dev/src/fdmdv2_plot_scalar.cpp [new file with mode: 0644]
freedv-dev/src/fdmdv2_plot_scalar.h [new file with mode: 0644]
freedv-dev/src/fdmdv2_plot_scatter.cpp [new file with mode: 0644]
freedv-dev/src/fdmdv2_plot_scatter.h [new file with mode: 0644]
freedv-dev/src/fdmdv2_plot_spectrum.cpp [new file with mode: 0644]
freedv-dev/src/fdmdv2_plot_spectrum.h [new file with mode: 0644]
freedv-dev/src/fdmdv2_plot_waterfall.cpp [new file with mode: 0644]
freedv-dev/src/fdmdv2_plot_waterfall.h [new file with mode: 0644]
freedv-dev/src/hamlib.cpp [new file with mode: 0644]
freedv-dev/src/hamlib.h [new file with mode: 0644]
freedv-dev/src/sox.h [new file with mode: 0644]
freedv-dev/src/sox_biquad.c [new file with mode: 0644]
freedv-dev/src/sox_biquad.h [new file with mode: 0644]
freedv-dev/src/topFrame.cpp [new file with mode: 0644]
freedv-dev/src/topFrame.h [new file with mode: 0644]
freedv/branches/0.97/.clang/.gitignore [new file with mode: 0644]
freedv/branches/0.97/AUTHORS [new file with mode: 0644]
freedv/branches/0.97/CMakeLists.txt [new file with mode: 0644]
freedv/branches/0.97/COPYING [new file with mode: 0644]
freedv/branches/0.97/ChangeLog [new file with mode: 0644]
freedv/branches/0.97/DEBIAN_DEVEL.sh [new file with mode: 0644]
freedv/branches/0.97/DEBIAN_RUNTIME.sh [new file with mode: 0644]
freedv/branches/0.97/Desktop.ini [new file with mode: 0644]
freedv/branches/0.97/INSTALL [new file with mode: 0644]
freedv/branches/0.97/NEWS [new file with mode: 0644]
freedv/branches/0.97/README [new file with mode: 0644]
freedv/branches/0.97/README.txt [new file with mode: 0644]
freedv/branches/0.97/build/codelite/.clang/.gitignore [new file with mode: 0644]
freedv/branches/0.97/build/codelite/dbfiles/fdmdv2config.sqlite.sql [new file with mode: 0644]
freedv/branches/0.97/build/codelite/dbfiles/fdmdv2config.sqlite.sqlite [new file with mode: 0644]
freedv/branches/0.97/build/codelite/dialogtest/MainDialog.cpp [new file with mode: 0644]
freedv/branches/0.97/build/codelite/dialogtest/MainDialog.h [new file with mode: 0644]
freedv/branches/0.97/build/codelite/dialogtest/dialogTest.mk [new file with mode: 0644]
freedv/branches/0.97/build/codelite/dialogtest/dialogTest.project [new file with mode: 0644]
freedv/branches/0.97/build/codelite/dialogtest/dialogTest.txt [new file with mode: 0644]
freedv/branches/0.97/build/codelite/dialogtest/main.cpp [new file with mode: 0644]
freedv/branches/0.97/build/codelite/dialogtest/win_resources.rc [new file with mode: 0644]
freedv/branches/0.97/build/codelite/dialogtest/wxcrafter.cpp [new file with mode: 0644]
freedv/branches/0.97/build/codelite/dialogtest/wxcrafter.h [new file with mode: 0644]
freedv/branches/0.97/build/codelite/dialogtest/wxcrafter.wxcp [new file with mode: 0644]
freedv/branches/0.97/build/codelite/dialogtest/wxcrafter_bitmaps.cpp [new file with mode: 0644]
freedv/branches/0.97/build/codelite/dialogtest/wxcrafter_bitmaps.xrc [new file with mode: 0644]
freedv/branches/0.97/build/codelite/fdmdv2.mk [new file with mode: 0644]
freedv/branches/0.97/build/codelite/fdmdv2.project [new file with mode: 0644]
freedv/branches/0.97/build/codelite/fdmdv2.txt [new file with mode: 0644]
freedv/branches/0.97/build/codelite/fdmdv2.workspace [new file with mode: 0644]
freedv/branches/0.97/build/codelite/fdmdv2_copyright_block.txt [new file with mode: 0644]
freedv/branches/0.97/build/codelite/fdmdv2_wsp.mk [new file with mode: 0644]
freedv/branches/0.97/build/codelite/hamlib_trial/MainFrame.cpp [new file with mode: 0644]
freedv/branches/0.97/build/codelite/hamlib_trial/MainFrame.h [new file with mode: 0644]
freedv/branches/0.97/build/codelite/hamlib_trial/dlg_rig_ctrl.cpp [new file with mode: 0644]
freedv/branches/0.97/build/codelite/hamlib_trial/dlg_rig_ctrl.h [new file with mode: 0644]
freedv/branches/0.97/build/codelite/hamlib_trial/hamlib_trial.mk [new file with mode: 0644]
freedv/branches/0.97/build/codelite/hamlib_trial/hamlib_trial.project [new file with mode: 0644]
freedv/branches/0.97/build/codelite/hamlib_trial/hamlib_trial.txt [new file with mode: 0644]
freedv/branches/0.97/build/codelite/hamlib_trial/main.cpp [new file with mode: 0644]
freedv/branches/0.97/build/codelite/hamlib_trial/main.h [new file with mode: 0644]
freedv/branches/0.97/build/codelite/hamlib_trial/win_resources.rc [new file with mode: 0644]
freedv/branches/0.97/build/codelite/hamlib_trial/wxcrafter.cpp [new file with mode: 0644]
freedv/branches/0.97/build/codelite/hamlib_trial/wxcrafter.h [new file with mode: 0644]
freedv/branches/0.97/build/codelite/hamlib_trial/wxcrafter.wxcp [new file with mode: 0644]
freedv/branches/0.97/build/codelite/hamlib_trial/wxcrafter.xrc [new file with mode: 0644]
freedv/branches/0.97/build/codelite/hamlib_trial/wxcrafter_bitmaps.cpp [new file with mode: 0644]
freedv/branches/0.97/build/codelite/hamlib_trial/wxcrafter_bitmaps.xrc [new file with mode: 0644]
freedv/branches/0.97/build/codelite/libCTB/libCTB.mk [new file with mode: 0644]
freedv/branches/0.97/build/codelite/libCTB/libCTB.project [new file with mode: 0644]
freedv/branches/0.97/build/codelite/libPortCtrl/Debug/.d [new file with mode: 0644]
freedv/branches/0.97/build/codelite/libPortCtrl/Release/.d [new file with mode: 0644]
freedv/branches/0.97/build/codelite/libPortCtrl/freedv_osx_port.patch [new file with mode: 0644]
freedv/branches/0.97/build/codelite/libPortCtrl/libPortCtrl.mk [new file with mode: 0644]
freedv/branches/0.97/build/codelite/libPortCtrl/libPortCtrl.project [new file with mode: 0644]
freedv/branches/0.97/build/codelite/libPortCtrl/libPortCtrl.txt [new file with mode: 0644]
freedv/branches/0.97/build/codelite/wxcrafter.xrc [new file with mode: 0644]
freedv/branches/0.97/build/msvc/.gitignore [new file with mode: 0644]
freedv/branches/0.97/cmake/BuildCodec2.cmake [new file with mode: 0644]
freedv/branches/0.97/cmake/BuildLibctb.cmake [new file with mode: 0644]
freedv/branches/0.97/cmake/BuildPortaudio.cmake [new file with mode: 0644]
freedv/branches/0.97/cmake/BuildSamplerate.cmake [new file with mode: 0644]
freedv/branches/0.97/cmake/BuildSndfile.cmake [new file with mode: 0644]
freedv/branches/0.97/cmake/BuildSox.cmake [new file with mode: 0644]
freedv/branches/0.97/cmake/BuildWxWidgets.cmake [new file with mode: 0644]
freedv/branches/0.97/cmake/FindPortaudio.cmake [new file with mode: 0644]
freedv/branches/0.97/cmake/GetDependencies.cmake.in [new file with mode: 0644]
freedv/branches/0.97/cmake/config.h.in [new file with mode: 0644]
freedv/branches/0.97/conf/authz [new file with mode: 0644]
freedv/branches/0.97/conf/passwd [new file with mode: 0644]
freedv/branches/0.97/conf/svnserve.conf [new file with mode: 0644]
freedv/branches/0.97/contrib/CMakeLists.txt [new file with mode: 0644]
freedv/branches/0.97/contrib/LICENSE [new file with mode: 0644]
freedv/branches/0.97/contrib/freedv.desktop [new file with mode: 0644]
freedv/branches/0.97/contrib/freedv.ico [new file with mode: 0644]
freedv/branches/0.97/contrib/freedv.rc [new file with mode: 0644]
freedv/branches/0.97/contrib/freedv128x128.png [new file with mode: 0644]
freedv/branches/0.97/contrib/freedv256x256.png [new file with mode: 0644]
freedv/branches/0.97/contrib/freedv48x48.png [new file with mode: 0644]
freedv/branches/0.97/contrib/freedv64x64.png [new file with mode: 0644]
freedv/branches/0.97/credits.txt [new file with mode: 0644]
freedv/branches/0.97/db/current [new file with mode: 0644]
freedv/branches/0.97/db/format [new file with mode: 0644]
freedv/branches/0.97/db/fs-type [new file with mode: 0644]
freedv/branches/0.97/db/fsfs.conf [new file with mode: 0644]
freedv/branches/0.97/db/min-unpacked-rev [new file with mode: 0644]
freedv/branches/0.97/db/rep-cache.db [new file with mode: 0644]
freedv/branches/0.97/db/revprops/0/0 [new file with mode: 0644]
freedv/branches/0.97/db/revprops/0/1 [new file with mode: 0644]
freedv/branches/0.97/db/revs/0/0 [new file with mode: 0644]
freedv/branches/0.97/db/revs/0/1 [new file with mode: 0644]
freedv/branches/0.97/db/transactions/.gitignore [new file with mode: 0644]
freedv/branches/0.97/db/txn-current [new file with mode: 0644]
freedv/branches/0.97/db/txn-current-lock [new file with mode: 0644]
freedv/branches/0.97/db/txn-protorevs/.gitignore [new file with mode: 0644]
freedv/branches/0.97/db/uuid [new file with mode: 0644]
freedv/branches/0.97/db/write-lock [new file with mode: 0644]
freedv/branches/0.97/fdmdv2.project [new file with mode: 0644]
freedv/branches/0.97/format [new file with mode: 0644]
freedv/branches/0.97/hooks/post-commit.tmpl [new file with mode: 0644]
freedv/branches/0.97/hooks/post-lock.tmpl [new file with mode: 0644]
freedv/branches/0.97/hooks/post-revprop-change.tmpl [new file with mode: 0644]
freedv/branches/0.97/hooks/post-unlock.tmpl [new file with mode: 0644]
freedv/branches/0.97/hooks/pre-commit.tmpl [new file with mode: 0644]
freedv/branches/0.97/hooks/pre-lock.tmpl [new file with mode: 0644]
freedv/branches/0.97/hooks/pre-revprop-change.tmpl [new file with mode: 0644]
freedv/branches/0.97/hooks/pre-unlock.tmpl [new file with mode: 0644]
freedv/branches/0.97/hooks/start-commit.tmpl [new file with mode: 0644]
freedv/branches/0.97/locks/db-logs.lock [new file with mode: 0644]
freedv/branches/0.97/locks/db.lock [new file with mode: 0644]
freedv/branches/0.97/notes/FDMDV_build_notes.txt [new file with mode: 0644]
freedv/branches/0.97/notes/codec2-MinGW-build/codec2-MinGW-build.tags [new file with mode: 0644]
freedv/branches/0.97/notes/codec2-MinGW-build/codec2-MinGW-build.workspace [new file with mode: 0644]
freedv/branches/0.97/notes/codec2-MinGW-build/codec2-MinGW-build.workspace.session [new file with mode: 0644]
freedv/branches/0.97/notes/codec2-MinGW-build/codec2basic/codec2basic.project [new file with mode: 0644]
freedv/branches/0.97/notes/codec2-MinGW-build/codec2basic/main.c [new file with mode: 0644]
freedv/branches/0.97/notes/codec2-MinGW-build/extra-inc/endian.h [new file with mode: 0644]
freedv/branches/0.97/notes/codec2-MinGW-build/extra-inc/sys/sound.h [new file with mode: 0644]
freedv/branches/0.97/notes/codec2-MinGW-build/extra-inc/sys/soundcard.h [new file with mode: 0644]
freedv/branches/0.97/notes/portaudio_notes.txt [new file with mode: 0644]
freedv/branches/0.97/obsolete/README.Win32 [new file with mode: 0644]
freedv/branches/0.97/obsolete/README.linux [new file with mode: 0644]
freedv/branches/0.97/obsolete/README.osx [new file with mode: 0644]
freedv/branches/0.97/obsolete/freedv_osx_port.patch.gz [new file with mode: 0644]
freedv/branches/0.97/src/CMakeLists.txt [new file with mode: 0644]
freedv/branches/0.97/src/comp.h [new file with mode: 0644]
freedv/branches/0.97/src/credits.txt [new file with mode: 0644]
freedv/branches/0.97/src/dlg_about.cpp [new file with mode: 0644]
freedv/branches/0.97/src/dlg_about.h [new file with mode: 0644]
freedv/branches/0.97/src/dlg_audiooptions.cpp [new file with mode: 0644]
freedv/branches/0.97/src/dlg_audiooptions.h [new file with mode: 0644]
freedv/branches/0.97/src/dlg_filter.cpp [new file with mode: 0644]
freedv/branches/0.97/src/dlg_filter.h [new file with mode: 0644]
freedv/branches/0.97/src/dlg_options.cpp [new file with mode: 0644]
freedv/branches/0.97/src/dlg_options.h [new file with mode: 0644]
freedv/branches/0.97/src/dlg_ptt.cpp [new file with mode: 0644]
freedv/branches/0.97/src/dlg_ptt.h [new file with mode: 0644]
freedv/branches/0.97/src/fdmdv2_defines.h [new file with mode: 0644]
freedv/branches/0.97/src/fdmdv2_main.cpp [new file with mode: 0644]
freedv/branches/0.97/src/fdmdv2_main.h [new file with mode: 0644]
freedv/branches/0.97/src/fdmdv2_pa_wrapper.cpp [new file with mode: 0644]
freedv/branches/0.97/src/fdmdv2_pa_wrapper.h [new file with mode: 0644]
freedv/branches/0.97/src/fdmdv2_plot.cpp [new file with mode: 0644]
freedv/branches/0.97/src/fdmdv2_plot.h [new file with mode: 0644]
freedv/branches/0.97/src/fdmdv2_plot_scalar.cpp [new file with mode: 0644]
freedv/branches/0.97/src/fdmdv2_plot_scalar.h [new file with mode: 0644]
freedv/branches/0.97/src/fdmdv2_plot_scatter.cpp [new file with mode: 0644]
freedv/branches/0.97/src/fdmdv2_plot_scatter.h [new file with mode: 0644]
freedv/branches/0.97/src/fdmdv2_plot_spectrum.cpp [new file with mode: 0644]
freedv/branches/0.97/src/fdmdv2_plot_spectrum.h [new file with mode: 0644]
freedv/branches/0.97/src/fdmdv2_plot_waterfall.cpp [new file with mode: 0644]
freedv/branches/0.97/src/fdmdv2_plot_waterfall.h [new file with mode: 0644]
freedv/branches/0.97/src/hamlib.cpp [new file with mode: 0644]
freedv/branches/0.97/src/hamlib.h [new file with mode: 0644]
freedv/branches/0.97/src/sox.h [new file with mode: 0644]
freedv/branches/0.97/src/sox_biquad.c [new file with mode: 0644]
freedv/branches/0.97/src/sox_biquad.h [new file with mode: 0644]
freedv/branches/0.97/src/topFrame.cpp [new file with mode: 0644]
freedv/branches/0.97/src/topFrame.h [new file with mode: 0644]
freedv/branches/0.97/src/varicode.c [new file with mode: 0644]
freedv/branches/0.97/src/varicode.h [new file with mode: 0644]
freedv/branches/0.97/src/varicode_table.h [new file with mode: 0644]
freedv/branches/0.97/src/version.h [new file with mode: 0644]
freedv/branches/0.97/svn.ico [new file with mode: 0644]
freedv/branches/0.99/.clang/.gitignore [new file with mode: 0644]
freedv/branches/0.99/CMakeLists.txt [new file with mode: 0644]
freedv/branches/0.99/COPYING [new file with mode: 0644]
freedv/branches/0.99/README.txt [new file with mode: 0644]
freedv/branches/0.99/cmake/BuildCodec2.cmake [new file with mode: 0644]
freedv/branches/0.99/cmake/BuildPortaudio.cmake [new file with mode: 0644]
freedv/branches/0.99/cmake/BuildSamplerate.cmake [new file with mode: 0644]
freedv/branches/0.99/cmake/BuildSndfile.cmake [new file with mode: 0644]
freedv/branches/0.99/cmake/BuildSox.cmake [new file with mode: 0644]
freedv/branches/0.99/cmake/BuildSpeex.cmake [new file with mode: 0644]
freedv/branches/0.99/cmake/BuildWxWidgets.cmake [new file with mode: 0644]
freedv/branches/0.99/cmake/FindPortaudio.cmake [new file with mode: 0644]
freedv/branches/0.99/cmake/GetDependencies.cmake.in [new file with mode: 0644]
freedv/branches/0.99/cmake/MinGW.cmake [new file with mode: 0644]
freedv/branches/0.99/cmake/Toolchain-Ubuntu-mingw32.cmake [new file with mode: 0644]
freedv/branches/0.99/cmake/config.h.in [new file with mode: 0644]
freedv/branches/0.99/cmake/version.h.in [new file with mode: 0644]
freedv/branches/0.99/contrib/CMakeLists.txt [new file with mode: 0644]
freedv/branches/0.99/contrib/LICENSE [new file with mode: 0644]
freedv/branches/0.99/contrib/freedv.desktop [new file with mode: 0644]
freedv/branches/0.99/contrib/freedv.ico [new file with mode: 0644]
freedv/branches/0.99/contrib/freedv.rc [new file with mode: 0644]
freedv/branches/0.99/contrib/freedv128x128.png [new file with mode: 0644]
freedv/branches/0.99/contrib/freedv256x256.png [new file with mode: 0644]
freedv/branches/0.99/contrib/freedv48x48.png [new file with mode: 0644]
freedv/branches/0.99/contrib/freedv64x64.png [new file with mode: 0644]
freedv/branches/0.99/credits.txt [new file with mode: 0644]
freedv/branches/0.99/db/current [new file with mode: 0644]
freedv/branches/0.99/db/format [new file with mode: 0644]
freedv/branches/0.99/db/fs-type [new file with mode: 0644]
freedv/branches/0.99/db/fsfs.conf [new file with mode: 0644]
freedv/branches/0.99/db/min-unpacked-rev [new file with mode: 0644]
freedv/branches/0.99/db/rep-cache.db [new file with mode: 0644]
freedv/branches/0.99/db/revprops/0/0 [new file with mode: 0644]
freedv/branches/0.99/db/revprops/0/1 [new file with mode: 0644]
freedv/branches/0.99/db/revs/0/0 [new file with mode: 0644]
freedv/branches/0.99/db/revs/0/1 [new file with mode: 0644]
freedv/branches/0.99/db/transactions/.gitignore [new file with mode: 0644]
freedv/branches/0.99/db/txn-current [new file with mode: 0644]
freedv/branches/0.99/db/txn-current-lock [new file with mode: 0644]
freedv/branches/0.99/db/txn-protorevs/.gitignore [new file with mode: 0644]
freedv/branches/0.99/db/uuid [new file with mode: 0644]
freedv/branches/0.99/db/write-lock [new file with mode: 0644]
freedv/branches/0.99/src/CMakeLists.txt [new file with mode: 0644]
freedv/branches/0.99/src/Makefile.win32 [new file with mode: 0644]
freedv/branches/0.99/src/comp.h [new file with mode: 0644]
freedv/branches/0.99/src/dlg_audiooptions.cpp [new file with mode: 0644]
freedv/branches/0.99/src/dlg_audiooptions.h [new file with mode: 0644]
freedv/branches/0.99/src/dlg_filter.cpp [new file with mode: 0644]
freedv/branches/0.99/src/dlg_filter.h [new file with mode: 0644]
freedv/branches/0.99/src/dlg_options.cpp [new file with mode: 0644]
freedv/branches/0.99/src/dlg_options.h [new file with mode: 0644]
freedv/branches/0.99/src/dlg_ptt.cpp [new file with mode: 0644]
freedv/branches/0.99/src/dlg_ptt.h [new file with mode: 0644]
freedv/branches/0.99/src/fdmdv2_defines.h [new file with mode: 0644]
freedv/branches/0.99/src/fdmdv2_main.cpp [new file with mode: 0644]
freedv/branches/0.99/src/fdmdv2_main.h [new file with mode: 0644]
freedv/branches/0.99/src/fdmdv2_pa_wrapper.cpp [new file with mode: 0644]
freedv/branches/0.99/src/fdmdv2_pa_wrapper.h [new file with mode: 0644]
freedv/branches/0.99/src/fdmdv2_plot.cpp [new file with mode: 0644]
freedv/branches/0.99/src/fdmdv2_plot.h [new file with mode: 0644]
freedv/branches/0.99/src/fdmdv2_plot_scalar.cpp [new file with mode: 0644]
freedv/branches/0.99/src/fdmdv2_plot_scalar.h [new file with mode: 0644]
freedv/branches/0.99/src/fdmdv2_plot_scatter.cpp [new file with mode: 0644]
freedv/branches/0.99/src/fdmdv2_plot_scatter.h [new file with mode: 0644]
freedv/branches/0.99/src/fdmdv2_plot_spectrum.cpp [new file with mode: 0644]
freedv/branches/0.99/src/fdmdv2_plot_spectrum.h [new file with mode: 0644]
freedv/branches/0.99/src/fdmdv2_plot_waterfall.cpp [new file with mode: 0644]
freedv/branches/0.99/src/fdmdv2_plot_waterfall.h [new file with mode: 0644]
freedv/branches/0.99/src/hamlib.cpp [new file with mode: 0644]
freedv/branches/0.99/src/hamlib.h [new file with mode: 0644]
freedv/branches/0.99/src/sox.h [new file with mode: 0644]
freedv/branches/0.99/src/sox_biquad.c [new file with mode: 0644]
freedv/branches/0.99/src/sox_biquad.h [new file with mode: 0644]
freedv/branches/0.99/src/topFrame.cpp [new file with mode: 0644]
freedv/branches/0.99/src/topFrame.h [new file with mode: 0644]
freedv/tags/0.99-Beta/.clang/.gitignore [new file with mode: 0644]
freedv/tags/0.99-Beta/CMakeLists.txt [new file with mode: 0644]
freedv/tags/0.99-Beta/COPYING [new file with mode: 0644]
freedv/tags/0.99-Beta/README.txt [new file with mode: 0644]
freedv/tags/0.99-Beta/cmake/BuildCodec2.cmake [new file with mode: 0644]
freedv/tags/0.99-Beta/cmake/BuildPortaudio.cmake [new file with mode: 0644]
freedv/tags/0.99-Beta/cmake/BuildSamplerate.cmake [new file with mode: 0644]
freedv/tags/0.99-Beta/cmake/BuildSndfile.cmake [new file with mode: 0644]
freedv/tags/0.99-Beta/cmake/BuildSox.cmake [new file with mode: 0644]
freedv/tags/0.99-Beta/cmake/BuildSpeex.cmake [new file with mode: 0644]
freedv/tags/0.99-Beta/cmake/BuildWxWidgets.cmake [new file with mode: 0644]
freedv/tags/0.99-Beta/cmake/FindPortaudio.cmake [new file with mode: 0644]
freedv/tags/0.99-Beta/cmake/GetDependencies.cmake.in [new file with mode: 0644]
freedv/tags/0.99-Beta/cmake/MinGW.cmake [new file with mode: 0644]
freedv/tags/0.99-Beta/cmake/Toolchain-Ubuntu-mingw32.cmake [new file with mode: 0644]
freedv/tags/0.99-Beta/cmake/config.h.in [new file with mode: 0644]
freedv/tags/0.99-Beta/cmake/version.h.in [new file with mode: 0644]
freedv/tags/0.99-Beta/contrib/CMakeLists.txt [new file with mode: 0644]
freedv/tags/0.99-Beta/contrib/LICENSE [new file with mode: 0644]
freedv/tags/0.99-Beta/contrib/freedv.desktop [new file with mode: 0644]
freedv/tags/0.99-Beta/contrib/freedv.ico [new file with mode: 0644]
freedv/tags/0.99-Beta/contrib/freedv.rc [new file with mode: 0644]
freedv/tags/0.99-Beta/contrib/freedv128x128.png [new file with mode: 0644]
freedv/tags/0.99-Beta/contrib/freedv256x256.png [new file with mode: 0644]
freedv/tags/0.99-Beta/contrib/freedv48x48.png [new file with mode: 0644]
freedv/tags/0.99-Beta/contrib/freedv64x64.png [new file with mode: 0644]
freedv/tags/0.99-Beta/credits.txt [new file with mode: 0644]
freedv/tags/0.99-Beta/db/current [new file with mode: 0644]
freedv/tags/0.99-Beta/db/format [new file with mode: 0644]
freedv/tags/0.99-Beta/db/fs-type [new file with mode: 0644]
freedv/tags/0.99-Beta/db/fsfs.conf [new file with mode: 0644]
freedv/tags/0.99-Beta/db/min-unpacked-rev [new file with mode: 0644]
freedv/tags/0.99-Beta/db/rep-cache.db [new file with mode: 0644]
freedv/tags/0.99-Beta/db/revprops/0/0 [new file with mode: 0644]
freedv/tags/0.99-Beta/db/revprops/0/1 [new file with mode: 0644]
freedv/tags/0.99-Beta/db/revs/0/0 [new file with mode: 0644]
freedv/tags/0.99-Beta/db/revs/0/1 [new file with mode: 0644]
freedv/tags/0.99-Beta/db/transactions/.gitignore [new file with mode: 0644]
freedv/tags/0.99-Beta/db/txn-current [new file with mode: 0644]
freedv/tags/0.99-Beta/db/txn-current-lock [new file with mode: 0644]
freedv/tags/0.99-Beta/db/txn-protorevs/.gitignore [new file with mode: 0644]
freedv/tags/0.99-Beta/db/uuid [new file with mode: 0644]
freedv/tags/0.99-Beta/db/write-lock [new file with mode: 0644]
freedv/tags/0.99-Beta/src/CMakeLists.txt [new file with mode: 0644]
freedv/tags/0.99-Beta/src/Makefile.win32 [new file with mode: 0644]
freedv/tags/0.99-Beta/src/comp.h [new file with mode: 0644]
freedv/tags/0.99-Beta/src/dlg_audiooptions.cpp [new file with mode: 0644]
freedv/tags/0.99-Beta/src/dlg_audiooptions.h [new file with mode: 0644]
freedv/tags/0.99-Beta/src/dlg_filter.cpp [new file with mode: 0644]
freedv/tags/0.99-Beta/src/dlg_filter.h [new file with mode: 0644]
freedv/tags/0.99-Beta/src/dlg_options.cpp [new file with mode: 0644]
freedv/tags/0.99-Beta/src/dlg_options.h [new file with mode: 0644]
freedv/tags/0.99-Beta/src/dlg_ptt.cpp [new file with mode: 0644]
freedv/tags/0.99-Beta/src/dlg_ptt.h [new file with mode: 0644]
freedv/tags/0.99-Beta/src/fdmdv2_defines.h [new file with mode: 0644]
freedv/tags/0.99-Beta/src/fdmdv2_main.cpp [new file with mode: 0644]
freedv/tags/0.99-Beta/src/fdmdv2_main.h [new file with mode: 0644]
freedv/tags/0.99-Beta/src/fdmdv2_pa_wrapper.cpp [new file with mode: 0644]
freedv/tags/0.99-Beta/src/fdmdv2_pa_wrapper.h [new file with mode: 0644]
freedv/tags/0.99-Beta/src/fdmdv2_plot.cpp [new file with mode: 0644]
freedv/tags/0.99-Beta/src/fdmdv2_plot.h [new file with mode: 0644]
freedv/tags/0.99-Beta/src/fdmdv2_plot_scalar.cpp [new file with mode: 0644]
freedv/tags/0.99-Beta/src/fdmdv2_plot_scalar.h [new file with mode: 0644]
freedv/tags/0.99-Beta/src/fdmdv2_plot_scatter.cpp [new file with mode: 0644]
freedv/tags/0.99-Beta/src/fdmdv2_plot_scatter.h [new file with mode: 0644]
freedv/tags/0.99-Beta/src/fdmdv2_plot_spectrum.cpp [new file with mode: 0644]
freedv/tags/0.99-Beta/src/fdmdv2_plot_spectrum.h [new file with mode: 0644]
freedv/tags/0.99-Beta/src/fdmdv2_plot_waterfall.cpp [new file with mode: 0644]
freedv/tags/0.99-Beta/src/fdmdv2_plot_waterfall.h [new file with mode: 0644]
freedv/tags/0.99-Beta/src/hamlib.cpp [new file with mode: 0644]
freedv/tags/0.99-Beta/src/hamlib.h [new file with mode: 0644]
freedv/tags/0.99-Beta/src/sox.h [new file with mode: 0644]
freedv/tags/0.99-Beta/src/sox_biquad.c [new file with mode: 0644]
freedv/tags/0.99-Beta/src/sox_biquad.h [new file with mode: 0644]
freedv/tags/0.99-Beta/src/topFrame.cpp [new file with mode: 0644]
freedv/tags/0.99-Beta/src/topFrame.h [new file with mode: 0644]

diff --git a/fdmdv2-dev/.clang/.gitignore b/fdmdv2-dev/.clang/.gitignore
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/fdmdv2-dev/CMakeLists.txt b/fdmdv2-dev/CMakeLists.txt
deleted file mode 100644 (file)
index afdd8a3..0000000
+++ /dev/null
@@ -1,487 +0,0 @@
-#
-# FreeDV - HF Digital Voice for Radio Amateurs
-#
-# CMake configuration contributed by Richard Shaw (KF5OIM)
-# Please report questions, comments, problems, or patches to the freetel
-# mailing list: https://lists.sourceforge.net/lists/listinfo/freetel-codec2
-#
-
-cmake_minimum_required(VERSION 2.8)
-
-# Prevent in-source builds to protect automake/autoconf config.
-# If an in-source build is attempted, you will still need to clean up a few
-# files manually.
-set(CMAKE_DISABLE_SOURCE_CHANGES ON)
-set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
-if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
-  message(FATAL_ERROR "In-source builds in ${CMAKE_BINARY_DIR} are not "   
-   "allowed, please remove ./CMakeCache.txt and ./CMakeFiles/, create a "
-   "separate build directory and run cmake from there.")
-endif("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
-
-# Set local module path.
-list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
-
-project(FreeDV)
-
-#
-# Set FreeDV version and generate src/version.h
-#
-set(FREEDV_VERSION_MAJOR 0)
-set(FREEDV_VERSION_MINOR 99)
-set(FREEDV_VERSION_PATCH FALSE)
-set(FREEDV_VERSION ${FREEDV_VERSION_MAJOR}.${FREEDV_VERSION_MINOR})
-if(FREEDV_VERSION_PATCH)
-    set(FREEDV_VERSION ${FREEDV_VERSION}.${FREEDV_VERSION_PATCH})
-endif()
-set(FREEDV_VERSION_SUFFIX "Beta")
-if(FREEDV_VERSION_SUFFIX)
-    set(FREEDV_VERSION_STRING "${FREEDV_VERSION} ${FREEDV_VERSION_SUFFIX}")
-endif()
-message(STATUS "FreeDV version: ${FREEDV_VERSION_STRING}")
-configure_file(cmake/version.h.in src/version.h @ONLY)
-
-# Set default build type
-if(NOT CMAKE_BUILD_TYPE)
-    set(CMAKE_BUILD_TYPE "Release")
-    message(STATUS "Build type not specified, defaulting to ${CMAKE_BUILD_TYPE}")
-endif(NOT CMAKE_BUILD_TYPE)
-
-
-# Work around for not using a svn working copy.
-add_definitions(-D_NO_AUTOTOOLS_)
-find_program(SVNVERSION_PATH svnversion)
-if(SVNVERSION_PATH)
-    execute_process(COMMAND ${SVNVERSION_PATH} .
-        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-        RESULT_VARIABLE SVN_REVISION_RESULT
-        OUTPUT_VARIABLE SVN_CURRENT_REVISION
-        ERROR_QUIET
-    )
-else()
-    set(SVN_REVISION_RESULT 1)
-endif()
-if(SVN_REVISION_RESULT EQUAL 0)
-string(STRIP ${SVN_CURRENT_REVISION} SVN_REVISION)
-add_definitions(-DSVN_REVISION="${SVN_REVISION}")
-else()
-add_definitions(-DSVN_REVISION="Unversioned directory")
-endif()
-
-
-# Set default build flags.
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
-
-#
-# Setup cmake options
-#
-set(CMAKE_VERBOSE_MAKEFILE TRUE CACHE BOOL "Verbose makefile.")
-set(USE_STATIC_DEPS FALSE CACHE BOOL 
-    "Download and build static libraries instead of system libraries.")
-set(USE_STATIC_PORTAUDIO FALSE CACHE BOOL 
-    "Download and build static portaudio instead of the system library.")
-set(USE_STATIC_SNDFILE FALSE CACHE BOOL
-    "Download and build static sndfile instead of the system library.")
-set(USE_STATIC_SAMPLERATE FALSE CACHE BOOL
-    "Download and build static samplerate instead of the system library.")
-set(USE_STATIC_SOX FALSE CACHE BOOL
-    "Download and build static sox instead of the system library.")
-set(USE_STATIC_CODEC2 TRUE CACHE BOOL
-    "Download and build static codec2 instead of the system library.")
-set(USE_STATIC_SPEEXDSP TRUE CACHE BOOL
-    "Download and build static speex instead of the system library.")
-set(BOOTSTRAP_WXWIDGETS FALSE CACHE BOOL
-    "Download and build static wxWidgets instead of the system library.")
-
-if(USE_STATIC_DEPS)
-    set(USE_STATIC_PORTAUDIO TRUE FORCE)
-    set(USE_STATIC_SNDFILE TRUE FORCE)
-    set(USE_STATIC_SAMPLERATE TRUE FORCE)
-    set(USE_STATIC_SOX TRUE FORCE)
-    set(USE_STATIC_CODEC2 TRUE FORCE)
-endif(USE_STATIC_DEPS)
-
-#
-# Pull in external wxWidgets target if performing static build.
-#
-if(BOOTSTRAP_WXWIDGETS)
-    message(STATUS "Adding wxWidgets build target...")
-    include(cmake/BuildWxWidgets.cmake)
-endif(BOOTSTRAP_WXWIDGETS)
-
-#
-# Perform bootstrap build of wxWidgets
-#
-if(BOOTSTRAP_WXWIDGETS AND NOT EXISTS ${WXCONFIG})
-    message(STATUS "Will perform bootstrap build of wxWidgets.
-   After make step completes, re-run cmake and make again to perform FreeDV build.")
-#
-# Continue normal build if not bootstrapping wxWidgets or is already built.
-#
-else(BOOTSTRAP_WXWIDGETS AND NOT EXISTS ${WXCONFIG})
-
-
-#
-# Various hacks and work arounds for building under MinGW.
-#
-if(MINGW)
-    message(STATUS "System is MinGW.")
-    # Setup HOST variable.
-    include(cmake/MinGW.cmake)
-    # This sets up the exe icon for windows under mingw.
-    set(RES_FILES "")
-    set(RES_FILES "${CMAKE_SOURCE_DIR}/contrib/freedv.rc")
-    set(CMAKE_RC_COMPILER_INIT windres)
-    enable_language(RC)
-    set(CMAKE_RC_COMPILE_OBJECT
-        "<CMAKE_RC_COMPILER> <FLAGS> -O coff <DEFINES> -i <SOURCE> -o <OBJECT>")
-    # These are DLOPEN'ed and can't be automatically pulled in by dependency.
-    foreach(RUNTIME
-        hamlib-adat.dll
-        hamlib-alinco.dll
-        hamlib-amsat.dll
-        hamlib-aor.dll
-        hamlib-ars.dll
-        hamlib-celestron.dll
-        hamlib-drake.dll
-        hamlib-dummy.dll
-        hamlib-easycomm.dll
-        hamlib-flexradio.dll
-        hamlib-fodtrack.dll
-        hamlib-gs232a.dll
-        hamlib-heathkit.dll
-        hamlib-icom.dll
-        hamlib-jrc.dll
-        hamlib-kachina.dll
-        hamlib-kenwood.dll
-        hamlib-kit.dll
-        hamlib-lowe.dll
-        hamlib-m2.dll
-        hamlib-pcr.dll
-        hamlib-prm80.dll
-        hamlib-racal.dll
-        hamlib-rft.dll
-        hamlib-rotorez.dll
-        hamlib-rs.dll
-        hamlib-sartek.dll
-        hamlib-skanti.dll
-        hamlib-spid.dll
-        hamlib-tapr.dll
-        hamlib-tentec.dll
-        hamlib-ts7400.dll
-        hamlib-tuner.dll
-        hamlib-uniden.dll
-        hamlib-winradio.dll
-        hamlib-wj.dll
-        hamlib-yaesu.dll)
-        message(STATUS "Checking for ${RUNTIME}")
-        find_library(${RUNTIME}_LIB ${RUNTIME}
-            PATH_SUFFIXES hamlib)
-        message(STATUS "runtime found: ${${RUNTIME}_LIB}")
-        list(APPEND CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS ${${RUNTIME}_LIB})
-    endforeach()
-    include(InstallRequiredSystemLibraries)
-endif(MINGW)
-
-# Math library is automatic on MinGW
-if(UNIX)
-    set(CMAKE_REQUIRED_INCLUDES math.h)
-    set(CMAKE_REQUIRED_LIBRARIES m)
-endif(UNIX)
-
-# Find some standard headers and functions.
-include(CheckIncludeFiles)
-check_include_files("limits.h" HAVE_LIMITS_H)
-check_include_files("stddef.h" HAVE_STDDEF_H)
-check_include_files("stdlib.h" HAVE_STDLIB_H)
-check_include_files("string.h" HAVE_STRING_H)
-
-include(CheckTypeSize)
-check_type_size("int" SIZEOF_INT)
-
-include(CheckFunctionExists)
-check_function_exists(floor HAVE_FLOOR)
-check_function_exists(memset HAVE_MEMSET)
-check_function_exists(pow HAVE_POW)
-check_function_exists(sqrt HAVE_SQRT)
-
-# fdmdv2_main.h requires patching to find config.h as it current looks in the
-# source directory and the generated file goes in the binary directory.
-configure_file ("${PROJECT_SOURCE_DIR}/cmake/config.h.in"
-                "${PROJECT_BINARY_DIR}/config.h" )
-include_directories(${PROJECT_BINARY_DIR})
-add_definitions(-DHAVE_CONFIG_H)
-
-# Pthread Library
-find_package(Threads REQUIRED)
-message(STATUS "Threads library flags: ${CMAKE_THREAD_LIBS_INIT}")
-
-#
-# Find codec2
-#
-if(NOT USE_STATIC_CODEC2)
-    message(STATUS "Looking for codec2...")
-    find_package(codec2 CONFIG QUIET)
-    if(codec2_FOUND)
-        get_target_property(CODEC2_LIBRARY codec2 LOCATION)
-        message(STATUS "  codec2 library: ${CODEC2_LIBRARY}")
-        message(STATUS "  codec2 headers: ${codec2_INCLUDE_DIRS}")
-    else()
-        # Try to find manually
-        find_path(CODEC2_INCLUDE_DIRS codec2.h
-                  PATH_SUFFIXES codec2)
-        find_library(CODEC2_LIBRARY NAMES codec2)
-        if(CODEC2_LIBRARY AND CODEC2_INCLUDE_DIRS)
-            message(STATUS "  codec2 library: ${CODEC2_LIBRARY}")
-            message(STATUS "  codec2 headers: ${CODEC2_INCLUDE_DIRS}")
-            list(APPEND FREEDV_LINK_LIBS ${CODEC2_LIBRARY})
-            include_directories(${CODEC2_INCLUDE_DIRS})
-        else()
-            message(FATAL_ERROR "codec2 library not found.
-Linux: 
-Codec2 may not be in your distribution so build yourself or use the cmake option to build statically into FreeDV.
-Windws:
-It's easiest to use the cmake option: USE_STATIC_CODEC2"
-        )
-        endif()
-    endif()
-else(NOT USE_STATIC_CODEC2)
-    message(STATUS "Will attempt static build of codec2.")
-    include(cmake/BuildCodec2.cmake)
-endif(NOT USE_STATIC_CODEC2)
-
-#
-# Find or build portaudio Library
-#
-if(NOT USE_STATIC_PORTAUDIO)
-    message(STATUS "Looking for portaudio...")
-    find_package(Portaudio REQUIRED)
-    if(PORTAUDIO_FOUND)
-        message(STATUS "  portaudio library: ${PORTAUDIO_LIBRARIES}")
-        message(STATUS "  portaudio headers: ${PORTAUDIO_INCLUDE_DIRS}")
-        list(APPEND FREEDV_LINK_LIBS ${PORTAUDIO_LIBRARIES})
-        include_directories(${PORTAUDIO_INCLUDE_DIRS})
-    else()
-        message(FATAL_ERROR "portaudio library not found.
-On Linux systems try installing:
-    portaudio-devel  (RPM based systems)
-    libportaudio-dev (DEB based systems)
-On Windows it's easiest to use the cmake option: USE_STATIC_PORTAUDIO"
-        )
-    endif()
-    if(NOT ${PORTAUDIO_VERSION} EQUAL 19)
-        message(WARNING "Portaudio versions other than 19 are known to have issues. You have been warned!")
-    endif()
-else(NOT USE_STATIC_PORTAUDIO)
-    message(STATUS "Will attempt static build of portaudio.")
-    include(cmake/BuildPortaudio.cmake)
-endif(NOT USE_STATIC_PORTAUDIO)
-
-#
-# Hamlib library
-#
-message(STATUS "Looking for hamlib...")
-find_path(HAMLIB_INCLUDE_DIR hamlib/rig.h)
-find_library(HAMLIB_LIBRARY hamlib)
-message(STATUS "Hamlib library: ${HAMLIB_LIBRARY}")
-message(STATUS "Hamlib headers: ${HAMLIB_INCLUDE_DIR}")
-if(HAMLIB_LIBRARY AND HAMLIB_INCLUDE_DIR)
-    message(STATUS "Hamlib library found.")
-    include_directories(${HAMLIB_INCLUDE_DIR})
-    list(APPEND FREEDV_LINK_LIBS ${HAMLIB_LIBRARY})
-else(HAMLIB_LIBRARY AND HAMLIB_INCLUDE_DIR)
-    message(FATAL_ERROR "hamlib not found.
-On Linux systems try installing:
-    hamlib-devel  (RPM based systems)
-    libhamlib-dev (DEB based systems)"
-    )
-endif(HAMLIB_LIBRARY AND HAMLIB_INCLUDE_DIR)
-
-
-#
-# Samplerate Library
-#
-if(NOT USE_STATIC_SAMPLERATE)
-    message(STATUS "Looking for samplerate...")
-    find_library(LIBSAMPLERATE samplerate)
-    find_path(LIBSAMPLERATE_INCLUDE_DIR samplerate.h)
-    message(STATUS "  samplerate library: ${LIBSAMPLERATE}")
-    message(STATUS "  samplerate headers: ${LIBSAMPLERATE_INCLUDE_DIR}")
-    if(LIBSAMPLERATE AND LIBSAMPLERATE_INCLUDE_DIR)
-        list(APPEND FREEDV_LINK_LIBS ${LIBSAMPLERATE})
-        include_directories(${LIBSAMPLERATE_INCLUDE_DIR})
-    else(LIBSTAMPLERATE AND LIBSAMPLERATE_INCLUDE_DIR)
-        message(FATAL_ERROR "samplerate library not found.
-On Linux systems try installing:
-    samplerate-devel  (RPM based systems)
-    libsamplerate-dev (DEB based systems)
-On Windows it's easiest to use the cmake option: USE_STATIC_SAMPLERATE"
-        )
-    endif(LIBSAMPLERATE AND LIBSAMPLERATE_INCLUDE_DIR)
-else(NOT USE_STATIC_SAMPLERATE)
-    message(STATUS "Will attempt static build of samplerate.")
-    include(cmake/BuildSamplerate.cmake)
-endif(NOT USE_STATIC_SAMPLERATE)
-
-#
-# Find sox library
-#
-if(NOT USE_STATIC_SOX)
-    message(STATUS "Looking for sox...")
-    find_library(LIBSOX_LIBRARY sox)
-    find_path(LIBSOX_INCLUDE_DIR NAMES sox/sox.h sox.h)
-    message(STATUS "  sox library: ${LIBSOX_LIBRARY}")
-    message(STATUS "  sox headers: ${LIBSOX_INCLUDE_DIR}")
-    if(LIBSOX_LIBRARY AND LIBSOX_INCLUDE_DIR)
-        list(APPEND FREEDV_LINK_LIBS ${LIBSOX_LIBRARY})
-        include_directories(${LIBSOX_INCLUDE_DIR})
-    else(LIBSOX_LIBRARY AND LIBSOX_INCLUDE_DIR)
-        message(FATAL_ERROR "sox library not found.
-On Linux systems try installing:
-    sox-devel (RPM based systems)
-    libsox-dev (DEB based systems)
-On Windows it's easiest to use the cmake option: USE_STATIC_SOX"
-        )
-    endif(LIBSOX_LIBRARY AND LIBSOX_INCLUDE_DIR)
-else(NOT USE_STATIC_SOX)
-    message(STATUS "Will attempt static build of sox.")
-    include(cmake/BuildSox.cmake)
-endif(NOT USE_STATIC_SOX)
-
-#    
-# sndfile Library
-#
-if(NOT USE_STATIC_SNDFILE)
-    message(STATUS "Looking for sndfile...")
-    find_library(LIBSNDFILE sndfile)
-    find_path(LIBSNDFILE_INCLUDE_DIR sndfile.h)
-    message(STATUS "  sndfile library: ${LIBSNDFILE}")
-    message(STATUS "  sndfile headers: ${LIBSNDFILE_INCLUDE_DIR}")
-    if(LIBSNDFILE AND LIBSNDFILE_INCLUDE_DIR)
-        list(APPEND FREEDV_LINK_LIBS ${LIBSNDFILE})
-    else(LIBSNDFILE AND LIBSNDFILE_INCLUDE_DIR)
-        message(FATAL_ERROR "sndfile library not found.
-On Linux systems try installing:
-    libsndfile-devel (RPM based systems)
-    libsndfile-dev   (DEB based systems)
-On Windows it's easiest to use the cmake option: USE_STATIC_SNDFILE"
-        )
-    endif(LIBSNDFILE AND LIBSNDFILE_INCLUDE_DIR)
-else(NOT USE_STATIC_SNDFILE)
-    message(STATUS "Will attempt static build of sndfile.")
-    include(cmake/BuildSndfile.cmake)
-endif(NOT USE_STATIC_SNDFILE)
-
-#
-# Find wxWidgets
-#
-if(NOT BOOTSTRAP_WXWIDGETS)
-    set(WXCONFIG "" CACHE FILEPATH "Location of wx-config binary.")
-    set(WXRC "" CACHE FILEPATH "Location of wxrc binary.")
-endif(NOT BOOTSTRAP_WXWIDGETS)
-#if(BOOTSTRAP_WXWIDGETS)
-#    set(WXCONFIG "${CMAKE_BINARY_DIR}/external/dist/bin/wx-config")
-#    set(WXRC "${CMAKE_BINARY_DIR}/external/dist/bin/wxrc")
-#    list(APPEND FREEDV_STATIC_DEPS wxWidgets)
-#endif(BOOTSTRAP_WXWIDGETS)
-message(STATUS "Looking for wxWidgets...")
-if(WXCONFIG)
-    message(STATUS "wx-config: ${WXCONFIG}")
-    set(wxWidgets_CONFIG_EXECUTABLE ${WXCONFIG})
-endif(WXCONFIG)
-if(WXRC)
-    message(STATUS "wxrc: ${WXRC}")
-    set(wxWidgets_wxrc_EXECUTABLE ${WXRC})
-endif(WXRC)
-set(WX_VERSION_MIN 3.0.0)
-find_package(wxWidgets REQUIRED core base aui html net adv)
-execute_process(COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}" --version
-    OUTPUT_VARIABLE WX_VERSION)
-string(STRIP ${WX_VERSION} WX_VERSION)
-if(WX_VERSION VERSION_EQUAL ${WX_VERSION_MIN}
-    OR WX_VERSION VERSION_GREATER ${WX_VERSION_MIN})
-   message(STATUS "wxWidgets version: ${WX_VERSION}")
-else()
-    message(FATAL_ERROR "wxWidgets must be installed on your system.
-Please check that wx-config is in path, the directory
-where wxWidgets libraries are installed (returned by
-'wx-config --libs' or 'wx-config --static --libs' command)
-is in LD_LIBRARY_PATH or equivalent variable and
-wxWidgets version is ${WX_VERSION_MIN} or above.")
-endif()
-if(wxWidgets_FOUND)
-    include("${wxWidgets_USE_FILE}")
-    list(APPEND FREEDV_LINK_LIBS ${wxWidgets_LIBRARIES})
-endif(wxWidgets_FOUND)
-
-#
-# Find speex library
-#
-if(NOT USE_STATIC_SPEEXDSP)
-    message(STATUS "Looking for Speex DSP library.")
-    find_path(SPEEXDSP_INCLUDE_DIR speex/speex.h)
-    find_library(SPEEXDSP_LIBRARY speexdsp)
-    message(STATUS "  Speex DSP headers: ${SPEEXDSP_INCLUDE_DIR}")
-    message(STATUS "  Speex DSP library: ${SPEEXDSP_LIBRARY}")
-    if(SPEEXDSP_INCLUDE_DIR AND SPEEXDSP_LIBRARY)
-        include_directories(${SPEEXDSP_INCLUDE_DIR})
-        list(APPEND FREEDV_LINK_LIBS ${SPEEXDSP_LIBRARY})
-    else(SPEEXDSP_INCLUDE_DIR AND SPEEXDSP_LIBRARY)
-        message(FATAL_ERROR "Speex DSP library not found!")
-    endif(SPEEXDSP_INCLUDE_DIR AND SPEEXDSP_LIBRARY)
-else()
-    message(STATUS "Will attempt static build of speex.")
-    include(cmake/BuildSpeex.cmake)
-endif()
-    
-#Freedv 
-add_subdirectory(src)
-
-# Icons and desktop file
-add_subdirectory(contrib)
-
-message(STATUS "Build type will be: ${CMAKE_BUILD_TYPE}")
-
-#
-# Cpack NSIS configuration for Windows.
-#
-if(WIN32)
-    # Detect if we're doing a 32-bit or 64-bit windows build.
-    if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
-        set(CMAKE_CL_64 TRUE)
-    endif()
-    if(NOT ${CMAKE_BUILD_TYPE} STREQUAL "Debug")
-        set(CPACK_STRIP_FILES TRUE)
-    endif()
-    configure_file(cmake/GetDependencies.cmake.in cmake/GetDependencies.cmake
-        @ONLY
-    )
-    install(SCRIPT ${CMAKE_BINARY_DIR}/cmake/GetDependencies.cmake)
-    set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "HF Digital Voice for Radio Amateurs")
-    set(CPACK_PACKAGE_VENDOR "CMake")
-    #set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
-    set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
-    set(CPACK_PACKAGE_VERSION_MAJOR ${FREEDV_VERSION_MAJOR})
-    set(CPACK_PACKAGE_VERSION_MINOR ${FREEDV_VERSION_MINOR})
-    # CPack expects a patch level version so set it here and override if we
-    # are actually setting one.
-    set(CPACK_PACKAGE_VERSION_PATCH 0)
-    if(FREEDV_VERSION_PATCH)
-        set(CPACK_PACKAGE_VERSION_PATCH ${FREEDV_VERSION_PATCH})
-    endif()
-    if(FREEDV_VERSION_SUFFIX)
-        set(CPACK_PACKAGE_VERSION_PATCH "${CPACK_PACKAGE_VERSION_PATCH}-${FREEDV_VERSION_SUFFIX}")
-    endif()
-    # There is a bug in NSI that does not handle full unix paths properly. Make
-    # sure there is at least one set of four (4) backlasshes.
-    #set(CPACK_PACKAGE_ICON "${CMake_SOURCE_DIR}/Utilities/Release\\\\InstallIcon.bmp")
-    set(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\freedv.exe")
-    set(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}")
-    set(CPACK_NSIS_PACKAGE_NAME "FreeDV")
-    set(CPACK_NSIS_URL_INFO_ABOUT "http://freedv.org")
-    set(CPACK_NSIS_MODIFY_PATH OFF)
-    set(CPACK_NSIS_MENU_LINKS "http://freedv.org" "FreeDV Homepage")
-    include(CPack)
-endif(WIN32)
-
-endif(BOOTSTRAP_WXWIDGETS AND NOT EXISTS ${WXCONFIG})
diff --git a/fdmdv2-dev/COPYING b/fdmdv2-dev/COPYING
deleted file mode 100644 (file)
index cfd4e99..0000000
+++ /dev/null
@@ -1,502 +0,0 @@
-                  GNU LESSER GENERAL PUBLIC LICENSE
-                       Version 2.1, February 1999
-
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.
- 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the Lesser GPL.  It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
-                            Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
-  This license, the Lesser General Public License, applies to some
-specially designated software packages--typically libraries--of the
-Free Software Foundation and other authors who decide to use it.  You
-can use it too, but we suggest you first think carefully about whether
-this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations below.
-
-  When we speak of free software, we are referring to freedom of use,
-not price.  Our General Public Licenses are designed to make sure that
-you have the freedom to distribute copies of free software (and charge
-for this service if you wish); that you receive source code or can get
-it if you want it; that you can change the software and use pieces of
-it in new free programs; and that you are informed that you can do
-these things.
-
-  To protect your rights, we need to make restrictions that forbid
-distributors to deny you these rights or to ask you to surrender these
-rights.  These restrictions translate to certain responsibilities for
-you if you distribute copies of the library or if you modify it.
-
-  For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you.  You must make sure that they, too, receive or can get the source
-code.  If you link other code with the library, you must provide
-complete object files to the recipients, so that they can relink them
-with the library after making changes to the library and recompiling
-it.  And you must show them these terms so they know their rights.
-
-  We protect your rights with a two-step method: (1) we copyright the
-library, and (2) we offer you this license, which gives you legal
-permission to copy, distribute and/or modify the library.
-
-  To protect each distributor, we want to make it very clear that
-there is no warranty for the free library.  Also, if the library is
-modified by someone else and passed on, the recipients should know
-that what they have is not the original version, so that the original
-author's reputation will not be affected by problems that might be
-introduced by others.
-\f
-  Finally, software patents pose a constant threat to the existence of
-any free program.  We wish to make sure that a company cannot
-effectively restrict the users of a free program by obtaining a
-restrictive license from a patent holder.  Therefore, we insist that
-any patent license obtained for a version of the library must be
-consistent with the full freedom of use specified in this license.
-
-  Most GNU software, including some libraries, is covered by the
-ordinary GNU General Public License.  This license, the GNU Lesser
-General Public License, applies to certain designated libraries, and
-is quite different from the ordinary General Public License.  We use
-this license for certain libraries in order to permit linking those
-libraries into non-free programs.
-
-  When a program is linked with a library, whether statically or using
-a shared library, the combination of the two is legally speaking a
-combined work, a derivative of the original library.  The ordinary
-General Public License therefore permits such linking only if the
-entire combination fits its criteria of freedom.  The Lesser General
-Public License permits more lax criteria for linking other code with
-the library.
-
-  We call this license the "Lesser" General Public License because it
-does Less to protect the user's freedom than the ordinary General
-Public License.  It also provides other free software developers Less
-of an advantage over competing non-free programs.  These disadvantages
-are the reason we use the ordinary General Public License for many
-libraries.  However, the Lesser license provides advantages in certain
-special circumstances.
-
-  For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it becomes
-a de-facto standard.  To achieve this, non-free programs must be
-allowed to use the library.  A more frequent case is that a free
-library does the same job as widely used non-free libraries.  In this
-case, there is little to gain by limiting the free library to free
-software only, so we use the Lesser General Public License.
-
-  In other cases, permission to use a particular library in non-free
-programs enables a greater number of people to use a large body of
-free software.  For example, permission to use the GNU C Library in
-non-free programs enables many more people to use the whole GNU
-operating system, as well as its variant, the GNU/Linux operating
-system.
-
-  Although the Lesser General Public License is Less protective of the
-users' freedom, it does ensure that the user of a program that is
-linked with the Library has the freedom and the wherewithal to run
-that program using a modified version of the Library.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.  Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library".  The
-former contains code derived from the library, whereas the latter must
-be combined with the library in order to run.
-\f
-                  GNU LESSER GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License Agreement applies to any software library or other
-program which contains a notice placed by the copyright holder or
-other authorized party saying it may be distributed under the terms of
-this Lesser General Public License (also called "this License").
-Each licensee is addressed as "you".
-
-  A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
-  The "Library", below, refers to any such software library or work
-which has been distributed under these terms.  A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language.  (Hereinafter, translation is
-included without limitation in the term "modification".)
-
-  "Source code" for a work means the preferred form of the work for
-making modifications to it.  For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
-  Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it).  Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-
-  1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
-  You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-\f
-  2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) The modified work must itself be a software library.
-
-    b) You must cause the files modified to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    c) You must cause the whole of the work to be licensed at no
-    charge to all third parties under the terms of this License.
-
-    d) If a facility in the modified Library refers to a function or a
-    table of data to be supplied by an application program that uses
-    the facility, other than as an argument passed when the facility
-    is invoked, then you must make a good faith effort to ensure that,
-    in the event an application does not supply such function or
-    table, the facility still operates, and performs whatever part of
-    its purpose remains meaningful.
-
-    (For example, a function in a library to compute square roots has
-    a purpose that is entirely well-defined independent of the
-    application.  Therefore, Subsection 2d requires that any
-    application-supplied function or table used by this function must
-    be optional: if the application does not supply it, the square
-    root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library.  To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License.  (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.)  Do not make any other change in
-these notices.
-\f
-  Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
-  This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
-  4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
-  If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-  5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library".  Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
-  However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library".  The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
-  When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library.  The
-threshold for this to be true is not precisely defined by law.
-
-  If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work.  (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
-  Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-\f
-  6. As an exception to the Sections above, you may also combine or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
-  You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License.  You must supply a copy of this License.  If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License.  Also, you must do one
-of these things:
-
-    a) Accompany the work with the complete corresponding
-    machine-readable source code for the Library including whatever
-    changes were used in the work (which must be distributed under
-    Sections 1 and 2 above); and, if the work is an executable linked
-    with the Library, with the complete machine-readable "work that
-    uses the Library", as object code and/or source code, so that the
-    user can modify the Library and then relink to produce a modified
-    executable containing the modified Library.  (It is understood
-    that the user who changes the contents of definitions files in the
-    Library will not necessarily be able to recompile the application
-    to use the modified definitions.)
-
-    b) Use a suitable shared library mechanism for linking with the
-    Library.  A suitable mechanism is one that (1) uses at run time a
-    copy of the library already present on the user's computer system,
-    rather than copying library functions into the executable, and (2)
-    will operate properly with a modified version of the library, if
-    the user installs one, as long as the modified version is
-    interface-compatible with the version that the work was made with.
-
-    c) Accompany the work with a written offer, valid for at
-    least three years, to give the same user the materials
-    specified in Subsection 6a, above, for a charge no more
-    than the cost of performing this distribution.
-
-    d) If distribution of the work is made by offering access to copy
-    from a designated place, offer equivalent access to copy the above
-    specified materials from the same place.
-
-    e) Verify that the user has already received a copy of these
-    materials or that you have already sent this user a copy.
-
-  For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it.  However, as a special exception,
-the materials to be distributed need not include anything that is
-normally distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
-  It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system.  Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-\f
-  7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
-    a) Accompany the combined library with a copy of the same work
-    based on the Library, uncombined with any other library
-    facilities.  This must be distributed under the terms of the
-    Sections above.
-
-    b) Give prominent notice with the combined library of the fact
-    that part of it is a work based on the Library, and explaining
-    where to find the accompanying uncombined form of the same work.
-
-  8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License.  Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License.  However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
-  9. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Library or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
-  10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties with
-this License.
-\f
-  11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-  12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License may add
-an explicit geographical distribution limitation excluding those countries,
-so that distribution is permitted only in or among countries not thus
-excluded.  In such case, this License incorporates the limitation as if
-written in the body of this License.
-
-  13. The Free Software Foundation may publish revised and/or new
-versions of the Lesser General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation.  If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-\f
-  14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission.  For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this.  Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
-                            NO WARRANTY
-
-  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
-                     END OF TERMS AND CONDITIONS
-\f
-           How to Apply These Terms to Your New Libraries
-
-  If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change.  You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
-  To apply these terms, attach the following notices to the library.  It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the library's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library 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
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, see
-    <http://www.gnu.org/licenses/>.
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the
-  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
-  <signature of Ty Coon>, 1 April 1990
-  Ty Coon, President of Vice
-
-That's all there is to it!
diff --git a/fdmdv2-dev/README.txt b/fdmdv2-dev/README.txt
deleted file mode 100644 (file)
index c844400..0000000
+++ /dev/null
@@ -1,275 +0,0 @@
-==================================
- Building and installing on Linux
-==================================
-
-Quickstart 1
------------
-
-Builds static versions of wxWidgets, portaudio, codec2-dev, which are commonly
-missing on many Linux systems, or of the wrong (older) version.
-
-1/ Assuming the fdmdv2-dev source is checked out into ~/fdmdv2-dev:
-
-  $ sudo apt-get install libgtk2.0-dev libhamlib-dev libsamplerate-dev libasound2-dev libao-dev libgsm1-dev
-  $ cd fdmdv2-dev
-  $ mkdir build_linux
-  $ cd build_linux
-  $ cmake -DBOOTSTRAP_WXWIDGETS=TRUE ~/fdmdv2-dev
-  $ make
-
-2/ Then you can configure FreeDV using your local codec-dev, something like:
-
-  $ cmake -DCMAKE_BUILD_TYPE=Debug -DBOOTSTRAP_WXWIDGETS=TRUE -DCODEC2_INCLUDE_DIRS=/path/to/codec2-dev/src -DCODEC2_LIBRARY=/path/to/codec2-dev/build_linux/src/libcodec2.so -DUSE_STATIC_CODEC2=FALSE -DUSE_STATIC_PORTAUDIO=TRUE -DUSE_STATIC_SOX=TRUE ../
-
-3/ OR build a local copy of codec2-dev:
-
-  $ cmake -DBOOTSTRAP_WXWIDGETS=TRUE -DUSE_STATIC_CODEC2=TRUE -DUSE_STATIC_PORTAUDIO=TRUE -DUSE_STATIC_SOX=TRUE ../
-  
-4/ Build and run FreeDV:
-
-   $ make
-   $ ./src/freedv
-
-Quickstart 2
-------------
-
-1/ Assuming you have all the dependant libraries:
-
-  $ cd /path/to/fdmdv2
-  $ mkdir build_linux
-  $ cd build_linux
-  $ cmake ../ (defaults to /usr/local, use CMAKE_INSTALL_PREFIX to override)
-  (if no errors)
-  $ make
-  (as root)
-  $ make install
-
-
-=======================================================
- Building for Windows on Ubuntu Linux (Cross compiling)
-=======================================================
-
-1/ Install the cross compiling toolchain:
-
-  $ sudo apt-get install mingw-w64
-
-2/ Patch cmake using: http://www.cmake.org/gitweb?p=stage/cmake.git;a=patch;h=33286235048495ceafb636d549d9a4e8891967ae
-
-3/ Checkout a fresh copy of codec2-dev and build for Windows, pointing to the generate_codebook built by a linux build of generate_codebook, using this cmake line
-
-  $ cmake .. -DCMAKE_TOOLCHAIN_FILE=../fdmdv2-dev/cmake/Toolchain-Ubuntu-mingw32.cmake -DUNITTEST=FALSE -DGENERATE_CODEBOOK=/home/david/codec2-dev/build_linux/src/generate_codebook 
-
-4/ Build WxWidgets
-
-  $ cd /path/to/fdmdv2-dev
-  $ mkdir build_windows
-  $ cd build_windows
-  $ cmake -DBOOTSTRAP_WXWIDGETS=TRUE .. -DCMAKE_TOOLCHAIN_FILE=cmake/Toolchain-Ubuntu-mingw32.cmake -DCMAKE_BUILD_TYPE=Debug
-  $ make
-
-5/ Download and install the Windows version of Hamlib:
-
-  $ wget http://internode.dl.sourceforge.net/project/hamlib/hamlib/1.2.15.3/hamlib-win32-1.2.15.3.zip
-  $ unzip hamlib-win32-1.2.15.3.zip
-
-6/ Build All the libraries and FreeDV:
-
-  $ cmake -DBOOTSTRAP_WXWIDGETS=TRUE -DCMAKE_TOOLCHAIN_FILE=cmake/Toolchain-Ubuntu-mingw32.cmake -DUSE_STATIC_PORTAUDIO=TRUE -DUSE_STATIC_SNDFILE=TRUE -DUSE_STATIC_SAMPLERATE=TRUE -DUSE_STATIC_SOX=TRUE -DUSE_STATIC_CODEC2=FALSE -DCODEC2_INCLUDE_DIRS=/home/david/tmp/codec2-dev/src -DCODEC2_LIBRARY=/home/david/tmp/codec2-dev/build_windows/src/libcodec2.dll.a -DHAMLIB_INCLUDE_DIR=hamlib-win32-1.2.15.3/include -DHAMLIB_LIBRARY=hamlib-win32-1.2.15.3/lib/gcc/libhamlib.dll.a -DCMAKE_BUILD_TYPE=Debug ..
-  $ make
-
-====================================
- Building and installing on Windows
-====================================
-
-The windows build is similar to linux and follows the same basic workflow,
-however, while codec2 and FreeDV (fdmdv2) build well on windows, some of the
-dependencies do not. For that reson current windows releases are cross-compiled
-from linux.
-
-Only MinGW is supported. While it is likely possible to perform a pure MinGW
-build, installing MSYS2 will make your life easier.
-
-CMake may not automatically detect that you're in the MSYS environment. If this
-occurs you need to pass cmake the proper generator:
-
-cmake -G"MSYS Makefiles" [other options] </path/to/source>
-
-===============================
- Bootstrapping wxWidgets build
-===============================
-
-If wxWidgets (>= 3.0) is not available then one option is to have CMake boot-
-strap the build for FreeDV.
-
-This is required because the tool wx-config is used to get the correct compiler
-and linker flags of the wxWidgets components needed by FreeDV. Since this is
-normally done at configure time, not during "make", it is not possible for CMake
-or have this information prior to building wxWidgets.
-
-In order to work around this issue you can "bootstrap" the wxWidgets build using
-the CMake option, "BOOTSTRAP_WXWIDGETS". wxWidgets will be built using static
-libraries.
-
-NOTE: This forces "USE_STATIC_WXWIDGETS" to be true internally regarless of the
-value set manually.
-
-(from any directory, but empty directory outside of the source is prefered.)
-$ cmake -DBOOTSTRAP_WXWIDGETS=TRUE /path/to/fdmdv2
-$ make
-(wxWidgets is downloaded and built)
-$ cmake .
-(wxWidgets build should be detected)
-$ make
-(if all goes well, as root)
-$ make install
-
-====================================
- Building and installing on OSX
-====================================
-
-====================================
- Building and installing on FreeBSD
-====================================
-
-As per "Quickstart 2" above but change build_linux to build_freebsd
-
-=======
-Editing
-=======
-
-Please make sure your text editor does not insert tabs, and
-used indents of 4 spaces.  The following .emacs code was used to
-configure emacs:
-
-(setq-default indent-tabs-mode nil)
-
-(add-hook 'c-mode-common-hook
-          (function (lambda ()
-                      (setq c-basic-offset 4)
-                      )))
-
-====
-TODO
-====
-
-[ ] Open R&D questions
-    + Goal is to develop an open source DV mode that performs comparably to SSB
-    [ ] Does 700 perform OK next to SSB?
-        + approx same tx pk level (hard to measure exactly)
-        + try some low SNR channels
-        + try some fast fading/nasty channels
-    [ ] Is 700 speech quality acceptable?
-
-[X] test frames 
-    [X] freedv API support
-    [X] BER displayed on GUI for 700 and 1600
-    [X] plot error patterns for 700 and 1600
-        + callback for error patterns, or poll via stats interface
-    [X] plot error histograms for 700 and 1600
-        + map bit error to carrier, have done this in tcohpsk?
-        + how to reset histogram?  On error reset?
-        + histogram screen ... new code?
-        + test with filter
-
-[X] Bugs
-    [X] resync issue
-    [X] equalise power on 700 and 1600
-    [X] research real and complex PAPR
-    [X] waterfall and spectrum in analog mode
-    [X] The waterfall in analog mode appears to quit working sometimes?
-
-    [X] On TX, intermittently PTT will cause signal to be heard in speakers.  Toggle PTT or 
-        Stop/Start toggle and then starts working.
-    [X] Squelch control on 1600 mode will not open up squelch to 0 (appears to be around 2 dB)
-    [X] space bar keys PTT when entering text info box
-    [X] checksum based txt reception
-        + only print if valid
-    [X] IC7200 audio breakup
-    [ ] short varicode doesn't work
-        + #ifdef-ed out for now
-        + cld be broken in freedv_api
-    [X] On 700 audio sounds tinny and clicky when out of sync compared to 1600 why?
-        + clue: only when analog not pressed
-        + this was 7.5 to 8kHz interpolator bug
-    [X] spectrum and waterfall scale changes when analog pressed
-    [X] ocassional test frames error counter goes crazy
-    [ ] old Waterfall AGC
-    [ ] 700 syncs up to 1000Hz sine waves
-        + shouldn't trigger sync logic, will be a problem with carriers
-    [ ] "clip" led, encourage people to adjust gain to hit that occ when speaking
-    [ ] Win32 record from radio time
-
-[ ] FreeDV 700 improvements
-    [ ] bpf filter after clipping to remove clicks
-        [ ] tcohpsk first, measure PAPR, impl loss
-    [ ] error masking
-        [ ] C version
-        [ ] training off air?  Switchable?
-        [ ] excitation params
-        [ ] training
-    [ ] plotting other demod stats like ch ampl and phase ests
-    [ ] profile with perf, different libresample routine
-    [ ] check for occassional freedv 700 loss of sync
-        + scatter seems to jump
-    [ ] switchable diversity (narrowband) option
-        + measure difference on a few channels
-        + blog
-
-[X] win32
-    [X] X-compile works
-    [X] basic installer
-    [X] Win32 installer
-        + Richard has taken care of this
-
-[ ] Small fixes
-    [X] Playfile bug
-    [X] running again
-    [X] bump ver number
-    [X] long varicode default
-    [X] option to _not_ require checksum, on by default
-    [X] default squelch 2dB
-    [X] scatter diagram tweaks
-        + e.g. meaningful plots on fading channels in real time 
-        [X] agc with hysteresis
-            + changed to log steps
-        [X] longer persistance
-            + changed to 6 seconds
-        [X] diversity addtions on 700
-            + still not real obvious on plot
-            + might be useful to make this switchable
-    [X] scatter diagram different colours/carrier
-    [X] remember what mode you were in
-    [ ] cmd line file decode
-    [ ] Waterfall direction
-    [ ] documentation or use, walk through, you tube, blog posts
-
-[ ] Web support for Presence/spotting hooks
-
-=================
-USER GUIDE NOTES
-=================
-
-TODO: Put this in a more usable form, video tutorials etc
-
-1/ Error Histogram.  Displays BER of each carrier when in "test frame"
- mode.  As each QPSK carrier has 2 bits there are 2*Nc histogram
- points.
-
- Ideally all carriers will have about the same BER (+/- 20% after 5000
- total bit errors).  However problems can occur with filtering in the
- tx path.  If one carrier has less power, then it will have a higher
- BER.  The errors in this carrier will tend to dominate overall
- BER. For example if one carrier is attenuated due to SSB filter
- ripple in the tx path then the BER on that carrier will be higher.
- This is bad news for DV.
-
- Suggested usage: Transmit FreeDV in test frame mode.  Use a 2nd rx
- (or get a friend) to monitor your rx signal with FreeDV in test frame
- mode.  Adjust your rx SNR to get a BER of a few % (e.g. reduce tx power,
- use a short antenna for the rx, point your beam away, adjust rx RF
- gain).  Monitor the error histogram for a few minutes, until you have
- say 5000 total bit errors.  You have a problem if the BER of any
- carrier is more than 20% different from the rest.
-
-  A typical issue will be one carrier at 1.0, the others at 0.5,
-  indicating the poorer carrier BER is twice the larger.
diff --git a/fdmdv2-dev/cmake/BuildCodec2.cmake b/fdmdv2-dev/cmake/BuildCodec2.cmake
deleted file mode 100644 (file)
index 471eef8..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-set(SPEEXDSP_CMAKE_ARGS -DBUILD_SHARED_LIBS=FALSE -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/external/dist)
-
-if(USE_STATIC_SPEEXDSP)
-    list(APPEND SPEEXDSP_CMAKE_ARGS 
-        -DSPEEXDSP_LIBRARIES=${CMAKE_BINARY_DIR}/external/dist/lib/libspeexdsp.a
-        -DSPEEXDSP_INCLUDE_DIR=${CMAKE_BINARY_DIR}/external/dist/include)
-endif()
-
-if(CMAKE_CROSSCOMPILING)
-    set(CODEC2_CMAKE_ARGS "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
-endif()
-
-include(ExternalProject)
-ExternalProject_Add(codec2
-   SVN_REPOSITORY https://svn.code.sf.net/p/freetel/code/codec2-dev
-   CMAKE_ARGS ${CODEC2_CMAKE_ARGS} ${SPEEXDSP_CMAKE_ARGS}
-   INSTALL_COMMAND ""
-)
-set(CODEC2_LIBRARIES
-    ${CMAKE_BINARY_DIR}/codec2-prefix/src/codec2-build/src/libcodec2.a)
-include_directories(${CMAKE_BINARY_DIR}/codec2-prefix/src/codec2/src)
-list(APPEND FREEDV_LINK_LIBS ${CODEC2_LIBRARIES})
-list(APPEND FREEDV_STATIC_DEPS codec2)
diff --git a/fdmdv2-dev/cmake/BuildPortaudio.cmake b/fdmdv2-dev/cmake/BuildPortaudio.cmake
deleted file mode 100644 (file)
index cc33d06..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-set(PORTAUDIO_TARBALL "pa_stable_v19_20111121")
-
-# required linking libraries on linux. Not sure about windows.
-find_library(ALSA_LIBRARIES asound)
-
-if(UNIX AND NOT ALSA_LIBRARIES)
-    message(ERROR "Could not find alsa library which is required for portaudio.
-On Linux systems try installing:
-    alsa-lib-devel  (RPM based systems)
-    libasound2-dev  (DEB based systems)"
-    )
-endif()
-
-# Make sure that configure knows what system we're using when cross-compiling.
-if(MINGW AND CMAKE_CROSSCOMPILING)
-    include(cmake/MinGW.cmake)
-    set(CONFIGURE_COMMAND ./configure --build=${HOST} --host=${HOST} --target=${HOST} --enable-cxx --without-jack --disable-shared --prefix=${CMAKE_BINARY_DIR}/external/dist)
-else()
-    set(CONFIGURE_COMMAND ./configure --enable-cxx --without-jack --disable-shared --prefix=${CMAKE_BINARY_DIR}/external/dist)
-endif()
-
-include(ExternalProject)
-ExternalProject_Add(portaudio
-    URL http://www.portaudio.com/archives/${PORTAUDIO_TARBALL}.tgz
-    BUILD_IN_SOURCE 1
-    INSTALL_DIR external/dist
-    CONFIGURE_COMMAND ${CONFIGURE_COMMAND}
-    BUILD_COMMAND $(MAKE)
-    INSTALL_COMMAND $(MAKE) install
-)
-if(WIN32)
-    set(PORTAUDIO_LIBRARIES 
-        ${CMAKE_BINARY_DIR}/external/dist/lib/libportaudio.a
-        ${CMAKE_BINARY_DIR}/external/dist/lib/libportaudiocpp.a
-)
-else(WIN32)
-    find_library(RT rt)
-    find_library(ASOUND asound)
-    set(PORTAUDIO_LIBRARIES
-        ${CMAKE_BINARY_DIR}/external/dist/lib/libportaudio.a
-        ${CMAKE_BINARY_DIR}/external/dist/lib/libportaudiocpp.a
-        ${RT}
-        ${ASOUND}
-    )
-endif(WIN32)
-include_directories(${CMAKE_BINARY_DIR}/external/dist/include)
-
-# Add the portaudio library to the list of libraries that must be linked.
-list(APPEND FREEDV_LINK_LIBS ${PORTAUDIO_LIBRARIES})
-
-# Setup a dependency so that this gets built before linking to freedv.
-list(APPEND FREEDV_STATIC_DEPS portaudio)
diff --git a/fdmdv2-dev/cmake/BuildSamplerate.cmake b/fdmdv2-dev/cmake/BuildSamplerate.cmake
deleted file mode 100644 (file)
index aa09f85..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-set(SAMPLERATE_TARBALL "libsamplerate-0.1.8")
-
-if(MINGW AND CMAKE_CROSSCOMPILING)
-    set(CONFIGURE_COMMAND ./configure --build=${HOST} --host=${HOST} --target=${HOST} --prefix=${CMAKE_BINARY_DIR}/external/dist --disable-sndfile)
-else()
-    set(CONFIGURE_COMMAND ./configure --prefix=${CMAKE_BINARY_DIR}/external/dist)
-endif()
-
-include(ExternalProject)
-ExternalProject_Add(samplerate
-    URL http://www.mega-nerd.com/SRC/${SAMPLERATE_TARBALL}.tar.gz 
-    BUILD_IN_SOURCE 1
-    INSTALL_DIR external/dist
-    CONFIGURE_COMMAND ${CONFIGURE_COMMAND}
-    BUILD_COMMAND $(MAKE)
-    INSTALL_COMMAND $(MAKE) install
-)
-if(WIN32)
-    set(SAMPLERATE_LIBRARIES
-        ${CMAKE_BINARY_DIR}/external/dist/lib/libsamplerate.a)
-else(WIN32)
-    set(SAMPLERATE_LIBRARIES
-        ${CMAKE_BINARY_DIR}/external/dist/lib/libsamplerate.a)
-endif(WIN32)
-include_directories(${CMAKE_BINARY_DIR}/external/dist/include)
-list(APPEND FREEDV_LINK_LIBS ${SAMPLERATE_LIBRARIES})
-list(APPEND FREEDV_STATIC_DEPS samplerate)
diff --git a/fdmdv2-dev/cmake/BuildSndfile.cmake b/fdmdv2-dev/cmake/BuildSndfile.cmake
deleted file mode 100644 (file)
index 43233fb..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-set(SNDFILE_TARBALL "libsndfile-1.0.25")
-
-if(MINGW AND CMAKE_CROSSCOMPILING)
-    set(CONFIGURE_COMMAND ./configure --host=${HOST}  --prefix=${CMAKE_BINARY_DIR}/external/dist --disable-external-libs --disable-shared)
-else()
-    set(CONFIGURE_COMMAND ./configure --prefix=${CMAKE_BINARY_DIR}/external/dist --disable-external-libs --disable-shared --disable-external-libs)
-endif()
-
-include(ExternalProject)
-ExternalProject_Add(sndfile
-    URL http://www.mega-nerd.com/libsndfile/files/${SNDFILE_TARBALL}.tar.gz
-    BUILD_IN_SOURCE 1
-    INSTALL_DIR external/dist
-    CONFIGURE_COMMAND ${CONFIGURE_COMMAND}
-    BUILD_COMMAND $(MAKE) V=1
-    INSTALL_COMMAND $(MAKE) install
-)
-if(MINGW)
-    set(SNDFILE_LIBRARIES ${CMAKE_BINARY_DIR}/external/dist/lib/libsndfile.a)
-else()
-    set(SNDFILE_LIBRARIES ${CMAKE_BINARY_DIR}/external/dist/lib/libsndfile.a)
-endif()
-
-include_directories(${CMAKE_BINARY_DIR}/external/dist/include)
-list(APPEND FREEDV_LINK_LIBS ${SNDFILE_LIBRARIES})
-list(APPEND FREEDV_STATIC_DEPS sndfile)
diff --git a/fdmdv2-dev/cmake/BuildSox.cmake b/fdmdv2-dev/cmake/BuildSox.cmake
deleted file mode 100644 (file)
index d54488b..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-set(SOX_TARBALL "sox-14.4.1")
-
-# required linking libraries on linux. Not sure about windows.
-find_library(ALSA_LIBRARIES asound)
-find_library(AO_LIBRARIES ao)
-find_library(GSM_LIBRARIES gsm)
-
-if(UNIX AND NOT ALSA_LIBRARIES)
-    message(ERROR "Could not find alsa library.
-On Linux systems try installing:
-    alsa-lib-devel  (RPM based systems)
-    libasound2-dev  (DEB based systems)"
-    )
-endif(UNIX AND NOT ALSA_LIBRARIES)
-
-if(UNIX AND NOT AO_LIBRARIES)
-    message(ERROR "Could not find libao.
-On Linux systems try installing:
-    libao-devel  (RPM based systems)
-    libao-dev    (DEB based systems)"
-    )
-endif(UNIX AND NOT AO_LIBRARIES)
-
-if(MINGW AND CMAKE_CROSSCOMPILING)
-    set(CONFIGURE_COMMAND ./configure --host=${HOST} --enable-shared=no --without-id3tag --without-png --disable-gomp --with-oggvorbis=no --with-oss=no --with-flac=no --with-amrnb=no --with-amrwb=no --with-mp3=no --with-wavpack=no --disable-dl-sndfile --with-pulseaudio=no --without-magic --with-gsm --prefix=${CMAKE_BINARY_DIR}/external/dist)
-else()
-    set(CONFIGURE_COMMAND ./configure --enable-shared=no --without-id3tag --without-png --disable-gomp --with-oggvorbis=no --with-oss=no --with-flac=no --with-amrnb=no --with-amrwb=no --with-mp3=no --with-wavpack=no --disable-dl-sndfile --with-pulseaudio=no --without-magic --with-gsm --prefix=${CMAKE_BINARY_DIR}/external/dist)
-endif()
-
-include(ExternalProject)
-ExternalProject_Add(sox
-    URL http://downloads.sourceforge.net/sox/${SOX_TARBALL}.tar.gz
-    BUILD_IN_SOURCE 1
-    INSTALL_DIR external/dist
-    CONFIGURE_COMMAND ${CONFIGURE_COMMAND}
-    BUILD_COMMAND $(MAKE) V=1
-    INSTALL_COMMAND $(MAKE) install
-)
-set(SOX_LIBRARIES ${CMAKE_BINARY_DIR}/external/dist/lib/libsox.a)
-if(UNIX)
-    list(APPEND SOX_LIBRARIES ${ALSA_LIBRARIES} ${AO_LIBRARIES} ${GSM_LIBRARIES})
-endif()
-if(MINGW)
-    list(APPEND SOX_LIBRARIES winmm)
-endif()
-include_directories(${CMAKE_BINARY_DIR}/external/dist/include)
-list(APPEND FREEDV_LINK_LIBS ${SOX_LIBRARIES})
-list(APPEND FREEDV_STATIC_DEPS sox)
diff --git a/fdmdv2-dev/cmake/BuildSpeex.cmake b/fdmdv2-dev/cmake/BuildSpeex.cmake
deleted file mode 100644 (file)
index 262d558..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-set(SPEEXDSP_TARBALL "speexdsp-1.2rc3.tar.gz")
-
-if(MINGW AND CMAKE_CROSSCOMPILING)
-    include(cmake/MinGW.cmake)
-    set(CONFIGURE_COMMAND ./configure --host=${HOST} --prefix=${CMAKE_BINARY_DIR}/external/dist --disable-examples)
-else()
-    set(CONFIGURE_COMMAND ./configure --prefix=${CMAKE_BINARY_DIR}/external/dist --disable-examples)
-endif()
-
-include(ExternalProject)
-ExternalProject_Add(speex
-   URL http://downloads.xiph.org/releases/speex/${SPEEXDSP_TARBALL}
-   BUILD_IN_SOURCE 1
-   INSTALL_DIR external/dist
-   CONFIGURE_COMMAND ${CONFIGURE_COMMAND}
-   BUILD_COMMAND $(MAKE)
-   INSTALL_COMMAND $(MAKE) install
-)
-
-set(SPEEXDSP_LIBRARIES ${CMAKE_BINARY_DIR}/external/dist/lib/libspeexdsp.a)
-include_directories(${CMAKE_BINARY_DIR}/external/dist/include)
-list(APPEND FREEDV_LINK_LIBS ${SPEEXDSP_LIBRARIES})
-list(APPEND FREEDV_STATIC_DEPS speex)
-if(USE_STATIC_CODEC2)
-    add_dependencies(codec2 speex)
-endif()
diff --git a/fdmdv2-dev/cmake/BuildWxWidgets.cmake b/fdmdv2-dev/cmake/BuildWxWidgets.cmake
deleted file mode 100644 (file)
index 901d806..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-set(WXWIDGETS_TARBALL "wxWidgets-3.0.2")
-
-# If we're cross-compiling then we need to set the target host manually.
-if(MINGW AND CMAKE_CROSSCOMPILING)
-    include(cmake/MinGW.cmake)
-endif()
-
-# If not cross-compiling then use the built-in makefile, otherwise use standard configure.
-if(MINGW AND NOT CMAKE_CROSSCOMPILING)
-#    set(CONFIGURE_COMMAND "true")
-#    set(MAKE_COMMAND $(MAKE) -C build/msw -f makefile.gcc SHARED=0 UNICODE=1 BUILD=release PREFIX=${CMAKE_BINARY_DIR}/external/dist)
-    set(CONFIGURE_COMMAND ./configure --disable-shared --prefix=${CMAKE_BINARY_DIR}/external/dist)
-       set(MAKE_COMMAND $(MAKE))
-endif()
-
-if(MINGW AND CMAKE_CROSSCOMPILING)
-    set(CONFIGURE_COMMAND ./configure --build=${HOST} --host=${HOST} --target=${HOST} --disable-shared --prefix=${CMAKE_BINARY_DIR}/external/dist)
-       set(MAKE_COMMAND $(MAKE))
-endif()
-
-if(NOT MINGW)
-    set(CONFIGURE_COMMAND ./configure --host=${HOST} --target=${HOST} --disable-shared --prefix=${CMAKE_BINARY_DIR}/external/dist)
-       set(MAKE_COMMAND $(MAKE))
-endif()
-
-include(ExternalProject)
-ExternalProject_Add(wxWidgets
-    URL http://downloads.sourceforge.net/wxwindows/${WXWIDGETS_TARBALL}.tar.bz2
-    BUILD_IN_SOURCE 1
-    INSTALL_DIR external/dist
-    CONFIGURE_COMMAND ${CONFIGURE_COMMAND}
-    BUILD_COMMAND ${MAKE_COMMAND}
-    INSTALL_COMMAND $(MAKE) install
-)
-
-ExternalProject_Get_Property(wxWidgets install_dir)
-message(STATUS "wxWidgets install dir: ${install_dir}")
-if(NOT WXCONFIG)
-    set(WXCONFIG "${install_dir}/bin/wx-config")
-endif()
-if(EXISTS ${WXCONFIG})
-    set(BS_WX_DONE TRUE)
-endif()
diff --git a/fdmdv2-dev/cmake/FindPortaudio.cmake b/fdmdv2-dev/cmake/FindPortaudio.cmake
deleted file mode 100644 (file)
index 158e20e..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-# - Try to find Portaudio
-# Once done this will define
-#
-#  PORTAUDIO_FOUND - system has Portaudio
-#  PORTAUDIO_INCLUDE_DIRS - the Portaudio include directory
-#  PORTAUDIO_LIBRARIES - Link these to use Portaudio
-#  PORTAUDIO_DEFINITIONS - Compiler switches required for using Portaudio
-#  PORTAUDIO_VERSION - Portaudio version
-#
-#  Copyright (c) 2006 Andreas Schneider <mail@cynapses.org>
-#
-# Redistribution and use is allowed according to the terms of the New BSD license.
-# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
-#
-
-
-if (PORTAUDIO_LIBRARIES AND PORTAUDIO_INCLUDE_DIRS)
-  # in cache already
-  set(PORTAUDIO_FOUND TRUE)
-else (PORTAUDIO_LIBRARIES AND PORTAUDIO_INCLUDE_DIRS)
-  if (NOT WIN32)
-   include(FindPkgConfig)
-   pkg_check_modules(PORTAUDIO2 portaudio-2.0)
-  endif (NOT WIN32)
-
-  if (PORTAUDIO2_FOUND)
-    set(PORTAUDIO_INCLUDE_DIRS
-      ${PORTAUDIO2_INCLUDE_DIRS}
-    )
-    if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
-      set(PORTAUDIO_LIBRARIES "${PORTAUDIO2_LIBRARY_DIRS}/lib${PORTAUDIO2_LIBRARIES}.dylib")
-    else (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
-      set(PORTAUDIO_LIBRARIES
-        ${PORTAUDIO2_LIBRARIES}
-      )
-    endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
-    set(PORTAUDIO_VERSION
-      19
-    )
-    set(PORTAUDIO_FOUND TRUE)
-  else (PORTAUDIO2_FOUND)
-    find_path(PORTAUDIO_INCLUDE_DIR
-      NAMES
-        portaudio.h
-      PATHS
-        /usr/include
-        /usr/local/include
-        /opt/local/include
-        /sw/include
-    )
-   
-    find_library(PORTAUDIO_LIBRARY
-      NAMES
-        portaudio
-      PATHS
-        /usr/lib
-        /usr/local/lib
-        /opt/local/lib
-        /sw/lib
-    )
-   
-    find_path(PORTAUDIO_LIBRARY_DIR
-      NAMES
-        portaudio
-      PATHS
-        /usr/lib
-        /usr/local/lib
-        /opt/local/lib
-        /sw/lib
-    )
-   
-    set(PORTAUDIO_INCLUDE_DIRS
-      ${PORTAUDIO_INCLUDE_DIR}
-    )
-    set(PORTAUDIO_LIBRARIES
-      ${PORTAUDIO_LIBRARY}
-    )
-   
-    set(PORTAUDIO_LIBRARY_DIRS
-      ${PORTAUDIO_LIBRARY_DIR}
-    )
-   
-    set(PORTAUDIO_VERSION
-      18
-    )
-   
-    if (PORTAUDIO_INCLUDE_DIRS AND PORTAUDIO_LIBRARIES)
-       set(PORTAUDIO_FOUND TRUE)
-    endif (PORTAUDIO_INCLUDE_DIRS AND PORTAUDIO_LIBRARIES)
-   
-    if (PORTAUDIO_FOUND)
-      if (NOT Portaudio_FIND_QUIETLY)
-        message(STATUS "Found Portaudio: ${PORTAUDIO_LIBRARIES}")
-      endif (NOT Portaudio_FIND_QUIETLY)
-    else (PORTAUDIO_FOUND)
-      if (Portaudio_FIND_REQUIRED)
-        message(FATAL_ERROR "Could not find Portaudio")
-      endif (Portaudio_FIND_REQUIRED)
-    endif (PORTAUDIO_FOUND)
-  endif (PORTAUDIO2_FOUND)
-
-
-  # show the PORTAUDIO_INCLUDE_DIRS and PORTAUDIO_LIBRARIES variables only in the advanced view
-  mark_as_advanced(PORTAUDIO_INCLUDE_DIRS PORTAUDIO_LIBRARIES)
-
-endif (PORTAUDIO_LIBRARIES AND PORTAUDIO_INCLUDE_DIRS)
-
diff --git a/fdmdv2-dev/cmake/GetDependencies.cmake.in b/fdmdv2-dev/cmake/GetDependencies.cmake.in
deleted file mode 100644 (file)
index 93204dd..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# As this script is run in a new cmake instance, it does not have access to
-# the existing cache variables. Pass them in via the configure_file command.
-set(CMAKE_BINARY_DIR @CMAKE_BINARY_DIR@)
-set(CMAKE_SOURCE_DIR @CMAKE_SOURCE_DIR@)
-set(UNIX @UNIX@)
-set(WIN32 @WIN32@)
-set(CMAKE_CROSSCOMPILING @CMAKE_CROSSCOMPILING@)
-set(CMAKE_FIND_LIBRARY_SUFFIXES @CMAKE_FIND_LIBRARY_SUFFIXES@)
-set(CMAKE_FIND_LIBRARY_PREFIXES @CMAKE_FIND_LIBRARY_PREFIXES@)
-set(CMAKE_SYSTEM_LIBRARY_PATH @CMAKE_SYSTEM_LIBRARY_PATH@)
-set(CMAKE_FIND_ROOT_PATH @CMAKE_FIND_ROOT_PATH@)
-
-set(FREEDV_EXE ${CMAKE_BINARY_DIR}/src/freedv.exe)
-
-include(GetPrerequisites)
-get_prerequisites("${FREEDV_EXE}" _deps 1 1 "" "${CMAKE_SYSTEM_LIBRARY_PATH}")
-foreach(_runtime ${_deps})
-    message("Looking for ${_runtime}")
-    find_library(RUNTIME_${_runtime} ${_runtime})
-    message("${RUNTIME_${_runtime}}")
-    if(RUNTIME_${_runtime})
-        file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/bin"
-        TYPE EXECUTABLE FILES "${RUNTIME_${_runtime}}")
-    endif()
-endforeach()
diff --git a/fdmdv2-dev/cmake/MinGW.cmake b/fdmdv2-dev/cmake/MinGW.cmake
deleted file mode 100644 (file)
index 333c1dc..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-# If we're cross-compiling then we need to set the target host manually.
-if(MINGW AND CMAKE_CROSSCOMPILING)
-    if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
-        set(HOST x86_64-w64-mingw32)
-    else()
-        set(HOST i686-w64-mingw32)
-    endif()
-endif()
diff --git a/fdmdv2-dev/cmake/Toolchain-Ubuntu-mingw32.cmake b/fdmdv2-dev/cmake/Toolchain-Ubuntu-mingw32.cmake
deleted file mode 100644 (file)
index 3507d72..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# Sample toolchain file for building for Windows from an Ubuntu Linux system.
-#
-# Typical usage:
-#    *) install cross compiler: `sudo apt-get install mingw-w64 g++-mingw-w64`
-#    *) cd build
-#    *) cmake -DCMAKE_TOOLCHAIN_FILE=~/Toolchain-Ubuntu-mingw32.cmake ..
-
-set(CMAKE_SYSTEM_NAME Windows)
-set(TOOLCHAIN_PREFIX i686-w64-mingw32)
-
-# cross compilers to use for C and C++
-set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc)
-set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
-set(CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres)
-
-# target environment on the build host system
-#   set 1st to dir with the cross compiler's C/C++ headers/libs
-set(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX})
-
-# modify default behavior of FIND_XXX() commands to
-# search for headers/libs in the target environment and
-# search for programs in the build host environment
-set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
-set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
-set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
diff --git a/fdmdv2-dev/cmake/config.h.in b/fdmdv2-dev/cmake/config.h.in
deleted file mode 100644 (file)
index 8e3ab76..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/*--------------------------------------------------------------------------
- ** This file is autogenerated from config.h.in 
- ** during the cmake configuration of your project. If you need to make changes
- ** edit the original file NOT THIS FILE.
- ** --------------------------------------------------------------------------*/
-#ifndef _CONFIGURATION_HEADER_GUARD_H_
-#define _CONFIGURATION_HEADER_GUARD_H_
-
-#define SIZEOF_INT @SIZEOF_INT@
-#cmakedefine HAVE_LIMITS_H @HAVE_LIMITS_H@
-#cmakedefine HAVE_STDINT_H @HAVE_STDINT_H@
-#cmakedefine HAVE_STDDEF_H @HAVE_STDDEF_H@
-#cmakedefine HAVE_STDLIB_H @HAVE_STDLIB_H@
-#cmakedefine HAVE_STRING_H @HAVE_STRING_H@
-#cmakedefine HAVE_FLOOR @HAVE_FLOOR@
-#cmakedefine HAVE_MEMSET @HAVE_MEMSET@
-#cmakedefine HAVE_POW @HAVE_POW@
-#cmakedefine HAVE_SQRT @HAVE_SQRT@
-#endif
diff --git a/fdmdv2-dev/cmake/version.h.in b/fdmdv2-dev/cmake/version.h.in
deleted file mode 100644 (file)
index 43b3b7a..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef FREEDV_VER_DOT_H
-#define FREEDV_VER_DOT_H 1
-
-#define FREEDV_VERSION_MAJOR @FREEDV_VERSION_MAJOR@
-#define FREEDV_VERSION_MINOR @FREEDV_VERSION_MINOR@
-#define FREEDV_VERSION_PATCH @FREEDV_VERSION_PATCH@
-#define FREEDV_VERSION_SUFFIX "@FREEDV_VERSION_SUFFIX@"
-
-#define FREEDV_VERSION "@FREEDV_VERSION_STRING@"
-
-#endif //FREEDV_VER_DOT_H
diff --git a/fdmdv2-dev/contrib/CMakeLists.txt b/fdmdv2-dev/contrib/CMakeLists.txt
deleted file mode 100644 (file)
index 3f4b7e0..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-# Install icons if we're on most *nix systems.
-if(UNIX AND NOT APPLE)
-    set(ICON_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor
-        CACHE PATH "Prefix to use for installing icons.")
-    install(FILES freedv48x48.png
-        DESTINATION ${ICON_INSTALL_PREFIX}/48x48/apps
-        RENAME freedv.png)
-    install(FILES freedv64x64.png
-        DESTINATION ${ICON_INSTALL_PREFIX}/64x64/apps
-        RENAME freedv.png)
-    install(FILES freedv128x128.png
-        DESTINATION ${ICON_INSTALL_PREFIX}/128x128/apps
-        RENAME freedv.png)
-    install(FILES freedv256x256.png
-        DESTINATION ${ICON_INSTALL_PREFIX}/256x256/apps
-        RENAME freedv.png)
-
-    set(DESKTOP_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/applications
-        CACHE PATH "Location to install desktop files.")
-    install(FILES freedv.desktop
-        DESTINATION ${DESKTOP_INSTALL_DIR})
-endif(UNIX AND NOT APPLE)
diff --git a/fdmdv2-dev/contrib/LICENSE b/fdmdv2-dev/contrib/LICENSE
deleted file mode 100644 (file)
index dc8853a..0000000
+++ /dev/null
@@ -1,393 +0,0 @@
-Attribution 4.0 International
-
-=======================================================================
-
-Creative Commons Corporation ("Creative Commons") is not a law firm and
-does not provide legal services or legal advice. Distribution of
-Creative Commons public licenses does not create a lawyer-client or
-other relationship. Creative Commons makes its licenses and related
-information available on an "as-is" basis. Creative Commons gives no
-warranties regarding its licenses, any material licensed under their
-terms and conditions, or any related information. Creative Commons
-disclaims all liability for damages resulting from their use to the
-fullest extent possible.
-
-Using Creative Commons Public Licenses
-
-Creative Commons public licenses provide a standard set of terms and
-conditions that creators and other rights holders may use to share
-original works of authorship and other material subject to copyright
-and certain other rights specified in the public license below. The
-following considerations are for informational purposes only, are not
-exhaustive, and do not form part of our licenses.
-
-     Considerations for licensors: Our public licenses are
-     intended for use by those authorized to give the public
-     permission to use material in ways otherwise restricted by
-     copyright and certain other rights. Our licenses are
-     irrevocable. Licensors should read and understand the terms
-     and conditions of the license they choose before applying it.
-     Licensors should also secure all rights necessary before
-     applying our licenses so that the public can reuse the
-     material as expected. Licensors should clearly mark any
-     material not subject to the license. This includes other CC-
-     licensed material, or material used under an exception or
-     limitation to copyright. More considerations for licensors:
-       wiki.creativecommons.org/Considerations_for_licensors
-
-     Considerations for the public: By using one of our public
-     licenses, a licensor grants the public permission to use the
-     licensed material under specified terms and conditions. If
-     the licensor's permission is not necessary for any reason--for
-     example, because of any applicable exception or limitation to
-     copyright--then that use is not regulated by the license. Our
-     licenses grant only permissions under copyright and certain
-     other rights that a licensor has authority to grant. Use of
-     the licensed material may still be restricted for other
-     reasons, including because others have copyright or other
-     rights in the material. A licensor may make special requests,
-     such as asking that all changes be marked or described.
-     Although not required by our licenses, you are encouraged to
-     respect those requests where reasonable. More_considerations
-     for the public: 
-       wiki.creativecommons.org/Considerations_for_licensees
-
-=======================================================================
-
-Creative Commons Attribution 4.0 International Public License
-
-By exercising the Licensed Rights (defined below), You accept and agree
-to be bound by the terms and conditions of this Creative Commons
-Attribution 4.0 International Public License ("Public License"). To the
-extent this Public License may be interpreted as a contract, You are
-granted the Licensed Rights in consideration of Your acceptance of
-these terms and conditions, and the Licensor grants You such rights in
-consideration of benefits the Licensor receives from making the
-Licensed Material available under these terms and conditions.
-
-
-Section 1 -- Definitions.
-
-  a. Adapted Material means material subject to Copyright and Similar
-     Rights that is derived from or based upon the Licensed Material
-     and in which the Licensed Material is translated, altered,
-     arranged, transformed, or otherwise modified in a manner requiring
-     permission under the Copyright and Similar Rights held by the
-     Licensor. For purposes of this Public License, where the Licensed
-     Material is a musical work, performance, or sound recording,
-     Adapted Material is always produced where the Licensed Material is
-     synched in timed relation with a moving image.
-
-  b. Adapter's License means the license You apply to Your Copyright
-     and Similar Rights in Your contributions to Adapted Material in
-     accordance with the terms and conditions of this Public License.
-
-  c. Copyright and Similar Rights means copyright and/or similar rights
-     closely related to copyright including, without limitation,
-     performance, broadcast, sound recording, and Sui Generis Database
-     Rights, without regard to how the rights are labeled or
-     categorized. For purposes of this Public License, the rights
-     specified in Section 2(b)(1)-(2) are not Copyright and Similar
-     Rights.
-
-  d. Effective Technological Measures means those measures that, in the
-     absence of proper authority, may not be circumvented under laws
-     fulfilling obligations under Article 11 of the WIPO Copyright
-     Treaty adopted on December 20, 1996, and/or similar international
-     agreements.
-
-  e. Exceptions and Limitations means fair use, fair dealing, and/or
-     any other exception or limitation to Copyright and Similar Rights
-     that applies to Your use of the Licensed Material.
-
-  f. Licensed Material means the artistic or literary work, database,
-     or other material to which the Licensor applied this Public
-     License.
-
-  g. Licensed Rights means the rights granted to You subject to the
-     terms and conditions of this Public License, which are limited to
-     all Copyright and Similar Rights that apply to Your use of the
-     Licensed Material and that the Licensor has authority to license.
-
-  h. Licensor means the individual(s) or entity(ies) granting rights
-     under this Public License.
-
-  i. Share means to provide material to the public by any means or
-     process that requires permission under the Licensed Rights, such
-     as reproduction, public display, public performance, distribution,
-     dissemination, communication, or importation, and to make material
-     available to the public including in ways that members of the
-     public may access the material from a place and at a time
-     individually chosen by them.
-
-  j. Sui Generis Database Rights means rights other than copyright
-     resulting from Directive 96/9/EC of the European Parliament and of
-     the Council of 11 March 1996 on the legal protection of databases,
-     as amended and/or succeeded, as well as other essentially
-     equivalent rights anywhere in the world.
-
-  k. You means the individual or entity exercising the Licensed Rights
-     under this Public License. Your has a corresponding meaning.
-
-
-Section 2 -- Scope.
-
-  a. License grant.
-
-       1. Subject to the terms and conditions of this Public License,
-          the Licensor hereby grants You a worldwide, royalty-free,
-          non-sublicensable, non-exclusive, irrevocable license to
-          exercise the Licensed Rights in the Licensed Material to:
-
-            a. reproduce and Share the Licensed Material, in whole or
-               in part; and
-
-            b. produce, reproduce, and Share Adapted Material.
-
-       2. Exceptions and Limitations. For the avoidance of doubt, where
-          Exceptions and Limitations apply to Your use, this Public
-          License does not apply, and You do not need to comply with
-          its terms and conditions.
-
-       3. Term. The term of this Public License is specified in Section
-          6(a).
-
-       4. Media and formats; technical modifications allowed. The
-          Licensor authorizes You to exercise the Licensed Rights in
-          all media and formats whether now known or hereafter created,
-          and to make technical modifications necessary to do so. The
-          Licensor waives and/or agrees not to assert any right or
-          authority to forbid You from making technical modifications
-          necessary to exercise the Licensed Rights, including
-          technical modifications necessary to circumvent Effective
-          Technological Measures. For purposes of this Public License,
-          simply making modifications authorized by this Section 2(a)
-          (4) never produces Adapted Material.
-
-       5. Downstream recipients.
-
-            a. Offer from the Licensor -- Licensed Material. Every
-               recipient of the Licensed Material automatically
-               receives an offer from the Licensor to exercise the
-               Licensed Rights under the terms and conditions of this
-               Public License.
-
-            b. No downstream restrictions. You may not offer or impose
-               any additional or different terms or conditions on, or
-               apply any Effective Technological Measures to, the
-               Licensed Material if doing so restricts exercise of the
-               Licensed Rights by any recipient of the Licensed
-               Material.
-
-       6. No endorsement. Nothing in this Public License constitutes or
-          may be construed as permission to assert or imply that You
-          are, or that Your use of the Licensed Material is, connected
-          with, or sponsored, endorsed, or granted official status by,
-          the Licensor or others designated to receive attribution as
-          provided in Section 3(a)(1)(A)(i).
-
-  b. Other rights.
-
-       1. Moral rights, such as the right of integrity, are not
-          licensed under this Public License, nor are publicity,
-          privacy, and/or other similar personality rights; however, to
-          the extent possible, the Licensor waives and/or agrees not to
-          assert any such rights held by the Licensor to the limited
-          extent necessary to allow You to exercise the Licensed
-          Rights, but not otherwise.
-
-       2. Patent and trademark rights are not licensed under this
-          Public License.
-
-       3. To the extent possible, the Licensor waives any right to
-          collect royalties from You for the exercise of the Licensed
-          Rights, whether directly or through a collecting society
-          under any voluntary or waivable statutory or compulsory
-          licensing scheme. In all other cases the Licensor expressly
-          reserves any right to collect such royalties.
-
-
-Section 3 -- License Conditions.
-
-Your exercise of the Licensed Rights is expressly made subject to the
-following conditions.
-
-  a. Attribution.
-
-       1. If You Share the Licensed Material (including in modified
-          form), You must:
-
-            a. retain the following if it is supplied by the Licensor
-               with the Licensed Material:
-
-                 i. identification of the creator(s) of the Licensed
-                    Material and any others designated to receive
-                    attribution, in any reasonable manner requested by
-                    the Licensor (including by pseudonym if
-                    designated);
-
-                ii. a copyright notice;
-
-               iii. a notice that refers to this Public License;
-
-                iv. a notice that refers to the disclaimer of
-                    warranties;
-
-                 v. a URI or hyperlink to the Licensed Material to the
-                    extent reasonably practicable;
-
-            b. indicate if You modified the Licensed Material and
-               retain an indication of any previous modifications; and
-
-            c. indicate the Licensed Material is licensed under this
-               Public License, and include the text of, or the URI or
-               hyperlink to, this Public License.
-
-       2. You may satisfy the conditions in Section 3(a)(1) in any
-          reasonable manner based on the medium, means, and context in
-          which You Share the Licensed Material. For example, it may be
-          reasonable to satisfy the conditions by providing a URI or
-          hyperlink to a resource that includes the required
-          information.
-
-       3. If requested by the Licensor, You must remove any of the
-          information required by Section 3(a)(1)(A) to the extent
-          reasonably practicable.
-
-       4. If You Share Adapted Material You produce, the Adapter's
-          License You apply must not prevent recipients of the Adapted
-          Material from complying with this Public License.
-
-
-Section 4 -- Sui Generis Database Rights.
-
-Where the Licensed Rights include Sui Generis Database Rights that
-apply to Your use of the Licensed Material:
-
-  a. for the avoidance of doubt, Section 2(a)(1) grants You the right
-     to extract, reuse, reproduce, and Share all or a substantial
-     portion of the contents of the database;
-
-  b. if You include all or a substantial portion of the database
-     contents in a database in which You have Sui Generis Database
-     Rights, then the database in which You have Sui Generis Database
-     Rights (but not its individual contents) is Adapted Material; and
-
-  c. You must comply with the conditions in Section 3(a) if You Share
-     all or a substantial portion of the contents of the database.
-
-For the avoidance of doubt, this Section 4 supplements and does not
-replace Your obligations under this Public License where the Licensed
-Rights include other Copyright and Similar Rights.
-
-
-Section 5 -- Disclaimer of Warranties and Limitation of Liability.
-
-  a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
-     EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
-     AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
-     ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
-     IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
-     WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
-     PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
-     ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
-     KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
-     ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
-
-  b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
-     TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
-     NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
-     INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
-     COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
-     USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
-     ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
-     DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
-     IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
-
-  c. The disclaimer of warranties and limitation of liability provided
-     above shall be interpreted in a manner that, to the extent
-     possible, most closely approximates an absolute disclaimer and
-     waiver of all liability.
-
-
-Section 6 -- Term and Termination.
-
-  a. This Public License applies for the term of the Copyright and
-     Similar Rights licensed here. However, if You fail to comply with
-     this Public License, then Your rights under this Public License
-     terminate automatically.
-
-  b. Where Your right to use the Licensed Material has terminated under
-     Section 6(a), it reinstates:
-
-       1. automatically as of the date the violation is cured, provided
-          it is cured within 30 days of Your discovery of the
-          violation; or
-
-       2. upon express reinstatement by the Licensor.
-
-     For the avoidance of doubt, this Section 6(b) does not affect any
-     right the Licensor may have to seek remedies for Your violations
-     of this Public License.
-
-  c. For the avoidance of doubt, the Licensor may also offer the
-     Licensed Material under separate terms or conditions or stop
-     distributing the Licensed Material at any time; however, doing so
-     will not terminate this Public License.
-
-  d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
-     License.
-
-
-Section 7 -- Other Terms and Conditions.
-
-  a. The Licensor shall not be bound by any additional or different
-     terms or conditions communicated by You unless expressly agreed.
-
-  b. Any arrangements, understandings, or agreements regarding the
-     Licensed Material not stated herein are separate from and
-     independent of the terms and conditions of this Public License.
-
-
-Section 8 -- Interpretation.
-
-  a. For the avoidance of doubt, this Public License does not, and
-     shall not be interpreted to, reduce, limit, restrict, or impose
-     conditions on any use of the Licensed Material that could lawfully
-     be made without permission under this Public License.
-
-  b. To the extent possible, if any provision of this Public License is
-     deemed unenforceable, it shall be automatically reformed to the
-     minimum extent necessary to make it enforceable. If the provision
-     cannot be reformed, it shall be severed from this Public License
-     without affecting the enforceability of the remaining terms and
-     conditions.
-
-  c. No term or condition of this Public License will be waived and no
-     failure to comply consented to unless expressly agreed to by the
-     Licensor.
-
-  d. Nothing in this Public License constitutes or may be interpreted
-     as a limitation upon, or waiver of, any privileges and immunities
-     that apply to the Licensor or You, including from the legal
-     processes of any jurisdiction or authority.
-
-
-=======================================================================
-
-Creative Commons is not a party to its public licenses.
-Notwithstanding, Creative Commons may elect to apply one of its public
-licenses to material it publishes and in those instances will be
-considered the "Licensor." Except for the limited purpose of indicating
-that material is shared under a Creative Commons public license or as
-otherwise permitted by the Creative Commons policies published at
-creativecommons.org/policies, Creative Commons does not authorize the
-use of the trademark "Creative Commons" or any other trademark or logo
-of Creative Commons without its prior written consent including,
-without limitation, in connection with any unauthorized modifications
-to any of its public licenses or any other arrangements,
-understandings, or agreements concerning use of licensed material. For
-the avoidance of doubt, this paragraph does not form part of the public
-licenses.
-
-Creative Commons may be contacted at creativecommons.org.
diff --git a/fdmdv2-dev/contrib/freedv.desktop b/fdmdv2-dev/contrib/freedv.desktop
deleted file mode 100644 (file)
index 96e8293..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-[Desktop Entry]
-Version=1.0
-Name=FreeDV
-Exec=freedv
-Icon=freedv
-Type=Application
-Terminal=false
-Categories=GTK;GNOME;AudioVideo;Audio;HamRadio;
diff --git a/fdmdv2-dev/contrib/freedv.ico b/fdmdv2-dev/contrib/freedv.ico
deleted file mode 100644 (file)
index e6b9a20..0000000
Binary files a/fdmdv2-dev/contrib/freedv.ico and /dev/null differ
diff --git a/fdmdv2-dev/contrib/freedv.rc b/fdmdv2-dev/contrib/freedv.rc
deleted file mode 100644 (file)
index 2e6655d..0000000
+++ /dev/null
@@ -1 +0,0 @@
-id ICON "./freedv.ico"
diff --git a/fdmdv2-dev/contrib/freedv128x128.png b/fdmdv2-dev/contrib/freedv128x128.png
deleted file mode 100644 (file)
index 5190a77..0000000
Binary files a/fdmdv2-dev/contrib/freedv128x128.png and /dev/null differ
diff --git a/fdmdv2-dev/contrib/freedv256x256.png b/fdmdv2-dev/contrib/freedv256x256.png
deleted file mode 100644 (file)
index b3eb5d7..0000000
Binary files a/fdmdv2-dev/contrib/freedv256x256.png and /dev/null differ
diff --git a/fdmdv2-dev/contrib/freedv48x48.png b/fdmdv2-dev/contrib/freedv48x48.png
deleted file mode 100644 (file)
index bd5efc6..0000000
Binary files a/fdmdv2-dev/contrib/freedv48x48.png and /dev/null differ
diff --git a/fdmdv2-dev/contrib/freedv64x64.png b/fdmdv2-dev/contrib/freedv64x64.png
deleted file mode 100644 (file)
index eb89773..0000000
Binary files a/fdmdv2-dev/contrib/freedv64x64.png and /dev/null differ
diff --git a/fdmdv2-dev/credits.txt b/fdmdv2-dev/credits.txt
deleted file mode 100644 (file)
index 431e399..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-Credits (code or ideas borrowed from):
-==============================================
-Dave Witten and David Rowe (obviously)
-Mel Whitten K0PFX (material and moral support)
-Bruce Perens (cheerleader, promotion and publicity)
-Mooneer Salem KG6AOV(Mac OSX Patch)
-Soeren Straarup OZ2DAK (FreeBSD Port)
-Don Mak
-Steve Nance (K5FR)
-Joel Stanley (Hamlib prototyping) and Mark Jessop (Mac OSX) 
-James Ahlstrom (Quisk)
-FLDIGI
-All the folks on the digital voice google group...
diff --git a/fdmdv2-dev/db/current b/fdmdv2-dev/db/current
deleted file mode 100644 (file)
index d00491f..0000000
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/fdmdv2-dev/db/format b/fdmdv2-dev/db/format
deleted file mode 100644 (file)
index db06890..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-4
-layout sharded 1000
diff --git a/fdmdv2-dev/db/fs-type b/fdmdv2-dev/db/fs-type
deleted file mode 100644 (file)
index 4fdd953..0000000
+++ /dev/null
@@ -1 +0,0 @@
-fsfs
diff --git a/fdmdv2-dev/db/fsfs.conf b/fdmdv2-dev/db/fsfs.conf
deleted file mode 100644 (file)
index cc08ceb..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-### This file controls the configuration of the FSFS filesystem.\r
-\r
-[memcached-servers]\r
-### These options name memcached servers used to cache internal FSFS\r
-### data.  See http://www.danga.com/memcached/ for more information on\r
-### memcached.  To use memcached with FSFS, run one or more memcached\r
-### servers, and specify each of them as an option like so:\r
-# first-server = 127.0.0.1:11211\r
-# remote-memcached = mymemcached.corp.example.com:11212\r
-### The option name is ignored; the value is of the form HOST:PORT.\r
-### memcached servers can be shared between multiple repositories;\r
-### however, if you do this, you *must* ensure that repositories have\r
-### distinct UUIDs and paths, or else cached data from one repository\r
-### might be used by another accidentally.  Note also that memcached has\r
-### no authentication for reads or writes, so you must ensure that your\r
-### memcached servers are only accessible by trusted users.\r
-\r
-[caches]\r
-### When a cache-related error occurs, normally Subversion ignores it\r
-### and continues, logging an error if the server is appropriately\r
-### configured (and ignoring it with file:// access).  To make\r
-### Subversion never ignore cache errors, uncomment this line.\r
-# fail-stop = true\r
-\r
-[rep-sharing]\r
-### To conserve space, the filesystem can optionally avoid storing\r
-### duplicate representations.  This comes at a slight cost in\r
-### performance, as maintaining a database of shared representations can\r
-### increase commit times.  The space savings are dependent upon the size\r
-### of the repository, the number of objects it contains and the amount of\r
-### duplication between them, usually a function of the branching and\r
-### merging process.\r
-###\r
-### The following parameter enables rep-sharing in the repository.  It can\r
-### be switched on and off at will, but for best space-saving results\r
-### should be enabled consistently over the life of the repository.\r
-### rep-sharing is enabled by default.\r
-# enable-rep-sharing = true\r
diff --git a/fdmdv2-dev/db/min-unpacked-rev b/fdmdv2-dev/db/min-unpacked-rev
deleted file mode 100644 (file)
index 573541a..0000000
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/fdmdv2-dev/db/rep-cache.db b/fdmdv2-dev/db/rep-cache.db
deleted file mode 100644 (file)
index 63c6f0b..0000000
Binary files a/fdmdv2-dev/db/rep-cache.db and /dev/null differ
diff --git a/fdmdv2-dev/db/revprops/0/0 b/fdmdv2-dev/db/revprops/0/0
deleted file mode 100644 (file)
index d0b90de..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-K 8
-svn:date
-V 27
-2012-08-21T18:27:59.389906Z
-END
diff --git a/fdmdv2-dev/db/revprops/0/1 b/fdmdv2-dev/db/revprops/0/1
deleted file mode 100644 (file)
index 0af71a2..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-K 10
-svn:author
-V 9
-OFA-Staff
-K 8
-svn:date
-V 27
-2012-08-21T18:28:08.741468Z
-K 7
-svn:log
-V 25
-Imported folder structure
-END
diff --git a/fdmdv2-dev/db/revs/0/0 b/fdmdv2-dev/db/revs/0/0
deleted file mode 100644 (file)
index 10f5c45..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-PLAIN
-END
-ENDREP
-id: 0.0.r0/17
-type: dir
-count: 0
-text: 0 0 4 4 2d2977d1c96f487abe4a1e202dd03b4e
-cpath: /
-
-
-17 107
diff --git a/fdmdv2-dev/db/revs/0/1 b/fdmdv2-dev/db/revs/0/1
deleted file mode 100644 (file)
index fd802a9..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-id: 3-1.0.r1/0
-type: dir
-count: 0
-cpath: /tags
-copyroot: 0 /
-
-id: 0-1.0.r1/62
-type: dir
-count: 0
-cpath: /trunk
-copyroot: 0 /
-
-id: 2-1.0.r1/126
-type: dir
-count: 0
-cpath: /branches
-copyroot: 0 /
-
-PLAIN
-K 8
-branches
-V 16
-dir 2-1.0.r1/126
-K 4
-tags
-V 14
-dir 3-1.0.r1/0
-K 5
-trunk
-V 15
-dir 0-1.0.r1/62
-END
-ENDREP
-id: 0.0.r1/306
-type: dir
-pred: 0.0.r0/17
-count: 1
-text: 1 194 99 99 7b6cc14dddba4e09be5255b475d1a0a8
-cpath: /
-copyroot: 0 /
-
-_0.0.t0-0 add-dir false false /trunk
-
-_2.0.t0-0 add-dir false false /branches
-
-_3.0.t0-0 add-dir false false /tags
-
-
-306 431
diff --git a/fdmdv2-dev/db/transactions/.gitignore b/fdmdv2-dev/db/transactions/.gitignore
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/fdmdv2-dev/db/txn-current b/fdmdv2-dev/db/txn-current
deleted file mode 100644 (file)
index d00491f..0000000
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/fdmdv2-dev/db/txn-current-lock b/fdmdv2-dev/db/txn-current-lock
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/fdmdv2-dev/db/txn-protorevs/.gitignore b/fdmdv2-dev/db/txn-protorevs/.gitignore
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/fdmdv2-dev/db/uuid b/fdmdv2-dev/db/uuid
deleted file mode 100644 (file)
index 0f36297..0000000
+++ /dev/null
@@ -1 +0,0 @@
-a56d66ce-6468-4744-9be7-52ce95ca47a4
diff --git a/fdmdv2-dev/db/write-lock b/fdmdv2-dev/db/write-lock
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/fdmdv2-dev/src/CMakeLists.txt b/fdmdv2-dev/src/CMakeLists.txt
deleted file mode 100644 (file)
index 44ccfe7..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-set(FREEDV_SOURCES
-    dlg_audiooptions.cpp
-    dlg_filter.cpp
-    dlg_options.cpp
-    dlg_ptt.cpp
-    fdmdv2_main.cpp
-    fdmdv2_pa_wrapper.cpp
-    fdmdv2_plot.cpp
-    fdmdv2_plot_scalar.cpp
-    fdmdv2_plot_scatter.cpp
-    fdmdv2_plot_spectrum.cpp
-    fdmdv2_plot_waterfall.cpp
-    hamlib.cpp
-    topFrame.cpp
-    sox_biquad.c
-    comp.h
-    dlg_audiooptions.h
-    dlg_filter.h
-    dlg_options.h
-    dlg_ptt.h
-    fdmdv2_defines.h
-    fdmdv2_main.h
-    fdmdv2_pa_wrapper.h
-    fdmdv2_plot.h
-    fdmdv2_plot_scalar.h
-    fdmdv2_plot_scatter.h
-    fdmdv2_plot_spectrum.h
-    fdmdv2_plot_waterfall.h
-    hamlib.h
-    sox_biquad.h
-    sox.h
-    topFrame.h
-    version.h
-)
-
-# WIN32 is needed for Windows GUI apps and is ignored for UNIX like systems.
-add_executable(freedv WIN32 ${FREEDV_SOURCES} ${RES_FILES})
-target_link_libraries(freedv ${FREEDV_LINK_LIBS})
-include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
-if(FREEDV_STATIC_DEPS)
-    add_dependencies(freedv ${FREEDV_STATIC_DEPS})
-endif(FREEDV_STATIC_DEPS)
-install(TARGETS freedv
-    RUNTIME DESTINATION bin)
diff --git a/fdmdv2-dev/src/Makefile.win32 b/fdmdv2-dev/src/Makefile.win32
deleted file mode 100644 (file)
index 932e851..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-# src/Makefile.win32
-# David Rowe 26 Oct 2012
-#
-# Makefile for Win32 on msys/Mingw to help David R get up to speed
-#
-# $ make -f Makefile.Win32
-
-CODEC2_PATH=$(HOME)/codec2-dev
-INCLUDE_PATH=/usr/local/include
-
-WX_CONFIG=wx-config
-WX_CPPFLAGS = $(shell $(WX_CONFIG) --cxxflags) -D__WXDEBUG__
-WX_LIBS = $(shell $(WX_CONFIG) --libs core, base, aui, adv, net)
-SVN_REVISION=$(shell svnversion)
-CODEC2_INC=$(CODEC2_PATH)/src 
-CODEC2_LIB=$(CODEC2_PATH)/build_win32/src/
-
-CPP_FLAGS = -D_NO_AUTOTOOLS_ -I$(INCLUDE_PATH) $(WX_CPPFLAGS) -I$(CODEC2_INC) -I../extern/include -I. -g -Wall -DSVN_REVISION=\"$(SVN_REVISION)\"
-LIBS = $(WX_LIBS) -L$(CODEC2_LIB) -lcodec2 -lm -lportaudiocpp -lportaudio -lpthread -lsndfile -lsamplerate -lhamlib -lsox -lspeexdsp
-
-OBJS = topFrame.o \
-fdmdv2_main.o \
-fdmdv2_plot.o \
-fdmdv2_plot_scalar.o \
-fdmdv2_plot_scatter.o \
-fdmdv2_plot_spectrum.o \
-fdmdv2_plot_waterfall.o \
-fdmdv2_pa_wrapper.o \
-dlg_audiooptions.o \
-dlg_ptt.o \
-dlg_options.o \
-dlg_filter.o \
-sox_biquad.o \
-hamlib.o \
-../../codec2-dev/src/golay23.o
-
-HDRS = version.h dlg_audiooptions.h dlg_ptt.h dlg_filter.h fdmdv2_main.h fdmdv2_defines.h fdmdv2_plot.h fdmdv2_plot_scalar.h fdmdv2_plot_waterfall.h fdmdv2_plot_scatter.h fdmdv2_plot_spectrum.h fdmdv2_pa_wrapper.h topFrame.h dlg_audiooptions.h topFrame.h varicode.h ../../codec2-dev/src/golay23.h hamlib.h
-
-all: freedv
-
-freedv: $(OBJS) 
-       g++ -o freedv $(OBJS) $(CPP_FLAGS) $(LIBS)
-
-%.o: %.cpp $(HDRS) Makefile.win32
-       g++ $(CPP_FLAGS) -c $< -o $@
-
-%.o: %.c $(HDRS) Makefile.win32
-       gcc $(CPP_FLAGS) -c $< -o $@
-
-clean:
-       rm -f *.o fdmdv2
-
diff --git a/fdmdv2-dev/src/comp.h b/fdmdv2-dev/src/comp.h
deleted file mode 100644 (file)
index a3a1bd9..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*---------------------------------------------------------------------------*\
-
-  FILE........: comp.h
-  AUTHOR......: David Rowe
-  DATE CREATED: 24/08/09
-
-  Complex number definition.
-
-\*---------------------------------------------------------------------------*/
-
-/*
-  Copyright (C) 2009 David Rowe
-
-  All rights reserved.
-
-  This program is free software; you can redistribute it and/or modify
-  it under the terms of the GNU Lesser 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 Lesser General Public License
-  along with this program; if not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef __COMP__
-#define __COMP__
-
-/* Complex number */
-
-typedef struct
-{
-    float real;
-    float imag;
-} COMP;
-
-#endif
diff --git a/fdmdv2-dev/src/dlg_audiooptions.cpp b/fdmdv2-dev/src/dlg_audiooptions.cpp
deleted file mode 100644 (file)
index 7d23a08..0000000
+++ /dev/null
@@ -1,1264 +0,0 @@
-//=========================================================================
-// Name:            AudioOptsDialog.cpp
-// Purpose:         Implements an Audio options selection dialog.
-//
-// Authors:         David Rowe, David Witten
-// License:
-//
-//  All rights reserved.
-//
-//  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 <http://www.gnu.org/licenses/>.
-//
-//=========================================================================
-#include "fdmdv2_main.h"
-#include "dlg_audiooptions.h"
-
-// constants for test waveform plots
-
-#define TEST_WAVEFORM_X          180
-#define TEST_WAVEFORM_Y          180
-#define TEST_WAVEFORM_PLOT_TIME  2.0
-#define TEST_WAVEFORM_PLOT_FS    400
-#define TEST_BUF_SIZE           1024
-#define TEST_FS                 48000.0
-#define TEST_DT                 0.1      // time between plot updates in seconds
-#define TEST_WAVEFORM_PLOT_BUF  ((int)(DT*400))
-
-void AudioOptsDialog::Pa_Init(void)
-{
-    m_isPaInitialized = false;
-
-    if((pa_err = Pa_Initialize()) == paNoError)
-    {
-        m_isPaInitialized = true;
-    }
-    else
-    {
-        wxMessageBox(wxT("Port Audio failed to initialize"), wxT("Pa_Initialize"), wxOK);
-        return;
-    }
-}
-
-
-void AudioOptsDialog::buildTestControls(PlotScalar **plotScalar, wxButton **btnTest, 
-                                        wxPanel *parentPanel, wxBoxSizer *bSizer, wxString buttonLabel)
-{
-    wxBoxSizer* bSizer1 = new wxBoxSizer(wxVERTICAL);
-
-    wxPanel *panel = new wxPanel(parentPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0);
-    *plotScalar = new PlotScalar((wxFrame*) panel, 1, TEST_WAVEFORM_PLOT_TIME, 1.0/TEST_WAVEFORM_PLOT_FS, -1, 1, 1, 0.2, "", 1);
-    (*plotScalar)->SetClientSize(wxSize(TEST_WAVEFORM_X,TEST_WAVEFORM_Y));
-    bSizer1->Add(panel, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 8);
-
-    *btnTest = new wxButton(parentPanel, wxID_ANY, buttonLabel, wxDefaultPosition, wxDefaultSize);
-    bSizer1->Add(*btnTest, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 0);
-
-    bSizer->Add(bSizer1, 0, wxALIGN_CENTER_HORIZONTAL |wxALIGN_CENTER_VERTICAL );
-}
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// AudioOptsDialog()
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-AudioOptsDialog::AudioOptsDialog(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style)
-{
-    this->SetSizeHints(wxSize(850, 600), wxDefaultSize);
-
-    Pa_Init();
-
-    wxBoxSizer* mainSizer;
-    mainSizer = new wxBoxSizer(wxVERTICAL);
-    m_panel1 = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
-    wxBoxSizer* bSizer4;
-    bSizer4 = new wxBoxSizer(wxVERTICAL);
-    m_notebook1 = new wxNotebook(m_panel1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxNB_BOTTOM);
-    m_panelRx = new wxPanel(m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
-    wxBoxSizer* bSizer20;
-    bSizer20 = new wxBoxSizer(wxVERTICAL);
-    wxGridSizer* gSizer4;
-    gSizer4 = new wxGridSizer(2, 1, 0, 0);
-
-    // Rx In -----------------------------------------------------------------------
-
-    wxStaticBoxSizer* sbSizer2;
-    sbSizer2 = new wxStaticBoxSizer(new wxStaticBox(m_panelRx, wxID_ANY, _("From Radio")), wxHORIZONTAL);
-
-    wxBoxSizer* bSizer811a = new wxBoxSizer(wxVERTICAL);
-
-    m_listCtrlRxInDevices = new wxListCtrl(m_panelRx, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VRULES);
-    bSizer811a->Add(m_listCtrlRxInDevices, 1, wxALL|wxEXPAND, 1);
-
-    wxBoxSizer* bSizer811;
-    bSizer811 = new wxBoxSizer(wxHORIZONTAL);
-    m_staticText51 = new wxStaticText(m_panelRx, wxID_ANY, _("Device:"), wxDefaultPosition, wxDefaultSize, 0);
-    m_staticText51->Wrap(-1);
-    bSizer811->Add(m_staticText51, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5);
-    m_textCtrlRxIn = new wxTextCtrl(m_panelRx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
-    bSizer811->Add(m_textCtrlRxIn, 1, wxALIGN_CENTER_VERTICAL|wxALL, 1);
-    m_staticText6 = new wxStaticText(m_panelRx, wxID_ANY, _("Sample Rate:"), wxDefaultPosition, wxDefaultSize, 0);
-    m_staticText6->Wrap(-1);
-    bSizer811->Add(m_staticText6, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5);
-    m_cbSampleRateRxIn = new wxComboBox(m_panelRx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(90,-1), 0, NULL, wxCB_DROPDOWN);
-    bSizer811->Add(m_cbSampleRateRxIn, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1);
-
-    bSizer811a->Add(bSizer811, 0, wxEXPAND, 5);
-
-    sbSizer2->Add(bSizer811a, 1, wxEXPAND, 2);
-    buildTestControls(&m_plotScalarRxIn, &m_btnRxInTest, m_panelRx, sbSizer2, _("Rec 2s"));
-
-    gSizer4->Add(sbSizer2, 1, wxEXPAND, 5);
-
-    // Rx Out -----------------------------------------------------------------------
-
-    wxStaticBoxSizer* sbSizer3;
-    sbSizer3 = new wxStaticBoxSizer(new wxStaticBox(m_panelRx, wxID_ANY, _("To Speaker/Headphones")), wxHORIZONTAL);
-
-    wxBoxSizer* bSizer81a = new wxBoxSizer(wxVERTICAL);
-
-    m_listCtrlRxOutDevices = new wxListCtrl(m_panelRx, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VRULES);
-    bSizer81a->Add(m_listCtrlRxOutDevices, 1, wxALL|wxEXPAND, 1);
-
-    wxBoxSizer* bSizer81;
-    bSizer81 = new wxBoxSizer(wxHORIZONTAL);
-    m_staticText9 = new wxStaticText(m_panelRx, wxID_ANY, _("Device:"), wxDefaultPosition, wxDefaultSize, 0);
-    m_staticText9->Wrap(-1);
-    bSizer81->Add(m_staticText9, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
-    m_textCtrlRxOut = new wxTextCtrl(m_panelRx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
-    bSizer81->Add(m_textCtrlRxOut, 1, wxALIGN_CENTER_VERTICAL|wxALL, 1);
-    m_staticText10 = new wxStaticText(m_panelRx, wxID_ANY, _("Sample Rate:"), wxDefaultPosition, wxDefaultSize, 0);
-    m_staticText10->Wrap(-1);
-    bSizer81->Add(m_staticText10, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5);
-    m_cbSampleRateRxOut = new wxComboBox(m_panelRx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(90,-1), 0, NULL, wxCB_DROPDOWN);
-    bSizer81->Add(m_cbSampleRateRxOut, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1);
-
-    bSizer81a->Add(bSizer81, 0, wxEXPAND, 5);
-
-    sbSizer3->Add(bSizer81a, 1, wxEXPAND, 2);
-    buildTestControls(&m_plotScalarRxOut, &m_btnRxOutTest, m_panelRx, sbSizer3, _("Play 2s"));
-    gSizer4->Add(sbSizer3, 1, wxEXPAND, 2);
-    bSizer20->Add(gSizer4, 1, wxEXPAND, 1);
-    m_panelRx->SetSizer(bSizer20);
-    m_panelRx->Layout();
-    bSizer20->Fit(m_panelRx);
-    m_notebook1->AddPage(m_panelRx, _("Receive"), true);
-
-    // Tx Tab -------------------------------------------------------------------------------
-
-    m_panelTx = new wxPanel(m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
-    wxBoxSizer* bSizer18;
-    bSizer18 = new wxBoxSizer(wxVERTICAL);
-    wxGridSizer* gSizer2;
-    gSizer2 = new wxGridSizer(2, 1, 0, 0);
-
-    // Tx In ----------------------------------------------------------------------------------
-
-    wxStaticBoxSizer* sbSizer22;
-    sbSizer22 = new wxStaticBoxSizer(new wxStaticBox(m_panelTx, wxID_ANY, _("From Microphone")), wxHORIZONTAL);
-
-    wxBoxSizer* bSizer83a = new wxBoxSizer(wxVERTICAL);
-
-    m_listCtrlTxInDevices = new wxListCtrl(m_panelTx, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VRULES);
-    bSizer83a->Add(m_listCtrlTxInDevices, 1, wxALL|wxEXPAND, 1);
-    wxBoxSizer* bSizer83;
-    bSizer83 = new wxBoxSizer(wxHORIZONTAL);
-    m_staticText12 = new wxStaticText(m_panelTx, wxID_ANY, _("Device:"), wxDefaultPosition, wxDefaultSize, 0);
-    m_staticText12->Wrap(-1);
-    bSizer83->Add(m_staticText12, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5);
-    m_textCtrlTxIn = new wxTextCtrl(m_panelTx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
-    bSizer83->Add(m_textCtrlTxIn, 1, wxALIGN_CENTER_VERTICAL|wxALL, 1);
-    m_staticText11 = new wxStaticText(m_panelTx, wxID_ANY, _("Sample Rate:"), wxDefaultPosition, wxDefaultSize, 0);
-    m_staticText11->Wrap(-1);
-    bSizer83->Add(m_staticText11, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5);
-    m_cbSampleRateTxIn = new wxComboBox(m_panelTx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(90,-1), 0, NULL, wxCB_DROPDOWN);
-    bSizer83->Add(m_cbSampleRateTxIn, 0, wxALL, 1);
-
-    bSizer83a->Add(bSizer83, 0, wxEXPAND, 5);
-
-    sbSizer22->Add(bSizer83a, 1, wxEXPAND, 2);
-    buildTestControls(&m_plotScalarTxIn, &m_btnTxInTest, m_panelTx, sbSizer22, _("Rec 2s"));
-
-    gSizer2->Add(sbSizer22, 1, wxEXPAND, 5);
-
-    // Tx Out ----------------------------------------------------------------------------------
-
-    wxStaticBoxSizer* sbSizer21;
-    sbSizer21 = new wxStaticBoxSizer(new wxStaticBox(m_panelTx, wxID_ANY, _("To Radio")), wxHORIZONTAL);
-
-    wxBoxSizer* bSizer82a = new wxBoxSizer(wxVERTICAL);
-
-    m_listCtrlTxOutDevices = new wxListCtrl(m_panelTx, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VRULES);
-    bSizer82a->Add(m_listCtrlTxOutDevices, 1, wxALL|wxEXPAND, 2);
-    wxBoxSizer* bSizer82;
-    bSizer82 = new wxBoxSizer(wxHORIZONTAL);
-    m_staticText81 = new wxStaticText(m_panelTx, wxID_ANY, _("Device:"), wxDefaultPosition, wxDefaultSize, 0);
-    m_staticText81->Wrap(-1);
-    bSizer82->Add(m_staticText81, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
-    m_textCtrlTxOut = new wxTextCtrl(m_panelTx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
-    bSizer82->Add(m_textCtrlTxOut, 1, wxALIGN_CENTER_VERTICAL|wxALL, 1);
-    m_staticText71 = new wxStaticText(m_panelTx, wxID_ANY, _("Sample Rate:"), wxDefaultPosition, wxDefaultSize, 0);
-    m_staticText71->Wrap(-1);
-    bSizer82->Add(m_staticText71, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5);
-    m_cbSampleRateTxOut = new wxComboBox(m_panelTx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(90,-1), 0, NULL, wxCB_DROPDOWN);
-    bSizer82->Add(m_cbSampleRateTxOut, 0, wxALL, 1);
-
-    bSizer82a->Add(bSizer82, 0, wxEXPAND, 5);
-
-    sbSizer21->Add(bSizer82a, 1, wxEXPAND, 2);
-    buildTestControls(&m_plotScalarTxOut, &m_btnTxOutTest, m_panelTx, sbSizer21, _("Play 2s"));
-
-    gSizer2->Add(sbSizer21, 1, wxEXPAND, 5);
-    bSizer18->Add(gSizer2, 1, wxEXPAND, 1);
-    m_panelTx->SetSizer(bSizer18);
-    m_panelTx->Layout();
-    bSizer18->Fit(m_panelTx);
-    m_notebook1->AddPage(m_panelTx, _("Transmit"), false);
-
-    // API Tab -------------------------------------------------------------------
-
-    m_panelAPI = new wxPanel(m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
-    wxBoxSizer* bSizer12;
-    bSizer12 = new wxBoxSizer(wxHORIZONTAL);
-    wxGridSizer* gSizer31;
-    gSizer31 = new wxGridSizer(2, 1, 0, 0);
-    wxStaticBoxSizer* sbSizer1;
-    sbSizer1 = new wxStaticBoxSizer(new wxStaticBox(m_panelAPI, wxID_ANY, _("PortAudio")), wxVERTICAL);
-
-    wxGridSizer* gSizer3;
-    gSizer3 = new wxGridSizer(4, 2, 0, 0);
-
-    m_staticText7 = new wxStaticText(m_panelAPI, wxID_ANY, _("PortAudio Version String:"), wxDefaultPosition, wxDefaultSize, 0);
-    m_staticText7->Wrap(-1);
-    gSizer3->Add(m_staticText7, 1, wxALIGN_RIGHT|wxALL|wxALIGN_CENTER_VERTICAL, 10);
-    m_textStringVer = new wxStaticText(m_panelAPI, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
-    gSizer3->Add(m_textStringVer, 1, wxALIGN_LEFT|wxALL|wxALIGN_CENTER_VERTICAL, 10);
-
-    m_staticText8 = new wxStaticText(m_panelAPI, wxID_ANY, _("PortAudio Int Version:"), wxDefaultPosition, wxDefaultSize, 0);
-    m_staticText8->Wrap(-1);
-    gSizer3->Add(m_staticText8, 1, wxALIGN_RIGHT|wxALL|wxALIGN_CENTER_VERTICAL, 10);
-    m_textIntVer = new wxStaticText(m_panelAPI, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(45,-1), 0);
-    gSizer3->Add(m_textIntVer, 1, wxALIGN_LEFT|wxALL|wxALIGN_CENTER_VERTICAL, 10);
-
-    m_staticText5 = new wxStaticText(m_panelAPI, wxID_ANY, _("Device Count:"), wxDefaultPosition, wxDefaultSize, 0);
-    m_staticText5->Wrap(-1);
-    gSizer3->Add(m_staticText5, 1, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 10);
-    m_textCDevCount = new wxStaticText(m_panelAPI, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(45,-1), 0);
-    gSizer3->Add(m_textCDevCount, 1, wxALIGN_LEFT|wxALL|wxALIGN_CENTER_VERTICAL, 10);
-
-    m_staticText4 = new wxStaticText(m_panelAPI, wxID_ANY, _("API Count:"), wxDefaultPosition, wxDefaultSize, 0);
-    m_staticText4->Wrap(-1);
-    gSizer3->Add(m_staticText4, 1, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 10);
-    m_textAPICount = new wxStaticText(m_panelAPI, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(45,-1), 0);
-    m_textAPICount->SetMaxSize(wxSize(45,-1));
-    gSizer3->Add(m_textAPICount, 1, wxALIGN_LEFT|wxALL|wxALIGN_CENTER_VERTICAL, 10);
-
-    sbSizer1->Add(gSizer3, 1, wxEXPAND, 2);
-    gSizer31->Add(sbSizer1, 1, wxEXPAND, 2);
-    wxStaticBoxSizer* sbSizer6;
-    sbSizer6 = new wxStaticBoxSizer(new wxStaticBox(m_panelAPI, wxID_ANY, _("Other")), wxVERTICAL);
-    gSizer31->Add(sbSizer6, 1, wxEXPAND, 5);
-    bSizer12->Add(gSizer31, 1, wxEXPAND, 5);
-    m_panelAPI->SetSizer(bSizer12);
-    m_panelAPI->Layout();
-    bSizer12->Fit(m_panelAPI);
-    m_notebook1->AddPage(m_panelAPI, _("API Info"), false);
-    bSizer4->Add(m_notebook1, 1, wxEXPAND | wxALL, 0);
-    m_panel1->SetSizer(bSizer4);
-    m_panel1->Layout();
-    bSizer4->Fit(m_panel1);
-    mainSizer->Add(m_panel1, 1, wxEXPAND | wxALL, 1);
-
-    wxBoxSizer* bSizer6;
-    bSizer6 = new wxBoxSizer(wxHORIZONTAL);
-    m_btnRefresh = new wxButton(this, wxID_ANY, _("Refresh"), wxDefaultPosition, wxDefaultSize, 0);
-    bSizer6->Add(m_btnRefresh, 0, wxALIGN_CENTER|wxALL, 2);
-
-    m_sdbSizer1 = new wxStdDialogButtonSizer();
-
-    m_sdbSizer1OK = new wxButton(this, wxID_OK);
-    m_sdbSizer1->AddButton(m_sdbSizer1OK);
-
-    m_sdbSizer1Cancel = new wxButton(this, wxID_CANCEL);
-    m_sdbSizer1->AddButton(m_sdbSizer1Cancel);
-
-    m_sdbSizer1Apply = new wxButton(this, wxID_APPLY);
-    m_sdbSizer1->AddButton(m_sdbSizer1Apply);
-
-    m_sdbSizer1->Realize();
-
-    bSizer6->Add(m_sdbSizer1, 1, wxALIGN_CENTER_VERTICAL, 2);
-    mainSizer->Add(bSizer6, 0, wxEXPAND, 2);
-    this->SetSizer(mainSizer);
-    this->Layout();
-    this->Centre(wxBOTH);
-//    this->Centre(wxBOTH);
-
-    m_notebook1->SetSelection(0);
-
-    showAPIInfo();
-    m_RxInDevices.m_listDevices   = m_listCtrlRxInDevices;
-    m_RxInDevices.direction       = AUDIO_IN;
-    m_RxInDevices.m_textDevice    = m_textCtrlRxIn;
-    m_RxInDevices.m_cbSampleRate  = m_cbSampleRateRxIn;
-
-    m_RxOutDevices.m_listDevices  = m_listCtrlRxOutDevices;
-    m_RxOutDevices.direction      = AUDIO_OUT;
-    m_RxOutDevices.m_textDevice   = m_textCtrlRxOut;
-    m_RxOutDevices.m_cbSampleRate = m_cbSampleRateRxOut;
-
-    m_TxInDevices.m_listDevices   = m_listCtrlTxInDevices;
-    m_TxInDevices.direction       = AUDIO_IN;
-    m_TxInDevices.m_textDevice    = m_textCtrlTxIn;
-    m_TxInDevices.m_cbSampleRate  = m_cbSampleRateTxIn;
-
-    m_TxOutDevices.m_listDevices  = m_listCtrlTxOutDevices;
-    m_TxOutDevices.direction      = AUDIO_OUT;
-    m_TxOutDevices.m_textDevice   = m_textCtrlTxOut;
-    m_TxOutDevices.m_cbSampleRate = m_cbSampleRateTxOut;
-
-    populateParams(m_RxInDevices);
-    populateParams(m_RxOutDevices);
-    populateParams(m_TxInDevices);
-    populateParams(m_TxOutDevices);
-
-    m_listCtrlRxInDevices->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( AudioOptsDialog::OnRxInDeviceSelect ), NULL, this );
-    m_listCtrlRxOutDevices->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( AudioOptsDialog::OnRxOutDeviceSelect ), NULL, this );
-    m_listCtrlTxInDevices->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( AudioOptsDialog::OnTxInDeviceSelect ), NULL, this );
-    m_listCtrlTxOutDevices->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( AudioOptsDialog::OnTxOutDeviceSelect ), NULL, this );
-
-    // wire up test buttons
-    m_btnRxInTest->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnRxInTest ), NULL, this );
-    m_btnRxOutTest->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnRxOutTest ), NULL, this );
-    m_btnTxInTest->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnTxInTest ), NULL, this );
-    m_btnTxOutTest->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnTxOutTest ), NULL, this );
-
-    m_btnRefresh->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnRefreshClick ), NULL, this );
-    m_sdbSizer1Apply->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnApplyAudioParameters ), NULL, this );
-    m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnCancelAudioParameters ), NULL, this );
-    m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnOkAudioParameters ), NULL, this );
-/*
-        void OnClose( wxCloseEvent& event ) { event.Skip(); }
-        void OnHibernate( wxActivateEvent& event ) { event.Skip(); }
-        void OnIconize( wxIconizeEvent& event ) { event.Skip(); }
-        void OnInitDialog( wxInitDialogEvent& event ) { event.Skip(); }
-*/
-//    this->Connect(wxEVT_CLOSE_WINDOW, wxCloseEventHandler(AudioOptsDialog::OnClose));
-    this->Connect(wxEVT_HIBERNATE, wxActivateEventHandler(AudioOptsDialog::OnHibernate));
-    this->Connect(wxEVT_ICONIZE, wxIconizeEventHandler(AudioOptsDialog::OnIconize));
-    this->Connect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(AudioOptsDialog::OnInitDialog));
-}
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// ~AudioOptsDialog()
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-AudioOptsDialog::~AudioOptsDialog()
-{
-    Pa_Terminate();
-
-    // Disconnect Events
-    this->Disconnect(wxEVT_HIBERNATE, wxActivateEventHandler(AudioOptsDialog::OnHibernate));
-    this->Disconnect(wxEVT_ICONIZE, wxIconizeEventHandler(AudioOptsDialog::OnIconize));
-    this->Disconnect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(AudioOptsDialog::OnInitDialog));
-
-    m_listCtrlRxInDevices->Disconnect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(AudioOptsDialog::OnRxInDeviceSelect), NULL, this);
-    m_listCtrlRxOutDevices->Disconnect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(AudioOptsDialog::OnRxOutDeviceSelect), NULL, this);
-    m_listCtrlTxInDevices->Disconnect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(AudioOptsDialog::OnTxInDeviceSelect), NULL, this);
-    m_listCtrlTxOutDevices->Disconnect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(AudioOptsDialog::OnTxOutDeviceSelect), NULL, this);
-
-    m_btnRxInTest->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnRxInTest ), NULL, this );
-    m_btnRxOutTest->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnRxOutTest ), NULL, this );
-    m_btnTxInTest->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnTxInTest ), NULL, this );
-    m_btnTxOutTest->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnTxOutTest ), NULL, this );
-
-    m_btnRefresh->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AudioOptsDialog::OnRefreshClick), NULL, this);
-    m_sdbSizer1Apply->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AudioOptsDialog::OnApplyAudioParameters), NULL, this);
-    m_sdbSizer1Cancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AudioOptsDialog::OnCancelAudioParameters), NULL, this);
-    m_sdbSizer1OK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AudioOptsDialog::OnOkAudioParameters), NULL, this);
-
-}
-
-//-------------------------------------------------------------------------
-// OnInitDialog()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnInitDialog( wxInitDialogEvent& event )
-{
-    ExchangeData(EXCHANGE_DATA_IN);
-}
-
-//-------------------------------------------------------------------------
-// OnInitDialog()
-//
-// helper function to look up name of devNum, and if it exists write
-// name to textCtrl.  Used to trap dissapearing devices.
-//-------------------------------------------------------------------------
-int AudioOptsDialog::setTextCtrlIfDevNumValid(wxTextCtrl *textCtrl, wxListCtrl *listCtrl, int devNum)
-{
-    int i, aDevNum, found_devNum;
-
-    // ignore last list entry as it is the "none" entry
-
-    found_devNum = 0;
-    for(i=0; i<listCtrl->GetItemCount()-1; i++) {
-        aDevNum = wxAtoi(listCtrl->GetItemText(i, 1));
-        //printf("aDevNum: %d devNum: %d\n", aDevNum, devNum);
-        if (aDevNum == devNum) {
-            found_devNum = 1;
-            textCtrl->SetValue(listCtrl->GetItemText(i, 0) + " (" + wxString::Format(wxT("%i"),devNum) + ")");
-            printf("setting focus of %d\n", i);
-            listCtrl->SetItemState(i, wxLIST_STATE_FOCUSED, wxLIST_STATE_FOCUSED);
-        }
-    }
-
-    if (found_devNum) 
-        return devNum;
-    else {
-        textCtrl->SetValue("none");
-        return -1;
-    }
-}
-
-//-------------------------------------------------------------------------
-// ExchangeData()
-//-------------------------------------------------------------------------
-int AudioOptsDialog::ExchangeData(int inout)
-{
-    if(inout == EXCHANGE_DATA_IN)
-    {
-        // Map sound card device numbers to tx/rx device numbers depending
-        // on number of sound cards in use
-
-        printf("EXCHANGE_DATA_IN:\n");
-        printf("  g_nSoundCards: %d\n", g_nSoundCards);
-        printf("  g_soundCard1InDeviceNum: %d\n", g_soundCard1InDeviceNum);
-        printf("  g_soundCard1OutDeviceNum: %d\n", g_soundCard1OutDeviceNum);
-        printf("  g_soundCard1SampleRate: %d\n", g_soundCard1SampleRate);
-        printf("  g_soundCard2InDeviceNum: %d\n", g_soundCard2InDeviceNum);
-        printf("  g_soundCard2OutDeviceNum: %d\n", g_soundCard2OutDeviceNum);
-        printf("  g_soundCard2SampleRate: %d\n", g_soundCard2SampleRate);
-
-        if (g_nSoundCards == 0) {
-            m_textCtrlRxIn ->SetValue("none"); rxInAudioDeviceNum  = -1;
-            m_textCtrlRxOut->SetValue("none"); rxOutAudioDeviceNum = -1;
-            m_textCtrlTxIn ->SetValue("none"); txInAudioDeviceNum  = -1;
-            m_textCtrlTxOut->SetValue("none"); txOutAudioDeviceNum = -1;           
-        }
-
-        if (g_nSoundCards == 1) {
-            rxInAudioDeviceNum  = setTextCtrlIfDevNumValid(m_textCtrlRxIn, 
-                                                           m_listCtrlRxInDevices, 
-                                                           g_soundCard1InDeviceNum);
-
-            rxOutAudioDeviceNum = setTextCtrlIfDevNumValid(m_textCtrlRxOut, 
-                                                           m_listCtrlRxOutDevices, 
-                                                           g_soundCard1OutDeviceNum);
-
-            if ((rxInAudioDeviceNum != -1) && (rxInAudioDeviceNum != -1)) {
-                m_cbSampleRateRxIn->SetValue(wxString::Format(wxT("%i"),g_soundCard1SampleRate));
-                m_cbSampleRateRxOut->SetValue(wxString::Format(wxT("%i"),g_soundCard1SampleRate));
-            }
-
-            m_textCtrlTxIn ->SetValue("none"); txInAudioDeviceNum  = -1;
-            m_textCtrlTxOut->SetValue("none"); txOutAudioDeviceNum = -1;           
-        }
-
-        if (g_nSoundCards == 2) {
-            rxInAudioDeviceNum  = setTextCtrlIfDevNumValid(m_textCtrlRxIn, 
-                                                           m_listCtrlRxInDevices, 
-                                                           g_soundCard1InDeviceNum);
-
-            rxOutAudioDeviceNum = setTextCtrlIfDevNumValid(m_textCtrlRxOut, 
-                                                           m_listCtrlRxOutDevices, 
-                                                           g_soundCard2OutDeviceNum);
-
-            txInAudioDeviceNum  = setTextCtrlIfDevNumValid(m_textCtrlTxIn, 
-                                                           m_listCtrlTxInDevices, 
-                                                           g_soundCard2InDeviceNum);
-
-            txOutAudioDeviceNum = setTextCtrlIfDevNumValid(m_textCtrlTxOut, 
-                                                           m_listCtrlTxOutDevices, 
-                                                           g_soundCard1OutDeviceNum);
-
-            if ((rxInAudioDeviceNum != -1) && (txOutAudioDeviceNum != -1)) {
-                m_cbSampleRateRxIn->SetValue(wxString::Format(wxT("%i"),g_soundCard1SampleRate));
-                m_cbSampleRateTxOut->SetValue(wxString::Format(wxT("%i"),g_soundCard1SampleRate));
-            }
-
-            if ((txInAudioDeviceNum != -1) && (rxOutAudioDeviceNum != -1)) {
-                m_cbSampleRateTxIn->SetValue(wxString::Format(wxT("%i"),g_soundCard2SampleRate));
-                m_cbSampleRateRxOut->SetValue(wxString::Format(wxT("%i"),g_soundCard2SampleRate));
-            }
-        }
-        printf("  rxInAudioDeviceNum: %d\n  rxOutAudioDeviceNum: %d\n  txInAudioDeviceNum: %d\n  txOutAudioDeviceNum: %d\n",
-               rxInAudioDeviceNum, rxOutAudioDeviceNum, txInAudioDeviceNum, txOutAudioDeviceNum);
-    }
-
-    if(inout == EXCHANGE_DATA_OUT)
-    {
-        int valid_one_card_config = 0;
-        int valid_two_card_config = 0;
-        wxString sampleRate1, sampleRate2;
-
-        printf("EXCHANGE_DATA_OUT:\n");
-        printf("  rxInAudioDeviceNum: %d\n  rxOutAudioDeviceNum: %d\n  txInAudioDeviceNum: %d\n  txOutAudioDeviceNum: %d\n",
-               rxInAudioDeviceNum, rxOutAudioDeviceNum, txInAudioDeviceNum, txOutAudioDeviceNum);
-
-        // ---------------------------------------------------------------
-        // check we have a valid 1 or 2 sound card configuration
-        // ---------------------------------------------------------------
-
-        // one sound card config, tx device numbers should be set to -1 
-
-        if ((rxInAudioDeviceNum != -1) && (rxOutAudioDeviceNum != -1) &&
-            (txInAudioDeviceNum == -1) && (txOutAudioDeviceNum == -1)) {
-            valid_one_card_config = 1; 
-
-            // in and out sample rate must be the same, as there is one callback
-            
-            sampleRate1 = m_cbSampleRateRxIn->GetValue();
-            if (!sampleRate1.IsSameAs(m_cbSampleRateRxOut->GetValue())) {
-                wxMessageBox(wxT("With a single sound card the Sample Rate of "
-                                 "From Radio and To Speaker/Headphones must be the same."), wxT(""), wxOK);
-                return -1;
-            }
-        }
-
-        // two card configuration
-
-        if ((rxInAudioDeviceNum != -1) && (rxOutAudioDeviceNum != -1) &&
-            (txInAudioDeviceNum != -1) && (txOutAudioDeviceNum != -1)) {
-
-            valid_two_card_config = 1; 
-
-            // Check we haven't doubled up on sound devices
-
-            if (rxInAudioDeviceNum == txInAudioDeviceNum) {
-                wxMessageBox(wxT("You must use different devices for From Radio and From Microphone"), wxT(""), wxOK);
-                return -1;
-            }
-
-            if (rxOutAudioDeviceNum == txOutAudioDeviceNum) {
-                wxMessageBox(wxT("You must use different devices for To Radio and To Speaker/Headphones"), wxT(""), wxOK);
-                return -1;
-            }
-
-            // Check sample rates for callback 1 devices are the same,
-            // as input and output are handled synchronously by one
-            // portaudio callback
-            
-            sampleRate1 = m_cbSampleRateRxIn->GetValue();
-            if (!sampleRate1.IsSameAs(m_cbSampleRateTxOut->GetValue())) {
-                wxMessageBox(wxT("With two sound cards the Sample Rate "
-                                 "of From Radio and To Radio must be the same."), wxT(""), wxOK);
-                return -1;
-            }
-            // check sample rate for callback 2 devices is the same
-
-            sampleRate2 = m_cbSampleRateTxIn->GetValue();
-            if (!sampleRate2.IsSameAs(m_cbSampleRateRxOut->GetValue())) {
-                wxMessageBox(wxT("With two sound cards the Sample Rate of "
-                                 "From Microphone and To Speaker/Headphones must be the same."), wxT(""), wxOK);
-                return -1;
-            }
-        }
-
-        printf("  valid_one_card_config: %d  valid_two_card_config: %d\n", valid_one_card_config, valid_two_card_config);
-
-        if (!valid_one_card_config && !valid_two_card_config) {
-            wxMessageBox(wxT("Invalid one or two sound card configuration"), wxT(""), wxOK);
-            return -1;
-        }
-
-        // ---------------------------------------------------------------
-        // Map Rx/TX device numbers to sound card device numbers used
-        // in callbacks. Portaudio uses one callback per sound card so
-        // we have to be soundcard oriented at run time rather than
-        // Tx/Rx oriented as in this dialog.
-        // ---------------------------------------------------------------
-        g_nSoundCards = 0;
-        g_soundCard1InDeviceNum = g_soundCard1OutDeviceNum = g_soundCard2InDeviceNum = g_soundCard2OutDeviceNum = -1;
-
-        if (valid_one_card_config) {
-
-            // Only callback 1 used
-
-            g_nSoundCards = 1;
-            g_soundCard1InDeviceNum  = rxInAudioDeviceNum;
-            g_soundCard1OutDeviceNum = rxOutAudioDeviceNum;
-            g_soundCard1SampleRate = wxAtoi(sampleRate1);
-        }
-
-        if (valid_two_card_config) {
-            g_nSoundCards = 2;
-            g_soundCard1InDeviceNum  = rxInAudioDeviceNum;
-            g_soundCard1OutDeviceNum = txOutAudioDeviceNum;
-            g_soundCard1SampleRate   = wxAtoi(sampleRate1);
-            g_soundCard2InDeviceNum  = txInAudioDeviceNum;
-            g_soundCard2OutDeviceNum = rxOutAudioDeviceNum;
-            g_soundCard2SampleRate   = wxAtoi(sampleRate2);
-        }
-
-        printf("  g_nSoundCards: %d\n", g_nSoundCards);
-        printf("  g_soundCard1InDeviceNum: %d\n", g_soundCard1InDeviceNum);
-        printf("  g_soundCard1OutDeviceNum: %d\n", g_soundCard1OutDeviceNum);
-        printf("  g_soundCard1SampleRate: %d\n", g_soundCard1SampleRate);
-        printf("  g_soundCard2InDeviceNum: %d\n", g_soundCard2InDeviceNum);
-        printf("  g_soundCard2OutDeviceNum: %d\n", g_soundCard2OutDeviceNum);
-        printf("  g_soundCard2SampleRate: %d\n", g_soundCard2SampleRate);
-
-        wxConfigBase *pConfig = wxConfigBase::Get();
-        pConfig->Write(wxT("/Audio/soundCard1InDeviceNum"),       g_soundCard1InDeviceNum);
-        pConfig->Write(wxT("/Audio/soundCard1OutDeviceNum"),      g_soundCard1OutDeviceNum);
-        pConfig->Write(wxT("/Audio/soundCard1SampleRate"),        g_soundCard1SampleRate );
-
-        pConfig->Write(wxT("/Audio/soundCard2InDeviceNum"),       g_soundCard2InDeviceNum);
-        pConfig->Write(wxT("/Audio/soundCard2OutDeviceNum"),      g_soundCard2OutDeviceNum);
-        pConfig->Write(wxT("/Audio/soundCard2SampleRate"),        g_soundCard2SampleRate );
-
-        pConfig->Flush();
-        delete wxConfigBase::Set((wxConfigBase *) NULL);
-    }
-
-    return 0;
-}
-
-//-------------------------------------------------------------------------
-// buildListOfSupportedSampleRates()
-//-------------------------------------------------------------------------
-int AudioOptsDialog:: buildListOfSupportedSampleRates(wxComboBox *cbSampleRate, int devNum, int in_out)
-{
-    // every sound device has a different list of supported sample rates, so
-    // we work out which ones are supported and populate the list ctrl
-
-    static double standardSampleRates[] =
-    {
-        8000.0,     9600.0,
-        11025.0,    12000.0,
-        16000.0,    22050.0,
-        24000.0,    32000.0,
-        44100.0,    48000.0,
-        88200.0,    96000.0,
-        192000.0,   -1          // negative terminated  list
-    };
-
-    const PaDeviceInfo  *deviceInfo;
-    PaStreamParameters   inputParameters, outputParameters;
-    PaError              err;
-    wxString             str;
-    int                  i, numSampleRates;
-
-    deviceInfo = Pa_GetDeviceInfo(devNum);
-    if (deviceInfo == NULL) {
-        printf("Pa_GetDeviceInfo(%d) failed!\n", devNum);
-        cbSampleRate->Clear();
-        return 0;
-    }
-
-    inputParameters.device = devNum;
-    inputParameters.channelCount = deviceInfo->maxInputChannels;
-    inputParameters.sampleFormat = paInt16;
-    inputParameters.suggestedLatency = 0;
-    inputParameters.hostApiSpecificStreamInfo = NULL;
-        
-    outputParameters.device = devNum;
-    outputParameters.channelCount = deviceInfo->maxOutputChannels;
-    outputParameters.sampleFormat = paInt16;
-    outputParameters.suggestedLatency = 0;
-    outputParameters.hostApiSpecificStreamInfo = NULL;
-    
-    cbSampleRate->Clear();
-    //printf("devNum %d supports: ", devNum);
-    numSampleRates = 0;
-    for(i = 0; standardSampleRates[i] > 0; i++)
-    {      
-        if (in_out == AUDIO_IN)
-            err = Pa_IsFormatSupported(&inputParameters, NULL, standardSampleRates[i]);
-        else
-            err = Pa_IsFormatSupported(NULL, &outputParameters, standardSampleRates[i]);
-
-        if( err == paFormatIsSupported ) {
-            str.Printf("%i", (int)standardSampleRates[i]);
-            cbSampleRate->AppendString(str);
-            printf("%i ", (int)standardSampleRates[i]);
-            numSampleRates++;
-        }
-    }
-    printf("\n");
-
-    return numSampleRates;
-}
-
-//-------------------------------------------------------------------------
-// showAPIInfo()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::showAPIInfo()
-{
-    wxString    strval;
-    int         apiVersion;
-    int         apiCount        = 0;
-    int         numDevices      = 0;
-
-    strval = Pa_GetVersionText();
-    m_textStringVer->SetLabel(strval);
-
-    apiVersion = Pa_GetVersion();
-    strval.Printf(wxT("%d"), apiVersion);
-    m_textIntVer->SetLabel(strval);
-
-    apiCount = Pa_GetHostApiCount();
-    strval.Printf(wxT("%d"), apiCount);
-    m_textAPICount->SetLabel(strval);
-
-    numDevices = Pa_GetDeviceCount();
-    strval.Printf(wxT("%d"), numDevices);
-    m_textCDevCount->SetLabel(strval);
-}
-
-//-------------------------------------------------------------------------
-// populateParams()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::populateParams(AudioInfoDisplay ai)
-{
-    const       PaDeviceInfo *deviceInfo = NULL;
-    wxListCtrl* ctrl    = ai.m_listDevices;
-    int         in_out  = ai.direction;
-    long        idx;
-    int         numDevices;
-    wxListItem  listItem;
-    wxString    buf;
-    int         devn;
-    int         col = 0;
-
-    numDevices = Pa_GetDeviceCount();
-
-    if(ctrl->GetColumnCount() > 0)
-    {
-        ctrl->ClearAll();
-    }
-
-    listItem.SetAlign(wxLIST_FORMAT_LEFT);
-    listItem.SetText(wxT("Device"));
-    idx = ctrl->InsertColumn(col, listItem);
-    ctrl->SetColumnWidth(col++, 300);
-
-    listItem.SetAlign(wxLIST_FORMAT_CENTRE);
-    listItem.SetText(wxT("ID"));
-    idx = ctrl->InsertColumn(col, listItem);
-    ctrl->SetColumnWidth(col++, 45);
-
-    listItem.SetAlign(wxLIST_FORMAT_LEFT);
-    listItem.SetText(wxT("API"));
-    idx = ctrl->InsertColumn(col, listItem);
-    ctrl->SetColumnWidth(col++, 100);
-
-    if(in_out == AUDIO_IN)
-    {
-        listItem.SetAlign(wxLIST_FORMAT_CENTRE);
-        listItem.SetText(wxT("Default Sample Rate"));
-        idx = ctrl->InsertColumn(col, listItem);
-        ctrl->SetColumnWidth(col++, 160);
-    }
-    else if(in_out == AUDIO_OUT)
-    {
-        listItem.SetAlign(wxLIST_FORMAT_CENTRE);
-        listItem.SetText(wxT("Default Sample Rate"));
-        idx = ctrl->InsertColumn(col, listItem);
-        ctrl->SetColumnWidth(col++, 160);
-    }
-
-    #ifdef LATENCY
-    listItem.SetAlign(wxLIST_FORMAT_CENTRE);
-    listItem.SetText(wxT("Min Latency"));
-    ctrl->InsertColumn(col, listItem);
-    ctrl->SetColumnWidth(col++, 100);
-
-    listItem.SetAlign(wxLIST_FORMAT_CENTRE);
-    listItem.SetText(wxT("Max Latency"));
-    ctrl->InsertColumn(col, listItem);
-    ctrl->SetColumnWidth(col++, 100);
-    #endif
-
-    for(devn = 0; devn < numDevices; devn++)
-    {
-        buf.Printf(wxT(""));
-        deviceInfo = Pa_GetDeviceInfo(devn);
-        if( ((in_out == AUDIO_IN) && (deviceInfo->maxInputChannels > 0)) ||
-            ((in_out == AUDIO_OUT) && (deviceInfo->maxOutputChannels > 0)))
-        {
-            col = 0;
-            buf.Printf(wxT("%s"), deviceInfo->name);
-            idx = ctrl->InsertItem(ctrl->GetItemCount(), buf);
-            col++;
-                
-            buf.Printf(wxT("%d"), devn);
-            ctrl->SetItem(idx, col++, buf);
-
-            buf.Printf(wxT("%s"), Pa_GetHostApiInfo(deviceInfo->hostApi)->name);
-            ctrl->SetItem(idx, col++, buf);
-
-            buf.Printf(wxT("%i"), (int)deviceInfo->defaultSampleRate);
-            ctrl->SetItem(idx, col++, buf);
-
-            #ifdef LATENCY
-            if (in_out == AUDIO_IN)
-                buf.Printf(wxT("%8.4f"), deviceInfo->defaultLowInputLatency);
-            else
-                buf.Printf(wxT("%8.4f"), deviceInfo->defaultLowOutputLatency);               
-            ctrl->SetItem(idx, col++, buf);
-
-            if (in_out == AUDIO_IN)
-                buf.Printf(wxT("%8.4f"), deviceInfo->defaultHighInputLatency);
-            else
-                 buf.Printf(wxT("%8.4f"), deviceInfo->defaultHighOutputLatency);             
-            ctrl->SetItem(idx, col++, buf);
-            #endif
-        }        
-    }
-
-    // add "none" option at end
-
-    buf.Printf(wxT("%s"), "none");
-    idx = ctrl->InsertItem(ctrl->GetItemCount(), buf);
-}
-
-//-------------------------------------------------------------------------
-// OnDeviceSelect()
-//
-// helper function to set up "Device:" and "Sample Rate:" fields when
-// we click on a line in the list of devices box
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnDeviceSelect(wxComboBox *cbSampleRate, 
-                                     wxTextCtrl *textCtrl, 
-                                     int        *devNum, 
-                                     wxListCtrl *listCtrlDevices, 
-                                     int         index,
-                                     int         in_out)
-{
-
-    wxString devName = listCtrlDevices->GetItemText(index, 0);
-     if (devName.IsSameAs("none")) {
-        *devNum = -1;
-        textCtrl->SetValue("none");
-    }
-    else {
-        *devNum = wxAtoi(listCtrlDevices->GetItemText(index, 1));
-        textCtrl->SetValue(devName + " (" + wxString::Format(wxT("%i"),*devNum) + ")");
-
-        int numSampleRates = buildListOfSupportedSampleRates(cbSampleRate, *devNum, in_out);
-        if (numSampleRates) {
-            wxString defSampleRate = listCtrlDevices->GetItemText(index, 3);        
-            cbSampleRate->SetValue(defSampleRate);
-        }
-        else {
-             cbSampleRate->SetValue("None");           
-        }
-    }
-}
-
-//-------------------------------------------------------------------------
-// OnRxInDeviceSelect()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnRxInDeviceSelect(wxListEvent& evt)
-{
-    OnDeviceSelect(m_cbSampleRateRxIn, 
-                   m_textCtrlRxIn, 
-                   &rxInAudioDeviceNum, 
-                   m_listCtrlRxInDevices, 
-                   evt.GetIndex(),
-                   AUDIO_IN);
-}
-
-//-------------------------------------------------------------------------
-// OnRxOutDeviceSelect()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnRxOutDeviceSelect(wxListEvent& evt)
-{
-    OnDeviceSelect(m_cbSampleRateRxOut, 
-                   m_textCtrlRxOut, 
-                   &rxOutAudioDeviceNum, 
-                   m_listCtrlRxOutDevices, 
-                   evt.GetIndex(),
-                   AUDIO_OUT);
-}
-
-//-------------------------------------------------------------------------
-// OnTxInDeviceSelect()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnTxInDeviceSelect(wxListEvent& evt)
-{
-    OnDeviceSelect(m_cbSampleRateTxIn, 
-                   m_textCtrlTxIn, 
-                   &txInAudioDeviceNum, 
-                   m_listCtrlTxInDevices, 
-                   evt.GetIndex(),
-                   AUDIO_IN);
-}
-
-//-------------------------------------------------------------------------
-// OnTxOutDeviceSelect()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnTxOutDeviceSelect(wxListEvent& evt)
-{
-    OnDeviceSelect(m_cbSampleRateTxOut, 
-                   m_textCtrlTxOut, 
-                   &txOutAudioDeviceNum, 
-                   m_listCtrlTxOutDevices, 
-                   evt.GetIndex(),
-                   AUDIO_OUT);
-}
-
-//-------------------------------------------------------------------------
-// plotDeviceInputForAFewSecs()
-//
-// opens a record device and plots the input speech for a few seconds.  This is "modal" using
-// synchronous portaudio functions, so the GUI will not respond until after test sample has been
-// taken
-//-------------------------------------------------------------------------
-void AudioOptsDialog::plotDeviceInputForAFewSecs(int devNum, PlotScalar *plotScalar) {
-    PaStreamParameters  inputParameters;
-    const PaDeviceInfo *deviceInfo = NULL;
-    PaStream           *stream = NULL;
-    PaError             err;
-    short               in48k_stereo_short[2*TEST_BUF_SIZE];
-    short               in48k_short[TEST_BUF_SIZE];
-    short               in8k_short[TEST_BUF_SIZE];
-    int                 numDevices, nBufs, i, j, src_error,inputChannels;
-    float               t;
-    SRC_STATE          *src;
-    FIFO               *fifo;
-
-    // a basic sanity check
-    numDevices = Pa_GetDeviceCount();
-    if (devNum >= numDevices)
-        return;
-    if (devNum < 0)
-        return;
-    printf("devNum %d\n", devNum);
-
-    fifo = fifo_create((int)(DT*TEST_WAVEFORM_PLOT_FS*2)); assert(fifo != NULL);
-    src = src_new(SRC_SINC_FASTEST, 1, &src_error); assert(src != NULL);
-
-    // work out how many input channels this device supports.
-
-    deviceInfo = Pa_GetDeviceInfo(devNum);
-    if (deviceInfo == NULL) {
-        wxMessageBox(wxT("Couldn't get device info from Port Audio for Sound Card "), wxT("Error"), wxOK);
-        return;
-    }
-    if (deviceInfo->maxInputChannels == 1)
-        inputChannels = 1;
-    else
-        inputChannels = 2;
-
-    // open device
-
-    inputParameters.device = devNum;
-    inputParameters.channelCount = inputChannels;
-    inputParameters.sampleFormat = paInt16;
-    inputParameters.suggestedLatency = Pa_GetDeviceInfo( inputParameters.device )->defaultHighInputLatency;
-    inputParameters.hostApiSpecificStreamInfo = NULL;
-
-    nBufs = TEST_WAVEFORM_PLOT_TIME*TEST_FS/TEST_BUF_SIZE;
-    printf("inputChannels: %d nBufs %d\n", inputChannels, nBufs);
-
-    err = Pa_OpenStream(
-              &stream,
-              &inputParameters,
-              NULL,
-              TEST_FS,
-              TEST_BUF_SIZE,
-              paClipOff,    
-              NULL,       // no callback, use blocking API
-              NULL ); 
-    if (err != paNoError) {
-        wxMessageBox(wxT("Couldn't initialise sound device."), wxT("Error"), wxOK);       
-        return;
-    }
-
-    err = Pa_StartStream(stream);
-    if (err != paNoError) {
-        wxMessageBox(wxT("Couldn't start sound device."), wxT("Error"), wxOK);       
-        return;
-    }
-
-    for(i=0, t=0.0; i<nBufs; i++, t+=(float)TEST_BUF_SIZE/TEST_FS) {
-        Pa_ReadStream(stream, in48k_stereo_short, TEST_BUF_SIZE);
-        if (inputChannels == 2) {
-            for(j=0; j<TEST_BUF_SIZE; j++)
-                in48k_short[j] = in48k_stereo_short[2*j]; // left channel only
-        }
-        else {
-            for(j=0; j<TEST_BUF_SIZE; j++)
-                in48k_short[j] = in48k_stereo_short[j]; 
-        }
-        int n8k = resample(src, in8k_short, in48k_short, 8000, TEST_FS, TEST_BUF_SIZE, TEST_BUF_SIZE);
-        resample_for_plot(fifo, in8k_short, n8k, FS);
-
-        // every TEST_DT seconds update plot, unfortunately plot
-        // doesnt get updated to end as we are blocking events in this
-        // function
-
-        if (t > TEST_DT) {
-            t -= TEST_DT;
-            short plotSamples[TEST_WAVEFORM_PLOT_BUF];
-            if (fifo_read(fifo, plotSamples, TEST_WAVEFORM_PLOT_BUF))
-                memset(plotSamples, 0, TEST_WAVEFORM_PLOT_BUF*sizeof(short));
-            plotScalar->add_new_short_samples(0, plotSamples, TEST_WAVEFORM_PLOT_BUF, 32767);
-            plotScalar->Refresh();
-       }
-    }
-   
-    err = Pa_StopStream(stream);
-    if (err != paNoError) {
-        wxMessageBox(wxT("Couldn't stop sound device."), wxT("Error"), wxOK);       
-        return;
-    }
-    Pa_CloseStream(stream);
-
-    fifo_destroy(fifo);
-    src_delete(src);
-}
-
-//-------------------------------------------------------------------------
-// plotDeviceOutputForAFewSecs()
-//
-// opens a play device and plays a tone for a few seconds.  This is "modal" using
-// synchronous portaudio functions, so the GUI will not respond until after test sample has been
-// taken.  Also plots a pretty picture like the record versions
-//-------------------------------------------------------------------------
-void AudioOptsDialog::plotDeviceOutputForAFewSecs(int devNum, PlotScalar *plotScalar) {
-    PaStreamParameters  outputParameters;
-    const PaDeviceInfo *deviceInfo = NULL;
-    PaStream           *stream = NULL;
-    PaError             err;
-    short               out48k_stereo_short[2*TEST_BUF_SIZE];
-    short               out48k_short[TEST_BUF_SIZE];
-    short               out8k_short[TEST_BUF_SIZE];
-    int                 numDevices, nBufs, i, j, src_error, n, outputChannels;
-    float               t;
-    SRC_STATE          *src;
-    FIFO               *fifo;
-
-    // a basic sanity check
-    numDevices = Pa_GetDeviceCount();
-    if (devNum >= numDevices)
-        return;
-    if (devNum < 0)
-        return;
-
-    fifo = fifo_create((int)(DT*TEST_WAVEFORM_PLOT_FS*2)); assert(fifo != NULL);
-    src = src_new(SRC_SINC_FASTEST, 1, &src_error); assert(src != NULL);
-
-    // work out how many output channels this device supports.
-
-    deviceInfo = Pa_GetDeviceInfo(devNum);
-    if (deviceInfo == NULL) {
-        wxMessageBox(wxT("Couldn't get device info from Port Audio for Sound Card "), wxT("Error"), wxOK);
-        return;
-    }
-    if (deviceInfo->maxOutputChannels == 1)
-        outputChannels = 1;
-    else
-        outputChannels = 2;
-
-    printf("outputChannels: %d\n", outputChannels);
-
-    outputParameters.device = devNum;
-    outputParameters.channelCount = outputChannels;
-    outputParameters.sampleFormat = paInt16;
-    outputParameters.suggestedLatency = Pa_GetDeviceInfo( outputParameters.device )->defaultHighOutputLatency;
-    outputParameters.hostApiSpecificStreamInfo = NULL;
-
-    nBufs = TEST_WAVEFORM_PLOT_TIME*TEST_FS/TEST_BUF_SIZE;
-
-    err = Pa_OpenStream(
-              &stream,
-              NULL,
-              &outputParameters,
-              TEST_FS,
-              TEST_BUF_SIZE,
-              paClipOff,    
-              NULL,       // no callback, use blocking API
-              NULL ); 
-    if (err != paNoError) {
-        wxMessageBox(wxT("Couldn't initialise sound device."), wxT("Error"), wxOK);       
-        return;
-    }
-
-    err = Pa_StartStream(stream);
-    if (err != paNoError) {
-        wxMessageBox(wxT("Couldn't start sound device."), wxT("Error"), wxOK);       
-        return;
-    }
-
-    for(i=0, t=0.0, n=0; i<nBufs; i++, t+=(float)TEST_BUF_SIZE/TEST_FS) {
-        for(j=0; j<TEST_BUF_SIZE; j++,n++) {
-            out48k_short[j] = 2000.0*cos(6.2832*(n++)*400.0/TEST_FS);
-            if (outputChannels == 2) {
-                out48k_stereo_short[2*j] = out48k_short[j];   // left channel
-                out48k_stereo_short[2*j+1] = out48k_short[j]; // right channel
-            }
-            else {
-                out48k_stereo_short[j] = out48k_short[j];     // mono
-            }
-        }
-        Pa_WriteStream(stream, out48k_stereo_short, TEST_BUF_SIZE);
-
-        // convert back to 8kHz just for plotting
-        int n8k = resample(src, out8k_short, out48k_short, 8000, TEST_FS, TEST_BUF_SIZE, TEST_BUF_SIZE);
-        resample_for_plot(fifo, out8k_short, n8k, FS);
-
-        // every TEST_DT seconds update plot
-
-        if (t > TEST_DT) {
-            t -= TEST_DT;
-            short plotSamples[TEST_WAVEFORM_PLOT_BUF];
-            if (fifo_read(fifo, plotSamples, TEST_WAVEFORM_PLOT_BUF))
-                memset(plotSamples, 0, TEST_WAVEFORM_PLOT_BUF*sizeof(short));
-            plotScalar->add_new_short_samples(0, plotSamples, TEST_WAVEFORM_PLOT_BUF, 32767);
-            plotScalar->Refresh();
-       }
-    }
-   
-    err = Pa_StopStream(stream);
-    if (err != paNoError) {
-        wxMessageBox(wxT("Couldn't stop sound device."), wxT("Error"), wxOK);       
-        return;
-    }
-    Pa_CloseStream(stream);
-
-    fifo_destroy(fifo);
-    src_delete(src);
-}
-
-//-------------------------------------------------------------------------
-// OnRxInTest()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnRxInTest(wxCommandEvent& event)
-{
-    plotDeviceInputForAFewSecs(rxInAudioDeviceNum, m_plotScalarRxIn);
-}
-
-//-------------------------------------------------------------------------
-// OnRxOutTest()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnRxOutTest(wxCommandEvent& event)
-{
-    plotDeviceOutputForAFewSecs(rxOutAudioDeviceNum, m_plotScalarRxOut);
-}
-
-//-------------------------------------------------------------------------
-// OnTxInTest()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnTxInTest(wxCommandEvent& event)
-{
-    plotDeviceInputForAFewSecs(txInAudioDeviceNum, m_plotScalarTxIn);
-}
-
-//-------------------------------------------------------------------------
-// OnTxOutTest()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnTxOutTest(wxCommandEvent& event)
-{
-    plotDeviceOutputForAFewSecs(txOutAudioDeviceNum, m_plotScalarTxOut);
-}
-
-//-------------------------------------------------------------------------
-// OnRefreshClick()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnRefreshClick(wxCommandEvent& event)
-{
-    // restart portaudio, to re-sample available devices
-
-    Pa_Terminate();
-    Pa_Init();
-
-    m_notebook1->SetSelection(0);
-    showAPIInfo();
-    populateParams(m_RxInDevices);
-    populateParams(m_RxOutDevices);
-    populateParams(m_TxInDevices);
-    populateParams(m_TxOutDevices);
-
-    // some devices may have dissapeared, so possibily change sound
-    // card config
-
-    ExchangeData(EXCHANGE_DATA_IN);
-}
-
-//-------------------------------------------------------------------------
-// OnApplyAudioParameters()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnApplyAudioParameters(wxCommandEvent& event)
-{
-    ExchangeData(EXCHANGE_DATA_OUT);
-    if(m_isPaInitialized)
-    {
-        if((pa_err = Pa_Terminate()) == paNoError)
-        {
-            m_isPaInitialized = false;
-        }
-        else
-        {
-            wxMessageBox(wxT("Port Audio failed to Terminate"), wxT("Pa_Terminate"), wxOK);
-        }
-    }
-}
-
-//-------------------------------------------------------------------------
-// OnCancelAudioParameters()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnCancelAudioParameters(wxCommandEvent& event)
-{
-    if(m_isPaInitialized)
-    {
-        if((pa_err = Pa_Terminate()) == paNoError)
-        {
-            m_isPaInitialized = false;
-        }
-        else
-        {
-            wxMessageBox(wxT("Port Audio failed to Terminate"), wxT("Pa_Terminate"), wxOK);
-        }
-    }
-    EndModal(wxCANCEL);
-}
-
-//-------------------------------------------------------------------------
-// OnOkAudioParameters()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnOkAudioParameters(wxCommandEvent& event)
-{
-    int status = ExchangeData(EXCHANGE_DATA_OUT);
-
-    // We only accept OK if config sucessful
-
-    printf("status: %d m_isPaInitialized: %d\n", status, m_isPaInitialized);
-    if (status == 0) {
-        if(m_isPaInitialized)
-        {
-            if((pa_err = Pa_Terminate()) == paNoError)
-            {
-                printf("terminated OK\n");
-                m_isPaInitialized = false;
-            }
-            else
-            {
-                wxMessageBox(wxT("Port Audio failed to Terminate"), wxT("Pa_Terminate"), wxOK);
-            }
-        }
-        EndModal(wxOK);
-    }
-
-}
diff --git a/fdmdv2-dev/src/dlg_audiooptions.h b/fdmdv2-dev/src/dlg_audiooptions.h
deleted file mode 100644 (file)
index 7a78b59..0000000
+++ /dev/null
@@ -1,176 +0,0 @@
-//=========================================================================
-// Name:          AudioInfoDisplay.h
-// Purpose:       Declares simple wxWidgets application with GUI
-//                created using wxFormBuilder.
-// 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 <http://www.gnu.org/licenses/>.
-//
-//=========================================================================
-#ifndef __AudioOptsDialog__
-#define __AudioOptsDialog__
-
-#include "fdmdv2_main.h"
-
-#define ID_AUDIO_OPTIONS    1000
-#define AUDIO_IN            0
-#define AUDIO_OUT           1
-
-#include "portaudio.h"
-#ifdef WIN32
-#if PA_USE_ASIO
-#include "pa_asio.h"
-#endif
-#endif
-#include "codec2_fifo.h"
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// AudioInfoDisplay
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class AudioInfoDisplay
-{
-    public:
-        wxListCtrl*     m_listDevices;
-        int             direction;
-        wxTextCtrl*     m_textDevice;
-        wxComboBox*     m_cbSampleRate;
-};
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// class AudioOptsDialog
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class AudioOptsDialog : public wxDialog
-{
-    private:
-
-    protected:
-        PaError         pa_err;
-        bool            m_isPaInitialized;
-
-        int             rxInAudioDeviceNum;
-        int             rxOutAudioDeviceNum;
-        int             txInAudioDeviceNum;
-        int             txOutAudioDeviceNum;
-
-        void buildTestControls(PlotScalar **plotScalar, wxButton **btnTest, 
-                               wxPanel *parentPanel, wxBoxSizer *bSizer, wxString buttonLabel);
-        void plotDeviceInputForAFewSecs(int devNum, PlotScalar *plotScalar);
-        void plotDeviceOutputForAFewSecs(int devNum, PlotScalar *plotScalar);
-
-        int buildListOfSupportedSampleRates(wxComboBox *cbSampleRate, int devNum, int in_out);
-        void populateParams(AudioInfoDisplay);
-        void showAPIInfo();
-        int setTextCtrlIfDevNumValid(wxTextCtrl *textCtrl, wxListCtrl *listCtrl, int devNum);
-        void Pa_Init(void);
-        void OnDeviceSelect(wxComboBox *cbSampleRate, 
-                            wxTextCtrl *textCtrl, 
-                            int        *devNum, 
-                            wxListCtrl *listCtrlDevices, 
-                            int         index,
-                            int         in_out);
-
-        AudioInfoDisplay m_RxInDevices;
-        AudioInfoDisplay m_RxOutDevices;
-        AudioInfoDisplay m_TxInDevices;
-        AudioInfoDisplay m_TxOutDevices;
-        wxPanel* m_panel1;
-        wxNotebook* m_notebook1;
-
-        wxPanel* m_panelRx;
-
-        wxListCtrl* m_listCtrlRxInDevices;
-        wxStaticText* m_staticText51;
-        wxTextCtrl* m_textCtrlRxIn;
-        wxStaticText* m_staticText6;
-        wxComboBox* m_cbSampleRateRxIn;
-
-        wxButton* m_btnRxInTest;
-        PlotScalar* m_plotScalarRxIn;
-
-        wxListCtrl* m_listCtrlRxOutDevices;
-        wxStaticText* m_staticText9;
-        wxTextCtrl* m_textCtrlRxOut;
-        wxStaticText* m_staticText10;
-        wxComboBox* m_cbSampleRateRxOut;
-
-        wxButton* m_btnRxOutTest;
-        PlotScalar* m_plotScalarRxOut;
-
-        wxPanel* m_panelTx;
-
-        wxListCtrl* m_listCtrlTxInDevices;
-        wxStaticText* m_staticText12;
-        wxTextCtrl* m_textCtrlTxIn;
-        wxStaticText* m_staticText11;
-        wxComboBox* m_cbSampleRateTxIn;
-
-        wxButton* m_btnTxInTest;
-        PlotScalar* m_plotScalarTxIn;
-
-        wxListCtrl* m_listCtrlTxOutDevices;
-        wxStaticText* m_staticText81;
-        wxTextCtrl* m_textCtrlTxOut;
-        wxStaticText* m_staticText71;
-        wxComboBox* m_cbSampleRateTxOut;
-
-        wxButton* m_btnTxOutTest;
-        PlotScalar* m_plotScalarTxOut;
-
-        wxPanel* m_panelAPI;
-
-        wxStaticText* m_staticText7;
-        wxStaticText* m_textStringVer;
-        wxStaticText* m_staticText8;
-        wxStaticText* m_textIntVer;
-        wxStaticText* m_staticText5;
-        wxStaticText* m_textCDevCount;
-        wxStaticText* m_staticText4;
-        wxStaticText* m_textAPICount;
-        wxButton* m_btnRefresh;
-        wxStdDialogButtonSizer* m_sdbSizer1;
-        wxButton* m_sdbSizer1OK;
-        wxButton* m_sdbSizer1Apply;
-        wxButton* m_sdbSizer1Cancel;
-
-        // Virtual event handlers, overide them in your derived class
-        //virtual void OnActivateApp( wxActivateEvent& event ) { event.Skip(); }
-//        virtual void OnCloseFrame( wxCloseEvent& event ) { event.Skip(); }
-
-        void OnRxInDeviceSelect( wxListEvent& event );
-
-        void OnRxInTest( wxCommandEvent& event );
-        void OnRxOutTest( wxCommandEvent& event );
-        void OnTxInTest( wxCommandEvent& event );
-        void OnTxOutTest( wxCommandEvent& event );
-
-        void OnRxOutDeviceSelect( wxListEvent& event );
-        void OnTxInDeviceSelect( wxListEvent& event );
-        void OnTxOutDeviceSelect( wxListEvent& event );
-        void OnRefreshClick( wxCommandEvent& event );
-        void OnApplyAudioParameters( wxCommandEvent& event );
-        void OnCancelAudioParameters( wxCommandEvent& event );
-        void OnOkAudioParameters( wxCommandEvent& event );
-        // Virtual event handlers, overide them in your derived class
-        void OnClose( wxCloseEvent& event ) { event.Skip(); }
-        void OnHibernate( wxActivateEvent& event ) { event.Skip(); }
-        void OnIconize( wxIconizeEvent& event ) { event.Skip(); }
-        void OnInitDialog( wxInitDialogEvent& event );
-
-    public:
-
-        AudioOptsDialog( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Audio Config"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 300,300 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
-        ~AudioOptsDialog();
-        int ExchangeData(int inout);
-};
-#endif //__AudioOptsDialog__
diff --git a/fdmdv2-dev/src/dlg_filter.cpp b/fdmdv2-dev/src/dlg_filter.cpp
deleted file mode 100644 (file)
index 0de8e8c..0000000
+++ /dev/null
@@ -1,786 +0,0 @@
-//==========================================================================
-// Name:            dlg_filter.cpp
-// Purpose:         Dialog for controlling Codec audio filtering
-// Date:            Nov 25 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#include "dlg_filter.h"
-
-#define SLIDER_MAX 100
-#define SLIDER_LENGTH 100
-
-#define FILTER_MIN_MAG_DB -20.0
-#define FILTER_MAX_MAG_DB  20.0
-
-#define MAX_FREQ_BASS      600.00
-#define MAX_FREQ_TREBLE   3900.00
-#define MAX_FREQ_DEF      3000.00
-
-#define MIN_GAIN          -20
-#define MAX_GAIN           20
-
-#define MAX_LOG10_Q         1.0
-#define MIN_LOG10_Q        -1.0 
-
-// DFT parameters
-
-#define IMP_AMP           2000.0                     // amplitude of impulse
-#define NIMP              50                         // number of samples in impulse response
-#define F_STEP_DFT        10.0                       // frequency steps to sample spectrum
-#define F_MAG_N           (int)(MAX_F_HZ/F_STEP_DFT) // number of frequency steps
-
-extern struct freedv      *g_pfreedv;
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class FilterDlg
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-FilterDlg::FilterDlg(wxWindow* parent, bool running, bool *newMicInFilter, bool *newSpkOutFilter,
-                     wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style)
-{
-    m_running = running;
-    m_newMicInFilter = newMicInFilter;
-    m_newSpkOutFilter = newSpkOutFilter;
-
-    this->SetSizeHints(wxDefaultSize, wxDefaultSize);
-
-    wxBoxSizer* bSizer30;
-    bSizer30 = new wxBoxSizer(wxVERTICAL);
-
-    // LPC Post Filter --------------------------------------------------------
-
-    wxStaticBoxSizer* lpcpfs = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("LPC Post Filter")), wxHORIZONTAL);
-
-    wxBoxSizer* left = new wxBoxSizer(wxVERTICAL);
-
-    m_codec2LPCPostFilterEnable = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition,wxDefaultSize, wxCHK_2STATE);
-    left->Add(m_codec2LPCPostFilterEnable);
-
-    m_codec2LPCPostFilterBassBoost = new wxCheckBox(this, wxID_ANY, _("0-1 kHz 3dB Boost"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
-    left->Add(m_codec2LPCPostFilterBassBoost);
-    lpcpfs->Add(left, 0, wxALL, 5);
-
-    newLPCPFControl(&m_codec2LPCPostFilterBeta, &m_staticTextBeta, lpcpfs, "Beta");
-    newLPCPFControl(&m_codec2LPCPostFilterGamma, &m_staticTextGamma, lpcpfs, "Gamma");
-
-    m_LPCPostFilterDefault = new wxButton(this, wxID_ANY, wxT("Default"));
-    lpcpfs->Add(m_LPCPostFilterDefault, 0, wxALL|wxALIGN_CENTRE_HORIZONTAL|wxALIGN_CENTRE_VERTICAL, 5);
-
-    bSizer30->Add(lpcpfs, 0, wxALL, 0);
-
-    // Speex pre-processor --------------------------------------------------
-
-    wxStaticBoxSizer* sbSizer_speexpp;
-    wxStaticBox *sb_speexpp = new wxStaticBox(this, wxID_ANY, _("Speex Mic Audio Pre-Processor"));
-    sbSizer_speexpp = new wxStaticBoxSizer(sb_speexpp, wxVERTICAL);
-
-    m_ckboxSpeexpp = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
-    sb_speexpp->SetToolTip(_("Enable noise supression, dereverberation, AGC of mic signal"));
-    sbSizer_speexpp->Add(m_ckboxSpeexpp, wxALIGN_LEFT, 2);
-
-    bSizer30->Add(sbSizer_speexpp, 0, wxALL, 0);   
-
-    // EQ Filters -----------------------------------------------------------
-
-    wxStaticBoxSizer* eqMicInSizer = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Mic In Equaliser")), wxVERTICAL);
-    wxBoxSizer* eqMicInSizer1 = new wxBoxSizer(wxHORIZONTAL);
-    wxBoxSizer* eqMicInSizer2 = new wxBoxSizer(wxHORIZONTAL);
-
-    m_MicInBass   = newEQ(eqMicInSizer1, "Bass"  , MAX_FREQ_BASS, disableQ);
-    m_MicInTreble = newEQ(eqMicInSizer1, "Treble", MAX_FREQ_TREBLE, disableQ);
-    eqMicInSizer->Add(eqMicInSizer1);
-
-    m_MicInEnable = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition,wxDefaultSize, wxCHK_2STATE);
-    eqMicInSizer2->Add(m_MicInEnable,0,wxALIGN_CENTRE_VERTICAL|wxRIGHT,10);
-    m_MicInMid    = newEQ(eqMicInSizer2, "Mid"   , MAX_FREQ_DEF, enableQ);
-    m_MicInDefault = new wxButton(this, wxID_ANY, wxT("Default"));
-    eqMicInSizer2->Add(m_MicInDefault,0,wxALIGN_CENTRE_VERTICAL|wxLEFT,20);
-    eqMicInSizer->Add(eqMicInSizer2);
-
-    wxStaticBoxSizer* eqSpkOutSizer = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Speaker Out Equaliser")), wxVERTICAL);
-    wxBoxSizer* eqSpkOutSizer1 = new wxBoxSizer(wxHORIZONTAL);
-    wxBoxSizer* eqSpkOutSizer2 = new wxBoxSizer(wxHORIZONTAL);
-
-    m_SpkOutBass   = newEQ(eqSpkOutSizer1, "Bass"  , MAX_FREQ_BASS, disableQ);
-    m_SpkOutTreble = newEQ(eqSpkOutSizer1, "Treble", MAX_FREQ_TREBLE, disableQ);
-    eqSpkOutSizer->Add(eqSpkOutSizer1);
-
-    m_SpkOutEnable = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition,wxDefaultSize, wxCHK_2STATE);
-    eqSpkOutSizer2->Add(m_SpkOutEnable,0,wxALIGN_CENTRE_VERTICAL|wxRIGHT,10);
-    m_SpkOutMid    = newEQ(eqSpkOutSizer2, "Mid"   , MAX_FREQ_DEF, enableQ);
-    m_SpkOutDefault = new wxButton(this, wxID_ANY, wxT("Default"));
-    eqSpkOutSizer2->Add(m_SpkOutDefault,0,wxALIGN_CENTRE_VERTICAL|wxLEFT,20);
-    eqSpkOutSizer->Add(eqSpkOutSizer2);
-    
-    bSizer30->Add(eqMicInSizer, 0, wxALL, 0);
-    bSizer30->Add(eqSpkOutSizer, 0, wxALL, 0);
-
-    // Storgage for spectrum magnitude plots ------------------------------------
-
-    m_MicInMagdB = new float[F_MAG_N];
-    for(int i=0; i<F_MAG_N; i++)
-        m_MicInMagdB[i] = 0.0;
-
-    m_SpkOutMagdB = new float[F_MAG_N];
-    for(int i=0; i<F_MAG_N; i++)
-        m_SpkOutMagdB[i] = 0.0;
-
-    // Spectrum Plots -----------------------------------------------------------
-
-    long nb_style = wxAUI_NB_BOTTOM | wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_MOVE | wxAUI_NB_SCROLL_BUTTONS;
-    m_auiNotebook = new wxAuiNotebook(this, wxID_ANY, wxDefaultPosition, wxSize(-1,200), nb_style);
-    m_auiNotebook->SetFont(wxFont(8, 70, 90, 90, false, wxEmptyString));
-
-    bSizer30->Add(m_auiNotebook, 0, wxEXPAND|wxALL, 3);
-    
-    m_MicInFreqRespPlot = new PlotSpectrum((wxFrame*) m_auiNotebook, m_MicInMagdB, F_MAG_N, FILTER_MIN_MAG_DB, FILTER_MAX_MAG_DB);
-    m_auiNotebook->AddPage(m_MicInFreqRespPlot, _("Microphone In Equaliser"));
-
-    m_SpkOutFreqRespPlot = new PlotSpectrum((wxFrame*)m_auiNotebook, m_SpkOutMagdB, F_MAG_N, FILTER_MIN_MAG_DB, FILTER_MAX_MAG_DB);
-    m_auiNotebook->AddPage(m_SpkOutFreqRespPlot, _("Speaker Out Equaliser"));
-
-    //  OK - Cancel buttons at the bottom --------------------------
-
-    wxBoxSizer* bSizer31 = new wxBoxSizer(wxHORIZONTAL);
-
-    m_sdbSizer5OK = new wxButton(this, wxID_OK);
-    bSizer31->Add(m_sdbSizer5OK, 0, wxALL, 2);
-
-    m_sdbSizer5Cancel = new wxButton(this, wxID_CANCEL);
-    bSizer31->Add(m_sdbSizer5Cancel, 0, wxALL, 2);
-
-    bSizer30->Add(bSizer31, 0, wxALIGN_RIGHT|wxALL, 0);
-
-    this->SetSizer(bSizer30);
-    this->Layout();
-
-    this->Centre(wxBOTH);
-    // Connect Events -------------------------------------------------------
-
-    this->Connect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(FilterDlg::OnInitDialog));
-
-    m_codec2LPCPostFilterEnable->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnEnable), NULL, this);
-    m_codec2LPCPostFilterBassBoost->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnBassBoost), NULL, this);
-    m_codec2LPCPostFilterBeta->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnBetaScroll), NULL, this);
-    m_codec2LPCPostFilterGamma->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnGammaScroll), NULL, this);
-    m_LPCPostFilterDefault->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnLPCPostFilterDefault), NULL, this);
-
-    m_ckboxSpeexpp->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnSpeexppEnable), NULL, this);
-
-    m_MicInBass.sliderFreq->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInBassFreqScroll), NULL, this);
-    m_MicInBass.sliderGain->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInBassGainScroll), NULL, this);
-    m_MicInTreble.sliderFreq->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInTrebleFreqScroll), NULL, this);
-    m_MicInTreble.sliderGain->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInTrebleGainScroll), NULL, this);
-    m_MicInMid.sliderFreq->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInMidFreqScroll), NULL, this);
-    m_MicInMid.sliderGain->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInMidGainScroll), NULL, this);
-    m_MicInMid.sliderQ->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInMidQScroll), NULL, this);
-    m_MicInEnable->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnMicInEnable), NULL, this);
-    m_MicInDefault->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnMicInDefault), NULL, this);
-
-    m_SpkOutBass.sliderFreq->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutBassFreqScroll), NULL, this);
-    m_SpkOutBass.sliderGain->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutBassGainScroll), NULL, this);
-    m_SpkOutTreble.sliderFreq->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutTrebleFreqScroll), NULL, this);
-    m_SpkOutTreble.sliderGain->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutTrebleGainScroll), NULL, this);
-    m_SpkOutMid.sliderFreq->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutMidFreqScroll), NULL, this);
-    m_SpkOutMid.sliderGain->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutMidGainScroll), NULL, this);
-    m_SpkOutMid.sliderQ->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutMidQScroll), NULL, this);
-    m_SpkOutEnable->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnSpkOutEnable), NULL, this);
-    m_SpkOutDefault->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnSpkOutDefault), NULL, this);
-
-    m_sdbSizer5Cancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnCancel), NULL, this);
-    m_sdbSizer5OK->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnOK), NULL, this);
-
-}
-
-//-------------------------------------------------------------------------
-// ~FilterDlg()
-//-------------------------------------------------------------------------
-FilterDlg::~FilterDlg()
-{
-    delete m_MicInMagdB;
-    delete m_SpkOutMagdB;
-
-    // Disconnect Events
-
-    this->Disconnect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(FilterDlg::OnInitDialog));
-
-    m_codec2LPCPostFilterEnable->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnEnable), NULL, this);
-    m_codec2LPCPostFilterBassBoost->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnBassBoost), NULL, this);
-    m_codec2LPCPostFilterBeta->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnBetaScroll), NULL, this);
-    m_codec2LPCPostFilterGamma->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnGammaScroll), NULL, this);
-    m_LPCPostFilterDefault->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnLPCPostFilterDefault), NULL, this);
-
-    m_MicInBass.sliderFreq->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInBassFreqScroll), NULL, this);
-    m_MicInBass.sliderGain->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInBassGainScroll), NULL, this);
-    m_MicInTreble.sliderFreq->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInTrebleFreqScroll), NULL, this);
-    m_MicInTreble.sliderGain->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInTrebleGainScroll), NULL, this);
-    m_MicInMid.sliderFreq->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInMidFreqScroll), NULL, this);
-    m_MicInMid.sliderGain->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInMidGainScroll), NULL, this);
-    m_MicInMid.sliderQ->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInMidQScroll), NULL, this);
-    m_MicInEnable->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnMicInEnable), NULL, this);
-    m_MicInDefault->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnMicInDefault), NULL, this);
-
-    m_SpkOutBass.sliderFreq->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutBassFreqScroll), NULL, this);
-    m_SpkOutBass.sliderGain->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutBassGainScroll), NULL, this);
-    m_SpkOutTreble.sliderFreq->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutTrebleFreqScroll), NULL, this);
-    m_SpkOutTreble.sliderGain->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutTrebleGainScroll), NULL, this);
-    m_SpkOutMid.sliderFreq->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutMidFreqScroll), NULL, this);
-    m_SpkOutMid.sliderGain->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutMidGainScroll), NULL, this);
-    m_SpkOutMid.sliderQ->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutMidQScroll), NULL, this);
-    m_SpkOutEnable->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnSpkOutEnable), NULL, this);
-    m_SpkOutDefault->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnSpkOutDefault), NULL, this);
-
-    m_sdbSizer5Cancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnCancel), NULL, this);
-    m_sdbSizer5OK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnOK), NULL, this);
-}
-
-void FilterDlg::newLPCPFControl(wxSlider **slider, wxStaticText **stValue, wxSizer *s, wxString controlName)
-{
-    wxBoxSizer *bs = new wxBoxSizer(wxHORIZONTAL);
-
-    wxStaticText* st = new wxStaticText(this, wxID_ANY, controlName, wxDefaultPosition, wxSize(70,-1), wxALIGN_RIGHT);
-    bs->Add(st, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 2);
-
-    *slider = new wxSlider(this, wxID_ANY, 0, 0, SLIDER_MAX, wxDefaultPosition, wxSize(SLIDER_LENGTH,wxDefaultCoord));
-    bs->Add(*slider, 1, wxALIGN_CENTER_VERTICAL|wxALL, 2);
-
-    *stValue = new wxStaticText(this, wxID_ANY, wxT("0.0"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
-    bs->Add(*stValue, 1, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxALL, 2);
-
-    s->Add(bs, 0);
-}
-
-void FilterDlg::newEQControl(wxSlider** slider, wxStaticText** value, wxStaticBoxSizer *bs, wxString controlName)
-{
-    wxStaticText* label = new wxStaticText(this, wxID_ANY, controlName, wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
-    bs->Add(label, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 0);
-
-    *slider = new wxSlider(this, wxID_ANY, 0, 0, SLIDER_MAX, wxDefaultPosition, wxSize(SLIDER_LENGTH,wxDefaultCoord));
-    bs->Add(*slider, 1, wxALIGN_CENTER_VERTICAL|wxALL, 0);
-
-    *value = new wxStaticText(this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(40,-1), wxALIGN_LEFT);
-    bs->Add(*value, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxRIGHT, 5);
-}
-
-EQ FilterDlg::newEQ(wxSizer *bs, wxString eqName, float maxFreqHz, bool enableQ)
-{
-    EQ eq;
-
-    wxStaticBoxSizer *bsEQ = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, eqName), wxHORIZONTAL);
-
-    newEQControl(&eq.sliderFreq, &eq.valueFreq, bsEQ, "Freq"); 
-    eq.maxFreqHz = maxFreqHz; 
-    eq.sliderFreqId = eq.sliderFreq->GetId();
-
-    newEQControl(&eq.sliderGain, &eq.valueGain, bsEQ, "Gain");
-    if (enableQ)
-        newEQControl(&eq.sliderQ, &eq.valueQ, bsEQ, "Q");
-    else
-        eq.sliderQ = NULL;
-
-    bs->Add(bsEQ);
-
-    return eq;
-}
-
-//-------------------------------------------------------------------------
-// ExchangeData()
-//-------------------------------------------------------------------------
-void FilterDlg::ExchangeData(int inout, bool storePersistent)
-{
-    wxConfigBase *pConfig = wxConfigBase::Get();
-    if(inout == EXCHANGE_DATA_IN)
-    {
-        // LPC Post filter
-
-        m_codec2LPCPostFilterEnable->SetValue(wxGetApp().m_codec2LPCPostFilterEnable);
-        m_codec2LPCPostFilterBassBoost->SetValue(wxGetApp().m_codec2LPCPostFilterBassBoost);
-        m_beta = wxGetApp().m_codec2LPCPostFilterBeta; setBeta();
-        m_gamma = wxGetApp().m_codec2LPCPostFilterGamma; setGamma();
-
-        // Speex Pre-Processor
-
-        m_ckboxSpeexpp->SetValue(wxGetApp().m_speexpp_enable);
-
-        // Mic In Equaliser
-
-        m_MicInBass.freqHz = wxGetApp().m_MicInBassFreqHz; 
-        m_MicInBass.freqHz = limit(m_MicInBass.freqHz, 1.0, MAX_FREQ_BASS);
-        setFreq(&m_MicInBass);
-        m_MicInBass.gaindB = wxGetApp().m_MicInBassGaindB;
-        m_MicInBass.gaindB = limit(m_MicInBass.gaindB, MIN_GAIN, MAX_GAIN);
-        setGain(&m_MicInBass);
-
-        m_MicInTreble.freqHz = wxGetApp().m_MicInTrebleFreqHz;
-        m_MicInTreble.freqHz = limit(m_MicInTreble.freqHz, 1.0, MAX_FREQ_TREBLE);
-        setFreq(&m_MicInTreble);
-        m_MicInTreble.gaindB = wxGetApp().m_MicInTrebleGaindB; 
-        m_MicInTreble.gaindB = limit(m_MicInTreble.gaindB, MIN_GAIN, MAX_GAIN);
-        setGain(&m_MicInTreble);
-
-        m_MicInMid.freqHz = wxGetApp().m_MicInMidFreqHz; 
-        m_MicInMid.freqHz = limit(m_MicInMid.freqHz, 1.0, MAX_FREQ_TREBLE);
-        setFreq(&m_MicInMid);
-        m_MicInMid.gaindB = wxGetApp().m_MicInMidGaindB; 
-        m_MicInMid.gaindB = limit(m_MicInMid.gaindB, MIN_GAIN, MAX_GAIN);
-        setGain(&m_MicInMid);
-        m_MicInMid.Q = wxGetApp().m_MicInMidQ;
-        m_MicInMid.Q = limit(m_MicInMid.Q, pow(10.0,MIN_LOG10_Q), pow(10.0, MAX_LOG10_Q));
-        setQ(&m_MicInMid);
-
-        m_MicInEnable->SetValue(wxGetApp().m_MicInEQEnable);
-
-        plotMicInFilterSpectrum();
-        // Spk Out Equaliser
-
-        m_SpkOutBass.freqHz = wxGetApp().m_SpkOutBassFreqHz;
-        m_SpkOutBass.freqHz = limit(m_SpkOutBass.freqHz, 1.0, MAX_FREQ_BASS);
-        setFreq(&m_SpkOutBass);
-        m_SpkOutBass.gaindB = wxGetApp().m_SpkOutBassGaindB; 
-        m_SpkOutBass.gaindB = limit(m_SpkOutBass.gaindB, MIN_GAIN, MAX_GAIN);
-        setGain(&m_SpkOutBass);
-
-        m_SpkOutTreble.freqHz = wxGetApp().m_SpkOutTrebleFreqHz; 
-        m_SpkOutTreble.freqHz = limit(m_SpkOutTreble.freqHz, 1.0, MAX_FREQ_TREBLE);
-        setFreq(&m_SpkOutTreble);
-        m_SpkOutTreble.gaindB = wxGetApp().m_SpkOutTrebleGaindB; 
-        m_SpkOutTreble.gaindB = limit(m_SpkOutTreble.gaindB, MIN_GAIN, MAX_GAIN);
-        setGain(&m_SpkOutTreble);
-
-        m_SpkOutMid.freqHz = wxGetApp().m_SpkOutMidFreqHz;
-        m_SpkOutMid.freqHz = limit(m_SpkOutMid.freqHz, 1.0, MAX_FREQ_TREBLE);
-        setFreq(&m_SpkOutMid);
-        m_SpkOutMid.gaindB = wxGetApp().m_SpkOutMidGaindB;
-        m_SpkOutMid.gaindB = limit(m_SpkOutMid.gaindB, MIN_GAIN, MAX_GAIN);
-        setGain(&m_SpkOutMid);
-        m_SpkOutMid.Q = wxGetApp().m_SpkOutMidQ;
-        m_SpkOutMid.Q = limit(m_SpkOutMid.Q, pow(10.0,MIN_LOG10_Q), pow(10.0, MAX_LOG10_Q));
-        setQ(&m_SpkOutMid);
-
-        m_SpkOutEnable->SetValue(wxGetApp().m_SpkOutEQEnable);
-
-        plotSpkOutFilterSpectrum();
-    }
-    if(inout == EXCHANGE_DATA_OUT)
-    {
-        // LPC Post filter
-
-        wxGetApp().m_codec2LPCPostFilterEnable     = m_codec2LPCPostFilterEnable->GetValue();
-        wxGetApp().m_codec2LPCPostFilterBassBoost  = m_codec2LPCPostFilterBassBoost->GetValue();
-        wxGetApp().m_codec2LPCPostFilterBeta       = m_beta;
-        wxGetApp().m_codec2LPCPostFilterGamma      = m_gamma;
-
-        // Speex Pre-Processor
-
-        wxGetApp().m_speexpp_enable = m_ckboxSpeexpp->GetValue();
-
-        // Mic In Equaliser
-
-        wxGetApp().m_MicInBassFreqHz = m_MicInBass.freqHz;
-        wxGetApp().m_MicInBassGaindB = m_MicInBass.gaindB;
-
-        wxGetApp().m_MicInTrebleFreqHz = m_MicInTreble.freqHz;
-        wxGetApp().m_MicInTrebleGaindB = m_MicInTreble.gaindB;
-
-        wxGetApp().m_MicInMidFreqHz = m_MicInMid.freqHz;
-        wxGetApp().m_MicInMidGaindB = m_MicInMid.gaindB;
-        wxGetApp().m_MicInMidQ = m_MicInMid.Q;
-
-        // Spk Out Equaliser
-
-        wxGetApp().m_SpkOutBassFreqHz = m_SpkOutBass.freqHz;
-        wxGetApp().m_SpkOutBassGaindB = m_SpkOutBass.gaindB;
-
-        wxGetApp().m_SpkOutTrebleFreqHz = m_SpkOutTreble.freqHz;
-        wxGetApp().m_SpkOutTrebleGaindB = m_SpkOutTreble.gaindB;
-
-        wxGetApp().m_SpkOutMidFreqHz = m_SpkOutMid.freqHz;
-        wxGetApp().m_SpkOutMidGaindB = m_SpkOutMid.gaindB;
-        wxGetApp().m_SpkOutMidQ = m_SpkOutMid.Q;
-
-        if (storePersistent) {
-            pConfig->Write(wxT("/Filter/codec2LPCPostFilterEnable"),     wxGetApp().m_codec2LPCPostFilterEnable);
-            pConfig->Write(wxT("/Filter/codec2LPCPostFilterBassBoost"),  wxGetApp().m_codec2LPCPostFilterBassBoost);
-            pConfig->Write(wxT("/Filter/codec2LPCPostFilterBeta"),       (int)(m_beta*100.0));
-            pConfig->Write(wxT("/Filter/codec2LPCPostFilterGamma"),      (int)(m_gamma*100.0));
-
-            pConfig->Write(wxT("/Filter/speexpp_enable"),                wxGetApp().m_speexpp_enable);
-
-            pConfig->Write(wxT("/Filter/MicInBassFreqHz"), (int)m_MicInBass.freqHz);
-            pConfig->Write(wxT("/Filter/MicInBassGaindB"), (int)(10.0*m_MicInBass.gaindB));
-            pConfig->Write(wxT("/Filter/MicInTrebleFreqHz"), (int)m_MicInTreble.freqHz);
-            pConfig->Write(wxT("/Filter/MicInTrebleGaindB"), (int)(10.0*m_MicInTreble.gaindB));
-            pConfig->Write(wxT("/Filter/MicInMidFreqHz"), (int)m_MicInMid.freqHz);
-            pConfig->Write(wxT("/Filter/MicInMidGaindB"), (int)(10.0*m_MicInMid.gaindB));
-            pConfig->Write(wxT("/Filter/MicInMidQ"), (int)(100.0*m_MicInMid.Q));
-
-            pConfig->Write(wxT("/Filter/SpkOutBassFreqHz"), (int)m_SpkOutBass.freqHz);
-            pConfig->Write(wxT("/Filter/SpkOutBassGaindB"), (int)(10.0*m_SpkOutBass.gaindB));
-            pConfig->Write(wxT("/Filter/SpkOutTrebleFreqHz"), (int)m_SpkOutTreble.freqHz);
-            pConfig->Write(wxT("/Filter/SpkOutTrebleGaindB"), (int)(10.0*m_SpkOutTreble.gaindB));
-            pConfig->Write(wxT("/Filter/SpkOutMidQ"), (int)(100.0*m_SpkOutMid.Q));
-            pConfig->Write(wxT("/Filter/SpkOutMidFreqHz"), (int)m_SpkOutMid.freqHz);
-            pConfig->Write(wxT("/Filter/SpkOutMidGaindB"), (int)(10.0*m_SpkOutMid.gaindB));
-
-            pConfig->Flush();
-        }
-    }
-    delete wxConfigBase::Set((wxConfigBase *) NULL);
-}
-
-float FilterDlg::limit(float value, float min, float max) {
-    if (value < min) return min;
-    if (value > max) return max;
-    return value;
-}
-
-//-------------------------------------------------------------------------
-// OnCancel()
-//-------------------------------------------------------------------------
-void FilterDlg::OnCancel(wxCommandEvent& event)
-{
-    this->EndModal(wxID_CANCEL);
-}
-
-//-------------------------------------------------------------------------
-// OnDefault()
-//-------------------------------------------------------------------------
-
-void FilterDlg::OnLPCPostFilterDefault(wxCommandEvent& event)
-{
-    m_beta = CODEC2_LPC_PF_BETA; setBeta();
-    m_gamma = CODEC2_LPC_PF_GAMMA; setGamma();
-    m_codec2LPCPostFilterEnable->SetValue(true);
-    m_codec2LPCPostFilterBassBoost->SetValue(true);
-}
-
-void FilterDlg::OnMicInDefault(wxCommandEvent& event)
-{
-    m_MicInBass.freqHz = 100.0;
-    m_MicInBass.gaindB = 0.0;
-    setFreq(&m_MicInBass); setGain(&m_MicInBass); 
-
-    m_MicInTreble.freqHz = 3000.0;
-    m_MicInTreble.gaindB = 0.0;
-    setFreq(&m_MicInTreble); setGain(&m_MicInTreble); 
-
-    m_MicInMid.freqHz = 1500.0;
-    m_MicInMid.gaindB = 0.0;
-    m_MicInMid.Q = 1.0;
-    setFreq(&m_MicInMid); setGain(&m_MicInMid); setQ(&m_MicInMid); 
-
-    plotMicInFilterSpectrum();    
-}
-
-void FilterDlg::OnSpkOutDefault(wxCommandEvent& event)
-{
-    m_SpkOutBass.freqHz = 100.0;
-    m_SpkOutBass.gaindB = 0.0;
-    setFreq(&m_SpkOutBass); setGain(&m_SpkOutBass); 
-
-    m_SpkOutTreble.freqHz = 3000.0;
-    m_SpkOutTreble.gaindB = 0.0;
-    setFreq(&m_SpkOutTreble); setGain(&m_SpkOutTreble); 
-
-    m_SpkOutMid.freqHz = 1500.0;
-    m_SpkOutMid.gaindB = 0.0;
-    m_SpkOutMid.Q = 1.0;
-    setFreq(&m_SpkOutMid); setGain(&m_SpkOutMid); setQ(&m_SpkOutMid); 
-
-    plotSpkOutFilterSpectrum();    
-}
-
-//-------------------------------------------------------------------------
-// OnOK()
-//-------------------------------------------------------------------------
-void FilterDlg::OnOK(wxCommandEvent& event)
-{
-    //printf("FilterDlg::OnOK\n");
-    ExchangeData(EXCHANGE_DATA_OUT, true);
-    this->EndModal(wxID_OK);
-}
-
-//-------------------------------------------------------------------------
-// OnClose()
-//-------------------------------------------------------------------------
-void FilterDlg::OnClose(wxCloseEvent& event)
-{
-    this->EndModal(wxID_OK);
-}
-
-//-------------------------------------------------------------------------
-// OnInitDialog()
-//-------------------------------------------------------------------------
-void FilterDlg::OnInitDialog(wxInitDialogEvent& event)
-{
-    //printf("FilterDlg::OnInitDialog\n");
-    ExchangeData(EXCHANGE_DATA_IN, false);
-    //printf("m_beta: %f\n", m_beta);
-}
-
-void FilterDlg::setBeta(void) {
-    wxString buf;
-    buf.Printf(wxT("%3.2f"), m_beta);
-    m_staticTextBeta->SetLabel(buf);
-    int slider = (int)(m_beta*SLIDER_MAX + 0.5);
-    m_codec2LPCPostFilterBeta->SetValue(slider);
-}
-
-void FilterDlg::setCodec2(void) {
-    if (m_running) {
-        assert(g_pfreedv->codec2 != NULL);
-        codec2_set_lpc_post_filter(g_pfreedv->codec2, 
-                               m_codec2LPCPostFilterEnable->GetValue(), 
-                               m_codec2LPCPostFilterBassBoost->GetValue(), 
-                               m_beta, m_gamma);
-    }
-}
-
-void FilterDlg::setGamma(void) {
-    wxString buf;
-    buf.Printf(wxT("%3.2f"), m_gamma);
-    m_staticTextGamma->SetLabel(buf);
-    int slider = (int)(m_gamma*SLIDER_MAX + 0.5);
-    m_codec2LPCPostFilterGamma->SetValue(slider);
-}
-
-void FilterDlg::OnEnable(wxScrollEvent& event) {
-    setCodec2();    
-}
-
-void FilterDlg::OnBassBoost(wxScrollEvent& event) {
-    setCodec2();    
-}
-
-void FilterDlg::OnBetaScroll(wxScrollEvent& event) {
-    m_beta = (float)m_codec2LPCPostFilterBeta->GetValue()/SLIDER_MAX;
-    setBeta();
-    setCodec2();
-}
-
-void FilterDlg::OnGammaScroll(wxScrollEvent& event) {
-    m_gamma = (float)m_codec2LPCPostFilterGamma->GetValue()/SLIDER_MAX;
-    setGamma();
-    setCodec2();
-}
-
-// immediately change enable flags rather using ExchangeData() so we can switch on and off at run time
-
-void FilterDlg::OnSpeexppEnable(wxScrollEvent& event) {
-    wxGetApp().m_speexpp_enable = m_ckboxSpeexpp->GetValue();
-}
-
-void FilterDlg::OnMicInEnable(wxScrollEvent& event) {
-    wxGetApp().m_MicInEQEnable = m_MicInEnable->GetValue();
-}
-
-void FilterDlg::OnSpkOutEnable(wxScrollEvent& event) {
-    wxGetApp().m_SpkOutEQEnable = m_SpkOutEnable->GetValue();
-    //printf("wxGetApp().m_SpkOutEQEnable: %d\n", wxGetApp().m_SpkOutEQEnable);
-}
-
-void FilterDlg::setFreq(EQ *eq)
-{
-    wxString buf;
-    buf.Printf(wxT("%3.0f"), eq->freqHz);
-    eq->valueFreq->SetLabel(buf);
-    int slider = (int)((eq->freqHz/eq->maxFreqHz)*SLIDER_MAX + 0.5);
-    eq->sliderFreq->SetValue(slider);
-}
-
-void FilterDlg::sliderToFreq(EQ *eq, bool micIn)
-{
-    eq->freqHz = ((float)eq->sliderFreq->GetValue()/SLIDER_MAX)*eq->maxFreqHz;
-    if (eq->freqHz < 1.0) eq->freqHz = 1.0; // sox doesn't like 0 Hz;
-    setFreq(eq);
-    if (micIn) {
-        plotMicInFilterSpectrum();
-        adjRunTimeMicInFilter();
-    }
-    else {
-        plotSpkOutFilterSpectrum();
-        adjRunTimeSpkOutFilter();
-    }
-}
-
-void FilterDlg::setGain(EQ *eq)
-{
-    wxString buf;
-    buf.Printf(wxT("%3.1f"), eq->gaindB);
-    eq->valueGain->SetLabel(buf);
-    int slider = (int)(((eq->gaindB-MIN_GAIN)/(MAX_GAIN-MIN_GAIN))*SLIDER_MAX + 0.5);
-    eq->sliderGain->SetValue(slider);
-}
-
-void FilterDlg::sliderToGain(EQ *eq, bool micIn)
-{
-    float range = MAX_GAIN-MIN_GAIN;
-    
-    eq->gaindB = MIN_GAIN + range*((float)eq->sliderGain->GetValue()/SLIDER_MAX);
-    //printf("gaindB: %f\n", eq->gaindB);
-    setGain(eq);
-    if (micIn) {
-        plotMicInFilterSpectrum();
-        adjRunTimeMicInFilter();
-    }
-    else {
-        plotSpkOutFilterSpectrum();
-        adjRunTimeSpkOutFilter();
-    }
-        
-}
-
-void FilterDlg::setQ(EQ *eq)
-{
-    wxString buf;
-    buf.Printf(wxT("%2.1f"), eq->Q);
-    eq->valueQ->SetLabel(buf);
-
-    float log10_range = MAX_LOG10_Q - MIN_LOG10_Q;
-
-    int slider = (int)(((log10(eq->Q+1E-6)-MIN_LOG10_Q)/log10_range)*SLIDER_MAX + 0.5);
-    eq->sliderQ->SetValue(slider);
-}
-
-void FilterDlg::sliderToQ(EQ *eq, bool micIn)
-{
-    float log10_range = MAX_LOG10_Q - MIN_LOG10_Q;
-    
-    float sliderNorm = (float)eq->sliderQ->GetValue()/SLIDER_MAX;
-    float log10Q =  MIN_LOG10_Q + sliderNorm*(log10_range);
-    eq->Q = pow(10.0, log10Q);
-    //printf("log10Q: %f eq->Q: %f\n", log10Q, eq->Q);
-    setQ(eq);
-    if (micIn) {
-        plotMicInFilterSpectrum();
-        adjRunTimeMicInFilter();
-    }
-    else {
-        plotSpkOutFilterSpectrum();
-        adjRunTimeSpkOutFilter();
-    }
-}
-
-void FilterDlg::plotMicInFilterSpectrum(void) {
-    plotFilterSpectrum(&m_MicInBass, &m_MicInMid, &m_MicInTreble, m_MicInFreqRespPlot, m_MicInMagdB);
-}
-
-void FilterDlg::plotSpkOutFilterSpectrum(void) {
-    plotFilterSpectrum(&m_SpkOutBass, &m_SpkOutMid, &m_SpkOutTreble, m_SpkOutFreqRespPlot, m_SpkOutMagdB);
-}
-
-void FilterDlg::adjRunTimeMicInFilter(void) {
-    // signal an adjustment in running filter coeffs
-
-    if (m_running) {
-        ExchangeData(EXCHANGE_DATA_OUT, false);
-        *m_newMicInFilter = true;
-    }
-}
-        
-void FilterDlg::adjRunTimeSpkOutFilter(void) {
-    // signal an adjustment in running filter coeffs
-
-    if (m_running) {
-        ExchangeData(EXCHANGE_DATA_OUT, false);
-        *m_newSpkOutFilter = true;
-    }
-}
-        
-
-void FilterDlg::plotFilterSpectrum(EQ *eqBass, EQ *eqMid, EQ *eqTreble, PlotSpectrum* freqRespPlot, float *magdB) {
-    char  *argBass[10];
-    char  *argTreble[10];
-    char  *argMid[10];
-    char   argstorage[10][80];
-    float magBass[F_MAG_N];
-    float magTreble[F_MAG_N];
-    float magMid[F_MAG_N];
-    int   i;
-
-    for(i=0; i<10; i++) {
-        argBass[i] = &argstorage[i][0];
-        argTreble[i] = &argstorage[i][0];
-        argMid[i] = &argstorage[i][0];
-    }
-    sprintf(argBass[0], "bass");                
-    sprintf(argBass[1], "%f", eqBass->gaindB+1E-6);
-    sprintf(argBass[2], "%f", eqBass->freqHz);      
-
-    calcFilterSpectrum(magBass, 2, argBass);
-
-    sprintf(argTreble[0], "treble");                
-    sprintf(argTreble[1], "%f", eqTreble->gaindB+1E-6);
-    sprintf(argTreble[2], "%f", eqTreble->freqHz);      
-
-    calcFilterSpectrum(magTreble, 2, argTreble);
-
-    sprintf(argTreble[0], "equalizer");                
-    sprintf(argTreble[1], "%f", eqMid->freqHz);      
-    sprintf(argTreble[2], "%f", eqMid->Q);      
-    sprintf(argTreble[3], "%f", eqMid->gaindB+1E-6);
-
-    calcFilterSpectrum(magMid, 3, argMid);
-
-    for(i=0; i<F_MAG_N; i++)
-        magdB[i] = magBass[i] + magMid[i] + magTreble[i];
-    freqRespPlot->m_newdata = true;
-    freqRespPlot->Refresh();
-}
-
-void FilterDlg::calcFilterSpectrum(float magdB[], int argc, char *argv[]) {
-    void       *sbq;
-    short       in[NIMP];
-    short       out[NIMP];
-    COMP        X[F_MAG_N];
-    float       f, w;
-    int         i, k;
-
-    // find impulse response -----------------------------------
-
-    for(i=0; i<NIMP; i++)
-        in[i] = 0;
-    in[0] = IMP_AMP;
-
-    //printf("argv[0]: %s argv[1]: %s\n", argv[0], argv[1]);
-    sbq = sox_biquad_create(argc, (const char **)argv);
-
-    sox_biquad_filter(sbq, out, in, NIMP);
-    //for(i=0; i<NIMP; i++)
-    //    printf("%d\n", out[i]);
-   
-    sox_biquad_destroy(sbq);
-
-    //for(i=0; i<NIMP; i++)
-    //    out[i] = 0.0;
-    //out[0] = IMP_AMP;
-
-    // calculate discrete time continous frequency Fourer transform
-    // doing this from first principles rather than FFT for no good reason
-
-    for(f=0,i=0; f<MAX_F_HZ; f+=F_STEP_DFT,i++) {
-        w = M_PI*f/(FS/2);
-        X[i].real = 0.0; X[i].imag = 0.0;
-        for(k=0; k<NIMP; k++) {
-            X[i].real += ((float)out[k]/IMP_AMP) * cos(w*k);
-            X[i].imag -= ((float)out[k]/IMP_AMP) * sin(w*k);
-        }
-        magdB[i] = 10.0*log10(X[i].real* X[i].real + X[i].imag*X[i].imag + 1E-12);
-        //printf("f: %f X[%d] = %f %f magdB = %f\n", f, i, X[i].real, X[i].imag,  magdB[i]);
-    }
-}
diff --git a/fdmdv2-dev/src/dlg_filter.h b/fdmdv2-dev/src/dlg_filter.h
deleted file mode 100644 (file)
index 82c43df..0000000
+++ /dev/null
@@ -1,166 +0,0 @@
-//==========================================================================
-// Name:            dlg_filter.h
-// Purpose:         Dialog for controlling Codec audio filtering
-// Created:         Nov 25 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-
-#ifndef __FILTER_DIALOG__
-#define __FILTER_DIALOG__
-
-#include "fdmdv2_main.h"
-
-enum {disableQ = false, enableQ = true};
-
-typedef struct { 
-    wxSlider     *sliderFreq;
-    wxStaticText *valueFreq;
-    wxSlider     *sliderGain;
-    wxStaticText *valueGain;
-    wxSlider     *sliderQ;
-    wxStaticText *valueQ;
-
-    int       sliderFreqId;
-    int       sliderGainId;
-    int       sliderQId;
-    
-    float     freqHz;
-    float     gaindB;
-    float     Q;
-
-    float     maxFreqHz;
-} EQ;
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class FilterDlg
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class FilterDlg : public wxDialog
-{
-    public:
-    FilterDlg( wxWindow* parent, bool running, bool *newMicInFilter, bool *newSpkOutFilter,
-               wxWindowID id = wxID_ANY, const wxString& title = _("Filter"), 
-               const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 800, 630 ), 
-               long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
-        ~FilterDlg();
-
-        void    ExchangeData(int inout, bool storePersistent);
-
-    protected:
-        // Handlers for events.
-        void    OnCancel(wxCommandEvent& event);
-        void    OnOK(wxCommandEvent& event);
-        void    OnClose(wxCloseEvent& event);
-        void    OnInitDialog(wxInitDialogEvent& event);
-        void    OnLPCPostFilterDefault(wxCommandEvent& event);
-
-        void    OnBetaScroll(wxScrollEvent& event);
-        void    OnGammaScroll(wxScrollEvent& event);
-        void    OnEnable(wxScrollEvent& event);
-        void    OnBassBoost(wxScrollEvent& event);
-
-        void    OnSpeexppEnable(wxScrollEvent& event);
-
-        void    OnMicInBassFreqScroll(wxScrollEvent& event) { sliderToFreq(&m_MicInBass, true); }
-        void    OnMicInBassGainScroll(wxScrollEvent& event) { sliderToGain(&m_MicInBass, true); }
-        void    OnMicInTrebleFreqScroll(wxScrollEvent& event) { sliderToFreq(&m_MicInTreble, true); }
-        void    OnMicInTrebleGainScroll(wxScrollEvent& event) { sliderToGain(&m_MicInTreble, true); }
-        void    OnMicInMidFreqScroll(wxScrollEvent& event) { sliderToFreq(&m_MicInMid, true); }
-        void    OnMicInMidGainScroll(wxScrollEvent& event) { sliderToGain(&m_MicInMid, true); }
-        void    OnMicInMidQScroll(wxScrollEvent& event) { sliderToQ(&m_MicInMid, true); }
-        void    OnMicInEnable(wxScrollEvent& event);
-        void    OnMicInDefault(wxCommandEvent& event);
-
-        void    OnSpkOutBassFreqScroll(wxScrollEvent& event) { sliderToFreq(&m_SpkOutBass, false); }
-        void    OnSpkOutBassGainScroll(wxScrollEvent& event) { sliderToGain(&m_SpkOutBass, false); }
-        void    OnSpkOutTrebleFreqScroll(wxScrollEvent& event) { sliderToFreq(&m_SpkOutTreble, false); }
-        void    OnSpkOutTrebleGainScroll(wxScrollEvent& event) { sliderToGain(&m_SpkOutTreble, false); }
-        void    OnSpkOutMidFreqScroll(wxScrollEvent& event) { sliderToFreq(&m_SpkOutMid, false); }
-        void    OnSpkOutMidGainScroll(wxScrollEvent& event) { sliderToGain(&m_SpkOutMid, false); }
-        void    OnSpkOutMidQScroll(wxScrollEvent& event) { sliderToQ(&m_SpkOutMid, false); }
-        void    OnSpkOutEnable(wxScrollEvent& event);
-        void    OnSpkOutDefault(wxCommandEvent& event);
-
-        wxStaticText* m_staticText8;
-        wxCheckBox*   m_codec2LPCPostFilterEnable;
-        wxStaticText* m_staticText9;
-        wxCheckBox*   m_codec2LPCPostFilterBassBoost;
-        wxStaticText* m_staticText91;
-        wxSlider*     m_codec2LPCPostFilterBeta;
-        wxStaticText* m_staticTextBeta;
-        wxStaticText* m_staticText911;
-        wxSlider*     m_codec2LPCPostFilterGamma;
-        wxStaticText* m_staticTextGamma;
-        wxButton*     m_LPCPostFilterDefault;
-
-        wxCheckBox*   m_ckboxSpeexpp;
-
-        wxStdDialogButtonSizer* m_sdbSizer5;
-        wxButton*     m_sdbSizer5OK;
-        wxButton*     m_sdbSizer5Cancel;
-        PlotSpectrum* m_MicInFreqRespPlot;
-        PlotSpectrum* m_SpkOutFreqRespPlot;
-        
-        wxCheckBox*   m_MicInEnable;
-        wxButton*     m_MicInDefault;
-        wxCheckBox*   m_SpkOutEnable;
-        wxButton*     m_SpkOutDefault;
-
-        float        *m_MicInMagdB;
-        float        *m_SpkOutMagdB;
-
-     private:
-        bool          m_running;
-        float         m_beta;
-        float         m_gamma;
-
-        void          setBeta(void);  // sets slider and static text from m_beta
-        void          setGamma(void); // sets slider and static text from m_gamma
-        void          setCodec2(void);
-        void          newEQControl(wxSlider** slider, wxStaticText** value, wxStaticBoxSizer *bs, wxString controlName);
-        EQ            newEQ(wxSizer *bs, wxString eqName, float maxFreqHz, bool enableQ);
-        void          newLPCPFControl(wxSlider **slider, wxStaticText **stValue, wxSizer *sbs, wxString controlName);
-        wxAuiNotebook *m_auiNotebook;
-        void          setFreq(EQ *eq);
-        void          setGain(EQ *eq);
-        void          setQ(EQ *eq);
-        void          sliderToFreq(EQ *eq, bool micIn);
-        void          sliderToGain(EQ *eq, bool micIn);
-        void          sliderToQ(EQ *eq, bool micIn);
-        void          plotFilterSpectrum(EQ *eqBass, EQ *eqMid, EQ* eqTreble, PlotSpectrum* freqRespPlot, float *magdB);
-        void          calcFilterSpectrum(float magdB[], int arc, char *argv[]);
-        void          plotMicInFilterSpectrum(void);
-        void          plotSpkOutFilterSpectrum(void);
-        void          adjRunTimeMicInFilter(void);
-        void          adjRunTimeSpkOutFilter(void);
-
-        EQ            m_MicInBass;
-        EQ            m_MicInMid;
-        EQ            m_MicInTreble;
-
-        EQ            m_SpkOutBass;
-        EQ            m_SpkOutMid;
-        EQ            m_SpkOutTreble;
-
-        float         limit(float value, float min, float max);
-        bool          *m_newMicInFilter;
-        bool          *m_newSpkOutFilter;
-
-};
-
-#endif // __FILTER_DIALOG__
diff --git a/fdmdv2-dev/src/dlg_options.cpp b/fdmdv2-dev/src/dlg_options.cpp
deleted file mode 100644 (file)
index 9189feb..0000000
+++ /dev/null
@@ -1,363 +0,0 @@
-//==========================================================================
-// Name:            dlg_options.cpp
-// Purpose:         Dialog for controlling misc FreeDV options
-// Date:            May 24 2013
-// 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-
-#include "dlg_options.h"
-extern bool g_modal;
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class OptionsDlg
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-OptionsDlg::OptionsDlg(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* bSizer30;
-    bSizer30 = new wxBoxSizer(wxVERTICAL);
-
-    //------------------------------
-    // Test Frames check box
-    //------------------------------
-
-    wxStaticBoxSizer* sbSizer_testFrames;
-    wxStaticBox *sb_testFrames = new wxStaticBox(this, wxID_ANY, _("Test Frames"));
-    sbSizer_testFrames = new wxStaticBoxSizer(sb_testFrames, wxHORIZONTAL);
-
-    m_ckboxTestFrame = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
-    m_ckboxTestFrame->SetToolTip(_("Send frames of known bits instead of compressed voice"));
-    sbSizer_testFrames->Add(m_ckboxTestFrame, 0, wxALIGN_LEFT, 0);
-
-    m_ckboxChannelNoise = new wxCheckBox(this, wxID_ANY, _("Channel Noise"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
-    m_ckboxChannelNoise->SetToolTip(_("Add simulated AWGN channel noise to received signal"));
-    sbSizer_testFrames->Add(m_ckboxChannelNoise, 0, wxALIGN_LEFT, 0);
-
-    bSizer30->Add(sbSizer_testFrames,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
-
-    //------------------------------
-    // FreeDV 700 Options
-    //------------------------------
-
-    wxStaticBoxSizer* sbSizer_freedv700;
-    wxStaticBox *sb_freedv700 = new wxStaticBox(this, wxID_ANY, _("FreeDV 700 Clipping"));
-    sbSizer_freedv700 = new wxStaticBoxSizer(sb_freedv700, wxHORIZONTAL);
-
-    m_ckboxFreeDV700txClip = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
-    m_ckboxFreeDV700txClip->SetToolTip(_("Clip FreeDv 700 tx waveform to reduce Peak to Average Power Ratio (PAPR)"));
-    sbSizer_freedv700->Add(m_ckboxFreeDV700txClip, 0, wxALIGN_LEFT, 0);
-
-    bSizer30->Add(sbSizer_freedv700,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
-
-    //------------------------------
-    // Txt Msg Text Box
-    //------------------------------
-
-    wxStaticBoxSizer* sbSizer_callSign;
-    wxStaticBox *sb_textMsg = new wxStaticBox(this, wxID_ANY, _("Txt Msg"));
-    sbSizer_callSign = new wxStaticBoxSizer(sb_textMsg, wxVERTICAL);
-
-    m_txtCtrlCallSign = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
-    m_txtCtrlCallSign->SetToolTip(_("Txt Msg you can send along with Voice"));
-    sbSizer_callSign->Add(m_txtCtrlCallSign, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3);
-
-    bSizer30->Add(sbSizer_callSign,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
-    //------------------------------
-    // Txt Encoding 
-    //------------------------------
-
-    wxStaticBoxSizer* sbSizer_encoding = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Text Encoding")), wxHORIZONTAL);
-
-#ifdef SHORT_VARICODE
-    m_rb_textEncoding1 = new wxRadioButton( this, wxID_ANY, wxT("Long varicode"), wxDefaultPosition, wxDefaultSize, 0);
-    m_rb_textEncoding1->SetValue(true);
-    sbSizer_encoding->Add(m_rb_textEncoding1, 0, wxALIGN_LEFT|wxALL, 1);
-    m_rb_textEncoding2 = new wxRadioButton( this, wxID_ANY, wxT("Short Varicode"), wxDefaultPosition, wxDefaultSize, 0);
-    sbSizer_encoding->Add(m_rb_textEncoding2, 0, wxALIGN_LEFT|wxALL, 1);
-#endif
-
-    m_ckboxEnableChecksum = new wxCheckBox(this, wxID_ANY, _("Use Checksum on Rx"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
-    sbSizer_encoding->Add(m_ckboxEnableChecksum, 0, wxALIGN_LEFT, 0);
-
-    bSizer30->Add(sbSizer_encoding,0, wxALL|wxEXPAND, 3);
-    //------------------------------
-    // Event processing
-    //------------------------------
-
-    wxStaticBoxSizer* sbSizer_events;
-    wxStaticBox *sb_events = new wxStaticBox(this, wxID_ANY, _("Event Processing"));
-    sbSizer_events = new wxStaticBoxSizer(sb_events, wxVERTICAL);
-
-    // event processing enable and spam timer
-
-    wxStaticBoxSizer* sbSizer_events_top;
-    wxStaticBox* sb_events1 = new wxStaticBox(this, wxID_ANY, _(""));    
-    sbSizer_events_top = new wxStaticBoxSizer(sb_events1, wxHORIZONTAL);
-
-    m_ckbox_events = new wxCheckBox(this, wxID_ANY, _("Enable System Calls    Syscall Spam Timer"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
-    sb_events->SetToolTip(_("Enable processing of events and generation of system calls"));
-    sbSizer_events_top->Add(m_ckbox_events, 0, 0, 5);
-    m_txt_spam_timer = new wxTextCtrl(this, wxID_ANY,  wxEmptyString, wxDefaultPosition, wxSize(40,-1), 0, wxTextValidator(wxFILTER_DIGITS));
-    m_txt_spam_timer->SetToolTip(_("Many matching events can cause a flood of syscalls. Set minimum time (seconds) between syscalls for each event here"));
-    sbSizer_events_top->Add(m_txt_spam_timer, 0, 0, 5);
-    m_rb_spam_timer = new wxRadioButton( this, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
-    m_rb_spam_timer->SetForegroundColour( wxColour(0, 255, 0 ) );
-    sbSizer_events_top->Add(m_rb_spam_timer, 0, 0, 10);
-    sbSizer_events->Add(sbSizer_events_top, 0, 0, 5);
-
-    // list of regexps
-
-    wxStaticBoxSizer* sbSizer_regexp = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Regular Expressions to Process Events")), wxHORIZONTAL);
-    m_txt_events_regexp_match = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(200,100), wxTE_MULTILINE);
-    m_txt_events_regexp_match->SetToolTip(_("Enter regular expressions to match events"));
-    sbSizer_regexp->Add(m_txt_events_regexp_match, 1, wxEXPAND, 5);
-    m_txt_events_regexp_replace = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(200,100), wxTE_MULTILINE);
-    m_txt_events_regexp_replace->SetToolTip(_("Enter regular expressions to replace events"));
-    sbSizer_regexp->Add(m_txt_events_regexp_replace, 1, wxEXPAND, 5);
-    sbSizer_events->Add(sbSizer_regexp, 1, wxEXPAND, 5);
-
-    // log of events and responses
-
-    wxStaticBoxSizer* sbSizer_event_log = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Log of Events and Responses")), wxVERTICAL);
-    wxBoxSizer* bSizer33 = new wxBoxSizer(wxHORIZONTAL);
-    m_txt_events_in = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(200,50), wxTE_MULTILINE | wxTE_READONLY);
-    bSizer33->Add(m_txt_events_in, 1, wxEXPAND, 5);
-    m_txt_events_out = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(200,50), wxTE_MULTILINE | wxTE_READONLY);
-    bSizer33->Add(m_txt_events_out, 1, wxEXPAND, 5);
-    sbSizer_event_log->Add(bSizer33, 1, wxEXPAND, 5);
-    sbSizer_events->Add(sbSizer_event_log, 1, wxEXPAND, 5);
-
-    bSizer30->Add(sbSizer_events,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
-
-    //------------------------------
-    // UDP control port
-    //------------------------------
-
-    wxStaticBoxSizer* sbSizer_udp;
-    wxStaticBox* sb_udp = new wxStaticBox(this, wxID_ANY, _("UDP Control Port"));
-    sbSizer_udp = new wxStaticBoxSizer(sb_udp, wxHORIZONTAL);
-    m_ckbox_udp_enable = new wxCheckBox(this, wxID_ANY, _("Enable UDP Control Port    UDP Port Number:"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
-    sb_udp->SetToolTip(_("Enable control of FreeDV via UDP port"));
-    sbSizer_udp->Add(m_ckbox_udp_enable, 0,  wxALIGN_CENTER_HORIZONTAL, 5);
-    m_txt_udp_port = new wxTextCtrl(this, wxID_ANY,  wxEmptyString, wxDefaultPosition, wxSize(50,-1), 0, wxTextValidator(wxFILTER_DIGITS));
-    sbSizer_udp->Add(m_txt_udp_port, 0, wxALIGN_CENTER_HORIZONTAL, 5);
-
-    bSizer30->Add(sbSizer_udp,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
-
-    //------------------------------
-    // OK - Cancel - Apply Buttons 
-    //------------------------------
-
-    wxBoxSizer* bSizer31 = new wxBoxSizer(wxHORIZONTAL);
-
-    m_sdbSizer5OK = new wxButton(this, wxID_OK);
-    bSizer31->Add(m_sdbSizer5OK, 0, wxALL, 2);
-
-    m_sdbSizer5Cancel = new wxButton(this, wxID_CANCEL);
-    bSizer31->Add(m_sdbSizer5Cancel, 0, wxALL, 2);
-
-    m_sdbSizer5Apply = new wxButton(this, wxID_APPLY);
-    bSizer31->Add(m_sdbSizer5Apply, 0, wxALL, 2);
-
-    bSizer30->Add(bSizer31, 0, wxALIGN_RIGHT|wxALL, 0);
-
-    this->SetSizer(bSizer30);
-    this->Layout();
-
-    this->Centre(wxBOTH);
-    // Connect Events -------------------------------------------------------
-
-    this->Connect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(OptionsDlg::OnInitDialog));
-
-    m_sdbSizer5OK->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsDlg::OnOK), NULL, this);
-    m_sdbSizer5Cancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsDlg::OnCancel), NULL, this);
-    m_sdbSizer5Apply->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsDlg::OnApply), NULL, this);
-
-    m_ckboxFreeDV700txClip->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(OptionsDlg::OnFreeDV700txClip), NULL, this);
-
-    event_in_serial = 0;
-    event_out_serial = 0;
-}
-
-//-------------------------------------------------------------------------
-// ~OptionsDlg()
-//-------------------------------------------------------------------------
-OptionsDlg::~OptionsDlg()
-{
-
-    // Disconnect Events
-
-    this->Disconnect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(OptionsDlg::OnInitDialog));
-
-    m_sdbSizer5OK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsDlg::OnOK), NULL, this);
-    m_sdbSizer5Cancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsDlg::OnCancel), NULL, this);
-    m_sdbSizer5Apply->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsDlg::OnApply), NULL, this);
-    m_ckboxFreeDV700txClip->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(OptionsDlg::OnFreeDV700txClip), NULL, this);
-}
-
-
-//-------------------------------------------------------------------------
-// ExchangeData()
-//-------------------------------------------------------------------------
-void OptionsDlg::ExchangeData(int inout, bool storePersistent)
-{
-    wxConfigBase *pConfig = wxConfigBase::Get();
-
-    if(inout == EXCHANGE_DATA_IN)
-    {
-        m_txtCtrlCallSign->SetValue(wxGetApp().m_callSign);
-        m_ckboxTestFrame->SetValue(wxGetApp().m_testFrames);
-        m_ckboxChannelNoise->SetValue(wxGetApp().m_channel_noise);
-
-        m_ckbox_events->SetValue(wxGetApp().m_events);
-        m_txt_spam_timer->SetValue(wxString::Format(wxT("%i"),wxGetApp().m_events_spam_timer));
-
-        m_txt_events_regexp_match->SetValue(wxGetApp().m_events_regexp_match);
-        m_txt_events_regexp_replace->SetValue(wxGetApp().m_events_regexp_replace);
-        
-        m_ckbox_udp_enable->SetValue(wxGetApp().m_udp_enable);
-        m_txt_udp_port->SetValue(wxString::Format(wxT("%i"),wxGetApp().m_udp_port));
-
-#ifdef SHORT_VARICODE
-        if (wxGetApp().m_textEncoding == 1)
-            m_rb_textEncoding1->SetValue(true);
-        if (wxGetApp().m_textEncoding == 2)
-            m_rb_textEncoding2->SetValue(true);
-#endif
-        m_ckboxEnableChecksum->SetValue(wxGetApp().m_enable_checksum);
-
-        m_ckboxFreeDV700txClip->SetValue(wxGetApp().m_FreeDV700txClip);
-    }
-
-    if(inout == EXCHANGE_DATA_OUT)
-    {
-        wxGetApp().m_callSign      = m_txtCtrlCallSign->GetValue();
-        wxGetApp().m_testFrames    = m_ckboxTestFrame->GetValue();
-        wxGetApp().m_channel_noise = m_ckboxChannelNoise->GetValue();
-
-        wxGetApp().m_events        = m_ckbox_events->GetValue();
-        long spam_timer;
-        m_txt_spam_timer->GetValue().ToLong(&spam_timer);
-        wxGetApp().m_events_spam_timer = (int)spam_timer;
-
-        // make sure regexp lists are terminated by a \n
-
-        if (m_txt_events_regexp_match->GetValue().Last() != '\n') {
-            m_txt_events_regexp_match->SetValue(m_txt_events_regexp_match->GetValue()+'\n');
-        }
-        if (m_txt_events_regexp_replace->GetValue().Last() != '\n') {
-            m_txt_events_regexp_replace->SetValue(m_txt_events_regexp_replace->GetValue()+'\n');
-        }
-        wxGetApp().m_events_regexp_match = m_txt_events_regexp_match->GetValue();
-        wxGetApp().m_events_regexp_replace = m_txt_events_regexp_replace->GetValue();
-        wxGetApp().m_udp_enable     = m_ckbox_udp_enable->GetValue();
-        long port;
-        m_txt_udp_port->GetValue().ToLong(&port);
-        wxGetApp().m_udp_port       = (int)port;
-
-#ifdef SHORT_VARICODE
-        if (m_rb_textEncoding1->GetValue())
-            wxGetApp().m_textEncoding = 1;
-        if (m_rb_textEncoding2->GetValue())
-            wxGetApp().m_textEncoding = 2;
-#endif
-        wxGetApp().m_enable_checksum = m_ckboxEnableChecksum->GetValue();
-
-        wxGetApp().m_FreeDV700txClip = m_ckboxFreeDV700txClip->GetValue();
-
-        if (storePersistent) {
-            pConfig->Write(wxT("/Data/CallSign"), wxGetApp().m_callSign);
-#ifdef SHORT_VARICODE
-            pConfig->Write(wxT("/Data/TextEncoding"), wxGetApp().m_textEncoding);
-#endif
-            pConfig->Write(wxT("/Data/EnableChecksumOnMsgRx"), wxGetApp().m_enable_checksum);
-
-            pConfig->Write(wxT("/Events/enable"), wxGetApp().m_events);
-            pConfig->Write(wxT("/Events/spam_timer"), wxGetApp().m_events_spam_timer);
-            pConfig->Write(wxT("/Events/regexp_match"), wxGetApp().m_events_regexp_match);
-            pConfig->Write(wxT("/Events/regexp_replace"), wxGetApp().m_events_regexp_replace);
-            
-            pConfig->Write(wxT("/UDP/enable"), wxGetApp().m_udp_enable);
-            pConfig->Write(wxT("/UDP/port"),  wxGetApp().m_udp_port);
-
-            pConfig->Write(wxT("/FreeDV700/txClip"), wxGetApp().m_FreeDV700txClip);
-
-            pConfig->Flush();
-        }
-    }
-    delete wxConfigBase::Set((wxConfigBase *) NULL);
-}
-
-//-------------------------------------------------------------------------
-// OnOK()
-//-------------------------------------------------------------------------
-void OptionsDlg::OnOK(wxCommandEvent& event)
-{
-    ExchangeData(EXCHANGE_DATA_OUT, true);
-    //this->EndModal(wxID_OK);
-    g_modal = false;
-    this->Show(false);
-}
-
-//-------------------------------------------------------------------------
-// OnCancel()
-//-------------------------------------------------------------------------
-void OptionsDlg::OnCancel(wxCommandEvent& event)
-{
-    //this->EndModal(wxID_CANCEL);
-    g_modal = false;
-    this->Show(false);
-}
-
-//-------------------------------------------------------------------------
-// OnApply()
-//-------------------------------------------------------------------------
-void OptionsDlg::OnApply(wxCommandEvent& event)
-{
-    ExchangeData(EXCHANGE_DATA_OUT, true);
-}
-
-//-------------------------------------------------------------------------
-// OnInitDialog()
-//-------------------------------------------------------------------------
-void OptionsDlg::OnInitDialog(wxInitDialogEvent& event)
-{
-    ExchangeData(EXCHANGE_DATA_IN, false);
-}
-
-// immediately change flags rather using ExchangeData() so we can switch on and off at run time
-
-void OptionsDlg::OnFreeDV700txClip(wxScrollEvent& event) {
-    wxGetApp().m_FreeDV700txClip = m_ckboxFreeDV700txClip->GetValue();
-}
-
-
-void OptionsDlg::updateEventLog(wxString event_in, wxString event_out) {
-    wxString event_in_with_serial, event_out_with_serial; 
-    event_in_with_serial.Printf(_T("[%d] %s"), event_in_serial++, event_in);
-    event_out_with_serial.Printf(_T("[%d] %s"), event_out_serial++, event_out);
-
-    m_txt_events_in->AppendText(event_in_with_serial+"\n");
-    m_txt_events_out->AppendText(event_out_with_serial+"\n");
-}
-
diff --git a/fdmdv2-dev/src/dlg_options.h b/fdmdv2-dev/src/dlg_options.h
deleted file mode 100644 (file)
index fe355ac..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-//==========================================================================
-// Name:            dlg_options.h
-// Purpose:         Dialog for controlling misc FreeDV options
-// Created:         Nov 25 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-
-#ifndef __OPTIONS_DIALOG__
-#define __OPTIONS_DIALOG__
-
-#include "fdmdv2_main.h"
-#include "fdmdv2_defines.h"
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class OptionsDlg
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class OptionsDlg : public wxDialog
-{
-    public:
-    OptionsDlg( wxWindow* parent,
-               wxWindowID id = wxID_ANY, const wxString& title = _("Options"), 
-                const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(600,630), 
-               long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
-        ~OptionsDlg();
-
-        void    ExchangeData(int inout, bool storePersistent);
-        void    updateEventLog(wxString event_in, wxString event_out);
-
-        bool    enableEventsChecked() {return m_ckbox_events->GetValue();}
-
-        void SetSpamTimerLight(bool state) {
-
-            // Colours don't work on Windows
-
-            if (state) {
-                m_rb_spam_timer->SetForegroundColour( wxColour( 255,0 , 0 ) ); // red
-                m_rb_spam_timer->SetValue(true);
-            }
-            else {
-                m_rb_spam_timer->SetForegroundColour( wxColour( 0, 255, 0 ) ); // green
-                m_rb_spam_timer->SetValue(false);
-            }
-        }
-
-
-    protected:
-        // Handlers for events.
-        void    OnOK(wxCommandEvent& event);
-        void    OnCancel(wxCommandEvent& event);
-        void    OnApply(wxCommandEvent& event);
-        void    OnClose(wxCloseEvent& event);
-        void    OnInitDialog(wxInitDialogEvent& event);
-        void    OnFreeDV700txClip(wxScrollEvent& event);
-
-        wxTextCtrl   *m_txtCtrlCallSign; // TODO: this should be renamed to tx_txtmsg, and rename all related incl persis strge
-        wxCheckBox   *m_ckboxTestFrame;
-        wxCheckBox   *m_ckboxChannelNoise;
-        wxCheckBox   *m_ckboxFreeDV700txClip;
-
-        wxRadioButton *m_rb_textEncoding1;
-        wxRadioButton *m_rb_textEncoding2;
-        wxCheckBox    *m_ckboxEnableChecksum;
-
-        wxCheckBox   *m_ckbox_events;
-        wxTextCtrl   *m_txt_events_regexp_match;
-        wxTextCtrl   *m_txt_events_regexp_replace;
-        wxTextCtrl   *m_txt_events_in;
-        wxTextCtrl   *m_txt_events_out;
-        wxTextCtrl   *m_txt_spam_timer;
-        wxRadioButton *m_rb_spam_timer;
-
-        wxCheckBox   *m_ckbox_udp_enable;
-        wxTextCtrl   *m_txt_udp_port;
-
-        wxButton*     m_sdbSizer5OK;
-        wxButton*     m_sdbSizer5Cancel;
-        wxButton*     m_sdbSizer5Apply;
-
-        unsigned int  event_in_serial, event_out_serial;
-
-     private:
-};
-
-#endif // __OPTIONS_DIALOG__
diff --git a/fdmdv2-dev/src/dlg_ptt.cpp b/fdmdv2-dev/src/dlg_ptt.cpp
deleted file mode 100644 (file)
index 2643c1d..0000000
+++ /dev/null
@@ -1,416 +0,0 @@
-//==========================================================================
-// Name:            dlg_ptt.cpp
-// Purpose:         Subclasses dialog GUI for PTT Config. Creates simple 
-//                  wxWidgets dialog GUI to select real/virtual Comm ports.
-// Date:            May 11 2012
-// Authors:         David Rowe, David Witten, Joel Stanley
-// 
-// 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#include "dlg_ptt.h"
-#include "fdmdv2_main.h"
-
-#ifdef __WIN32__
-#include <wx/msw/registry.h>
-#endif
-#ifdef __FreeBSD__
-#include <glob.h>
-#include <string.h>
-#endif
-
-#include <sstream>
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class ComPortsDlg
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-ComPortsDlg::ComPortsDlg(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style)
-{
-    wxBoxSizer* mainSizer = new wxBoxSizer(wxVERTICAL);
-    this->SetSizer(mainSizer);
-    
-    //----------------------------------------------------------------------
-    // Half Duplex Flag for VOX PTT
-    //----------------------------------------------------------------------
-
-    // DR: should this be on options dialog?
-
-    wxStaticBoxSizer* staticBoxSizer28 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("VOX PTT Settings")), wxHORIZONTAL);
-    m_ckHalfDuplex = new wxCheckBox(this, wxID_ANY, _("Half Duplex"), wxDefaultPosition, wxSize(-1,-1), 0);
-    staticBoxSizer28->Add(m_ckHalfDuplex, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
-    m_ckLeftChannelVoxTone = new wxCheckBox(this, wxID_ANY, _("Left Channel Vox Tone"), wxDefaultPosition, wxSize(-1,-1), 0);
-    staticBoxSizer28->Add(m_ckLeftChannelVoxTone, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
-
-    mainSizer->Add(staticBoxSizer28, 0, wxEXPAND, 5);
-
-    //----------------------------------------------------------------------
-    // Hamlib for CAT PTT
-    //----------------------------------------------------------------------
-
-    wxStaticBoxSizer* staticBoxSizer18 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("Hamlib Settings")), wxVERTICAL);
-
-    wxBoxSizer* gridSizer100 = new wxBoxSizer(wxHORIZONTAL);
-
-    /* Use Hamlib for PTT checkbox. */
-    m_ckUseHamlibPTT = new wxCheckBox(this, wxID_ANY, _("Use Hamlib PTT"), wxDefaultPosition, wxSize(-1, -1), 0);
-    m_ckUseHamlibPTT->SetValue(false);
-    gridSizer100->Add(m_ckUseHamlibPTT, 0, wxALIGN_CENTER_VERTICAL, 0);
-
-    /* Hamlib Rig Type combobox. */
-    gridSizer100->Add(new wxStaticText(this, wxID_ANY, _("Rig Model:"), wxDefaultPosition, wxDefaultSize, 0), 
-                      0, wxALIGN_CENTER_VERTICAL | wxLEFT, 20);
-    m_cbRigName = new wxComboBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(250, -1), 0, NULL, wxCB_DROPDOWN);
-    /* TODO(Joel): this is a hack. At the least, need to gurantee that m_hamLib
-     * exists. */
-    wxGetApp().m_hamlib->populateComboBox(m_cbRigName);
-    m_cbRigName->SetSelection(wxGetApp().m_intHamlibRig);
-    gridSizer100->Add(m_cbRigName, 0, wxALIGN_CENTER_VERTICAL, 0);
-
-    /* Hamlib Serial Port combobox. */
-    gridSizer100->Add(new wxStaticText(this, wxID_ANY, _("Serial Device:"), wxDefaultPosition, wxDefaultSize, 0), 
-                      0, wxALIGN_CENTER_VERTICAL | wxLEFT, 20);
-    m_cbSerialPort = new wxComboBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(140, -1), 0, NULL, wxCB_DROPDOWN);
-    gridSizer100->Add(m_cbSerialPort, 0, wxALIGN_CENTER_VERTICAL, 0);
-
-    staticBoxSizer18->Add(gridSizer100, 1);
-    mainSizer->Add(staticBoxSizer18, 1);
-
-    //----------------------------------------------------------------------
-    // Serial port PTT
-    //----------------------------------------------------------------------
-
-    wxStaticBoxSizer* staticBoxSizer17 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("Serial Port Settings")), wxVERTICAL);
-    mainSizer->Add(staticBoxSizer17, 1, wxEXPAND, 5);
-    wxStaticBoxSizer* staticBoxSizer31 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("PTT Port")), wxVERTICAL);
-    staticBoxSizer17->Add(staticBoxSizer31, 1, wxEXPAND, 5);
-
-#ifdef __WXMSW__
-    m_ckUseSerialPTT = new wxCheckBox(this, wxID_ANY, _("Use Serial Port PTT"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_ckUseSerialPTT->SetValue(false);
-    staticBoxSizer31->Add(m_ckUseSerialPTT, 0, wxALIGN_LEFT, 20);
-
-    wxArrayString m_listCtrlPortsArr;
-    m_listCtrlPorts = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxSize(-1,45), m_listCtrlPortsArr, wxLB_SINGLE | wxLB_SORT);
-    staticBoxSizer31->Add(m_listCtrlPorts, 1, wxALIGN_CENTER, 0);
-#endif
-
-#ifdef __WXGTK__
-    wxBoxSizer* bSizer83;
-    bSizer83 = new wxBoxSizer(wxHORIZONTAL);
-
-    wxGridSizer* gridSizer200 = new wxGridSizer(1, 3, 0, 0);
-    
-    m_ckUseSerialPTT = new wxCheckBox(this, wxID_ANY, _("Use Serial Port PTT"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_ckUseSerialPTT->SetValue(false);
-    gridSizer200->Add(m_ckUseSerialPTT, 1, wxALIGN_CENTER|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 2);
-
-    m_staticText12 = new wxStaticText(this, wxID_ANY, _("Serial Device:  "), wxDefaultPosition, wxDefaultSize, 0);
-    m_staticText12->Wrap(-1);
-    gridSizer200->Add(m_staticText12, 1,wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 2);
-
-    m_cbCtlDevicePath = new wxComboBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(140, -1), 0, NULL, wxCB_DROPDOWN);
-    gridSizer200->Add(m_cbCtlDevicePath, 1, wxEXPAND|wxALIGN_CENTER|wxALIGN_RIGHT, 2);
-    
-    bSizer83->Add(gridSizer200, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT | wxALL, 2);
-    staticBoxSizer31->Add(bSizer83, 1, wxALIGN_CENTER_VERTICAL|wxALL, 1);
-#endif
-
-    wxBoxSizer* boxSizer19 = new wxBoxSizer(wxVERTICAL);
-    staticBoxSizer17->Add(boxSizer19, 1, wxEXPAND, 5);
-    wxStaticBoxSizer* staticBoxSizer16 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("Signal polarity")), wxHORIZONTAL);
-    boxSizer19->Add(staticBoxSizer16, 1, wxEXPAND|wxALIGN_CENTER|wxALIGN_RIGHT, 5);
-
-    wxGridSizer* gridSizer17 = new wxGridSizer(2, 2, 0, 0);
-    staticBoxSizer16->Add(gridSizer17, 1, wxEXPAND|wxALIGN_RIGHT, 5);
-
-    m_rbUseDTR = new wxRadioButton(this, wxID_ANY, _("Use DTR"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_rbUseDTR->SetToolTip(_("Toggle DTR line for PTT"));
-    m_rbUseDTR->SetValue(1);
-    gridSizer17->Add(m_rbUseDTR, 0, wxALIGN_CENTER|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5);
-
-    m_ckDTRPos = new wxCheckBox(this, wxID_ANY, _("DTR = +V"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_ckDTRPos->SetToolTip(_("Set Polarity of the DTR line"));
-    m_ckDTRPos->SetValue(false);
-    gridSizer17->Add(m_ckDTRPos, 0, wxALIGN_CENTER|wxALIGN_RIGHT, 5);
-
-    m_rbUseRTS = new wxRadioButton(this, wxID_ANY, _("Use RTS"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_rbUseRTS->SetToolTip(_("Toggle the RTS pin for PTT"));
-    m_rbUseRTS->SetValue(1);
-    gridSizer17->Add(m_rbUseRTS, 0, wxALIGN_CENTER|wxALIGN_RIGHT, 5);
-
-    m_ckRTSPos = new wxCheckBox(this, wxID_ANY, _("RTS = +V"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_ckRTSPos->SetValue(false);
-    m_ckRTSPos->SetToolTip(_("Set Polarity of the RTS line"));
-    gridSizer17->Add(m_ckRTSPos, 0, wxALIGN_CENTER|wxALIGN_RIGHT, 5);
-
-    //----------------------------------------------------------------------
-    // OK - Cancel - Apply
-    //----------------------------------------------------------------------
-
-    wxBoxSizer* boxSizer12 = new wxBoxSizer(wxHORIZONTAL);
-
-    m_buttonOK = new wxButton(this, wxID_OK, _("OK"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_buttonOK->SetDefault();
-    boxSizer12->Add(m_buttonOK, 0, wxLEFT|wxRIGHT|wxTOP|wxBOTTOM, 5);
-
-    m_buttonCancel = new wxButton(this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxSize(-1,-1), 0);
-    boxSizer12->Add(m_buttonCancel, 0, wxLEFT|wxRIGHT|wxTOP|wxBOTTOM, 5);
-
-    m_buttonApply = new wxButton(this, wxID_APPLY, _("Apply"), wxDefaultPosition, wxSize(-1,-1), 0);
-    boxSizer12->Add(m_buttonApply, 0, wxLEFT|wxRIGHT|wxTOP|wxBOTTOM, 5);
-
-    mainSizer->Add(boxSizer12, 0, wxLEFT|wxRIGHT|wxTOP|wxBOTTOM|wxALIGN_CENTER_HORIZONTAL, 5);
-
-    if ( GetSizer() ) 
-    {
-         GetSizer()->Fit(this);
-    }
-    Centre(wxBOTH);
-
-    // Connect events
-    this->Connect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(ComPortsDlg::OnInitDialog), NULL, this);
-    m_ckUseHamlibPTT->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(ComPortsDlg::PTTUseHamLibClicked), NULL, this);
-    m_ckUseSerialPTT->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(ComPortsDlg::PTTUseSerialClicked), NULL, this);
-    m_buttonOK->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnOK), NULL, this);
-    m_buttonCancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnCancel), NULL, this);
-    m_buttonApply->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnApply), NULL, this);
-}
-
-//-------------------------------------------------------------------------
-// ~ComPortsDlg()
-//-------------------------------------------------------------------------
-ComPortsDlg::~ComPortsDlg()
-{
-    // Disconnect Events
-    this->Disconnect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(ComPortsDlg::OnInitDialog), NULL, this);
-    m_ckUseHamlibPTT->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(ComPortsDlg::PTTUseHamLibClicked), NULL, this);
-    m_ckUseSerialPTT->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(ComPortsDlg::PTTUseSerialClicked), NULL, this);
-    m_buttonOK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnOK), NULL, this);
-    m_buttonCancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnCancel), NULL, this);
-    m_buttonApply->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnApply), NULL, this);
-}
-
-//-------------------------------------------------------------------------
-// OnInitDialog()
-//-------------------------------------------------------------------------
-void ComPortsDlg::OnInitDialog(wxInitDialogEvent& event)
-{
-    populatePortList();
-    ExchangeData(EXCHANGE_DATA_IN);
-}
-
-//-------------------------------------------------------------------------
-// populatePortList()
-//-------------------------------------------------------------------------
-void ComPortsDlg::populatePortList()
-{
-#ifdef __WXMSW__
-    m_listCtrlPorts->Clear();
-    m_cbSerialPort->Clear();
-    wxArrayString aStr;
-    wxRegKey key(wxRegKey::HKLM, _T("HARDWARE\\DEVICEMAP\\SERIALCOMM"));
-    if(!key.Exists())
-    {
-        return;
-    }
-    else
-    {
-        // Get the number of subkeys and enumerate them.
-        if(!key.Open(wxRegKey::Read))
-        {
-            return;
-        }    
-        size_t subkeys;
-        size_t values;
-        if(!key.GetKeyInfo(&subkeys, NULL, &values, NULL))
-        {
-            return;
-        }
-        if(!key.HasValues())
-        {
-            return;
-        }
-        wxString key_name;
-        long el = 1;
-        key.GetFirstValue(key_name, el);
-        wxString valType;
-        wxString key_data;
-        for(unsigned int i = 0; i < values; i++)
-        {
-            key.QueryValue(key_name, key_data);
-            //wxPrintf("Value:  %s Data: %s\n", key_name, key_data);
-            aStr.Add(key_data, 1);
-            key.GetNextValue(key_name, el);
-        }
-    }
-    m_listCtrlPorts->Append(aStr);
-    m_cbSerialPort->Append(aStr);
-#endif
-#ifdef __WXGTK__
-    m_cbSerialPort->Clear();
-    m_cbCtlDevicePath->Clear();
-#ifdef __FreeBSD__
-       glob_t  gl;
-       if(glob("/dev/tty*", GLOB_MARK, NULL, &gl)==0) {
-               for(unsigned int i=0; i<gl.gl_pathc; i++) {
-                       if(gl.gl_pathv[i][strlen(gl.gl_pathv[i])-1]=='/')
-                               continue;
-                               
-                       /* Exclude pseudo TTYs */
-                       if(gl.gl_pathv[i][8] >= 'l' && gl.gl_pathv[i][8] <= 's')
-                               continue;
-                       if(gl.gl_pathv[i][8] >= 'L' && gl.gl_pathv[i][8] <= 'S')
-                               continue;
-
-                       /* Exclude virtual TTYs */
-                       if(gl.gl_pathv[i][8] == 'v')
-                               continue;
-
-                       /* Exclude initial-state and lock-state devices */
-                       if(strchr(gl.gl_pathv[i], '.') != NULL)
-                               continue;
-
-                       m_cbSerialPort->Append(gl.gl_pathv[i]);
-                       m_cbCtlDevicePath->Append(gl.gl_pathv[i]);
-               }
-               globfree(&gl);
-       }
-#else
-    /* TODO(Joel): http://stackoverflow.com/questions/2530096/how-to-find-all-serial-devices-ttys-ttyusb-on-linux-without-opening-them */
-    m_cbSerialPort->Append("/dev/ttyUSB0");
-    m_cbSerialPort->Append("/dev/ttyUSB1");
-    m_cbSerialPort->Append("/dev/ttyS0");
-    m_cbSerialPort->Append("/dev/ttyS1");
-    m_cbCtlDevicePath->Clear();
-    m_cbCtlDevicePath->Append("/dev/ttyUSB0");
-    m_cbCtlDevicePath->Append("/dev/ttyUSB1");
-    m_cbCtlDevicePath->Append("/dev/ttyS0");
-    m_cbCtlDevicePath->Append("/dev/ttyS1");
-#endif
-#endif
-}
-
-//-------------------------------------------------------------------------
-// ExchangeData()
-//-------------------------------------------------------------------------
-void ComPortsDlg::ExchangeData(int inout)
-{
-    wxConfigBase *pConfig = wxConfigBase::Get();
-    wxString str;
-    
-    if(inout == EXCHANGE_DATA_IN)
-    {
-        m_ckHalfDuplex->SetValue(wxGetApp().m_boolHalfDuplex);
-        m_ckLeftChannelVoxTone->SetValue(wxGetApp().m_leftChannelVoxTone);
-
-        m_ckUseHamlibPTT->SetValue(wxGetApp().m_boolHamlibUseForPTT);
-        m_cbRigName->SetSelection(wxGetApp().m_intHamlibRig);
-        m_cbSerialPort->SetValue(wxGetApp().m_strHamlibSerialPort);
-
-        m_ckUseSerialPTT->SetValue(wxGetApp().m_boolUseSerialPTT);
-        str = wxGetApp().m_strRigCtrlPort;
-#ifdef __WXMSW__
-        m_listCtrlPorts->SetStringSelection(str);
-#endif
-#ifdef __WXGTK__
-        m_cbCtlDevicePath->SetValue(str);
-#endif
-        m_rbUseRTS->SetValue(wxGetApp().m_boolUseRTS);
-        m_ckRTSPos->SetValue(wxGetApp().m_boolRTSPos);
-        m_rbUseDTR->SetValue(wxGetApp().m_boolUseDTR);
-        m_ckDTRPos->SetValue(wxGetApp().m_boolDTRPos);
-    }
-    if(inout == EXCHANGE_DATA_OUT)
-    {
-        wxGetApp().m_boolHalfDuplex = m_ckHalfDuplex->GetValue();
-        pConfig->Write(wxT("/Rig/HalfDuplex"), wxGetApp().m_boolHalfDuplex);
-        wxGetApp().m_leftChannelVoxTone = m_ckLeftChannelVoxTone->GetValue();
-        pConfig->Write(wxT("/Rig/leftChannelVoxTone"), wxGetApp().m_leftChannelVoxTone);
-
-        /* Hamlib settings. */
-
-        wxGetApp().m_boolHamlibUseForPTT = m_ckUseHamlibPTT->GetValue();
-        wxGetApp().m_intHamlibRig = m_cbRigName->GetSelection();
-        wxGetApp().m_strHamlibSerialPort = m_cbSerialPort->GetValue();
-
-        pConfig->Write(wxT("/Hamlib/UseForPTT"), wxGetApp().m_boolHamlibUseForPTT);
-        pConfig->Write(wxT("/Hamlib/RigName"), wxGetApp().m_intHamlibRig);
-        pConfig->Write(wxT("/Hamlib/SerialPort"), wxGetApp().m_strHamlibSerialPort);
-
-        /* Serial settings */
-
-        wxGetApp().m_boolUseSerialPTT           = m_ckUseSerialPTT->IsChecked();
-#ifdef __WXMSW__
-        wxGetApp().m_strRigCtrlPort             = m_listCtrlPorts->GetStringSelection();
-#endif
-#ifdef __WXGTK__
-        wxGetApp().m_strRigCtrlPort             = m_cbCtlDevicePath->GetValue();
-#endif
-        wxGetApp().m_boolUseRTS                 = m_rbUseRTS->GetValue();
-        wxGetApp().m_boolRTSPos                 = m_ckRTSPos->IsChecked();
-        wxGetApp().m_boolUseDTR                 = m_rbUseDTR->GetValue();
-        wxGetApp().m_boolDTRPos                 = m_ckDTRPos->IsChecked();
-        
-        pConfig->Write(wxT("/Rig/UseSerialPTT"),    wxGetApp().m_boolUseSerialPTT);
-        pConfig->Write(wxT("/Rig/Port"),            wxGetApp().m_strRigCtrlPort); 
-        pConfig->Write(wxT("/Rig/UseRTS"),          wxGetApp().m_boolUseRTS);
-        pConfig->Write(wxT("/Rig/RTSPolarity"),     wxGetApp().m_boolRTSPos);
-        pConfig->Write(wxT("/Rig/UseDTR"),          wxGetApp().m_boolUseDTR);
-        pConfig->Write(wxT("/Rig/DTRPolarity"),     wxGetApp().m_boolDTRPos);
-
-        pConfig->Flush();
-    }
-    delete wxConfigBase::Set((wxConfigBase *) NULL);
-}
-
-//-------------------------------------------------------------------------
-// PTTUseHamLibClicked()
-//-------------------------------------------------------------------------
-void ComPortsDlg::PTTUseHamLibClicked(wxCommandEvent& event)
-{
-    m_ckUseSerialPTT->SetValue(false);    
-}
-
-//-------------------------------------------------------------------------
-// PTTUseSerialClicked()
-//-------------------------------------------------------------------------
-void ComPortsDlg::PTTUseSerialClicked(wxCommandEvent& event)
-{
-    m_ckUseHamlibPTT->SetValue(false);
-}
-
-//-------------------------------------------------------------------------
-// OnApply()
-//-------------------------------------------------------------------------
-void ComPortsDlg::OnApply(wxCommandEvent& event)
-{
-    ExchangeData(EXCHANGE_DATA_OUT);
-}
-
-//-------------------------------------------------------------------------
-// OnCancel()
-//-------------------------------------------------------------------------
-void ComPortsDlg::OnCancel(wxCommandEvent& event)
-{
-    this->EndModal(wxID_CANCEL);
-}
-
-//-------------------------------------------------------------------------
-// OnClose()
-//-------------------------------------------------------------------------
-void ComPortsDlg::OnOK(wxCommandEvent& event)
-{
-    ExchangeData(EXCHANGE_DATA_OUT);
-    this->EndModal(wxID_OK);
-}
diff --git a/fdmdv2-dev/src/dlg_ptt.h b/fdmdv2-dev/src/dlg_ptt.h
deleted file mode 100644 (file)
index 8fa9b9d..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-//==========================================================================
-// Name:            dlg_ptt.h
-// Purpose:         Subclasses dialog GUI for PTT Config.
-//                  
-// Created:         May. 11, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#ifndef __COMPORTS_DIALOG__
-#define __COMPORTS_DIALOG__
-
-#include "fdmdv2_main.h"
-#include "hamlib.h"
-#include <wx/settings.h>
-#include <wx/xrc/xmlres.h>
-#include <wx/xrc/xh_bmp.h>
-#include <wx/dialog.h>
-#include <wx/sizer.h>
-#include <wx/statbox.h>
-#include <wx/checkbox.h>
-#include <wx/listbox.h>
-#include <wx/radiobut.h>
-#include <wx/button.h>
-#include <wx/spinctrl.h>
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class ComPortsDlg
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class ComPortsDlg : public wxDialog
-{
-     public:
-        ComPortsDlg(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("PTT Config"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(450,300), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER);
-        virtual ~ComPortsDlg();
-        void    ExchangeData(int inout);
-
-    protected:
-        wxCheckBox* m_ckHalfDuplex;
-        wxCheckBox* m_ckLeftChannelVoxTone;
-
-        /* Hamlib settings.*/
-
-        wxCheckBox *m_ckUseHamlibPTT;
-        wxComboBox *m_cbRigName;
-        wxComboBox *m_cbSerialPort;
-
-        Hamlib *m_hamlib;
-
-        /* Serial Settings */
-
-        wxListBox     *m_listCtrlPorts;
-        wxCheckBox    *m_ckUseSerialPTT;
-        wxStaticText  *m_staticText12;
-        wxComboBox    *m_cbCtlDevicePath;
-        wxRadioButton *m_rbUseDTR;
-        wxCheckBox    *m_ckRTSPos;
-        wxRadioButton *m_rbUseRTS;
-        wxCheckBox    *m_ckDTRPos;
-
-        /* Ok - Cancel - Apply */
-
-        wxButton* m_buttonOK;
-        wxButton* m_buttonCancel;
-        wxButton* m_buttonApply;
-
-
-protected:
-        void populatePortList();
-
-        void PTTUseHamLibClicked(wxCommandEvent& event);
-        void PTTUseSerialClicked(wxCommandEvent& event);
-
-        void OnOK(wxCommandEvent& event);
-        void OnCancel(wxCommandEvent& event);
-        void OnApply(wxCommandEvent& event);
-        virtual void OnInitDialog(wxInitDialogEvent& event);
-};
-
-#endif // __COMPORTS_DIALOG__
diff --git a/fdmdv2-dev/src/fdmdv2_defines.h b/fdmdv2-dev/src/fdmdv2_defines.h
deleted file mode 100644 (file)
index 64aa606..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_defines.h
-// Purpose:         Definitions used by plots derived from fdmdv2_plot class.
-// Created:         August 27, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#ifndef __FDMDV2_DEFINES__
-#define __FDMDV2_DEFINES__
-
-#include "wx/wx.h"
-#include "freedv_api.h"
-#include "freedv_api_internal.h"
-
-// Spectrogram and Waterfall
-
-#define MIN_MAG_DB        -40.0     // min of spectrogram/waterfall magnitude axis
-#define MAX_MAG_DB          0.0     // max of spectrogram/waterfall magnitude axis
-#define STEP_MAG_DB         5.0     // magnitude axis step
-#define BETA                0.95    // constant for time averaging spectrum data
-#define MIN_F_HZ            0       // min freq on Waterfall and Spectrum
-#define MAX_F_HZ            3000    // max freq on Waterfall and Spectrum
-#define STEP_F_HZ           500     // major (e.g. text legend) freq step on Waterfall and Spectrum graticule
-#define STEP_MINOR_F_HZ     100     // minor (ticks) freq step on Waterfall and Spectrum graticule
-#define WATERFALL_SECS_Y    30      // number of seconds respresented by y axis of waterfall
-#define WATERFALL_SECS_STEP 5       // graticule y axis steps of waterfall
-#define DT                  0.1     // time between real time graphing updates
-#define FS                  8000    // FDMDV modem sample rate
-
-// Scatter diagram 
-
-#define SCATTER_MEM_SECS    10
-// (symbols/frame)/(graphics update period) = symbols/s sent to scatter memory
-// memory (symbols) = secs of memory * symbols/sec
-#define SCATTER_MEM_SYMS_MAX    ((int)(SCATTER_MEM_SECS*((FDMDV_NC_MAX+1)/DT)))
-
-// Waveform plotting constants
-
-#define WAVEFORM_PLOT_FS    400                            // sample rate (points/s) of waveform plotted to screen
-#define WAVEFORM_PLOT_TIME  5                              // length or entire waveform on screen
-#define WAVEFORM_PLOT_BUF   ((int)(DT*WAVEFORM_PLOT_FS))   // number of new samples we plot per DT
-
-// sample rate I/O & conversion constants
-
-#define MAX_FPB             8096                           // maximum value of portAudio framesPerBuffer
-#define PA_FPB              1024                           // nominal value of portAudio framesPerBuffer
-#define SAMPLE_RATE         48000                          // 48 kHz sampling rate rec. as we can trust accuracy of sound card
-#define N8                  160                            // processing buffer size at 8 kHz
-#define MEM8                (FDMDV_OS_TAPS/FDMDV_OS)
-#define N48                 (N8*SAMPLE_RATE/FS)            // processing buffer size at 48 kHz
-#define NUM_CHANNELS        2                              // I think most sound cards prefer stereo we will convert to mono
-#define VOX_TONE_FREQ       1000.0                         // optional left channel vox tone freq
-#define VOX_TONE_AMP        30000                          // optional left channel vox tone amp
-
-#define MAX_BITS_PER_CODEC_FRAME 64                            // 1600 bit/s mode
-#define MAX_BYTES_PER_CODEC_FRAME (MAX_BITS_PER_CODEC_FRAME/8)
-#define MAX_BITS_PER_FDMDV_FRAME 40                            // 2000 bit/s mode
-
-// Squelch
-#define SQ_DEFAULT_SNR       2.0
-
-// Level Gauge
-#define FROM_RADIO_MAX       0.8
-#define FROM_MIC_MAX         0.8
-#define LEVEL_BETA           0.99
-
-// SNR
-#define SNRSLOW_BETA        0.5                           // time constant for slow SNR for display
-
-// Text messaging Data
-#define MAX_CALLSIGN         80
-#define MAX_EVENT_LOG        10
-#define MAX_EVENT_RULES      100
-   
-enum
-{
-    ID_ROTATE_LEFT = wxID_HIGHEST + 1,
-    ID_ROTATE_RIGHT,
-    ID_RESIZE,
-    ID_PAINT_BG
-};
-
-// Codec 2 LPC Post Filter defaults, from codec-dev/src/quantise.c
-
-#define CODEC2_LPC_PF_GAMMA 0.5
-#define CODEC2_LPC_PF_BETA  0.2
-
-
-#endif  //__FDMDV2_DEFINES__
diff --git a/fdmdv2-dev/src/fdmdv2_main.cpp b/fdmdv2-dev/src/fdmdv2_main.cpp
deleted file mode 100644 (file)
index 37bf6a4..0000000
+++ /dev/null
@@ -1,3697 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_main.cpp
-//
-// Purpose:         FreeDV main()
-// Created:         Apr. 9, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-
-#include "fdmdv2_main.h"
-
-#define wxUSE_FILEDLG   1
-#define wxUSE_LIBPNG    1
-#define wxUSE_LIBJPEG   1
-#define wxUSE_GIF       1
-#define wxUSE_PCX       1
-#define wxUSE_LIBTIFF   1
-
-//-------------------------------------------------------------------
-// Bunch of globals used for communication with sound card call
-// back functions
-// ------------------------------------------------------------------
-
-int g_in, g_out;
-
-// Global Codec2 & modem states - just one reqd for tx & rx
-int                 g_Nc;
-int                 g_mode;
-struct freedv      *g_pfreedv;
-struct MODEM_STATS  g_stats;
-float               g_pwr_scale;
-int                 g_clip;
-
-// test Frames
-int                 g_testFrames;
-int                 g_test_frame_sync_state;
-int                 g_test_frame_count;
-int                 g_total_bits;
-int                 g_total_bit_errors;
-int                 g_channel_noise;
-float               g_sig_pwr_av = 0.0;
-struct FIFO        *g_error_pattern_fifo;
-short              *g_error_hist;
-// time averaged magnitude spectrum used for waterfall and spectrum display
-float               g_avmag[MODEM_STATS_NSPEC];
-
-// GUI controls that affect rx and tx processes
-int   g_SquelchActive;
-float g_SquelchLevel;
-int   g_analog;
-int   g_split;
-int   g_tx;
-float g_snr;
-bool  g_half_duplex;
-bool  g_modal;
-
-// sending and receiving Call Sign data
-struct FIFO         *g_txDataInFifo;
-struct FIFO         *g_rxDataOutFifo;
-
-// tx/rx processing states
-int                 g_State;
-paCallBackData     *g_rxUserdata;
-
-// FIFOs used for plotting waveforms
-struct FIFO        *g_plotDemodInFifo;
-struct FIFO        *g_plotSpeechOutFifo;
-struct FIFO        *g_plotSpeechInFifo;
-
-// Soundcard config
-int                 g_nSoundCards;
-int                 g_soundCard1InDeviceNum;
-int                 g_soundCard1OutDeviceNum;
-int                 g_soundCard1SampleRate;
-int                 g_soundCard2InDeviceNum;
-int                 g_soundCard2OutDeviceNum;
-int                 g_soundCard2SampleRate;
-
-// playing and recording from sound files
-
-SNDFILE            *g_sfPlayFile;
-bool                g_playFileToMicIn;
-bool                g_loopPlayFileToMicIn;
-int                 g_playFileToMicInEventId;
-
-SNDFILE            *g_sfRecFile;
-bool                g_recFileFromRadio;
-unsigned int        g_recFromRadioSamples;
-int                 g_recFileFromRadioEventId;
-
-SNDFILE            *g_sfPlayFileFromRadio;
-bool                g_playFileFromRadio;
-int                 g_sfFs;
-bool                g_loopPlayFileFromRadio;
-int                 g_playFileFromRadioEventId;
-float               g_blink;
-
-wxWindow           *g_parent;
-
-// Click to tune rx and tx frequency offset states
-float               g_RxFreqOffsetHz;
-COMP                g_RxFreqOffsetPhaseRect;
-float               g_TxFreqOffsetHz;
-COMP                g_TxFreqOffsetPhaseRect;
-
-// experimental mutex to make sound card callbacks mutually exclusive
-// TODO: review code and see if we need this any more, as fifos should
-// now be thread safe
-
-wxMutex g_mutexProtectingCallbackData;
-
-// Speex pre-processor states
-
-SpeexPreprocessState *g_speex_st;
-
-// WxWidgets - initialize the application
-IMPLEMENT_APP(MainApp);
-
-//FILE *ft;
-FILE *g_logfile;
-
-//-------------------------------------------------------------------------
-// OnInit()
-//-------------------------------------------------------------------------
-bool MainApp::OnInit()
-{
-    if(!wxApp::OnInit())
-    {
-        return false;
-    }
-    SetVendorName(wxT("CODEC2-Project"));
-    SetAppName(wxT("FreeDV"));      // not needed, it's the default value
-
-    // DR - this is wrong define so won't be used on windows build, should be __WXMSW__
-    // So registry will be used for Win32
-#ifdef _WXMSW_
-    // Force use of file-based configuration persistance on Windows platforma
-    wxConfig *pConfig = new wxConfig();
-    wxFileConfig *pFConfig = new wxFileConfig(wxT("FreeDV"), wxT("CODEC2-Project"), wxT("FreeDV.conf"), wxT("FreeDV.conf"),  wxCONFIG_USE_LOCAL_FILE | wxCONFIG_USE_RELATIVE_PATH);
-    pConfig->Set(pFConfig);
-    pConfig->SetRecordDefaults();
-#else
-    wxConfigBase *pConfig = wxConfigBase::Get();
-    pConfig->SetRecordDefaults();
-#endif
-
-    m_rTopWindow = wxRect(0, 0, 0, 0);
-    m_strRxInAudio.Empty();
-    m_strRxOutAudio.Empty();
-    m_textVoiceInput.Empty();
-    m_textVoiceOutput.Empty();
-    m_strSampleRate.Empty();
-    m_strBitrate.Empty();
-    // Create the main application window
-    frame = new MainFrame(NULL);
-    SetTopWindow(frame);
-    // Should guarantee that the first plot tab defined is the one
-    // displayed. But it doesn't when built from command line.  Why?
-    frame->m_auiNbookCtrl->ChangeSelection(0);
-    frame->Layout();
-    frame->Show();
-    g_parent =frame;
-
-    //ft = fopen("tmp.raw","wb");
-    //assert(ft != NULL);
-
-    return true;
-}
-
-//-------------------------------------------------------------------------
-// OnExit()
-//-------------------------------------------------------------------------
-int MainApp::OnExit()
-{
-    return 0;
-}
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class MainFrame(wxFrame* pa->ent) : TopFrame(parent)
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-MainFrame::MainFrame(wxWindow *parent) : TopFrame(parent)
-{
-    m_zoom              = 1.;
-
-    #ifdef __WXMSW__
-    g_logfile = fopen("log.txt","wt");
-    #else
-    g_logfile = stderr;
-    #endif
-
-    SetMinSize(wxSize(400,400));
-
-    // Init Hamlib library, but we dont start talking to any rigs yet
-
-    wxGetApp().m_hamlib = new Hamlib();
-
-    tools->AppendSeparator();
-    wxMenuItem* m_menuItemToolsConfigDelete;
-    m_menuItemToolsConfigDelete = new wxMenuItem(tools, wxID_ANY, wxString(_("&Restore defaults")) , wxT("Delete config file/keys and restore defaults"), wxITEM_NORMAL);
-    this->Connect(m_menuItemToolsConfigDelete->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::OnDeleteConfig));
-
-    tools->Append(m_menuItemToolsConfigDelete);
-
-    wxConfigBase *pConfig = wxConfigBase::Get();
-
-    // restore frame position and size
-    int x = pConfig->Read(wxT("/MainFrame/left"),       20);
-    int y = pConfig->Read(wxT("/MainFrame/top"),        20);
-    int w = pConfig->Read(wxT("/MainFrame/width"),     800);
-    int h = pConfig->Read(wxT("/MainFrame/height"),    550);
-
-    // sanitise frame position as a first pass at Win32 registry bug
-
-    fprintf(g_logfile, "x = %d y = %d w = %d h = %d\n", x,y,w,h);
-    if (x < 0 || x > 2048) x = 20;
-    if (y < 0 || y > 2048) y = 20;
-    if (w < 0 || w > 2048) w = 800;
-    if (h < 0 || h > 2048) h = 550;
-
-    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_show_speech_in     = pConfig->Read(wxT("/MainFrame/show_speech_in"),    1);
-    wxGetApp().m_show_speech_out    = pConfig->Read(wxT("/MainFrame/show_speech_out"),   1);
-    wxGetApp().m_show_demod_in      = pConfig->Read(wxT("/MainFrame/show_demod_in"),     1);
-    wxGetApp().m_show_test_frame_errors = pConfig->Read(wxT("/MainFrame/show_test_frame_errors"),     1);
-    wxGetApp().m_show_test_frame_errors_hist = pConfig->Read(wxT("/MainFrame/show_test_frame_errors_hist"),     1);
-
-    wxGetApp().m_rxNbookCtrl        = pConfig->Read(wxT("/MainFrame/rxNbookCtrl"),    (long)0);
-
-    g_SquelchActive = pConfig->Read(wxT("/Audio/SquelchActive"), (long)0);
-    g_SquelchLevel = pConfig->Read(wxT("/Audio/SquelchLevel"), (int)(SQ_DEFAULT_SNR*2));
-    g_SquelchLevel /= 2.0;
-
-    Move(x, y);
-    SetClientSize(w, h);
-    
-    if(wxGetApp().m_show_wf)
-    {
-        // Add Waterfall Plot window
-        m_panelWaterfall = new PlotWaterfall((wxFrame*) m_auiNbookCtrl, false, 0);
-        m_panelWaterfall->SetToolTip(_("Left click to tune, Right click to toggle mono/colour"));
-        m_auiNbookCtrl->AddPage(m_panelWaterfall, _("Waterfall"), true, wxNullBitmap);
-    }
-    if(wxGetApp().m_show_spect)
-    {
-        // Add Spectrum Plot window
-        m_panelSpectrum = new PlotSpectrum((wxFrame*) m_auiNbookCtrl, g_avmag,
-                                           MODEM_STATS_NSPEC*((float)MAX_F_HZ/MODEM_STATS_MAX_F_HZ));
-        m_panelSpectrum->SetToolTip(_("Left click to tune"));
-        m_auiNbookCtrl->AddPage(m_panelSpectrum, _("Spectrum"), true, wxNullBitmap);
-    }
-    if(wxGetApp().m_show_scatter)
-    {
-        // Add Scatter Plot window
-        m_panelScatter = new PlotScatter((wxFrame*) m_auiNbookCtrl);
-        m_auiNbookCtrl->AddPage(m_panelScatter, _("Scatter"), true, wxNullBitmap);
-    }
-    if(wxGetApp().m_show_demod_in)
-    {
-        // Add Demod Input window
-        m_panelDemodIn = new PlotScalar((wxFrame*) m_auiNbookCtrl, 1, WAVEFORM_PLOT_TIME, 1.0/WAVEFORM_PLOT_FS, -1, 1, 1, 0.2, "%2.1f", 0);
-        m_auiNbookCtrl->AddPage(m_panelDemodIn, _("Frm Radio"), true, wxNullBitmap);
-        g_plotDemodInFifo = fifo_create(2*WAVEFORM_PLOT_BUF);
-    }
-
-    if(wxGetApp().m_show_speech_in)
-    {
-        // Add Speech Input window
-        m_panelSpeechIn = new PlotScalar((wxFrame*) m_auiNbookCtrl, 1, WAVEFORM_PLOT_TIME, 1.0/WAVEFORM_PLOT_FS, -1, 1, 1, 0.2, "%2.1f", 0);
-        m_auiNbookCtrl->AddPage(m_panelSpeechIn, _("Frm Mic"), true, wxNullBitmap);
-        g_plotSpeechInFifo = fifo_create(4*WAVEFORM_PLOT_BUF);
-    }
-
-    if(wxGetApp().m_show_speech_out)
-    {
-        // Add Speech Output window
-        m_panelSpeechOut = new PlotScalar((wxFrame*) m_auiNbookCtrl, 1, WAVEFORM_PLOT_TIME, 1.0/WAVEFORM_PLOT_FS, -1, 1, 1, 0.2, "%2.1f", 0);
-        m_auiNbookCtrl->AddPage(m_panelSpeechOut, _("To Spkr/Hdphns"), true, wxNullBitmap);
-        g_plotSpeechOutFifo = fifo_create(2*WAVEFORM_PLOT_BUF);
-    }
-
-    if(wxGetApp().m_show_timing)
-    {
-        // Add Timing Offset window
-        m_panelTimeOffset = new PlotScalar((wxFrame*) m_auiNbookCtrl, 1, 5.0, DT, -0.5, 0.5, 1, 0.1, "%2.1f", 0);
-        m_auiNbookCtrl->AddPage(m_panelTimeOffset, L"Timing \u0394", true, wxNullBitmap);
-    }
-    if(wxGetApp().m_show_freq)
-    {
-        // Add Frequency Offset window
-        m_panelFreqOffset = new PlotScalar((wxFrame*) m_auiNbookCtrl, 1, 5.0, DT, -200, 200, 1, 50, "%3.0fHz", 0);
-        m_auiNbookCtrl->AddPage(m_panelFreqOffset, L"Frequency \u0394", true, wxNullBitmap);
-    }
-
-    if(wxGetApp().m_show_test_frame_errors)
-    {
-        // Add Test Frame Errors window
-        m_panelTestFrameErrors = new PlotScalar((wxFrame*) m_auiNbookCtrl, 2*MODEM_STATS_NC_MAX, 30.0, DT, 0, 2*MODEM_STATS_NC_MAX+2, 1, 1, "", 1);
-        m_auiNbookCtrl->AddPage(m_panelTestFrameErrors, L"Test Frame Errors", true, wxNullBitmap);
-    }
-
-    if(wxGetApp().m_show_test_frame_errors_hist)
-    {
-        // Add Test Frame Errors window
-        m_panelTestFrameErrorsHist = new PlotScalar((wxFrame*) m_auiNbookCtrl, 1, 1.0, 1.0/(2*FDMDV_NC_MAX), 0.0, 1.0, 1.0/FDMDV_NC_MAX, 0.1, "%3.2f", 0);
-        m_auiNbookCtrl->AddPage(m_panelTestFrameErrorsHist, L"Test Frame Histogram", true, wxNullBitmap);
-    }
-
-    wxGetApp().m_framesPerBuffer = pConfig->Read(wxT("/Audio/framesPerBuffer"), PA_FPB);
-
-    g_soundCard1InDeviceNum  = pConfig->Read(wxT("/Audio/soundCard1InDeviceNum"),         -1);
-    g_soundCard1OutDeviceNum = pConfig->Read(wxT("/Audio/soundCard1OutDeviceNum"),        -1);
-    g_soundCard1SampleRate   = pConfig->Read(wxT("/Audio/soundCard1SampleRate"),          -1);
-
-    g_soundCard2InDeviceNum  = pConfig->Read(wxT("/Audio/soundCard2InDeviceNum"),         -1);
-    g_soundCard2OutDeviceNum = pConfig->Read(wxT("/Audio/soundCard2OutDeviceNum"),        -1);
-    g_soundCard2SampleRate   = pConfig->Read(wxT("/Audio/soundCard2SampleRate"),          -1);
-
-    g_nSoundCards = 0;
-    if ((g_soundCard1InDeviceNum > -1) && (g_soundCard1OutDeviceNum > -1)) {
-        g_nSoundCards = 1;
-        if ((g_soundCard2InDeviceNum > -1) && (g_soundCard2OutDeviceNum > -1))
-            g_nSoundCards = 2;
-    }
-
-    wxGetApp().m_playFileToMicInPath = pConfig->Read("/File/playFileToMicInPath",   wxT(""));
-    wxGetApp().m_recFileFromRadioPath = pConfig->Read("/File/recFileFromRadioPath", wxT(""));
-    wxGetApp().m_recFileFromRadioSecs = pConfig->Read("/File/recFileFromRadioSecs", 30);
-    wxGetApp().m_playFileFromRadioPath = pConfig->Read("/File/playFileFromRadioPath", wxT(""));
-
-    // PTT -------------------------------------------------------------------
-
-    wxGetApp().m_boolHalfDuplex     = pConfig->ReadBool(wxT("/Rig/HalfDuplex"),     true);
-    wxGetApp().m_leftChannelVoxTone = pConfig->ReadBool("/Rig/leftChannelVoxTone",  false);
-    wxGetApp().m_boolHamlibUseForPTT = pConfig->ReadBool("/Hamlib/UseForPTT", false);
-    wxGetApp().m_intHamlibRig = pConfig->ReadLong("/Hamlib/RigName", 0);
-    wxGetApp().m_strHamlibSerialPort = pConfig->Read("/Hamlib/SerialPort", "");
-    
-    wxGetApp().m_boolUseSerialPTT   = pConfig->ReadBool(wxT("/Rig/UseSerialPTT"),   false);
-    wxGetApp().m_strRigCtrlPort     = pConfig->Read(wxT("/Rig/Port"),               wxT(""));
-    wxGetApp().m_boolUseRTS         = pConfig->ReadBool(wxT("/Rig/UseRTS"),         true);
-    wxGetApp().m_boolRTSPos         = pConfig->ReadBool(wxT("/Rig/RTSPolarity"),    true);
-    wxGetApp().m_boolUseDTR         = pConfig->ReadBool(wxT("/Rig/UseDTR"),         false);
-    wxGetApp().m_boolDTRPos         = pConfig->ReadBool(wxT("/Rig/DTRPolarity"),    false);
-    com_handle = COM_HANDLE_INVALID;
-
-    // -----------------------------------------------------------------------
-
-    bool slow = false; // prevents compile error when using default bool
-    wxGetApp().m_snrSlow = pConfig->Read("/Audio/snrSlow", slow);
-
-    bool t = true;     // prevents compile error when using default bool
-    wxGetApp().m_codec2LPCPostFilterEnable     = pConfig->Read(wxT("/Filter/codec2LPCPostFilterEnable"),    t);
-    wxGetApp().m_codec2LPCPostFilterBassBoost  = pConfig->Read(wxT("/Filter/codec2LPCPostFilterBassBoost"), t);
-    wxGetApp().m_codec2LPCPostFilterGamma      = (float)pConfig->Read(wxT("/Filter/codec2LPCPostFilterGamma"),     CODEC2_LPC_PF_GAMMA*100)/100.0;
-    wxGetApp().m_codec2LPCPostFilterBeta       = (float)pConfig->Read(wxT("/Filter/codec2LPCPostFilterBeta"),      CODEC2_LPC_PF_BETA*100)/100.0;
-    //printf("main(): m_codec2LPCPostFilterBeta: %f\n", wxGetApp().m_codec2LPCPostFilterBeta);
-
-    wxGetApp().m_speexpp_enable     = pConfig->Read(wxT("/Filter/speexpp_enable"),    t);
-
-    wxGetApp().m_MicInBassFreqHz = (float)pConfig->Read(wxT("/Filter/MicInBassFreqHz"),    1);
-    wxGetApp().m_MicInBassGaindB = (float)pConfig->Read(wxT("/Filter/MicInBassGaindB"),    (long)0)/10.0;
-    wxGetApp().m_MicInTrebleFreqHz = (float)pConfig->Read(wxT("/Filter/MicInTrebleFreqHz"),    1);
-    wxGetApp().m_MicInTrebleGaindB = (float)pConfig->Read(wxT("/Filter/MicInTrebleGaindB"),    (long)0)/10.0;
-    wxGetApp().m_MicInMidFreqHz = (float)pConfig->Read(wxT("/Filter/MicInMidFreqHz"),    1);
-    wxGetApp().m_MicInMidGaindB = (float)pConfig->Read(wxT("/Filter/MicInMidGaindB"),    (long)0)/10.0;
-    wxGetApp().m_MicInMidQ = (float)pConfig->Read(wxT("/Filter/MicInMidQ"),              (long)100)/100.0;
-
-    bool f = false;
-    wxGetApp().m_MicInEQEnable = (float)pConfig->Read(wxT("/Filter/MicInEQEnable"), f);
-
-    wxGetApp().m_SpkOutBassFreqHz = (float)pConfig->Read(wxT("/Filter/SpkOutBassFreqHz"),    1);
-    wxGetApp().m_SpkOutBassGaindB = (float)pConfig->Read(wxT("/Filter/SpkOutBassGaindB"),    (long)0)/10.0;
-    wxGetApp().m_SpkOutTrebleFreqHz = (float)pConfig->Read(wxT("/Filter/SpkOutTrebleFreqHz"),    1);
-    wxGetApp().m_SpkOutTrebleGaindB = (float)pConfig->Read(wxT("/Filter/SpkOutTrebleGaindB"),    (long)0)/10.0;
-    wxGetApp().m_SpkOutMidFreqHz = (float)pConfig->Read(wxT("/Filter/SpkOutMidFreqHz"),    1);
-    wxGetApp().m_SpkOutMidGaindB = (float)pConfig->Read(wxT("/Filter/SpkOutMidGaindB"),    (long)0)/10.0;
-    wxGetApp().m_SpkOutMidQ = (float)pConfig->Read(wxT("/Filter/SpkOutMidQ"),                (long)100)/100.0;
-
-    wxGetApp().m_SpkOutEQEnable = (float)pConfig->Read(wxT("/Filter/SpkOutEQEnable"), f);
-
-    wxGetApp().m_callSign = pConfig->Read("/Data/CallSign", wxT(""));
-    wxGetApp().m_textEncoding = pConfig->Read("/Data/TextEncoding", 1);
-    wxGetApp().m_enable_checksum = pConfig->Read("/Data/EnableChecksumOnMsgRx", f);
-
-    wxGetApp().m_events = pConfig->Read("/Events/enable", f);
-    wxGetApp().m_events_spam_timer = (int)pConfig->Read(wxT("/Events/spam_timer"), 10);
-    wxGetApp().m_events_regexp_match = pConfig->Read("/Events/regexp_match", wxT("s=(.*)"));
-    wxGetApp().m_events_regexp_replace = pConfig->Read("/Events/regexp_replace", 
-                                                       wxT("curl http://qso.freedv.org/cgi-bin/onspot.cgi?s=\\1"));
-    // make sure regexp lists are terminated by a \n
-
-    if (wxGetApp().m_events_regexp_match.Last() != '\n') {
-        wxGetApp().m_events_regexp_match = wxGetApp().m_events_regexp_match+'\n';
-    }
-    if (wxGetApp().m_events_regexp_replace.Last() != '\n') {
-        wxGetApp().m_events_regexp_replace = wxGetApp().m_events_regexp_replace+'\n';
-    }
-
-    wxGetApp().m_udp_enable = (float)pConfig->Read(wxT("/UDP/enable"), f);
-    wxGetApp().m_udp_port = (int)pConfig->Read(wxT("/UDP/port"), 3000);
-
-    wxGetApp().m_FreeDV700txClip = (float)pConfig->Read(wxT("/FreeDV700/txClip"), t);
-
-    int mode  = pConfig->Read(wxT("/Audio/mode"), (long)0);
-    if (mode == 0)
-        m_rb1600->SetValue(1);
-    if (mode == 1)
-        m_rb700->SetValue(1);
-    if (mode == 2)
-        m_rb700b->SetValue(1);
-        
-    pConfig->SetPath(wxT("/"));
-
-//    this->Connect(m_menuItemHelpUpdates->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnHelpCheckUpdatesUI));
-    //m_togRxID->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnRxIDUI), NULL, this);
-    //m_togTxID->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnTxIDUI), NULL, this);
-    m_togBtnOnOff->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnOnOffUI), NULL, this);
-    m_togBtnSplit->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnSplitClickUI), NULL, this);
-    m_togBtnAnalog->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnAnalogClickUI), NULL, this);
-    //m_togBtnALC->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnALCClickUI), NULL, this);
-   // m_btnTogPTT->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnPTT_UI), NULL, this);
-
-    m_togBtnSplit->Disable();
-    //m_togRxID->Disable();
-    //m_togTxID->Disable();
-    m_togBtnAnalog->Disable();
-    m_btnTogPTT->Disable();
-    //m_togBtnALC->Disable();
-
-    // squelch settings
-    char sqsnr[15];
-    m_sliderSQ->SetValue((int)((g_SquelchLevel+5.0)*2.0));
-    sprintf(sqsnr, "%4.1f", g_SquelchLevel);
-    wxString sqsnr_string(sqsnr);
-    m_textSQ->SetLabel(sqsnr_string);
-    m_ckboxSQ->SetValue(g_SquelchActive);
-
-    // SNR settings
-
-    m_ckboxSNR->SetValue(wxGetApp().m_snrSlow);
-    setsnrBeta(wxGetApp().m_snrSlow);
-
-#ifdef _USE_TIMER
-    Bind(wxEVT_TIMER, &MainFrame::OnTimer, this);       // ID_MY_WINDOW);
-    m_plotTimer.SetOwner(this, ID_TIMER_WATERFALL);
-    //m_panelWaterfall->Refresh();
-#endif
-
-    m_RxRunning = false;
-
-#ifdef _USE_ONIDLE
-    Connect(wxEVT_IDLE, wxIdleEventHandler(MainFrame::OnIdle), NULL, this);
-#endif //_USE_ONIDLE
-
-    g_sfPlayFile = NULL;
-    g_playFileToMicIn = false;
-    g_loopPlayFileToMicIn = false;
-
-    g_sfRecFile = NULL;
-    g_recFileFromRadio = false;
-
-    g_sfPlayFileFromRadio = NULL;
-    g_playFileFromRadio = false;
-    g_loopPlayFileFromRadio = false;
-
-    // init click-tune states
-
-    g_RxFreqOffsetHz = 0.0;
-    g_RxFreqOffsetPhaseRect.real = cos(0.0);
-    g_RxFreqOffsetPhaseRect.imag = sin(0.0);
-    m_panelWaterfall->setRxFreq(FDMDV_FCENTRE - g_RxFreqOffsetHz);
-    m_panelSpectrum->setRxFreq(FDMDV_FCENTRE - g_RxFreqOffsetHz);
-
-    g_TxFreqOffsetHz = 0.0;
-    g_TxFreqOffsetPhaseRect.real = cos(0.0);
-    g_TxFreqOffsetPhaseRect.imag = sin(0.0);
-
-    g_tx = 0;
-    g_split = 0;
-
-    // data states
-    g_txDataInFifo = fifo_create(MAX_CALLSIGN*VARICODE_MAX_BITS);
-    g_rxDataOutFifo = fifo_create(MAX_CALLSIGN*VARICODE_MAX_BITS);
-
-    sox_biquad_start();
-    golay23_init();
-
-    g_testFrames = 0;
-    g_test_frame_sync_state = 0;
-    g_total_bit_errors = 0;
-    g_total_bits = 0;
-    wxGetApp().m_testFrames = false;
-
-    g_modal = false;
-
-    // Start UDP listener thread
-
-    m_UDPThread = NULL;
-    startUDPThread();
-
-    optionsDlg = new OptionsDlg(NULL);
-    m_schedule_restore = false;
-
-}
-
-//-------------------------------------------------------------------------
-// ~MainFrame()
-//-------------------------------------------------------------------------
-MainFrame::~MainFrame()
-{
-    int x;
-    int y;
-    int w;
-    int h;
-
-    //fclose(ft);
-    #ifdef __WXMSW__
-    fclose(g_logfile);
-    #endif
-
-    if (optionsDlg != NULL) {
-        delete optionsDlg;
-        optionsDlg = NULL;
-    }
-
-    stopUDPThread();
-
-    /* TOOD(Joel): the ownership of m_hamlib is probably wrong. */
-    if (wxGetApp().m_hamlib) delete wxGetApp().m_hamlib;
-
-    //MainApp *pApp = wxGetApp();
-    wxConfigBase *pConfig = wxConfigBase::Get();
-    if(pConfig)
-    {
-        if (!IsIconized()) {
-            GetClientSize(&w, &h);
-
-            // big hack - for some reason height shrinks by this much
-            // every time FreeDV runs!  I have no idea why
-
-            h += 23;
-
-            GetPosition(&x, &y);
-            printf("x = %d y = %d w = %d h = %d\n", x,y,w,h);
-            pConfig->Write(wxT("/MainFrame/left"),               (long) x);
-            pConfig->Write(wxT("/MainFrame/top"),                (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("/MainFrame/show_speech_in"),    wxGetApp().m_show_speech_in);
-        pConfig->Write(wxT("/MainFrame/show_speech_out"),   wxGetApp().m_show_speech_out);
-        pConfig->Write(wxT("/MainFrame/show_demod_in"),     wxGetApp().m_show_demod_in);
-        pConfig->Write(wxT("/MainFrame/show_test_frame_errors"), wxGetApp().m_show_test_frame_errors);
-        pConfig->Write(wxT("/MainFrame/show_test_frame_errors_hist"), wxGetApp().m_show_test_frame_errors_hist);
-
-        pConfig->Write(wxT("/MainFrame/rxNbookCtrl"), wxGetApp().m_rxNbookCtrl);
-
-        pConfig->Write(wxT("/Audio/SquelchActive"),         g_SquelchActive);
-        pConfig->Write(wxT("/Audio/SquelchLevel"),          (int)(g_SquelchLevel*2.0));
-
-        pConfig->Write(wxT("/Audio/framesPerBuffer"),       wxGetApp().m_framesPerBuffer);
-
-        pConfig->Write(wxT("/Audio/soundCard1InDeviceNum"),   g_soundCard1InDeviceNum);
-        pConfig->Write(wxT("/Audio/soundCard1OutDeviceNum"),  g_soundCard1OutDeviceNum);
-        pConfig->Write(wxT("/Audio/soundCard1SampleRate"),    g_soundCard1SampleRate );
-
-        pConfig->Write(wxT("/Audio/soundCard2InDeviceNum"),   g_soundCard2InDeviceNum);
-        pConfig->Write(wxT("/Audio/soundCard2OutDeviceNum"),  g_soundCard2OutDeviceNum);
-        pConfig->Write(wxT("/Audio/soundCard2SampleRate"),    g_soundCard2SampleRate );
-
-        pConfig->Write(wxT("/Rig/HalfDuplex"),              wxGetApp().m_boolHalfDuplex);
-        pConfig->Write(wxT("/Rig/leftChannelVoxTone"),      wxGetApp().m_leftChannelVoxTone);
-        pConfig->Write("/Hamlib/UseForPTT", wxGetApp().m_boolHamlibUseForPTT);
-        pConfig->Write("/Hamlib/RigName", wxGetApp().m_intHamlibRig);
-        pConfig->Write("/Hamlib/SerialPort", wxGetApp().m_strHamlibSerialPort);
-
-
-        pConfig->Write(wxT("/File/playFileToMicInPath"),    wxGetApp().m_playFileToMicInPath);
-        pConfig->Write(wxT("/File/recFileFromRadioPath"),   wxGetApp().m_recFileFromRadioPath);
-        pConfig->Write(wxT("/File/recFileFromRadioSecs"),   wxGetApp().m_recFileFromRadioSecs);
-        pConfig->Write(wxT("/File/playFileFromRadioPath"),  wxGetApp().m_playFileFromRadioPath);
-
-        pConfig->Write(wxT("/Audio/snrSlow"), wxGetApp().m_snrSlow);
-
-        pConfig->Write(wxT("/Data/CallSign"), wxGetApp().m_callSign);
-        pConfig->Write(wxT("/Data/TextEncoding"), wxGetApp().m_textEncoding);
-        pConfig->Write(wxT("/Data/EnableChecksumOnMsgRx"), wxGetApp().m_enable_checksum);
-        pConfig->Write(wxT("/Events/enable"), wxGetApp().m_events);
-        pConfig->Write(wxT("/Events/spam_timer"), wxGetApp().m_events_spam_timer);
-        pConfig->Write(wxT("/Events/regexp_match"), wxGetApp().m_events_regexp_match);
-        pConfig->Write(wxT("/Events/regexp_replace"), wxGetApp().m_events_regexp_replace);
-        pConfig->Write(wxT("/UDP/enable"), wxGetApp().m_udp_enable);
-        pConfig->Write(wxT("/UDP/port"),  wxGetApp().m_udp_port);
-
-        pConfig->Write(wxT("/Filter/MicInEQEnable"), wxGetApp().m_MicInEQEnable);
-        pConfig->Write(wxT("/Filter/SpkOutEQEnable"), wxGetApp().m_SpkOutEQEnable);
-
-        pConfig->Write(wxT("/FreeDV700/txClip"), wxGetApp().m_FreeDV700txClip);
-
-        int mode;
-        if (m_rb1600->GetValue())
-            mode = 0;
-        if (m_rb700->GetValue())
-            mode = 1;
-        if (m_rb700b->GetValue())
-            mode = 2;
-        pConfig->Write(wxT("/Audio/mode"), mode);
-    }
-
-    //m_togRxID->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnRxIDUI), NULL, this);
-    //m_togTxID->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnTxIDUI), NULL, this);
-    m_togBtnOnOff->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnOnOffUI), NULL, this);
-    m_togBtnSplit->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnSplitClickUI), NULL, this);
-    m_togBtnAnalog->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnAnalogClickUI), NULL, this);
-    //m_togBtnALC->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnALCClickUI), NULL, this);
-    //m_btnTogPTT->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnPTT_UI), NULL, this);
-
-    sox_biquad_finish();
-
-    if (m_RxRunning)
-    {
-        stopRxStream();
-    }
-    if (g_sfPlayFile != NULL)
-    {
-        sf_close(g_sfPlayFile);
-        g_sfPlayFile = NULL;
-    }
-    if (g_sfRecFile != NULL)
-    {
-        sf_close(g_sfRecFile);
-        g_sfRecFile = NULL;
-    }
-#ifdef _USE_TIMER
-    if(m_plotTimer.IsRunning())
-    {
-        m_plotTimer.Stop();
-        Unbind(wxEVT_TIMER, &MainFrame::OnTimer, this);
-    }
-#endif //_USE_TIMER
-
-#ifdef _USE_ONIDLE
-    Disconnect(wxEVT_IDLE, wxIdleEventHandler(MainFrame::OnIdle), NULL, this);
-#endif // _USE_ONIDLE
-
-    delete wxConfigBase::Set((wxConfigBase *) NULL);
-}
-
-//----------------------------------------------------------------
-// closeComPort() closes the currently open com port
-//----------------------------------------------------------------
-void MainFrame::closeComPort(void)
-{
-#ifdef _WIN32
-       CloseHandle(com_handle);
-#else
-       close(com_handle);
-#endif
-       com_handle = COM_HANDLE_INVALID;
-}
-
-//----------------------------------------------------------------
-// openComPort() opens the com port specified by the string
-// ie: "COM1" on Windows or "/dev/ttyu0" on FreeBSD
-//----------------------------------------------------------------
-bool MainFrame::openComPort(const char *name)
-{
-       if(com_handle != COM_HANDLE_INVALID)
-               closeComPort();
-#ifdef _WIN32
-       {
-               COMMCONFIG CC;
-               DWORD CCsize=sizeof(CC);
-               COMMTIMEOUTS timeouts;
-               DCB     dcb;
-
-               if(GetDefaultCommConfigA(name, &CC, &CCsize)) {
-                       CC.dcb.fOutxCtsFlow             = FALSE;
-                       CC.dcb.fOutxDsrFlow             = FALSE;
-                       CC.dcb.fDtrControl              = DTR_CONTROL_DISABLE;
-                       CC.dcb.fDsrSensitivity  = FALSE;
-                       CC.dcb.fRtsControl              = RTS_CONTROL_DISABLE;
-                       SetDefaultCommConfigA(name, &CC, CCsize);
-               }
-
-               if((com_handle=CreateFileA(name
-                       ,GENERIC_READ|GENERIC_WRITE     /* Access */
-                       ,0                                                              /* Share mode */
-                       ,NULL                                                   /* Security attributes */
-                       ,OPEN_EXISTING                                  /* Create access */
-                       ,FILE_ATTRIBUTE_NORMAL                  /* File attributes */
-                       ,NULL                                                   /* Template */
-                       ))==INVALID_HANDLE_VALUE)
-                       return false;
-
-               if(GetCommTimeouts(com_handle, &timeouts)) {
-                       timeouts.ReadIntervalTimeout=MAXDWORD;
-                       timeouts.ReadTotalTimeoutMultiplier=0;
-                       timeouts.ReadTotalTimeoutConstant=0;            // No-wait read timeout
-                       timeouts.WriteTotalTimeoutMultiplier=0;
-                       timeouts.WriteTotalTimeoutConstant=5000;        // 5 seconds
-                       SetCommTimeouts(com_handle,&timeouts);
-               }
-
-               /* Force N-8-1 mode: */
-               if(GetCommState(com_handle, &dcb)==TRUE) {
-                       dcb.ByteSize            = 8;
-                       dcb.Parity                      = NOPARITY;
-                       dcb.StopBits            = ONESTOPBIT;
-                       dcb.DCBlength           = sizeof(DCB);
-                       dcb.fBinary                     = TRUE;
-                       dcb.fOutxCtsFlow        = FALSE;
-                       dcb.fOutxDsrFlow        = FALSE;
-                       dcb.fDtrControl         = DTR_CONTROL_DISABLE;
-                       dcb.fDsrSensitivity     = FALSE;
-                       dcb.fTXContinueOnXoff= TRUE;
-                       dcb.fOutX                       = FALSE;
-                       dcb.fInX                        = FALSE;
-                       dcb.fRtsControl         = RTS_CONTROL_DISABLE;
-                       dcb.fAbortOnError       = FALSE;
-                       SetCommState(com_handle, &dcb);
-               }
-       }
-#else
-       {
-               struct termios t;
-
-               if((com_handle=open(name, O_NONBLOCK|O_RDWR))==COM_HANDLE_INVALID)
-                       return false;
-
-               if(tcgetattr(com_handle, &t)==-1) {
-                       close(com_handle);
-                       com_handle = COM_HANDLE_INVALID;
-                       return false;
-               }
-
-               t.c_iflag = (
-                                         IGNBRK   /* ignore BREAK condition */
-                                       | IGNPAR   /* ignore (discard) parity errors */
-                                       );
-               t.c_oflag = 0;  /* No output processing */
-               t.c_cflag = (
-                                         CS8         /* 8 bits */
-                                       | CREAD       /* enable receiver */
-               /*
-               Fun snippet from the FreeBSD manpage:
-
-                        If CREAD is set, the receiver is enabled.  Otherwise, no character is
-                        received.  Not all hardware supports this bit.  In fact, this flag is
-                        pretty silly and if it were not part of the termios specification it
-                        would be omitted.
-               */
-                                       | CLOCAL      /* ignore modem status lines */
-                                       );
-               t.c_lflag = 0;  /* No local modes */
-               if(tcsetattr(com_handle, TCSANOW, &t)==-1) {
-                       close(com_handle);
-                       com_handle = COM_HANDLE_INVALID;
-                       return false;
-               }
-               
-       }
-#endif
-       return true;
-}
-
-#ifdef _USE_ONIDLE
-void MainFrame::OnIdle(wxIdleEvent &evt) {
-}
-#endif
-
-//----------------------------------------------------------------
-// (raise|lower)(RTS|DTR)()
-//
-// Raises/lowers the specified signal
-//----------------------------------------------------------------
-void MainFrame::raiseDTR(void)
-{
-       if(com_handle == COM_HANDLE_INVALID)
-               return;
-#ifdef _WIN32
-       EscapeCommFunction(com_handle, SETDTR);
-#else
-       {       // For C89 happiness
-               int flags = TIOCM_DTR;
-               ioctl(com_handle, TIOCMBIS, &flags);
-       }
-#endif
-}
-void MainFrame::raiseRTS(void)
-{
-       if(com_handle == COM_HANDLE_INVALID)
-               return;
-#ifdef _WIN32
-       EscapeCommFunction(com_handle, SETRTS);
-#else
-       {       // For C89 happiness
-               int flags = TIOCM_RTS;
-               ioctl(com_handle, TIOCMBIS, &flags);
-       }
-#endif
-}
-void MainFrame::lowerDTR(void)
-{
-       if(com_handle == COM_HANDLE_INVALID)
-               return;
-#ifdef _WIN32
-       EscapeCommFunction(com_handle, CLRDTR);
-#else
-       {       // For C89 happiness
-               int flags = TIOCM_DTR;
-               ioctl(com_handle, TIOCMBIC, &flags);
-       }
-#endif
-}
-void MainFrame::lowerRTS(void)
-{
-       if(com_handle == COM_HANDLE_INVALID)
-               return;
-#ifdef _WIN32
-       EscapeCommFunction(com_handle, CLRRTS);
-#else
-       {       // For C89 happiness
-               int flags = TIOCM_RTS;
-               ioctl(com_handle, TIOCMBIC, &flags);
-       }
-#endif
-}
-
-
-#ifdef _USE_TIMER
-//----------------------------------------------------------------
-// OnTimer()
-//
-// when the timer fires every DT seconds we update the GUI displays.
-// the tabs only the plot that is visible actually gets updated, this
-// keeps CPU load reasonable
-//----------------------------------------------------------------
-void MainFrame::OnTimer(wxTimerEvent &evt)
-{
-
-    int r,c;
-
-    if (m_panelWaterfall->checkDT()) {
-        m_panelWaterfall->setRxFreq(FDMDV_FCENTRE - g_RxFreqOffsetHz);
-        m_panelWaterfall->m_newdata = true;
-        m_panelWaterfall->Refresh();
-    }
-
-    m_panelSpectrum->setRxFreq(FDMDV_FCENTRE - g_RxFreqOffsetHz);
-    m_panelSpectrum->m_newdata = true;
-    m_panelSpectrum->Refresh();
-
-    /* update scatter plot -----------------------------------------------------------------*/
-
-    for (r=0; r<g_stats.nr; r++) {
-        
-        if (g_pfreedv->mode == FREEDV_MODE_1600) {
-            m_panelScatter->add_new_samples(&g_stats.rx_symbols[r][0]);
-        }
-
-        if ((g_pfreedv->mode == FREEDV_MODE_700) || (g_pfreedv->mode == FREEDV_MODE_700B)) {
-
-            /* 
-               FreeDV 700 uses diversity, so combine symbols for
-               scatter plot, as combined symbols are used for
-               demodulation.  Note we need to use a copy of the
-               symbols, as we are not sure when the stats will be
-               updated.
-            */
-
-            COMP rx_symbols_copy[g_Nc/2];
-
-            for(c=0; c<g_Nc/2; c++)
-                rx_symbols_copy[c] = cadd(g_stats.rx_symbols[r][c], g_stats.rx_symbols[r][c+g_Nc/2]);
-            m_panelScatter->add_new_samples(rx_symbols_copy);
-        }
-       
-    }
-
-    m_panelScatter->Refresh();
-
-    // Oscilliscope type speech plots -------------------------------------------------------
-
-    short speechInPlotSamples[WAVEFORM_PLOT_BUF];
-    if (fifo_read(g_plotSpeechInFifo, speechInPlotSamples, WAVEFORM_PLOT_BUF)) {
-        memset(speechInPlotSamples, 0, WAVEFORM_PLOT_BUF*sizeof(short));
-        //fprintf(stderr, "empty!\n");
-    }
-    m_panelSpeechIn->add_new_short_samples(0, speechInPlotSamples, WAVEFORM_PLOT_BUF, 32767);
-    m_panelSpeechIn->Refresh();
-
-    short speechOutPlotSamples[WAVEFORM_PLOT_BUF];
-    if (fifo_read(g_plotSpeechOutFifo, speechOutPlotSamples, WAVEFORM_PLOT_BUF))
-        memset(speechOutPlotSamples, 0, WAVEFORM_PLOT_BUF*sizeof(short));
-    m_panelSpeechOut->add_new_short_samples(0, speechOutPlotSamples, WAVEFORM_PLOT_BUF, 32767);
-    m_panelSpeechOut->Refresh();
-
-    short demodInPlotSamples[WAVEFORM_PLOT_BUF];
-    if (fifo_read(g_plotDemodInFifo, demodInPlotSamples, WAVEFORM_PLOT_BUF)) {
-        memset(demodInPlotSamples, 0, WAVEFORM_PLOT_BUF*sizeof(short));
-    }
-    m_panelDemodIn->add_new_short_samples(0,demodInPlotSamples, WAVEFORM_PLOT_BUF, 32767);
-    m_panelDemodIn->Refresh();
-
-    // Demod states -----------------------------------------------------------------------
-
-    m_panelTimeOffset->add_new_sample(0, (float)g_stats.rx_timing/FDMDV_NOM_SAMPLES_PER_FRAME);
-    m_panelTimeOffset->Refresh();
-
-    m_panelFreqOffset->add_new_sample(0, g_stats.foff);
-    m_panelFreqOffset->Refresh();
-
-    // SNR text box and gauge ------------------------------------------------------------
-
-    // LP filter g_stats.snr_est some more to stabilise the
-    // display. g_stats.snr_est already has some low pass filtering
-    // but we need it fairly fast to activate squelch.  So we
-    // optionally perform some further filtering for the display
-    // version of SNR.  The "Slow" checkbox controls the amount of
-    // filtering.  The filtered snr also controls the squelch
-
-    g_snr = m_snrBeta*g_snr + (1.0 - m_snrBeta)*g_stats.snr_est;
-    float snr_limited = g_snr;
-    if (snr_limited < -5.0) snr_limited = -5.0;
-    if (snr_limited > 20.0) snr_limited = 20.0;
-
-    char snr[15];
-    sprintf(snr, "%d", (int)(g_snr+0.5)); // round to nearest dB
-
-    //printf("snr_est: %f m_snrBeta: %f g_snr: %f snr_limited: %f\n", g_stats.snr_est,  m_snrBeta, g_snr, snr_limited);
-
-    wxString snr_string(snr);
-    m_textSNR->SetLabel(snr_string);
-    m_gaugeSNR->SetValue((int)(snr_limited+5));
-
-    // Level Gauge -----------------------------------------------------------------------
-
-    float tooHighThresh;
-    if (!g_tx && m_RxRunning)
-    {
-        // receive mode - display From Radio peaks
-        // peak from this DT sampling period
-        int maxDemodIn = 0;
-        for(int i=0; i<WAVEFORM_PLOT_BUF; i++)
-            if (maxDemodIn < abs(demodInPlotSamples[i]))
-                maxDemodIn = abs(demodInPlotSamples[i]);
-
-        // peak from last second
-        if (maxDemodIn > m_maxLevel)
-            m_maxLevel = maxDemodIn;
-
-        tooHighThresh = FROM_RADIO_MAX;
-    }
-    else
-    {
-        // transmit mode - display From Mic peaks
-
-        // peak from this DT sampling period
-        int maxSpeechIn = 0;
-        for(int i=0; i<WAVEFORM_PLOT_BUF; i++)
-            if (maxSpeechIn < abs(speechInPlotSamples[i]))
-                maxSpeechIn = abs(speechInPlotSamples[i]);
-
-        // peak from last second
-        if (maxSpeechIn > m_maxLevel)
-            m_maxLevel = maxSpeechIn;
-
-       tooHighThresh = FROM_MIC_MAX;
-    }
-
-    // Peak Reading meter: updates peaks immediately, then slowly decays
-    int maxScaled = (int)(100.0 * ((float)m_maxLevel/32767.0));
-    m_gaugeLevel->SetValue(maxScaled);
-    //printf("maxScaled: %d\n", maxScaled);
-    if (((float)maxScaled/100) > tooHighThresh)
-        m_textLevel->SetLabel("Too High");
-    else
-        m_textLevel->SetLabel("");
-
-    m_maxLevel *= LEVEL_BETA;
-
-    // sync LED (Colours don't work on Windows) ------------------------
-
-    if (g_State) {
-        m_rbSync->SetForegroundColour( wxColour( 0, 255, 0 ) ); // green
-        m_rbSync->SetValue(true);
-    }
-    else {
-        m_rbSync->SetForegroundColour( wxColour( 255, 0, 0 ) ); // red
-        m_rbSync->SetValue(false);
-    }
-
-    // send Callsign ----------------------------------------------------
-
-    char callsign[MAX_CALLSIGN];
-    strncpy(callsign, (const char*) wxGetApp().m_callSign.mb_str(wxConvUTF8), MAX_CALLSIGN-1);
-
-    // buffer 1 txt message to ensure tx data fifo doesn't "run dry"
-
-    if ((unsigned)fifo_used(g_txDataInFifo) < strlen(callsign)) {
-        unsigned int  i;
-
-        //fprintf(g_logfile, "tx callsign: %s.\n", callsign);
-
-        /* optionally append checksum */
-
-        if (wxGetApp().m_enable_checksum) {
-
-            unsigned char checksum = 0;
-            char callsign_checksum_cr[MAX_CALLSIGN+1];
-
-            for(i=0; i<strlen(callsign); i++)
-                checksum += callsign[i];
-            sprintf(callsign_checksum_cr, "%s%2x", callsign, checksum);
-            callsign_checksum_cr[strlen(callsign)+2] = 13;
-            callsign_checksum_cr[strlen(callsign)+3] = 0;
-            strcpy(callsign, callsign_checksum_cr);
-        }
-        else {
-            callsign[strlen(callsign)] = 13;
-            callsign[strlen(callsign)+1] = 0;
-        }
-
-        //fprintf(g_logfile, "tx callsign: %s.\n", callsign);
-
-        // write chars to tx data fifo
-
-        for(i=0; i<strlen(callsign); i++) {
-            short ashort = (short)callsign[i];
-            fifo_write(g_txDataInFifo, &ashort, 1);
-        }
-    }
-
-    // See if any Callsign info received --------------------------------
-
-    short ashort;
-    while (fifo_read(g_rxDataOutFifo, &ashort, 1) == 0) {
-
-        if ((ashort == 13) || ((m_pcallsign - m_callsign) > MAX_CALLSIGN-1)) {
-            // CR completes line
-            *m_pcallsign = 0;
-            
-            /* Checksums can be disabled, e.g. for compatability with
-               older vesions.  In that case we print msg but don't do
-               any event processing.  If checksums enabled, only print
-               out when checksum is good. */
-
-            if (wxGetApp().m_enable_checksum) {
-                // lets see if checksum is OK
-            
-                unsigned char checksum_rx = 0;
-                if (strlen(m_callsign) > 2) {
-                    for(unsigned int i=0; i<strlen(m_callsign)-2; i++)
-                        checksum_rx += m_callsign[i];
-                }
-                unsigned int checksum_tx;
-                int ret = sscanf(&m_callsign[strlen(m_callsign)-2], "%2x", &checksum_tx);
-                //fprintf(g_logfile, "rx callsign: %s.\n  checksum tx: %02x checksum rx: %02x\n", m_callsign, checksum_tx, checksum_rx);
-
-                wxString s;
-                if (ret && (checksum_tx == checksum_rx)) {
-                    m_callsign[strlen(m_callsign)-2] = 0;
-                    s.Printf("%s", m_callsign);
-                    m_txtCtrlCallSign->SetValue(s);
-
-                    char s1[MAX_CALLSIGN];
-                    sprintf(s1,"rx_txtmsg %s", m_callsign);
-                    processTxtEvent(s1);
-
-                    m_checksumGood++;
-                    s.Printf("%d", m_checksumGood);
-                    m_txtChecksumGood->SetLabel(s);              
-                }
-                else {
-                    m_checksumBad++;
-                    s.Printf("%d", m_checksumBad);
-                    m_txtChecksumBad->SetLabel(s);        
-                }
-            }
-
-            //fprintf(g_logfile,"resetting callsign %s %ld\n", m_callsign, m_pcallsign-m_callsign);
-            // reset ptr to start of string
-            m_pcallsign = m_callsign;
-        }
-        else {
-            //fprintf(g_logfile, "new char %d %c\n", ashort, (char)ashort);
-            *m_pcallsign++ = (char)ashort;
-        }
-
-        /* If checksums disabled, display txt chars as they arrive */
-
-        if (!wxGetApp().m_enable_checksum) {
-            m_txtCtrlCallSign->SetValue(m_callsign);
-        }
-    }
-
-    // Run time update of EQ filters -----------------------------------
-    if (m_newMicInFilter || m_newSpkOutFilter) {
-        g_mutexProtectingCallbackData.Lock();
-        deleteEQFilters(g_rxUserdata);
-        designEQFilters(g_rxUserdata);
-        g_mutexProtectingCallbackData.Unlock();
-        m_newMicInFilter = m_newSpkOutFilter = false;
-    }
-    g_rxUserdata->micInEQEnable = wxGetApp().m_MicInEQEnable;
-    g_rxUserdata->spkOutEQEnable = wxGetApp().m_SpkOutEQEnable;
-
-    // Run time update of FreeDV 700 tx clipper
-
-    g_pfreedv->clip = (int)wxGetApp().m_FreeDV700txClip;
-
-    // Test Frame Bit Error Updates ------------------------------------
-
-    // Toggle test frame mode at run time
-
-    if (!g_pfreedv->test_frames && wxGetApp().m_testFrames) {
-
-        // reset stats on check box off to on transition
-
-        g_pfreedv->test_frames = 1;
-        g_pfreedv->test_frame_sync_state = 0;
-        g_pfreedv->total_bits = 0;
-        g_pfreedv->total_bit_errors = 0;
-    }
-    g_pfreedv->test_frames =  wxGetApp().m_testFrames;
-    g_channel_noise =  wxGetApp().m_channel_noise;
-
-    if (g_State) {
-        char bits[80], errors[80], ber[80];
-
-        // update stats on main page
-
-        sprintf(bits, "Bits: %d", (int)g_pfreedv->total_bits); wxString bits_string(bits); m_textBits->SetLabel(bits_string);
-        sprintf(errors, "Errs: %d", (int)g_pfreedv->total_bit_errors); wxString errors_string(errors); m_textErrors->SetLabel(errors_string);
-        float b = (float)g_pfreedv->total_bit_errors/(1E-6+g_pfreedv->total_bits);
-        sprintf(ber, "BER: %4.3f", b); wxString ber_string(ber); m_textBER->SetLabel(ber_string);
-
-        // update error plots
-
-        int sz_error_pattern = g_pfreedv->sz_error_pattern;
-        short error_pattern[sz_error_pattern];
-
-        if (fifo_read(g_error_pattern_fifo, error_pattern, sz_error_pattern) == 0) {
-            int i,b;
-
-            /* both modes map IQ to alternate bits, but one same carrier */
-
-            if (g_pfreedv->mode == FREEDV_MODE_1600) {
-                /* FreeDV 1600 mapping from error pattern to bit on each carrier */
-
-                for(b=0; b<g_Nc*2; b++) {
-                    for(i=b; i<sz_error_pattern; i+= 2*g_Nc) {
-                        m_panelTestFrameErrors->add_new_sample(b, b + 0.8*error_pattern[i]);
-                        g_error_hist[b] += error_pattern[i];
-                    }
-                    //if (b%2)
-                    //    printf("g_error_hist[%d]: %d\n", b/2, g_error_hist[b/2]);
-                }
-
-                int max_hist = 0;
-                for(b=0; b<g_Nc; b++)
-                    if (g_error_hist[b] > max_hist)
-                        max_hist = g_error_hist[b];
-
-                m_panelTestFrameErrorsHist->add_new_short_samples(0, g_error_hist, 2*FDMDV_NC_MAX, max_hist);
-            }
-       
-            if ((g_pfreedv->mode == FREEDV_MODE_700) || (g_pfreedv->mode == FREEDV_MODE_700B)) {
-                int c;
-
-                /* FreeDV 700 mapping from error pattern to bit on each
-                   carrier.  Note we don't have access to carriers before
-                   diversity re-combination, so this won't give us the full
-                   picture, we have to assume Nc/2 carriers. */
-
-                for(i=0; i<sz_error_pattern; i++) {
-                    c = i/4;
-                    m_panelTestFrameErrors->add_new_sample(c, c + 0.8*error_pattern[i]);
-                    g_error_hist[c] += error_pattern[i];
-                    //printf("i: %d c: %d\n", i, c);
-                }
-
-                int max_hist = 0;
-                for(b=0; b<g_Nc; b++)
-                    if (g_error_hist[b] > max_hist)
-                        max_hist = g_error_hist[b];
-                m_panelTestFrameErrorsHist->add_new_short_samples(0, g_error_hist, 2*FDMDV_NC_MAX, max_hist);                
-            }
-            m_panelTestFrameErrors->Refresh();       
-            m_panelTestFrameErrorsHist->Refresh();
-        }
-    }
-
-    // command from UDP thread that is best processed in main thread to avoid seg faults
-
-    if (m_schedule_restore) {
-        if (IsIconized())
-            Restore();
-        m_schedule_restore = false;
-    }
-
-    // Light Spam Timer LED if at least one timer is running
-
-    int i;
-    optionsDlg->SetSpamTimerLight(false);
-    for(i=0; i<MAX_EVENT_RULES; i++)
-        if (spamTimer[i].IsRunning())
-            optionsDlg->SetSpamTimerLight(true);        
-
-    // Blink file playback status line
-
-    if (g_playFileFromRadio) {
-        g_blink += DT;
-        //fprintf(g_logfile, "g_blink: %f\n", g_blink);
-        if ((g_blink >= 1.0) && (g_blink < 2.0))
-            SetStatusText(wxT("Playing into from radio"), 0);
-        if (g_blink >= 2.0) {
-            SetStatusText(wxT(""), 0);
-            g_blink = 0.0;
-        }
-    }
-
-}
-#endif
-
-
-//-------------------------------------------------------------------------
-// OnCloseFrame()
-//-------------------------------------------------------------------------
-void MainFrame::OnCloseFrame(wxCloseEvent& event)
-{
-    Pa_Terminate();
-    Destroy();
-}
-
-//-------------------------------------------------------------------------
-// OnTop()
-//-------------------------------------------------------------------------
-void MainFrame::OnTop(wxCommandEvent& event)
-{
-    int style = GetWindowStyle();
-
-    if (style & wxSTAY_ON_TOP)
-    {
-        style &= ~wxSTAY_ON_TOP;
-    }
-    else
-    {
-        style |= wxSTAY_ON_TOP;
-    }
-    SetWindowStyle(style);
-}
-
-//-------------------------------------------------------------------------
-// OnDeleteConfig()
-//-------------------------------------------------------------------------
-void MainFrame::OnDeleteConfig(wxCommandEvent&)
-{
-    wxConfigBase *pConfig = wxConfigBase::Get();
-    if(pConfig->DeleteAll())
-    {
-        wxLogMessage(wxT("Config file/registry key successfully deleted."));
-
-        delete wxConfigBase::Set(NULL);
-        wxConfigBase::DontCreateOnDemand();
-    }
-    else
-    {
-        wxLogError(wxT("Deleting config file/registry key failed."));
-    }
-}
-
-//-------------------------------------------------------------------------
-// Paint()
-//-------------------------------------------------------------------------
-void MainFrame::OnPaint(wxPaintEvent& WXUNUSED(event))
-{
-    wxPaintDC dc(this);
-
-    if(GetMenuBar()->IsChecked(ID_PAINT_BG))
-    {
-        dc.Clear();
-    }
-    dc.SetUserScale(m_zoom, m_zoom);
-}
-
-//-------------------------------------------------------------------------
-// OnCmdSliderScroll()
-//-------------------------------------------------------------------------
-void MainFrame::OnCmdSliderScroll(wxScrollEvent& event)
-{
-    char sqsnr[15];
-    g_SquelchLevel = (float)m_sliderSQ->GetValue()/2.0 - 5.0;   
-    sprintf(sqsnr, "%4.1f", g_SquelchLevel); // 0.5 dB steps
-    wxString sqsnr_string(sqsnr);
-    m_textSQ->SetLabel(sqsnr_string);
-
-    event.Skip();
-}
-
-//-------------------------------------------------------------------------
-// OnCheckSQClick()
-//-------------------------------------------------------------------------
-void MainFrame::OnCheckSQClick(wxCommandEvent& event)
-{
-    if(!g_SquelchActive)
-    {
-        g_SquelchActive = true;
-    }
-    else
-    {
-        g_SquelchActive = false;
-    }
-}
-
-void MainFrame::setsnrBeta(bool snrSlow)
-{
-    if(snrSlow)
-    {
-        m_snrBeta = 0.95; // make this closer to 1.0 to smooth SNR est further
-    }
-    else
-    {
-        m_snrBeta = 0.0; // no smoothing of SNR estimate from demodulator
-    }
-}
-
-//-------------------------------------------------------------------------
-// OnCheckSQClick()
-//-------------------------------------------------------------------------
-void MainFrame::OnCheckSNRClick(wxCommandEvent& event)
-{
-    wxGetApp().m_snrSlow = m_ckboxSNR->GetValue();
-    setsnrBeta(wxGetApp().m_snrSlow);
-    //printf("m_snrSlow: %d\n", (int)wxGetApp().m_snrSlow);
-}
-
-// check for space bar press (only when running)
-
-int MainApp::FilterEvent(wxEvent& event)
-{
-    if ((event.GetEventType() == wxEVT_KEY_DOWN) && 
-        (((wxKeyEvent&)event).GetKeyCode() == WXK_SPACE))
-        {
-            // only use space to toggle PTT if we are running and no modal dialogs (like options) up
-            //fprintf(stderr,"frame->m_RxRunning: %d g_modal: %d\n",
-            //        frame->m_RxRunning, g_modal);
-            if (frame->m_RxRunning && !g_modal) {
-                if (frame->m_btnTogPTT->GetValue())
-                    frame->m_btnTogPTT->SetValue(false);
-                else
-                    frame->m_btnTogPTT->SetValue(true);
-
-                frame->togglePTT();
-
-                return true; // absorb space so we don't toggle control with focus (e.g. Start)
-
-            }
-        }
-
-    return -1;
-}
-
-//-------------------------------------------------------------------------
-// OnTogBtnPTT ()
-//-------------------------------------------------------------------------
-void MainFrame::OnTogBtnPTT (wxCommandEvent& event)
-{
-    togglePTT();
-    event.Skip();
-}
-
-void MainFrame::togglePTT(void) {
-
-    // Change tabbed page in centre panel depending on PTT state
-
-    if (g_tx)
-    {
-        // tx-> rx transition, swap to the page we were on for last rx
-        m_auiNbookCtrl->ChangeSelection(wxGetApp().m_rxNbookCtrl);
-    }
-    else
-    {
-        // rx-> tx transition, swap to Mic In page to monitor speech
-        wxGetApp().m_rxNbookCtrl = m_auiNbookCtrl->GetSelection();
-        m_auiNbookCtrl->ChangeSelection(m_auiNbookCtrl->GetPageIndex((wxWindow *)m_panelSpeechIn));
-        char e[80]; sprintf(e,"ptt"); processTxtEvent(e);
-    }
-
-    g_tx = m_btnTogPTT->GetValue();
-
-    // Hamlib PTT
-
-    if (wxGetApp().m_boolHamlibUseForPTT) {        
-        Hamlib *hamlib = wxGetApp().m_hamlib; 
-        if (wxGetApp().m_boolHamlibUseForPTT && hamlib != NULL) {
-            hamlib->ptt(g_tx);
-        }
-    }
-
-    // Serial PTT
-
-    /*  Truth table:
-
-          g_tx   RTSPos   RTS
-          -------------------
-          0      1        0
-          1      1        1
-          0      0        1
-          1      0        0
-
-          exclusive NOR
-    */
-
-    if(wxGetApp().m_boolUseSerialPTT && (com_handle != COM_HANDLE_INVALID)) {
-        if (wxGetApp().m_boolUseRTS) {
-            printf("g_tx: %d m_boolRTSPos: %d serialLine: %d\n", g_tx, wxGetApp().m_boolRTSPos, g_tx == wxGetApp().m_boolRTSPos);
-            if (g_tx == wxGetApp().m_boolRTSPos)
-                raiseRTS();
-            else
-                lowerRTS();
-        }
-        if (wxGetApp().m_boolUseDTR) {
-            printf("g_tx: %d m_boolDTRPos: %d serialLine: %d\n", g_tx, wxGetApp().m_boolDTRPos, g_tx == wxGetApp().m_boolDTRPos);
-            if (g_tx == wxGetApp().m_boolDTRPos)
-                raiseDTR();
-            else
-                lowerDTR();
-        }
-    }
-
-    // reset level gauge
-
-    m_maxLevel = 0;
-    m_textLevel->SetLabel(wxT(""));
-    m_gaugeLevel->SetValue(0);
-}
-
-//-------------------------------------------------------------------------
-// OnTogBtnRxID()
-//-------------------------------------------------------------------------
-void MainFrame::OnTogBtnRxID(wxCommandEvent& event)
-{
-    // empty any junk in rx data FIFO
-    short junk;
-    while(fifo_read(g_rxDataOutFifo,&junk,1) == 0);
-    event.Skip();
-}
-
-//-------------------------------------------------------------------------
-// OnTogBtnTxID()
-//-------------------------------------------------------------------------
-void MainFrame::OnTogBtnTxID(wxCommandEvent& event)
-{
-    event.Skip();
-}
-
-void MainFrame::OnTogBtnSplitClick(wxCommandEvent& event) {
-    if (g_split)
-        g_split = 0;
-    else
-        g_split = 1;
-    event.Skip();
-}
-
-//-------------------------------------------------------------------------
-// OnTogBtnAnalogClick()
-//-------------------------------------------------------------------------
-void MainFrame::OnTogBtnAnalogClick (wxCommandEvent& event)
-{
-    if (g_analog == 0) {
-        g_analog = 1;
-        m_panelSpectrum->setFreqScale(MODEM_STATS_NSPEC*((float)MAX_F_HZ/(FS/2)));
-        m_panelWaterfall->setFs(FS);
-    }
-    else {
-        g_analog = 0;
-        m_panelSpectrum->setFreqScale(MODEM_STATS_NSPEC*((float)MAX_F_HZ/(g_pfreedv->modem_sample_rate/2)));
-        m_panelWaterfall->setFs(g_pfreedv->modem_sample_rate);
-    }
-
-    g_State = 0;
-    g_stats.snr_est = 0;
-
-    event.Skip();
-}
-
-void MainFrame::OnCallSignReset(wxCommandEvent& event)
-{
-    m_pcallsign = m_callsign;
-    memset(m_callsign, 0, MAX_CALLSIGN);
-    wxString s;
-    s.Printf("%s", m_callsign);
-    m_txtCtrlCallSign->SetValue(s);
-    m_checksumGood = m_checksumBad = 0;
-    m_txtChecksumGood->SetLabel(_("0"));
-    m_txtChecksumBad->SetLabel(_("0"));
-}
-
-void MainFrame::OnBerReset(wxCommandEvent& event)
-{
-    g_pfreedv->total_bits = 0;
-    g_pfreedv->total_bit_errors = 0;
-    int i;
-    for(i=0; i<2*g_Nc; i++)
-        g_error_hist[i] = 0;
-    
-}
-
-#ifdef ALC
-//-------------------------------------------------------------------------
-// OnTogBtnALCClick()
-//-------------------------------------------------------------------------
-void MainFrame::OnTogBtnALCClick(wxCommandEvent& event)
-{
-    wxMessageBox(wxT("Got Click!"), wxT("OnTogBtnALCClick"), wxOK);
-
-    event.Skip();
-}
-#endif
-
-// extra panel added to file open dialog to add loop checkbox
-MyExtraPlayFilePanel::MyExtraPlayFilePanel(wxWindow *parent): wxPanel(parent)
-{
-    m_cb = new wxCheckBox(this, -1, wxT("Loop"));
-    m_cb->SetToolTip(_("When checked file will repeat forever"));
-    m_cb->SetValue(g_loopPlayFileToMicIn);
-
-    // bug: I can't this to align right.....
-    wxBoxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
-    sizerTop->Add(m_cb, 0, wxALIGN_RIGHT, 0);
-    SetSizerAndFit(sizerTop);
-}
-
-static wxWindow* createMyExtraPlayFilePanel(wxWindow *parent)
-{
-    return new MyExtraPlayFilePanel(parent);
-}
-
-//-------------------------------------------------------------------------
-// OnPlayFileToMicIn()
-//-------------------------------------------------------------------------
-void MainFrame::OnPlayFileToMicIn(wxCommandEvent& event)
-{
-    wxUnusedVar(event);
-
-    if(g_playFileToMicIn)
-    {
-        g_mutexProtectingCallbackData.Lock();
-        g_playFileToMicIn = false;
-        sf_close(g_sfPlayFile);
-        SetStatusText(wxT(""));
-        g_mutexProtectingCallbackData.Unlock();
-    }
-    else
-    {
-        wxString    soundFile;
-        SF_INFO     sfInfo;
-
-        wxFileDialog openFileDialog(
-                                    this,
-                                    wxT("Play File to Mic In"),
-                                    wxGetApp().m_playFileToMicInPath,
-                                    wxEmptyString,
-                                    wxT("WAV and RAW files (*.wav;*.raw)|*.wav;*.raw|")
-                                    wxT("All files (*.*)|*.*"),
-                                    wxFD_OPEN | wxFD_FILE_MUST_EXIST
-                                    );
-
-        // add the loop check box
-        openFileDialog.SetExtraControlCreator(&createMyExtraPlayFilePanel);
-
-        if(openFileDialog.ShowModal() == wxID_CANCEL)
-        {
-            return;     // the user changed their mind...
-        }
-
-        wxString fileName, extension;
-        soundFile = openFileDialog.GetPath();
-        wxFileName::SplitPath(soundFile, &wxGetApp().m_playFileToMicInPath, &fileName, &extension);
-        //wxLogDebug("m_playFileToMicInPath: %s", wxGetApp().m_playFileToMicInPath);
-        sfInfo.format = 0;
-
-        if(!extension.IsEmpty())
-        {
-            extension.LowerCase();
-            if(extension == wxT("raw"))
-            {
-                sfInfo.format     = SF_FORMAT_RAW | SF_FORMAT_PCM_16;
-                sfInfo.channels   = 1;
-                sfInfo.samplerate = FS;
-            }
-        }
-        g_sfPlayFile = sf_open(soundFile, SFM_READ, &sfInfo);
-        if(g_sfPlayFile == NULL)
-        {
-            wxString strErr = sf_strerror(NULL);
-            wxMessageBox(strErr, wxT("Couldn't open sound file"), wxOK);
-            return;
-        }
-
-        wxWindow * const ctrl = openFileDialog.GetExtraControl();
-
-        // Huh?! I just copied wxWidgets-2.9.4/samples/dialogs ....
-        g_loopPlayFileToMicIn = static_cast<MyExtraPlayFilePanel*>(ctrl)->getLoopPlayFileToMicIn();
-
-        SetStatusText(wxT("Playing File: ") + fileName + wxT(" to Mic Input") , 0);
-        g_playFileToMicIn = true;
-    }
-}
-
-//-------------------------------------------------------------------------
-// OnPlayFileFromRadio()
-// This puppy "plays" a recorded file into the demodulator input, allowing us
-// to replay off air signals.
-//-------------------------------------------------------------------------
-void MainFrame::OnPlayFileFromRadio(wxCommandEvent& event)
-{
-    wxUnusedVar(event);
-
-    printf("OnPlayFileFromRadio:: %d\n", (int)g_playFileFromRadio);
-    if (g_playFileFromRadio)
-    {
-        printf("OnPlayFileFromRadio:: Stop\n");
-        g_mutexProtectingCallbackData.Lock();
-        g_playFileFromRadio = false;
-        sf_close(g_sfPlayFileFromRadio);
-        SetStatusText(wxT(""),0);
-        SetStatusText(wxT(""),1);
-        g_mutexProtectingCallbackData.Unlock();
-    }
-    else
-    {
-        wxString    soundFile;
-        SF_INFO     sfInfo;
-
-        wxFileDialog openFileDialog(
-                                    this,
-                                    wxT("Play File - From Radio"),
-                                    wxGetApp().m_playFileFromRadioPath,
-                                    wxEmptyString,
-                                    wxT("WAV and RAW files (*.wav;*.raw)|*.wav;*.raw|")
-                                    wxT("All files (*.*)|*.*"),
-                                    wxFD_OPEN | wxFD_FILE_MUST_EXIST
-                                    );
-
-        // add the loop check box
-        openFileDialog.SetExtraControlCreator(&createMyExtraPlayFilePanel);
-
-        if(openFileDialog.ShowModal() == wxID_CANCEL)
-        {
-            return;     // the user changed their mind...
-        }
-
-        wxString fileName, extension;
-        soundFile = openFileDialog.GetPath();
-        wxFileName::SplitPath(soundFile, &wxGetApp().m_playFileFromRadioPath, &fileName, &extension);
-        //wxLogDebug("m_playFileToFromRadioPath: %s", wxGetApp().m_playFileFromRadioPath);
-        sfInfo.format = 0;
-
-        if(!extension.IsEmpty())
-        {
-            extension.LowerCase();
-            if(extension == wxT("raw"))
-            {
-                sfInfo.format     = SF_FORMAT_RAW | SF_FORMAT_PCM_16;
-                sfInfo.channels   = 1;
-                sfInfo.samplerate = g_pfreedv->modem_sample_rate;
-            }
-        }
-        g_sfPlayFileFromRadio = sf_open(soundFile, SFM_READ, &sfInfo);
-        g_sfFs = sfInfo.samplerate;
-        if(g_sfPlayFileFromRadio == NULL)
-        {
-            wxString strErr = sf_strerror(NULL);
-            wxMessageBox(strErr, wxT("Couldn't open sound file"), wxOK);
-            return;
-        }
-
-        wxWindow * const ctrl = openFileDialog.GetExtraControl();
-
-        // Huh?! I just copied wxWidgets-2.9.4/samples/dialogs ....
-        g_loopPlayFileFromRadio = static_cast<MyExtraPlayFilePanel*>(ctrl)->getLoopPlayFileToMicIn();
-
-        SetStatusText(wxT("Playing into from radio"), 0);
-        if(extension == wxT("raw")) {
-            wxString stringnumber = wxString::Format(wxT("%d"), (int)sfInfo.samplerate);
-            SetStatusText(wxT("raw file assuming Fs=") + stringnumber, 1);          
-        }
-        fprintf(g_logfile, "OnPlayFileFromRadio:: Playing File\n");
-        g_playFileFromRadio = true;
-        g_blink = 0.0;
-    }
-}
-
-// extra panel added to file save dialog to set number of seconds to record for
-
-MyExtraRecFilePanel::MyExtraRecFilePanel(wxWindow *parent): wxPanel(parent)
-{
-    wxBoxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
-
-    wxStaticText* staticText = new wxStaticText(this, wxID_ANY, _("Seconds:"), wxDefaultPosition, wxDefaultSize, 0);
-    sizerTop->Add(staticText, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
-    m_secondsToRecord = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
-    m_secondsToRecord->SetToolTip(_("Number of seconds to record for"));
-    m_secondsToRecord->SetValue(wxString::Format(wxT("%i"), wxGetApp().m_recFileFromRadioSecs));
-    sizerTop->Add(m_secondsToRecord, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
-    SetSizerAndFit(sizerTop);
-}
-
-static wxWindow* createMyExtraRecFilePanel(wxWindow *parent)
-{
-    return new MyExtraRecFilePanel(parent);
-}
-
-//-------------------------------------------------------------------------
-// OnRecFileFromRadio()
-//-------------------------------------------------------------------------
-void MainFrame::OnRecFileFromRadio(wxCommandEvent& event)
-{
-    wxUnusedVar(event);
-
-    if (g_recFileFromRadio) {
-        printf("Stopping Record....\n");
-        g_mutexProtectingCallbackData.Lock();
-        g_recFileFromRadio = false;
-        sf_close(g_sfRecFile);
-        SetStatusText(wxT(""));
-        g_mutexProtectingCallbackData.Unlock();
-    }
-    else {
-
-        wxString    soundFile;
-        SF_INFO     sfInfo;
-
-         wxFileDialog openFileDialog(
-                                    this,
-                                    wxT("Record File From Radio"),
-                                    wxGetApp().m_recFileFromRadioPath,
-                                    wxEmptyString,
-                                    wxT("WAV and RAW files (*.wav;*.raw)|*.wav;*.raw|")
-                                    wxT("All files (*.*)|*.*"),
-                                    wxFD_SAVE
-                                    );
-
-        // add the loop check box
-        openFileDialog.SetExtraControlCreator(&createMyExtraRecFilePanel);
-
-        if(openFileDialog.ShowModal() == wxID_CANCEL)
-        {
-            return;     // the user changed their mind...
-        }
-
-        wxString fileName, extension;
-        soundFile = openFileDialog.GetPath();
-        wxFileName::SplitPath(soundFile, &wxGetApp().m_recFileFromRadioPath, &fileName, &extension);
-        wxLogDebug("m_recFileFromRadioPath: %s", wxGetApp().m_recFileFromRadioPath);
-        wxLogDebug("soundFile: %s", soundFile);
-        sfInfo.format = 0;
-
-        if(!extension.IsEmpty())
-        {
-            extension.LowerCase();
-            if(extension == wxT("raw"))
-            {
-                sfInfo.format     = SF_FORMAT_RAW | SF_FORMAT_PCM_16;
-                sfInfo.channels   = 1;
-                sfInfo.samplerate = g_pfreedv->modem_sample_rate;
-            }
-            else if(extension == wxT("wav"))
-            {
-                sfInfo.format     = SF_FORMAT_WAV | SF_FORMAT_PCM_16;
-                sfInfo.channels   = 1;
-                sfInfo.samplerate = g_pfreedv->modem_sample_rate;
-            } else {
-                wxMessageBox(wxT("Invalid file format"), wxT("Record File From Radio"), wxOK);
-                return;
-            }
-        }
-        else {
-            wxMessageBox(wxT("Invalid file format"), wxT("Record File From Radio"), wxOK);
-            return;
-        }
-
-        // Bug: on Win32 I cant read m_recFileFromRadioSecs, so have hard coded it
-#ifdef __WIN32__
-        long secs = wxGetApp().m_recFileFromRadioSecs;
-        g_recFromRadioSamples = FS*(unsigned int)secs;
-#else
-        // work out number of samples to record
-
-        wxWindow * const ctrl = openFileDialog.GetExtraControl();
-        wxString secsString = static_cast<MyExtraRecFilePanel*>(ctrl)->getSecondsToRecord();
-        wxLogDebug("test: %s secsString: %s\n", wxT("testing 123"), secsString);
-
-        long secs;
-        if (secsString.ToLong(&secs)) {
-            wxGetApp().m_recFileFromRadioSecs = (unsigned int)secs;
-            //printf(" secondsToRecord: %d\n",  (unsigned int)secs);
-            g_recFromRadioSamples = FS*(unsigned int)secs;
-            //printf("g_recFromRadioSamples: %d\n", g_recFromRadioSamples);
-        }
-        else {
-            wxMessageBox(wxT("Invalid number of Seconds"), wxT("Record File From Radio"), wxOK);
-            return;
-        }
-#endif
-
-        g_sfRecFile = sf_open(soundFile, SFM_WRITE, &sfInfo);
-        if(g_sfRecFile == NULL)
-        {
-            wxString strErr = sf_strerror(NULL);
-            wxMessageBox(strErr, wxT("Couldn't open sound file"), wxOK);
-            return;
-        }
-
-        SetStatusText(wxT("Recording File: ") + fileName + wxT(" From Radio") , 0);
-        g_recFileFromRadio = true;
-    }
-
-}
-
-//-------------------------------------------------------------------------
-// OnExit()
-//-------------------------------------------------------------------------
-void MainFrame::OnExit(wxCommandEvent& event)
-{
-    wxUnusedVar(event);
-#ifdef _USE_TIMER
-    m_plotTimer.Stop();
-#endif // _USE_TIMER
-    if(g_sfPlayFile != NULL)
-    {
-        sf_close(g_sfPlayFile);
-        g_sfPlayFile = NULL;
-    }
-    if(g_sfRecFile != NULL)
-    {
-        sf_close(g_sfRecFile);
-        g_sfRecFile = NULL;
-    }
-    if(m_RxRunning)
-    {
-        stopRxStream();
-    }
-    m_togBtnSplit->Disable();
-    //m_togRxID->Disable();
-    //m_togTxID->Disable();
-    m_togBtnAnalog->Disable();
-    //m_togBtnALC->Disable();
-    //m_btnTogPTT->Disable();
-    Pa_Terminate();
-    Destroy();
-}
-
-//-------------------------------------------------------------------------
-// OnExitClick()
-//-------------------------------------------------------------------------
-void MainFrame::OnExitClick(wxCommandEvent& event)
-{
-    OnExit(event);
-}
-
-//-------------------------------------------------------------------------
-// OnToolsAudio()
-//-------------------------------------------------------------------------
-void MainFrame::OnToolsAudio(wxCommandEvent& event)
-{
-    wxUnusedVar(event);
-    int rv = 0;
-    AudioOptsDialog *dlg = new AudioOptsDialog(NULL);
-    rv = dlg->ShowModal();
-    if(rv == wxID_OK)
-    {
-        dlg->ExchangeData(EXCHANGE_DATA_OUT);
-    }
-    delete dlg;
-}
-
-//-------------------------------------------------------------------------
-// OnToolsAudioUI()
-//-------------------------------------------------------------------------
-void MainFrame::OnToolsAudioUI(wxUpdateUIEvent& event)
-{
-    event.Enable(!m_RxRunning);
-}
-
-//-------------------------------------------------------------------------
-// OnToolsFilter()
-//-------------------------------------------------------------------------
-void MainFrame::OnToolsFilter(wxCommandEvent& event)
-{
-    wxUnusedVar(event);
-    FilterDlg *dlg = new FilterDlg(NULL, m_RxRunning, &m_newMicInFilter, &m_newSpkOutFilter);
-    dlg->ShowModal();
-    delete dlg;
-}
-
-//-------------------------------------------------------------------------
-// OnToolsOptions()
-//-------------------------------------------------------------------------
-void MainFrame::OnToolsOptions(wxCommandEvent& event)
-{
-    wxUnusedVar(event);
-    g_modal = true;
-    //fprintf(stderr,"g_modal: %d\n", g_modal);
-    optionsDlg->Show();
-}
-
-//-------------------------------------------------------------------------
-// OnToolsOptionsUI()
-//-------------------------------------------------------------------------
-void MainFrame::OnToolsOptionsUI(wxUpdateUIEvent& event)
-{
-}
-
-//-------------------------------------------------------------------------
-// OnToolsComCfg()
-//-------------------------------------------------------------------------
-void MainFrame::OnToolsComCfg(wxCommandEvent& event)
-{
-    wxUnusedVar(event);
-
-    ComPortsDlg *dlg = new ComPortsDlg(NULL);
-
-    int rv = dlg->ShowModal();
-
-    // test Hamlib/Serial set up
-
-    if(rv == wxID_OK)
-    {
-        if (wxGetApp().m_boolHamlibUseForPTT) {
-            OpenHamlibRig();
-            wxGetApp().m_hamlib->close();
-        }
-        if (wxGetApp().m_boolUseSerialPTT) {
-            SetupSerialPort();
-            CloseSerialPort();
-        }
-    }
-
-    delete dlg;
-}
-
-//-------------------------------------------------------------------------
-// OnToolsComCfgUI()
-//-------------------------------------------------------------------------
-void MainFrame::OnToolsComCfgUI(wxUpdateUIEvent& event)
-{
-    event.Enable(!m_RxRunning);
-}
-
-//-------------------------------------------------------------------------
-// OnHelpCheckUpdates()
-//-------------------------------------------------------------------------
-void MainFrame::OnHelpCheckUpdates(wxCommandEvent& event)
-{
-    wxMessageBox("Got Click!", "OnHelpCheckUpdates", wxOK);
-    event.Skip();
-}
-
-//-------------------------------------------------------------------------
-// OnHelpCheckUpdatesUI()
-//-------------------------------------------------------------------------
-void MainFrame::OnHelpCheckUpdatesUI(wxUpdateUIEvent& event)
-{
-    event.Enable(false);
-}
-
-//-------------------------------------------------------------------------
-//OnHelpAbout()
-//-------------------------------------------------------------------------
-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
-    wxURL url(wxT("http://svn.code.sf.net/p/freetel/code/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("<h2>p/freetel/code - Revision ");
-            int startIndex = htmldata.find(s) + s.Length();
-            int endIndex = htmldata.find(wxT(": /fdmdv2</h2>"));
-            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("How much have you spent on Ham gear this year?  How did it compare to FreeDV? ")
-                wxT("FreeDV repesents an open and free future for digital voice over Ham Radio. ")
-                wxT("Please help by donating just $10 here: 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);
-
-#endif // _USE_ABOUT_DIALOG
-#ifdef USE_SIMPLE_ABOUT_DIALOG
-    wxUnusedVar(event);
-    wxAboutDialogInfo info;
-    info.SetCopyright(_("HAMLib Test"));
-    info.SetLicence(_("GPL v2 or later"));
-    info.SetDescription(_("Short description goes here"));
-    ::wxAboutBox(info);
-#endif // USE_SIMPLE_ABOUT_DIALOG
-
-}
-
-
-// Attempt to talk to rig using Hamlib
-
-bool MainFrame::OpenHamlibRig() {
-    if (wxGetApp().m_boolHamlibUseForPTT != true)
-       return false;
-    if (wxGetApp().m_intHamlibRig == 0)
-        return false;
-    if (wxGetApp().m_hamlib == NULL)
-        return false;
-
-    int rig = wxGetApp().m_intHamlibRig;
-    wxString port = wxGetApp().m_strHamlibSerialPort;
-    bool status = wxGetApp().m_hamlib->connect(rig, port.mb_str(wxConvUTF8));
-    if (status == false)
-        wxMessageBox("Couldn't connect to Radio with hamlib", wxT("About"), wxOK | wxICON_ERROR, this);
-    return status;
-} 
-
-//-------------------------------------------------------------------------
-// OnTogBtnOnOff()
-//-------------------------------------------------------------------------
-void MainFrame::OnTogBtnOnOff(wxCommandEvent& event)
-{
-    wxString startStop = m_togBtnOnOff->GetLabel();
-
-    // we are attempting to start
-
-    if (startStop.IsSameAs("Start"))
-    {
-        //
-        // Start Running -------------------------------------------------
-        //
-
-        // modify some button states when running
-
-        m_togBtnSplit->Enable();
-        m_togBtnAnalog->Enable();
-        m_togBtnOnOff->SetLabel(wxT("Stop"));
-        m_btnTogPTT->Enable();
-
-        m_rb1600->Disable();
-        m_rb700->Disable();
-        m_rb700b->Disable();
-
-        // determine what mode we are using
-
-        if (m_rb1600->GetValue()) {
-            g_mode = FREEDV_MODE_1600;
-            g_Nc = 16;
-            m_panelScatter->setNc(g_Nc);
-        }
-        if (m_rb700->GetValue()) {
-            g_mode = FREEDV_MODE_700;
-            g_Nc = 14;
-            m_panelScatter->setNc(g_Nc/2-1);  /* due to diversity, -1 due to no pilot like FreeDV 1600 */
-        }
-        if (m_rb700b->GetValue()) {
-            g_mode = FREEDV_MODE_700B;
-            g_Nc = 14;
-            m_panelScatter->setNc(g_Nc/2-1);  /* due to diversity, -1 due to no pilot like FreeDV 1600 */
-        }
-   
-        // init freedv states
-
-        g_pfreedv = freedv_open(g_mode);
-        g_pfreedv->callback_state = NULL;
-        g_pfreedv->freedv_get_next_tx_char = &my_get_next_tx_char;
-        g_pfreedv->freedv_put_next_rx_char = &my_put_next_rx_char;
-
-        g_pfreedv->error_pattern_callback_state = (void*)m_panelTestFrameErrors;
-        g_pfreedv->freedv_put_error_pattern = &my_freedv_put_error_pattern;
-        g_error_pattern_fifo = fifo_create(2*g_pfreedv->sz_error_pattern);
-        g_error_hist = new short[FDMDV_NC_MAX*2];
-        int i;
-        for(i=0; i<2*FDMDV_NC_MAX; i++)
-            g_error_hist[i] = 0;
-
-        //if (g_mode == FREEDV_MODE_700)
-        //    cohpsk_set_verbose(g_pfreedv->cohpsk, 1);
-
-        //cohpsk_set_verbose(g_pfreedv->cohpsk, 1);
-        assert(g_pfreedv != NULL);
-        modem_stats_open(&g_stats);
-
-        // Init Speex pre-processor states
-        // by inspecting Speex source it seems that only denoiser is on be default
-
-        g_speex_st = speex_preprocess_state_init(g_pfreedv->n_speech_samples, FS); 
-
-        // adjust spectrum and waterfall freq scaling base on mode
-
-        m_panelSpectrum->setFreqScale(MODEM_STATS_NSPEC*((float)MAX_F_HZ/(g_pfreedv->modem_sample_rate/2)));
-        m_panelWaterfall->setFs(g_pfreedv->modem_sample_rate);
-
-        // adjust scatter diagram for Number of FDM carriers
-
-        // init Codec 2 LPC Post Filter
-
-        codec2_set_lpc_post_filter(g_pfreedv->codec2,
-                                   wxGetApp().m_codec2LPCPostFilterEnable,
-                                   wxGetApp().m_codec2LPCPostFilterBassBoost,
-                                   wxGetApp().m_codec2LPCPostFilterBeta,
-                                   wxGetApp().m_codec2LPCPostFilterGamma);
-
-        g_State = 0;
-        g_snr = 0.0;
-        g_half_duplex = wxGetApp().m_boolHalfDuplex;
-
-        m_pcallsign = m_callsign;
-        memset(m_callsign, 0, sizeof(m_callsign));
-        m_checksumGood = m_checksumBad = 0;
-        wxString s;
-        s.Printf("%d", m_checksumGood);
-        m_txtChecksumGood->SetLabel(s);              
-        s.Printf("%d", m_checksumBad);
-        m_txtChecksumBad->SetLabel(s);        
-
-        m_maxLevel = 0;
-        m_textLevel->SetLabel(wxT(""));
-        m_gaugeLevel->SetValue(0);
-
-        // Init text msg decoding
-
-        varicode_set_code_num(&g_pfreedv->varicode_dec_states, wxGetApp().m_textEncoding);
-        //printf("m_textEncoding = %d\n", wxGetApp().m_textEncoding);
-        //printf("g_stats.snr: %f\n", g_stats.snr_est);
-
-        // attempt to start PTT ......
-        
-        if (wxGetApp().m_boolHamlibUseForPTT)
-            OpenHamlibRig();
-        if (wxGetApp().m_boolUseSerialPTT) {
-            SetupSerialPort();
-        }
-
-        // attempt to start sound cards and tx/rx processing
-
-        startRxStream();
-
-        if (m_RxRunning)
-        {
-#ifdef _USE_TIMER
-            m_plotTimer.Start(_REFRESH_TIMER_PERIOD, wxTIMER_CONTINUOUS);
-#endif // _USE_TIMER
-        }
-        char e[80]; sprintf(e,"start"); processTxtEvent(e);
-    }
-
-    // Stop was pressed or start up failed
-
-    if (startStop.IsSameAs("Stop") || !m_RxRunning ) {
-
-        //
-        // Stop Running -------------------------------------------------
-        //
-
-        optionsDlg->SetSpamTimerLight(false);
-
-#ifdef _USE_TIMER
-        m_plotTimer.Stop();
-#endif // _USE_TIMER
-
-        // ensure we are not transmitting and shut down audio processing
-
-        if (wxGetApp().m_boolHamlibUseForPTT) {
-            Hamlib *hamlib = wxGetApp().m_hamlib; 
-            if (wxGetApp().m_boolHamlibUseForPTT && hamlib != NULL) {
-                hamlib->ptt(false);
-                hamlib->close();
-            }
-        }
-
-        if (wxGetApp().m_boolUseSerialPTT)
-            CloseSerialPort();
-
-        m_btnTogPTT->SetValue(false);
-
-        stopRxStream();
-
-        // free up states
-
-        modem_stats_close(&g_stats);
-        delete g_error_hist;
-        fifo_destroy(g_error_pattern_fifo);
-        freedv_close(g_pfreedv);
-        speex_preprocess_state_destroy(g_speex_st);
-        m_newMicInFilter = m_newSpkOutFilter = true;
-
-        m_togBtnSplit->Disable();
-        //m_togRxID->Disable();
-        //m_togTxID->Disable();
-        m_togBtnAnalog->Disable();
-        m_btnTogPTT->Disable();
-        m_togBtnOnOff->SetLabel(wxT("Start"));
-        m_rb1600->Enable();
-        m_rb700->Enable();
-        m_rb700b->Enable();
-#ifdef DISABLED_FEATURE
-        m_rb1400old->Enable();
-        m_rb1600Wide->Enable();
-        m_rb1400->Enable();
-        m_rb2000->Enable();
-#endif
-        char e[80]; sprintf(e,"stop"); processTxtEvent(e);
-    }
-}
-
-//-------------------------------------------------------------------------
-// stopRxStream()
-//-------------------------------------------------------------------------
-void MainFrame::stopRxStream()
-{
-    if(m_RxRunning)
-    {
-        m_RxRunning = false;
-
-        fprintf(g_logfile, "waiting for thread to stop");
-        m_txRxThread->m_run = 0;
-        m_txRxThread->Wait();
-        fprintf(g_logfile, "thread stopped");
-
-        m_rxInPa->stop();
-        m_rxInPa->streamClose();
-        delete m_rxInPa;
-        if(m_rxOutPa != m_rxInPa) {
-                       m_rxOutPa->stop();
-                       m_rxOutPa->streamClose();
-                       delete m_rxOutPa;
-               }
-
-        if (g_nSoundCards == 2) {
-            m_txInPa->stop();
-            m_txInPa->streamClose();
-            delete m_txInPa;
-            if(m_txInPa != m_txOutPa) {
-                               m_txOutPa->stop();
-                               m_txOutPa->streamClose();
-                               delete m_txOutPa;
-                       }
-        }
-
-        destroy_fifos();
-        destroy_src();
-        deleteEQFilters(g_rxUserdata);
-        delete g_rxUserdata;
-    }
-}
-
-void MainFrame::destroy_fifos(void)
-{
-    fifo_destroy(g_rxUserdata->infifo1);
-    fifo_destroy(g_rxUserdata->outfifo1);
-    fifo_destroy(g_rxUserdata->infifo2);
-    fifo_destroy(g_rxUserdata->outfifo2);
-    fifo_destroy(g_rxUserdata->rxinfifo);
-    fifo_destroy(g_rxUserdata->rxoutfifo);
-}
-
-void MainFrame::destroy_src(void)
-{
-    src_delete(g_rxUserdata->insrc1);
-    src_delete(g_rxUserdata->outsrc1);
-    src_delete(g_rxUserdata->insrc2);
-    src_delete(g_rxUserdata->outsrc2);
-    src_delete(g_rxUserdata->insrcsf);
-}
-
-void  MainFrame::initPortAudioDevice(PortAudioWrap *pa, int inDevice, int outDevice,
-                                     int soundCard, int sampleRate, int inputChannels)
-{
-    // Note all of the wrapper functions below just set values in a
-    // portaudio struct so can't return any errors. So no need to trap
-    // any errors in this function.
-
-    // init input params
-
-    pa->setInputDevice(inDevice);
-    if(inDevice != paNoDevice) {
-        pa->setInputChannelCount(inputChannels);           // stereo input
-        pa->setInputSampleFormat(PA_SAMPLE_TYPE);
-        pa->setInputLatency(pa->getInputDefaultLowLatency());
-        pa->setInputHostApiStreamInfo(NULL);
-    }
-
-    pa->setOutputDevice(paNoDevice);
-    
-    // init output params
-    
-    pa->setOutputDevice(outDevice);
-    if(outDevice != paNoDevice) {
-        pa->setOutputChannelCount(2);                      // stereo output
-        pa->setOutputSampleFormat(PA_SAMPLE_TYPE);
-        pa->setOutputLatency(pa->getOutputDefaultLowLatency());
-        pa->setOutputHostApiStreamInfo(NULL);
-    }
-
-    // init params that affect input and output
-
-    /*
-      On Linux, setting this to wxGetApp().m_framesPerBuffer caused
-      intermittant break up on the audio from my IC7200 on Ubuntu 14.
-      After a day of bug hunting I found that 0, as recommended by the
-      PortAudio docunmentation, fixed the problem.
-    */
-
-    //pa->setFramesPerBuffer(wxGetApp().m_framesPerBuffer);
-    pa->setFramesPerBuffer(0);
-
-    pa->setSampleRate(sampleRate);
-    pa->setStreamFlags(paClipOff);
-}
-
-//-------------------------------------------------------------------------
-// startRxStream()
-//-------------------------------------------------------------------------
-void MainFrame::startRxStream()
-{
-    int   src_error;
-    const PaDeviceInfo *deviceInfo1 = NULL, *deviceInfo2 = NULL;
-    int   inputChannels1, inputChannels2;
-    bool  two_rx=false;
-    bool  two_tx=false;
-
-    if(!m_RxRunning) {
-        m_RxRunning = true;
-
-        if(Pa_Initialize())
-        {
-            wxMessageBox(wxT("Port Audio failed to initialize"), wxT("Pa_Initialize"), wxOK);
-        }
-
-        m_rxInPa = new PortAudioWrap();
-        if(g_soundCard1InDeviceNum != g_soundCard1OutDeviceNum)
-            two_rx=true;
-        if(g_soundCard2InDeviceNum != g_soundCard2OutDeviceNum)
-            two_tx=true;
-        
-        fprintf(g_logfile, "two_rx: %d two_tx: %d\n", two_rx, two_tx);
-        if(two_rx)
-            m_rxOutPa = new PortAudioWrap();
-        else
-            m_rxOutPa = m_rxInPa;
-
-        if (g_nSoundCards == 0) {
-            wxMessageBox(wxT("No Sound Cards configured, use Tools - Audio Config to configure"), wxT("Error"), wxOK);
-            delete m_rxInPa;
-            if(two_rx)
-                delete m_rxOutPa;
-            m_RxRunning = false;
-            return;
-        }
-
-        // Init Sound card 1 ----------------------------------------------
-        // sanity check on sound card device numbers
-
-        if ((m_rxInPa->getDeviceCount() <= g_soundCard1InDeviceNum) ||
-            (m_rxOutPa->getDeviceCount() <= g_soundCard1OutDeviceNum)) {
-            wxMessageBox(wxT("Sound Card 1 not present"), wxT("Error"), wxOK);
-            delete m_rxInPa;
-            if(two_rx)
-                               delete m_rxOutPa;
-            m_RxRunning = false;
-            return;
-        }
-
-        // work out how many input channels this device supports.
-
-        deviceInfo1 = Pa_GetDeviceInfo(g_soundCard1InDeviceNum);
-        if (deviceInfo1 == NULL) {
-            wxMessageBox(wxT("Couldn't get device info from Port Audio for Sound Card 1"), wxT("Error"), wxOK);
-            delete m_rxInPa;
-            if(two_rx)
-                               delete m_rxOutPa;
-            m_RxRunning = false;
-            return;
-        }
-        if (deviceInfo1->maxInputChannels == 1)
-            inputChannels1 = 1;
-        else
-            inputChannels1 = 2;
-
-        if(two_rx) {
-            initPortAudioDevice(m_rxInPa, g_soundCard1InDeviceNum, paNoDevice, 1,
-                            g_soundCard1SampleRate, inputChannels1);
-            initPortAudioDevice(m_rxOutPa, paNoDevice, g_soundCard1OutDeviceNum, 1,
-                            g_soundCard1SampleRate, inputChannels1);
-               }
-        else
-            initPortAudioDevice(m_rxInPa, g_soundCard1InDeviceNum, g_soundCard1OutDeviceNum, 1,
-                            g_soundCard1SampleRate, inputChannels1);
-
-        // Init Sound Card 2 ------------------------------------------------
-
-        if (g_nSoundCards == 2) {
-
-            m_txInPa = new PortAudioWrap();
-            if(two_tx)
-                m_txOutPa = new PortAudioWrap();
-            else
-                m_txOutPa = m_txInPa;
-
-            // sanity check on sound card device numbers
-
-            //printf("m_txInPa->getDeviceCount(): %d\n", m_txInPa->getDeviceCount());
-            //printf("g_soundCard2InDeviceNum: %d\n", g_soundCard2InDeviceNum);
-            //printf("g_soundCard2OutDeviceNum: %d\n", g_soundCard2OutDeviceNum);
-
-            if ((m_txInPa->getDeviceCount() <= g_soundCard2InDeviceNum) ||
-                (m_txOutPa->getDeviceCount() <= g_soundCard2OutDeviceNum)) {
-                wxMessageBox(wxT("Sound Card 2 not present"), wxT("Error"), wxOK);
-                delete m_rxInPa;
-                if(two_rx)
-                    delete m_rxOutPa;
-                delete m_txInPa;
-                if(two_tx)
-                    delete m_txOutPa;
-                m_RxRunning = false;
-                return;
-            }
-
-            deviceInfo2 = Pa_GetDeviceInfo(g_soundCard2InDeviceNum);
-            if (deviceInfo2 == NULL) {
-                wxMessageBox(wxT("Couldn't get device info from Port Audio for Sound Card 1"), wxT("Error"), wxOK);
-                delete m_rxInPa;
-                if(two_rx)
-                                       delete m_rxOutPa;
-                delete m_txInPa;
-                if(two_tx)
-                                       delete m_txOutPa;
-                m_RxRunning = false;
-                return;
-            }
-            if (deviceInfo2->maxInputChannels == 1)
-                inputChannels2 = 1;
-            else
-                inputChannels2 = 2;
-
-            if(two_tx) {
-                               initPortAudioDevice(m_txInPa, g_soundCard2InDeviceNum, paNoDevice, 2,
-                                g_soundCard2SampleRate, inputChannels2);
-                               initPortAudioDevice(m_txOutPa, paNoDevice, g_soundCard2OutDeviceNum, 2,
-                                g_soundCard2SampleRate, inputChannels2);
-                       }
-                       else
-                               initPortAudioDevice(m_txInPa, g_soundCard2InDeviceNum, g_soundCard2OutDeviceNum, 2,
-                                g_soundCard2SampleRate, inputChannels2);
-        }
-
-        // Init call back data structure ----------------------------------------------
-
-        g_rxUserdata = new paCallBackData;
-        g_rxUserdata->inputChannels1 = inputChannels1;
-        if (deviceInfo2 != NULL)
-            g_rxUserdata->inputChannels2 = inputChannels2;
-
-        // init sample rate conversion states
-
-        g_rxUserdata->insrc1 = src_new(SRC_SINC_FASTEST, 1, &src_error);
-        assert(g_rxUserdata->insrc1 != NULL);
-        g_rxUserdata->outsrc1 = src_new(SRC_SINC_FASTEST, 1, &src_error);
-        assert(g_rxUserdata->outsrc1 != NULL);
-        g_rxUserdata->insrc2 = src_new(SRC_SINC_FASTEST, 1, &src_error);
-        assert(g_rxUserdata->insrc2 != NULL);
-        g_rxUserdata->outsrc2 = src_new(SRC_SINC_FASTEST, 1, &src_error);
-        assert(g_rxUserdata->outsrc2 != NULL);
-
-        g_rxUserdata->insrcsf = src_new(SRC_SINC_FASTEST, 1, &src_error);
-        assert(g_rxUserdata->insrcsf != NULL);
-
-        // create FIFOs used to interface between different buffer sizes
-
-        g_rxUserdata->infifo1 = fifo_create(8*N48);
-        g_rxUserdata->outfifo1 = fifo_create(10*N48);
-        g_rxUserdata->outfifo2 = fifo_create(8*N48);
-        g_rxUserdata->infifo2 = fifo_create(8*N48);
-        printf("N48: %d\n", N48);
-
-        g_rxUserdata->rxinfifo = fifo_create(3 * g_pfreedv->n_speech_samples);
-        g_rxUserdata->rxoutfifo = fifo_create(2 * g_pfreedv->n_speech_samples);
-
-        // Init Equaliser Filters ------------------------------------------------------
-
-        m_newMicInFilter = m_newSpkOutFilter = true;
-        designEQFilters(g_rxUserdata);
-        g_rxUserdata->micInEQEnable = wxGetApp().m_MicInEQEnable;
-        g_rxUserdata->spkOutEQEnable = wxGetApp().m_SpkOutEQEnable;
-
-        // optional tone in left channel to reliably trigger vox
-        
-        g_rxUserdata->leftChannelVoxTone = wxGetApp().m_leftChannelVoxTone;
-        g_rxUserdata->voxTonePhase = 0;
-
-        // Start sound card 1 ----------------------------------------------------------
-
-        m_rxInPa->setUserData(g_rxUserdata);
-        m_rxErr = m_rxInPa->setCallback(rxCallback);
-
-        m_rxErr = m_rxInPa->streamOpen();
-
-        if(m_rxErr != paNoError) {
-            wxMessageBox(wxT("Sound Card 1 Open/Setup error."), wxT("Error"), wxOK);
-                       delete m_rxInPa;
-                       if(two_rx)
-                               delete m_rxOutPa;
-                       delete m_txInPa;
-                       if(two_tx)
-                               delete m_txOutPa;
-            destroy_fifos();
-            destroy_src();
-            deleteEQFilters(g_rxUserdata);
-            delete g_rxUserdata;
-            m_RxRunning = false;
-            return;
-        }
-
-        m_rxErr = m_rxInPa->streamStart();
-        if(m_rxErr != paNoError) {
-            wxMessageBox(wxT("Sound Card 1 Stream Start Error."), wxT("Error"), wxOK);
-                       delete m_rxInPa;
-                       if(two_rx)
-                               delete m_rxOutPa;
-                       delete m_txInPa;
-                       if(two_tx)
-                               delete m_txOutPa;
-            destroy_fifos();
-            destroy_src();
-            deleteEQFilters(g_rxUserdata);
-            delete g_rxUserdata;
-            m_RxRunning = false;
-            return;
-        }
-
-        // Start separate output stream if needed
-
-        if(two_rx) {
-            m_rxOutPa->setUserData(g_rxUserdata);
-            m_rxErr = m_rxOutPa->setCallback(rxCallback);
-
-            m_rxErr = m_rxOutPa->streamOpen();
-
-            if(m_rxErr != paNoError) {
-                wxMessageBox(wxT("Sound Card 1 Second Stream Open/Setup error."), wxT("Error"), wxOK);
-                delete m_rxInPa;
-                delete m_rxOutPa;
-                delete m_txOutPa;
-                if(two_tx)
-                    delete m_txOutPa;
-                destroy_fifos();
-                destroy_src();
-                deleteEQFilters(g_rxUserdata);
-                delete g_rxUserdata;
-                m_RxRunning = false;
-                return;
-            }
-
-            m_rxErr = m_rxOutPa->streamStart();
-            if(m_rxErr != paNoError) {
-                wxMessageBox(wxT("Sound Card 1 Second Stream Start Error."), wxT("Error"), wxOK);
-                m_rxInPa->stop();
-                m_rxInPa->streamClose();
-                delete m_rxInPa;
-                delete m_rxOutPa;
-                delete m_txOutPa;
-                if(two_tx)
-                    delete m_txOutPa;
-                destroy_fifos();
-                destroy_src();
-                deleteEQFilters(g_rxUserdata);
-                delete g_rxUserdata;
-                m_RxRunning = false;
-                return;
-            }
-        }
-
-        // Start sound card 2 ----------------------------------------------------------
-
-        if (g_nSoundCards == 2) {
-
-            // question: can we use same callback data
-            // (g_rxUserdata)or both sound card callbacks?  Is there a
-            // chance of them both being called at the same time?  We
-            // could need a mutex ...
-
-            m_txInPa->setUserData(g_rxUserdata);
-            m_txErr = m_txInPa->setCallback(txCallback);
-            m_txErr = m_txInPa->streamOpen();
-
-            if(m_txErr != paNoError) {
-                fprintf(stderr, "Err: %d\n", m_txErr);
-                wxMessageBox(wxT("Sound Card 2 Open/Setup error."), wxT("Error"), wxOK);
-                m_rxInPa->stop();
-                m_rxInPa->streamClose();
-                delete m_rxInPa;
-                if(two_rx) {
-                    m_rxOutPa->stop();
-                    m_rxOutPa->streamClose();
-                    delete m_rxOutPa;
-                }
-                delete m_txInPa;
-                if(two_tx)
-                    delete m_txOutPa;
-                destroy_fifos();
-                destroy_src();
-                deleteEQFilters(g_rxUserdata);
-                delete g_rxUserdata;
-                m_RxRunning = false;
-                return;
-            }
-            m_txErr = m_txInPa->streamStart();
-            if(m_txErr != paNoError) {
-                wxMessageBox(wxT("Sound Card 2 Start Error."), wxT("Error"), wxOK);
-                m_rxInPa->stop();
-                m_rxInPa->streamClose();
-                delete m_rxInPa;
-                if(two_rx) {
-                    m_rxOutPa->stop();
-                    m_rxOutPa->streamClose();
-                    delete m_rxOutPa;
-                }
-                delete m_txInPa;
-                if(two_tx)
-                    delete m_txOutPa;
-                destroy_fifos();
-                destroy_src();
-                deleteEQFilters(g_rxUserdata);
-                delete g_rxUserdata;
-                m_RxRunning = false;
-                return;
-            }
-
-            // Start separate output stream if needed
-
-            if (two_tx) {
-
-                // question: can we use same callback data
-                // (g_rxUserdata)or both sound card callbacks?  Is there a
-                // chance of them both being called at the same time?  We
-                // could need a mutex ...
-
-                m_txOutPa->setUserData(g_rxUserdata);
-                m_txErr = m_txOutPa->setCallback(txCallback);
-                m_txErr = m_txOutPa->streamOpen();
-
-                if(m_txErr != paNoError) {
-                    wxMessageBox(wxT("Sound Card 2 Second Stream Open/Setup error."), wxT("Error"), wxOK);
-                    m_rxInPa->stop();
-                    m_rxInPa->streamClose();
-                    delete m_rxInPa;
-                    if(two_rx) {
-                        m_rxOutPa->stop();
-                        m_rxOutPa->streamClose();
-                        delete m_rxOutPa;
-                    }
-                    m_txInPa->stop();
-                    m_txInPa->streamClose();
-                    delete m_txInPa;
-                    delete m_txOutPa;
-                    destroy_fifos();
-                    destroy_src();
-                    deleteEQFilters(g_rxUserdata);
-                    delete g_rxUserdata;
-                    m_RxRunning = false;
-                    return;
-                }
-                m_txErr = m_txOutPa->streamStart();
-                if(m_txErr != paNoError) {
-                    wxMessageBox(wxT("Sound Card 2 Second Stream Start Error."), wxT("Error"), wxOK);
-                    m_rxInPa->stop();
-                    m_rxInPa->streamClose();
-                    m_txInPa->stop();
-                    m_txInPa->streamClose();
-                    delete m_txInPa;
-                    if(two_rx) {
-                        m_rxOutPa->stop();
-                        m_rxOutPa->streamClose();
-                        delete m_rxOutPa;
-                    }
-                    delete m_txInPa;
-                    delete m_txOutPa;
-                    destroy_fifos();
-                    destroy_src();
-                    deleteEQFilters(g_rxUserdata);
-                    delete g_rxUserdata;
-                    m_RxRunning = false;
-                    return;
-                }
-            }
-        }
-
-        // start tx/rx processing thread
-
-        m_txRxThread = new txRxThread;
-
-        if ( m_txRxThread->Create() != wxTHREAD_NO_ERROR )
-        {
-            wxLogError(wxT("Can't create thread!"));
-        }
-
-        m_txRxThread->SetPriority(WXTHREAD_MAX_PRIORITY);
-
-        if ( m_txRxThread->Run() != wxTHREAD_NO_ERROR )
-        {
-            wxLogError(wxT("Can't start thread!"));
-        }
-
-    }
-}
-
-
-void MainFrame::processTxtEvent(char event[]) {
-    int rule = 0;
-
-    //printf("processTxtEvent:\n");
-    //printf("  event: %s\n", event);
-
-    // process with regexp and issue system command
-
-    // Each regexp in our list is separated by a newline.  We want to try all of them.
-
-    wxString event_str(event);
-    int match_end, replace_end;
-    match_end = replace_end = 0;
-    wxString regexp_match_list = wxGetApp().m_events_regexp_match;
-    wxString regexp_replace_list = wxGetApp().m_events_regexp_replace;
-
-    bool found_match = false;
-
-    while (((match_end = regexp_match_list.Find('\n')) != wxNOT_FOUND) && (rule < MAX_EVENT_RULES)) {
-        //printf("match_end: %d\n", match_end);
-        if ((replace_end = regexp_replace_list.Find('\n')) != wxNOT_FOUND) {
-            //printf("replace_end = %d\n", replace_end);
-
-            // candidate match and replace regexps strings exist, so lets try them
-
-            wxString regexp_match = regexp_match_list.SubString(0, match_end-1);
-            wxString regexp_replace = regexp_replace_list.SubString(0, replace_end-1);
-            //printf("match: %s replace: %s\n", (const char *)regexp_match.c_str(), (const char *)regexp_replace.c_str());
-            wxRegEx re(regexp_match);
-            //printf("  checking for match against: %s\n", (const char *)regexp_match.c_str());
-
-            // if we found a match, lets run the replace regexp and issue the system command
-
-            wxString event_str_rep = event_str;
-
-            if (re.Replace(&event_str_rep, regexp_replace) != 0) {
-                //printf("  found match!\n");
-                found_match = true;
-
-                bool enableSystem = false;
-                if (wxGetApp().m_events)
-                    enableSystem = true;
-
-                // no syscall if spam timer still running
-
-                if (spamTimer[rule].IsRunning()) {
-                    enableSystem = false;
-                    //printf("  spam timer running\n");
-                }
-
-                const char *event_out = event_str_rep.ToUTF8();
-                wxString event_out_with_return_code;
-
-                if (enableSystem) {
-                    int ret = wxExecute(event_str_rep);
-                    event_out_with_return_code.Printf(_T("%s -> returned %d"), event_out, ret);
-                    spamTimer[rule].Start((wxGetApp().m_events_spam_timer)*1000, wxTIMER_ONE_SHOT);
-                }
-                else
-                    event_out_with_return_code.Printf(_T("%s T: %d"), event_out, spamTimer[rule].IsRunning());
-
-                // update event log GUI if currently displayed
-                
-                if (optionsDlg != NULL) {                  
-                    optionsDlg->updateEventLog(wxString(event), event_out_with_return_code);                     
-                }
-            }
-        }
-        regexp_match_list = regexp_match_list.SubString(match_end+1, regexp_match_list.length());
-        regexp_replace_list = regexp_replace_list.SubString(replace_end+1, regexp_replace_list.length());
-
-        rule++;
-    }
-    if ((optionsDlg != NULL) && !found_match) {                  
-        optionsDlg->updateEventLog(wxString(event), _("<no match>"));                     
-    }
-}
-
-
-#define SBQ_MAX_ARGS 4
-
-void *MainFrame::designAnEQFilter(const char filterType[], float freqHz, float gaindB, float Q)
-{
-    char  *arg[SBQ_MAX_ARGS];
-    char   argstorage[SBQ_MAX_ARGS][80];
-    void  *sbq;
-    int    i, argc;
-
-    assert((strcmp(filterType, "bass") == 0)   ||
-           (strcmp(filterType, "treble") == 0) ||
-           (strcmp(filterType, "equalizer") == 0));
-
-    for(i=0; i<SBQ_MAX_ARGS; i++) {
-        arg[i] = &argstorage[i][0];
-        arg[i] = &argstorage[i][0];
-        arg[i] = &argstorage[i][0];
-    }
-
-    argc = 0;
-
-    if ((strcmp(filterType, "bass") == 0) || (strcmp(filterType, "treble") == 0)) {
-        sprintf(arg[argc++], "%s", filterType);
-        sprintf(arg[argc++], "%f", gaindB+1E-6);
-        sprintf(arg[argc++], "%f", freqHz);
-    }
-
-    if (strcmp(filterType, "equalizer") == 0) {
-        sprintf(arg[argc++], "%s", filterType);
-        sprintf(arg[argc++], "%f", freqHz);
-        sprintf(arg[argc++], "%f", Q);
-        sprintf(arg[argc++], "%f", gaindB+1E-6);
-    }
-
-    assert(argc <= SBQ_MAX_ARGS);
-
-    sbq = sox_biquad_create(argc-1, (const char **)arg);
-
-    return sbq;
-}
-
-void  MainFrame::designEQFilters(paCallBackData *cb)
-{
-    // init Mic In Equaliser Filters
-
-    if (m_newMicInFilter) {
-        //printf("designing new Min In filters\n");
-        cb->sbqMicInBass   = designAnEQFilter("bass", wxGetApp().m_MicInBassFreqHz, wxGetApp().m_MicInBassGaindB);
-        cb->sbqMicInTreble = designAnEQFilter("treble", wxGetApp().m_MicInTrebleFreqHz, wxGetApp().m_MicInTrebleGaindB);
-        cb->sbqMicInMid    = designAnEQFilter("equalizer", wxGetApp().m_MicInMidFreqHz, wxGetApp().m_MicInMidGaindB, wxGetApp().m_MicInMidQ);
-    }
-
-    // init Spk Out Equaliser Filters
-
-    if (m_newSpkOutFilter) {
-        //printf("designing new Spk Out filters\n");
-        //printf("designEQFilters: wxGetApp().m_SpkOutBassFreqHz: %f\n",wxGetApp().m_SpkOutBassFreqHz);
-        cb->sbqSpkOutBass   = designAnEQFilter("bass", wxGetApp().m_SpkOutBassFreqHz, wxGetApp().m_SpkOutBassGaindB);
-        cb->sbqSpkOutTreble = designAnEQFilter("treble", wxGetApp().m_SpkOutTrebleFreqHz, wxGetApp().m_SpkOutTrebleGaindB);
-        cb->sbqSpkOutMid    = designAnEQFilter("equalizer", wxGetApp().m_SpkOutMidFreqHz, wxGetApp().m_SpkOutMidGaindB, wxGetApp().m_SpkOutMidQ);
-    }
-}
-
-void  MainFrame::deleteEQFilters(paCallBackData *cb)
-{
-    if (m_newMicInFilter) {
-        sox_biquad_destroy(cb->sbqMicInBass);
-        sox_biquad_destroy(cb->sbqMicInTreble);
-        sox_biquad_destroy(cb->sbqMicInMid);
-    }
-    if (m_newSpkOutFilter) {
-        sox_biquad_destroy(cb->sbqSpkOutBass);
-        sox_biquad_destroy(cb->sbqSpkOutTreble);
-        sox_biquad_destroy(cb->sbqSpkOutMid);
-    }
-}
-
-// returns number of output samples generated by resampling
-int resample(SRC_STATE *src,
-            short      output_short[],
-            short      input_short[],
-            int        output_sample_rate,
-            int        input_sample_rate,
-            int        length_output_short, // maximum output array length in samples
-            int        length_input_short
-            )
-{
-    SRC_DATA src_data;
-    float    input[N48*4];
-    float    output[N48*4];
-    int      ret;
-
-    assert(src != NULL);
-    assert(length_input_short <= N48*4);
-    assert(length_output_short <= N48*4);
-
-    src_short_to_float_array(input_short, input, length_input_short);
-
-    src_data.data_in = input;
-    src_data.data_out = output;
-    src_data.input_frames = length_input_short;
-    src_data.output_frames = length_output_short;
-    src_data.end_of_input = 0;
-    src_data.src_ratio = (float)output_sample_rate/input_sample_rate;
-
-    ret = src_process(src, &src_data);
-    assert(ret == 0);
-
-    assert(src_data.output_frames_gen <= length_output_short);
-    src_float_to_short_array(output, output_short, src_data.output_frames_gen);
-
-    return src_data.output_frames_gen;
-}
-
-
-// Decimates samples using an algorithm that produces nice plots of
-// speech signals at a low sample rate.  We want a low sample rate so
-// we don't hammer the graphics system too hard.  Saves decimated data
-// to a fifo for plotting on screen.
-void resample_for_plot(struct FIFO *plotFifo, short buf[], int length, int fs)
-{
-    int decimation = fs/WAVEFORM_PLOT_FS;
-    int nSamples, sample;
-    int i, st, en, max, min;
-    short dec_samples[length];
-
-    nSamples = length/decimation;
-
-    for(sample = 0; sample < nSamples; sample += 2)
-    {
-        st = decimation*sample;
-        en = decimation*(sample+2);
-        max = min = 0;
-        for(i=st; i<en; i++ )
-        {
-            if (max < buf[i]) max = buf[i];
-            if (min > buf[i]) min = buf[i];
-        }
-        dec_samples[sample] = max;
-        dec_samples[sample+1] = min;
-    }
-    fifo_write(plotFifo, dec_samples, nSamples);
-}
-
-void txRxProcessing()
-{
-
-    paCallBackData  *cbData = g_rxUserdata;
-
-    // Buffers re-used by tx and rx processing
-    // signals in in48k/out48k are at a maximum sample rate of 48k, could be 44.1kHz
-    // depending on sound hardware.
-
-    short           in8k_short[4*N8];
-    short           in48k_short[4*N48];
-    short           out8k_short[4*N8];
-    short           out48k_short[4*N48];
-    int             nout, samplerate, n_samples;
-
-    //fprintf(g_logfile, "start infifo1: %5d outfifo2: %5d\n", fifo_used(cbData->infifo1), fifo_used(cbData->outfifo2));
-
-    // FreeDV 700 uses a modem sample rate of 7500 Hz which requires some special treatment
-
-    if (g_analog) 
-        samplerate = FS;
-    else
-        samplerate = g_pfreedv->modem_sample_rate;
-
-    //
-    //  RX side processing --------------------------------------------
-    //
-
-    // while we have enough input samples available ...
-
-    int nsam = g_soundCard1SampleRate * (float)N8/FS;
-    assert(nsam <= N48);
-    g_mutexProtectingCallbackData.Lock();
-    while ((fifo_read(cbData->infifo1, in48k_short, nsam) == 0) && ((g_half_duplex && !g_tx) || !g_half_duplex)) 
-    {
-        g_mutexProtectingCallbackData.Unlock();
-        unsigned int n8k;
-
-        n8k = resample(cbData->insrc1, in8k_short, in48k_short, samplerate, g_soundCard1SampleRate, N8, nsam);
-        assert(n8k <= N8);
-
-        // optionally save "from radio" signal (write demod input to file)
-        // Really useful for testing and development as it allows us
-        // to repeat tests using off air signals
-
-        g_mutexProtectingCallbackData.Lock();
-        if (g_recFileFromRadio && (g_sfRecFile != NULL)) {
-            //printf("g_recFromRadioSamples: %d  n8k: %d \n", g_recFromRadioSamples);
-            if (g_recFromRadioSamples < n8k) {
-                sf_write_short(g_sfRecFile, in8k_short, g_recFromRadioSamples);
-                wxCommandEvent event( wxEVT_COMMAND_MENU_SELECTED, g_recFileFromRadioEventId );
-                // call stop/start record menu item, should be thread safe
-                g_parent->GetEventHandler()->AddPendingEvent( event );
-                g_recFromRadioSamples = 0;
-                //printf("finished recording g_recFromRadioSamples: %d n8k: %d!\n", g_recFileFromRadio, n8k);
-            }
-            else {
-                sf_write_short(g_sfRecFile, in8k_short, n8k);
-                g_recFromRadioSamples -= n8k;
-            }
-        }
-        g_mutexProtectingCallbackData.Unlock();
-
-        // optionally read "from radio" signal from file (read demod input from file)
-
-        g_mutexProtectingCallbackData.Lock();
-        if (g_playFileFromRadio && (g_sfPlayFileFromRadio != NULL)) {
-            unsigned int nsf = n8k*g_sfFs/samplerate;
-            short        insf_short[nsf];
-            unsigned int n = sf_read_short(g_sfPlayFileFromRadio, insf_short, nsf);
-            n8k = resample(cbData->insrcsf, in8k_short, insf_short, samplerate, g_sfFs, N8, nsf);
-            //fprintf(g_logfile, "n: %d nsnf: %d n8k: %d\n", n, nsf, n8k);
-            assert(n8k <= N8);
-
-            if (n == 0) {
-                if (g_loopPlayFileFromRadio)
-                    sf_seek(g_sfPlayFileFromRadio, 0, SEEK_SET);
-                else {
-                    printf("playFileFromRadio finished, issuing event!\n");
-                    wxCommandEvent event( wxEVT_COMMAND_MENU_SELECTED, g_playFileFromRadioEventId );
-                    // call stop/start play menu item, should be thread safe
-                    g_parent->GetEventHandler()->AddPendingEvent( event );
-                }
-            }
-        }
-        g_mutexProtectingCallbackData.Unlock();
-
-        resample_for_plot(g_plotDemodInFifo, in8k_short, n8k, samplerate);
-
-        // send latest squelch level to FreeDV API, as it handles squelch internally
-
-        g_pfreedv->squelch_en = g_SquelchActive;
-        g_pfreedv->snr_squelch_thresh = g_SquelchLevel;
-        //fprintf(g_logfile, "snr_squelch_thresh: %f\n",  g_pfreedv->snr_squelch_thresh);
-
-        // Get some audio to send to headphones/speaker.  If in analog
-        // mode we pass thru the "from radio" audio to the
-        // headphones/speaker.
-
-        if (g_analog) {
-            memcpy(out8k_short, in8k_short, sizeof(short)*n8k);
-            
-            // compute rx spectrum 
-
-            COMP  rx_fdm[n8k];
-            float rx_spec[MODEM_STATS_NSPEC];
-            unsigned int   i;
-
-            for(i=0; i<n8k; i++) {
-                rx_fdm[i].real = in8k_short[i];
-                rx_fdm[i].imag = 0.0;
-            }            
-            modem_stats_get_rx_spectrum(&g_stats, rx_spec, rx_fdm, n8k);
-
-            // Average rx spectrum data using a simple IIR low pass filter
-
-            for(i = 0; i<MODEM_STATS_NSPEC; i++) {
-                g_avmag[i] = BETA * g_avmag[i] + (1.0 - BETA) * rx_spec[i];
-            }
-        }
-        else {
-            fifo_write(cbData->rxinfifo, in8k_short, n8k);
-            per_frame_rx_processing(cbData->rxoutfifo, cbData->rxinfifo);
-            memset(out8k_short, 0, sizeof(short)*N8);
-            fifo_read(cbData->rxoutfifo, out8k_short, N8);
-        }
-
-
-        // Optional Spk Out EQ Filtering, need mutex as filter can change at run time
-        g_mutexProtectingCallbackData.Lock();
-        if (cbData->spkOutEQEnable) {
-            sox_biquad_filter(cbData->sbqSpkOutBass,   out8k_short, out8k_short, N8);
-            sox_biquad_filter(cbData->sbqSpkOutTreble, out8k_short, out8k_short, N8);
-            sox_biquad_filter(cbData->sbqSpkOutMid,    out8k_short, out8k_short, N8);
-        }
-        g_mutexProtectingCallbackData.Unlock();
-
-        resample_for_plot(g_plotSpeechOutFifo, out8k_short, N8, FS);
-
-        g_mutexProtectingCallbackData.Lock();
-        if (g_nSoundCards == 1) {
-            nout = resample(cbData->outsrc2, out48k_short, out8k_short, g_soundCard1SampleRate, FS, N48, N8);
-            fifo_write(cbData->outfifo1, out48k_short, nout);
-        }
-        else {
-            nout = resample(cbData->outsrc2, out48k_short, out8k_short, g_soundCard2SampleRate, FS, N48, N8);
-            fifo_write(cbData->outfifo2, out48k_short, nout);
-        }
-    }
-    g_mutexProtectingCallbackData.Unlock();
-
-    //
-    //  TX side processing --------------------------------------------
-    //
-
-    if ((g_nSoundCards == 2) && ((g_half_duplex && g_tx) || !g_half_duplex)) {
-        int ret;
-
-        // Make sure we have q few frames of modulator output
-        // samples.  This also locks the modulator to the sample rate
-        // of sound card 1.  We want to make sure that modulator
-        // samples are uninterrupted by differences in sample rate
-        // between this sound card and sound card 2.
-
-        g_mutexProtectingCallbackData.Lock();
-        while((unsigned)fifo_used(cbData->outfifo1) < 6*N48)
-        {
-            g_mutexProtectingCallbackData.Unlock();
-
-            int   nsam = g_soundCard2SampleRate * g_pfreedv->n_speech_samples/FS;
-            assert(nsam <= 4*N48);
-
-            // infifo2 is written to by another sound card so it may
-            // over or underflow, but we don't realy care.  It will
-            // just result in a short interruption in audio being fed
-            // to codec2_enc, possibly making a click every now and
-            // again in the decoded audio at the other end.
-
-            // zero speech input just in case infifo2 underflows
-            memset(in48k_short, 0, nsam*sizeof(short));
-            fifo_read(cbData->infifo2, in48k_short, nsam);
-
-            nout = resample(cbData->insrc2, in8k_short, in48k_short, FS, g_soundCard2SampleRate, 4*N8, nsam);
-
-            // optionally use file for mic input signal
-
-            g_mutexProtectingCallbackData.Lock();
-            if (g_playFileToMicIn && (g_sfPlayFile != NULL)) {
-                int n = sf_read_short(g_sfPlayFile, in8k_short, nout);
-                //fprintf(stderr, "n: %d nout: %d\n", n, nout);
-                if (n != nout) {
-                    if (g_loopPlayFileToMicIn)
-                        sf_seek(g_sfPlayFile, 0, SEEK_SET);
-                    else {
-                        wxCommandEvent event( wxEVT_COMMAND_MENU_SELECTED, g_playFileToMicInEventId );
-                        // call stop/start play menu item, should be thread safe
-                        g_parent->GetEventHandler()->AddPendingEvent( event );
-                    }
-                }
-            }
-            g_mutexProtectingCallbackData.Unlock();
-
-            // Optional Speex pre-processor for acoustic noise reduction
-
-            if (wxGetApp().m_speexpp_enable) {
-                speex_preprocess_run(g_speex_st, in8k_short);
-            }
-
-            // Optional Mic In EQ Filtering, need mutex as filter can change at run time
-
-            g_mutexProtectingCallbackData.Lock();
-            if (cbData->micInEQEnable) {
-                sox_biquad_filter(cbData->sbqMicInBass, in8k_short, in8k_short, nout);
-                sox_biquad_filter(cbData->sbqMicInTreble, in8k_short, in8k_short, nout);
-                sox_biquad_filter(cbData->sbqMicInMid, in8k_short, in8k_short, nout);
-            }
-            g_mutexProtectingCallbackData.Unlock();
-
-            resample_for_plot(g_plotSpeechInFifo, in8k_short, nout, FS);
-
-            n_samples = g_pfreedv->n_nom_modem_samples;
-
-            if (g_analog) {
-                n_samples = g_pfreedv->n_speech_samples;
-
-                // Boost the "from mic" -> "to radio" audio in analog
-                // mode.  The need for the gain was found by
-                // experiment - analog SSB sounded too quiet compared
-                // to digital. With digital voice we generally drive
-                // the "to radio" (SSB radio mic input) at about 25%
-                // of the peak level for normal SSB voice. So we
-                // introduce 6dB gain to make analog SSB sound the
-                // same level as the digital.  Watch out for clipping.
-                for(int i=0; i<n_samples; i++) {
-                    float out = (float)in8k_short[i]*2.0;
-                    if (out > 32767) out = 32767.0;
-                    if (out < -32767) out = -32767.0;
-                    out8k_short[i] = out;
-                }
-            }
-            else {
-                COMP tx_fdm[g_pfreedv->n_nom_modem_samples];
-                COMP tx_fdm_offset[g_pfreedv->n_nom_modem_samples];
-                int  i;
-
-                freedv_comptx(g_pfreedv, tx_fdm, in8k_short);
-  
-                fdmdv_freq_shift_coh(tx_fdm_offset, tx_fdm, g_TxFreqOffsetHz, g_pfreedv->modem_sample_rate, &g_TxFreqOffsetPhaseRect, g_pfreedv->n_nom_modem_samples);
-                for(i=0; i<g_pfreedv->n_nom_modem_samples; i++)
-                    out8k_short[i] = tx_fdm_offset[i].real;
-            }
-
-            // output one frame of modem signal
-            nout = resample(cbData->outsrc1, out48k_short, out8k_short, g_soundCard1SampleRate, samplerate, N48*4, n_samples);
-            g_mutexProtectingCallbackData.Lock();
-            ret = fifo_write(cbData->outfifo1, out48k_short, nout);
-            //fprintf(stderr,"nout: %d ret: %d N48*4: %d\n", nout, ret, N48*4);
-
-            assert(ret != -1);
-        }
-        g_mutexProtectingCallbackData.Unlock();
-    }
-   
-    //fprintf(g_logfile, "  end infifo1: %5d outfifo2: %5d\n", fifo_used(cbData->infifo1), fifo_used(cbData->outfifo2));
-
-}
-
-//----------------------------------------------------------------
-// per_frame_rx_processing()
-//----------------------------------------------------------------
-
-void per_frame_rx_processing(
-                                            FIFO    *output_fifo,   // decoded speech samples
-                                            FIFO    *input_fifo
-                                        )
-{
-    short               input_buf[g_pfreedv->n_max_modem_samples];
-    short               output_buf[g_pfreedv->n_speech_samples];
-    COMP                rx_fdm[g_pfreedv->n_max_modem_samples];
-    COMP                rx_fdm_offset[g_pfreedv->n_max_modem_samples];
-    float               rx_spec[MODEM_STATS_NSPEC];
-    int                 i;
-    int                 nin, nin_prev, nout;
-
-    nin = freedv_nin(g_pfreedv);
-    while (fifo_read(input_fifo, input_buf, nin) == 0)
-    {
-        assert(nin <= g_pfreedv->n_max_modem_samples);
-
-        nin_prev = nin;
-        //fwrite(input_buf, sizeof(short), nin, ft);
-
-        // demod per frame processing
-        for(i=0; i<nin; i++)
-        {
-            rx_fdm[i].real = (float)input_buf[i];
-            rx_fdm[i].imag = 0.0;
-        }
-       
-        if (g_channel_noise) {
-            float snr;
-
-            /* enough noise to get a couple of % errors */
-
-            if (g_pfreedv->mode == FREEDV_MODE_1600)
-                snr = 2.0;
-            if ((g_pfreedv->mode == FREEDV_MODE_700) || (g_pfreedv->mode == FREEDV_MODE_700))
-                snr = -1.0;           
-            fdmdv_simulate_channel(&g_sig_pwr_av, rx_fdm, nin, snr);
-        }
-        fdmdv_freq_shift_coh(rx_fdm_offset, rx_fdm, g_RxFreqOffsetHz, g_pfreedv->modem_sample_rate, &g_RxFreqOffsetPhaseRect, nin);
-        nout = freedv_comprx(g_pfreedv, output_buf, rx_fdm_offset);
-        
-        fifo_write(output_fifo, output_buf, nout);
-        
-        nin = freedv_nin(g_pfreedv);
-        g_State = g_pfreedv->sync;
-        //fprintf(g_logfile, "g_State: %d g_stats.sync: %d snr: %f \n", g_State, g_stats.sync, f->snr);
-
-        // compute rx spectrum 
-
-        modem_stats_get_rx_spectrum(&g_stats, rx_spec, rx_fdm, nin_prev);
-        // Average rx spectrum data using a simple IIR low pass filter
-
-        for(i = 0; i<MODEM_STATS_NSPEC; i++) {
-            g_avmag[i] = BETA * g_avmag[i] + (1.0 - BETA) * rx_spec[i];
-        }
-
-        if (g_pfreedv->mode == FREEDV_MODE_1600)
-            fdmdv_get_demod_stats(g_pfreedv->fdmdv, &g_stats);
-        if ((g_pfreedv->mode == FREEDV_MODE_700) || (g_pfreedv->mode == FREEDV_MODE_700B))
-            cohpsk_get_demod_stats(g_pfreedv->cohpsk, &g_stats);
-
-    }
-}
-
-
-//-------------------------------------------------------------------------
-// rxCallback()
-//
-// Sound card 1 callback from PortAudio, that is used for processing rx
-// side:
-//
-// + infifo1 is the "from radio" off air modem signal from the SSB rx that we send to the demod.
-// + In single sound card mode outfifo1 is the "to speaker/headphones" decoded speech output.
-// + In dual sound card mode outfifo1 is the "to radio" modulator signal to the SSB tx.
-//
-//-------------------------------------------------------------------------
-int MainFrame::rxCallback(
-                            const void      *inputBuffer,
-                            void            *outputBuffer,
-                            unsigned long   framesPerBuffer,
-                            const PaStreamCallbackTimeInfo* timeInfo,
-                            PaStreamCallbackFlags statusFlags,
-                            void            *userData
-                         )
-{
-    paCallBackData  *cbData = (paCallBackData*)userData;
-    short           *rptr    = (short*)inputBuffer;
-    short           *wptr    = (short*)outputBuffer;
-
-    short           indata[MAX_FPB];
-    short           outdata[MAX_FPB];
-
-    unsigned int    i;
-
-    (void) timeInfo;
-    (void) statusFlags;
-
-    wxMutexLocker lock(g_mutexProtectingCallbackData);
-
-    //fprintf(g_logfile, "cb1 statusFlags: 0x%x framesPerBuffer: %d rptr: 0x%x wptr: 0x%x \n", (int)statusFlags,
-    //        framesPerBuffer, rptr, wptr);
-
-    //
-    //  RX side processing --------------------------------------------
-    //
-
-    // assemble a mono buffer and write to FIFO
-
-    assert(framesPerBuffer < MAX_FPB);
-
-    if(rptr) {
-        //fprintf(g_logfile,"in %ld %d\n",  framesPerBuffer, g_in++);
-        //g_indata += framesPerBuffer;
-        for(i = 0; i < framesPerBuffer; i++, rptr += cbData->inputChannels1)
-            indata[i] = rptr[0];                       
-        if (fifo_write(cbData->infifo1, indata, framesPerBuffer)) {
-            //fprintf(g_logfile, "infifo1 full\n");
-        }
-        //fifo_write(cbData->outfifo1, indata, framesPerBuffer);
-    }
-
-    // OK now set up output samples for this callback
-
-    if(wptr) {
-        //fprintf(g_logfile,"out %ld %d\n",  framesPerBuffer, g_out++);
-        if (fifo_read(cbData->outfifo1, outdata, framesPerBuffer) == 0) {
-
-            // write signal to both channels
-
-            for(i = 0; i < framesPerBuffer; i++, wptr += 2) {
-                if (cbData->leftChannelVoxTone) {
-                    cbData->voxTonePhase += 2.0*M_PI*VOX_TONE_FREQ/g_soundCard1SampleRate;
-                    cbData->voxTonePhase -= 2.0*M_PI*floor(cbData->voxTonePhase/(2.0*M_PI));
-                    wptr[0] = VOX_TONE_AMP*cos(cbData->voxTonePhase);                              
-                    //printf("%f %d\n", cbData->voxTonePhase, wptr[0]);
-                }
-                else
-                    wptr[0] = outdata[i];
-                               
-                wptr[1] = outdata[i];
-            }
-        }
-        else {
-            //fprintf(g_logfile, "outfifo1 empty\n");
-            // zero output if no data available
-            for(i = 0; i < framesPerBuffer; i++, wptr += 2) {
-                wptr[0] = 0;
-                wptr[1] = 0;
-            }
-        }
-    }
-
-    return paContinue;
-}
-
-
-//-------------------------------------------------------------------------
-// txCallback()
-//-------------------------------------------------------------------------
-int MainFrame::txCallback(
-                            const void *inputBuffer,
-                            void *outputBuffer,
-                            unsigned long framesPerBuffer,
-                            const PaStreamCallbackTimeInfo *outTime,
-                            PaStreamCallbackFlags statusFlags,
-                            void *userData
-                        )
-{
-    paCallBackData  *cbData = (paCallBackData*)userData;
-    unsigned int    i;
-    short           *rptr    = (short*)inputBuffer;
-    short           *wptr    = (short*)outputBuffer;
-    short           indata[MAX_FPB];
-    short           outdata[MAX_FPB];
-
-    wxMutexLocker lock(g_mutexProtectingCallbackData);
-
-    //    if (statusFlags)
-    //    printf("cb2 statusFlags: 0x%x\n", (int)statusFlags);
-
-    // assemble a mono buffer and write to FIFO
-
-    assert(framesPerBuffer < MAX_FPB);
-
-    if(rptr) {
-        for(i = 0; i < framesPerBuffer; i++, rptr += cbData->inputChannels2)
-            indata[i] = rptr[0];                        
-    }
-
-    //#define SC2_LOOPBACK
-#ifdef SC2_LOOPBACK
-    //TODO: This doesn't work unless using the same soundcard!
-
-    if(wptr) {
-        for(i = 0; i < framesPerBuffer; i++, wptr += 2) {
-            wptr[0] = indata[i];
-            wptr[1] = indata[i];
-        }
-    }
-
-#else
-    if(rptr) {
-        if (fifo_write(cbData->infifo2, indata, framesPerBuffer)) {
-            //fprintf(g_logfile, "infifo2 full\n");
-        }
-    }
-
-    // OK now set up output samples for this callback
-
-    if(wptr) {
-        if (fifo_read(cbData->outfifo2, outdata, framesPerBuffer) == 0) {
-               
-            // write signal to both channels */
-            for(i = 0; i < framesPerBuffer; i++, wptr += 2) {
-                wptr[0] = outdata[i];
-                wptr[1] = outdata[i];
-            }
-        }
-        else {
-            //fprintf(g_logfile, "outfifo2 empty\n");
-            // zero output if no data available
-            for(i = 0; i < framesPerBuffer; i++, wptr += 2) {
-                wptr[0] = 0;
-                wptr[1] = 0;
-            }
-        }
-    }
-#endif
-    return paContinue;
-}
-
-// Callback from plot_spectrum & plot_waterfall.  would be nice to
-// work out a way to do this without globals.
-
-void fdmdv2_clickTune(float freq) {
-
-    // The demod is hard-wired to expect a centre frequency of
-    // FDMDV_FCENTRE.  So we want to take the signal centered on the
-    // click tune freq and re-centre it on FDMDV_FCENTRE.  For example
-    // if the click tune freq is 1500Hz, and FDMDV_CENTRE is 1200 Hz,
-    // we need to shift the input signal centred on 1500Hz down to
-    // 1200Hz, an offset of -300Hz.
-
-    if (g_split) {
-        g_RxFreqOffsetHz = FDMDV_FCENTRE - freq;
-    }
-    else {
-        g_TxFreqOffsetHz = freq - FDMDV_FCENTRE;
-        g_RxFreqOffsetHz = FDMDV_FCENTRE - freq;
-    }
-}
-
-//----------------------------------------------------------------
-// SetupSerialPort()
-//----------------------------------------------------------------
-void MainFrame::SetupSerialPort(void)
-{
-    if(!wxGetApp().m_strRigCtrlPort.IsEmpty())
-    {
-        if(openComPort(wxGetApp().m_strRigCtrlPort.c_str()))
-        {
-            // always start PTT in Rx state
-            SerialPTTRx();
-        }
-        else
-        {
-            wxMessageBox("Couldn't open Serial Port", wxT("About"), wxOK | wxICON_ERROR, this);
-        }
-    }
-}
-
-void MainFrame::SerialPTTRx(void)
-{
-    printf("m_boolUseRTS: %d m_boolRTSPos: %d m_boolUseDTR: %d m_boolDTRPos: %d\n",
-           wxGetApp().m_boolUseRTS, wxGetApp().m_boolRTSPos, wxGetApp().m_boolUseDTR, wxGetApp().m_boolDTRPos);
-
-        if(wxGetApp().m_boolRTSPos) // RTS cleared LOW
-            lowerRTS();
-        else                        // RTS cleared HIGH
-            raiseRTS();
-
-        if(wxGetApp().m_boolDTRPos) // DTR cleared LOW
-            lowerDTR();
-        else                        // DTR cleared HIGH
-            raiseDTR();
-}
-
-//----------------------------------------------------------------
-// CloseSerialPort()
-//----------------------------------------------------------------
-void MainFrame::CloseSerialPort(void)
-{
-    if (com_handle != COM_HANDLE_INVALID) {
-        // always end with PTT in rx state
-
-        SerialPTTRx();
-
-               closeComPort();
-    }
-}
-
-
-//----------------------------------------------------------------
-// PollUDP() - see if any commands on UDP port
-//----------------------------------------------------------------
-
-// test this puppy with netcat: 
-//   $ echo "hello" | nc -u -q1 localhost 3000
-
-int MainFrame::PollUDP(void)
-{
-    // this will block until message received, so we put it in it's own thread
-
-    char buf[1024];
-    char reply[80];
-    size_t n = m_udp_sock->RecvFrom(m_udp_addr, buf, sizeof(buf)).LastCount();
-
-    if (n) {
-        wxString bufstr = wxString::From8BitData(buf, n);
-        bufstr.Trim();
-        wxString ipaddr = m_udp_addr.IPAddress();
-        printf("Received: \"%s\" from %s:%u\n",
-               (const char *)bufstr.c_str(),
-               (const char *)ipaddr.c_str(), m_udp_addr.Service());
-
-        // for security only accept commands from local host
-
-        sprintf(reply,"nope\n");
-        if (ipaddr.Cmp(_("127.0.0.1")) == 0) {
-
-            // process commands
-
-            if (bufstr.Cmp(_("restore")) == 0) {
-                m_schedule_restore = true;  // Make Restore happen in main thread to avoid crashing
-                sprintf(reply,"ok\n");
-            }
-                
-            wxString itemToSet, val;
-            if (bufstr.StartsWith(_("set "), &itemToSet)) {
-                if (itemToSet.StartsWith("txtmsg ", &val)) {
-                    // note: if options dialog is open this will get overwritten
-                    wxGetApp().m_callSign = val;
-                }  
-                sprintf(reply,"ok\n");
-            }
-                
-        }
-        else {
-            printf("We only accept messages from locahost!\n");
-        }
-
-       if ( m_udp_sock->SendTo(m_udp_addr, reply, strlen(reply)).LastCount() != strlen(reply)) {
-           printf("ERROR: failed to send data\n");
-        }
-    }
-
-    return n;
-}
-
-void MainFrame::startUDPThread(void) {
-    printf("starting UDP thread!\n");
-    m_UDPThread = new UDPThread;
-    m_UDPThread->mf = this;
-    if (m_UDPThread->Create() != wxTHREAD_NO_ERROR ) {
-        wxLogError(wxT("Can't create thread!"));
-    }
-    if (m_UDPThread->Run() != wxTHREAD_NO_ERROR ) {
-        wxLogError(wxT("Can't start thread!"));
-        delete m_UDPThread;
-    }
-}
-
-void MainFrame::stopUDPThread(void) {
-    printf("stopping UDP thread!\n");
-    if ((m_UDPThread != NULL) && m_UDPThread->m_run) {
-        m_UDPThread->m_run = 0;
-        m_UDPThread->Wait();
-        m_UDPThread = NULL;
-    }
-}
-
-void *UDPThread::Entry() {
-    printf("UDP thread started!\n");
-    while (m_run) {
-        if (wxGetApp().m_udp_enable) {
-            printf("m_udp_enable\n");
-            mf->m_udp_addr.Service(wxGetApp().m_udp_port);
-            mf->m_udp_sock = new wxDatagramSocket(mf->m_udp_addr, wxSOCKET_NOWAIT);
-
-            while (m_run && wxGetApp().m_udp_enable) {
-                if (mf->PollUDP() == 0) {
-                    wxThread::Sleep(20);
-                }
-            }
-
-            delete mf->m_udp_sock;
-        }
-        wxThread::Sleep(20);
-    }
-    return NULL;
-}
-
-
-char my_get_next_tx_char(void *callback_state) {
-    short ch = 0;
-    
-    fifo_read(g_txDataInFifo, &ch, 1);
-    //fprintf(stderr, "get_next_tx_char: %c\n", (char)ch);
-    return (char)ch;
-}
-
-void my_put_next_rx_char(void *callback_state, char c) {
-    short ch = (short)c;
-    //fprintf(stderr, "put_next_rx_char: %c\n", (char)c);
-    fifo_write(g_rxDataOutFifo, &ch, 1);
-}
-
-// Callback from FreeDv API to update error plots
-
-void my_freedv_put_error_pattern(void *state, short error_pattern[], int sz_error_pattern) {
-    fifo_write(g_error_pattern_fifo, error_pattern, sz_error_pattern);
-}
diff --git a/fdmdv2-dev/src/fdmdv2_main.h b/fdmdv2-dev/src/fdmdv2_main.h
deleted file mode 100644 (file)
index 25a1e70..0000000
+++ /dev/null
@@ -1,614 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_main.h
-//
-// Purpose:         Declares simple wxWidgets application with GUI.
-// Created:         Apr. 9, 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 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 License
-//  along with this program; if not, see <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#ifndef __FDMDV2_MAIN__
-#define __FDMDV2_MAIN__
-
-#include "version.h"
-#ifndef _NO_AUTOTOOLS_
-#include "../config.h"
-#endif
-#include <wx/wx.h>
-
-#include <wx/tglbtn.h>
-#include <wx/app.h>
-//#include <wx/aboutdlg.h>
-#include "wx/rawbmp.h"
-#include "wx/file.h"
-#include "wx/filename.h"
-#include "wx/config.h"
-#include <wx/fileconf.h>
-#include "wx/graphics.h"
-#include "wx/mstream.h"
-#include "wx/wfstream.h"
-#include "wx/quantize.h"
-#include "wx/scopedptr.h"
-#include "wx/stopwatch.h"
-#include "wx/versioninfo.h"
-#include <wx/sound.h>
-#include <wx/url.h>
-#include <wx/sstream.h>
-#include <wx/listbox.h>
-#include <wx/textdlg.h>
-#include <wx/regex.h>
-#include <wx/socket.h>
-
-#include <samplerate.h>
-
-#include <hamlib.h> 
-#include <stdint.h>
-#include <speex/speex_preprocess.h>
-
-#ifdef _WIN32
-#include <windows.h>
-#else
-#include <termios.h>
-#include <sys/ioctl.h>
-#endif
-
-#include "codec2.h"
-#include "codec2_fdmdv.h"
-#include "codec2_fifo.h"
-#include "golay23.h"
-#include "modem_stats.h"
-
-#include "topFrame.h"
-#include "dlg_ptt.h"
-#include "dlg_options.h"
-#include "fdmdv2_plot.h"
-#include "fdmdv2_plot_scalar.h"
-#include "fdmdv2_plot_scatter.h"
-#include "fdmdv2_plot_waterfall.h"
-#include "fdmdv2_plot_spectrum.h"
-#include "fdmdv2_pa_wrapper.h"
-#include "sndfile.h"
-#include "portaudio.h"
-#include "dlg_audiooptions.h"
-#include "dlg_filter.h"
-#include "dlg_options.h"
-#include "varicode.h"
-#include "sox_biquad.h"
-#include "comp_prim.h"
-
-#define _USE_TIMER              1
-#define _USE_ONIDLE             1
-#define _DUMMY_DATA             1
-//#define _AUDIO_PASSTHROUGH    1
-#define _REFRESH_TIMER_PERIOD   (DT*1000)
-//#define _USE_ABOUT_DIALOG       1
-
-enum {
-        ID_START = wxID_HIGHEST,
-        ID_TIMER_WATERFALL,
-        ID_TIMER_SPECTRUM,
-        ID_TIMER_SCATTER,
-        ID_TIMER_SCALAR
-     };
-
-#define EXCHANGE_DATA_IN    0
-#define EXCHANGE_DATA_OUT   1
-
-#ifdef _WIN32
-#define COM_HANDLE_INVALID                     INVALID_HANDLE_VALUE
-typedef HANDLE      com_handle_t;
-#else
-#define COM_HANDLE_INVALID                     -1
-typedef int         com_handle_t;
-#endif
-
-extern int                 g_nSoundCards;
-extern int                 g_soundCard1InDeviceNum;
-extern int                 g_soundCard1OutDeviceNum;
-extern int                 g_soundCard1SampleRate;
-extern int                 g_soundCard2InDeviceNum;
-extern int                 g_soundCard2OutDeviceNum;
-extern int                 g_soundCard2SampleRate;
-
-class MainFrame;
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class MainApp
-//
-// @class $(Name)
-// @author $(User)
-// @date $(Date)
-// @file $(CurrentFileName).$(CurrentFileExt)
-// @brief
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class MainApp : public wxApp
-{
-    public:
-        virtual bool        OnInit();
-        virtual int         OnExit();
-
-        wxString            m_strVendName;
-        wxString            m_StrAppName;
-
-        wxString            m_textNumChOut;
-        wxString            m_textNumChIn;
-
-        wxString            m_strRxInAudio;
-        wxString            m_strRxOutAudio;
-        wxString            m_textVoiceInput;
-        wxString            m_textVoiceOutput;
-        wxString            m_strSampleRate;
-        wxString            m_strBitrate;
-
-        // PTT -----------------------------------
-
-        bool                m_boolHalfDuplex;
-
-        bool                m_boolHamlibUseForPTT;
-        unsigned int        m_intHamlibRig;
-        wxString            m_strHamlibSerialPort;
-        Hamlib              *m_hamlib;
-
-        bool                m_boolUseSerialPTT;
-        wxString            m_strRigCtrlPort;
-        bool                m_boolUseRTS;
-        bool                m_boolRTSPos;
-        bool                m_boolUseDTR;
-        bool                m_boolDTRPos;
-
-        // Play/Rec files
-
-        wxString            m_playFileToMicInPath;
-        wxString            m_recFileFromRadioPath;
-        unsigned int        m_recFileFromRadioSecs;
-        wxString            m_playFileFromRadioPath;
-
-        // Options dialog
-
-        wxString            m_callSign;
-        bool                m_events;
-        int                 m_events_spam_timer;
-        unsigned int        m_textEncoding;
-        bool                m_enable_checksum;
-        wxString            m_events_regexp_match;
-        wxString            m_events_regexp_replace;
-
-        bool                m_snrSlow;
-
-        // LPC Post Filter
-        bool                m_codec2LPCPostFilterEnable;
-        bool                m_codec2LPCPostFilterBassBoost;
-        float               m_codec2LPCPostFilterGamma;
-        float               m_codec2LPCPostFilterBeta;
-        
-        // Speex Pre-Processor
-        bool                m_speexpp_enable;
-
-        // Mic In Equaliser
-        float               m_MicInBassFreqHz;
-        float               m_MicInBassGaindB;
-        float               m_MicInTrebleFreqHz;
-        float               m_MicInTrebleGaindB;
-        float               m_MicInMidFreqHz;
-        float               m_MicInMidGaindB;
-        float               m_MicInMidQ;
-        bool                m_MicInEQEnable;
-
-        // Spk Out Equaliser
-        float               m_SpkOutBassFreqHz;
-        float               m_SpkOutBassGaindB;
-        float               m_SpkOutTrebleFreqHz;
-        float               m_SpkOutTrebleGaindB;
-        float               m_SpkOutMidFreqHz;
-        float               m_SpkOutMidGaindB;
-        float               m_SpkOutMidQ;
-        bool                m_SpkOutEQEnable;
-
-        // Flags for displaying windows
-        int                 m_show_wf;
-        int                 m_show_spect;
-        int                 m_show_scatter;
-        int                 m_show_timing;
-        int                 m_show_freq;
-        int                 m_show_speech_in;
-        int                 m_show_speech_out;
-        int                 m_show_demod_in;
-        int                 m_show_test_frame_errors;
-        int                 m_show_test_frame_errors_hist;
-
-        // optional vox trigger tone
-        bool                m_leftChannelVoxTone;
-
-        // UDP control port
-        bool                m_udp_enable;
-        int                 m_udp_port;
-
-        // notebook display after tx->rxtransition
-        int                 m_rxNbookCtrl;
-
-        wxRect              m_rTopWindow;
-
-        int                 m_framesPerBuffer;
-
-        bool                loadConfig();
-        bool                saveConfig();
-
-        // misc
-
-        bool       m_testFrames;
-        bool       m_channel_noise;
-        float      m_channel_snr_dB;
-
-        int        FilterEvent(wxEvent& event);
-        MainFrame *frame;
-
-        bool       m_FreeDV700txClip;
-    protected:
-};
-
-// declare global static function wxGetApp()
-DECLARE_APP(MainApp)
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// paCallBackData
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-typedef struct
-{
-    // libresample states for 48 to 8 kHz conversions
-
-    SRC_STATE      *insrc1;
-    SRC_STATE      *outsrc1;
-    SRC_STATE      *insrc2;
-    SRC_STATE      *outsrc2;
-    SRC_STATE      *insrcsf;
-
-    // FIFOs attached to first sound card
-
-    struct FIFO    *infifo1;
-    struct FIFO    *outfifo1;
-
-    // FIFOs attached to second sound card
-    struct FIFO    *infifo2;
-    struct FIFO    *outfifo2;
-
-    // FIFOs for rx process
-    struct FIFO    *rxinfifo;
-    struct FIFO    *rxoutfifo;
-
-    int             inputChannels1, inputChannels2;
-
-    // EQ filter states
-    void           *sbqMicInBass;
-    void           *sbqMicInTreble;
-    void           *sbqMicInMid;
-    void           *sbqSpkOutBass;
-    void           *sbqSpkOutTreble;
-    void           *sbqSpkOutMid;
-
-    bool            micInEQEnable;
-    bool            spkOutEQEnable;
-
-    // optional loud tone on left channel to reliably trigger vox
-    bool            leftChannelVoxTone;
-    float           voxTonePhase;
-
-} paCallBackData;
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// panel with custom loop checkbox for play file dialog
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class MyExtraPlayFilePanel : public wxPanel
-{
-public:
-    MyExtraPlayFilePanel(wxWindow *parent);
-    void setLoopPlayFileToMicIn(bool checked) { m_cb->SetValue(checked); }
-    bool getLoopPlayFileToMicIn(void) { return m_cb->GetValue(); }
-private:
-    wxCheckBox *m_cb;
-};
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// panel with custom Seconds-to-record control for record file dialog
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class MyExtraRecFilePanel : public wxPanel
-{
-public:
-    MyExtraRecFilePanel(wxWindow *parent);
-    ~MyExtraRecFilePanel() 
-    {
-        wxLogDebug("Destructor\n");
-    }
-    void setSecondsToRecord(wxString value) { m_secondsToRecord->SetValue(value); }
-    wxString getSecondsToRecord(void) 
-    { 
-        wxLogDebug("getSecondsToRecord: %s\n",m_secondsToRecord->GetValue());
-        return m_secondsToRecord->GetValue(); 
-    }
-private:
-    wxTextCtrl *m_secondsToRecord;
-};
-
-class txRxThread;
-class UDPThread;
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class MainFrame
-//
-// @class $(Name)
-// @author $(User)
-// @date $(Date)
-// @file $(CurrentFileName).$(CurrentFileExt)
-// @brief
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class MainFrame : public TopFrame
-{
-    public:
-        MainFrame(wxWindow *parent);
-        virtual ~MainFrame();
-
-        PlotSpectrum*           m_panelSpectrum;
-        PlotWaterfall*          m_panelWaterfall;
-        PlotScatter*            m_panelScatter;
-        PlotScalar*             m_panelTimeOffset;
-        PlotScalar*             m_panelFreqOffset;
-        PlotScalar*             m_panelSpeechIn;
-        PlotScalar*             m_panelSpeechOut;
-        PlotScalar*             m_panelDemodIn;
-        PlotScalar*             m_panelTestFrameErrors;
-        PlotScalar*             m_panelTestFrameErrorsHist;
-
-        bool                    m_RxRunning;
-
-        PortAudioWrap           *m_rxInPa;
-        PortAudioWrap           *m_rxOutPa;
-        PortAudioWrap           *m_txInPa;
-        PortAudioWrap           *m_txOutPa;
-
-        PaError                 m_rxErr;
-        PaError                 m_txErr;
-        
-        txRxThread*             m_txRxThread;
-
-        bool                    OpenHamlibRig();
-        void                    SetupSerialPort(void);
-        void                    CloseSerialPort(void);
-        void                    SerialPTTRx(void);
-
-        bool                    m_modal;
-
-#ifdef _USE_TIMER
-        wxTimer                 m_plotTimer;
-#endif
-
-    void destroy_fifos(void);
-    void destroy_src(void);
-    void autoDetectSoundCards(PortAudioWrap *pa);
-
-        static int rxCallback(
-                                const void *inBuffer,
-                                void *outBuffer,
-                                unsigned long framesPerBuffer,
-                                const PaStreamCallbackTimeInfo *outTime,
-                                PaStreamCallbackFlags statusFlags,
-                                void *userData
-                             );
-        static int txCallback(
-                                const void *inBuffer,
-                                void *outBuffer,
-                                unsigned long framesPerBuffer,
-                                const PaStreamCallbackTimeInfo *outTime,
-                                PaStreamCallbackFlags statusFlags,
-                                void *userData
-                             );
-
-
-    void initPortAudioDevice(PortAudioWrap *pa, int inDevice, int outDevice, 
-                             int soundCard, int sampleRate, int inputChannels);
-
-    void togglePTT(void);
-
-    wxIPV4address           m_udp_addr;
-    wxDatagramSocket       *m_udp_sock;
-    UDPThread              *m_UDPThread;
-    void                    startUDPThread(void);
-    void                    stopUDPThread(void);
-    int                     PollUDP();
-    bool                    m_schedule_restore;
-
-    protected:
-
-#ifdef _WIN32
-#define COM_HANDLE_INVALID                     INVALID_HANDLE_VALUE
-        com_handle_t  com_handle;
-#else
-#define COM_HANDLE_INVALID                     -1
-        com_handle_t  com_handle;
-#endif
-        void raiseDTR(void);
-        void lowerDTR(void);
-        void raiseRTS(void);
-        void lowerRTS(void);
-        bool openComPort(const char *port);
-        void closeComPort(void);
-
-        void setsnrBeta(bool snrSlow);
-
-        // protected event handlers
-        virtual void OnCloseFrame(wxCloseEvent& event);
-        void OnExitClick(wxCommandEvent& event);
-
-        void startTxStream();
-        void startRxStream();
-        void stopTxStream();
-        void stopRxStream();
-        void abortTxStream();
-        void abortRxStream();
-        
-        void OnTop(wxCommandEvent& event);
-        void OnExit( wxCommandEvent& event );
-
-        void OnToolsAudio( wxCommandEvent& event );
-        void OnToolsAudioUI( wxUpdateUIEvent& event );
-        void OnToolsComCfg( wxCommandEvent& event );
-        void OnToolsComCfgUI( wxUpdateUIEvent& event );
-        void OnToolsFilter( wxCommandEvent& event );
-        void OnToolsOptions(wxCommandEvent& event);
-        void OnToolsOptionsUI(wxUpdateUIEvent& event);
-
-        void OnPlayFileToMicIn( wxCommandEvent& event );
-        void OnRecFileFromRadio( wxCommandEvent& event );
-        void OnPlayFileFromRadio( wxCommandEvent& event );
-
-        void OnHelpCheckUpdates( wxCommandEvent& event );
-        void OnHelpCheckUpdatesUI( wxUpdateUIEvent& event );
-        void OnHelpAbout( wxCommandEvent& event );
-        void OnCmdSliderScroll( wxScrollEvent& event );
-//        void OnSliderScrollBottom( wxScrollEvent& event );
-//        void OnCmdSliderScrollChanged( wxScrollEvent& event );
-//        void OnSliderScrollTop( wxScrollEvent& event );
-        void OnCheckSQClick( wxCommandEvent& event );
-        void OnCheckSNRClick( wxCommandEvent& event );
-
-        // Toggle Buttons
-        void OnTogBtnSplitClick(wxCommandEvent& event);
-        void OnTogBtnAnalogClick(wxCommandEvent& event);
-        void OnTogBtnRxID( wxCommandEvent& event );
-        void OnTogBtnTxID( wxCommandEvent& event );
-        void OnTogBtnPTT( wxCommandEvent& event );
-        void OnTogBtnOnOff( wxCommandEvent& event );
-
-        void OnCallSignReset( wxCommandEvent& event );
-        void OnBerReset( wxCommandEvent& event );
-
-        //System Events
-        void OnPaint(wxPaintEvent& event);
-        void OnSize( wxSizeEvent& event );
-        void OnUpdateUI( wxUpdateUIEvent& event );
-        void OnDeleteConfig(wxCommandEvent&);
-#ifdef _USE_TIMER
-        void OnTimer(wxTimerEvent &evt);
-#endif
-#ifdef _USE_ONIDLE
-        void OnIdle(wxIdleEvent &evt);
-#endif
-
-    private:
-        bool        m_useMemory;
-        wxTextCtrl* m_tc;
-        int         m_zoom;
-        float       m_snrBeta;
-        
-        // Callsign/text messaging
-        char        m_callsign[MAX_CALLSIGN];
-        char       *m_pcallsign;
-        unsigned int m_checksumGood;
-        unsigned int m_checksumBad;
-        
-        // Events
-        void        processTxtEvent(char event[]);
-        class OptionsDlg *optionsDlg;
-        wxTimer     spamTimer[MAX_EVENT_RULES];
-
-        // level Gauge
-        float       m_maxLevel;
-        // flags to indicate when new EQ filters need to be designed
-
-        bool        m_newMicInFilter;
-        bool        m_newSpkOutFilter;
-
-        void*       designAnEQFilter(const char filterType[], float freqHz, float gaindB, float Q = 0.0);
-        void        designEQFilters(paCallBackData *cb);
-        void        deleteEQFilters(paCallBackData *cb);
-};
-
-void txRxProcessing();
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// class txRxThread - experimental tx/rx processing thread
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class txRxThread : public wxThread
-{
-public:
-    txRxThread(void) : wxThread(wxTHREAD_JOINABLE) { m_run = 1; }
-
-    // thread execution starts here
-    void *Entry() 
-    {
-        while (m_run) 
-        {
-            txRxProcessing();        
-            wxThread::Sleep(20);
-        }
-        return NULL;
-    }
-
-    // called when the thread exits - whether it terminates normally or is
-    // stopped with Delete() (but not when it is Kill()ed!)
-    void OnExit() { }
-
-public:
-    bool  m_run;
-};
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// class UDPThread - waits for UDP messages
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class UDPThread : public wxThread
-{
-public:
-    UDPThread(void) : wxThread(wxTHREAD_JOINABLE) { m_run = 1; }
-
-    // thread execution starts here
-    void *Entry();
-
-    // called when the thread exits - whether it terminates normally or is
-    // stopped with Delete() (but not when it is Kill()ed!)
-    void OnExit() { }
-
-public:
-    MainFrame              *mf;
-    bool                    m_run;
-};
-
-void resample_for_plot(struct FIFO *plotFifo, short buf[], int length, int fs);
-
-int resample(SRC_STATE *src,
-             short      output_short[],
-             short      input_short[],
-             int        output_sample_rate,
-             int        input_sample_rate,
-             int        length_output_short, // maximum output array length in samples
-             int        length_input_short
-             );
-void txRxProcessing();
-void per_frame_rx_processing(
-                                        FIFO    *output_fifo,   // decoded speech samples
-                                        FIFO    *input_fifo     // modem samples input to demod
-                                    );
-
-// FreeDv API calls this when there is a test frame that needs a-plottin'
-
-void my_freedv_put_error_pattern(void *state, short error_pattern[], int sz_error_pattern);
-
-// FreeDv API calls these puppies when it needs/receives a text char 
-
-char my_get_next_tx_char(void *callback_state);
-void my_put_next_rx_char(void *callback_state, char c);
-
-#endif //__FDMDV2_MAIN__
diff --git a/fdmdv2-dev/src/fdmdv2_pa_wrapper.cpp b/fdmdv2-dev/src/fdmdv2_pa_wrapper.cpp
deleted file mode 100644 (file)
index 2f67ca2..0000000
+++ /dev/null
@@ -1,324 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_pa_wrapper.cpp
-// Purpose:         Implements a wrapper class around the PortAudio library.
-// Created:         August 12, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#include "fdmdv2_pa_wrapper.h"
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// PortAudioWrap()
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-PortAudioWrap::PortAudioWrap()
-{
-    m_pStream                   = NULL;
-    m_pUserData                 = NULL;
-    m_samplerate                = 0;
-    m_framesPerBuffer           = 0;
-    m_statusFlags               = 0;
-    m_pStreamCallback           = NULL;
-    m_pStreamFinishedCallback   = NULL;
-    m_pTimeInfo                 = 0;
-    m_newdata                   = false;
-
-//    loadData();
-}
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// ~PortAudioWrap()
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-PortAudioWrap::~PortAudioWrap()
-{
-}
-
-//----------------------------------------------------------------
-// streamOpen()
-//----------------------------------------------------------------
-PaError PortAudioWrap::streamOpen()
-{
-    return Pa_OpenStream(
-                            &m_pStream,
-                            m_inputBuffer.device == paNoDevice ? NULL : &m_inputBuffer,
-                            m_outputBuffer.device == paNoDevice ? NULL : &m_outputBuffer,
-                            m_samplerate,
-                            m_framesPerBuffer,
-                            m_statusFlags,
-                            *m_pStreamCallback,
-                            m_pUserData
-                        );
-}
-
-//----------------------------------------------------------------
-// streamStart()
-//----------------------------------------------------------------
-PaError PortAudioWrap::streamStart()
-{
-    return Pa_StartStream(m_pStream);
-}
-
-//----------------------------------------------------------------
-// streamClose()
-//----------------------------------------------------------------
-PaError PortAudioWrap::streamClose()
-{
-    if(isOpen())
-    {
-        PaError rv = Pa_CloseStream(m_pStream);
-        return rv;
-    }
-    else
-    {
-        return paNoError;
-    }
-}
-
-//----------------------------------------------------------------
-// terminate()
-//----------------------------------------------------------------
-void PortAudioWrap::terminate()
-{
-    if(Pa_IsStreamStopped(m_pStream) != paNoError)
-    {
-        Pa_StopStream(m_pStream);
-    }
-    Pa_Terminate();
-}
-
-//----------------------------------------------------------------
-// stop()
-//----------------------------------------------------------------
-void PortAudioWrap::stop()
-{
-    Pa_StopStream(m_pStream);
-}
-
-//----------------------------------------------------------------
-// abort()
-//----------------------------------------------------------------
-void PortAudioWrap::abort()
-{
-    Pa_AbortStream(m_pStream);
-}
-
-//----------------------------------------------------------------
-// isStopped()
-//----------------------------------------------------------------
-bool PortAudioWrap::isStopped() const
-{
-    PaError ret = Pa_IsStreamStopped(m_pStream);
-    return ret;
-}
-
-//----------------------------------------------------------------
-// isActive()
-//----------------------------------------------------------------
-bool PortAudioWrap::isActive() const
-{
-    PaError ret = Pa_IsStreamActive(m_pStream);
-    return ret;
-}
-
-//----------------------------------------------------------------
-// isOpen()
-//----------------------------------------------------------------
-bool PortAudioWrap::isOpen() const
-{
-    return (m_pStream != NULL);
-}
-
-//----------------------------------------------------------------
-// getDefaultInputDevice()
-//----------------------------------------------------------------
-PaDeviceIndex PortAudioWrap::getDefaultInputDevice()
-{
-    return Pa_GetDefaultInputDevice();
-}
-
-//----------------------------------------------------------------
-// getDefaultOutputDevice()
-//----------------------------------------------------------------
-PaDeviceIndex PortAudioWrap::getDefaultOutputDevice()
-{
-    return Pa_GetDefaultOutputDevice();
-}
-
-//----------------------------------------------------------------
-// setInputChannelCount()
-//----------------------------------------------------------------
-PaError PortAudioWrap::setInputChannelCount(int count)
-{
-    m_inputBuffer.channelCount = count;
-    return paNoError;
-}
-
-//----------------------------------------------------------------
-// getInputChannelCount()
-//----------------------------------------------------------------
-PaError PortAudioWrap::getInputChannelCount()
-{
-    return m_inputBuffer.channelCount;
-}
-
-//----------------------------------------------------------------
-// setInputSampleFormat()
-//----------------------------------------------------------------
-PaError PortAudioWrap::setInputSampleFormat(PaSampleFormat format)
-{
-    m_inputBuffer.sampleFormat = format;
-    return paNoError;
-}
-
-//----------------------------------------------------------------
-// setInputLatency()
-//----------------------------------------------------------------
-PaError PortAudioWrap::setInputLatency(PaTime latency)
-{
-    m_inputBuffer.suggestedLatency = latency;
-    return paNoError;
-}
-
-//----------------------------------------------------------------
-// setInputHostApiStreamInfo()
-//----------------------------------------------------------------
-void PortAudioWrap::setInputHostApiStreamInfo(void *info)
-{
-    m_inputBuffer.hostApiSpecificStreamInfo = info;
-}
-
-//----------------------------------------------------------------
-// getInputDefaultLowLatency()
-//----------------------------------------------------------------
-PaTime  PortAudioWrap::getInputDefaultLowLatency()
-{
-    return Pa_GetDeviceInfo(m_inputBuffer.device)->defaultLowInputLatency;
-}
-
-//----------------------------------------------------------------
-// setOutputChannelCount()
-//----------------------------------------------------------------
-PaError PortAudioWrap::setOutputChannelCount(int count)
-{
-    m_outputBuffer.channelCount = count;
-    return paNoError;
-}
-
-//----------------------------------------------------------------
-// getOutputChannelCount()
-//----------------------------------------------------------------
-const int PortAudioWrap::getOutputChannelCount()
-{
-    return m_outputBuffer.channelCount;
-}
-
-//----------------------------------------------------------------
-// getDeviceName()
-//----------------------------------------------------------------
-const char *PortAudioWrap::getDeviceName(PaDeviceIndex dev)
-{
-    const PaDeviceInfo *info;
-    info = Pa_GetDeviceInfo(dev);
-    return info->name;
-}
-
-//----------------------------------------------------------------
-// setOutputSampleFormat()
-//----------------------------------------------------------------
-PaError PortAudioWrap::setOutputSampleFormat(PaSampleFormat format)
-{
-    m_outputBuffer.sampleFormat = format;
-    return paNoError;
-}
-
-//----------------------------------------------------------------
-// setOutputLatency()
-//----------------------------------------------------------------
-PaError PortAudioWrap::setOutputLatency(PaTime latency)
-{
-    m_outputBuffer.suggestedLatency = latency;
-    return paNoError;
-}
-
-//----------------------------------------------------------------
-// setOutputHostApiStreamInfo()
-//----------------------------------------------------------------
-void PortAudioWrap::setOutputHostApiStreamInfo(void *info)
-{
-    m_outputBuffer.hostApiSpecificStreamInfo = info;
-}
-
-//----------------------------------------------------------------
-// getOutputDefaultLowLatency()
-//----------------------------------------------------------------
-PaTime  PortAudioWrap::getOutputDefaultLowLatency()
-{
-    return Pa_GetDeviceInfo(m_outputBuffer.device)->defaultLowOutputLatency;
-}
-
-//----------------------------------------------------------------
-// setFramesPerBuffer()
-//----------------------------------------------------------------
-PaError PortAudioWrap::setFramesPerBuffer(unsigned long size)
-{
-    m_framesPerBuffer = size;
-    return paNoError;
-}
-
-//----------------------------------------------------------------
-// setSampleRate()
-//----------------------------------------------------------------
-PaError PortAudioWrap::setSampleRate(unsigned long rate)
-{
-    m_samplerate = rate;
-    return paNoError;
-}
-
-//----------------------------------------------------------------
-// setStreamFlags()
-//----------------------------------------------------------------
-PaError PortAudioWrap::setStreamFlags(PaStreamFlags flags)
-{
-    m_statusFlags = flags;
-    return paNoError;
-}
-
-//----------------------------------------------------------------
-// setInputDevice()
-//----------------------------------------------------------------
-PaError PortAudioWrap::setInputDevice(PaDeviceIndex index)
-{
-    m_inputBuffer.device = index;
-    return paNoError;
-}
-
-//----------------------------------------------------------------
-// setOutputDevice()
-//----------------------------------------------------------------
-PaError PortAudioWrap::setOutputDevice(PaDeviceIndex index)
-{
-    m_outputBuffer.device = index;
-    return paNoError;
-}
-
-//----------------------------------------------------------------
-// setCallback()
-//----------------------------------------------------------------
-PaError PortAudioWrap::setCallback(PaStreamCallback *callback)
-{
-    m_pStreamCallback = callback;
-    return paNoError;
-}
-
diff --git a/fdmdv2-dev/src/fdmdv2_pa_wrapper.h b/fdmdv2-dev/src/fdmdv2_pa_wrapper.h
deleted file mode 100644 (file)
index 3d216c0..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_pa_wrapper.h
-// Purpose:         Defines a wrapper class around PortAudio
-// Created:         August 12, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#include <stdio.h>
-#include <math.h>
-#include "fdmdv2_defines.h"
-#include "codec2_fdmdv.h"
-#include "codec2.h"
-#include "portaudio.h"
-
-#define PA_SAMPLE_TYPE      paInt16         //paFloat32
-#define FRAMES_PER_BUFFER   (64)
-
-typedef float SAMPLE;
-
-class PortAudioWrap
-{
-    public:
-        PortAudioWrap();
-        ~PortAudioWrap();
-
-//        float                           m_av_mag[FDMDV_NSPEC];
-
-    private:
-        PaStream                        *m_pStream;
-        void                            *m_pUserData;
-        PaStreamCallback                *m_pStreamCallback;
-        PaStreamFinishedCallback        *m_pStreamFinishedCallback;
-        const PaStreamCallbackTimeInfo  *m_pTimeInfo;
-        struct FDMDV                    *m_pFDMDV_state;
-        PaStreamParameters              m_inputBuffer;
-        PaStreamParameters              m_outputBuffer;
-        int                             m_samplerate;
-        unsigned long                   m_framesPerBuffer;
-        PaStreamCallbackFlags           m_statusFlags;
-        bool                            m_newdata;
-
-    public:
-
-        void                averageData(float mag_dB[]);
-
-        int                 getDeviceCount() { return Pa_GetDeviceCount(); }
-        PaDeviceIndex       getDefaultInputDevice();
-        PaDeviceIndex       getDefaultOutputDevice();
-        PaStreamParameters  *getDeviceInfo(PaDeviceIndex idx);
-
-        PaError             setFramesPerBuffer(unsigned long size);
-        PaError             setSampleRate(unsigned long size);
-
-        PaError             setStreamFlags(PaStreamFlags flags);
-        PaError             setCallback(PaStreamCallback *m_pStreamCallback);
-        PaError             setStreamCallback(PaStream *stream, PaStreamCallback* callback) { m_pStreamCallback = callback; return 0;}
-        PaError             setStreamFinishedCallback(PaStream *stream, PaStreamFinishedCallback* m_pStreamFinishedCallback);
-
-        void                setInputBuffer(const PaStreamParameters& inputBuffer)   {this->m_inputBuffer = inputBuffer;}
-        PaError             setInputDevice(PaDeviceIndex dev);
-        PaError             setInputChannelCount(int count);
-        int                 getInputChannelCount();
-        PaError             setInputSampleFormat(PaSampleFormat format);
-        PaError             setInputSampleRate(PaSampleFormat format);
-        PaError             setInputLatency(PaTime latency);
-        void                setInputHostApiStreamInfo(void *info = NULL);
-        PaTime              getInputDefaultLowLatency();
-        const char          *getDeviceName(PaDeviceIndex dev);
-
-        PaError             setOutputDevice(PaDeviceIndex dev);
-        PaError             setOutputChannelCount(int count);
-        const int           getOutputChannelCount();
-        PaError             setOutputSampleFormat(PaSampleFormat format);
-        PaError             setOutputLatency(PaTime latency);
-        void                setOutputHostApiStreamInfo(void *info = NULL);
-        PaTime              getOutputDefaultLowLatency();
-
-        void                setFdmdvState(FDMDV* fdmdv_state)                       {this->m_pFDMDV_state = fdmdv_state;}
-        void                setOutputBuffer(const PaStreamParameters& outputBuffer) {this->m_outputBuffer = outputBuffer;}
-        void                setTimeInfo(PaStreamCallbackTimeInfo* timeInfo)         {this->m_pTimeInfo = timeInfo;}
-        void                setUserData(void* userData)                             {this->m_pUserData = userData;}
-        unsigned long       getFramesPerBuffer() const                              {return m_framesPerBuffer;}
-        const               PaStreamParameters& getInputBuffer() const              {return m_inputBuffer;}
-        const               PaStreamParameters& getOutputBuffer() const             {return m_outputBuffer;}
-        const               PaStreamCallbackFlags& getStatusFlags() const           {return m_statusFlags;}
-
-        FDMDV*              getFdmdvState()                                         {return m_pFDMDV_state;}
-        int                 getSamplerate() const                                   {return m_samplerate;}
-        PaStream*           getStream()                                             {return m_pStream;}
-        void                *getUserData()                                          {return m_pUserData;}
-        bool                getDataAvail()                                          {return m_newdata;}
-        PaError             streamStart();
-        PaError             streamClose();
-        PaError             streamOpen();
-        void                terminate();
-        void                stop();
-        void                abort();
-        bool                isOpen() const;
-        bool                isStopped() const;
-        bool                isActive() const;
-//        void                loadData();
-};
diff --git a/fdmdv2-dev/src/fdmdv2_plot.cpp b/fdmdv2-dev/src/fdmdv2_plot.cpp
deleted file mode 100644 (file)
index 1b85cd9..0000000
+++ /dev/null
@@ -1,283 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_plot.cpp
-// Purpose:         Implements simple wxWidgets application with GUI.
-// Created:         Apr. 9, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#include <string.h>
-#include "fdmdv2_plot.h"
-
-BEGIN_EVENT_TABLE(PlotPanel, wxPanel)
-    EVT_PAINT           (PlotPanel::OnPaint)
-    EVT_MOTION          (PlotPanel::OnMouseMove)
-    EVT_LEFT_DOWN       (PlotPanel::OnMouseLeftDown)
-    EVT_LEFT_UP         (PlotPanel::OnMouseLeftUp)
-    EVT_RIGHT_DOWN      (PlotPanel::OnMouseRightDown)
-    EVT_MOUSEWHEEL      (PlotPanel::OnMouseWheelMoved)
-    EVT_SIZE            (PlotPanel::OnSize)
-    EVT_SHOW            (PlotPanel::OnShow)
-END_EVENT_TABLE()
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class PlotPanel(wxFrame* parent) : wxPanel(parent)
-//
-// @class $(Name)
-// @author $(User)
-// @date $(Date)
-// @file $(CurrentFileName).$(CurrentFileExt)
-// @brief
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-PlotPanel::PlotPanel(wxFrame* parent) : wxPanel(parent)
-{
-    m_pNoteBook         = (wxAuiNotebook *) parent;
-    m_pTopFrame         = (MainFrame *)m_pNoteBook->GetParent();
-    m_zoomFactor        = 1.0;
-    m_pBmp              = NULL;
-    m_pPix              = NULL;
-    m_firstPass         = true;
-    m_line_color        = 0;
-    m_newdata           = false;
-    m_clip              = false;
-    m_use_bitmap        = true;
-    m_rubberBand        = false;
-    m_mouseDown         = false;
-    m_penShortDash      = wxPen(wxColor(0xA0, 0xA0, 0xA0), 1, wxPENSTYLE_SHORT_DASH);
-    m_penDotDash        = wxPen(wxColor(0xD0, 0xD0, 0xD0), 1, wxPENSTYLE_DOT_DASH);
-    m_penSolid          = wxPen(wxColor(0x00, 0x00, 0x00), 1, wxPENSTYLE_SOLID);
-    SetBackgroundStyle(wxBG_STYLE_PAINT);
-    SetLabelSize(10.0);
-}
-
-//-------------------------------------------------------------------------
-// ~PlotPanel()
-//-------------------------------------------------------------------------
-PlotPanel::~PlotPanel()
-{
-    if(m_pBmp != NULL)
-    {
-        delete m_pBmp;
-    }
-}
-
-//-------------------------------------------------------------------------
-// GetLabelSize()
-//-------------------------------------------------------------------------
-double PlotPanel::GetLabelSize()
-{
-    return m_label_size;
-}
-
-//-------------------------------------------------------------------------
-// SetLabelSize()
-//-------------------------------------------------------------------------
-void PlotPanel::SetLabelSize(double size)
-{
-    m_label_size = size;
-}
-
-//-------------------------------------------------------------------------
-// OnShow()
-//-------------------------------------------------------------------------
-void PlotPanel::OnShow(wxShowEvent& event)
-{
-    this->Refresh();
-}
-
-//-------------------------------------------------------------------------
-// OnErase()
-//-------------------------------------------------------------------------
-void PlotPanel::OnErase(wxEraseEvent& event)
-{
-    event.Skip();
-}
-
-//-------------------------------------------------------------------------
-// OnSize()
-//-------------------------------------------------------------------------
-void PlotPanel::OnSize(wxSizeEvent& event)
-{
-    m_rCtrlPrev = m_rCtrl;
-    m_rCtrl     = GetClientRect();
-    if(m_use_bitmap)
-    {
-        if(!m_oImage.IsOk())
-        {
-            m_oImage.Create(m_rCtrl.GetWidth(), m_rCtrl.GetHeight(), true);
-        }
-        else
-        {
-            m_oImage.Rescale(m_rCtrl.GetWidth(), m_rCtrl.GetHeight());
-        }
-        m_pBmp = new wxBitmap(m_oImage, wxBITMAP_SCREEN_DEPTH);
-        m_firstPass = true;
-    }
-    this->Refresh();
-}
-
-//-------------------------------------------------------------------------
-// OnMouseMove()
-//-------------------------------------------------------------------------
-void PlotPanel::OnMouseMove(wxMouseEvent& event)
-{
-//    if(m_mouseDown)
-//    {
-//        paintNow();
-//    }
-}
-
-//-------------------------------------------------------------------------
-// OnMouseLeftDown()
-//-------------------------------------------------------------------------
-void PlotPanel::OnMouseLeftDown(wxMouseEvent& event)
-{
-}
-
-//-------------------------------------------------------------------------
-// OnMouseRightDown()
-//-------------------------------------------------------------------------
-void PlotPanel::OnMouseRightDown(wxMouseEvent& event)
-{
-}
-
-//-------------------------------------------------------------------------
-// OnMouseWheelMoved()
-//-------------------------------------------------------------------------
-void PlotPanel::OnMouseWheelMoved(wxMouseEvent& event)
-{
-}
-
-//-------------------------------------------------------------------------
-// OnMouseLeftUp()
-//-------------------------------------------------------------------------
-void PlotPanel::OnMouseLeftUp(wxMouseEvent& event)
-{
-    m_mouseDown = false;
-}
-
-//-------------------------------------------------------------------------
-// SetZoomFactor()
-//-------------------------------------------------------------------------
-double PlotPanel::SetZoomFactor(double zf)
-{
-    if((zf > 0) && (zf < 5.0))
-    {
-        m_zoomFactor = zf;
-    }
-    return zf;
-}
-
-//-------------------------------------------------------------------------
-// GetZoomFactor()
-//-------------------------------------------------------------------------
-double PlotPanel::GetZoomFactor(double zf)
-{
-    return m_zoomFactor;
-}
-
-//-------------------------------------------------------------------------
-// draw()
-//-------------------------------------------------------------------------
-void PlotPanel::draw(wxAutoBufferedPaintDC& pDC)
-{
-    printf("PlotPanel::draw()");
-    wxMemoryDC m_mDC;
-    m_mDC.SelectObject(*m_pBmp);
-    m_rCtrl  = GetClientRect();
-    m_rGrid  = m_rCtrl;
-
-    m_rGrid = m_rGrid.Deflate(PLOT_BORDER + (XLEFT_OFFSET/2), (PLOT_BORDER + (YBOTTOM_OFFSET/2)));
-    m_rGrid.Offset(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER);
-
-    pDC.Clear();
-    m_rPlot = wxRect(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER, m_rGrid.GetWidth(), m_rGrid.GetHeight());
-    if(m_firstPass)
-    {
-        m_firstPass = false;
-        m_mDC.FloodFill(0, 0, VERY_LTGREY_COLOR);
-
-        // Draw a filled rectangle with aborder
-        wxBrush ltGraphBkgBrush = wxBrush(DARK_BLUE_COLOR);
-        m_mDC.SetBrush(ltGraphBkgBrush);
-        m_mDC.SetPen(wxPen(BLACK_COLOR, 0));
-        m_mDC.DrawRectangle(m_rPlot);
-    }
-    if(m_newdata)
-    {
-        m_newdata = false;
-        int t = m_rPlot.GetTop();
-        int l = m_rPlot.GetLeft();
-//        int r = m_rPlot.GetRight();
-        int h = m_rPlot.GetHeight();
-        int w = m_rPlot.GetWidth();
-        pDC.Blit(l, t, w, h, &m_mDC, l, t);
-    }
-    drawGraticule(pDC);
-    m_mDC.SetBrush(wxNullBrush);
-    m_mDC.SelectObject(wxNullBitmap);
-}
-
-//-------------------------------------------------------------------------
-// drawGraticule()
-//-------------------------------------------------------------------------
-void PlotPanel::drawGraticule(wxAutoBufferedPaintDC& pDC)
-{
-    int p;
-    char buf[15];
-    wxString s;
-
-    // Vertical gridlines
-    pDC.SetPen(m_penShortDash);
-    for(p = (PLOT_BORDER + XLEFT_OFFSET + GRID_INCREMENT); p < ((m_rGrid.GetWidth() - XLEFT_OFFSET) + GRID_INCREMENT); p += GRID_INCREMENT)
-    {
-        pDC.DrawLine(p, (m_rGrid.GetHeight() + PLOT_BORDER), p, PLOT_BORDER);
-    }
-    // Horizontal gridlines
-    pDC.SetPen(m_penDotDash);
-    for(p = (m_rGrid.GetHeight() - GRID_INCREMENT); p > PLOT_BORDER; p -= GRID_INCREMENT)
-    {
-        pDC.DrawLine(PLOT_BORDER + XLEFT_OFFSET, (p + PLOT_BORDER), (m_rGrid.GetWidth() + PLOT_BORDER + XLEFT_OFFSET), (p + PLOT_BORDER));
-    }
-    // Label the X-Axis
-    pDC.SetPen(wxPen(GREY_COLOR, 1));
-    for(p = GRID_INCREMENT; p < (m_rGrid.GetWidth() - YBOTTOM_OFFSET); p += GRID_INCREMENT)
-    {
-        sprintf(buf, "%1.1f Hz",(double)(p / 10));
-        pDC.DrawText(buf, p - PLOT_BORDER + XLEFT_OFFSET, m_rGrid.GetHeight() + YBOTTOM_OFFSET/2);
-    }
-    // Label the Y-Axis
-    //for(p = GRID_INCREMENT; p < (h - YBOTTOM_OFFSET); p += GRID_INCREMENT)
-    for(p = (m_rGrid.GetHeight() - GRID_INCREMENT); p > PLOT_BORDER; p -= GRID_INCREMENT)
-    {
-        sprintf(buf, "%1.0f", (double)((m_rGrid.GetHeight() - p) * -10));
-        pDC.DrawText(buf, XLEFT_TEXT_OFFSET, p);
-    }
-}
-
-//-------------------------------------------------------------------------
-// paintEvent()
-//
-// Called by the system of by wxWidgets when the panel needs
-// to be redrawn. You can also trigger this call by calling
-// Refresh()/Update().
-//-------------------------------------------------------------------------
-void PlotPanel::OnPaint(wxPaintEvent & evt)
-{
-    wxAutoBufferedPaintDC pdc(this);
-    draw(pdc);
-}
-
diff --git a/fdmdv2-dev/src/fdmdv2_plot.h b/fdmdv2-dev/src/fdmdv2_plot.h
deleted file mode 100644 (file)
index 25309d3..0000000
+++ /dev/null
@@ -1,150 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_plot.h
-// Purpose:         Declares simple wxWidgets application with GUI
-// Created:         Apr. 10, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-//#include "fdmdv2_main.h"
-#ifndef __FDMDV2_PLOT__
-#define __FDMDV2_PLOT__
-#include <wx/wx.h>
-#include <wx/aui/auibook.h>
-#include <wx/rawbmp.h>
-#include <wx/image.h>
-#include <wx/dcbuffer.h>
-
-#define MAX_ZOOM            7
-#define MAX_BMP_X           (400 * MAX_ZOOM)
-#define MAX_BMP_Y           (400 * MAX_ZOOM)
-#define DATA_LINE_HEIGHT    10
-#define TEXT_BASELINE_OFFSET_Y  -5
-
-
-#define wxUSE_FILEDLG       1
-#define wxUSE_LIBPNG        1
-#define wxUSE_LIBJPEG       1
-#define wxUSE_GIF           1
-#define wxUSE_PCX           1
-#define wxUSE_LIBTIFF       1
-
-#define PLOT_BORDER         12
-#define XLEFT_OFFSET        40
-#define XLEFT_TEXT_OFFSET   6
-#define YBOTTOM_OFFSET      20
-#define YBOTTOM_TEXT_OFFSET 15
-#define GRID_INCREMENT      50
-
-#define BLACK_COLOR         wxColor(0x00, 0x00, 0x00)
-#define GREY_COLOR          wxColor(0x80, 0x80, 0x80)
-#define DARK_GREY_COLOR     wxColor(0x40, 0x40, 0x40)
-#define MEDIUM_GREY_COLOR   wxColor(0xC0, 0xC0, 0xC0)
-#define LIGHT_GREY_COLOR    wxColor(0xE0, 0xE0, 0xE0)
-#define VERY_LTGREY_COLOR   wxColor(0xF8, 0xF8, 0xF8)
-#define WHITE_COLOR         wxColor(0xFF, 0xFF, 0xFF)
-
-#define DARK_BLUE_COLOR     wxColor(0x00, 0x00, 0x60)
-#define BLUE_COLOR          wxColor(0x00, 0x00, 0xFF)
-#define LIGHT_BLUE_COLOR    wxColor(0x80, 0x80, 0xFF)
-
-#define RED_COLOR           wxColor(0xFF, 0x5E, 0x5E)
-#define LIGHT_RED_COLOR     wxColor(0xFF, 0xE0, 0xE0)
-#define DARK_RED_COLOR      wxColor(0xFF, 0x00, 0x00)
-#define PINK_COLOR          wxColor(0xFF, 0x80, 0xFF)
-
-#define LIGHT_GREEN_COLOR   wxColor(0xE3, 0xFF, 0xE0)
-#define GREEN_COLOR         wxColor(0x95, 0xFF, 0x8A)
-#define DARK_GREEN_COLOR    wxColor(0x20, 0xFF, 0x08)
-#define VERY_GREEN_COLOR    wxColor(0x00, 0xFF, 0x00)
-
-#define YELLOW_COLOR        wxColor(0xFF, 0xFF, 0x5E)
-#define LIGHT_YELLOW_COLOR  wxColor(0xFF, 0xFF, 0xB5)
-#define DARK_YELLOW_COLOR   wxColor(0xFF, 0xFF, 0x08)
-
-class MainFrame;
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class PlotPanel
-//
-// @class $(Name)
-// @author $(User)
-// @date $(Date)
-// @file $(CurrentFileName).$(CurrentFileExt)
-// @brief
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class PlotPanel : public wxPanel
-{
-    public:
-        PlotPanel(wxFrame* parent);
-        ~PlotPanel();
-        wxPen               m_penShortDash;
-        wxPen               m_penDotDash;
-        wxPen               m_penSolid;
-        wxRect              m_rCtrlPrev;
-        wxRect              m_rCtrl;
-        wxRect              m_rGrid;
-        wxRect              m_rPlot;
-        MainFrame           *m_pTopFrame;
-        wxAuiNotebook       *m_pNoteBook;
-        double              m_label_size;
-        wxSize              m_Bufsz;
-        bool                m_newdata;
-        wxImage             m_oImage;
-        wxBitmap            *m_pBmp;
-        wxNativePixelData   *m_pPix;
-
-        // some useful events
-        void            OnMouseMove(wxMouseEvent& event);
-        virtual void    OnMouseLeftDown(wxMouseEvent& event);
-        void            OnMouseLeftUp(wxMouseEvent& event);
-        virtual void    OnMouseRightDown(wxMouseEvent& event);
-        void            OnMouseWheelMoved(wxMouseEvent& event);
-        void            OnClose(wxCloseEvent& event ){ event.Skip(); }
-        void            OnSize( wxSizeEvent& event );
-        void            OnErase(wxEraseEvent& event);
-        void            OnPaint(wxPaintEvent& event);
-        //void OnUpdateUI( wxUpdateUIEvent& event ){ event.Skip(); }
-
-        void            paintEvent(wxPaintEvent & evt);
-        virtual void    draw(wxAutoBufferedPaintDC&  pdc);
-        virtual void    drawGraticule(wxAutoBufferedPaintDC&  pdc);
-        virtual double  SetZoomFactor(double zf);
-        virtual double  GetZoomFactor(double zf);
-        virtual void    OnShow(wxShowEvent& event);
-        virtual double  GetLabelSize();
-        virtual void    SetLabelSize(double size);
-
-    protected:
-        int             m_x;
-        int             m_y;
-        int             m_left;
-        int             m_top;
-        int             m_prev_w;
-        int             m_prev_h;
-        int             m_prev_x;
-        int             m_prev_y;
-        bool            m_use_bitmap;
-        bool            m_clip;
-        bool            m_rubberBand;
-        bool            m_mouseDown;
-        bool            m_firstPass;
-        double          m_zoomFactor;
-        int             m_greyscale;
-        int             m_line_color;
-    DECLARE_EVENT_TABLE()
-};
-#endif //__FDMDV2_PLOT__
diff --git a/fdmdv2-dev/src/fdmdv2_plot_scalar.cpp b/fdmdv2-dev/src/fdmdv2_plot_scalar.cpp
deleted file mode 100644 (file)
index 7a07f46..0000000
+++ /dev/null
@@ -1,281 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_plot_scalar.cpp
-// Purpose:         Plots scalar amplitude against time
-// Created:         June 22, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#include <string.h>
-#include "wx/wx.h"
-#include "fdmdv2_main.h"
-#include "fdmdv2_plot_scalar.h"
-
-BEGIN_EVENT_TABLE(PlotScalar, PlotPanel)
-    EVT_PAINT           (PlotScalar::OnPaint)
-    EVT_MOTION          (PlotScalar::OnMouseMove)
-    EVT_MOUSEWHEEL      (PlotScalar::OnMouseWheelMoved)
-    EVT_SIZE            (PlotScalar::OnSize)
-    EVT_SHOW            (PlotScalar::OnShow)
-//    EVT_ERASE_BACKGROUND(PlotScalar::OnErase)
-END_EVENT_TABLE()
-
-//----------------------------------------------------------------
-// PlotScalar()
-//----------------------------------------------------------------
-PlotScalar::PlotScalar(wxFrame* parent, 
-                       int    channels,           // number on channels to plot
-                      float  t_secs,             // time covered by entire x axis in seconds
-                      float  sample_period_secs, // time between each sample in seconds
-                      float  a_min,              // min ampltude of samples being plotted
-                      float  a_max,              // max ampltude of samples being plotted
-                      float  graticule_t_step,   // time step of x (time) axis graticule in seconds
-                      float  graticule_a_step,   // step of amplitude axis graticule
-                      const char a_fmt[],        // printf format string for amplitude axis labels
-                       int    mini                // true for mini-plot - don't draw graticule
-                      ): PlotPanel(parent)
-{
-    int i;
-
-    m_rCtrl = GetClientRect();
-
-    m_channels = channels;
-    m_t_secs = t_secs;
-    m_sample_period_secs = sample_period_secs;
-    m_a_min = a_min;
-    m_a_max = a_max;
-    m_graticule_t_step = graticule_t_step;
-    m_graticule_a_step = graticule_a_step;
-    assert(strlen(a_fmt) < 15);
-    strcpy(m_a_fmt, a_fmt);
-    m_mini = mini;
-
-    // work out number of samples we will store and allocate storage
-
-    m_samples = m_t_secs/m_sample_period_secs;
-    m_mem = new float[m_samples*m_channels];
-
-    for(i = 0; i < m_samples*m_channels; i++)
-    {
-        m_mem[i] = 0.0;
-    }
-}
-
-//----------------------------------------------------------------
-// ~PlotScalar()
-//----------------------------------------------------------------
-PlotScalar::~PlotScalar()
-{
-    delete m_mem;
-}
-
-//----------------------------------------------------------------
-// add_new_sample()
-//----------------------------------------------------------------
-void PlotScalar::add_new_sample(int channel, float sample)
-{
-    int i;
-    int offset = channel*m_samples;
-
-    assert(channel < m_channels);
-
-    for(i = 0; i < m_samples-1; i++)
-    {
-        m_mem[offset+i] = m_mem[offset+i+1];
-    }
-    m_mem[offset+m_samples-1] = sample;
-}
-
-//----------------------------------------------------------------
-// add_new_samples()
-//----------------------------------------------------------------
-void  PlotScalar::add_new_short_samples(int channel, short samples[], int length, float scale_factor)
-{
-    int i;
-    int offset = channel*m_samples;
-
-    assert(channel < m_channels);
-
-    for(i = 0; i < m_samples-length; i++)
-        m_mem[offset+i] = m_mem[offset+i+length];
-    for(; i < m_samples; i++)
-       m_mem[offset+i] = (float)*samples++/scale_factor;
-}
-
-//----------------------------------------------------------------
-// draw()
-//----------------------------------------------------------------
-void PlotScalar::draw(wxAutoBufferedPaintDC&  dc)
-{
-    float index_to_px;
-    float a_to_py;
-    int   i;
-    int   x, y;
-    int   prev_x, prev_y;
-    float a;
-
-    m_rCtrl = GetClientRect();
-    m_rGrid = m_rCtrl;
-    if (!m_mini)
-        m_rGrid = m_rGrid.Deflate(PLOT_BORDER + (XLEFT_OFFSET/2), (PLOT_BORDER + (YBOTTOM_OFFSET/2)));
-
-    //printf("h %d w %d\n", m_rCtrl.GetWidth(), m_rCtrl.GetHeight());
-    //printf("h %d w %d\n", m_rGrid.GetWidth(), m_rGrid.GetHeight());
-
-    // black background
-
-    dc.Clear();
-    if (m_mini)
-        m_rPlot = wxRect(0, 0, m_rGrid.GetWidth(), m_rGrid.GetHeight());        
-    else
-        m_rPlot = wxRect(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER, m_rGrid.GetWidth(), m_rGrid.GetHeight());
-   
-    wxBrush ltGraphBkgBrush = wxBrush(BLACK_COLOR);
-    dc.SetBrush(ltGraphBkgBrush);
-    dc.SetPen(wxPen(BLACK_COLOR, 0));
-    dc.DrawRectangle(m_rPlot);
-
-    index_to_px = (float)m_rGrid.GetWidth()/m_samples;
-    a_to_py = (float)m_rGrid.GetHeight()/(m_a_max - m_a_min);
-
-    wxPen pen;
-    pen.SetColour(DARK_GREEN_COLOR);
-    pen.SetWidth(1);
-    dc.SetPen(pen);
-
-    // draw all samples
-
-    prev_x = prev_y = 0; // stop warning
-
-    // plot each channel 
-
-    int offset;
-    for(offset=0; offset<m_channels*m_samples; offset+=m_samples) {
-
-        for(i = 0; i < m_samples; i++) {
-            x = index_to_px * i;
-            a = m_mem[offset+i];
-            if (a < m_a_min) a = m_a_min;
-            if (a > m_a_max) a = m_a_max;
-
-            // invert y axis and offset by minimum
-
-            y = m_rGrid.GetHeight() - a_to_py * a + m_a_min*a_to_py;
-
-            // put inside plot window
-
-            if (!m_mini) {
-                x += PLOT_BORDER + XLEFT_OFFSET;
-                y += PLOT_BORDER;
-            }
-
-            if (i)
-                dc.DrawLine(x, y, prev_x, prev_y);
-            prev_x = x; prev_y = y;
-        }
-    }
-
-    drawGraticule(dc);
-}
-
-//-------------------------------------------------------------------------
-// drawGraticule()
-//-------------------------------------------------------------------------
-void PlotScalar::drawGraticule(wxAutoBufferedPaintDC&  dc)
-{
-    float    t, a;
-    int      x, y, text_w, text_h;
-    char     buf[15];
-    wxString s;
-    float    sec_to_px;
-    float    a_to_py;
-
-    wxBrush ltGraphBkgBrush;
-    ltGraphBkgBrush.SetStyle(wxBRUSHSTYLE_TRANSPARENT);
-    ltGraphBkgBrush.SetColour(*wxBLACK);
-    dc.SetBrush(ltGraphBkgBrush);
-    dc.SetPen(wxPen(BLACK_COLOR, 1));
-
-    sec_to_px = (float)m_rGrid.GetWidth()/m_t_secs;
-    a_to_py = (float)m_rGrid.GetHeight()/(m_a_max - m_a_min);
-
-    // upper LH coords of plot area are (PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER)
-    // lower RH coords of plot area are (PLOT_BORDER + XLEFT_OFFSET + m_rGrid.GetWidth(), 
-    //                                   PLOT_BORDER + m_rGrid.GetHeight())
-
-    // Vertical gridlines
-
-    dc.SetPen(m_penShortDash);
-    for(t=0; t<=m_t_secs; t+=m_graticule_t_step) {
-       x = t*sec_to_px;
-       if (m_mini) {
-            dc.DrawLine(x, m_rGrid.GetHeight(), x, 0);
-        }
-        else {
-            x += PLOT_BORDER + XLEFT_OFFSET;
-            dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, PLOT_BORDER);
-        }
-        if (!m_mini) {
-            sprintf(buf, "%2.1fs", t);
-            GetTextExtent(buf, &text_w, &text_h);
-            dc.DrawText(buf, x - text_w/2, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET);
-        }
-    }
-
-    // Horizontal gridlines
-
-    dc.SetPen(m_penDotDash);
-    for(a=m_a_min; a<m_a_max; a+=m_graticule_a_step) {
-       y = m_rGrid.GetHeight() - a*a_to_py + m_a_min*a_to_py;
-       if (m_mini) {
-            dc.DrawLine(0, y, m_rGrid.GetWidth(), y);
-        }
-        else {
-            y += PLOT_BORDER;
-            dc.DrawLine(PLOT_BORDER + XLEFT_OFFSET, y, 
-                        (m_rGrid.GetWidth() + PLOT_BORDER + XLEFT_OFFSET), y);
-        }
-        if (!m_mini) {
-            sprintf(buf, m_a_fmt, a);
-            GetTextExtent(buf, &text_w, &text_h);
-            dc.DrawText(buf, PLOT_BORDER + XLEFT_OFFSET - text_w - XLEFT_TEXT_OFFSET, y-text_h/2);
-        }
-   }
-
-
-}
-
-//----------------------------------------------------------------
-// OnPaint()
-//----------------------------------------------------------------
-void PlotScalar::OnPaint(wxPaintEvent& event)
-{
-    wxAutoBufferedPaintDC dc(this);
-    draw(dc);
-}
-
-//----------------------------------------------------------------
-// OnSize()
-//----------------------------------------------------------------
-void PlotScalar::OnSize(wxSizeEvent& event)
-{
-}
-
-//----------------------------------------------------------------
-// OnShow()
-//----------------------------------------------------------------
-void PlotScalar::OnShow(wxShowEvent& event)
-{
-}
diff --git a/fdmdv2-dev/src/fdmdv2_plot_scalar.h b/fdmdv2-dev/src/fdmdv2_plot_scalar.h
deleted file mode 100644 (file)
index 7043987..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_plot_scalar.h
-// Purpose:         Defines a scalar plot derivative of fdmdv2_plot.
-// Created:         June 22, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#ifndef __FDMDV2_PLOT_SCALAR__
-#define __FDMDV2_PLOT_SCALAR__
-
-#include "fdmdv2_plot.h"
-#include "fdmdv2_defines.h"
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class PlotScalar
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class PlotScalar: public PlotPanel
-{
-    public:
-
-    PlotScalar(wxFrame* parent,
-               int   channels,
-              float t_secs, 
-              float sample_period_secs,
-              float a_min,
-              float a_max,
-              float graticule_t_step,   
-              float graticule_a_step,
-              const char  a_fmt[],
-               int   mini
-              );
-        ~PlotScalar();
-         void add_new_sample(int channel, float sample);
-         void add_new_short_samples(int channel, short samples[], int length, float scale_factor);
-
-    protected:
-
-         int      m_channels;
-        float    m_t_secs;
-        float    m_sample_period_secs;
-        float    m_a_min;
-        float    m_a_max;
-        float    m_graticule_t_step;   
-        float    m_graticule_a_step;
-        char     m_a_fmt[15];
-         int      m_mini;
-        int      m_samples;
-        float   *m_mem;              
-
-        void draw(wxAutoBufferedPaintDC&  dc);
-       void drawGraticule(wxAutoBufferedPaintDC&  dc);
-        void OnPaint(wxPaintEvent& event);
-        void OnSize(wxSizeEvent& event);
-        void OnShow(wxShowEvent& event);
-
-        DECLARE_EVENT_TABLE()
-};
-
-#endif // __FDMDV2_PLOT_SCALAR__
-
diff --git a/fdmdv2-dev/src/fdmdv2_plot_scatter.cpp b/fdmdv2-dev/src/fdmdv2_plot_scatter.cpp
deleted file mode 100644 (file)
index 3c0b155..0000000
+++ /dev/null
@@ -1,199 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_plot_scatter.cpp
-// Purpose:         A scatter plot derivative of fdmdv2_plot.
-// Created:         June 24, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#include <string.h>
-#include "wx/wx.h"
-#include "fdmdv2_plot_scatter.h"
-
-BEGIN_EVENT_TABLE(PlotScatter, PlotPanel)
-    EVT_PAINT           (PlotScatter::OnPaint)
-    EVT_MOTION          (PlotScatter::OnMouseMove)
-    EVT_MOUSEWHEEL      (PlotScatter::OnMouseWheelMoved)
-    EVT_SIZE            (PlotScatter::OnSize)
-    EVT_SHOW            (PlotScatter::OnShow)
-//    EVT_ERASE_BACKGROUND(PlotScatter::OnErase)
-END_EVENT_TABLE()
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// PlotScatter
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-PlotScatter::PlotScatter(wxFrame* parent) : PlotPanel(parent)
-{
-    int i;
-
-    for(i=0; i < SCATTER_MEM_SYMS_MAX; i++)
-    {
-        m_mem[i].real = 0.0;
-        m_mem[i].imag = 0.0;
-    }
-
-    m_filter_max_xy = 0.1;
-
-    // defaults so we start off with something sensible
-
-    Nsym = 14+1;
-    scatterMemSyms = ((int)(SCATTER_MEM_SECS*(Nsym/DT)));
-    assert(scatterMemSyms <= SCATTER_MEM_SYMS_MAX);
-        
-}
-
-// changing number of carriers changes number of symbols to plot
-void PlotScatter::setNc(int Nc) {
-    Nsym = Nc+1;
-    assert(Nsym <= (FDMDV_NC_MAX+1));
-    scatterMemSyms = ((int)(SCATTER_MEM_SECS*(Nsym/DT)));
-    assert(scatterMemSyms <= SCATTER_MEM_SYMS_MAX);
-}
-
-//----------------------------------------------------------------
-// draw()
-//----------------------------------------------------------------
-void PlotScatter::draw(wxAutoBufferedPaintDC& dc)
-{
-    float x_scale;
-    float y_scale;
-    int   i;
-    int   x;
-    int   y;
-    wxColour sym_to_colour[] = {wxColor(0,0,255), 
-                                wxColor(0,255,0),
-                                wxColor(0,255,255),
-                                wxColor(255,0,0),
-                                wxColor(255,0,255), 
-                                wxColor(255,255,0),
-                                wxColor(255,255,255),
-                                wxColor(0,0,255), 
-                                wxColor(0,255,0),
-                                wxColor(0,255,255),
-                                wxColor(255,0,0),
-                                wxColor(255,0,255), 
-                                wxColor(255,255,0),
-                                wxColor(255,255,255),
-                                wxColor(0,0,255), 
-                                wxColor(0,255,0),
-                                wxColor(0,255,255),
-                                wxColor(255,0,0),
-                                wxColor(255,0,255)
-    };
-
-    m_rCtrl = GetClientRect();
-    m_rGrid = m_rCtrl;
-    m_rGrid = m_rGrid.Deflate(PLOT_BORDER + (XLEFT_OFFSET/2), (PLOT_BORDER + (YBOTTOM_OFFSET/2)));
-
-    // black background
-
-    dc.Clear();
-    m_rPlot = wxRect(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER, m_rGrid.GetWidth(), m_rGrid.GetHeight());
-    wxBrush ltGraphBkgBrush = wxBrush(BLACK_COLOR);
-    dc.SetBrush(ltGraphBkgBrush);
-    dc.SetPen(wxPen(BLACK_COLOR, 0));
-    dc.DrawRectangle(m_rPlot);
-    wxPen pen;
-    pen.SetWidth(1); // note this is ignored by DrawPoint
-
-    // automatically scale, first measure the maximum value
-
-    float max_xy = 1E-12;
-    float real,imag;
-    for(i=0; i< scatterMemSyms; i++) {
-        real = fabs(m_mem[i].real);
-        imag = fabs(m_mem[i].imag);
-        if (real > max_xy)
-            max_xy = real;
-        if (imag > max_xy)
-            max_xy = imag;
-    }
-
-    // smooth it out and set a lower limit to prevent didev by 0 issues
-
-    m_filter_max_xy = BETA*m_filter_max_xy + (1 - BETA)*2.5*max_xy;
-    if (m_filter_max_xy < 0.001)
-        m_filter_max_xy = 0.001;
-
-    // quantise to log steps to prevent scatter scaling bobbing about too
-    // much as scaling varies
-
-    float quant_m_filter_max_xy = exp(floor(0.5+log(m_filter_max_xy)));
-    //printf("max_xy: %f m_filter_max_xy: %f quant_m_filter_max_xy: %f\n", max_xy, m_filter_max_xy, quant_m_filter_max_xy);
-
-    x_scale = (float)m_rGrid.GetWidth()/quant_m_filter_max_xy;
-    y_scale = (float)m_rGrid.GetHeight()/quant_m_filter_max_xy;
-
-    // draw all samples
-
-    for(i = 0; i < scatterMemSyms; i++)
-    {
-        x = x_scale * m_mem[i].real + m_rGrid.GetWidth()/2;
-        y = y_scale * m_mem[i].imag + m_rGrid.GetHeight()/2;
-       x += PLOT_BORDER + XLEFT_OFFSET;
-       y += PLOT_BORDER;
-        pen.SetColour(sym_to_colour[i%Nsym]);
-        dc.SetPen(pen);
-       dc.DrawPoint(x, y);
-    }
-}
-
-//----------------------------------------------------------------
-// add_new_samples()
-//----------------------------------------------------------------
-void PlotScatter::add_new_samples(COMP samples[])
-{
-    int i,j;
-
-    // shift memory
-
-    for(i = 0; i < scatterMemSyms - Nsym; i++)
-    {
-        m_mem[i] = m_mem[i+Nsym];
-    }
-
-    // new samples
-
-    for(j=0; i < scatterMemSyms; i++,j++)
-    {
-        m_mem[i] = samples[j];
-    }
-}
-
-//----------------------------------------------------------------
-// OnPaint()
-//----------------------------------------------------------------
-void PlotScatter::OnPaint(wxPaintEvent& event)
-{
-    wxAutoBufferedPaintDC dc(this);
-    draw(dc);
-}
-
-//----------------------------------------------------------------
-// OnSize()
-//----------------------------------------------------------------
-void PlotScatter::OnSize(wxSizeEvent& event)
-{
-    // todo: clear screen
-}
-
-//----------------------------------------------------------------
-// OnShow()
-//----------------------------------------------------------------
-void PlotScatter::OnShow(wxShowEvent& event)
-{
-}
-
diff --git a/fdmdv2-dev/src/fdmdv2_plot_scatter.h b/fdmdv2-dev/src/fdmdv2_plot_scatter.h
deleted file mode 100644 (file)
index 702f633..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_plot_scatter.h
-// Purpose:         A scatter plot derivative of fdmdv2_plot.
-// Created:         June 24, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#ifndef __FDMDV2_PLOT_SCATTER__
-#define __FDMDV2_PLOT_SCATTER__
-
-#include "comp.h"
-#include "fdmdv2_plot.h"
-#include "fdmdv2_defines.h"
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class PlotScatter
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class PlotScatter : public PlotPanel
-{
-    public:
-        PlotScatter(wxFrame* parent);
-        ~PlotScatter(){};
-       void add_new_samples(COMP samples[]);
-       void setNc(int Nc);
-
-    protected:
-        COMP m_mem[SCATTER_MEM_SYMS_MAX];
-        COMP m_new_samples[FDMDV_NC_MAX+1];
-
-        void draw(wxAutoBufferedPaintDC&  dc);
-        void OnPaint(wxPaintEvent& event);
-        void OnSize(wxSizeEvent& event);
-        void OnShow(wxShowEvent& event);
-
-        DECLARE_EVENT_TABLE()
-
-    private:
-        int   Nsym;
-        int   scatterMemSyms;
-        float m_filter_max_xy;
-};
-
-#endif //__FDMDV2_PLOT_SCATTER__
diff --git a/fdmdv2-dev/src/fdmdv2_plot_spectrum.cpp b/fdmdv2-dev/src/fdmdv2_plot_spectrum.cpp
deleted file mode 100644 (file)
index d9c72d0..0000000
+++ /dev/null
@@ -1,266 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_plot_waterfall.cpp
-// Purpose:         Implements a waterfall plot derivative of fdmdv2_plot.
-// Created:         June 23, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#include <string.h>
-#include "wx/wx.h"
-
-#include "fdmdv2_main.h"
-
-extern float g_avmag[];                 // average mag data passed to draw() 
-void fdmdv2_clickTune(float frequency); // callback to pass new click freq
-
-BEGIN_EVENT_TABLE(PlotSpectrum, PlotPanel)
-    EVT_MOTION          (PlotSpectrum::OnMouseMove)
-    EVT_LEFT_DOWN       (PlotSpectrum::OnMouseLeftDown)
-    EVT_LEFT_UP         (PlotSpectrum::OnMouseLeftUp)
-    EVT_MOUSEWHEEL      (PlotSpectrum::OnMouseWheelMoved)
-    EVT_PAINT           (PlotSpectrum::OnPaint)
-    EVT_SHOW            (PlotSpectrum::OnShow)
-END_EVENT_TABLE()
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class PlotSpectrum
-//
-// @class $(Name)
-// @author $(User)
-// @date $(Date)
-// @file $(CurrentFileName).$(CurrentFileExt)
-// @brief
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-PlotSpectrum::PlotSpectrum(wxFrame* parent, float *magdB, int n_magdB, 
-                           float min_mag_db, float max_mag_db, bool clickTune): PlotPanel(parent)
-{
-    m_greyscale     = 0;
-    m_Bufsz         = GetMaxClientSize();
-    m_newdata       = false;
-    m_firstPass     = true;
-    m_line_color    = 0;
-    SetLabelSize(10.0);
-
-    m_magdB         = magdB;
-    m_n_magdB       = n_magdB;     // number of points in magdB that covers 0 ... MAX_F_HZ of spectrum
-    m_max_mag_db    = max_mag_db;
-    m_min_mag_db    = min_mag_db;
-    m_rxFreq        = 0.0;
-    m_clickTune     = clickTune;
-}
-
-//----------------------------------------------------------------
-// ~PlotSpectrum()
-//----------------------------------------------------------------
-PlotSpectrum::~PlotSpectrum()
-{
-}
-
-//----------------------------------------------------------------
-// OnSize()
-//----------------------------------------------------------------
-void PlotSpectrum::OnSize(wxSizeEvent& event) {
-}
-
-//----------------------------------------------------------------
-// OnPaint()
-//----------------------------------------------------------------
-void PlotSpectrum::OnPaint(wxPaintEvent& event)
-{
-    wxAutoBufferedPaintDC dc(this);
-    draw(dc);
-}
-
-//----------------------------------------------------------------
-// OnShow()
-//----------------------------------------------------------------
-void PlotSpectrum::OnShow(wxShowEvent& event)
-{
-}
-
-//----------------------------------------------------------------
-// draw()
-//----------------------------------------------------------------
-void PlotSpectrum::draw(wxAutoBufferedPaintDC& dc)
-{
-    m_rCtrl  = GetClientRect();
-
-    // m_rGrid is coords of inner window we actually plot to.  We deflate it a bit
-    // to leave room for axis labels.  We need to work this out every time we draw
-    // as OnSize() may not be called before OnPaint(), for example when a new tab
-    // is selected
-
-    m_rGrid  = m_rCtrl;
-    m_rGrid = m_rGrid.Deflate(PLOT_BORDER + (XLEFT_OFFSET/2), (PLOT_BORDER + (YBOTTOM_OFFSET/2)));
-
-    dc.Clear();
-
-    // black background
-
-    m_rPlot = wxRect(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER, m_rGrid.GetWidth(), m_rGrid.GetHeight());
-    wxBrush ltGraphBkgBrush = wxBrush(BLACK_COLOR);
-    dc.SetBrush(ltGraphBkgBrush);
-    dc.SetPen(wxPen(BLACK_COLOR, 0));
-    dc.DrawRectangle(m_rPlot);
-
-    // draw spectrum
-
-    int   x, y, prev_x, prev_y, index;
-    float index_to_px, mag_dB_to_py, mag;
-
-    m_newdata = false;
-
-    wxPen pen;
-    pen.SetColour(DARK_GREEN_COLOR);
-    pen.SetWidth(1);
-    dc.SetPen(pen);
-
-    index_to_px = (float)m_rGrid.GetWidth()/m_n_magdB;
-    mag_dB_to_py = (float)m_rGrid.GetHeight()/(m_max_mag_db - m_min_mag_db);
-
-    prev_x = PLOT_BORDER + XLEFT_OFFSET;
-    prev_y = PLOT_BORDER;
-    for(index = 0; index < m_n_magdB; index++)
-    {
-        x = index*index_to_px;
-        mag = m_magdB[index];
-        if (mag > m_max_mag_db) mag = m_max_mag_db;
-        if (mag < m_min_mag_db) mag = m_min_mag_db;
-        y = -(mag - m_max_mag_db) * mag_dB_to_py;
-
-        x += PLOT_BORDER + XLEFT_OFFSET;
-        y += PLOT_BORDER;
-
-        if (index)
-            dc.DrawLine(x, y, prev_x, prev_y);
-        prev_x = x; prev_y = y;
-    }
-
-    // and finally draw Graticule
-
-    drawGraticule(dc);
-
-}
-
-//-------------------------------------------------------------------------
-// drawGraticule()
-//-------------------------------------------------------------------------
-void PlotSpectrum::drawGraticule(wxAutoBufferedPaintDC&  dc)
-{
-    int      x, y, text_w, text_h;
-    char     buf[15];
-    wxString s;
-    float    f, mag, freq_hz_to_px, mag_dB_to_py;
-
-    wxBrush ltGraphBkgBrush;
-    ltGraphBkgBrush.SetStyle(wxBRUSHSTYLE_TRANSPARENT);
-    ltGraphBkgBrush.SetColour(*wxBLACK);
-    dc.SetBrush(ltGraphBkgBrush);
-    dc.SetPen(wxPen(BLACK_COLOR, 1));
-
-    freq_hz_to_px = (float)m_rGrid.GetWidth()/(MAX_F_HZ-MIN_F_HZ);
-    mag_dB_to_py = (float)m_rGrid.GetHeight()/(m_max_mag_db - m_min_mag_db);
-
-    // upper LH coords of plot area are (PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER)
-    // lower RH coords of plot area are (PLOT_BORDER + XLEFT_OFFSET + m_rGrid.GetWidth(), 
-    //                                   PLOT_BORDER + m_rGrid.GetHeight())
-
-    // Check if small screen size means text will overlap
-
-    int textXStep = STEP_F_HZ*freq_hz_to_px;
-    int textYStep = STEP_MAG_DB*mag_dB_to_py;
-    sprintf(buf, "%4.0fHz", (float)MAX_F_HZ - STEP_F_HZ);
-    GetTextExtent(buf, &text_w, &text_h);
-    int overlappedText = (text_w > textXStep) || (text_h > textYStep);
-    //printf("text_w: %d textXStep: %d text_h: %d textYStep: %d  overlappedText: %d\n", text_w, textXStep, 
-    //      text_h, textYStep, overlappedText);
-
-    // Vertical gridlines
-
-    for(f=STEP_F_HZ; f<MAX_F_HZ; f+=STEP_F_HZ) {
-       x = f*freq_hz_to_px;
-       x += PLOT_BORDER + XLEFT_OFFSET;
-
-        dc.SetPen(m_penShortDash);
-        dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, PLOT_BORDER);
-        dc.SetPen(wxPen(BLACK_COLOR, 1));
-        dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET);
-
-        sprintf(buf, "%4.0fHz", f);
-       GetTextExtent(buf, &text_w, &text_h);
-        if (!overlappedText)
-            dc.DrawText(buf, x - text_w/2, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET);
-    }
-
-    dc.SetPen(wxPen(BLACK_COLOR, 1));
-    for(f=STEP_MINOR_F_HZ; f<MAX_F_HZ; f+=STEP_MINOR_F_HZ) 
-    {
-        x = f*freq_hz_to_px;
-        x += PLOT_BORDER + XLEFT_OFFSET;
-        dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET-5);
-    }
-    
-    // Horizontal gridlines
-
-    dc.SetPen(m_penDotDash);
-    for(mag=m_min_mag_db; mag<=m_max_mag_db; mag+=STEP_MAG_DB) {
-       y = -(mag - m_max_mag_db) * mag_dB_to_py;
-       y += PLOT_BORDER;
-       dc.DrawLine(PLOT_BORDER + XLEFT_OFFSET, y, 
-                   (m_rGrid.GetWidth() + PLOT_BORDER + XLEFT_OFFSET), y);
-        sprintf(buf, "%3.0fdB", mag);
-       GetTextExtent(buf, &text_w, &text_h);
-        if (!overlappedText)
-            dc.DrawText(buf, PLOT_BORDER + XLEFT_OFFSET - text_w - XLEFT_TEXT_OFFSET, y-text_h/2);
-    }
-
-    // red rx tuning line
-    
-    if (m_rxFreq != 0.0) {
-        dc.SetPen(wxPen(RED_COLOR, 2));
-        x = m_rxFreq*freq_hz_to_px;
-        x += PLOT_BORDER + XLEFT_OFFSET;
-        //printf("m_rxFreq %f x %d\n", m_rxFreq, x);
-        dc.DrawLine(x, m_rGrid.GetHeight()+ PLOT_BORDER, x, m_rCtrl.GetHeight());
-    }
-
-}
-
-//-------------------------------------------------------------------------
-// OnMouseDown()
-//-------------------------------------------------------------------------
-void PlotSpectrum::OnMouseLeftDown(wxMouseEvent& event)
-{
-    m_mouseDown = true;
-    wxClientDC dc(this);
-
-    wxPoint pt(event.GetLogicalPosition(dc));
-
-    // map x coord to edges of actual plot
-    pt.x -= PLOT_BORDER + XLEFT_OFFSET;
-    pt.y -= PLOT_BORDER;
-
-    // valid click if inside of plot
-    if ((pt.x >= 0) && (pt.x <= m_rGrid.GetWidth()) && (pt.y >=0) && m_clickTune) {
-        float freq_hz_to_px = (float)m_rGrid.GetWidth()/(MAX_F_HZ-MIN_F_HZ);
-        float clickFreq = (float)pt.x/freq_hz_to_px;
-
-        // see PlotWaterfall::OnMouseDown()
-
-        fdmdv2_clickTune(clickFreq);
-    }
-}
diff --git a/fdmdv2-dev/src/fdmdv2_plot_spectrum.h b/fdmdv2-dev/src/fdmdv2_plot_spectrum.h
deleted file mode 100644 (file)
index 353f312..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_plot_spectrum.h
-// Purpose:         Defines a spectrum plot derived from fdmdv2_plot class.
-// Created:         June 22, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#ifndef __FDMDV2_PLOT_SPECTRUM__
-#define __FDMDV2_PLOT_SPECTRUM__
-
-#include "fdmdv2_plot.h"
-#include "fdmdv2_defines.h"
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class Waterfall
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class PlotSpectrum : public PlotPanel
-{
-    public:
-    PlotSpectrum(wxFrame* parent, float *magdB, int n_magdB, 
-                 float min_mag_db=MIN_MAG_DB, float max_mag_db=MAX_MAG_DB, bool clickTune=true);
-        ~PlotSpectrum();
-        void setRxFreq(float rxFreq) { m_rxFreq = rxFreq; }
-        void setFreqScale(int n_magdB) { m_n_magdB = n_magdB; }
-
-    protected:
-        void        OnPaint(wxPaintEvent& event);
-        void        OnSize(wxSizeEvent& event);
-        void        OnShow(wxShowEvent& event);
-        void        drawGraticule(wxAutoBufferedPaintDC& dc);
-        void        draw(wxAutoBufferedPaintDC& dc);
-        void        OnMouseLeftDown(wxMouseEvent& event);
-
-   private:
-        float       m_rxFreq;
-        float       m_max_mag_db;
-        float       m_min_mag_db;
-        float      *m_magdB;
-        int         m_n_magdB;  
-        bool        m_clickTune;
-
-        DECLARE_EVENT_TABLE()
-};
-
-#endif //__FDMDV2_PLOT_SPECTRUM__
diff --git a/fdmdv2-dev/src/fdmdv2_plot_waterfall.cpp b/fdmdv2-dev/src/fdmdv2_plot_waterfall.cpp
deleted file mode 100644 (file)
index d3a29ab..0000000
+++ /dev/null
@@ -1,483 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_plot_waterfall.cpp
-// Purpose:         Implements a waterfall plot derivative of fdmdv2_plot.
-// Created:         June 22, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#include <string.h>
-#include "wx/wx.h"
-#include "fdmdv2_main.h"
-
-extern float g_avmag[];                 // av mag spec passed in to draw() 
-void fdmdv2_clickTune(float frequency); // callback to pass new click freq
-
-BEGIN_EVENT_TABLE(PlotWaterfall, PlotPanel)
-    EVT_PAINT           (PlotWaterfall::OnPaint)
-    EVT_MOTION          (PlotWaterfall::OnMouseMove)
-    EVT_LEFT_DOWN       (PlotWaterfall::OnMouseLeftDown)
-    EVT_RIGHT_DOWN      (PlotWaterfall::OnMouseRightDown)
-    EVT_LEFT_UP         (PlotWaterfall::OnMouseLeftUp)
-    EVT_MOUSEWHEEL      (PlotWaterfall::OnMouseWheelMoved)
-    EVT_SIZE            (PlotWaterfall::OnSize)
-    EVT_SHOW            (PlotWaterfall::OnShow)
-END_EVENT_TABLE()
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class WaterfallPlot
-//
-// @class   WaterfallPlot
-// @author  David Witten
-// @date    $(Date)
-// @file    $(CurrentFileName).$(CurrentFileExt)
-// @brief
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-PlotWaterfall::PlotWaterfall(wxFrame* parent, bool graticule, int colour): PlotPanel(parent)
-{
-
-    for(int i = 0; i < 255; i++)
-    {
-        m_heatmap_lut[i] = heatmap((float)i, 0.0, 255.0);
-    }
-    m_graticule     = graticule;
-    m_colour        = colour;
-    m_Bufsz         = GetMaxClientSize();
-    m_newdata       = false;
-    m_firstPass     = true;
-    m_line_color    = 0;
-    m_modem_stats_max_f_hz = MODEM_STATS_MAX_F_HZ;
-
-    SetLabelSize(10.0);
-
-    m_pBmp = NULL;
-    m_max_mag = MAX_MAG_DB;
-    m_min_mag = MIN_MAG_DB;
-}
-
-// When the window size gets set we can work outthe size of the window
-// we plot in and allocate a bit map of the correct size
-void PlotWaterfall::OnSize(wxSizeEvent& event) 
-{
-    // resize bit map
-
-    delete m_pBmp;
-    
-    m_rCtrl  = GetClientRect();
-
-    // m_rGrid is coords of inner window we actually plot to.  We deflate it a bit
-    // to leave room for axis labels.
-
-    m_rGrid  = m_rCtrl;
-    m_rGrid = m_rGrid.Deflate(PLOT_BORDER + (XLEFT_OFFSET/2), (PLOT_BORDER + (YBOTTOM_OFFSET/2)));
-
-    // we want a bit map the size of m_rGrid
-
-    m_pBmp = new wxBitmap(m_rGrid.GetWidth(), m_rGrid.GetHeight(), 24);
-
-    m_dT = DT;
-}
-
-//----------------------------------------------------------------
-// paintEvent()
-//
-// @class $(Name)
-// @author $(User)
-// @date $(Date)
-// @file $(CurrentFileName).$(CurrentFileExt)
-// @brief
-//
-// Called by the system of by wxWidgets when the panel needs
-// to be redrawn. You can also trigger this call by calling
-// Refresh()/Update().
-//----------------------------------------------------------------
-void PlotWaterfall::OnPaint(wxPaintEvent & evt)
-{
-    wxAutoBufferedPaintDC dc(this);
-    draw(dc);
-}
-
-//----------------------------------------------------------------
-// OnShow()
-//----------------------------------------------------------------
-void PlotWaterfall::OnShow(wxShowEvent& event)
-{
-}
-
-//----------------------------------------------------------------
-// ~PlotWaterfall()
-//----------------------------------------------------------------
-PlotWaterfall::~PlotWaterfall()
-{
-}
-
-//----------------------------------------------------------------
-// heatmap()
-// map val to a rgb colour
-// from http://eddiema.ca/2011/01/21/c-sharp-heatmaps/
-//----------------------------------------------------------------
-unsigned PlotWaterfall::heatmap(float val, float min, float max)
-{
-    unsigned r = 0;
-    unsigned g = 0;
-    unsigned b = 0;
-
-    val = (val - min) / (max - min);
-    if(val <= 0.2)
-    {
-        b = (unsigned)((val / 0.2) * 255);
-    }
-    else if(val >  0.2 &&  val <= 0.7)
-    {
-        b = (unsigned)((1.0 - ((val - 0.2) / 0.5)) * 255);
-    }
-    if(val >= 0.2 &&  val <= 0.6)
-    {
-        g = (unsigned)(((val - 0.2) / 0.4) * 255);
-    }
-    else if(val >  0.6 &&  val <= 0.9)
-    {
-        g = (unsigned)((1.0 - ((val - 0.6) / 0.3)) * 255);
-    }
-    if(val >= 0.5)
-    {
-        r = (unsigned)(((val - 0.5) / 0.5) * 255);
-    }
-    //printf("%f %x %x %x\n", val, r, g, b);
-    return  (b << 16) + (g << 8) + r;
-}
-
-bool PlotWaterfall::checkDT(void)
-{
-    // Check dY is > 1 pixel before proceeding. For small screens
-    // and large WATERFALL_SECS_Y we might have less than one
-    // block per pixel.  In this case increase m_dT and perform draw
-    // less often
-
-    float px_per_sec = (float)m_rGrid.GetHeight() / WATERFALL_SECS_Y;
-    float dy = m_dT * px_per_sec;
-    
-    if (dy < 1.0) {
-        m_dT += DT;
-        return false;
-    }
-    else
-        return true;
-}
-
-//----------------------------------------------------------------
-// draw()
-//----------------------------------------------------------------
-void PlotWaterfall::draw(wxAutoBufferedPaintDC& dc)
-{
-
-    m_rCtrl  = GetClientRect();
-
-    // m_rGrid is coords of inner window we actually plot to.  We deflate it a bit
-    // to leave room for axis labels.
-
-    m_rGrid = m_rCtrl;
-    m_rGrid = m_rGrid.Deflate(PLOT_BORDER + (XLEFT_OFFSET/2), (PLOT_BORDER + (YBOTTOM_OFFSET/2)));
-
-    if (m_pBmp == NULL) 
-    {
-        // we want a bit map the size of m_rGrid
-        m_pBmp = new wxBitmap(m_rGrid.GetWidth(), m_rGrid.GetHeight(), 24);
-    }
-
-    dc.Clear();
-
-    if(m_newdata)
-    {
-        m_newdata = false;
-        plotPixelData();
-        dc.DrawBitmap(*m_pBmp, PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER);
-        m_dT = DT;
-    }
-    else 
-    {
-
-        // no data to plot so just erase to black.  Blue looks nicer
-        // but is same colour as low amplitude signal
-
-        // Bug on Linux: When Stop is pressed this code doesn't erase
-        // the lower 25% of the Waterfall Window
-
-        m_rPlot = wxRect(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER, m_rGrid.GetWidth(), m_rGrid.GetHeight());
-        wxBrush ltGraphBkgBrush = wxBrush(BLACK_COLOR);
-        dc.SetBrush(ltGraphBkgBrush);
-        dc.SetPen(wxPen(BLACK_COLOR, 0));
-        dc.DrawRectangle(m_rPlot);
-    }
-    drawGraticule(dc);
-}
-
-//-------------------------------------------------------------------------
-// drawGraticule()
-//-------------------------------------------------------------------------
-void PlotWaterfall::drawGraticule(wxAutoBufferedPaintDC& dc)
-{
-    int      x, y, text_w, text_h;
-    char     buf[15];
-    wxString s;
-    float    f, time, freq_hz_to_px, time_s_to_py;
-
-    wxBrush ltGraphBkgBrush;
-    ltGraphBkgBrush.SetStyle(wxBRUSHSTYLE_TRANSPARENT);
-    ltGraphBkgBrush.SetColour(*wxBLACK);
-    dc.SetBrush(ltGraphBkgBrush);
-    dc.SetPen(wxPen(BLACK_COLOR, 1));
-
-    freq_hz_to_px = (float)m_rGrid.GetWidth()/(MAX_F_HZ-MIN_F_HZ);
-    time_s_to_py = (float)m_rGrid.GetHeight()/WATERFALL_SECS_Y;
-
-    // upper LH coords of plot area are (PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER)
-    // lower RH coords of plot area are (PLOT_BORDER + XLEFT_OFFSET + m_rGrid.GetWidth(), 
-    //                                   PLOT_BORDER + m_rGrid.GetHeight())
-
-    // Check if small screen size means text will overlap
-
-    int textXStep = STEP_F_HZ*freq_hz_to_px;
-    int textYStep = WATERFALL_SECS_STEP*time_s_to_py;
-    sprintf(buf, "%4.0fHz", (float)MAX_F_HZ - STEP_F_HZ);
-    GetTextExtent(buf, &text_w, &text_h);
-    int overlappedText = (text_w > textXStep) || (text_h > textYStep);
-
-    // Major Vertical gridlines and legend
-    //dc.SetPen(m_penShortDash);
-    for(f=STEP_F_HZ; f<MAX_F_HZ; f+=STEP_F_HZ) 
-    {
-        x = f*freq_hz_to_px;
-        x += PLOT_BORDER + XLEFT_OFFSET;
-
-        if (m_graticule)
-            dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, PLOT_BORDER);
-        else
-            dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET);
-            
-        sprintf(buf, "%4.0fHz", f);
-        GetTextExtent(buf, &text_w, &text_h);
-        if (!overlappedText)
-            dc.DrawText(buf, x - text_w/2, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET);
-    }
-
-    for(f=STEP_MINOR_F_HZ; f<MAX_F_HZ; f+=STEP_MINOR_F_HZ) 
-    {
-        x = f*freq_hz_to_px;
-        x += PLOT_BORDER + XLEFT_OFFSET;
-        dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET-5);
-    }
-    
-    // Horizontal gridlines
-    dc.SetPen(m_penDotDash);
-    for(time=0; time<=WATERFALL_SECS_Y; time+=WATERFALL_SECS_STEP) {
-       y = m_rGrid.GetHeight() - time*time_s_to_py;
-       y += PLOT_BORDER;
-
-        if (m_graticule)
-            dc.DrawLine(PLOT_BORDER + XLEFT_OFFSET, y, 
-                        (m_rGrid.GetWidth() + PLOT_BORDER + XLEFT_OFFSET), y);
-        sprintf(buf, "%3.0fs", time);
-       GetTextExtent(buf, &text_w, &text_h);
-        if (!overlappedText)
-            dc.DrawText(buf, PLOT_BORDER + XLEFT_OFFSET - text_w - XLEFT_TEXT_OFFSET, y-text_h/2);
-   }
-
-    // red rx tuning line
-    dc.SetPen(wxPen(RED_COLOR, 2));
-    x = m_rxFreq*freq_hz_to_px;
-    x += PLOT_BORDER + XLEFT_OFFSET;
-    //printf("m_rxFreq %f x %d\n", m_rxFreq, x);
-    dc.DrawLine(x, m_rGrid.GetHeight()+ PLOT_BORDER, x, m_rCtrl.GetHeight());
-    
-}
-
-//-------------------------------------------------------------------------
-// plotPixelData()
-//-------------------------------------------------------------------------
-void PlotWaterfall::plotPixelData()
-{
-    float       spec_index_per_px;
-    float       intensity_per_dB;
-    float       px_per_sec;
-    int         index;
-    float       dy;
-    int         dy_blocks;
-    int         b;
-    int         px;
-    int         py;
-    int         intensity;
-
-    /*
-      Design Notes:
-
-      The height in pixels represents WATERFALL_SECS_Y of data.  Every DT
-      seconds we get a vector of MODEM_STATS_NSPEC spectrum samples which we use
-      to update the last row.  The height of each row is dy pixels, which
-      maps to DT seconds.  We call each dy high rectangle of pixels a
-      block.
-
-    */
-
-    // determine dy, the height of one "block"
-    px_per_sec = (float)m_rGrid.GetHeight() / WATERFALL_SECS_Y;
-    dy = m_dT * px_per_sec;
-
-    // number of dy high blocks in spectrogram
-    dy_blocks = m_rGrid.GetHeight()/ dy;
-
-    // update min and max amplitude estimates
-    float max_mag = MIN_MAG_DB;
-
-    int min_fft_bin=((float)200/m_modem_stats_max_f_hz)*MODEM_STATS_NSPEC;
-    int max_fft_bin=((float)2800/m_modem_stats_max_f_hz)*MODEM_STATS_NSPEC;
-
-    for(int i=min_fft_bin; i<max_fft_bin; i++) 
-    {
-        if (g_avmag[i] > max_mag)
-        {
-            max_mag = g_avmag[i];
-        }
-    }
-
-    m_max_mag = BETA*m_max_mag + (1 - BETA)*max_mag;
-    m_min_mag = max_mag - 20.0;
-    //printf("max_mag: %f m_max_mag: %f\n", max_mag, m_max_mag);
-    //intensity_per_dB  = (float)256 /(MAX_MAG_DB - MIN_MAG_DB);
-    intensity_per_dB  = (float)256 /(m_max_mag - m_min_mag);
-    spec_index_per_px = ((float)(MAX_F_HZ)/(float)m_modem_stats_max_f_hz)*(float)MODEM_STATS_NSPEC / (float) m_rGrid.GetWidth();
-
-    /*
-    printf("h %d w %d px_per_sec %d dy %d dy_blocks %d spec_index_per_px: %f\n", 
-       m_rGrid.GetHeight(), m_rGrid.GetWidth(), px_per_sec, 
-       dy, dy_blocks, spec_index_per_px);
-    */
-
-    // Shift previous bit map up one row of blocks ----------------------------
-    wxNativePixelData data(*m_pBmp);
-    wxNativePixelData::Iterator bitMapStart(data);
-    wxNativePixelData::Iterator p = bitMapStart;
-
-    for(b = 0; b < dy_blocks - 1; b++) 
-    {
-        wxNativePixelData::Iterator psrc = bitMapStart;
-        wxNativePixelData::Iterator pdest = bitMapStart;
-        pdest.OffsetY(data, dy * b);
-        psrc.OffsetY(data, dy * (b+1));
-
-        // copy one line of blocks
-
-        for(py = 0; py < dy; py++) 
-        {
-            wxNativePixelData::Iterator pdestRowStart = pdest;
-            wxNativePixelData::Iterator psrcRowStart = psrc;
-
-            for(px = 0; px < m_rGrid.GetWidth(); px++) 
-            {
-                pdest.Red() = psrc.Red();
-                pdest.Green() = psrc.Green();
-                pdest.Blue() = psrc.Blue();
-                pdest++;
-                psrc++;
-            }
-            pdest = pdestRowStart;
-            pdest.OffsetY(data, 1);
-            psrc = psrcRowStart;
-            psrc.OffsetY(data, 1);         
-        }
-    }
-
-    // Draw last line of blocks using latest amplitude data ------------------
-    p = bitMapStart;
-    p.OffsetY(data, dy *(dy_blocks - 1));
-    for(py = 0; py < dy; py++)
-    {
-        wxNativePixelData::Iterator rowStart = p;
-
-        for(px = 0; px < m_rGrid.GetWidth(); px++)
-        {
-            index = px * spec_index_per_px;
-            assert(index < MODEM_STATS_NSPEC);
-
-            intensity = intensity_per_dB * (g_avmag[index] - m_min_mag);
-            if(intensity > 255) intensity = 255;
-            if (intensity < 0) intensity = 0;
-            //printf("%d %f %d \n", index, g_avmag[index], intensity);
-
-            switch (m_colour) {
-            case 0:
-                p.Red() = m_heatmap_lut[intensity] & 0xff;
-                p.Green() = (m_heatmap_lut[intensity] >> 8) & 0xff;
-                p.Blue() = (m_heatmap_lut[intensity] >> 16) & 0xff;
-                break;
-            case 1:
-                p.Red() = intensity;
-                p.Green() = intensity;
-                p.Blue() = intensity;       
-                break;
-            case 2:
-                p.Red() = intensity;
-                p.Green() = intensity;
-                if (intensity < 127)
-                    p.Blue() = intensity*2;
-                else
-                    p.Blue() = 255;
-                        
-                break;
-            }
-            ++p;
-        }
-        p = rowStart;
-        p.OffsetY(data, 1);
-    }
-
-}
-
-//-------------------------------------------------------------------------
-// OnMouseLeftDown()
-//-------------------------------------------------------------------------
-void PlotWaterfall::OnMouseLeftDown(wxMouseEvent& event)
-{
-    m_mouseDown = true;
-    wxClientDC dc(this);
-
-    wxPoint pt(event.GetLogicalPosition(dc));
-
-    // map x coord to edges of actual plot
-    pt.x -= PLOT_BORDER + XLEFT_OFFSET;
-    pt.y -= PLOT_BORDER;
-
-    // valid click if inside of plot
-    if ((pt.x >= 0) && (pt.x <= m_rGrid.GetWidth()) && (pt.y >=0)) 
-    {
-        float freq_hz_to_px = (float)m_rGrid.GetWidth()/(MAX_F_HZ-MIN_F_HZ);
-        float clickFreq = (float)pt.x/freq_hz_to_px;
-
-        // communicate back to other threads
-        fdmdv2_clickTune(clickFreq);
-    }
-}
-
-//-------------------------------------------------------------------------
-// OnMouseRightDown()
-//-------------------------------------------------------------------------
-void PlotWaterfall::OnMouseRightDown(wxMouseEvent& event)
-{
-    m_colour++;
-    if (m_colour == 3)
-        m_colour = 0;
-}
-
diff --git a/fdmdv2-dev/src/fdmdv2_plot_waterfall.h b/fdmdv2-dev/src/fdmdv2_plot_waterfall.h
deleted file mode 100644 (file)
index 77058fd..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_plot_waterfall.h
-// Purpose:         Defines a waterfall plot derivative of fdmdv2_plot.
-// Created:         June 22, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#ifndef __FDMDV2_PLOT_WATERFALL__
-#define __FDMDV2_PLOT_WATERFALL__
-
-#include "fdmdv2_plot.h"
-#include "fdmdv2_defines.h"
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class PlotWaterfall
-//
-// @class $(Name)
-// @author $(User)
-// @date $(Date)
-// @file $(CurrentFileName).$(CurrentFileExt)
-// @brief
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class PlotWaterfall : public PlotPanel
-{
-    public:
-    PlotWaterfall(wxFrame* parent, bool graticule, int colour);
-        ~PlotWaterfall();
-        bool checkDT(void);
-        void setGreyscale(bool greyscale) { m_greyscale = greyscale; }
-        void setRxFreq(float rxFreq) { m_rxFreq = rxFreq; }
-        void setFs(int fs) { m_modem_stats_max_f_hz = fs/2; }
-
-    protected:
-        unsigned    m_heatmap_lut[256];
-
-        unsigned    heatmap(float val, float min, float max);
-
-        void        OnPaint(wxPaintEvent & evt);
-        void        OnSize(wxSizeEvent& event);
-        void        OnShow(wxShowEvent& event);
-        void        drawGraticule(wxAutoBufferedPaintDC&  dc);
-        void        draw(wxAutoBufferedPaintDC& dc);
-        void        plotPixelData();
-        void        OnMouseLeftDown(wxMouseEvent& event);
-        void        OnMouseRightDown(wxMouseEvent& event);
-
-    private:
-        float       m_dT;
-        float       m_rxFreq;
-        bool        m_graticule;
-        float       m_min_mag;
-        float       m_max_mag;
-        int         m_colour;
-        int         m_modem_stats_max_f_hz;
-
-        DECLARE_EVENT_TABLE()
-};
-
-#endif //__FDMDV2_PLOT_WATERFALL__
diff --git a/fdmdv2-dev/src/hamlib.cpp b/fdmdv2-dev/src/hamlib.cpp
deleted file mode 100644 (file)
index 575f36a..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-//==========================================================================
-// Name:            hamlib.cpp
-//
-// Purpose:         Hamlib integration for FreeDV
-// Created:         May 2013
-// Authors:         Joel Stanley
-//
-// 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#include <hamlib.h>
-
-#include <vector>
-#include <algorithm>
-
-using namespace std;
-
-typedef std::vector<const struct rig_caps *> riglist_t;
-
-static bool rig_cmp(const struct rig_caps *rig1, const struct rig_caps *rig2);
-static int build_list(const struct rig_caps *rig, rig_ptr_t);
-
-Hamlib::Hamlib() : m_rig(NULL) {
-    /* Stop hamlib from spewing info to stderr. */
-    rig_set_debug(RIG_DEBUG_NONE);
-
-    /* Create sorted list of rigs. */
-    rig_load_all_backends();
-    rig_list_foreach(build_list, &m_rigList);
-    sort(m_rigList.begin(), m_rigList.end(), rig_cmp);
-
-    /* Reset debug output. */
-    rig_set_debug(RIG_DEBUG_VERBOSE);
-
-       m_rig = NULL;
-}
-
-Hamlib::~Hamlib() {
-       if(m_rig)
-               close();
-}
-
-static int build_list(const struct rig_caps *rig, rig_ptr_t rigList) {
-    ((riglist_t *)rigList)->push_back(rig); 
-    return 1;
-}
-
-static bool rig_cmp(const struct rig_caps *rig1, const struct rig_caps *rig2) {
-    /* Compare manufacturer. */
-    int r = strcasecmp(rig1->mfg_name, rig2->mfg_name);
-    if (r != 0)
-        return r < 0;
-
-    /* Compare model. */
-    r = strcasecmp(rig1->model_name, rig2->model_name);
-    if (r != 0)
-        return r < 0;
-
-    /* Compare rig ID. */
-    return rig1->rig_model < rig2->rig_model;
-}
-
-void Hamlib::populateComboBox(wxComboBox *cb) {
-
-    riglist_t::const_iterator rig = m_rigList.begin();
-    for (; rig !=m_rigList.end(); rig++) {
-        char name[128];
-        snprintf(name, 128, "%s %s", (*rig)->mfg_name, (*rig)->model_name); 
-        cb->Append(name);
-    }
-}
-
-bool Hamlib::connect(unsigned int rig_index, const char *serial_port) {
-    /* Look up model from index. */
-    if (rig_index >= m_rigList.size()) {
-        return false;
-    }
-    printf("rig: %s %s (%d)\n", m_rigList[rig_index]->mfg_name,
-            m_rigList[rig_index]->model_name, m_rigList[rig_index]->rig_model);
-
-       if(m_rig) {
-               printf("Closing old hamlib instance!\n");
-               close();
-       }
-
-    /* Initialise, configure and open. */
-    m_rig = rig_init(m_rigList[rig_index]->rig_model);
-    /* TODO: Also use baud rate from the screen. */
-    if (!m_rig)
-        return false;
-    token_t token = rig_token_lookup(m_rig, "rig_pathname");
-    if (rig_set_conf(m_rig, token, serial_port) != RIG_OK) {
-        return false;
-    }
-    if (rig_open(m_rig) == RIG_OK) {
-        return true;
-    }
-    return false;
-}
-
-bool Hamlib::ptt(bool press) {
-       if(!m_rig)
-               return false;
-    /* TODO(Joel): make ON_DATA and ON configurable. */
-    ptt_t on = press ? RIG_PTT_ON : RIG_PTT_OFF;
-    /* TODO(Joel): what should the VFO option be? */
-    return rig_set_ptt(m_rig, RIG_VFO_CURR, on) == RIG_OK;
-}
-
-void Hamlib::close(void) {
-       if(m_rig) {
-               rig_close(m_rig);
-               rig_cleanup(m_rig);
-               m_rig = NULL;
-       }
-}
diff --git a/fdmdv2-dev/src/hamlib.h b/fdmdv2-dev/src/hamlib.h
deleted file mode 100644 (file)
index fe3496f..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-#ifndef HAMLIB_H
-#define HAMLIB_H
-
-extern "C" {
-#include <hamlib/rig.h>
-}
-#include <wx/combobox.h>
-#include <vector>
-
-class Hamlib {
-
-    public:
-        Hamlib();
-        ~Hamlib();
-        void populateComboBox(wxComboBox *cb);
-        bool connect(unsigned int rig_index, const char *serial_port);
-        bool ptt(bool press);
-        void close(void);
-
-        typedef std::vector<const struct rig_caps *> riglist_t;
-
-    private:
-        RIG *m_rig;
-        /* Sorted list of rigs. */
-        riglist_t m_rigList;
-};
-
-#endif /*HAMLIB_H*/
diff --git a/fdmdv2-dev/src/sox.h b/fdmdv2-dev/src/sox.h
deleted file mode 100644 (file)
index 07aedeb..0000000
+++ /dev/null
@@ -1,2608 +0,0 @@
-/* libSoX Library Public Interface
- *
- * Copyright 1999-2011 Chris Bagwell and SoX Contributors.
- *
- * This source code is freely redistributable and may be used for
- * any purpose.  This copyright notice must be maintained.
- * Chris Bagwell And SoX Contributors are not responsible for
- * the consequences of using this software.
- */
-
-/** @file
-Contains the interface exposed to clients of the libSoX library.
-Symbols starting with "sox_" or "SOX_" are part of the public interface for
-libSoX clients (applications that consume libSoX). Symbols starting with
-"lsx_" or "LSX_" are internal use by libSoX and plugins.
-LSX_ and lsx_ symbols should not be used by libSoX-based applications.
-*/
-
-#ifndef SOX_H
-#define SOX_H /**< Client API: This macro is defined if sox.h has been included. */
-
-#include <limits.h>
-#include <stdarg.h>
-#include <stddef.h>
-
-#if defined(__cplusplus)
-extern "C" {
-#endif
-
-/* Suppress warnings from use of type long long. */
-#if defined __GNUC__
-#pragma GCC system_header
-#endif
-
-/*****************************************************************************
-API decoration macros:
-Mostly for documentation purposes. For some compilers, decorations also affect
-code generation, influence compiler warnings or activate compiler
-optimizations.
-*****************************************************************************/
-
-/**
-Plugins API:
-Attribute required on all functions exported by libSoX and on all function
-pointer types used by the libSoX API.
-*/
-#ifdef __GNUC__
-#define LSX_API  __attribute__ ((cdecl)) /* libSoX function */
-#elif _MSC_VER
-#define LSX_API  __cdecl /* libSoX function */
-#else
-#define LSX_API /* libSoX function */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter or local variable to suppress warnings about
-the variable being unused (especially in macro-generated code).
-*/
-#ifdef __GNUC__
-#define LSX_UNUSED  __attribute__ ((unused)) /* Parameter or local variable is intentionally unused. */
-#else
-#define LSX_UNUSED /* Parameter or local variable is intentionally unused. */
-#endif
-
-/**
-Plugins API:
-LSX_PRINTF12: Attribute applied to a function to indicate that it requires
-a printf-style format string for arg1 and that printf parameters start at
-arg2.
-*/
-#ifdef __GNUC__
-#define LSX_PRINTF12  __attribute__ ((format (printf, 1, 2))) /* Function has printf-style arguments. */
-#else
-#define LSX_PRINTF12 /* Function has printf-style arguments. */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a function to indicate that it has no side effects and
-depends only its input parameters and global memory. If called repeatedly, it
-returns the same result each time.
-*/
-#ifdef __GNUC__
-#define LSX_RETURN_PURE __attribute__ ((pure)) /* Function is pure. */
-#else
-#define LSX_RETURN_PURE /* Function is pure. */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a function to indicate that the
-return value is always a pointer to a valid object (never NULL).
-*/
-#ifdef _Ret_
-#define LSX_RETURN_VALID _Ret_ /* Function always returns a valid object (never NULL). */
-#else
-#define LSX_RETURN_VALID /* Function always returns a valid object (never NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a function to indicate that the return value is always a
-pointer to a valid array (never NULL).
-*/
-#ifdef _Ret_valid_
-#define LSX_RETURN_ARRAY _Ret_valid_ /* Function always returns a valid array (never NULL). */
-#else
-#define LSX_RETURN_ARRAY /* Function always returns a valid array (never NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a function to indicate that the return value is always a
-pointer to a valid 0-terminated array (never NULL).
-*/
-#ifdef _Ret_z_
-#define LSX_RETURN_VALID_Z _Ret_z_ /* Function always returns a 0-terminated array (never NULL). */
-#else
-#define LSX_RETURN_VALID_Z /* Function always returns a 0-terminated array (never NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a function to indicate that the returned pointer may be
-null.
-*/
-#ifdef _Ret_opt_
-#define LSX_RETURN_OPT _Ret_opt_ /* Function may return NULL. */
-#else
-#define LSX_RETURN_OPT /* Function may return NULL. */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a valid
-pointer to one const element of the pointed-to type (never NULL).
-*/
-#ifdef _In_
-#define LSX_PARAM_IN _In_ /* Required const pointer to a valid object (never NULL). */
-#else
-#define LSX_PARAM_IN /* Required const pointer to a valid object (never NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a valid
-pointer to a const 0-terminated string (never NULL).
-*/
-#ifdef _In_z_
-#define LSX_PARAM_IN_Z _In_z_ /* Required const pointer to 0-terminated string (never NULL). */
-#else
-#define LSX_PARAM_IN_Z /* Required const pointer to 0-terminated string (never NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a const
-pointer to a 0-terminated printf format string.
-*/
-#ifdef _Printf_format_string_
-#define LSX_PARAM_IN_PRINTF _Printf_format_string_ /* Required const pointer to 0-terminated printf format string (never NULL). */
-#else
-#define LSX_PARAM_IN_PRINTF /* Required const pointer to 0-terminated printf format string (never NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a valid
-pointer to (len) const initialized elements of the pointed-to type, where
-(len) is the name of another parameter.
-@param len The parameter that contains the number of elements in the array.
-*/
-#ifdef _In_count_
-#define LSX_PARAM_IN_COUNT(len) _In_count_(len) /* Required const pointer to (len) valid objects (never NULL). */
-#else
-#define LSX_PARAM_IN_COUNT(len) /* Required const pointer to (len) valid objects (never NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a valid
-pointer to (len) const bytes of initialized data, where (len) is the name of
-another parameter.
-@param len The parameter that contains the number of bytes in the array.
-*/
-#ifdef _In_bytecount_
-#define LSX_PARAM_IN_BYTECOUNT(len) _In_bytecount_(len) /* Required const pointer to (len) bytes of data (never NULL). */
-#else
-#define LSX_PARAM_IN_BYTECOUNT(len) /* Required const pointer to (len) bytes of data (never NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is either NULL
-or a valid pointer to one const element of the pointed-to type.
-*/
-#ifdef _In_opt_
-#define LSX_PARAM_IN_OPT _In_opt_ /* Optional const pointer to a valid object (may be NULL). */
-#else
-#define LSX_PARAM_IN_OPT /* Optional const pointer to a valid object (may be NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is either NULL
-or a valid pointer to a const 0-terminated string.
-*/
-#ifdef _In_opt_z_
-#define LSX_PARAM_IN_OPT_Z _In_opt_z_ /* Optional const pointer to 0-terminated string (may be NULL). */
-#else
-#define LSX_PARAM_IN_OPT_Z /* Optional const pointer to 0-terminated string (may be NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a valid
-pointer to one initialized element of the pointed-to type (never NULL). The
-function may modify the element.
-*/
-#ifdef _Inout_
-#define LSX_PARAM_INOUT _Inout_ /* Required pointer to a valid object (never NULL). */
-#else
-#define LSX_PARAM_INOUT /* Required pointer to a valid object (never NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a valid
-pointer to (len) initialized elements of the pointed-to type (never NULL). The
-function may modify the elements.
-@param len The parameter that contains the number of elements in the array.
-*/
-#ifdef _Inout_count_x_
-#define LSX_PARAM_INOUT_COUNT(len) _Inout_count_x_(len) /* Required pointer to (len) valid objects (never NULL). */
-#else
-#define LSX_PARAM_INOUT_COUNT(len) /* Required pointer to (len) valid objects (never NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a valid
-pointer to memory sufficient for one element of the pointed-to type (never
-NULL). The function will initialize the element.
-*/
-#ifdef _Out_
-#define LSX_PARAM_OUT _Out_ /* Required pointer to an object to be initialized (never NULL). */
-#else
-#define LSX_PARAM_OUT /* Required pointer to an object to be initialized (never NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a valid
-pointer to memory sufficient for (len) bytes of data (never NULL), where (len)
-is the name of another parameter. The function may write up to len bytes of
-data to this memory.
-@param len The parameter that contains the number of bytes in the array.
-*/
-#ifdef _Out_bytecap_
-#define LSX_PARAM_OUT_BYTECAP(len) _Out_bytecap_(len) /* Required pointer to writable buffer with room for len bytes. */
-#else
-#define LSX_PARAM_OUT_BYTECAP(len) /* Required pointer to writable buffer with room for len bytes. */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a valid
-pointer to memory sufficient for (len) elements of the pointed-to type (never
-NULL), where (len) is the name of another parameter. On return, (filled)
-elements will have been initialized, where (filled) is either the dereference
-of another pointer parameter (for example "*written") or the "return"
-parameter (indicating that the function returns the number of elements
-written).
-@param len The parameter that contains the number of elements in the array.
-@param filled The dereference of the parameter that receives the number of elements written to the array, or "return" if the value is returned.
-*/
-#ifdef _Out_cap_post_count_
-#define LSX_PARAM_OUT_CAP_POST_COUNT(len,filled) _Out_cap_post_count_(len,filled) /* Required pointer to buffer for (len) elements (never NULL); on return, (filled) elements will have been initialized. */
-#else
-#define LSX_PARAM_OUT_CAP_POST_COUNT(len,filled) /* Required pointer to buffer for (len) elements (never NULL); on return, (filled) elements will have been initialized. */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a valid
-pointer to memory sufficient for (len) elements of the pointed-to type (never
-NULL), where (len) is the name of another parameter. On return, (filled+1)
-elements will have been initialized, with the last element having been
-initialized to 0, where (filled) is either the dereference of another pointer
-parameter (for example, "*written") or the "return" parameter (indicating that
-the function returns the number of elements written).
-@param len The parameter that contains the number of elements in the array.
-@param filled The dereference of the parameter that receives the number of elements written to the array (not counting the terminating null), or "return" if the value is returned.
-*/
-#ifdef _Out_z_cap_post_count_
-#define LSX_PARAM_OUT_Z_CAP_POST_COUNT(len,filled) _Out_z_cap_post_count_(len,filled) /* Required pointer to buffer for (len) elements (never NULL); on return, (filled+1) elements will have been initialized, and the array will be 0-terminated. */
-#else
-#define LSX_PARAM_OUT_Z_CAP_POST_COUNT(len,filled) /* Required pointer to buffer for (len) elements (never NULL); on return, (filled+1) elements will have been initialized, and the array will be 0-terminated. */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is either NULL
-or a valid pointer to memory sufficient for one element of the pointed-to
-type. The function will initialize the element.
-*/
-#ifdef _Out_opt_
-#define LSX_PARAM_OUT_OPT _Out_opt_ /* Optional pointer to an object to be initialized (may be NULL). */
-#else
-#define LSX_PARAM_OUT_OPT /* Optional pointer to an object to be initialized (may be NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a valid
-pointer (never NULL) to another pointer which may be NULL when the function is
-invoked.
-*/
-#ifdef _Deref_pre_maybenull_
-#define LSX_PARAM_DEREF_PRE_MAYBENULL _Deref_pre_maybenull_ /* Required pointer (never NULL) to another pointer (may be NULL). */
-#else
-#define LSX_PARAM_DEREF_PRE_MAYBENULL /* Required pointer (never NULL) to another pointer (may be NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a valid
-pointer (never NULL) to another pointer which will be NULL when the function
-returns.
-*/
-#ifdef _Deref_post_null_
-#define LSX_PARAM_DEREF_POST_NULL _Deref_post_null_ /* Required pointer (never NULL) to another pointer, which will be NULL on exit. */
-#else
-#define LSX_PARAM_DEREF_POST_NULL /* Required pointer (never NULL) to another pointer, which will be NULL on exit. */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a valid
-pointer (never NULL) to another pointer which will be non-NULL when the
-function returns.
-*/
-#ifdef _Deref_post_notnull_
-#define LSX_PARAM_DEREF_POST_NOTNULL _Deref_post_notnull_ /* Required pointer (never NULL) to another pointer, which will be valid (not NULL) on exit. */
-#else
-#define LSX_PARAM_DEREF_POST_NOTNULL /* Required pointer (never NULL) to another pointer, which will be valid (not NULL) on exit. */
-#endif
-
-/**
-Plugins API:
-Expression that "uses" a potentially-unused variable to avoid compiler
-warnings (especially in macro-generated code).
-*/
-#ifdef _PREFAST_
-#define LSX_USE_VAR(x)  ((void)(x=0)) /* During static analysis, initialize unused variables to 0. */
-#else
-#define LSX_USE_VAR(x)  ((void)(x)) /* Parameter or variable is intentionally unused. */
-#endif
-
-/**
-Plugins API:
-Compile-time assertion. Causes a compile error if the expression is false.
-@param e  The expression to test. If expression is false, compilation will fail.
-@param f  A unique identifier for the test, for example foo_must_not_be_zero.
-*/
-#define lsx_static_assert(e,f) enum {lsx_static_assert_##f = 1/((e) ? 1 : 0)}
-
-/*****************************************************************************
-Basic typedefs:
-*****************************************************************************/
-
-/**
-Client API:
-Signed twos-complement 8-bit type. Typically defined as signed char.
-*/
-#if SCHAR_MAX==127 && SCHAR_MIN==(-128)
-typedef signed char sox_int8_t;
-#elif CHAR_MAX==127 && CHAR_MIN==(-128)
-typedef char sox_int8_t;
-#else
-#error Unable to determine an appropriate definition for sox_int8_t.
-#endif
-
-/**
-Client API:
-Unsigned 8-bit type. Typically defined as unsigned char.
-*/
-#if UCHAR_MAX==0xff
-typedef unsigned char sox_uint8_t;
-#elif CHAR_MAX==0xff && CHAR_MIN==0
-typedef char sox_uint8_t;
-#else
-#error Unable to determine an appropriate definition for sox_uint8_t.
-#endif
-
-/**
-Client API:
-Signed twos-complement 16-bit type. Typically defined as short.
-*/
-#if SHRT_MAX==32767 && SHRT_MIN==(-32768)
-typedef short sox_int16_t;
-#elif INT_MAX==32767 && INT_MIN==(-32768)
-typedef int sox_int16_t;
-#else
-#error Unable to determine an appropriate definition for sox_int16_t.
-#endif
-
-/**
-Client API:
-Unsigned 16-bit type. Typically defined as unsigned short.
-*/
-#if USHRT_MAX==0xffff
-typedef unsigned short sox_uint16_t;
-#elif UINT_MAX==0xffff
-typedef unsigned int sox_uint16_t;
-#else
-#error Unable to determine an appropriate definition for sox_uint16_t.
-#endif
-
-/**
-Client API:
-Signed twos-complement 32-bit type. Typically defined as int.
-*/
-#if INT_MAX==2147483647 && INT_MIN==(-2147483647-1)
-typedef int sox_int32_t;
-#elif LONG_MAX==2147483647 && LONG_MIN==(-2147483647-1)
-typedef long sox_int32_t;
-#else
-#error Unable to determine an appropriate definition for sox_int32_t.
-#endif
-
-/**
-Client API:
-Unsigned 32-bit type. Typically defined as unsigned int.
-*/
-#if UINT_MAX==0xffffffff
-typedef unsigned int sox_uint32_t;
-#elif ULONG_MAX==0xffffffff
-typedef unsigned long sox_uint32_t;
-#else
-#error Unable to determine an appropriate definition for sox_uint32_t.
-#endif
-
-/**
-Client API:
-Signed twos-complement 64-bit type. Typically defined as long or long long.
-*/
-#if LONG_MAX==9223372036854775807 && LONG_MIN==(-9223372036854775807-1)
-typedef long sox_int64_t;
-#elif defined(_MSC_VER)
-typedef __int64 sox_int64_t;
-#else
-typedef long long sox_int64_t;
-#endif
-
-/**
-Client API:
-Unsigned 64-bit type. Typically defined as unsigned long or unsigned long long.
-*/
-#if ULONG_MAX==0xffffffffffffffff
-typedef unsigned long sox_uint64_t;
-#elif defined(_MSC_VER)
-typedef unsigned __int64 sox_uint64_t;
-#else
-typedef unsigned long long sox_uint64_t;
-#endif
-
-#ifndef _DOXYGEN_
-lsx_static_assert(sizeof(sox_int8_t)==1,   sox_int8_size);
-lsx_static_assert(sizeof(sox_uint8_t)==1,  sox_uint8_size);
-lsx_static_assert(sizeof(sox_int16_t)==2,  sox_int16_size);
-lsx_static_assert(sizeof(sox_uint16_t)==2, sox_uint16_size);
-lsx_static_assert(sizeof(sox_int32_t)==4,  sox_int32_size);
-lsx_static_assert(sizeof(sox_uint32_t)==4, sox_uint32_size);
-lsx_static_assert(sizeof(sox_int64_t)==8,  sox_int64_size);
-lsx_static_assert(sizeof(sox_uint64_t)==8, sox_uint64_size);
-#endif
-
-/**
-Client API:
-Alias for sox_int32_t (beware of the extra byte).
-*/
-typedef sox_int32_t sox_int24_t;
-
-/**
-Client API:
-Alias for sox_uint32_t (beware of the extra byte).
-*/
-typedef sox_uint32_t sox_uint24_t;
-
-/**
-Client API:
-Native SoX audio sample type (alias for sox_int32_t).
-*/
-typedef sox_int32_t sox_sample_t;
-
-/**
-Client API:
-Samples per second is stored as a double.
-*/
-typedef double sox_rate_t;
-
-/**
-Client API:
-File's metadata, access via sox_*_comments functions.
-*/
-typedef char * * sox_comments_t;
-
-/*****************************************************************************
-Enumerations:
-*****************************************************************************/
-
-/**
-Client API:
-Boolean type, assignment (but not necessarily binary) compatible with C++ bool.
-*/
-typedef enum sox_bool {
-    sox_false, /**< False = 0. */
-    sox_true   /**< True = 1. */
-} sox_bool;
-
-/**
-Client API:
-no, yes, or default (default usually implies some kind of auto-detect logic).
-*/
-typedef enum sox_option_t {
-    sox_option_no,      /**< Option specified as no = 0. */
-    sox_option_yes,     /**< Option specified as yes = 1. */
-    sox_option_default  /**< Option unspecified = 2. */
-} sox_option_t;
-
-/**
-Client API:
-The libSoX-specific error codes.
-libSoX functions may return these codes or others that map from errno codes.
-*/
-enum sox_error_t {
-  SOX_SUCCESS = 0,     /**< Function succeeded = 0 */
-  SOX_EOF = -1,        /**< End Of File or other error = -1 */
-  SOX_EHDR = 2000,     /**< Invalid Audio Header = 2000 */
-  SOX_EFMT,            /**< Unsupported data format = 2001 */
-  SOX_ENOMEM,          /**< Can't alloc memory = 2002 */
-  SOX_EPERM,           /**< Operation not permitted = 2003 */
-  SOX_ENOTSUP,         /**< Operation not supported = 2004 */
-  SOX_EINVAL           /**< Invalid argument = 2005 */
-};
-
-/**
-Client API:
-Flags indicating whether optional features are present in this build of libSoX.
-*/
-typedef enum sox_version_flags_t {
-    sox_version_none = 0,         /**< No special features = 0. */
-    sox_version_have_popen = 1,   /**< popen = 1. */
-    sox_version_have_magic = 2,   /**< magic = 2. */
-    sox_version_have_threads = 4, /**< threads = 4. */
-    sox_version_have_memopen = 8  /**< memopen = 8. */
-} sox_version_flags_t;
-
-/**
-Client API:
-Format of sample data.
-*/
-typedef enum sox_encoding_t {
-  SOX_ENCODING_UNKNOWN   , /**< encoding has not yet been determined */
-
-  SOX_ENCODING_SIGN2     , /**< signed linear 2's comp: Mac */
-  SOX_ENCODING_UNSIGNED  , /**< unsigned linear: Sound Blaster */
-  SOX_ENCODING_FLOAT     , /**< floating point (binary format) */
-  SOX_ENCODING_FLOAT_TEXT, /**< floating point (text format) */
-  SOX_ENCODING_FLAC      , /**< FLAC compression */
-  SOX_ENCODING_HCOM      , /**< Mac FSSD files with Huffman compression */
-  SOX_ENCODING_WAVPACK   , /**< WavPack with integer samples */
-  SOX_ENCODING_WAVPACKF  , /**< WavPack with float samples */
-  SOX_ENCODING_ULAW      , /**< u-law signed logs: US telephony, SPARC */
-  SOX_ENCODING_ALAW      , /**< A-law signed logs: non-US telephony, Psion */
-  SOX_ENCODING_G721      , /**< G.721 4-bit ADPCM */
-  SOX_ENCODING_G723      , /**< G.723 3 or 5 bit ADPCM */
-  SOX_ENCODING_CL_ADPCM  , /**< Creative Labs 8 --> 2,3,4 bit Compressed PCM */
-  SOX_ENCODING_CL_ADPCM16, /**< Creative Labs 16 --> 4 bit Compressed PCM */
-  SOX_ENCODING_MS_ADPCM  , /**< Microsoft Compressed PCM */
-  SOX_ENCODING_IMA_ADPCM , /**< IMA Compressed PCM */
-  SOX_ENCODING_OKI_ADPCM , /**< Dialogic/OKI Compressed PCM */
-  SOX_ENCODING_DPCM      , /**< Differential PCM: Fasttracker 2 (xi) */
-  SOX_ENCODING_DWVW      , /**< Delta Width Variable Word */
-  SOX_ENCODING_DWVWN     , /**< Delta Width Variable Word N-bit */
-  SOX_ENCODING_GSM       , /**< GSM 6.10 33byte frame lossy compression */
-  SOX_ENCODING_MP3       , /**< MP3 compression */
-  SOX_ENCODING_VORBIS    , /**< Vorbis compression */
-  SOX_ENCODING_AMR_WB    , /**< AMR-WB compression */
-  SOX_ENCODING_AMR_NB    , /**< AMR-NB compression */
-  SOX_ENCODING_CVSD      , /**< Continuously Variable Slope Delta modulation */
-  SOX_ENCODING_LPC10     , /**< Linear Predictive Coding */
-
-  SOX_ENCODINGS            /**< End of list marker */
-} sox_encoding_t;
-
-/**
-Client API:
-Flags for sox_encodings_info_t: lossless/lossy1/lossy2.
-*/
-typedef enum sox_encodings_flags_t {
-  sox_encodings_none   = 0, /**< no flags specified (implies lossless encoding) = 0. */
-  sox_encodings_lossy1 = 1, /**< encode, decode: lossy once = 1. */
-  sox_encodings_lossy2 = 2  /**< encode, decode, encode, decode: lossy twice = 2. */
-} sox_encodings_flags_t;
-
-/**
-Client API:
-Type of plot.
-*/
-typedef enum sox_plot_t {
-    sox_plot_off,     /**< No plot = 0. */
-    sox_plot_octave,  /**< Octave plot = 1. */
-    sox_plot_gnuplot, /**< Gnuplot plot = 2. */
-    sox_plot_data     /**< Plot data = 3. */
-} sox_plot_t;
-
-/**
-Client API:
-Loop modes: upper 4 bits mask the loop blass, lower 4 bits describe
-the loop behaviour, for example single shot, bidirectional etc.
-*/
-enum sox_loop_flags_t {
-  sox_loop_none = 0,          /**< single-shot = 0 */
-  sox_loop_forward = 1,       /**< forward loop = 1 */
-  sox_loop_forward_back = 2,  /**< forward/back loop = 2 */
-  sox_loop_8 = 32,            /**< 8 loops (??) = 32 */
-  sox_loop_sustain_decay = 64 /**< AIFF style, one sustain & one decay loop = 64 */
-};
-
-/**
-Plugins API:
-Is file a real file, a pipe, or a url?
-*/
-typedef enum lsx_io_type
-{
-    lsx_io_file, /**< File is a real file = 0. */
-    lsx_io_pipe, /**< File is a pipe (no seeking) = 1. */
-    lsx_io_url   /**< File is a URL (no seeking) = 2. */
-} lsx_io_type;
-
-/*****************************************************************************
-Macros:
-*****************************************************************************/
-
-/**
-Client API:
-Compute a 32-bit integer API version from three 8-bit parts.
-@param a Major version.
-@param b Minor version.
-@param c Revision or build number.
-@returns 32-bit integer API version 0x000a0b0c.
-*/
-#define SOX_LIB_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
-
-/**
-Client API:
-The API version of the sox.h file. It is not meant to follow the version
-number of SoX but it has historically. Please do not count on
-SOX_LIB_VERSION_CODE staying in sync with the libSoX version.
-*/
-#define SOX_LIB_VERSION_CODE   SOX_LIB_VERSION(14, 4, 0)
-
-/**
-Client API:
-Returns the smallest (negative) value storable in a twos-complement signed
-integer with the specified number of bits, cast to an unsigned integer;
-for example, SOX_INT_MIN(8) = 0x80, SOX_INT_MIN(16) = 0x8000, etc.
-@param bits Size of value for which to calculate minimum.
-@returns the smallest (negative) value storable in a twos-complement signed
-integer with the specified number of bits, cast to an unsigned integer.
-*/
-#define SOX_INT_MIN(bits) (1 <<((bits)-1))
-
-/**
-Client API:
-Returns the largest (positive) value storable in a twos-complement signed
-integer with the specified number of bits, cast to an unsigned integer;
-for example, SOX_INT_MAX(8) = 0x7F, SOX_INT_MAX(16) = 0x7FFF, etc.
-@param bits Size of value for which to calculate maximum.
-@returns the largest (positive) value storable in a twos-complement signed
-integer with the specified number of bits, cast to an unsigned integer.
-*/
-#define SOX_INT_MAX(bits) (((unsigned)-1)>>(33-(bits)))
-
-/**
-Client API:
-Returns the largest value storable in an unsigned integer with the specified
-number of bits; for example, SOX_UINT_MAX(8) = 0xFF,
-SOX_UINT_MAX(16) = 0xFFFF, etc.
-@param bits Size of value for which to calculate maximum.
-@returns the largest value storable in an unsigned integer with the specified
-number of bits.
-*/
-#define SOX_UINT_MAX(bits) (SOX_INT_MIN(bits)|SOX_INT_MAX(bits))
-
-/**
-Client API:
-Returns 0x7F.
-*/
-#define SOX_INT8_MAX  SOX_INT_MAX(8)
-
-/**
-Client API:
-Returns 0x7FFF.
-*/
-#define SOX_INT16_MAX SOX_INT_MAX(16)
-
-/**
-Client API:
-Returns 0x7FFFFF.
-*/
-#define SOX_INT24_MAX SOX_INT_MAX(24)
-
-/**
-Client API:
-Returns 0x7FFFFFFF.
-*/
-#define SOX_INT32_MAX SOX_INT_MAX(32)
-
-/**
-Client API:
-Bits in a sox_sample_t = 32.
-*/
-#define SOX_SAMPLE_PRECISION 32
-
-/**
-Client API:
-Max value for sox_sample_t = 0x7FFFFFFF.
-*/
-#define SOX_SAMPLE_MAX (sox_sample_t)SOX_INT_MAX(32)
-
-/**
-Client API:
-Min value for sox_sample_t = 0x80000000.
-*/
-#define SOX_SAMPLE_MIN (sox_sample_t)SOX_INT_MIN(32)
-
-
-/*                Conversions: Linear PCM <--> sox_sample_t
- *
- *   I/O      Input    sox_sample_t Clips?   Input    sox_sample_t Clips?
- *  Format   Minimum     Minimum     I O    Maximum     Maximum     I O
- *  ------  ---------  ------------ -- --   --------  ------------ -- --
- *  Float     -inf         -1        y n      inf      1 - 5e-10    y n
- *  Int8      -128        -128       n n      127     127.9999999   n y
- *  Int16    -32768      -32768      n n     32767    32767.99998   n y
- *  Int24   -8388608    -8388608     n n    8388607   8388607.996   n y
- *  Int32  -2147483648 -2147483648   n n   2147483647 2147483647    n n
- *
- * Conversions are as accurate as possible (with rounding).
- *
- * Rounding: halves toward +inf, all others to nearest integer.
- *
- * Clips? shows whether on not there is the possibility of a conversion
- * clipping to the minimum or maximum value when inputing from or outputing
- * to a given type.
- *
- * Unsigned integers are converted to and from signed integers by flipping
- * the upper-most bit then treating them as signed integers.
- */
-
-/**
-Client API:
-Declares the temporary local variables that are required when using SOX
-conversion macros.
-*/
-#define SOX_SAMPLE_LOCALS sox_sample_t sox_macro_temp_sample LSX_UNUSED; \
-  double sox_macro_temp_double LSX_UNUSED
-
-/**
-Client API:
-Sign bit for sox_sample_t = 0x80000000.
-*/
-#define SOX_SAMPLE_NEG SOX_INT_MIN(32)
-
-/**
-Client API:
-Converts sox_sample_t to an unsigned integer of width (bits).
-@param bits  Width of resulting sample (1 through 32).
-@param d     Input sample to be converted.
-@param clips Variable that is incremented if the result is too big.
-@returns Unsigned integer of width (bits).
-*/
-#define SOX_SAMPLE_TO_UNSIGNED(bits,d,clips) \
-  (sox_uint##bits##_t)(SOX_SAMPLE_TO_SIGNED(bits,d,clips)^SOX_INT_MIN(bits))
-
-/**
-Client API:
-Converts sox_sample_t to a signed integer of width (bits).
-@param bits  Width of resulting sample (1 through 32).
-@param d     Input sample to be converted.
-@param clips Variable that is incremented if the result is too big.
-@returns Signed integer of width (bits).
-*/
-#define SOX_SAMPLE_TO_SIGNED(bits,d,clips) \
-  (sox_int##bits##_t)(LSX_USE_VAR(sox_macro_temp_double),sox_macro_temp_sample=(d),sox_macro_temp_sample>SOX_SAMPLE_MAX-(1<<(31-bits))?++(clips),SOX_INT_MAX(bits):((sox_uint32_t)(sox_macro_temp_sample+(1<<(31-bits))))>>(32-bits))
-
-/**
-Client API:
-Converts signed integer of width (bits) to sox_sample_t.
-@param bits Width of input sample (1 through 32).
-@param d    Input sample to be converted.
-@returns SoX native sample value.
-*/
-#define SOX_SIGNED_TO_SAMPLE(bits,d)((sox_sample_t)(d)<<(32-bits))
-
-/**
-Client API:
-Converts unsigned integer of width (bits) to sox_sample_t.
-@param bits Width of input sample (1 through 32).
-@param d    Input sample to be converted.
-@returns SoX native sample value.
-*/
-#define SOX_UNSIGNED_TO_SAMPLE(bits,d)(SOX_SIGNED_TO_SAMPLE(bits,d)^SOX_SAMPLE_NEG)
-
-/**
-Client API:
-Converts unsigned 8-bit integer to sox_sample_t.
-@param d     Input sample to be converted.
-@param clips The parameter is not used.
-@returns SoX native sample value.
-*/
-#define SOX_UNSIGNED_8BIT_TO_SAMPLE(d,clips) SOX_UNSIGNED_TO_SAMPLE(8,d)
-
-/**
-Client API:
-Converts signed 8-bit integer to sox_sample_t.
-@param d    Input sample to be converted.
-@param clips The parameter is not used.
-@returns SoX native sample value.
-*/
-#define SOX_SIGNED_8BIT_TO_SAMPLE(d,clips) SOX_SIGNED_TO_SAMPLE(8,d)
-
-/**
-Client API:
-Converts unsigned 16-bit integer to sox_sample_t.
-@param d     Input sample to be converted.
-@param clips The parameter is not used.
-@returns SoX native sample value.
-*/
-#define SOX_UNSIGNED_16BIT_TO_SAMPLE(d,clips) SOX_UNSIGNED_TO_SAMPLE(16,d)
-
-/**
-Client API:
-Converts signed 16-bit integer to sox_sample_t.
-@param d    Input sample to be converted.
-@param clips The parameter is not used.
-@returns SoX native sample value.
-*/
-#define SOX_SIGNED_16BIT_TO_SAMPLE(d,clips) SOX_SIGNED_TO_SAMPLE(16,d)
-
-/**
-Client API:
-Converts unsigned 24-bit integer to sox_sample_t.
-@param d     Input sample to be converted.
-@param clips The parameter is not used.
-@returns SoX native sample value.
-*/
-#define SOX_UNSIGNED_24BIT_TO_SAMPLE(d,clips) SOX_UNSIGNED_TO_SAMPLE(24,d)
-
-/**
-Client API:
-Converts signed 24-bit integer to sox_sample_t.
-@param d    Input sample to be converted.
-@param clips The parameter is not used.
-@returns SoX native sample value.
-*/
-#define SOX_SIGNED_24BIT_TO_SAMPLE(d,clips) SOX_SIGNED_TO_SAMPLE(24,d)
-
-/**
-Client API:
-Converts unsigned 32-bit integer to sox_sample_t.
-@param d     Input sample to be converted.
-@param clips The parameter is not used.
-@returns SoX native sample value.
-*/
-#define SOX_UNSIGNED_32BIT_TO_SAMPLE(d,clips) ((sox_sample_t)(d)^SOX_SAMPLE_NEG)
-
-/**
-Client API:
-Converts signed 32-bit integer to sox_sample_t.
-@param d    Input sample to be converted.
-@param clips The parameter is not used.
-@returns SoX native sample value.
-*/
-#define SOX_SIGNED_32BIT_TO_SAMPLE(d,clips) (sox_sample_t)(d)
-
-/**
-Client API:
-Converts 32-bit float to sox_sample_t.
-@param d     Input sample to be converted, range [-1, 1).
-@param clips Variable to increment if the input sample is too large or too small.
-@returns SoX native sample value.
-*/
-#define SOX_FLOAT_32BIT_TO_SAMPLE(d,clips) (sox_sample_t)(LSX_USE_VAR(sox_macro_temp_sample),sox_macro_temp_double=(d)*(SOX_SAMPLE_MAX+1.),sox_macro_temp_double<SOX_SAMPLE_MIN?++(clips),SOX_SAMPLE_MIN:sox_macro_temp_double>=SOX_SAMPLE_MAX+1.?sox_macro_temp_double>SOX_SAMPLE_MAX+1.?++(clips),SOX_SAMPLE_MAX:SOX_SAMPLE_MAX:sox_macro_temp_double)
-
-/**
-Client API:
-Converts 64-bit float to sox_sample_t.
-@param d     Input sample to be converted, range [-1, 1).
-@param clips Variable to increment if the input sample is too large or too small.
-@returns SoX native sample value.
-*/
-#define SOX_FLOAT_64BIT_TO_SAMPLE(d,clips) (sox_sample_t)(LSX_USE_VAR(sox_macro_temp_sample),sox_macro_temp_double=(d)*(SOX_SAMPLE_MAX+1.),sox_macro_temp_double<0?sox_macro_temp_double<=SOX_SAMPLE_MIN-.5?++(clips),SOX_SAMPLE_MIN:sox_macro_temp_double-.5:sox_macro_temp_double>=SOX_SAMPLE_MAX+.5?sox_macro_temp_double>SOX_SAMPLE_MAX+1.?++(clips),SOX_SAMPLE_MAX:SOX_SAMPLE_MAX:sox_macro_temp_double+.5)
-
-/**
-Client API:
-Converts SoX native sample to an unsigned 8-bit integer.
-@param d Input sample to be converted.
-@param clips Variable to increment if input sample is too large.
-*/
-#define SOX_SAMPLE_TO_UNSIGNED_8BIT(d,clips) SOX_SAMPLE_TO_UNSIGNED(8,d,clips)
-
-/**
-Client API:
-Converts SoX native sample to an signed 8-bit integer.
-@param d Input sample to be converted.
-@param clips Variable to increment if input sample is too large.
-*/
-#define SOX_SAMPLE_TO_SIGNED_8BIT(d,clips) SOX_SAMPLE_TO_SIGNED(8,d,clips)
-
-/**
-Client API:
-Converts SoX native sample to an unsigned 16-bit integer.
-@param d Input sample to be converted.
-@param clips Variable to increment if input sample is too large.
-*/
-#define SOX_SAMPLE_TO_UNSIGNED_16BIT(d,clips) SOX_SAMPLE_TO_UNSIGNED(16,d,clips)
-
-/**
-Client API:
-Converts SoX native sample to a signed 16-bit integer.
-@param d Input sample to be converted.
-@param clips Variable to increment if input sample is too large.
-*/
-#define SOX_SAMPLE_TO_SIGNED_16BIT(d,clips) SOX_SAMPLE_TO_SIGNED(16,d,clips)
-
-/**
-Client API:
-Converts SoX native sample to an unsigned 24-bit integer.
-@param d Input sample to be converted.
-@param clips Variable to increment if input sample is too large.
-*/
-#define SOX_SAMPLE_TO_UNSIGNED_24BIT(d,clips) SOX_SAMPLE_TO_UNSIGNED(24,d,clips)
-
-/**
-Client API:
-Converts SoX native sample to a signed 24-bit integer.
-@param d Input sample to be converted.
-@param clips Variable to increment if input sample is too large.
-*/
-#define SOX_SAMPLE_TO_SIGNED_24BIT(d,clips) SOX_SAMPLE_TO_SIGNED(24,d,clips)
-
-/**
-Client API:
-Converts SoX native sample to an unsigned 32-bit integer.
-@param d Input sample to be converted.
-@param clips The parameter is not used.
-*/
-#define SOX_SAMPLE_TO_UNSIGNED_32BIT(d,clips) (sox_uint32_t)((d)^SOX_SAMPLE_NEG)
-
-/**
-Client API:
-Converts SoX native sample to a signed 32-bit integer.
-@param d Input sample to be converted.
-@param clips The parameter is not used.
-*/
-#define SOX_SAMPLE_TO_SIGNED_32BIT(d,clips) (sox_int32_t)(d)
-
-/**
-Client API:
-Converts SoX native sample to a 32-bit float.
-@param d Input sample to be converted.
-@param clips Variable to increment if input sample is too large.
-*/
-#define SOX_SAMPLE_TO_FLOAT_32BIT(d,clips) (LSX_USE_VAR(sox_macro_temp_double),sox_macro_temp_sample=(d),sox_macro_temp_sample>SOX_SAMPLE_MAX-128?++(clips),1:(((sox_macro_temp_sample+128)&~255)*(1./(SOX_SAMPLE_MAX+1.))))
-
-/**
-Client API:
-Converts SoX native sample to a 64-bit float.
-@param d Input sample to be converted.
-@param clips The parameter is not used.
-*/
-#define SOX_SAMPLE_TO_FLOAT_64BIT(d,clips) ((d)*(1./(SOX_SAMPLE_MAX+1.)))
-
-/**
-Client API:
-Clips a value of a type that is larger then sox_sample_t (for example, int64)
-to sox_sample_t's limits and increment a counter if clipping occurs.
-@param samp Value (lvalue) to be clipped, updated as necessary.
-@param clips Value (lvalue) that is incremented if clipping is needed.
-*/
-#define SOX_SAMPLE_CLIP_COUNT(samp, clips) \
-  do { \
-    if (samp > SOX_SAMPLE_MAX) \
-      { samp = SOX_SAMPLE_MAX; clips++; } \
-    else if (samp < SOX_SAMPLE_MIN) \
-      { samp = SOX_SAMPLE_MIN; clips++; } \
-  } while (0)
-
-/**
-Client API:
-Clips a value of a type that is larger then sox_sample_t (for example, int64)
-to sox_sample_t's limits and increment a counter if clipping occurs.
-@param d Value (rvalue) to be clipped.
-@param clips Value (lvalue) that is incremented if clipping is needed.
-@returns Clipped value.
-*/
-#define SOX_ROUND_CLIP_COUNT(d, clips) \
-  ((d) < 0? (d) <= SOX_SAMPLE_MIN - 0.5? ++(clips), SOX_SAMPLE_MIN: (d) - 0.5 \
-        : (d) >= SOX_SAMPLE_MAX + 0.5? ++(clips), SOX_SAMPLE_MAX: (d) + 0.5)
-
-/**
-Client API:
-Clips a value to the limits of a signed integer of the specified width
-and increment a counter if clipping occurs.
-@param bits Width (in bits) of target integer type.
-@param i Value (rvalue) to be clipped.
-@param clips Value (lvalue) that is incremented if clipping is needed.
-@returns Clipped value.
-*/
-#define SOX_INTEGER_CLIP_COUNT(bits,i,clips) ( \
-  (i) >(1 << ((bits)-1))- 1? ++(clips),(1 << ((bits)-1))- 1 : \
-  (i) <-1 << ((bits)-1)    ? ++(clips),-1 << ((bits)-1) : (i))
-
-/**
-Client API:
-Clips a value to the limits of a 16-bit signed integer and increment a counter
-if clipping occurs.
-@param i Value (rvalue) to be clipped.
-@param clips Value (lvalue) that is incremented if clipping is needed.
-@returns Clipped value.
-*/
-#define SOX_16BIT_CLIP_COUNT(i,clips) SOX_INTEGER_CLIP_COUNT(16,i,clips)
-
-/**
-Client API:
-Clips a value to the limits of a 24-bit signed integer and increment a counter
-if clipping occurs.
-@param i Value (rvalue) to be clipped.
-@param clips Value (lvalue) that is incremented if clipping is needed.
-@returns Clipped value.
-*/
-#define SOX_24BIT_CLIP_COUNT(i,clips) SOX_INTEGER_CLIP_COUNT(24,i,clips)
-
-#define SOX_SIZE_MAX ((size_t)(-1)) /**< Client API: Maximum value of size_t. */
-
-#define SOX_UNSPEC 0                         /**< Client API: Members of sox_signalinfo_t are set to SOX_UNSPEC (= 0) if the actual value is not yet known. */
-#define SOX_UNKNOWN_LEN (sox_uint64_t)(-1) /**< Client API: sox_signalinfo_t.length is set to SOX_UNKNOWN_LEN (= -1) within the effects chain if the actual length is not known. Format handlers currently use SOX_UNSPEC instead. */
-#define SOX_IGNORE_LENGTH (sox_uint64_t)(-2) /**< Client API: sox_signalinfo_t.length is set to SOX_IGNORE_LENGTH (= -2) to indicate that a format handler should ignore length information in file headers. */
-
-#define SOX_DEFAULT_CHANNELS  2     /**< Client API: Default channel count is 2 (stereo). */
-#define SOX_DEFAULT_RATE      48000 /**< Client API: Default rate is 48000Hz. */
-#define SOX_DEFAULT_PRECISION 16    /**< Client API: Default precision is 16 bits per sample. */
-#define SOX_DEFAULT_ENCODING  SOX_ENCODING_SIGN2 /**< Client API: Default encoding is SIGN2 (linear 2's complement PCM). */
-
-#define SOX_LOOP_NONE          ((unsigned char)sox_loop_none)          /**< Client API: single-shot = 0 */
-#define SOX_LOOP_8             ((unsigned char)sox_loop_8)             /**< Client API: 8 loops = 32 */
-#define SOX_LOOP_SUSTAIN_DECAY ((unsigned char)sox_loop_sustain_decay) /**< Client API: AIFF style, one sustain & one decay loop = 64 */
-
-#define SOX_MAX_NLOOPS         8 /**< Client API: Maximum number of loops supported by sox_oob_t = 8. */
-
-#define SOX_FILE_NOSTDIO 0x0001 /**< Client API: Does not use stdio routines */
-#define SOX_FILE_DEVICE  0x0002 /**< Client API: File is an audio device */
-#define SOX_FILE_PHONY   0x0004 /**< Client API: Phony file/device (for example /dev/null) */
-#define SOX_FILE_REWIND  0x0008 /**< Client API: File should be rewound to write header */
-#define SOX_FILE_BIT_REV 0x0010 /**< Client API: Is file bit-reversed? */
-#define SOX_FILE_NIB_REV 0x0020 /**< Client API: Is file nibble-reversed? */
-#define SOX_FILE_ENDIAN  0x0040 /**< Client API: Is file format endian? */
-#define SOX_FILE_ENDBIG  0x0080 /**< Client API: For endian file format, is it big endian? */
-#define SOX_FILE_MONO    0x0100 /**< Client API: Do channel restrictions allow mono? */
-#define SOX_FILE_STEREO  0x0200 /**< Client API: Do channel restrictions allow stereo? */
-#define SOX_FILE_QUAD    0x0400 /**< Client API: Do channel restrictions allow quad? */
-
-#define SOX_FILE_CHANS   (SOX_FILE_MONO | SOX_FILE_STEREO | SOX_FILE_QUAD) /**< Client API: No channel restrictions */
-#define SOX_FILE_LIT_END (SOX_FILE_ENDIAN | 0)                             /**< Client API: File is little-endian */
-#define SOX_FILE_BIG_END (SOX_FILE_ENDIAN | SOX_FILE_ENDBIG)               /**< Client API: File is big-endian */
-
-#define SOX_EFF_CHAN     1           /**< Client API: Effect might alter the number of channels */
-#define SOX_EFF_RATE     2           /**< Client API: Effect might alter sample rate */
-#define SOX_EFF_PREC     4           /**< Client API: Effect does its own calculation of output sample precision (otherwise a default value is taken, depending on the presence of SOX_EFF_MODIFY) */
-#define SOX_EFF_LENGTH   8           /**< Client API: Effect might alter audio length (as measured in time units, not necessarily in samples) */
-#define SOX_EFF_MCHAN    16          /**< Client API: Effect handles multiple channels internally */
-#define SOX_EFF_NULL     32          /**< Client API: Effect does nothing (can be optimized out of chain) */
-#define SOX_EFF_DEPRECATED 64        /**< Client API: Effect will soon be removed from SoX */
-#define SOX_EFF_GAIN     128         /**< Client API: Effect does not support gain -r */
-#define SOX_EFF_MODIFY   256         /**< Client API: Effect does not modify sample values (but might remove or duplicate samples or insert zeros) */
-#define SOX_EFF_ALPHA    512         /**< Client API: Effect is experimental/incomplete */
-#define SOX_EFF_INTERNAL 1024        /**< Client API: Effect present in libSoX but not valid for use by SoX command-line tools */
-
-/**
-Client API:
-When used as the "whence" parameter of sox_seek, indicates that the specified
-offset is relative to the beginning of the file.
-*/
-#define SOX_SEEK_SET 0
-
-/*****************************************************************************
-Forward declarations:
-*****************************************************************************/
-
-typedef struct sox_format_t sox_format_t;
-typedef struct sox_effect_t sox_effect_t;
-typedef struct sox_effect_handler_t sox_effect_handler_t;
-typedef struct sox_format_handler_t sox_format_handler_t;
-
-/*****************************************************************************
-Function pointers:
-*****************************************************************************/
-
-/**
-Client API:
-Callback to write a message to an output device (console or log file),
-used by sox_globals_t.output_message_handler.
-*/
-typedef void (LSX_API * sox_output_message_handler_t)(
-    unsigned level,                       /* 1 = FAIL, 2 = WARN, 3 = INFO, 4 = DEBUG, 5 = DEBUG_MORE, 6 = DEBUG_MOST. */
-    LSX_PARAM_IN_Z char const * filename, /* Source code __FILENAME__ from which message originates. */
-    LSX_PARAM_IN_PRINTF char const * fmt, /* Message format string. */
-    LSX_PARAM_IN va_list ap               /* Message format parameters. */
-    );
-
-/**
-Client API:
-Callback to retrieve information about a format handler,
-used by sox_format_tab_t.fn.
-@returns format handler information.
-*/
-typedef sox_format_handler_t const * (LSX_API * sox_format_fn_t)(void);
-
-/**
-Client API:
-Callback to get information about an effect handler,
-used by the table returned from sox_get_effect_fns(void).
-@returns Pointer to information about an effect handler.
-*/
-typedef sox_effect_handler_t const * (LSX_API *sox_effect_fn_t)(void);
-
-/**
-Client API:
-Callback to initialize reader (decoder), used by
-sox_format_handler.startread.
-@returns SOX_SUCCESS if successful.
-*/
-typedef int (LSX_API * sox_format_handler_startread)(
-    LSX_PARAM_INOUT sox_format_t * ft /**< Format pointer. */
-    );
-
-/**
-Client API:
-Callback to read (decode) a block of samples,
-used by sox_format_handler.read.
-@returns number of samples read, or 0 if unsuccessful.
-*/
-typedef size_t (LSX_API * sox_format_handler_read)(
-    LSX_PARAM_INOUT sox_format_t * ft, /**< Format pointer. */
-    LSX_PARAM_OUT_CAP_POST_COUNT(len,return) sox_sample_t *buf, /**< Buffer from which to read samples. */
-    size_t len /**< Number of samples available in buf. */
-    );
-
-/**
-Client API:
-Callback to close reader (decoder),
-used by sox_format_handler.stopread.
-@returns SOX_SUCCESS if successful.
-*/
-typedef int (LSX_API * sox_format_handler_stopread)(
-    LSX_PARAM_INOUT sox_format_t * ft /**< Format pointer. */
-    );
-
-/**
-Client API:
-Callback to initialize writer (encoder),
-used by sox_format_handler.startwrite.
-@returns SOX_SUCCESS if successful.
-*/
-typedef int (LSX_API * sox_format_handler_startwrite)(
-    LSX_PARAM_INOUT sox_format_t * ft /**< Format pointer. */
-    );
-
-/**
-Client API:
-Callback to write (encode) a block of samples,
-used by sox_format_handler.write.
-@returns number of samples written, or 0 if unsuccessful.
-*/
-typedef size_t (LSX_API * sox_format_handler_write)(
-    LSX_PARAM_INOUT sox_format_t * ft, /**< Format pointer. */
-    LSX_PARAM_IN_COUNT(len) sox_sample_t const * buf, /**< Buffer to which samples are written. */
-    size_t len /**< Capacity of buf, measured in samples. */
-    );
-
-/**
-Client API:
-Callback to close writer (decoder),
-used by sox_format_handler.stopwrite.
-@returns SOX_SUCCESS if successful.
-*/
-typedef int (LSX_API * sox_format_handler_stopwrite)(
-    LSX_PARAM_INOUT sox_format_t * ft /**< Format pointer. */
-    );
-
-/**
-Client API:
-Callback to reposition reader,
-used by sox_format_handler.seek.
-@returns SOX_SUCCESS if successful.
-*/
-typedef int (LSX_API * sox_format_handler_seek)(
-    LSX_PARAM_INOUT sox_format_t * ft, /**< Format pointer. */
-    sox_uint64_t offset /**< Sample offset to which reader should be positioned. */
-    );
-
-/**
-Client API:
-Callback to parse command-line arguments (called once per effect),
-used by sox_effect_handler.getopts.
-@returns SOX_SUCCESS if successful.
-*/
-typedef int (LSX_API * sox_effect_handler_getopts)(
-    LSX_PARAM_INOUT sox_effect_t * effp, /**< Effect pointer. */
-    int argc, /**< Number of arguments in argv. */
-    LSX_PARAM_IN_COUNT(argc) char *argv[] /**< Array of command-line arguments. */
-    );
-
-/**
-Client API:
-Callback to initialize effect (called once per flow),
-used by sox_effect_handler.start.
-@returns SOX_SUCCESS if successful.
-*/
-typedef int (LSX_API * sox_effect_handler_start)(
-    LSX_PARAM_INOUT sox_effect_t * effp /**< Effect pointer. */
-    );
-
-/**
-Client API:
-Callback to process samples,
-used by sox_effect_handler.flow.
-@returns SOX_SUCCESS if successful.
-*/
-typedef int (LSX_API * sox_effect_handler_flow)(
-    LSX_PARAM_INOUT sox_effect_t * effp, /**< Effect pointer. */
-    LSX_PARAM_IN_COUNT(*isamp) sox_sample_t const * ibuf, /**< Buffer from which to read samples. */
-    LSX_PARAM_OUT_CAP_POST_COUNT(*osamp,*osamp) sox_sample_t * obuf, /**< Buffer to which samples are written. */
-    LSX_PARAM_INOUT size_t *isamp, /**< On entry, contains capacity of ibuf; on exit, contains number of samples consumed. */
-    LSX_PARAM_INOUT size_t *osamp /**< On entry, contains capacity of obuf; on exit, contains number of samples written. */
-    );
-
-/**
-Client API:
-Callback to finish getting output after input is complete,
-used by sox_effect_handler.drain.
-@returns SOX_SUCCESS if successful.
-*/
-typedef int (LSX_API * sox_effect_handler_drain)(
-    LSX_PARAM_INOUT sox_effect_t * effp, /**< Effect pointer. */
-    LSX_PARAM_OUT_CAP_POST_COUNT(*osamp,*osamp) sox_sample_t *obuf, /**< Buffer to which samples are written. */
-    LSX_PARAM_INOUT size_t *osamp /**< On entry, contains capacity of obuf; on exit, contains number of samples written. */
-    );
-
-/**
-Client API:
-Callback to shut down effect (called once per flow),
-used by sox_effect_handler.stop.
-@returns SOX_SUCCESS if successful.
-*/
-typedef int (LSX_API * sox_effect_handler_stop)(
-    LSX_PARAM_INOUT sox_effect_t * effp /**< Effect pointer. */
-    );
-
-/**
-Client API:
-Callback to shut down effect (called once per effect),
-used by sox_effect_handler.kill.
-@returns SOX_SUCCESS if successful.
-*/
-typedef int (LSX_API * sox_effect_handler_kill)(
-    LSX_PARAM_INOUT sox_effect_t * effp /**< Effect pointer. */
-    );
-
-/**
-Client API:
-Callback called while flow is running (called once per buffer),
-used by sox_flow_effects.callback.
-@returns SOX_SUCCESS to continue, other value to abort flow.
-*/
-typedef int (LSX_API * sox_flow_effects_callback)(
-    sox_bool all_done,
-    void * client_data
-    );
-
-/**
-Client API:
-Callback for enumerating the contents of a playlist,
-used by the sox_parse_playlist function.
-@returns SOX_SUCCESS if successful, any other value to abort playlist enumeration.
-*/
-typedef int (LSX_API * sox_playlist_callback_t)(
-    void * callback_data,
-    LSX_PARAM_IN_Z char const * filename
-    );
-
-/*****************************************************************************
-Structures:
-*****************************************************************************/
-
-/**
-Client API:
-Information about a build of libSoX, returned from the sox_version_info
-function.
-*/
-typedef struct sox_version_info_t {
-    size_t       size;         /**< structure size = sizeof(sox_version_info_t) */
-    sox_version_flags_t flags; /**< feature flags = popen | magic | threads | memopen */
-    sox_uint32_t version_code; /**< version number = 0x140400 */
-    char const * version;      /**< version string = sox_version(), for example, "14.4.0" */
-    char const * version_extra;/**< version extra info or null = "PACKAGE_EXTRA", for example, "beta" */
-    char const * time;         /**< build time = "__DATE__ __TIME__", for example, "Jan  7 2010 03:31:50" */
-    char const * distro;       /**< distro or null = "DISTRO", for example, "Debian" */
-    char const * compiler;     /**< compiler info or null, for example, "msvc 160040219" */
-    char const * arch;         /**< arch, for example, "1248 48 44 L OMP" */
-    /* new info should be added at the end for version backwards-compatibility. */
-} sox_version_info_t;
-
-/**
-Client API:
-Global parameters (for effects & formats), returned from the sox_get_globals
-function.
-*/
-typedef struct sox_globals_t {
-/* public: */
-  unsigned     verbosity; /**< messages are only written if globals.verbosity >= message.level */
-  sox_output_message_handler_t output_message_handler; /**< client-specified message output callback */
-  sox_bool     repeatable; /**< true to use pre-determined timestamps and PRNG seed */
-
-  /**
-  Default size (in bytes) used by libSoX for blocks of sample data.
-  Plugins should use similarly-sized buffers to get best performance.
-  */
-  size_t       bufsiz;
-
-  /**
-  Default size (in bytes) used by libSoX for blocks of input sample data.
-  Plugins should use similarly-sized buffers to get best performance.
-  */
-  size_t       input_bufsiz;
-
-  sox_int32_t  ranqd1; /**< Can be used to re-seed libSoX's PRNG */
-
-  char const * stdin_in_use_by;  /**< Private: tracks the name of the handler currently using stdin */
-  char const * stdout_in_use_by; /**< Private: tracks the name of the handler currently using stdout */
-  char const * subsystem;        /**< Private: tracks the name of the handler currently writing an output message */
-  char       * tmp_path;         /**< Private: client-configured path to use for temporary files */
-  sox_bool     use_magic;        /**< Private: true if client has requested use of 'magic' file-type detection */
-  sox_bool     use_threads;      /**< Private: true if client has requested parallel effects processing */
-} sox_globals_t;
-
-/**
-Client API:
-Signal parameters; members should be set to SOX_UNSPEC (= 0) if unknown.
-*/
-typedef struct sox_signalinfo_t {
-  sox_rate_t       rate;         /**< samples per second, 0 if unknown */
-  unsigned         channels;     /**< number of sound channels, 0 if unknown */
-  unsigned         precision;    /**< bits per sample, 0 if unknown */
-  sox_uint64_t     length;       /**< samples * chans in file, 0 if unknown, -1 if unspecified */
-  double           * mult;       /**< Effects headroom multiplier; may be null */
-} sox_signalinfo_t;
-
-/**
-Client API:
-Basic information about an encoding.
-*/
-typedef struct sox_encodings_info_t {
-  sox_encodings_flags_t flags; /**< lossy once (lossy1), lossy twice (lossy2), or lossless (none). */
-  char const * name;           /**< encoding name. */
-  char const * desc;           /**< encoding description. */
-} sox_encodings_info_t;
-
-/**
-Client API:
-Encoding parameters.
-*/
-typedef struct sox_encodinginfo_t {
-  sox_encoding_t encoding; /**< format of sample numbers */
-  unsigned bits_per_sample;/**< 0 if unknown or variable; uncompressed value if lossless; compressed value if lossy */
-  double compression;      /**< compression factor (where applicable) */
-
-  /**
-  Should bytes be reversed? If this is default during sox_open_read or
-  sox_open_write, libSoX will set them to either no or yes according to the
-  machine or format default.
-  */
-  sox_option_t reverse_bytes;
-
-  /**
-  Should nibbles be reversed? If this is default during sox_open_read or
-  sox_open_write, libSoX will set them to either no or yes according to the
-  machine or format default.
-  */
-  sox_option_t reverse_nibbles;
-
-  /**
-  Should bits be reversed? If this is default during sox_open_read or
-  sox_open_write, libSoX will set them to either no or yes according to the
-  machine or format default.
-  */
-  sox_option_t reverse_bits;
-
-  /**
-  If set to true, the format should reverse its default endianness.
-  */
-  sox_bool opposite_endian;
-} sox_encodinginfo_t;
-
-/**
-Client API:
-Looping parameters (out-of-band data).
-*/
-typedef struct sox_loopinfo_t {
-  sox_uint64_t  start;  /**< first sample */
-  sox_uint64_t  length; /**< length */
-  unsigned      count;  /**< number of repeats, 0=forever */
-  unsigned char type;   /**< 0=no, 1=forward, 2=forward/back (see sox_loop_* for valid values). */
-} sox_loopinfo_t;
-
-/**
-Client API:
-Instrument information.
-*/
-typedef struct sox_instrinfo_t{
-  signed char MIDInote;   /**< for unity pitch playback */
-  signed char MIDIlow;    /**< MIDI pitch-bend low range */
-  signed char MIDIhi;     /**< MIDI pitch-bend high range */
-  unsigned char loopmode; /**< 0=no, 1=forward, 2=forward/back (see sox_loop_* values) */
-  unsigned nloops;  /**< number of active loops (max SOX_MAX_NLOOPS). */
-} sox_instrinfo_t;
-
-/**
-Client API:
-File buffer info.  Holds info so that data can be read in blocks.
-*/
-typedef struct sox_fileinfo_t {
-  char          *buf;                 /**< Pointer to data buffer */
-  size_t        size;                 /**< Size of buffer in bytes */
-  size_t        count;                /**< Count read into buffer */
-  size_t        pos;                  /**< Position in buffer */
-} sox_fileinfo_t;
-
-/**
-Client API:
-Handler structure defined by each format.
-*/
-struct sox_format_handler_t {
-  unsigned     sox_lib_version_code;  /**< Checked on load; must be 1st in struct*/
-  char         const * description;   /**< short description of format */
-  char         const * const * names; /**< null-terminated array of filename extensions that are handled by this format */
-  unsigned int flags;                 /**< File flags (SOX_FILE_* values). */
-  sox_format_handler_startread startread; /**< called to initialize reader (decoder) */
-  sox_format_handler_read read;       /**< called to read (decode) a block of samples */
-  sox_format_handler_stopread stopread; /**< called to close reader (decoder); may be null if no closing necessary */
-  sox_format_handler_startwrite startwrite; /**< called to initialize writer (encoder) */
-  sox_format_handler_write write;     /**< called to write (encode) a block of samples */
-  sox_format_handler_stopwrite stopwrite; /**< called to close writer (decoder); may be null if no closing necessary */
-  sox_format_handler_seek seek;       /**< called to reposition reader; may be null if not supported */
-
-  /**
-  Array of values indicating the encodings and precisions supported for
-  writing (encoding). Precisions specified with default precision first.
-  Encoding, precision, precision, ..., 0, repeat. End with one more 0.
-  Example:
-  unsigned const * formats = {
-    SOX_ENCODING_SIGN2, 16, 24, 0, // Support SIGN2 at 16 and 24 bits, default to 16 bits.
-    SOX_ENCODING_UNSIGNED, 8, 0,   // Support UNSIGNED at 8 bits, default to 8 bits.
-    0 // No more supported encodings.
-  };
-  */
-  unsigned     const * write_formats;
-
-  /**
-  Array of sample rates (samples per second) supported for writing (encoding).
-  NULL if all (or almost all) rates are supported. End with 0.
-  */
-  sox_rate_t   const * write_rates;
-
-  /**
-  SoX will automatically allocate a buffer in which the handler can store data.
-  Specify the size of the buffer needed here. Usually this will be sizeof(your_struct).
-  The buffer will be allocated and zeroed before the call to startread/startwrite.
-  The buffer will be freed after the call to stopread/stopwrite.
-  The buffer will be provided via format.priv in each call to the handler.
-  */
-  size_t       priv_size;
-};
-
-/**
-Client API:
-Comments, instrument info, loop info (out-of-band data).
-*/
-typedef struct sox_oob_t{
-  /* Decoded: */
-  sox_comments_t   comments;              /**< Comment strings in id=value format. */
-  sox_instrinfo_t  instr;                 /**< Instrument specification */
-  sox_loopinfo_t   loops[SOX_MAX_NLOOPS]; /**< Looping specification */
-
-  /* TBD: Non-decoded chunks, etc: */
-} sox_oob_t;
-
-/**
-Client API:
-Data passed to/from the format handler
-*/
-struct sox_format_t {
-  char             * filename;      /**< File name */
-
-  /**
-  Signal specifications for reader (decoder) or writer (encoder):
-  sample rate, number of channels, precision, length, headroom multiplier.
-  Any info specified by the user is here on entry to startread or
-  startwrite. Info will be SOX_UNSPEC if the user provided no info.
-  At exit from startread, should be completely filled in, using
-  either data from the file's headers (if available) or whatever
-  the format is guessing/assuming (if header data is not available).
-  At exit from startwrite, should be completely filled in, using
-  either the data that was specified, or values chosen by the format
-  based on the format's defaults or capabilities.
-  */
-  sox_signalinfo_t signal;
-
-  /**
-  Encoding specifications for reader (decoder) or writer (encoder):
-  encoding (sample format), bits per sample, compression rate, endianness.
-  Should be filled in by startread. Values specified should be used
-  by startwrite when it is configuring the encoding parameters.
-  */
-  sox_encodinginfo_t encoding;
-
-  char             * filetype;      /**< Type of file, as determined by header inspection or libmagic. */
-  sox_oob_t        oob;             /**< comments, instrument info, loop info (out-of-band data) */
-  sox_bool         seekable;        /**< Can seek on this file */
-  char             mode;            /**< Read or write mode ('r' or 'w') */
-  sox_uint64_t     olength;         /**< Samples * chans written to file */
-  sox_uint64_t     clips;           /**< Incremented if clipping occurs */
-  int              sox_errno;       /**< Failure error code */
-  char             sox_errstr[256]; /**< Failure error text */
-  void             * fp;            /**< File stream pointer */
-  lsx_io_type      io_type;         /**< Stores whether this is a file, pipe or URL */
-  sox_uint64_t     tell_off;        /**< Current offset within file */
-  sox_uint64_t     data_start;      /**< Offset at which headers end and sound data begins (set by lsx_check_read_params) */
-  sox_format_handler_t handler;     /**< Format handler for this file */
-  void             * priv;          /**< Format handler's private data area */
-};
-
-/**
-Client API:
-Information about a loaded format handler, including the format name and a
-function pointer that can be invoked to get additional information about the
-format.
-*/
-typedef struct sox_format_tab_t {
-  char *name;         /**< Name of format handler */
-  sox_format_fn_t fn; /**< Function to call to get format handler's information */
-} sox_format_tab_t;
-
-/**
-Client API:
-Global parameters for effects.
-*/
-typedef struct sox_effects_globals_t {
-  sox_plot_t plot;         /**< To help the user choose effect & options */
-  sox_globals_t * global_info; /**< Pointer to associated SoX globals */
-} sox_effects_globals_t;
-
-/**
-Client API:
-Effect handler information.
-*/
-struct sox_effect_handler_t {
-  char const * name;  /**< Effect name */
-  char const * usage; /**< Short explanation of parameters accepted by effect */
-  unsigned int flags; /**< Combination of SOX_EFF_* flags */
-  sox_effect_handler_getopts getopts; /**< Called to parse command-line arguments (called once per effect). */
-  sox_effect_handler_start start;     /**< Called to initialize effect (called once per flow). */
-  sox_effect_handler_flow flow;       /**< Called to process samples. */
-  sox_effect_handler_drain drain;     /**< Called to finish getting output after input is complete. */
-  sox_effect_handler_stop stop;       /**< Called to shut down effect (called once per flow). */
-  sox_effect_handler_kill kill;       /**< Called to shut down effect (called once per effect). */
-  size_t       priv_size;             /**< Size of private data SoX should pre-allocate for effect */
-};
-
-/**
-Client API:
-Effect information.
-*/
-struct sox_effect_t {
-  sox_effects_globals_t    * global_info; /**< global effect parameters */
-  sox_signalinfo_t         in_signal;     /**< Information about the incoming data stream */
-  sox_signalinfo_t         out_signal;    /**< Information about the outgoing data stream */
-  sox_encodinginfo_t       const * in_encoding;  /**< Information about the incoming data encoding */
-  sox_encodinginfo_t       const * out_encoding; /**< Information about the outgoing data encoding */
-  sox_effect_handler_t     handler;   /**< The handler for this effect */
-  sox_sample_t             * obuf;    /**< output buffer */
-  size_t                   obeg;      /**< output buffer: start of valid data section */
-  size_t                   oend;      /**< output buffer: one past valid data section (oend-obeg is length of current content) */
-  size_t               imin;          /**< minimum input buffer content required for calling this effect's flow function; set via lsx_effect_set_imin() */
-  sox_uint64_t         clips;         /**< increment if clipping occurs */
-  size_t               flows;         /**< 1 if MCHAN, number of chans otherwise */
-  size_t               flow;          /**< flow number */
-  void                 * priv;        /**< Effect's private data area (each flow has a separate copy) */
-};
-
-/**
-Client API:
-Chain of effects to be applied to a stream.
-*/
-typedef struct sox_effects_chain_t {
-  sox_effect_t **effects;                  /**< Table of effects to be applied to a stream */
-  unsigned table_size;                     /**< Number of entries in effects table */
-  unsigned length;                         /**< Number of effects to be applied */
-  sox_sample_t **ibufc;                    /**< Channel interleave buffer */
-  sox_sample_t **obufc;                    /**< Channel interleave buffer */
-  sox_effects_globals_t global_info;       /**< Copy of global effects settings */
-  sox_encodinginfo_t const * in_enc;       /**< Input encoding */
-  sox_encodinginfo_t const * out_enc;      /**< Output encoding */
-} sox_effects_chain_t;
-
-/*****************************************************************************
-Functions:
-*****************************************************************************/
-
-/**
-Client API:
-Returns version number string of libSoX, for example, "14.4.0".
-@returns The version number string of libSoX, for example, "14.4.0".
-*/
-LSX_RETURN_VALID_Z LSX_RETURN_PURE
-char const *
-LSX_API
-sox_version(void);
-
-/**
-Client API:
-Returns information about this build of libsox.
-@returns Pointer to a version information structure.
-*/
-LSX_RETURN_VALID LSX_RETURN_PURE
-sox_version_info_t const *
-LSX_API
-sox_version_info(void);
-
-/**
-Client API:
-Returns a pointer to the structure with libSoX's global settings.
-@returns a pointer to the structure with libSoX's global settings.
-*/
-LSX_RETURN_VALID LSX_RETURN_PURE
-sox_globals_t *
-LSX_API
-sox_get_globals(void);
-
-/**
-Client API:
-Deprecated macro that returns the structure with libSoX's global settings
-as an lvalue.
-*/
-#define sox_globals (*sox_get_globals())
-
-/**
-Client API:
-Returns a pointer to the list of available encodings.
-End of list indicated by name == NULL.
-@returns pointer to the list of available encodings.
-*/
-LSX_RETURN_ARRAY LSX_RETURN_PURE
-sox_encodings_info_t const *
-LSX_API
-sox_get_encodings_info(void);
-
-/**
-Client API:
-Deprecated macro that returns the list of available encodings.
-End of list indicated by name == NULL.
-*/
-#define sox_encodings_info (sox_get_encodings_info())
-
-/**
-Client API:
-Fills in an encodinginfo with default values.
-*/
-void
-LSX_API
-sox_init_encodinginfo(
-    LSX_PARAM_OUT sox_encodinginfo_t * e /**< Pointer to uninitialized encoding info structure to be initialized. */
-    );
-
-/**
-Client API:
-Given an encoding (for example, SIGN2) and the encoded bits_per_sample (for
-example, 16), returns the number of useful bits per sample in the decoded data
-(for example, 16), or returns 0 to indicate that the value returned by the
-format handler should be used instead of a pre-determined precision.
-@returns the number of useful bits per sample in the decoded data (for example
-16), or returns 0 to indicate that the value returned by the format handler
-should be used instead of a pre-determined precision.
-*/
-LSX_RETURN_PURE
-unsigned
-LSX_API
-sox_precision(
-    sox_encoding_t encoding,   /**< Encoding for which to lookup precision information. */
-    unsigned bits_per_sample   /**< The number of encoded bits per sample. */
-    );
-
-/**
-Client API:
-Returns the number of items in the metadata block.
-@returns the number of items in the metadata block.
-*/
-size_t
-LSX_API
-sox_num_comments(
-    LSX_PARAM_IN_OPT sox_comments_t comments /**< Metadata block. */
-    );
-
-/**
-Client API:
-Adds an "id=value" item to the metadata block.
-*/
-void
-LSX_API
-sox_append_comment(
-    LSX_PARAM_DEREF_PRE_MAYBENULL LSX_PARAM_DEREF_POST_NOTNULL sox_comments_t * comments, /**< Metadata block. */
-    LSX_PARAM_IN_Z char const * item /**< Item to be added in "id=value" format. */
-    );
-
-/**
-Client API:
-Adds a newline-delimited list of "id=value" items to the metadata block.
-*/
-void
-LSX_API
-sox_append_comments(
-    LSX_PARAM_DEREF_PRE_MAYBENULL LSX_PARAM_DEREF_POST_NOTNULL sox_comments_t * comments, /**< Metadata block. */
-    LSX_PARAM_IN_Z char const * items /**< Newline-separated list of items to be added, for example "id1=value1\\nid2=value2". */
-    );
-
-/**
-Client API:
-Duplicates the metadata block.
-@returns the copied metadata block.
-*/
-LSX_RETURN_OPT
-sox_comments_t
-LSX_API
-sox_copy_comments(
-    LSX_PARAM_IN_OPT sox_comments_t comments /**< Metadata block to copy. */
-    );
-
-/**
-Client API:
-Frees the metadata block.
-*/
-void
-LSX_API
-sox_delete_comments(
-    LSX_PARAM_DEREF_PRE_MAYBENULL LSX_PARAM_DEREF_POST_NULL sox_comments_t * comments /**< Metadata block. */
-    );
-
-/**
-Client API:
-If "id=value" is found, return value, else return null.
-@returns value, or null if value not found.
-*/
-LSX_RETURN_OPT
-char const *
-LSX_API
-sox_find_comment(
-    LSX_PARAM_IN_OPT sox_comments_t comments, /**< Metadata block in which to search. */
-    LSX_PARAM_IN_Z char const * id /**< Id for which to search */
-    );
-
-/**
-Client API:
-Find and load format handler plugins.
-@returns SOX_SUCCESS if successful.
-*/
-int
-LSX_API
-sox_format_init(void);
-
-/**
-Client API:
-Unload format handler plugins.
-*/
-void
-LSX_API
-sox_format_quit(void);
-
-/**
-Client API:
-Initialize effects library.
-@returns SOX_SUCCESS if successful.
-*/
-int
-LSX_API
-sox_init(void);
-
-/**
-Client API:
-Close effects library and unload format handler plugins.
-@returns SOX_SUCCESS if successful.
-*/
-int
-LSX_API
-sox_quit(void);
-
-/**
-Client API:
-Returns the table of format handler names and functions.
-@returns the table of format handler names and functions.
-*/
-LSX_RETURN_ARRAY LSX_RETURN_PURE
-sox_format_tab_t const *
-LSX_API
-sox_get_format_fns(void);
-
-/**
-Client API:
-Deprecated macro that returns the table of format handler names and functions.
-*/
-#define sox_format_fns (sox_get_format_fns())
-
-/**
-Client API:
-Opens a decoding session for a file. Returned handle must be closed with sox_close().
-@returns The handle for the new session, or null on failure.
-*/
-LSX_RETURN_OPT
-sox_format_t *
-LSX_API
-sox_open_read(
-    LSX_PARAM_IN_Z   char               const * path,      /**< Path to file to be opened (required). */
-    LSX_PARAM_IN_OPT sox_signalinfo_t   const * signal,    /**< Information already known about audio stream, or NULL if none. */
-    LSX_PARAM_IN_OPT sox_encodinginfo_t const * encoding,  /**< Information already known about sample encoding, or NULL if none. */
-    LSX_PARAM_IN_OPT_Z char             const * filetype   /**< Previously-determined file type, or NULL to auto-detect. */
-    );
-
-/**
-Client API:
-Opens a decoding session for a memory buffer. Returned handle must be closed with sox_close().
-@returns The handle for the new session, or null on failure.
-*/
-LSX_RETURN_OPT
-sox_format_t *
-LSX_API
-sox_open_mem_read(
-    LSX_PARAM_IN_BYTECOUNT(buffer_size) void  * buffer,     /**< Pointer to audio data buffer (required). */
-    size_t                                      buffer_size,/**< Number of bytes to read from audio data buffer. */
-    LSX_PARAM_IN_OPT sox_signalinfo_t   const * signal,     /**< Information already known about audio stream, or NULL if none. */
-    LSX_PARAM_IN_OPT sox_encodinginfo_t const * encoding,   /**< Information already known about sample encoding, or NULL if none. */
-    LSX_PARAM_IN_OPT_Z char             const * filetype    /**< Previously-determined file type, or NULL to auto-detect. */
-    );
-
-/**
-Client API:
-Returns true if the format handler for the specified file type supports the specified encoding.
-@returns true if the format handler for the specified file type supports the specified encoding.
-*/
-sox_bool
-LSX_API
-sox_format_supports_encoding(
-    LSX_PARAM_IN_OPT_Z char               const * path,       /**< Path to file to be examined (required if filetype is NULL). */
-    LSX_PARAM_IN_OPT_Z char               const * filetype,   /**< Previously-determined file type, or NULL to use extension from path. */
-    LSX_PARAM_IN       sox_encodinginfo_t const * encoding    /**< Encoding for which format handler should be queried. */
-    );
-
-/**
-Client API:
-Gets the format handler for a specified file type.
-@returns The found format handler, or null if not found.
-*/
-LSX_RETURN_OPT
-sox_format_handler_t const *
-LSX_API
-sox_write_handler(
-    LSX_PARAM_IN_OPT_Z char               const * path,         /**< Path to file (required if filetype is NULL). */
-    LSX_PARAM_IN_OPT_Z char               const * filetype,     /**< Filetype for which handler is needed, or NULL to use extension from path. */
-    LSX_PARAM_OUT_OPT  char               const * * filetype1   /**< Receives the filetype that was detected. Pass NULL if not needed. */
-    );
-
-/**
-Client API:
-Opens an encoding session for a file. Returned handle must be closed with sox_close().
-@returns The new session handle, or null on failure.
-*/
-LSX_RETURN_OPT
-sox_format_t *
-LSX_API
-sox_open_write(
-    LSX_PARAM_IN_Z     char               const * path,     /**< Path to file to be written (required). */
-    LSX_PARAM_IN       sox_signalinfo_t   const * signal,   /**< Information about desired audio stream (required). */
-    LSX_PARAM_IN_OPT   sox_encodinginfo_t const * encoding, /**< Information about desired sample encoding, or NULL to use defaults. */
-    LSX_PARAM_IN_OPT_Z char               const * filetype, /**< Previously-determined file type, or NULL to auto-detect. */
-    LSX_PARAM_IN_OPT   sox_oob_t          const * oob,      /**< Out-of-band data to add to file, or NULL if none. */
-    LSX_PARAM_IN_OPT   sox_bool           (LSX_API * overwrite_permitted)(LSX_PARAM_IN_Z char const * filename) /**< Called if file exists to determine whether overwrite is ok. */
-    );
-
-/**
-Client API:
-Opens an encoding session for a memory buffer. Returned handle must be closed with sox_close().
-@returns The new session handle, or null on failure.
-*/
-LSX_RETURN_OPT
-sox_format_t *
-LSX_API
-sox_open_mem_write(
-    LSX_PARAM_OUT_BYTECAP(buffer_size) void                     * buffer,      /**< Pointer to audio data buffer that receives data (required). */
-    LSX_PARAM_IN                       size_t                     buffer_size, /**< Maximum number of bytes to write to audio data buffer. */
-    LSX_PARAM_IN                       sox_signalinfo_t   const * signal,      /**< Information about desired audio stream (required). */
-    LSX_PARAM_IN_OPT                   sox_encodinginfo_t const * encoding,    /**< Information about desired sample encoding, or NULL to use defaults. */
-    LSX_PARAM_IN_OPT_Z                 char               const * filetype,    /**< Previously-determined file type, or NULL to auto-detect. */
-    LSX_PARAM_IN_OPT                   sox_oob_t          const * oob          /**< Out-of-band data to add to file, or NULL if none. */
-    );
-
-/**
-Client API:
-Opens an encoding session for a memstream buffer. Returned handle must be closed with sox_close().
-@returns The new session handle, or null on failure.
-*/
-LSX_RETURN_OPT
-sox_format_t *
-LSX_API
-sox_open_memstream_write(
-    LSX_PARAM_OUT      char                     * * buffer_ptr,    /**< Receives pointer to audio data buffer that receives data (required). */
-    LSX_PARAM_OUT      size_t                   * buffer_size_ptr, /**< Receives size of data written to audio data buffer (required). */
-    LSX_PARAM_IN       sox_signalinfo_t   const * signal,          /**< Information about desired audio stream (required). */
-    LSX_PARAM_IN_OPT   sox_encodinginfo_t const * encoding,        /**< Information about desired sample encoding, or NULL to use defaults. */
-    LSX_PARAM_IN_OPT_Z char               const * filetype,        /**< Previously-determined file type, or NULL to auto-detect. */
-    LSX_PARAM_IN_OPT   sox_oob_t          const * oob              /**< Out-of-band data to add to file, or NULL if none. */
-    );
-
-/**
-Client API:
-Reads samples from a decoding session into a sample buffer.
-@returns Number of samples decoded, or 0 for EOF.
-*/
-size_t
-LSX_API
-sox_read(
-    LSX_PARAM_INOUT sox_format_t * ft, /**< Format pointer. */
-    LSX_PARAM_OUT_CAP_POST_COUNT(len,return) sox_sample_t *buf, /**< Buffer from which to read samples. */
-    size_t len /**< Number of samples available in buf. */
-    );
-
-/**
-Client API:
-Writes samples to an encoding session from a sample buffer.
-@returns Number of samples encoded.
-*/
-size_t
-LSX_API
-sox_write(
-    LSX_PARAM_INOUT sox_format_t * ft, /**< Format pointer. */
-    LSX_PARAM_IN_COUNT(len) sox_sample_t const * buf, /**< Buffer from which to read samples. */
-    size_t len /**< Number of samples available in buf. */
-    );
-
-/**
-Client API:
-Closes an encoding or decoding session.
-@returns SOX_SUCCESS if successful.
-*/
-int
-LSX_API
-sox_close(
-    LSX_PARAM_INOUT sox_format_t * ft /**< Format pointer. */
-    );
-
-/**
-Client API:
-Sets the location at which next samples will be decoded. Returns SOX_SUCCESS if successful.
-@returns SOX_SUCCESS if successful.
-*/
-int
-LSX_API
-sox_seek(
-    LSX_PARAM_INOUT sox_format_t * ft, /**< Format pointer. */
-    sox_uint64_t offset, /**< Sample offset at which to position reader. */
-    int whence /**< Set to SOX_SEEK_SET. */
-    );
-
-/**
-Client API:
-Finds a format handler by name.
-@returns Format handler data, or null if not found.
-*/
-LSX_RETURN_OPT
-sox_format_handler_t const *
-LSX_API
-sox_find_format(
-    LSX_PARAM_IN_Z char const * name, /**< Name of format handler to find. */
-    sox_bool ignore_devices /**< Set to true to ignore device names. */
-    );
-
-/**
-Client API:
-Returns global parameters for effects
-@returns global parameters for effects.
-*/
-LSX_RETURN_VALID LSX_RETURN_PURE
-sox_effects_globals_t *
-LSX_API
-sox_get_effects_globals(void);
-
-/**
-Client API:
-Deprecated macro that returns global parameters for effects.
-*/
-#define sox_effects_globals (*sox_get_effects_globals())
-
-/**
-Client API:
-Finds the effect handler with the given name.
-@returns Effect pointer, or null if not found.
-*/
-LSX_RETURN_OPT LSX_RETURN_PURE
-sox_effect_handler_t const *
-LSX_API
-sox_find_effect(
-    LSX_PARAM_IN_Z char const * name /**< Name of effect to find. */
-    );
-
-/**
-Client API:
-Creates an effect using the given handler.
-@returns The new effect, or null if not found.
-*/
-LSX_RETURN_OPT
-sox_effect_t *
-LSX_API
-sox_create_effect(
-    LSX_PARAM_IN sox_effect_handler_t const * eh /**< Handler to use for effect. */
-    );
-
-/**
-Client API:
-Applies the command-line options to the effect.
-@returns the number of arguments consumed.
-*/
-int
-LSX_API
-sox_effect_options(
-    LSX_PARAM_IN sox_effect_t *effp, /**< Effect pointer on which to set options. */
-    int argc, /**< Number of arguments in argv. */
-    LSX_PARAM_IN_COUNT(argc) char * const argv[] /**< Array of command-line options. */
-    );
-
-/**
-Client API:
-Returns an array containing the known effect handlers.
-@returns An array containing the known effect handlers.
-*/
-LSX_RETURN_VALID_Z LSX_RETURN_PURE
-sox_effect_fn_t const *
-LSX_API
-sox_get_effect_fns(void);
-
-/**
-Client API:
-Deprecated macro that returns an array containing the known effect handlers.
-*/
-#define sox_effect_fns (sox_get_effect_fns())
-
-/**
-Client API:
-Initializes an effects chain. Returned handle must be closed with sox_delete_effects_chain().
-@returns Handle, or null on failure.
-*/
-LSX_RETURN_OPT
-sox_effects_chain_t *
-LSX_API
-sox_create_effects_chain(
-    LSX_PARAM_IN sox_encodinginfo_t const * in_enc, /**< Input encoding. */
-    LSX_PARAM_IN sox_encodinginfo_t const * out_enc /**< Output encoding. */
-    );
-
-/**
-Client API:
-Closes an effects chain.
-*/
-void
-LSX_API
-sox_delete_effects_chain(
-    LSX_PARAM_INOUT sox_effects_chain_t *ecp /**< Effects chain pointer. */
-    );
-
-/**
-Client API:
-Adds an effect to the effects chain, returns SOX_SUCCESS if successful.
-@returns SOX_SUCCESS if successful.
-*/
-int
-LSX_API
-sox_add_effect(
-    LSX_PARAM_INOUT sox_effects_chain_t * chain, /**< Effects chain to which effect should be added . */
-    LSX_PARAM_INOUT sox_effect_t * effp, /**< Effect to be added. */
-    LSX_PARAM_INOUT sox_signalinfo_t * in, /**< Input format. */
-    LSX_PARAM_IN    sox_signalinfo_t const * out /**< Output format. */
-    );
-
-/**
-Client API:
-Runs the effects chain, returns SOX_SUCCESS if successful.
-@returns SOX_SUCCESS if successful.
-*/
-int
-LSX_API
-sox_flow_effects(
-    LSX_PARAM_INOUT  sox_effects_chain_t * chain, /**< Effects chain to run. */
-    LSX_PARAM_IN_OPT sox_flow_effects_callback callback, /**< Callback for monitoring flow progress. */
-    LSX_PARAM_IN_OPT void * client_data /**< Data to pass into callback. */
-    );
-
-/**
-Client API:
-Gets the number of clips that occurred while running an effects chain.
-@returns the number of clips that occurred while running an effects chain.
-*/
-sox_uint64_t
-LSX_API
-sox_effects_clips(
-    LSX_PARAM_IN sox_effects_chain_t * chain /**< Effects chain from which to read clip information. */
-    );
-
-/**
-Client API:
-Shuts down an effect (calls stop on each of its flows).
-@returns the number of clips from all flows.
-*/
-sox_uint64_t
-LSX_API
-sox_stop_effect(
-    LSX_PARAM_INOUT_COUNT(effp->flows) sox_effect_t * effp /**< Effect to stop. */
-    );
-
-/**
-Client API:
-Adds an already-initialized effect to the end of the chain.
-*/
-void
-LSX_API
-sox_push_effect_last(
-    LSX_PARAM_INOUT sox_effects_chain_t * chain, /**< Effects chain to which effect should be added. */
-    LSX_PARAM_INOUT sox_effect_t * effp /**< Effect to be added. */
-    );
-
-/**
-Client API:
-Removes and returns an effect from the end of the chain.
-@returns the removed effect, or null if no effects.
-*/
-LSX_RETURN_OPT
-sox_effect_t *
-LSX_API
-sox_pop_effect_last(
-    LSX_PARAM_INOUT sox_effects_chain_t *chain /**< Effects chain from which to remove an effect. */
-    );
-
-/**
-Client API:
-Shut down and delete an effect.
-*/
-void
-LSX_API
-sox_delete_effect(
-    LSX_PARAM_INOUT_COUNT(effp->flows) sox_effect_t *effp /**< Effect to be deleted. */
-    );
-
-/**
-Client API:
-Shut down and delete the last effect in the chain.
-*/
-void
-LSX_API
-sox_delete_effect_last(
-    LSX_PARAM_INOUT sox_effects_chain_t *chain /**< Effects chain from which to remove the last effect. */
-    );
-
-/**
-Client API:
-Shut down and delete all effects in the chain.
-*/
-void
-LSX_API
-sox_delete_effects(
-    LSX_PARAM_INOUT sox_effects_chain_t *chain /**< Effects chain from which to delete effects. */
-    );
-
-/**
-Client API:
-Gets the sample offset of the start of the trim, useful for efficiently
-skipping the part that will be trimmed anyway (get trim start, seek, then
-clear trim start).
-@returns the sample offset of the start of the trim.
-*/
-sox_uint64_t
-LSX_API
-sox_trim_get_start(
-    LSX_PARAM_IN sox_effect_t * effp /**< Trim effect. */
-    );
-
-/**
-Client API:
-Clears the start of the trim to 0.
-*/
-void
-LSX_API
-sox_trim_clear_start(
-    LSX_PARAM_INOUT sox_effect_t * effp /**< Trim effect. */
-    );
-
-/**
-Client API:
-Returns true if the specified file is a known playlist file type.
-@returns true if the specified file is a known playlist file type.
-*/
-sox_bool
-LSX_API
-sox_is_playlist(
-    LSX_PARAM_IN_Z char const * filename /**< Name of file to examine. */
-    );
-
-/**
-Client API:
-Parses the specified playlist file.
-@returns SOX_SUCCESS if successful.
-*/
-int
-LSX_API
-sox_parse_playlist(
-    LSX_PARAM_IN sox_playlist_callback_t callback, /**< Callback to call for each item in the playlist. */
-    void * p, /**< Data to pass to callback. */
-    LSX_PARAM_IN char const * const listname /**< Filename of playlist file. */
-    );
-
-/**
-Client API:
-Converts a SoX error code into an error string.
-@returns error string corresponding to the specified error code,
-or a generic message if the error code is not recognized.
-*/
-LSX_RETURN_VALID_Z LSX_RETURN_PURE
-char const *
-LSX_API
-sox_strerror(
-    int sox_errno /**< Error code to look up. */
-    );
-
-/**
-Client API:
-Gets the basename of the specified file; for example, the basename of
-"/a/b/c.d" would be "c".
-@returns the number of characters written to base_buffer, excluding the null,
-or 0 on failure.
-*/
-size_t
-LSX_API
-sox_basename(
-    LSX_PARAM_OUT_Z_CAP_POST_COUNT(base_buffer_len,return) char * base_buffer, /**< Buffer into which basename should be written. */
-    size_t base_buffer_len, /**< Size of base_buffer, in bytes. */
-    LSX_PARAM_IN_Z char const * filename /**< Filename from which to extract basename. */
-    );
-
-/*****************************************************************************
-Internal API:
-WARNING - The items in this section are subject to instability. They only
-exist in the public header because sox (the application) currently uses them.
-These may be changed or removed in future versions of libSoX.
-*****************************************************************************/
-
-/**
-Plugins API:
-Print a fatal error in libSoX.
-*/
-void
-LSX_API
-lsx_fail_impl(
-    LSX_PARAM_IN_PRINTF char const * fmt, /**< printf-style format string. */
-    ...)
-    LSX_PRINTF12;
-
-/**
-Plugins API:
-Print a warning in libSoX.
-*/
-void
-LSX_API
-lsx_warn_impl(
-    LSX_PARAM_IN_PRINTF char const * fmt, /**< printf-style format string. */
-    ...)
-    LSX_PRINTF12;
-
-/**
-Plugins API:
-Print an informational message in libSoX.
-*/
-void
-LSX_API
-lsx_report_impl(
-    LSX_PARAM_IN_PRINTF char const * fmt, /**< printf-style format string. */
-    ...)
-    LSX_PRINTF12;
-
-/**
-Plugins API:
-Print a debug message in libSoX.
-*/
-void
-LSX_API
-lsx_debug_impl(
-    LSX_PARAM_IN_PRINTF char const * fmt, /**< printf-style format string. */
-    ...)
-    LSX_PRINTF12;
-
-/**
-Plugins API:
-Report a fatal error in libSoX; printf-style arguments must follow.
-*/
-#define lsx_fail       sox_get_globals()->subsystem=__FILE__,lsx_fail_impl
-
-/**
-Plugins API:
-Report a warning in libSoX; printf-style arguments must follow.
-*/
-#define lsx_warn       sox_get_globals()->subsystem=__FILE__,lsx_warn_impl
-
-/**
-Plugins API:
-Report an informational message in libSoX; printf-style arguments must follow.
-*/
-#define lsx_report     sox_get_globals()->subsystem=__FILE__,lsx_report_impl
-
-/**
-Plugins API:
-Report a debug message in libSoX; printf-style arguments must follow.
-*/
-#define lsx_debug      sox_get_globals()->subsystem=__FILE__,lsx_debug_impl
-
-/**
-Plugins API:
-String name and integer values for enumerated types (type metadata), for use
-with LSX_ENUM_ITEM, lsx_find_enum_text, and lsx_find_enum_value.
-*/
-typedef struct lsx_enum_item {
-    char const *text; /**< String name of enumeration. */
-    unsigned value;   /**< Integer value of enumeration. */
-} lsx_enum_item;
-
-/**
-Plugins API:
-Declares a static instance of an lsx_enum_item structure in format
-{ "item", prefixitem }, for use in declaring lsx_enum_item[] arrays.
-@param prefix The prefix to prepend to the item in the enumeration symbolic name.
-@param item   The user-visible text name of the item (must also be a valid C symbol name).
-*/
-#define LSX_ENUM_ITEM(prefix, item) {#item, prefix##item},
-
-/**
-Plugins API:
-Flags for use with lsx_find_enum_item.
-*/
-enum
-{
-    lsx_find_enum_item_none = 0, /**< Default parameters (case-insensitive). */
-    lsx_find_enum_item_case_sensitive = 1 /**< Enable case-sensitive search. */
-};
-
-/**
-Plugins API:
-Looks up an enumeration by name in an array of lsx_enum_items.
-@returns the corresponding item, or null if not found.
-*/
-LSX_RETURN_OPT LSX_RETURN_PURE
-lsx_enum_item const *
-LSX_API
-lsx_find_enum_text(
-    LSX_PARAM_IN_Z char const * text, /**< Name of enumeration to find. */
-    LSX_PARAM_IN lsx_enum_item const * lsx_enum_items, /**< Array of items to search, with text == NULL for last item. */
-    int flags /**< Search flags: 0 (case-insensitive) or lsx_find_enum_item_case_sensitive (case-sensitive). */
-    );
-
-/**
-Plugins API:
-Looks up an enumeration by value in an array of lsx_enum_items.
-@returns the corresponding item, or null if not found.
-*/
-LSX_RETURN_OPT LSX_RETURN_PURE
-lsx_enum_item const *
-LSX_API
-lsx_find_enum_value(
-    unsigned value, /**< Enumeration value to find. */
-    LSX_PARAM_IN lsx_enum_item const * lsx_enum_items /**< Array of items to search, with text == NULL for last item. */
-    );
-
-/**
-Plugins API:
-Looks up a command-line argument in a set of enumeration names, showing an
-error message if the argument is not found in the set of names.
-@returns The enumeration value corresponding to the matching enumeration, or
-INT_MAX if the argument does not match any enumeration name.
-*/
-LSX_RETURN_PURE
-int
-LSX_API
-lsx_enum_option(
-    int c, /**< Option character to which arg is associated, for example with -a, c would be 'a'. */
-    LSX_PARAM_IN_Z char const * arg, /**< Argument to find in enumeration list. */
-    LSX_PARAM_IN lsx_enum_item const * items /**< Array of items to search, with text == NULL for last item. */
-    );
-
-/**
-Plugins API:
-Determines whether the specified string ends with the specified suffix (case-sensitive).
-@returns true if the specified string ends with the specified suffix.
-*/
-LSX_RETURN_PURE
-sox_bool
-LSX_API
-lsx_strends(
-    LSX_PARAM_IN_Z char const * str, /**< String to search. */
-    LSX_PARAM_IN_Z char const * end  /**< Suffix to search for. */
-    );
-
-/**
-Plugins API:
-Finds the file extension for a filename.
-@returns the file extension, not including the '.', or null if filename does
-not have an extension.
-*/
-LSX_RETURN_VALID_Z LSX_RETURN_PURE
-char const *
-LSX_API
-lsx_find_file_extension(
-    LSX_PARAM_IN_Z char const * pathname /**< Filename to search for extension. */
-    );
-
-/**
-Plugins API:
-Formats the specified number with up to three significant figures and adds a
-metric suffix in place of the exponent, such as 1.23G.
-@returns A static buffer with the formatted number, valid until the next time
-this function is called (note: not thread safe).
-*/
-LSX_RETURN_VALID_Z
-char const *
-LSX_API
-lsx_sigfigs3(
-    double number /**< Number to be formatted. */
-    );
-
-/**
-Plugins API:
-Formats the specified number as a percentage, showing up to three significant
-figures.
-@returns A static buffer with the formatted number, valid until the next time
-this function is called (note: not thread safe).
-*/
-LSX_RETURN_VALID_Z
-char const *
-LSX_API
-lsx_sigfigs3p(
-    double percentage /**< Number to be formatted. */
-    );
-
-/**
-Plugins API:
-Allocates, deallocates, or resizes; like C's realloc, except that this version
-terminates the running application if unable to allocate the requested memory.
-@returns New buffer, or null if buffer was freed.
-*/
-LSX_RETURN_OPT
-void *
-LSX_API
-lsx_realloc(
-    LSX_PARAM_IN_OPT void *ptr, /**< Pointer to be freed or resized, or null if allocating a new buffer. */
-    size_t newsize /**< New size for buffer, or 0 to free the buffer. */
-    );
-
-/**
-Plugins API:
-Like strcmp, except that the characters are compared without regard to case.
-@returns 0 (s1 == s2), negative (s1 < s2), or positive (s1 > s2).
-*/
-LSX_RETURN_PURE
-int
-LSX_API
-lsx_strcasecmp(
-    LSX_PARAM_IN_Z char const * s1, /**< First string. */
-    LSX_PARAM_IN_Z char const * s2  /**< Second string. */
-    );
-
-
-/**
-Plugins API:
-Like strncmp, except that the characters are compared without regard to case.
-@returns 0 (s1 == s2), negative (s1 < s2), or positive (s1 > s2).
-*/
-LSX_RETURN_PURE
-int
-LSX_API
-lsx_strncasecmp(
-    LSX_PARAM_IN_Z char const * s1, /**< First string. */
-    LSX_PARAM_IN_Z char const * s2, /**< Second string. */
-    size_t n /**< Maximum number of characters to examine. */
-    );
-
-/**
-Plugins API:
-Is option argument unsupported, required, or optional.
-*/
-typedef enum lsx_option_arg_t {
-    lsx_option_arg_none, /**< Option does not have an argument. */
-    lsx_option_arg_required, /**< Option requires an argument. */
-    lsx_option_arg_optional /**< Option can optionally be followed by an argument. */
-} lsx_option_arg_t;
-
-/**
-Plugins API:
-lsx_getopt_init options.
-*/
-typedef enum lsx_getopt_flags_t {
-    lsx_getopt_flag_none = 0,      /**< no flags (no output, not long-only) */
-    lsx_getopt_flag_opterr = 1,    /**< if set, invalid options trigger lsx_warn output */
-    lsx_getopt_flag_longonly = 2   /**< if set, recognize -option as a long option */
-} lsx_getopt_flags_t;
-
-/**
-Plugins API:
-lsx_getopt long option descriptor.
-*/
-typedef struct lsx_option_t {
-    char const *     name;    /**< Name of the long option. */
-    lsx_option_arg_t has_arg; /**< Whether the long option supports an argument and, if so, whether the argument is required or optional. */
-    int *            flag;    /**< Flag to set if argument is present. */
-    int              val;     /**< Value to put in flag if argument is present. */
-} lsx_option_t;
-
-/**
-Plugins API:
-lsx_getopt session information (initialization data and state).
-*/
-typedef struct lsx_getopt_t {
-    int                  argc;     /**< IN    argc:      Number of arguments in argv */
-    char * const *       argv;     /**< IN    argv:      Array of arguments */
-    char const *         shortopts;/**< IN    shortopts: Short option characters */
-    lsx_option_t const * longopts; /**< IN    longopts:  Array of long option descriptors */
-    lsx_getopt_flags_t   flags;    /**< IN    flags:     Flags for longonly and opterr */
-    char const *         curpos;   /**< INOUT curpos:    Maintains state between calls to lsx_getopt */
-    int                  ind;      /**< INOUT optind:    Maintains the index of next element to be processed */
-    int                  opt;      /**< OUT   optopt:    Receives the option character that caused error */
-    char const *         arg;      /**< OUT   optarg:    Receives the value of the option's argument */
-    int                  lngind;   /**< OUT   lngind:    Receives the index of the matched long option or -1 if not a long option */
-} lsx_getopt_t;
-
-/**
-Plugins API:
-Initializes an lsx_getopt_t structure for use with lsx_getopt.
-*/
-void
-LSX_API
-lsx_getopt_init(
-    LSX_PARAM_IN             int argc,                      /**< Number of arguments in argv */
-    LSX_PARAM_IN_COUNT(argc) char * const * argv,           /**< Array of arguments */
-    LSX_PARAM_IN_Z           char const * shortopts,        /**< Short options, for example ":abc:def::ghi" (+/- not supported) */
-    LSX_PARAM_IN_OPT         lsx_option_t const * longopts, /**< Array of long option descriptors */
-    LSX_PARAM_IN             lsx_getopt_flags_t flags,      /**< Flags for longonly and opterr */
-    LSX_PARAM_IN             int first,                     /**< First argv to check (usually 1) */
-    LSX_PARAM_OUT            lsx_getopt_t * state           /**< State object to be initialized */
-    );
-
-/**
-Plugins API:
-Gets the next option. Options are parameters that start with "-" or "--".
-If no more options, returns -1. If unrecognized short option, returns '?'.
-If a recognized short option is missing a required argument,
-return (shortopts[0]==':' ? ':' : '?'). If successfully recognized short
-option, return the recognized character. If successfully recognized long
-option, returns (option.flag ? 0 : option.val).
-Note: lsx_getopt does not permute the non-option arguments.
-@returns option character (short), val or 0 (long), or -1 (no more).
-*/
-int
-LSX_API
-lsx_getopt(
-    LSX_PARAM_INOUT lsx_getopt_t * state /**< The getopt state pointer. */
-    );
-
-/* WARNING END */
-
-#if defined(__cplusplus)
-}
-#endif
-
-#endif /* SOX_H */
diff --git a/fdmdv2-dev/src/sox_biquad.c b/fdmdv2-dev/src/sox_biquad.c
deleted file mode 100644 (file)
index f5a0913..0000000
+++ /dev/null
@@ -1,129 +0,0 @@
-//==========================================================================
-// Name:            sox_biquad.h
-// Purpose:         Interface into Sox Biquad filters 
-// Created:         Dec 1, 2012
-// Authors:         David Rowe
-// 
-// To test:
-//          $ gcc sox_biquad.c -o sox_biquad -DSOX_BIQUAD_UNITTEST -Wall \
-//            /path/to/sox-14.4.0/src/.libs/libsox.a -lm -lsndfile
-//          $ ./sox_biquad
-//
-// 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-
-#include <assert.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include "sox.h"
-
-#include "sox_biquad.h"
-
-
-#define N_MAX 1024
-
-int lsx_biquad_flow(sox_effect_t * effp, const sox_sample_t *ibuf,
-                    sox_sample_t *obuf, size_t *isamp, size_t *osamp);
-
-void sox_biquad_start(void)
-{
-    int r = sox_init();
-    assert(r == SOX_SUCCESS);
-}
-
-void sox_biquad_finish(void)
-{
-    sox_quit();
-}
-
-/*
-  Effect must be implemented by biquads.c in sox, arguments are just
-  like sox command line, for example:
-
-  char *argv[10];
-  argv[0] = "highpass"; argv[1]="1000"; argc=1;
-*/
-
-void *sox_biquad_create(int argc, const char *argv[])
-{
-    int ret;
-    sox_effect_t *e;
-    int (*start)(sox_effect_t *); /* function pointer to effect start func */
-    
-    e = sox_create_effect(sox_find_effect(argv[0])); assert(e != NULL);
-    ret = sox_effect_options(e, argc, (char * const*)&argv[1]);
-    assert(ret == SOX_SUCCESS);
-
-    start = e->handler.start;
-    e->in_signal.rate = 8000;     /* locked at FS=8000 Hz */
-    ret = start(e); assert(ret == SOX_SUCCESS);
-    
-    return (void *)e;
-}
-
-void sox_biquad_destroy(void *sbq) {
-    sox_effect_t *e = (sox_effect_t *)sbq;
-    free(e);
-}
-
-void sox_biquad_filter(void *sbq, short out[], short in[], int n)
-{
-    sox_effect_t *e = (sox_effect_t *)sbq;
-    sox_sample_t ibuf[N_MAX];
-    sox_sample_t obuf[N_MAX];
-    size_t isamp, osamp;
-    unsigned int clips;
-    SOX_SAMPLE_LOCALS; 
-    int i;
-
-    assert(n <= N_MAX);
-
-    clips = 0;
-    for(i=0; i<n; i++)
-        ibuf[i] = SOX_SIGNED_16BIT_TO_SAMPLE(in[i], clips);
-    isamp = osamp = (unsigned int)n;
-    lsx_biquad_flow(e, ibuf, obuf, &isamp, &osamp);
-    for(i=0; i<n; i++)
-        out[i] = SOX_SAMPLE_TO_SIGNED_16BIT(obuf[i], clips); 
-}
-
-
-#ifdef SOX_BIQUAD_UNITTEST
-#define N 20
-int main(void) {
-    void *sbq;
-    char *argv[10];
-    short in[N];
-    short out[N];
-    int   i, argc;;
-
-    for(i=0; i<N; i++)
-        in[i] = 0;
-    in[0] = 8000;
-
-    sox_biquad_start();
-    argv[0] = "highpass"; argv[1]="1000"; argc=1;
-    sbq = sox_biquad_create(argc, argv);
-
-    sox_biquad_filter(sbq, out, in, N);
-    for(i=0; i<N; i++)
-        printf("%d\n", out[i]);
-   
-    sox_biquad_destroy(sbq);
-    sox_biquad_finish();
-
-    return 0;
-}
-#endif
diff --git a/fdmdv2-dev/src/sox_biquad.h b/fdmdv2-dev/src/sox_biquad.h
deleted file mode 100644 (file)
index f38de64..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-//==========================================================================
-// Name:            sox_biquad.h
-// Purpose:         Interface into Sox Biquad filters 
-// Created:         Dec 1, 2012
-// Authors:         David Rowe
-// 
-// 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-
-#ifndef __SOX_BIQUAD__
-#define __SOX_BIQUAD__
-
-#ifdef __cplusplus
-extern "C" {
-
-#endif
-
-void sox_biquad_start(void);
-void sox_biquad_finish(void);
-void *sox_biquad_create(int argc, const char *argv[]);
-void sox_biquad_destroy(void *sbq);
-void sox_biquad_filter(void *sbq, short out[], short in[], int n);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/fdmdv2-dev/src/topFrame.cpp b/fdmdv2-dev/src/topFrame.cpp
deleted file mode 100644 (file)
index e9ca34f..0000000
+++ /dev/null
@@ -1,553 +0,0 @@
-//==========================================================================
-// Name:            topFrame.cpp
-//
-// Purpose:         Implements simple wxWidgets application with GUI.
-// Created:         Apr. 9, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#include "topFrame.h"
-
-extern int g_playFileToMicInEventId;
-extern int g_recFileFromRadioEventId;
-extern int g_playFileFromRadioEventId;
-
-//=========================================================================
-// Code that lays out the main application window
-//=========================================================================
-TopFrame::TopFrame(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxFrame(parent, id, title, pos, size, style)
-{
-    this->SetSizeHints(wxDefaultSize, wxDefaultSize);
-    this->SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
-    this->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DLIGHT));
-    this->SetSizeHints(wxDefaultSize, wxDefaultSize);
-    this->SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
-    this->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DLIGHT));
-    //=====================================================
-    // Menubar Setup
-    m_menubarMain = new wxMenuBar(wxMB_DOCKABLE);
-    file = new wxMenu();
-
-    wxMenuItem* m_menuItemOnTop;
-    m_menuItemOnTop = new wxMenuItem(file, wxID_ANY, wxString(_("On Top")) , _("Always Top Window"), wxITEM_NORMAL);
-    file->Append(m_menuItemOnTop);
-
-    wxMenuItem* m_menuItemExit;
-    m_menuItemExit = new wxMenuItem(file, ID_EXIT, wxString(_("E&xit")) , _("Exit Program"), wxITEM_NORMAL);
-    file->Append(m_menuItemExit);
-
-    m_menubarMain->Append(file, _("&File"));
-
-    tools = new wxMenu();
-    wxMenuItem* m_menuItemAudio;
-    m_menuItemAudio = new wxMenuItem(tools, wxID_ANY, wxString(_("&Audio Config")) , wxEmptyString, wxITEM_NORMAL);
-    tools->Append(m_menuItemAudio);
-
-    wxMenuItem* m_menuItemRigCtrlCfg;
-    m_menuItemRigCtrlCfg = new wxMenuItem(tools, wxID_ANY, wxString(_("&PTT Config")) , wxEmptyString, wxITEM_NORMAL);
-    tools->Append(m_menuItemRigCtrlCfg);
-
-    wxMenuItem* m_menuItemOptions;
-    m_menuItemOptions = new wxMenuItem(tools, wxID_ANY, wxString(_("Options")) , wxEmptyString, wxITEM_NORMAL);
-    tools->Append(m_menuItemOptions);
-
-    wxMenuItem* m_menuItemFilter;
-    m_menuItemFilter = new wxMenuItem(tools, wxID_ANY, wxString(_("&Filter")) , wxEmptyString, wxITEM_NORMAL);
-    tools->Append(m_menuItemFilter);
-
-    wxMenuItem* m_menuItemPlayFileToMicIn;
-    m_menuItemPlayFileToMicIn = new wxMenuItem(tools, wxID_ANY, wxString(_("Start/Stop Play File - Mic In")) , wxEmptyString, wxITEM_NORMAL);
-    g_playFileToMicInEventId = m_menuItemPlayFileToMicIn->GetId();
-    tools->Append(m_menuItemPlayFileToMicIn);
-
-    wxMenuItem* m_menuItemRecFileFromRadio;
-    m_menuItemRecFileFromRadio = new wxMenuItem(tools, wxID_ANY, wxString(_("Start/Stop Record File - From Radio")) , wxEmptyString, wxITEM_NORMAL);
-    g_recFileFromRadioEventId = m_menuItemRecFileFromRadio->GetId();
-    tools->Append(m_menuItemRecFileFromRadio);
-
-    wxMenuItem* m_menuItemPlayFileFromRadio;
-    m_menuItemPlayFileFromRadio = new wxMenuItem(tools, wxID_ANY, wxString(_("Start/Stop Play File - From Radio")) , wxEmptyString, wxITEM_NORMAL);
-    g_playFileFromRadioEventId = m_menuItemPlayFileFromRadio->GetId();
-    tools->Append(m_menuItemPlayFileFromRadio);
-    m_menubarMain->Append(tools, _("&Tools"));
-
-    help = new wxMenu();
-    wxMenuItem* m_menuItemHelpUpdates;
-    m_menuItemHelpUpdates = new wxMenuItem(help, wxID_ANY, wxString(_("Check for Updates")) , wxEmptyString, wxITEM_NORMAL);
-    help->Append(m_menuItemHelpUpdates);
-    m_menuItemHelpUpdates->Enable(false);
-
-    wxMenuItem* m_menuItemAbout;
-    m_menuItemAbout = new wxMenuItem(help, ID_ABOUT, wxString(_("&About")) , _("About this program"), wxITEM_NORMAL);
-    help->Append(m_menuItemAbout);
-
-    m_menubarMain->Append(help, _("&Help"));
-
-    this->SetMenuBar(m_menubarMain);
-
-    wxBoxSizer* bSizer1;
-    bSizer1 = new wxBoxSizer(wxHORIZONTAL);
-
-    //=====================================================
-    // Left side
-    //=====================================================
-    wxBoxSizer* leftSizer;
-    leftSizer = new wxBoxSizer(wxVERTICAL);
-
-    wxStaticBoxSizer* snrSizer;
-    snrSizer = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("SNR")), wxVERTICAL);
-
-    //------------------------------
-    // S/N ratio Guage (vert. bargraph)
-    //------------------------------
-    m_gaugeSNR = new wxGauge(this, wxID_ANY, 25, wxDefaultPosition, wxSize(15,135), wxGA_SMOOTH|wxGA_VERTICAL);
-    m_gaugeSNR->SetToolTip(_("Displays signal to noise ratio in dB."));
-    snrSizer->Add(m_gaugeSNR, 1, wxALIGN_CENTER_HORIZONTAL|wxALL, 10);
-
-    //------------------------------
-    // Box for S/N ratio (Numeric)
-    //------------------------------
-    m_textSNR = new wxStaticText(this, wxID_ANY, wxT(" 0.0"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE);
-    snrSizer->Add(m_textSNR, 0, wxALIGN_CENTER_HORIZONTAL, 1);
-
-    //------------------------------
-    // S/N ratio slow Checkbox
-    //------------------------------
-    m_ckboxSNR = new wxCheckBox(this, wxID_ANY, _("Slow"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
-    m_ckboxSNR->SetToolTip(_("Smooth but slow SNR estimation"));
-    snrSizer->Add(m_ckboxSNR, 0, wxALIGN_CENTER_HORIZONTAL, 5);
-
-    leftSizer->Add(snrSizer, 2, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxALL, 1);
-
-    //------------------------------
-    // Sync  Indicator box
-    //------------------------------
-    wxStaticBoxSizer* sbSizer3_33;
-    sbSizer3_33 = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Sync")), wxVERTICAL);
-
-    m_rbSync = new wxRadioButton( this, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
-    m_rbSync->SetForegroundColour( wxColour( 255, 0, 0 ) );
-    sbSizer3_33->Add(m_rbSync, 0, wxALIGN_CENTER|wxALL, 1);
-    leftSizer->Add(sbSizer3_33,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
-
-    //------------------------------
-    // BER Frames box
-    //------------------------------
-
-    wxStaticBoxSizer* sbSizer_ber;
-    sbSizer_ber = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Bit Error Rate")), wxVERTICAL);
-
-    m_BtnBerReset = new wxButton(this, wxID_ANY, _("Reset"), wxDefaultPosition, wxDefaultSize, 0);
-    sbSizer_ber->Add(m_BtnBerReset, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
-
-    m_textBits = new wxStaticText(this, wxID_ANY, wxT("Bits: 0"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
-    sbSizer_ber->Add(m_textBits, 0, wxALIGN_LEFT, 1);
-    m_textErrors = new wxStaticText(this, wxID_ANY, wxT("Errs: 0"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
-    sbSizer_ber->Add(m_textErrors, 0, wxALIGN_LEFT, 1);
-    m_textBER = new wxStaticText(this, wxID_ANY, wxT("BER: 0.0"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
-    sbSizer_ber->Add(m_textBER, 0, wxALIGN_LEFT, 1);
-
-    leftSizer->Add(sbSizer_ber,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
-
-    //------------------------------
-    // Signal Level(vert. bargraph)
-    //------------------------------
-    wxStaticBoxSizer* levelSizer;
-    levelSizer = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Level")), wxVERTICAL);
-
-    m_textLevel = new wxStaticText(this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(60,-1), wxALIGN_CENTRE);
-    m_textLevel->SetForegroundColour(wxColour(255,0,0));
-    levelSizer->Add(m_textLevel, 0, wxALIGN_LEFT, 1);
-
-    m_gaugeLevel = new wxGauge(this, wxID_ANY, 100, wxDefaultPosition, wxSize(15,135), wxGA_SMOOTH|wxGA_VERTICAL);
-    m_gaugeLevel->SetToolTip(_("Peak of From Radio in Rx, or peak of From Mic in Tx mode.  If Red you should reduce your levels"));
-    levelSizer->Add(m_gaugeLevel, 1, wxALIGN_CENTER_HORIZONTAL|wxALL, 10);
-
-    leftSizer->Add(levelSizer, 2, wxALIGN_CENTER|wxALL|wxEXPAND, 1);
-
-    bSizer1->Add(leftSizer, 0, wxALL|wxEXPAND, 5);
-
-    //=====================================================
-    // Center Section
-    //=====================================================
-    wxBoxSizer* centerSizer;
-    centerSizer = new wxBoxSizer(wxVERTICAL);
-    wxBoxSizer* upperSizer;
-    upperSizer = new wxBoxSizer(wxVERTICAL);
-
-    //=====================================================
-    // Tabbed Notebook control containing display graphs
-    //=====================================================
-    //m_auiNbookCtrl = new wxAuiNotebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_NB_BOTTOM|wxAUI_NB_DEFAULT_STYLE);
-    //long style = wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_MOVE | wxAUI_NB_SCROLL_BUTTONS | wxAUI_NB_CLOSE_ON_ACTIVE_TAB | wxAUI_NB_MIDDLE_CLICK_CLOSE;
-    long nb_style = wxAUI_NB_BOTTOM | wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_MOVE | wxAUI_NB_SCROLL_BUTTONS;
-    m_auiNbookCtrl = new wxAuiNotebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, nb_style);
-    // This line sets the fontsize for the tabs on the notebook control
-    m_auiNbookCtrl->SetFont(wxFont(8, 70, 90, 90, false, wxEmptyString));
-
-    upperSizer->Add(m_auiNbookCtrl, 1, wxALIGN_TOP|wxEXPAND, 1);
-    centerSizer->Add(upperSizer, 1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALIGN_TOP|wxEXPAND, 0);
-
-    // lower middle used for user ID
-
-    wxBoxSizer* lowerSizer;
-    lowerSizer = new wxBoxSizer(wxHORIZONTAL);
-
-    m_BtnCallSignReset = new wxButton(this, wxID_ANY, _("Clear"), wxDefaultPosition, wxDefaultSize, 0);
-    lowerSizer->Add(m_BtnCallSignReset, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
-
-    wxBoxSizer* bSizer15;
-    bSizer15 = new wxBoxSizer(wxVERTICAL);
-    m_txtCtrlCallSign = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
-    m_txtCtrlCallSign->SetToolTip(_("Call Sign of transmitting station will appear here"));
-    bSizer15->Add(m_txtCtrlCallSign, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 5);
-    lowerSizer->Add(bSizer15, 1, wxEXPAND, 5);
-
-    wxStaticBoxSizer* sbSizer_Checksum = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Checksums")), wxHORIZONTAL);
-
-    wxStaticText *goodLabel = new wxStaticText(this, wxID_ANY, wxT("Good: "), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE);
-    sbSizer_Checksum->Add(goodLabel, 0, 0, 2);
-    m_txtChecksumGood = new wxStaticText(this, wxID_ANY, wxT("0"), wxDefaultPosition, wxSize(30,-1), wxALIGN_CENTRE);
-    sbSizer_Checksum->Add(m_txtChecksumGood, 0, 0, 2);
-
-    wxStaticText *badLabel = new wxStaticText(this, wxID_ANY, wxT("Bad: "), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE);
-    sbSizer_Checksum->Add(badLabel, 0, 0, 1);
-    m_txtChecksumBad = new wxStaticText(this, wxID_ANY, wxT("0"), wxDefaultPosition, wxSize(30,-1), wxALIGN_CENTRE);
-    sbSizer_Checksum->Add(m_txtChecksumBad, 0, 0, 1);
-
-    lowerSizer->Add(sbSizer_Checksum, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
-
-    //=====================================================
-    // These are the buttons that autosend the userid (?)
-    //=====================================================
-
-    // DR 4 Dec - taken off for screen for Beta release to avoid questions on their use until
-    // we implement this feature
- #ifdef UNIMPLEMENTED
-    wxBoxSizer* bSizer141;
-    bSizer141 = new wxBoxSizer(wxHORIZONTAL);
-
-    // TxID
-    //---------
-    m_togTxID = new wxToggleButton(this, wxID_ANY, _("TxID"), wxDefaultPosition, wxDefaultSize, 0);
-    m_togTxID->SetToolTip(_("Send Tx ID information"));
-    bSizer141->Add(m_togTxID, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
-
-    // RxID
-    //---------
-    m_togRxID = new wxToggleButton(this, wxID_ANY, _("RxID"), wxDefaultPosition, wxDefaultSize, 0);
-    m_togRxID->SetToolTip(_("Enable reception of ID information"));
-    bSizer141->Add(m_togRxID, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_LEFT|wxALL|wxFIXED_MINSIZE, 5);
-
-    lowerSizer->Add(bSizer141, 0, wxALIGN_RIGHT, 5);
-#endif
-
-    centerSizer->Add(lowerSizer, 0, wxALIGN_BOTTOM|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 2);
-    bSizer1->Add(centerSizer, 4, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 1);
-
-    //=====================================================
-    // Right side
-    //=====================================================
-    wxBoxSizer* rightSizer;
-    rightSizer = new wxBoxSizer(wxVERTICAL);
-
-    //=====================================================
-    // Squelch Slider Control
-    //=====================================================
-    wxStaticBoxSizer* sbSizer3;
-    sbSizer3 = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Squelch")), wxVERTICAL);
-
-    m_sliderSQ = new wxSlider(this, wxID_ANY, 0, 0, 40, wxDefaultPosition, wxSize(-1,80), wxSL_AUTOTICKS|wxSL_INVERSE|wxSL_VERTICAL);
-    m_sliderSQ->SetToolTip(_("Set Squelch level in dB."));
-
-    sbSizer3->Add(m_sliderSQ, 1, wxALIGN_CENTER_HORIZONTAL, 0);
-
-    //------------------------------
-    // Squelch Level static text box
-    //------------------------------
-    m_textSQ = new wxStaticText(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE);
-
-    sbSizer3->Add(m_textSQ, 0, wxALIGN_CENTER_HORIZONTAL, 0);
-
-    //------------------------------
-    // Squelch Toggle Checkbox
-    //------------------------------
-    m_ckboxSQ = new wxCheckBox(this, wxID_ANY, _(""), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
-
-    sbSizer3->Add(m_ckboxSQ, 0, wxALIGN_CENTER_HORIZONTAL, 0);
-    rightSizer->Add(sbSizer3, 2, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 0);
-
-    //rightSizer->Add(sbSizer3_33,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
-
-    /* new --- */
-
-    //------------------------------
-    // Mode box
-    //------------------------------
-    wxStaticBoxSizer* sbSizer_mode;
-    sbSizer_mode = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Mode")), wxVERTICAL);
-
-#ifdef DISABLED_FEATURE
-    m_rb1400old = new wxRadioButton( this, wxID_ANY, wxT("1400 V0.91"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
-    sbSizer_mode->Add(m_rb1400old, 0, wxALIGN_LEFT|wxALL, 1);
-    m_rb1400 = new wxRadioButton( this, wxID_ANY, wxT("1400"), wxDefaultPosition, wxDefaultSize, 0);
-    sbSizer_mode->Add(m_rb1400, 0, wxALIGN_LEFT|wxALL, 1);
-#endif
-    m_rb700 = new wxRadioButton( this, wxID_ANY, wxT("700"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
-    sbSizer_mode->Add(m_rb700, 0, wxALIGN_LEFT|wxALL, 1);
-    m_rb700b = new wxRadioButton( this, wxID_ANY, wxT("700B"), wxDefaultPosition, wxDefaultSize, 0);
-    sbSizer_mode->Add(m_rb700b, 0, wxALIGN_LEFT|wxALL, 1);
-    m_rb1600 = new wxRadioButton( this, wxID_ANY, wxT("1600"), wxDefaultPosition, wxDefaultSize, 0);
-    sbSizer_mode->Add(m_rb1600, 0, wxALIGN_LEFT|wxALL, 1);
-    m_rb1600->SetValue(true);
-#ifdef DISABLED_FEATURE
-    m_rb1600Wide = new wxRadioButton( this, wxID_ANY, wxT("1600 Wide"), wxDefaultPosition, wxDefaultSize, 0);
-    sbSizer_mode->Add(m_rb1600Wide, 0, wxALIGN_LEFT|wxALL, 1);
-    m_rb2000 = new wxRadioButton( this, wxID_ANY, wxT("2000"), wxDefaultPosition, wxDefaultSize, 0);
-    sbSizer_mode->Add(m_rb2000, 0, wxALIGN_LEFT|wxALL, 1);
-#endif
-
-    rightSizer->Add(sbSizer_mode,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
-
-    #ifdef MOVED_TO_OPTIONS_DIALOG
-    /* new --- */
-
-    //------------------------------
-    // Test Frames box
-    //------------------------------
-
-    wxStaticBoxSizer* sbSizer_testFrames;
-    sbSizer_testFrames = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Test Frames")), wxVERTICAL);
-
-    m_ckboxTestFrame = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
-    sbSizer_testFrames->Add(m_ckboxTestFrame, 0, wxALIGN_LEFT, 0);
-
-    rightSizer->Add(sbSizer_testFrames,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
-    #endif
-
-    //=====================================================
-    // Control Toggles box
-    //=====================================================
-    wxStaticBoxSizer* sbSizer5;
-    sbSizer5 = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Control")), wxVERTICAL);
-    wxBoxSizer* bSizer1511;
-    bSizer1511 = new wxBoxSizer(wxVERTICAL);
-
-    //-------------------------------
-    // Stop/Stop signal processing (rx and tx)
-    //-------------------------------
-    m_togBtnOnOff = new wxToggleButton(this, wxID_ANY, _("Start"), wxDefaultPosition, wxDefaultSize, 0);
-    m_togBtnOnOff->SetToolTip(_("Begin/End receiving data."));
-    bSizer1511->Add(m_togBtnOnOff, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
-    sbSizer5->Add(bSizer1511, 0, wxEXPAND, 1);
-
-#ifdef UNIMPLEMENTED
-    //------------------------------
-    // Toggle Loopback button for RX
-    //------------------------------
-    wxBoxSizer* bSizer15113;
-    bSizer15113 = new wxBoxSizer(wxHORIZONTAL);
-    wxBoxSizer* bSizer15111;
-    bSizer15111 = new wxBoxSizer(wxVERTICAL);
-    wxSize wxSz = wxSize(44, 30);
-    m_togBtnLoopRx = new wxToggleButton(this, wxID_ANY, _("Loop\nRX"), wxDefaultPosition, wxSz, 0);
-    m_togBtnLoopRx->SetFont(wxFont(6, 70, 90, 90, false, wxEmptyString));
-    m_togBtnLoopRx->SetToolTip(_("Loopback Receive audio data."));
-
-    bSizer15111->Add(m_togBtnLoopRx, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 0);
-
-    //sbSizer5->Add(bSizer15111, 0, wxEXPAND, 1);
-    bSizer15113->Add(bSizer15111, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 0);
-
-    //------------------------------
-    // Toggle Loopback button for Tx
-    //------------------------------
-    wxBoxSizer* bSizer15112;
-    bSizer15112 = new wxBoxSizer(wxVERTICAL);
-    m_togBtnLoopTx = new wxToggleButton(this, wxID_ANY, _("Loop\nTX"), wxDefaultPosition, wxSz, 0);
-    m_togBtnLoopTx->SetFont(wxFont(6, 70, 90, 90, false, wxEmptyString));
-    m_togBtnLoopTx->SetToolTip(_("Loopback Transmit audio data."));
-
-    bSizer15112->Add(m_togBtnLoopTx, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 0);
-    bSizer15113->Add(bSizer15112, 0,  wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 0);
-
-    sbSizer5->Add(bSizer15113, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
-#endif
-
-    //------------------------------
-    // Split Frequency Mode Toggle
-    //------------------------------
-    wxBoxSizer* bSizer151;
-    bSizer151 = new wxBoxSizer(wxVERTICAL);
-
-    m_togBtnSplit = new wxToggleButton(this, wxID_ANY, _("Split"), wxDefaultPosition, wxDefaultSize, 0);
-    m_togBtnSplit->SetToolTip(_("Toggle split frequency mode."));
-
-    bSizer151->Add(m_togBtnSplit, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
-    sbSizer5->Add(bSizer151, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 1);
-    wxBoxSizer* bSizer13;
-    bSizer13 = new wxBoxSizer(wxVERTICAL);
-
-    //------------------------------
-    // Analog Passthrough Toggle
-    //------------------------------
-    m_togBtnAnalog = new wxToggleButton(this, wxID_ANY, _("Analog"), wxDefaultPosition, wxDefaultSize, 0);
-    m_togBtnAnalog->SetToolTip(_("Toggle analog/digital operation."));
-    bSizer13->Add(m_togBtnAnalog, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
-    sbSizer5->Add(bSizer13, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
-
-    // not implemented on fdmdv2
-#ifdef ALC
-    //------------------------------
-    // Toggle for ALC
-    //------------------------------
-    wxBoxSizer* bSizer14;
-    bSizer14 = new wxBoxSizer(wxVERTICAL);
-    m_togBtnALC = new wxToggleButton(this, wxID_ANY, _("ALC"), wxDefaultPosition, wxDefaultSize, 0);
-    m_togBtnALC->SetToolTip(_("Toggle automatic level control mode."));
-
-    bSizer14->Add(m_togBtnALC, 0, wxALL, 1);
-    sbSizer5->Add(bSizer14, 0, wxALIGN_CENTER|wxALIGN_CENTER_HORIZONTAL|wxALL, 1);
-#endif
-
-    //------------------------------
-    // Toggle Transmit/Receive relays
-    //------------------------------
-    wxBoxSizer* bSizer11;
-    bSizer11 = new wxBoxSizer(wxVERTICAL);
-    m_btnTogPTT = new wxToggleButton(this, wxID_ANY, _("PTT"), wxDefaultPosition, wxDefaultSize, 0);
-    m_btnTogPTT->SetToolTip(_("Push to Talk - Switch between Receive and Transmit - you can also use the space bar "));
-    bSizer11->Add(m_btnTogPTT, 1, wxALIGN_CENTER|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
-    sbSizer5->Add(bSizer11, 2, wxEXPAND, 1);
-    rightSizer->Add(sbSizer5, 2, wxALIGN_CENTER|wxALL|wxEXPAND, 3);
-    bSizer1->Add(rightSizer, 0, wxALL|wxEXPAND, 3);
-    this->SetSizer(bSizer1);
-    this->Layout();
-    m_statusBar1 = this->CreateStatusBar(3, wxST_SIZEGRIP, wxID_ANY);
-
-    //=====================================================
-    // End of layout
-    //=====================================================
-
-    //-------------------
-    // Connect Events
-    //-------------------
-    this->Connect(wxEVT_CLOSE_WINDOW, wxCloseEventHandler(TopFrame::topFrame_OnClose));
-    this->Connect(wxEVT_PAINT, wxPaintEventHandler(TopFrame::topFrame_OnPaint));
-    this->Connect(wxEVT_SIZE, wxSizeEventHandler(TopFrame::topFrame_OnSize));
-    this->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::topFrame_OnUpdateUI));
-
-    this->Connect(m_menuItemExit->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnExit));
-    this->Connect(m_menuItemOnTop->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnTop));
-
-    this->Connect(m_menuItemAudio->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsAudio));
-    this->Connect(m_menuItemAudio->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsAudioUI));
-    this->Connect(m_menuItemFilter->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsFilter));
-    this->Connect(m_menuItemFilter->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsFilterUI));
-    this->Connect(m_menuItemRigCtrlCfg->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsComCfg));
-    this->Connect(m_menuItemRigCtrlCfg->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsComCfgUI));
-    this->Connect(m_menuItemOptions->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsOptions));
-    this->Connect(m_menuItemOptions->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsOptionsUI));
-
-    this->Connect(m_menuItemPlayFileToMicIn->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnPlayFileToMicIn));
-    this->Connect(m_menuItemRecFileFromRadio->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnRecFileFromRadio));
-    this->Connect(m_menuItemPlayFileFromRadio->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnPlayFileFromRadio));
-
-    this->Connect(m_menuItemHelpUpdates->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnHelpCheckUpdates));
-    this->Connect(m_menuItemHelpUpdates->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnHelpCheckUpdatesUI));
-    this->Connect(m_menuItemAbout->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnHelpAbout));
-    //m_togRxID->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnRxID), NULL, this);
-    //m_togTxID->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnTxID), NULL, this);
-    m_sliderSQ->Connect(wxEVT_SCROLL_TOP, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Connect(wxEVT_SCROLL_BOTTOM, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Connect(wxEVT_SCROLL_LINEUP, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Connect(wxEVT_SCROLL_LINEDOWN, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Connect(wxEVT_SCROLL_PAGEUP, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Connect(wxEVT_SCROLL_PAGEDOWN, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Connect(wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Connect(wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Connect(wxEVT_SCROLL_BOTTOM, wxScrollEventHandler(TopFrame::OnSliderScrollBottom), NULL, this);
-    m_sliderSQ->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(TopFrame::OnCmdSliderScrollChanged), NULL, this);
-    m_sliderSQ->Connect(wxEVT_SCROLL_TOP, wxScrollEventHandler(TopFrame::OnSliderScrollTop), NULL, this);
-    m_ckboxSQ->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(TopFrame::OnCheckSQClick), NULL, this);
-
-    m_ckboxSNR->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(TopFrame::OnCheckSNRClick), NULL, this);
-
-    m_togBtnOnOff->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnOnOff), NULL, this);
-    m_togBtnSplit->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnSplitClick), NULL, this);
-    m_togBtnAnalog->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnAnalogClick), NULL, this);
-#ifdef ALC
-    m_togBtnALC->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnALCClick), NULL, this);
-#endif
-    m_btnTogPTT->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnPTT), NULL, this);
-
-    m_BtnCallSignReset->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnCallSignReset), NULL, this);
-    m_BtnBerReset->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnBerReset), NULL, this);
-}
-
-TopFrame::~TopFrame()
-{
-    //-------------------
-    // Disconnect Events
-    //-------------------
-    this->Disconnect(wxEVT_CLOSE_WINDOW, wxCloseEventHandler(TopFrame::topFrame_OnClose));
-    this->Disconnect(wxEVT_PAINT, wxPaintEventHandler(TopFrame::topFrame_OnPaint));
-    this->Disconnect(wxEVT_SIZE, wxSizeEventHandler(TopFrame::topFrame_OnSize));
-    this->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::topFrame_OnUpdateUI));
-    this->Disconnect(ID_EXIT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnExit));
-    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsAudio));
-    this->Disconnect(wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsAudioUI));
-    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsFilter));
-    this->Disconnect(wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsFilterUI));
-    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsComCfg));
-    this->Disconnect(wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsComCfgUI));
-    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsOptions));
-    this->Disconnect(wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsOptionsUI));
-
-    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnPlayFileToMicIn));
-    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnRecFileFromRadio));
-    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnPlayFileFromRadio));
-
-    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnHelpCheckUpdates));
-    this->Disconnect(wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnHelpCheckUpdatesUI));
-    this->Disconnect(ID_ABOUT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnHelpAbout));
-    //m_togRxID->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnRxID), NULL, this);
-    //m_togTxID->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnTxID), NULL, this);
-    m_sliderSQ->Disconnect(wxEVT_SCROLL_TOP, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Disconnect(wxEVT_SCROLL_BOTTOM, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Disconnect(wxEVT_SCROLL_LINEUP, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Disconnect(wxEVT_SCROLL_LINEDOWN, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Disconnect(wxEVT_SCROLL_PAGEUP, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Disconnect(wxEVT_SCROLL_PAGEDOWN, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Disconnect(wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Disconnect(wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Disconnect(wxEVT_SCROLL_BOTTOM, wxScrollEventHandler(TopFrame::OnSliderScrollBottom), NULL, this);
-    m_sliderSQ->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(TopFrame::OnCmdSliderScrollChanged), NULL, this);
-    m_sliderSQ->Disconnect(wxEVT_SCROLL_TOP, wxScrollEventHandler(TopFrame::OnSliderScrollTop), NULL, this);
-    m_ckboxSQ->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(TopFrame::OnCheckSQClick), NULL, this);
-
-    m_togBtnOnOff->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnOnOff), NULL, this);
-    m_togBtnSplit->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnSplitClick), NULL, this);
-    m_togBtnAnalog->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnAnalogClick), NULL, this);
-#ifdef ALC
-    m_togBtnALC->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnALCClick), NULL, this);
-#endif
-    m_btnTogPTT->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnPTT), NULL, this);
-
-}
-
diff --git a/fdmdv2-dev/src/topFrame.h b/fdmdv2-dev/src/topFrame.h
deleted file mode 100644 (file)
index 54ec408..0000000
+++ /dev/null
@@ -1,184 +0,0 @@
-//==========================================================================
-// Name:            topFrame.h
-//
-// Purpose:         Implements simple wxWidgets application with GUI.
-// Created:         Apr. 9, 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 Lesser 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 Lesser General Public License
-//  along with this program; if not, see <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#ifndef __TOPFRAME_H__
-#define __TOPFRAME_H__
-
-#include "version.h"
-#include <wx/artprov.h>
-#include <wx/xrc/xmlres.h>
-#include <wx/intl.h>
-#include <wx/string.h>
-#include <wx/bitmap.h>
-#include <wx/image.h>
-#include <wx/icon.h>
-#include <wx/menu.h>
-#include <wx/gdicmn.h>
-#include <wx/font.h>
-#include <wx/colour.h>
-#include <wx/settings.h>
-#include <wx/gauge.h>
-#include <wx/textctrl.h>
-#include <wx/sizer.h>
-#include <wx/statbox.h>
-#include <wx/aui/auibook.h>
-#include <wx/tglbtn.h>
-#include <wx/slider.h>
-#include <wx/checkbox.h>
-#include <wx/statusbr.h>
-#include <wx/frame.h>
-#include <wx/statbmp.h>
-#include <wx/stattext.h>
-#include <wx/button.h>
-#include <wx/dialog.h>
-#include <wx/radiobut.h>
-#include <wx/combobox.h>
-#include <wx/panel.h>
-#include <wx/listbox.h>
-#include <wx/notebook.h>
-#include <wx/listctrl.h>
-
-
-///////////////////////////////////////////////////////////////////////////
-
-#define ID_OPEN 1000
-#define ID_SAVE 1001
-#define ID_CLOSE 1002
-#define ID_EXIT 1003
-#define ID_COPY 1004
-#define ID_CUT 1005
-#define ID_PASTE 1006
-#define ID_OPTIONS 1007
-#define ID_ABOUT 1008
-
-///////////////////////////////////////////////////////////////////////////////
-/// Class TopFrame
-///////////////////////////////////////////////////////////////////////////////
-class TopFrame : public wxFrame
-{
-    private:
-
-    protected:
-        wxMenuBar* m_menubarMain;
-        wxMenu* file;
-        wxMenu* edit;
-        wxMenu* tools;
-        wxMenu* help;
-        wxGauge* m_gaugeSNR;
-        wxStaticText* m_textSNR;
-        wxCheckBox* m_ckboxSNR;
-        wxGauge* m_gaugeLevel;
-        wxStaticText* m_textLevel;
-
-        wxButton*     m_BtnCallSignReset;
-        wxTextCtrl*   m_txtCtrlCallSign;
-        wxStaticText* m_txtChecksumGood;
-        wxStaticText* m_txtChecksumBad;
-
-        wxSlider* m_sliderSQ;
-        wxCheckBox* m_ckboxSQ;
-        wxStaticText* m_textSQ;
-        wxStatusBar* m_statusBar1;
-
-        wxButton*     m_BtnBerReset;
-        wxStaticText  *m_textBits;
-        wxStaticText  *m_textErrors;
-        wxStaticText  *m_textBER;
-
-        wxRadioButton *m_rbSync;
-        wxRadioButton *m_rb1400old;
-        wxRadioButton *m_rb1400;
-        wxRadioButton *m_rb700;
-        wxRadioButton *m_rb700b;
-        wxRadioButton *m_rb1600;
-        wxRadioButton *m_rb2000;
-        wxRadioButton *m_rb1600Wide;
-
-        // Virtual event handlers, overide them in your derived class
-        virtual void topFrame_OnClose( wxCloseEvent& event ) { event.Skip(); }
-        virtual void topFrame_OnPaint( wxPaintEvent& event ) { event.Skip(); }
-        virtual void topFrame_OnSize( wxSizeEvent& event ) { event.Skip(); }
-        virtual void topFrame_OnUpdateUI( wxUpdateUIEvent& event ) { event.Skip(); }
-
-        virtual void OnExit( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnTop( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnToolsAudio( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnToolsAudioUI( wxUpdateUIEvent& event ) { event.Skip(); }
-        virtual void OnToolsFilter( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnToolsFilterUI( wxUpdateUIEvent& event ) { event.Skip(); }
-        virtual void OnToolsOptions( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnToolsUDP( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnToolsOptionsUI( wxUpdateUIEvent& event ) { event.Skip(); }
-        virtual void OnToolsComCfg( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnToolsComCfgUI( wxUpdateUIEvent& event ) { event.Skip(); }
-        virtual void OnPlayFileToMicIn( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnRecFileFromRadio( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnPlayFileFromRadio( wxCommandEvent& event ) { event.Skip(); }
-
-        virtual void OnHelpCheckUpdates( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnHelpCheckUpdatesUI( wxUpdateUIEvent& event ) { event.Skip(); }
-        virtual void OnHelpAbout( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnTogBtnRxID( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnTogBtnTxID( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnCmdSliderScroll( wxScrollEvent& event ) { event.Skip(); }
-        virtual void OnSliderScrollBottom( wxScrollEvent& event ) { event.Skip(); }
-        virtual void OnCmdSliderScrollChanged( wxScrollEvent& event ) { event.Skip(); }
-        virtual void OnSliderScrollTop( wxScrollEvent& event ) { event.Skip(); }
-        virtual void OnCheckSQClick( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnCheckSNRClick( wxCommandEvent& event ) { event.Skip(); }
-
-        virtual void OnTogBtnLoopRx( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnTogBtnLoopTx( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnTogBtnOnOff( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnTogBtnSplitClick( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnTogBtnAnalogClick( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnTogBtnALCClick( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnTogBtnPTT( wxCommandEvent& event ) { event.Skip(); }
-
-        virtual void OnTogBtnSplitClickUI(wxUpdateUIEvent& event) { event.Skip(); }
-        virtual void OnTogBtnAnalogClickUI(wxUpdateUIEvent& event) { event.Skip(); }
-        virtual void OnTogBtnALCClickUI(wxUpdateUIEvent& event) { event.Skip(); }
-        virtual void OnTogBtnRxIDUI(wxUpdateUIEvent& event ) { event.Skip(); }
-        virtual void OnTogBtnTxIDUI(wxUpdateUIEvent& event ) { event.Skip(); }
-        virtual void OnTogBtnPTT_UI(wxUpdateUIEvent& event ) { event.Skip(); }
-        virtual void OnTogBtnOnOffUI(wxUpdateUIEvent& event ) { event.Skip(); }
-
-        virtual void OnCallSignReset( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnBerReset( wxCommandEvent& event ) { event.Skip(); }
-
-    public:
-        wxToggleButton* m_togRxID;
-        wxToggleButton* m_togTxID;
-        wxToggleButton* m_togBtnOnOff;
-        wxToggleButton* m_togBtnSplit;
-        wxToggleButton* m_togBtnAnalog;
-        wxToggleButton* m_togBtnALC;
-        wxToggleButton* m_btnTogPTT;
-        wxToggleButton* m_togBtnLoopRx;
-        wxToggleButton* m_togBtnLoopTx;
-        wxAuiNotebook* m_auiNbookCtrl;
-
-        TopFrame( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("FreeDV ") + _(FREEDV_VERSION), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(561,300 ), long style = wxDEFAULT_FRAME_STYLE|wxRESIZE_BORDER|wxTAB_TRAVERSAL );
-
-        ~TopFrame();
-};
-
-#endif //__TOPFRAME_H__
diff --git a/fdmdv2/branches/0.97/.clang/.gitignore b/fdmdv2/branches/0.97/.clang/.gitignore
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/fdmdv2/branches/0.97/AUTHORS b/fdmdv2/branches/0.97/AUTHORS
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/fdmdv2/branches/0.97/CMakeLists.txt b/fdmdv2/branches/0.97/CMakeLists.txt
deleted file mode 100644 (file)
index fd61d52..0000000
+++ /dev/null
@@ -1,461 +0,0 @@
-#
-# FreeDV - HF Digital Voice for Radio Amateurs
-#
-# CMake configuration contributed by Richard Shaw (KF5OIM)
-# Please report questions, comments, problems, or patches to the freetel
-# mailing list: https://lists.sourceforge.net/lists/listinfo/freetel-codec2
-#
-
-cmake_minimum_required(VERSION 2.8)
-
-# Prevent in-source builds to protect automake/autoconf config.
-# If an in-source build is attempted, you will still need to clean up a few
-# files manually.
-set(CMAKE_DISABLE_SOURCE_CHANGES ON)
-set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
-if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
-  message(FATAL_ERROR "In-source builds in ${CMAKE_BINARY_DIR} are not "   
-   "allowed, please remove ./CMakeCache.txt and ./CMakeFiles/, create a "
-   "separate build directory and run cmake from there.")
-endif("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
-
-# Set local module path.
-list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
-
-project(FreeDV)
-
-#
-# Parse FreeDV version from src/version.h
-#
-file(READ "${CMAKE_SOURCE_DIR}/src/version.h" _VERSION_H)
-string(REGEX REPLACE ".*FREEDV_VERSION_MAJOR ([0-9]+).*" "\\1"
-    FREEDV_VERSION_MAJOR "${_VERSION_H}")
-string(REGEX REPLACE ".*FREEDV_VERSION_MINOR ([0-9]+).*" "\\1"
-    FREEDV_VERSION_MINOR "${_VERSION_H}")
-string(REGEX REPLACE ".*FREEDV_VERSION_PATCH ([0-9]+).*" "\\1"
-    FREEDV_VERSION_PATCH "${_VERSION_H}")
-set(FREEDV_VERSION "${FREEDV_VERSION_MAJOR}.${FREEDV_VERSION_MINOR}")
-if(FREEDV_VERSION_PATCH)
-    set(FREEDV_VERSION ${FREEDV_VERSION}.${FREEDV_VERSION_PATCH})
-endif(FREEDV_VERSION_PATCH)
-
-message(STATUS "FreeDV version: ${FREEDV_VERSION}")
-
-# Set default build type
-if(NOT CMAKE_BUILD_TYPE)
-    set(CMAKE_BUILD_TYPE "Release")
-    message(STATUS "Build type not specified, defaulting to ${CMAKE_BUILD_TYPE}")
-endif(NOT CMAKE_BUILD_TYPE)
-
-
-# Work around for not using a svn working copy.
-add_definitions(-D_NO_AUTOTOOLS_)
-find_program(SVNVERSION_PATH svnversion)
-if(SVNVERSION_PATH)
-    execute_process(COMMAND ${SVNVERSION_PATH} .
-        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-        RESULT_VARIABLE SVN_REVISION_RESULT
-        OUTPUT_VARIABLE SVN_CURRENT_REVISION
-        ERROR_QUIET
-    )
-else()
-    set(SVN_REVISION_RESULT 1)
-endif()
-if(SVN_REVISION_RESULT EQUAL 0)
-string(STRIP ${SVN_CURRENT_REVISION} SVN_REVISION)
-add_definitions(-DSVN_REVISION="${SVN_REVISION}")
-else()
-add_definitions(-DSVN_REVISION="Unversioned directory")
-endif()
-
-
-# Set default build flags.
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
-
-#
-# Setup cmake options
-#
-set(USE_STATIC_DEPS FALSE CACHE BOOL 
-    "Download and build static libraries instead of system libraries.")
-set(USE_STATIC_PORTAUDIO FALSE CACHE BOOL 
-    "Download and build static portaudio instead of the system library.")
-set(USE_STATIC_SNDFILE FALSE CACHE BOOL
-    "Download and build static sndfile instead of the system library.")
-set(USE_STATIC_SAMPLERATE FALSE CACHE BOOL
-    "Download and build static samplerate instead of the system library.")
-set(USE_STATIC_SOX FALSE CACHE BOOL
-    "Download and build static sox instead of the system library.")
-set(USE_STATIC_CODEC2 FALSE CACHE BOOL
-    "Download and build static codec2 instead of the system library.")
-set(BOOTSTRAP_WXWIDGETS FALSE CACHE BOOL
-    "Download and build static wxWidgets instead of the system library.")
-
-if(USE_STATIC_DEPS)
-    set(USE_STATIC_PORTAUDIO TRUE FORCE)
-    set(USE_STATIC_SNDFILE TRUE FORCE)
-    set(USE_STATIC_SAMPLERATE TRUE FORCE)
-    set(USE_STATIC_SOX TRUE FORCE)
-    set(USE_STATIC_CODEC2 TRUE FORCE)
-endif(USE_STATIC_DEPS)
-
-#
-# Pull in external wxWidgets target if performing static build.
-#
-if(BOOTSTRAP_WXWIDGETS)
-    message(STATUS "Adding wxWidgets build target...")
-    include(cmake/BuildWxWidgets.cmake)
-endif(BOOTSTRAP_WXWIDGETS)
-
-#
-# Perform bootstrap build of wxWidgets
-#
-if(BOOTSTRAP_WXWIDGETS AND NOT EXISTS ${WXCONFIG})
-    message(STATUS "Will perform bootstrap build of wxWidgets.
-   After make step completes, re-run cmake and make again to perform FreeDV build.")
-#
-# Continue normal build if not bootstrapping wxWidgets or is already built.
-#
-else(BOOTSTRAP_WXWIDGETS AND NOT EXISTS ${WXCONFIG})
-
-
-#
-# Various hacks and work arounds for building under MinGW.
-#
-if(MINGW)
-    message(STATUS "System is MinGW.")
-    # This sets up the exe icon for windows under mingw.
-    set(RES_FILES "")
-    set(RES_FILES "${CMAKE_SOURCE_DIR}/contrib/freedv.rc")
-    set(CMAKE_RC_COMPILER_INIT windres)
-    enable_language(RC)
-    set(CMAKE_RC_COMPILE_OBJECT
-        "<CMAKE_RC_COMPILER> <FLAGS> -O coff <DEFINES> -i <SOURCE> -o <OBJECT>")
-    # These are DLOPEN'ed and can't be automatically pulled in by dependency.
-    foreach(RUNTIME
-        hamlib-adat.dll
-        hamlib-alinco.dll
-        hamlib-amsat.dll
-        hamlib-aor.dll
-        hamlib-ars.dll
-        hamlib-celestron.dll
-        hamlib-drake.dll
-        hamlib-dummy.dll
-        hamlib-easycomm.dll
-        hamlib-flexradio.dll
-        hamlib-fodtrack.dll
-        hamlib-gs232a.dll
-        hamlib-heathkit.dll
-        hamlib-icom.dll
-        hamlib-jrc.dll
-        hamlib-kachina.dll
-        hamlib-kenwood.dll
-        hamlib-kit.dll
-        hamlib-lowe.dll
-        hamlib-m2.dll
-        hamlib-pcr.dll
-        hamlib-prm80.dll
-        hamlib-racal.dll
-        hamlib-rft.dll
-        hamlib-rotorez.dll
-        hamlib-rs.dll
-        hamlib-sartek.dll
-        hamlib-skanti.dll
-        hamlib-spid.dll
-        hamlib-tapr.dll
-        hamlib-tentec.dll
-        hamlib-ts7400.dll
-        hamlib-tuner.dll
-        hamlib-uniden.dll
-        hamlib-winradio.dll
-        hamlib-wj.dll
-        hamlib-yaesu.dll)
-        message(STATUS "Checking for ${RUNTIME}")
-        find_library(${RUNTIME}_LIB ${RUNTIME}
-            PATH_SUFFIXES hamlib)
-        message(STATUS "runtime found: ${${RUNTIME}_LIB}")
-        list(APPEND CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS ${${RUNTIME}_LIB})
-    endforeach()
-    include(InstallRequiredSystemLibraries)
-endif(MINGW)
-
-# Math library is automatic on MinGW
-if(UNIX)
-    set(CMAKE_REQUIRED_INCLUDES math.h)
-    set(CMAKE_REQUIRED_LIBRARIES m)
-endif(UNIX)
-
-# Find some standard headers and functions.
-include(CheckIncludeFiles)
-check_include_files("limits.h" HAVE_LIMITS_H)
-check_include_files("stddef.h" HAVE_STDDEF_H)
-check_include_files("stdlib.h" HAVE_STDLIB_H)
-check_include_files("string.h" HAVE_STRING_H)
-
-include(CheckTypeSize)
-check_type_size("int" SIZEOF_INT)
-
-include(CheckFunctionExists)
-check_function_exists(floor HAVE_FLOOR)
-check_function_exists(memset HAVE_MEMSET)
-check_function_exists(pow HAVE_POW)
-check_function_exists(sqrt HAVE_SQRT)
-
-# fdmdv2_main.h requires patching to find config.h as it current looks in the
-# source directory and the generated file goes in the binary directory.
-configure_file ("${PROJECT_SOURCE_DIR}/cmake/config.h.in"
-                "${PROJECT_BINARY_DIR}/config.h" )
-include_directories(${PROJECT_BINARY_DIR})
-add_definitions(-DHAVE_CONFIG_H)
-
-# Pthread Library
-find_package(Threads REQUIRED)
-message(STATUS "Threads library flags: ${CMAKE_THREAD_LIBS_INIT}")
-
-#
-# Find codec2
-#
-if(NOT USE_STATIC_CODEC2)
-    message(STATUS "Looking for codec2...")
-    find_package(codec2 CONFIG QUIET)
-    if(codec2_FOUND)
-        get_target_property(CODEC2_BRARY codec2 LOCATION)
-        message(STATUS "  codec2 library: ${CODEC2_LIBRARY}")
-        message(STATUS "  codec2 headers: ${codec2_INCLUDE_DIRS}")
-    else()
-        # Try to find manually
-        find_path(CODEC2_INCLUDE_DIRS codec2.h
-                  PATH_SUFFIXES codec2)
-        find_library(CODEC2_LIBRARY NAMES codec2)
-        if(CODEC2_LIBRARY AND CODEC2_INCLUDE_DIRS)
-            message(STATUS "  codec2 library: ${CODEC2_LIBRARY}")
-            message(STATUS "  codec2 headers: ${CODEC2_INCLUDE_DIRS}")
-            list(APPEND FREEDV_LINK_LIBS ${CODEC2_LIBRARY})
-            include_directories(${CODEC2_INCLUDE_DIRS})
-        else()
-            message(FATAL_ERROR "codec2 library not found.
-Linux: 
-Codec2 may not be in your distribution so build yourself or use the cmake option to build statically into FreeDV.
-Windws:
-It's easiest to use the cmake option: USE_STATIC_CODEC2"
-        )
-        endif()
-    endif()
-else(NOT USE_STATIC_CODEC2)
-    message(STATUS "Will attempt static build of codec2.")
-    include(cmake/BuildCodec2.cmake)
-endif(NOT USE_STATIC_CODEC2)
-
-#
-# Find or build portaudio Library
-#
-if(NOT USE_STATIC_PORTAUDIO)
-    message(STATUS "Looking for portaudio...")
-    find_package(Portaudio REQUIRED)
-    if(PORTAUDIO_FOUND)
-        message(STATUS "  portaudio library: ${PORTAUDIO_LIBRARIES}")
-        message(STATUS "  portaudio headers: ${PORTAUDIO_INCLUDE_DIRS}")
-        list(APPEND FREEDV_LINK_LIBS ${PORTAUDIO_LIBRARIES})
-        include_directories(${PORTAUDIO_INCLUDE_DIRS})
-    else()
-        message(FATAL_ERROR "portaudio library not found.
-On Linux systems try installing:
-    portaudio-devel  (RPM based systems)
-    libportaudio-dev (DEB based systems)
-On Windows it's easiest to use the cmake option: USE_STATIC_PORTAUDIO"
-        )
-    endif()
-    if(NOT ${PORTAUDIO_VERSION} EQUAL 19)
-        message(WARNING "Portaudio versions other than 19 are known to have issues. You have been warned!")
-    endif()
-else(NOT USE_STATIC_PORTAUDIO)
-    message(STATUS "Will attempt static build of portaudio.")
-    include(cmake/BuildPortaudio.cmake)
-endif(NOT USE_STATIC_PORTAUDIO)
-
-#
-# Hamlib library
-#
-message(STATUS "Looking for hamlib...")
-find_path(HAMLIB_INCLUDE_DIR hamlib/rig.h)
-find_library(HAMLIB_LIBRARY hamlib)
-message(STATUS "Hamlib library: ${HAMLIB_LIBRARY}")
-message(STATUS "Hamlib headers: ${HAMLIB_INCLUDE_DIR}")
-if(HAMLIB_LIBRARY AND HAMLIB_INCLUDE_DIR)
-    message(STATUS "Hamlib library found.")
-    include_directories(${HAMLIB_INCLUDE_DIR})
-    list(APPEND FREEDV_LINK_LIBS ${HAMLIB_LIBRARY})
-else(HAMLIB_LIBRARY AND HAMLIB_INCLUDE_DIR)
-    message(FATAL_ERROR "hamlib not found.
-On Linux systems try installing:
-    hamlib-devel  (RPM based systems)
-    libhamlib-dev (DEB based systems)"
-    )
-endif(HAMLIB_LIBRARY AND HAMLIB_INCLUDE_DIR)
-
-
-#
-# Samplerate Library
-#
-if(NOT USE_STATIC_SAMPLERATE)
-    message(STATUS "Looking for samplerate...")
-    find_library(LIBSAMPLERATE samplerate)
-    find_path(LIBSAMPLERATE_INCLUDE_DIR samplerate.h)
-    message(STATUS "  samplerate library: ${LIBSAMPLERATE}")
-    message(STATUS "  samplerate headers: ${LIBSAMPLERATE_INCLUDE_DIR}")
-    if(LIBSAMPLERATE AND LIBSAMPLERATE_INCLUDE_DIR)
-        list(APPEND FREEDV_LINK_LIBS ${LIBSAMPLERATE})
-        include_directories(${LIBSAMPLERATE_INCLUDE_DIR})
-    else(LIBSTAMPLERATE AND LIBSAMPLERATE_INCLUDE_DIR)
-        message(FATAL_ERROR "samplerate library not found.
-On Linux systems try installing:
-    samplerate-devel  (RPM based systems)
-    libsamplerate-dev (DEB based systems)
-On Windows it's easiest to use the cmake option: USE_STATIC_SAMPLERATE"
-        )
-    endif(LIBSAMPLERATE AND LIBSAMPLERATE_INCLUDE_DIR)
-else(NOT USE_STATIC_SAMPLERATE)
-    message(STATUS "Will attempt static build of samplerate.")
-    include(cmake/BuildSamplerate.cmake)
-endif(NOT USE_STATIC_SAMPLERATE)
-
-#
-# Find sox library
-#
-if(NOT USE_STATIC_SOX)
-    message(STATUS "Looking for sox...")
-    find_library(LIBSOX_LIBRARY sox)
-    find_path(LIBSOX_INCLUDE_DIR NAMES sox/sox.h sox.h)
-    message(STATUS "  sox library: ${LIBSOX_LIBRARY}")
-    message(STATUS "  sox headers: ${LIBSOX_INCLUDE_DIR}")
-    if(LIBSOX_LIBRARY AND LIBSOX_INCLUDE_DIR)
-        list(APPEND FREEDV_LINK_LIBS ${LIBSOX_LIBRARY})
-        include_directories(${LIBSOX_INCLUDE_DIR})
-    else(LIBSOX_LIBRARY AND LIBSOX_INCLUDE_DIR)
-        message(FATAL_ERROR "sox library not found.
-On Linux systems try installing:
-    sox-devel (RPM based systems)
-    libsox-dev (DEB based systems)
-On Windows it's easiest to use the cmake option: USE_STATIC_SOX"
-        )
-    endif(LIBSOX_LIBRARY AND LIBSOX_INCLUDE_DIR)
-else(NOT USE_STATIC_SOX)
-    message(STATUS "Will attempt static build of sox.")
-    include(cmake/BuildSox.cmake)
-endif(NOT USE_STATIC_SOX)
-
-#    
-# sndfile Library
-#
-if(NOT USE_STATIC_SNDFILE)
-    message(STATUS "Looking for sndfile...")
-    find_library(LIBSNDFILE sndfile)
-    find_path(LIBSNDFILE_INCLUDE_DIR sndfile.h)
-    message(STATUS "  sndfile library: ${LIBSNDFILE}")
-    message(STATUS "  sndfile headers: ${LIBSNDFILE_INCLUDE_DIR}")
-    if(LIBSNDFILE AND LIBSNDFILE_INCLUDE_DIR)
-        list(APPEND FREEDV_LINK_LIBS ${LIBSNDFILE})
-    else(LIBSNDFILE AND LIBSNDFILE_INCLUDE_DIR)
-        message(FATAL_ERROR "sndfile library not found.
-On Linux systems try installing:
-    libsndfile-devel (RPM based systems)
-    libsndfile-dev   (DEB based systems)
-On Windows it's easiest to use the cmake option: USE_STATIC_SNDFILE"
-        )
-    endif(LIBSNDFILE AND LIBSNDFILE_INCLUDE_DIR)
-else(NOT USE_STATIC_SNDFILE)
-    message(STATUS "Will attempt static build of sndfile.")
-    include(cmake/BuildSndfile.cmake)
-endif(NOT USE_STATIC_SNDFILE)
-
-#
-# Find wxWidgets
-#
-if(NOT BOOTSTRAP_WXWIDGETS)
-    set(WXCONFIG "" CACHE FILEPATH "Location of wx-config binary.")
-    set(WXRC "" CACHE FILEPATH "Location of wxrc binary.")
-endif(NOT BOOTSTRAP_WXWIDGETS)
-#if(BOOTSTRAP_WXWIDGETS)
-#    set(WXCONFIG "${CMAKE_BINARY_DIR}/external/dist/bin/wx-config")
-#    set(WXRC "${CMAKE_BINARY_DIR}/external/dist/bin/wxrc")
-#    list(APPEND FREEDV_STATIC_DEPS wxWidgets)
-#endif(BOOTSTRAP_WXWIDGETS)
-message(STATUS "Looking for wxWidgets...")
-if(WXCONFIG)
-    message(STATUS "wx-config: ${WXCONFIG}")
-    set(wxWidgets_CONFIG_EXECUTABLE ${WXCONFIG})
-endif(WXCONFIG)
-if(WXRC)
-    message(STATUS "wxrc: ${WXRC}")
-    set(wxWidgets_wxrc_EXECUTABLE ${WXRC})
-endif(WXRC)
-set(WX_VERSION_MIN 3.0.0)
-find_package(wxWidgets REQUIRED core base aui html net adv)
-execute_process(COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}" --version
-    OUTPUT_VARIABLE WX_VERSION)
-string(STRIP ${WX_VERSION} WX_VERSION)
-if(WX_VERSION VERSION_EQUAL ${WX_VERSION_MIN}
-    OR WX_VERSION VERSION_GREATER ${WX_VERSION_MIN})
-   message(STATUS "wxWidgets version: ${WX_VERSION}")
-else()
-    message(FATAL_ERROR "wxWidgets must be installed on your system.
-Please check that wx-config is in path, the directory
-where wxWidgets libraries are installed (returned by
-'wx-config --libs' or 'wx-config --static --libs' command)
-is in LD_LIBRARY_PATH or equivalent variable and
-wxWidgets version is ${WX_VERSION_MIN} or above.")
-endif()
-if(wxWidgets_FOUND)
-    include("${wxWidgets_USE_FILE}")
-    list(APPEND FREEDV_LINK_LIBS ${wxWidgets_LIBRARIES})
-endif(wxWidgets_FOUND)
-
-
-# Freedv 
-add_subdirectory(src)
-
-# Icons and desktop file
-add_subdirectory(contrib)
-
-message(STATUS "Build type will be: ${CMAKE_BUILD_TYPE}")
-
-#
-# Cpack NSIS configuration for Windows.
-#
-if(WIN32)
-    # Detect if we're doing a 32-bit or 64-bit windows build.
-    if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
-        set(CMAKE_CL_64 TRUE)
-    endif()
-    if(NOT ${CMAKE_BUILD_TYPE} STREQUAL "Debug")
-        set(CPACK_STRIP_FILES TRUE)
-    endif()
-
-    configure_file(cmake/GetDependencies.cmake.in cmake/GetDependencies.cmake
-        @ONLY
-    )
-    install(SCRIPT ${CMAKE_BINARY_DIR}/cmake/GetDependencies.cmake)
-    set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "HF Digital Voice for Radio Amateurs")
-    set(CPACK_PACKAGE_VENDOR "CMake")
-    set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
-    set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
-    set(CPACK_PACKAGE_VERSION_MAJOR ${FREEDV_VERSION_MAJOR})
-    set(CPACK_PACKAGE_VERSION_MINOR ${FREEDV_VERSION_MINOR})
-    if(FREEDV_VERSION_PATCH)
-        set(CPACK_PACKAGE_VERSION_PATCH ${FREEDV_VERSION_PATCH})
-    else()
-        set(CPACK_PACKAGE_VERSION_PATCH "0")
-    endif()
-    set(CPACK_PACKAGE_INSTALL_DIRECTORY "FreeDV")
-    set(CPACK_PACKAGE_EXECUTABLES freedv;FreeDV)
-    set(CPACK_STRIP_FILES TRUE)
-    # NSIS specific settings
-    set(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\freedv.exe")
-    set(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}")
-    set(CPACK_NSIS_PACKAGE_NAME "FreeDV")
-    set(CPACK_NSIS_URL_INFO_ABOUT "http://freedv.org")
-    set(CPACK_NSIS_MODIFY_PATH OFF)
-    set(CPACK_NSIS_MENU_LINKS "http://freedv.org" "FreeDV Homepage")
-    include(CPack)
-endif(WIN32)
-
-endif(BOOTSTRAP_WXWIDGETS AND NOT EXISTS ${WXCONFIG})
diff --git a/fdmdv2/branches/0.97/COPYING b/fdmdv2/branches/0.97/COPYING
deleted file mode 100644 (file)
index cfd4e99..0000000
+++ /dev/null
@@ -1,502 +0,0 @@
-                  GNU LESSER GENERAL PUBLIC LICENSE
-                       Version 2.1, February 1999
-
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.
- 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the Lesser GPL.  It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
-                            Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
-  This license, the Lesser General Public License, applies to some
-specially designated software packages--typically libraries--of the
-Free Software Foundation and other authors who decide to use it.  You
-can use it too, but we suggest you first think carefully about whether
-this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations below.
-
-  When we speak of free software, we are referring to freedom of use,
-not price.  Our General Public Licenses are designed to make sure that
-you have the freedom to distribute copies of free software (and charge
-for this service if you wish); that you receive source code or can get
-it if you want it; that you can change the software and use pieces of
-it in new free programs; and that you are informed that you can do
-these things.
-
-  To protect your rights, we need to make restrictions that forbid
-distributors to deny you these rights or to ask you to surrender these
-rights.  These restrictions translate to certain responsibilities for
-you if you distribute copies of the library or if you modify it.
-
-  For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you.  You must make sure that they, too, receive or can get the source
-code.  If you link other code with the library, you must provide
-complete object files to the recipients, so that they can relink them
-with the library after making changes to the library and recompiling
-it.  And you must show them these terms so they know their rights.
-
-  We protect your rights with a two-step method: (1) we copyright the
-library, and (2) we offer you this license, which gives you legal
-permission to copy, distribute and/or modify the library.
-
-  To protect each distributor, we want to make it very clear that
-there is no warranty for the free library.  Also, if the library is
-modified by someone else and passed on, the recipients should know
-that what they have is not the original version, so that the original
-author's reputation will not be affected by problems that might be
-introduced by others.
-\f
-  Finally, software patents pose a constant threat to the existence of
-any free program.  We wish to make sure that a company cannot
-effectively restrict the users of a free program by obtaining a
-restrictive license from a patent holder.  Therefore, we insist that
-any patent license obtained for a version of the library must be
-consistent with the full freedom of use specified in this license.
-
-  Most GNU software, including some libraries, is covered by the
-ordinary GNU General Public License.  This license, the GNU Lesser
-General Public License, applies to certain designated libraries, and
-is quite different from the ordinary General Public License.  We use
-this license for certain libraries in order to permit linking those
-libraries into non-free programs.
-
-  When a program is linked with a library, whether statically or using
-a shared library, the combination of the two is legally speaking a
-combined work, a derivative of the original library.  The ordinary
-General Public License therefore permits such linking only if the
-entire combination fits its criteria of freedom.  The Lesser General
-Public License permits more lax criteria for linking other code with
-the library.
-
-  We call this license the "Lesser" General Public License because it
-does Less to protect the user's freedom than the ordinary General
-Public License.  It also provides other free software developers Less
-of an advantage over competing non-free programs.  These disadvantages
-are the reason we use the ordinary General Public License for many
-libraries.  However, the Lesser license provides advantages in certain
-special circumstances.
-
-  For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it becomes
-a de-facto standard.  To achieve this, non-free programs must be
-allowed to use the library.  A more frequent case is that a free
-library does the same job as widely used non-free libraries.  In this
-case, there is little to gain by limiting the free library to free
-software only, so we use the Lesser General Public License.
-
-  In other cases, permission to use a particular library in non-free
-programs enables a greater number of people to use a large body of
-free software.  For example, permission to use the GNU C Library in
-non-free programs enables many more people to use the whole GNU
-operating system, as well as its variant, the GNU/Linux operating
-system.
-
-  Although the Lesser General Public License is Less protective of the
-users' freedom, it does ensure that the user of a program that is
-linked with the Library has the freedom and the wherewithal to run
-that program using a modified version of the Library.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.  Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library".  The
-former contains code derived from the library, whereas the latter must
-be combined with the library in order to run.
-\f
-                  GNU LESSER GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License Agreement applies to any software library or other
-program which contains a notice placed by the copyright holder or
-other authorized party saying it may be distributed under the terms of
-this Lesser General Public License (also called "this License").
-Each licensee is addressed as "you".
-
-  A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
-  The "Library", below, refers to any such software library or work
-which has been distributed under these terms.  A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language.  (Hereinafter, translation is
-included without limitation in the term "modification".)
-
-  "Source code" for a work means the preferred form of the work for
-making modifications to it.  For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
-  Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it).  Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-
-  1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
-  You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-\f
-  2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) The modified work must itself be a software library.
-
-    b) You must cause the files modified to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    c) You must cause the whole of the work to be licensed at no
-    charge to all third parties under the terms of this License.
-
-    d) If a facility in the modified Library refers to a function or a
-    table of data to be supplied by an application program that uses
-    the facility, other than as an argument passed when the facility
-    is invoked, then you must make a good faith effort to ensure that,
-    in the event an application does not supply such function or
-    table, the facility still operates, and performs whatever part of
-    its purpose remains meaningful.
-
-    (For example, a function in a library to compute square roots has
-    a purpose that is entirely well-defined independent of the
-    application.  Therefore, Subsection 2d requires that any
-    application-supplied function or table used by this function must
-    be optional: if the application does not supply it, the square
-    root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library.  To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License.  (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.)  Do not make any other change in
-these notices.
-\f
-  Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
-  This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
-  4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
-  If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-  5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library".  Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
-  However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library".  The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
-  When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library.  The
-threshold for this to be true is not precisely defined by law.
-
-  If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work.  (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
-  Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-\f
-  6. As an exception to the Sections above, you may also combine or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
-  You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License.  You must supply a copy of this License.  If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License.  Also, you must do one
-of these things:
-
-    a) Accompany the work with the complete corresponding
-    machine-readable source code for the Library including whatever
-    changes were used in the work (which must be distributed under
-    Sections 1 and 2 above); and, if the work is an executable linked
-    with the Library, with the complete machine-readable "work that
-    uses the Library", as object code and/or source code, so that the
-    user can modify the Library and then relink to produce a modified
-    executable containing the modified Library.  (It is understood
-    that the user who changes the contents of definitions files in the
-    Library will not necessarily be able to recompile the application
-    to use the modified definitions.)
-
-    b) Use a suitable shared library mechanism for linking with the
-    Library.  A suitable mechanism is one that (1) uses at run time a
-    copy of the library already present on the user's computer system,
-    rather than copying library functions into the executable, and (2)
-    will operate properly with a modified version of the library, if
-    the user installs one, as long as the modified version is
-    interface-compatible with the version that the work was made with.
-
-    c) Accompany the work with a written offer, valid for at
-    least three years, to give the same user the materials
-    specified in Subsection 6a, above, for a charge no more
-    than the cost of performing this distribution.
-
-    d) If distribution of the work is made by offering access to copy
-    from a designated place, offer equivalent access to copy the above
-    specified materials from the same place.
-
-    e) Verify that the user has already received a copy of these
-    materials or that you have already sent this user a copy.
-
-  For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it.  However, as a special exception,
-the materials to be distributed need not include anything that is
-normally distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
-  It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system.  Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-\f
-  7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
-    a) Accompany the combined library with a copy of the same work
-    based on the Library, uncombined with any other library
-    facilities.  This must be distributed under the terms of the
-    Sections above.
-
-    b) Give prominent notice with the combined library of the fact
-    that part of it is a work based on the Library, and explaining
-    where to find the accompanying uncombined form of the same work.
-
-  8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License.  Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License.  However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
-  9. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Library or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
-  10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties with
-this License.
-\f
-  11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-  12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License may add
-an explicit geographical distribution limitation excluding those countries,
-so that distribution is permitted only in or among countries not thus
-excluded.  In such case, this License incorporates the limitation as if
-written in the body of this License.
-
-  13. The Free Software Foundation may publish revised and/or new
-versions of the Lesser General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation.  If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-\f
-  14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission.  For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this.  Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
-                            NO WARRANTY
-
-  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
-                     END OF TERMS AND CONDITIONS
-\f
-           How to Apply These Terms to Your New Libraries
-
-  If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change.  You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
-  To apply these terms, attach the following notices to the library.  It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the library's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library 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
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, see
-    <http://www.gnu.org/licenses/>.
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the
-  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
-  <signature of Ty Coon>, 1 April 1990
-  Ty Coon, President of Vice
-
-That's all there is to it!
diff --git a/fdmdv2/branches/0.97/ChangeLog b/fdmdv2/branches/0.97/ChangeLog
deleted file mode 100644 (file)
index 6cc9eb6..0000000
+++ /dev/null
@@ -1,1819 +0,0 @@
-------------------------------------------------------------------------
-r1317 | hobbes1069 | 2013-06-13 10:40:39 -0500 (Thu, 13 Jun 2013) | 1 line
-
-Update wxWidgets bootstrap process to be more simple and other tweaks to USE_STATIC_... options.
-------------------------------------------------------------------------
-r1312 | hobbes1069 | 2013-06-07 13:17:05 -0500 (Fri, 07 Jun 2013) | 1 line
-
-Use version.h for settign version info.
-------------------------------------------------------------------------
-r1311 | shenki | 2013-06-06 19:55:20 -0500 (Thu, 06 Jun 2013) | 5 lines
-
-Add libctb to the list of libraries to build
-
-It will not be downloaded nor built with the current configuration.
-Thanks to Curt, WE7U on the codec2 mailing list for discovering this one.
-
-------------------------------------------------------------------------
-r1310 | shenki | 2013-06-06 04:00:35 -0500 (Thu, 06 Jun 2013) | 2 lines
-
-Move init of sox outside of assert calls
-
-------------------------------------------------------------------------
-r1306 | hobbes1069 | 2013-06-02 11:50:41 -0500 (Sun, 02 Jun 2013) | 1 line
-
-Update version in cmake config.
-------------------------------------------------------------------------
-r1305 | hobbes1069 | 2013-06-02 08:01:51 -0500 (Sun, 02 Jun 2013) | 1 line
-
-Put the file in the right place...
-------------------------------------------------------------------------
-r1304 | hobbes1069 | 2013-06-02 07:59:53 -0500 (Sun, 02 Jun 2013) | 1 line
-
-Add freedv.rc which allows embedding the freedv icon in the windows executable.
-------------------------------------------------------------------------
-r1303 | drowe67 | 2013-06-01 19:19:57 -0500 (Sat, 01 Jun 2013) | 1 line
-
-serial & Hamlib PTT tested OK on Linux
-------------------------------------------------------------------------
-r1300 | drowe67 | 2013-05-31 17:20:06 -0500 (Fri, 31 May 2013) | 1 line
-
-hooked up serial port logic, still to test and debug
-------------------------------------------------------------------------
-r1297 | drowe67 | 2013-05-30 19:50:52 -0500 (Thu, 30 May 2013) | 1 line
-
-restored serial PTT dilaog, yet to hook up actual logic to use it
-------------------------------------------------------------------------
-r1296 | drowe67 | 2013-05-29 21:11:07 -0500 (Wed, 29 May 2013) | 1 line
-
-made filter dialog a little larger as ok/cancel wasbing cropped
-------------------------------------------------------------------------
-r1295 | hobbes1069 | 2013-05-29 20:36:45 -0500 (Wed, 29 May 2013) | 1 line
-
-Move golay23 into codec2 library.
-------------------------------------------------------------------------
-r1294 | hobbes1069 | 2013-05-29 15:06:55 -0500 (Wed, 29 May 2013) | 1 line
-
-Additional hamlib cmake config cleanup.
-------------------------------------------------------------------------
-r1293 | hobbes1069 | 2013-05-28 19:55:57 -0500 (Tue, 28 May 2013) | 1 line
-
-Add cmake checks for hamlib and more fixes for updated source names.
-------------------------------------------------------------------------
-r1292 | hobbes1069 | 2013-05-28 19:15:28 -0500 (Tue, 28 May 2013) | 1 line
-
-Update cmake config for renamed source files.
-------------------------------------------------------------------------
-r1291 | drowe67 | 2013-05-28 01:45:26 -0500 (Tue, 28 May 2013) | 1 line
-
-cleaned up some unused files
-------------------------------------------------------------------------
-r1289 | drowe67 | 2013-05-27 19:37:30 -0500 (Mon, 27 May 2013) | 1 line
-
-minor tweaks to README, remove dunused automake stuff, and tweaked help-about for donations
-------------------------------------------------------------------------
-r1288 | drowe67 | 2013-05-27 18:35:32 -0500 (Mon, 27 May 2013) | 1 line
-
-managedto get Win32 building with hamlib win32 binaries instead of building hamlib myself
-------------------------------------------------------------------------
-r1287 | drowe67 | 2013-05-27 17:33:38 -0500 (Mon, 27 May 2013) | 1 line
-
-first pass at building with hamlib, but cantget hamlib to build
-------------------------------------------------------------------------
-r1286 | drowe67 | 2013-05-27 15:50:41 -0500 (Mon, 27 May 2013) | 1 line
-
-filer dialog now fits on 800x600 without clipping 
-------------------------------------------------------------------------
-r1285 | drowe67 | 2013-05-27 15:46:49 -0500 (Mon, 27 May 2013) | 1 line
-
-after some sizer frustration with ptt dlg, rename commport to ptt
-------------------------------------------------------------------------
-r1284 | shenki | 2013-05-27 05:41:58 -0500 (Mon, 27 May 2013) | 4 lines
-
-Add hamlib related files
-
-These were missing from the previous commit. Oops!
-
-------------------------------------------------------------------------
-r1283 | shenki | 2013-05-27 05:17:32 -0500 (Mon, 27 May 2013) | 13 lines
-
-Add hamlib support for push to talk
-
-This removes libctb in favour of hamlib. It has been tested with 1.2.15.3 of
-hamlib with a IC-7200.
-
-The rig is configured using it's own dialog Tools -> PTT Config.  The only
-options available are the rig model and serial port, the rest of the options
-are obtained from the rig definition in hamlib.
-
-FreeDV will open the configured serial port on startup. When it cannot find
-the radio, an error dialog will be displayed. Spacebar can be used to toggle
-TX/RX.
-
-------------------------------------------------------------------------
-r1268 | drowe67 | 2013-05-23 18:00:55 -0500 (Thu, 23 May 2013) | 1 line
-
-added options dialog, bumped version
-------------------------------------------------------------------------
-r1267 | drowe67 | 2013-05-23 09:24:58 -0500 (Thu, 23 May 2013) | 1 line
-
-make 1600 default and re-arranged to fit 800x600 netbook layout
-------------------------------------------------------------------------
-r1253 | wittend99 | 2013-05-20 16:23:52 -0500 (Mon, 20 May 2013) | 1 line
-
-Personal test project 
-------------------------------------------------------------------------
-r1252 | wittend99 | 2013-05-20 16:22:44 -0500 (Mon, 20 May 2013) | 1 line
-
-Personal test stuff
-------------------------------------------------------------------------
-r1251 | wittend99 | 2013-05-20 16:21:24 -0500 (Mon, 20 May 2013) | 1 line
-
-
-------------------------------------------------------------------------
-r1250 | shenki | 2013-05-18 23:08:22 -0500 (Sat, 18 May 2013) | 7 lines
-
-Allow building against the system sox library
-
-Provide SYSTEM_SOX=y to build against the system libsox instead
-of downloading, building and linking staticly.
-
-The default of linking staticly remains the same.
-
-------------------------------------------------------------------------
-r1249 | hobbes1069 | 2013-05-17 09:53:07 -0500 (Fri, 17 May 2013) | 1 line
-
-Forgot to svn add the readme.
-------------------------------------------------------------------------
-r1248 | hobbes1069 | 2013-05-17 09:51:38 -0500 (Fri, 17 May 2013) | 2 lines
-
-Major cmake config overhall for freedv mingw build. Add freedv icon to installer and start menu entry. Add README.cmake for codec2-dev.
-
-------------------------------------------------------------------------
-r1246 | hobbes1069 | 2013-05-10 18:54:16 -0500 (Fri, 10 May 2013) | 1 line
-
-Workaround for location of config.h
-------------------------------------------------------------------------
-r1245 | hobbes1069 | 2013-05-09 15:44:20 -0500 (Thu, 09 May 2013) | 1 line
-
-Fix internal building of Codec2. Fix finding libraries under MinGW.
-------------------------------------------------------------------------
-r1244 | hobbes1069 | 2013-05-08 14:38:44 -0500 (Wed, 08 May 2013) | 1 line
-
-CMake configuration tweaks for wxWidgets bootstrap build option and update of README.cmake.
-------------------------------------------------------------------------
-r1243 | hobbes1069 | 2013-05-07 09:13:02 -0500 (Tue, 07 May 2013) | 1 line
-
-Fix typo in cmake config, add README.cmake.
-------------------------------------------------------------------------
-r1242 | hobbes1069 | 2013-05-07 09:07:47 -0500 (Tue, 07 May 2013) | 1 line
-
-Add missing BuildCodec2.cmake
-------------------------------------------------------------------------
-r1241 | wittend99 | 2013-05-06 12:17:19 -0500 (Mon, 06 May 2013) | 1 line
-
-Pushing changes to force windows builds to use a configuration file rather than the registry. 
-------------------------------------------------------------------------
-r1240 | wittend99 | 2013-05-06 12:14:34 -0500 (Mon, 06 May 2013) | 1 line
-
-Just changes to my personal IDE workspace.  Irrelevant to everyone but me -DMW
-------------------------------------------------------------------------
-r1239 | hobbes1069 | 2013-05-06 10:49:31 -0500 (Mon, 06 May 2013) | 1 line
-
-Add cmake configuration for contrib dir.
-------------------------------------------------------------------------
-r1238 | hobbes1069 | 2013-05-06 10:48:37 -0500 (Mon, 06 May 2013) | 1 line
-
-CMake configuration updates. More detailed error messages. Icon and desktop installation for Linux. WIN32 CPack tweaks.
-------------------------------------------------------------------------
-r1237 | wittend99 | 2013-04-26 08:13:11 -0500 (Fri, 26 Apr 2013) | 1 line
-
-Reversing commits made in error...
-------------------------------------------------------------------------
-r1236 | wittend99 | 2013-04-26 08:09:05 -0500 (Fri, 26 Apr 2013) | 1 line
-
-
-------------------------------------------------------------------------
-r1235 | hobbes1069 | 2013-04-24 14:34:37 -0500 (Wed, 24 Apr 2013) | 1 line
-
-Update cmake configuration including building static builds of most dependencies. Update codec2 build to include basic cpack configuration.
-------------------------------------------------------------------------
-r1234 | hobbes1069 | 2013-04-19 14:26:53 -0500 (Fri, 19 Apr 2013) | 1 line
-
-Major updates to cmake configuration for both codec2-dev and fdmdv2. Preliminary cpack NSIS configuration for codec2 windows installer.
-------------------------------------------------------------------------
-r1232 | hobbes1069 | 2013-04-15 09:35:41 -0500 (Mon, 15 Apr 2013) | 1 line
-
-Commit inital cmake configuration, *nix and windows icon, and *nix desktop file.
-------------------------------------------------------------------------
-r1231 | wittend99 | 2013-03-26 10:53:46 -0500 (Tue, 26 Mar 2013) | 1 line
-
-
-------------------------------------------------------------------------
-r1230 | wittend99 | 2013-03-26 10:31:07 -0500 (Tue, 26 Mar 2013) | 1 line
-
-Updating my personal resting configuration.
-------------------------------------------------------------------------
-r1229 | wittend99 | 2013-03-26 10:22:42 -0500 (Tue, 26 Mar 2013) | 1 line
-
-Reduce minimum size of the top level frame to let it be used on 1024 x 600 displays.
-------------------------------------------------------------------------
-r1228 | wittend99 | 2013-03-26 10:22:07 -0500 (Tue, 26 Mar 2013) | 1 line
-
-Reduce minimum size of the top level frame to let it be used on 1024 x 600 displays.
-------------------------------------------------------------------------
-r1227 | drowe67 | 2013-03-25 15:33:49 -0500 (Mon, 25 Mar 2013) | 1 line
-
-checked in Stuarts patches 1 thru 4
-------------------------------------------------------------------------
-r1226 | wittend99 | 2013-03-24 17:21:11 -0500 (Sun, 24 Mar 2013) | 1 line
-
-Removed comment
-------------------------------------------------------------------------
-r1224 | drowe67 | 2013-03-24 00:47:15 -0500 (Sun, 24 Mar 2013) | 1 line
-
-prototype 1600 wide mode
-------------------------------------------------------------------------
-r1223 | drowe67 | 2013-03-22 17:51:40 -0500 (Fri, 22 Mar 2013) | 1 line
-
-disabled a few extraneous test modes for v0.96 release
-------------------------------------------------------------------------
-r1221 | drowe67 | 2013-03-19 22:51:21 -0500 (Tue, 19 Mar 2013) | 1 line
-
-bump version
-------------------------------------------------------------------------
-r1219 | drowe67 | 2013-03-19 20:35:29 -0500 (Tue, 19 Mar 2013) | 1 line
-
-made test frames count high error rate frames to get a more accurate result
-------------------------------------------------------------------------
-r1218 | drowe67 | 2013-03-19 20:21:35 -0500 (Tue, 19 Mar 2013) | 1 line
-
-integrated and tested more reliable odd/even frame sync, I think it's an improvement on 4dB poor channel
-------------------------------------------------------------------------
-r1213 | drowe67 | 2013-03-18 02:30:28 -0500 (Mon, 18 Mar 2013) | 1 line
-
-removed clip, added new 1600 bit/s mode (1300+FEC)
-------------------------------------------------------------------------
-r1205 | drowe67 | 2013-03-08 22:00:48 -0600 (Fri, 08 Mar 2013) | 1 line
-
-support for clipping of tx waveform
-------------------------------------------------------------------------
-r1204 | drowe67 | 2013-03-08 17:59:51 -0600 (Fri, 08 Mar 2013) | 1 line
-
-normalised tx power across modes
-------------------------------------------------------------------------
-r1203 | drowe67 | 2013-03-08 14:49:30 -0600 (Fri, 08 Mar 2013) | 1 line
-
-Support in Windows Makefile for golay module
-------------------------------------------------------------------------
-r1202 | drowe67 | 2013-03-08 01:45:10 -0600 (Fri, 08 Mar 2013) | 1 line
-
-changed version number
-------------------------------------------------------------------------
-r1201 | drowe67 | 2013-03-08 01:24:29 -0600 (Fri, 08 Mar 2013) | 1 line
-
-first pass at bit error patterns being plotted
-------------------------------------------------------------------------
-r1199 | drowe67 | 2013-03-07 21:15:29 -0600 (Thu, 07 Mar 2013) | 1 line
-
-added multi-channel support to plot scalar, tested OK with 1 channel
-------------------------------------------------------------------------
-r1198 | drowe67 | 2013-03-07 20:40:11 -0600 (Thu, 07 Mar 2013) | 1 line
-
-BER tx and tx working OK, tested with some simulated AWGN and CCIR files
-------------------------------------------------------------------------
-r1197 | drowe67 | 2013-03-07 01:37:11 -0600 (Thu, 07 Mar 2013) | 1 line
-
-FEC on 2000 mode implemented but not tested with errors (yet)
-------------------------------------------------------------------------
-r1196 | drowe67 | 2013-03-07 01:23:02 -0600 (Thu, 07 Mar 2013) | 1 line
-
-2000 bit/s mode seems to be transmitting OK
-------------------------------------------------------------------------
-r1194 | drowe67 | 2013-03-07 00:49:11 -0600 (Thu, 07 Mar 2013) | 1 line
-
-both 1400 and 1600 modes working in loopback, needed to test 1400V0.91 against a V0.91 release
-------------------------------------------------------------------------
-r1189 | drowe67 | 2013-03-06 22:18:54 -0600 (Wed, 06 Mar 2013) | 1 line
-
-added mode radio-buttons to front page of GUI
-------------------------------------------------------------------------
-r1155 | wittend99 | 2012-12-30 16:41:15 -0600 (Sun, 30 Dec 2012) | 1 line
-
-Trivial updates, looking for uninitialized variables and other loose ends.
-------------------------------------------------------------------------
-r1154 | wittend99 | 2012-12-29 17:28:53 -0600 (Sat, 29 Dec 2012) | 1 line
-
-Add files README.osx and freedv_osx_port.patch.gz, update credits.txt file.  Not much else.
-------------------------------------------------------------------------
-r1153 | wittend99 | 2012-12-29 13:10:49 -0600 (Sat, 29 Dec 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r1152 | drowe67 | 2012-12-23 18:14:07 -0600 (Sun, 23 Dec 2012) | 1 line
-
-first pass at autotools build system, thanks Patrick, not tested at this stage, Makefile.linux still works
-------------------------------------------------------------------------
-r1151 | drowe67 | 2012-12-22 01:29:28 -0600 (Sat, 22 Dec 2012) | 1 line
-
-changed changed fifo.h and fdmdv.h to more unique names codec2_fifo.h & codec2_fdmdv.h
-------------------------------------------------------------------------
-r1145 | wittend99 | 2012-12-16 20:43:05 -0600 (Sun, 16 Dec 2012) | 1 line
-
-Unversion some pieces unintentionally added by restructuring.
-------------------------------------------------------------------------
-r1144 | wittend99 | 2012-12-16 20:40:23 -0600 (Sun, 16 Dec 2012) | 1 line
-
-Added a msvc folder to build for a future MS C++ build.
-------------------------------------------------------------------------
-r1143 | wittend99 | 2012-12-16 20:33:05 -0600 (Sun, 16 Dec 2012) | 1 line
-
-Move all Codelite-Mingw build environment from ./build to ./build/codelite
-------------------------------------------------------------------------
-r1142 | wittend99 | 2012-12-16 20:04:21 -0600 (Sun, 16 Dec 2012) | 1 line
-
-Add codelite subfolder.
-------------------------------------------------------------------------
-r1141 | wittend99 | 2012-12-16 19:56:46 -0600 (Sun, 16 Dec 2012) | 1 line
-
-Work on moving multiple unrelated classes out of fdmdv_main.cpp, cleanup dead code.
-------------------------------------------------------------------------
-r1140 | drowe67 | 2012-12-16 16:57:25 -0600 (Sun, 16 Dec 2012) | 1 line
-
-disabled jack with portaudio based on mailing list feedback, thanks guys
-------------------------------------------------------------------------
-r1139 | drowe67 | 2012-12-16 00:24:46 -0600 (Sun, 16 Dec 2012) | 1 line
-
-typo in README.linux
-------------------------------------------------------------------------
-r1138 | drowe67 | 2012-12-16 00:22:52 -0600 (Sun, 16 Dec 2012) | 1 line
-
-2nd pass at generic Makefile.linux
-------------------------------------------------------------------------
-r1137 | drowe67 | 2012-12-15 17:28:45 -0600 (Sat, 15 Dec 2012) | 1 line
-
-experimental new makefile for Linux that downloads and builds most of the libraries we need, tested on Ubuntu 9.1 and 10.04
-------------------------------------------------------------------------
-r1136 | drowe67 | 2012-12-15 06:14:13 -0600 (Sat, 15 Dec 2012) | 1 line
-
-makefile modified for Ubuntu 10.04
-------------------------------------------------------------------------
-r1135 | drowe67 | 2012-12-15 05:41:44 -0600 (Sat, 15 Dec 2012) | 1 line
-
-experimental Linux makefile, about to test on Ubuntu 10.04
-------------------------------------------------------------------------
-r1134 | wittend99 | 2012-12-14 15:36:21 -0600 (Fri, 14 Dec 2012) | 1 line
-
-Comment out the event handlers which were connected to the wrong check boxes in the PTT dialog. This _should_ have no effect on behavior because the event handlers in question were unused in the current code.
-------------------------------------------------------------------------
-r1133 | wittend99 | 2012-12-12 19:11:14 -0600 (Wed, 12 Dec 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r1132 | wittend99 | 2012-12-11 08:43:05 -0600 (Tue, 11 Dec 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r1131 | drowe67 | 2012-12-10 18:31:12 -0600 (Mon, 10 Dec 2012) | 1 line
-
-added some debug code to trap reported sox lib errors
-------------------------------------------------------------------------
-r1130 | wittend99 | 2012-12-10 18:05:18 -0600 (Mon, 10 Dec 2012) | 2 lines
-
-Moved version.h from /fdmdv2 to /fdmdv2/src. 
-Removed four orphaned lib files from /fdmdv2
-------------------------------------------------------------------------
-r1129 | wittend99 | 2012-12-10 17:37:17 -0600 (Mon, 10 Dec 2012) | 2 lines
-
-Renamed (finally) OnTogBtnTXClick to OnTogBtnPTT globally.  
-Removed fdmdv2-doc/* for now - to reduce traffic for first time users. Probably to be replaced with freedv-doc when useful content stabilizes.
-------------------------------------------------------------------------
-r1128 | drowe67 | 2012-12-09 23:36:38 -0600 (Sun, 09 Dec 2012) | 1 line
-
-small edits to README.Linux
-------------------------------------------------------------------------
-r1127 | drowe67 | 2012-12-09 23:33:18 -0600 (Sun, 09 Dec 2012) | 1 line
-
-after testing half duplex on Windows
-------------------------------------------------------------------------
-r1126 | drowe67 | 2012-12-09 23:09:11 -0600 (Sun, 09 Dec 2012) | 1 line
-
-first pass at half duplex, still testing
-------------------------------------------------------------------------
-r1125 | wittend99 | 2012-12-09 19:55:45 -0600 (Sun, 09 Dec 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r1124 | drowe67 | 2012-12-06 18:14:53 -0600 (Thu, 06 Dec 2012) | 1 line
-
-analog 6dB boost on mic, some experiments with waterfall blue colors, using 200-2800Hz for waterfall max AGC level, and updated Linux compile notes
-------------------------------------------------------------------------
-r1123 | drowe67 | 2012-12-05 21:04:43 -0600 (Wed, 05 Dec 2012) | 1 line
-
-added V0.9 Beta version code and support for future versioning via version.txt
-------------------------------------------------------------------------
-r1122 | drowe67 | 2012-12-05 15:06:24 -0600 (Wed, 05 Dec 2012) | 1 line
-
-added Codec 2 build instructions to README.Win32
-------------------------------------------------------------------------
-r1121 | wittend99 | 2012-12-05 09:22:25 -0600 (Wed, 05 Dec 2012) | 1 line
-
-More work on PTT button.
-------------------------------------------------------------------------
-r1120 | drowe67 | 2012-12-04 18:37:25 -0600 (Tue, 04 Dec 2012) | 1 line
-
-fix for File-Exit, works under Linux
-------------------------------------------------------------------------
-r1119 | wittend99 | 2012-12-04 15:27:23 -0600 (Tue, 04 Dec 2012) | 1 line
-
-Improve layout of PTT dialog layout under Linux
-------------------------------------------------------------------------
-r1118 | drowe67 | 2012-12-04 00:52:27 -0600 (Tue, 04 Dec 2012) | 1 line
-
-removed a few prints and #ifdefed out the display of txid/rxid buttons for now as feature wont be implemented for the beta
-------------------------------------------------------------------------
-r1117 | wittend99 | 2012-12-03 22:27:26 -0600 (Mon, 03 Dec 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r1116 | wittend99 | 2012-12-03 21:41:59 -0600 (Mon, 03 Dec 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r1115 | wittend99 | 2012-12-03 21:39:40 -0600 (Mon, 03 Dec 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r1114 | drowe67 | 2012-12-02 23:42:18 -0600 (Sun, 02 Dec 2012) | 1 line
-
-better shut down of EQ states to prevent bombing with sound card error
-------------------------------------------------------------------------
-r1113 | drowe67 | 2012-12-02 23:31:12 -0600 (Sun, 02 Dec 2012) | 1 line
-
-speaker eq states now being preserved and can take eqs in and out at run time
-------------------------------------------------------------------------
-r1112 | drowe67 | 2012-12-02 19:41:38 -0600 (Sun, 02 Dec 2012) | 1 line
-
-real time EQ adjustment working, designing filters on the fly, but still a few GUI and context save/restore bugs
-------------------------------------------------------------------------
-r1111 | drowe67 | 2012-12-02 04:39:21 -0600 (Sun, 02 Dec 2012) | 1 line
-
-EQ enable and separate default buttons, ready to wire up real time code
-------------------------------------------------------------------------
-r1110 | drowe67 | 2012-12-02 03:18:22 -0600 (Sun, 02 Dec 2012) | 1 line
-
-make axis labels dissapear if windows small enough to make text overlap
-------------------------------------------------------------------------
-r1109 | drowe67 | 2012-12-01 20:48:07 -0600 (Sat, 01 Dec 2012) | 1 line
-
-first pass at speaker eq controls
-------------------------------------------------------------------------
-r1108 | drowe67 | 2012-12-01 20:26:13 -0600 (Sat, 01 Dec 2012) | 1 line
-
-some tweaks to mic in filter
-------------------------------------------------------------------------
-r1107 | drowe67 | 2012-12-01 18:01:07 -0600 (Sat, 01 Dec 2012) | 1 line
-
-3 band equaliser for Mic In working on dialog, not connected to actual real time speech yet
-------------------------------------------------------------------------
-r1106 | drowe67 | 2012-12-01 02:38:43 -0600 (Sat, 01 Dec 2012) | 1 line
-
-fixed some registry probs on Win32, read & write formats were different.  Think its OK now
-------------------------------------------------------------------------
-r1105 | drowe67 | 2012-12-01 01:46:36 -0600 (Sat, 01 Dec 2012) | 1 line
-
-reduced filter dialog size
-------------------------------------------------------------------------
-r1104 | drowe67 | 2012-12-01 00:07:39 -0600 (Sat, 01 Dec 2012) | 1 line
-
-instructions for building sox on Win32 and modified win32 makefile for sox
-------------------------------------------------------------------------
-r1103 | wittend99 | 2012-11-30 22:20:24 -0600 (Fri, 30 Nov 2012) | 1 line
-
-Fix some things about PTT.
-------------------------------------------------------------------------
-r1102 | drowe67 | 2012-11-30 22:06:23 -0600 (Fri, 30 Nov 2012) | 1 line
-
-first pass at real time update of MicIn spectrum in response to slider
-------------------------------------------------------------------------
-r1095 | drowe67 | 2012-11-30 19:56:34 -0600 (Fri, 30 Nov 2012) | 1 line
-
-reduced size of filter dialog so it fits on 800 high screens...
-------------------------------------------------------------------------
-r1094 | drowe67 | 2012-11-30 19:09:11 -0600 (Fri, 30 Nov 2012) | 1 line
-
-equaliser: one slider partially connected
-------------------------------------------------------------------------
-r1093 | wittend99 | 2012-11-30 18:52:49 -0600 (Fri, 30 Nov 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r1092 | drowe67 | 2012-11-30 18:02:09 -0600 (Fri, 30 Nov 2012) | 1 line
-
-wrote and unit tested library to use sox biqaud filter
-------------------------------------------------------------------------
-r1091 | wittend99 | 2012-11-30 14:29:40 -0600 (Fri, 30 Nov 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r1090 | wittend99 | 2012-11-29 20:39:08 -0600 (Thu, 29 Nov 2012) | 1 line
-
-No more segfault, problem was not in this code.  Fixes to the PTT signal polarity, should work now, but not properly tested.
-------------------------------------------------------------------------
-r1088 | drowe67 | 2012-11-29 18:36:46 -0600 (Thu, 29 Nov 2012) | 1 line
-
-Win32 makefile and install notes for libctb
-------------------------------------------------------------------------
-r1086 | drowe67 | 2012-11-29 17:30:25 -0600 (Thu, 29 Nov 2012) | 1 line
-
-modified Linux makefile for libctb, added build instructions for libctb
-------------------------------------------------------------------------
-r1085 | wittend99 | 2012-11-29 16:22:25 -0600 (Thu, 29 Nov 2012) | 1 line
-
-I should have noted - this and the previous commit give me a segfault when the audio processing runs.
-------------------------------------------------------------------------
-r1084 | wittend99 | 2012-11-29 16:18:52 -0600 (Thu, 29 Nov 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r1083 | drowe67 | 2012-11-26 23:03:09 -0600 (Mon, 26 Nov 2012) | 1 line
-
-rewrote callsign system along fdmdv1 lines
-------------------------------------------------------------------------
-r1082 | drowe67 | 2012-11-26 21:39:17 -0600 (Mon, 26 Nov 2012) | 1 line
-
-rescaled waterfall and spectrum to be 300Hz wide, as per fdmdv1
-------------------------------------------------------------------------
-r1080 | drowe67 | 2012-11-26 20:41:12 -0600 (Mon, 26 Nov 2012) | 1 line
-
-added play file to From Radio option
-------------------------------------------------------------------------
-r1079 | drowe67 | 2012-11-26 19:24:40 -0600 (Mon, 26 Nov 2012) | 1 line
-
-automatic scaling of spectrogram, and toggling color mapping.  Think it works better but need to try on real signals
-------------------------------------------------------------------------
-r1078 | drowe67 | 2012-11-26 16:48:17 -0600 (Mon, 26 Nov 2012) | 1 line
-
-implemented level guage on tx & rx inclduing too high warning
-------------------------------------------------------------------------
-r1077 | drowe67 | 2012-11-26 14:43:08 -0600 (Mon, 26 Nov 2012) | 1 line
-
-number of secords to record from radio hard coded for Win32 as I cant read number of secs from dialog ctrl
-------------------------------------------------------------------------
-r1073 | drowe67 | 2012-11-26 00:03:20 -0600 (Mon, 26 Nov 2012) | 1 line
-
-receive data now doing something sensible, but I think rxid window is too big
-------------------------------------------------------------------------
-r1070 | wittend99 | 2012-11-25 20:37:41 -0600 (Sun, 25 Nov 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r1069 | drowe67 | 2012-11-25 18:23:24 -0600 (Sun, 25 Nov 2012) | 1 line
-
-first pass with data, can send messages and printf to screen.  Need to think about silence thresholds/time outs
-------------------------------------------------------------------------
-r1066 | drowe67 | 2012-11-25 03:34:47 -0600 (Sun, 25 Nov 2012) | 1 line
-
-tx id callback working on Linux
-------------------------------------------------------------------------
-r1065 | drowe67 | 2012-11-25 03:28:31 -0600 (Sun, 25 Nov 2012) | 1 line
-
-started hooking up controls for tx and rx data experiments
-------------------------------------------------------------------------
-r1064 | drowe67 | 2012-11-25 03:27:04 -0600 (Sun, 25 Nov 2012) | 1 line
-
-modified varicode decoder to retain state between calls so it can be interrupted half way thru decoding one character
-------------------------------------------------------------------------
-r1063 | drowe67 | 2012-11-25 00:01:27 -0600 (Sun, 25 Nov 2012) | 1 line
-
-Filter dialog all hooked up to Codec, still requires testing
-------------------------------------------------------------------------
-r1062 | wittend99 | 2012-11-24 20:38:37 -0600 (Sat, 24 Nov 2012) | 1 line
-
-Work on PTT control dialog. Not finished...
-------------------------------------------------------------------------
-r1060 | drowe67 | 2012-11-24 18:00:28 -0600 (Sat, 24 Nov 2012) | 1 line
-
-basic filter dialog screen working, after usual pain with sizers
-------------------------------------------------------------------------
-r1059 | drowe67 | 2012-11-24 16:03:07 -0600 (Sat, 24 Nov 2012) | 1 line
-
-added filter dialog, it displays OK but doesn't do anything yet.  test OK under Linux
-------------------------------------------------------------------------
-r1058 | drowe67 | 2012-11-24 05:02:48 -0600 (Sat, 24 Nov 2012) | 1 line
-
-varicode encoding and decoding, passes unittest
-------------------------------------------------------------------------
-r1056 | drowe67 | 2012-11-23 17:27:07 -0600 (Fri, 23 Nov 2012) | 1 line
-
-minor tweaks to scatter scaling
-------------------------------------------------------------------------
-r1055 | drowe67 | 2012-11-23 17:04:43 -0600 (Fri, 23 Nov 2012) | 1 line
-
-automatic scaling of scatter diagram, quite nice to watch
-------------------------------------------------------------------------
-r1054 | drowe67 | 2012-11-23 16:39:17 -0600 (Fri, 23 Nov 2012) | 1 line
-
-higher resn FFT, red tuning line, automatic page switching on tx/rx, works OK on Linux
-------------------------------------------------------------------------
-r1052 | drowe67 | 2012-11-23 13:51:46 -0600 (Fri, 23 Nov 2012) | 1 line
-
-modified Makefiles for DW cleanup, modified waterfall to handle slow waterfall updates where DT nmaps to less than one vertical pixel.  Waterfall now covers 30 seconds. Works OK on Linux
-------------------------------------------------------------------------
-r1051 | wittend99 | 2012-11-23 10:24:35 -0600 (Fri, 23 Nov 2012) | 1 line
-
-Removed unnecessary or distracting Files, C++ Classes, members, and unimplemented code.
-------------------------------------------------------------------------
-r1050 | wittend99 | 2012-11-23 10:01:05 -0600 (Fri, 23 Nov 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r1049 | wittend99 | 2012-11-23 09:59:26 -0600 (Fri, 23 Nov 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r1048 | drowe67 | 2012-11-23 04:41:31 -0600 (Fri, 23 Nov 2012) | 1 line
-
-wired up squelch, added slow SNR option, works OK on Linux, need to test on Win32
-------------------------------------------------------------------------
-r1046 | drowe67 | 2012-11-22 13:39:05 -0600 (Thu, 22 Nov 2012) | 1 line
-
-modified split so tx doesn't change, version number in program title on main window, edited to-do
-------------------------------------------------------------------------
-r1045 | drowe67 | 2012-11-21 17:28:54 -0600 (Wed, 21 Nov 2012) | 1 line
-
-click tune with split and tx logic, works OK on Linux
-------------------------------------------------------------------------
-r1043 | drowe67 | 2012-11-20 23:31:22 -0600 (Tue, 20 Nov 2012) | 1 line
-
-tx and rx click tune, tied together (non split)
-------------------------------------------------------------------------
-r1042 | drowe67 | 2012-11-20 22:57:41 -0600 (Tue, 20 Nov 2012) | 1 line
-
-rx click tune using globals resulted in a cleaner design although I would prefer not to have used globals.  Maybe passing the address of the freq offset in the waterfall/spectrum constructor would have ben cleaner
-------------------------------------------------------------------------
-r1041 | drowe67 | 2012-11-20 22:32:21 -0600 (Tue, 20 Nov 2012) | 1 line
-
-first pass at click to tune for rx.  It works OK, but the communication of the click freq sucks so I might try re-writing that bit
-------------------------------------------------------------------------
-r1040 | drowe67 | 2012-11-20 04:07:13 -0600 (Tue, 20 Nov 2012) | 1 line
-
-looks up svn revision from the Internet
-------------------------------------------------------------------------
-r1039 | drowe67 | 2012-11-20 02:58:55 -0600 (Tue, 20 Nov 2012) | 1 line
-
-attemp at support for svn revsion under windows 
-------------------------------------------------------------------------
-r1038 | drowe67 | 2012-11-20 02:53:47 -0600 (Tue, 20 Nov 2012) | 1 line
-
-testing adding svn revision to about (yet again)
-------------------------------------------------------------------------
-r1037 | drowe67 | 2012-11-20 02:52:51 -0600 (Tue, 20 Nov 2012) | 1 line
-
-testing adding svn revision to about (and again)
-------------------------------------------------------------------------
-r1036 | drowe67 | 2012-11-20 02:45:28 -0600 (Tue, 20 Nov 2012) | 1 line
-
-testing adding svn revision to about (again)
-------------------------------------------------------------------------
-r1035 | drowe67 | 2012-11-20 02:44:30 -0600 (Tue, 20 Nov 2012) | 1 line
-
-testing adding svn revision to about
-------------------------------------------------------------------------
-r1034 | wittend99 | 2012-11-19 21:55:22 -0600 (Mon, 19 Nov 2012) | 1 line
-
-Modified the header comment block of all files to indicate GPL license.
-------------------------------------------------------------------------
-r1033 | drowe67 | 2012-11-19 20:49:53 -0600 (Mon, 19 Nov 2012) | 1 line
-
-removed tx & rx loopback, as they no longer necc
-------------------------------------------------------------------------
-r1032 | drowe67 | 2012-11-19 20:37:44 -0600 (Mon, 19 Nov 2012) | 1 line
-
-added record from radio feature, works OK on wave and raw files, can demod/decode aved files using command line tools
-------------------------------------------------------------------------
-r1031 | drowe67 | 2012-11-19 04:14:34 -0600 (Mon, 19 Nov 2012) | 1 line
-
-wav and raw at the same time, can't position loop checkbox correctly...
-------------------------------------------------------------------------
-r1030 | drowe67 | 2012-11-19 03:56:56 -0600 (Mon, 19 Nov 2012) | 1 line
-
-added some todos to readme.linux, added play file to mic in feature
-------------------------------------------------------------------------
-r1024 | drowe67 | 2012-11-18 21:49:16 -0600 (Sun, 18 Nov 2012) | 1 line
-
-changed labels on audo config test, fifo header file change
-------------------------------------------------------------------------
-r1023 | wittend99 | 2012-11-18 21:20:58 -0600 (Sun, 18 Nov 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r1016 | drowe67 | 2012-11-17 22:26:06 -0600 (Sat, 17 Nov 2012) | 1 line
-
-tried static text fields for API tab of audio config dlg
-------------------------------------------------------------------------
-r1015 | drowe67 | 2012-11-17 17:03:02 -0600 (Sat, 17 Nov 2012) | 1 line
-
-was a bit unstable under ubuntu/alsa so added some mutex protection around fifo access that is shared by callsbacks and tx/rx processing threads.  Alsa now seems more stable.
-------------------------------------------------------------------------
-r1014 | drowe67 | 2012-11-17 16:07:23 -0600 (Sat, 17 Nov 2012) | 1 line
-
-experimental thread based tx/rx processing.  Seems more stable on Windows and works better with Rig Blaster despite dirfting tx/rx sample clock.  Still some start up transients, i.e. loss of sync in first few seconds and occasionally thereafter
-------------------------------------------------------------------------
-r1001 | drowe67 | 2012-11-16 20:11:54 -0600 (Fri, 16 Nov 2012) | 1 line
-
-moved tx and rx processing to OnIdle, using device-defined buffer sizes for portaudio callbacks.  Still testing.
-------------------------------------------------------------------------
-r978 | drowe67 | 2012-11-15 22:08:38 -0600 (Thu, 15 Nov 2012) | 1 line
-
-experimental support for mono record devices such as the rig blaster, still testing
-------------------------------------------------------------------------
-r970 | drowe67 | 2012-11-14 05:12:26 -0600 (Wed, 14 Nov 2012) | 1 line
-
-made sample rate combo box wider
-------------------------------------------------------------------------
-r969 | drowe67 | 2012-11-14 02:17:13 -0600 (Wed, 14 Nov 2012) | 1 line
-
-nicer layout with test feature
-------------------------------------------------------------------------
-r968 | drowe67 | 2012-11-13 16:34:42 -0600 (Tue, 13 Nov 2012) | 1 line
-
-test feature for all 4 audio devices, tested OK on Ubuntu 9.10, needs work on the layout
-------------------------------------------------------------------------
-r967 | drowe67 | 2012-11-13 02:18:53 -0600 (Tue, 13 Nov 2012) | 1 line
-
-first pass at a test tool for audio config dialog that plots input to a little screen.  Just rx in at this stage.  Some indication that it is occasionally unstable.  Might need to convert to async/callback model
-------------------------------------------------------------------------
-r966 | drowe67 | 2012-11-12 17:03:04 -0600 (Mon, 12 Nov 2012) | 1 line
-
-Sync indicator now works for Windows, but isn't multicolour like on Linux. As it is implemented with a radio button, unfortunately the user can press it.
-------------------------------------------------------------------------
-r965 | drowe67 | 2012-11-12 16:23:18 -0600 (Mon, 12 Nov 2012) | 1 line
-
-minor tweaks to SNR positioning
-------------------------------------------------------------------------
-r964 | drowe67 | 2012-11-12 15:43:36 -0600 (Mon, 12 Nov 2012) | 1 line
-
-Testing wxlogdebug and added device number to device name in config dialog to help ID devices with the same name under Windows
-------------------------------------------------------------------------
-r963 | drowe67 | 2012-11-12 14:22:51 -0600 (Mon, 12 Nov 2012) | 1 line
-
-added some notes to Linux README
-------------------------------------------------------------------------
-r962 | wittend99 | 2012-11-12 13:53:33 -0600 (Mon, 12 Nov 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r961 | drowe67 | 2012-11-11 22:40:02 -0600 (Sun, 11 Nov 2012) | 1 line
-
-small sample rate selection bug
-------------------------------------------------------------------------
-r960 | drowe67 | 2012-11-11 22:30:48 -0600 (Sun, 11 Nov 2012) | 1 line
-
-fixed bug, can now run soudn card1 at 44kHz
-------------------------------------------------------------------------
-r959 | drowe67 | 2012-11-11 19:34:32 -0600 (Sun, 11 Nov 2012) | 1 line
-
-After testing on an Alsa based Ubuntu 10 machine: tweaked layout, added dynamic sample rate list generation to dlg_audioconfig, refactored a few routines that got messy, and separated portaudio device number from list box index to support non-duplex devices
-------------------------------------------------------------------------
-r958 | drowe67 | 2012-11-11 15:58:29 -0600 (Sun, 11 Nov 2012) | 1 line
-
-improved detection of erros due to removed sound card
-------------------------------------------------------------------------
-r957 | drowe67 | 2012-11-11 04:05:21 -0600 (Sun, 11 Nov 2012) | 1 line
-
-disable Audio Config dialog when running
-------------------------------------------------------------------------
-r956 | drowe67 | 2012-11-10 19:22:01 -0600 (Sat, 10 Nov 2012) | 1 line
-
-first pass at connecting audio config dialog to rest of system.  Can configure single and dual card systems on Unbuntu 9.10.  Still a few situations that can crash system
-------------------------------------------------------------------------
-r955 | drowe67 | 2012-11-08 22:38:02 -0600 (Thu, 08 Nov 2012) | 1 line
-
-removed some accel key debug warnings on start up
-------------------------------------------------------------------------
-r954 | drowe67 | 2012-11-08 21:16:52 -0600 (Thu, 08 Nov 2012) | 1 line
-
-peristent storing of squelch levels to config file
-------------------------------------------------------------------------
-r953 | drowe67 | 2012-11-08 20:43:55 -0600 (Thu, 08 Nov 2012) | 1 line
-
-wired up analog mode
-------------------------------------------------------------------------
-r952 | drowe67 | 2012-11-08 20:29:35 -0600 (Thu, 08 Nov 2012) | 1 line
-
-removed ALC
-------------------------------------------------------------------------
-r951 | drowe67 | 2012-11-08 19:56:45 -0600 (Thu, 08 Nov 2012) | 1 line
-
-positioned squelch and snr static text correctly and stays centred
-------------------------------------------------------------------------
-r950 | drowe67 | 2012-11-07 22:19:29 -0600 (Wed, 07 Nov 2012) | 1 line
-
-playing with squelch slider, but not happy with layout
-------------------------------------------------------------------------
-r949 | drowe67 | 2012-11-07 19:35:43 -0600 (Wed, 07 Nov 2012) | 1 line
-
-hooked up sync LED, changed SNR text box to static text to prevent it getting focus
-------------------------------------------------------------------------
-r948 | drowe67 | 2012-11-07 17:14:42 -0600 (Wed, 07 Nov 2012) | 1 line
-
-formatting, and added freq shifter in front of demod to suport click tune feature
-------------------------------------------------------------------------
-r944 | wittend99 | 2012-11-07 13:09:14 -0600 (Wed, 07 Nov 2012) | 1 line
-
-Remove dependencies in Icon files in dlg_audiooptions.*.  Eliminated use of icons for now.  They were ugly anyway.  Dialog returns the string form of the chosen interface, and not the if # for now.  This can be trivially changed.
-------------------------------------------------------------------------
-r939 | wittend99 | 2012-11-06 20:09:35 -0600 (Tue, 06 Nov 2012) | 1 line
-
-Changed dlg_audio.* to dlg_audiooptions.*, changed other dlg code, altered makefiles.
-------------------------------------------------------------------------
-r938 | wittend99 | 2012-11-06 08:18:21 -0600 (Tue, 06 Nov 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r937 | drowe67 | 2012-11-05 18:47:29 -0600 (Mon, 05 Nov 2012) | 1 line
-
-Added editor set up instructions to avoid problems with tabs
-------------------------------------------------------------------------
-r936 | drowe67 | 2012-11-05 17:58:54 -0600 (Mon, 05 Nov 2012) | 1 line
-
-changed Davids emacs to use spaces rather than tabs
-------------------------------------------------------------------------
-r935 | wittend99 | 2012-11-05 13:22:16 -0600 (Mon, 05 Nov 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r934 | drowe67 | 2012-11-05 02:20:38 -0600 (Mon, 05 Nov 2012) | 1 line
-
-Added libresample
-------------------------------------------------------------------------
-r933 | drowe67 | 2012-11-05 02:18:35 -0600 (Mon, 05 Nov 2012) | 1 line
-
-added libsamplerate
-------------------------------------------------------------------------
-r932 | drowe67 | 2012-11-05 01:46:54 -0600 (Mon, 05 Nov 2012) | 1 line
-
-SNR text box and bar graph hooked up
-------------------------------------------------------------------------
-r931 | drowe67 | 2012-11-04 23:25:34 -0600 (Sun, 04 Nov 2012) | 1 line
-
-building up soundcard auto detect code
-------------------------------------------------------------------------
-r930 | drowe67 | 2012-11-04 23:04:49 -0600 (Sun, 04 Nov 2012) | 1 line
-
-improved speech plots with a better decimation algorithm
-------------------------------------------------------------------------
-r928 | drowe67 | 2012-11-04 18:23:51 -0600 (Sun, 04 Nov 2012) | 1 line
-
-added experimental waveform plots, the idea is to usethm as a tool to adjust levels. Not sure if they are useful yet...
-------------------------------------------------------------------------
-r927 | drowe67 | 2012-11-04 17:11:29 -0600 (Sun, 04 Nov 2012) | 1 line
-
-first pass at plot-scalar working to produce timing and frequency offset plots
-------------------------------------------------------------------------
-r926 | drowe67 | 2012-11-03 17:15:48 -0500 (Sat, 03 Nov 2012) | 1 line
-
-cleaned up some code after adjusting demod sample rate slip 
-------------------------------------------------------------------------
-r924 | drowe67 | 2012-11-03 16:30:41 -0500 (Sat, 03 Nov 2012) | 1 line
-
-refactored sample rate conversion code to clean up sound card 1 call back, works OK
-------------------------------------------------------------------------
-r923 | wittend99 | 2012-11-03 10:57:11 -0500 (Sat, 03 Nov 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r922 | drowe67 | 2012-11-03 02:53:32 -0500 (Sat, 03 Nov 2012) | 1 line
-
-shutdown codec for libresample states
-------------------------------------------------------------------------
-r921 | drowe67 | 2012-11-03 01:32:20 -0500 (Sat, 03 Nov 2012) | 1 line
-
-libresample used for all 4 sample rate conversions, but needs clean up into functions.
-------------------------------------------------------------------------
-r920 | drowe67 | 2012-11-03 01:13:21 -0500 (Sat, 03 Nov 2012) | 1 line
-
-partial port to libresample, using 48kHz for one sound card and 44.1kHz for another
-------------------------------------------------------------------------
-r918 | drowe67 | 2012-11-02 01:26:16 -0500 (Fri, 02 Nov 2012) | 1 line
-
-debug version while testing different headphones
-------------------------------------------------------------------------
-r917 | drowe67 | 2012-11-01 21:56:57 -0500 (Thu, 01 Nov 2012) | 1 line
-
-working better with new headphones - about to remove some debug printfs
-------------------------------------------------------------------------
-r916 | drowe67 | 2012-11-01 19:02:56 -0500 (Thu, 01 Nov 2012) | 1 line
-
-debug version, looking for reason mic audio is getting corrupted
-------------------------------------------------------------------------
-r915 | wittend99 | 2012-11-01 17:31:35 -0500 (Thu, 01 Nov 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r902 | drowe67 | 2012-10-30 20:58:52 -0500 (Tue, 30 Oct 2012) | 1 line
-
-modified for independant in and output portaudio devices to suit Win32.
-------------------------------------------------------------------------
-r901 | drowe67 | 2012-10-30 19:18:00 -0500 (Tue, 30 Oct 2012) | 1 line
-
-first pass at full duplex working ... two sound card, tx looped back to rx audio, can hear what I am saying in headset.  Still some stability issues
-------------------------------------------------------------------------
-r900 | drowe67 | 2012-10-30 18:40:11 -0500 (Tue, 30 Oct 2012) | 1 line
-
-have tx process doing something with one sound card - it sends a signal that I can loop back to rx with good quality scatter diagram.  Next stage is to enable the 2nd sound card
-------------------------------------------------------------------------
-r899 | drowe67 | 2012-10-30 01:18:02 -0500 (Tue, 30 Oct 2012) | 1 line
-
-first attempt at support for two sound cardsand tx processing.  Debugging tx side
-------------------------------------------------------------------------
-r888 | drowe67 | 2012-10-28 22:29:37 -0500 (Sun, 28 Oct 2012) | 1 line
-
-replaced buffers in rx callback with fifos to ease porting to two sound cards
-------------------------------------------------------------------------
-r873 | wittend99 | 2012-10-28 18:14:06 -0500 (Sun, 28 Oct 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r855 | drowe67 | 2012-10-28 03:31:55 -0500 (Sun, 28 Oct 2012) | 1 line
-
-changed portaudio buffer size to make OSS work a little better on Ububtu 9.10 - but still cant adjust mic gain
-------------------------------------------------------------------------
-r831 | drowe67 | 2012-10-27 00:36:22 -0500 (Sat, 27 Oct 2012) | 1 line
-
-Fixed Waterfall/Spectrum axis labels on windows.  Rx loop also decodes modem signals OK, sounds good, no clicks or pops!
-------------------------------------------------------------------------
-r829 | drowe67 | 2012-10-26 18:47:18 -0500 (Fri, 26 Oct 2012) | 1 line
-
-Davids R's first version building on Win32
-------------------------------------------------------------------------
-r825 | wittend99 | 2012-10-25 17:05:20 -0500 (Thu, 25 Oct 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r816 | wittend99 | 2012-10-25 14:34:02 -0500 (Thu, 25 Oct 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r815 | wittend99 | 2012-10-25 14:27:38 -0500 (Thu, 25 Oct 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r814 | wittend99 | 2012-10-25 14:23:10 -0500 (Thu, 25 Oct 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r813 | wittend99 | 2012-10-25 13:45:14 -0500 (Thu, 25 Oct 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r812 | wittend99 | 2012-10-25 13:39:14 -0500 (Thu, 25 Oct 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r811 | wittend99 | 2012-10-25 08:50:56 -0500 (Thu, 25 Oct 2012) | 1 line
-
-Just update my IDE configuration probably of no interest to anyone but me. DMW  
-------------------------------------------------------------------------
-r804 | wittend99 | 2012-10-24 10:30:04 -0500 (Wed, 24 Oct 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r803 | drowe67 | 2012-10-24 03:14:35 -0500 (Wed, 24 Oct 2012) | 1 line
-
-first pass at a working scatter plot - haven't tested on real modem signals yet
-------------------------------------------------------------------------
-r802 | drowe67 | 2012-10-23 19:50:22 -0500 (Tue, 23 Oct 2012) | 1 line
-
-renamed a few variables for consistency, spectrum now working
-------------------------------------------------------------------------
-r801 | drowe67 | 2012-10-23 19:20:06 -0500 (Tue, 23 Oct 2012) | 1 line
-
-fixed axis labels on waterfall and tweaked those on spectrum
-------------------------------------------------------------------------
-r800 | wittend99 | 2012-10-23 17:12:37 -0500 (Tue, 23 Oct 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r799 | wittend99 | 2012-10-23 17:07:13 -0500 (Tue, 23 Oct 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r798 | drowe67 | 2012-10-23 16:03:44 -0500 (Tue, 23 Oct 2012) | 1 line
-
-spectrum plot drawGraticule() working OK with nice labels
-------------------------------------------------------------------------
-r797 | drowe67 | 2012-10-23 05:05:13 -0500 (Tue, 23 Oct 2012) | 1 line
-
-added some code to handle resizing better, and fact OnSize can't be relied upon to be called for bit map allocation
-------------------------------------------------------------------------
-r796 | drowe67 | 2012-10-23 04:37:49 -0500 (Tue, 23 Oct 2012) | 1 line
-
-cleaned up a little, made var names consistent with plot spectrum
-------------------------------------------------------------------------
-r795 | drowe67 | 2012-10-23 04:26:30 -0500 (Tue, 23 Oct 2012) | 1 line
-
-fixed wrong window dimensions, was reading past endof array and writing past end of bit map
-------------------------------------------------------------------------
-r794 | wittend99 | 2012-10-22 10:46:47 -0500 (Mon, 22 Oct 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r793 | wittend99 | 2012-10-22 10:31:13 -0500 (Mon, 22 Oct 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r792 | wittend99 | 2012-10-22 10:21:49 -0500 (Mon, 22 Oct 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r791 | wittend99 | 2012-10-22 10:20:43 -0500 (Mon, 22 Oct 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r790 | wittend99 | 2012-10-22 10:11:26 -0500 (Mon, 22 Oct 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r789 | wittend99 | 2012-10-22 10:10:00 -0500 (Mon, 22 Oct 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r788 | wittend99 | 2012-10-22 10:09:37 -0500 (Mon, 22 Oct 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r787 | drowe67 | 2012-10-21 20:35:43 -0500 (Sun, 21 Oct 2012) | 1 line
-
-spent a few hours trying to debug Stop not erasing bottom 25% of Waterfall, but haven't fixed bug.  Leaving for now
-------------------------------------------------------------------------
-r786 | drowe67 | 2012-10-20 18:59:33 -0500 (Sat, 20 Oct 2012) | 1 line
-
-waterfall working at slow update rate on Linux, some visual bugs on stop & restart
-------------------------------------------------------------------------
-r785 | drowe67 | 2012-10-20 17:58:04 -0500 (Sat, 20 Oct 2012) | 1 line
-
-related timer period to update interval of Waterfall
-------------------------------------------------------------------------
-r784 | drowe67 | 2012-10-20 17:56:42 -0500 (Sat, 20 Oct 2012) | 1 line
-
-removed debug printfs
-------------------------------------------------------------------------
-r783 | drowe67 | 2012-10-20 17:50:34 -0500 (Sat, 20 Oct 2012) | 1 line
-
-free g_RxInBuf on Stop
-------------------------------------------------------------------------
-r782 | drowe67 | 2012-10-19 21:29:23 -0500 (Fri, 19 Oct 2012) | 1 line
-
-bottom line of spectrogram working at 500ms period
-------------------------------------------------------------------------
-r781 | drowe67 | 2012-10-19 18:22:35 -0500 (Fri, 19 Oct 2012) | 1 line
-
-bitmap test pattern working
-------------------------------------------------------------------------
-r780 | drowe67 | 2012-10-19 16:43:56 -0500 (Fri, 19 Oct 2012) | 1 line
-
-libsndfile support
-------------------------------------------------------------------------
-r779 | wittend99 | 2012-10-19 16:28:59 -0500 (Fri, 19 Oct 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r778 | wittend99 | 2012-10-19 07:54:57 -0500 (Fri, 19 Oct 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r777 | drowe67 | 2012-10-18 23:50:43 -0500 (Thu, 18 Oct 2012) | 1 line
-
-initial cjeck in of wxWdigets image test dir
-------------------------------------------------------------------------
-r766 | wittend99 | 2012-10-17 07:53:44 -0500 (Wed, 17 Oct 2012) | 2 lines
-
-minimal changes.
-
-------------------------------------------------------------------------
-r765 | wittend99 | 2012-10-16 12:25:48 -0500 (Tue, 16 Oct 2012) | 1 line
-
-Updating doxygen documentation and removing some unnecessary junk that has accumulated. 
-------------------------------------------------------------------------
-r764 | wittend99 | 2012-10-16 10:32:32 -0500 (Tue, 16 Oct 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r763 | wittend99 | 2012-10-16 10:17:09 -0500 (Tue, 16 Oct 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r762 | wittend99 | 2012-10-16 10:16:45 -0500 (Tue, 16 Oct 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r761 | wittend99 | 2012-10-15 21:01:27 -0500 (Mon, 15 Oct 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r760 | wittend99 | 2012-10-15 20:29:25 -0500 (Mon, 15 Oct 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r759 | wittend99 | 2012-10-15 20:28:47 -0500 (Mon, 15 Oct 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r757 | drowe67 | 2012-10-15 16:19:49 -0500 (Mon, 15 Oct 2012) | 1 line
-
-main demod processing loop runs without crashing
-------------------------------------------------------------------------
-r752 | drowe67 | 2012-10-14 22:59:03 -0500 (Sun, 14 Oct 2012) | 1 line
-
-added a fifo buffer to interface between framesPerBufferof portaudio and the buffer size we need for modem processing. Basic audio loopback working now
-------------------------------------------------------------------------
-r748 | drowe67 | 2012-10-13 16:50:57 -0500 (Sat, 13 Oct 2012) | 1 line
-
-build instructions for Linux
-------------------------------------------------------------------------
-r747 | drowe67 | 2012-10-13 02:25:50 -0500 (Sat, 13 Oct 2012) | 1 line
-
-temp. disabled timer and rx callback to stabilise, can start/stop without crashing now
-------------------------------------------------------------------------
-r746 | drowe67 | 2012-10-13 01:32:03 -0500 (Sat, 13 Oct 2012) | 1 line
-
-re-orged linux Makefile a little
-------------------------------------------------------------------------
-r745 | wittend99 | 2012-10-12 16:49:51 -0500 (Fri, 12 Oct 2012) | 1 line
-
-Convert line endings to UNIX style for readability. 
-------------------------------------------------------------------------
-r744 | drowe67 | 2012-10-11 19:53:06 -0500 (Thu, 11 Oct 2012) | 1 line
-
-changed syntax of extern g_avmag to fix segfault
-------------------------------------------------------------------------
-r743 | drowe67 | 2012-10-11 18:29:14 -0500 (Thu, 11 Oct 2012) | 1 line
-
-added setColour to prevent bombing on Linux
-------------------------------------------------------------------------
-r742 | drowe67 | 2012-10-11 00:16:50 -0500 (Thu, 11 Oct 2012) | 1 line
-
-first pass at Makefile for Linux
-------------------------------------------------------------------------
-r740 | wittend99 | 2012-10-09 22:31:50 -0500 (Tue, 09 Oct 2012) | 1 line
-
-Killer bug.  Data point array not initialized?
-------------------------------------------------------------------------
-r739 | wittend99 | 2012-10-08 08:29:38 -0500 (Mon, 08 Oct 2012) | 1 line
-
-Receive side connected, segfault still to be tracked down. 
-------------------------------------------------------------------------
-r738 | wittend99 | 2012-10-06 14:16:25 -0500 (Sat, 06 Oct 2012) | 1 line
-
-Various incremental advances.  Not 'there' yet.
-------------------------------------------------------------------------
-r731 | wittend99 | 2012-09-19 12:21:32 -0500 (Wed, 19 Sep 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r730 | wittend99 | 2012-09-19 12:11:30 -0500 (Wed, 19 Sep 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r716 | wittend99 | 2012-09-17 13:16:46 -0500 (Mon, 17 Sep 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r712 | wittend99 | 2012-09-14 18:26:51 -0500 (Fri, 14 Sep 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r676 | wittend99 | 2012-09-11 15:10:16 -0500 (Tue, 11 Sep 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r675 | wittend99 | 2012-09-11 14:58:36 -0500 (Tue, 11 Sep 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r674 | wittend99 | 2012-09-11 14:51:11 -0500 (Tue, 11 Sep 2012) | 1 line
-
-no longer needed.
-------------------------------------------------------------------------
-r673 | wittend99 | 2012-09-11 14:49:55 -0500 (Tue, 11 Sep 2012) | 1 line
-
-no longer needed.
-------------------------------------------------------------------------
-r672 | wittend99 | 2012-09-11 14:44:56 -0500 (Tue, 11 Sep 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r671 | wittend99 | 2012-09-11 14:36:45 -0500 (Tue, 11 Sep 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r670 | wittend99 | 2012-09-11 12:13:28 -0500 (Tue, 11 Sep 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r667 | wittend99 | 2012-09-10 11:45:37 -0500 (Mon, 10 Sep 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r666 | wittend99 | 2012-09-10 11:25:14 -0500 (Mon, 10 Sep 2012) | 1 line
-
-Beginning to add some code documentation using Doxygen.
-------------------------------------------------------------------------
-r663 | wittend99 | 2012-09-04 21:54:00 -0500 (Tue, 04 Sep 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r662 | wittend99 | 2012-09-04 21:47:34 -0500 (Tue, 04 Sep 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r660 | wittend99 | 2012-09-04 15:44:29 -0500 (Tue, 04 Sep 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r659 | wittend99 | 2012-09-04 15:43:00 -0500 (Tue, 04 Sep 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r658 | wittend99 | 2012-09-04 15:40:24 -0500 (Tue, 04 Sep 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r647 | wittend99 | 2012-08-28 23:03:56 -0500 (Tue, 28 Aug 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r646 | wittend99 | 2012-08-28 22:54:54 -0500 (Tue, 28 Aug 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r645 | wittend99 | 2012-08-28 22:50:53 -0500 (Tue, 28 Aug 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r643 | wittend99 | 2012-08-27 12:01:45 -0500 (Mon, 27 Aug 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r639 | wittend99 | 2012-08-24 14:01:17 -0500 (Fri, 24 Aug 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r638 | wittend99 | 2012-08-24 14:00:49 -0500 (Fri, 24 Aug 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r637 | wittend99 | 2012-08-24 13:56:48 -0500 (Fri, 24 Aug 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r636 | wittend99 | 2012-08-22 12:33:04 -0500 (Wed, 22 Aug 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r634 | wittend99 | 2012-08-21 16:29:09 -0500 (Tue, 21 Aug 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r633 | wittend99 | 2012-08-21 13:26:23 -0500 (Tue, 21 Aug 2012) | 1 line
-
-Working to get an Autotools build in place.
-------------------------------------------------------------------------
-r632 | wittend99 | 2012-08-20 15:09:21 -0500 (Mon, 20 Aug 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r631 | wittend99 | 2012-08-20 14:54:14 -0500 (Mon, 20 Aug 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r630 | wittend99 | 2012-08-20 14:53:49 -0500 (Mon, 20 Aug 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r629 | wittend99 | 2012-08-20 14:52:31 -0500 (Mon, 20 Aug 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r628 | wittend99 | 2012-08-20 14:43:10 -0500 (Mon, 20 Aug 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r627 | wittend99 | 2012-08-17 15:57:31 -0500 (Fri, 17 Aug 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r626 | wittend99 | 2012-08-17 15:50:27 -0500 (Fri, 17 Aug 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r625 | wittend99 | 2012-08-17 15:50:00 -0500 (Fri, 17 Aug 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r624 | wittend99 | 2012-08-17 15:48:58 -0500 (Fri, 17 Aug 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r623 | wittend99 | 2012-08-17 15:43:19 -0500 (Fri, 17 Aug 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r622 | wittend99 | 2012-08-17 15:42:13 -0500 (Fri, 17 Aug 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r621 | wittend99 | 2012-08-17 15:20:38 -0500 (Fri, 17 Aug 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r620 | wittend99 | 2012-08-17 15:18:55 -0500 (Fri, 17 Aug 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r619 | wittend99 | 2012-08-17 15:18:39 -0500 (Fri, 17 Aug 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r618 | wittend99 | 2012-08-17 15:18:24 -0500 (Fri, 17 Aug 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r617 | wittend99 | 2012-08-17 15:10:20 -0500 (Fri, 17 Aug 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r616 | wittend99 | 2012-08-17 15:07:18 -0500 (Fri, 17 Aug 2012) | 1 line
-
-For variant versions
-------------------------------------------------------------------------
-r615 | wittend99 | 2012-08-17 15:05:10 -0500 (Fri, 17 Aug 2012) | 1 line
-
-Moved to ./3rdparty
-------------------------------------------------------------------------
-r614 | wittend99 | 2012-08-17 15:03:59 -0500 (Fri, 17 Aug 2012) | 1 line
-
-Moved to ./3rdparty
-------------------------------------------------------------------------
-r613 | wittend99 | 2012-08-17 15:02:47 -0500 (Fri, 17 Aug 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r612 | wittend99 | 2012-08-14 21:31:28 -0500 (Tue, 14 Aug 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r589 | wittend99 | 2012-07-15 15:45:52 -0500 (Sun, 15 Jul 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r588 | wittend99 | 2012-07-15 15:44:30 -0500 (Sun, 15 Jul 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r571 | wittend99 | 2012-06-18 10:10:40 -0500 (Mon, 18 Jun 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r570 | wittend99 | 2012-06-18 10:07:01 -0500 (Mon, 18 Jun 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r569 | wittend99 | 2012-06-18 10:06:26 -0500 (Mon, 18 Jun 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r568 | wittend99 | 2012-06-18 10:04:56 -0500 (Mon, 18 Jun 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r567 | wittend99 | 2012-06-18 10:04:10 -0500 (Mon, 18 Jun 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r566 | wittend99 | 2012-06-18 09:16:14 -0500 (Mon, 18 Jun 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r565 | wittend99 | 2012-06-18 09:13:02 -0500 (Mon, 18 Jun 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r564 | wittend99 | 2012-06-18 09:10:53 -0500 (Mon, 18 Jun 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r563 | wittend99 | 2012-06-18 09:08:49 -0500 (Mon, 18 Jun 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r562 | wittend99 | 2012-06-18 08:54:08 -0500 (Mon, 18 Jun 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r561 | wittend99 | 2012-06-18 08:52:45 -0500 (Mon, 18 Jun 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r560 | wittend99 | 2012-06-18 08:52:08 -0500 (Mon, 18 Jun 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r559 | wittend99 | 2012-06-18 08:51:00 -0500 (Mon, 18 Jun 2012) | 1 line
-
-Update svn:ignore
-------------------------------------------------------------------------
-r558 | wittend99 | 2012-06-18 08:45:24 -0500 (Mon, 18 Jun 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r557 | wittend99 | 2012-06-18 08:44:06 -0500 (Mon, 18 Jun 2012) | 1 line
-
-Some cleanup
-------------------------------------------------------------------------
-r556 | wittend99 | 2012-06-17 10:05:25 -0500 (Sun, 17 Jun 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r555 | wittend99 | 2012-06-17 10:03:12 -0500 (Sun, 17 Jun 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r554 | wittend99 | 2012-06-17 10:02:44 -0500 (Sun, 17 Jun 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r553 | wittend99 | 2012-06-17 10:00:29 -0500 (Sun, 17 Jun 2012) | 1 line
-
-Bunches of work on portaudio, still not done. Added fdmdvBasic tor testing, it is the same as the main app without the graphic spectrum display.  It may not be useful for without the waterfall display for tuning. 
-------------------------------------------------------------------------
-r551 | wittend99 | 2012-06-15 09:26:24 -0500 (Fri, 15 Jun 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r550 | wittend99 | 2012-06-15 09:25:06 -0500 (Fri, 15 Jun 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r549 | wittend99 | 2012-06-15 09:20:30 -0500 (Fri, 15 Jun 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r548 | wittend99 | 2012-06-15 09:19:41 -0500 (Fri, 15 Jun 2012) | 1 line
-
-experiments
-------------------------------------------------------------------------
-r547 | wittend99 | 2012-06-15 09:18:07 -0500 (Fri, 15 Jun 2012) | 1 line
-
-update build from codec2-dev 545
-------------------------------------------------------------------------
-r546 | wittend99 | 2012-06-12 07:30:44 -0500 (Tue, 12 Jun 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r521 | wittend99 | 2012-05-30 21:53:15 -0500 (Wed, 30 May 2012) | 1 line
-
-Still working on the audio dialog, mostly.
-------------------------------------------------------------------------
-r520 | wittend99 | 2012-05-29 22:43:11 -0500 (Tue, 29 May 2012) | 1 line
-
-Work on portaudio dialog, misc. cleanup.
-------------------------------------------------------------------------
-r518 | wittend99 | 2012-05-29 18:27:43 -0500 (Tue, 29 May 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r517 | wittend99 | 2012-05-29 18:26:27 -0500 (Tue, 29 May 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r516 | wittend99 | 2012-05-29 18:07:56 -0500 (Tue, 29 May 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r515 | wittend99 | 2012-05-29 17:53:59 -0500 (Tue, 29 May 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r514 | wittend99 | 2012-05-29 17:53:42 -0500 (Tue, 29 May 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r513 | wittend99 | 2012-05-29 17:53:00 -0500 (Tue, 29 May 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r512 | wittend99 | 2012-05-29 17:50:22 -0500 (Tue, 29 May 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r511 | wittend99 | 2012-05-29 17:49:51 -0500 (Tue, 29 May 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r510 | wittend99 | 2012-05-29 17:49:13 -0500 (Tue, 29 May 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r509 | wittend99 | 2012-05-29 17:48:28 -0500 (Tue, 29 May 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r508 | wittend99 | 2012-05-29 17:47:54 -0500 (Tue, 29 May 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r507 | wittend99 | 2012-05-29 17:35:24 -0500 (Tue, 29 May 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r505 | wittend99 | 2012-05-27 12:34:55 -0500 (Sun, 27 May 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r504 | wittend99 | 2012-05-27 10:44:30 -0500 (Sun, 27 May 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r503 | wittend99 | 2012-05-27 10:41:44 -0500 (Sun, 27 May 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r502 | wittend99 | 2012-05-26 22:10:12 -0500 (Sat, 26 May 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r501 | wittend99 | 2012-05-26 21:53:08 -0500 (Sat, 26 May 2012) | 1 line
-
-fdmdv2dll builds, as yet untested though.
-------------------------------------------------------------------------
-r500 | wittend99 | 2012-05-26 09:05:50 -0500 (Sat, 26 May 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r499 | wittend99 | 2012-05-26 08:31:29 -0500 (Sat, 26 May 2012) | 1 line
-
-changed this to fdmdv2dll
-------------------------------------------------------------------------
-r498 | wittend99 | 2012-05-26 08:30:03 -0500 (Sat, 26 May 2012) | 1 line
-
-Attempting to clean up the project.
-------------------------------------------------------------------------
-r497 | wittend99 | 2012-05-26 08:26:01 -0500 (Sat, 26 May 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r495 | wittend99 | 2012-05-26 07:59:29 -0500 (Sat, 26 May 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r494 | wittend99 | 2012-05-26 07:17:59 -0500 (Sat, 26 May 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r493 | wittend99 | 2012-05-26 07:17:28 -0500 (Sat, 26 May 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r491 | wittend99 | 2012-05-24 18:46:43 -0500 (Thu, 24 May 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r486 | wittend99 | 2012-05-21 21:23:11 -0500 (Mon, 21 May 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r485 | wittend99 | 2012-05-19 20:58:55 -0500 (Sat, 19 May 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r480 | wittend99 | 2012-05-17 21:16:32 -0500 (Thu, 17 May 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r479 | wittend99 | 2012-05-17 21:10:59 -0500 (Thu, 17 May 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r478 | wittend99 | 2012-05-17 21:09:48 -0500 (Thu, 17 May 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r477 | wittend99 | 2012-05-17 21:08:19 -0500 (Thu, 17 May 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r476 | wittend99 | 2012-05-17 21:07:58 -0500 (Thu, 17 May 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r475 | wittend99 | 2012-05-17 21:06:15 -0500 (Thu, 17 May 2012) | 1 line
-
-Catching up before things get into a snarl.
-------------------------------------------------------------------------
-r474 | wittend99 | 2012-05-17 13:06:55 -0500 (Thu, 17 May 2012) | 1 line
-
-More basic required library files.
-------------------------------------------------------------------------
-r473 | wittend99 | 2012-05-17 12:54:14 -0500 (Thu, 17 May 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r472 | wittend99 | 2012-05-17 10:08:08 -0500 (Thu, 17 May 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r471 | wittend99 | 2012-05-17 10:03:24 -0500 (Thu, 17 May 2012) | 1 line
-
-More work with portaudiocpp
-------------------------------------------------------------------------
-r470 | wittend99 | 2012-05-15 21:31:30 -0500 (Tue, 15 May 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r469 | wittend99 | 2012-05-15 14:11:26 -0500 (Tue, 15 May 2012) | 1 line
-
-synching things up...
-------------------------------------------------------------------------
-r468 | wittend99 | 2012-05-15 14:07:29 -0500 (Tue, 15 May 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r467 | wittend99 | 2012-05-15 08:47:57 -0500 (Tue, 15 May 2012) | 1 line
-
-Fun with portaudio!
-------------------------------------------------------------------------
-r466 | wittend99 | 2012-05-15 08:44:43 -0500 (Tue, 15 May 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r465 | wittend99 | 2012-05-15 08:44:23 -0500 (Tue, 15 May 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r464 | wittend99 | 2012-05-15 08:44:02 -0500 (Tue, 15 May 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r463 | wittend99 | 2012-05-15 08:42:49 -0500 (Tue, 15 May 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r462 | wittend99 | 2012-05-14 20:25:56 -0500 (Mon, 14 May 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r460 | wittend99 | 2012-05-13 20:04:35 -0500 (Sun, 13 May 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r459 | wittend99 | 2012-05-13 19:55:29 -0500 (Sun, 13 May 2012) | 1 line
-
-built libs and headers for linking
-------------------------------------------------------------------------
-r458 | wittend99 | 2012-05-13 19:51:07 -0500 (Sun, 13 May 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r456 | wittend99 | 2012-05-13 19:25:07 -0500 (Sun, 13 May 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r455 | wittend99 | 2012-05-13 19:13:32 -0500 (Sun, 13 May 2012) | 1 line
-
-Notes about building portaudio for fdmdv2.
-------------------------------------------------------------------------
-r453 | wittend99 | 2012-05-13 16:19:57 -0500 (Sun, 13 May 2012) | 1 line
-
-portaudio portable audio framework
-------------------------------------------------------------------------
-r452 | wittend99 | 2012-05-13 16:10:42 -0500 (Sun, 13 May 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r451 | wittend99 | 2012-05-13 15:49:44 -0500 (Sun, 13 May 2012) | 1 line
-
-remove incorrect paths
-------------------------------------------------------------------------
-r450 | wittend99 | 2012-05-13 15:49:03 -0500 (Sun, 13 May 2012) | 1 line
-
-Workspace for the Codelite IDE
-------------------------------------------------------------------------
-r449 | wittend99 | 2012-05-13 15:48:16 -0500 (Sun, 13 May 2012) | 1 line
-
-fixup some paths
-------------------------------------------------------------------------
-r448 | wittend99 | 2012-05-13 15:44:49 -0500 (Sun, 13 May 2012) | 1 line
-
-project file for Codelite
-------------------------------------------------------------------------
-r447 | wittend99 | 2012-05-13 14:43:58 -0500 (Sun, 13 May 2012) | 1 line
-
-Potentially for use for rig control
-------------------------------------------------------------------------
-r446 | wittend99 | 2012-05-13 14:32:29 -0500 (Sun, 13 May 2012) | 1 line
-
-Possible rs-232 Comm library for use if needed. Born of frustration with existing options. After all these years isn't there a decent, usable, documented cross-platform library somewhere?
-------------------------------------------------------------------------
-r445 | wittend99 | 2012-05-13 14:20:14 -0500 (Sun, 13 May 2012) | 1 line
-
-A copy of libsndfile.dll built for Win32 using MinGW + MSYS on Win7 
-------------------------------------------------------------------------
-r444 | wittend99 | 2012-05-13 14:17:16 -0500 (Sun, 13 May 2012) | 1 line
-
-Just running notes about where ideas and code have come from.
-------------------------------------------------------------------------
-r443 | wittend99 | 2012-05-13 14:10:56 -0500 (Sun, 13 May 2012) | 1 line
-
-Class declarations for the spectrum and waterfall classes.
-------------------------------------------------------------------------
-r442 | wittend99 | 2012-05-13 14:08:16 -0500 (Sun, 13 May 2012) | 1 line
-
-Intended to be a superclass to the waterfall and spectrum plot classes.  Currently the UI just instantiates one directly derived for each window in the wxNotebook display.
-------------------------------------------------------------------------
-r441 | wittend99 | 2012-05-13 14:03:07 -0500 (Sun, 13 May 2012) | 1 line
-
-
-------------------------------------------------------------------------
-r440 | wittend99 | 2012-05-13 11:30:57 -0500 (Sun, 13 May 2012) | 1 line
-
-UI Project 'main' header
-------------------------------------------------------------------------
-r439 | wittend99 | 2012-05-13 11:30:12 -0500 (Sun, 13 May 2012) | 1 line
-
-UI project 'main' module
-------------------------------------------------------------------------
-r438 | wittend99 | 2012-05-13 11:28:34 -0500 (Sun, 13 May 2012) | 1 line
-
-Workspace for CodeLite
-------------------------------------------------------------------------
-r437 | wittend99 | 2012-05-13 11:03:53 -0500 (Sun, 13 May 2012) | 1 line
-
-An XRC definition of the UI window classes.  Can be used by wxWidgets, but is just for reference in this project.
-------------------------------------------------------------------------
-r436 | wittend99 | 2012-05-13 11:01:37 -0500 (Sun, 13 May 2012) | 1 line
-
-wxFormbuilder generated Python version of the UI classes, included just for grins (for now)
-------------------------------------------------------------------------
-r435 | wittend99 | 2012-05-13 10:59:09 -0500 (Sun, 13 May 2012) | 1 line
-
-wxFormbuilder generated UI class declarations. (topframe.* are all generated classes. Don' Edit!)
-------------------------------------------------------------------------
-r434 | wittend99 | 2012-05-13 10:56:34 -0500 (Sun, 13 May 2012) | 1 line
-
-Defines the top level frame window for the UI as well as the dialogs.  the MainFrame classs and all of the dialog classes inherit from this.
-------------------------------------------------------------------------
-r433 | wittend99 | 2012-05-13 10:53:43 -0500 (Sun, 13 May 2012) | 1 line
-
-wxFormbuilder Project File used to create the top-level UI and the dialogs.  Probably requires wxFormbuilder v. 3.3.2-beta or above. This generates topframe.h, topframe.cpp, (and topframe.py, topframe.xrc for experimentation).  Use this with care.
-------------------------------------------------------------------------
-r432 | wittend99 | 2012-05-13 10:45:54 -0500 (Sun, 13 May 2012) | 1 line
-
-Sound file Read/Write library
-------------------------------------------------------------------------
-r431 | wittend99 | 2012-05-13 10:39:42 -0500 (Sun, 13 May 2012) | 1 line
-
-sample rate conversion library aka "Secret Rabbit Code"
-------------------------------------------------------------------------
-r430 | wittend99 | 2012-05-13 10:31:45 -0500 (Sun, 13 May 2012) | 1 line
-
-General Program Options Dialog Header
-------------------------------------------------------------------------
-r429 | wittend99 | 2012-05-13 10:30:39 -0500 (Sun, 13 May 2012) | 1 line
-
-General Program Options Dialog
-------------------------------------------------------------------------
-r428 | wittend99 | 2012-05-13 10:29:55 -0500 (Sun, 13 May 2012) | 1 line
-
-Comm Ports Dialog Header
-------------------------------------------------------------------------
-r427 | wittend99 | 2012-05-13 10:29:07 -0500 (Sun, 13 May 2012) | 1 line
-
-Comm Ports Dialog
-------------------------------------------------------------------------
-r426 | wittend99 | 2012-05-13 10:27:58 -0500 (Sun, 13 May 2012) | 1 line
-
-Audio Dialog Header
-------------------------------------------------------------------------
-r425 | wittend99 | 2012-05-13 10:27:22 -0500 (Sun, 13 May 2012) | 1 line
-
-Audio Dialog
-------------------------------------------------------------------------
-r424 | wittend99 | 2012-05-13 10:26:11 -0500 (Sun, 13 May 2012) | 1 line
-
-help>About Header
-------------------------------------------------------------------------
-r423 | wittend99 | 2012-05-13 10:25:24 -0500 (Sun, 13 May 2012) | 1 line
-
-help>About Dialog.
-------------------------------------------------------------------------
-r422 | wittend99 | 2012-05-13 10:23:55 -0500 (Sun, 13 May 2012) | 1 line
-
-wxWidgets DLL file used for Win32 build.
-------------------------------------------------------------------------
-r421 | wittend99 | 2012-05-13 10:08:46 -0500 (Sun, 13 May 2012) | 1 line
-
-A folder for fdmdv-2 UI work.
-------------------------------------------------------------------------
diff --git a/fdmdv2/branches/0.97/DEBIAN_DEVEL.sh b/fdmdv2/branches/0.97/DEBIAN_DEVEL.sh
deleted file mode 100644 (file)
index 71cf970..0000000
+++ /dev/null
@@ -1 +0,0 @@
-apt-get install cmake gcc g++ libportaudio-dev libhamlib-dev libsamplerate-dev libsndfile-dev libsox-dev libgtk-3-dev libasound-dev
diff --git a/fdmdv2/branches/0.97/DEBIAN_RUNTIME.sh b/fdmdv2/branches/0.97/DEBIAN_RUNTIME.sh
deleted file mode 100644 (file)
index 239945f..0000000
+++ /dev/null
@@ -1 +0,0 @@
-apt-get install libportaudio2 libhamlib2 libsamplerate0 libsndfile1 libsox2 libgtk-3-0 libasound2
diff --git a/fdmdv2/branches/0.97/Desktop.ini b/fdmdv2/branches/0.97/Desktop.ini
deleted file mode 100644 (file)
index ae60713..0000000
Binary files a/fdmdv2/branches/0.97/Desktop.ini and /dev/null differ
diff --git a/fdmdv2/branches/0.97/INSTALL b/fdmdv2/branches/0.97/INSTALL
deleted file mode 100644 (file)
index 2d82cd6..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-The CMake configuration for FDMDV2 (FreeDV) is the primary build method at
-this time and has been thouroughly tested on Fedora Linux and will likely work
-well on most *nix systems and has many advanages over the autotools config.
-
-It should also work on Windows environments but only the mingw-w64 is tested
-to work using the MSYS2 environment. Others may work but you're on your own.
-
-- Builds against system libraries (by default).
-- Or optionally download, build, and statically link with required libraries on
-  an individual basis. See USE_STATIC_??? options. 
-  NOTE: We need test reports on mingw/Windows, not all dependencies will build.
-- Has experimental NSIS packaing support for Windows (WIN32) targets. *nix
-  systems should rely on 'make install' or tradional packaing methods as the
-  packages (RPM & DEB) created by CPack are questionable.
-
-==================================
- Building and installing on Linux
-==================================
-
-To perform a cmake build create a directory anywhere underneath (or outside of)
-the source directory.
-
-Linux command line example:
-
-$ cd /path/to/fdmdv2
-$ mkdir build_linux
-$ cd build_linux
-$ cmake ../ (defaults to /usr/local, use CMAKE_INSTALL_PREFIX to override)
-(if no errors)
-$ make
-(as root)
-$ make install
-
-====================================
- Building and installing on Windows
-====================================
-
-The windows build is similar to linux and follows the same basic workflow.
-
-Only MinGW is supported. While it is likely possible to perform a pure MinGW
-build, installing MSYS will make your life easier.
-
-CMake may not automatically detect that you're in the MSYS environment. If this
-occurs you need to pass cmake the proper generator:
-
-cmake -G"MSYS Makefiles" [other options] </path/to/source>
-
-===============================
- Bootstrapping wxWidgets build
-===============================
-
-If wxWidgets (>= 3.0) is not available then one option is to have CMake boot-
-strap the build for FreeDV.
-
-This is required because the tool wx-config is used to get the correct compiler
-and linker flags of the wxWidgets components needed by FreeDV. Since this is
-normally done at configure time, not during "make", it is not possible for CMake
-to have this information prior to building wxWidgets.
-
-In order to work around this issue you can "bootstrap" the wxWidgets build using
-the CMake option, "BOOTSTRAP_WXWIDGETS". wxWidgets will be built using static 
-libraries.
-
-NOTE: This forces "USE_STATIC_WXWIDGETS" to be true internally regarless of the
-value set manually.
-
-(from any prefered directory outside of the source)
-$ cmake -DBOOTSTRAP_WXWIDGETS=TRUE <path to fdmdv2 source>
-$ make
-(wxWidgets is downloaded and built)
-$ cmake .
-$ make
-(if all goes well, as root)
-$ make install
diff --git a/fdmdv2/branches/0.97/NEWS b/fdmdv2/branches/0.97/NEWS
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/fdmdv2/branches/0.97/README b/fdmdv2/branches/0.97/README
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/fdmdv2/branches/0.97/README.txt b/fdmdv2/branches/0.97/README.txt
deleted file mode 100644 (file)
index f54ff34..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-==================================
- Building and installing on Linux
-==================================
-
-Quickstart 1
------------
-
-Builds static versions of wxWidgets, portaudio, codec2-dev, which are commonly
-missing on many Linux systems, or of the wrong (older) version.
-
-Assuming the freedv-dev sources is checked out into ~/fdmdv2-dev:
-
-$ cd fdmdv2-dev
-$ mkdir build_linux
-$ cd build_linux
-$ cmake -DBOOTSTRAP_WXWIDGETS=TRUE ~/fdmdv2-dev
-$ make
-[wxWidgets builds]
-
-Then you can use your local codec-dev, something like:
-
-$ cmake cmake -DBOOTSTRAP_WXWIDGETS=TRUE -DCODEC2_INCLUDE_DIR=/home/david/codec2-dev/src -DCODEC2_LIBRARY=/home/david/codec2-dev/build_linux/src/libcodec2.so -DUSE_STATIC_CODEC2=FALSE -DUSE_STATIC_PORTAUDIO=TRUE -DUSE_STATIC_SOX=TRUE ../
-
-OR build a local copy of codec2-dev:
-
-$ cmake cmake -DBOOTSTRAP_WXWIDGETS=TRUE -DUSE_STATIC_CODEC2=TRUE -DUSE_STATIC_PORTAUDIO=TRUE -DUSE_STATIC_SOX=TRUE ../
-
-$ make
-[FreeDV builds]
-$ ./src/freedv
-
-Note: add "-DCMAKE_BUILD_TYPE=Debug" the list above for debug (gcc -g) buildthat include source line numbers.
-
-Quickstart 2
-------------
-
-Assuming you have all the dependant libraries:
-
-$ cd /path/to/fdmdv2
-$ mkdir build_linux
-$ cd build_linux
-$ cmake ../ (defaults to /usr/local, use CMAKE_INSTALL_PREFIX to override)
-(if no errors)
-$ make
-(as root)
-$ make install
-
-====================================
- Building and installing on Windows
-====================================
-
-The windows build is similar to linux and follows the same basic workflow.
-
-Only MinGW is supported. While it is likely possible to perform a pure MinGW
-build, installing MSYS will make your life easier.
-
-CMake may not automatically detect that you're in the MSYS environment. If this
-occurs you need to pass cmake the proper generator:
-
-cmake -G"MSYS Makefiles" [other options] </path/to/source>
-
-===============================
- Bootstrapping wxWidgets build
-===============================
-
-If wxWidgets (>= 3.0) is not available then one option is to have CMake boot-
-strap the build for FreeDV.
-
-This is required because the tool wx-config is used to get the correct compiler
-and linker flags of the wxWidgets components needed by FreeDV. Since this is
-normally done at configure time, not during "make", it is not possible for CMake
-or have this information prior to building wxWidgets.
-
-In order to work around this issue you can "bootstrap" the wxWidgets build using
-the CMake option, "BOOTSTRAP_WXWIDGETS". wxWidgets will be built using static
-libraries.
-
-NOTE: This forces "USE_STATIC_WXWIDGETS" to be true internally regarless of the
-value set manually.
-
-(from any prefered, but empty directory outside of the source)
-$ cmake -DBOOTSTRAP_WXWIDGETS=TRUE /path/to/fdmdv2
-$ make
-(wxWidgets is downloaded and built)
-$ cmake .
-$ make
-(if all goes well, as root)
-$ make install
-
-====================================
- Building and installing on OSX
-====================================
-
-====================================
- Building and installing on FreeBSD
-====================================
-
-As per "Quickstart 2" above but change build_linux to build_freebsd
-
-=======
-Editing
-=======
-
-Please make sure your text editor does not insert tabs, and
-used indents of 4 spaces.  The following .emacs code was used to
-configure emacs:
-
-(setq-default indent-tabs-mode nil)
-
-(add-hook 'c-mode-common-hook
-          (function (lambda ()
-                      (setq c-basic-offset 4)
-                      )))
-
diff --git a/fdmdv2/branches/0.97/build/codelite/.clang/.gitignore b/fdmdv2/branches/0.97/build/codelite/.clang/.gitignore
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/fdmdv2/branches/0.97/build/codelite/dbfiles/fdmdv2config.sqlite.sql b/fdmdv2/branches/0.97/build/codelite/dbfiles/fdmdv2config.sqlite.sql
deleted file mode 100644 (file)
index fd66b5c..0000000
+++ /dev/null
@@ -1 +0,0 @@
-CREATE TABLE "configuration" ("prikey" DATETIME PRIMARY KEY  NOT NULL  UNIQUE  DEFAULT CURRENT_TIMESTAMP, "datecreate" DATETIME DEFAULT CURRENT_DATE, "timecreate" DATETIME DEFAULT CURRENT_TIME, "rx_driver_in_idx" INTEGER check(typeof("rx_driver_in_idx") = 'integer') , "rx_driver_in_string" TEXT check(typeof("rx_driver_in_string") = 'text') , "rx_driver_out_idx" INTEGER check(typeof("rx_driver_out_idx") = 'integer') , "rx_driver_out_str" TEXT check(typeof("rx_driver_out_str") = 'text') , "tx_driver_in_idx" INTEGER check(typeof("tx_driver_in_idx") = 'integer') , "tx_driver_in_str" TEXT check(typeof("tx_driver_in_str") = 'text') , "tx_driver_out_idx" INTEGER check(typeof("tx_driver_out_idx") = 'integer') , "tx_driver_out_str" TEXT check(typeof("tx_driver_out_str") = 'text') );
diff --git a/fdmdv2/branches/0.97/build/codelite/dbfiles/fdmdv2config.sqlite.sqlite b/fdmdv2/branches/0.97/build/codelite/dbfiles/fdmdv2config.sqlite.sqlite
deleted file mode 100644 (file)
index eace5f3..0000000
Binary files a/fdmdv2/branches/0.97/build/codelite/dbfiles/fdmdv2config.sqlite.sqlite and /dev/null differ
diff --git a/fdmdv2/branches/0.97/build/codelite/dialogtest/MainDialog.cpp b/fdmdv2/branches/0.97/build/codelite/dialogtest/MainDialog.cpp
deleted file mode 100644 (file)
index ce5168e..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-#include "MainDialog.h"
-
-PTTDialog::PTTDialog(wxWindow* parent): PTTDialogBaseClass(parent)
-{
-}
-
-PTTDialog::~PTTDialog()
-{
-}
-
-void PTTDialog::DTRVPlusClicked(wxCommandEvent& event)
-{
-    wxMessageBox(wxT("DTRVPlusClicked"));
-}
-
-void PTTDialog::PTTAudioClick(wxCommandEvent& event)
-{
-    wxMessageBox(wxT("PTTAudioClick"));
-}
-
-void PTTDialog::PTTPortSlelcted(wxCommandEvent& event)
-{
-    wxMessageBox(wxT("PTTPortSlelcted"));
-}
-
-void PTTDialog::PTTUseSerialClicked(wxCommandEvent& event)
-{
-    wxMessageBox(wxT("PTTUseSerialClicked"));
-}
-
-void PTTDialog::RTSVPlusClicked(wxCommandEvent& event)
-{
-    wxMessageBox(wxT("RTSVPlusClicked"));
-}
-
-void PTTDialog::UseDTRCliched(wxCommandEvent& event)
-{
-    wxMessageBox(wxT("UseDTRCliched"));
-}
-
-void PTTDialog::UseRTSClicked(wxCommandEvent& event)
-{
-    wxMessageBox(wxT("UseRTSClicked"));
-}
-
-void PTTDialog::OnApply(wxCommandEvent& event)
-{
-    wxMessageBox(wxT("OnApply"));
-}
-
-void PTTDialog::OnCancel(wxCommandEvent& event)
-{
-    wxMessageBox(wxT("OnCancel"));
-}
-
-void PTTDialog::OnOK(wxCommandEvent& event)
-{
-    wxMessageBox(wxT("OnOK"));
-}
-void PTTDialog::OnInitDialog(wxInitDialogEvent& event)
-{
-}
diff --git a/fdmdv2/branches/0.97/build/codelite/dialogtest/MainDialog.h b/fdmdv2/branches/0.97/build/codelite/dialogtest/MainDialog.h
deleted file mode 100644 (file)
index 2553079..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifndef PTTDialog_H
-#define PTTDialog_H
-#include <wx/wx.h>
-#include "wxcrafter.h"
-
-class PTTDialog : public PTTDialogBaseClass
-{
-public:
-    PTTDialog(wxWindow* parent);
-    virtual ~PTTDialog();
-protected:
-    virtual void OnInitDialog(wxInitDialogEvent& event);
-    wxCheckBox* m_ckPTTRtChan;
-    wxListBox* m_listCtrlPorts;
-    wxCheckBox* m_ckUseSerialPTT;
-    wxRadioButton* m_rbUseDTR;
-    wxCheckBox* m_ckRTSPos;
-    wxRadioButton* m_rbUseRTS;
-    wxCheckBox* m_ckDTRPos;
-    wxButton* m_buttonOK;
-    wxButton* m_buttonCancel;
-    wxButton* m_buttonApply;
-
-    void PTTAudioClick(wxCommandEvent& event);
-    void PTTPortSlelcted(wxCommandEvent& event);
-    void PTTUseSerialClicked(wxCommandEvent& event);
-    void UseDTRCliched(wxCommandEvent& event);
-    void DTRVPlusClicked(wxCommandEvent& event);
-    void UseRTSClicked(wxCommandEvent& event);
-    void RTSVPlusClicked(wxCommandEvent& event);
-
-    virtual void OnApply(wxCommandEvent& event);
-    virtual void OnCancel(wxCommandEvent& event);
-    virtual void OnOK(wxCommandEvent& event);
-
-    void ExchangeData(int inout);
-    void populatePortList(void);
-};
-#endif // PTTDialog_H
diff --git a/fdmdv2/branches/0.97/build/codelite/dialogtest/dialogTest.mk b/fdmdv2/branches/0.97/build/codelite/dialogtest/dialogTest.mk
deleted file mode 100644 (file)
index 6d76a82..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-##\r
-## Auto Generated makefile by CodeLite IDE\r
-## any manual changes will be erased      \r
-##\r
-## Release\r
-ProjectName            :=dialogTest\r
-ConfigurationName      :=Release\r
-WorkspacePath          := "D:\Projects\Radio\fdmdv2\build"\r
-ProjectPath            := "D:\Projects\Radio\fdmdv2\build"\r
-IntermediateDirectory  :=./Release\r
-OutDir                 := $(IntermediateDirectory)\r
-CurrentFileName        :=\r
-CurrentFilePath        :=\r
-CurrentFileFullPath    :=\r
-User                   :=wittend\r
-Date                   :=12/10/2012\r
-CodeLitePath           :="D:\bin\CodeLite"\r
-LinkerName             :=g++\r
-SharedObjectLinkerName :=g++ -shared -fPIC\r
-ObjectSuffix           :=.o\r
-DependSuffix           :=.o.d\r
-PreprocessSuffix       :=.o.i\r
-DebugSwitch            :=-gstab\r
-IncludeSwitch          :=-I\r
-LibrarySwitch          :=-l\r
-OutputSwitch           :=-o \r
-LibraryPathSwitch      :=-L\r
-PreprocessorSwitch     :=-D\r
-SourceSwitch           :=-c \r
-OutputFile             :=$(IntermediateDirectory)/$(ProjectName)\r
-Preprocessors          :=\r
-ObjectSwitch           :=-o \r
-ArchiveOutputSwitch    := \r
-PreprocessOnlySwitch   :=-E \r
-ObjectsFileList        :="D:\Projects\Radio\fdmdv2\build\dialogTest.txt"\r
-PCHCompileFlags        :=\r
-MakeDirCommand         :=makedir\r
-RcCmpOptions           := $(shell wx-config --rcflags)\r
-RcCompilerName         :=windres\r
-LinkOptions            :=  $(shell wx-config --libs) -mwindows\r
-IncludePath            :=  $(IncludeSwitch). $(IncludeSwitch). \r
-IncludePCH             := \r
-RcIncludePath          := \r
-Libs                   := \r
-ArLibs                 :=  \r
-LibPath                := $(LibraryPathSwitch). \r
-\r
-##\r
-## Common variables\r
-## AR, CXX, CC, CXXFLAGS and CFLAGS can be overriden using an environment variables\r
-##\r
-AR       := ar rcus\r
-CXX      := g++\r
-CC       := gcc\r
-CXXFLAGS :=  -O2 -Wall $(shell wx-config --cflags)  -DSVN_REVISION=\"1128\"  $(Preprocessors)\r
-CFLAGS   :=  -O2 -Wall  -DSVN_REVISION=\"1128\"  $(Preprocessors)\r
-\r
-\r
-##\r
-## User defined environment variables\r
-##\r
-CodeLiteDir:=D:\bin\CodeLite\r
-WXWIN:=D:\bin\wxWidgets-2.9.4\r
-PATH:=$(WXWIN)\lib\gcc_dll;$(PATH)\r
-WXCFG:=gcc_dll\mswu\r
-UNIT_TEST_PP_SRC_DIR:=D:\bin\UnitTest++-1.3\r
-Objects=$(IntermediateDirectory)/main$(ObjectSuffix) $(IntermediateDirectory)/wxcrafter$(ObjectSuffix) $(IntermediateDirectory)/wxcrafter_bitmaps$(ObjectSuffix) $(IntermediateDirectory)/MainDialog$(ObjectSuffix) $(IntermediateDirectory)/win_resources.rc$(ObjectSuffix) \r
-\r
-##\r
-## Main Build Targets \r
-##\r
-.PHONY: all clean PreBuild PrePreBuild PostBuild\r
-all: $(OutputFile)\r
-\r
-$(OutputFile): $(IntermediateDirectory)/.d $(Objects) \r
-       @$(MakeDirCommand) $(@D)\r
-       @echo "" > $(IntermediateDirectory)/.d\r
-       @echo $(Objects) > $(ObjectsFileList)\r
-       $(LinkerName) $(OutputSwitch)$(OutputFile) @$(ObjectsFileList) $(LibPath) $(Libs) $(LinkOptions)\r
-\r
-$(IntermediateDirectory)/.d:\r
-       @$(MakeDirCommand) "./Release"\r
-\r
-PreBuild:\r
-\r
-\r
-##\r
-## Objects\r
-##\r
-$(IntermediateDirectory)/main$(ObjectSuffix): main.cpp $(IntermediateDirectory)/main$(DependSuffix)\r
-       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/build/main.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/main$(ObjectSuffix) $(IncludePath)\r
-$(IntermediateDirectory)/main$(DependSuffix): main.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/main$(ObjectSuffix) -MF$(IntermediateDirectory)/main$(DependSuffix) -MM "D:/Projects/Radio/fdmdv2/build/main.cpp"\r
-\r
-$(IntermediateDirectory)/main$(PreprocessSuffix): main.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/main$(PreprocessSuffix) "D:/Projects/Radio/fdmdv2/build/main.cpp"\r
-\r
-$(IntermediateDirectory)/wxcrafter$(ObjectSuffix): wxcrafter.cpp $(IntermediateDirectory)/wxcrafter$(DependSuffix)\r
-       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/build/wxcrafter.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/wxcrafter$(ObjectSuffix) $(IncludePath)\r
-$(IntermediateDirectory)/wxcrafter$(DependSuffix): wxcrafter.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/wxcrafter$(ObjectSuffix) -MF$(IntermediateDirectory)/wxcrafter$(DependSuffix) -MM "D:/Projects/Radio/fdmdv2/build/wxcrafter.cpp"\r
-\r
-$(IntermediateDirectory)/wxcrafter$(PreprocessSuffix): wxcrafter.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/wxcrafter$(PreprocessSuffix) "D:/Projects/Radio/fdmdv2/build/wxcrafter.cpp"\r
-\r
-$(IntermediateDirectory)/wxcrafter_bitmaps$(ObjectSuffix): wxcrafter_bitmaps.cpp $(IntermediateDirectory)/wxcrafter_bitmaps$(DependSuffix)\r
-       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/build/wxcrafter_bitmaps.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/wxcrafter_bitmaps$(ObjectSuffix) $(IncludePath)\r
-$(IntermediateDirectory)/wxcrafter_bitmaps$(DependSuffix): wxcrafter_bitmaps.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/wxcrafter_bitmaps$(ObjectSuffix) -MF$(IntermediateDirectory)/wxcrafter_bitmaps$(DependSuffix) -MM "D:/Projects/Radio/fdmdv2/build/wxcrafter_bitmaps.cpp"\r
-\r
-$(IntermediateDirectory)/wxcrafter_bitmaps$(PreprocessSuffix): wxcrafter_bitmaps.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/wxcrafter_bitmaps$(PreprocessSuffix) "D:/Projects/Radio/fdmdv2/build/wxcrafter_bitmaps.cpp"\r
-\r
-$(IntermediateDirectory)/MainDialog$(ObjectSuffix): MainDialog.cpp $(IntermediateDirectory)/MainDialog$(DependSuffix)\r
-       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/build/MainDialog.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/MainDialog$(ObjectSuffix) $(IncludePath)\r
-$(IntermediateDirectory)/MainDialog$(DependSuffix): MainDialog.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/MainDialog$(ObjectSuffix) -MF$(IntermediateDirectory)/MainDialog$(DependSuffix) -MM "D:/Projects/Radio/fdmdv2/build/MainDialog.cpp"\r
-\r
-$(IntermediateDirectory)/MainDialog$(PreprocessSuffix): MainDialog.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/MainDialog$(PreprocessSuffix) "D:/Projects/Radio/fdmdv2/build/MainDialog.cpp"\r
-\r
-$(IntermediateDirectory)/win_resources.rc$(ObjectSuffix): win_resources.rc\r
-       $(RcCompilerName) -i "D:/Projects/Radio/fdmdv2/build/win_resources.rc" $(RcCmpOptions)   $(ObjectSwitch)$(IntermediateDirectory)/win_resources.rc$(ObjectSuffix) $(RcIncludePath)\r
-\r
--include $(IntermediateDirectory)/*$(DependSuffix)\r
-##\r
-## Clean\r
-##\r
-clean:\r
-       $(RM) $(IntermediateDirectory)/main$(ObjectSuffix)\r
-       $(RM) $(IntermediateDirectory)/main$(DependSuffix)\r
-       $(RM) $(IntermediateDirectory)/main$(PreprocessSuffix)\r
-       $(RM) $(IntermediateDirectory)/wxcrafter$(ObjectSuffix)\r
-       $(RM) $(IntermediateDirectory)/wxcrafter$(DependSuffix)\r
-       $(RM) $(IntermediateDirectory)/wxcrafter$(PreprocessSuffix)\r
-       $(RM) $(IntermediateDirectory)/wxcrafter_bitmaps$(ObjectSuffix)\r
-       $(RM) $(IntermediateDirectory)/wxcrafter_bitmaps$(DependSuffix)\r
-       $(RM) $(IntermediateDirectory)/wxcrafter_bitmaps$(PreprocessSuffix)\r
-       $(RM) $(IntermediateDirectory)/MainDialog$(ObjectSuffix)\r
-       $(RM) $(IntermediateDirectory)/MainDialog$(DependSuffix)\r
-       $(RM) $(IntermediateDirectory)/MainDialog$(PreprocessSuffix)\r
-       $(RM) $(IntermediateDirectory)/win_resources.rc$(ObjectSuffix)\r
-       $(RM) $(OutputFile)\r
-       $(RM) $(OutputFile).exe\r
-       $(RM) "D:\Projects\Radio\fdmdv2\build\.build-release\dialogTest"\r
-\r
-\r
diff --git a/fdmdv2/branches/0.97/build/codelite/dialogtest/dialogTest.project b/fdmdv2/branches/0.97/build/codelite/dialogtest/dialogTest.project
deleted file mode 100644 (file)
index b9719ad..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<CodeLite_Project Name="dialogTest" InternalType="GUI">
-  <Description/>
-  <Dependencies/>
-  <Settings Type="Executable">
-    <GlobalSettings>
-      <Compiler Options="" C_Options="">
-        <IncludePath Value="."/>
-      </Compiler>
-      <Linker Options="">
-        <LibraryPath Value="."/>
-      </Linker>
-      <ResourceCompiler Options=""/>
-    </GlobalSettings>
-    <Configuration Name="Debug" CompilerType="gnu g++" DebuggerType="GNU gdb debugger" Type="Executable" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append">
-      <Compiler Options="-g;-O0;-Wall;$(shell wx-config --cflags --debug)" C_Options="-g;-O0;-Wall" Required="yes" PreCompiledHeader="" PCHInCommandLine="no" UseDifferentPCHFlags="no" PCHFlags="">
-        <IncludePath Value="."/>
-      </Compiler>
-      <Linker Options="$(shell wx-config --libs --debug);-mwindows" Required="yes"/>
-      <ResourceCompiler Options="$(shell wx-config --rcflags)" Required="no"/>
-      <General OutputFile="$(IntermediateDirectory)/$(ProjectName)" IntermediateDirectory="./Debug" Command="./$(ProjectName)" CommandArguments="" UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="no"/>
-      <Environment EnvVarSetName="&lt;Use Defaults&gt;" DbgSetName="&lt;Use Defaults&gt;">
-        <![CDATA[]]>
-      </Environment>
-      <Debugger IsRemote="no" RemoteHostName="" RemoteHostPort="" DebuggerPath="">
-        <PostConnectCommands/>
-        <StartupCommands/>
-      </Debugger>
-      <PreBuild/>
-      <PostBuild/>
-      <CustomBuild Enabled="no">
-        <RebuildCommand/>
-        <CleanCommand/>
-        <BuildCommand/>
-        <PreprocessFileCommand/>
-        <SingleFileCommand/>
-        <MakefileGenerationCommand/>
-        <ThirdPartyToolName>None</ThirdPartyToolName>
-        <WorkingDirectory/>
-      </CustomBuild>
-      <AdditionalRules>
-        <CustomPostBuild/>
-        <CustomPreBuild/>
-      </AdditionalRules>
-      <Completion EnableCpp11="no">
-        <ClangCmpFlagsC/>
-        <ClangCmpFlags/>
-        <ClangPP/>
-        <SearchPaths/>
-      </Completion>
-    </Configuration>
-    <Configuration Name="Release" CompilerType="gnu g++" DebuggerType="GNU gdb debugger" Type="Executable" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append">
-      <Compiler Options="-O2;-Wall;$(shell wx-config --cflags)" C_Options="-O2;-Wall" Required="yes" PreCompiledHeader="" PCHInCommandLine="no" UseDifferentPCHFlags="no" PCHFlags="">
-        <IncludePath Value="."/>
-      </Compiler>
-      <Linker Options="$(shell wx-config --libs);-mwindows" Required="yes"/>
-      <ResourceCompiler Options="$(shell wx-config --rcflags)" Required="no"/>
-      <General OutputFile="$(IntermediateDirectory)/$(ProjectName)" IntermediateDirectory="./Release" Command="./$(ProjectName)" CommandArguments="" UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="no"/>
-      <Environment EnvVarSetName="&lt;Use Defaults&gt;" DbgSetName="&lt;Use Defaults&gt;">
-        <![CDATA[]]>
-      </Environment>
-      <Debugger IsRemote="no" RemoteHostName="" RemoteHostPort="" DebuggerPath="">
-        <PostConnectCommands/>
-        <StartupCommands/>
-      </Debugger>
-      <PreBuild/>
-      <PostBuild/>
-      <CustomBuild Enabled="no">
-        <RebuildCommand/>
-        <CleanCommand/>
-        <BuildCommand/>
-        <PreprocessFileCommand/>
-        <SingleFileCommand/>
-        <MakefileGenerationCommand/>
-        <ThirdPartyToolName>None</ThirdPartyToolName>
-        <WorkingDirectory/>
-      </CustomBuild>
-      <AdditionalRules>
-        <CustomPostBuild/>
-        <CustomPreBuild/>
-      </AdditionalRules>
-      <Completion EnableCpp11="no">
-        <ClangCmpFlagsC/>
-        <ClangCmpFlags/>
-        <ClangPP/>
-        <SearchPaths/>
-      </Completion>
-    </Configuration>
-  </Settings>
-  <VirtualDirectory Name="src">
-    <File Name="main.cpp"/>
-    <File Name="wxcrafter.cpp"/>
-    <File Name="wxcrafter_bitmaps.cpp"/>
-    <File Name="MainDialog.cpp"/>
-  </VirtualDirectory>
-  <VirtualDirectory Name="include">
-    <File Name="MainDialog.h"/>
-    <File Name="wxcrafter.h"/>
-  </VirtualDirectory>
-  <VirtualDirectory Name="resources">
-    <File Name="wxcrafter.wxcp"/>
-    <File Name="win_resources.rc"/>
-  </VirtualDirectory>
-  <VirtualDirectory Name="wxcrafter">
-    <VirtualDirectory Name="XRC">
-      <File Name="wxcrafter.xrc"/>
-    </VirtualDirectory>
-  </VirtualDirectory>
-</CodeLite_Project>
diff --git a/fdmdv2/branches/0.97/build/codelite/dialogtest/dialogTest.txt b/fdmdv2/branches/0.97/build/codelite/dialogtest/dialogTest.txt
deleted file mode 100644 (file)
index 869f461..0000000
+++ /dev/null
@@ -1 +0,0 @@
-./Debug/main.o ./Debug/wxcrafter.o ./Debug/wxcrafter_bitmaps.o ./Debug/MainDialog.o ./Debug/win_resources.rc.o  \r
diff --git a/fdmdv2/branches/0.97/build/codelite/dialogtest/main.cpp b/fdmdv2/branches/0.97/build/codelite/dialogtest/main.cpp
deleted file mode 100644 (file)
index d1b49ab..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-#include <wx/app.h>
-#include <wx/event.h>
-#include "MainDialog.h"
-#include <wx/image.h>
-
-// Define the MainApp
-class MainApp : public wxApp
-{
-public:
-    MainApp() {}
-    virtual ~MainApp() {}
-    
-    virtual bool OnInit() 
-    {
-        // Add the common image handlers
-        wxImage::AddHandler( new wxPNGHandler );
-        wxImage::AddHandler( new wxJPEGHandler );
-        
-        PTTDialog mainDialog(NULL);
-        mainDialog.ShowModal();
-        return false;
-    }
-};
-
-DECLARE_APP(MainApp)
-IMPLEMENT_APP(MainApp)
diff --git a/fdmdv2/branches/0.97/build/codelite/dialogtest/win_resources.rc b/fdmdv2/branches/0.97/build/codelite/dialogtest/win_resources.rc
deleted file mode 100644 (file)
index fa70c15..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#include "wx/msw/wx.rc"\r
-1 24 "wx/msw/wx.manifest"\r
diff --git a/fdmdv2/branches/0.97/build/codelite/dialogtest/wxcrafter.cpp b/fdmdv2/branches/0.97/build/codelite/dialogtest/wxcrafter.cpp
deleted file mode 100644 (file)
index 4bf7dc5..0000000
+++ /dev/null
@@ -1,143 +0,0 @@
-//////////////////////////////////////////////////////////////////////
-// This file was auto-generated by codelite's wxCrafter Plugin
-// Do not modify this file by hand!
-//////////////////////////////////////////////////////////////////////
-
-#include "wxcrafter.h"
-
-
-// Declare the bitmap loading function
-extern void wxC9ED9InitBitmapResources();
-
-static bool bBitmapLoaded = false;
-
-
-PTTDialogBaseClass::PTTDialogBaseClass(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style)
-    : wxDialog(parent, id, title, pos, size, style)
-{
-    if ( !bBitmapLoaded ) {
-        // We need to initialise the default bitmap handler
-        wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler);
-        wxC9ED9InitBitmapResources();
-        bBitmapLoaded = true;
-    }
-    
-    wxBoxSizer* mainSizer = new wxBoxSizer(wxVERTICAL);
-    this->SetSizer(mainSizer);
-    
-    wxStaticBoxSizer* staticBoxSizer28 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("Audio Tone")), wxVERTICAL);
-    
-    mainSizer->Add(staticBoxSizer28, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5);
-    
-    m_ckPTTRtChan = new wxCheckBox(this, wxID_ANY, _("PTT tone on right audio channel"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_ckPTTRtChan->SetValue(false);
-    
-    staticBoxSizer28->Add(m_ckPTTRtChan, 0, wxALIGN_CENTER|wxALIGN_CENTER_VERTICAL, 5);
-    
-    wxStaticBoxSizer* staticBoxSizer17 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("Hardware PTT Settings")), wxVERTICAL);
-    
-    mainSizer->Add(staticBoxSizer17, 1, wxEXPAND, 5);
-    
-    wxStaticBoxSizer* staticBoxSizer31 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("PTT Port")), wxVERTICAL);
-    
-    staticBoxSizer17->Add(staticBoxSizer31, 0, wxEXPAND, 5);
-    
-    wxArrayString m_listCtrlPortsArr;
-    m_listCtrlPorts = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), m_listCtrlPortsArr, wxLB_SINGLE);
-    
-    staticBoxSizer31->Add(m_listCtrlPorts, 1, wxALIGN_CENTER, 0);
-    
-    wxBoxSizer* boxSizer19 = new wxBoxSizer(wxVERTICAL);
-    
-    staticBoxSizer17->Add(boxSizer19, 1, wxEXPAND, 5);
-    
-    wxStaticBoxSizer* staticBoxSizer16 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("Signal polarity")), wxHORIZONTAL);
-    
-    boxSizer19->Add(staticBoxSizer16, 1, wxEXPAND|wxALIGN_CENTER|wxALIGN_RIGHT, 5);
-    
-    wxGridSizer* gridSizer17 = new wxGridSizer(  3, 2, 0, 0);
-    
-    staticBoxSizer16->Add(gridSizer17, 1, wxEXPAND|wxALIGN_RIGHT, 5);
-    
-    m_ckUseSerialPTT = new wxCheckBox(this, wxID_ANY, _("Use Serial Port PTT"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_ckUseSerialPTT->SetValue(false);
-    
-    gridSizer17->Add(m_ckUseSerialPTT, 0, wxALIGN_CENTER, 10);
-    
-    gridSizer17->Add(0, 0, 0, 0, 5);
-    
-    m_rbUseDTR = new wxRadioButton(this, wxID_ANY, _("Use DTR"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_rbUseDTR->SetValue(1);
-    
-    gridSizer17->Add(m_rbUseDTR, 0, wxALIGN_CENTER|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5);
-    
-    m_ckRTSPos = new wxCheckBox(this, wxID_ANY, _("DTR = +V"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_ckRTSPos->SetValue(false);
-    
-    gridSizer17->Add(m_ckRTSPos, 0, wxALIGN_CENTER|wxALIGN_RIGHT, 5);
-    
-    m_rbUseRTS = new wxRadioButton(this, wxID_ANY, _("Use RTS"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_rbUseRTS->SetToolTip(_("Toggle the RTS pin for PTT"));
-    m_rbUseRTS->SetValue(1);
-    
-    gridSizer17->Add(m_rbUseRTS, 0, wxALIGN_CENTER|wxALIGN_RIGHT, 5);
-    
-    m_ckDTRPos = new wxCheckBox(this, wxID_ANY, _("RTS = +V"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_ckDTRPos->SetValue(false);
-    m_ckDTRPos->SetToolTip(_("Set Polarity of the RTS line"));
-    
-    gridSizer17->Add(m_ckDTRPos, 0, wxALIGN_CENTER|wxALIGN_RIGHT, 5);
-    
-    wxBoxSizer* boxSizer12 = new wxBoxSizer(wxHORIZONTAL);
-    
-    mainSizer->Add(boxSizer12, 0, wxLEFT|wxRIGHT|wxTOP|wxBOTTOM|wxALIGN_CENTER_HORIZONTAL, 5);
-    
-    m_buttonOK = new wxButton(this, wxID_OK, _("OK"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_buttonOK->SetDefault();
-    
-    boxSizer12->Add(m_buttonOK, 0, wxLEFT|wxRIGHT|wxTOP|wxBOTTOM, 5);
-    
-    m_buttonCancel = new wxButton(this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxSize(-1,-1), 0);
-    
-    boxSizer12->Add(m_buttonCancel, 0, wxLEFT|wxRIGHT|wxTOP|wxBOTTOM, 5);
-    
-    m_buttonApply = new wxButton(this, wxID_APPLY, _("Apply"), wxDefaultPosition, wxSize(-1,-1), 0);
-    
-    boxSizer12->Add(m_buttonApply, 0, wxLEFT|wxRIGHT|wxTOP|wxBOTTOM, 5);
-    
-    
-    SetSizeHints(450,300);
-    if ( GetSizer() ) {
-         GetSizer()->Fit(this);
-    }
-    Centre(wxBOTH);
-    // Connect events
-    this->Connect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(PTTDialogBaseClass::OnInitDialog), NULL, this);
-    m_ckPTTRtChan->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(PTTDialogBaseClass::PTTAudioClick), NULL, this);
-    m_listCtrlPorts->Connect(wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler(PTTDialogBaseClass::PTTPortSlelcted), NULL, this);
-    m_ckUseSerialPTT->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(PTTDialogBaseClass::PTTUseSerialClicked), NULL, this);
-    m_rbUseDTR->Connect(wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler(PTTDialogBaseClass::UseDTRCliched), NULL, this);
-    m_ckRTSPos->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(PTTDialogBaseClass::DTRVPlusClicked), NULL, this);
-    m_rbUseRTS->Connect(wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler(PTTDialogBaseClass::UseRTSClicked), NULL, this);
-    m_ckDTRPos->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(PTTDialogBaseClass::RTSVPlusClicked), NULL, this);
-    m_buttonOK->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(PTTDialogBaseClass::OnOK), NULL, this);
-    m_buttonCancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(PTTDialogBaseClass::OnCancel), NULL, this);
-    m_buttonApply->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(PTTDialogBaseClass::OnApply), NULL, this);
-    
-}
-
-PTTDialogBaseClass::~PTTDialogBaseClass()
-{
-    this->Disconnect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(PTTDialogBaseClass::OnInitDialog), NULL, this);
-    m_ckPTTRtChan->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(PTTDialogBaseClass::PTTAudioClick), NULL, this);
-    m_listCtrlPorts->Disconnect(wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler(PTTDialogBaseClass::PTTPortSlelcted), NULL, this);
-    m_ckUseSerialPTT->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(PTTDialogBaseClass::PTTUseSerialClicked), NULL, this);
-    m_rbUseDTR->Disconnect(wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler(PTTDialogBaseClass::UseDTRCliched), NULL, this);
-    m_ckRTSPos->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(PTTDialogBaseClass::DTRVPlusClicked), NULL, this);
-    m_rbUseRTS->Disconnect(wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler(PTTDialogBaseClass::UseRTSClicked), NULL, this);
-    m_ckDTRPos->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(PTTDialogBaseClass::RTSVPlusClicked), NULL, this);
-    m_buttonOK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(PTTDialogBaseClass::OnOK), NULL, this);
-    m_buttonCancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(PTTDialogBaseClass::OnCancel), NULL, this);
-    m_buttonApply->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(PTTDialogBaseClass::OnApply), NULL, this);
-    
-}
diff --git a/fdmdv2/branches/0.97/build/codelite/dialogtest/wxcrafter.h b/fdmdv2/branches/0.97/build/codelite/dialogtest/wxcrafter.h
deleted file mode 100644 (file)
index fb0f63a..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-//////////////////////////////////////////////////////////////////////
-// This file was auto-generated by codelite's wxCrafter Plugin
-// Do not modify this file by hand!
-//////////////////////////////////////////////////////////////////////
-
-#ifndef WXCRAFTER_BASE_CLASSES_H
-#define WXCRAFTER_BASE_CLASSES_H
-
-#include <wx/settings.h>
-#include <wx/xrc/xmlres.h>
-#include <wx/xrc/xh_bmp.h>
-#include <wx/dialog.h>
-#include <wx/sizer.h>
-#include <wx/statbox.h>
-#include <wx/checkbox.h>
-#include <wx/listbox.h>
-#include <wx/radiobut.h>
-#include <wx/button.h>
-
-class PTTDialogBaseClass : public wxDialog
-{
-protected:
-    wxCheckBox* m_ckPTTRtChan;
-    wxListBox* m_listCtrlPorts;
-    wxCheckBox* m_ckUseSerialPTT;
-    wxRadioButton* m_rbUseDTR;
-    wxCheckBox* m_ckRTSPos;
-    wxRadioButton* m_rbUseRTS;
-    wxCheckBox* m_ckDTRPos;
-    wxButton* m_buttonOK;
-    wxButton* m_buttonCancel;
-    wxButton* m_buttonApply;
-
-protected:
-    virtual void OnInitDialog(wxInitDialogEvent& event) { event.Skip(); }
-    virtual void PTTAudioClick(wxCommandEvent& event) { event.Skip(); }
-    virtual void PTTPortSlelcted(wxCommandEvent& event) { event.Skip(); }
-    virtual void PTTUseSerialClicked(wxCommandEvent& event) { event.Skip(); }
-    virtual void UseDTRCliched(wxCommandEvent& event) { event.Skip(); }
-    virtual void DTRVPlusClicked(wxCommandEvent& event) { event.Skip(); }
-    virtual void UseRTSClicked(wxCommandEvent& event) { event.Skip(); }
-    virtual void RTSVPlusClicked(wxCommandEvent& event) { event.Skip(); }
-    virtual void OnOK(wxCommandEvent& event) { event.Skip(); }
-    virtual void OnCancel(wxCommandEvent& event) { event.Skip(); }
-    virtual void OnApply(wxCommandEvent& event) { event.Skip(); }
-
-public:
-    PTTDialogBaseClass(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Hardware PTT"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(450,300), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER);
-    virtual ~PTTDialogBaseClass();
-};
-
-#endif
diff --git a/fdmdv2/branches/0.97/build/codelite/dialogtest/wxcrafter.wxcp b/fdmdv2/branches/0.97/build/codelite/dialogtest/wxcrafter.wxcp
deleted file mode 100644 (file)
index b79705a..0000000
+++ /dev/null
@@ -1,965 +0,0 @@
-{
-       "metadata":     {
-               "m_generatedFilesDir":  "",
-               "m_objCounter": 32,
-               "m_includeFiles":       [],
-               "m_bitmapFunction":     "wxC9ED9InitBitmapResources",
-               "m_bitmapsFile":        "wxcrafter_bitmaps.cpp",
-               "m_GenerateCodeTypes":  3
-       },
-       "windows":      [{
-                       "m_type":       4421,
-                       "proportion":   0,
-                       "border":       5,
-                       "gbSpan":       "1,1",
-                       "gbPosition":   "0,0",
-                       "m_styles":     ["wxDEFAULT_DIALOG_STYLE", "wxRESIZE_BORDER"],
-                       "m_sizerFlags": ["wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                       "m_properties": [{
-                                       "type": "winid",
-                                       "m_label":      "ID:",
-                                       "m_winid":      "wxID_ANY"
-                               }, {
-                                       "type": "string",
-                                       "m_label":      "Size:",
-                                       "m_value":      "450,300"
-                               }, {
-                                       "type": "string",
-                                       "m_label":      "Minimum Size:",
-                                       "m_value":      "-1,-1"
-                               }, {
-                                       "type": "string",
-                                       "m_label":      "Name:",
-                                       "m_value":      "PTTDialog"
-                               }, {
-                                       "type": "multi-string",
-                                       "m_label":      "Tooltip:",
-                                       "m_value":      ""
-                               }, {
-                                       "type": "colour",
-                                       "m_label":      "Bg Colour:",
-                                       "colour":       "<Default>"
-                               }, {
-                                       "type": "colour",
-                                       "m_label":      "Fg Colour:",
-                                       "colour":       "<Default>"
-                               }, {
-                                       "type": "font",
-                                       "m_label":      "Font:",
-                                       "m_value":      ""
-                               }, {
-                                       "type": "string",
-                                       "m_label":      "Class Name:",
-                                       "m_value":      ""
-                               }, {
-                                       "type": "string",
-                                       "m_label":      "Include File:",
-                                       "m_value":      ""
-                               }, {
-                                       "type": "string",
-                                       "m_label":      "Title:",
-                                       "m_value":      "Hardware PTT"
-                               }, {
-                                       "type": "string",
-                                       "m_label":      "File:",
-                                       "m_value":      "MainDialog"
-                               }, {
-                                       "type": "virtualFolderPicker",
-                                       "m_label":      "Virtual Folder:",
-                                       "m_path":       ""
-                               }, {
-                                       "type": "choice",
-                                       "m_label":      "Centre:",
-                                       "m_selection":  1,
-                                       "m_options":    ["", "wxBOTH", "wxVERTICAL", "wxHORIZONTAL"]
-                               }],
-                       "m_events":     [{
-                                       "m_eventName":  "wxEVT_INIT_DIALOG",
-                                       "m_eventClass": "wxInitDialogEvent",
-                                       "m_eventHandler":       "wxInitDialogEventHandler",
-                                       "m_functionNameAndSignature":   "OnInitDialog(wxInitDialogEvent& event)",
-                                       "m_description":        "A wxInitDialogEvent is sent as a dialog or panel is being initialised. Handlers for this event can transfer data to the window.\nThe default handler calls wxWindow::TransferDataToWindow"
-                               }],
-                       "m_children":   [{
-                                       "m_type":       4401,
-                                       "proportion":   0,
-                                       "border":       5,
-                                       "gbSpan":       "1,1",
-                                       "gbPosition":   "0,0",
-                                       "m_styles":     [],
-                                       "m_sizerFlags": ["wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                       "m_properties": [{
-                                                       "type": "string",
-                                                       "m_label":      "Name:",
-                                                       "m_value":      "mainSizer"
-                                               }, {
-                                                       "type": "choice",
-                                                       "m_label":      "Orientation:",
-                                                       "m_selection":  0,
-                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
-                                               }],
-                                       "m_events":     [],
-                                       "m_children":   [{
-                                                       "m_type":       4449,
-                                                       "proportion":   0,
-                                                       "border":       5,
-                                                       "gbSpan":       "1,1",
-                                                       "gbPosition":   "0,0",
-                                                       "m_styles":     [],
-                                                       "m_sizerFlags": ["wxEXPAND", "wxALIGN_CENTER_VERTICAL"],
-                                                       "m_properties": [{
-                                                                       "type": "string",
-                                                                       "m_label":      "Name:",
-                                                                       "m_value":      "staticBoxSizer28"
-                                                               }, {
-                                                                       "type": "choice",
-                                                                       "m_label":      "Orientation:",
-                                                                       "m_selection":  0,
-                                                                       "m_options":    ["Vertical", "Horizontal"]
-                                                               }, {
-                                                                       "type": "string",
-                                                                       "m_label":      "Label:",
-                                                                       "m_value":      "Audio Tone"
-                                                               }],
-                                                       "m_events":     [],
-                                                       "m_children":   [{
-                                                                       "m_type":       4415,
-                                                                       "proportion":   0,
-                                                                       "border":       5,
-                                                                       "gbSpan":       "1,1",
-                                                                       "gbPosition":   "0,0",
-                                                                       "m_styles":     [],
-                                                                       "m_sizerFlags": ["wxALIGN_CENTER", "wxALIGN_CENTER_VERTICAL"],
-                                                                       "m_properties": [{
-                                                                                       "type": "winid",
-                                                                                       "m_label":      "ID:",
-                                                                                       "m_winid":      "wxID_ANY"
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Size:",
-                                                                                       "m_value":      "-1,-1"
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Minimum Size:",
-                                                                                       "m_value":      "-1,-1"
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Name:",
-                                                                                       "m_value":      "m_ckPTTRtChan"
-                                                                               }, {
-                                                                                       "type": "multi-string",
-                                                                                       "m_label":      "Tooltip:",
-                                                                                       "m_value":      ""
-                                                                               }, {
-                                                                                       "type": "colour",
-                                                                                       "m_label":      "Bg Colour:",
-                                                                                       "colour":       "<Default>"
-                                                                               }, {
-                                                                                       "type": "colour",
-                                                                                       "m_label":      "Fg Colour:",
-                                                                                       "colour":       "<Default>"
-                                                                               }, {
-                                                                                       "type": "font",
-                                                                                       "m_label":      "Font:",
-                                                                                       "m_value":      ""
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Class Name:",
-                                                                                       "m_value":      ""
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Include File:",
-                                                                                       "m_value":      ""
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Label:",
-                                                                                       "m_value":      "PTT tone on right audio channel"
-                                                                               }, {
-                                                                                       "type": "bool",
-                                                                                       "m_label":      "Value:",
-                                                                                       "m_value":      false
-                                                                               }],
-                                                                       "m_events":     [{
-                                                                                       "m_eventName":  "wxEVT_COMMAND_CHECKBOX_CLICKED",
-                                                                                       "m_eventClass": "wxCommandEvent",
-                                                                                       "m_eventHandler":       "wxCommandEventHandler",
-                                                                                       "m_functionNameAndSignature":   "PTTAudioClick(wxCommandEvent& event)",
-                                                                                       "m_description":        "Process a wxEVT_COMMAND_CHECKBOX_CLICKED event, when the checkbox is clicked."
-                                                                               }],
-                                                                       "m_children":   []
-                                                               }]
-                                               }, {
-                                                       "m_type":       4449,
-                                                       "proportion":   1,
-                                                       "border":       5,
-                                                       "gbSpan":       "1,1",
-                                                       "gbPosition":   "0,0",
-                                                       "m_styles":     [],
-                                                       "m_sizerFlags": ["wxEXPAND"],
-                                                       "m_properties": [{
-                                                                       "type": "string",
-                                                                       "m_label":      "Name:",
-                                                                       "m_value":      "staticBoxSizer17"
-                                                               }, {
-                                                                       "type": "choice",
-                                                                       "m_label":      "Orientation:",
-                                                                       "m_selection":  0,
-                                                                       "m_options":    ["Vertical", "Horizontal"]
-                                                               }, {
-                                                                       "type": "string",
-                                                                       "m_label":      "Label:",
-                                                                       "m_value":      "Hardware PTT Settings"
-                                                               }],
-                                                       "m_events":     [],
-                                                       "m_children":   [{
-                                                                       "m_type":       4449,
-                                                                       "proportion":   0,
-                                                                       "border":       5,
-                                                                       "gbSpan":       "1,1",
-                                                                       "gbPosition":   "0,0",
-                                                                       "m_styles":     [],
-                                                                       "m_sizerFlags": ["wxEXPAND"],
-                                                                       "m_properties": [{
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Name:",
-                                                                                       "m_value":      "staticBoxSizer31"
-                                                                               }, {
-                                                                                       "type": "choice",
-                                                                                       "m_label":      "Orientation:",
-                                                                                       "m_selection":  0,
-                                                                                       "m_options":    ["Vertical", "Horizontal"]
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Label:",
-                                                                                       "m_value":      "PTT Port"
-                                                                               }],
-                                                                       "m_events":     [],
-                                                                       "m_children":   [{
-                                                                                       "m_type":       4412,
-                                                                                       "proportion":   1,
-                                                                                       "border":       0,
-                                                                                       "gbSpan":       "1,1",
-                                                                                       "gbPosition":   "0,0",
-                                                                                       "m_styles":     ["wxLB_SINGLE"],
-                                                                                       "m_sizerFlags": ["wxALIGN_CENTER"],
-                                                                                       "m_properties": [{
-                                                                                                       "type": "winid",
-                                                                                                       "m_label":      "ID:",
-                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                               }, {
-                                                                                                       "type": "string",
-                                                                                                       "m_label":      "Size:",
-                                                                                                       "m_value":      "-1,-1"
-                                                                                               }, {
-                                                                                                       "type": "string",
-                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                       "m_value":      "-1,-1"
-                                                                                               }, {
-                                                                                                       "type": "string",
-                                                                                                       "m_label":      "Name:",
-                                                                                                       "m_value":      "m_listCtrlPorts"
-                                                                                               }, {
-                                                                                                       "type": "multi-string",
-                                                                                                       "m_label":      "Tooltip:",
-                                                                                                       "m_value":      ""
-                                                                                               }, {
-                                                                                                       "type": "colour",
-                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                       "colour":       "<Default>"
-                                                                                               }, {
-                                                                                                       "type": "colour",
-                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                       "colour":       "<Default>"
-                                                                                               }, {
-                                                                                                       "type": "font",
-                                                                                                       "m_label":      "Font:",
-                                                                                                       "m_value":      ""
-                                                                                               }, {
-                                                                                                       "type": "string",
-                                                                                                       "m_label":      "Class Name:",
-                                                                                                       "m_value":      ""
-                                                                                               }, {
-                                                                                                       "type": "string",
-                                                                                                       "m_label":      "Include File:",
-                                                                                                       "m_value":      ""
-                                                                                               }, {
-                                                                                                       "type": "multi-string",
-                                                                                                       "m_label":      "Choices:",
-                                                                                                       "m_value":      ""
-                                                                                               }, {
-                                                                                                       "type": "string",
-                                                                                                       "m_label":      "Selection:",
-                                                                                                       "m_value":      "-1"
-                                                                                               }],
-                                                                                       "m_events":     [{
-                                                                                                       "m_eventName":  "wxEVT_COMMAND_LISTBOX_SELECTED",
-                                                                                                       "m_eventClass": "wxCommandEvent",
-                                                                                                       "m_eventHandler":       "wxCommandEventHandler",
-                                                                                                       "m_functionNameAndSignature":   "PTTPortSlelcted(wxCommandEvent& event)",
-                                                                                                       "m_description":        "Process a wxEVT_COMMAND_LISTBOX_SELECTED event, when an item on the list is selected or the selection changes."
-                                                                                               }],
-                                                                                       "m_children":   []
-                                                                               }]
-                                                               }, {
-                                                                       "m_type":       4401,
-                                                                       "proportion":   1,
-                                                                       "border":       5,
-                                                                       "gbSpan":       "1,1",
-                                                                       "gbPosition":   "0,0",
-                                                                       "m_styles":     [],
-                                                                       "m_sizerFlags": ["wxEXPAND"],
-                                                                       "m_properties": [{
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Name:",
-                                                                                       "m_value":      "boxSizer19"
-                                                                               }, {
-                                                                                       "type": "choice",
-                                                                                       "m_label":      "Orientation:",
-                                                                                       "m_selection":  0,
-                                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
-                                                                               }],
-                                                                       "m_events":     [],
-                                                                       "m_children":   [{
-                                                                                       "m_type":       4449,
-                                                                                       "proportion":   1,
-                                                                                       "border":       5,
-                                                                                       "gbSpan":       "1,1",
-                                                                                       "gbPosition":   "0,0",
-                                                                                       "m_styles":     [],
-                                                                                       "m_sizerFlags": ["wxEXPAND", "wxALIGN_CENTER", "wxALIGN_RIGHT"],
-                                                                                       "m_properties": [{
-                                                                                                       "type": "string",
-                                                                                                       "m_label":      "Name:",
-                                                                                                       "m_value":      "staticBoxSizer16"
-                                                                                               }, {
-                                                                                                       "type": "choice",
-                                                                                                       "m_label":      "Orientation:",
-                                                                                                       "m_selection":  1,
-                                                                                                       "m_options":    ["Vertical", "Horizontal"]
-                                                                                               }, {
-                                                                                                       "type": "string",
-                                                                                                       "m_label":      "Label:",
-                                                                                                       "m_value":      "Signal polarity"
-                                                                                               }],
-                                                                                       "m_events":     [],
-                                                                                       "m_children":   [{
-                                                                                                       "m_type":       4452,
-                                                                                                       "proportion":   1,
-                                                                                                       "border":       5,
-                                                                                                       "gbSpan":       "1,1",
-                                                                                                       "gbPosition":   "0,0",
-                                                                                                       "m_styles":     [],
-                                                                                                       "m_sizerFlags": ["wxEXPAND", "wxALIGN_RIGHT"],
-                                                                                                       "m_properties": [{
-                                                                                                                       "type": "string",
-                                                                                                                       "m_label":      "Name:",
-                                                                                                                       "m_value":      "gridSizer17"
-                                                                                                               }, {
-                                                                                                                       "type": "string",
-                                                                                                                       "m_label":      "# Columns:",
-                                                                                                                       "m_value":      "2"
-                                                                                                               }, {
-                                                                                                                       "type": "string",
-                                                                                                                       "m_label":      "# Rows:",
-                                                                                                                       "m_value":      "3"
-                                                                                                               }, {
-                                                                                                                       "type": "string",
-                                                                                                                       "m_label":      "Horizontal gap:",
-                                                                                                                       "m_value":      "0"
-                                                                                                               }, {
-                                                                                                                       "type": "string",
-                                                                                                                       "m_label":      "Vertical gap:",
-                                                                                                                       "m_value":      "0"
-                                                                                                               }],
-                                                                                                       "m_events":     [],
-                                                                                                       "m_children":   [{
-                                                                                                                       "m_type":       4415,
-                                                                                                                       "proportion":   0,
-                                                                                                                       "border":       10,
-                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                       "m_styles":     [],
-                                                                                                                       "m_sizerFlags": ["wxALIGN_CENTER"],
-                                                                                                                       "m_properties": [{
-                                                                                                                                       "type": "winid",
-                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                       "m_value":      "m_ckUseSerialPTT"
-                                                                                                                               }, {
-                                                                                                                                       "type": "multi-string",
-                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "colour",
-                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                       "colour":       "<Default>"
-                                                                                                                               }, {
-                                                                                                                                       "type": "colour",
-                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                       "colour":       "<Default>"
-                                                                                                                               }, {
-                                                                                                                                       "type": "font",
-                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                       "m_value":      "Use Serial Port PTT"
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Value:",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }],
-                                                                                                                       "m_events":     [{
-                                                                                                                                       "m_eventName":  "wxEVT_COMMAND_CHECKBOX_CLICKED",
-                                                                                                                                       "m_eventClass": "wxCommandEvent",
-                                                                                                                                       "m_eventHandler":       "wxCommandEventHandler",
-                                                                                                                                       "m_functionNameAndSignature":   "PTTUseSerialClicked(wxCommandEvent& event)",
-                                                                                                                                       "m_description":        "Process a wxEVT_COMMAND_CHECKBOX_CLICKED event, when the checkbox is clicked."
-                                                                                                                               }],
-                                                                                                                       "m_children":   []
-                                                                                                               }, {
-                                                                                                                       "m_type":       4454,
-                                                                                                                       "proportion":   0,
-                                                                                                                       "border":       5,
-                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                       "m_styles":     [],
-                                                                                                                       "m_sizerFlags": [],
-                                                                                                                       "m_properties": [{
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                       "m_value":      "Spacer"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                       "m_value":      "0,0"
-                                                                                                                               }],
-                                                                                                                       "m_events":     [],
-                                                                                                                       "m_children":   []
-                                                                                                               }, {
-                                                                                                                       "m_type":       4417,
-                                                                                                                       "proportion":   0,
-                                                                                                                       "border":       5,
-                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                       "m_styles":     [],
-                                                                                                                       "m_sizerFlags": ["wxALIGN_CENTER", "wxALIGN_RIGHT", "wxALIGN_CENTER_VERTICAL"],
-                                                                                                                       "m_properties": [{
-                                                                                                                                       "type": "winid",
-                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                       "m_value":      "m_rbUseDTR"
-                                                                                                                               }, {
-                                                                                                                                       "type": "multi-string",
-                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "colour",
-                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                       "colour":       "<Default>"
-                                                                                                                               }, {
-                                                                                                                                       "type": "colour",
-                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                       "colour":       "<Default>"
-                                                                                                                               }, {
-                                                                                                                                       "type": "font",
-                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                       "m_value":      "Use DTR"
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Value:",
-                                                                                                                                       "m_value":      true
-                                                                                                                               }],
-                                                                                                                       "m_events":     [{
-                                                                                                                                       "m_eventName":  "wxEVT_COMMAND_RADIOBUTTON_SELECTED",
-                                                                                                                                       "m_eventClass": "wxCommandEvent",
-                                                                                                                                       "m_eventHandler":       "wxCommandEventHandler",
-                                                                                                                                       "m_functionNameAndSignature":   "UseDTRCliched(wxCommandEvent& event)",
-                                                                                                                                       "m_description":        "Process a wxEVT_COMMAND_RADIOBUTTON_SELECTED event, when the radiobutton is clicked."
-                                                                                                                               }],
-                                                                                                                       "m_children":   []
-                                                                                                               }, {
-                                                                                                                       "m_type":       4415,
-                                                                                                                       "proportion":   0,
-                                                                                                                       "border":       5,
-                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                       "m_styles":     [],
-                                                                                                                       "m_sizerFlags": ["wxALIGN_CENTER", "wxALIGN_RIGHT"],
-                                                                                                                       "m_properties": [{
-                                                                                                                                       "type": "winid",
-                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                       "m_value":      "m_ckRTSPos"
-                                                                                                                               }, {
-                                                                                                                                       "type": "multi-string",
-                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "colour",
-                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                       "colour":       "<Default>"
-                                                                                                                               }, {
-                                                                                                                                       "type": "colour",
-                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                       "colour":       "<Default>"
-                                                                                                                               }, {
-                                                                                                                                       "type": "font",
-                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                       "m_value":      "DTR = +V"
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Value:",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }],
-                                                                                                                       "m_events":     [{
-                                                                                                                                       "m_eventName":  "wxEVT_COMMAND_CHECKBOX_CLICKED",
-                                                                                                                                       "m_eventClass": "wxCommandEvent",
-                                                                                                                                       "m_eventHandler":       "wxCommandEventHandler",
-                                                                                                                                       "m_functionNameAndSignature":   "DTRVPlusClicked(wxCommandEvent& event)",
-                                                                                                                                       "m_description":        "Process a wxEVT_COMMAND_CHECKBOX_CLICKED event, when the checkbox is clicked."
-                                                                                                                               }],
-                                                                                                                       "m_children":   []
-                                                                                                               }, {
-                                                                                                                       "m_type":       4417,
-                                                                                                                       "proportion":   0,
-                                                                                                                       "border":       5,
-                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                       "m_styles":     [],
-                                                                                                                       "m_sizerFlags": ["wxALIGN_CENTER", "wxALIGN_RIGHT"],
-                                                                                                                       "m_properties": [{
-                                                                                                                                       "type": "winid",
-                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                       "m_value":      "m_rbUseRTS"
-                                                                                                                               }, {
-                                                                                                                                       "type": "multi-string",
-                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                       "m_value":      "Toggle the RTS pin for PTT"
-                                                                                                                               }, {
-                                                                                                                                       "type": "colour",
-                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                       "colour":       "<Default>"
-                                                                                                                               }, {
-                                                                                                                                       "type": "colour",
-                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                       "colour":       "<Default>"
-                                                                                                                               }, {
-                                                                                                                                       "type": "font",
-                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                       "m_value":      "Use RTS"
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Value:",
-                                                                                                                                       "m_value":      true
-                                                                                                                               }],
-                                                                                                                       "m_events":     [{
-                                                                                                                                       "m_eventName":  "wxEVT_COMMAND_RADIOBUTTON_SELECTED",
-                                                                                                                                       "m_eventClass": "wxCommandEvent",
-                                                                                                                                       "m_eventHandler":       "wxCommandEventHandler",
-                                                                                                                                       "m_functionNameAndSignature":   "UseRTSClicked(wxCommandEvent& event)",
-                                                                                                                                       "m_description":        "Process a wxEVT_COMMAND_RADIOBUTTON_SELECTED event, when the radiobutton is clicked."
-                                                                                                                               }],
-                                                                                                                       "m_children":   []
-                                                                                                               }, {
-                                                                                                                       "m_type":       4415,
-                                                                                                                       "proportion":   0,
-                                                                                                                       "border":       5,
-                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                       "m_styles":     [],
-                                                                                                                       "m_sizerFlags": ["wxALIGN_CENTER", "wxALIGN_RIGHT"],
-                                                                                                                       "m_properties": [{
-                                                                                                                                       "type": "winid",
-                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                       "m_value":      "m_ckDTRPos"
-                                                                                                                               }, {
-                                                                                                                                       "type": "multi-string",
-                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                       "m_value":      "Set Polarity of the RTS line"
-                                                                                                                               }, {
-                                                                                                                                       "type": "colour",
-                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                       "colour":       "<Default>"
-                                                                                                                               }, {
-                                                                                                                                       "type": "colour",
-                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                       "colour":       "<Default>"
-                                                                                                                               }, {
-                                                                                                                                       "type": "font",
-                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                       "m_value":      "RTS = +V"
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Value:",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }],
-                                                                                                                       "m_events":     [{
-                                                                                                                                       "m_eventName":  "wxEVT_COMMAND_CHECKBOX_CLICKED",
-                                                                                                                                       "m_eventClass": "wxCommandEvent",
-                                                                                                                                       "m_eventHandler":       "wxCommandEventHandler",
-                                                                                                                                       "m_functionNameAndSignature":   "RTSVPlusClicked(wxCommandEvent& event)",
-                                                                                                                                       "m_description":        "Process a wxEVT_COMMAND_CHECKBOX_CLICKED event, when the checkbox is clicked."
-                                                                                                                               }],
-                                                                                                                       "m_children":   []
-                                                                                                               }]
-                                                                                               }]
-                                                                               }]
-                                                               }]
-                                               }, {
-                                                       "m_type":       4401,
-                                                       "proportion":   0,
-                                                       "border":       5,
-                                                       "gbSpan":       "1,1",
-                                                       "gbPosition":   "0,0",
-                                                       "m_styles":     [],
-                                                       "m_sizerFlags": ["wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_HORIZONTAL"],
-                                                       "m_properties": [{
-                                                                       "type": "string",
-                                                                       "m_label":      "Name:",
-                                                                       "m_value":      "boxSizer12"
-                                                               }, {
-                                                                       "type": "choice",
-                                                                       "m_label":      "Orientation:",
-                                                                       "m_selection":  1,
-                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
-                                                               }],
-                                                       "m_events":     [],
-                                                       "m_children":   [{
-                                                                       "m_type":       4400,
-                                                                       "proportion":   0,
-                                                                       "border":       5,
-                                                                       "gbSpan":       "1,1",
-                                                                       "gbPosition":   "0,0",
-                                                                       "m_styles":     [],
-                                                                       "m_sizerFlags": ["wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                                                       "m_properties": [{
-                                                                                       "type": "winid",
-                                                                                       "m_label":      "ID:",
-                                                                                       "m_winid":      "wxID_OK"
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Size:",
-                                                                                       "m_value":      "-1,-1"
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Minimum Size:",
-                                                                                       "m_value":      "-1,-1"
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Name:",
-                                                                                       "m_value":      "m_buttonOK"
-                                                                               }, {
-                                                                                       "type": "multi-string",
-                                                                                       "m_label":      "Tooltip:",
-                                                                                       "m_value":      ""
-                                                                               }, {
-                                                                                       "type": "colour",
-                                                                                       "m_label":      "Bg Colour:",
-                                                                                       "colour":       "<Default>"
-                                                                               }, {
-                                                                                       "type": "colour",
-                                                                                       "m_label":      "Fg Colour:",
-                                                                                       "colour":       "<Default>"
-                                                                               }, {
-                                                                                       "type": "font",
-                                                                                       "m_label":      "Font:",
-                                                                                       "m_value":      ""
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Class Name:",
-                                                                                       "m_value":      ""
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Include File:",
-                                                                                       "m_value":      ""
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Label:",
-                                                                                       "m_value":      "OK"
-                                                                               }, {
-                                                                                       "type": "bool",
-                                                                                       "m_label":      "Default Button",
-                                                                                       "m_value":      true
-                                                                               }, {
-                                                                                       "type": "filePicker",
-                                                                                       "m_label":      "Bitmap File:",
-                                                                                       "m_path":       ""
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Margins:",
-                                                                                       "m_value":      "2,2"
-                                                                               }],
-                                                                       "m_events":     [{
-                                                                                       "m_eventName":  "wxEVT_COMMAND_BUTTON_CLICKED",
-                                                                                       "m_eventClass": "wxCommandEvent",
-                                                                                       "m_eventHandler":       "wxCommandEventHandler",
-                                                                                       "m_functionNameAndSignature":   "OnOK(wxCommandEvent& event)",
-                                                                                       "m_description":        "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked."
-                                                                               }],
-                                                                       "m_children":   []
-                                                               }, {
-                                                                       "m_type":       4400,
-                                                                       "proportion":   0,
-                                                                       "border":       5,
-                                                                       "gbSpan":       "1,1",
-                                                                       "gbPosition":   "0,0",
-                                                                       "m_styles":     [],
-                                                                       "m_sizerFlags": ["wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                                                       "m_properties": [{
-                                                                                       "type": "winid",
-                                                                                       "m_label":      "ID:",
-                                                                                       "m_winid":      "wxID_CANCEL"
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Size:",
-                                                                                       "m_value":      "-1,-1"
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Minimum Size:",
-                                                                                       "m_value":      "-1,-1"
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Name:",
-                                                                                       "m_value":      "m_buttonCancel"
-                                                                               }, {
-                                                                                       "type": "multi-string",
-                                                                                       "m_label":      "Tooltip:",
-                                                                                       "m_value":      ""
-                                                                               }, {
-                                                                                       "type": "colour",
-                                                                                       "m_label":      "Bg Colour:",
-                                                                                       "colour":       "<Default>"
-                                                                               }, {
-                                                                                       "type": "colour",
-                                                                                       "m_label":      "Fg Colour:",
-                                                                                       "colour":       "<Default>"
-                                                                               }, {
-                                                                                       "type": "font",
-                                                                                       "m_label":      "Font:",
-                                                                                       "m_value":      ""
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Class Name:",
-                                                                                       "m_value":      ""
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Include File:",
-                                                                                       "m_value":      ""
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Label:",
-                                                                                       "m_value":      "Cancel"
-                                                                               }, {
-                                                                                       "type": "bool",
-                                                                                       "m_label":      "Default Button",
-                                                                                       "m_value":      false
-                                                                               }, {
-                                                                                       "type": "filePicker",
-                                                                                       "m_label":      "Bitmap File:",
-                                                                                       "m_path":       ""
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Margins:",
-                                                                                       "m_value":      "2,2"
-                                                                               }],
-                                                                       "m_events":     [{
-                                                                                       "m_eventName":  "wxEVT_COMMAND_BUTTON_CLICKED",
-                                                                                       "m_eventClass": "wxCommandEvent",
-                                                                                       "m_eventHandler":       "wxCommandEventHandler",
-                                                                                       "m_functionNameAndSignature":   "OnCancel(wxCommandEvent& event)",
-                                                                                       "m_description":        "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked."
-                                                                               }],
-                                                                       "m_children":   []
-                                                               }, {
-                                                                       "m_type":       4400,
-                                                                       "proportion":   0,
-                                                                       "border":       5,
-                                                                       "gbSpan":       "1,1",
-                                                                       "gbPosition":   "0,0",
-                                                                       "m_styles":     [],
-                                                                       "m_sizerFlags": ["wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                                                       "m_properties": [{
-                                                                                       "type": "winid",
-                                                                                       "m_label":      "ID:",
-                                                                                       "m_winid":      "wxID_APPLY"
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Size:",
-                                                                                       "m_value":      "-1,-1"
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Minimum Size:",
-                                                                                       "m_value":      "-1,-1"
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Name:",
-                                                                                       "m_value":      "m_buttonApply"
-                                                                               }, {
-                                                                                       "type": "multi-string",
-                                                                                       "m_label":      "Tooltip:",
-                                                                                       "m_value":      ""
-                                                                               }, {
-                                                                                       "type": "colour",
-                                                                                       "m_label":      "Bg Colour:",
-                                                                                       "colour":       "<Default>"
-                                                                               }, {
-                                                                                       "type": "colour",
-                                                                                       "m_label":      "Fg Colour:",
-                                                                                       "colour":       "<Default>"
-                                                                               }, {
-                                                                                       "type": "font",
-                                                                                       "m_label":      "Font:",
-                                                                                       "m_value":      ""
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Class Name:",
-                                                                                       "m_value":      ""
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Include File:",
-                                                                                       "m_value":      ""
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Label:",
-                                                                                       "m_value":      "Apply"
-                                                                               }, {
-                                                                                       "type": "bool",
-                                                                                       "m_label":      "Default Button",
-                                                                                       "m_value":      false
-                                                                               }, {
-                                                                                       "type": "filePicker",
-                                                                                       "m_label":      "Bitmap File:",
-                                                                                       "m_path":       ""
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Margins:",
-                                                                                       "m_value":      "2,2"
-                                                                               }],
-                                                                       "m_events":     [{
-                                                                                       "m_eventName":  "wxEVT_COMMAND_BUTTON_CLICKED",
-                                                                                       "m_eventClass": "wxCommandEvent",
-                                                                                       "m_eventHandler":       "wxCommandEventHandler",
-                                                                                       "m_functionNameAndSignature":   "OnApply(wxCommandEvent& event)",
-                                                                                       "m_description":        "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked."
-                                                                               }],
-                                                                       "m_children":   []
-                                                               }]
-                                               }]
-                               }]
-               }]
-}
\ No newline at end of file
diff --git a/fdmdv2/branches/0.97/build/codelite/dialogtest/wxcrafter_bitmaps.cpp b/fdmdv2/branches/0.97/build/codelite/dialogtest/wxcrafter_bitmaps.cpp
deleted file mode 100644 (file)
index b78c0b9..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-//\r
-// This file was automatically generated by wxrc, do not edit by hand.\r
-//\r
-\r
-#include <wx/wxprec.h>\r
-\r
-#ifdef __BORLANDC__\r
-    #pragma hdrstop\r
-#endif\r
-\r
-#include <wx/filesys.h>\r
-#include <wx/fs_mem.h>\r
-#include <wx/xrc/xmlres.h>\r
-#include <wx/xrc/xh_all.h>\r
-\r
-#if wxCHECK_VERSION(2,8,5) && wxABI_VERSION >= 20805\r
-    #define XRC_ADD_FILE(name, data, size, mime) \\r
-        wxMemoryFSHandler::AddFileWithMimeType(name, data, size, mime)\r
-#else\r
-    #define XRC_ADD_FILE(name, data, size, mime) \\r
-        wxMemoryFSHandler::AddFile(name, data, size)\r
-#endif\r
-\r
-static size_t xml_res_size_0 = 108;\r
-static unsigned char xml_res_file_0[] = {\r
-60,63,120,109,108,32,118,101,114,115,105,111,110,61,34,49,46,48,34,32,101,\r
-110,99,111,100,105,110,103,61,34,85,84,70,45,56,34,63,62,10,60,114,101,\r
-115,111,117,114,99,101,32,120,109,108,110,115,61,34,104,116,116,112,58,\r
-47,47,119,119,119,46,119,120,119,105,110,100,111,119,115,46,111,114,103,\r
-47,119,120,120,114,99,34,32,118,101,114,115,105,111,110,61,34,50,46,51,\r
-46,48,46,49,34,47,62,10};\r
-\r
-void wxC9ED9InitBitmapResources()\r
-{\r
-\r
-    // Check for memory FS. If not present, load the handler:\r
-    {\r
-        wxMemoryFSHandler::AddFile(wxT("XRC_resource/dummy_file"), wxT("dummy one"));\r
-        wxFileSystem fsys;\r
-        wxFSFile *f = fsys.OpenFile(wxT("memory:XRC_resource/dummy_file"));\r
-        wxMemoryFSHandler::RemoveFile(wxT("XRC_resource/dummy_file"));\r
-        if (f) delete f;\r
-        else wxFileSystem::AddHandler(new wxMemoryFSHandlerBase);\r
-    }\r
-\r
-    XRC_ADD_FILE(wxT("XRC_resource/wxcrafter_bitmaps.cpp$._wxcrafter_bitmaps.xrc"), xml_res_file_0, xml_res_size_0, wxT("text/xml"));\r
-    wxXmlResource::Get()->Load(wxT("memory:XRC_resource/wxcrafter_bitmaps.cpp$._wxcrafter_bitmaps.xrc"));\r
-}\r
diff --git a/fdmdv2/branches/0.97/build/codelite/dialogtest/wxcrafter_bitmaps.xrc b/fdmdv2/branches/0.97/build/codelite/dialogtest/wxcrafter_bitmaps.xrc
deleted file mode 100644 (file)
index 8a0ee50..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resource xmlns="http://www.wxwindows.org/wxxrc" version="2.3.0.1"/>
diff --git a/fdmdv2/branches/0.97/build/codelite/fdmdv2.mk b/fdmdv2/branches/0.97/build/codelite/fdmdv2.mk
deleted file mode 100644 (file)
index 1864ae1..0000000
+++ /dev/null
@@ -1,270 +0,0 @@
-##\r
-## Auto Generated makefile by CodeLite IDE\r
-## any manual changes will be erased      \r
-##\r
-## Debug\r
-ProjectName            :=fdmdv2\r
-ConfigurationName      :=Debug\r
-WorkspacePath          := "D:\Projects\Radio\fdmdv2\build\codelite"\r
-ProjectPath            := "D:\Projects\Radio\fdmdv2\build\codelite"\r
-IntermediateDirectory  :=./Debug\r
-OutDir                 := $(IntermediateDirectory)\r
-CurrentFileName        :=\r
-CurrentFilePath        :=\r
-CurrentFileFullPath    :=\r
-User                   :=wittend\r
-Date                   :=5/6/2013\r
-CodeLitePath           :="D:\bin\CodeLite"\r
-LinkerName             :=g++\r
-SharedObjectLinkerName :=g++ -shared -fPIC\r
-ObjectSuffix           :=.o\r
-DependSuffix           :=.o.d\r
-PreprocessSuffix       :=.o.i\r
-DebugSwitch            :=-gstab\r
-IncludeSwitch          :=-I\r
-LibrarySwitch          :=-l\r
-OutputSwitch           :=-o \r
-LibraryPathSwitch      :=-L\r
-PreprocessorSwitch     :=-D\r
-SourceSwitch           :=-c \r
-OutputFile             :=$(IntermediateDirectory)/freeDV\r
-Preprocessors          :=$(PreprocessorSwitch)__WX__ $(PreprocessorSwitch)_NO_AUTOTOOLS_=1 $(PreprocessorSwitch)DMW=1 \r
-ObjectSwitch           :=-o \r
-ArchiveOutputSwitch    := \r
-PreprocessOnlySwitch   :=-E \r
-ObjectsFileList        :="fdmdv2.txt"\r
-PCHCompileFlags        :=\r
-MakeDirCommand         :=makedir\r
-RcCmpOptions           := $(shell wx-config --rcflags)\r
-RcCompilerName         :=windres\r
-LinkOptions            :=  -mwindows $(shell wx-config --debug=yes --libs --unicode=yes)\r
-IncludePath            :=  $(IncludeSwitch). $(IncludeSwitch)/bin/MinGW-4.7.1/msys/1.0/local/include $(IncludeSwitch)../../../codec2/src $(IncludeSwitch)/bin/Projects/Audio/libsndfile/include \r
-IncludePCH             := \r
-RcIncludePath          := \r
-Libs                   := $(LibrarySwitch)sndfile-1 $(LibrarySwitch)codec2 $(LibrarySwitch)portaudio $(LibrarySwitch)portaudiocpp $(LibrarySwitch)samplerate.dll $(LibrarySwitch)ctb-0.16 $(LibrarySwitch)sox \r
-ArLibs                 :=  "libsndfile-1.dll" "codec2" "libportaudio.a" "libportaudiocpp.a" "libsamplerate.dll.a" "libctb-0.16.a" "libsox" \r
-LibPath                := $(LibraryPathSwitch). $(LibraryPathSwitch)d:/Projects/Radio/codec2/src/.libs $(LibraryPathSwitch)d:/bin/MinGW-4.7.1/msys/1.0/local/lib \r
-\r
-##\r
-## Common variables\r
-## AR, CXX, CC, CXXFLAGS and CFLAGS can be overriden using an environment variables\r
-##\r
-AR       := ar rcus\r
-CXX      := g++\r
-CC       := gcc\r
-CXXFLAGS :=  -g -O0 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=yes)  -DSVN_REVISION=\"1237\"  $(Preprocessors)\r
-CFLAGS   :=  -g -O0 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=yes)  -DSVN_REVISION=\"1237\"  $(Preprocessors)\r
-\r
-\r
-##\r
-## User defined environment variables\r
-##\r
-CodeLiteDir:=D:\bin\CodeLite\r
-WXWIN:=D:\bin\wxWidgets-2.9.4\r
-PATH:=$(WXWIN)\lib\gcc_dll;$(PATH)\r
-WXCFG:=gcc_dll\mswu\r
-UNIT_TEST_PP_SRC_DIR:=D:\bin\UnitTest++1.3\r
-Objects0=$(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) \\r
-       $(IntermediateDirectory)/src_dlg_filter$(ObjectSuffix) $(IntermediateDirectory)/src_varicode$(ObjectSuffix) $(IntermediateDirectory)/src_sox_biquad$(ObjectSuffix) $(IntermediateDirectory)/src_dlg_about$(ObjectSuffix) $(IntermediateDirectory)/src_golay23$(ObjectSuffix) \r
-\r
-\r
-\r
-Objects=$(Objects0) \r
-\r
-##\r
-## Main Build Targets \r
-##\r
-.PHONY: all clean PreBuild PrePreBuild PostBuild\r
-all: $(OutputFile)\r
-\r
-$(OutputFile): $(IntermediateDirectory)/.d $(Objects) \r
-       @$(MakeDirCommand) $(@D)\r
-       @echo "" > $(IntermediateDirectory)/.d\r
-       @echo $(Objects0)  > $(ObjectsFileList)\r
-       $(LinkerName) $(OutputSwitch)$(OutputFile) @$(ObjectsFileList) $(LibPath) $(Libs) $(LinkOptions)\r
-\r
-$(IntermediateDirectory)/.d:\r
-       @$(MakeDirCommand) "./Debug"\r
-\r
-PreBuild:\r
-\r
-\r
-##\r
-## Objects\r
-##\r
-$(IntermediateDirectory)/src_dlg_comports$(ObjectSuffix): ../../src/dlg_comports.cpp $(IntermediateDirectory)/src_dlg_comports$(DependSuffix)\r
-       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/src/dlg_comports.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/src_dlg_comports$(ObjectSuffix) $(IncludePath)\r
-$(IntermediateDirectory)/src_dlg_comports$(DependSuffix): ../../src/dlg_comports.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/src_dlg_comports$(ObjectSuffix) -MF$(IntermediateDirectory)/src_dlg_comports$(DependSuffix) -MM "../../src/dlg_comports.cpp"\r
-\r
-$(IntermediateDirectory)/src_dlg_comports$(PreprocessSuffix): ../../src/dlg_comports.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_dlg_comports$(PreprocessSuffix) "../../src/dlg_comports.cpp"\r
-\r
-$(IntermediateDirectory)/src_fdmdv2_main$(ObjectSuffix): ../../src/fdmdv2_main.cpp $(IntermediateDirectory)/src_fdmdv2_main$(DependSuffix)\r
-       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/src/fdmdv2_main.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/src_fdmdv2_main$(ObjectSuffix) $(IncludePath)\r
-$(IntermediateDirectory)/src_fdmdv2_main$(DependSuffix): ../../src/fdmdv2_main.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/src_fdmdv2_main$(ObjectSuffix) -MF$(IntermediateDirectory)/src_fdmdv2_main$(DependSuffix) -MM "../../src/fdmdv2_main.cpp"\r
-\r
-$(IntermediateDirectory)/src_fdmdv2_main$(PreprocessSuffix): ../../src/fdmdv2_main.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_fdmdv2_main$(PreprocessSuffix) "../../src/fdmdv2_main.cpp"\r
-\r
-$(IntermediateDirectory)/src_fdmdv2_plot$(ObjectSuffix): ../../src/fdmdv2_plot.cpp $(IntermediateDirectory)/src_fdmdv2_plot$(DependSuffix)\r
-       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/src/fdmdv2_plot.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/src_fdmdv2_plot$(ObjectSuffix) $(IncludePath)\r
-$(IntermediateDirectory)/src_fdmdv2_plot$(DependSuffix): ../../src/fdmdv2_plot.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/src_fdmdv2_plot$(ObjectSuffix) -MF$(IntermediateDirectory)/src_fdmdv2_plot$(DependSuffix) -MM "../../src/fdmdv2_plot.cpp"\r
-\r
-$(IntermediateDirectory)/src_fdmdv2_plot$(PreprocessSuffix): ../../src/fdmdv2_plot.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_fdmdv2_plot$(PreprocessSuffix) "../../src/fdmdv2_plot.cpp"\r
-\r
-$(IntermediateDirectory)/src_topFrame$(ObjectSuffix): ../../src/topFrame.cpp $(IntermediateDirectory)/src_topFrame$(DependSuffix)\r
-       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/src/topFrame.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/src_topFrame$(ObjectSuffix) $(IncludePath)\r
-$(IntermediateDirectory)/src_topFrame$(DependSuffix): ../../src/topFrame.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/src_topFrame$(ObjectSuffix) -MF$(IntermediateDirectory)/src_topFrame$(DependSuffix) -MM "../../src/topFrame.cpp"\r
-\r
-$(IntermediateDirectory)/src_topFrame$(PreprocessSuffix): ../../src/topFrame.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_topFrame$(PreprocessSuffix) "../../src/topFrame.cpp"\r
-\r
-$(IntermediateDirectory)/src_fdmdv2_plot_scatter$(ObjectSuffix): ../../src/fdmdv2_plot_scatter.cpp $(IntermediateDirectory)/src_fdmdv2_plot_scatter$(DependSuffix)\r
-       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/src/fdmdv2_plot_scatter.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/src_fdmdv2_plot_scatter$(ObjectSuffix) $(IncludePath)\r
-$(IntermediateDirectory)/src_fdmdv2_plot_scatter$(DependSuffix): ../../src/fdmdv2_plot_scatter.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/src_fdmdv2_plot_scatter$(ObjectSuffix) -MF$(IntermediateDirectory)/src_fdmdv2_plot_scatter$(DependSuffix) -MM "../../src/fdmdv2_plot_scatter.cpp"\r
-\r
-$(IntermediateDirectory)/src_fdmdv2_plot_scatter$(PreprocessSuffix): ../../src/fdmdv2_plot_scatter.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_fdmdv2_plot_scatter$(PreprocessSuffix) "../../src/fdmdv2_plot_scatter.cpp"\r
-\r
-$(IntermediateDirectory)/src_fdmdv2_plot_spectrum$(ObjectSuffix): ../../src/fdmdv2_plot_spectrum.cpp $(IntermediateDirectory)/src_fdmdv2_plot_spectrum$(DependSuffix)\r
-       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/src/fdmdv2_plot_spectrum.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/src_fdmdv2_plot_spectrum$(ObjectSuffix) $(IncludePath)\r
-$(IntermediateDirectory)/src_fdmdv2_plot_spectrum$(DependSuffix): ../../src/fdmdv2_plot_spectrum.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/src_fdmdv2_plot_spectrum$(ObjectSuffix) -MF$(IntermediateDirectory)/src_fdmdv2_plot_spectrum$(DependSuffix) -MM "../../src/fdmdv2_plot_spectrum.cpp"\r
-\r
-$(IntermediateDirectory)/src_fdmdv2_plot_spectrum$(PreprocessSuffix): ../../src/fdmdv2_plot_spectrum.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_fdmdv2_plot_spectrum$(PreprocessSuffix) "../../src/fdmdv2_plot_spectrum.cpp"\r
-\r
-$(IntermediateDirectory)/src_fdmdv2_pa_wrapper$(ObjectSuffix): ../../src/fdmdv2_pa_wrapper.cpp $(IntermediateDirectory)/src_fdmdv2_pa_wrapper$(DependSuffix)\r
-       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/src/fdmdv2_pa_wrapper.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/src_fdmdv2_pa_wrapper$(ObjectSuffix) $(IncludePath)\r
-$(IntermediateDirectory)/src_fdmdv2_pa_wrapper$(DependSuffix): ../../src/fdmdv2_pa_wrapper.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/src_fdmdv2_pa_wrapper$(ObjectSuffix) -MF$(IntermediateDirectory)/src_fdmdv2_pa_wrapper$(DependSuffix) -MM "../../src/fdmdv2_pa_wrapper.cpp"\r
-\r
-$(IntermediateDirectory)/src_fdmdv2_pa_wrapper$(PreprocessSuffix): ../../src/fdmdv2_pa_wrapper.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_fdmdv2_pa_wrapper$(PreprocessSuffix) "../../src/fdmdv2_pa_wrapper.cpp"\r
-\r
-$(IntermediateDirectory)/src_fdmdv2_plot_scalar$(ObjectSuffix): ../../src/fdmdv2_plot_scalar.cpp $(IntermediateDirectory)/src_fdmdv2_plot_scalar$(DependSuffix)\r
-       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/src/fdmdv2_plot_scalar.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/src_fdmdv2_plot_scalar$(ObjectSuffix) $(IncludePath)\r
-$(IntermediateDirectory)/src_fdmdv2_plot_scalar$(DependSuffix): ../../src/fdmdv2_plot_scalar.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/src_fdmdv2_plot_scalar$(ObjectSuffix) -MF$(IntermediateDirectory)/src_fdmdv2_plot_scalar$(DependSuffix) -MM "../../src/fdmdv2_plot_scalar.cpp"\r
-\r
-$(IntermediateDirectory)/src_fdmdv2_plot_scalar$(PreprocessSuffix): ../../src/fdmdv2_plot_scalar.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_fdmdv2_plot_scalar$(PreprocessSuffix) "../../src/fdmdv2_plot_scalar.cpp"\r
-\r
-$(IntermediateDirectory)/src_fdmdv2_plot_waterfall_linux$(ObjectSuffix): ../../src/fdmdv2_plot_waterfall_linux.cpp $(IntermediateDirectory)/src_fdmdv2_plot_waterfall_linux$(DependSuffix)\r
-       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/src/fdmdv2_plot_waterfall_linux.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/src_fdmdv2_plot_waterfall_linux$(ObjectSuffix) $(IncludePath)\r
-$(IntermediateDirectory)/src_fdmdv2_plot_waterfall_linux$(DependSuffix): ../../src/fdmdv2_plot_waterfall_linux.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/src_fdmdv2_plot_waterfall_linux$(ObjectSuffix) -MF$(IntermediateDirectory)/src_fdmdv2_plot_waterfall_linux$(DependSuffix) -MM "../../src/fdmdv2_plot_waterfall_linux.cpp"\r
-\r
-$(IntermediateDirectory)/src_fdmdv2_plot_waterfall_linux$(PreprocessSuffix): ../../src/fdmdv2_plot_waterfall_linux.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_fdmdv2_plot_waterfall_linux$(PreprocessSuffix) "../../src/fdmdv2_plot_waterfall_linux.cpp"\r
-\r
-$(IntermediateDirectory)/src_dlg_audiooptions$(ObjectSuffix): ../../src/dlg_audiooptions.cpp $(IntermediateDirectory)/src_dlg_audiooptions$(DependSuffix)\r
-       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/src/dlg_audiooptions.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/src_dlg_audiooptions$(ObjectSuffix) $(IncludePath)\r
-$(IntermediateDirectory)/src_dlg_audiooptions$(DependSuffix): ../../src/dlg_audiooptions.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/src_dlg_audiooptions$(ObjectSuffix) -MF$(IntermediateDirectory)/src_dlg_audiooptions$(DependSuffix) -MM "../../src/dlg_audiooptions.cpp"\r
-\r
-$(IntermediateDirectory)/src_dlg_audiooptions$(PreprocessSuffix): ../../src/dlg_audiooptions.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_dlg_audiooptions$(PreprocessSuffix) "../../src/dlg_audiooptions.cpp"\r
-\r
-$(IntermediateDirectory)/src_dlg_filter$(ObjectSuffix): ../../src/dlg_filter.cpp $(IntermediateDirectory)/src_dlg_filter$(DependSuffix)\r
-       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/src/dlg_filter.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/src_dlg_filter$(ObjectSuffix) $(IncludePath)\r
-$(IntermediateDirectory)/src_dlg_filter$(DependSuffix): ../../src/dlg_filter.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/src_dlg_filter$(ObjectSuffix) -MF$(IntermediateDirectory)/src_dlg_filter$(DependSuffix) -MM "../../src/dlg_filter.cpp"\r
-\r
-$(IntermediateDirectory)/src_dlg_filter$(PreprocessSuffix): ../../src/dlg_filter.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_dlg_filter$(PreprocessSuffix) "../../src/dlg_filter.cpp"\r
-\r
-$(IntermediateDirectory)/src_varicode$(ObjectSuffix): ../../src/varicode.c $(IntermediateDirectory)/src_varicode$(DependSuffix)\r
-       $(CC) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/src/varicode.c" $(CFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/src_varicode$(ObjectSuffix) $(IncludePath)\r
-$(IntermediateDirectory)/src_varicode$(DependSuffix): ../../src/varicode.c\r
-       @$(CC) $(CFLAGS) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/src_varicode$(ObjectSuffix) -MF$(IntermediateDirectory)/src_varicode$(DependSuffix) -MM "../../src/varicode.c"\r
-\r
-$(IntermediateDirectory)/src_varicode$(PreprocessSuffix): ../../src/varicode.c\r
-       @$(CC) $(CFLAGS) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_varicode$(PreprocessSuffix) "../../src/varicode.c"\r
-\r
-$(IntermediateDirectory)/src_sox_biquad$(ObjectSuffix): ../../src/sox_biquad.c $(IntermediateDirectory)/src_sox_biquad$(DependSuffix)\r
-       $(CC) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/src/sox_biquad.c" $(CFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/src_sox_biquad$(ObjectSuffix) $(IncludePath)\r
-$(IntermediateDirectory)/src_sox_biquad$(DependSuffix): ../../src/sox_biquad.c\r
-       @$(CC) $(CFLAGS) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/src_sox_biquad$(ObjectSuffix) -MF$(IntermediateDirectory)/src_sox_biquad$(DependSuffix) -MM "../../src/sox_biquad.c"\r
-\r
-$(IntermediateDirectory)/src_sox_biquad$(PreprocessSuffix): ../../src/sox_biquad.c\r
-       @$(CC) $(CFLAGS) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_sox_biquad$(PreprocessSuffix) "../../src/sox_biquad.c"\r
-\r
-$(IntermediateDirectory)/src_dlg_about$(ObjectSuffix): ../../src/dlg_about.cpp $(IntermediateDirectory)/src_dlg_about$(DependSuffix)\r
-       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/src/dlg_about.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/src_dlg_about$(ObjectSuffix) $(IncludePath)\r
-$(IntermediateDirectory)/src_dlg_about$(DependSuffix): ../../src/dlg_about.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/src_dlg_about$(ObjectSuffix) -MF$(IntermediateDirectory)/src_dlg_about$(DependSuffix) -MM "../../src/dlg_about.cpp"\r
-\r
-$(IntermediateDirectory)/src_dlg_about$(PreprocessSuffix): ../../src/dlg_about.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_dlg_about$(PreprocessSuffix) "../../src/dlg_about.cpp"\r
-\r
-$(IntermediateDirectory)/src_golay23$(ObjectSuffix): ../../../codec2/src/golay23.c $(IntermediateDirectory)/src_golay23$(DependSuffix)\r
-       $(CC) $(SourceSwitch) "D:/Projects/Radio/codec2/src/golay23.c" $(CFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/src_golay23$(ObjectSuffix) $(IncludePath)\r
-$(IntermediateDirectory)/src_golay23$(DependSuffix): ../../../codec2/src/golay23.c\r
-       @$(CC) $(CFLAGS) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/src_golay23$(ObjectSuffix) -MF$(IntermediateDirectory)/src_golay23$(DependSuffix) -MM "../../../codec2/src/golay23.c"\r
-\r
-$(IntermediateDirectory)/src_golay23$(PreprocessSuffix): ../../../codec2/src/golay23.c\r
-       @$(CC) $(CFLAGS) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_golay23$(PreprocessSuffix) "../../../codec2/src/golay23.c"\r
-\r
-\r
--include $(IntermediateDirectory)/*$(DependSuffix)\r
-##\r
-## Clean\r
-##\r
-clean:\r
-       $(RM) $(IntermediateDirectory)/src_dlg_comports$(ObjectSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_dlg_comports$(DependSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_dlg_comports$(PreprocessSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_fdmdv2_main$(ObjectSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_fdmdv2_main$(DependSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_fdmdv2_main$(PreprocessSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_fdmdv2_plot$(ObjectSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_fdmdv2_plot$(DependSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_fdmdv2_plot$(PreprocessSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_topFrame$(ObjectSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_topFrame$(DependSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_topFrame$(PreprocessSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_fdmdv2_plot_scatter$(ObjectSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_fdmdv2_plot_scatter$(DependSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_fdmdv2_plot_scatter$(PreprocessSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_fdmdv2_plot_spectrum$(ObjectSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_fdmdv2_plot_spectrum$(DependSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_fdmdv2_plot_spectrum$(PreprocessSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_fdmdv2_pa_wrapper$(ObjectSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_fdmdv2_pa_wrapper$(DependSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_fdmdv2_pa_wrapper$(PreprocessSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_fdmdv2_plot_scalar$(ObjectSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_fdmdv2_plot_scalar$(DependSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_fdmdv2_plot_scalar$(PreprocessSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_fdmdv2_plot_waterfall_linux$(ObjectSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_fdmdv2_plot_waterfall_linux$(DependSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_fdmdv2_plot_waterfall_linux$(PreprocessSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_dlg_audiooptions$(ObjectSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_dlg_audiooptions$(DependSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_dlg_audiooptions$(PreprocessSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_dlg_filter$(ObjectSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_dlg_filter$(DependSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_dlg_filter$(PreprocessSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_varicode$(ObjectSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_varicode$(DependSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_varicode$(PreprocessSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_sox_biquad$(ObjectSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_sox_biquad$(DependSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_sox_biquad$(PreprocessSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_dlg_about$(ObjectSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_dlg_about$(DependSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_dlg_about$(PreprocessSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_golay23$(ObjectSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_golay23$(DependSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_golay23$(PreprocessSuffix)\r
-       $(RM) $(OutputFile)\r
-       $(RM) $(OutputFile).exe\r
-       $(RM) ".build-debug/fdmdv2"\r
-\r
-\r
diff --git a/fdmdv2/branches/0.97/build/codelite/fdmdv2.project b/fdmdv2/branches/0.97/build/codelite/fdmdv2.project
deleted file mode 100644 (file)
index acef6ef..0000000
+++ /dev/null
@@ -1,175 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<CodeLite_Project Name="fdmdv2" InternalType="GUI">
-  <Plugins>
-    <Plugin Name="qmake">
-      <![CDATA[00020001N0005Debug0000000000000001N0007Release000000000000]]>
-    </Plugin>
-  </Plugins>
-  <Description/>
-  <Dependencies/>
-  <VirtualDirectory Name="src">
-    <File Name="../../src/dlg_comports.cpp"/>
-    <File Name="../../src/fdmdv2_main.cpp"/>
-    <File Name="../../src/fdmdv2_plot.cpp"/>
-    <File Name="../../src/topFrame.cpp"/>
-    <File Name="../../src/fdmdv2_plot_scatter.cpp"/>
-    <File Name="../../src/fdmdv2_plot_spectrum.cpp"/>
-    <File Name="../../src/fdmdv2_pa_wrapper.cpp"/>
-    <File Name="../../src/fdmdv2_plot_scalar.cpp"/>
-    <File Name="../../src/fdmdv2_plot_waterfall_linux.cpp"/>
-    <File Name="../../src/dlg_audiooptions.cpp"/>
-    <File Name="../../src/dlg_filter.cpp"/>
-    <File Name="../../src/varicode.c"/>
-    <File Name="../../src/sox_biquad.c"/>
-    <File Name="../../src/dlg_about.cpp"/>
-    <File Name="../../../codec2/src/golay23.c"/>
-  </VirtualDirectory>
-  <VirtualDirectory Name="include">
-    <File Name="../../src/dlg_comports.h"/>
-    <File Name="../../src/fdmdv2_main.h"/>
-    <File Name="../../src/fdmdv2_plot.h"/>
-    <File Name="../../src/topFrame.h"/>
-    <File Name="../../src/fdmdv2_plot_scatter.h"/>
-    <File Name="../../src/fdmdv2_plot_spectrum.h"/>
-    <File Name="../../src/fdmdv2_pa_wrapper.h"/>
-    <File Name="../../src/comp.h"/>
-    <File Name="../../src/fdmdv2_plot_scalar.h"/>
-    <File Name="../../../codec2/src/codec2.h"/>
-    <File Name="../../src/fdmdv2_defines.h"/>
-    <File Name="../../../Audio/libsndfile/include/sndfile.h"/>
-    <File Name="../../src/fdmdv2_plot_waterfall_linux.h"/>
-    <File Name="../../src/dlg_audiooptions.h"/>
-    <File Name="../../src/varicode.h"/>
-    <File Name="../../src/varicode_table.h"/>
-    <File Name="../../src/sox_biquad.h"/>
-    <File Name="../../src/dlg_about.h"/>
-    <File Name="../../../../code/libCTB-0.16/include/ctb-0.16/ctb.h"/>
-    <File Name="../../../../Audio/portaudio/include/portaudio.h"/>
-    <File Name="../../src/dlg_filter.h"/>
-    <File Name="../../src/version.h"/>
-    <File Name="../../../codec2/src/golay23.h"/>
-  </VirtualDirectory>
-  <VirtualDirectory Name="resources">
-    <File Name="../../src/FDMDV2.fbp"/>
-  </VirtualDirectory>
-  <Dependencies Name="Debug"/>
-  <Dependencies Name="Release"/>
-  <Settings Type="Executable">
-    <GlobalSettings>
-      <Compiler Options="" C_Options="">
-        <IncludePath Value="."/>
-      </Compiler>
-      <Linker Options="">
-        <LibraryPath Value="."/>
-      </Linker>
-      <ResourceCompiler Options=""/>
-    </GlobalSettings>
-    <Configuration Name="Debug" CompilerType="gnu g++" DebuggerType="GNU gdb debugger" Type="Executable" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append">
-      <Compiler Options="-g;-O0;-Wall;$(shell wx-config --cxxflags --unicode=yes --debug=yes)" C_Options="-g;-O0;-Wall;$(shell wx-config --cxxflags --unicode=yes --debug=yes)" Required="yes" PreCompiledHeader="" PCHInCommandLine="no" UseDifferentPCHFlags="no" PCHFlags="">
-        <IncludePath Value="/bin/MinGW-4.7.1/msys/1.0/local/include"/>
-        <IncludePath Value="../../../codec2/src"/>
-        <IncludePath Value="/bin/Projects/Audio/libsndfile/include"/>
-        <Preprocessor Value="__WX__"/>
-        <Preprocessor Value="_NO_AUTOTOOLS_=1"/>
-        <Preprocessor Value="DMW=1"/>
-      </Compiler>
-      <Linker Options="-mwindows;$(shell wx-config --debug=yes --libs --unicode=yes)" Required="yes">
-        <LibraryPath Value="d:/Projects/Radio/codec2/src/.libs"/>
-        <LibraryPath Value="d:/bin/MinGW-4.7.1/msys/1.0/local/lib"/>
-        <Library Value="libsndfile-1.dll"/>
-        <Library Value="codec2"/>
-        <Library Value="libportaudio.a"/>
-        <Library Value="libportaudiocpp.a"/>
-        <Library Value="libsamplerate.dll.a"/>
-        <Library Value="libctb-0.16.a"/>
-        <Library Value="libsox"/>
-      </Linker>
-      <ResourceCompiler Options="$(shell wx-config --rcflags)" Required="no"/>
-      <General OutputFile="$(IntermediateDirectory)/freeDV" IntermediateDirectory="./Debug" Command="./freeDV.exe" CommandArguments="" UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="no"/>
-      <Environment EnvVarSetName="&lt;Use Defaults&gt;" DbgSetName="&lt;Use Defaults&gt;">
-        <![CDATA[]]>
-      </Environment>
-      <Debugger IsRemote="no" RemoteHostName="" RemoteHostPort="" DebuggerPath="">
-        <PostConnectCommands/>
-        <StartupCommands/>
-      </Debugger>
-      <PreBuild/>
-      <PostBuild/>
-      <CustomBuild Enabled="no">
-        <RebuildCommand/>
-        <CleanCommand/>
-        <BuildCommand/>
-        <PreprocessFileCommand/>
-        <SingleFileCommand/>
-        <MakefileGenerationCommand/>
-        <ThirdPartyToolName>None</ThirdPartyToolName>
-        <WorkingDirectory/>
-      </CustomBuild>
-      <AdditionalRules>
-        <CustomPostBuild/>
-        <CustomPreBuild/>
-      </AdditionalRules>
-      <Completion EnableCpp11="no">
-        <ClangCmpFlagsC/>
-        <ClangCmpFlags/>
-        <ClangPP/>
-        <SearchPaths/>
-      </Completion>
-    </Configuration>
-    <Configuration Name="Release" CompilerType="gnu g++" DebuggerType="GNU gdb debugger" Type="Executable" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append">
-      <Compiler Options="-O2;-Wall;$(shell wx-config --cxxflags --unicode=yes --debug=no)" C_Options="-O2;-Wall;$(shell wx-config --cxxflags --unicode=yes --debug=no)" Required="yes" PreCompiledHeader="" PCHInCommandLine="no" UseDifferentPCHFlags="no" PCHFlags="">
-        <IncludePath Value="/bin/MinGW-4.7.1/msys/1.0/local/include"/>
-        <IncludePath Value="../../../codec2/src"/>
-        <IncludePath Value="../../../Audio/portaudio/include"/>
-        <IncludePath Value="../../../Audio/libsndfile/include"/>
-        <IncludePath Value="../../../Audio/libsamplerate-0.1.8/src"/>
-        <Preprocessor Value="__WX__"/>
-        <Preprocessor Value="DMW=1"/>
-        <Preprocessor Value="_NO_AUTOTOOLS_=1"/>
-      </Compiler>
-      <Linker Options="-mwindows;-s;$(shell wx-config --debug=no --libs --unicode=yes)" Required="yes">
-        <LibraryPath Value="d:/Projects/Radio/codec2/src/.libs"/>
-        <LibraryPath Value="d:/bin/MinGW-4.7.1/msys/1.0/local/lib"/>
-        <LibraryPath Value="d:/Projects/Audio/libsndfile/lib"/>
-        <Library Value="libsndfile-1.dll"/>
-        <Library Value="codec2"/>
-        <Library Value="libportaudio.a"/>
-        <Library Value="libportaudiocpp.a"/>
-        <Library Value="libsamplerate.dll.a"/>
-        <Library Value="libctb-0.16.a"/>
-        <Library Value="libsox.dll.a"/>
-      </Linker>
-      <ResourceCompiler Options="$(shell wx-config --rcflags)" Required="no"/>
-      <General OutputFile="$(IntermediateDirectory)/freeDV" IntermediateDirectory="./Release" Command="./freeDV.exe" CommandArguments="" UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="no"/>
-      <Environment EnvVarSetName="&lt;Use Defaults&gt;" DbgSetName="&lt;Use Defaults&gt;">
-        <![CDATA[]]>
-      </Environment>
-      <Debugger IsRemote="no" RemoteHostName="" RemoteHostPort="" DebuggerPath="">
-        <PostConnectCommands/>
-        <StartupCommands/>
-      </Debugger>
-      <PreBuild/>
-      <PostBuild/>
-      <CustomBuild Enabled="no">
-        <RebuildCommand/>
-        <CleanCommand/>
-        <BuildCommand/>
-        <PreprocessFileCommand/>
-        <SingleFileCommand/>
-        <MakefileGenerationCommand/>
-        <ThirdPartyToolName>None</ThirdPartyToolName>
-        <WorkingDirectory/>
-      </CustomBuild>
-      <AdditionalRules>
-        <CustomPostBuild/>
-        <CustomPreBuild/>
-      </AdditionalRules>
-      <Completion EnableCpp11="no">
-        <ClangCmpFlagsC/>
-        <ClangCmpFlags/>
-        <ClangPP/>
-        <SearchPaths/>
-      </Completion>
-    </Configuration>
-  </Settings>
-</CodeLite_Project>
diff --git a/fdmdv2/branches/0.97/build/codelite/fdmdv2.txt b/fdmdv2/branches/0.97/build/codelite/fdmdv2.txt
deleted file mode 100644 (file)
index 7b08125..0000000
+++ /dev/null
@@ -1 +0,0 @@
-./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 ./Debug/src_dlg_about.o ./Debug/src_golay23.o   \r
diff --git a/fdmdv2/branches/0.97/build/codelite/fdmdv2.workspace b/fdmdv2/branches/0.97/build/codelite/fdmdv2.workspace
deleted file mode 100644 (file)
index 9a56dfc..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<CodeLite_Workspace Name="fdmdv2" Database="./fdmdv2.tags">
-  <Project Name="fdmdv2" Path="fdmdv2.project" Active="Yes"/>
-  <Environment>
-    <![CDATA[]]>
-  </Environment>
-  <Project Name="hamlib_trial" Path="hamlib_trial/hamlib_trial.project" Active="No"/>
-  <BuildMatrix>
-    <WorkspaceConfiguration Name="Debug" Selected="yes">
-      <Project Name="fdmdv2" ConfigName="Debug"/>
-      <Project Name="rawbits" ConfigName="Debug"/>
-      <Project Name="pa_enum" ConfigName="Debug"/>
-      <Project Name="appWithDlg" ConfigName="Debug"/>
-      <Project Name="dialogTest" ConfigName="Debug"/>
-      <Project Name="bigButtonRig" ConfigName="Debug"/>
-      <Project Name="enumSerial" ConfigName="Debug"/>
-      <Project Name="hamlib_trial" ConfigName="Debug"/>
-    </WorkspaceConfiguration>
-    <WorkspaceConfiguration Name="Release" Selected="no">
-      <Project Name="fdmdv2" ConfigName="Release"/>
-      <Project Name="rawbits" ConfigName="Release"/>
-      <Project Name="pa_enum" ConfigName="Release"/>
-      <Project Name="appWithDlg" ConfigName="Release"/>
-      <Project Name="dialogTest" ConfigName="Release"/>
-      <Project Name="bigButtonRig" ConfigName="Release"/>
-      <Project Name="enumSerial" ConfigName="Release"/>
-      <Project Name="hamlib_trial" ConfigName="Release"/>
-    </WorkspaceConfiguration>
-  </BuildMatrix>
-</CodeLite_Workspace>
diff --git a/fdmdv2/branches/0.97/build/codelite/fdmdv2_copyright_block.txt b/fdmdv2/branches/0.97/build/codelite/fdmdv2_copyright_block.txt
deleted file mode 100644 (file)
index 785ec41..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-//==========================================================================\r
-// Name:\r
-// Purpose:\r
-// Created:         June 22, 2012
-// Initial author:  David Witten\r
-// Derived from:\r
-// License:\r
-//\r
-//  Copyright (C) 2012 David Witten
-//
-//  All rights reserved.
-//
-//  This program is free software; you can redistribute it and/or modify
-//  it under the terms of the GNU Lesser 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 Lesser General Public License
-//  along with this program; if not, see <http://www.gnu.org/licenses/>.
-//
-//==========================================================================\r
diff --git a/fdmdv2/branches/0.97/build/codelite/fdmdv2_wsp.mk b/fdmdv2/branches/0.97/build/codelite/fdmdv2_wsp.mk
deleted file mode 100644 (file)
index 4226245..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-.PHONY: clean All
-
-All:
-       @echo "----------Building project:[ fdmdv2 - Debug ]----------"
-       @$(MAKE) -f  "fdmdv2.mk"
-clean:
-       @echo "----------Cleaning project:[ fdmdv2 - Debug ]----------"
-       @$(MAKE) -f  "fdmdv2.mk" clean
diff --git a/fdmdv2/branches/0.97/build/codelite/hamlib_trial/MainFrame.cpp b/fdmdv2/branches/0.97/build/codelite/hamlib_trial/MainFrame.cpp
deleted file mode 100644 (file)
index c0fae92..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-#include "main.h"
-#include "MainFrame.h"
-#include <wx/aboutdlg.h>
-#include "dlg_rig_ctrl.h"
-
-MainFrame::MainFrame(wxWindow* parent): MainFrameBaseClass(parent)
-{
-    wxConfigBase *pConfig = wxConfigBase::Get();
-    if(pConfig)
-    {
-        pConfig->SetRecordDefaults();
-
-        // 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);
-
-        Move(x, y);
-        SetClientSize(w, h);
-    }
-}
-
-MainFrame::~MainFrame()
-{
-    int x;
-    int y;
-    int w;
-    int h;
-
-    wxConfigBase *pConfig = wxConfigBase::Get();
-    if(pConfig)
-    {
-        GetClientSize(&w, &h);
-        GetPosition(&x, &y);
-        //wxLogDebug("x = %d y = %d w = %d h = %d\n", x,y,w,h);
-        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);
-    }
-    delete wxConfigBase::Set((wxConfigBase *) NULL);
-}
-
-void MainFrame::OnExit(wxCommandEvent& event)
-{
-    wxUnusedVar(event);
-    Close();
-}
-
-void MainFrame::OnAbout(wxCommandEvent& event)
-{
-    wxUnusedVar(event);
-    wxAboutDialogInfo info;
-    info.SetCopyright(_("HAMLib Test"));
-    info.SetLicence(_("GPL v2 or later"));
-    info.SetDescription(_("Short description goes here"));
-    ::wxAboutBox(info);
-}
-
-void MainFrame::OnNew(wxCommandEvent& event)
-{
-}
-
-void MainFrame::OnOpen(wxCommandEvent& event)
-{
-}
-
-void MainFrame::OnSize(wxSizeEvent& event)
-{
-}
-
-void MainFrame::OnToolsPrefs(wxCommandEvent& event)
-{
-    wxUnusedVar(event);
-    DlgRigCtrlBase *dlg = new DlgRigCtrlBase(NULL);
-    //int rVal = dlg
-    dlg->ShowModal();
-    delete dlg;
-}
diff --git a/fdmdv2/branches/0.97/build/codelite/hamlib_trial/MainFrame.h b/fdmdv2/branches/0.97/build/codelite/hamlib_trial/MainFrame.h
deleted file mode 100644 (file)
index 2797db0..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-#ifndef MAINFRAME_H
-#define MAINFRAME_H
-#include "wxcrafter.h"
-
-class MainFrame : public MainFrameBaseClass
-{
-public:
-    MainFrame(wxWindow* parent);
-    virtual ~MainFrame();
-
-    void OnExit(wxCommandEvent& event);
-    void OnAbout(wxCommandEvent& event);
-protected:
-    virtual void OnToolsPrefs(wxCommandEvent& event);
-    virtual void OnNew(wxCommandEvent& event);
-    virtual void OnOpen(wxCommandEvent& event);
-    virtual void OnSize(wxSizeEvent& event);
-};
-#endif // MAINFRAME_H
diff --git a/fdmdv2/branches/0.97/build/codelite/hamlib_trial/dlg_rig_ctrl.cpp b/fdmdv2/branches/0.97/build/codelite/hamlib_trial/dlg_rig_ctrl.cpp
deleted file mode 100644 (file)
index 82ba665..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#include "dlg_rig_ctrl.h"
-
-DialogRigCtrl::DialogRigCtrl(wxWindow* parent) : DlgRigCtrlBase(parent)
-{
-}
-
-DialogRigCtrl::~DialogRigCtrl()
-{
-}
-
diff --git a/fdmdv2/branches/0.97/build/codelite/hamlib_trial/dlg_rig_ctrl.h b/fdmdv2/branches/0.97/build/codelite/hamlib_trial/dlg_rig_ctrl.h
deleted file mode 100644 (file)
index 88f2f88..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef DIALOGRIGCTRL_H
-#define DIALOGRIGCTRL_H
-#include "wxcrafter.h"
-
-class DialogRigCtrl : public DlgRigCtrlBase
-{
-public:
-    DialogRigCtrl(wxWindow* parent);
-    virtual ~DialogRigCtrl();
-};
-#endif // DIALOGRIGCTRL_H
diff --git a/fdmdv2/branches/0.97/build/codelite/hamlib_trial/hamlib_trial.mk b/fdmdv2/branches/0.97/build/codelite/hamlib_trial/hamlib_trial.mk
deleted file mode 100644 (file)
index c5ffaba..0000000
+++ /dev/null
@@ -1,162 +0,0 @@
-##\r
-## Auto Generated makefile by CodeLite IDE\r
-## any manual changes will be erased      \r
-##\r
-## Debug\r
-ProjectName            :=hamlib_trial\r
-ConfigurationName      :=Debug\r
-WorkspacePath          := "D:\Projects\Radio\fdmdv2\build\codelite"\r
-ProjectPath            := "D:\Projects\Radio\fdmdv2\build\codelite\hamlib_trial"\r
-IntermediateDirectory  :=./Debug\r
-OutDir                 := $(IntermediateDirectory)\r
-CurrentFileName        :=\r
-CurrentFilePath        :=\r
-CurrentFileFullPath    :=\r
-User                   :=wittend\r
-Date                   :=5/6/2013\r
-CodeLitePath           :="D:\bin\CodeLite"\r
-LinkerName             :=g++\r
-SharedObjectLinkerName :=g++ -shared -fPIC\r
-ObjectSuffix           :=.o\r
-DependSuffix           :=.o.d\r
-PreprocessSuffix       :=.o.i\r
-DebugSwitch            :=-gstab\r
-IncludeSwitch          :=-I\r
-LibrarySwitch          :=-l\r
-OutputSwitch           :=-o \r
-LibraryPathSwitch      :=-L\r
-PreprocessorSwitch     :=-D\r
-SourceSwitch           :=-c \r
-OutputFile             :=$(IntermediateDirectory)/$(ProjectName)\r
-Preprocessors          :=\r
-ObjectSwitch           :=-o \r
-ArchiveOutputSwitch    := \r
-PreprocessOnlySwitch   :=-E \r
-ObjectsFileList        :="hamlib_trial.txt"\r
-PCHCompileFlags        :=\r
-MakeDirCommand         :=makedir\r
-RcCmpOptions           := $(shell wx-config --rcflags)\r
-RcCompilerName         :=windres\r
-LinkOptions            :=  $(shell wx-config --libs --debug) -mwindows\r
-IncludePath            :=  $(IncludeSwitch). $(IncludeSwitch). \r
-IncludePCH             := \r
-RcIncludePath          := \r
-Libs                   := \r
-ArLibs                 :=  \r
-LibPath                := $(LibraryPathSwitch). \r
-\r
-##\r
-## Common variables\r
-## AR, CXX, CC, CXXFLAGS and CFLAGS can be overriden using an environment variables\r
-##\r
-AR       := ar rcus\r
-CXX      := g++\r
-CC       := gcc\r
-CXXFLAGS :=  -g -O0 -Wall $(shell wx-config --cflags --debug)  -DSVN_REVISION=\"1237\"  $(Preprocessors)\r
-CFLAGS   :=  -g -O0 -Wall  -DSVN_REVISION=\"1237\"  $(Preprocessors)\r
-\r
-\r
-##\r
-## User defined environment variables\r
-##\r
-CodeLiteDir:=D:\bin\CodeLite\r
-WXWIN:=D:\bin\wxWidgets-2.9.4\r
-PATH:=$(WXWIN)\lib\gcc_dll;$(PATH)\r
-WXCFG:=gcc_dll\mswu\r
-UNIT_TEST_PP_SRC_DIR:=D:\bin\UnitTest++1.3\r
-Objects0=$(IntermediateDirectory)/main$(ObjectSuffix) $(IntermediateDirectory)/MainFrame$(ObjectSuffix) $(IntermediateDirectory)/wxcrafter$(ObjectSuffix) $(IntermediateDirectory)/wxcrafter_bitmaps$(ObjectSuffix) $(IntermediateDirectory)/win_resources.rc$(ObjectSuffix) $(IntermediateDirectory)/dlg_rig_ctrl$(ObjectSuffix) \r
-\r
-\r
-\r
-Objects=$(Objects0) \r
-\r
-##\r
-## Main Build Targets \r
-##\r
-.PHONY: all clean PreBuild PrePreBuild PostBuild\r
-all: $(OutputFile)\r
-\r
-$(OutputFile): $(IntermediateDirectory)/.d $(Objects) \r
-       @$(MakeDirCommand) $(@D)\r
-       @echo "" > $(IntermediateDirectory)/.d\r
-       @echo $(Objects0)  > $(ObjectsFileList)\r
-       $(LinkerName) $(OutputSwitch)$(OutputFile) @$(ObjectsFileList) $(LibPath) $(Libs) $(LinkOptions)\r
-\r
-$(IntermediateDirectory)/.d:\r
-       @$(MakeDirCommand) "./Debug"\r
-\r
-PreBuild:\r
-\r
-\r
-##\r
-## Objects\r
-##\r
-$(IntermediateDirectory)/main$(ObjectSuffix): main.cpp $(IntermediateDirectory)/main$(DependSuffix)\r
-       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/build/codelite/hamlib_trial/main.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/main$(ObjectSuffix) $(IncludePath)\r
-$(IntermediateDirectory)/main$(DependSuffix): main.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/main$(ObjectSuffix) -MF$(IntermediateDirectory)/main$(DependSuffix) -MM "main.cpp"\r
-\r
-$(IntermediateDirectory)/main$(PreprocessSuffix): main.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/main$(PreprocessSuffix) "main.cpp"\r
-\r
-$(IntermediateDirectory)/MainFrame$(ObjectSuffix): MainFrame.cpp $(IntermediateDirectory)/MainFrame$(DependSuffix)\r
-       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/build/codelite/hamlib_trial/MainFrame.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/MainFrame$(ObjectSuffix) $(IncludePath)\r
-$(IntermediateDirectory)/MainFrame$(DependSuffix): MainFrame.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/MainFrame$(ObjectSuffix) -MF$(IntermediateDirectory)/MainFrame$(DependSuffix) -MM "MainFrame.cpp"\r
-\r
-$(IntermediateDirectory)/MainFrame$(PreprocessSuffix): MainFrame.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/MainFrame$(PreprocessSuffix) "MainFrame.cpp"\r
-\r
-$(IntermediateDirectory)/wxcrafter$(ObjectSuffix): wxcrafter.cpp $(IntermediateDirectory)/wxcrafter$(DependSuffix)\r
-       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/build/codelite/hamlib_trial/wxcrafter.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/wxcrafter$(ObjectSuffix) $(IncludePath)\r
-$(IntermediateDirectory)/wxcrafter$(DependSuffix): wxcrafter.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/wxcrafter$(ObjectSuffix) -MF$(IntermediateDirectory)/wxcrafter$(DependSuffix) -MM "wxcrafter.cpp"\r
-\r
-$(IntermediateDirectory)/wxcrafter$(PreprocessSuffix): wxcrafter.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/wxcrafter$(PreprocessSuffix) "wxcrafter.cpp"\r
-\r
-$(IntermediateDirectory)/wxcrafter_bitmaps$(ObjectSuffix): wxcrafter_bitmaps.cpp $(IntermediateDirectory)/wxcrafter_bitmaps$(DependSuffix)\r
-       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/build/codelite/hamlib_trial/wxcrafter_bitmaps.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/wxcrafter_bitmaps$(ObjectSuffix) $(IncludePath)\r
-$(IntermediateDirectory)/wxcrafter_bitmaps$(DependSuffix): wxcrafter_bitmaps.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/wxcrafter_bitmaps$(ObjectSuffix) -MF$(IntermediateDirectory)/wxcrafter_bitmaps$(DependSuffix) -MM "wxcrafter_bitmaps.cpp"\r
-\r
-$(IntermediateDirectory)/wxcrafter_bitmaps$(PreprocessSuffix): wxcrafter_bitmaps.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/wxcrafter_bitmaps$(PreprocessSuffix) "wxcrafter_bitmaps.cpp"\r
-\r
-$(IntermediateDirectory)/win_resources.rc$(ObjectSuffix): win_resources.rc\r
-       $(RcCompilerName) -i "D:/Projects/Radio/fdmdv2/build/codelite/hamlib_trial/win_resources.rc" $(RcCmpOptions)   $(ObjectSwitch)$(IntermediateDirectory)/win_resources.rc$(ObjectSuffix) $(RcIncludePath)\r
-$(IntermediateDirectory)/dlg_rig_ctrl$(ObjectSuffix): dlg_rig_ctrl.cpp $(IntermediateDirectory)/dlg_rig_ctrl$(DependSuffix)\r
-       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/build/codelite/hamlib_trial/dlg_rig_ctrl.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/dlg_rig_ctrl$(ObjectSuffix) $(IncludePath)\r
-$(IntermediateDirectory)/dlg_rig_ctrl$(DependSuffix): dlg_rig_ctrl.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/dlg_rig_ctrl$(ObjectSuffix) -MF$(IntermediateDirectory)/dlg_rig_ctrl$(DependSuffix) -MM "dlg_rig_ctrl.cpp"\r
-\r
-$(IntermediateDirectory)/dlg_rig_ctrl$(PreprocessSuffix): dlg_rig_ctrl.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/dlg_rig_ctrl$(PreprocessSuffix) "dlg_rig_ctrl.cpp"\r
-\r
-\r
--include $(IntermediateDirectory)/*$(DependSuffix)\r
-##\r
-## Clean\r
-##\r
-clean:\r
-       $(RM) $(IntermediateDirectory)/main$(ObjectSuffix)\r
-       $(RM) $(IntermediateDirectory)/main$(DependSuffix)\r
-       $(RM) $(IntermediateDirectory)/main$(PreprocessSuffix)\r
-       $(RM) $(IntermediateDirectory)/MainFrame$(ObjectSuffix)\r
-       $(RM) $(IntermediateDirectory)/MainFrame$(DependSuffix)\r
-       $(RM) $(IntermediateDirectory)/MainFrame$(PreprocessSuffix)\r
-       $(RM) $(IntermediateDirectory)/wxcrafter$(ObjectSuffix)\r
-       $(RM) $(IntermediateDirectory)/wxcrafter$(DependSuffix)\r
-       $(RM) $(IntermediateDirectory)/wxcrafter$(PreprocessSuffix)\r
-       $(RM) $(IntermediateDirectory)/wxcrafter_bitmaps$(ObjectSuffix)\r
-       $(RM) $(IntermediateDirectory)/wxcrafter_bitmaps$(DependSuffix)\r
-       $(RM) $(IntermediateDirectory)/wxcrafter_bitmaps$(PreprocessSuffix)\r
-       $(RM) $(IntermediateDirectory)/win_resources.rc$(ObjectSuffix)\r
-       $(RM) $(IntermediateDirectory)/dlg_rig_ctrl$(ObjectSuffix)\r
-       $(RM) $(IntermediateDirectory)/dlg_rig_ctrl$(DependSuffix)\r
-       $(RM) $(IntermediateDirectory)/dlg_rig_ctrl$(PreprocessSuffix)\r
-       $(RM) $(OutputFile)\r
-       $(RM) $(OutputFile).exe\r
-       $(RM) "../.build-debug/hamlib_trial"\r
-\r
-\r
diff --git a/fdmdv2/branches/0.97/build/codelite/hamlib_trial/hamlib_trial.project b/fdmdv2/branches/0.97/build/codelite/hamlib_trial/hamlib_trial.project
deleted file mode 100644 (file)
index 1217de4..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<CodeLite_Project Name="hamlib_trial" InternalType="GUI">
-  <Plugins>
-    <Plugin Name="qmake">
-      <![CDATA[00010001N0007Release000000000000]]>
-    </Plugin>
-  </Plugins>
-  <Description/>
-  <Dependencies/>
-  <VirtualDirectory Name="src">
-    <File Name="main.cpp"/>
-    <File Name="MainFrame.cpp"/>
-    <File Name="wxcrafter.cpp"/>
-    <File Name="wxcrafter_bitmaps.cpp"/>
-  </VirtualDirectory>
-  <VirtualDirectory Name="include">
-    <File Name="MainFrame.h"/>
-    <File Name="wxcrafter.h"/>
-    <File Name="main.h"/>
-  </VirtualDirectory>
-  <VirtualDirectory Name="resources">
-    <File Name="wxcrafter.wxcp"/>
-    <File Name="win_resources.rc"/>
-  </VirtualDirectory>
-  <Dependencies Name="Debug"/>
-  <Dependencies Name="Release"/>
-  <Settings Type="Executable">
-    <GlobalSettings>
-      <Compiler Options="" C_Options="">
-        <IncludePath Value="."/>
-      </Compiler>
-      <Linker Options="">
-        <LibraryPath Value="."/>
-      </Linker>
-      <ResourceCompiler Options=""/>
-    </GlobalSettings>
-    <Configuration Name="Debug" CompilerType="gnu g++" DebuggerType="GNU gdb debugger" Type="Executable" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append">
-      <Compiler Options="-g;-O0;-Wall;$(shell wx-config --cflags --debug)" C_Options="-g;-O0;-Wall" Required="yes" PreCompiledHeader="" PCHInCommandLine="no" UseDifferentPCHFlags="no" PCHFlags="">
-        <IncludePath Value="."/>
-      </Compiler>
-      <Linker Options="$(shell wx-config --libs --debug);-mwindows" Required="yes"/>
-      <ResourceCompiler Options="$(shell wx-config --rcflags)" Required="no"/>
-      <General OutputFile="$(IntermediateDirectory)/$(ProjectName)" IntermediateDirectory="./Debug" Command="./$(ProjectName)" CommandArguments="" UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="no"/>
-      <Environment EnvVarSetName="&lt;Use Defaults&gt;" DbgSetName="&lt;Use Defaults&gt;">
-        <![CDATA[]]>
-      </Environment>
-      <Debugger IsRemote="no" RemoteHostName="" RemoteHostPort="" DebuggerPath="">
-        <PostConnectCommands/>
-        <StartupCommands/>
-      </Debugger>
-      <PreBuild/>
-      <PostBuild/>
-      <CustomBuild Enabled="no">
-        <RebuildCommand/>
-        <CleanCommand/>
-        <BuildCommand/>
-        <PreprocessFileCommand/>
-        <SingleFileCommand/>
-        <MakefileGenerationCommand/>
-        <ThirdPartyToolName>None</ThirdPartyToolName>
-        <WorkingDirectory/>
-      </CustomBuild>
-      <AdditionalRules>
-        <CustomPostBuild/>
-        <CustomPreBuild/>
-      </AdditionalRules>
-      <Completion EnableCpp11="no">
-        <ClangCmpFlagsC/>
-        <ClangCmpFlags/>
-        <ClangPP/>
-        <SearchPaths/>
-      </Completion>
-    </Configuration>
-    <Configuration Name="Release" CompilerType="gnu g++" DebuggerType="GNU gdb debugger" Type="Executable" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append">
-      <Compiler Options="-O2;-Wall;$(shell wx-config --cflags)" C_Options="-O2;-Wall" Required="yes" PreCompiledHeader="" PCHInCommandLine="no" UseDifferentPCHFlags="no" PCHFlags="">
-        <IncludePath Value="."/>
-        <IncludePath Value="D:/Projects/Radio/fdmdv2/build/codelite/hamlib-win32-1.2.15.3/include/hamlib"/>
-        <IncludePath Value="D:\Projects\Radio\fdmdv2\build\codelite\hamlib-win32-1.2.15.3\include"/>
-      </Compiler>
-      <Linker Options="$(shell wx-config --libs);-mwindows" Required="yes"/>
-      <ResourceCompiler Options="$(shell wx-config --rcflags)" Required="no"/>
-      <General OutputFile="$(IntermediateDirectory)/$(ProjectName)" IntermediateDirectory="./Release" Command="./$(ProjectName)" CommandArguments="" UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="no"/>
-      <Environment EnvVarSetName="&lt;Use Defaults&gt;" DbgSetName="&lt;Use Defaults&gt;">
-        <![CDATA[]]>
-      </Environment>
-      <Debugger IsRemote="no" RemoteHostName="" RemoteHostPort="" DebuggerPath="">
-        <PostConnectCommands/>
-        <StartupCommands/>
-      </Debugger>
-      <PreBuild/>
-      <PostBuild/>
-      <CustomBuild Enabled="no">
-        <RebuildCommand/>
-        <CleanCommand/>
-        <BuildCommand/>
-        <PreprocessFileCommand/>
-        <SingleFileCommand/>
-        <MakefileGenerationCommand/>
-        <ThirdPartyToolName>None</ThirdPartyToolName>
-        <WorkingDirectory/>
-      </CustomBuild>
-      <AdditionalRules>
-        <CustomPostBuild/>
-        <CustomPreBuild/>
-      </AdditionalRules>
-      <Completion EnableCpp11="no">
-        <ClangCmpFlagsC/>
-        <ClangCmpFlags/>
-        <ClangPP/>
-        <SearchPaths/>
-      </Completion>
-    </Configuration>
-  </Settings>
-  <VirtualDirectory Name="rig_ctrl">
-    <File Name="dlg_rig_ctrl.h"/>
-    <File Name="dlg_rig_ctrl.cpp"/>
-  </VirtualDirectory>
-  <VirtualDirectory Name="wxcrafter">
-    <VirtualDirectory Name="XRC">
-      <File Name="wxcrafter.xrc"/>
-    </VirtualDirectory>
-  </VirtualDirectory>
-</CodeLite_Project>
diff --git a/fdmdv2/branches/0.97/build/codelite/hamlib_trial/hamlib_trial.txt b/fdmdv2/branches/0.97/build/codelite/hamlib_trial/hamlib_trial.txt
deleted file mode 100644 (file)
index 2ade1a7..0000000
+++ /dev/null
@@ -1 +0,0 @@
-./Release/main.o ./Release/MainFrame.o ./Release/wxcrafter.o ./Release/wxcrafter_bitmaps.o ./Release/win_resources.rc.o ./Release/dlg_rig_ctrl.o   \r
diff --git a/fdmdv2/branches/0.97/build/codelite/hamlib_trial/main.cpp b/fdmdv2/branches/0.97/build/codelite/hamlib_trial/main.cpp
deleted file mode 100644 (file)
index 56eb165..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#include "main.h"
-#include "MainFrame.h"
-
-IMPLEMENT_APP(MainApp)
-
-bool MainApp::OnInit()
-{
-    // Add the common image handlers
-    wxImage::AddHandler( new wxPNGHandler );
-    wxImage::AddHandler( new wxJPEGHandler );
-
-    SetVendorName(wxT("CODEC2-Project"));
-    SetAppName(wxT("Hamlib test"));
-
-    wxConfig *pConfig = new wxConfig();
-    wxFileConfig *pFConfig = new wxFileConfig(wxT("visiWidgits"), wxT("WWR Development"), wxT("visiWidgits.conf"), wxT("visiWidgits.conf"),  wxCONFIG_USE_LOCAL_FILE | wxCONFIG_USE_RELATIVE_PATH);
-    pConfig->Set(pFConfig);
-    pConfig->SetRecordDefaults();
-
-
-    MainFrame *mainFrame = new MainFrame(NULL);
-    SetTopWindow(mainFrame);
-    return GetTopWindow()->Show();
-}
diff --git a/fdmdv2/branches/0.97/build/codelite/hamlib_trial/main.h b/fdmdv2/branches/0.97/build/codelite/hamlib_trial/main.h
deleted file mode 100644 (file)
index 424bde9..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-//==========================================================================
-// Name:            main.h
-//
-// Purpose:         Inclusions and constants for the entire visiWidgets program.
-// Created:         Mar. 01, 2013
-// Authors:         David Witten
-//
-// License:
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this program; if not, see <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#ifndef __HAMLIBTRIAL_MAIN__
-#define __HAMLIBTRIAL_MAIN__
-
-#include <wx/wx.h>
-#include <wx/aui/framemanager.h>
-#include <wx/app.h>
-#include <wx/event.h>
-#include "wx/file.h"
-#include "wx/filename.h"
-#include "wx/config.h"
-#include <wx/fileconf.h>
-#include <wx/image.h>
-
-#include "MainFrame.h"
-
-#include "rig.h"
-#include "rig_dll.h"
-#include "riglist.h"
-#include "rotator.h"
-#include "rotlist.h"
-
-#if defined(__WINDOWS__)
-#undef wxUSE_CONFIG_NATIVE
-#endif
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class MainApp
-//
-// @class $(Name)
-// @author $(User)
-// @date $(Date)
-// @file $(CurrentFileName).$(CurrentFileExt)
-// @brief
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Define the MainApp
-class MainApp : public wxApp
-{
-public:
-    MainApp() {}
-    virtual ~MainApp() {}
-
-    virtual bool OnInit();
-};
-
-DECLARE_APP(MainApp)
-//IMPLEMENT_APP(MainApp)
-
-#endif //__HAMLIBTRIAL_MAIN__
diff --git a/fdmdv2/branches/0.97/build/codelite/hamlib_trial/win_resources.rc b/fdmdv2/branches/0.97/build/codelite/hamlib_trial/win_resources.rc
deleted file mode 100644 (file)
index fa70c15..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#include "wx/msw/wx.rc"\r
-1 24 "wx/msw/wx.manifest"\r
diff --git a/fdmdv2/branches/0.97/build/codelite/hamlib_trial/wxcrafter.cpp b/fdmdv2/branches/0.97/build/codelite/hamlib_trial/wxcrafter.cpp
deleted file mode 100644 (file)
index 4195f37..0000000
+++ /dev/null
@@ -1,754 +0,0 @@
-//////////////////////////////////////////////////////////////////////
-// This file was auto-generated by codelite's wxCrafter Plugin
-// Do not modify this file by hand!
-//////////////////////////////////////////////////////////////////////
-
-#include "wxcrafter.h"
-
-
-// Declare the bitmap loading function
-extern void wxC9ED9InitBitmapResources();
-
-static bool bBitmapLoaded = false;
-
-
-MainFrameBaseClass::MainFrameBaseClass(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style)
-    : wxFrame(parent, id, title, pos, size, style)
-{
-    if ( !bBitmapLoaded ) {
-        // We need to initialise the default bitmap handler
-        wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler);
-        wxC9ED9InitBitmapResources();
-        bBitmapLoaded = true;
-    }
-    
-    wxBoxSizer* boxSizer1 = new wxBoxSizer(wxVERTICAL);
-    this->SetSizer(boxSizer1);
-    
-    m_mainPanel = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), wxTAB_TRAVERSAL);
-    
-    boxSizer1->Add(m_mainPanel, 1, wxEXPAND, 5);
-    
-    wxBoxSizer* boxSizer33 = new wxBoxSizer(wxVERTICAL);
-    m_mainPanel->SetSizer(boxSizer33);
-    
-    m_menuBar = new wxMenuBar(0);
-    this->SetMenuBar(m_menuBar);
-    
-    m_mbFile = new wxMenu();
-    m_menuBar->Append(m_mbFile, _("File"));
-    
-    m_mbiNew = new wxMenuItem(m_mbFile, wxID_NEW, _("New"), wxT(""), wxITEM_NORMAL);
-    m_mbFile->Append(m_mbiNew);
-    
-    m_mbiOpen = new wxMenuItem(m_mbFile, wxID_OPEN, _("Open"), wxT(""), wxITEM_NORMAL);
-    m_mbFile->Append(m_mbiOpen);
-    
-    m_mbiSave = new wxMenuItem(m_mbFile, wxID_SAVE, _("Save"), wxT(""), wxITEM_NORMAL);
-    m_mbFile->Append(m_mbiSave);
-    
-    m_mbiSaveAs = new wxMenuItem(m_mbFile, wxID_SAVEAS, _("Save As"), wxT(""), wxITEM_NORMAL);
-    m_mbFile->Append(m_mbiSaveAs);
-    
-    m_mbFile->AppendSeparator();
-    
-    m_mbiExit = new wxMenuItem(m_mbFile, wxID_EXIT, _("Exit    Alt-X"), _("Quit"), wxITEM_NORMAL);
-    m_mbFile->Append(m_mbiExit);
-    
-    m_mbTools = new wxMenu();
-    m_menuBar->Append(m_mbTools, _("Tools"));
-    
-    m_mbiPrefs = new wxMenuItem(m_mbTools, wxID_PREFERENCES, _("Preferences"), wxT(""), wxITEM_NORMAL);
-    m_mbTools->Append(m_mbiPrefs);
-    
-    m_mbHelp = new wxMenu();
-    m_menuBar->Append(m_mbHelp, _("Help"));
-    
-    m_menuItem9 = new wxMenuItem(m_mbHelp, wxID_ABOUT, _("About..."), wxT(""), wxITEM_NORMAL);
-    m_mbHelp->Append(m_menuItem9);
-    
-    m_mainToolbar = this->CreateToolBar(wxTB_FLAT, wxID_ANY);
-    m_mainToolbar->SetToolBitmapSize(wxSize(16,16));
-    
-    m_mainToolbar->AddTool(wxID_NEW, _("New"), wxXmlResource::Get()->LoadBitmap(wxT("placeholder16")), wxNullBitmap, wxITEM_NORMAL, _("New"), _("New"), NULL);
-    
-    m_mainToolbar->AddTool(wxID_OPEN, _("Tool Label"), wxXmlResource::Get()->LoadBitmap(wxT("placeholder16")), wxNullBitmap, wxITEM_NORMAL, _("Open"), _("Open"), NULL);
-    m_mainToolbar->Realize();
-    
-    
-    SetSizeHints(500,300);
-    if ( GetSizer() ) {
-         GetSizer()->Fit(this);
-    }
-    Centre(wxBOTH);
-    // Connect events
-    m_mainPanel->Connect(wxEVT_SIZE, wxSizeEventHandler(MainFrameBaseClass::OnSize), NULL, this);
-    this->Connect(m_mbiExit->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrameBaseClass::OnExit), NULL, this);
-    this->Connect(m_mbiPrefs->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrameBaseClass::OnToolsPrefs), NULL, this);
-    this->Connect(m_menuItem9->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrameBaseClass::OnAbout), NULL, this);
-    this->Connect(wxID_NEW, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(MainFrameBaseClass::OnNew), NULL, this);
-    this->Connect(wxID_OPEN, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(MainFrameBaseClass::OnOpen), NULL, this);
-    
-}
-
-MainFrameBaseClass::~MainFrameBaseClass()
-{
-    m_mainPanel->Disconnect(wxEVT_SIZE, wxSizeEventHandler(MainFrameBaseClass::OnSize), NULL, this);
-    this->Disconnect(m_mbiExit->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrameBaseClass::OnExit), NULL, this);
-    this->Disconnect(m_mbiPrefs->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrameBaseClass::OnToolsPrefs), NULL, this);
-    this->Disconnect(m_menuItem9->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrameBaseClass::OnAbout), NULL, this);
-    this->Disconnect(wxID_NEW, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(MainFrameBaseClass::OnNew), NULL, this);
-    this->Disconnect(wxID_OPEN, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(MainFrameBaseClass::OnOpen), NULL, this);
-    
-}
-
-DlgRigCtrlBase::DlgRigCtrlBase(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style)
-    : wxDialog(parent, id, title, pos, size, style)
-{
-    if ( !bBitmapLoaded ) {
-        // We need to initialise the default bitmap handler
-        wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler);
-        wxC9ED9InitBitmapResources();
-        bBitmapLoaded = true;
-    }
-    
-    wxBoxSizer* boxSizer51 = new wxBoxSizer(wxVERTICAL);
-    this->SetSizer(boxSizer51);
-    
-    m_notebook53 = new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxSize(-1, -1), wxBK_DEFAULT);
-    
-    boxSizer51->Add(m_notebook53, 1, wxALL|wxEXPAND, 2);
-    
-    m_panelHDWPTT = new wxPanel(m_notebook53, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), wxTAB_TRAVERSAL);
-    m_panelHDWPTT->SetToolTip(_("Hardware Push-to-Talk"));
-    m_notebook53->AddPage(m_panelHDWPTT, _("Hardware PTT"), true);
-    
-    wxFlexGridSizer* flexGridSizer135 = new wxFlexGridSizer(  3, 1, 0, 0);
-    flexGridSizer135->SetFlexibleDirection( wxBOTH );
-    flexGridSizer135->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
-    flexGridSizer135->AddGrowableCol(1);
-    flexGridSizer135->AddGrowableRow(3);
-    m_panelHDWPTT->SetSizer(flexGridSizer135);
-    
-    wxStaticBoxSizer* staticBoxSizer169 = new wxStaticBoxSizer( new wxStaticBox(m_panelHDWPTT, wxID_ANY, wxT("")), wxVERTICAL);
-    
-    flexGridSizer135->Add(staticBoxSizer169, 0, wxALL|wxEXPAND, 2);
-    
-    m_checkBox7537 = new wxCheckBox(m_panelHDWPTT, wxID_ANY, _("PTT tone on right audio channel"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_checkBox7537->SetValue(false);
-    
-    staticBoxSizer169->Add(m_checkBox7537, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 2);
-    
-    wxGridSizer* gridSizer159 = new wxGridSizer(  1, 1, 0, 0);
-    
-    flexGridSizer135->Add(gridSizer159, 0, wxALL|wxALIGN_LEFT|wxALIGN_TOP, 2);
-    
-    wxStaticBoxSizer* staticBoxSizer157 = new wxStaticBoxSizer( new wxStaticBox(m_panelHDWPTT, wxID_ANY, _("h/w ptt device pin")), wxHORIZONTAL);
-    
-    gridSizer159->Add(staticBoxSizer157, 0, wxALL|wxEXPAND|wxALIGN_TOP, 2);
-    
-    wxBoxSizer* boxSizer175 = new wxBoxSizer(wxVERTICAL);
-    
-    staticBoxSizer157->Add(boxSizer175, 1, wxALL, 2);
-    
-    m_checkBox9112 = new wxCheckBox(m_panelHDWPTT, wxID_ANY, _("Use separate PTT device pin"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_checkBox9112->SetValue(false);
-    
-    boxSizer175->Add(m_checkBox9112, 0, wxALL|wxALIGN_TOP, 2);
-    
-    m_staticText173 = new wxStaticText(m_panelHDWPTT, wxID_ANY, _("Device:"), wxDefaultPosition, wxSize(-1,-1), 0);
-    
-    boxSizer175->Add(m_staticText173, 0, wxALL, 5);
-    
-    wxArrayString m_comboBox9313Arr;
-    m_comboBox9313 = new wxComboBox(m_panelHDWPTT, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1,-1), m_comboBox9313Arr, 0);
-    
-    boxSizer175->Add(m_comboBox9313, 0, wxALL, 2);
-    
-    wxBoxSizer* boxSizer171 = new wxBoxSizer(wxHORIZONTAL);
-    
-    staticBoxSizer157->Add(boxSizer171, 1, wxALL, 2);
-    
-    wxBoxSizer* boxSizer12714 = new wxBoxSizer(wxVERTICAL);
-    
-    boxSizer171->Add(boxSizer12714, 1, wxALL|wxALIGN_CENTER_HORIZONTAL, 2);
-    
-    wxArrayString m_radioBox10115Arr;
-    m_radioBox10115Arr.Add(wxT("Normal (V-)"));
-    m_radioBox10115Arr.Add(wxT("Inverted (V+)"));
-    m_radioBox10115 = new wxRadioBox(m_panelHDWPTT, wxID_ANY, _("Use RTS"), wxDefaultPosition, wxSize(-1,-1), m_radioBox10115Arr, 2, wxRA_SPECIFY_COLS);
-    m_radioBox10115->SetSelection(0);
-    
-    boxSizer12714->Add(m_radioBox10115, 1, wxALL|wxALIGN_CENTER_HORIZONTAL, 2);
-    
-    wxArrayString m_radioBox10316Arr;
-    m_radioBox10316Arr.Add(wxT("Normal (V-)"));
-    m_radioBox10316Arr.Add(wxT("Inverted (V+)"));
-    m_radioBox10316 = new wxRadioBox(m_panelHDWPTT, wxID_ANY, _("Use DTR"), wxDefaultPosition, wxSize(-1,-1), m_radioBox10316Arr, 2, wxRA_SPECIFY_COLS);
-    m_radioBox10316->SetSelection(0);
-    
-    boxSizer12714->Add(m_radioBox10316, 1, wxALL|wxALIGN_CENTER_HORIZONTAL, 2);
-    
-    wxBoxSizer* boxSizer13118 = new wxBoxSizer(wxHORIZONTAL);
-    
-    boxSizer12714->Add(boxSizer13118, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 2);
-    
-    m_button11319 = new wxButton(m_panelHDWPTT, wxID_ANY, _("Initialize"), wxDefaultPosition, wxSize(-1,-1), 0);
-    
-    boxSizer13118->Add(m_button11319, 1, wxALL, 2);
-    
-    wxStaticBoxSizer* staticBoxSizer79420 = new wxStaticBoxSizer( new wxStaticBox(m_panelHDWPTT, wxID_ANY, _("PTT delay for all CAT/PTT types")), wxHORIZONTAL);
-    
-    flexGridSizer135->Add(staticBoxSizer79420, 0, wxALL|wxEXPAND|wxALIGN_LEFT, 2);
-    
-    m_staticText177 = new wxStaticText(m_panelHDWPTT, wxID_ANY, _("Start of xmit delay"), wxDefaultPosition, wxSize(-1,-1), 0);
-    
-    staticBoxSizer79420->Add(m_staticText177, 0, wxALL|wxALIGN_CENTER_VERTICAL, 2);
-    
-    m_slider10721 = new wxSlider(m_panelHDWPTT, wxID_ANY, 50, 0, 100, wxDefaultPosition, wxSize(-1,-1), wxSL_HORIZONTAL);
-    
-    staticBoxSizer79420->Add(m_slider10721, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 2);
-    
-    m_staticText179 = new wxStaticText(m_panelHDWPTT, wxID_ANY, _("End of xmit delay:"), wxDefaultPosition, wxSize(-1,-1), 0);
-    
-    staticBoxSizer79420->Add(m_staticText179, 0, wxALL|wxALIGN_CENTER_VERTICAL, 2);
-    
-    m_slider10922 = new wxSlider(m_panelHDWPTT, wxID_ANY, 50, 0, 100, wxDefaultPosition, wxSize(-1,-1), wxSL_HORIZONTAL);
-    
-    staticBoxSizer79420->Add(m_slider10922, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 2);
-    
-    m_panelRIGCat = new wxPanel(m_notebook53, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), wxTAB_TRAVERSAL);
-    m_panelRIGCat->SetToolTip(_("RigCat"));
-    m_notebook53->AddPage(m_panelRIGCat, _("RigCAT"), false);
-    
-    wxBoxSizer* boxSizer67 = new wxBoxSizer(wxVERTICAL);
-    m_panelRIGCat->SetSizer(boxSizer67);
-    
-    m_radioButton185 = new wxRadioButton(m_panelRIGCat, wxID_ANY, _("Use RigCAT"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_radioButton185->SetValue(1);
-    
-    boxSizer67->Add(m_radioButton185, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 2);
-    
-    wxStaticBoxSizer* staticBoxSizer183 = new wxStaticBoxSizer( new wxStaticBox(m_panelRIGCat, wxID_ANY, wxT("")), wxVERTICAL);
-    
-    boxSizer67->Add(staticBoxSizer183, 1, wxALL|wxEXPAND|wxALIGN_TOP, 2);
-    
-    wxFlexGridSizer* flexGridSizer187 = new wxFlexGridSizer(  1, 1, 0, 0);
-    flexGridSizer187->SetFlexibleDirection( wxBOTH );
-    flexGridSizer187->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
-    flexGridSizer187->AddGrowableCol(1);
-    flexGridSizer187->AddGrowableRow(1);
-    
-    staticBoxSizer183->Add(flexGridSizer187, 0, wxALL, 2);
-    
-    wxFlexGridSizer* flexGridSizer204 = new wxFlexGridSizer(  3, 4, 0, 0);
-    flexGridSizer204->SetFlexibleDirection( wxBOTH );
-    flexGridSizer204->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
-    
-    flexGridSizer187->Add(flexGridSizer204, 1, wxALL|wxEXPAND, 2);
-    
-    wxBoxSizer* boxSizer193 = new wxBoxSizer(wxHORIZONTAL);
-    
-    flexGridSizer204->Add(boxSizer193, 1, wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL, 2);
-    
-    m_staticText189 = new wxStaticText(m_panelRIGCat, wxID_ANY, _("File:"), wxDefaultPosition, wxSize(-1,-1), 0);
-    
-    boxSizer193->Add(m_staticText189, 0, wxALL|wxALIGN_CENTER_VERTICAL, 2);
-    
-    m_textCtrl191 = new wxTextCtrl(m_panelRIGCat, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1,-1), 0);
-    
-    boxSizer193->Add(m_textCtrl191, 0, wxALL|wxALIGN_CENTER_VERTICAL, 2);
-    
-    wxBoxSizer* boxSizer206 = new wxBoxSizer(wxVERTICAL);
-    
-    flexGridSizer204->Add(boxSizer206, 1, wxALL|wxEXPAND, 5);
-    
-    m_button208 = new wxButton(m_panelRIGCat, wxID_ANY, _("Open"), wxDefaultPosition, wxSize(-1,-1), 0);
-    
-    boxSizer206->Add(m_button208, 0, wxALL|wxALIGN_CENTER_VERTICAL, 2);
-    
-    wxBoxSizer* boxSizer19329 = new wxBoxSizer(wxHORIZONTAL);
-    
-    flexGridSizer204->Add(boxSizer19329, 1, wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL, 2);
-    
-    m_staticText18930 = new wxStaticText(m_panelRIGCat, wxID_ANY, _("Device:"), wxDefaultPosition, wxSize(-1,-1), 0);
-    
-    boxSizer19329->Add(m_staticText18930, 0, wxALL|wxALIGN_CENTER_VERTICAL, 2);
-    
-    wxArrayString m_comboBox218Arr;
-    m_comboBox218 = new wxComboBox(m_panelRIGCat, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1,-1), m_comboBox218Arr, 0);
-    
-    boxSizer19329->Add(m_comboBox218, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5);
-    
-    wxFlexGridSizer* flexGridSizer222 = new wxFlexGridSizer(  1, 3, 0, 0);
-    flexGridSizer222->SetFlexibleDirection( wxBOTH );
-    flexGridSizer222->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
-    flexGridSizer222->AddGrowableCol(2);
-    
-    staticBoxSizer183->Add(flexGridSizer222, 0, wxALL, 2);
-    
-    wxBoxSizer* boxSizer19326 = new wxBoxSizer(wxHORIZONTAL);
-    
-    flexGridSizer222->Add(boxSizer19326, 1, wxALL|wxEXPAND, 2);
-    
-    m_staticText18927 = new wxStaticText(m_panelRIGCat, wxID_ANY, _("Retries:"), wxDefaultPosition, wxSize(-1,-1), 0);
-    
-    boxSizer19326->Add(m_staticText18927, 0, wxALL|wxALIGN_CENTER_VERTICAL, 2);
-    
-    m_textCtrl19128 = new wxTextCtrl(m_panelRIGCat, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1,-1), 0);
-    
-    boxSizer19326->Add(m_textCtrl19128, 1, wxALL|wxALIGN_CENTER_VERTICAL, 2);
-    
-    wxBoxSizer* boxSizer19323 = new wxBoxSizer(wxHORIZONTAL);
-    
-    flexGridSizer222->Add(boxSizer19323, 1, wxALL|wxEXPAND, 2);
-    
-    m_staticText18924 = new wxStaticText(m_panelRIGCat, wxID_ANY, _("Retry Interval:"), wxDefaultPosition, wxSize(-1,-1), 0);
-    
-    boxSizer19323->Add(m_staticText18924, 0, wxALL|wxALIGN_CENTER_VERTICAL, 2);
-    
-    m_textCtrl19125 = new wxTextCtrl(m_panelRIGCat, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1,-1), 0);
-    
-    boxSizer19323->Add(m_textCtrl19125, 1, wxALL|wxALIGN_CENTER_VERTICAL, 2);
-    
-    wxBoxSizer* boxSizer1932954 = new wxBoxSizer(wxHORIZONTAL);
-    
-    flexGridSizer222->Add(boxSizer1932954, 1, wxALL|wxEXPAND, 2);
-    
-    m_staticText1893055 = new wxStaticText(m_panelRIGCat, wxID_ANY, _("Baud Rate:"), wxDefaultPosition, wxSize(-1,-1), 0);
-    
-    boxSizer1932954->Add(m_staticText1893055, 0, wxALL|wxALIGN_CENTER_VERTICAL, 2);
-    
-    wxArrayString m_comboBaudArr;
-    m_comboBaudArr.Add(wxT("300"));
-    m_comboBaudArr.Add(wxT("600"));
-    m_comboBaudArr.Add(wxT("1200"));
-    m_comboBaudArr.Add(wxT("2400"));
-    m_comboBaudArr.Add(wxT("9600"));
-    m_comboBaudArr.Add(wxT("19200"));
-    m_comboBaudArr.Add(wxT("38400"));
-    m_comboBaudArr.Add(wxT("56800"));
-    m_comboBaud = new wxComboBox(m_panelRIGCat, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1,-1), m_comboBaudArr, 0);
-    
-    boxSizer1932954->Add(m_comboBaud, 1, wxALL|wxALIGN_CENTER_VERTICAL, 2);
-    
-    wxFlexGridSizer* flexGridSizer18747 = new wxFlexGridSizer(  1, 1, 0, 0);
-    flexGridSizer18747->SetFlexibleDirection( wxBOTH );
-    flexGridSizer18747->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
-    flexGridSizer18747->AddGrowableCol(1);
-    
-    staticBoxSizer183->Add(flexGridSizer18747, 0, wxALL|wxEXPAND, 2);
-    
-    wxFlexGridSizer* flexGridSizer20448 = new wxFlexGridSizer(  1, 3, 0, 0);
-    flexGridSizer20448->SetFlexibleDirection( wxBOTH );
-    flexGridSizer20448->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
-    flexGridSizer20448->AddGrowableCol(3);
-    flexGridSizer20448->AddGrowableRow(1);
-    
-    flexGridSizer18747->Add(flexGridSizer20448, 1, wxALL, 2);
-    
-    wxBoxSizer* boxSizer19349 = new wxBoxSizer(wxHORIZONTAL);
-    
-    flexGridSizer20448->Add(boxSizer19349, 1, wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL, 2);
-    
-    m_staticText18950 = new wxStaticText(m_panelRIGCat, wxID_ANY, _("Write Delay (ms):"), wxDefaultPosition, wxSize(-1,-1), 0);
-    
-    boxSizer19349->Add(m_staticText18950, 0, wxALL|wxALIGN_CENTER_VERTICAL, 2);
-    
-    m_textCtrl19151 = new wxTextCtrl(m_panelRIGCat, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1,-1), 0);
-    
-    boxSizer19349->Add(m_textCtrl19151, 0, wxALL|wxALIGN_CENTER_VERTICAL, 2);
-    
-    wxBoxSizer* boxSizer298 = new wxBoxSizer(wxHORIZONTAL);
-    
-    flexGridSizer20448->Add(boxSizer298, 1, wxALL|wxEXPAND, 2);
-    
-    m_staticText298 = new wxStaticText(m_panelRIGCat, wxID_ANY, _("Stop Bits:"), wxDefaultPosition, wxSize(-1,-1), 0);
-    
-    boxSizer298->Add(m_staticText298, 0, wxALL, 2);
-    
-    m_sliderStopBits = new wxSlider(m_panelRIGCat, wxID_ANY, 0, 0, 2, wxDefaultPosition, wxSize(-1,-1), wxSL_HORIZONTAL);
-    
-    boxSizer298->Add(m_sliderStopBits, 0, wxALL, 5);
-    
-    wxFlexGridSizer* flexGridSizer224 = new wxFlexGridSizer(  1, 4, 0, 0);
-    flexGridSizer224->SetFlexibleDirection( wxBOTH );
-    flexGridSizer224->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
-    flexGridSizer224->AddGrowableCol(4);
-    flexGridSizer224->AddGrowableRow(1);
-    
-    staticBoxSizer183->Add(flexGridSizer224, 0, wxALL|wxEXPAND, 2);
-    
-    flexGridSizer224->Add(2, 2, 1, wxALL|wxEXPAND, 2);
-    
-    m_cbEcho = new wxCheckBox(m_panelRIGCat, wxID_ANY, _("Commands echoed"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_cbEcho->SetValue(false);
-    m_cbEcho->SetToolTip(_("Commands are echoed"));
-    
-    flexGridSizer224->Add(m_cbEcho, 0, wxALL|wxEXPAND, 1);
-    
-    flexGridSizer224->Add(2, 2, 1, wxALL|wxEXPAND, 2);
-    
-    m_cbCATPTT = new wxCheckBox(m_panelRIGCat, wxID_ANY, _("CAT command for PTT"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_cbCATPTT->SetValue(false);
-    m_cbCATPTT->SetToolTip(_("Use CAT commands for PTT"));
-    
-    flexGridSizer224->Add(m_cbCATPTT, 1, wxALL|wxEXPAND, 2);
-    
-    wxFlexGridSizer* flexGridSizer22432 = new wxFlexGridSizer(  1, 4, 0, 0);
-    flexGridSizer22432->SetFlexibleDirection( wxBOTH );
-    flexGridSizer22432->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
-    flexGridSizer22432->AddGrowableCol(4);
-    flexGridSizer22432->AddGrowableRow(1);
-    
-    staticBoxSizer183->Add(flexGridSizer22432, 0, wxALL|wxEXPAND, 2);
-    
-    flexGridSizer22432->Add(2, 2, 1, wxALL|wxEXPAND, 2);
-    
-    m_cbToggleRTSPTT = new wxCheckBox(m_panelRIGCat, wxID_ANY, _("Toggle RTS for PTT"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_cbToggleRTSPTT->SetValue(false);
-    m_cbToggleRTSPTT->SetToolTip(_("Toggle RTS for PTT"));
-    
-    flexGridSizer22432->Add(m_cbToggleRTSPTT, 1, wxALL, 2);
-    
-    flexGridSizer22432->Add(2, 2, 1, wxALL|wxEXPAND, 2);
-    
-    m_cbToggleDTRPTT = new wxCheckBox(m_panelRIGCat, wxID_ANY, _("Toggle DTR for PTT"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_cbToggleDTRPTT->SetValue(false);
-    m_cbToggleDTRPTT->SetToolTip(_("Toggle DTR for PTT"));
-    
-    flexGridSizer22432->Add(m_cbToggleDTRPTT, 1, wxALL, 2);
-    
-    wxFlexGridSizer* flexGridSizer22437 = new wxFlexGridSizer(  1, 4, 0, 0);
-    flexGridSizer22437->SetFlexibleDirection( wxBOTH );
-    flexGridSizer22437->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
-    flexGridSizer22437->AddGrowableCol(4);
-    flexGridSizer22437->AddGrowableRow(1);
-    
-    staticBoxSizer183->Add(flexGridSizer22437, 0, wxALL|wxEXPAND, 2);
-    
-    flexGridSizer22437->Add(2, 2, 1, wxALL|wxEXPAND, 2);
-    
-    m_cbRTS12VInit = new wxCheckBox(m_panelRIGCat, wxID_ANY, _("Initial RTS +12v"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_cbRTS12VInit->SetValue(false);
-    m_cbRTS12VInit->SetToolTip(_("Initialize state of RTS"));
-    
-    flexGridSizer22437->Add(m_cbRTS12VInit, 1, wxALL|wxEXPAND, 2);
-    
-    flexGridSizer22437->Add(2, 2, 1, wxALL|wxEXPAND, 2);
-    
-    m_cbDTR12VInit = new wxCheckBox(m_panelRIGCat, wxID_ANY, _("Initial DTR +12v"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_cbDTR12VInit->SetValue(false);
-    m_cbDTR12VInit->SetToolTip(_("Initialize state of DTR"));
-    
-    flexGridSizer22437->Add(m_cbDTR12VInit, 1, wxALL|wxEXPAND, 2);
-    
-    wxFlexGridSizer* flexGridSizer22442 = new wxFlexGridSizer(  1, 4, 0, 0);
-    flexGridSizer22442->SetFlexibleDirection( wxBOTH );
-    flexGridSizer22442->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
-    flexGridSizer22442->AddGrowableCol(4);
-    flexGridSizer22442->AddGrowableRow(1);
-    
-    staticBoxSizer183->Add(flexGridSizer22442, 0, wxALL|wxEXPAND, 2);
-    
-    flexGridSizer22442->Add(2, 2, 0, wxALL, 2);
-    
-    m_cbRTSCTSFlowCtl = new wxCheckBox(m_panelRIGCat, wxID_ANY, _("RTS/CTS Flow Control"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_cbRTSCTSFlowCtl->SetValue(false);
-    
-    flexGridSizer22442->Add(m_cbRTSCTSFlowCtl, 0, wxALL, 2);
-    
-    flexGridSizer22442->Add(2, 2, 0, wxALL, 2);
-    
-    m_cbVSPEnable = new wxCheckBox(m_panelRIGCat, wxID_ANY, _("RTS/CTS Flow Control"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_cbVSPEnable->SetValue(false);
-    m_cbVSPEnable->SetToolTip(_("Virtual serial port enable. Suppress WARNINGS"));
-    
-    flexGridSizer22442->Add(m_cbVSPEnable, 0, wxALL, 2);
-    
-    m_panelHAMLib = new wxPanel(m_notebook53, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), wxTAB_TRAVERSAL);
-    m_panelHAMLib->SetToolTip(_("Hamlib Configuration"));
-    m_notebook53->AddPage(m_panelHAMLib, _("HAMlib"), false);
-    
-    wxStaticBoxSizer* staticBoxSizer296 = new wxStaticBoxSizer( new wxStaticBox(m_panelHAMLib, wxID_ANY, wxT("")), wxVERTICAL);
-    m_panelHAMLib->SetSizer(staticBoxSizer296);
-    
-    wxGridSizer* gridSizer368 = new wxGridSizer(  8, 3, 0, 0);
-    
-    staticBoxSizer296->Add(gridSizer368, 0, wxALL|wxEXPAND, 5);
-    
-    wxBoxSizer* boxSizer312 = new wxBoxSizer(wxHORIZONTAL);
-    
-    gridSizer368->Add(boxSizer312, 1, wxALL|wxEXPAND, 2);
-    
-    m_staticText308 = new wxStaticText(m_panelHAMLib, wxID_ANY, _("Device:"), wxDefaultPosition, wxSize(-1,-1), 0);
-    
-    boxSizer312->Add(m_staticText308, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 2);
-    
-    wxArrayString m_comboBox314Arr;
-    m_comboBox314 = new wxComboBox(m_panelHAMLib, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1,-1), m_comboBox314Arr, 0);
-    
-    boxSizer312->Add(m_comboBox314, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 2);
-    
-    m_staticText304 = new wxStaticText(m_panelHAMLib, wxID_ANY, _("Rig:"), wxDefaultPosition, wxSize(-1,-1), 0);
-    
-    gridSizer368->Add(m_staticText304, 1, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 2);
-    
-    wxBoxSizer* boxSizer302 = new wxBoxSizer(wxHORIZONTAL);
-    
-    gridSizer368->Add(boxSizer302, 1, wxALL, 2);
-    
-    m_textCtrl306 = new wxTextCtrl(m_panelHAMLib, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1,-1), 0);
-    
-    boxSizer302->Add(m_textCtrl306, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 2);
-    
-    wxBoxSizer* boxSizer320 = new wxBoxSizer(wxHORIZONTAL);
-    
-    gridSizer368->Add(boxSizer320, 1, wxALL, 2);
-    
-    m_staticText326 = new wxStaticText(m_panelHAMLib, wxID_ANY, _("Retries:"), wxDefaultPosition, wxSize(-1,-1), 0);
-    
-    boxSizer320->Add(m_staticText326, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 2);
-    
-    m_textCtrl328 = new wxTextCtrl(m_panelHAMLib, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1,-1), 0);
-    
-    boxSizer320->Add(m_textCtrl328, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 2);
-    
-    wxBoxSizer* boxSizer32057 = new wxBoxSizer(wxHORIZONTAL);
-    
-    gridSizer368->Add(boxSizer32057, 1, wxALL, 2);
-    
-    m_staticText32658 = new wxStaticText(m_panelHAMLib, wxID_ANY, _("Retry Interval:"), wxDefaultPosition, wxSize(-1,-1), 0);
-    
-    boxSizer32057->Add(m_staticText32658, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 2);
-    
-    m_textCtrl32859 = new wxTextCtrl(m_panelHAMLib, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1,-1), 0);
-    
-    boxSizer32057->Add(m_textCtrl32859, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 2);
-    
-    wxBoxSizer* boxSizer32060 = new wxBoxSizer(wxHORIZONTAL);
-    
-    gridSizer368->Add(boxSizer32060, 1, wxALL, 2);
-    
-    m_staticText32661 = new wxStaticText(m_panelHAMLib, wxID_ANY, _("Baud Rate:"), wxDefaultPosition, wxSize(-1,-1), 0);
-    
-    boxSizer32060->Add(m_staticText32661, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 2);
-    
-    wxArrayString m_comboBox339Arr;
-    m_comboBox339Arr.Add(wxT("300"));
-    m_comboBox339Arr.Add(wxT("600"));
-    m_comboBox339Arr.Add(wxT("1200"));
-    m_comboBox339Arr.Add(wxT("2400"));
-    m_comboBox339Arr.Add(wxT("9600"));
-    m_comboBox339Arr.Add(wxT("19200"));
-    m_comboBox339Arr.Add(wxT("38400"));
-    m_comboBox339Arr.Add(wxT("56800"));
-    m_comboBox339 = new wxComboBox(m_panelHAMLib, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1,-1), m_comboBox339Arr, 0);
-    
-    boxSizer32060->Add(m_comboBox339, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 2);
-    
-    wxBoxSizer* boxSizer32064 = new wxBoxSizer(wxHORIZONTAL);
-    
-    gridSizer368->Add(boxSizer32064, 0, wxALL, 2);
-    
-    m_staticText32665 = new wxStaticText(m_panelHAMLib, wxID_ANY, _("Write Delay:"), wxDefaultPosition, wxSize(-1,-1), 0);
-    
-    boxSizer32064->Add(m_staticText32665, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 2);
-    
-    m_textCtrl32866 = new wxTextCtrl(m_panelHAMLib, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1,-1), 0);
-    
-    boxSizer32064->Add(m_textCtrl32866, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 2);
-    
-    wxBoxSizer* boxSizer3205767 = new wxBoxSizer(wxHORIZONTAL);
-    
-    gridSizer368->Add(boxSizer3205767, 1, wxALL, 2);
-    
-    m_staticText3265868 = new wxStaticText(m_panelHAMLib, wxID_ANY, _("Post Write Delay:"), wxDefaultPosition, wxSize(-1,-1), 0);
-    
-    boxSizer3205767->Add(m_staticText3265868, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 2);
-    
-    m_textCtrl3285969 = new wxTextCtrl(m_panelHAMLib, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1,-1), 0);
-    
-    boxSizer3205767->Add(m_textCtrl3285969, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 2);
-    
-    wxBoxSizer* boxSizer3206070 = new wxBoxSizer(wxHORIZONTAL);
-    
-    gridSizer368->Add(boxSizer3206070, 0, wxALL, 2);
-    
-    m_staticText3266171 = new wxStaticText(m_panelHAMLib, wxID_ANY, _("Stop bits:"), wxDefaultPosition, wxSize(-1,-1), 0);
-    
-    boxSizer3206070->Add(m_staticText3266171, 1, wxALL, 2);
-    
-    m_slider361 = new wxSlider(m_panelHAMLib, wxID_ANY, 1, 0, 2, wxDefaultPosition, wxSize(-1,-1), wxSL_LABELS|wxSL_HORIZONTAL);
-    
-    boxSizer3206070->Add(m_slider361, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 2);
-    
-    m_cbHAMLIBPTT = new wxCheckBox(m_panelHAMLib, wxID_ANY, _("PTT via HAMLib"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_cbHAMLIBPTT->SetValue(false);
-    m_cbHAMLIBPTT->SetToolTip(_("Use Hamlib to control PTT"));
-    
-    gridSizer368->Add(m_cbHAMLIBPTT, 1, wxALL, 2);
-    
-    m_staticText408 = new wxStaticText(m_panelHAMLib, wxID_ANY, _("Sideband:"), wxDefaultPosition, wxSize(-1,-1), 0);
-    
-    gridSizer368->Add(m_staticText408, 1, wxALL|wxALIGN_RIGHT, 2);
-    
-    wxBoxSizer* boxSizer410 = new wxBoxSizer(wxVERTICAL);
-    
-    gridSizer368->Add(boxSizer410, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 2);
-    
-    wxArrayString m_comboBox376Arr;
-    m_comboBox376Arr.Add(wxT("Upper"));
-    m_comboBox376Arr.Add(wxT("Lower"));
-    m_comboBox376 = new wxComboBox(m_panelHAMLib, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1,-1), m_comboBox376Arr, 0);
-    
-    boxSizer410->Add(m_comboBox376, 0, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 2);
-    
-    m_checkBox378 = new wxCheckBox(m_panelHAMLib, wxID_ANY, _("Initial RTS +12v"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_checkBox378->SetValue(false);
-    m_checkBox378->SetToolTip(_("Initialize state of RTS"));
-    
-    gridSizer368->Add(m_checkBox378, 0, wxALL, 2);
-    
-    gridSizer368->Add(0, 0, 0, wxALL, 2);
-    
-    m_checkBox382 = new wxCheckBox(m_panelHAMLib, wxID_ANY, _("Initial DTR +12v"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_checkBox382->SetValue(false);
-    
-    gridSizer368->Add(m_checkBox382, 0, wxALL, 2);
-    
-    m_cbRTSCTS = new wxCheckBox(m_panelHAMLib, wxID_ANY, _("RTS/CTS Flow Control"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_cbRTSCTS->SetValue(false);
-    m_cbRTSCTS->SetToolTip(_("Use RTS/CTS Flow Control"));
-    
-    gridSizer368->Add(m_cbRTSCTS, 0, wxALL, 2);
-    
-    gridSizer368->Add(0, 0, 0, wxALL, 2);
-    
-    m_cbXONXOFF = new wxCheckBox(m_panelHAMLib, wxID_ANY, _("XON/XOFF Flow Control"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_cbXONXOFF->SetValue(false);
-    m_cbXONXOFF->SetToolTip(_("Use XON/XOFF flow control"));
-    
-    gridSizer368->Add(m_cbXONXOFF, 0, wxALL, 2);
-    
-    m_staticText404 = new wxStaticText(m_panelHAMLib, wxID_ANY, _("Advanced Configuration:"), wxDefaultPosition, wxSize(-1,-1), 0);
-    
-    gridSizer368->Add(m_staticText404, 0, wxALL, 2);
-    
-    gridSizer368->Add(0, 0, 0, wxALL, 2);
-    
-    m_btnRevert = new wxButton(m_panelHAMLib, wxID_ANY, _("Revert"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_btnRevert->SetToolTip(_("Revert to previous settings"));
-    
-    gridSizer368->Add(m_btnRevert, 0, wxALL, 2);
-    
-    m_textAdvancedCFG = new wxTextCtrl(m_panelHAMLib, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_textAdvancedCFG->SetToolTip(_("Enter Advanced Configuration string"));
-    
-    gridSizer368->Add(m_textAdvancedCFG, 1, wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL, 2);
-    
-    gridSizer368->Add(0, 0, 0, wxALL, 2);
-    
-    m_btnInitHamlib = new wxButton(m_panelHAMLib, wxID_ANY, _("Initialize"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_btnInitHamlib->SetToolTip(_("Initialize HAMLib"));
-    
-    gridSizer368->Add(m_btnInitHamlib, 0, wxALL, 2);
-    
-    m_panelMemMap = new wxPanel(m_notebook53, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), wxTAB_TRAVERSAL);
-    m_panelMemMap->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNHIGHLIGHT));
-    m_panelMemMap->SetToolTip(_("Memory Mapped control"));
-    m_notebook53->AddPage(m_panelMemMap, _("MemMap"), false);
-    
-    wxStaticBoxSizer* staticBoxSizer294 = new wxStaticBoxSizer( new wxStaticBox(m_panelMemMap, wxID_ANY, wxT("")), wxVERTICAL);
-    m_panelMemMap->SetSizer(staticBoxSizer294);
-    
-    wxGridSizer* gridSizer420 = new wxGridSizer(  2, 1, 0, 0);
-    
-    staticBoxSizer294->Add(gridSizer420, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 2);
-    
-    wxStaticBoxSizer* staticBoxSizer424 = new wxStaticBoxSizer( new wxStaticBox(m_panelMemMap, wxID_ANY, wxT("")), wxVERTICAL);
-    
-    gridSizer420->Add(staticBoxSizer424, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
-    
-    m_staticText422 = new wxStaticText(m_panelMemMap, wxID_ANY, _("\nControl via Memory Mapped Shared Variables, i. e. Kachina \n"), wxDefaultPosition, wxSize(-1,-1), wxALIGN_CENTRE);
-    m_staticText422->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE));
-    
-    staticBoxSizer424->Add(m_staticText422, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
-    
-    wxBoxSizer* boxSizer4456 = new wxBoxSizer(wxVERTICAL);
-    
-    gridSizer420->Add(boxSizer4456, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5);
-    
-    m_checkBox4377 = new wxCheckBox(m_panelMemMap, wxID_ANY, _("Use Memorymap"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_checkBox4377->SetValue(false);
-    
-    boxSizer4456->Add(m_checkBox4377, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
-    
-    m_checkBox4398 = new wxCheckBox(m_panelMemMap, wxID_ANY, _("Use Memmap PTT"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_checkBox4398->SetValue(false);
-    
-    boxSizer4456->Add(m_checkBox4398, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_BOTTOM, 5);
-    
-    m_button4419 = new wxButton(m_panelMemMap, wxID_ANY, _("Initialize"), wxDefaultPosition, wxSize(-1,-1), 0);
-    
-    boxSizer4456->Add(m_button4419, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
-    
-    m_panelXMLRPC = new wxPanel(m_notebook53, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), wxTAB_TRAVERSAL);
-    m_panelXMLRPC->SetToolTip(_("XML-RPC control"));
-    m_notebook53->AddPage(m_panelXMLRPC, _("XML-RPC"), false);
-    
-    wxStaticBoxSizer* staticBoxSizer85 = new wxStaticBoxSizer( new wxStaticBox(m_panelXMLRPC, wxID_ANY, wxT("")), wxVERTICAL);
-    m_panelXMLRPC->SetSizer(staticBoxSizer85);
-    
-    wxGridSizer* gridSizer4203 = new wxGridSizer(  2, 1, 0, 0);
-    
-    staticBoxSizer85->Add(gridSizer4203, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 2);
-    
-    wxStaticBoxSizer* staticBoxSizer4244 = new wxStaticBoxSizer( new wxStaticBox(m_panelXMLRPC, wxID_ANY, wxT("")), wxVERTICAL);
-    
-    gridSizer4203->Add(staticBoxSizer4244, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
-    
-    m_staticText42210 = new wxStaticText(m_panelXMLRPC, wxID_ANY, _("\nRig control via external program using XML RPC Remote Calls\n"), wxDefaultPosition, wxSize(-1,-1), wxALIGN_CENTRE);
-    m_staticText42210->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE));
-    
-    staticBoxSizer4244->Add(m_staticText42210, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
-    
-    wxBoxSizer* boxSizer445 = new wxBoxSizer(wxVERTICAL);
-    
-    gridSizer4203->Add(boxSizer445, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5);
-    
-    m_checkBox437 = new wxCheckBox(m_panelXMLRPC, wxID_ANY, _("Use XML-RPC"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_checkBox437->SetValue(false);
-    
-    boxSizer445->Add(m_checkBox437, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
-    
-    m_button441 = new wxButton(m_panelXMLRPC, wxID_ANY, _("Initialize"), wxDefaultPosition, wxSize(-1,-1), 0);
-    
-    boxSizer445->Add(m_button441, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
-    
-    m_stdBtnSizer155 = new wxStdDialogButtonSizer();
-    
-    boxSizer51->Add(m_stdBtnSizer155, 0, wxALL|wxALIGN_RIGHT|wxALIGN_BOTTOM, 2);
-    
-    m_button165 = new wxButton(this, wxID_APPLY, wxT(""), wxDefaultPosition, wxSize(-1, -1), 0);
-    m_stdBtnSizer155->AddButton(m_button165);
-    
-    m_button167 = new wxButton(this, wxID_OK, wxT(""), wxDefaultPosition, wxSize(-1, -1), 0);
-    m_button167->SetDefault();
-    m_stdBtnSizer155->AddButton(m_button167);
-    
-    m_button366 = new wxButton(this, wxID_CANCEL, wxT(""), wxDefaultPosition, wxSize(-1, -1), 0);
-    m_stdBtnSizer155->AddButton(m_button366);
-    m_stdBtnSizer155->Realize();
-    
-    
-    SetSizeHints(460,315);
-    if ( GetSizer() ) {
-         GetSizer()->Fit(this);
-    }
-    Centre(wxBOTH);
-}
-
-DlgRigCtrlBase::~DlgRigCtrlBase()
-{
-}
diff --git a/fdmdv2/branches/0.97/build/codelite/hamlib_trial/wxcrafter.h b/fdmdv2/branches/0.97/build/codelite/hamlib_trial/wxcrafter.h
deleted file mode 100644 (file)
index 752b774..0000000
+++ /dev/null
@@ -1,153 +0,0 @@
-//////////////////////////////////////////////////////////////////////
-// This file was auto-generated by codelite's wxCrafter Plugin
-// Do not modify this file by hand!
-//////////////////////////////////////////////////////////////////////
-
-#ifndef WXCRAFTER_BASE_CLASSES_H
-#define WXCRAFTER_BASE_CLASSES_H
-
-#include <wx/settings.h>
-#include <wx/xrc/xmlres.h>
-#include <wx/xrc/xh_bmp.h>
-#include <wx/frame.h>
-#include <wx/sizer.h>
-#include <wx/panel.h>
-#include <wx/menu.h>
-#include <wx/toolbar.h>
-#include <wx/dialog.h>
-#include <wx/notebook.h>
-#include <wx/imaglist.h>
-#include <wx/statbox.h>
-#include <wx/checkbox.h>
-#include <wx/stattext.h>
-#include <wx/combobox.h>
-#include <wx/arrstr.h>
-#include <wx/radiobox.h>
-#include <wx/button.h>
-#include <wx/slider.h>
-#include <wx/radiobut.h>
-#include <wx/textctrl.h>
-
-class MainFrameBaseClass : public wxFrame
-{
-protected:
-    wxPanel* m_mainPanel;
-    wxMenuBar* m_menuBar;
-    wxMenu* m_mbFile;
-    wxMenuItem* m_mbiNew;
-    wxMenuItem* m_mbiOpen;
-    wxMenuItem* m_mbiSave;
-    wxMenuItem* m_mbiSaveAs;
-    wxMenuItem* m_menuItem21;
-    wxMenuItem* m_mbiExit;
-    wxMenu* m_mbTools;
-    wxMenuItem* m_mbiPrefs;
-    wxMenu* m_mbHelp;
-    wxMenuItem* m_menuItem9;
-    wxToolBar* m_mainToolbar;
-
-protected:
-    virtual void OnSize(wxSizeEvent& event) { event.Skip(); }
-    virtual void OnExit(wxCommandEvent& event) { event.Skip(); }
-    virtual void OnToolsPrefs(wxCommandEvent& event) { event.Skip(); }
-    virtual void OnAbout(wxCommandEvent& event) { event.Skip(); }
-    virtual void OnNew(wxCommandEvent& event) { event.Skip(); }
-    virtual void OnOpen(wxCommandEvent& event) { event.Skip(); }
-
-public:
-    MainFrameBaseClass(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("topFrame"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(500,300), long style = wxCAPTION|wxRESIZE_BORDER|wxMAXIMIZE_BOX|wxMINIMIZE_BOX|wxSYSTEM_MENU|wxCLOSE_BOX);
-    virtual ~MainFrameBaseClass();
-};
-
-
-class DlgRigCtrlBase : public wxDialog
-{
-protected:
-    wxNotebook* m_notebook53;
-    wxPanel* m_panelHDWPTT;
-    wxCheckBox* m_checkBox7537;
-    wxCheckBox* m_checkBox9112;
-    wxStaticText* m_staticText173;
-    wxComboBox* m_comboBox9313;
-    wxRadioBox* m_radioBox10115;
-    wxRadioBox* m_radioBox10316;
-    wxButton* m_button11319;
-    wxStaticText* m_staticText177;
-    wxSlider* m_slider10721;
-    wxStaticText* m_staticText179;
-    wxSlider* m_slider10922;
-    wxPanel* m_panelRIGCat;
-    wxRadioButton* m_radioButton185;
-    wxStaticText* m_staticText189;
-    wxTextCtrl* m_textCtrl191;
-    wxButton* m_button208;
-    wxStaticText* m_staticText18930;
-    wxComboBox* m_comboBox218;
-    wxStaticText* m_staticText18927;
-    wxTextCtrl* m_textCtrl19128;
-    wxStaticText* m_staticText18924;
-    wxTextCtrl* m_textCtrl19125;
-    wxStaticText* m_staticText1893055;
-    wxComboBox* m_comboBaud;
-    wxStaticText* m_staticText18950;
-    wxTextCtrl* m_textCtrl19151;
-    wxStaticText* m_staticText298;
-    wxSlider* m_sliderStopBits;
-    wxCheckBox* m_cbEcho;
-    wxCheckBox* m_cbCATPTT;
-    wxCheckBox* m_cbToggleRTSPTT;
-    wxCheckBox* m_cbToggleDTRPTT;
-    wxCheckBox* m_cbRTS12VInit;
-    wxCheckBox* m_cbDTR12VInit;
-    wxCheckBox* m_cbRTSCTSFlowCtl;
-    wxCheckBox* m_cbVSPEnable;
-    wxPanel* m_panelHAMLib;
-    wxStaticText* m_staticText308;
-    wxComboBox* m_comboBox314;
-    wxStaticText* m_staticText304;
-    wxTextCtrl* m_textCtrl306;
-    wxStaticText* m_staticText326;
-    wxTextCtrl* m_textCtrl328;
-    wxStaticText* m_staticText32658;
-    wxTextCtrl* m_textCtrl32859;
-    wxStaticText* m_staticText32661;
-    wxComboBox* m_comboBox339;
-    wxStaticText* m_staticText32665;
-    wxTextCtrl* m_textCtrl32866;
-    wxStaticText* m_staticText3265868;
-    wxTextCtrl* m_textCtrl3285969;
-    wxStaticText* m_staticText3266171;
-    wxSlider* m_slider361;
-    wxCheckBox* m_cbHAMLIBPTT;
-    wxStaticText* m_staticText408;
-    wxComboBox* m_comboBox376;
-    wxCheckBox* m_checkBox378;
-    wxCheckBox* m_checkBox382;
-    wxCheckBox* m_cbRTSCTS;
-    wxCheckBox* m_cbXONXOFF;
-    wxStaticText* m_staticText404;
-    wxButton* m_btnRevert;
-    wxTextCtrl* m_textAdvancedCFG;
-    wxButton* m_btnInitHamlib;
-    wxPanel* m_panelMemMap;
-    wxStaticText* m_staticText422;
-    wxCheckBox* m_checkBox4377;
-    wxCheckBox* m_checkBox4398;
-    wxButton* m_button4419;
-    wxPanel* m_panelXMLRPC;
-    wxStaticText* m_staticText42210;
-    wxCheckBox* m_checkBox437;
-    wxButton* m_button441;
-    wxStdDialogButtonSizer* m_stdBtnSizer155;
-    wxButton* m_button165;
-    wxButton* m_button167;
-    wxButton* m_button366;
-
-protected:
-
-public:
-    DlgRigCtrlBase(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Rig Control"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(460,315), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxCLOSE_BOX);
-    virtual ~DlgRigCtrlBase();
-};
-
-#endif
diff --git a/fdmdv2/branches/0.97/build/codelite/hamlib_trial/wxcrafter.wxcp b/fdmdv2/branches/0.97/build/codelite/hamlib_trial/wxcrafter.wxcp
deleted file mode 100644 (file)
index 7a31bf3..0000000
+++ /dev/null
@@ -1,7969 +0,0 @@
-{
-       "metadata":     {
-               "m_generatedFilesDir":  "",
-               "m_objCounter": 455,
-               "m_includeFiles":       [],
-               "m_bitmapFunction":     "wxC9ED9InitBitmapResources",
-               "m_bitmapsFile":        "wxcrafter_bitmaps.cpp",
-               "m_GenerateCodeTypes":  3,
-               "m_outputFileName":     "",
-               "m_templateClasses":    []
-       },
-       "windows":      [{
-                       "m_type":       4402,
-                       "proportion":   0,
-                       "border":       5,
-                       "gbSpan":       "1,1",
-                       "gbPosition":   "0,0",
-                       "m_styles":     ["wxCAPTION", "wxRESIZE_BORDER", "wxMAXIMIZE_BOX", "wxMINIMIZE_BOX", "wxSYSTEM_MENU", "wxCLOSE_BOX"],
-                       "m_sizerFlags": ["wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                       "m_properties": [{
-                                       "type": "string",
-                                       "m_label":      "Size:",
-                                       "m_value":      "500,300"
-                               }, {
-                                       "type": "string",
-                                       "m_label":      "Minimum Size:",
-                                       "m_value":      "-1,-1"
-                               }, {
-                                       "type": "string",
-                                       "m_label":      "Name:",
-                                       "m_value":      "MainFrameBaseClass"
-                               }, {
-                                       "type": "multi-string",
-                                       "m_label":      "Tooltip:",
-                                       "m_value":      ""
-                               }, {
-                                       "type": "colour",
-                                       "m_label":      "Bg Colour:",
-                                       "colour":       "<Default>"
-                               }, {
-                                       "type": "colour",
-                                       "m_label":      "Fg Colour:",
-                                       "colour":       "<Default>"
-                               }, {
-                                       "type": "font",
-                                       "m_label":      "Font:",
-                                       "m_value":      ""
-                               }, {
-                                       "type": "bool",
-                                       "m_label":      "Hidden",
-                                       "m_value":      false
-                               }, {
-                                       "type": "bool",
-                                       "m_label":      "Disabled",
-                                       "m_value":      false
-                               }, {
-                                       "type": "bool",
-                                       "m_label":      "Focused",
-                                       "m_value":      false
-                               }, {
-                                       "type": "string",
-                                       "m_label":      "Class Name:",
-                                       "m_value":      ""
-                               }, {
-                                       "type": "string",
-                                       "m_label":      "Include File:",
-                                       "m_value":      ""
-                               }, {
-                                       "type": "string",
-                                       "m_label":      "Title:",
-                                       "m_value":      "topFrame"
-                               }, {
-                                       "type": "virtualFolderPicker",
-                                       "m_label":      "Virtual Folder:",
-                                       "m_path":       ""
-                               }, {
-                                       "type": "choice",
-                                       "m_label":      "Centre:",
-                                       "m_selection":  1,
-                                       "m_options":    ["", "wxBOTH", "wxVERTICAL", "wxHORIZONTAL"]
-                               }, {
-                                       "type": "string",
-                                       "m_label":      "File:",
-                                       "m_value":      "MainFrame"
-                               }, {
-                                       "type": "string",
-                                       "m_label":      "Inherited Class",
-                                       "m_value":      "MainFrame"
-                               }, {
-                                       "type": "string",
-                                       "m_label":      "Class Decorator",
-                                       "m_value":      ""
-                               }],
-                       "m_events":     [],
-                       "m_children":   [{
-                                       "m_type":       4401,
-                                       "proportion":   0,
-                                       "border":       5,
-                                       "gbSpan":       "1,1",
-                                       "gbPosition":   "0,0",
-                                       "m_styles":     [],
-                                       "m_sizerFlags": ["wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                       "m_properties": [{
-                                                       "type": "string",
-                                                       "m_label":      "Name:",
-                                                       "m_value":      "boxSizer1"
-                                               }, {
-                                                       "type": "choice",
-                                                       "m_label":      "Orientation:",
-                                                       "m_selection":  0,
-                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
-                                               }],
-                                       "m_events":     [],
-                                       "m_children":   [{
-                                                       "m_type":       4408,
-                                                       "proportion":   1,
-                                                       "border":       5,
-                                                       "gbSpan":       "1,1",
-                                                       "gbPosition":   "0,0",
-                                                       "m_styles":     ["wxTAB_TRAVERSAL"],
-                                                       "m_sizerFlags": ["wxEXPAND"],
-                                                       "m_properties": [{
-                                                                       "type": "winid",
-                                                                       "m_label":      "ID:",
-                                                                       "m_winid":      "wxID_ANY"
-                                                               }, {
-                                                                       "type": "string",
-                                                                       "m_label":      "Size:",
-                                                                       "m_value":      "-1,-1"
-                                                               }, {
-                                                                       "type": "string",
-                                                                       "m_label":      "Minimum Size:",
-                                                                       "m_value":      "-1,-1"
-                                                               }, {
-                                                                       "type": "string",
-                                                                       "m_label":      "Name:",
-                                                                       "m_value":      "m_mainPanel"
-                                                               }, {
-                                                                       "type": "multi-string",
-                                                                       "m_label":      "Tooltip:",
-                                                                       "m_value":      ""
-                                                               }, {
-                                                                       "type": "colour",
-                                                                       "m_label":      "Bg Colour:",
-                                                                       "colour":       "<Default>"
-                                                               }, {
-                                                                       "type": "colour",
-                                                                       "m_label":      "Fg Colour:",
-                                                                       "colour":       "<Default>"
-                                                               }, {
-                                                                       "type": "font",
-                                                                       "m_label":      "Font:",
-                                                                       "m_value":      ""
-                                                               }, {
-                                                                       "type": "bool",
-                                                                       "m_label":      "Hidden",
-                                                                       "m_value":      false
-                                                               }, {
-                                                                       "type": "bool",
-                                                                       "m_label":      "Disabled",
-                                                                       "m_value":      false
-                                                               }, {
-                                                                       "type": "bool",
-                                                                       "m_label":      "Focused",
-                                                                       "m_value":      false
-                                                               }, {
-                                                                       "type": "string",
-                                                                       "m_label":      "Class Name:",
-                                                                       "m_value":      ""
-                                                               }, {
-                                                                       "type": "string",
-                                                                       "m_label":      "Include File:",
-                                                                       "m_value":      ""
-                                                               }],
-                                                       "m_events":     [{
-                                                                       "m_eventName":  "wxEVT_SIZE",
-                                                                       "m_eventClass": "wxSizeEvent",
-                                                                       "m_eventHandler":       "wxSizeEventHandler",
-                                                                       "m_functionNameAndSignature":   "OnSize(wxSizeEvent& event)",
-                                                                       "m_description":        "Process a wxEVT_SIZE event"
-                                                               }],
-                                                       "m_children":   [{
-                                                                       "m_type":       4401,
-                                                                       "proportion":   1,
-                                                                       "border":       5,
-                                                                       "gbSpan":       "1,1",
-                                                                       "gbPosition":   "0,0",
-                                                                       "m_styles":     [],
-                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
-                                                                       "m_properties": [{
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Name:",
-                                                                                       "m_value":      "boxSizer33"
-                                                                               }, {
-                                                                                       "type": "choice",
-                                                                                       "m_label":      "Orientation:",
-                                                                                       "m_selection":  0,
-                                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
-                                                                               }],
-                                                                       "m_events":     [],
-                                                                       "m_children":   []
-                                                               }]
-                                               }]
-                               }, {
-                                       "m_type":       4457,
-                                       "proportion":   0,
-                                       "border":       5,
-                                       "gbSpan":       "1,1",
-                                       "gbPosition":   "0,0",
-                                       "m_styles":     [],
-                                       "m_sizerFlags": ["wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                       "m_properties": [{
-                                                       "type": "winid",
-                                                       "m_label":      "ID:",
-                                                       "m_winid":      "wxID_ANY"
-                                               }, {
-                                                       "type": "string",
-                                                       "m_label":      "Size:",
-                                                       "m_value":      "-1,-1"
-                                               }, {
-                                                       "type": "string",
-                                                       "m_label":      "Minimum Size:",
-                                                       "m_value":      "-1,-1"
-                                               }, {
-                                                       "type": "string",
-                                                       "m_label":      "Name:",
-                                                       "m_value":      "m_menuBar"
-                                               }, {
-                                                       "type": "multi-string",
-                                                       "m_label":      "Tooltip:",
-                                                       "m_value":      ""
-                                               }, {
-                                                       "type": "colour",
-                                                       "m_label":      "Bg Colour:",
-                                                       "colour":       "<Default>"
-                                               }, {
-                                                       "type": "colour",
-                                                       "m_label":      "Fg Colour:",
-                                                       "colour":       "<Default>"
-                                               }, {
-                                                       "type": "font",
-                                                       "m_label":      "Font:",
-                                                       "m_value":      ""
-                                               }, {
-                                                       "type": "bool",
-                                                       "m_label":      "Hidden",
-                                                       "m_value":      false
-                                               }, {
-                                                       "type": "bool",
-                                                       "m_label":      "Disabled",
-                                                       "m_value":      false
-                                               }, {
-                                                       "type": "bool",
-                                                       "m_label":      "Focused",
-                                                       "m_value":      false
-                                               }, {
-                                                       "type": "string",
-                                                       "m_label":      "Class Name:",
-                                                       "m_value":      ""
-                                               }, {
-                                                       "type": "string",
-                                                       "m_label":      "Include File:",
-                                                       "m_value":      ""
-                                               }],
-                                       "m_events":     [],
-                                       "m_children":   [{
-                                                       "m_type":       4458,
-                                                       "proportion":   0,
-                                                       "border":       5,
-                                                       "gbSpan":       "1,1",
-                                                       "gbPosition":   "0,0",
-                                                       "m_styles":     [],
-                                                       "m_sizerFlags": ["wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                                       "m_properties": [{
-                                                                       "type": "string",
-                                                                       "m_label":      "Name:",
-                                                                       "m_value":      "m_mbFile"
-                                                               }, {
-                                                                       "type": "string",
-                                                                       "m_label":      "Label:",
-                                                                       "m_value":      "File"
-                                                               }],
-                                                       "m_events":     [],
-                                                       "m_children":   [{
-                                                                       "m_type":       4459,
-                                                                       "proportion":   0,
-                                                                       "border":       5,
-                                                                       "gbSpan":       "1,1",
-                                                                       "gbPosition":   "0,0",
-                                                                       "m_styles":     [],
-                                                                       "m_sizerFlags": [],
-                                                                       "m_properties": [{
-                                                                                       "type": "winid",
-                                                                                       "m_label":      "ID:",
-                                                                                       "m_winid":      "wxID_NEW"
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Name:",
-                                                                                       "m_value":      "m_mbiNew"
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Label:",
-                                                                                       "m_value":      "New"
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Shortcut:",
-                                                                                       "m_value":      ""
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Help String:",
-                                                                                       "m_value":      ""
-                                                                               }, {
-                                                                                       "type": "filePicker",
-                                                                                       "m_label":      "Bitmap File:",
-                                                                                       "m_path":       ""
-                                                                               }, {
-                                                                                       "type": "choice",
-                                                                                       "m_label":      "Kind:",
-                                                                                       "m_selection":  0,
-                                                                                       "m_options":    ["normal", "checkable", "radio", "separator"]
-                                                                               }, {
-                                                                                       "type": "bool",
-                                                                                       "m_label":      "Checked",
-                                                                                       "m_value":      false
-                                                                               }],
-                                                                       "m_events":     [],
-                                                                       "m_children":   []
-                                                               }, {
-                                                                       "m_type":       4459,
-                                                                       "proportion":   0,
-                                                                       "border":       5,
-                                                                       "gbSpan":       "1,1",
-                                                                       "gbPosition":   "0,0",
-                                                                       "m_styles":     [],
-                                                                       "m_sizerFlags": [],
-                                                                       "m_properties": [{
-                                                                                       "type": "winid",
-                                                                                       "m_label":      "ID:",
-                                                                                       "m_winid":      "wxID_OPEN"
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Name:",
-                                                                                       "m_value":      "m_mbiOpen"
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Label:",
-                                                                                       "m_value":      "Open"
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Shortcut:",
-                                                                                       "m_value":      ""
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Help String:",
-                                                                                       "m_value":      ""
-                                                                               }, {
-                                                                                       "type": "filePicker",
-                                                                                       "m_label":      "Bitmap File:",
-                                                                                       "m_path":       ""
-                                                                               }, {
-                                                                                       "type": "choice",
-                                                                                       "m_label":      "Kind:",
-                                                                                       "m_selection":  0,
-                                                                                       "m_options":    ["normal", "checkable", "radio", "separator"]
-                                                                               }, {
-                                                                                       "type": "bool",
-                                                                                       "m_label":      "Checked",
-                                                                                       "m_value":      false
-                                                                               }],
-                                                                       "m_events":     [],
-                                                                       "m_children":   []
-                                                               }, {
-                                                                       "m_type":       4459,
-                                                                       "proportion":   0,
-                                                                       "border":       5,
-                                                                       "gbSpan":       "1,1",
-                                                                       "gbPosition":   "0,0",
-                                                                       "m_styles":     [],
-                                                                       "m_sizerFlags": [],
-                                                                       "m_properties": [{
-                                                                                       "type": "winid",
-                                                                                       "m_label":      "ID:",
-                                                                                       "m_winid":      "wxID_SAVE"
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Name:",
-                                                                                       "m_value":      "m_mbiSave"
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Label:",
-                                                                                       "m_value":      "Save"
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Shortcut:",
-                                                                                       "m_value":      ""
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Help String:",
-                                                                                       "m_value":      ""
-                                                                               }, {
-                                                                                       "type": "filePicker",
-                                                                                       "m_label":      "Bitmap File:",
-                                                                                       "m_path":       ""
-                                                                               }, {
-                                                                                       "type": "choice",
-                                                                                       "m_label":      "Kind:",
-                                                                                       "m_selection":  0,
-                                                                                       "m_options":    ["normal", "checkable", "radio", "separator"]
-                                                                               }, {
-                                                                                       "type": "bool",
-                                                                                       "m_label":      "Checked",
-                                                                                       "m_value":      false
-                                                                               }],
-                                                                       "m_events":     [],
-                                                                       "m_children":   []
-                                                               }, {
-                                                                       "m_type":       4459,
-                                                                       "proportion":   0,
-                                                                       "border":       5,
-                                                                       "gbSpan":       "1,1",
-                                                                       "gbPosition":   "0,0",
-                                                                       "m_styles":     [],
-                                                                       "m_sizerFlags": [],
-                                                                       "m_properties": [{
-                                                                                       "type": "winid",
-                                                                                       "m_label":      "ID:",
-                                                                                       "m_winid":      "wxID_SAVEAS"
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Name:",
-                                                                                       "m_value":      "m_mbiSaveAs"
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Label:",
-                                                                                       "m_value":      "Save As"
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Shortcut:",
-                                                                                       "m_value":      ""
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Help String:",
-                                                                                       "m_value":      ""
-                                                                               }, {
-                                                                                       "type": "filePicker",
-                                                                                       "m_label":      "Bitmap File:",
-                                                                                       "m_path":       ""
-                                                                               }, {
-                                                                                       "type": "choice",
-                                                                                       "m_label":      "Kind:",
-                                                                                       "m_selection":  0,
-                                                                                       "m_options":    ["normal", "checkable", "radio", "separator"]
-                                                                               }, {
-                                                                                       "type": "bool",
-                                                                                       "m_label":      "Checked",
-                                                                                       "m_value":      false
-                                                                               }],
-                                                                       "m_events":     [],
-                                                                       "m_children":   []
-                                                               }, {
-                                                                       "m_type":       4459,
-                                                                       "proportion":   0,
-                                                                       "border":       5,
-                                                                       "gbSpan":       "1,1",
-                                                                       "gbPosition":   "0,0",
-                                                                       "m_styles":     [],
-                                                                       "m_sizerFlags": [],
-                                                                       "m_properties": [{
-                                                                                       "type": "winid",
-                                                                                       "m_label":      "ID:",
-                                                                                       "m_winid":      "wxID_ANY"
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Name:",
-                                                                                       "m_value":      "m_menuItem21"
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Label:",
-                                                                                       "m_value":      "Item7"
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Shortcut:",
-                                                                                       "m_value":      ""
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Help String:",
-                                                                                       "m_value":      ""
-                                                                               }, {
-                                                                                       "type": "filePicker",
-                                                                                       "m_label":      "Bitmap File:",
-                                                                                       "m_path":       ""
-                                                                               }, {
-                                                                                       "type": "choice",
-                                                                                       "m_label":      "Kind:",
-                                                                                       "m_selection":  3,
-                                                                                       "m_options":    ["normal", "checkable", "radio", "separator"]
-                                                                               }, {
-                                                                                       "type": "bool",
-                                                                                       "m_label":      "Checked",
-                                                                                       "m_value":      false
-                                                                               }],
-                                                                       "m_events":     [],
-                                                                       "m_children":   []
-                                                               }, {
-                                                                       "m_type":       4459,
-                                                                       "proportion":   0,
-                                                                       "border":       5,
-                                                                       "gbSpan":       "1,1",
-                                                                       "gbPosition":   "0,0",
-                                                                       "m_styles":     [],
-                                                                       "m_sizerFlags": [],
-                                                                       "m_properties": [{
-                                                                                       "type": "winid",
-                                                                                       "m_label":      "ID:",
-                                                                                       "m_winid":      "wxID_EXIT"
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Name:",
-                                                                                       "m_value":      "m_mbiExit"
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Label:",
-                                                                                       "m_value":      "Exit"
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Shortcut:",
-                                                                                       "m_value":      "Alt-X"
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Help String:",
-                                                                                       "m_value":      "Quit"
-                                                                               }, {
-                                                                                       "type": "filePicker",
-                                                                                       "m_label":      "Bitmap File:",
-                                                                                       "m_path":       ""
-                                                                               }, {
-                                                                                       "type": "choice",
-                                                                                       "m_label":      "Kind:",
-                                                                                       "m_selection":  0,
-                                                                                       "m_options":    ["normal", "checkable", "radio", "separator"]
-                                                                               }, {
-                                                                                       "type": "bool",
-                                                                                       "m_label":      "Checked",
-                                                                                       "m_value":      false
-                                                                               }],
-                                                                       "m_events":     [{
-                                                                                       "m_eventName":  "wxEVT_COMMAND_MENU_SELECTED",
-                                                                                       "m_eventClass": "wxCommandEvent",
-                                                                                       "m_eventHandler":       "wxCommandEventHandler",
-                                                                                       "m_functionNameAndSignature":   "OnExit(wxCommandEvent& event)",
-                                                                                       "m_description":        "Menu item has been clicked"
-                                                                               }],
-                                                                       "m_children":   []
-                                                               }]
-                                               }, {
-                                                       "m_type":       4458,
-                                                       "proportion":   0,
-                                                       "border":       5,
-                                                       "gbSpan":       "1,1",
-                                                       "gbPosition":   "0,0",
-                                                       "m_styles":     [],
-                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                                       "m_properties": [{
-                                                                       "type": "string",
-                                                                       "m_label":      "Name:",
-                                                                       "m_value":      "m_mbTools"
-                                                               }, {
-                                                                       "type": "string",
-                                                                       "m_label":      "Label:",
-                                                                       "m_value":      "Tools"
-                                                               }],
-                                                       "m_events":     [],
-                                                       "m_children":   [{
-                                                                       "m_type":       4459,
-                                                                       "proportion":   0,
-                                                                       "border":       5,
-                                                                       "gbSpan":       "1,1",
-                                                                       "gbPosition":   "0,0",
-                                                                       "m_styles":     [],
-                                                                       "m_sizerFlags": [],
-                                                                       "m_properties": [{
-                                                                                       "type": "winid",
-                                                                                       "m_label":      "ID:",
-                                                                                       "m_winid":      "wxID_PREFERENCES"
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Name:",
-                                                                                       "m_value":      "m_mbiPrefs"
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Label:",
-                                                                                       "m_value":      "Preferences"
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Shortcut:",
-                                                                                       "m_value":      ""
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Help String:",
-                                                                                       "m_value":      ""
-                                                                               }, {
-                                                                                       "type": "filePicker",
-                                                                                       "m_label":      "Bitmap File:",
-                                                                                       "m_path":       ""
-                                                                               }, {
-                                                                                       "type": "choice",
-                                                                                       "m_label":      "Kind:",
-                                                                                       "m_selection":  0,
-                                                                                       "m_options":    ["normal", "checkable", "radio", "separator"]
-                                                                               }, {
-                                                                                       "type": "bool",
-                                                                                       "m_label":      "Checked",
-                                                                                       "m_value":      false
-                                                                               }],
-                                                                       "m_events":     [{
-                                                                                       "m_eventName":  "wxEVT_COMMAND_MENU_SELECTED",
-                                                                                       "m_eventClass": "wxCommandEvent",
-                                                                                       "m_eventHandler":       "wxCommandEventHandler",
-                                                                                       "m_functionNameAndSignature":   "OnToolsPrefs(wxCommandEvent& event)",
-                                                                                       "m_description":        "Menu item has been clicked"
-                                                                               }],
-                                                                       "m_children":   []
-                                                               }]
-                                               }, {
-                                                       "m_type":       4458,
-                                                       "proportion":   0,
-                                                       "border":       5,
-                                                       "gbSpan":       "1,1",
-                                                       "gbPosition":   "0,0",
-                                                       "m_styles":     [],
-                                                       "m_sizerFlags": ["wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                                       "m_properties": [{
-                                                                       "type": "string",
-                                                                       "m_label":      "Name:",
-                                                                       "m_value":      "m_mbHelp"
-                                                               }, {
-                                                                       "type": "string",
-                                                                       "m_label":      "Label:",
-                                                                       "m_value":      "Help"
-                                                               }],
-                                                       "m_events":     [],
-                                                       "m_children":   [{
-                                                                       "m_type":       4459,
-                                                                       "proportion":   0,
-                                                                       "border":       5,
-                                                                       "gbSpan":       "1,1",
-                                                                       "gbPosition":   "0,0",
-                                                                       "m_styles":     [],
-                                                                       "m_sizerFlags": [],
-                                                                       "m_properties": [{
-                                                                                       "type": "winid",
-                                                                                       "m_label":      "ID:",
-                                                                                       "m_winid":      "wxID_ABOUT"
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Name:",
-                                                                                       "m_value":      "m_menuItem9"
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Label:",
-                                                                                       "m_value":      "About..."
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Shortcut:",
-                                                                                       "m_value":      ""
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Help String:",
-                                                                                       "m_value":      ""
-                                                                               }, {
-                                                                                       "type": "filePicker",
-                                                                                       "m_label":      "Bitmap File:",
-                                                                                       "m_path":       ""
-                                                                               }, {
-                                                                                       "type": "choice",
-                                                                                       "m_label":      "Kind:",
-                                                                                       "m_selection":  0,
-                                                                                       "m_options":    ["normal", "checkable", "radio", "separator"]
-                                                                               }, {
-                                                                                       "type": "bool",
-                                                                                       "m_label":      "Checked",
-                                                                                       "m_value":      false
-                                                                               }],
-                                                                       "m_events":     [{
-                                                                                       "m_eventName":  "wxEVT_COMMAND_MENU_SELECTED",
-                                                                                       "m_eventClass": "wxCommandEvent",
-                                                                                       "m_eventHandler":       "wxCommandEventHandler",
-                                                                                       "m_functionNameAndSignature":   "OnAbout(wxCommandEvent& event)",
-                                                                                       "m_description":        "Menu item has been clicked"
-                                                                               }],
-                                                                       "m_children":   []
-                                                               }]
-                                               }]
-                               }, {
-                                       "m_type":       4461,
-                                       "proportion":   0,
-                                       "border":       5,
-                                       "gbSpan":       "1,1",
-                                       "gbPosition":   "0,0",
-                                       "m_styles":     ["wxTB_FLAT"],
-                                       "m_sizerFlags": ["wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                       "m_properties": [{
-                                                       "type": "winid",
-                                                       "m_label":      "ID:",
-                                                       "m_winid":      "wxID_ANY"
-                                               }, {
-                                                       "type": "string",
-                                                       "m_label":      "Size:",
-                                                       "m_value":      "-1,-1"
-                                               }, {
-                                                       "type": "string",
-                                                       "m_label":      "Name:",
-                                                       "m_value":      "m_mainToolbar"
-                                               }, {
-                                                       "type": "string",
-                                                       "m_label":      "Tooltip:",
-                                                       "m_value":      ""
-                                               }, {
-                                                       "type": "string",
-                                                       "m_label":      "Bitmap Size:",
-                                                       "m_value":      "16,16"
-                                               }, {
-                                                       "type": "string",
-                                                       "m_label":      "Margins:",
-                                                       "m_value":      "-1,-1"
-                                               }, {
-                                                       "type": "string",
-                                                       "m_label":      "Padding:",
-                                                       "m_value":      "1"
-                                               }, {
-                                                       "type": "string",
-                                                       "m_label":      "Separator Size:",
-                                                       "m_value":      "5"
-                                               }],
-                                       "m_events":     [],
-                                       "m_children":   [{
-                                                       "m_type":       4462,
-                                                       "proportion":   0,
-                                                       "border":       5,
-                                                       "gbSpan":       "1,1",
-                                                       "gbPosition":   "0,0",
-                                                       "m_styles":     [],
-                                                       "m_sizerFlags": [],
-                                                       "m_properties": [{
-                                                                       "type": "winid",
-                                                                       "m_label":      "ID:",
-                                                                       "m_winid":      "wxID_NEW"
-                                                               }, {
-                                                                       "type": "string",
-                                                                       "m_label":      "Name:",
-                                                                       "m_value":      "m_tbiNew"
-                                                               }, {
-                                                                       "type": "string",
-                                                                       "m_label":      "Label:",
-                                                                       "m_value":      "New"
-                                                               }, {
-                                                                       "type": "multi-string",
-                                                                       "m_label":      "Tooltip:",
-                                                                       "m_value":      "New"
-                                                               }, {
-                                                                       "type": "string",
-                                                                       "m_label":      "Help String:",
-                                                                       "m_value":      "New"
-                                                               }, {
-                                                                       "type": "filePicker",
-                                                                       "m_label":      "Bitmap File:",
-                                                                       "m_path":       "C:\\Users\\wittend\\AppData\\Local\\Temp\\placeholder16.png"
-                                                               }, {
-                                                                       "type": "filePicker",
-                                                                       "m_label":      "Disabled-Bitmap File",
-                                                                       "m_path":       ""
-                                                               }, {
-                                                                       "type": "choice",
-                                                                       "m_label":      "Kind:",
-                                                                       "m_selection":  0,
-                                                                       "m_options":    ["normal", "checkable", "radio", "separator"]
-                                                               }],
-                                                       "m_events":     [{
-                                                                       "m_eventName":  "wxEVT_COMMAND_TOOL_CLICKED",
-                                                                       "m_eventClass": "wxCommandEvent",
-                                                                       "m_eventHandler":       "wxCommandEventHandler",
-                                                                       "m_functionNameAndSignature":   "OnNew(wxCommandEvent& event)",
-                                                                       "m_description":        "Process a wxEVT_COMMAND_TOOL_CLICKED event (a synonym for wxEVT_COMMAND_MENU_SELECTED). Pass the id of the tool"
-                                                               }],
-                                                       "m_children":   []
-                                               }, {
-                                                       "m_type":       4462,
-                                                       "proportion":   0,
-                                                       "border":       5,
-                                                       "gbSpan":       "1,1",
-                                                       "gbPosition":   "0,0",
-                                                       "m_styles":     [],
-                                                       "m_sizerFlags": [],
-                                                       "m_properties": [{
-                                                                       "type": "winid",
-                                                                       "m_label":      "ID:",
-                                                                       "m_winid":      "wxID_OPEN"
-                                                               }, {
-                                                                       "type": "string",
-                                                                       "m_label":      "Name:",
-                                                                       "m_value":      "m_rbiOpen"
-                                                               }, {
-                                                                       "type": "string",
-                                                                       "m_label":      "Label:",
-                                                                       "m_value":      "Tool Label"
-                                                               }, {
-                                                                       "type": "multi-string",
-                                                                       "m_label":      "Tooltip:",
-                                                                       "m_value":      "Open"
-                                                               }, {
-                                                                       "type": "string",
-                                                                       "m_label":      "Help String:",
-                                                                       "m_value":      "Open"
-                                                               }, {
-                                                                       "type": "filePicker",
-                                                                       "m_label":      "Bitmap File:",
-                                                                       "m_path":       "C:\\Users\\wittend\\AppData\\Local\\Temp\\placeholder16.png"
-                                                               }, {
-                                                                       "type": "filePicker",
-                                                                       "m_label":      "Disabled-Bitmap File",
-                                                                       "m_path":       ""
-                                                               }, {
-                                                                       "type": "choice",
-                                                                       "m_label":      "Kind:",
-                                                                       "m_selection":  0,
-                                                                       "m_options":    ["normal", "checkable", "radio", "separator"]
-                                                               }],
-                                                       "m_events":     [{
-                                                                       "m_eventName":  "wxEVT_COMMAND_TOOL_CLICKED",
-                                                                       "m_eventClass": "wxCommandEvent",
-                                                                       "m_eventHandler":       "wxCommandEventHandler",
-                                                                       "m_functionNameAndSignature":   "OnOpen(wxCommandEvent& event)",
-                                                                       "m_description":        "Process a wxEVT_COMMAND_TOOL_CLICKED event (a synonym for wxEVT_COMMAND_MENU_SELECTED). Pass the id of the tool"
-                                                               }],
-                                                       "m_children":   []
-                                               }]
-                               }]
-               }, {
-                       "m_type":       4421,
-                       "proportion":   0,
-                       "border":       5,
-                       "gbSpan":       "1,1",
-                       "gbPosition":   "0,0",
-                       "m_styles":     ["wxDEFAULT_DIALOG_STYLE", "wxRESIZE_BORDER", "wxCLOSE_BOX"],
-                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                       "m_properties": [{
-                                       "type": "string",
-                                       "m_label":      "Size:",
-                                       "m_value":      "460,315"
-                               }, {
-                                       "type": "string",
-                                       "m_label":      "Minimum Size:",
-                                       "m_value":      "-1,-1"
-                               }, {
-                                       "type": "string",
-                                       "m_label":      "Name:",
-                                       "m_value":      "DlgRigCtrlBase"
-                               }, {
-                                       "type": "multi-string",
-                                       "m_label":      "Tooltip:",
-                                       "m_value":      ""
-                               }, {
-                                       "type": "colour",
-                                       "m_label":      "Bg Colour:",
-                                       "colour":       "<Default>"
-                               }, {
-                                       "type": "colour",
-                                       "m_label":      "Fg Colour:",
-                                       "colour":       "<Default>"
-                               }, {
-                                       "type": "font",
-                                       "m_label":      "Font:",
-                                       "m_value":      ""
-                               }, {
-                                       "type": "bool",
-                                       "m_label":      "Hidden",
-                                       "m_value":      false
-                               }, {
-                                       "type": "bool",
-                                       "m_label":      "Disabled",
-                                       "m_value":      false
-                               }, {
-                                       "type": "bool",
-                                       "m_label":      "Focused",
-                                       "m_value":      false
-                               }, {
-                                       "type": "string",
-                                       "m_label":      "Class Name:",
-                                       "m_value":      ""
-                               }, {
-                                       "type": "string",
-                                       "m_label":      "Include File:",
-                                       "m_value":      ""
-                               }, {
-                                       "type": "string",
-                                       "m_label":      "Title:",
-                                       "m_value":      "Rig Control"
-                               }, {
-                                       "type": "virtualFolderPicker",
-                                       "m_label":      "Virtual Folder:",
-                                       "m_path":       "hamlib_trial:rig_ctrl"
-                               }, {
-                                       "type": "choice",
-                                       "m_label":      "Centre:",
-                                       "m_selection":  1,
-                                       "m_options":    ["", "wxBOTH", "wxVERTICAL", "wxHORIZONTAL"]
-                               }, {
-                                       "type": "string",
-                                       "m_label":      "File:",
-                                       "m_value":      "dlg_rig_ctrl"
-                               }, {
-                                       "type": "string",
-                                       "m_label":      "Inherited Class",
-                                       "m_value":      "DialogRigCtrl"
-                               }, {
-                                       "type": "string",
-                                       "m_label":      "Class Decorator",
-                                       "m_value":      ""
-                               }],
-                       "m_events":     [],
-                       "m_children":   [{
-                                       "m_type":       4401,
-                                       "proportion":   1,
-                                       "border":       5,
-                                       "gbSpan":       "1,1",
-                                       "gbPosition":   "0,0",
-                                       "m_styles":     [],
-                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
-                                       "m_properties": [{
-                                                       "type": "string",
-                                                       "m_label":      "Name:",
-                                                       "m_value":      "boxSizer51"
-                                               }, {
-                                                       "type": "choice",
-                                                       "m_label":      "Orientation:",
-                                                       "m_selection":  0,
-                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
-                                               }],
-                                       "m_events":     [],
-                                       "m_children":   [{
-                                                       "m_type":       4442,
-                                                       "proportion":   1,
-                                                       "border":       2,
-                                                       "gbSpan":       "1,1",
-                                                       "gbPosition":   "0,0",
-                                                       "m_styles":     ["wxBK_DEFAULT"],
-                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
-                                                       "m_properties": [{
-                                                                       "type": "winid",
-                                                                       "m_label":      "ID:",
-                                                                       "m_winid":      "wxID_ANY"
-                                                               }, {
-                                                                       "type": "string",
-                                                                       "m_label":      "Size:",
-                                                                       "m_value":      "-1, -1"
-                                                               }, {
-                                                                       "type": "string",
-                                                                       "m_label":      "Minimum Size:",
-                                                                       "m_value":      "-1,-1"
-                                                               }, {
-                                                                       "type": "string",
-                                                                       "m_label":      "Name:",
-                                                                       "m_value":      "m_notebook53"
-                                                               }, {
-                                                                       "type": "multi-string",
-                                                                       "m_label":      "Tooltip:",
-                                                                       "m_value":      ""
-                                                               }, {
-                                                                       "type": "colour",
-                                                                       "m_label":      "Bg Colour:",
-                                                                       "colour":       "<Default>"
-                                                               }, {
-                                                                       "type": "colour",
-                                                                       "m_label":      "Fg Colour:",
-                                                                       "colour":       "<Default>"
-                                                               }, {
-                                                                       "type": "font",
-                                                                       "m_label":      "Font:",
-                                                                       "m_value":      ""
-                                                               }, {
-                                                                       "type": "bool",
-                                                                       "m_label":      "Hidden",
-                                                                       "m_value":      false
-                                                               }, {
-                                                                       "type": "bool",
-                                                                       "m_label":      "Disabled",
-                                                                       "m_value":      false
-                                                               }, {
-                                                                       "type": "bool",
-                                                                       "m_label":      "Focused",
-                                                                       "m_value":      false
-                                                               }, {
-                                                                       "type": "string",
-                                                                       "m_label":      "Class Name:",
-                                                                       "m_value":      ""
-                                                               }, {
-                                                                       "type": "string",
-                                                                       "m_label":      "Include File:",
-                                                                       "m_value":      ""
-                                                               }],
-                                                       "m_events":     [],
-                                                       "m_children":   [{
-                                                                       "m_type":       4441,
-                                                                       "proportion":   0,
-                                                                       "border":       5,
-                                                                       "gbSpan":       "1,1",
-                                                                       "gbPosition":   "0,0",
-                                                                       "m_styles":     ["wxTAB_TRAVERSAL"],
-                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                                                       "m_properties": [{
-                                                                                       "type": "winid",
-                                                                                       "m_label":      "ID:",
-                                                                                       "m_winid":      "wxID_ANY"
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Size:",
-                                                                                       "m_value":      "-1,-1"
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Minimum Size:",
-                                                                                       "m_value":      "-1,-1"
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Name:",
-                                                                                       "m_value":      "m_panelHDWPTT"
-                                                                               }, {
-                                                                                       "type": "multi-string",
-                                                                                       "m_label":      "Tooltip:",
-                                                                                       "m_value":      "Hardware Push-to-Talk"
-                                                                               }, {
-                                                                                       "type": "colour",
-                                                                                       "m_label":      "Bg Colour:",
-                                                                                       "colour":       "<Default>"
-                                                                               }, {
-                                                                                       "type": "colour",
-                                                                                       "m_label":      "Fg Colour:",
-                                                                                       "colour":       "<Default>"
-                                                                               }, {
-                                                                                       "type": "font",
-                                                                                       "m_label":      "Font:",
-                                                                                       "m_value":      ""
-                                                                               }, {
-                                                                                       "type": "bool",
-                                                                                       "m_label":      "Hidden",
-                                                                                       "m_value":      false
-                                                                               }, {
-                                                                                       "type": "bool",
-                                                                                       "m_label":      "Disabled",
-                                                                                       "m_value":      false
-                                                                               }, {
-                                                                                       "type": "bool",
-                                                                                       "m_label":      "Focused",
-                                                                                       "m_value":      false
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Class Name:",
-                                                                                       "m_value":      ""
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Include File:",
-                                                                                       "m_value":      ""
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Label:",
-                                                                                       "m_value":      "Hardware PTT"
-                                                                               }, {
-                                                                                       "type": "filePicker",
-                                                                                       "m_label":      "Bitmap File:",
-                                                                                       "m_path":       ""
-                                                                               }, {
-                                                                                       "type": "bool",
-                                                                                       "m_label":      "Selected",
-                                                                                       "m_value":      true
-                                                                               }],
-                                                                       "m_events":     [],
-                                                                       "m_children":   [{
-                                                                                       "m_type":       4403,
-                                                                                       "proportion":   1,
-                                                                                       "border":       5,
-                                                                                       "gbSpan":       "1,1",
-                                                                                       "gbPosition":   "0,0",
-                                                                                       "m_styles":     [],
-                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
-                                                                                       "m_properties": [{
-                                                                                                       "type": "string",
-                                                                                                       "m_label":      "Name:",
-                                                                                                       "m_value":      "flexGridSizer135"
-                                                                                               }, {
-                                                                                                       "type": "string",
-                                                                                                       "m_label":      "# Columns:",
-                                                                                                       "m_value":      "1"
-                                                                                               }, {
-                                                                                                       "type": "string",
-                                                                                                       "m_label":      "# Rows:",
-                                                                                                       "m_value":      "3"
-                                                                                               }, {
-                                                                                                       "type": "string",
-                                                                                                       "m_label":      "Growable columns:",
-                                                                                                       "m_value":      "1"
-                                                                                               }, {
-                                                                                                       "type": "string",
-                                                                                                       "m_label":      "Growable rows:",
-                                                                                                       "m_value":      "3"
-                                                                                               }, {
-                                                                                                       "type": "string",
-                                                                                                       "m_label":      "Horizontal gap:",
-                                                                                                       "m_value":      "0"
-                                                                                               }, {
-                                                                                                       "type": "string",
-                                                                                                       "m_label":      "Vertical gap:",
-                                                                                                       "m_value":      "0"
-                                                                                               }],
-                                                                                       "m_events":     [],
-                                                                                       "m_children":   [{
-                                                                                                       "m_type":       4449,
-                                                                                                       "proportion":   0,
-                                                                                                       "border":       2,
-                                                                                                       "gbSpan":       "1,1",
-                                                                                                       "gbPosition":   "0,0",
-                                                                                                       "m_styles":     [],
-                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
-                                                                                                       "m_properties": [{
-                                                                                                                       "type": "string",
-                                                                                                                       "m_label":      "Name:",
-                                                                                                                       "m_value":      "staticBoxSizer169"
-                                                                                                               }, {
-                                                                                                                       "type": "choice",
-                                                                                                                       "m_label":      "Orientation:",
-                                                                                                                       "m_selection":  0,
-                                                                                                                       "m_options":    ["Vertical", "Horizontal"]
-                                                                                                               }, {
-                                                                                                                       "type": "string",
-                                                                                                                       "m_label":      "Label:",
-                                                                                                                       "m_value":      ""
-                                                                                                               }],
-                                                                                                       "m_events":     [],
-                                                                                                       "m_children":   [{
-                                                                                                                       "m_type":       4415,
-                                                                                                                       "proportion":   1,
-                                                                                                                       "border":       2,
-                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                       "m_styles":     [],
-                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_LEFT", "wxALIGN_CENTER_VERTICAL"],
-                                                                                                                       "m_properties": [{
-                                                                                                                                       "type": "winid",
-                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                       "m_value":      "m_checkBox7537"
-                                                                                                                               }, {
-                                                                                                                                       "type": "multi-string",
-                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "colour",
-                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                       "colour":       "<Default>"
-                                                                                                                               }, {
-                                                                                                                                       "type": "colour",
-                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                       "colour":       "<Default>"
-                                                                                                                               }, {
-                                                                                                                                       "type": "font",
-                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                       "m_value":      "PTT tone on right audio channel"
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Value:",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }],
-                                                                                                                       "m_events":     [],
-                                                                                                                       "m_children":   []
-                                                                                                               }]
-                                                                                               }, {
-                                                                                                       "m_type":       4452,
-                                                                                                       "proportion":   0,
-                                                                                                       "border":       2,
-                                                                                                       "gbSpan":       "1,1",
-                                                                                                       "gbPosition":   "0,0",
-                                                                                                       "m_styles":     [],
-                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_LEFT", "wxALIGN_TOP"],
-                                                                                                       "m_properties": [{
-                                                                                                                       "type": "string",
-                                                                                                                       "m_label":      "Name:",
-                                                                                                                       "m_value":      "gridSizer159"
-                                                                                                               }, {
-                                                                                                                       "type": "string",
-                                                                                                                       "m_label":      "# Columns:",
-                                                                                                                       "m_value":      "1"
-                                                                                                               }, {
-                                                                                                                       "type": "string",
-                                                                                                                       "m_label":      "# Rows:",
-                                                                                                                       "m_value":      "1"
-                                                                                                               }, {
-                                                                                                                       "type": "string",
-                                                                                                                       "m_label":      "Horizontal gap:",
-                                                                                                                       "m_value":      "0"
-                                                                                                               }, {
-                                                                                                                       "type": "string",
-                                                                                                                       "m_label":      "Vertical gap:",
-                                                                                                                       "m_value":      "0"
-                                                                                                               }],
-                                                                                                       "m_events":     [],
-                                                                                                       "m_children":   [{
-                                                                                                                       "m_type":       4449,
-                                                                                                                       "proportion":   0,
-                                                                                                                       "border":       2,
-                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                       "m_styles":     [],
-                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND", "wxALIGN_TOP"],
-                                                                                                                       "m_properties": [{
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                       "m_value":      "staticBoxSizer157"
-                                                                                                                               }, {
-                                                                                                                                       "type": "choice",
-                                                                                                                                       "m_label":      "Orientation:",
-                                                                                                                                       "m_selection":  1,
-                                                                                                                                       "m_options":    ["Vertical", "Horizontal"]
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                       "m_value":      "h/w ptt device pin"
-                                                                                                                               }],
-                                                                                                                       "m_events":     [],
-                                                                                                                       "m_children":   [{
-                                                                                                                                       "m_type":       4401,
-                                                                                                                                       "proportion":   1,
-                                                                                                                                       "border":       2,
-                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                       "m_styles":     [],
-                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                                                                                                                       "m_properties": [{
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                       "m_value":      "boxSizer175"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "choice",
-                                                                                                                                                       "m_label":      "Orientation:",
-                                                                                                                                                       "m_selection":  0,
-                                                                                                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
-                                                                                                                                               }],
-                                                                                                                                       "m_events":     [],
-                                                                                                                                       "m_children":   [{
-                                                                                                                                                       "m_type":       4415,
-                                                                                                                                                       "proportion":   0,
-                                                                                                                                                       "border":       2,
-                                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                                       "m_styles":     [],
-                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_TOP"],
-                                                                                                                                                       "m_properties": [{
-                                                                                                                                                                       "type": "winid",
-                                                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                                       "m_value":      "m_checkBox9112"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "colour",
-                                                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "colour",
-                                                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "font",
-                                                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                                                       "m_value":      false
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                                                       "m_value":      false
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                                                       "m_value":      false
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                                                       "m_value":      "Use separate PTT device pin"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                       "m_label":      "Value:",
-                                                                                                                                                                       "m_value":      false
-                                                                                                                                                               }],
-                                                                                                                                                       "m_events":     [],
-                                                                                                                                                       "m_children":   []
-                                                                                                                                               }, {
-                                                                                                                                                       "m_type":       4405,
-                                                                                                                                                       "proportion":   0,
-                                                                                                                                                       "border":       5,
-                                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                                       "m_styles":     [],
-                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                                                                                                                                       "m_properties": [{
-                                                                                                                                                                       "type": "winid",
-                                                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                                       "m_value":      "m_staticText173"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "colour",
-                                                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "colour",
-                                                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "font",
-                                                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                                                       "m_value":      false
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                                                       "m_value":      false
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                                                       "m_value":      false
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                                                       "m_value":      "Device:"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Wrap:",
-                                                                                                                                                                       "m_value":      "-1"
-                                                                                                                                                               }],
-                                                                                                                                                       "m_events":     [],
-                                                                                                                                                       "m_children":   []
-                                                                                                                                               }, {
-                                                                                                                                                       "m_type":       4410,
-                                                                                                                                                       "proportion":   0,
-                                                                                                                                                       "border":       2,
-                                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                                       "m_styles":     [],
-                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                                                                                                                                       "m_properties": [{
-                                                                                                                                                                       "type": "winid",
-                                                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                                       "m_value":      "m_comboBox9313"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "colour",
-                                                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "colour",
-                                                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "font",
-                                                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                                                       "m_value":      false
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                                                       "m_value":      false
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                                                       "m_value":      false
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                                       "m_label":      "ComboBox Choices:",
-                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Selection:",
-                                                                                                                                                                       "m_value":      "-1"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Value:",
-                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                               }],
-                                                                                                                                                       "m_events":     [],
-                                                                                                                                                       "m_children":   []
-                                                                                                                                               }]
-                                                                                                                               }, {
-                                                                                                                                       "m_type":       4401,
-                                                                                                                                       "proportion":   1,
-                                                                                                                                       "border":       2,
-                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                       "m_styles":     [],
-                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                                                                                                                       "m_properties": [{
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                       "m_value":      "boxSizer171"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "choice",
-                                                                                                                                                       "m_label":      "Orientation:",
-                                                                                                                                                       "m_selection":  1,
-                                                                                                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
-                                                                                                                                               }],
-                                                                                                                                       "m_events":     [],
-                                                                                                                                       "m_children":   [{
-                                                                                                                                                       "m_type":       4401,
-                                                                                                                                                       "proportion":   1,
-                                                                                                                                                       "border":       2,
-                                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                                       "m_styles":     [],
-                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_HORIZONTAL"],
-                                                                                                                                                       "m_properties": [{
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                                       "m_value":      "boxSizer12714"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "choice",
-                                                                                                                                                                       "m_label":      "Orientation:",
-                                                                                                                                                                       "m_selection":  0,
-                                                                                                                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
-                                                                                                                                                               }],
-                                                                                                                                                       "m_events":     [],
-                                                                                                                                                       "m_children":   [{
-                                                                                                                                                                       "m_type":       4416,
-                                                                                                                                                                       "proportion":   1,
-                                                                                                                                                                       "border":       2,
-                                                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                                                       "m_styles":     ["wxRA_SPECIFY_COLS"],
-                                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_HORIZONTAL"],
-                                                                                                                                                                       "m_properties": [{
-                                                                                                                                                                                       "type": "winid",
-                                                                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                                                       "m_value":      "m_radioBox10115"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "colour",
-                                                                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "colour",
-                                                                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "font",
-                                                                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                                                                       "m_value":      false
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                                                                       "m_value":      false
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                                                                       "m_value":      false
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                                                                       "m_value":      "Use RTS"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                                                       "m_label":      "Choices:",
-                                                                                                                                                                                       "m_value":      "Normal (V-);Inverted (V+)"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Selection:",
-                                                                                                                                                                                       "m_value":      "0"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Major Dimension:",
-                                                                                                                                                                                       "m_value":      "2"
-                                                                                                                                                                               }],
-                                                                                                                                                                       "m_events":     [],
-                                                                                                                                                                       "m_children":   []
-                                                                                                                                                               }, {
-                                                                                                                                                                       "m_type":       4416,
-                                                                                                                                                                       "proportion":   1,
-                                                                                                                                                                       "border":       2,
-                                                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                                                       "m_styles":     ["wxRA_SPECIFY_COLS"],
-                                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_HORIZONTAL"],
-                                                                                                                                                                       "m_properties": [{
-                                                                                                                                                                                       "type": "winid",
-                                                                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                                                       "m_value":      "m_radioBox10316"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "colour",
-                                                                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "colour",
-                                                                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "font",
-                                                                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                                                                       "m_value":      false
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                                                                       "m_value":      false
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                                                                       "m_value":      false
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                                                                       "m_value":      "Use DTR"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                                                       "m_label":      "Choices:",
-                                                                                                                                                                                       "m_value":      "Normal (V-);Inverted (V+)"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Selection:",
-                                                                                                                                                                                       "m_value":      "0"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Major Dimension:",
-                                                                                                                                                                                       "m_value":      "2"
-                                                                                                                                                                               }],
-                                                                                                                                                                       "m_events":     [],
-                                                                                                                                                                       "m_children":   []
-                                                                                                                                                               }, {
-                                                                                                                                                                       "m_type":       4401,
-                                                                                                                                                                       "proportion":   0,
-                                                                                                                                                                       "border":       2,
-                                                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                                                       "m_styles":     [],
-                                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_HORIZONTAL", "wxALIGN_CENTER_VERTICAL"],
-                                                                                                                                                                       "m_properties": [{
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                                                       "m_value":      "boxSizer13118"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "choice",
-                                                                                                                                                                                       "m_label":      "Orientation:",
-                                                                                                                                                                                       "m_selection":  1,
-                                                                                                                                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
-                                                                                                                                                                               }],
-                                                                                                                                                                       "m_events":     [],
-                                                                                                                                                                       "m_children":   [{
-                                                                                                                                                                                       "m_type":       4400,
-                                                                                                                                                                                       "proportion":   1,
-                                                                                                                                                                                       "border":       2,
-                                                                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                                                                       "m_styles":     [],
-                                                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                                                                                                                                                                       "m_properties": [{
-                                                                                                                                                                                                       "type": "winid",
-                                                                                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                                                                                               }, {
-                                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                                                                               }, {
-                                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                                                                               }, {
-                                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                                                                       "m_value":      "m_button11319"
-                                                                                                                                                                                               }, {
-                                                                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                                                               }, {
-                                                                                                                                                                                                       "type": "colour",
-                                                                                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                                                                               }, {
-                                                                                                                                                                                                       "type": "colour",
-                                                                                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                                                                               }, {
-                                                                                                                                                                                                       "type": "font",
-                                                                                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                                                               }, {
-                                                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                                                                                       "m_value":      false
-                                                                                                                                                                                               }, {
-                                                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                                                                                       "m_value":      false
-                                                                                                                                                                                               }, {
-                                                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                                                                                       "m_value":      false
-                                                                                                                                                                                               }, {
-                                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                                                               }, {
-                                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                                                               }, {
-                                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                                                                                       "m_value":      "Initialize"
-                                                                                                                                                                                               }, {
-                                                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                                                       "m_label":      "Default Button",
-                                                                                                                                                                                                       "m_value":      false
-                                                                                                                                                                                               }, {
-                                                                                                                                                                                                       "type": "filePicker",
-                                                                                                                                                                                                       "m_label":      "Bitmap File:",
-                                                                                                                                                                                                       "m_path":       ""
-                                                                                                                                                                                               }, {
-                                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                                       "m_label":      "Margins:",
-                                                                                                                                                                                                       "m_value":      "2,2"
-                                                                                                                                                                                               }],
-                                                                                                                                                                                       "m_events":     [],
-                                                                                                                                                                                       "m_children":   []
-                                                                                                                                                                               }]
-                                                                                                                                                               }]
-                                                                                                                                               }]
-                                                                                                                               }]
-                                                                                                               }]
-                                                                                               }, {
-                                                                                                       "m_type":       4449,
-                                                                                                       "proportion":   0,
-                                                                                                       "border":       2,
-                                                                                                       "gbSpan":       "1,1",
-                                                                                                       "gbPosition":   "0,0",
-                                                                                                       "m_styles":     [],
-                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND", "wxALIGN_LEFT"],
-                                                                                                       "m_properties": [{
-                                                                                                                       "type": "string",
-                                                                                                                       "m_label":      "Name:",
-                                                                                                                       "m_value":      "staticBoxSizer79420"
-                                                                                                               }, {
-                                                                                                                       "type": "choice",
-                                                                                                                       "m_label":      "Orientation:",
-                                                                                                                       "m_selection":  1,
-                                                                                                                       "m_options":    ["Vertical", "Horizontal"]
-                                                                                                               }, {
-                                                                                                                       "type": "string",
-                                                                                                                       "m_label":      "Label:",
-                                                                                                                       "m_value":      "PTT delay for all CAT/PTT types"
-                                                                                                               }],
-                                                                                                       "m_events":     [],
-                                                                                                       "m_children":   [{
-                                                                                                                       "m_type":       4405,
-                                                                                                                       "proportion":   0,
-                                                                                                                       "border":       2,
-                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                       "m_styles":     [],
-                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_VERTICAL"],
-                                                                                                                       "m_properties": [{
-                                                                                                                                       "type": "winid",
-                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                       "m_value":      "m_staticText177"
-                                                                                                                               }, {
-                                                                                                                                       "type": "multi-string",
-                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "colour",
-                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                       "colour":       "<Default>"
-                                                                                                                               }, {
-                                                                                                                                       "type": "colour",
-                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                       "colour":       "<Default>"
-                                                                                                                               }, {
-                                                                                                                                       "type": "font",
-                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "multi-string",
-                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                       "m_value":      "Start of xmit delay"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Wrap:",
-                                                                                                                                       "m_value":      "-1"
-                                                                                                                               }],
-                                                                                                                       "m_events":     [],
-                                                                                                                       "m_children":   []
-                                                                                                               }, {
-                                                                                                                       "m_type":       4419,
-                                                                                                                       "proportion":   1,
-                                                                                                                       "border":       2,
-                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                       "m_styles":     ["wxSL_HORIZONTAL"],
-                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_HORIZONTAL", "wxALIGN_CENTER_VERTICAL"],
-                                                                                                                       "m_properties": [{
-                                                                                                                                       "type": "winid",
-                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                       "m_value":      "m_slider10721"
-                                                                                                                               }, {
-                                                                                                                                       "type": "multi-string",
-                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "colour",
-                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                       "colour":       "<Default>"
-                                                                                                                               }, {
-                                                                                                                                       "type": "colour",
-                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                       "colour":       "<Default>"
-                                                                                                                               }, {
-                                                                                                                                       "type": "font",
-                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Value:",
-                                                                                                                                       "m_value":      "50"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Min value:",
-                                                                                                                                       "m_value":      "0"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Max value:",
-                                                                                                                                       "m_value":      "100"
-                                                                                                                               }],
-                                                                                                                       "m_events":     [],
-                                                                                                                       "m_children":   []
-                                                                                                               }, {
-                                                                                                                       "m_type":       4405,
-                                                                                                                       "proportion":   0,
-                                                                                                                       "border":       2,
-                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                       "m_styles":     [],
-                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_VERTICAL"],
-                                                                                                                       "m_properties": [{
-                                                                                                                                       "type": "winid",
-                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                       "m_value":      "m_staticText179"
-                                                                                                                               }, {
-                                                                                                                                       "type": "multi-string",
-                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "colour",
-                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                       "colour":       "<Default>"
-                                                                                                                               }, {
-                                                                                                                                       "type": "colour",
-                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                       "colour":       "<Default>"
-                                                                                                                               }, {
-                                                                                                                                       "type": "font",
-                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "multi-string",
-                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                       "m_value":      "End of xmit delay:"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Wrap:",
-                                                                                                                                       "m_value":      "-1"
-                                                                                                                               }],
-                                                                                                                       "m_events":     [],
-                                                                                                                       "m_children":   []
-                                                                                                               }, {
-                                                                                                                       "m_type":       4419,
-                                                                                                                       "proportion":   0,
-                                                                                                                       "border":       2,
-                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                       "m_styles":     ["wxSL_HORIZONTAL"],
-                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_HORIZONTAL", "wxALIGN_CENTER_VERTICAL"],
-                                                                                                                       "m_properties": [{
-                                                                                                                                       "type": "winid",
-                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                       "m_value":      "m_slider10922"
-                                                                                                                               }, {
-                                                                                                                                       "type": "multi-string",
-                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "colour",
-                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                       "colour":       "<Default>"
-                                                                                                                               }, {
-                                                                                                                                       "type": "colour",
-                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                       "colour":       "<Default>"
-                                                                                                                               }, {
-                                                                                                                                       "type": "font",
-                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Value:",
-                                                                                                                                       "m_value":      "50"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Min value:",
-                                                                                                                                       "m_value":      "0"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Max value:",
-                                                                                                                                       "m_value":      "100"
-                                                                                                                               }],
-                                                                                                                       "m_events":     [],
-                                                                                                                       "m_children":   []
-                                                                                                               }]
-                                                                                               }]
-                                                                               }]
-                                                               }, {
-                                                                       "m_type":       4441,
-                                                                       "proportion":   0,
-                                                                       "border":       5,
-                                                                       "gbSpan":       "1,1",
-                                                                       "gbPosition":   "0,0",
-                                                                       "m_styles":     ["wxTAB_TRAVERSAL"],
-                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                                                       "m_properties": [{
-                                                                                       "type": "winid",
-                                                                                       "m_label":      "ID:",
-                                                                                       "m_winid":      "wxID_ANY"
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Size:",
-                                                                                       "m_value":      "-1,-1"
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Minimum Size:",
-                                                                                       "m_value":      "-1,-1"
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Name:",
-                                                                                       "m_value":      "m_panelRIGCat"
-                                                                               }, {
-                                                                                       "type": "multi-string",
-                                                                                       "m_label":      "Tooltip:",
-                                                                                       "m_value":      "RigCat"
-                                                                               }, {
-                                                                                       "type": "colour",
-                                                                                       "m_label":      "Bg Colour:",
-                                                                                       "colour":       "<Default>"
-                                                                               }, {
-                                                                                       "type": "colour",
-                                                                                       "m_label":      "Fg Colour:",
-                                                                                       "colour":       "<Default>"
-                                                                               }, {
-                                                                                       "type": "font",
-                                                                                       "m_label":      "Font:",
-                                                                                       "m_value":      ""
-                                                                               }, {
-                                                                                       "type": "bool",
-                                                                                       "m_label":      "Hidden",
-                                                                                       "m_value":      false
-                                                                               }, {
-                                                                                       "type": "bool",
-                                                                                       "m_label":      "Disabled",
-                                                                                       "m_value":      false
-                                                                               }, {
-                                                                                       "type": "bool",
-                                                                                       "m_label":      "Focused",
-                                                                                       "m_value":      false
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Class Name:",
-                                                                                       "m_value":      ""
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Include File:",
-                                                                                       "m_value":      ""
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Label:",
-                                                                                       "m_value":      "RigCAT"
-                                                                               }, {
-                                                                                       "type": "filePicker",
-                                                                                       "m_label":      "Bitmap File:",
-                                                                                       "m_path":       ""
-                                                                               }, {
-                                                                                       "type": "bool",
-                                                                                       "m_label":      "Selected",
-                                                                                       "m_value":      false
-                                                                               }],
-                                                                       "m_events":     [],
-                                                                       "m_children":   [{
-                                                                                       "m_type":       4401,
-                                                                                       "proportion":   1,
-                                                                                       "border":       5,
-                                                                                       "gbSpan":       "1,1",
-                                                                                       "gbPosition":   "0,0",
-                                                                                       "m_styles":     [],
-                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
-                                                                                       "m_properties": [{
-                                                                                                       "type": "string",
-                                                                                                       "m_label":      "Name:",
-                                                                                                       "m_value":      "boxSizer67"
-                                                                                               }, {
-                                                                                                       "type": "choice",
-                                                                                                       "m_label":      "Orientation:",
-                                                                                                       "m_selection":  0,
-                                                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
-                                                                                               }],
-                                                                                       "m_events":     [],
-                                                                                       "m_children":   [{
-                                                                                                       "m_type":       4417,
-                                                                                                       "proportion":   0,
-                                                                                                       "border":       2,
-                                                                                                       "gbSpan":       "1,1",
-                                                                                                       "gbPosition":   "0,0",
-                                                                                                       "m_styles":     [],
-                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_HORIZONTAL"],
-                                                                                                       "m_properties": [{
-                                                                                                                       "type": "winid",
-                                                                                                                       "m_label":      "ID:",
-                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                               }, {
-                                                                                                                       "type": "string",
-                                                                                                                       "m_label":      "Size:",
-                                                                                                                       "m_value":      "-1,-1"
-                                                                                                               }, {
-                                                                                                                       "type": "string",
-                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                       "m_value":      "-1,-1"
-                                                                                                               }, {
-                                                                                                                       "type": "string",
-                                                                                                                       "m_label":      "Name:",
-                                                                                                                       "m_value":      "m_radioButton185"
-                                                                                                               }, {
-                                                                                                                       "type": "multi-string",
-                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                       "m_value":      ""
-                                                                                                               }, {
-                                                                                                                       "type": "colour",
-                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                       "colour":       "<Default>"
-                                                                                                               }, {
-                                                                                                                       "type": "colour",
-                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                       "colour":       "<Default>"
-                                                                                                               }, {
-                                                                                                                       "type": "font",
-                                                                                                                       "m_label":      "Font:",
-                                                                                                                       "m_value":      ""
-                                                                                                               }, {
-                                                                                                                       "type": "bool",
-                                                                                                                       "m_label":      "Hidden",
-                                                                                                                       "m_value":      false
-                                                                                                               }, {
-                                                                                                                       "type": "bool",
-                                                                                                                       "m_label":      "Disabled",
-                                                                                                                       "m_value":      false
-                                                                                                               }, {
-                                                                                                                       "type": "bool",
-                                                                                                                       "m_label":      "Focused",
-                                                                                                                       "m_value":      false
-                                                                                                               }, {
-                                                                                                                       "type": "string",
-                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                       "m_value":      ""
-                                                                                                               }, {
-                                                                                                                       "type": "string",
-                                                                                                                       "m_label":      "Include File:",
-                                                                                                                       "m_value":      ""
-                                                                                                               }, {
-                                                                                                                       "type": "string",
-                                                                                                                       "m_label":      "Label:",
-                                                                                                                       "m_value":      "Use RigCAT"
-                                                                                                               }, {
-                                                                                                                       "type": "bool",
-                                                                                                                       "m_label":      "Value:",
-                                                                                                                       "m_value":      true
-                                                                                                               }],
-                                                                                                       "m_events":     [],
-                                                                                                       "m_children":   []
-                                                                                               }, {
-                                                                                                       "m_type":       4449,
-                                                                                                       "proportion":   1,
-                                                                                                       "border":       2,
-                                                                                                       "gbSpan":       "1,1",
-                                                                                                       "gbPosition":   "0,0",
-                                                                                                       "m_styles":     [],
-                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND", "wxALIGN_TOP"],
-                                                                                                       "m_properties": [{
-                                                                                                                       "type": "string",
-                                                                                                                       "m_label":      "Name:",
-                                                                                                                       "m_value":      "staticBoxSizer183"
-                                                                                                               }, {
-                                                                                                                       "type": "choice",
-                                                                                                                       "m_label":      "Orientation:",
-                                                                                                                       "m_selection":  0,
-                                                                                                                       "m_options":    ["Vertical", "Horizontal"]
-                                                                                                               }, {
-                                                                                                                       "type": "string",
-                                                                                                                       "m_label":      "Label:",
-                                                                                                                       "m_value":      ""
-                                                                                                               }],
-                                                                                                       "m_events":     [],
-                                                                                                       "m_children":   [{
-                                                                                                                       "m_type":       4403,
-                                                                                                                       "proportion":   0,
-                                                                                                                       "border":       2,
-                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                       "m_styles":     [],
-                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                                                                                                       "m_properties": [{
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                       "m_value":      "flexGridSizer187"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "# Columns:",
-                                                                                                                                       "m_value":      "1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "# Rows:",
-                                                                                                                                       "m_value":      "1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Growable columns:",
-                                                                                                                                       "m_value":      "1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Growable rows:",
-                                                                                                                                       "m_value":      "1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Horizontal gap:",
-                                                                                                                                       "m_value":      "0"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Vertical gap:",
-                                                                                                                                       "m_value":      "0"
-                                                                                                                               }],
-                                                                                                                       "m_events":     [],
-                                                                                                                       "m_children":   [{
-                                                                                                                                       "m_type":       4403,
-                                                                                                                                       "proportion":   1,
-                                                                                                                                       "border":       2,
-                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                       "m_styles":     [],
-                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
-                                                                                                                                       "m_properties": [{
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                       "m_value":      "flexGridSizer204"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "# Columns:",
-                                                                                                                                                       "m_value":      "4"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "# Rows:",
-                                                                                                                                                       "m_value":      "3"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Growable columns:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Growable rows:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Horizontal gap:",
-                                                                                                                                                       "m_value":      "0"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Vertical gap:",
-                                                                                                                                                       "m_value":      "0"
-                                                                                                                                               }],
-                                                                                                                                       "m_events":     [],
-                                                                                                                                       "m_children":   [{
-                                                                                                                                                       "m_type":       4401,
-                                                                                                                                                       "proportion":   1,
-                                                                                                                                                       "border":       2,
-                                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                                       "m_styles":     [],
-                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND", "wxALIGN_CENTER_VERTICAL"],
-                                                                                                                                                       "m_properties": [{
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                                       "m_value":      "boxSizer193"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "choice",
-                                                                                                                                                                       "m_label":      "Orientation:",
-                                                                                                                                                                       "m_selection":  1,
-                                                                                                                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
-                                                                                                                                                               }],
-                                                                                                                                                       "m_events":     [],
-                                                                                                                                                       "m_children":   [{
-                                                                                                                                                                       "m_type":       4405,
-                                                                                                                                                                       "proportion":   0,
-                                                                                                                                                                       "border":       2,
-                                                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                                                       "m_styles":     [],
-                                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_VERTICAL"],
-                                                                                                                                                                       "m_properties": [{
-                                                                                                                                                                                       "type": "winid",
-                                                                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                                                       "m_value":      "m_staticText189"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "colour",
-                                                                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "colour",
-                                                                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "font",
-                                                                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                                                                       "m_value":      false
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                                                                       "m_value":      false
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                                                                       "m_value":      false
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                                                                       "m_value":      "File:"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Wrap:",
-                                                                                                                                                                                       "m_value":      "-1"
-                                                                                                                                                                               }],
-                                                                                                                                                                       "m_events":     [],
-                                                                                                                                                                       "m_children":   []
-                                                                                                                                                               }, {
-                                                                                                                                                                       "m_type":       4406,
-                                                                                                                                                                       "proportion":   0,
-                                                                                                                                                                       "border":       2,
-                                                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                                                       "m_styles":     [],
-                                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_VERTICAL"],
-                                                                                                                                                                       "m_properties": [{
-                                                                                                                                                                                       "type": "winid",
-                                                                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                                                       "m_value":      "m_textCtrl191"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "colour",
-                                                                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "colour",
-                                                                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "font",
-                                                                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                                                                       "m_value":      false
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                                                                       "m_value":      false
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                                                                       "m_value":      false
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Value:",
-                                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Max Length:",
-                                                                                                                                                                                       "m_value":      "0"
-                                                                                                                                                                               }],
-                                                                                                                                                                       "m_events":     [],
-                                                                                                                                                                       "m_children":   []
-                                                                                                                                                               }]
-                                                                                                                                               }, {
-                                                                                                                                                       "m_type":       4401,
-                                                                                                                                                       "proportion":   1,
-                                                                                                                                                       "border":       5,
-                                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                                       "m_styles":     [],
-                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
-                                                                                                                                                       "m_properties": [{
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                                       "m_value":      "boxSizer206"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "choice",
-                                                                                                                                                                       "m_label":      "Orientation:",
-                                                                                                                                                                       "m_selection":  0,
-                                                                                                                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
-                                                                                                                                                               }],
-                                                                                                                                                       "m_events":     [],
-                                                                                                                                                       "m_children":   [{
-                                                                                                                                                                       "m_type":       4400,
-                                                                                                                                                                       "proportion":   0,
-                                                                                                                                                                       "border":       2,
-                                                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                                                       "m_styles":     [],
-                                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_VERTICAL"],
-                                                                                                                                                                       "m_properties": [{
-                                                                                                                                                                                       "type": "winid",
-                                                                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                                                       "m_value":      "m_button208"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "colour",
-                                                                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "colour",
-                                                                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "font",
-                                                                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                                                                       "m_value":      false
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                                                                       "m_value":      false
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                                                                       "m_value":      false
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                                                                       "m_value":      "Open"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                                       "m_label":      "Default Button",
-                                                                                                                                                                                       "m_value":      false
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "filePicker",
-                                                                                                                                                                                       "m_label":      "Bitmap File:",
-                                                                                                                                                                                       "m_path":       ""
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Margins:",
-                                                                                                                                                                                       "m_value":      "2,2"
-                                                                                                                                                                               }],
-                                                                                                                                                                       "m_events":     [],
-                                                                                                                                                                       "m_children":   []
-                                                                                                                                                               }]
-                                                                                                                                               }, {
-                                                                                                                                                       "m_type":       4401,
-                                                                                                                                                       "proportion":   1,
-                                                                                                                                                       "border":       2,
-                                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                                       "m_styles":     [],
-                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND", "wxALIGN_CENTER_VERTICAL"],
-                                                                                                                                                       "m_properties": [{
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                                       "m_value":      "boxSizer19329"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "choice",
-                                                                                                                                                                       "m_label":      "Orientation:",
-                                                                                                                                                                       "m_selection":  1,
-                                                                                                                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
-                                                                                                                                                               }],
-                                                                                                                                                       "m_events":     [],
-                                                                                                                                                       "m_children":   [{
-                                                                                                                                                                       "m_type":       4405,
-                                                                                                                                                                       "proportion":   0,
-                                                                                                                                                                       "border":       2,
-                                                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                                                       "m_styles":     [],
-                                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_VERTICAL"],
-                                                                                                                                                                       "m_properties": [{
-                                                                                                                                                                                       "type": "winid",
-                                                                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                                                       "m_value":      "m_staticText18930"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "colour",
-                                                                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "colour",
-                                                                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "font",
-                                                                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                                                                       "m_value":      false
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                                                                       "m_value":      false
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                                                                       "m_value":      false
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                                                                       "m_value":      "Device:"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Wrap:",
-                                                                                                                                                                                       "m_value":      "-1"
-                                                                                                                                                                               }],
-                                                                                                                                                                       "m_events":     [],
-                                                                                                                                                                       "m_children":   []
-                                                                                                                                                               }, {
-                                                                                                                                                                       "m_type":       4410,
-                                                                                                                                                                       "proportion":   0,
-                                                                                                                                                                       "border":       5,
-                                                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                                                       "m_styles":     [],
-                                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_VERTICAL"],
-                                                                                                                                                                       "m_properties": [{
-                                                                                                                                                                                       "type": "winid",
-                                                                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                                                       "m_value":      "m_comboBox218"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "colour",
-                                                                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "colour",
-                                                                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "font",
-                                                                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                                                                       "m_value":      false
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                                                                       "m_value":      false
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                                                                       "m_value":      false
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                                                       "m_label":      "ComboBox Choices:",
-                                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Selection:",
-                                                                                                                                                                                       "m_value":      "-1"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Value:",
-                                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                                               }],
-                                                                                                                                                                       "m_events":     [],
-                                                                                                                                                                       "m_children":   []
-                                                                                                                                                               }]
-                                                                                                                                               }]
-                                                                                                                               }]
-                                                                                                               }, {
-                                                                                                                       "m_type":       4403,
-                                                                                                                       "proportion":   0,
-                                                                                                                       "border":       2,
-                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                       "m_styles":     [],
-                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                                                                                                       "m_properties": [{
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                       "m_value":      "flexGridSizer222"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "# Columns:",
-                                                                                                                                       "m_value":      "3"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "# Rows:",
-                                                                                                                                       "m_value":      "1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Growable columns:",
-                                                                                                                                       "m_value":      "2"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Growable rows:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Horizontal gap:",
-                                                                                                                                       "m_value":      "0"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Vertical gap:",
-                                                                                                                                       "m_value":      "0"
-                                                                                                                               }],
-                                                                                                                       "m_events":     [],
-                                                                                                                       "m_children":   [{
-                                                                                                                                       "m_type":       4401,
-                                                                                                                                       "proportion":   1,
-                                                                                                                                       "border":       2,
-                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                       "m_styles":     [],
-                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
-                                                                                                                                       "m_properties": [{
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                       "m_value":      "boxSizer19326"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "choice",
-                                                                                                                                                       "m_label":      "Orientation:",
-                                                                                                                                                       "m_selection":  1,
-                                                                                                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
-                                                                                                                                               }],
-                                                                                                                                       "m_events":     [],
-                                                                                                                                       "m_children":   [{
-                                                                                                                                                       "m_type":       4405,
-                                                                                                                                                       "proportion":   0,
-                                                                                                                                                       "border":       2,
-                                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                                       "m_styles":     [],
-                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_VERTICAL"],
-                                                                                                                                                       "m_properties": [{
-                                                                                                                                                                       "type": "winid",
-                                                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                                       "m_value":      "m_staticText18927"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "colour",
-                                                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "colour",
-                                                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "font",
-                                                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                                                       "m_value":      false
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                                                       "m_value":      false
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                                                       "m_value":      false
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                                                       "m_value":      "Retries:"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Wrap:",
-                                                                                                                                                                       "m_value":      "-1"
-                                                                                                                                                               }],
-                                                                                                                                                       "m_events":     [],
-                                                                                                                                                       "m_children":   []
-                                                                                                                                               }, {
-                                                                                                                                                       "m_type":       4406,
-                                                                                                                                                       "proportion":   1,
-                                                                                                                                                       "border":       2,
-                                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                                       "m_styles":     [],
-                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_VERTICAL"],
-                                                                                                                                                       "m_properties": [{
-                                                                                                                                                                       "type": "winid",
-                                                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                                       "m_value":      "m_textCtrl19128"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "colour",
-                                                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "colour",
-                                                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "font",
-                                                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                                                       "m_value":      false
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                                                       "m_value":      false
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                                                       "m_value":      false
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Value:",
-                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Max Length:",
-                                                                                                                                                                       "m_value":      "0"
-                                                                                                                                                               }],
-                                                                                                                                                       "m_events":     [],
-                                                                                                                                                       "m_children":   []
-                                                                                                                                               }]
-                                                                                                                               }, {
-                                                                                                                                       "m_type":       4401,
-                                                                                                                                       "proportion":   1,
-                                                                                                                                       "border":       2,
-                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                       "m_styles":     [],
-                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
-                                                                                                                                       "m_properties": [{
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                       "m_value":      "boxSizer19323"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "choice",
-                                                                                                                                                       "m_label":      "Orientation:",
-                                                                                                                                                       "m_selection":  1,
-                                                                                                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
-                                                                                                                                               }],
-                                                                                                                                       "m_events":     [],
-                                                                                                                                       "m_children":   [{
-                                                                                                                                                       "m_type":       4405,
-                                                                                                                                                       "proportion":   0,
-                                                                                                                                                       "border":       2,
-                                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                                       "m_styles":     [],
-                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_VERTICAL"],
-                                                                                                                                                       "m_properties": [{
-                                                                                                                                                                       "type": "winid",
-                                                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                                       "m_value":      "m_staticText18924"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "colour",
-                                                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "colour",
-                                                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "font",
-                                                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                                                       "m_value":      false
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                                                       "m_value":      false
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                                                       "m_value":      false
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                                                       "m_value":      "Retry Interval:"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Wrap:",
-                                                                                                                                                                       "m_value":      "-1"
-                                                                                                                                                               }],
-                                                                                                                                                       "m_events":     [],
-                                                                                                                                                       "m_children":   []
-                                                                                                                                               }, {
-                                                                                                                                                       "m_type":       4406,
-                                                                                                                                                       "proportion":   1,
-                                                                                                                                                       "border":       2,
-                                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                                       "m_styles":     [],
-                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_VERTICAL"],
-                                                                                                                                                       "m_properties": [{
-                                                                                                                                                                       "type": "winid",
-                                                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                                       "m_value":      "m_textCtrl19125"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "colour",
-                                                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "colour",
-                                                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "font",
-                                                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                                                       "m_value":      false
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                                                       "m_value":      false
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                                                       "m_value":      false
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Value:",
-                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Max Length:",
-                                                                                                                                                                       "m_value":      "0"
-                                                                                                                                                               }],
-                                                                                                                                                       "m_events":     [],
-                                                                                                                                                       "m_children":   []
-                                                                                                                                               }]
-                                                                                                                               }, {
-                                                                                                                                       "m_type":       4401,
-                                                                                                                                       "proportion":   1,
-                                                                                                                                       "border":       2,
-                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                       "m_styles":     [],
-                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
-                                                                                                                                       "m_properties": [{
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                       "m_value":      "boxSizer1932954"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "choice",
-                                                                                                                                                       "m_label":      "Orientation:",
-                                                                                                                                                       "m_selection":  1,
-                                                                                                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
-                                                                                                                                               }],
-                                                                                                                                       "m_events":     [],
-                                                                                                                                       "m_children":   [{
-                                                                                                                                                       "m_type":       4405,
-                                                                                                                                                       "proportion":   0,
-                                                                                                                                                       "border":       2,
-                                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                                       "m_styles":     [],
-                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_VERTICAL"],
-                                                                                                                                                       "m_properties": [{
-                                                                                                                                                                       "type": "winid",
-                                                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                                       "m_value":      "m_staticText1893055"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "colour",
-                                                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "colour",
-                                                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "font",
-                                                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                                                       "m_value":      false
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                                                       "m_value":      false
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                                                       "m_value":      false
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                                                       "m_value":      "Baud Rate:"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Wrap:",
-                                                                                                                                                                       "m_value":      "-1"
-                                                                                                                                                               }],
-                                                                                                                                                       "m_events":     [],
-                                                                                                                                                       "m_children":   []
-                                                                                                                                               }, {
-                                                                                                                                                       "m_type":       4410,
-                                                                                                                                                       "proportion":   1,
-                                                                                                                                                       "border":       2,
-                                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                                       "m_styles":     [],
-                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_VERTICAL"],
-                                                                                                                                                       "m_properties": [{
-                                                                                                                                                                       "type": "winid",
-                                                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                                       "m_value":      "m_comboBaud"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "colour",
-                                                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "colour",
-                                                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "font",
-                                                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                                                       "m_value":      false
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                                                       "m_value":      false
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                                                       "m_value":      false
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                                       "m_label":      "ComboBox Choices:",
-                                                                                                                                                                       "m_value":      "300\\n600\\n1200\\n2400\\n9600\\n19200\\n38400\\n56800"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Selection:",
-                                                                                                                                                                       "m_value":      "-1"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Value:",
-                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                               }],
-                                                                                                                                                       "m_events":     [],
-                                                                                                                                                       "m_children":   []
-                                                                                                                                               }]
-                                                                                                                               }]
-                                                                                                               }, {
-                                                                                                                       "m_type":       4403,
-                                                                                                                       "proportion":   0,
-                                                                                                                       "border":       2,
-                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                       "m_styles":     [],
-                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
-                                                                                                                       "m_properties": [{
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                       "m_value":      "flexGridSizer18747"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "# Columns:",
-                                                                                                                                       "m_value":      "1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "# Rows:",
-                                                                                                                                       "m_value":      "1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Growable columns:",
-                                                                                                                                       "m_value":      "1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Growable rows:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Horizontal gap:",
-                                                                                                                                       "m_value":      "0"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Vertical gap:",
-                                                                                                                                       "m_value":      "0"
-                                                                                                                               }],
-                                                                                                                       "m_events":     [],
-                                                                                                                       "m_children":   [{
-                                                                                                                                       "m_type":       4403,
-                                                                                                                                       "proportion":   1,
-                                                                                                                                       "border":       2,
-                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                       "m_styles":     [],
-                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                                                                                                                       "m_properties": [{
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                       "m_value":      "flexGridSizer20448"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "# Columns:",
-                                                                                                                                                       "m_value":      "3"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "# Rows:",
-                                                                                                                                                       "m_value":      "1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Growable columns:",
-                                                                                                                                                       "m_value":      "3"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Growable rows:",
-                                                                                                                                                       "m_value":      "1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Horizontal gap:",
-                                                                                                                                                       "m_value":      "0"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Vertical gap:",
-                                                                                                                                                       "m_value":      "0"
-                                                                                                                                               }],
-                                                                                                                                       "m_events":     [],
-                                                                                                                                       "m_children":   [{
-                                                                                                                                                       "m_type":       4401,
-                                                                                                                                                       "proportion":   1,
-                                                                                                                                                       "border":       2,
-                                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                                       "m_styles":     [],
-                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND", "wxALIGN_CENTER_VERTICAL"],
-                                                                                                                                                       "m_properties": [{
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                                       "m_value":      "boxSizer19349"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "choice",
-                                                                                                                                                                       "m_label":      "Orientation:",
-                                                                                                                                                                       "m_selection":  1,
-                                                                                                                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
-                                                                                                                                                               }],
-                                                                                                                                                       "m_events":     [],
-                                                                                                                                                       "m_children":   [{
-                                                                                                                                                                       "m_type":       4405,
-                                                                                                                                                                       "proportion":   0,
-                                                                                                                                                                       "border":       2,
-                                                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                                                       "m_styles":     [],
-                                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_VERTICAL"],
-                                                                                                                                                                       "m_properties": [{
-                                                                                                                                                                                       "type": "winid",
-                                                                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                                                       "m_value":      "m_staticText18950"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "colour",
-                                                                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "colour",
-                                                                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "font",
-                                                                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                                                                       "m_value":      false
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                                                                       "m_value":      false
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                                                                       "m_value":      false
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                                                                       "m_value":      "Write Delay (ms):"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Wrap:",
-                                                                                                                                                                                       "m_value":      "-1"
-                                                                                                                                                                               }],
-                                                                                                                                                                       "m_events":     [],
-                                                                                                                                                                       "m_children":   []
-                                                                                                                                                               }, {
-                                                                                                                                                                       "m_type":       4406,
-                                                                                                                                                                       "proportion":   0,
-                                                                                                                                                                       "border":       2,
-                                                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                                                       "m_styles":     [],
-                                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_VERTICAL"],
-                                                                                                                                                                       "m_properties": [{
-                                                                                                                                                                                       "type": "winid",
-                                                                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                                                       "m_value":      "m_textCtrl19151"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "colour",
-                                                                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "colour",
-                                                                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "font",
-                                                                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                                                                       "m_value":      false
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                                                                       "m_value":      false
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                                                                       "m_value":      false
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Value:",
-                                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Max Length:",
-                                                                                                                                                                                       "m_value":      "0"
-                                                                                                                                                                               }],
-                                                                                                                                                                       "m_events":     [],
-                                                                                                                                                                       "m_children":   []
-                                                                                                                                                               }]
-                                                                                                                                               }, {
-                                                                                                                                                       "m_type":       4401,
-                                                                                                                                                       "proportion":   1,
-                                                                                                                                                       "border":       2,
-                                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                                       "m_styles":     [],
-                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
-                                                                                                                                                       "m_properties": [{
-                                                                                                                                                                       "type": "string",
-                                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                                       "m_value":      "boxSizer298"
-                                                                                                                                                               }, {
-                                                                                                                                                                       "type": "choice",
-                                                                                                                                                                       "m_label":      "Orientation:",
-                                                                                                                                                                       "m_selection":  1,
-                                                                                                                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
-                                                                                                                                                               }],
-                                                                                                                                                       "m_events":     [],
-                                                                                                                                                       "m_children":   [{
-                                                                                                                                                                       "m_type":       4405,
-                                                                                                                                                                       "proportion":   0,
-                                                                                                                                                                       "border":       2,
-                                                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                                                       "m_styles":     [],
-                                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                                                                                                                                                       "m_properties": [{
-                                                                                                                                                                                       "type": "winid",
-                                                                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                                                       "m_value":      "m_staticText298"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "colour",
-                                                                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "colour",
-                                                                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "font",
-                                                                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                                                                       "m_value":      false
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                                                                       "m_value":      false
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                                                                       "m_value":      false
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                                                                       "m_value":      "Stop Bits:"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Wrap:",
-                                                                                                                                                                                       "m_value":      "-1"
-                                                                                                                                                                               }],
-                                                                                                                                                                       "m_events":     [],
-                                                                                                                                                                       "m_children":   []
-                                                                                                                                                               }, {
-                                                                                                                                                                       "m_type":       4419,
-                                                                                                                                                                       "proportion":   0,
-                                                                                                                                                                       "border":       5,
-                                                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                                                       "m_styles":     ["wxSL_HORIZONTAL"],
-                                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                                                                                                                                                       "m_properties": [{
-                                                                                                                                                                                       "type": "winid",
-                                                                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                                                       "m_value":      "m_sliderStopBits"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "colour",
-                                                                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "colour",
-                                                                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "font",
-                                                                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                                                                       "m_value":      false
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                                                                       "m_value":      false
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "bool",
-                                                                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                                                                       "m_value":      false
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                                                                       "m_value":      ""
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Value:",
-                                                                                                                                                                                       "m_value":      "0"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Min value:",
-                                                                                                                                                                                       "m_value":      "0"
-                                                                                                                                                                               }, {
-                                                                                                                                                                                       "type": "string",
-                                                                                                                                                                                       "m_label":      "Max value:",
-                                                                                                                                                                                       "m_value":      "2"
-                                                                                                                                                                               }],
-                                                                                                                                                                       "m_events":     [],
-                                                                                                                                                                       "m_children":   []
-                                                                                                                                                               }]
-                                                                                                                                               }]
-                                                                                                                               }]
-                                                                                                               }, {
-                                                                                                                       "m_type":       4403,
-                                                                                                                       "proportion":   0,
-                                                                                                                       "border":       2,
-                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                       "m_styles":     [],
-                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
-                                                                                                                       "m_properties": [{
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                       "m_value":      "flexGridSizer224"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "# Columns:",
-                                                                                                                                       "m_value":      "4"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "# Rows:",
-                                                                                                                                       "m_value":      "1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Growable columns:",
-                                                                                                                                       "m_value":      "4"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Growable rows:",
-                                                                                                                                       "m_value":      "1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Horizontal gap:",
-                                                                                                                                       "m_value":      "0"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Vertical gap:",
-                                                                                                                                       "m_value":      "0"
-                                                                                                                               }],
-                                                                                                                       "m_events":     [],
-                                                                                                                       "m_children":   [{
-                                                                                                                                       "m_type":       4454,
-                                                                                                                                       "proportion":   1,
-                                                                                                                                       "border":       2,
-                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                       "m_styles":     [],
-                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
-                                                                                                                                       "m_properties": [{
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                       "m_value":      "Spacer234"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                       "m_value":      "2,2"
-                                                                                                                                               }],
-                                                                                                                                       "m_events":     [],
-                                                                                                                                       "m_children":   []
-                                                                                                                               }, {
-                                                                                                                                       "m_type":       4415,
-                                                                                                                                       "proportion":   0,
-                                                                                                                                       "border":       1,
-                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                       "m_styles":     [],
-                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
-                                                                                                                                       "m_properties": [{
-                                                                                                                                                       "type": "winid",
-                                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                       "m_value":      "m_cbEcho"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                                       "m_value":      "Commands are echoed"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "font",
-                                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                                       "m_value":      "Commands echoed"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Value:",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }],
-                                                                                                                                       "m_events":     [],
-                                                                                                                                       "m_children":   []
-                                                                                                                               }, {
-                                                                                                                                       "m_type":       4454,
-                                                                                                                                       "proportion":   1,
-                                                                                                                                       "border":       2,
-                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                       "m_styles":     [],
-                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
-                                                                                                                                       "m_properties": [{
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                       "m_value":      "Spacer240"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                       "m_value":      "2,2"
-                                                                                                                                               }],
-                                                                                                                                       "m_events":     [],
-                                                                                                                                       "m_children":   []
-                                                                                                                               }, {
-                                                                                                                                       "m_type":       4415,
-                                                                                                                                       "proportion":   1,
-                                                                                                                                       "border":       2,
-                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                       "m_styles":     [],
-                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
-                                                                                                                                       "m_properties": [{
-                                                                                                                                                       "type": "winid",
-                                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                       "m_value":      "m_cbCATPTT"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                                       "m_value":      "Use CAT commands for PTT"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "font",
-                                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                                       "m_value":      "CAT command for PTT"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Value:",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }],
-                                                                                                                                       "m_events":     [],
-                                                                                                                                       "m_children":   []
-                                                                                                                               }]
-                                                                                                               }, {
-                                                                                                                       "m_type":       4403,
-                                                                                                                       "proportion":   0,
-                                                                                                                       "border":       2,
-                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                       "m_styles":     [],
-                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
-                                                                                                                       "m_properties": [{
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                       "m_value":      "flexGridSizer22432"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "# Columns:",
-                                                                                                                                       "m_value":      "4"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "# Rows:",
-                                                                                                                                       "m_value":      "1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Growable columns:",
-                                                                                                                                       "m_value":      "4"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Growable rows:",
-                                                                                                                                       "m_value":      "1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Horizontal gap:",
-                                                                                                                                       "m_value":      "0"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Vertical gap:",
-                                                                                                                                       "m_value":      "0"
-                                                                                                                               }],
-                                                                                                                       "m_events":     [],
-                                                                                                                       "m_children":   [{
-                                                                                                                                       "m_type":       4454,
-                                                                                                                                       "proportion":   1,
-                                                                                                                                       "border":       2,
-                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                       "m_styles":     [],
-                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
-                                                                                                                                       "m_properties": [{
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                       "m_value":      "Spacer2402"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                       "m_value":      "2,2"
-                                                                                                                                               }],
-                                                                                                                                       "m_events":     [],
-                                                                                                                                       "m_children":   []
-                                                                                                                               }, {
-                                                                                                                                       "m_type":       4415,
-                                                                                                                                       "proportion":   1,
-                                                                                                                                       "border":       2,
-                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                       "m_styles":     [],
-                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                                                                                                                       "m_properties": [{
-                                                                                                                                                       "type": "winid",
-                                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                       "m_value":      "m_cbToggleRTSPTT"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                                       "m_value":      "Toggle RTS for PTT"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "font",
-                                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                                       "m_value":      "Toggle RTS for PTT"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Value:",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }],
-                                                                                                                                       "m_events":     [],
-                                                                                                                                       "m_children":   []
-                                                                                                                               }, {
-                                                                                                                                       "m_type":       4454,
-                                                                                                                                       "proportion":   1,
-                                                                                                                                       "border":       2,
-                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                       "m_styles":     [],
-                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
-                                                                                                                                       "m_properties": [{
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                       "m_value":      "Spacer2401"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                       "m_value":      "2,2"
-                                                                                                                                               }],
-                                                                                                                                       "m_events":     [],
-                                                                                                                                       "m_children":   []
-                                                                                                                               }, {
-                                                                                                                                       "m_type":       4415,
-                                                                                                                                       "proportion":   1,
-                                                                                                                                       "border":       2,
-                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                       "m_styles":     [],
-                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                                                                                                                       "m_properties": [{
-                                                                                                                                                       "type": "winid",
-                                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                       "m_value":      "m_cbToggleDTRPTT"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                                       "m_value":      "Toggle DTR for PTT"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "font",
-                                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                                       "m_value":      "Toggle DTR for PTT"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Value:",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }],
-                                                                                                                                       "m_events":     [],
-                                                                                                                                       "m_children":   []
-                                                                                                                               }]
-                                                                                                               }, {
-                                                                                                                       "m_type":       4403,
-                                                                                                                       "proportion":   0,
-                                                                                                                       "border":       2,
-                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                       "m_styles":     [],
-                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
-                                                                                                                       "m_properties": [{
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                       "m_value":      "flexGridSizer22437"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "# Columns:",
-                                                                                                                                       "m_value":      "4"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "# Rows:",
-                                                                                                                                       "m_value":      "1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Growable columns:",
-                                                                                                                                       "m_value":      "4"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Growable rows:",
-                                                                                                                                       "m_value":      "1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Horizontal gap:",
-                                                                                                                                       "m_value":      "0"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Vertical gap:",
-                                                                                                                                       "m_value":      "0"
-                                                                                                                               }],
-                                                                                                                       "m_events":     [],
-                                                                                                                       "m_children":   [{
-                                                                                                                                       "m_type":       4454,
-                                                                                                                                       "proportion":   1,
-                                                                                                                                       "border":       2,
-                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                       "m_styles":     [],
-                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
-                                                                                                                                       "m_properties": [{
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                       "m_value":      "Spacer23438"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                       "m_value":      "2,2"
-                                                                                                                                               }],
-                                                                                                                                       "m_events":     [],
-                                                                                                                                       "m_children":   []
-                                                                                                                               }, {
-                                                                                                                                       "m_type":       4415,
-                                                                                                                                       "proportion":   1,
-                                                                                                                                       "border":       2,
-                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                       "m_styles":     [],
-                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
-                                                                                                                                       "m_properties": [{
-                                                                                                                                                       "type": "winid",
-                                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                       "m_value":      "m_cbRTS12VInit"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                                       "m_value":      "Initialize state of RTS"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "font",
-                                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                                       "m_value":      "Initial RTS +12v"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Value:",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }],
-                                                                                                                                       "m_events":     [],
-                                                                                                                                       "m_children":   []
-                                                                                                                               }, {
-                                                                                                                                       "m_type":       4454,
-                                                                                                                                       "proportion":   1,
-                                                                                                                                       "border":       2,
-                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                       "m_styles":     [],
-                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
-                                                                                                                                       "m_properties": [{
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                       "m_value":      "Spacer24040"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                       "m_value":      "2,2"
-                                                                                                                                               }],
-                                                                                                                                       "m_events":     [],
-                                                                                                                                       "m_children":   []
-                                                                                                                               }, {
-                                                                                                                                       "m_type":       4415,
-                                                                                                                                       "proportion":   1,
-                                                                                                                                       "border":       2,
-                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                       "m_styles":     [],
-                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
-                                                                                                                                       "m_properties": [{
-                                                                                                                                                       "type": "winid",
-                                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                       "m_value":      "m_cbDTR12VInit"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                                       "m_value":      "Initialize state of DTR"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "font",
-                                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                                       "m_value":      "Initial DTR +12v"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Value:",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }],
-                                                                                                                                       "m_events":     [],
-                                                                                                                                       "m_children":   []
-                                                                                                                               }]
-                                                                                                               }, {
-                                                                                                                       "m_type":       4403,
-                                                                                                                       "proportion":   0,
-                                                                                                                       "border":       2,
-                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                       "m_styles":     [],
-                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
-                                                                                                                       "m_properties": [{
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                       "m_value":      "flexGridSizer22442"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "# Columns:",
-                                                                                                                                       "m_value":      "4"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "# Rows:",
-                                                                                                                                       "m_value":      "1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Growable columns:",
-                                                                                                                                       "m_value":      "4"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Growable rows:",
-                                                                                                                                       "m_value":      "1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Horizontal gap:",
-                                                                                                                                       "m_value":      "0"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Vertical gap:",
-                                                                                                                                       "m_value":      "0"
-                                                                                                                               }],
-                                                                                                                       "m_events":     [],
-                                                                                                                       "m_children":   [{
-                                                                                                                                       "m_type":       4454,
-                                                                                                                                       "proportion":   0,
-                                                                                                                                       "border":       2,
-                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                       "m_styles":     [],
-                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                                                                                                                       "m_properties": [{
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                       "m_value":      "Spacer23443"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                       "m_value":      "2,2"
-                                                                                                                                               }],
-                                                                                                                                       "m_events":     [],
-                                                                                                                                       "m_children":   []
-                                                                                                                               }, {
-                                                                                                                                       "m_type":       4415,
-                                                                                                                                       "proportion":   0,
-                                                                                                                                       "border":       2,
-                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                       "m_styles":     [],
-                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                                                                                                                       "m_properties": [{
-                                                                                                                                                       "type": "winid",
-                                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                       "m_value":      "m_cbRTSCTSFlowCtl"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "font",
-                                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                                       "m_value":      "RTS/CTS Flow Control"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Value:",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }],
-                                                                                                                                       "m_events":     [],
-                                                                                                                                       "m_children":   []
-                                                                                                                               }, {
-                                                                                                                                       "m_type":       4454,
-                                                                                                                                       "proportion":   0,
-                                                                                                                                       "border":       2,
-                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                       "m_styles":     [],
-                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                                                                                                                       "m_properties": [{
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                       "m_value":      "Spacer24045"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                       "m_value":      "2,2"
-                                                                                                                                               }],
-                                                                                                                                       "m_events":     [],
-                                                                                                                                       "m_children":   []
-                                                                                                                               }, {
-                                                                                                                                       "m_type":       4415,
-                                                                                                                                       "proportion":   0,
-                                                                                                                                       "border":       2,
-                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                       "m_styles":     [],
-                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                                                                                                                       "m_properties": [{
-                                                                                                                                                       "type": "winid",
-                                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                       "m_value":      "m_cbVSPEnable"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                                       "m_value":      "Virtual serial port enable. Suppress WARNINGS"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "font",
-                                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                                       "m_value":      "RTS/CTS Flow Control"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Value:",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }],
-                                                                                                                                       "m_events":     [],
-                                                                                                                                       "m_children":   []
-                                                                                                                               }]
-                                                                                                               }]
-                                                                                               }]
-                                                                               }]
-                                                               }, {
-                                                                       "m_type":       4441,
-                                                                       "proportion":   0,
-                                                                       "border":       5,
-                                                                       "gbSpan":       "1,1",
-                                                                       "gbPosition":   "0,0",
-                                                                       "m_styles":     ["wxTAB_TRAVERSAL"],
-                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                                                       "m_properties": [{
-                                                                                       "type": "winid",
-                                                                                       "m_label":      "ID:",
-                                                                                       "m_winid":      "wxID_ANY"
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Size:",
-                                                                                       "m_value":      "-1,-1"
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Minimum Size:",
-                                                                                       "m_value":      "-1,-1"
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Name:",
-                                                                                       "m_value":      "m_panelHAMLib"
-                                                                               }, {
-                                                                                       "type": "multi-string",
-                                                                                       "m_label":      "Tooltip:",
-                                                                                       "m_value":      "Hamlib Configuration"
-                                                                               }, {
-                                                                                       "type": "colour",
-                                                                                       "m_label":      "Bg Colour:",
-                                                                                       "colour":       "<Default>"
-                                                                               }, {
-                                                                                       "type": "colour",
-                                                                                       "m_label":      "Fg Colour:",
-                                                                                       "colour":       "<Default>"
-                                                                               }, {
-                                                                                       "type": "font",
-                                                                                       "m_label":      "Font:",
-                                                                                       "m_value":      ""
-                                                                               }, {
-                                                                                       "type": "bool",
-                                                                                       "m_label":      "Hidden",
-                                                                                       "m_value":      false
-                                                                               }, {
-                                                                                       "type": "bool",
-                                                                                       "m_label":      "Disabled",
-                                                                                       "m_value":      false
-                                                                               }, {
-                                                                                       "type": "bool",
-                                                                                       "m_label":      "Focused",
-                                                                                       "m_value":      false
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Class Name:",
-                                                                                       "m_value":      ""
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Include File:",
-                                                                                       "m_value":      ""
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Label:",
-                                                                                       "m_value":      "HAMlib"
-                                                                               }, {
-                                                                                       "type": "filePicker",
-                                                                                       "m_label":      "Bitmap File:",
-                                                                                       "m_path":       ""
-                                                                               }, {
-                                                                                       "type": "bool",
-                                                                                       "m_label":      "Selected",
-                                                                                       "m_value":      false
-                                                                               }],
-                                                                       "m_events":     [],
-                                                                       "m_children":   [{
-                                                                                       "m_type":       4449,
-                                                                                       "proportion":   1,
-                                                                                       "border":       5,
-                                                                                       "gbSpan":       "1,1",
-                                                                                       "gbPosition":   "0,0",
-                                                                                       "m_styles":     [],
-                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
-                                                                                       "m_properties": [{
-                                                                                                       "type": "string",
-                                                                                                       "m_label":      "Name:",
-                                                                                                       "m_value":      "staticBoxSizer296"
-                                                                                               }, {
-                                                                                                       "type": "choice",
-                                                                                                       "m_label":      "Orientation:",
-                                                                                                       "m_selection":  0,
-                                                                                                       "m_options":    ["Vertical", "Horizontal"]
-                                                                                               }, {
-                                                                                                       "type": "string",
-                                                                                                       "m_label":      "Label:",
-                                                                                                       "m_value":      ""
-                                                                                               }],
-                                                                                       "m_events":     [],
-                                                                                       "m_children":   [{
-                                                                                                       "m_type":       4452,
-                                                                                                       "proportion":   0,
-                                                                                                       "border":       5,
-                                                                                                       "gbSpan":       "1,1",
-                                                                                                       "gbPosition":   "0,0",
-                                                                                                       "m_styles":     [],
-                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
-                                                                                                       "m_properties": [{
-                                                                                                                       "type": "string",
-                                                                                                                       "m_label":      "Name:",
-                                                                                                                       "m_value":      "gridSizer368"
-                                                                                                               }, {
-                                                                                                                       "type": "string",
-                                                                                                                       "m_label":      "# Columns:",
-                                                                                                                       "m_value":      "3"
-                                                                                                               }, {
-                                                                                                                       "type": "string",
-                                                                                                                       "m_label":      "# Rows:",
-                                                                                                                       "m_value":      "8"
-                                                                                                               }, {
-                                                                                                                       "type": "string",
-                                                                                                                       "m_label":      "Horizontal gap:",
-                                                                                                                       "m_value":      "0"
-                                                                                                               }, {
-                                                                                                                       "type": "string",
-                                                                                                                       "m_label":      "Vertical gap:",
-                                                                                                                       "m_value":      "0"
-                                                                                                               }],
-                                                                                                       "m_events":     [],
-                                                                                                       "m_children":   [{
-                                                                                                                       "m_type":       4401,
-                                                                                                                       "proportion":   1,
-                                                                                                                       "border":       2,
-                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                       "m_styles":     [],
-                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
-                                                                                                                       "m_properties": [{
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                       "m_value":      "boxSizer312"
-                                                                                                                               }, {
-                                                                                                                                       "type": "choice",
-                                                                                                                                       "m_label":      "Orientation:",
-                                                                                                                                       "m_selection":  1,
-                                                                                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
-                                                                                                                               }],
-                                                                                                                       "m_events":     [],
-                                                                                                                       "m_children":   [{
-                                                                                                                                       "m_type":       4405,
-                                                                                                                                       "proportion":   0,
-                                                                                                                                       "border":       2,
-                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                       "m_styles":     [],
-                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_RIGHT", "wxALIGN_CENTER_VERTICAL"],
-                                                                                                                                       "m_properties": [{
-                                                                                                                                                       "type": "winid",
-                                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                       "m_value":      "m_staticText308"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "font",
-                                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                                       "m_value":      "Device:"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Wrap:",
-                                                                                                                                                       "m_value":      "-1"
-                                                                                                                                               }],
-                                                                                                                                       "m_events":     [],
-                                                                                                                                       "m_children":   []
-                                                                                                                               }, {
-                                                                                                                                       "m_type":       4410,
-                                                                                                                                       "proportion":   1,
-                                                                                                                                       "border":       2,
-                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                       "m_styles":     [],
-                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_LEFT", "wxALIGN_CENTER_VERTICAL"],
-                                                                                                                                       "m_properties": [{
-                                                                                                                                                       "type": "winid",
-                                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                       "m_value":      "m_comboBox314"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "font",
-                                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                       "m_label":      "ComboBox Choices:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Selection:",
-                                                                                                                                                       "m_value":      "-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Value:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }],
-                                                                                                                                       "m_events":     [],
-                                                                                                                                       "m_children":   []
-                                                                                                                               }]
-                                                                                                               }, {
-                                                                                                                       "m_type":       4405,
-                                                                                                                       "proportion":   1,
-                                                                                                                       "border":       2,
-                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                       "m_styles":     [],
-                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_RIGHT", "wxALIGN_CENTER_VERTICAL"],
-                                                                                                                       "m_properties": [{
-                                                                                                                                       "type": "winid",
-                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                       "m_value":      "m_staticText304"
-                                                                                                                               }, {
-                                                                                                                                       "type": "multi-string",
-                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "colour",
-                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                       "colour":       "<Default>"
-                                                                                                                               }, {
-                                                                                                                                       "type": "colour",
-                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                       "colour":       "<Default>"
-                                                                                                                               }, {
-                                                                                                                                       "type": "font",
-                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "multi-string",
-                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                       "m_value":      "Rig:"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Wrap:",
-                                                                                                                                       "m_value":      "-1"
-                                                                                                                               }],
-                                                                                                                       "m_events":     [],
-                                                                                                                       "m_children":   []
-                                                                                                               }, {
-                                                                                                                       "m_type":       4401,
-                                                                                                                       "proportion":   1,
-                                                                                                                       "border":       2,
-                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                       "m_styles":     [],
-                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                                                                                                       "m_properties": [{
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                       "m_value":      "boxSizer302"
-                                                                                                                               }, {
-                                                                                                                                       "type": "choice",
-                                                                                                                                       "m_label":      "Orientation:",
-                                                                                                                                       "m_selection":  1,
-                                                                                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
-                                                                                                                               }],
-                                                                                                                       "m_events":     [],
-                                                                                                                       "m_children":   [{
-                                                                                                                                       "m_type":       4406,
-                                                                                                                                       "proportion":   1,
-                                                                                                                                       "border":       2,
-                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                       "m_styles":     [],
-                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_LEFT", "wxALIGN_CENTER_VERTICAL"],
-                                                                                                                                       "m_properties": [{
-                                                                                                                                                       "type": "winid",
-                                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                       "m_value":      "m_textCtrl306"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "font",
-                                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Value:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Max Length:",
-                                                                                                                                                       "m_value":      "0"
-                                                                                                                                               }],
-                                                                                                                                       "m_events":     [],
-                                                                                                                                       "m_children":   []
-                                                                                                                               }]
-                                                                                                               }, {
-                                                                                                                       "m_type":       4401,
-                                                                                                                       "proportion":   1,
-                                                                                                                       "border":       2,
-                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                       "m_styles":     [],
-                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                                                                                                       "m_properties": [{
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                       "m_value":      "boxSizer320"
-                                                                                                                               }, {
-                                                                                                                                       "type": "choice",
-                                                                                                                                       "m_label":      "Orientation:",
-                                                                                                                                       "m_selection":  1,
-                                                                                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
-                                                                                                                               }],
-                                                                                                                       "m_events":     [],
-                                                                                                                       "m_children":   [{
-                                                                                                                                       "m_type":       4405,
-                                                                                                                                       "proportion":   0,
-                                                                                                                                       "border":       2,
-                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                       "m_styles":     [],
-                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_RIGHT", "wxALIGN_CENTER_VERTICAL"],
-                                                                                                                                       "m_properties": [{
-                                                                                                                                                       "type": "winid",
-                                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                       "m_value":      "m_staticText326"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "font",
-                                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                                       "m_value":      "Retries:"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Wrap:",
-                                                                                                                                                       "m_value":      "-1"
-                                                                                                                                               }],
-                                                                                                                                       "m_events":     [],
-                                                                                                                                       "m_children":   []
-                                                                                                                               }, {
-                                                                                                                                       "m_type":       4406,
-                                                                                                                                       "proportion":   1,
-                                                                                                                                       "border":       2,
-                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                       "m_styles":     [],
-                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_LEFT", "wxALIGN_CENTER_VERTICAL"],
-                                                                                                                                       "m_properties": [{
-                                                                                                                                                       "type": "winid",
-                                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                       "m_value":      "m_textCtrl328"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "font",
-                                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Value:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Max Length:",
-                                                                                                                                                       "m_value":      "0"
-                                                                                                                                               }],
-                                                                                                                                       "m_events":     [],
-                                                                                                                                       "m_children":   []
-                                                                                                                               }]
-                                                                                                               }, {
-                                                                                                                       "m_type":       4401,
-                                                                                                                       "proportion":   1,
-                                                                                                                       "border":       2,
-                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                       "m_styles":     [],
-                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                                                                                                       "m_properties": [{
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                       "m_value":      "boxSizer32057"
-                                                                                                                               }, {
-                                                                                                                                       "type": "choice",
-                                                                                                                                       "m_label":      "Orientation:",
-                                                                                                                                       "m_selection":  1,
-                                                                                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
-                                                                                                                               }],
-                                                                                                                       "m_events":     [],
-                                                                                                                       "m_children":   [{
-                                                                                                                                       "m_type":       4405,
-                                                                                                                                       "proportion":   0,
-                                                                                                                                       "border":       2,
-                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                       "m_styles":     [],
-                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_RIGHT", "wxALIGN_CENTER_VERTICAL"],
-                                                                                                                                       "m_properties": [{
-                                                                                                                                                       "type": "winid",
-                                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                       "m_value":      "m_staticText32658"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "font",
-                                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                                       "m_value":      "Retry Interval:"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Wrap:",
-                                                                                                                                                       "m_value":      "-1"
-                                                                                                                                               }],
-                                                                                                                                       "m_events":     [],
-                                                                                                                                       "m_children":   []
-                                                                                                                               }, {
-                                                                                                                                       "m_type":       4406,
-                                                                                                                                       "proportion":   1,
-                                                                                                                                       "border":       2,
-                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                       "m_styles":     [],
-                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_HORIZONTAL", "wxALIGN_CENTER_VERTICAL"],
-                                                                                                                                       "m_properties": [{
-                                                                                                                                                       "type": "winid",
-                                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                       "m_value":      "m_textCtrl32859"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "font",
-                                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Value:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Max Length:",
-                                                                                                                                                       "m_value":      "0"
-                                                                                                                                               }],
-                                                                                                                                       "m_events":     [],
-                                                                                                                                       "m_children":   []
-                                                                                                                               }]
-                                                                                                               }, {
-                                                                                                                       "m_type":       4401,
-                                                                                                                       "proportion":   1,
-                                                                                                                       "border":       2,
-                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                       "m_styles":     [],
-                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                                                                                                       "m_properties": [{
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                       "m_value":      "boxSizer32060"
-                                                                                                                               }, {
-                                                                                                                                       "type": "choice",
-                                                                                                                                       "m_label":      "Orientation:",
-                                                                                                                                       "m_selection":  1,
-                                                                                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
-                                                                                                                               }],
-                                                                                                                       "m_events":     [],
-                                                                                                                       "m_children":   [{
-                                                                                                                                       "m_type":       4405,
-                                                                                                                                       "proportion":   0,
-                                                                                                                                       "border":       2,
-                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                       "m_styles":     [],
-                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_RIGHT", "wxALIGN_CENTER_VERTICAL"],
-                                                                                                                                       "m_properties": [{
-                                                                                                                                                       "type": "winid",
-                                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                       "m_value":      "m_staticText32661"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "font",
-                                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                                       "m_value":      "Baud Rate:"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Wrap:",
-                                                                                                                                                       "m_value":      "-1"
-                                                                                                                                               }],
-                                                                                                                                       "m_events":     [],
-                                                                                                                                       "m_children":   []
-                                                                                                                               }, {
-                                                                                                                                       "m_type":       4410,
-                                                                                                                                       "proportion":   1,
-                                                                                                                                       "border":       2,
-                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                       "m_styles":     [],
-                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_HORIZONTAL", "wxALIGN_CENTER_VERTICAL"],
-                                                                                                                                       "m_properties": [{
-                                                                                                                                                       "type": "winid",
-                                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                       "m_value":      "m_comboBox339"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "font",
-                                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                       "m_label":      "ComboBox Choices:",
-                                                                                                                                                       "m_value":      "300\\n600\\n1200\\n2400\\n9600\\n19200\\n38400\\n56800\\n"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Selection:",
-                                                                                                                                                       "m_value":      "-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Value:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }],
-                                                                                                                                       "m_events":     [],
-                                                                                                                                       "m_children":   []
-                                                                                                                               }]
-                                                                                                               }, {
-                                                                                                                       "m_type":       4401,
-                                                                                                                       "proportion":   0,
-                                                                                                                       "border":       2,
-                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                       "m_styles":     [],
-                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                                                                                                       "m_properties": [{
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                       "m_value":      "boxSizer32064"
-                                                                                                                               }, {
-                                                                                                                                       "type": "choice",
-                                                                                                                                       "m_label":      "Orientation:",
-                                                                                                                                       "m_selection":  1,
-                                                                                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
-                                                                                                                               }],
-                                                                                                                       "m_events":     [],
-                                                                                                                       "m_children":   [{
-                                                                                                                                       "m_type":       4405,
-                                                                                                                                       "proportion":   0,
-                                                                                                                                       "border":       2,
-                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                       "m_styles":     [],
-                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_RIGHT", "wxALIGN_CENTER_VERTICAL"],
-                                                                                                                                       "m_properties": [{
-                                                                                                                                                       "type": "winid",
-                                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                       "m_value":      "m_staticText32665"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "font",
-                                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                                       "m_value":      "Write Delay:"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Wrap:",
-                                                                                                                                                       "m_value":      "-1"
-                                                                                                                                               }],
-                                                                                                                                       "m_events":     [],
-                                                                                                                                       "m_children":   []
-                                                                                                                               }, {
-                                                                                                                                       "m_type":       4406,
-                                                                                                                                       "proportion":   1,
-                                                                                                                                       "border":       2,
-                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                       "m_styles":     [],
-                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_LEFT", "wxALIGN_CENTER_VERTICAL"],
-                                                                                                                                       "m_properties": [{
-                                                                                                                                                       "type": "winid",
-                                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                       "m_value":      "m_textCtrl32866"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "font",
-                                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Value:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Max Length:",
-                                                                                                                                                       "m_value":      "0"
-                                                                                                                                               }],
-                                                                                                                                       "m_events":     [],
-                                                                                                                                       "m_children":   []
-                                                                                                                               }]
-                                                                                                               }, {
-                                                                                                                       "m_type":       4401,
-                                                                                                                       "proportion":   1,
-                                                                                                                       "border":       2,
-                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                       "m_styles":     [],
-                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                                                                                                       "m_properties": [{
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                       "m_value":      "boxSizer3205767"
-                                                                                                                               }, {
-                                                                                                                                       "type": "choice",
-                                                                                                                                       "m_label":      "Orientation:",
-                                                                                                                                       "m_selection":  1,
-                                                                                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
-                                                                                                                               }],
-                                                                                                                       "m_events":     [],
-                                                                                                                       "m_children":   [{
-                                                                                                                                       "m_type":       4405,
-                                                                                                                                       "proportion":   0,
-                                                                                                                                       "border":       2,
-                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                       "m_styles":     [],
-                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_RIGHT", "wxALIGN_CENTER_VERTICAL"],
-                                                                                                                                       "m_properties": [{
-                                                                                                                                                       "type": "winid",
-                                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                       "m_value":      "m_staticText3265868"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "font",
-                                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                                       "m_value":      "Post Write Delay:"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Wrap:",
-                                                                                                                                                       "m_value":      "-1"
-                                                                                                                                               }],
-                                                                                                                                       "m_events":     [],
-                                                                                                                                       "m_children":   []
-                                                                                                                               }, {
-                                                                                                                                       "m_type":       4406,
-                                                                                                                                       "proportion":   1,
-                                                                                                                                       "border":       2,
-                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                       "m_styles":     [],
-                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_HORIZONTAL", "wxALIGN_CENTER_VERTICAL"],
-                                                                                                                                       "m_properties": [{
-                                                                                                                                                       "type": "winid",
-                                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                       "m_value":      "m_textCtrl3285969"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "font",
-                                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Value:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Max Length:",
-                                                                                                                                                       "m_value":      "0"
-                                                                                                                                               }],
-                                                                                                                                       "m_events":     [],
-                                                                                                                                       "m_children":   []
-                                                                                                                               }]
-                                                                                                               }, {
-                                                                                                                       "m_type":       4401,
-                                                                                                                       "proportion":   0,
-                                                                                                                       "border":       2,
-                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                       "m_styles":     [],
-                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                                                                                                       "m_properties": [{
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                       "m_value":      "boxSizer3206070"
-                                                                                                                               }, {
-                                                                                                                                       "type": "choice",
-                                                                                                                                       "m_label":      "Orientation:",
-                                                                                                                                       "m_selection":  1,
-                                                                                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
-                                                                                                                               }],
-                                                                                                                       "m_events":     [],
-                                                                                                                       "m_children":   [{
-                                                                                                                                       "m_type":       4405,
-                                                                                                                                       "proportion":   1,
-                                                                                                                                       "border":       2,
-                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                       "m_styles":     [],
-                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                                                                                                                       "m_properties": [{
-                                                                                                                                                       "type": "winid",
-                                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                       "m_value":      "m_staticText3266171"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "font",
-                                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                                       "m_value":      "Stop bits:"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Wrap:",
-                                                                                                                                                       "m_value":      "-1"
-                                                                                                                                               }],
-                                                                                                                                       "m_events":     [],
-                                                                                                                                       "m_children":   []
-                                                                                                                               }, {
-                                                                                                                                       "m_type":       4419,
-                                                                                                                                       "proportion":   1,
-                                                                                                                                       "border":       2,
-                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                       "m_styles":     ["wxSL_LABELS", "wxSL_HORIZONTAL"],
-                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_HORIZONTAL", "wxALIGN_CENTER_VERTICAL"],
-                                                                                                                                       "m_properties": [{
-                                                                                                                                                       "type": "winid",
-                                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                       "m_value":      "m_slider361"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "font",
-                                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Value:",
-                                                                                                                                                       "m_value":      "1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Min value:",
-                                                                                                                                                       "m_value":      "0"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Max value:",
-                                                                                                                                                       "m_value":      "2"
-                                                                                                                                               }],
-                                                                                                                                       "m_events":     [],
-                                                                                                                                       "m_children":   []
-                                                                                                                               }]
-                                                                                                               }, {
-                                                                                                                       "m_type":       4415,
-                                                                                                                       "proportion":   1,
-                                                                                                                       "border":       2,
-                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                       "m_styles":     [],
-                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                                                                                                       "m_properties": [{
-                                                                                                                                       "type": "winid",
-                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                       "m_value":      "m_cbHAMLIBPTT"
-                                                                                                                               }, {
-                                                                                                                                       "type": "multi-string",
-                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                       "m_value":      "Use Hamlib to control PTT"
-                                                                                                                               }, {
-                                                                                                                                       "type": "colour",
-                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                       "colour":       "<Default>"
-                                                                                                                               }, {
-                                                                                                                                       "type": "colour",
-                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                       "colour":       "<Default>"
-                                                                                                                               }, {
-                                                                                                                                       "type": "font",
-                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                       "m_value":      "PTT via HAMLib"
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Value:",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }],
-                                                                                                                       "m_events":     [],
-                                                                                                                       "m_children":   []
-                                                                                                               }, {
-                                                                                                                       "m_type":       4405,
-                                                                                                                       "proportion":   1,
-                                                                                                                       "border":       2,
-                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                       "m_styles":     [],
-                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_RIGHT"],
-                                                                                                                       "m_properties": [{
-                                                                                                                                       "type": "winid",
-                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                       "m_value":      "m_staticText408"
-                                                                                                                               }, {
-                                                                                                                                       "type": "multi-string",
-                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "colour",
-                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                       "colour":       "<Default>"
-                                                                                                                               }, {
-                                                                                                                                       "type": "colour",
-                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                       "colour":       "<Default>"
-                                                                                                                               }, {
-                                                                                                                                       "type": "font",
-                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "multi-string",
-                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                       "m_value":      "Sideband:"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Wrap:",
-                                                                                                                                       "m_value":      "-1"
-                                                                                                                               }],
-                                                                                                                       "m_events":     [],
-                                                                                                                       "m_children":   []
-                                                                                                               }, {
-                                                                                                                       "m_type":       4401,
-                                                                                                                       "proportion":   1,
-                                                                                                                       "border":       2,
-                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                       "m_styles":     [],
-                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_HORIZONTAL", "wxALIGN_CENTER_VERTICAL"],
-                                                                                                                       "m_properties": [{
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                       "m_value":      "boxSizer410"
-                                                                                                                               }, {
-                                                                                                                                       "type": "choice",
-                                                                                                                                       "m_label":      "Orientation:",
-                                                                                                                                       "m_selection":  0,
-                                                                                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
-                                                                                                                               }],
-                                                                                                                       "m_events":     [],
-                                                                                                                       "m_children":   [{
-                                                                                                                                       "m_type":       4410,
-                                                                                                                                       "proportion":   0,
-                                                                                                                                       "border":       2,
-                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                       "m_styles":     [],
-                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_LEFT", "wxALIGN_CENTER_VERTICAL"],
-                                                                                                                                       "m_properties": [{
-                                                                                                                                                       "type": "winid",
-                                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                       "m_value":      "m_comboBox376"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "font",
-                                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                       "m_label":      "ComboBox Choices:",
-                                                                                                                                                       "m_value":      "Upper\\nLower"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Selection:",
-                                                                                                                                                       "m_value":      "-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Value:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }],
-                                                                                                                                       "m_events":     [],
-                                                                                                                                       "m_children":   []
-                                                                                                                               }]
-                                                                                                               }, {
-                                                                                                                       "m_type":       4415,
-                                                                                                                       "proportion":   0,
-                                                                                                                       "border":       2,
-                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                       "m_styles":     [],
-                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                                                                                                       "m_properties": [{
-                                                                                                                                       "type": "winid",
-                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                       "m_value":      "m_checkBox378"
-                                                                                                                               }, {
-                                                                                                                                       "type": "multi-string",
-                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                       "m_value":      "Initialize state of RTS"
-                                                                                                                               }, {
-                                                                                                                                       "type": "colour",
-                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                       "colour":       "<Default>"
-                                                                                                                               }, {
-                                                                                                                                       "type": "colour",
-                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                       "colour":       "<Default>"
-                                                                                                                               }, {
-                                                                                                                                       "type": "font",
-                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                       "m_value":      "Initial RTS +12v"
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Value:",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }],
-                                                                                                                       "m_events":     [],
-                                                                                                                       "m_children":   []
-                                                                                                               }, {
-                                                                                                                       "m_type":       4454,
-                                                                                                                       "proportion":   0,
-                                                                                                                       "border":       2,
-                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                       "m_styles":     [],
-                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                                                                                                       "m_properties": [{
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                       "m_value":      "Spacer380"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                       "m_value":      "0,0"
-                                                                                                                               }],
-                                                                                                                       "m_events":     [],
-                                                                                                                       "m_children":   []
-                                                                                                               }, {
-                                                                                                                       "m_type":       4415,
-                                                                                                                       "proportion":   0,
-                                                                                                                       "border":       2,
-                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                       "m_styles":     [],
-                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                                                                                                       "m_properties": [{
-                                                                                                                                       "type": "winid",
-                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                       "m_value":      "m_checkBox382"
-                                                                                                                               }, {
-                                                                                                                                       "type": "multi-string",
-                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "colour",
-                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                       "colour":       "<Default>"
-                                                                                                                               }, {
-                                                                                                                                       "type": "colour",
-                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                       "colour":       "<Default>"
-                                                                                                                               }, {
-                                                                                                                                       "type": "font",
-                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                       "m_value":      "Initial DTR +12v"
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Value:",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }],
-                                                                                                                       "m_events":     [],
-                                                                                                                       "m_children":   []
-                                                                                                               }, {
-                                                                                                                       "m_type":       4415,
-                                                                                                                       "proportion":   0,
-                                                                                                                       "border":       2,
-                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                       "m_styles":     [],
-                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                                                                                                       "m_properties": [{
-                                                                                                                                       "type": "winid",
-                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                       "m_value":      "m_cbRTSCTS"
-                                                                                                                               }, {
-                                                                                                                                       "type": "multi-string",
-                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                       "m_value":      "Use RTS/CTS Flow Control"
-                                                                                                                               }, {
-                                                                                                                                       "type": "colour",
-                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                       "colour":       "<Default>"
-                                                                                                                               }, {
-                                                                                                                                       "type": "colour",
-                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                       "colour":       "<Default>"
-                                                                                                                               }, {
-                                                                                                                                       "type": "font",
-                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                       "m_value":      "RTS/CTS Flow Control"
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Value:",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }],
-                                                                                                                       "m_events":     [],
-                                                                                                                       "m_children":   []
-                                                                                                               }, {
-                                                                                                                       "m_type":       4454,
-                                                                                                                       "proportion":   0,
-                                                                                                                       "border":       2,
-                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                       "m_styles":     [],
-                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                                                                                                       "m_properties": [{
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                       "m_value":      "Spacer386"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                       "m_value":      "0,0"
-                                                                                                                               }],
-                                                                                                                       "m_events":     [],
-                                                                                                                       "m_children":   []
-                                                                                                               }, {
-                                                                                                                       "m_type":       4415,
-                                                                                                                       "proportion":   0,
-                                                                                                                       "border":       2,
-                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                       "m_styles":     [],
-                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                                                                                                       "m_properties": [{
-                                                                                                                                       "type": "winid",
-                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                       "m_value":      "m_cbXONXOFF"
-                                                                                                                               }, {
-                                                                                                                                       "type": "multi-string",
-                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                       "m_value":      "Use XON/XOFF flow control"
-                                                                                                                               }, {
-                                                                                                                                       "type": "colour",
-                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                       "colour":       "<Default>"
-                                                                                                                               }, {
-                                                                                                                                       "type": "colour",
-                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                       "colour":       "<Default>"
-                                                                                                                               }, {
-                                                                                                                                       "type": "font",
-                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                       "m_value":      "XON/XOFF Flow Control"
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Value:",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }],
-                                                                                                                       "m_events":     [],
-                                                                                                                       "m_children":   []
-                                                                                                               }, {
-                                                                                                                       "m_type":       4405,
-                                                                                                                       "proportion":   0,
-                                                                                                                       "border":       2,
-                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                       "m_styles":     [],
-                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                                                                                                       "m_properties": [{
-                                                                                                                                       "type": "winid",
-                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                       "m_value":      "m_staticText404"
-                                                                                                                               }, {
-                                                                                                                                       "type": "multi-string",
-                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "colour",
-                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                       "colour":       "<Default>"
-                                                                                                                               }, {
-                                                                                                                                       "type": "colour",
-                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                       "colour":       "<Default>"
-                                                                                                                               }, {
-                                                                                                                                       "type": "font",
-                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "multi-string",
-                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                       "m_value":      "Advanced Configuration:"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Wrap:",
-                                                                                                                                       "m_value":      "-1"
-                                                                                                                               }],
-                                                                                                                       "m_events":     [],
-                                                                                                                       "m_children":   []
-                                                                                                               }, {
-                                                                                                                       "m_type":       4454,
-                                                                                                                       "proportion":   0,
-                                                                                                                       "border":       2,
-                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                       "m_styles":     [],
-                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                                                                                                       "m_properties": [{
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                       "m_value":      "Spacer396"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                       "m_value":      "0,0"
-                                                                                                                               }],
-                                                                                                                       "m_events":     [],
-                                                                                                                       "m_children":   []
-                                                                                                               }, {
-                                                                                                                       "m_type":       4400,
-                                                                                                                       "proportion":   0,
-                                                                                                                       "border":       2,
-                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                       "m_styles":     [],
-                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                                                                                                       "m_properties": [{
-                                                                                                                                       "type": "winid",
-                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                       "m_value":      "m_btnRevert"
-                                                                                                                               }, {
-                                                                                                                                       "type": "multi-string",
-                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                       "m_value":      "Revert to previous settings"
-                                                                                                                               }, {
-                                                                                                                                       "type": "colour",
-                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                       "colour":       "<Default>"
-                                                                                                                               }, {
-                                                                                                                                       "type": "colour",
-                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                       "colour":       "<Default>"
-                                                                                                                               }, {
-                                                                                                                                       "type": "font",
-                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                       "m_value":      "Revert"
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Default Button",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }, {
-                                                                                                                                       "type": "filePicker",
-                                                                                                                                       "m_label":      "Bitmap File:",
-                                                                                                                                       "m_path":       ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Margins:",
-                                                                                                                                       "m_value":      "2,2"
-                                                                                                                               }],
-                                                                                                                       "m_events":     [],
-                                                                                                                       "m_children":   []
-                                                                                                               }, {
-                                                                                                                       "m_type":       4406,
-                                                                                                                       "proportion":   1,
-                                                                                                                       "border":       2,
-                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                       "m_styles":     [],
-                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND", "wxALIGN_CENTER_VERTICAL"],
-                                                                                                                       "m_properties": [{
-                                                                                                                                       "type": "winid",
-                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                       "m_value":      "m_textAdvancedCFG"
-                                                                                                                               }, {
-                                                                                                                                       "type": "multi-string",
-                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                       "m_value":      "Enter Advanced Configuration string"
-                                                                                                                               }, {
-                                                                                                                                       "type": "colour",
-                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                       "colour":       "<Default>"
-                                                                                                                               }, {
-                                                                                                                                       "type": "colour",
-                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                       "colour":       "<Default>"
-                                                                                                                               }, {
-                                                                                                                                       "type": "font",
-                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Value:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Max Length:",
-                                                                                                                                       "m_value":      "0"
-                                                                                                                               }],
-                                                                                                                       "m_events":     [],
-                                                                                                                       "m_children":   []
-                                                                                                               }, {
-                                                                                                                       "m_type":       4454,
-                                                                                                                       "proportion":   0,
-                                                                                                                       "border":       2,
-                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                       "m_styles":     [],
-                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                                                                                                       "m_properties": [{
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                       "m_value":      "Spacer406"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                       "m_value":      "0,0"
-                                                                                                                               }],
-                                                                                                                       "m_events":     [],
-                                                                                                                       "m_children":   []
-                                                                                                               }, {
-                                                                                                                       "m_type":       4400,
-                                                                                                                       "proportion":   0,
-                                                                                                                       "border":       2,
-                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                       "m_styles":     [],
-                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                                                                                                       "m_properties": [{
-                                                                                                                                       "type": "winid",
-                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                       "m_value":      "m_btnInitHamlib"
-                                                                                                                               }, {
-                                                                                                                                       "type": "multi-string",
-                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                       "m_value":      "Initialize HAMLib"
-                                                                                                                               }, {
-                                                                                                                                       "type": "colour",
-                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                       "colour":       "<Default>"
-                                                                                                                               }, {
-                                                                                                                                       "type": "colour",
-                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                       "colour":       "<Default>"
-                                                                                                                               }, {
-                                                                                                                                       "type": "font",
-                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                       "m_value":      "Initialize"
-                                                                                                                               }, {
-                                                                                                                                       "type": "bool",
-                                                                                                                                       "m_label":      "Default Button",
-                                                                                                                                       "m_value":      false
-                                                                                                                               }, {
-                                                                                                                                       "type": "filePicker",
-                                                                                                                                       "m_label":      "Bitmap File:",
-                                                                                                                                       "m_path":       ""
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Margins:",
-                                                                                                                                       "m_value":      "2,2"
-                                                                                                                               }],
-                                                                                                                       "m_events":     [],
-                                                                                                                       "m_children":   []
-                                                                                                               }]
-                                                                                               }]
-                                                                               }]
-                                                               }, {
-                                                                       "m_type":       4441,
-                                                                       "proportion":   0,
-                                                                       "border":       5,
-                                                                       "gbSpan":       "1,1",
-                                                                       "gbPosition":   "0,0",
-                                                                       "m_styles":     ["wxTAB_TRAVERSAL"],
-                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                                                       "m_properties": [{
-                                                                                       "type": "winid",
-                                                                                       "m_label":      "ID:",
-                                                                                       "m_winid":      "wxID_ANY"
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Size:",
-                                                                                       "m_value":      "-1,-1"
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Minimum Size:",
-                                                                                       "m_value":      "-1,-1"
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Name:",
-                                                                                       "m_value":      "m_panelMemMap"
-                                                                               }, {
-                                                                                       "type": "multi-string",
-                                                                                       "m_label":      "Tooltip:",
-                                                                                       "m_value":      "Memory Mapped control"
-                                                                               }, {
-                                                                                       "type": "colour",
-                                                                                       "m_label":      "Bg Colour:",
-                                                                                       "colour":       "ButtonHighlight"
-                                                                               }, {
-                                                                                       "type": "colour",
-                                                                                       "m_label":      "Fg Colour:",
-                                                                                       "colour":       "<Default>"
-                                                                               }, {
-                                                                                       "type": "font",
-                                                                                       "m_label":      "Font:",
-                                                                                       "m_value":      ""
-                                                                               }, {
-                                                                                       "type": "bool",
-                                                                                       "m_label":      "Hidden",
-                                                                                       "m_value":      false
-                                                                               }, {
-                                                                                       "type": "bool",
-                                                                                       "m_label":      "Disabled",
-                                                                                       "m_value":      false
-                                                                               }, {
-                                                                                       "type": "bool",
-                                                                                       "m_label":      "Focused",
-                                                                                       "m_value":      false
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Class Name:",
-                                                                                       "m_value":      ""
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Include File:",
-                                                                                       "m_value":      ""
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Label:",
-                                                                                       "m_value":      "MemMap"
-                                                                               }, {
-                                                                                       "type": "filePicker",
-                                                                                       "m_label":      "Bitmap File:",
-                                                                                       "m_path":       ""
-                                                                               }, {
-                                                                                       "type": "bool",
-                                                                                       "m_label":      "Selected",
-                                                                                       "m_value":      false
-                                                                               }],
-                                                                       "m_events":     [],
-                                                                       "m_children":   [{
-                                                                                       "m_type":       4449,
-                                                                                       "proportion":   1,
-                                                                                       "border":       5,
-                                                                                       "gbSpan":       "1,1",
-                                                                                       "gbPosition":   "0,0",
-                                                                                       "m_styles":     [],
-                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
-                                                                                       "m_properties": [{
-                                                                                                       "type": "string",
-                                                                                                       "m_label":      "Name:",
-                                                                                                       "m_value":      "staticBoxSizer294"
-                                                                                               }, {
-                                                                                                       "type": "choice",
-                                                                                                       "m_label":      "Orientation:",
-                                                                                                       "m_selection":  0,
-                                                                                                       "m_options":    ["Vertical", "Horizontal"]
-                                                                                               }, {
-                                                                                                       "type": "string",
-                                                                                                       "m_label":      "Label:",
-                                                                                                       "m_value":      ""
-                                                                                               }],
-                                                                                       "m_events":     [],
-                                                                                       "m_children":   [{
-                                                                                                       "m_type":       4452,
-                                                                                                       "proportion":   1,
-                                                                                                       "border":       2,
-                                                                                                       "gbSpan":       "1,1",
-                                                                                                       "gbPosition":   "0,0",
-                                                                                                       "m_styles":     [],
-                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_HORIZONTAL", "wxALIGN_CENTER_VERTICAL"],
-                                                                                                       "m_properties": [{
-                                                                                                                       "type": "string",
-                                                                                                                       "m_label":      "Name:",
-                                                                                                                       "m_value":      "gridSizer420"
-                                                                                                               }, {
-                                                                                                                       "type": "string",
-                                                                                                                       "m_label":      "# Columns:",
-                                                                                                                       "m_value":      "1"
-                                                                                                               }, {
-                                                                                                                       "type": "string",
-                                                                                                                       "m_label":      "# Rows:",
-                                                                                                                       "m_value":      "2"
-                                                                                                               }, {
-                                                                                                                       "type": "string",
-                                                                                                                       "m_label":      "Horizontal gap:",
-                                                                                                                       "m_value":      "0"
-                                                                                                               }, {
-                                                                                                                       "type": "string",
-                                                                                                                       "m_label":      "Vertical gap:",
-                                                                                                                       "m_value":      "0"
-                                                                                                               }],
-                                                                                                       "m_events":     [],
-                                                                                                       "m_children":   [{
-                                                                                                                       "m_type":       4449,
-                                                                                                                       "proportion":   1,
-                                                                                                                       "border":       5,
-                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                       "m_styles":     [],
-                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND", "wxALIGN_CENTER_HORIZONTAL", "wxALIGN_CENTER_VERTICAL"],
-                                                                                                                       "m_properties": [{
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                       "m_value":      "staticBoxSizer424"
-                                                                                                                               }, {
-                                                                                                                                       "type": "choice",
-                                                                                                                                       "m_label":      "Orientation:",
-                                                                                                                                       "m_selection":  0,
-                                                                                                                                       "m_options":    ["Vertical", "Horizontal"]
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }],
-                                                                                                                       "m_events":     [],
-                                                                                                                       "m_children":   [{
-                                                                                                                                       "m_type":       4405,
-                                                                                                                                       "proportion":   1,
-                                                                                                                                       "border":       5,
-                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                       "m_styles":     ["wxALIGN_CENTRE"],
-                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND", "wxALIGN_CENTER_HORIZONTAL", "wxALIGN_CENTER_VERTICAL"],
-                                                                                                                                       "m_properties": [{
-                                                                                                                                                       "type": "winid",
-                                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                       "m_value":      "m_staticText422"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                                       "colour":       "ButtonFace"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "font",
-                                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                                       "m_value":      "\\nControl via Memory Mapped Shared Variables, i. e. Kachina \\n"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Wrap:",
-                                                                                                                                                       "m_value":      "-1"
-                                                                                                                                               }],
-                                                                                                                                       "m_events":     [],
-                                                                                                                                       "m_children":   []
-                                                                                                                               }]
-                                                                                                               }, {
-                                                                                                                       "m_type":       4401,
-                                                                                                                       "proportion":   0,
-                                                                                                                       "border":       5,
-                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                       "m_styles":     [],
-                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_HORIZONTAL"],
-                                                                                                                       "m_properties": [{
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                       "m_value":      "boxSizer4456"
-                                                                                                                               }, {
-                                                                                                                                       "type": "choice",
-                                                                                                                                       "m_label":      "Orientation:",
-                                                                                                                                       "m_selection":  0,
-                                                                                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
-                                                                                                                               }],
-                                                                                                                       "m_events":     [],
-                                                                                                                       "m_children":   [{
-                                                                                                                                       "m_type":       4415,
-                                                                                                                                       "proportion":   0,
-                                                                                                                                       "border":       5,
-                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                       "m_styles":     [],
-                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_HORIZONTAL", "wxALIGN_CENTER_VERTICAL"],
-                                                                                                                                       "m_properties": [{
-                                                                                                                                                       "type": "winid",
-                                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                       "m_value":      "m_checkBox4377"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "font",
-                                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                                       "m_value":      "Use Memorymap"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Value:",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }],
-                                                                                                                                       "m_events":     [],
-                                                                                                                                       "m_children":   []
-                                                                                                                               }, {
-                                                                                                                                       "m_type":       4415,
-                                                                                                                                       "proportion":   0,
-                                                                                                                                       "border":       5,
-                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                       "m_styles":     [],
-                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_HORIZONTAL", "wxALIGN_BOTTOM"],
-                                                                                                                                       "m_properties": [{
-                                                                                                                                                       "type": "winid",
-                                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                       "m_value":      "m_checkBox4398"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "font",
-                                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                                       "m_value":      "Use Memmap PTT"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Value:",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }],
-                                                                                                                                       "m_events":     [],
-                                                                                                                                       "m_children":   []
-                                                                                                                               }, {
-                                                                                                                                       "m_type":       4400,
-                                                                                                                                       "proportion":   0,
-                                                                                                                                       "border":       5,
-                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                       "m_styles":     [],
-                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_HORIZONTAL", "wxALIGN_CENTER_VERTICAL"],
-                                                                                                                                       "m_properties": [{
-                                                                                                                                                       "type": "winid",
-                                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                       "m_value":      "m_button4419"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "font",
-                                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                                       "m_value":      "Initialize"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Default Button",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "filePicker",
-                                                                                                                                                       "m_label":      "Bitmap File:",
-                                                                                                                                                       "m_path":       ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Margins:",
-                                                                                                                                                       "m_value":      "2,2"
-                                                                                                                                               }],
-                                                                                                                                       "m_events":     [],
-                                                                                                                                       "m_children":   []
-                                                                                                                               }]
-                                                                                                               }]
-                                                                                               }]
-                                                                               }]
-                                                               }, {
-                                                                       "m_type":       4441,
-                                                                       "proportion":   0,
-                                                                       "border":       5,
-                                                                       "gbSpan":       "1,1",
-                                                                       "gbPosition":   "0,0",
-                                                                       "m_styles":     ["wxTAB_TRAVERSAL"],
-                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                                                       "m_properties": [{
-                                                                                       "type": "winid",
-                                                                                       "m_label":      "ID:",
-                                                                                       "m_winid":      "wxID_ANY"
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Size:",
-                                                                                       "m_value":      "-1,-1"
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Minimum Size:",
-                                                                                       "m_value":      "-1,-1"
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Name:",
-                                                                                       "m_value":      "m_panelXMLRPC"
-                                                                               }, {
-                                                                                       "type": "multi-string",
-                                                                                       "m_label":      "Tooltip:",
-                                                                                       "m_value":      "XML-RPC control"
-                                                                               }, {
-                                                                                       "type": "colour",
-                                                                                       "m_label":      "Bg Colour:",
-                                                                                       "colour":       "<Default>"
-                                                                               }, {
-                                                                                       "type": "colour",
-                                                                                       "m_label":      "Fg Colour:",
-                                                                                       "colour":       "<Default>"
-                                                                               }, {
-                                                                                       "type": "font",
-                                                                                       "m_label":      "Font:",
-                                                                                       "m_value":      ""
-                                                                               }, {
-                                                                                       "type": "bool",
-                                                                                       "m_label":      "Hidden",
-                                                                                       "m_value":      false
-                                                                               }, {
-                                                                                       "type": "bool",
-                                                                                       "m_label":      "Disabled",
-                                                                                       "m_value":      false
-                                                                               }, {
-                                                                                       "type": "bool",
-                                                                                       "m_label":      "Focused",
-                                                                                       "m_value":      false
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Class Name:",
-                                                                                       "m_value":      ""
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Include File:",
-                                                                                       "m_value":      ""
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Label:",
-                                                                                       "m_value":      "XML-RPC"
-                                                                               }, {
-                                                                                       "type": "filePicker",
-                                                                                       "m_label":      "Bitmap File:",
-                                                                                       "m_path":       ""
-                                                                               }, {
-                                                                                       "type": "bool",
-                                                                                       "m_label":      "Selected",
-                                                                                       "m_value":      false
-                                                                               }],
-                                                                       "m_events":     [],
-                                                                       "m_children":   [{
-                                                                                       "m_type":       4449,
-                                                                                       "proportion":   1,
-                                                                                       "border":       5,
-                                                                                       "gbSpan":       "1,1",
-                                                                                       "gbPosition":   "0,0",
-                                                                                       "m_styles":     [],
-                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
-                                                                                       "m_properties": [{
-                                                                                                       "type": "string",
-                                                                                                       "m_label":      "Name:",
-                                                                                                       "m_value":      "staticBoxSizer85"
-                                                                                               }, {
-                                                                                                       "type": "choice",
-                                                                                                       "m_label":      "Orientation:",
-                                                                                                       "m_selection":  0,
-                                                                                                       "m_options":    ["Vertical", "Horizontal"]
-                                                                                               }, {
-                                                                                                       "type": "string",
-                                                                                                       "m_label":      "Label:",
-                                                                                                       "m_value":      ""
-                                                                                               }],
-                                                                                       "m_events":     [],
-                                                                                       "m_children":   [{
-                                                                                                       "m_type":       4452,
-                                                                                                       "proportion":   1,
-                                                                                                       "border":       2,
-                                                                                                       "gbSpan":       "1,1",
-                                                                                                       "gbPosition":   "0,0",
-                                                                                                       "m_styles":     [],
-                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_HORIZONTAL", "wxALIGN_CENTER_VERTICAL"],
-                                                                                                       "m_properties": [{
-                                                                                                                       "type": "string",
-                                                                                                                       "m_label":      "Name:",
-                                                                                                                       "m_value":      "gridSizer4203"
-                                                                                                               }, {
-                                                                                                                       "type": "string",
-                                                                                                                       "m_label":      "# Columns:",
-                                                                                                                       "m_value":      "1"
-                                                                                                               }, {
-                                                                                                                       "type": "string",
-                                                                                                                       "m_label":      "# Rows:",
-                                                                                                                       "m_value":      "2"
-                                                                                                               }, {
-                                                                                                                       "type": "string",
-                                                                                                                       "m_label":      "Horizontal gap:",
-                                                                                                                       "m_value":      "0"
-                                                                                                               }, {
-                                                                                                                       "type": "string",
-                                                                                                                       "m_label":      "Vertical gap:",
-                                                                                                                       "m_value":      "0"
-                                                                                                               }],
-                                                                                                       "m_events":     [],
-                                                                                                       "m_children":   [{
-                                                                                                                       "m_type":       4449,
-                                                                                                                       "proportion":   1,
-                                                                                                                       "border":       5,
-                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                       "m_styles":     [],
-                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND", "wxALIGN_CENTER_HORIZONTAL", "wxALIGN_CENTER_VERTICAL"],
-                                                                                                                       "m_properties": [{
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                       "m_value":      "staticBoxSizer4244"
-                                                                                                                               }, {
-                                                                                                                                       "type": "choice",
-                                                                                                                                       "m_label":      "Orientation:",
-                                                                                                                                       "m_selection":  0,
-                                                                                                                                       "m_options":    ["Vertical", "Horizontal"]
-                                                                                                                               }, {
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                       "m_value":      ""
-                                                                                                                               }],
-                                                                                                                       "m_events":     [],
-                                                                                                                       "m_children":   [{
-                                                                                                                                       "m_type":       4405,
-                                                                                                                                       "proportion":   1,
-                                                                                                                                       "border":       5,
-                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                       "m_styles":     ["wxALIGN_CENTRE"],
-                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND", "wxALIGN_CENTER_HORIZONTAL", "wxALIGN_CENTER_VERTICAL"],
-                                                                                                                                       "m_properties": [{
-                                                                                                                                                       "type": "winid",
-                                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                       "m_value":      "m_staticText42210"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                                       "colour":       "ButtonFace"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "font",
-                                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                                       "m_value":      "\\nRig control via external program using XML RPC Remote Calls\\n"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Wrap:",
-                                                                                                                                                       "m_value":      "-1"
-                                                                                                                                               }],
-                                                                                                                                       "m_events":     [],
-                                                                                                                                       "m_children":   []
-                                                                                                                               }]
-                                                                                                               }, {
-                                                                                                                       "m_type":       4401,
-                                                                                                                       "proportion":   0,
-                                                                                                                       "border":       5,
-                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                       "m_styles":     [],
-                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_HORIZONTAL"],
-                                                                                                                       "m_properties": [{
-                                                                                                                                       "type": "string",
-                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                       "m_value":      "boxSizer445"
-                                                                                                                               }, {
-                                                                                                                                       "type": "choice",
-                                                                                                                                       "m_label":      "Orientation:",
-                                                                                                                                       "m_selection":  0,
-                                                                                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
-                                                                                                                               }],
-                                                                                                                       "m_events":     [],
-                                                                                                                       "m_children":   [{
-                                                                                                                                       "m_type":       4415,
-                                                                                                                                       "proportion":   0,
-                                                                                                                                       "border":       5,
-                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                       "m_styles":     [],
-                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_HORIZONTAL", "wxALIGN_CENTER_VERTICAL"],
-                                                                                                                                       "m_properties": [{
-                                                                                                                                                       "type": "winid",
-                                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                       "m_value":      "m_checkBox437"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "font",
-                                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                                       "m_value":      "Use XML-RPC"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Value:",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }],
-                                                                                                                                       "m_events":     [],
-                                                                                                                                       "m_children":   []
-                                                                                                                               }, {
-                                                                                                                                       "m_type":       4400,
-                                                                                                                                       "proportion":   0,
-                                                                                                                                       "border":       5,
-                                                                                                                                       "gbSpan":       "1,1",
-                                                                                                                                       "gbPosition":   "0,0",
-                                                                                                                                       "m_styles":     [],
-                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_HORIZONTAL", "wxALIGN_CENTER_VERTICAL"],
-                                                                                                                                       "m_properties": [{
-                                                                                                                                                       "type": "winid",
-                                                                                                                                                       "m_label":      "ID:",
-                                                                                                                                                       "m_winid":      "wxID_ANY"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Minimum Size:",
-                                                                                                                                                       "m_value":      "-1,-1"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Name:",
-                                                                                                                                                       "m_value":      "m_button441"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "multi-string",
-                                                                                                                                                       "m_label":      "Tooltip:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Bg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "colour",
-                                                                                                                                                       "m_label":      "Fg Colour:",
-                                                                                                                                                       "colour":       "<Default>"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "font",
-                                                                                                                                                       "m_label":      "Font:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Hidden",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Disabled",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Focused",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Class Name:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Include File:",
-                                                                                                                                                       "m_value":      ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Label:",
-                                                                                                                                                       "m_value":      "Initialize"
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "bool",
-                                                                                                                                                       "m_label":      "Default Button",
-                                                                                                                                                       "m_value":      false
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "filePicker",
-                                                                                                                                                       "m_label":      "Bitmap File:",
-                                                                                                                                                       "m_path":       ""
-                                                                                                                                               }, {
-                                                                                                                                                       "type": "string",
-                                                                                                                                                       "m_label":      "Margins:",
-                                                                                                                                                       "m_value":      "2,2"
-                                                                                                                                               }],
-                                                                                                                                       "m_events":     [],
-                                                                                                                                       "m_children":   []
-                                                                                                                               }]
-                                                                                                               }]
-                                                                                               }]
-                                                                               }]
-                                                               }]
-                                               }, {
-                                                       "m_type":       4467,
-                                                       "proportion":   0,
-                                                       "border":       2,
-                                                       "gbSpan":       "1,1",
-                                                       "gbPosition":   "0,0",
-                                                       "m_styles":     [],
-                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_RIGHT", "wxALIGN_BOTTOM"],
-                                                       "m_properties": [{
-                                                                       "type": "winid",
-                                                                       "m_label":      "ID:",
-                                                                       "m_winid":      "wxID_ANY"
-                                                               }, {
-                                                                       "type": "string",
-                                                                       "m_label":      "Size:",
-                                                                       "m_value":      "-1,-1"
-                                                               }, {
-                                                                       "type": "string",
-                                                                       "m_label":      "Minimum Size:",
-                                                                       "m_value":      "-1,-1"
-                                                               }, {
-                                                                       "type": "string",
-                                                                       "m_label":      "Name:",
-                                                                       "m_value":      "m_stdBtnSizer155"
-                                                               }, {
-                                                                       "type": "multi-string",
-                                                                       "m_label":      "Tooltip:",
-                                                                       "m_value":      ""
-                                                               }, {
-                                                                       "type": "colour",
-                                                                       "m_label":      "Bg Colour:",
-                                                                       "colour":       "<Default>"
-                                                               }, {
-                                                                       "type": "colour",
-                                                                       "m_label":      "Fg Colour:",
-                                                                       "colour":       "<Default>"
-                                                               }, {
-                                                                       "type": "font",
-                                                                       "m_label":      "Font:",
-                                                                       "m_value":      ""
-                                                               }, {
-                                                                       "type": "bool",
-                                                                       "m_label":      "Hidden",
-                                                                       "m_value":      false
-                                                               }, {
-                                                                       "type": "bool",
-                                                                       "m_label":      "Disabled",
-                                                                       "m_value":      false
-                                                               }, {
-                                                                       "type": "bool",
-                                                                       "m_label":      "Focused",
-                                                                       "m_value":      false
-                                                               }, {
-                                                                       "type": "string",
-                                                                       "m_label":      "Class Name:",
-                                                                       "m_value":      ""
-                                                               }, {
-                                                                       "type": "string",
-                                                                       "m_label":      "Include File:",
-                                                                       "m_value":      ""
-                                                               }],
-                                                       "m_events":     [],
-                                                       "m_children":   [{
-                                                                       "m_type":       4468,
-                                                                       "proportion":   0,
-                                                                       "border":       5,
-                                                                       "gbSpan":       "1,1",
-                                                                       "gbPosition":   "0,0",
-                                                                       "m_styles":     [],
-                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                                                       "m_properties": [{
-                                                                                       "type": "choice",
-                                                                                       "m_label":      "ID:",
-                                                                                       "m_selection":  3,
-                                                                                       "m_options":    ["wxID_OK", "wxID_YES", "wxID_SAVE", "wxID_APPLY", "wxID_CLOSE", "wxID_NO", "wxID_CANCEL", "wxID_HELP", "wxID_CONTEXT_HELP"]
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Name:",
-                                                                                       "m_value":      "m_button165"
-                                                                               }, {
-                                                                                       "type": "multi-string",
-                                                                                       "m_label":      "Tooltip:",
-                                                                                       "m_value":      ""
-                                                                               }, {
-                                                                                       "type": "bool",
-                                                                                       "m_label":      "Default Button",
-                                                                                       "m_value":      false
-                                                                               }],
-                                                                       "m_events":     [],
-                                                                       "m_children":   []
-                                                               }, {
-                                                                       "m_type":       4468,
-                                                                       "proportion":   0,
-                                                                       "border":       5,
-                                                                       "gbSpan":       "1,1",
-                                                                       "gbPosition":   "0,0",
-                                                                       "m_styles":     [],
-                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                                                       "m_properties": [{
-                                                                                       "type": "choice",
-                                                                                       "m_label":      "ID:",
-                                                                                       "m_selection":  0,
-                                                                                       "m_options":    ["wxID_OK", "wxID_YES", "wxID_SAVE", "wxID_APPLY", "wxID_CLOSE", "wxID_NO", "wxID_CANCEL", "wxID_HELP", "wxID_CONTEXT_HELP"]
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Name:",
-                                                                                       "m_value":      "m_button167"
-                                                                               }, {
-                                                                                       "type": "multi-string",
-                                                                                       "m_label":      "Tooltip:",
-                                                                                       "m_value":      ""
-                                                                               }, {
-                                                                                       "type": "bool",
-                                                                                       "m_label":      "Default Button",
-                                                                                       "m_value":      true
-                                                                               }],
-                                                                       "m_events":     [],
-                                                                       "m_children":   []
-                                                               }, {
-                                                                       "m_type":       4468,
-                                                                       "proportion":   0,
-                                                                       "border":       5,
-                                                                       "gbSpan":       "1,1",
-                                                                       "gbPosition":   "0,0",
-                                                                       "m_styles":     [],
-                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
-                                                                       "m_properties": [{
-                                                                                       "type": "choice",
-                                                                                       "m_label":      "ID:",
-                                                                                       "m_selection":  6,
-                                                                                       "m_options":    ["wxID_OK", "wxID_YES", "wxID_SAVE", "wxID_APPLY", "wxID_CLOSE", "wxID_NO", "wxID_CANCEL", "wxID_HELP", "wxID_CONTEXT_HELP"]
-                                                                               }, {
-                                                                                       "type": "string",
-                                                                                       "m_label":      "Name:",
-                                                                                       "m_value":      "m_button366"
-                                                                               }, {
-                                                                                       "type": "multi-string",
-                                                                                       "m_label":      "Tooltip:",
-                                                                                       "m_value":      ""
-                                                                               }, {
-                                                                                       "type": "bool",
-                                                                                       "m_label":      "Default Button",
-                                                                                       "m_value":      false
-                                                                               }],
-                                                                       "m_events":     [],
-                                                                       "m_children":   []
-                                                               }]
-                                               }]
-                               }]
-               }]
-}
\ No newline at end of file
diff --git a/fdmdv2/branches/0.97/build/codelite/hamlib_trial/wxcrafter.xrc b/fdmdv2/branches/0.97/build/codelite/hamlib_trial/wxcrafter.xrc
deleted file mode 100644 (file)
index 4c562ab..0000000
+++ /dev/null
@@ -1,1326 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resource xmlns="http://www.wxwindows.org/wxxrc" version="2.3.0.1">
-  <object class="wxFrame" name="MainFrameBaseClass">
-    <title>topFrame</title>
-    <centered>1</centered>
-    <style>wxCAPTION|wxRESIZE_BORDER|wxMAXIMIZE_BOX|wxMINIMIZE_BOX|wxSYSTEM_MENU|wxCLOSE_BOX</style>
-    <size>500,300</size>
-    <object class="wxBoxSizer">
-      <orient>wxVERTICAL</orient>
-      <object class="sizeritem">
-        <flag>wxEXPAND</flag>
-        <border>5</border>
-        <option>1</option>
-        <object class="wxPanel" name="m_mainPanel">
-          <style>wxTAB_TRAVERSAL</style>
-          <object class="wxBoxSizer">
-            <orient>wxVERTICAL</orient>
-          </object>
-        </object>
-      </object>
-    </object>
-    <object class="wxMenuBar" name="m_menuBar">
-      <style/>
-      <object class="wxMenu" name="m_mbFile">
-        <label>File</label>
-        <style/>
-        <object class="wxMenuItem" name="m_mbiNew">
-          <label>New</label>
-          <accel/>
-        </object>
-        <object class="wxMenuItem" name="m_mbiOpen">
-          <label>Open</label>
-          <accel/>
-        </object>
-        <object class="wxMenuItem" name="m_mbiSave">
-          <label>Save</label>
-          <accel/>
-        </object>
-        <object class="wxMenuItem" name="m_mbiSaveAs">
-          <label>Save As</label>
-          <accel/>
-        </object>
-        <object class="separator"/>
-        <object class="wxMenuItem" name="m_mbiExit">
-          <label>Exit</label>
-          <accel>Alt-X</accel>
-        </object>
-      </object>
-      <object class="wxMenu" name="m_mbTools">
-        <label>Tools</label>
-        <style/>
-        <object class="wxMenuItem" name="m_mbiPrefs">
-          <label>Preferences</label>
-          <accel/>
-        </object>
-      </object>
-      <object class="wxMenu" name="m_mbHelp">
-        <label>Help</label>
-        <style/>
-        <object class="wxMenuItem" name="m_menuItem9">
-          <label>About...</label>
-          <accel/>
-        </object>
-      </object>
-    </object>
-    <object class="wxToolBar" name="m_mainToolbar">
-      <style>wxTB_FLAT</style>
-      <bitmapsize>16,16</bitmapsize>
-      <object class="tool" name="m_tbiNew">
-        <label>New</label>
-        <tooltip>New</tooltip>
-        <longhelp>New</longhelp>
-        <bitmap>C:/Users/wittend/AppData/Local/Temp/placeholder16.png</bitmap>
-      </object>
-      <object class="tool" name="m_rbiOpen">
-        <label>Tool Label</label>
-        <tooltip>Open</tooltip>
-        <longhelp>Open</longhelp>
-        <bitmap>C:/Users/wittend/AppData/Local/Temp/placeholder16.png</bitmap>
-      </object>
-    </object>
-  </object>
-  <object class="wxDialog" name="DlgRigCtrlBase">
-    <title>Rig Control</title>
-    <centered>1</centered>
-    <style>wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxCLOSE_BOX</style>
-    <size>460,315</size>
-    <object class="wxBoxSizer">
-      <orient>wxVERTICAL</orient>
-      <object class="sizeritem">
-        <flag>wxALL|wxEXPAND</flag>
-        <border>2</border>
-        <option>1</option>
-        <object class="wxNotebook" name="m_notebook53">
-          <style>wxBK_DEFAULT</style>
-          <object class="notebookpage">
-            <label>Hardware PTT</label>
-            <selected>1</selected>
-            <object class="wxPanel" name="m_panelHDWPTT">
-              <style>wxTAB_TRAVERSAL</style>
-              <tooltip>Hardware Push-to-Talk</tooltip>
-              <object class="wxFlexGridSizer">
-                <cols>1</cols>
-                <rows>3</rows>
-                <vgap>0</vgap>
-                <hgap>0</hgap>
-                <growablecols>1</growablecols>
-                <growablerows>3</growablerows>
-                <object class="sizeritem" name="staticBoxSizer169">
-                  <flag>wxALL|wxEXPAND</flag>
-                  <border>2</border>
-                  <object class="wxStaticBoxSizer" name="staticBoxSizer169">
-                    <sizeritem>
-                      <object class="spacer"/>
-                    </sizeritem>
-                    <orient>wxVERTICAL</orient>
-                    <label/>
-                    <object class="sizeritem">
-                      <flag>wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL</flag>
-                      <border>2</border>
-                      <option>1</option>
-                      <object class="wxCheckBox" name="m_checkBox7537">
-                        <style/>
-                        <label>PTT tone on right audio channel</label>
-                        <checked>0</checked>
-                      </object>
-                    </object>
-                  </object>
-                </object>
-                <object class="sizeritem" name="gridSizer159">
-                  <flag>wxALL|wxALIGN_LEFT|wxALIGN_TOP</flag>
-                  <border>2</border>
-                  <object class="wxGridSizer">
-                    <cols>1</cols>
-                    <rows>1</rows>
-                    <vgap>0</vgap>
-                    <hgap>0</hgap>
-                    <object class="sizeritem" name="staticBoxSizer157">
-                      <flag>wxALL|wxEXPAND|wxALIGN_TOP</flag>
-                      <border>2</border>
-                      <object class="wxStaticBoxSizer" name="staticBoxSizer157">
-                        <sizeritem>
-                          <object class="spacer"/>
-                        </sizeritem>
-                        <orient>wxHORIZONTAL</orient>
-                        <label>h/w ptt device pin</label>
-                        <object class="sizeritem" name="boxSizer175">
-                          <flag>wxALL</flag>
-                          <border>2</border>
-                          <option>1</option>
-                          <object class="wxBoxSizer">
-                            <orient>wxVERTICAL</orient>
-                            <object class="sizeritem">
-                              <flag>wxALL|wxALIGN_TOP</flag>
-                              <border>2</border>
-                              <object class="wxCheckBox" name="m_checkBox9112">
-                                <style/>
-                                <label>Use separate PTT device pin</label>
-                                <checked>0</checked>
-                              </object>
-                            </object>
-                            <object class="sizeritem">
-                              <flag>wxALL</flag>
-                              <border>5</border>
-                              <object class="wxStaticText" name="m_staticText173">
-                                <label>Device:</label>
-                                <style/>
-                              </object>
-                            </object>
-                            <object class="sizeritem">
-                              <flag>wxALL</flag>
-                              <border>2</border>
-                              <object class="wxComboBox" name="m_comboBox9313">
-                                <style/>
-                                <selection>-1</selection>
-                                <content/>
-                              </object>
-                            </object>
-                          </object>
-                        </object>
-                        <object class="sizeritem" name="boxSizer171">
-                          <flag>wxALL</flag>
-                          <border>2</border>
-                          <option>1</option>
-                          <object class="wxBoxSizer">
-                            <orient>wxHORIZONTAL</orient>
-                            <object class="sizeritem" name="boxSizer12714">
-                              <flag>wxALL|wxALIGN_CENTER_HORIZONTAL</flag>
-                              <border>2</border>
-                              <option>1</option>
-                              <object class="wxBoxSizer">
-                                <orient>wxVERTICAL</orient>
-                                <object class="sizeritem">
-                                  <flag>wxALL|wxALIGN_CENTER_HORIZONTAL</flag>
-                                  <border>2</border>
-                                  <option>1</option>
-                                  <object class="wxRadioBox" name="m_radioBox10115">
-                                    <label>Use RTS</label>
-                                    <style>wxRA_SPECIFY_COLS</style>
-                                    <dimension>2</dimension>
-                                    <selection>0</selection>
-                                    <content>
-                                      <item>Normal (V-)</item>
-                                      <item>Inverted (V+)</item>
-                                    </content>
-                                  </object>
-                                </object>
-                                <object class="sizeritem">
-                                  <flag>wxALL|wxALIGN_CENTER_HORIZONTAL</flag>
-                                  <border>2</border>
-                                  <option>1</option>
-                                  <object class="wxRadioBox" name="m_radioBox10316">
-                                    <label>Use DTR</label>
-                                    <style>wxRA_SPECIFY_COLS</style>
-                                    <dimension>2</dimension>
-                                    <selection>0</selection>
-                                    <content>
-                                      <item>Normal (V-)</item>
-                                      <item>Inverted (V+)</item>
-                                    </content>
-                                  </object>
-                                </object>
-                                <object class="sizeritem" name="boxSizer13118">
-                                  <flag>wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
-                                  <border>2</border>
-                                  <object class="wxBoxSizer">
-                                    <orient>wxHORIZONTAL</orient>
-                                    <object class="sizeritem">
-                                      <flag>wxALL</flag>
-                                      <border>2</border>
-                                      <option>1</option>
-                                      <object class="wxButton" name="m_button11319">
-                                        <label>Initialize</label>
-                                        <style/>
-                                        <default>0</default>
-                                      </object>
-                                    </object>
-                                  </object>
-                                </object>
-                              </object>
-                            </object>
-                          </object>
-                        </object>
-                      </object>
-                    </object>
-                  </object>
-                </object>
-                <object class="sizeritem" name="staticBoxSizer79420">
-                  <flag>wxALL|wxEXPAND|wxALIGN_LEFT</flag>
-                  <border>2</border>
-                  <object class="wxStaticBoxSizer" name="staticBoxSizer79420">
-                    <sizeritem>
-                      <object class="spacer"/>
-                    </sizeritem>
-                    <orient>wxHORIZONTAL</orient>
-                    <label>PTT delay for all CAT/PTT types</label>
-                    <object class="sizeritem">
-                      <flag>wxALL|wxALIGN_CENTER_VERTICAL</flag>
-                      <border>2</border>
-                      <object class="wxStaticText" name="m_staticText177">
-                        <label>Start of xmit delay</label>
-                        <style/>
-                      </object>
-                    </object>
-                    <object class="sizeritem">
-                      <flag>wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
-                      <border>2</border>
-                      <option>1</option>
-                      <object class="wxSlider" name="m_slider10721">
-                        <style>wxSL_HORIZONTAL</style>
-                        <min>0</min>
-                        <max>100</max>
-                        <value>50</value>
-                      </object>
-                    </object>
-                    <object class="sizeritem">
-                      <flag>wxALL|wxALIGN_CENTER_VERTICAL</flag>
-                      <border>2</border>
-                      <object class="wxStaticText" name="m_staticText179">
-                        <label>End of xmit delay:</label>
-                        <style/>
-                      </object>
-                    </object>
-                    <object class="sizeritem">
-                      <flag>wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
-                      <border>2</border>
-                      <object class="wxSlider" name="m_slider10922">
-                        <style>wxSL_HORIZONTAL</style>
-                        <min>0</min>
-                        <max>100</max>
-                        <value>50</value>
-                      </object>
-                    </object>
-                  </object>
-                </object>
-              </object>
-            </object>
-          </object>
-          <object class="notebookpage">
-            <label>RigCAT</label>
-            <selected>0</selected>
-            <object class="wxPanel" name="m_panelRIGCat">
-              <style>wxTAB_TRAVERSAL</style>
-              <tooltip>RigCat</tooltip>
-              <object class="wxBoxSizer">
-                <orient>wxVERTICAL</orient>
-                <object class="sizeritem">
-                  <flag>wxALL|wxALIGN_CENTER_HORIZONTAL</flag>
-                  <border>2</border>
-                  <object class="wxRadioButton" name="m_radioButton185">
-                    <style/>
-                    <label>Use RigCAT</label>
-                    <value>1</value>
-                  </object>
-                </object>
-                <object class="sizeritem" name="staticBoxSizer183">
-                  <flag>wxALL|wxEXPAND|wxALIGN_TOP</flag>
-                  <border>2</border>
-                  <option>1</option>
-                  <object class="wxStaticBoxSizer" name="staticBoxSizer183">
-                    <sizeritem>
-                      <object class="spacer"/>
-                    </sizeritem>
-                    <orient>wxVERTICAL</orient>
-                    <label/>
-                    <object class="sizeritem" name="flexGridSizer187">
-                      <flag>wxALL</flag>
-                      <border>2</border>
-                      <object class="wxFlexGridSizer">
-                        <cols>1</cols>
-                        <rows>1</rows>
-                        <vgap>0</vgap>
-                        <hgap>0</hgap>
-                        <growablecols>1</growablecols>
-                        <growablerows>1</growablerows>
-                        <object class="sizeritem" name="flexGridSizer204">
-                          <flag>wxALL|wxEXPAND</flag>
-                          <border>2</border>
-                          <option>1</option>
-                          <object class="wxFlexGridSizer">
-                            <cols>4</cols>
-                            <rows>3</rows>
-                            <vgap>0</vgap>
-                            <hgap>0</hgap>
-                            <growablecols/>
-                            <growablerows/>
-                            <object class="sizeritem" name="boxSizer193">
-                              <flag>wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL</flag>
-                              <border>2</border>
-                              <option>1</option>
-                              <object class="wxBoxSizer">
-                                <orient>wxHORIZONTAL</orient>
-                                <object class="sizeritem">
-                                  <flag>wxALL|wxALIGN_CENTER_VERTICAL</flag>
-                                  <border>2</border>
-                                  <object class="wxStaticText" name="m_staticText189">
-                                    <label>File:</label>
-                                    <style/>
-                                  </object>
-                                </object>
-                                <object class="sizeritem">
-                                  <flag>wxALL|wxALIGN_CENTER_VERTICAL</flag>
-                                  <border>2</border>
-                                  <object class="wxTextCtrl" name="m_textCtrl191">
-                                    <style/>
-                                  </object>
-                                </object>
-                              </object>
-                            </object>
-                            <object class="sizeritem" name="boxSizer206">
-                              <flag>wxALL|wxEXPAND</flag>
-                              <border>5</border>
-                              <option>1</option>
-                              <object class="wxBoxSizer">
-                                <orient>wxVERTICAL</orient>
-                                <object class="sizeritem">
-                                  <flag>wxALL|wxALIGN_CENTER_VERTICAL</flag>
-                                  <border>2</border>
-                                  <object class="wxButton" name="m_button208">
-                                    <label>Open</label>
-                                    <style/>
-                                    <default>0</default>
-                                  </object>
-                                </object>
-                              </object>
-                            </object>
-                            <object class="sizeritem" name="boxSizer19329">
-                              <flag>wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL</flag>
-                              <border>2</border>
-                              <option>1</option>
-                              <object class="wxBoxSizer">
-                                <orient>wxHORIZONTAL</orient>
-                                <object class="sizeritem">
-                                  <flag>wxALL|wxALIGN_CENTER_VERTICAL</flag>
-                                  <border>2</border>
-                                  <object class="wxStaticText" name="m_staticText18930">
-                                    <label>Device:</label>
-                                    <style/>
-                                  </object>
-                                </object>
-                                <object class="sizeritem">
-                                  <flag>wxALL|wxALIGN_CENTER_VERTICAL</flag>
-                                  <border>5</border>
-                                  <object class="wxComboBox" name="m_comboBox218">
-                                    <style/>
-                                    <selection>-1</selection>
-                                    <content/>
-                                  </object>
-                                </object>
-                              </object>
-                            </object>
-                          </object>
-                        </object>
-                      </object>
-                    </object>
-                    <object class="sizeritem" name="flexGridSizer222">
-                      <flag>wxALL</flag>
-                      <border>2</border>
-                      <object class="wxFlexGridSizer">
-                        <cols>3</cols>
-                        <rows>1</rows>
-                        <vgap>0</vgap>
-                        <hgap>0</hgap>
-                        <growablecols>2</growablecols>
-                        <growablerows/>
-                        <object class="sizeritem" name="boxSizer19326">
-                          <flag>wxALL|wxEXPAND</flag>
-                          <border>2</border>
-                          <option>1</option>
-                          <object class="wxBoxSizer">
-                            <orient>wxHORIZONTAL</orient>
-                            <object class="sizeritem">
-                              <flag>wxALL|wxALIGN_CENTER_VERTICAL</flag>
-                              <border>2</border>
-                              <object class="wxStaticText" name="m_staticText18927">
-                                <label>Retries:</label>
-                                <style/>
-                              </object>
-                            </object>
-                            <object class="sizeritem">
-                              <flag>wxALL|wxALIGN_CENTER_VERTICAL</flag>
-                              <border>2</border>
-                              <option>1</option>
-                              <object class="wxTextCtrl" name="m_textCtrl19128">
-                                <style/>
-                              </object>
-                            </object>
-                          </object>
-                        </object>
-                        <object class="sizeritem" name="boxSizer19323">
-                          <flag>wxALL|wxEXPAND</flag>
-                          <border>2</border>
-                          <option>1</option>
-                          <object class="wxBoxSizer">
-                            <orient>wxHORIZONTAL</orient>
-                            <object class="sizeritem">
-                              <flag>wxALL|wxALIGN_CENTER_VERTICAL</flag>
-                              <border>2</border>
-                              <object class="wxStaticText" name="m_staticText18924">
-                                <label>Retry Interval:</label>
-                                <style/>
-                              </object>
-                            </object>
-                            <object class="sizeritem">
-                              <flag>wxALL|wxALIGN_CENTER_VERTICAL</flag>
-                              <border>2</border>
-                              <option>1</option>
-                              <object class="wxTextCtrl" name="m_textCtrl19125">
-                                <style/>
-                              </object>
-                            </object>
-                          </object>
-                        </object>
-                        <object class="sizeritem" name="boxSizer1932954">
-                          <flag>wxALL|wxEXPAND</flag>
-                          <border>2</border>
-                          <option>1</option>
-                          <object class="wxBoxSizer">
-                            <orient>wxHORIZONTAL</orient>
-                            <object class="sizeritem">
-                              <flag>wxALL|wxALIGN_CENTER_VERTICAL</flag>
-                              <border>2</border>
-                              <object class="wxStaticText" name="m_staticText1893055">
-                                <label>Baud Rate:</label>
-                                <style/>
-                              </object>
-                            </object>
-                            <object class="sizeritem">
-                              <flag>wxALL|wxALIGN_CENTER_VERTICAL</flag>
-                              <border>2</border>
-                              <option>1</option>
-                              <object class="wxComboBox" name="m_comboBaud">
-                                <style/>
-                                <selection>-1</selection>
-                                <content>
-                                  <item>300</item>
-                                  <item>600</item>
-                                  <item>1200</item>
-                                  <item>2400</item>
-                                  <item>9600</item>
-                                  <item>19200</item>
-                                  <item>38400</item>
-                                  <item>56800</item>
-                                </content>
-                              </object>
-                            </object>
-                          </object>
-                        </object>
-                      </object>
-                    </object>
-                    <object class="sizeritem" name="flexGridSizer18747">
-                      <flag>wxALL|wxEXPAND</flag>
-                      <border>2</border>
-                      <object class="wxFlexGridSizer">
-                        <cols>1</cols>
-                        <rows>1</rows>
-                        <vgap>0</vgap>
-                        <hgap>0</hgap>
-                        <growablecols>1</growablecols>
-                        <growablerows/>
-                        <object class="sizeritem" name="flexGridSizer20448">
-                          <flag>wxALL</flag>
-                          <border>2</border>
-                          <option>1</option>
-                          <object class="wxFlexGridSizer">
-                            <cols>3</cols>
-                            <rows>1</rows>
-                            <vgap>0</vgap>
-                            <hgap>0</hgap>
-                            <growablecols>3</growablecols>
-                            <growablerows>1</growablerows>
-                            <object class="sizeritem" name="boxSizer19349">
-                              <flag>wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL</flag>
-                              <border>2</border>
-                              <option>1</option>
-                              <object class="wxBoxSizer">
-                                <orient>wxHORIZONTAL</orient>
-                                <object class="sizeritem">
-                                  <flag>wxALL|wxALIGN_CENTER_VERTICAL</flag>
-                                  <border>2</border>
-                                  <object class="wxStaticText" name="m_staticText18950">
-                                    <label>Write Delay (ms):</label>
-                                    <style/>
-                                  </object>
-                                </object>
-                                <object class="sizeritem">
-                                  <flag>wxALL|wxALIGN_CENTER_VERTICAL</flag>
-                                  <border>2</border>
-                                  <object class="wxTextCtrl" name="m_textCtrl19151">
-                                    <style/>
-                                  </object>
-                                </object>
-                              </object>
-                            </object>
-                            <object class="sizeritem" name="boxSizer298">
-                              <flag>wxALL|wxEXPAND</flag>
-                              <border>2</border>
-                              <option>1</option>
-                              <object class="wxBoxSizer">
-                                <orient>wxHORIZONTAL</orient>
-                                <object class="sizeritem">
-                                  <flag>wxALL</flag>
-                                  <border>2</border>
-                                  <object class="wxStaticText" name="m_staticText298">
-                                    <label>Stop Bits:</label>
-                                    <style/>
-                                  </object>
-                                </object>
-                                <object class="sizeritem">
-                                  <flag>wxALL</flag>
-                                  <border>5</border>
-                                  <object class="wxSlider" name="m_sliderStopBits">
-                                    <style>wxSL_HORIZONTAL</style>
-                                    <min>0</min>
-                                    <max>2</max>
-                                    <value>0</value>
-                                  </object>
-                                </object>
-                              </object>
-                            </object>
-                          </object>
-                        </object>
-                      </object>
-                    </object>
-                    <object class="sizeritem" name="flexGridSizer224">
-                      <flag>wxALL|wxEXPAND</flag>
-                      <border>2</border>
-                      <object class="wxFlexGridSizer">
-                        <cols>4</cols>
-                        <rows>1</rows>
-                        <vgap>0</vgap>
-                        <hgap>0</hgap>
-                        <growablecols>4</growablecols>
-                        <growablerows>1</growablerows>
-                        <object class="spacer" name="Spacer234">
-                          <size>2,2</size>
-                          <flag>wxALL|wxEXPAND</flag>
-                          <border>2</border>
-                          <option>1</option>
-                        </object>
-                        <object class="sizeritem">
-                          <flag>wxALL|wxEXPAND</flag>
-                          <border>1</border>
-                          <object class="wxCheckBox" name="m_cbEcho">
-                            <tooltip>Commands are echoed</tooltip>
-                            <style/>
-                            <label>Commands echoed</label>
-                            <checked>0</checked>
-                          </object>
-                        </object>
-                        <object class="spacer" name="Spacer240">
-                          <size>2,2</size>
-                          <flag>wxALL|wxEXPAND</flag>
-                          <border>2</border>
-                          <option>1</option>
-                        </object>
-                        <object class="sizeritem">
-                          <flag>wxALL|wxEXPAND</flag>
-                          <border>2</border>
-                          <option>1</option>
-                          <object class="wxCheckBox" name="m_cbCATPTT">
-                            <tooltip>Use CAT commands for PTT</tooltip>
-                            <style/>
-                            <label>CAT command for PTT</label>
-                            <checked>0</checked>
-                          </object>
-                        </object>
-                      </object>
-                    </object>
-                    <object class="sizeritem" name="flexGridSizer22432">
-                      <flag>wxALL|wxEXPAND</flag>
-                      <border>2</border>
-                      <object class="wxFlexGridSizer">
-                        <cols>4</cols>
-                        <rows>1</rows>
-                        <vgap>0</vgap>
-                        <hgap>0</hgap>
-                        <growablecols>4</growablecols>
-                        <growablerows>1</growablerows>
-                        <object class="spacer" name="Spacer2402">
-                          <size>2,2</size>
-                          <flag>wxALL|wxEXPAND</flag>
-                          <border>2</border>
-                          <option>1</option>
-                        </object>
-                        <object class="sizeritem">
-                          <flag>wxALL</flag>
-                          <border>2</border>
-                          <option>1</option>
-                          <object class="wxCheckBox" name="m_cbToggleRTSPTT">
-                            <tooltip>Toggle RTS for PTT</tooltip>
-                            <style/>
-                            <label>Toggle RTS for PTT</label>
-                            <checked>0</checked>
-                          </object>
-                        </object>
-                        <object class="spacer" name="Spacer2401">
-                          <size>2,2</size>
-                          <flag>wxALL|wxEXPAND</flag>
-                          <border>2</border>
-                          <option>1</option>
-                        </object>
-                        <object class="sizeritem">
-                          <flag>wxALL</flag>
-                          <border>2</border>
-                          <option>1</option>
-                          <object class="wxCheckBox" name="m_cbToggleDTRPTT">
-                            <tooltip>Toggle DTR for PTT</tooltip>
-                            <style/>
-                            <label>Toggle DTR for PTT</label>
-                            <checked>0</checked>
-                          </object>
-                        </object>
-                      </object>
-                    </object>
-                    <object class="sizeritem" name="flexGridSizer22437">
-                      <flag>wxALL|wxEXPAND</flag>
-                      <border>2</border>
-                      <object class="wxFlexGridSizer">
-                        <cols>4</cols>
-                        <rows>1</rows>
-                        <vgap>0</vgap>
-                        <hgap>0</hgap>
-                        <growablecols>4</growablecols>
-                        <growablerows>1</growablerows>
-                        <object class="spacer" name="Spacer23438">
-                          <size>2,2</size>
-                          <flag>wxALL|wxEXPAND</flag>
-                          <border>2</border>
-                          <option>1</option>
-                        </object>
-                        <object class="sizeritem">
-                          <flag>wxALL|wxEXPAND</flag>
-                          <border>2</border>
-                          <option>1</option>
-                          <object class="wxCheckBox" name="m_cbRTS12VInit">
-                            <tooltip>Initialize state of RTS</tooltip>
-                            <style/>
-                            <label>Initial RTS +12v</label>
-                            <checked>0</checked>
-                          </object>
-                        </object>
-                        <object class="spacer" name="Spacer24040">
-                          <size>2,2</size>
-                          <flag>wxALL|wxEXPAND</flag>
-                          <border>2</border>
-                          <option>1</option>
-                        </object>
-                        <object class="sizeritem">
-                          <flag>wxALL|wxEXPAND</flag>
-                          <border>2</border>
-                          <option>1</option>
-                          <object class="wxCheckBox" name="m_cbDTR12VInit">
-                            <tooltip>Initialize state of DTR</tooltip>
-                            <style/>
-                            <label>Initial DTR +12v</label>
-                            <checked>0</checked>
-                          </object>
-                        </object>
-                      </object>
-                    </object>
-                    <object class="sizeritem" name="flexGridSizer22442">
-                      <flag>wxALL|wxEXPAND</flag>
-                      <border>2</border>
-                      <object class="wxFlexGridSizer">
-                        <cols>4</cols>
-                        <rows>1</rows>
-                        <vgap>0</vgap>
-                        <hgap>0</hgap>
-                        <growablecols>4</growablecols>
-                        <growablerows>1</growablerows>
-                        <object class="spacer" name="Spacer23443">
-                          <size>2,2</size>
-                          <flag>wxALL</flag>
-                          <border>2</border>
-                        </object>
-                        <object class="sizeritem">
-                          <flag>wxALL</flag>
-                          <border>2</border>
-                          <object class="wxCheckBox" name="m_cbRTSCTSFlowCtl">
-                            <style/>
-                            <label>RTS/CTS Flow Control</label>
-                            <checked>0</checked>
-                          </object>
-                        </object>
-                        <object class="spacer" name="Spacer24045">
-                          <size>2,2</size>
-                          <flag>wxALL</flag>
-                          <border>2</border>
-                        </object>
-                        <object class="sizeritem">
-                          <flag>wxALL</flag>
-                          <border>2</border>
-                          <object class="wxCheckBox" name="m_cbVSPEnable">
-                            <tooltip>Virtual serial port enable. Suppress WARNINGS</tooltip>
-                            <style/>
-                            <label>RTS/CTS Flow Control</label>
-                            <checked>0</checked>
-                          </object>
-                        </object>
-                      </object>
-                    </object>
-                  </object>
-                </object>
-              </object>
-            </object>
-          </object>
-          <object class="notebookpage">
-            <label>HAMlib</label>
-            <selected>0</selected>
-            <object class="wxPanel" name="m_panelHAMLib">
-              <style>wxTAB_TRAVERSAL</style>
-              <tooltip>Hamlib Configuration</tooltip>
-              <object class="wxStaticBoxSizer" name="staticBoxSizer296">
-                <sizeritem>
-                  <object class="spacer"/>
-                </sizeritem>
-                <orient>wxVERTICAL</orient>
-                <label/>
-                <object class="sizeritem" name="gridSizer368">
-                  <flag>wxALL|wxEXPAND</flag>
-                  <border>5</border>
-                  <object class="wxGridSizer">
-                    <cols>3</cols>
-                    <rows>8</rows>
-                    <vgap>0</vgap>
-                    <hgap>0</hgap>
-                    <object class="sizeritem" name="boxSizer312">
-                      <flag>wxALL|wxEXPAND</flag>
-                      <border>2</border>
-                      <option>1</option>
-                      <object class="wxBoxSizer">
-                        <orient>wxHORIZONTAL</orient>
-                        <object class="sizeritem">
-                          <flag>wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL</flag>
-                          <border>2</border>
-                          <object class="wxStaticText" name="m_staticText308">
-                            <label>Device:</label>
-                            <style/>
-                          </object>
-                        </object>
-                        <object class="sizeritem">
-                          <flag>wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL</flag>
-                          <border>2</border>
-                          <option>1</option>
-                          <object class="wxComboBox" name="m_comboBox314">
-                            <style/>
-                            <selection>-1</selection>
-                            <content/>
-                          </object>
-                        </object>
-                      </object>
-                    </object>
-                    <object class="sizeritem">
-                      <flag>wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL</flag>
-                      <border>2</border>
-                      <option>1</option>
-                      <object class="wxStaticText" name="m_staticText304">
-                        <label>Rig:</label>
-                        <style/>
-                      </object>
-                    </object>
-                    <object class="sizeritem" name="boxSizer302">
-                      <flag>wxALL</flag>
-                      <border>2</border>
-                      <option>1</option>
-                      <object class="wxBoxSizer">
-                        <orient>wxHORIZONTAL</orient>
-                        <object class="sizeritem">
-                          <flag>wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL</flag>
-                          <border>2</border>
-                          <option>1</option>
-                          <object class="wxTextCtrl" name="m_textCtrl306">
-                            <style/>
-                          </object>
-                        </object>
-                      </object>
-                    </object>
-                    <object class="sizeritem" name="boxSizer320">
-                      <flag>wxALL</flag>
-                      <border>2</border>
-                      <option>1</option>
-                      <object class="wxBoxSizer">
-                        <orient>wxHORIZONTAL</orient>
-                        <object class="sizeritem">
-                          <flag>wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL</flag>
-                          <border>2</border>
-                          <object class="wxStaticText" name="m_staticText326">
-                            <label>Retries:</label>
-                            <style/>
-                          </object>
-                        </object>
-                        <object class="sizeritem">
-                          <flag>wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL</flag>
-                          <border>2</border>
-                          <option>1</option>
-                          <object class="wxTextCtrl" name="m_textCtrl328">
-                            <style/>
-                          </object>
-                        </object>
-                      </object>
-                    </object>
-                    <object class="sizeritem" name="boxSizer32057">
-                      <flag>wxALL</flag>
-                      <border>2</border>
-                      <option>1</option>
-                      <object class="wxBoxSizer">
-                        <orient>wxHORIZONTAL</orient>
-                        <object class="sizeritem">
-                          <flag>wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL</flag>
-                          <border>2</border>
-                          <object class="wxStaticText" name="m_staticText32658">
-                            <label>Retry Interval:</label>
-                            <style/>
-                          </object>
-                        </object>
-                        <object class="sizeritem">
-                          <flag>wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
-                          <border>2</border>
-                          <option>1</option>
-                          <object class="wxTextCtrl" name="m_textCtrl32859">
-                            <style/>
-                          </object>
-                        </object>
-                      </object>
-                    </object>
-                    <object class="sizeritem" name="boxSizer32060">
-                      <flag>wxALL</flag>
-                      <border>2</border>
-                      <option>1</option>
-                      <object class="wxBoxSizer">
-                        <orient>wxHORIZONTAL</orient>
-                        <object class="sizeritem">
-                          <flag>wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL</flag>
-                          <border>2</border>
-                          <object class="wxStaticText" name="m_staticText32661">
-                            <label>Baud Rate:</label>
-                            <style/>
-                          </object>
-                        </object>
-                        <object class="sizeritem">
-                          <flag>wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
-                          <border>2</border>
-                          <option>1</option>
-                          <object class="wxComboBox" name="m_comboBox339">
-                            <style/>
-                            <selection>-1</selection>
-                            <content>
-                              <item>300</item>
-                              <item>600</item>
-                              <item>1200</item>
-                              <item>2400</item>
-                              <item>9600</item>
-                              <item>19200</item>
-                              <item>38400</item>
-                              <item>56800</item>
-                            </content>
-                          </object>
-                        </object>
-                      </object>
-                    </object>
-                    <object class="sizeritem" name="boxSizer32064">
-                      <flag>wxALL</flag>
-                      <border>2</border>
-                      <object class="wxBoxSizer">
-                        <orient>wxHORIZONTAL</orient>
-                        <object class="sizeritem">
-                          <flag>wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL</flag>
-                          <border>2</border>
-                          <object class="wxStaticText" name="m_staticText32665">
-                            <label>Write Delay:</label>
-                            <style/>
-                          </object>
-                        </object>
-                        <object class="sizeritem">
-                          <flag>wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL</flag>
-                          <border>2</border>
-                          <option>1</option>
-                          <object class="wxTextCtrl" name="m_textCtrl32866">
-                            <style/>
-                          </object>
-                        </object>
-                      </object>
-                    </object>
-                    <object class="sizeritem" name="boxSizer3205767">
-                      <flag>wxALL</flag>
-                      <border>2</border>
-                      <option>1</option>
-                      <object class="wxBoxSizer">
-                        <orient>wxHORIZONTAL</orient>
-                        <object class="sizeritem">
-                          <flag>wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL</flag>
-                          <border>2</border>
-                          <object class="wxStaticText" name="m_staticText3265868">
-                            <label>Post Write Delay:</label>
-                            <style/>
-                          </object>
-                        </object>
-                        <object class="sizeritem">
-                          <flag>wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
-                          <border>2</border>
-                          <option>1</option>
-                          <object class="wxTextCtrl" name="m_textCtrl3285969">
-                            <style/>
-                          </object>
-                        </object>
-                      </object>
-                    </object>
-                    <object class="sizeritem" name="boxSizer3206070">
-                      <flag>wxALL</flag>
-                      <border>2</border>
-                      <object class="wxBoxSizer">
-                        <orient>wxHORIZONTAL</orient>
-                        <object class="sizeritem">
-                          <flag>wxALL</flag>
-                          <border>2</border>
-                          <option>1</option>
-                          <object class="wxStaticText" name="m_staticText3266171">
-                            <label>Stop bits:</label>
-                            <style/>
-                          </object>
-                        </object>
-                        <object class="sizeritem">
-                          <flag>wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
-                          <border>2</border>
-                          <option>1</option>
-                          <object class="wxSlider" name="m_slider361">
-                            <style>wxSL_LABELS|wxSL_HORIZONTAL</style>
-                            <min>0</min>
-                            <max>2</max>
-                            <value>1</value>
-                          </object>
-                        </object>
-                      </object>
-                    </object>
-                    <object class="sizeritem">
-                      <flag>wxALL</flag>
-                      <border>2</border>
-                      <option>1</option>
-                      <object class="wxCheckBox" name="m_cbHAMLIBPTT">
-                        <tooltip>Use Hamlib to control PTT</tooltip>
-                        <style/>
-                        <label>PTT via HAMLib</label>
-                        <checked>0</checked>
-                      </object>
-                    </object>
-                    <object class="sizeritem">
-                      <flag>wxALL|wxALIGN_RIGHT</flag>
-                      <border>2</border>
-                      <option>1</option>
-                      <object class="wxStaticText" name="m_staticText408">
-                        <label>Sideband:</label>
-                        <style/>
-                      </object>
-                    </object>
-                    <object class="sizeritem" name="boxSizer410">
-                      <flag>wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
-                      <border>2</border>
-                      <option>1</option>
-                      <object class="wxBoxSizer">
-                        <orient>wxVERTICAL</orient>
-                        <object class="sizeritem">
-                          <flag>wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL</flag>
-                          <border>2</border>
-                          <object class="wxComboBox" name="m_comboBox376">
-                            <style/>
-                            <selection>-1</selection>
-                            <content>
-                              <item>Upper</item>
-                              <item>Lower</item>
-                            </content>
-                          </object>
-                        </object>
-                      </object>
-                    </object>
-                    <object class="sizeritem">
-                      <flag>wxALL</flag>
-                      <border>2</border>
-                      <object class="wxCheckBox" name="m_checkBox378">
-                        <tooltip>Initialize state of RTS</tooltip>
-                        <style/>
-                        <label>Initial RTS +12v</label>
-                        <checked>0</checked>
-                      </object>
-                    </object>
-                    <object class="spacer" name="Spacer380">
-                      <flag>wxALL</flag>
-                      <border>2</border>
-                    </object>
-                    <object class="sizeritem">
-                      <flag>wxALL</flag>
-                      <border>2</border>
-                      <object class="wxCheckBox" name="m_checkBox382">
-                        <style/>
-                        <label>Initial DTR +12v</label>
-                        <checked>0</checked>
-                      </object>
-                    </object>
-                    <object class="sizeritem">
-                      <flag>wxALL</flag>
-                      <border>2</border>
-                      <object class="wxCheckBox" name="m_cbRTSCTS">
-                        <tooltip>Use RTS/CTS Flow Control</tooltip>
-                        <style/>
-                        <label>RTS/CTS Flow Control</label>
-                        <checked>0</checked>
-                      </object>
-                    </object>
-                    <object class="spacer" name="Spacer386">
-                      <flag>wxALL</flag>
-                      <border>2</border>
-                    </object>
-                    <object class="sizeritem">
-                      <flag>wxALL</flag>
-                      <border>2</border>
-                      <object class="wxCheckBox" name="m_cbXONXOFF">
-                        <tooltip>Use XON/XOFF flow control</tooltip>
-                        <style/>
-                        <label>XON/XOFF Flow Control</label>
-                        <checked>0</checked>
-                      </object>
-                    </object>
-                    <object class="sizeritem">
-                      <flag>wxALL</flag>
-                      <border>2</border>
-                      <object class="wxStaticText" name="m_staticText404">
-                        <label>Advanced Configuration:</label>
-                        <style/>
-                      </object>
-                    </object>
-                    <object class="spacer" name="Spacer396">
-                      <flag>wxALL</flag>
-                      <border>2</border>
-                    </object>
-                    <object class="sizeritem">
-                      <flag>wxALL</flag>
-                      <border>2</border>
-                      <object class="wxButton" name="m_btnRevert">
-                        <label>Revert</label>
-                        <style/>
-                        <tooltip>Revert to previous settings</tooltip>
-                        <default>0</default>
-                      </object>
-                    </object>
-                    <object class="sizeritem">
-                      <flag>wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL</flag>
-                      <border>2</border>
-                      <option>1</option>
-                      <object class="wxTextCtrl" name="m_textAdvancedCFG">
-                        <style/>
-                        <tooltip>Enter Advanced Configuration string</tooltip>
-                      </object>
-                    </object>
-                    <object class="spacer" name="Spacer406">
-                      <flag>wxALL</flag>
-                      <border>2</border>
-                    </object>
-                    <object class="sizeritem">
-                      <flag>wxALL</flag>
-                      <border>2</border>
-                      <object class="wxButton" name="m_btnInitHamlib">
-                        <label>Initialize</label>
-                        <style/>
-                        <tooltip>Initialize HAMLib</tooltip>
-                        <default>0</default>
-                      </object>
-                    </object>
-                  </object>
-                </object>
-              </object>
-            </object>
-          </object>
-          <object class="notebookpage">
-            <label>MemMap</label>
-            <selected>0</selected>
-            <object class="wxPanel" name="m_panelMemMap">
-              <style>wxTAB_TRAVERSAL</style>
-              <bg>wxSYS_COLOUR_BTNHIGHLIGHT</bg>
-              <tooltip>Memory Mapped control</tooltip>
-              <object class="wxStaticBoxSizer" name="staticBoxSizer294">
-                <sizeritem>
-                  <object class="spacer"/>
-                </sizeritem>
-                <orient>wxVERTICAL</orient>
-                <label/>
-                <object class="sizeritem" name="gridSizer420">
-                  <flag>wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
-                  <border>2</border>
-                  <option>1</option>
-                  <object class="wxGridSizer">
-                    <cols>1</cols>
-                    <rows>2</rows>
-                    <vgap>0</vgap>
-                    <hgap>0</hgap>
-                    <object class="sizeritem" name="staticBoxSizer424">
-                      <flag>wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
-                      <border>5</border>
-                      <option>1</option>
-                      <object class="wxStaticBoxSizer" name="staticBoxSizer424">
-                        <sizeritem>
-                          <object class="spacer"/>
-                        </sizeritem>
-                        <orient>wxVERTICAL</orient>
-                        <label/>
-                        <object class="sizeritem">
-                          <flag>wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
-                          <border>5</border>
-                          <option>1</option>
-                          <object class="wxStaticText" name="m_staticText422">
-                            <label>\nControl via Memory Mapped Shared Variables, i. e. Kachina \n</label>
-                            <style>wxALIGN_CENTRE</style>
-                            <bg>wxSYS_COLOUR_BTNFACE</bg>
-                          </object>
-                        </object>
-                      </object>
-                    </object>
-                    <object class="sizeritem" name="boxSizer4456">
-                      <flag>wxALL|wxALIGN_CENTER_HORIZONTAL</flag>
-                      <border>5</border>
-                      <object class="wxBoxSizer">
-                        <orient>wxVERTICAL</orient>
-                        <object class="sizeritem">
-                          <flag>wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
-                          <border>5</border>
-                          <object class="wxCheckBox" name="m_checkBox4377">
-                            <style/>
-                            <label>Use Memorymap</label>
-                            <checked>0</checked>
-                          </object>
-                        </object>
-                        <object class="sizeritem">
-                          <flag>wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_BOTTOM</flag>
-                          <border>5</border>
-                          <object class="wxCheckBox" name="m_checkBox4398">
-                            <style/>
-                            <label>Use Memmap PTT</label>
-                            <checked>0</checked>
-                          </object>
-                        </object>
-                        <object class="sizeritem">
-                          <flag>wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
-                          <border>5</border>
-                          <object class="wxButton" name="m_button4419">
-                            <label>Initialize</label>
-                            <style/>
-                            <default>0</default>
-                          </object>
-                        </object>
-                      </object>
-                    </object>
-                  </object>
-                </object>
-              </object>
-            </object>
-          </object>
-          <object class="notebookpage">
-            <label>XML-RPC</label>
-            <selected>0</selected>
-            <object class="wxPanel" name="m_panelXMLRPC">
-              <style>wxTAB_TRAVERSAL</style>
-              <tooltip>XML-RPC control</tooltip>
-              <object class="wxStaticBoxSizer" name="staticBoxSizer85">
-                <sizeritem>
-                  <object class="spacer"/>
-                </sizeritem>
-                <orient>wxVERTICAL</orient>
-                <label/>
-                <object class="sizeritem" name="gridSizer4203">
-                  <flag>wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
-                  <border>2</border>
-                  <option>1</option>
-                  <object class="wxGridSizer">
-                    <cols>1</cols>
-                    <rows>2</rows>
-                    <vgap>0</vgap>
-                    <hgap>0</hgap>
-                    <object class="sizeritem" name="staticBoxSizer4244">
-                      <flag>wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
-                      <border>5</border>
-                      <option>1</option>
-                      <object class="wxStaticBoxSizer" name="staticBoxSizer4244">
-                        <sizeritem>
-                          <object class="spacer"/>
-                        </sizeritem>
-                        <orient>wxVERTICAL</orient>
-                        <label/>
-                        <object class="sizeritem">
-                          <flag>wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
-                          <border>5</border>
-                          <option>1</option>
-                          <object class="wxStaticText" name="m_staticText42210">
-                            <label>\nRig control via external program using XML RPC Remote Calls\n</label>
-                            <style>wxALIGN_CENTRE</style>
-                            <bg>wxSYS_COLOUR_BTNFACE</bg>
-                          </object>
-                        </object>
-                      </object>
-                    </object>
-                    <object class="sizeritem" name="boxSizer445">
-                      <flag>wxALL|wxALIGN_CENTER_HORIZONTAL</flag>
-                      <border>5</border>
-                      <object class="wxBoxSizer">
-                        <orient>wxVERTICAL</orient>
-                        <object class="sizeritem">
-                          <flag>wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
-                          <border>5</border>
-                          <object class="wxCheckBox" name="m_checkBox437">
-                            <style/>
-                            <label>Use XML-RPC</label>
-                            <checked>0</checked>
-                          </object>
-                        </object>
-                        <object class="sizeritem">
-                          <flag>wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
-                          <border>5</border>
-                          <object class="wxButton" name="m_button441">
-                            <label>Initialize</label>
-                            <style/>
-                            <default>0</default>
-                          </object>
-                        </object>
-                      </object>
-                    </object>
-                  </object>
-                </object>
-              </object>
-            </object>
-          </object>
-        </object>
-      </object>
-      <object class="sizeritem">
-        <flag>wxALL|wxALIGN_RIGHT|wxALIGN_BOTTOM</flag>
-        <border>2</border>
-        <object class="wxStdDialogButtonSizer" name="m_stdBtnSizer155">
-          <object class="button">
-            <object class="wxButton" name="wxID_APPLY">
-              <label/>
-              <style/>
-              <bg/>
-              <fg/>
-              <default>0</default>
-            </object>
-          </object>
-          <object class="button">
-            <object class="wxButton" name="wxID_OK">
-              <label/>
-              <style/>
-              <bg/>
-              <fg/>
-              <default>1</default>
-            </object>
-          </object>
-          <object class="button">
-            <object class="wxButton" name="wxID_CANCEL">
-              <label/>
-              <style/>
-              <bg/>
-              <fg/>
-              <default>0</default>
-            </object>
-          </object>
-        </object>
-      </object>
-    </object>
-  </object>
-</resource>
diff --git a/fdmdv2/branches/0.97/build/codelite/hamlib_trial/wxcrafter_bitmaps.cpp b/fdmdv2/branches/0.97/build/codelite/hamlib_trial/wxcrafter_bitmaps.cpp
deleted file mode 100644 (file)
index 6d25c24..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-//\r
-// This file was automatically generated by wxrc, do not edit by hand.\r
-//\r
-\r
-#include <wx/wxprec.h>\r
-\r
-#ifdef __BORLANDC__\r
-    #pragma hdrstop\r
-#endif\r
-\r
-#include <wx/filesys.h>\r
-#include <wx/fs_mem.h>\r
-#include <wx/xrc/xmlres.h>\r
-#include <wx/xrc/xh_all.h>\r
-\r
-#if wxCHECK_VERSION(2,8,5) && wxABI_VERSION >= 20805\r
-    #define XRC_ADD_FILE(name, data, size, mime) \\r
-        wxMemoryFSHandler::AddFileWithMimeType(name, data, size, mime)\r
-#else\r
-    #define XRC_ADD_FILE(name, data, size, mime) \\r
-        wxMemoryFSHandler::AddFile(name, data, size)\r
-#endif\r
-\r
-static size_t xml_res_size_0 = 741;\r
-static unsigned char xml_res_file_0[] = {\r
-137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,16,0,0,0,16,8,6,0,0,\r
-0,31,243,255,97,0,0,0,4,115,66,73,84,8,8,8,8,124,8,100,136,0,0,2,156,73,\r
-68,65,84,56,141,173,147,75,72,84,81,24,199,127,231,220,235,220,235,45,199,\r
-49,197,80,163,135,129,137,61,160,162,54,45,34,132,176,22,150,72,26,97,20,\r
-18,68,181,200,144,158,180,41,122,16,34,4,81,4,165,161,133,88,17,145,16,\r
-84,84,27,193,160,168,133,76,81,19,77,106,62,26,31,89,51,57,227,157,185,\r
-143,22,87,210,86,110,250,195,225,28,248,56,191,255,247,253,15,71,48,67,\r
-67,13,53,115,50,28,251,146,227,184,181,2,55,29,119,170,32,192,69,36,164,\r
-20,205,49,169,28,207,59,122,103,130,233,146,167,95,23,119,93,21,138,60,\r
-168,173,219,64,90,81,9,34,175,128,127,0,67,3,164,66,239,49,223,116,225,\r
-218,206,181,204,147,109,135,254,2,126,156,171,106,215,10,139,170,141,242,\r
-74,80,4,36,250,33,21,1,41,61,128,237,128,111,62,232,11,192,113,137,119,\r
-60,192,12,135,238,206,59,125,111,167,24,57,91,117,222,151,95,112,202,191,\r
-167,22,98,131,48,17,2,203,34,210,209,205,216,171,48,8,200,45,45,38,103,\r
-235,74,176,28,152,187,12,50,242,137,182,52,147,28,28,184,32,237,100,170,\r
-222,95,81,9,241,97,72,244,128,106,16,31,156,100,180,243,51,37,183,14,176,\r
-244,216,54,190,61,14,130,158,9,170,1,241,30,136,15,227,175,168,196,78,165,\r
-234,165,80,125,26,1,63,164,126,130,98,128,212,49,138,151,176,188,233,48,\r
-184,26,74,90,58,129,128,14,82,7,37,221,131,164,126,66,192,15,73,71,83,29,\r
-203,241,146,80,124,120,169,9,16,2,55,97,243,245,76,11,137,190,97,150,223,\r
-57,13,147,73,80,37,184,46,40,26,72,176,108,7,53,249,59,158,36,26,243,161,\r
-231,128,57,238,49,164,68,248,85,10,27,235,189,16,19,38,8,1,210,245,204,\r
-180,44,248,21,195,182,157,164,12,199,204,219,145,214,54,208,3,144,158,237,\r
-181,168,232,196,63,245,19,172,168,35,184,189,206,115,84,116,72,51,192,200,\r
-6,61,64,164,181,141,112,212,188,45,128,130,215,251,74,155,23,173,91,189,\r
-57,119,111,13,72,1,142,5,10,160,168,83,207,104,3,210,27,211,182,25,110,\r
-106,165,247,205,187,103,235,111,190,168,85,128,216,141,119,95,187,182,248,\r
-213,108,247,227,231,85,89,155,202,64,73,3,105,0,6,160,131,52,176,127,140,\r
-18,237,236,98,232,218,13,194,161,222,251,27,110,189,60,2,244,77,89,16,126,\r
-61,48,214,180,162,162,188,6,178,137,190,125,74,111,67,35,154,161,33,164,\r
-4,1,54,152,223,77,235,209,254,39,111,175,132,70,126,247,1,125,51,191,1,\r
-31,142,86,95,119,156,47,110,228,225,101,55,184,123,163,91,182,56,111,51,\r
-176,118,198,90,13,44,244,102,153,150,0,8,238,216,225,19,153,81,211,181,\r
-44,198,38,147,207,55,182,119,158,0,186,129,20,179,72,204,216,215,76,157,\r
-199,129,240,108,23,255,155,254,0,55,116,2,121,97,65,188,6,0,0,0,0,73,69,\r
-78,68,174,66,96,130};\r
-\r
-static size_t xml_res_size_1 = 252;\r
-static unsigned char xml_res_file_1[] = {\r
-60,63,120,109,108,32,118,101,114,115,105,111,110,61,34,49,46,48,34,32,101,\r
-110,99,111,100,105,110,103,61,34,85,84,70,45,56,34,63,62,10,60,114,101,\r
-115,111,117,114,99,101,32,120,109,108,110,115,61,34,104,116,116,112,58,\r
-47,47,119,119,119,46,119,120,119,105,110,100,111,119,115,46,111,114,103,\r
-47,119,120,120,114,99,34,32,118,101,114,115,105,111,110,61,34,50,46,51,\r
-46,48,46,49,34,62,10,32,32,60,111,98,106,101,99,116,32,99,108,97,115,115,\r
-61,34,119,120,66,105,116,109,97,112,34,32,110,97,109,101,61,34,112,108,\r
-97,99,101,104,111,108,100,101,114,49,54,34,62,119,120,99,114,97,102,116,\r
-101,114,95,98,105,116,109,97,112,115,46,99,112,112,36,67,95,95,85,115,101,\r
-114,115,95,119,105,116,116,101,110,100,95,65,112,112,68,97,116,97,95,76,\r
-111,99,97,108,95,84,101,109,112,95,112,108,97,99,101,104,111,108,100,101,\r
-114,49,54,46,112,110,103,60,47,111,98,106,101,99,116,62,10,60,47,114,101,\r
-115,111,117,114,99,101,62,10};\r
-\r
-void wxC9ED9InitBitmapResources()\r
-{\r
-\r
-    // Check for memory FS. If not present, load the handler:\r
-    {\r
-        wxMemoryFSHandler::AddFile(wxT("XRC_resource/dummy_file"), wxT("dummy one"));\r
-        wxFileSystem fsys;\r
-        wxFSFile *f = fsys.OpenFile(wxT("memory:XRC_resource/dummy_file"));\r
-        wxMemoryFSHandler::RemoveFile(wxT("XRC_resource/dummy_file"));\r
-        if (f) delete f;\r
-        else wxFileSystem::AddHandler(new wxMemoryFSHandlerBase);\r
-    }\r
-\r
-    XRC_ADD_FILE(wxT("XRC_resource/wxcrafter_bitmaps.cpp$C__Users_wittend_AppData_Local_Temp_placeholder16.png"), xml_res_file_0, xml_res_size_0, wxT("image/png"));\r
-    XRC_ADD_FILE(wxT("XRC_resource/wxcrafter_bitmaps.cpp$._wxcrafter_bitmaps.xrc"), xml_res_file_1, xml_res_size_1, wxT("text/xml"));\r
-    wxXmlResource::Get()->Load(wxT("memory:XRC_resource/wxcrafter_bitmaps.cpp$._wxcrafter_bitmaps.xrc"));\r
-}\r
diff --git a/fdmdv2/branches/0.97/build/codelite/hamlib_trial/wxcrafter_bitmaps.xrc b/fdmdv2/branches/0.97/build/codelite/hamlib_trial/wxcrafter_bitmaps.xrc
deleted file mode 100644 (file)
index 8627bff..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resource xmlns="http://www.wxwindows.org/wxxrc" version="2.3.0.1">
-  <object class="wxBitmap" name="placeholder16">C:\Users\wittend\AppData\Local\Temp\placeholder16.png</object>
-</resource>
diff --git a/fdmdv2/branches/0.97/build/codelite/libCTB/libCTB.mk b/fdmdv2/branches/0.97/build/codelite/libCTB/libCTB.mk
deleted file mode 100644 (file)
index 1f1c584..0000000
+++ /dev/null
@@ -1,213 +0,0 @@
-##\r
-## Auto Generated makefile by CodeLite IDE\r
-## any manual changes will be erased      \r
-##\r
-## Debug\r
-ProjectName            :=libCTB\r
-ConfigurationName      :=Debug\r
-WorkspacePath          := "D:\Projects\Radio\fdmdv2\build\codelite"\r
-ProjectPath            := "D:\Projects\Radio\fdmdv2\build\codelite\libCTB"\r
-IntermediateDirectory  :=./Debug\r
-OutDir                 := $(IntermediateDirectory)\r
-CurrentFileName        :=\r
-CurrentFilePath        :=\r
-CurrentFileFullPath    :=\r
-User                   :=wittend\r
-Date                   :=12/30/2012\r
-CodeLitePath           :="D:\bin\CodeLite"\r
-LinkerName             :=g++\r
-SharedObjectLinkerName :=g++ -shared -fPIC\r
-ObjectSuffix           :=.o\r
-DependSuffix           :=.o.d\r
-PreprocessSuffix       :=.o.i\r
-DebugSwitch            :=-gstab\r
-IncludeSwitch          :=-I\r
-LibrarySwitch          :=-l\r
-OutputSwitch           :=-o \r
-LibraryPathSwitch      :=-L\r
-PreprocessorSwitch     :=-D\r
-SourceSwitch           :=-c \r
-OutputFile             :=$(IntermediateDirectory)/lib$(ProjectName).a\r
-Preprocessors          :=\r
-ObjectSwitch           :=-o \r
-ArchiveOutputSwitch    := \r
-PreprocessOnlySwitch   :=-E \r
-ObjectsFileList        :="D:\Projects\Radio\fdmdv2\build\codelite\libCTB\libCTB.txt"\r
-PCHCompileFlags        :=\r
-MakeDirCommand         :=makedir\r
-RcCmpOptions           := \r
-RcCompilerName         :=windres\r
-LinkOptions            :=  \r
-IncludePath            :=  $(IncludeSwitch). $(IncludeSwitch). \r
-IncludePCH             := \r
-RcIncludePath          := \r
-Libs                   := \r
-ArLibs                 :=  \r
-LibPath                := $(LibraryPathSwitch). \r
-\r
-##\r
-## Common variables\r
-## AR, CXX, CC, CXXFLAGS and CFLAGS can be overriden using an environment variables\r
-##\r
-AR       := ar rcus\r
-CXX      := g++\r
-CC       := gcc\r
-CXXFLAGS :=  -g  -DSVN_REVISION=\"1152\"  $(Preprocessors)\r
-CFLAGS   :=  -g  -DSVN_REVISION=\"1152\"  $(Preprocessors)\r
-\r
-\r
-##\r
-## User defined environment variables\r
-##\r
-CodeLiteDir:=D:\bin\CodeLite\r
-WXWIN:=D:\bin\wxWidgets-2.9.4\r
-PATH:=$(WXWIN)\lib\gcc_dll;$(PATH)\r
-WXCFG:=gcc_dll\mswu\r
-UNIT_TEST_PP_SRC_DIR:=D:\bin\UnitTest++-1.3\r
-Objects=$(IntermediateDirectory)/src_fifo$(ObjectSuffix) $(IntermediateDirectory)/src_getopt$(ObjectSuffix) $(IntermediateDirectory)/src_gpib$(ObjectSuffix) $(IntermediateDirectory)/src_iobase$(ObjectSuffix) $(IntermediateDirectory)/src_kbhit$(ObjectSuffix) $(IntermediateDirectory)/src_portscan$(ObjectSuffix) $(IntermediateDirectory)/src_serportx$(ObjectSuffix) $(IntermediateDirectory)/win32_getopt$(ObjectSuffix) $(IntermediateDirectory)/win32_serport$(ObjectSuffix) $(IntermediateDirectory)/win32_timer$(ObjectSuffix) \\r
-       \r
-\r
-##\r
-## Main Build Targets \r
-##\r
-.PHONY: all clean PreBuild PrePreBuild PostBuild\r
-all: $(IntermediateDirectory) $(OutputFile)\r
-\r
-$(OutputFile): $(Objects)\r
-       @$(MakeDirCommand) $(@D)\r
-       @echo "" > $(IntermediateDirectory)/.d\r
-       @echo $(Objects) > $(ObjectsFileList)\r
-       $(AR) $(ArchiveOutputSwitch)$(OutputFile) @$(ObjectsFileList) $(ArLibs)\r
-       @$(MakeDirCommand) "D:\Projects\Radio\fdmdv2\build\codelite\.build-debug"\r
-       @echo rebuilt > "D:\Projects\Radio\fdmdv2\build\codelite\.build-debug\libCTB"\r
-\r
-./Debug:\r
-       @$(MakeDirCommand) "./Debug"\r
-\r
-PreBuild:\r
-\r
-\r
-##\r
-## Objects\r
-##\r
-$(IntermediateDirectory)/src_fifo$(ObjectSuffix): ../../../../code/libCTB-0.16/src/fifo.cpp $(IntermediateDirectory)/src_fifo$(DependSuffix)\r
-       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/code/libCTB-0.16/src/fifo.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/src_fifo$(ObjectSuffix) $(IncludePath)\r
-$(IntermediateDirectory)/src_fifo$(DependSuffix): ../../../../code/libCTB-0.16/src/fifo.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/src_fifo$(ObjectSuffix) -MF$(IntermediateDirectory)/src_fifo$(DependSuffix) -MM "D:/Projects/Radio/code/libCTB-0.16/src/fifo.cpp"\r
-\r
-$(IntermediateDirectory)/src_fifo$(PreprocessSuffix): ../../../../code/libCTB-0.16/src/fifo.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_fifo$(PreprocessSuffix) "D:/Projects/Radio/code/libCTB-0.16/src/fifo.cpp"\r
-\r
-$(IntermediateDirectory)/src_getopt$(ObjectSuffix): ../../../../code/libCTB-0.16/src/getopt.cpp $(IntermediateDirectory)/src_getopt$(DependSuffix)\r
-       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/code/libCTB-0.16/src/getopt.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/src_getopt$(ObjectSuffix) $(IncludePath)\r
-$(IntermediateDirectory)/src_getopt$(DependSuffix): ../../../../code/libCTB-0.16/src/getopt.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/src_getopt$(ObjectSuffix) -MF$(IntermediateDirectory)/src_getopt$(DependSuffix) -MM "D:/Projects/Radio/code/libCTB-0.16/src/getopt.cpp"\r
-\r
-$(IntermediateDirectory)/src_getopt$(PreprocessSuffix): ../../../../code/libCTB-0.16/src/getopt.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_getopt$(PreprocessSuffix) "D:/Projects/Radio/code/libCTB-0.16/src/getopt.cpp"\r
-\r
-$(IntermediateDirectory)/src_gpib$(ObjectSuffix): ../../../../code/libCTB-0.16/src/gpib.cpp $(IntermediateDirectory)/src_gpib$(DependSuffix)\r
-       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/code/libCTB-0.16/src/gpib.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/src_gpib$(ObjectSuffix) $(IncludePath)\r
-$(IntermediateDirectory)/src_gpib$(DependSuffix): ../../../../code/libCTB-0.16/src/gpib.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/src_gpib$(ObjectSuffix) -MF$(IntermediateDirectory)/src_gpib$(DependSuffix) -MM "D:/Projects/Radio/code/libCTB-0.16/src/gpib.cpp"\r
-\r
-$(IntermediateDirectory)/src_gpib$(PreprocessSuffix): ../../../../code/libCTB-0.16/src/gpib.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_gpib$(PreprocessSuffix) "D:/Projects/Radio/code/libCTB-0.16/src/gpib.cpp"\r
-\r
-$(IntermediateDirectory)/src_iobase$(ObjectSuffix): ../../../../code/libCTB-0.16/src/iobase.cpp $(IntermediateDirectory)/src_iobase$(DependSuffix)\r
-       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/code/libCTB-0.16/src/iobase.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/src_iobase$(ObjectSuffix) $(IncludePath)\r
-$(IntermediateDirectory)/src_iobase$(DependSuffix): ../../../../code/libCTB-0.16/src/iobase.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/src_iobase$(ObjectSuffix) -MF$(IntermediateDirectory)/src_iobase$(DependSuffix) -MM "D:/Projects/Radio/code/libCTB-0.16/src/iobase.cpp"\r
-\r
-$(IntermediateDirectory)/src_iobase$(PreprocessSuffix): ../../../../code/libCTB-0.16/src/iobase.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_iobase$(PreprocessSuffix) "D:/Projects/Radio/code/libCTB-0.16/src/iobase.cpp"\r
-\r
-$(IntermediateDirectory)/src_kbhit$(ObjectSuffix): ../../../../code/libCTB-0.16/src/kbhit.cpp $(IntermediateDirectory)/src_kbhit$(DependSuffix)\r
-       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/code/libCTB-0.16/src/kbhit.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/src_kbhit$(ObjectSuffix) $(IncludePath)\r
-$(IntermediateDirectory)/src_kbhit$(DependSuffix): ../../../../code/libCTB-0.16/src/kbhit.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/src_kbhit$(ObjectSuffix) -MF$(IntermediateDirectory)/src_kbhit$(DependSuffix) -MM "D:/Projects/Radio/code/libCTB-0.16/src/kbhit.cpp"\r
-\r
-$(IntermediateDirectory)/src_kbhit$(PreprocessSuffix): ../../../../code/libCTB-0.16/src/kbhit.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_kbhit$(PreprocessSuffix) "D:/Projects/Radio/code/libCTB-0.16/src/kbhit.cpp"\r
-\r
-$(IntermediateDirectory)/src_portscan$(ObjectSuffix): ../../../../code/libCTB-0.16/src/portscan.cpp $(IntermediateDirectory)/src_portscan$(DependSuffix)\r
-       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/code/libCTB-0.16/src/portscan.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/src_portscan$(ObjectSuffix) $(IncludePath)\r
-$(IntermediateDirectory)/src_portscan$(DependSuffix): ../../../../code/libCTB-0.16/src/portscan.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/src_portscan$(ObjectSuffix) -MF$(IntermediateDirectory)/src_portscan$(DependSuffix) -MM "D:/Projects/Radio/code/libCTB-0.16/src/portscan.cpp"\r
-\r
-$(IntermediateDirectory)/src_portscan$(PreprocessSuffix): ../../../../code/libCTB-0.16/src/portscan.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_portscan$(PreprocessSuffix) "D:/Projects/Radio/code/libCTB-0.16/src/portscan.cpp"\r
-\r
-$(IntermediateDirectory)/src_serportx$(ObjectSuffix): ../../../../code/libCTB-0.16/src/serportx.cpp $(IntermediateDirectory)/src_serportx$(DependSuffix)\r
-       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/code/libCTB-0.16/src/serportx.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/src_serportx$(ObjectSuffix) $(IncludePath)\r
-$(IntermediateDirectory)/src_serportx$(DependSuffix): ../../../../code/libCTB-0.16/src/serportx.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/src_serportx$(ObjectSuffix) -MF$(IntermediateDirectory)/src_serportx$(DependSuffix) -MM "D:/Projects/Radio/code/libCTB-0.16/src/serportx.cpp"\r
-\r
-$(IntermediateDirectory)/src_serportx$(PreprocessSuffix): ../../../../code/libCTB-0.16/src/serportx.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_serportx$(PreprocessSuffix) "D:/Projects/Radio/code/libCTB-0.16/src/serportx.cpp"\r
-\r
-$(IntermediateDirectory)/win32_getopt$(ObjectSuffix): ../../../../code/libCTB-0.16/src/win32/getopt.cpp $(IntermediateDirectory)/win32_getopt$(DependSuffix)\r
-       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/code/libCTB-0.16/src/win32/getopt.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/win32_getopt$(ObjectSuffix) $(IncludePath)\r
-$(IntermediateDirectory)/win32_getopt$(DependSuffix): ../../../../code/libCTB-0.16/src/win32/getopt.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/win32_getopt$(ObjectSuffix) -MF$(IntermediateDirectory)/win32_getopt$(DependSuffix) -MM "D:/Projects/Radio/code/libCTB-0.16/src/win32/getopt.cpp"\r
-\r
-$(IntermediateDirectory)/win32_getopt$(PreprocessSuffix): ../../../../code/libCTB-0.16/src/win32/getopt.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/win32_getopt$(PreprocessSuffix) "D:/Projects/Radio/code/libCTB-0.16/src/win32/getopt.cpp"\r
-\r
-$(IntermediateDirectory)/win32_serport$(ObjectSuffix): ../../../../code/libCTB-0.16/src/win32/serport.cpp $(IntermediateDirectory)/win32_serport$(DependSuffix)\r
-       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/code/libCTB-0.16/src/win32/serport.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/win32_serport$(ObjectSuffix) $(IncludePath)\r
-$(IntermediateDirectory)/win32_serport$(DependSuffix): ../../../../code/libCTB-0.16/src/win32/serport.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/win32_serport$(ObjectSuffix) -MF$(IntermediateDirectory)/win32_serport$(DependSuffix) -MM "D:/Projects/Radio/code/libCTB-0.16/src/win32/serport.cpp"\r
-\r
-$(IntermediateDirectory)/win32_serport$(PreprocessSuffix): ../../../../code/libCTB-0.16/src/win32/serport.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/win32_serport$(PreprocessSuffix) "D:/Projects/Radio/code/libCTB-0.16/src/win32/serport.cpp"\r
-\r
-$(IntermediateDirectory)/win32_timer$(ObjectSuffix): ../../../../code/libCTB-0.16/src/win32/timer.cpp $(IntermediateDirectory)/win32_timer$(DependSuffix)\r
-       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/code/libCTB-0.16/src/win32/timer.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/win32_timer$(ObjectSuffix) $(IncludePath)\r
-$(IntermediateDirectory)/win32_timer$(DependSuffix): ../../../../code/libCTB-0.16/src/win32/timer.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/win32_timer$(ObjectSuffix) -MF$(IntermediateDirectory)/win32_timer$(DependSuffix) -MM "D:/Projects/Radio/code/libCTB-0.16/src/win32/timer.cpp"\r
-\r
-$(IntermediateDirectory)/win32_timer$(PreprocessSuffix): ../../../../code/libCTB-0.16/src/win32/timer.cpp\r
-       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/win32_timer$(PreprocessSuffix) "D:/Projects/Radio/code/libCTB-0.16/src/win32/timer.cpp"\r
-\r
-\r
--include $(IntermediateDirectory)/*$(DependSuffix)\r
-##\r
-## Clean\r
-##\r
-clean:\r
-       $(RM) $(IntermediateDirectory)/src_fifo$(ObjectSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_fifo$(DependSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_fifo$(PreprocessSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_getopt$(ObjectSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_getopt$(DependSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_getopt$(PreprocessSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_gpib$(ObjectSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_gpib$(DependSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_gpib$(PreprocessSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_iobase$(ObjectSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_iobase$(DependSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_iobase$(PreprocessSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_kbhit$(ObjectSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_kbhit$(DependSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_kbhit$(PreprocessSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_portscan$(ObjectSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_portscan$(DependSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_portscan$(PreprocessSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_serportx$(ObjectSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_serportx$(DependSuffix)\r
-       $(RM) $(IntermediateDirectory)/src_serportx$(PreprocessSuffix)\r
-       $(RM) $(IntermediateDirectory)/win32_getopt$(ObjectSuffix)\r
-       $(RM) $(IntermediateDirectory)/win32_getopt$(DependSuffix)\r
-       $(RM) $(IntermediateDirectory)/win32_getopt$(PreprocessSuffix)\r
-       $(RM) $(IntermediateDirectory)/win32_serport$(ObjectSuffix)\r
-       $(RM) $(IntermediateDirectory)/win32_serport$(DependSuffix)\r
-       $(RM) $(IntermediateDirectory)/win32_serport$(PreprocessSuffix)\r
-       $(RM) $(IntermediateDirectory)/win32_timer$(ObjectSuffix)\r
-       $(RM) $(IntermediateDirectory)/win32_timer$(DependSuffix)\r
-       $(RM) $(IntermediateDirectory)/win32_timer$(PreprocessSuffix)\r
-       $(RM) $(OutputFile)\r
-       $(RM) $(OutputFile)\r
-       $(RM) "D:\Projects\Radio\fdmdv2\build\codelite\.build-debug\libCTB"\r
-\r
-\r
diff --git a/fdmdv2/branches/0.97/build/codelite/libCTB/libCTB.project b/fdmdv2/branches/0.97/build/codelite/libCTB/libCTB.project
deleted file mode 100644 (file)
index 86c3ddf..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<CodeLite_Project Name="libCTB" InternalType="Library">
-  <Plugins>
-    <Plugin Name="qmake">
-      <![CDATA[00010001N0005Debug000000000000]]>
-    </Plugin>
-  </Plugins>
-  <Description/>
-  <Dependencies/>
-  <VirtualDirectory Name="src">
-    <File Name="../../../../code/libCTB-0.16/src/fifo.cpp"/>
-    <File Name="../../../../code/libCTB-0.16/src/getopt.cpp"/>
-    <File Name="../../../../code/libCTB-0.16/src/gpib.cpp"/>
-    <File Name="../../../../code/libCTB-0.16/src/iobase.cpp"/>
-    <File Name="../../../../code/libCTB-0.16/src/kbhit.cpp"/>
-    <File Name="../../../../code/libCTB-0.16/src/portscan.cpp"/>
-    <File Name="../../../../code/libCTB-0.16/src/serportx.cpp"/>
-    <File Name="../../../../code/libCTB-0.16/src/win32/getopt.cpp"/>
-    <File Name="../../../../code/libCTB-0.16/src/win32/serport.cpp"/>
-    <File Name="../../../../code/libCTB-0.16/src/win32/timer.cpp"/>
-  </VirtualDirectory>
-  <VirtualDirectory Name="include">
-    <File Name="../../../../code/libCTB-0.16/include/ctb-0.16/ctb.h"/>
-    <File Name="../../../../code/libCTB-0.16/include/ctb-0.16/fifo.h"/>
-    <File Name="../../../../code/libCTB-0.16/include/ctb-0.16/getopt.h"/>
-    <File Name="../../../../code/libCTB-0.16/include/ctb-0.16/gpib.h"/>
-    <File Name="../../../../code/libCTB-0.16/include/ctb-0.16/iobase.h"/>
-    <File Name="../../../../code/libCTB-0.16/include/ctb-0.16/kbhit.h"/>
-    <File Name="../../../../code/libCTB-0.16/include/ctb-0.16/portscan.h"/>
-    <File Name="../../../../code/libCTB-0.16/include/ctb-0.16/serport.h"/>
-    <File Name="../../../../code/libCTB-0.16/include/ctb-0.16/serportx.h"/>
-    <File Name="../../../../code/libCTB-0.16/include/ctb-0.16/timer.h"/>
-    <File Name="../../../../code/libCTB-0.16/include/ctb-0.16/win32/getopt.h"/>
-    <File Name="../../../../code/libCTB-0.16/include/ctb-0.16/win32/gpib-32.h"/>
-    <File Name="../../../../code/libCTB-0.16/include/ctb-0.16/win32/serport.h"/>
-    <File Name="../../../../code/libCTB-0.16/include/ctb-0.16/win32/timer.h"/>
-  </VirtualDirectory>
-  <Settings Type="Static Library">
-    <GlobalSettings>
-      <Compiler Options="" C_Options="">
-        <IncludePath Value="."/>
-      </Compiler>
-      <Linker Options="">
-        <LibraryPath Value="."/>
-      </Linker>
-      <ResourceCompiler Options=""/>
-    </GlobalSettings>
-    <Configuration Name="Debug" CompilerType="gnu g++" DebuggerType="GNU gdb debugger" Type="Static Library" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append">
-      <Compiler Options="-g" C_Options="-g" Required="yes" PreCompiledHeader="" PCHInCommandLine="no" UseDifferentPCHFlags="no" PCHFlags="">
-        <IncludePath Value="."/>
-      </Compiler>
-      <Linker Options="" Required="yes"/>
-      <ResourceCompiler Options="" Required="no"/>
-      <General OutputFile="$(IntermediateDirectory)/lib$(ProjectName).a" IntermediateDirectory="./Debug" Command="" CommandArguments="" UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="yes"/>
-      <Environment EnvVarSetName="&lt;Use Defaults&gt;" DbgSetName="&lt;Use Defaults&gt;">
-        <![CDATA[]]>
-      </Environment>
-      <Debugger IsRemote="no" RemoteHostName="" RemoteHostPort="" DebuggerPath="">
-        <PostConnectCommands/>
-        <StartupCommands/>
-      </Debugger>
-      <PreBuild/>
-      <PostBuild/>
-      <CustomBuild Enabled="no">
-        <RebuildCommand/>
-        <CleanCommand/>
-        <BuildCommand/>
-        <PreprocessFileCommand/>
-        <SingleFileCommand/>
-        <MakefileGenerationCommand/>
-        <ThirdPartyToolName/>
-        <WorkingDirectory/>
-      </CustomBuild>
-      <AdditionalRules>
-        <CustomPostBuild/>
-        <CustomPreBuild/>
-      </AdditionalRules>
-      <Completion EnableCpp11="no">
-        <ClangCmpFlagsC/>
-        <ClangCmpFlags/>
-        <ClangPP/>
-        <SearchPaths/>
-      </Completion>
-    </Configuration>
-    <Configuration Name="Release" CompilerType="gnu g++" DebuggerType="GNU gdb debugger" Type="" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append">
-      <Compiler Options="" C_Options="" Required="yes" PreCompiledHeader="" PCHInCommandLine="no" UseDifferentPCHFlags="no" PCHFlags="">
-        <IncludePath Value="."/>
-      </Compiler>
-      <Linker Options="" Required="yes"/>
-      <ResourceCompiler Options="" Required="no"/>
-      <General OutputFile="$(IntermediateDirectory)/lib$(ProjectName).a" IntermediateDirectory="./Release" Command="" CommandArguments="" UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="yes"/>
-      <Environment EnvVarSetName="&lt;Use Defaults&gt;" DbgSetName="&lt;Use Defaults&gt;">
-        <![CDATA[]]>
-      </Environment>
-      <Debugger IsRemote="no" RemoteHostName="" RemoteHostPort="" DebuggerPath="">
-        <PostConnectCommands/>
-        <StartupCommands/>
-      </Debugger>
-      <PreBuild/>
-      <PostBuild/>
-      <CustomBuild Enabled="no">
-        <RebuildCommand/>
-        <CleanCommand/>
-        <BuildCommand/>
-        <PreprocessFileCommand/>
-        <SingleFileCommand/>
-        <MakefileGenerationCommand/>
-        <ThirdPartyToolName/>
-        <WorkingDirectory/>
-      </CustomBuild>
-      <AdditionalRules>
-        <CustomPostBuild/>
-        <CustomPreBuild/>
-      </AdditionalRules>
-      <Completion EnableCpp11="no">
-        <ClangCmpFlagsC/>
-        <ClangCmpFlags/>
-        <ClangPP/>
-        <SearchPaths/>
-      </Completion>
-    </Configuration>
-  </Settings>
-</CodeLite_Project>
diff --git a/fdmdv2/branches/0.97/build/codelite/libPortCtrl/Debug/.d b/fdmdv2/branches/0.97/build/codelite/libPortCtrl/Debug/.d
deleted file mode 100644 (file)
index 950b468..0000000
+++ /dev/null
@@ -1 +0,0 @@
-"" \r
diff --git a/fdmdv2/branches/0.97/build/codelite/libPortCtrl/Release/.d b/fdmdv2/branches/0.97/build/codelite/libPortCtrl/Release/.d
deleted file mode 100644 (file)
index 950b468..0000000
+++ /dev/null
@@ -1 +0,0 @@
-"" \r
diff --git a/fdmdv2/branches/0.97/build/codelite/libPortCtrl/freedv_osx_port.patch b/fdmdv2/branches/0.97/build/codelite/libPortCtrl/freedv_osx_port.patch
deleted file mode 100644 (file)
index c34f2b3..0000000
+++ /dev/null
@@ -1,774 +0,0 @@
-Index: src/Makefile.linux
-===================================================================
---- src/Makefile.linux (revision 1152)
-+++ src/Makefile.linux (working copy)
-@@ -36,12 +36,6 @@
- SOX_INC=-I$(SOX)/src/
- SOX_LIB=$(SOX)/src/.libs/libsox.a
--# CTB ---------------------------------------------------
--
--CTB=libctb-0.16
--CTB_INC=-I$(CTB)/include
--CTB_LIB=$(CTB)/lib/libctb-0.16.a
--
- # if libasound is available, PortAudio will be using it, so we will
- # need to add it to freedv link line.  To test if it is present, we try
- # to link a small C program with -lasound
-@@ -50,8 +44,8 @@
- # FreeDV ------------------------------------------------
--CPP_FLAGS = -D_NO_AUTOTOOLS_ $(WX_CPPFLAGS) $(PORTAUDIO_INC) $(CODEC2_INC) $(SOX_INC) $(CTB_INC) -I. -g -Wall -O3 -DSVN_REVISION=\"$(SVN_REVISION)\"
--FREEDV_LIBS = $(WX_LIBS) $(PORTAUDIO_LIB) $(CODEC2_LIB) $(SOX_LIB) $(CTB_LIB) -lm -lpthread -lsndfile -lsamplerate $(LIBASOUND)
-+CPP_FLAGS = -D_NO_AUTOTOOLS_ $(WX_CPPFLAGS) $(PORTAUDIO_INC) $(CODEC2_INC) $(SOX_INC) -I. -g -Wall -O3 -DSVN_REVISION=\"$(SVN_REVISION)\"
-+FREEDV_LIBS = $(WX_LIBS) $(PORTAUDIO_LIB) $(CODEC2_LIB) $(SOX_LIB) -lm -lpthread -lsndfile -lsamplerate $(LIBASOUND)
- OBJS = topFrame.o \
- fdmdv2_main.o \
-@@ -65,11 +59,12 @@
- dlg_comports.o \
- dlg_filter.o \
- varicode.o \
--sox_biquad.o
-+sox_biquad.o \
-+serialport.o
--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
-+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 serialport.h
--all: $(WXWIDGETS)/.built $(PORTAUDIO)/.built $(CODEC2)/.built $(SOX)/.built $(CTB)/.built freedv
-+all: $(WXWIDGETS)/.built $(PORTAUDIO)/.built $(CODEC2)/.built $(SOX)/.built freedv
- freedv: $(OBJS) 
-       g++ -o freedv $(OBJS) $(CPP_FLAGS) $(FREEDV_LIBS)
-@@ -81,7 +76,7 @@
-       rm -f *.o fdmdv2 
- clean-lib:
--      rm -Rf $(WXWIDGETS) $(PORTAUDIO) $(CODEC2) $(SOX) $(CTB)  
-+      rm -Rf $(WXWIDGETS) $(PORTAUDIO) $(CODEC2) $(SOX) 
-       rm -f *.o fdmdv2 
- # wxWidgets ---------------------------------------------------------
-@@ -126,14 +121,3 @@
-        
- $(SOX).tar.bz2:
-       wget http://downloads.sourceforge.net/project/sox/sox/14.4.0/sox-14.4.0.tar.bz2
--
--# CTB -------------------------------------------------------------
--
--$(CTB)/.built: $(CTB)
--      cd $(CTB)/build && make && touch ../.built
--               
--$(CTB) : $(CTB).tar.gz
--      tar xvzf $(CTB).tar.gz
--       
--$(CTB).tar.gz:
--      wget https://iftools.com/download/ctb/0.16/libctb-0.16.tar.gz
-Index: src/Makefile.linux.dmw
-===================================================================
---- src/Makefile.linux.dmw     (revision 1152)
-+++ src/Makefile.linux.dmw     (working copy)
-@@ -36,7 +36,8 @@
- dlg_comports.o \
- dlg_filter.o \
- varicode.o \
--sox_biquad.o
-+sox_biquad.o \
-+serialport.o
- all: fdmdv2
-@@ -44,7 +45,7 @@
- fdmdv2: $(OBJS) fdmdv2_main.h
-       g++ -o fdmdv2 $(OBJS) $(CPP_FLAGS) $(LIBS)
--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
-+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 serialport.h
- %.o: %.cpp
-       g++ $(CPP_FLAGS) -c $< -o $@
-Index: src/Makefile.osx
-===================================================================
---- src/Makefile.osx   (revision 0)
-+++ src/Makefile.osx   (working copy)
-@@ -0,0 +1,76 @@
-+# src/Makefile.osx
-+# Mooneer Salem 28 Dec 2012
-+#
-+# Makefile for OSX - assumes MacPorts for some libraries and builds the others locally.
-+# Note: dependencies must be installed with universal binary support due to the use of Carbon by portaudio and others.
-+#       (Carbon is officially deprecated by Apple and does not have 64-bit support.)
-+#
-+# $ sudo port install wxWidgets30 +aui +universal portaudio +universal sox +universal libsndfile +universal libsamplerate +universal
-+# $ make -f Makefile.osx
-+
-+SVN_REVISION=$(shell svnversion)
-+MACPORTS_FOLDER=/opt/local
-+
-+# Codec 2 -----------------------------------------------
-+
-+CODEC2=codec2-dev
-+CODEC2_INC=-I$(CODEC2)/src
-+CODEC2_LIB=$(CODEC2)/src/.libs/libcodec2.a
-+
-+# FreeDV ------------------------------------------------
-+
-+CPP_FLAGS = -D_NO_AUTOTOOLS_ -I$(MACPORTS_FOLDER)/include -arch i386 `wx-config --cppflags` $(CODEC2_INC) -I. -g -Wall -O3 -DSVN_REVISION=\"$(SVN_REVISION)\"
-+FREEDV_LIBS = -arch i386 -L$(MACPORTS_FOLDER)/lib `wx-config --libs all` -lportaudio $(CODEC2_LIB) -lm -lpthread -lsndfile -lsamplerate -lsox
-+
-+OBJS = topFrame.o \
-+fdmdv2_main.o \
-+fdmdv2_plot.o \
-+fdmdv2_plot_scalar.o \
-+fdmdv2_plot_scatter.o \
-+fdmdv2_plot_spectrum.o \
-+fdmdv2_plot_waterfall_linux.o \
-+fdmdv2_pa_wrapper.o \
-+dlg_audiooptions.o \
-+dlg_comports.o \
-+dlg_filter.o \
-+varicode.o \
-+sox_biquad.o \
-+serialport.o
-+
-+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 serialport.h
-+
-+all: $(CODEC2)/.built freedv FreeDV.app
-+
-+freedv: $(OBJS)
-+      g++ -o freedv $(OBJS) $(CPP_FLAGS) $(FREEDV_LIBS)
-+
-+FreeDV.app: info.plist freedv
-+      -mkdir -p $@/Contents/MacOS
-+      -mkdir -p $@/Contents/Resources/English.lproj
-+      cp info.plist $@/Contents
-+      echo -n "APPL????" > $@/Contents/PkgInfo
-+      cp freedv $@/Contents/MacOS/FreeDV
-+      
-+%.o: %.cpp $(HDRS)
-+      g++ $(CPP_FLAGS) -c $< -o $@
-+
-+sox_biquad.o: sox_biquad.c
-+      gcc $(CPP_FLAGS) -c sox_biquad.c -o sox_biquad.o
-+
-+varicode.o: varicode.c
-+      cc $(CPP_FLAGS) -c varicode.c -o varicode.o
-+
-+clean:
-+      rm -f *.o fdmdv2 
-+      rm -rf FreeDV.app/
-+      
-+clean-lib: clean
-+      rm -Rf $(CODEC2)
-+ 
-+# Codec 2 ----------------------------------------------------------
-+
-+$(CODEC2)/.built: $(CODEC2)
-+      cd $(CODEC2) && CPPFLAGS="-arch i386" LDFLAGS="-arch i386" ./configure && make && touch .built
-+
-+$(CODEC2):
-+      svn co https://freetel.svn.sourceforge.net/svnroot/freetel/codec2-dev
-\ No newline at end of file
-Index: src/Makefile.win32
-===================================================================
---- src/Makefile.win32 (revision 1152)
-+++ src/Makefile.win32 (working copy)
-@@ -16,7 +16,7 @@
- CODEC2_LIB=$(CODEC2_PATH)/src/.libs/libcodec2.a
- CPP_FLAGS = -D_NO_AUTOTOOLS_ -I$(INCLUDE_PATH) $(WX_CPPFLAGS) -I$(CODEC2_INC) -I../extern/include -g -Wall -DSVN_REVISION=\"$(SVN_REVISION)\"
--LIBS = $(WX_LIBS) $(CODEC2_LIB) -lm -lportaudiocpp -lportaudio -lpthread -lsndfile -lsamplerate -lctb-0.16 -lsox
-+LIBS = $(WX_LIBS) $(CODEC2_LIB) -lm -lportaudiocpp -lportaudio -lpthread -lsndfile -lsamplerate -lsox
- OBJS = topFrame.o \
- fdmdv2_main.o \
-@@ -30,9 +30,10 @@
- dlg_comports.o \
- dlg_filter.o \
- varicode.o \
--sox_biquad.o
-+sox_biquad.o \
-+serialport.o
--HDRS = ../version.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 dlg_audiooptions.h topFrame.h varicode.h
-+HDRS = ../version.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 dlg_audiooptions.h topFrame.h varicode.h serialport.h
- all: freedv
-Index: src/Makefile.win32.dmw
-===================================================================
---- src/Makefile.win32.dmw     (revision 1152)
-+++ src/Makefile.win32.dmw     (working copy)
-@@ -40,10 +40,11 @@
- dlg_comports.o \
- dlg_filter.o \
- varicode.o \
--sox_biquad.o
-+sox_biquad.o \
-+serialport.o
--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
-+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 serialport.h
- all: freedv
-Index: src/dlg_comports.cpp
-===================================================================
---- src/dlg_comports.cpp       (revision 1152)
-+++ src/dlg_comports.cpp       (working copy)
-@@ -21,7 +21,6 @@
- //==========================================================================
- #include "dlg_comports.h"
- #include "fdmdv2_main.h"
--#include <wx/msw/registry.h>
- #include <sstream>
- //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-@@ -62,8 +61,9 @@
-     wxArrayString m_listCtrlPortsArr;
-     m_listCtrlPorts = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxSize(-1,45), m_listCtrlPortsArr, wxLB_SINGLE | wxLB_SORT);
-     staticBoxSizer31->Add(m_listCtrlPorts, 1, wxALIGN_CENTER, 0);
--#endif
--#ifdef __WXGTK__
-+#else
-+/*#endif
-+#ifdef __WXGTK__*/
-     wxBoxSizer* bSizer83;
-     bSizer83 = new wxBoxSizer(wxHORIZONTAL);
-Index: src/fdmdv2_main.cpp
-===================================================================
---- src/fdmdv2_main.cpp        (revision 1152)
-+++ src/fdmdv2_main.cpp        (working copy)
-@@ -163,7 +163,6 @@
- {
-     m_zoom              = 1.;
-     m_serialPort        = NULL;
--    m_device            = NULL;
-     
-     tools->AppendSeparator();
-     wxMenuItem* m_menuItemToolsConfigDelete;
-@@ -857,22 +856,22 @@
-             {
-                 if(wxGetApp().m_boolRTSPos) // RTS asserted HIGH
-                 {
--                    m_serialPort->SetLineState(ctb::LinestateRts);
-+                    m_serialPort->setRTS(true);
-                 }
-                 else                        // RTS asserted LOW
-                 {
--                    m_serialPort->ClrLineState(ctb::LinestateRts);
-+                    m_serialPort->setRTS(false);
-                 }
-             }
-             else                            // Use DTR
-             {
-                 if(wxGetApp().m_boolDTRPos) // DTR asserted HIGH
-                 {
--                    m_serialPort->SetLineState(ctb::LinestateDtr);
-+                    m_serialPort->setDTR(true);
-                 }
-                 else                        // DTR asserted LOW
-                 {
--                    m_serialPort->ClrLineState(ctb::LinestateDtr);
-+                    m_serialPort->setDTR(false);
-                 }
-             }
-         } 
-@@ -882,22 +881,22 @@
-             {
-                 if(wxGetApp().m_boolRTSPos) // RTS cleared LOW
-                 {
--                    m_serialPort->ClrLineState(ctb::LinestateRts);
-+                    m_serialPort->setRTS(false);
-                 }
-                 else                        // RTS cleared HIGH
-                 {
--                    m_serialPort->SetLineState(ctb::LinestateRts);
-+                    m_serialPort->setRTS(true);
-                 }
-             }
-             else                            // Use DTR
-             {
-                 if(wxGetApp().m_boolDTRPos) // DTR cleared LOW
-                 {
--                    m_serialPort->ClrLineState(ctb::LinestateDtr);
-+                    m_serialPort->setDTR(false);
-                 }
-                 else                        // DTR cleared HIGH
-                 {
--                    m_serialPort->SetLineState(ctb::LinestateDtr);
-+                    m_serialPort->setDTR(true);
-                 }
-             }
-         } 
-@@ -1351,13 +1350,15 @@
- {
-     wxUnusedVar(event);
-     int rv = 0;
--    int  iLineState  = 0;
-+    bool rtsEnabled = false;
-+    bool dtrEnabled = false;
-     //bool bPTTEnabled = m_btnTogPTT->IsEnabled();
-     //bool bPTTState   = m_btnTogPTT->GetValue();
-     if(m_serialPort != NULL)
-     {
--        int iLineState   = m_serialPort->GetLineState();
-+        rtsEnabled = m_serialPort->getRTS();
-+        dtrEnabled = m_serialPort->getDTR();
-         CloseSerialPort();
-     }
-     ComPortsDlg *dlg = new ComPortsDlg(NULL);
-@@ -1372,21 +1373,21 @@
-         SetupSerialPort();
-         if(m_serialPort != NULL)
-         {
--            if(iLineState | ctb::LinestateRts)
-+            if(rtsEnabled)
-             {
--                m_serialPort->SetLineState(ctb::LinestateRts);
-+                m_serialPort->setRTS(true);
-             }
-             else
-             {
--                m_serialPort->ClrLineState(ctb::LinestateRts);
-+                m_serialPort->setRTS(false);
-             }
--            if(iLineState | ctb::LinestateDtr)
-+            if(dtrEnabled)
-             {
--                m_serialPort->SetLineState(ctb::LinestateDtr);
-+                m_serialPort->setDTR(true);
-             }
-             else
-             {
--                m_serialPort->ClrLineState(ctb::LinestateDtr);
-+                m_serialPort->setDTR(false);
-             }
-         // m_btnTogPTT->Enable(bPTTEnabled);
-         // m_btnTogPTT->SetValue(bPTTState);
-@@ -2631,26 +2632,25 @@
-     if(!wxGetApp().m_strRigCtrlPort.IsEmpty())
-     {
-         wxString protocol = wxGetApp().m_strRigCtrlDatabits + wxGetApp().m_strRigCtrlParity + wxGetApp().m_strRigCtrlStopbits;
--        m_serialPort = new ctb::SerialPort();
--        if(m_serialPort->Open(wxGetApp().m_strRigCtrlPort.c_str(), baudrate, protocol.c_str(), ctb::SerialPort::NoFlowControl ) >= 0 ) 
-+        m_serialPort = new SerialPort(wxGetApp().m_strRigCtrlPort.ToAscii().data());
-+        if(m_serialPort->open(/*baudrate, protocol.c_str()*/ ) >= 0 ) 
-         {
--            m_device = m_serialPort;
-             //  always start with PTT cleared
-             if(wxGetApp().m_boolRTSPos) // RTS cleared LOW
-             {
--                m_serialPort->ClrLineState(ctb::LinestateRts);
-+                m_serialPort->setRTS(false);
-             }
-             else                        // RTS cleared HIGH
-             {
--                m_serialPort->SetLineState(ctb::LinestateRts);
-+                m_serialPort->setRTS(true);
-             }
-             if(wxGetApp().m_boolDTRPos) // DTR cleared LOW
-             {
--                m_serialPort->ClrLineState(ctb::LinestateDtr);
-+                m_serialPort->setDTR(false);
-             }
-             else                        // DTR cleared HIGH
-             {
--                m_serialPort->SetLineState(ctb::LinestateDtr);
-+                m_serialPort->setDTR(true);
-             }
-             //m_btnTogPTT->Enable(true);
-             m_btnTogPTT->SetValue(false);
-@@ -2658,7 +2658,6 @@
-         else
-         {
-             m_serialPort = NULL;
--            m_device     = NULL;
-             //m_btnTogPTT->Disable();
-         }
-     }
-@@ -2675,11 +2674,10 @@
- //----------------------------------------------------------------
- void MainFrame::CloseSerialPort(void)
- {
--    if((m_serialPort != NULL) && m_serialPort->IsOpen())
-+    if((m_serialPort != NULL) && m_serialPort->isOpen())
-     {
--        m_serialPort->Close();
-+        m_serialPort->close();
-         m_serialPort = NULL;
--        m_device     = NULL; 
-         //m_btnTogPTT->SetLabel(wxT("PTT"));
-         //m_btnTogPTT->Enable(false);
-     }
-Index: src/fdmdv2_main.h
-===================================================================
---- src/fdmdv2_main.h  (revision 1152)
-+++ src/fdmdv2_main.h  (working copy)
-@@ -55,10 +55,7 @@
- #include "codec2_fdmdv.h"
- #include "codec2_fifo.h"
--#include "ctb-0.16/ctb.h"
--#include "ctb-0.16/portscan.h"
--#include "ctb-0.16/serportx.h"
--#include "ctb-0.16/serport.h"
-+#include "serialport.h"
- #include "topFrame.h"
- #include "dlg_comports.h"
-@@ -353,8 +350,7 @@
-     protected:
--        ctb::IOBase*            m_device;
--        ctb::SerialPort*        m_serialPort;
-+        SerialPort*             m_serialPort;
-         void setsnrBeta(bool snrSlow);
-Index: src/info.plist
-===================================================================
---- src/info.plist     (revision 0)
-+++ src/info.plist     (working copy)
-@@ -0,0 +1,34 @@
-+<?xml version="1.0" encoding="UTF-8"?>
-+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-+<plist version="1.0">
-+<dict>
-+      <key>CFBundleDevelopmentRegion</key>
-+      <string>en</string>
-+      <key>CFBundleExecutable</key>
-+      <string>freedv</string>
-+      <key>CFBundleIconFile</key>
-+      <string></string>
-+      <key>CFBundleIdentifier</key>
-+      <string>org.freedv.freedv</string>
-+      <key>CFBundleInfoDictionaryVersion</key>
-+      <string>6.0</string>
-+      <key>CFBundleName</key>
-+      <string>FreeDV</string>
-+      <key>CFBundlePackageType</key>
-+      <string>APPL</string>
-+      <key>CFBundleShortVersionString</key>
-+      <string>1.0</string>
-+      <key>CFBundleSignature</key>
-+      <string>????</string>
-+      <key>CFBundleVersion</key>
-+      <string>1</string>
-+      <key>LSMinimumSystemVersion</key>
-+      <string>10.5</string>
-+      <key>NSHumanReadableCopyright</key>
-+      <string>Copyright Â© 2012 FreeDV. All rights reserved.</string>
-+      <!--<key>NSMainNibFile</key>
-+      <string>MainMenu</string>-->
-+      <key>NSPrincipalClass</key>
-+      <string>NSApplication</string>
-+</dict>
-+</plist>
-\ No newline at end of file
-Index: src/serialport.cpp
-===================================================================
---- src/serialport.cpp (revision 0)
-+++ src/serialport.cpp (working copy)
-@@ -0,0 +1,207 @@
-+//==========================================================================
-+// Name:            serialport.cpp
-+//
-+// Purpose:         Serial port management.
-+// Created:         Dec. 28, 2012
-+// Authors:         Mooneer Salem
-+// 
-+// License:
-+//
-+//  This program is free software; you can redistribute it and/or modify
-+//  it under the terms of the GNU General 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 License
-+//  along with this program; if not, see <http://www.gnu.org/licenses/>.
-+//
-+//==========================================================================
-+
-+#ifndef WIN32
-+#include <fcntl.h>
-+#include <termios.h>
-+#include <unistd.h>
-+#include <sys/ioctl.h>
-+#endif // !WIN32
-+
-+#include "serialport.h"
-+
-+#define ERROR_CONDITION (-1)
-+#ifdef WIN32
-+#define INVALID_FILE_DESCRIPTOR (INVALID_HANDLE_VALUE)
-+#else
-+#define INVALID_FILE_DESCRIPTOR (-1)
-+#endif // WIN32
-+
-+SerialPort::SerialPort(const std::string &portName)
-+    : _portName(portName)
-+    , _fileDescriptor(INVALID_FILE_DESCRIPTOR)
-+#ifdef WIN32
-+    , _rtsEnabled(false)
-+    , _dtrEnabled(false)
-+#endif // WIN32
-+{
-+    // No action here until open() is called.
-+}
-+
-+SerialPort::~SerialPort()
-+{
-+    // Close serial port if needed.
-+    if (isOpen())
-+    {
-+        close();
-+    }
-+}
-+
-+#ifndef WIN32
-+static int posixGetModemControlBits(const int fileDescriptor)
-+{
-+    int modemControlBits = 0;
-+    
-+    if (ioctl(fileDescriptor, TIOCMGET, &modemControlBits) == 0)
-+    {
-+        return modemControlBits;
-+    }
-+    else
-+    {
-+        return ERROR_CONDITION;
-+    }
-+}
-+
-+static int posixSetModemControlBits(const int fileDescriptor, int modemControlBits)
-+{
-+    if (ioctl(fileDescriptor, TIOCMSET, &modemControlBits) == 0)
-+    {
-+        return modemControlBits;
-+    }
-+    else
-+    {
-+        return ERROR_CONDITION;
-+    }
-+}
-+#endif // !WIN32
-+
-+bool SerialPort::getRTS() const
-+{
-+#ifdef WIN32
-+    // No way to get DTR/RTS directly from Windows, so we have to
-+    // grab what the caller put in during a previous set*() call.
-+    return _rtsEnabled;
-+#else
-+    int tmpbits = posixGetModemControlBits(_fileDescriptor);
-+    if (tmpbits != ERROR_CONDITION)
-+    {
-+        return tmpbits & TIOCM_RTS;
-+    }
-+    else
-+    {
-+        return ERROR_CONDITION;
-+    }
-+#endif // WIN32
-+}
-+
-+void SerialPort::setRTS(const bool newRTS)
-+{
-+#ifdef WIN32
-+    if (newRTS)
-+    {
-+        EscapeCommFunction(_fileDescriptor, SETRTS);
-+    }
-+    else
-+    {
-+        EscapeCommFunction(_fileDescriptor, CLRRTS);
-+    }
-+    _rtsEnabled = newRTS;
-+#else
-+    int tmpbits = posixGetModemControlBits(_fileDescriptor);
-+    if (tmpbits != ERROR_CONDITION)
-+    {
-+        if (newRTS) tmpbits |= TIOCM_RTS;
-+        else tmpbits &= ~TIOCM_RTS;
-+        posixSetModemControlBits(_fileDescriptor, tmpbits);
-+    }
-+#endif // WIN32
-+}
-+    
-+bool SerialPort::getDTR() const
-+{
-+#ifdef WIN32
-+    // No way to get DTR/RTS directly from Windows, so we have to
-+    // grab what the caller put in during a previous set*() call.
-+    return _dtrEnabled;
-+#else
-+    int tmpbits = posixGetModemControlBits(_fileDescriptor);
-+    if (tmpbits != ERROR_CONDITION)
-+    {
-+        return tmpbits & TIOCM_DTR;
-+    }
-+    else
-+    {
-+        return ERROR_CONDITION;
-+    }
-+#endif // WIN32
-+}
-+
-+void SerialPort::setDTR(const bool newDTR)
-+{
-+#ifdef WIN32
-+    if (newDTR)
-+    {
-+        EscapeCommFunction(_fileDescriptor, SETDTR);
-+    }
-+    else
-+    {
-+        EscapeCommFunction(_fileDescriptor, CLRDTR);
-+    }
-+    _dtrEnabled = newDTR;
-+#else
-+    int tmpbits = posixGetModemControlBits(_fileDescriptor);
-+    if (tmpbits != ERROR_CONDITION)
-+    {
-+        if (newDTR) tmpbits |= TIOCM_DTR;
-+        else tmpbits &= ~TIOCM_DTR;
-+        posixSetModemControlBits(_fileDescriptor, tmpbits);
-+    }
-+#endif // WIN32
-+}
-+    
-+int SerialPort::open()
-+{
-+#ifdef WIN32
-+    TCHAR portName[32];
-+    _stprintf_s(portName, sizeof(portName)/sizeof(TCHAR), _T("\\\\.\\%s"), _portName.c_str());
-+    
-+    _fileDescriptor = CreateFile(
-+        portName, 
-+        GENERIC_READ | GENERIC_WRITE,
-+        0, 
-+        0, 
-+        OPEN_EXISTING, 
-+        FILE_FLAG_OVERLAPPED, 
-+        0);
-+#else
-+    _fileDescriptor = ::open(_portName.c_str(), O_RDWR);
-+#endif // WIN32
-+
-+    return (int)_fileDescriptor;
-+}
-+
-+int SerialPort::close()
-+{
-+#ifdef WIN32
-+    int rv = CloseHandle(_fileDescriptor);
-+#else
-+    int rv = ::close(_fileDescriptor);
-+#endif // WIN32
-+
-+    _fileDescriptor = INVALID_FILE_DESCRIPTOR;
-+    return rv;
-+}
-+    
-+bool SerialPort::isOpen() const
-+{
-+    return _fileDescriptor != INVALID_FILE_DESCRIPTOR;
-+}
-\ No newline at end of file
-Index: src/serialport.h
-===================================================================
---- src/serialport.h   (revision 0)
-+++ src/serialport.h   (working copy)
-@@ -0,0 +1,81 @@
-+//==========================================================================
-+// Name:            serialport.h
-+//
-+// Purpose:         Serial port management.
-+// Created:         Dec. 28, 2012
-+// Authors:         Mooneer Salem
-+// 
-+// License:
-+//
-+//  This program is free software; you can redistribute it and/or modify
-+//  it under the terms of the GNU General 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 License
-+//  along with this program; if not, see <http://www.gnu.org/licenses/>.
-+//
-+//==========================================================================
-+
-+#ifndef SERIAL_PORT_H
-+#define SERIAL_PORT_H
-+
-+#ifdef WIN32
-+#include <windows.h>
-+#endif // WIN32
-+
-+#include <string>
-+
-+enum SerialPortParity
-+{
-+    NONE,
-+    EVEN,
-+    ODD
-+};
-+
-+// Quick and dirty serial port class that supports the minimum necessary to
-+// do PTT (for now). Can be extended later (send/receive data for CAT control, 
-+// for example).
-+class SerialPort
-+{
-+public:
-+    // portName is a path to the serial port, in one of the following formats:
-+    // OSX: /dev/tty.*
-+    // Linux: /dev/ttyS*
-+    // Windows: COM*:
-+    SerialPort(const std::string &portName);
-+    virtual ~SerialPort();
-+    
-+    bool getRTS() const;
-+    void setRTS(const bool newRTS);
-+    
-+    bool getDTR() const;
-+    void setDTR(const bool newDTR);
-+    
-+    int open();
-+    int close();
-+    
-+    bool isOpen() const;
-+    
-+private:
-+    const std::string _portName;
-+    
-+#ifdef WIN32
-+    HANDLE _fileDescriptor;
-+    
-+    bool _rtsEnabled;
-+    bool _dtrEnabled;
-+#else
-+    int _fileDescriptor;
-+#endif // WIN32
-+        
-+    // Object should not be copied since there can be only one handle open
-+    // per serial port. An attempt to use the copy constructor here, even
-+    // implicitly, will result in a compile error due to the declaration below.
-+    SerialPort(const SerialPort&);
-+};
-+
-+#endif // SERIAL_PORT_H
-\ No newline at end of file
diff --git a/fdmdv2/branches/0.97/build/codelite/libPortCtrl/libPortCtrl.mk b/fdmdv2/branches/0.97/build/codelite/libPortCtrl/libPortCtrl.mk
deleted file mode 100644 (file)
index fd5c6a2..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-##\r
-## Auto Generated makefile by CodeLite IDE\r
-## any manual changes will be erased      \r
-##\r
-## Release\r
-ProjectName            :=libPortCtrl\r
-ConfigurationName      :=Release\r
-WorkspacePath          := "D:\Projects\Radio\fdmdv2\build\codelite"\r
-ProjectPath            := "D:\Projects\Radio\fdmdv2\build\codelite\libPortCtrl"\r
-IntermediateDirectory  :=./Release\r
-OutDir                 := $(IntermediateDirectory)\r
-CurrentFileName        :=\r
-CurrentFilePath        :=\r
-CurrentFileFullPath    :=\r
-User                   :=wittend\r
-Date                   :=3/22/2013\r
-CodeLitePath           :="D:\bin\CodeLite"\r
-LinkerName             :=g++\r
-SharedObjectLinkerName :=g++ -shared -fPIC\r
-ObjectSuffix           :=.o\r
-DependSuffix           :=.o.d\r
-PreprocessSuffix       :=.o.i\r
-DebugSwitch            :=-gstab\r
-IncludeSwitch          :=-I\r
-LibrarySwitch          :=-l\r
-OutputSwitch           :=-o \r
-LibraryPathSwitch      :=-L\r
-PreprocessorSwitch     :=-D\r
-SourceSwitch           :=-c \r
-OutputFile             :=$(IntermediateDirectory)/lib$(ProjectName).a\r
-Preprocessors          :=\r
-ObjectSwitch           :=-o \r
-ArchiveOutputSwitch    := \r
-PreprocessOnlySwitch   :=-E \r
-ObjectsFileList        :="libPortCtrl.txt"\r
-PCHCompileFlags        :=\r
-MakeDirCommand         :=makedir\r
-RcCmpOptions           := \r
-RcCompilerName         :=windres\r
-LinkOptions            :=  \r
-IncludePath            :=  $(IncludeSwitch). $(IncludeSwitch). \r
-IncludePCH             := \r
-RcIncludePath          := \r
-Libs                   := \r
-ArLibs                 :=  \r
-LibPath                := $(LibraryPathSwitch). \r
-\r
-##\r
-## Common variables\r
-## AR, CXX, CC, CXXFLAGS and CFLAGS can be overriden using an environment variables\r
-##\r
-AR       := ar rcus\r
-CXX      := g++\r
-CC       := gcc\r
-CXXFLAGS :=    -DSVN_REVISION=\"1221\"  $(Preprocessors)\r
-CFLAGS   :=    -DSVN_REVISION=\"1221\"  $(Preprocessors)\r
-\r
-\r
-##\r
-## User defined environment variables\r
-##\r
-CodeLiteDir:=D:\bin\CodeLite\r
-WXWIN:=D:\bin\wxWidgets-2.9.4\r
-PATH:=$(WXWIN)\lib\gcc_dll;$(PATH)\r
-WXCFG:=gcc_dll\mswu\r
-UNIT_TEST_PP_SRC_DIR:=D:\bin\UnitTest++1.3\r
-\r
-\r
-Objects=\r
-\r
-##\r
-## Main Build Targets \r
-##\r
-.PHONY: all clean PreBuild PrePreBuild PostBuild\r
-all: $(IntermediateDirectory) $(OutputFile)\r
-\r
-$(OutputFile): $(Objects)\r
-       @$(MakeDirCommand) $(@D)\r
-       @echo "" > $(IntermediateDirectory)/.d\r
-       $(AR) $(ArchiveOutputSwitch)$(OutputFile) @$(ObjectsFileList) $(ArLibs)\r
-       @$(MakeDirCommand) "D:\Projects\Radio\fdmdv2\build\codelite/.build-release"\r
-       @echo rebuilt > "D:\Projects\Radio\fdmdv2\build\codelite/.build-release/libPortCtrl"\r
-\r
-./Release:\r
-       @$(MakeDirCommand) "./Release"\r
-\r
-PreBuild:\r
-\r
-\r
-##\r
-## Objects\r
-##\r
-\r
--include $(IntermediateDirectory)/*$(DependSuffix)\r
-##\r
-## Clean\r
-##\r
-clean:\r
-       $(RM) $(OutputFile)\r
-       $(RM) $(OutputFile)\r
-       $(RM) "../.build-release/libPortCtrl"\r
-\r
-\r
diff --git a/fdmdv2/branches/0.97/build/codelite/libPortCtrl/libPortCtrl.project b/fdmdv2/branches/0.97/build/codelite/libPortCtrl/libPortCtrl.project
deleted file mode 100644 (file)
index 8338fe1..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<CodeLite_Project Name="libPortCtrl" InternalType="Library">
-  <Description/>
-  <Dependencies/>
-  <Settings Type="Static Library">
-    <GlobalSettings>
-      <Compiler Options="" C_Options="">
-        <IncludePath Value="."/>
-      </Compiler>
-      <Linker Options="">
-        <LibraryPath Value="."/>
-      </Linker>
-      <ResourceCompiler Options=""/>
-    </GlobalSettings>
-    <Configuration Name="Debug" CompilerType="gnu g++" DebuggerType="GNU gdb debugger" Type="" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append">
-      <Compiler Options="-g" C_Options="-g" Required="yes" PreCompiledHeader="" PCHInCommandLine="no" UseDifferentPCHFlags="no" PCHFlags="">
-        <IncludePath Value="."/>
-      </Compiler>
-      <Linker Options="" Required="yes"/>
-      <ResourceCompiler Options="" Required="no"/>
-      <General OutputFile="$(IntermediateDirectory)/lib$(ProjectName).a" IntermediateDirectory="./Debug" Command="" CommandArguments="" UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="yes"/>
-      <Environment EnvVarSetName="&lt;Use Defaults&gt;" DbgSetName="&lt;Use Defaults&gt;">
-        <![CDATA[]]>
-      </Environment>
-      <Debugger IsRemote="no" RemoteHostName="" RemoteHostPort="" DebuggerPath="">
-        <PostConnectCommands/>
-        <StartupCommands/>
-      </Debugger>
-      <PreBuild/>
-      <PostBuild/>
-      <CustomBuild Enabled="no">
-        <RebuildCommand/>
-        <CleanCommand/>
-        <BuildCommand/>
-        <PreprocessFileCommand/>
-        <SingleFileCommand/>
-        <MakefileGenerationCommand/>
-        <ThirdPartyToolName/>
-        <WorkingDirectory/>
-      </CustomBuild>
-      <AdditionalRules>
-        <CustomPostBuild/>
-        <CustomPreBuild/>
-      </AdditionalRules>
-      <Completion EnableCpp11="no">
-        <ClangCmpFlagsC/>
-        <ClangCmpFlags/>
-        <ClangPP/>
-        <SearchPaths/>
-      </Completion>
-    </Configuration>
-    <Configuration Name="Release" CompilerType="gnu g++" DebuggerType="GNU gdb debugger" Type="" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append">
-      <Compiler Options="" C_Options="" Required="yes" PreCompiledHeader="" PCHInCommandLine="no" UseDifferentPCHFlags="no" PCHFlags="">
-        <IncludePath Value="."/>
-      </Compiler>
-      <Linker Options="" Required="yes"/>
-      <ResourceCompiler Options="" Required="no"/>
-      <General OutputFile="$(IntermediateDirectory)/lib$(ProjectName).a" IntermediateDirectory="./Release" Command="" CommandArguments="" UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="yes"/>
-      <Environment EnvVarSetName="&lt;Use Defaults&gt;" DbgSetName="&lt;Use Defaults&gt;">
-        <![CDATA[]]>
-      </Environment>
-      <Debugger IsRemote="no" RemoteHostName="" RemoteHostPort="" DebuggerPath="">
-        <PostConnectCommands/>
-        <StartupCommands/>
-      </Debugger>
-      <PreBuild/>
-      <PostBuild/>
-      <CustomBuild Enabled="no">
-        <RebuildCommand/>
-        <CleanCommand/>
-        <BuildCommand/>
-        <PreprocessFileCommand/>
-        <SingleFileCommand/>
-        <MakefileGenerationCommand/>
-        <ThirdPartyToolName/>
-        <WorkingDirectory/>
-      </CustomBuild>
-      <AdditionalRules>
-        <CustomPostBuild/>
-        <CustomPreBuild/>
-      </AdditionalRules>
-      <Completion EnableCpp11="no">
-        <ClangCmpFlagsC/>
-        <ClangCmpFlags/>
-        <ClangPP/>
-        <SearchPaths/>
-      </Completion>
-    </Configuration>
-  </Settings>
-  <VirtualDirectory Name="src"/>
-  <VirtualDirectory Name="include"/>
-  <Dependencies Name="Debug"/>
-  <Dependencies Name="Release"/>
-</CodeLite_Project>
diff --git a/fdmdv2/branches/0.97/build/codelite/libPortCtrl/libPortCtrl.txt b/fdmdv2/branches/0.97/build/codelite/libPortCtrl/libPortCtrl.txt
deleted file mode 100644 (file)
index e3f4898..0000000
+++ /dev/null
@@ -1 +0,0 @@
-ECHO is off.\r
diff --git a/fdmdv2/branches/0.97/build/codelite/wxcrafter.xrc b/fdmdv2/branches/0.97/build/codelite/wxcrafter.xrc
deleted file mode 100644 (file)
index 3961d4b..0000000
+++ /dev/null
@@ -1,180 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resource xmlns="http://www.wxwindows.org/wxxrc" version="2.3.0.1">
-  <object class="wxDialog" name="PTTDialog">
-    <title>Hardware PTT</title>
-    <centered>1</centered>
-    <style>wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</style>
-    <size>450,300</size>
-    <object class="wxBoxSizer">
-      <orient>wxVERTICAL</orient>
-      <object class="sizeritem" name="staticBoxSizer28">
-        <flag>wxEXPAND|wxALIGN_CENTER_VERTICAL</flag>
-        <border>5</border>
-        <object class="wxStaticBoxSizer" name="staticBoxSizer28">
-          <sizeritem>
-            <object class="spacer"/>
-          </sizeritem>
-          <orient>wxVERTICAL</orient>
-          <label>Audio Tone</label>
-          <object class="sizeritem">
-            <flag>wxALIGN_CENTER|wxALIGN_CENTER_VERTICAL</flag>
-            <border>5</border>
-            <object class="wxCheckBox" name="m_ckPTTRtChan">
-              <style/>
-              <label>PTT tone on right audio channel</label>
-              <checked>0</checked>
-            </object>
-          </object>
-        </object>
-      </object>
-      <object class="sizeritem" name="staticBoxSizer17">
-        <flag>wxEXPAND</flag>
-        <border>5</border>
-        <option>1</option>
-        <object class="wxStaticBoxSizer" name="staticBoxSizer17">
-          <sizeritem>
-            <object class="spacer"/>
-          </sizeritem>
-          <orient>wxVERTICAL</orient>
-          <label>Hardware PTT Settings</label>
-          <object class="sizeritem" name="staticBoxSizer31">
-            <flag>wxEXPAND</flag>
-            <border>5</border>
-            <object class="wxStaticBoxSizer" name="staticBoxSizer31">
-              <sizeritem>
-                <object class="spacer"/>
-              </sizeritem>
-              <orient>wxVERTICAL</orient>
-              <label>PTT Port</label>
-              <object class="sizeritem">
-                <flag>wxALIGN_CENTER</flag>
-                <option>1</option>
-                <object class="wxListBox" name="m_listCtrlPorts">
-                  <style>wxLB_SINGLE</style>
-                  <content/>
-                  <selection>-1</selection>
-                </object>
-              </object>
-            </object>
-          </object>
-          <object class="sizeritem" name="boxSizer19">
-            <flag>wxEXPAND</flag>
-            <border>5</border>
-            <option>1</option>
-            <object class="wxBoxSizer">
-              <orient>wxVERTICAL</orient>
-              <object class="sizeritem" name="staticBoxSizer16">
-                <flag>wxEXPAND|wxALIGN_CENTER|wxALIGN_RIGHT</flag>
-                <border>5</border>
-                <option>1</option>
-                <object class="wxStaticBoxSizer" name="staticBoxSizer16">
-                  <sizeritem>
-                    <object class="spacer"/>
-                  </sizeritem>
-                  <orient>wxHORIZONTAL</orient>
-                  <label>Signal polarity</label>
-                  <object class="sizeritem" name="gridSizer17">
-                    <flag>wxEXPAND|wxALIGN_RIGHT</flag>
-                    <border>5</border>
-                    <option>1</option>
-                    <object class="wxGridSizer">
-                      <cols>2</cols>
-                      <rows>3</rows>
-                      <vgap>0</vgap>
-                      <hgap>0</hgap>
-                      <object class="sizeritem">
-                        <flag>wxALIGN_CENTER</flag>
-                        <border>10</border>
-                        <object class="wxCheckBox" name="m_ckUseSerialPTT">
-                          <style/>
-                          <label>Use Serial Port PTT</label>
-                          <checked>0</checked>
-                        </object>
-                      </object>
-                      <object class="spacer" name="Spacer">
-                        <flag/>
-                        <border>5</border>
-                      </object>
-                      <object class="sizeritem">
-                        <flag>wxALIGN_CENTER|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL</flag>
-                        <border>5</border>
-                        <object class="wxRadioButton" name="m_rbUseDTR">
-                          <style/>
-                          <label>Use DTR</label>
-                          <value>1</value>
-                        </object>
-                      </object>
-                      <object class="sizeritem">
-                        <flag>wxALIGN_CENTER|wxALIGN_RIGHT</flag>
-                        <border>5</border>
-                        <object class="wxCheckBox" name="m_ckRTSPos">
-                          <style/>
-                          <label>DTR = +V</label>
-                          <checked>0</checked>
-                        </object>
-                      </object>
-                      <object class="sizeritem">
-                        <flag>wxALIGN_CENTER|wxALIGN_RIGHT</flag>
-                        <border>5</border>
-                        <object class="wxRadioButton" name="m_rbUseRTS">
-                          <style/>
-                          <label>Use RTS</label>
-                          <tooltip>Toggle the RTS pin for PTT</tooltip>
-                          <value>1</value>
-                        </object>
-                      </object>
-                      <object class="sizeritem">
-                        <flag>wxALIGN_CENTER|wxALIGN_RIGHT</flag>
-                        <border>5</border>
-                        <object class="wxCheckBox" name="m_ckDTRPos">
-                          <tooltip>Set Polarity of the RTS line</tooltip>
-                          <style/>
-                          <label>RTS = +V</label>
-                          <checked>0</checked>
-                        </object>
-                      </object>
-                    </object>
-                  </object>
-                </object>
-              </object>
-            </object>
-          </object>
-        </object>
-      </object>
-      <object class="sizeritem" name="boxSizer12">
-        <flag>wxLEFT|wxRIGHT|wxTOP|wxBOTTOM|wxALIGN_CENTER_HORIZONTAL</flag>
-        <border>5</border>
-        <object class="wxBoxSizer">
-          <orient>wxHORIZONTAL</orient>
-          <object class="sizeritem">
-            <flag>wxLEFT|wxRIGHT|wxTOP|wxBOTTOM</flag>
-            <border>5</border>
-            <object class="wxButton" name="m_buttonOK">
-              <label>OK</label>
-              <style/>
-              <default>1</default>
-            </object>
-          </object>
-          <object class="sizeritem">
-            <flag>wxLEFT|wxRIGHT|wxTOP|wxBOTTOM</flag>
-            <border>5</border>
-            <object class="wxButton" name="m_buttonCancel">
-              <label>Cancel</label>
-              <style/>
-              <default>0</default>
-            </object>
-          </object>
-          <object class="sizeritem">
-            <flag>wxLEFT|wxRIGHT|wxTOP|wxBOTTOM</flag>
-            <border>5</border>
-            <object class="wxButton" name="m_buttonApply">
-              <label>Apply</label>
-              <style/>
-              <default>0</default>
-            </object>
-          </object>
-        </object>
-      </object>
-    </object>
-  </object>
-</resource>
diff --git a/fdmdv2/branches/0.97/build/msvc/.gitignore b/fdmdv2/branches/0.97/build/msvc/.gitignore
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/fdmdv2/branches/0.97/cmake/BuildCodec2.cmake b/fdmdv2/branches/0.97/cmake/BuildCodec2.cmake
deleted file mode 100644 (file)
index 034bc46..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-if(CMAKE_CROSSCOMPILING)
-    set(CODEC2_CMAKE_ARGS "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
-endif()
-
-include(ExternalProject)
-ExternalProject_Add(codec2
-   SVN_REPOSITORY https://svn.code.sf.net/p/freetel/code/codec2
-   CMAKE_ARGS ${CODEC2_CMAKE_ARGS}
-   INSTALL_COMMAND ""
-)
-set(CODEC2_LIBRARIES
-    ${CMAKE_BINARY_DIR}/codec2-prefix/src/codec2-build/src/libcodec2.a)
-include_directories(${CMAKE_BINARY_DIR}/codec2-prefix/src/codec2/src)
-list(APPEND FREEDV_LINK_LIBS ${CODEC2_LIBRARIES})
-list(APPEND FREEDV_STATIC_DEPS codec2)
diff --git a/fdmdv2/branches/0.97/cmake/BuildLibctb.cmake b/fdmdv2/branches/0.97/cmake/BuildLibctb.cmake
deleted file mode 100644 (file)
index bb98bd2..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-set(LIBCTB_TARBALL "libctb-0.16")
-
-include(ExternalProject)
-ExternalProject_Add(libctb
-   URL https://iftools.com/download/ctb/0.16/${LIBCTB_TARBALL}.tar.gz
-   PATCH_COMMAND patch -p1 < ${CMAKE_SOURCE_DIR}/cmake/libctb.patch
-   CMAKE_ARGS -DBUILD_SHARED_LIBS=FALSE
-   INSTALL_COMMAND ""
-)
-if(WIN32)
-   set(LIBCTB_LIBRARY
-       ${CMAKE_BINARY_DIR}/libctb-prefix/src/libctb-build/src/ctb-0.16.lib)
-else(WIN32)
-   set(LIBCTB_LIBRARY
-       ${CMAKE_BINARY_DIR}/libctb-prefix/src/libctb-build/src/libctb-0.16.a)
-endif(WIN32)
-include_directories(${CMAKE_BINARY_DIR}/libctb-prefix/src/libctb/include)
-list(APPEND FREEDV_LINK_LIBS ${LIBCTB_LIBRARY})
-list(APPEND FREEDV_STATIC_DEPS libctb)
diff --git a/fdmdv2/branches/0.97/cmake/BuildPortaudio.cmake b/fdmdv2/branches/0.97/cmake/BuildPortaudio.cmake
deleted file mode 100644 (file)
index 445b1e1..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-set(PORTAUDIO_TARBALL "pa_stable_v19_20111121")
-
-# required linking libraries on linux. Not sure about windows.
-find_library(ALSA_LIBRARIES asound)
-
-if(UNIX AND NOT ALSA_LIBRARIES)
-    message(ERROR "Could not find alsa library which is required for portaudio.
-On Linux systems try installing:
-    alsa-lib-devel  (RPM based systems)
-    libasound2-dev  (DEB based systems)"
-    )
-endif()
-
-include(ExternalProject)
-ExternalProject_Add(portaudio
-    URL http://www.portaudio.com/archives/${PORTAUDIO_TARBALL}.tgz
-    BUILD_IN_SOURCE 1
-    INSTALL_DIR external/dist
-    CONFIGURE_COMMAND ./configure --enable-cxx --without-jack --prefix=${CMAKE_BINARY_DIR}/external/dist
-    BUILD_COMMAND $(MAKE)
-    INSTALL_COMMAND $(MAKE) install
-)
-if(WIN32)
-    set(PORTAUDIO_LIBRARIES ${CMAKE_BINARY_DIR}/external/dist/lib/portaudio.lib)
-else(WIN32)
-    find_library(RT rt)
-    find_library(ASOUND asound)
-    set(PORTAUDIO_LIBRARIES
-        ${CMAKE_BINARY_DIR}/external/dist/lib/libportaudio.a
-        ${CMAKE_BINARY_DIR}/external/dist/lib/libportaudiocpp.a
-        ${RT}
-        ${ASOUND}
-    )
-endif(WIN32)
-include_directories(${CMAKE_BINARY_DIR}/external/dist/include)
-
-# Add the portaudio library to the list of libraries that must be linked.
-list(APPEND FREEDV_LINK_LIBS ${PORTAUDIO_LIBRARIES})
-
-# Setup a dependency so that this gets built before linking to freedv.
-list(APPEND FREEDV_STATIC_DEPS portaudio)
diff --git a/fdmdv2/branches/0.97/cmake/BuildSamplerate.cmake b/fdmdv2/branches/0.97/cmake/BuildSamplerate.cmake
deleted file mode 100644 (file)
index a3be551..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-set(SAMPLERATE_TARBALL "libsamplerate-0.1.8")
-
-include(ExternalProject)
-ExternalProject_Add(samplerate
-    URL http://www.mega-nerd.com/SRC/${SAMPLERATE_TARBALL}.tar.gz 
-    BUILD_IN_SOURCE 1
-    INSTALL_DIR external/dist
-    CONFIGURE_COMMAND ./configure --prefix=${CMAKE_BINARY_DIR}/external/dist
-    BUILD_COMMAND $(MAKE)
-    INSTALL_COMMAND $(MAKE) install
-)
-if(WIN32)
-    set(SAMPLERATE_LIBRARIES
-        ${CMAKE_BINARY_DIR}/external/dist/lib/samplerate.lib)
-else(WIN32)
-    set(SAMPLERATE_LIBRARIES
-        ${CMAKE_BINARY_DIR}/external/dist/lib/libsamplerate.a)
-endif(WIN32)
-include_directories(${CMAKE_BINARY_DIR}/external/dist/include)
-list(APPEND FREEDV_LINK_LIBS ${SAMPLERATE_LIBRARIES})
-list(APPEND FREEDV_STATIC_DEPS samplerate)
diff --git a/fdmdv2/branches/0.97/cmake/BuildSndfile.cmake b/fdmdv2/branches/0.97/cmake/BuildSndfile.cmake
deleted file mode 100644 (file)
index 2375c47..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-set(SNDFILE_TARBALL "libsndfile-1.0.25")
-
-include(ExternalProject)
-ExternalProject_Add(sndfile
-    URL http://www.mega-nerd.com/libsndfile/files/${SNDFILE_TARBALL}.tar.gz
-    BUILD_IN_SOURCE 1
-    INSTALL_DIR external/dist
-    CONFIGURE_COMMAND ./configure --prefix=${CMAKE_BINARY_DIR}/external/dist --disable-external-libs --disable-shared
-    BUILD_COMMAND $(MAKE) V=1
-    INSTALL_COMMAND $(MAKE) install
-)
-if(MINGW)
-    set(SNDFILE_LIBRARIES ${CMAKE_BINARY_DIR}/external/dist/bin/libsndfile-1.dll)
-else()
-    set(SNDFILE_LIBRARIES ${CMAKE_BINARY_DIR}/external/dist/lib/libsndfile.a)
-endif()
-
-include_directories(${CMAKE_BINARY_DIR}/external/dist/include)
-list(APPEND FREEDV_LINK_LIBS ${SNDFILE_LIBRARIES})
-list(APPEND FREEDV_STATIC_DEPS sndfile)
diff --git a/fdmdv2/branches/0.97/cmake/BuildSox.cmake b/fdmdv2/branches/0.97/cmake/BuildSox.cmake
deleted file mode 100644 (file)
index 635fc93..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-set(SOX_TARBALL "sox-14.4.1")
-
-# required linking libraries on linux. Not sure about windows.
-find_library(ALSA_LIBRARIES asound)
-find_library(AO_LIBRARIES ao)
-
-if(UNIX AND NOT ALSA_LIBRARIES)
-    message(ERROR "Could not find alsa library.
-On Linux systems try installing:
-    alsa-lib-devel  (RPM based systems)
-    libasound2-dev  (DEB based systems)"
-    )
-endif(UNIX AND NOT ALSA_LIBRARIES)
-
-if(UNIX AND NOT AO_LIBRARIES)
-    message(ERROR "Could not find libao.
-On Linux systems try installing:
-    libao-devel  (RPM based systems)
-    libao-dev    (DEB based systems)"
-    )
-endif(UNIX AND NOT AO_LIBRARIES)
-
-include(ExternalProject)
-ExternalProject_Add(sox
-    URL http://downloads.sourceforge.net/sox/${SOX_TARBALL}.tar.gz
-    BUILD_IN_SOURCE 1
-    INSTALL_DIR external/dist
-    CONFIGURE_COMMAND ./configure --enable-shared=no --without-id3tag --without-png --disable-gomp --with-oggvorbis=no --with-oss=no --with-flac=no --with-amrnb=no --with-amrwb=no --with-mp3=no --with-wavpack=no --disable-dl-sndfile --with-pulseaudio=no --without-magic --prefix=${CMAKE_BINARY_DIR}/external/dist
-    BUILD_COMMAND $(MAKE) V=1
-    INSTALL_COMMAND $(MAKE) install
-)
-set(SOX_LIBRARIES ${CMAKE_BINARY_DIR}/external/dist/lib/libsox.a)
-if(UNIX)
-    list(APPEND SOX_LIBRARIES ${ALSA_LIBRARIES} ${AO_LIBRARIES})
-endif()
-if(MINGW)
-    list(APPEND SOX_LIBRARIES winmm)
-endif()
-include_directories(${CMAKE_BINARY_DIR}/external/dist/include)
-list(APPEND FREEDV_LINK_LIBS ${SOX_LIBRARIES})
-list(APPEND FREEDV_STATIC_DEPS sox)
\ No newline at end of file
diff --git a/fdmdv2/branches/0.97/cmake/BuildWxWidgets.cmake b/fdmdv2/branches/0.97/cmake/BuildWxWidgets.cmake
deleted file mode 100644 (file)
index 7dbcd1e..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-set(WXWIDGETS_TARBALL "wxWidgets-3.0.2")
-
-# If we're cross-compiling then we need to set the target host manually.
-if(MINGW AND CMAKE_CROSSCOMPILING)
-    if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
-        set(HOST x86_64-w64-mingw32)
-    else()
-        set(HOST i686-w64-mingw32)
-    endif()
-endif()
-
-# If not cross-compiling then use the built-in makefile, otherwise use standard configure.
-if(MINGW AND NOT CMAKE_CROSSCOMPILING)
-#    set(CONFIGURE_COMMAND "true")
-#    set(MAKE_COMMAND $(MAKE) -C build/msw -f makefile.gcc SHARED=0 UNICODE=1 BUILD=release PREFIX=${CMAKE_BINARY_DIR}/external/dist)
-    set(CONFIGURE_COMMAND ./configure --disable-shared --prefix=${CMAKE_BINARY_DIR}/external/dist)
-       set(MAKE_COMMAND $(MAKE))
-else()
-    set(CONFIGURE_COMMAND ./configure --host=${HOST} --target=${HOST} --disable-shared --prefix=${CMAKE_BINARY_DIR}/external/dist)
-       set(MAKE_COMMAND $(MAKE))
-endif()
-
-include(ExternalProject)
-ExternalProject_Add(wxWidgets
-    URL http://downloads.sourceforge.net/wxwindows/${WXWIDGETS_TARBALL}.tar.bz2
-    BUILD_IN_SOURCE 1
-    INSTALL_DIR external/dist
-    CONFIGURE_COMMAND ${CONFIGURE_COMMAND}
-    BUILD_COMMAND ${MAKE_COMMAND}
-    INSTALL_COMMAND $(MAKE) install
-)
-
-ExternalProject_Get_Property(wxWidgets install_dir)
-message(STATUS "wxWidgets install dir: ${install_dir}")
-if(NOT WXCONFIG)
-    set(WXCONFIG "${install_dir}/bin/wx-config")
-endif()
-if(EXISTS ${WXCONFIG})
-    set(BS_WX_DONE TRUE)
-endif()
diff --git a/fdmdv2/branches/0.97/cmake/FindPortaudio.cmake b/fdmdv2/branches/0.97/cmake/FindPortaudio.cmake
deleted file mode 100644 (file)
index 9eca1d0..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-# - Try to find Portaudio
-# Once done this will define
-#
-#  PORTAUDIO_FOUND - system has Portaudio
-#  PORTAUDIO_INCLUDE_DIRS - the Portaudio include directory
-#  PORTAUDIO_LIBRARIES - Link these to use Portaudio
-#  PORTAUDIO_DEFINITIONS - Compiler switches required for using Portaudio
-#  PORTAUDIO_VERSION - Portaudio version
-#
-#  Copyright (c) 2006 Andreas Schneider <mail@cynapses.org>
-#
-# Redistribution and use is allowed according to the terms of the New BSD license.
-# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
-#
-
-
-if(PORTAUDIO_LIBRARIES AND PORTAUDIO_INCLUDE_DIRS)
-  # in cache already
-  set(PORTAUDIO_FOUND TRUE)
-else(PORTAUDIO_LIBRARIES AND PORTAUDIO_INCLUDE_DIRS)
-  if(NOT WIN32 OR (MINGW AND CMAKE_CROSSCOMPILING))
-   include(FindPkgConfig)
-   pkg_check_modules(PORTAUDIO2 portaudio-2.0)
-  endif()
-
-  if(PORTAUDIO2_FOUND)
-
-    set(PORTAUDIO_INCLUDE_DIRS ${PORTAUDIO2_INCLUDE_DIRS})
-    if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
-      set(PORTAUDIO_LIBRARIES "${PORTAUDIO2_LIBRARY_DIRS}/lib${PORTAUDIO2_LIBRARIES}.dylib")
-    else()
-      # CMake prefers absolute library paths.
-      foreach(_lib portaudio-2;${PORTAUDIO2_LIBRARIES})
-        find_library(${_lib}_LIB ${_lib} {PORTAUDIO2_LIBDIR})
-        if(${_lib}_LIB)
-          list(APPEND PORTAUDIO_LIBRARIES ${${_lib}_LIB})
-        endif()
-      endforeach()
-    endif()
-    set(PORTAUDIO_VERSION 19)
-    set(PORTAUDIO_FOUND TRUE)
-
-  else(PORTAUDIO2_FOUND)
-
-    find_path(PORTAUDIO_INCLUDE_DIR
-      NAMES
-        portaudio.h
-      PATHS
-        /usr/include
-        /usr/local/include
-        /opt/local/include
-        /sw/include
-    )
-   
-    find_library(PORTAUDIO_LIBRARY
-      NAMES
-        portaudio
-      PATHS
-        /usr/lib
-        /usr/local/lib
-        /opt/local/lib
-        /sw/lib
-    )
-   
-    find_path(PORTAUDIO_LIBRARY_DIR
-      NAMES
-        portaudio
-      PATHS
-        ${CMAKE_SYSTEM_LIBRARY_PATH}
-        ${CMAKE_LIBRARY_PATH}
-        /usr/lib
-        /usr/local/lib
-        /opt/local/lib
-        /sw/lib
-    )
-   
-    set(PORTAUDIO_INCLUDE_DIRS
-      ${PORTAUDIO_INCLUDE_DIR}
-    )
-    set(PORTAUDIO_LIBRARIES
-      ${PORTAUDIO_LIBRARY}
-    )
-   
-    set(PORTAUDIO_LIBRARY_DIRS
-      ${PORTAUDIO_LIBRARY_DIR}
-    )
-   
-    set(PORTAUDIO_VERSION
-      18
-    )
-   
-    if (PORTAUDIO_INCLUDE_DIRS AND PORTAUDIO_LIBRARIES)
-       set(PORTAUDIO_FOUND TRUE)
-    endif (PORTAUDIO_INCLUDE_DIRS AND PORTAUDIO_LIBRARIES)
-   
-    if (PORTAUDIO_FOUND)
-      if (NOT Portaudio_FIND_QUIETLY)
-        message(STATUS "Found Portaudio: ${PORTAUDIO_LIBRARIES}")
-      endif (NOT Portaudio_FIND_QUIETLY)
-    else (PORTAUDIO_FOUND)
-      if (Portaudio_FIND_REQUIRED)
-        message(FATAL_ERROR "Could not find Portaudio")
-      endif (Portaudio_FIND_REQUIRED)
-    endif (PORTAUDIO_FOUND)
-  endif (PORTAUDIO2_FOUND)
-
-
-  # show the PORTAUDIO_INCLUDE_DIRS and PORTAUDIO_LIBRARIES variables only in the advanced view
-  mark_as_advanced(PORTAUDIO_INCLUDE_DIRS PORTAUDIO_LIBRARIES)
-
-endif (PORTAUDIO_LIBRARIES AND PORTAUDIO_INCLUDE_DIRS)
-
diff --git a/fdmdv2/branches/0.97/cmake/GetDependencies.cmake.in b/fdmdv2/branches/0.97/cmake/GetDependencies.cmake.in
deleted file mode 100644 (file)
index 93204dd..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# As this script is run in a new cmake instance, it does not have access to
-# the existing cache variables. Pass them in via the configure_file command.
-set(CMAKE_BINARY_DIR @CMAKE_BINARY_DIR@)
-set(CMAKE_SOURCE_DIR @CMAKE_SOURCE_DIR@)
-set(UNIX @UNIX@)
-set(WIN32 @WIN32@)
-set(CMAKE_CROSSCOMPILING @CMAKE_CROSSCOMPILING@)
-set(CMAKE_FIND_LIBRARY_SUFFIXES @CMAKE_FIND_LIBRARY_SUFFIXES@)
-set(CMAKE_FIND_LIBRARY_PREFIXES @CMAKE_FIND_LIBRARY_PREFIXES@)
-set(CMAKE_SYSTEM_LIBRARY_PATH @CMAKE_SYSTEM_LIBRARY_PATH@)
-set(CMAKE_FIND_ROOT_PATH @CMAKE_FIND_ROOT_PATH@)
-
-set(FREEDV_EXE ${CMAKE_BINARY_DIR}/src/freedv.exe)
-
-include(GetPrerequisites)
-get_prerequisites("${FREEDV_EXE}" _deps 1 1 "" "${CMAKE_SYSTEM_LIBRARY_PATH}")
-foreach(_runtime ${_deps})
-    message("Looking for ${_runtime}")
-    find_library(RUNTIME_${_runtime} ${_runtime})
-    message("${RUNTIME_${_runtime}}")
-    if(RUNTIME_${_runtime})
-        file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/bin"
-        TYPE EXECUTABLE FILES "${RUNTIME_${_runtime}}")
-    endif()
-endforeach()
diff --git a/fdmdv2/branches/0.97/cmake/config.h.in b/fdmdv2/branches/0.97/cmake/config.h.in
deleted file mode 100644 (file)
index 8e3ab76..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/*--------------------------------------------------------------------------
- ** This file is autogenerated from config.h.in 
- ** during the cmake configuration of your project. If you need to make changes
- ** edit the original file NOT THIS FILE.
- ** --------------------------------------------------------------------------*/
-#ifndef _CONFIGURATION_HEADER_GUARD_H_
-#define _CONFIGURATION_HEADER_GUARD_H_
-
-#define SIZEOF_INT @SIZEOF_INT@
-#cmakedefine HAVE_LIMITS_H @HAVE_LIMITS_H@
-#cmakedefine HAVE_STDINT_H @HAVE_STDINT_H@
-#cmakedefine HAVE_STDDEF_H @HAVE_STDDEF_H@
-#cmakedefine HAVE_STDLIB_H @HAVE_STDLIB_H@
-#cmakedefine HAVE_STRING_H @HAVE_STRING_H@
-#cmakedefine HAVE_FLOOR @HAVE_FLOOR@
-#cmakedefine HAVE_MEMSET @HAVE_MEMSET@
-#cmakedefine HAVE_POW @HAVE_POW@
-#cmakedefine HAVE_SQRT @HAVE_SQRT@
-#endif
diff --git a/fdmdv2/branches/0.97/conf/authz b/fdmdv2/branches/0.97/conf/authz
deleted file mode 100644 (file)
index 90d8838..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-### This file is an example authorization file for svnserve.\r
-### Its format is identical to that of mod_authz_svn authorization\r
-### files.\r
-### As shown below each section defines authorizations for the path and\r
-### (optional) repository specified by the section name.\r
-### The authorizations follow. An authorization line can refer to:\r
-###  - a single user,\r
-###  - a group of users defined in a special [groups] section,\r
-###  - an alias defined in a special [aliases] section,\r
-###  - all authenticated users, using the '$authenticated' token,\r
-###  - only anonymous users, using the '$anonymous' token,\r
-###  - anyone, using the '*' wildcard.\r
-###\r
-### A match can be inverted by prefixing the rule with '~'. Rules can\r
-### grant read ('r') access, read-write ('rw') access, or no access\r
-### ('').\r
-\r
-[aliases]\r
-# joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average\r
-\r
-[groups]\r
-# harry_and_sally = harry,sally\r
-# harry_sally_and_joe = harry,sally,&joe\r
-\r
-# [/foo/bar]\r
-# harry = rw\r
-# &joe = r\r
-# * =\r
-\r
-# [repository:/baz/fuz]\r
-# @harry_and_sally = rw\r
-# * = r\r
diff --git a/fdmdv2/branches/0.97/conf/passwd b/fdmdv2/branches/0.97/conf/passwd
deleted file mode 100644 (file)
index d22bafc..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-### This file is an example password file for svnserve.\r
-### Its format is similar to that of svnserve.conf. As shown in the\r
-### example below it contains one section labelled [users].\r
-### The name and password for each user follow, one account per line.\r
-\r
-[users]\r
-# harry = harryssecret\r
-# sally = sallyssecret\r
diff --git a/fdmdv2/branches/0.97/conf/svnserve.conf b/fdmdv2/branches/0.97/conf/svnserve.conf
deleted file mode 100644 (file)
index d22d631..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-### This file controls the configuration of the svnserve daemon, if you\r
-### use it to allow access to this repository.  (If you only allow\r
-### access through http: and/or file: URLs, then this file is\r
-### irrelevant.)\r
-\r
-### Visit http://subversion.apache.org/ for more information.\r
-\r
-[general]\r
-### The anon-access and auth-access options control access to the\r
-### repository for unauthenticated (a.k.a. anonymous) users and\r
-### authenticated users, respectively.\r
-### Valid values are "write", "read", and "none".\r
-### Setting the value to "none" prohibits both reading and writing;\r
-### "read" allows read-only access, and "write" allows complete \r
-### read/write access to the repository.\r
-### The sample settings below are the defaults and specify that anonymous\r
-### users have read-only access to the repository, while authenticated\r
-### users have read and write access to the repository.\r
-# anon-access = read\r
-# auth-access = write\r
-### The password-db option controls the location of the password\r
-### database file.  Unless you specify a path starting with a /,\r
-### the file's location is relative to the directory containing\r
-### this configuration file.\r
-### If SASL is enabled (see below), this file will NOT be used.\r
-### Uncomment the line below to use the default password file.\r
-# password-db = passwd\r
-### The authz-db option controls the location of the authorization\r
-### rules for path-based access control.  Unless you specify a path\r
-### starting with a /, the file's location is relative to the the\r
-### directory containing this file.  If you don't specify an\r
-### authz-db, no path-based access control is done.\r
-### Uncomment the line below to use the default authorization file.\r
-# authz-db = authz\r
-### This option specifies the authentication realm of the repository.\r
-### If two repositories have the same authentication realm, they should\r
-### have the same password database, and vice versa.  The default realm\r
-### is repository's uuid.\r
-# realm = My First Repository\r
-### The force-username-case option causes svnserve to case-normalize\r
-### usernames before comparing them against the authorization rules in the\r
-### authz-db file configured above.  Valid values are "upper" (to upper-\r
-### case the usernames), "lower" (to lowercase the usernames), and\r
-### "none" (to compare usernames as-is without case conversion, which\r
-### is the default behavior).\r
-# force-username-case = none\r
-\r
-[sasl]\r
-### This option specifies whether you want to use the Cyrus SASL\r
-### library for authentication. Default is false.\r
-### This section will be ignored if svnserve is not built with Cyrus\r
-### SASL support; to check, run 'svnserve --version' and look for a line\r
-### reading 'Cyrus SASL authentication is available.'\r
-# use-sasl = true\r
-### These options specify the desired strength of the security layer\r
-### that you want SASL to provide. 0 means no encryption, 1 means\r
-### integrity-checking only, values larger than 1 are correlated\r
-### to the effective key length for encryption (e.g. 128 means 128-bit\r
-### encryption). The values below are the defaults.\r
-# min-encryption = 0\r
-# max-encryption = 256\r
diff --git a/fdmdv2/branches/0.97/contrib/CMakeLists.txt b/fdmdv2/branches/0.97/contrib/CMakeLists.txt
deleted file mode 100644 (file)
index 3f4b7e0..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-# Install icons if we're on most *nix systems.
-if(UNIX AND NOT APPLE)
-    set(ICON_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor
-        CACHE PATH "Prefix to use for installing icons.")
-    install(FILES freedv48x48.png
-        DESTINATION ${ICON_INSTALL_PREFIX}/48x48/apps
-        RENAME freedv.png)
-    install(FILES freedv64x64.png
-        DESTINATION ${ICON_INSTALL_PREFIX}/64x64/apps
-        RENAME freedv.png)
-    install(FILES freedv128x128.png
-        DESTINATION ${ICON_INSTALL_PREFIX}/128x128/apps
-        RENAME freedv.png)
-    install(FILES freedv256x256.png
-        DESTINATION ${ICON_INSTALL_PREFIX}/256x256/apps
-        RENAME freedv.png)
-
-    set(DESKTOP_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/applications
-        CACHE PATH "Location to install desktop files.")
-    install(FILES freedv.desktop
-        DESTINATION ${DESKTOP_INSTALL_DIR})
-endif(UNIX AND NOT APPLE)
diff --git a/fdmdv2/branches/0.97/contrib/LICENSE b/fdmdv2/branches/0.97/contrib/LICENSE
deleted file mode 100644 (file)
index dc8853a..0000000
+++ /dev/null
@@ -1,393 +0,0 @@
-Attribution 4.0 International
-
-=======================================================================
-
-Creative Commons Corporation ("Creative Commons") is not a law firm and
-does not provide legal services or legal advice. Distribution of
-Creative Commons public licenses does not create a lawyer-client or
-other relationship. Creative Commons makes its licenses and related
-information available on an "as-is" basis. Creative Commons gives no
-warranties regarding its licenses, any material licensed under their
-terms and conditions, or any related information. Creative Commons
-disclaims all liability for damages resulting from their use to the
-fullest extent possible.
-
-Using Creative Commons Public Licenses
-
-Creative Commons public licenses provide a standard set of terms and
-conditions that creators and other rights holders may use to share
-original works of authorship and other material subject to copyright
-and certain other rights specified in the public license below. The
-following considerations are for informational purposes only, are not
-exhaustive, and do not form part of our licenses.
-
-     Considerations for licensors: Our public licenses are
-     intended for use by those authorized to give the public
-     permission to use material in ways otherwise restricted by
-     copyright and certain other rights. Our licenses are
-     irrevocable. Licensors should read and understand the terms
-     and conditions of the license they choose before applying it.
-     Licensors should also secure all rights necessary before
-     applying our licenses so that the public can reuse the
-     material as expected. Licensors should clearly mark any
-     material not subject to the license. This includes other CC-
-     licensed material, or material used under an exception or
-     limitation to copyright. More considerations for licensors:
-       wiki.creativecommons.org/Considerations_for_licensors
-
-     Considerations for the public: By using one of our public
-     licenses, a licensor grants the public permission to use the
-     licensed material under specified terms and conditions. If
-     the licensor's permission is not necessary for any reason--for
-     example, because of any applicable exception or limitation to
-     copyright--then that use is not regulated by the license. Our
-     licenses grant only permissions under copyright and certain
-     other rights that a licensor has authority to grant. Use of
-     the licensed material may still be restricted for other
-     reasons, including because others have copyright or other
-     rights in the material. A licensor may make special requests,
-     such as asking that all changes be marked or described.
-     Although not required by our licenses, you are encouraged to
-     respect those requests where reasonable. More_considerations
-     for the public: 
-       wiki.creativecommons.org/Considerations_for_licensees
-
-=======================================================================
-
-Creative Commons Attribution 4.0 International Public License
-
-By exercising the Licensed Rights (defined below), You accept and agree
-to be bound by the terms and conditions of this Creative Commons
-Attribution 4.0 International Public License ("Public License"). To the
-extent this Public License may be interpreted as a contract, You are
-granted the Licensed Rights in consideration of Your acceptance of
-these terms and conditions, and the Licensor grants You such rights in
-consideration of benefits the Licensor receives from making the
-Licensed Material available under these terms and conditions.
-
-
-Section 1 -- Definitions.
-
-  a. Adapted Material means material subject to Copyright and Similar
-     Rights that is derived from or based upon the Licensed Material
-     and in which the Licensed Material is translated, altered,
-     arranged, transformed, or otherwise modified in a manner requiring
-     permission under the Copyright and Similar Rights held by the
-     Licensor. For purposes of this Public License, where the Licensed
-     Material is a musical work, performance, or sound recording,
-     Adapted Material is always produced where the Licensed Material is
-     synched in timed relation with a moving image.
-
-  b. Adapter's License means the license You apply to Your Copyright
-     and Similar Rights in Your contributions to Adapted Material in
-     accordance with the terms and conditions of this Public License.
-
-  c. Copyright and Similar Rights means copyright and/or similar rights
-     closely related to copyright including, without limitation,
-     performance, broadcast, sound recording, and Sui Generis Database
-     Rights, without regard to how the rights are labeled or
-     categorized. For purposes of this Public License, the rights
-     specified in Section 2(b)(1)-(2) are not Copyright and Similar
-     Rights.
-
-  d. Effective Technological Measures means those measures that, in the
-     absence of proper authority, may not be circumvented under laws
-     fulfilling obligations under Article 11 of the WIPO Copyright
-     Treaty adopted on December 20, 1996, and/or similar international
-     agreements.
-
-  e. Exceptions and Limitations means fair use, fair dealing, and/or
-     any other exception or limitation to Copyright and Similar Rights
-     that applies to Your use of the Licensed Material.
-
-  f. Licensed Material means the artistic or literary work, database,
-     or other material to which the Licensor applied this Public
-     License.
-
-  g. Licensed Rights means the rights granted to You subject to the
-     terms and conditions of this Public License, which are limited to
-     all Copyright and Similar Rights that apply to Your use of the
-     Licensed Material and that the Licensor has authority to license.
-
-  h. Licensor means the individual(s) or entity(ies) granting rights
-     under this Public License.
-
-  i. Share means to provide material to the public by any means or
-     process that requires permission under the Licensed Rights, such
-     as reproduction, public display, public performance, distribution,
-     dissemination, communication, or importation, and to make material
-     available to the public including in ways that members of the
-     public may access the material from a place and at a time
-     individually chosen by them.
-
-  j. Sui Generis Database Rights means rights other than copyright
-     resulting from Directive 96/9/EC of the European Parliament and of
-     the Council of 11 March 1996 on the legal protection of databases,
-     as amended and/or succeeded, as well as other essentially
-     equivalent rights anywhere in the world.
-
-  k. You means the individual or entity exercising the Licensed Rights
-     under this Public License. Your has a corresponding meaning.
-
-
-Section 2 -- Scope.
-
-  a. License grant.
-
-       1. Subject to the terms and conditions of this Public License,
-          the Licensor hereby grants You a worldwide, royalty-free,
-          non-sublicensable, non-exclusive, irrevocable license to
-          exercise the Licensed Rights in the Licensed Material to:
-
-            a. reproduce and Share the Licensed Material, in whole or
-               in part; and
-
-            b. produce, reproduce, and Share Adapted Material.
-
-       2. Exceptions and Limitations. For the avoidance of doubt, where
-          Exceptions and Limitations apply to Your use, this Public
-          License does not apply, and You do not need to comply with
-          its terms and conditions.
-
-       3. Term. The term of this Public License is specified in Section
-          6(a).
-
-       4. Media and formats; technical modifications allowed. The
-          Licensor authorizes You to exercise the Licensed Rights in
-          all media and formats whether now known or hereafter created,
-          and to make technical modifications necessary to do so. The
-          Licensor waives and/or agrees not to assert any right or
-          authority to forbid You from making technical modifications
-          necessary to exercise the Licensed Rights, including
-          technical modifications necessary to circumvent Effective
-          Technological Measures. For purposes of this Public License,
-          simply making modifications authorized by this Section 2(a)
-          (4) never produces Adapted Material.
-
-       5. Downstream recipients.
-
-            a. Offer from the Licensor -- Licensed Material. Every
-               recipient of the Licensed Material automatically
-               receives an offer from the Licensor to exercise the
-               Licensed Rights under the terms and conditions of this
-               Public License.
-
-            b. No downstream restrictions. You may not offer or impose
-               any additional or different terms or conditions on, or
-               apply any Effective Technological Measures to, the
-               Licensed Material if doing so restricts exercise of the
-               Licensed Rights by any recipient of the Licensed
-               Material.
-
-       6. No endorsement. Nothing in this Public License constitutes or
-          may be construed as permission to assert or imply that You
-          are, or that Your use of the Licensed Material is, connected
-          with, or sponsored, endorsed, or granted official status by,
-          the Licensor or others designated to receive attribution as
-          provided in Section 3(a)(1)(A)(i).
-
-  b. Other rights.
-
-       1. Moral rights, such as the right of integrity, are not
-          licensed under this Public License, nor are publicity,
-          privacy, and/or other similar personality rights; however, to
-          the extent possible, the Licensor waives and/or agrees not to
-          assert any such rights held by the Licensor to the limited
-          extent necessary to allow You to exercise the Licensed
-          Rights, but not otherwise.
-
-       2. Patent and trademark rights are not licensed under this
-          Public License.
-
-       3. To the extent possible, the Licensor waives any right to
-          collect royalties from You for the exercise of the Licensed
-          Rights, whether directly or through a collecting society
-          under any voluntary or waivable statutory or compulsory
-          licensing scheme. In all other cases the Licensor expressly
-          reserves any right to collect such royalties.
-
-
-Section 3 -- License Conditions.
-
-Your exercise of the Licensed Rights is expressly made subject to the
-following conditions.
-
-  a. Attribution.
-
-       1. If You Share the Licensed Material (including in modified
-          form), You must:
-
-            a. retain the following if it is supplied by the Licensor
-               with the Licensed Material:
-
-                 i. identification of the creator(s) of the Licensed
-                    Material and any others designated to receive
-                    attribution, in any reasonable manner requested by
-                    the Licensor (including by pseudonym if
-                    designated);
-
-                ii. a copyright notice;
-
-               iii. a notice that refers to this Public License;
-
-                iv. a notice that refers to the disclaimer of
-                    warranties;
-
-                 v. a URI or hyperlink to the Licensed Material to the
-                    extent reasonably practicable;
-
-            b. indicate if You modified the Licensed Material and
-               retain an indication of any previous modifications; and
-
-            c. indicate the Licensed Material is licensed under this
-               Public License, and include the text of, or the URI or
-               hyperlink to, this Public License.
-
-       2. You may satisfy the conditions in Section 3(a)(1) in any
-          reasonable manner based on the medium, means, and context in
-          which You Share the Licensed Material. For example, it may be
-          reasonable to satisfy the conditions by providing a URI or
-          hyperlink to a resource that includes the required
-          information.
-
-       3. If requested by the Licensor, You must remove any of the
-          information required by Section 3(a)(1)(A) to the extent
-          reasonably practicable.
-
-       4. If You Share Adapted Material You produce, the Adapter's
-          License You apply must not prevent recipients of the Adapted
-          Material from complying with this Public License.
-
-
-Section 4 -- Sui Generis Database Rights.
-
-Where the Licensed Rights include Sui Generis Database Rights that
-apply to Your use of the Licensed Material:
-
-  a. for the avoidance of doubt, Section 2(a)(1) grants You the right
-     to extract, reuse, reproduce, and Share all or a substantial
-     portion of the contents of the database;
-
-  b. if You include all or a substantial portion of the database
-     contents in a database in which You have Sui Generis Database
-     Rights, then the database in which You have Sui Generis Database
-     Rights (but not its individual contents) is Adapted Material; and
-
-  c. You must comply with the conditions in Section 3(a) if You Share
-     all or a substantial portion of the contents of the database.
-
-For the avoidance of doubt, this Section 4 supplements and does not
-replace Your obligations under this Public License where the Licensed
-Rights include other Copyright and Similar Rights.
-
-
-Section 5 -- Disclaimer of Warranties and Limitation of Liability.
-
-  a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
-     EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
-     AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
-     ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
-     IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
-     WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
-     PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
-     ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
-     KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
-     ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
-
-  b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
-     TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
-     NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
-     INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
-     COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
-     USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
-     ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
-     DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
-     IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
-
-  c. The disclaimer of warranties and limitation of liability provided
-     above shall be interpreted in a manner that, to the extent
-     possible, most closely approximates an absolute disclaimer and
-     waiver of all liability.
-
-
-Section 6 -- Term and Termination.
-
-  a. This Public License applies for the term of the Copyright and
-     Similar Rights licensed here. However, if You fail to comply with
-     this Public License, then Your rights under this Public License
-     terminate automatically.
-
-  b. Where Your right to use the Licensed Material has terminated under
-     Section 6(a), it reinstates:
-
-       1. automatically as of the date the violation is cured, provided
-          it is cured within 30 days of Your discovery of the
-          violation; or
-
-       2. upon express reinstatement by the Licensor.
-
-     For the avoidance of doubt, this Section 6(b) does not affect any
-     right the Licensor may have to seek remedies for Your violations
-     of this Public License.
-
-  c. For the avoidance of doubt, the Licensor may also offer the
-     Licensed Material under separate terms or conditions or stop
-     distributing the Licensed Material at any time; however, doing so
-     will not terminate this Public License.
-
-  d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
-     License.
-
-
-Section 7 -- Other Terms and Conditions.
-
-  a. The Licensor shall not be bound by any additional or different
-     terms or conditions communicated by You unless expressly agreed.
-
-  b. Any arrangements, understandings, or agreements regarding the
-     Licensed Material not stated herein are separate from and
-     independent of the terms and conditions of this Public License.
-
-
-Section 8 -- Interpretation.
-
-  a. For the avoidance of doubt, this Public License does not, and
-     shall not be interpreted to, reduce, limit, restrict, or impose
-     conditions on any use of the Licensed Material that could lawfully
-     be made without permission under this Public License.
-
-  b. To the extent possible, if any provision of this Public License is
-     deemed unenforceable, it shall be automatically reformed to the
-     minimum extent necessary to make it enforceable. If the provision
-     cannot be reformed, it shall be severed from this Public License
-     without affecting the enforceability of the remaining terms and
-     conditions.
-
-  c. No term or condition of this Public License will be waived and no
-     failure to comply consented to unless expressly agreed to by the
-     Licensor.
-
-  d. Nothing in this Public License constitutes or may be interpreted
-     as a limitation upon, or waiver of, any privileges and immunities
-     that apply to the Licensor or You, including from the legal
-     processes of any jurisdiction or authority.
-
-
-=======================================================================
-
-Creative Commons is not a party to its public licenses.
-Notwithstanding, Creative Commons may elect to apply one of its public
-licenses to material it publishes and in those instances will be
-considered the "Licensor." Except for the limited purpose of indicating
-that material is shared under a Creative Commons public license or as
-otherwise permitted by the Creative Commons policies published at
-creativecommons.org/policies, Creative Commons does not authorize the
-use of the trademark "Creative Commons" or any other trademark or logo
-of Creative Commons without its prior written consent including,
-without limitation, in connection with any unauthorized modifications
-to any of its public licenses or any other arrangements,
-understandings, or agreements concerning use of licensed material. For
-the avoidance of doubt, this paragraph does not form part of the public
-licenses.
-
-Creative Commons may be contacted at creativecommons.org.
diff --git a/fdmdv2/branches/0.97/contrib/freedv.desktop b/fdmdv2/branches/0.97/contrib/freedv.desktop
deleted file mode 100644 (file)
index 96e8293..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-[Desktop Entry]
-Version=1.0
-Name=FreeDV
-Exec=freedv
-Icon=freedv
-Type=Application
-Terminal=false
-Categories=GTK;GNOME;AudioVideo;Audio;HamRadio;
diff --git a/fdmdv2/branches/0.97/contrib/freedv.ico b/fdmdv2/branches/0.97/contrib/freedv.ico
deleted file mode 100644 (file)
index e6b9a20..0000000
Binary files a/fdmdv2/branches/0.97/contrib/freedv.ico and /dev/null differ
diff --git a/fdmdv2/branches/0.97/contrib/freedv.rc b/fdmdv2/branches/0.97/contrib/freedv.rc
deleted file mode 100644 (file)
index 2e6655d..0000000
+++ /dev/null
@@ -1 +0,0 @@
-id ICON "./freedv.ico"
diff --git a/fdmdv2/branches/0.97/contrib/freedv128x128.png b/fdmdv2/branches/0.97/contrib/freedv128x128.png
deleted file mode 100644 (file)
index 5190a77..0000000
Binary files a/fdmdv2/branches/0.97/contrib/freedv128x128.png and /dev/null differ
diff --git a/fdmdv2/branches/0.97/contrib/freedv256x256.png b/fdmdv2/branches/0.97/contrib/freedv256x256.png
deleted file mode 100644 (file)
index b3eb5d7..0000000
Binary files a/fdmdv2/branches/0.97/contrib/freedv256x256.png and /dev/null differ
diff --git a/fdmdv2/branches/0.97/contrib/freedv48x48.png b/fdmdv2/branches/0.97/contrib/freedv48x48.png
deleted file mode 100644 (file)
index bd5efc6..0000000
Binary files a/fdmdv2/branches/0.97/contrib/freedv48x48.png and /dev/null differ
diff --git a/fdmdv2/branches/0.97/contrib/freedv64x64.png b/fdmdv2/branches/0.97/contrib/freedv64x64.png
deleted file mode 100644 (file)
index eb89773..0000000
Binary files a/fdmdv2/branches/0.97/contrib/freedv64x64.png and /dev/null differ
diff --git a/fdmdv2/branches/0.97/credits.txt b/fdmdv2/branches/0.97/credits.txt
deleted file mode 100644 (file)
index b45038d..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-Credits (code or ideas borrowed from):
-==============================================
-David Rowe(obviously)
-Mel Whitten K0PFX (material and moral support)
-Bruce Perens (cheerleader, promotion and publicity)
-Mooneer Salem KG6AOV(Mac OSX Patch)
-Soeren Straarup OZ2DAK (FreeBSD Port)
-Don Mak
-Steve Nance (K5FR)
-James Ahlstrom (Quisk)
-FLDIGI
-All the folks on the digital voice google group...
diff --git a/fdmdv2/branches/0.97/db/current b/fdmdv2/branches/0.97/db/current
deleted file mode 100644 (file)
index d00491f..0000000
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/fdmdv2/branches/0.97/db/format b/fdmdv2/branches/0.97/db/format
deleted file mode 100644 (file)
index db06890..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-4
-layout sharded 1000
diff --git a/fdmdv2/branches/0.97/db/fs-type b/fdmdv2/branches/0.97/db/fs-type
deleted file mode 100644 (file)
index 4fdd953..0000000
+++ /dev/null
@@ -1 +0,0 @@
-fsfs
diff --git a/fdmdv2/branches/0.97/db/fsfs.conf b/fdmdv2/branches/0.97/db/fsfs.conf
deleted file mode 100644 (file)
index cc08ceb..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-### This file controls the configuration of the FSFS filesystem.\r
-\r
-[memcached-servers]\r
-### These options name memcached servers used to cache internal FSFS\r
-### data.  See http://www.danga.com/memcached/ for more information on\r
-### memcached.  To use memcached with FSFS, run one or more memcached\r
-### servers, and specify each of them as an option like so:\r
-# first-server = 127.0.0.1:11211\r
-# remote-memcached = mymemcached.corp.example.com:11212\r
-### The option name is ignored; the value is of the form HOST:PORT.\r
-### memcached servers can be shared between multiple repositories;\r
-### however, if you do this, you *must* ensure that repositories have\r
-### distinct UUIDs and paths, or else cached data from one repository\r
-### might be used by another accidentally.  Note also that memcached has\r
-### no authentication for reads or writes, so you must ensure that your\r
-### memcached servers are only accessible by trusted users.\r
-\r
-[caches]\r
-### When a cache-related error occurs, normally Subversion ignores it\r
-### and continues, logging an error if the server is appropriately\r
-### configured (and ignoring it with file:// access).  To make\r
-### Subversion never ignore cache errors, uncomment this line.\r
-# fail-stop = true\r
-\r
-[rep-sharing]\r
-### To conserve space, the filesystem can optionally avoid storing\r
-### duplicate representations.  This comes at a slight cost in\r
-### performance, as maintaining a database of shared representations can\r
-### increase commit times.  The space savings are dependent upon the size\r
-### of the repository, the number of objects it contains and the amount of\r
-### duplication between them, usually a function of the branching and\r
-### merging process.\r
-###\r
-### The following parameter enables rep-sharing in the repository.  It can\r
-### be switched on and off at will, but for best space-saving results\r
-### should be enabled consistently over the life of the repository.\r
-### rep-sharing is enabled by default.\r
-# enable-rep-sharing = true\r
diff --git a/fdmdv2/branches/0.97/db/min-unpacked-rev b/fdmdv2/branches/0.97/db/min-unpacked-rev
deleted file mode 100644 (file)
index 573541a..0000000
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/fdmdv2/branches/0.97/db/rep-cache.db b/fdmdv2/branches/0.97/db/rep-cache.db
deleted file mode 100644 (file)
index 63c6f0b..0000000
Binary files a/fdmdv2/branches/0.97/db/rep-cache.db and /dev/null differ
diff --git a/fdmdv2/branches/0.97/db/revprops/0/0 b/fdmdv2/branches/0.97/db/revprops/0/0
deleted file mode 100644 (file)
index d0b90de..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-K 8
-svn:date
-V 27
-2012-08-21T18:27:59.389906Z
-END
diff --git a/fdmdv2/branches/0.97/db/revprops/0/1 b/fdmdv2/branches/0.97/db/revprops/0/1
deleted file mode 100644 (file)
index 0af71a2..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-K 10
-svn:author
-V 9
-OFA-Staff
-K 8
-svn:date
-V 27
-2012-08-21T18:28:08.741468Z
-K 7
-svn:log
-V 25
-Imported folder structure
-END
diff --git a/fdmdv2/branches/0.97/db/revs/0/0 b/fdmdv2/branches/0.97/db/revs/0/0
deleted file mode 100644 (file)
index 10f5c45..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-PLAIN
-END
-ENDREP
-id: 0.0.r0/17
-type: dir
-count: 0
-text: 0 0 4 4 2d2977d1c96f487abe4a1e202dd03b4e
-cpath: /
-
-
-17 107
diff --git a/fdmdv2/branches/0.97/db/revs/0/1 b/fdmdv2/branches/0.97/db/revs/0/1
deleted file mode 100644 (file)
index fd802a9..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-id: 3-1.0.r1/0
-type: dir
-count: 0
-cpath: /tags
-copyroot: 0 /
-
-id: 0-1.0.r1/62
-type: dir
-count: 0
-cpath: /trunk
-copyroot: 0 /
-
-id: 2-1.0.r1/126
-type: dir
-count: 0
-cpath: /branches
-copyroot: 0 /
-
-PLAIN
-K 8
-branches
-V 16
-dir 2-1.0.r1/126
-K 4
-tags
-V 14
-dir 3-1.0.r1/0
-K 5
-trunk
-V 15
-dir 0-1.0.r1/62
-END
-ENDREP
-id: 0.0.r1/306
-type: dir
-pred: 0.0.r0/17
-count: 1
-text: 1 194 99 99 7b6cc14dddba4e09be5255b475d1a0a8
-cpath: /
-copyroot: 0 /
-
-_0.0.t0-0 add-dir false false /trunk
-
-_2.0.t0-0 add-dir false false /branches
-
-_3.0.t0-0 add-dir false false /tags
-
-
-306 431
diff --git a/fdmdv2/branches/0.97/db/transactions/.gitignore b/fdmdv2/branches/0.97/db/transactions/.gitignore
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/fdmdv2/branches/0.97/db/txn-current b/fdmdv2/branches/0.97/db/txn-current
deleted file mode 100644 (file)
index d00491f..0000000
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/fdmdv2/branches/0.97/db/txn-current-lock b/fdmdv2/branches/0.97/db/txn-current-lock
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/fdmdv2/branches/0.97/db/txn-protorevs/.gitignore b/fdmdv2/branches/0.97/db/txn-protorevs/.gitignore
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/fdmdv2/branches/0.97/db/uuid b/fdmdv2/branches/0.97/db/uuid
deleted file mode 100644 (file)
index 0f36297..0000000
+++ /dev/null
@@ -1 +0,0 @@
-a56d66ce-6468-4744-9be7-52ce95ca47a4
diff --git a/fdmdv2/branches/0.97/db/write-lock b/fdmdv2/branches/0.97/db/write-lock
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/fdmdv2/branches/0.97/fdmdv2.project b/fdmdv2/branches/0.97/fdmdv2.project
deleted file mode 100644 (file)
index 1e699eb..0000000
+++ /dev/null
@@ -1,166 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<CodeLite_Project Name="fdmdv2" InternalType="GUI">
-  <Plugins>
-    <Plugin Name="qmake">
-      <![CDATA[00020001N0005Debug0000000000000001N0007Release000000000000]]>
-    </Plugin>
-  </Plugins>
-  <Description/>
-  <Dependencies/>
-  <VirtualDirectory Name="src">
-    <File Name="topFrame.cpp"/>
-    <File Name="dlg_about.cpp"/>
-    <File Name="dlg_audio.cpp"/>
-    <File Name="dlg_options.cpp"/>
-    <File Name="dlg_comports.cpp"/>
-    <File Name="fdmdv2_plot.cpp"/>
-    <File Name="fdmdv2_main.cpp"/>
-    <File Name="paclass.cpp"/>
-  </VirtualDirectory>
-  <VirtualDirectory Name="include">
-    <File Name="topFrame.h"/>
-    <File Name="dlg_about.h"/>
-    <File Name="dlg_audio.h"/>
-    <File Name="dlg_options.h"/>
-    <File Name="dlg_comports.h"/>
-    <File Name="fdmdv2_plot.h"/>
-    <File Name="fdmdv2_main.h"/>
-    <File Name="extern/include/rig.h"/>
-    <File Name="extern/include/rig_dll.h"/>
-    <File Name="extern/include/riglist.h"/>
-    <File Name="extern/include/samplerate.h"/>
-    <VirtualDirectory Name="portaudio_cpp">
-      <File Name="extern/include/portaudiocpp/AsioDeviceAdapter.hxx"/>
-      <File Name="extern/include/portaudiocpp/AutoSystem.hxx"/>
-      <File Name="extern/include/portaudiocpp/BlockingStream.hxx"/>
-      <File Name="extern/include/portaudiocpp/CallbackInterface.hxx"/>
-      <File Name="extern/include/portaudiocpp/CallbackStream.hxx"/>
-      <File Name="extern/include/portaudiocpp/CFunCallbackStream.hxx"/>
-      <File Name="extern/include/portaudiocpp/CppFunCallbackStream.hxx"/>
-      <File Name="extern/include/portaudiocpp/Device.hxx"/>
-      <File Name="extern/include/portaudiocpp/DirectionSpecificStreamParameters.hxx"/>
-      <File Name="extern/include/portaudiocpp/Exception.hxx"/>
-      <File Name="extern/include/portaudiocpp/HostApi.hxx"/>
-      <File Name="extern/include/portaudiocpp/InterfaceCallbackStream.hxx"/>
-      <File Name="extern/include/portaudiocpp/MemFunCallbackStream.hxx"/>
-      <File Name="extern/include/portaudiocpp/PortAudioCpp.hxx"/>
-      <File Name="extern/include/portaudiocpp/SampleDataFormat.hxx"/>
-      <File Name="extern/include/portaudiocpp/Stream.hxx"/>
-      <File Name="extern/include/portaudiocpp/StreamParameters.hxx"/>
-      <File Name="extern/include/portaudiocpp/System.hxx"/>
-      <File Name="extern/include/portaudiocpp/SystemDeviceIterator.hxx"/>
-      <File Name="extern/include/portaudiocpp/SystemHostApiIterator.hxx"/>
-    </VirtualDirectory>
-    <File Name="paclass.h"/>
-    <File Name="../codec2/src/codec2.h"/>
-    <File Name="../codec2/src/fdmdv.h"/>
-  </VirtualDirectory>
-  <VirtualDirectory Name="resources">
-    <File Name="FDMDV2.fbp"/>
-  </VirtualDirectory>
-  <Dependencies Name="Debug"/>
-  <Dependencies Name="Release"/>
-  <Settings Type="Executable">
-    <GlobalSettings>
-      <Compiler Options="" C_Options="">
-        <IncludePath Value="."/>
-      </Compiler>
-      <Linker Options="">
-        <LibraryPath Value="."/>
-      </Linker>
-      <ResourceCompiler Options=""/>
-    </GlobalSettings>
-    <Configuration Name="Debug" CompilerType="gnu g++" DebuggerType="GNU gdb debugger" Type="Executable" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append">
-      <Compiler Options="-g;-O0;-Wall;$(shell wx-config --cxxflags --unicode=yes --debug=yes)" C_Options="-g;-O0;-Wall;$(shell wx-config --cxxflags --unicode=yes --debug=yes)" Required="yes" PreCompiledHeader="" PCHInCommandLine="no" UseDifferentPCHFlags="no" PCHFlags="">
-        <IncludePath Value="/bin/MinGW/msys/1.0/local/include"/>
-        <IncludePath Value="../codec2/src"/>
-        <Preprocessor Value="__WX__"/>
-      </Compiler>
-      <Linker Options="-mwindows;$(shell wx-config --debug=yes --libs --unicode=yes)" Required="yes">
-        <LibraryPath Value="./libsndfile/bin"/>
-        <LibraryPath Value="./extern/lib"/>
-        <Library Value="libsndfile-1.dll"/>
-        <Library Value="libcodec2.a"/>
-        <Library Value="libportaudio.a"/>
-        <Library Value="libportaudiocpp.a"/>
-      </Linker>
-      <ResourceCompiler Options="$(shell wx-config --rcflags)" Required="no"/>
-      <General OutputFile="$(IntermediateDirectory)/$(ProjectName)" IntermediateDirectory="./Debug" Command="./$(ProjectName)" CommandArguments="" UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="yes"/>
-      <Environment EnvVarSetName="&lt;Use Defaults&gt;" DbgSetName="&lt;Use Defaults&gt;">
-        <![CDATA[]]>
-      </Environment>
-      <Debugger IsRemote="no" RemoteHostName="" RemoteHostPort="" DebuggerPath="">
-        <PostConnectCommands/>
-        <StartupCommands/>
-      </Debugger>
-      <PreBuild/>
-      <PostBuild/>
-      <CustomBuild Enabled="no">
-        <RebuildCommand/>
-        <CleanCommand/>
-        <BuildCommand/>
-        <PreprocessFileCommand/>
-        <SingleFileCommand/>
-        <MakefileGenerationCommand/>
-        <ThirdPartyToolName>None</ThirdPartyToolName>
-        <WorkingDirectory/>
-      </CustomBuild>
-      <AdditionalRules>
-        <CustomPostBuild/>
-        <CustomPreBuild/>
-      </AdditionalRules>
-      <Completion EnableCpp11="no">
-        <ClangCmpFlags/>
-        <ClangPP/>
-        <SearchPaths/>
-      </Completion>
-    </Configuration>
-    <Configuration Name="Release" CompilerType="gnu g++" DebuggerType="GNU gdb debugger" Type="Executable" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append">
-      <Compiler Options="-O2;-Wall;$(shell wx-config --cxxflags --unicode=yes --debug=no)" C_Options="-O2;-Wall;$(shell wx-config --cxxflags --unicode=yes --debug=no)" Required="yes" PreCompiledHeader="" PCHInCommandLine="no" UseDifferentPCHFlags="no" PCHFlags="">
-        <IncludePath Value="/bin/MinGW/msys/1.0/local/include"/>
-        <IncludePath Value="../codec2/src"/>
-        <IncludePath Value="../../Audio/portaudio/include"/>
-        <IncludePath Value="../../Audio/portaudio/bindings/cpp/include"/>
-        <IncludePath Value="./libsndfile/include"/>
-        <Preprocessor Value="__WX__"/>
-      </Compiler>
-      <Linker Options="-mwindows;-s;$(shell wx-config --debug=no --libs --unicode=yes)" Required="yes">
-        <LibraryPath Value="/bin/MinGW/msys/1.0/local/lib"/>
-        <Library Value="libsndfile-1.dll"/>
-        <Library Value="libcodec2.a"/>
-        <Library Value="libportaudio.a"/>
-        <Library Value="libportaudiocpp.a"/>
-      </Linker>
-      <ResourceCompiler Options="$(shell wx-config --rcflags)" Required="no"/>
-      <General OutputFile="$(IntermediateDirectory)/$(ProjectName)" IntermediateDirectory="./Release" Command="./$(ProjectName)" CommandArguments="" UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="no"/>
-      <Environment EnvVarSetName="&lt;Use Defaults&gt;" DbgSetName="&lt;Use Defaults&gt;">
-        <![CDATA[]]>
-      </Environment>
-      <Debugger IsRemote="no" RemoteHostName="" RemoteHostPort="" DebuggerPath="">
-        <PostConnectCommands/>
-        <StartupCommands/>
-      </Debugger>
-      <PreBuild/>
-      <PostBuild/>
-      <CustomBuild Enabled="no">
-        <RebuildCommand/>
-        <CleanCommand/>
-        <BuildCommand/>
-        <PreprocessFileCommand/>
-        <SingleFileCommand/>
-        <MakefileGenerationCommand/>
-        <ThirdPartyToolName>None</ThirdPartyToolName>
-        <WorkingDirectory/>
-      </CustomBuild>
-      <AdditionalRules>
-        <CustomPostBuild/>
-        <CustomPreBuild/>
-      </AdditionalRules>
-      <Completion EnableCpp11="no">
-        <ClangCmpFlags/>
-        <ClangPP/>
-        <SearchPaths/>
-      </Completion>
-    </Configuration>
-  </Settings>
-</CodeLite_Project>
diff --git a/fdmdv2/branches/0.97/format b/fdmdv2/branches/0.97/format
deleted file mode 100644 (file)
index 7ed6ff8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-5
diff --git a/fdmdv2/branches/0.97/hooks/post-commit.tmpl b/fdmdv2/branches/0.97/hooks/post-commit.tmpl
deleted file mode 100644 (file)
index 4b70357..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/bin/sh\r
-\r
-# POST-COMMIT HOOK\r
-#\r
-# The post-commit hook is invoked after a commit.  Subversion runs\r
-# this hook by invoking a program (script, executable, binary, etc.)\r
-# named 'post-commit' (for which this file is a template) with the \r
-# following ordered arguments:\r
-#\r
-#   [1] REPOS-PATH   (the path to this repository)\r
-#   [2] REV          (the number of the revision just committed)\r
-#\r
-# The default working directory for the invocation is undefined, so\r
-# the program should set one explicitly if it cares.\r
-#\r
-# Because the commit has already completed and cannot be undone,\r
-# the exit code of the hook program is ignored.  The hook program\r
-# can use the 'svnlook' utility to help it examine the\r
-# newly-committed tree.\r
-#\r
-# On a Unix system, the normal procedure is to have 'post-commit'\r
-# invoke other programs to do the real work, though it may do the\r
-# work itself too.\r
-#\r
-# Note that 'post-commit' must be executable by the user(s) who will\r
-# invoke it (typically the user httpd runs as), and that user must\r
-# have filesystem-level permission to access the repository.\r
-#\r
-# On a Windows system, you should name the hook program\r
-# 'post-commit.bat' or 'post-commit.exe',\r
-# but the basic idea is the same.\r
-# \r
-# The hook program typically does not inherit the environment of\r
-# its parent process.  For example, a common problem is for the\r
-# PATH environment variable to not be set to its usual value, so\r
-# that subprograms fail to launch unless invoked via absolute path.\r
-# If you're having unexpected problems with a hook program, the\r
-# culprit may be unusual (or missing) environment variables.\r
-# \r
-# Here is an example hook script, for a Unix /bin/sh interpreter.\r
-# For more examples and pre-written hooks, see those in\r
-# the Subversion repository at\r
-# http://svn.apache.org/repos/asf/subversion/trunk/tools/hook-scripts/ and\r
-# http://svn.apache.org/repos/asf/subversion/trunk/contrib/hook-scripts/\r
-\r
-\r
-REPOS="$1"\r
-REV="$2"\r
-\r
-mailer.py commit "$REPOS" "$REV" /path/to/mailer.conf\r
diff --git a/fdmdv2/branches/0.97/hooks/post-lock.tmpl b/fdmdv2/branches/0.97/hooks/post-lock.tmpl
deleted file mode 100644 (file)
index 65a7d40..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/bin/sh\r
-\r
-# POST-LOCK HOOK\r
-#\r
-# The post-lock hook is run after a path is locked.  Subversion runs\r
-# this hook by invoking a program (script, executable, binary, etc.)\r
-# named 'post-lock' (for which this file is a template) with the \r
-# following ordered arguments:\r
-#\r
-#   [1] REPOS-PATH   (the path to this repository)\r
-#   [2] USER         (the user who created the lock)\r
-#\r
-# The paths that were just locked are passed to the hook via STDIN (as\r
-# of Subversion 1.2, only one path is passed per invocation, but the\r
-# plan is to pass all locked paths at once, so the hook program\r
-# should be written accordingly).\r
-#\r
-# The default working directory for the invocation is undefined, so\r
-# the program should set one explicitly if it cares.\r
-#\r
-# Because the lock has already been created and cannot be undone,\r
-# the exit code of the hook program is ignored.  The hook program\r
-# can use the 'svnlook' utility to help it examine the\r
-# newly-created lock.\r
-#\r
-# On a Unix system, the normal procedure is to have 'post-lock'\r
-# invoke other programs to do the real work, though it may do the\r
-# work itself too.\r
-#\r
-# Note that 'post-lock' must be executable by the user(s) who will\r
-# invoke it (typically the user httpd runs as), and that user must\r
-# have filesystem-level permission to access the repository.\r
-#\r
-# On a Windows system, you should name the hook program\r
-# 'post-lock.bat' or 'post-lock.exe',\r
-# but the basic idea is the same.\r
-# \r
-# Here is an example hook script, for a Unix /bin/sh interpreter:\r
-\r
-REPOS="$1"\r
-USER="$2"\r
-\r
-# Send email to interested parties, let them know a lock was created:\r
-mailer.py lock "$REPOS" "$USER" /path/to/mailer.conf\r
diff --git a/fdmdv2/branches/0.97/hooks/post-revprop-change.tmpl b/fdmdv2/branches/0.97/hooks/post-revprop-change.tmpl
deleted file mode 100644 (file)
index be2b54a..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/bin/sh\r
-\r
-# POST-REVPROP-CHANGE HOOK\r
-#\r
-# The post-revprop-change hook is invoked after a revision property\r
-# has been added, modified or deleted.  Subversion runs this hook by\r
-# invoking a program (script, executable, binary, etc.) named\r
-# 'post-revprop-change' (for which this file is a template), with the\r
-# following ordered arguments:\r
-#\r
-#   [1] REPOS-PATH   (the path to this repository)\r
-#   [2] REV          (the revision that was tweaked)\r
-#   [3] USER         (the username of the person tweaking the property)\r
-#   [4] PROPNAME     (the property that was changed)\r
-#   [5] ACTION       (the property was 'A'dded, 'M'odified, or 'D'eleted)\r
-#\r
-#   [STDIN] PROPVAL  ** the old property value is passed via STDIN.\r
-#\r
-# Because the propchange has already completed and cannot be undone,\r
-# the exit code of the hook program is ignored.  The hook program\r
-# can use the 'svnlook' utility to help it examine the\r
-# new property value.\r
-#\r
-# On a Unix system, the normal procedure is to have 'post-revprop-change'\r
-# invoke other programs to do the real work, though it may do the\r
-# work itself too.\r
-#\r
-# Note that 'post-revprop-change' must be executable by the user(s) who will\r
-# invoke it (typically the user httpd runs as), and that user must\r
-# have filesystem-level permission to access the repository.\r
-#\r
-# On a Windows system, you should name the hook program\r
-# 'post-revprop-change.bat' or 'post-revprop-change.exe',\r
-# but the basic idea is the same.\r
-# \r
-# The hook program typically does not inherit the environment of\r
-# its parent process.  For example, a common problem is for the\r
-# PATH environment variable to not be set to its usual value, so\r
-# that subprograms fail to launch unless invoked via absolute path.\r
-# If you're having unexpected problems with a hook program, the\r
-# culprit may be unusual (or missing) environment variables.\r
-# \r
-# Here is an example hook script, for a Unix /bin/sh interpreter.\r
-# For more examples and pre-written hooks, see those in\r
-# the Subversion repository at\r
-# http://svn.apache.org/repos/asf/subversion/trunk/tools/hook-scripts/ and\r
-# http://svn.apache.org/repos/asf/subversion/trunk/contrib/hook-scripts/\r
-\r
-\r
-REPOS="$1"\r
-REV="$2"\r
-USER="$3"\r
-PROPNAME="$4"\r
-ACTION="$5"\r
-\r
-mailer.py propchange2 "$REPOS" "$REV" "$USER" "$PROPNAME" "$ACTION" /path/to/mailer.conf\r
diff --git a/fdmdv2/branches/0.97/hooks/post-unlock.tmpl b/fdmdv2/branches/0.97/hooks/post-unlock.tmpl
deleted file mode 100644 (file)
index 5821be8..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/bin/sh\r
-\r
-# POST-UNLOCK HOOK\r
-#\r
-# The post-unlock hook runs after a path is unlocked.  Subversion runs\r
-# this hook by invoking a program (script, executable, binary, etc.)\r
-# named 'post-unlock' (for which this file is a template) with the \r
-# following ordered arguments:\r
-#\r
-#   [1] REPOS-PATH   (the path to this repository)\r
-#   [2] USER         (the user who destroyed the lock)\r
-#\r
-# The paths that were just unlocked are passed to the hook via STDIN\r
-# (as of Subversion 1.2, only one path is passed per invocation, but\r
-# the plan is to pass all unlocked paths at once, so the hook program\r
-# should be written accordingly).\r
-#\r
-# The default working directory for the invocation is undefined, so\r
-# the program should set one explicitly if it cares.\r
-#\r
-# Because the lock has already been destroyed and cannot be undone,\r
-# the exit code of the hook program is ignored.\r
-#\r
-# On a Unix system, the normal procedure is to have 'post-unlock'\r
-# invoke other programs to do the real work, though it may do the\r
-# work itself too.\r
-#\r
-# Note that 'post-unlock' must be executable by the user(s) who will\r
-# invoke it (typically the user httpd runs as), and that user must\r
-# have filesystem-level permission to access the repository.\r
-#\r
-# On a Windows system, you should name the hook program\r
-# 'post-unlock.bat' or 'post-unlock.exe',\r
-# but the basic idea is the same.\r
-# \r
-# Here is an example hook script, for a Unix /bin/sh interpreter:\r
-\r
-REPOS="$1"\r
-USER="$2"\r
-\r
-# Send email to interested parties, let them know a lock was removed:\r
-mailer.py unlock "$REPOS" "$USER" /path/to/mailer.conf\r
diff --git a/fdmdv2/branches/0.97/hooks/pre-commit.tmpl b/fdmdv2/branches/0.97/hooks/pre-commit.tmpl
deleted file mode 100644 (file)
index 776968d..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-#!/bin/sh\r
-\r
-# PRE-COMMIT HOOK\r
-#\r
-# The pre-commit hook is invoked before a Subversion txn is\r
-# committed.  Subversion runs this hook by invoking a program\r
-# (script, executable, binary, etc.) named 'pre-commit' (for which\r
-# this file is a template), with the following ordered arguments:\r
-#\r
-#   [1] REPOS-PATH   (the path to this repository)\r
-#   [2] TXN-NAME     (the name of the txn about to be committed)\r
-#\r
-#   [STDIN] LOCK-TOKENS ** the lock tokens are passed via STDIN.\r
-#\r
-#   If STDIN contains the line "LOCK-TOKENS:\n" (the "\n" denotes a\r
-#   single newline), the lines following it are the lock tokens for\r
-#   this commit.  The end of the list is marked by a line containing\r
-#   only a newline character.\r
-#\r
-#   Each lock token line consists of a URI-escaped path, followed\r
-#   by the separator character '|', followed by the lock token string,\r
-#   followed by a newline.\r
-#\r
-# The default working directory for the invocation is undefined, so\r
-# the program should set one explicitly if it cares.\r
-#\r
-# If the hook program exits with success, the txn is committed; but\r
-# if it exits with failure (non-zero), the txn is aborted, no commit\r
-# takes place, and STDERR is returned to the client.   The hook\r
-# program can use the 'svnlook' utility to help it examine the txn.\r
-#\r
-# On a Unix system, the normal procedure is to have 'pre-commit'\r
-# invoke other programs to do the real work, though it may do the\r
-# work itself too.\r
-#\r
-#   ***  NOTE: THE HOOK PROGRAM MUST NOT MODIFY THE TXN, EXCEPT  ***\r
-#   ***  FOR REVISION PROPERTIES (like svn:log or svn:author).   ***\r
-#\r
-#   This is why we recommend using the read-only 'svnlook' utility.\r
-#   In the future, Subversion may enforce the rule that pre-commit\r
-#   hooks should not modify the versioned data in txns, or else come\r
-#   up with a mechanism to make it safe to do so (by informing the\r
-#   committing client of the changes).  However, right now neither\r
-#   mechanism is implemented, so hook writers just have to be careful.\r
-#\r
-# Note that 'pre-commit' must be executable by the user(s) who will\r
-# invoke it (typically the user httpd runs as), and that user must\r
-# have filesystem-level permission to access the repository.\r
-#\r
-# On a Windows system, you should name the hook program\r
-# 'pre-commit.bat' or 'pre-commit.exe',\r
-# but the basic idea is the same.\r
-#\r
-# The hook program typically does not inherit the environment of\r
-# its parent process.  For example, a common problem is for the\r
-# PATH environment variable to not be set to its usual value, so\r
-# that subprograms fail to launch unless invoked via absolute path.\r
-# If you're having unexpected problems with a hook program, the\r
-# culprit may be unusual (or missing) environment variables.\r
-# \r
-# Here is an example hook script, for a Unix /bin/sh interpreter.\r
-# For more examples and pre-written hooks, see those in\r
-# the Subversion repository at\r
-# http://svn.apache.org/repos/asf/subversion/trunk/tools/hook-scripts/ and\r
-# http://svn.apache.org/repos/asf/subversion/trunk/contrib/hook-scripts/\r
-\r
-\r
-REPOS="$1"\r
-TXN="$2"\r
-\r
-# Make sure that the log message contains some text.\r
-SVNLOOK=/usr/local/bin/svnlook\r
-$SVNLOOK log -t "$TXN" "$REPOS" | \\r
-   grep "[a-zA-Z0-9]" > /dev/null || exit 1\r
-\r
-# Check that the author of this commit has the rights to perform\r
-# the commit on the files and directories being modified.\r
-commit-access-control.pl "$REPOS" "$TXN" commit-access-control.cfg || exit 1\r
-\r
-# All checks passed, so allow the commit.\r
-exit 0\r
diff --git a/fdmdv2/branches/0.97/hooks/pre-lock.tmpl b/fdmdv2/branches/0.97/hooks/pre-lock.tmpl
deleted file mode 100644 (file)
index 8ced86c..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-#!/bin/sh\r
-\r
-# PRE-LOCK HOOK\r
-#\r
-# The pre-lock hook is invoked before an exclusive lock is\r
-# created.  Subversion runs this hook by invoking a program \r
-# (script, executable, binary, etc.) named 'pre-lock' (for which\r
-# this file is a template), with the following ordered arguments:\r
-#\r
-#   [1] REPOS-PATH   (the path to this repository)\r
-#   [2] PATH         (the path in the repository about to be locked)\r
-#   [3] USER         (the user creating the lock)\r
-#   [4] COMMENT      (the comment of the lock)\r
-#   [5] STEAL-LOCK   (1 if the user is trying to steal the lock, else 0)\r
-#\r
-# If the hook program outputs anything on stdout, the output string will\r
-# be used as the lock token for this lock operation.  If you choose to use\r
-# this feature, you must guarantee the tokens generated are unique across\r
-# the repository each time.\r
-#\r
-# The default working directory for the invocation is undefined, so\r
-# the program should set one explicitly if it cares.\r
-#\r
-# If the hook program exits with success, the lock is created; but\r
-# if it exits with failure (non-zero), the lock action is aborted\r
-# and STDERR is returned to the client.\r
-\r
-# On a Unix system, the normal procedure is to have 'pre-lock'\r
-# invoke other programs to do the real work, though it may do the\r
-# work itself too.\r
-#\r
-# Note that 'pre-lock' must be executable by the user(s) who will\r
-# invoke it (typically the user httpd runs as), and that user must\r
-# have filesystem-level permission to access the repository.\r
-#\r
-# On a Windows system, you should name the hook program\r
-# 'pre-lock.bat' or 'pre-lock.exe',\r
-# but the basic idea is the same.\r
-#\r
-# Here is an example hook script, for a Unix /bin/sh interpreter:\r
-\r
-REPOS="$1"\r
-PATH="$2"\r
-USER="$3"\r
-COMMENT="$4"\r
-STEAL="$5"\r
-\r
-# If a lock exists and is owned by a different person, don't allow it\r
-# to be stolen (e.g., with 'svn lock --force ...').\r
-\r
-# (Maybe this script could send email to the lock owner?)\r
-SVNLOOK=/usr/local/bin/svnlook\r
-GREP=/bin/grep\r
-SED=/bin/sed\r
-\r
-LOCK_OWNER=`$SVNLOOK lock "$REPOS" "$PATH" | \\r
-            $GREP '^Owner: ' | $SED 's/Owner: //'`\r
-\r
-# If we get no result from svnlook, there's no lock, allow the lock to\r
-# happen:\r
-if [ "$LOCK_OWNER" = "" ]; then\r
-  exit 0\r
-fi\r
-\r
-# If the person locking matches the lock's owner, allow the lock to\r
-# happen:\r
-if [ "$LOCK_OWNER" = "$USER" ]; then\r
-  exit 0\r
-fi\r
-\r
-# Otherwise, we've got an owner mismatch, so return failure:\r
-echo "Error: $PATH already locked by ${LOCK_OWNER}." 1>&2\r
-exit 1\r
diff --git a/fdmdv2/branches/0.97/hooks/pre-revprop-change.tmpl b/fdmdv2/branches/0.97/hooks/pre-revprop-change.tmpl
deleted file mode 100644 (file)
index 9aa7c95..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/bin/sh\r
-\r
-# PRE-REVPROP-CHANGE HOOK\r
-#\r
-# The pre-revprop-change hook is invoked before a revision property\r
-# is added, modified or deleted.  Subversion runs this hook by invoking\r
-# a program (script, executable, binary, etc.) named 'pre-revprop-change'\r
-# (for which this file is a template), with the following ordered\r
-# arguments:\r
-#\r
-#   [1] REPOS-PATH   (the path to this repository)\r
-#   [2] REV          (the revision being tweaked)\r
-#   [3] USER         (the username of the person tweaking the property)\r
-#   [4] PROPNAME     (the property being set on the revision)\r
-#   [5] ACTION       (the property is being 'A'dded, 'M'odified, or 'D'eleted)\r
-#\r
-#   [STDIN] PROPVAL  ** the new property value is passed via STDIN.\r
-#\r
-# If the hook program exits with success, the propchange happens; but\r
-# if it exits with failure (non-zero), the propchange doesn't happen.\r
-# The hook program can use the 'svnlook' utility to examine the \r
-# existing value of the revision property.\r
-#\r
-# WARNING: unlike other hooks, this hook MUST exist for revision\r
-# properties to be changed.  If the hook does not exist, Subversion \r
-# will behave as if the hook were present, but failed.  The reason\r
-# for this is that revision properties are UNVERSIONED, meaning that\r
-# a successful propchange is destructive;  the old value is gone\r
-# forever.  We recommend the hook back up the old value somewhere.\r
-#\r
-# On a Unix system, the normal procedure is to have 'pre-revprop-change'\r
-# invoke other programs to do the real work, though it may do the\r
-# work itself too.\r
-#\r
-# Note that 'pre-revprop-change' must be executable by the user(s) who will\r
-# invoke it (typically the user httpd runs as), and that user must\r
-# have filesystem-level permission to access the repository.\r
-#\r
-# On a Windows system, you should name the hook program\r
-# 'pre-revprop-change.bat' or 'pre-revprop-change.exe',\r
-# but the basic idea is the same.\r
-#\r
-# The hook program typically does not inherit the environment of\r
-# its parent process.  For example, a common problem is for the\r
-# PATH environment variable to not be set to its usual value, so\r
-# that subprograms fail to launch unless invoked via absolute path.\r
-# If you're having unexpected problems with a hook program, the\r
-# culprit may be unusual (or missing) environment variables.\r
-# \r
-# Here is an example hook script, for a Unix /bin/sh interpreter.\r
-# For more examples and pre-written hooks, see those in\r
-# the Subversion repository at\r
-# http://svn.apache.org/repos/asf/subversion/trunk/tools/hook-scripts/ and\r
-# http://svn.apache.org/repos/asf/subversion/trunk/contrib/hook-scripts/\r
-\r
-\r
-REPOS="$1"\r
-REV="$2"\r
-USER="$3"\r
-PROPNAME="$4"\r
-ACTION="$5"\r
-\r
-if [ "$ACTION" = "M" -a "$PROPNAME" = "svn:log" ]; then exit 0; fi\r
-\r
-echo "Changing revision properties other than svn:log is prohibited" >&2\r
-exit 1\r
diff --git a/fdmdv2/branches/0.97/hooks/pre-unlock.tmpl b/fdmdv2/branches/0.97/hooks/pre-unlock.tmpl
deleted file mode 100644 (file)
index 8617b22..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-#!/bin/sh\r
-\r
-# PRE-UNLOCK HOOK\r
-#\r
-# The pre-unlock hook is invoked before an exclusive lock is\r
-# destroyed.  Subversion runs this hook by invoking a program \r
-# (script, executable, binary, etc.) named 'pre-unlock' (for which\r
-# this file is a template), with the following ordered arguments:\r
-#\r
-#   [1] REPOS-PATH   (the path to this repository)\r
-#   [2] PATH         (the path in the repository about to be unlocked)\r
-#   [3] USER         (the user destroying the lock)\r
-#   [4] TOKEN        (the lock token to be destroyed)\r
-#   [5] BREAK-UNLOCK (1 if the user is breaking the lock, else 0)\r
-#\r
-# The default working directory for the invocation is undefined, so\r
-# the program should set one explicitly if it cares.\r
-#\r
-# If the hook program exits with success, the lock is destroyed; but\r
-# if it exits with failure (non-zero), the unlock action is aborted\r
-# and STDERR is returned to the client.\r
-\r
-# On a Unix system, the normal procedure is to have 'pre-unlock'\r
-# invoke other programs to do the real work, though it may do the\r
-# work itself too.\r
-#\r
-# Note that 'pre-unlock' must be executable by the user(s) who will\r
-# invoke it (typically the user httpd runs as), and that user must\r
-# have filesystem-level permission to access the repository.\r
-#\r
-# On a Windows system, you should name the hook program\r
-# 'pre-unlock.bat' or 'pre-unlock.exe',\r
-# but the basic idea is the same.\r
-#\r
-# Here is an example hook script, for a Unix /bin/sh interpreter:\r
-\r
-REPOS="$1"\r
-PATH="$2"\r
-USER="$3"\r
-TOKEN="$4"\r
-BREAK="$5"\r
-\r
-# If a lock is owned by a different person, don't allow it be broken.\r
-# (Maybe this script could send email to the lock owner?)\r
-\r
-SVNLOOK=/usr/local/bin/svnlook\r
-GREP=/bin/grep\r
-SED=/bin/sed\r
-\r
-LOCK_OWNER=`$SVNLOOK lock "$REPOS" "$PATH" | \\r
-            $GREP '^Owner: ' | $SED 's/Owner: //'`\r
-\r
-# If we get no result from svnlook, there's no lock, return success:\r
-if [ "$LOCK_OWNER" = "" ]; then\r
-  exit 0\r
-fi\r
-\r
-# If the person unlocking matches the lock's owner, return success:\r
-if [ "$LOCK_OWNER" = "$USER" ]; then\r
-  exit 0\r
-fi\r
-\r
-# Otherwise, we've got an owner mismatch, so return failure:\r
-echo "Error: $PATH locked by ${LOCK_OWNER}." 1>&2\r
-exit 1\r
diff --git a/fdmdv2/branches/0.97/hooks/start-commit.tmpl b/fdmdv2/branches/0.97/hooks/start-commit.tmpl
deleted file mode 100644 (file)
index 7df182e..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-#!/bin/sh\r
-\r
-# START-COMMIT HOOK\r
-#\r
-# The start-commit hook is invoked before a Subversion txn is created\r
-# in the process of doing a commit.  Subversion runs this hook\r
-# by invoking a program (script, executable, binary, etc.) named\r
-# 'start-commit' (for which this file is a template)\r
-# with the following ordered arguments:\r
-#\r
-#   [1] REPOS-PATH   (the path to this repository)\r
-#   [2] USER         (the authenticated user attempting to commit)\r
-#   [3] CAPABILITIES (a colon-separated list of capabilities reported\r
-#                     by the client; see note below)\r
-#\r
-# Note: The CAPABILITIES parameter is new in Subversion 1.5, and 1.5\r
-# clients will typically report at least the "mergeinfo" capability.\r
-# If there are other capabilities, then the list is colon-separated,\r
-# e.g.: "mergeinfo:some-other-capability" (the order is undefined).\r
-#\r
-# The list is self-reported by the client.  Therefore, you should not\r
-# make security assumptions based on the capabilities list, nor should\r
-# you assume that clients reliably report every capability they have.\r
-#\r
-# The working directory for this hook program's invocation is undefined,\r
-# so the program should set one explicitly if it cares.\r
-#\r
-# If the hook program exits with success, the commit continues; but\r
-# if it exits with failure (non-zero), the commit is stopped before\r
-# a Subversion txn is created, and STDERR is returned to the client.\r
-#\r
-# On a Unix system, the normal procedure is to have 'start-commit'\r
-# invoke other programs to do the real work, though it may do the\r
-# work itself too.\r
-#\r
-# Note that 'start-commit' must be executable by the user(s) who will\r
-# invoke it (typically the user httpd runs as), and that user must\r
-# have filesystem-level permission to access the repository.\r
-#\r
-# On a Windows system, you should name the hook program\r
-# 'start-commit.bat' or 'start-commit.exe',\r
-# but the basic idea is the same.\r
-# \r
-# The hook program typically does not inherit the environment of\r
-# its parent process.  For example, a common problem is for the\r
-# PATH environment variable to not be set to its usual value, so\r
-# that subprograms fail to launch unless invoked via absolute path.\r
-# If you're having unexpected problems with a hook program, the\r
-# culprit may be unusual (or missing) environment variables.\r
-# \r
-# Here is an example hook script, for a Unix /bin/sh interpreter.\r
-# For more examples and pre-written hooks, see those in\r
-# the Subversion repository at\r
-# http://svn.apache.org/repos/asf/subversion/trunk/tools/hook-scripts/ and\r
-# http://svn.apache.org/repos/asf/subversion/trunk/contrib/hook-scripts/\r
-\r
-\r
-REPOS="$1"\r
-USER="$2"\r
-\r
-commit-allower.pl --repository "$REPOS" --user "$USER" || exit 1\r
-special-auth-check.py --user "$USER" --auth-level 3 || exit 1\r
-\r
-# All checks passed, so allow the commit.\r
-exit 0\r
diff --git a/fdmdv2/branches/0.97/locks/db-logs.lock b/fdmdv2/branches/0.97/locks/db-logs.lock
deleted file mode 100644 (file)
index 536ac36..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-This file is not used by Subversion 1.3.x or later.\r
-However, its existence is required for compatibility with\r
-Subversion 1.2.x or earlier.\r
diff --git a/fdmdv2/branches/0.97/locks/db.lock b/fdmdv2/branches/0.97/locks/db.lock
deleted file mode 100644 (file)
index 536ac36..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-This file is not used by Subversion 1.3.x or later.\r
-However, its existence is required for compatibility with\r
-Subversion 1.2.x or earlier.\r
diff --git a/fdmdv2/branches/0.97/notes/FDMDV_build_notes.txt b/fdmdv2/branches/0.97/notes/FDMDV_build_notes.txt
deleted file mode 100644 (file)
index 1c936f6..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-# ===========================================================\r
-# Build notes for portaudio\r
-# ===========================================================\r
-\r
-For building FDMDV2:\r
-using PortAudio November 21, 2011, SVN rev 1788 \r
-On Windows\r
-Built with MinGW/MSYS.\r
-\r
-Ignore this bit for now:  \r
-# ===========================================================\r
-# Config commandline:\r
-# ./configure --enable-cxx --with-winapi=directx  --with-dxdir="/p/Radio/fdmdv2/extern"\r
-# \r
-# I configured my "C:/Users/wittend/Projects/dx7sdk" to appear as /p in the MSys \r
-# environment.  This required editing the MSys /etc/fstab file (actually in my \r
-# C:\bin\MinGW\msys\1.0\etc folder) to contain: \r
-# \r
-# C:/bin/MinGW/   /mingw\r
-# C:/Users/wittend/Projects    /p\r
-# \r
-# Also, MSys does not seem to like paths like:\r
-# "C:\Program Files\Microsoft DirectX SDK (August 2010)\" \r
-# so I had to move it to my "C:/Users/wittend/Projects/dx7sdk".\r
-# ===========================================================\r
-\r
-Finally gave up on Dsound for now. Used this instead:\r
-\r
-./configure --enable-cxx\r
-\r
-configure output:\r
-\r
-Configuration summary:\r
-\r
-  Target ...................... i686-pc-mingw32\r
-  C++ bindings ................ yes\r
-  Debug output ................ no\r
-\r
-  WMME ........................ yes\r
-  DSound ...................... no\r
-  ASIO ........................ no\r
-  WASAPI ...................... no\r
-  WDMKS ....................... no\r
-\r
-#---------------------------------------------------------------------------------------------------------  \r
-Here is some info from the portaudio Wiki about building with Microsoft compilers that may be helpful:\r
-# -----------------------------------------------------------\r
-6) Select "all configurations" in the "Configurations" combo box above. Select "All Platforms" in the "Platforms" combo box.\r
-7) Now set a few options:\r
-\r
-C/C++ -> Optimization -> Omit frame pointers = Yes\r
-C/C++ -> Code Generation -> Runtime library = /MT\r
-Optional: C/C++ -> Code Generation -> Floating point model = fast\r
-\r
-NOTE: For most users it is not necessary to explicitly set the structure member alignment; the default should work fine. \r
-However some languages require, for example, 4-byte alignment. If you are having problems with portaudio.h structure \r
-members not being properly read or written to, it may be necessary to explicitly set this value by going to \r
-C/C++ -> Code Generation -> Struct member alignment and setting it to an appropriate value (four is a common value). \r
-If your compiler is configurable, you should ensure that it is set to use the same structure member alignment value \r
-as used for the PortAudio build.\r
-\r
-Preprocessor Definitions:\r
-# -----------------------------------------------------------\r
-Since the preprocessor definitions are different for each configuration and platform, you'll need to edit these \r
-individually for each configuration/platform combination that you want to modify using the "Configurations" and \r
-"Platforms" combo boxes.\r
-\r
-8) To suppress PortAudio runtime debug console output, go to Project -> Properties -> Configuration Properties\r
- -> C/C++ -> Preprocessor. In the field 'Preprocessor Definitions', find PA_ENABLE_DEBUG_OUTPUT and remove it. \r
-The console will not output debug messages.\r
-9) Also in the preprocessor definitions you need to explicitly define the audio APIs you wish to use. For \r
-Windows the available API definitions are:\r
-\r
-PA_USE_ASIO[[BR]] PA_USE_DS (DirectSound)[[BR]] PA_USE_WMME (MME)[[BR]] PA_USE_WASAPI[[BR]] PA_USE_WDMKS[[BR]] PA_USE_SKELETON\r
-For each of these, the value of 0 indicates that support for this API should not be included. The value 1 indicates \r
-that support for this API should be included.\r
-\r
-Building:\r
-# -----------------------------------------------------------\r
-As when setting Preprocessor definitions, building is a per-configuration per-platform process. Follow these \r
-instructions for each configuration/platform combination that you're interested in.\r
-10) From the Build menu click Build -> Build solution. For 32-bit compilations, the dll file created by this \r
-process (portaudio_x86.dll) can be found in the directory build\msvc\Win32\Release. For 64-bit compilations, \r
-the dll file is called portaudio_x64.dll, and is found in the directory build\msvc\x64\Release.\r
-11) Now, any project which requires portaudio can be linked with portaudio_x86.lib (or _x64) and include the\r
-relevant headers (portaudio.h, and/or pa_asio.h , pa_x86_plain_converters.h) You may want to add/remove some \r
-DLL entry points. Right now those 6 entries are not from portaudio.h:\r
-(from portaudio.def) \r
-#---------------------------------------------------------------------------------------------------------  \r
-\r
diff --git a/fdmdv2/branches/0.97/notes/codec2-MinGW-build/codec2-MinGW-build.tags b/fdmdv2/branches/0.97/notes/codec2-MinGW-build/codec2-MinGW-build.tags
deleted file mode 100644 (file)
index cceec0a..0000000
Binary files a/fdmdv2/branches/0.97/notes/codec2-MinGW-build/codec2-MinGW-build.tags and /dev/null differ
diff --git a/fdmdv2/branches/0.97/notes/codec2-MinGW-build/codec2-MinGW-build.workspace b/fdmdv2/branches/0.97/notes/codec2-MinGW-build/codec2-MinGW-build.workspace
deleted file mode 100644 (file)
index 6a8c018..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<CodeLite_Workspace Name="codec2-MinGW-build" Database="./codec2-MinGW-build.tags">
-  <Project Name="codec2basic" Path="codec2basic/codec2basic.project" Active="Yes"/>
-  <BuildMatrix>
-    <WorkspaceConfiguration Name="Debug" Selected="yes">
-      <Project Name="codec2basic" ConfigName="Debug"/>
-    </WorkspaceConfiguration>
-    <WorkspaceConfiguration Name="Release" Selected="yes">
-      <Project Name="codec2basic" ConfigName="Release"/>
-    </WorkspaceConfiguration>
-  </BuildMatrix>
-</CodeLite_Workspace>
diff --git a/fdmdv2/branches/0.97/notes/codec2-MinGW-build/codec2-MinGW-build.workspace.session b/fdmdv2/branches/0.97/notes/codec2-MinGW-build/codec2-MinGW-build.workspace.session
deleted file mode 100644 (file)
index 58e84ab..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<Session Name="C:\Users\wittend\Projects\codec2-MinGW-build\codec2-MinGW-build.workspace">
-  <int Value="0" Name="m_selectedTab"/>
-  <wxString Value="C:\Users\wittend\Projects\codec2-MinGW-build\codec2-MinGW-build.workspace" Name="m_workspaceName"/>
-  <TabInfoArray Name="TabInfoArray"/>
-  <SerializedObject Name="m_breakpoints">
-    <long Value="0" Name="Count"/>
-  </SerializedObject>
-</Session>
diff --git a/fdmdv2/branches/0.97/notes/codec2-MinGW-build/codec2basic/codec2basic.project b/fdmdv2/branches/0.97/notes/codec2-MinGW-build/codec2basic/codec2basic.project
deleted file mode 100644 (file)
index 9a14a4e..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<CodeLite_Project Name="codec2basic" InternalType="Console">
-  <Description/>
-  <Dependencies/>
-  <Settings Type="Executable">
-    <GlobalSettings>
-      <Compiler Options="" C_Options="">
-        <IncludePath Value="."/>
-      </Compiler>
-      <Linker Options="">
-        <LibraryPath Value="."/>
-      </Linker>
-      <ResourceCompiler Options=""/>
-    </GlobalSettings>
-    <Configuration Name="Debug" CompilerType="gnu gcc" DebuggerType="GNU gdb debugger" Type="" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append">
-      <Compiler Options="-g;-O0;-Wall" C_Options="-g;-O0;-Wall" Required="yes" PreCompiledHeader="" PCHInCommandLine="no" UseDifferentPCHFlags="no" PCHFlags="">
-        <IncludePath Value="."/>
-      </Compiler>
-      <Linker Options="" Required="yes"/>
-      <ResourceCompiler Options="" Required="no"/>
-      <General OutputFile="$(IntermediateDirectory)/$(ProjectName)" IntermediateDirectory="./Debug" Command="./$(ProjectName)" CommandArguments="" UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="yes"/>
-      <Environment EnvVarSetName="&lt;Use Defaults&gt;" DbgSetName="&lt;Use Defaults&gt;">
-        <![CDATA[]]>
-      </Environment>
-      <Debugger IsRemote="no" RemoteHostName="" RemoteHostPort="" DebuggerPath="">
-        <PostConnectCommands/>
-        <StartupCommands/>
-      </Debugger>
-      <PreBuild/>
-      <PostBuild/>
-      <CustomBuild Enabled="no">
-        <RebuildCommand/>
-        <CleanCommand/>
-        <BuildCommand/>
-        <PreprocessFileCommand/>
-        <SingleFileCommand/>
-        <MakefileGenerationCommand/>
-        <ThirdPartyToolName>None</ThirdPartyToolName>
-        <WorkingDirectory/>
-      </CustomBuild>
-      <AdditionalRules>
-        <CustomPostBuild/>
-        <CustomPreBuild/>
-      </AdditionalRules>
-      <Completion>
-        <ClangCmpFlags/>
-        <ClangPP/>
-        <SearchPaths/>
-      </Completion>
-    </Configuration>
-    <Configuration Name="Release" CompilerType="gnu gcc" DebuggerType="GNU gdb debugger" Type="" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append">
-      <Compiler Options="-O2;-Wall" C_Options="-O2;-Wall" Required="yes" PreCompiledHeader="" PCHInCommandLine="no" UseDifferentPCHFlags="no" PCHFlags="">
-        <IncludePath Value="."/>
-      </Compiler>
-      <Linker Options="" Required="yes"/>
-      <ResourceCompiler Options="" Required="no"/>
-      <General OutputFile="$(IntermediateDirectory)/$(ProjectName)" IntermediateDirectory="./Release" Command="./$(ProjectName)" CommandArguments="" UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="yes"/>
-      <Environment EnvVarSetName="&lt;Use Defaults&gt;" DbgSetName="&lt;Use Defaults&gt;">
-        <![CDATA[]]>
-      </Environment>
-      <Debugger IsRemote="no" RemoteHostName="" RemoteHostPort="" DebuggerPath="">
-        <PostConnectCommands/>
-        <StartupCommands/>
-      </Debugger>
-      <PreBuild/>
-      <PostBuild/>
-      <CustomBuild Enabled="no">
-        <RebuildCommand/>
-        <CleanCommand/>
-        <BuildCommand/>
-        <PreprocessFileCommand/>
-        <SingleFileCommand/>
-        <MakefileGenerationCommand/>
-        <ThirdPartyToolName>None</ThirdPartyToolName>
-        <WorkingDirectory/>
-      </CustomBuild>
-      <AdditionalRules>
-        <CustomPostBuild/>
-        <CustomPreBuild/>
-      </AdditionalRules>
-      <Completion>
-        <ClangCmpFlags/>
-        <ClangPP/>
-        <SearchPaths/>
-      </Completion>
-    </Configuration>
-  </Settings>
-  <VirtualDirectory Name="src">
-    <File Name="main.c"/>
-  </VirtualDirectory>
-</CodeLite_Project>
diff --git a/fdmdv2/branches/0.97/notes/codec2-MinGW-build/codec2basic/main.c b/fdmdv2/branches/0.97/notes/codec2-MinGW-build/codec2basic/main.c
deleted file mode 100644 (file)
index 82bd805..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <stdio.h>
-
-int main(int argc, char **argv)
-{
-       printf("hello world\n");
-       return 0;
-}
diff --git a/fdmdv2/branches/0.97/notes/codec2-MinGW-build/extra-inc/endian.h b/fdmdv2/branches/0.97/notes/codec2-MinGW-build/extra-inc/endian.h
deleted file mode 100644 (file)
index 11cbb7a..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-/* Copyright (C) 1992, 1996, 1997, 2000, 2008 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library 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
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
-
-#ifndef        _ENDIAN_H
-#define        _ENDIAN_H       1
-
-//#include <features.h>
-
-/* Definitions for byte order, according to significance of bytes,
-   from low addresses to high addresses.  The value is what you get by
-   putting '4' in the most significant byte, '3' in the second most
-   significant byte, '2' in the second least significant byte, and '1'
-   in the least significant byte, and then writing down one digit for
-   each byte, starting with the byte at the lowest address at the left,
-   and proceeding to the byte with the highest address at the right.  */
-
-#define        __LITTLE_ENDIAN 1234
-#define        __BIG_ENDIAN    4321
-#define        __PDP_ENDIAN    3412
-
-/* This file defines `__BYTE_ORDER' for the particular machine.  */
-//#include <bits/endian.h>
-
-/* Some machines may need to use a different endianness for floating point
-   values.  */
-#ifndef __FLOAT_WORD_ORDER
-# define __FLOAT_WORD_ORDER __BYTE_ORDER
-#endif
-
-#ifdef __USE_BSD
-# define LITTLE_ENDIAN __LITTLE_ENDIAN
-# define BIG_ENDIAN    __BIG_ENDIAN
-# define PDP_ENDIAN    __PDP_ENDIAN
-# define BYTE_ORDER    __BYTE_ORDER
-#endif
-
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-# define __LONG_LONG_PAIR(HI, LO) LO, HI
-#elif __BYTE_ORDER == __BIG_ENDIAN
-# define __LONG_LONG_PAIR(HI, LO) HI, LO
-#endif
-
-
-#ifdef __USE_BSD
-/* Conversion interfaces.  */
-# include <bits/byteswap.h>
-
-# if __BYTE_ORDER == __LITTLE_ENDIAN
-#  define htobe16(x) __bswap_16 (x)
-#  define htole16(x) (x)
-#  define be16toh(x) __bswap_16 (x)
-#  define le16toh(x) (x)
-
-#  define htobe32(x) __bswap_32 (x)
-#  define htole32(x) (x)
-#  define be32toh(x) __bswap_32 (x)
-#  define le32toh(x) (x)
-
-#  define htobe64(x) __bswap_64 (x)
-#  define htole64(x) (x)
-#  define be64toh(x) __bswap_64 (x)
-#  define le64toh(x) (x)
-# else
-#  define htobe16(x) (x)
-#  define htole16(x) __bswap_16 (x)
-#  define be16toh(x) (x)
-#  define le16toh(x) __bswap_16 (x)
-
-#  define htobe32(x) (x)
-#  define htole32(x) __bswap_32 (x)
-#  define be32toh(x) (x)
-#  define le32toh(x) __bswap_32 (x)
-
-#  define htobe64(x) (x)
-#  define htole64(x) __bswap_64 (x)
-#  define be64toh(x) (x)
-#  define le64toh(x) __bswap_64 (x)
-# endif
-#endif
-
-#endif /* endian.h */
diff --git a/fdmdv2/branches/0.97/notes/codec2-MinGW-build/extra-inc/sys/sound.h b/fdmdv2/branches/0.97/notes/codec2-MinGW-build/extra-inc/sys/sound.h
deleted file mode 100644 (file)
index b1fde3d..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-
-/*
- * Minor numbers for the sound driver.
- */
-
-#include <linux/fs.h>
-
-#define SND_DEV_CTL                0   /* Control port /dev/mixer */
-#define SND_DEV_SEQ                1   /* Sequencer output /dev/sequencer (FM synthesizer and MIDI output) */
-#define SND_DEV_MIDIN          2       /* Raw midi access */
-#define SND_DEV_DSP                3   /* Digitized voice /dev/dsp */
-#define SND_DEV_AUDIO          4       /* Sparc compatible /dev/audio */
-#define SND_DEV_DSP16          5       /* Like /dev/dsp but 16 bits/sample */
-/* #define SND_DEV_STATUS      6 */    /* /dev/sndstat (obsolete) */
-#define SND_DEV_UNUSED         6
-#define SND_DEV_AWFM           7       /* Reserved */
-#define SND_DEV_SEQ2           8       /* /dev/sequencer, level 2 interface */
-/* #define SND_DEV_SNDPROC     9 */    /* /dev/sndproc for programmable devices (not used) */
-/* #define SND_DEV_DMMIDI      9 */
-#define SND_DEV_SYNTH          9       /* Raw synth access /dev/synth (same as /dev/dmfm) */
-#define SND_DEV_DMFM           10      /* Raw synth access /dev/dmfm */
-#define SND_DEV_UNKNOWN11      11
-#define SND_DEV_ADSP           12      /* Like /dev/dsp (obsolete) */
-#define SND_DEV_AMIDI          13      /* Like /dev/midi (obsolete) */
-#define SND_DEV_ADMMIDI                14      /* Like /dev/dmmidi (onsolete) */
-
diff --git a/fdmdv2/branches/0.97/notes/codec2-MinGW-build/extra-inc/sys/soundcard.h b/fdmdv2/branches/0.97/notes/codec2-MinGW-build/extra-inc/sys/soundcard.h
deleted file mode 100644 (file)
index d811549..0000000
+++ /dev/null
@@ -1,1276 +0,0 @@
-#ifndef SOUNDCARD_H
-#define SOUNDCARD_H
-/*
- * Copyright by Hannu Savolainen 1993-1997
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met: 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer. 2.
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-
-/*
- * OSS interface version. With versions earlier than 3.6 this value is
- * an integer with value less than 361. In versions 3.6 and later
- * it's a six digit hexadecimal value. For example value
- * of 0x030600 represents OSS version 3.6.0.
- * Use ioctl(fd, OSS_GETVERSION, &int) to get the version number of
- * the currently active driver.
- */
-#define SOUND_VERSION  0x030802
-#define OPEN_SOUND_SYSTEM
-
-/* In Linux we need to be prepared for cross compiling */
-//#include <linux/ioctl.h>
-
-/* Endian macros. */
-#  include <endian.h>
-
-/*
- *     Supported card ID numbers (Should be somewhere else?)
- */
-
-#define SNDCARD_ADLIB          1
-#define SNDCARD_SB                 2
-#define SNDCARD_PAS                3
-#define SNDCARD_GUS                4
-#define SNDCARD_MPU401         5
-#define SNDCARD_SB16           6
-#define SNDCARD_SB16MIDI       7
-#define SNDCARD_UART6850       8
-#define SNDCARD_GUS16          9
-#define SNDCARD_MSS                10
-#define SNDCARD_PSS            11
-#define SNDCARD_SSCAPE         12
-#define SNDCARD_PSS_MPU     13
-#define SNDCARD_PSS_MSS     14
-#define SNDCARD_SSCAPE_MSS     15
-#define SNDCARD_TRXPRO         16
-#define SNDCARD_TRXPRO_SB      17
-#define SNDCARD_TRXPRO_MPU     18
-#define SNDCARD_MAD16          19
-#define SNDCARD_MAD16_MPU      20
-#define SNDCARD_CS4232         21
-#define SNDCARD_CS4232_MPU     22
-#define SNDCARD_MAUI           23
-#define SNDCARD_PSEUDO_MSS     24
-#define SNDCARD_GUSPNP         25
-#define SNDCARD_UART401                26
-/* Sound card numbers 27 to N are reserved. Don't add more numbers here. */
-
-/***********************************
- * IOCTL Commands for /dev/sequencer
- */
-
-#ifndef _SIOWR
-#if defined(_IOWR) && (defined(_AIX) || (!defined(sun) && !defined(sparc) && !defined(__sparc__) && !defined(__INCioctlh) && !defined(__Lynx__)))
-/* Use already defined ioctl defines if they exist (except with Sun or Sparc) */
-#define        SIOCPARM_MASK   IOCPARM_MASK
-#define        SIOC_VOID       IOC_VOID
-#define        SIOC_OUT        IOC_OUT
-#define        SIOC_IN         IOC_IN
-#define        SIOC_INOUT      IOC_INOUT
-#define _SIOC_SIZE     _IOC_SIZE
-#define _SIOC_DIR      _IOC_DIR
-#define _SIOC_NONE     _IOC_NONE
-#define _SIOC_READ     _IOC_READ
-#define _SIOC_WRITE    _IOC_WRITE
-#define        _SIO            _IO
-#define        _SIOR           _IOR
-#define        _SIOW           _IOW
-#define        _SIOWR          _IOWR
-#else
-
-/* Ioctl's have the command encoded in the lower word,
- * and the size of any in or out parameters in the upper
- * word.  The high 2 bits of the upper word are used
- * to encode the in/out status of the parameter; for now
- * we restrict parameters to at most 8191 bytes.
- */
-/* #define     SIOCTYPE                (0xff<<8) */
-#define        SIOCPARM_MASK   0x1fff          /* parameters must be < 8192 bytes */
-#define        SIOC_VOID       0x00000000      /* no parameters */
-#define        SIOC_OUT        0x20000000      /* copy out parameters */
-#define        SIOC_IN         0x40000000      /* copy in parameters */
-#define        SIOC_INOUT      (SIOC_IN|SIOC_OUT)
-/* the 0x20000000 is so we can distinguish new ioctl's from old */
-#define        _SIO(x,y)       ((int)(SIOC_VOID|(x<<8)|y))
-#define        _SIOR(x,y,t)    ((int)(SIOC_OUT|((sizeof(t)&SIOCPARM_MASK)<<16)|(x<<8)|y))
-#define        _SIOW(x,y,t)    ((int)(SIOC_IN|((sizeof(t)&SIOCPARM_MASK)<<16)|(x<<8)|y))
-/* this should be _SIORW, but stdio got there first */
-#define        _SIOWR(x,y,t)   ((int)(SIOC_INOUT|((sizeof(t)&SIOCPARM_MASK)<<16)|(x<<8)|y))
-#define _SIOC_SIZE(x)  ((x>>16)&SIOCPARM_MASK) 
-#define _SIOC_DIR(x)   (x & 0xf0000000)
-#define _SIOC_NONE     SIOC_VOID
-#define _SIOC_READ     SIOC_OUT
-#define _SIOC_WRITE    SIOC_IN
-#  endif /* _IOWR */
-#endif  /* !_SIOWR */
-
-#define SNDCTL_SEQ_RESET               _SIO  ('Q', 0)
-#define SNDCTL_SEQ_SYNC                        _SIO  ('Q', 1)
-#define SNDCTL_SYNTH_INFO              _SIOWR('Q', 2, struct synth_info)
-#define SNDCTL_SEQ_CTRLRATE            _SIOWR('Q', 3, int)     /* Set/get timer resolution (HZ) */
-#define SNDCTL_SEQ_GETOUTCOUNT         _SIOR ('Q', 4, int)
-#define SNDCTL_SEQ_GETINCOUNT          _SIOR ('Q', 5, int)
-#define SNDCTL_SEQ_PERCMODE            _SIOW ('Q', 6, int)
-#define SNDCTL_FM_LOAD_INSTR           _SIOW ('Q', 7, struct sbi_instrument)   /* Obsolete. Don't use!!!!!! */
-#define SNDCTL_SEQ_TESTMIDI            _SIOW ('Q', 8, int)
-#define SNDCTL_SEQ_RESETSAMPLES                _SIOW ('Q', 9, int)
-#define SNDCTL_SEQ_NRSYNTHS            _SIOR ('Q',10, int)
-#define SNDCTL_SEQ_NRMIDIS             _SIOR ('Q',11, int)
-#define SNDCTL_MIDI_INFO               _SIOWR('Q',12, struct midi_info)
-#define SNDCTL_SEQ_THRESHOLD           _SIOW ('Q',13, int)
-#define SNDCTL_SYNTH_MEMAVL            _SIOWR('Q',14, int)     /* in=dev#, out=memsize */
-#define SNDCTL_FM_4OP_ENABLE           _SIOW ('Q',15, int)     /* in=dev# */
-#define SNDCTL_SEQ_PANIC               _SIO  ('Q',17)
-#define SNDCTL_SEQ_OUTOFBAND           _SIOW ('Q',18, struct seq_event_rec)
-#define SNDCTL_SEQ_GETTIME             _SIOR ('Q',19, int)
-#define SNDCTL_SYNTH_ID                        _SIOWR('Q',20, struct synth_info)
-#define SNDCTL_SYNTH_CONTROL           _SIOWR('Q',21, struct synth_control)
-#define SNDCTL_SYNTH_REMOVESAMPLE      _SIOWR('Q',22, struct remove_sample)
-
-typedef struct synth_control
-{
-       int devno;      /* Synthesizer # */
-       char data[4000]; /* Device spesific command/data record */
-}synth_control;
-
-typedef struct remove_sample
-{
-       int devno;      /* Synthesizer # */
-       int bankno;     /* MIDI bank # (0=General MIDI) */
-       int instrno;    /* MIDI instrument number */
-} remove_sample;
-
-typedef struct seq_event_rec {
-               unsigned char arr[8];
-} seq_event_rec;
-
-#define SNDCTL_TMR_TIMEBASE            _SIOWR('T', 1, int)
-#define SNDCTL_TMR_START               _SIO  ('T', 2)
-#define SNDCTL_TMR_STOP                        _SIO  ('T', 3)
-#define SNDCTL_TMR_CONTINUE            _SIO  ('T', 4)
-#define SNDCTL_TMR_TEMPO               _SIOWR('T', 5, int)
-#define SNDCTL_TMR_SOURCE              _SIOWR('T', 6, int)
-#      define TMR_INTERNAL             0x00000001
-#      define TMR_EXTERNAL             0x00000002
-#              define TMR_MODE_MIDI    0x00000010
-#              define TMR_MODE_FSK     0x00000020
-#              define TMR_MODE_CLS     0x00000040
-#              define TMR_MODE_SMPTE   0x00000080
-#define SNDCTL_TMR_METRONOME           _SIOW ('T', 7, int)
-#define SNDCTL_TMR_SELECT              _SIOW ('T', 8, int)
-
-/*
- * Some big endian/little endian handling macros
- */
-
-#define _LINUX_PATCHKEY_H_INDIRECT
-//#include <linux/patchkey.h>
-#undef _LINUX_PATCHKEY_H_INDIRECT
-
-#if   defined(__BYTE_ORDER)
-#  if __BYTE_ORDER == __BIG_ENDIAN
-#    define AFMT_S16_NE AFMT_S16_BE
-#  elif __BYTE_ORDER == __LITTLE_ENDIAN
-#    define AFMT_S16_NE AFMT_S16_LE
-#  else
-#    error "could not determine byte order"
-#  endif
-#endif
-
-/*
- *     Sample loading mechanism for internal synthesizers (/dev/sequencer)
- *     The following patch_info structure has been designed to support
- *     Gravis UltraSound. It tries to be universal format for uploading
- *     sample based patches but is probably too limited.
- *
- *      (PBD) As Hannu guessed, the GUS structure is too limited for 
- *      the WaveFront, but this is the right place for a constant definition.
- */
-
-struct patch_info {
-               unsigned short key;             /* Use WAVE_PATCH here */
-#define WAVE_PATCH        _PATCHKEY(0x04)
-#define GUS_PATCH         WAVE_PATCH
-#define WAVEFRONT_PATCH    _PATCHKEY(0x06)
-
-               short device_no;        /* Synthesizer number */
-               short instr_no;         /* Midi pgm# */
-
-               unsigned int mode;
-/*
- * The least significant byte has the same format than the GUS .PAT
- * files
- */
-#define WAVE_16_BITS   0x01    /* bit 0 = 8 or 16 bit wave data. */
-#define WAVE_UNSIGNED  0x02    /* bit 1 = Signed - Unsigned data. */
-#define WAVE_LOOPING   0x04    /* bit 2 = looping enabled-1. */
-#define WAVE_BIDIR_LOOP        0x08    /* bit 3 = Set is bidirectional looping. */
-#define WAVE_LOOP_BACK 0x10    /* bit 4 = Set is looping backward. */
-#define WAVE_SUSTAIN_ON        0x20    /* bit 5 = Turn sustaining on. (Env. pts. 3)*/
-#define WAVE_ENVELOPES 0x40    /* bit 6 = Enable envelopes - 1 */
-#define WAVE_FAST_RELEASE 0x80 /* bit 7 = Shut off immediately after note off */
-                               /*      (use the env_rate/env_offs fields). */
-/* Linux specific bits */
-#define WAVE_VIBRATO   0x00010000      /* The vibrato info is valid */
-#define WAVE_TREMOLO   0x00020000      /* The tremolo info is valid */
-#define WAVE_SCALE     0x00040000      /* The scaling info is valid */
-#define WAVE_FRACTIONS 0x00080000      /* Fraction information is valid */
-/* Reserved bits */
-#define WAVE_ROM       0x40000000      /* For future use */
-#define WAVE_MULAW     0x20000000      /* For future use */
-/* Other bits must be zeroed */
-
-               int len;        /* Size of the wave data in bytes */
-               int loop_start, loop_end; /* Byte offsets from the beginning */
-
-/* 
- * The base_freq and base_note fields are used when computing the
- * playback speed for a note. The base_note defines the tone frequency
- * which is heard if the sample is played using the base_freq as the
- * playback speed.
- *
- * The low_note and high_note fields define the minimum and maximum note
- * frequencies for which this sample is valid. It is possible to define
- * more than one samples for an instrument number at the same time. The
- * low_note and high_note fields are used to select the most suitable one.
- *
- * The fields base_note, high_note and low_note should contain
- * the note frequency multiplied by 1000. For example value for the
- * middle A is 440*1000.
- */
-
-               unsigned int base_freq;
-               unsigned int base_note;
-               unsigned int high_note;
-               unsigned int low_note;
-               int panning;    /* -128=left, 127=right */
-               int detuning;
-
-/*     New fields introduced in version 1.99.5 */
-
-       /* Envelope. Enabled by mode bit WAVE_ENVELOPES */
-               unsigned char   env_rate[ 6 ];   /* GUS HW ramping rate */
-               unsigned char   env_offset[ 6 ]; /* 255 == 100% */
-
-       /* 
-        * The tremolo, vibrato and scale info are not supported yet.
-        * Enable by setting the mode bits WAVE_TREMOLO, WAVE_VIBRATO or
-        * WAVE_SCALE
-        */
-
-               unsigned char   tremolo_sweep;
-               unsigned char   tremolo_rate;
-               unsigned char   tremolo_depth;
-       
-               unsigned char   vibrato_sweep;
-               unsigned char   vibrato_rate;
-               unsigned char   vibrato_depth;
-
-               int             scale_frequency;
-               unsigned int    scale_factor;           /* from 0 to 2048 or 0 to 2 */
-       
-               int             volume;
-               int             fractions;
-               int             reserved1;
-               int             spare[2];
-               char data[1];   /* The waveform data starts here */
-       };
-
-struct sysex_info {
-               short key;              /* Use SYSEX_PATCH or MAUI_PATCH here */
-#define SYSEX_PATCH    _PATCHKEY(0x05)
-#define MAUI_PATCH     _PATCHKEY(0x06)
-               short device_no;        /* Synthesizer number */
-               int len;        /* Size of the sysex data in bytes */
-               unsigned char data[1];  /* Sysex data starts here */
-       };
-
-/*
- * /dev/sequencer input events.
- *
- * The data written to the /dev/sequencer is a stream of events. Events
- * are records of 4 or 8 bytes. The first byte defines the size. 
- * Any number of events can be written with a write call. There
- * is a set of macros for sending these events. Use these macros if you
- * want to maximize portability of your program.
- *
- * Events SEQ_WAIT, SEQ_MIDIPUTC and SEQ_ECHO. Are also input events.
- * (All input events are currently 4 bytes long. Be prepared to support
- * 8 byte events also. If you receive any event having first byte >= 128,
- * it's a 8 byte event.
- *
- * The events are documented at the end of this file.
- *
- * Normal events (4 bytes)
- * There is also a 8 byte version of most of the 4 byte events. The
- * 8 byte one is recommended.
- */
-#define SEQ_NOTEOFF            0
-#define SEQ_FMNOTEOFF          SEQ_NOTEOFF     /* Just old name */
-#define SEQ_NOTEON             1
-#define        SEQ_FMNOTEON            SEQ_NOTEON
-#define SEQ_WAIT               TMR_WAIT_ABS
-#define SEQ_PGMCHANGE          3
-#define SEQ_FMPGMCHANGE                SEQ_PGMCHANGE
-#define SEQ_SYNCTIMER          TMR_START
-#define SEQ_MIDIPUTC           5
-#define SEQ_DRUMON             6       /*** OBSOLETE ***/
-#define SEQ_DRUMOFF            7       /*** OBSOLETE ***/
-#define SEQ_ECHO               TMR_ECHO        /* For synching programs with output */
-#define SEQ_AFTERTOUCH         9
-#define SEQ_CONTROLLER         10
-
-/*******************************************
- *     Midi controller numbers
- *******************************************
- * Controllers 0 to 31 (0x00 to 0x1f) and
- * 32 to 63 (0x20 to 0x3f) are continuous
- * controllers.
- * In the MIDI 1.0 these controllers are sent using
- * two messages. Controller numbers 0 to 31 are used
- * to send the MSB and the controller numbers 32 to 63
- * are for the LSB. Note that just 7 bits are used in MIDI bytes.
- */
-
-#define           CTL_BANK_SELECT              0x00
-#define           CTL_MODWHEEL                 0x01
-#define    CTL_BREATH                  0x02
-/*             undefined               0x03 */
-#define    CTL_FOOT                    0x04
-#define    CTL_PORTAMENTO_TIME         0x05
-#define    CTL_DATA_ENTRY              0x06
-#define    CTL_MAIN_VOLUME             0x07
-#define    CTL_BALANCE                 0x08
-/*             undefined               0x09 */
-#define    CTL_PAN                     0x0a
-#define    CTL_EXPRESSION              0x0b
-/*             undefined               0x0c */
-/*             undefined               0x0d */
-/*             undefined               0x0e */
-/*             undefined               0x0f */
-#define    CTL_GENERAL_PURPOSE1        0x10
-#define    CTL_GENERAL_PURPOSE2        0x11
-#define    CTL_GENERAL_PURPOSE3        0x12
-#define    CTL_GENERAL_PURPOSE4        0x13
-/*             undefined               0x14 - 0x1f */
-
-/*             undefined               0x20 */
-/* The controller numbers 0x21 to 0x3f are reserved for the */
-/* least significant bytes of the controllers 0x00 to 0x1f. */
-/* These controllers are not recognised by the driver. */
-
-/* Controllers 64 to 69 (0x40 to 0x45) are on/off switches. */
-/* 0=OFF and 127=ON (intermediate values are possible) */
-#define    CTL_DAMPER_PEDAL            0x40
-#define    CTL_SUSTAIN                 0x40    /* Alias */
-#define    CTL_HOLD                    0x40    /* Alias */
-#define    CTL_PORTAMENTO              0x41
-#define    CTL_SOSTENUTO               0x42
-#define    CTL_SOFT_PEDAL              0x43
-/*             undefined               0x44 */
-#define    CTL_HOLD2                   0x45
-/*             undefined               0x46 - 0x4f */
-
-#define    CTL_GENERAL_PURPOSE5        0x50
-#define    CTL_GENERAL_PURPOSE6        0x51
-#define    CTL_GENERAL_PURPOSE7        0x52
-#define    CTL_GENERAL_PURPOSE8        0x53
-/*             undefined               0x54 - 0x5a */
-#define    CTL_EXT_EFF_DEPTH           0x5b
-#define    CTL_TREMOLO_DEPTH           0x5c
-#define    CTL_CHORUS_DEPTH            0x5d
-#define    CTL_DETUNE_DEPTH            0x5e
-#define    CTL_CELESTE_DEPTH           0x5e    /* Alias for the above one */
-#define    CTL_PHASER_DEPTH            0x5f
-#define    CTL_DATA_INCREMENT          0x60
-#define    CTL_DATA_DECREMENT          0x61
-#define    CTL_NONREG_PARM_NUM_LSB     0x62
-#define    CTL_NONREG_PARM_NUM_MSB     0x63
-#define    CTL_REGIST_PARM_NUM_LSB     0x64
-#define    CTL_REGIST_PARM_NUM_MSB     0x65
-/*             undefined               0x66 - 0x78 */
-/*             reserved                0x79 - 0x7f */
-
-/* Pseudo controllers (not midi compatible) */
-#define    CTRL_PITCH_BENDER           255
-#define    CTRL_PITCH_BENDER_RANGE     254
-#define    CTRL_EXPRESSION             253     /* Obsolete */
-#define    CTRL_MAIN_VOLUME            252     /* Obsolete */
-#define SEQ_BALANCE            11
-#define SEQ_VOLMODE             12
-
-/*
- * Volume mode decides how volumes are used
- */
-
-#define VOL_METHOD_ADAGIO      1
-#define VOL_METHOD_LINEAR      2
-
-/*
- * Note! SEQ_WAIT, SEQ_MIDIPUTC and SEQ_ECHO are used also as
- *      input events.
- */
-
-/*
- * Event codes 0xf0 to 0xfc are reserved for future extensions.
- */
-
-#define SEQ_FULLSIZE           0xfd    /* Long events */
-/*
- *     SEQ_FULLSIZE events are used for loading patches/samples to the
- *     synthesizer devices. These events are passed directly to the driver
- *     of the associated synthesizer device. There is no limit to the size
- *     of the extended events. These events are not queued but executed
- *     immediately when the write() is called (execution can take several
- *     seconds of time). 
- *
- *     When a SEQ_FULLSIZE message is written to the device, it must
- *     be written using exactly one write() call. Other events cannot
- *     be mixed to the same write.
- *     
- *     For FM synths (YM3812/OPL3) use struct sbi_instrument and write it to the 
- *     /dev/sequencer. Don't write other data together with the instrument structure
- *     Set the key field of the structure to FM_PATCH. The device field is used to
- *     route the patch to the corresponding device.
- *
- *     For wave table use struct patch_info. Initialize the key field
- *      to WAVE_PATCH.
- */
-#define SEQ_PRIVATE            0xfe    /* Low level HW dependent events (8 bytes) */
-#define SEQ_EXTENDED           0xff    /* Extended events (8 bytes) OBSOLETE */
-
-/*
- * Record for FM patches
- */
-
-typedef unsigned char sbi_instr_data[32];
-
-struct sbi_instrument {
-               unsigned short  key;    /* FM_PATCH or OPL3_PATCH */
-#define FM_PATCH       _PATCHKEY(0x01)
-#define OPL3_PATCH     _PATCHKEY(0x03)
-               short           device;         /*      Synth# (0-4)    */
-               int             channel;        /*      Program# to be initialized      */
-               sbi_instr_data  operators;      /*      Register settings for operator cells (.SBI format)      */
-       };
-
-struct synth_info {    /* Read only */
-               char    name[30];
-               int     device;         /* 0-N. INITIALIZE BEFORE CALLING */
-               int     synth_type;
-#define SYNTH_TYPE_FM                  0
-#define SYNTH_TYPE_SAMPLE              1
-#define SYNTH_TYPE_MIDI                        2       /* Midi interface */
-
-               int     synth_subtype;
-#define FM_TYPE_ADLIB                  0x00
-#define FM_TYPE_OPL3                   0x01
-#define MIDI_TYPE_MPU401               0x401
-
-#define SAMPLE_TYPE_BASIC              0x10
-#define SAMPLE_TYPE_GUS                        SAMPLE_TYPE_BASIC
-#define SAMPLE_TYPE_WAVEFRONT           0x11
-
-               int     perc_mode;      /* No longer supported */
-               int     nr_voices;
-               int     nr_drums;       /* Obsolete field */
-               int     instr_bank_size;
-               unsigned int    capabilities;   
-#define SYNTH_CAP_PERCMODE             0x00000001 /* No longer used */
-#define SYNTH_CAP_OPL3                 0x00000002 /* Set if OPL3 supported */
-#define SYNTH_CAP_INPUT                        0x00000004 /* Input (MIDI) device */
-               int     dummies[19];    /* Reserve space */
-       };
-
-struct sound_timer_info {
-               char name[32];
-               int caps;
-       };
-
-#define MIDI_CAP_MPU401                1               /* MPU-401 intelligent mode */
-
-struct midi_info {
-               char            name[30];
-               int             device;         /* 0-N. INITIALIZE BEFORE CALLING */
-               unsigned int    capabilities;   /* To be defined later */
-               int             dev_type;
-               int             dummies[18];    /* Reserve space */
-       };
-
-/********************************************
- * ioctl commands for the /dev/midi##
- */
-typedef struct {
-               unsigned char cmd;
-               char nr_args, nr_returns;
-               unsigned char data[30];
-       } mpu_command_rec;
-
-#define SNDCTL_MIDI_PRETIME            _SIOWR('m', 0, int)
-#define SNDCTL_MIDI_MPUMODE            _SIOWR('m', 1, int)
-#define SNDCTL_MIDI_MPUCMD             _SIOWR('m', 2, mpu_command_rec)
-
-/********************************************
- * IOCTL commands for /dev/dsp and /dev/audio
- */
-
-#define SNDCTL_DSP_RESET               _SIO  ('P', 0)
-#define SNDCTL_DSP_SYNC                        _SIO  ('P', 1)
-#define SNDCTL_DSP_SPEED               _SIOWR('P', 2, int)
-#define SNDCTL_DSP_STEREO              _SIOWR('P', 3, int)
-#define SNDCTL_DSP_GETBLKSIZE          _SIOWR('P', 4, int)
-#define SNDCTL_DSP_SAMPLESIZE          SNDCTL_DSP_SETFMT
-#define SNDCTL_DSP_CHANNELS            _SIOWR('P', 6, int)
-#define SOUND_PCM_WRITE_CHANNELS       SNDCTL_DSP_CHANNELS
-#define SOUND_PCM_WRITE_FILTER         _SIOWR('P', 7, int)
-#define SNDCTL_DSP_POST                        _SIO  ('P', 8)
-#define SNDCTL_DSP_SUBDIVIDE           _SIOWR('P', 9, int)
-#define SNDCTL_DSP_SETFRAGMENT         _SIOWR('P',10, int)
-
-/*     Audio data formats (Note! U8=8 and S16_LE=16 for compatibility) */
-#define SNDCTL_DSP_GETFMTS             _SIOR ('P',11, int) /* Returns a mask */
-#define SNDCTL_DSP_SETFMT              _SIOWR('P',5, int) /* Selects ONE fmt*/
-#      define AFMT_QUERY               0x00000000      /* Return current fmt */
-#      define AFMT_MU_LAW              0x00000001
-#      define AFMT_A_LAW               0x00000002
-#      define AFMT_IMA_ADPCM           0x00000004
-#      define AFMT_U8                  0x00000008
-#      define AFMT_S16_LE              0x00000010      /* Little endian signed 16*/
-#      define AFMT_S16_BE              0x00000020      /* Big endian signed 16 */
-#      define AFMT_S8                  0x00000040
-#      define AFMT_U16_LE              0x00000080      /* Little endian U16 */
-#      define AFMT_U16_BE              0x00000100      /* Big endian U16 */
-#      define AFMT_MPEG                0x00000200      /* MPEG (2) audio */
-#      define AFMT_AC3         0x00000400      /* Dolby Digital AC3 */
-
-/*
- * Buffer status queries.
- */
-typedef struct audio_buf_info {
-                       int fragments;  /* # of available fragments (partially usend ones not counted) */
-                       int fragstotal; /* Total # of fragments allocated */
-                       int fragsize;   /* Size of a fragment in bytes */
-
-                       int bytes;      /* Available space in bytes (includes partially used fragments) */
-                       /* Note! 'bytes' could be more than fragments*fragsize */
-               } audio_buf_info;
-
-#define SNDCTL_DSP_GETOSPACE           _SIOR ('P',12, audio_buf_info)
-#define SNDCTL_DSP_GETISPACE           _SIOR ('P',13, audio_buf_info)
-#define SNDCTL_DSP_NONBLOCK            _SIO  ('P',14)
-#define SNDCTL_DSP_GETCAPS             _SIOR ('P',15, int)
-#      define DSP_CAP_REVISION         0x000000ff      /* Bits for revision level (0 to 255) */
-#      define DSP_CAP_DUPLEX           0x00000100      /* Full duplex record/playback */
-#      define DSP_CAP_REALTIME         0x00000200      /* Real time capability */
-#      define DSP_CAP_BATCH            0x00000400      /* Device has some kind of */
-                                                       /* internal buffers which may */
-                                                       /* cause some delays and */
-                                                       /* decrease precision of timing */
-#      define DSP_CAP_COPROC           0x00000800      /* Has a coprocessor */
-                                                       /* Sometimes it's a DSP */
-                                                       /* but usually not */
-#      define DSP_CAP_TRIGGER          0x00001000      /* Supports SETTRIGGER */
-#      define DSP_CAP_MMAP             0x00002000      /* Supports mmap() */
-#      define DSP_CAP_MULTI            0x00004000      /* support multiple open */
-#      define DSP_CAP_BIND             0x00008000      /* channel binding to front/rear/cneter/lfe */
-
-
-#define SNDCTL_DSP_GETTRIGGER          _SIOR ('P',16, int)
-#define SNDCTL_DSP_SETTRIGGER          _SIOW ('P',16, int)
-#      define PCM_ENABLE_INPUT         0x00000001
-#      define PCM_ENABLE_OUTPUT                0x00000002
-
-typedef struct count_info {
-               int bytes;      /* Total # of bytes processed */
-               int blocks;     /* # of fragment transitions since last time */
-               int ptr;        /* Current DMA pointer value */
-       } count_info;
-
-#define SNDCTL_DSP_GETIPTR             _SIOR ('P',17, count_info)
-#define SNDCTL_DSP_GETOPTR             _SIOR ('P',18, count_info)
-
-typedef struct buffmem_desc {
-               unsigned *buffer;
-               int size;
-       } buffmem_desc;
-#define SNDCTL_DSP_MAPINBUF            _SIOR ('P', 19, buffmem_desc)
-#define SNDCTL_DSP_MAPOUTBUF           _SIOR ('P', 20, buffmem_desc)
-#define SNDCTL_DSP_SETSYNCRO           _SIO  ('P', 21)
-#define SNDCTL_DSP_SETDUPLEX           _SIO  ('P', 22)
-#define SNDCTL_DSP_GETODELAY           _SIOR ('P', 23, int)
-
-#define SNDCTL_DSP_GETCHANNELMASK              _SIOWR('P', 64, int)
-#define SNDCTL_DSP_BIND_CHANNEL                _SIOWR('P', 65, int)
-#      define DSP_BIND_QUERY           0x00000000
-#      define DSP_BIND_FRONT           0x00000001
-#      define DSP_BIND_SURR            0x00000002
-#      define DSP_BIND_CENTER_LFE      0x00000004
-#      define DSP_BIND_HANDSET         0x00000008
-#      define DSP_BIND_MIC             0x00000010
-#      define DSP_BIND_MODEM1          0x00000020
-#      define DSP_BIND_MODEM2          0x00000040
-#      define DSP_BIND_I2S             0x00000080
-#      define DSP_BIND_SPDIF           0x00000100
-
-#define SNDCTL_DSP_SETSPDIF            _SIOW ('P', 66, int)
-#define SNDCTL_DSP_GETSPDIF            _SIOR ('P', 67, int)
-#      define SPDIF_PRO        0x0001
-#      define SPDIF_N_AUD      0x0002
-#      define SPDIF_COPY       0x0004
-#      define SPDIF_PRE        0x0008
-#      define SPDIF_CC         0x07f0
-#      define SPDIF_L          0x0800
-#      define SPDIF_DRS        0x4000
-#      define SPDIF_V          0x8000
-
-/*
- * Application's profile defines the way how playback underrun situations should be handled.
- * 
- *     APF_NORMAL (the default) and APF_NETWORK make the driver to cleanup the
- *     playback buffer whenever an underrun occurs. This consumes some time
- *     prevents looping the existing buffer.
- *     APF_CPUINTENS is intended to be set by CPU intensive applications which
- *     are likely to run out of time occasionally. In this mode the buffer cleanup is
- *     disabled which saves CPU time but also let's the previous buffer content to
- *     be played during the "pause" after the underrun.
- */
-#define SNDCTL_DSP_PROFILE             _SIOW ('P', 23, int)
-#define          APF_NORMAL    0       /* Normal applications */
-#define          APF_NETWORK   1       /* Underruns probably caused by an "external" delay */
-#define   APF_CPUINTENS 2      /* Underruns probably caused by "overheating" the CPU */
-
-#define SOUND_PCM_READ_RATE            _SIOR ('P', 2, int)
-#define SOUND_PCM_READ_CHANNELS                _SIOR ('P', 6, int)
-#define SOUND_PCM_READ_BITS            _SIOR ('P', 5, int)
-#define SOUND_PCM_READ_FILTER          _SIOR ('P', 7, int)
-
-/* Some alias names */
-#define SOUND_PCM_WRITE_BITS           SNDCTL_DSP_SETFMT
-#define SOUND_PCM_WRITE_RATE           SNDCTL_DSP_SPEED
-#define SOUND_PCM_POST                 SNDCTL_DSP_POST
-#define SOUND_PCM_RESET                        SNDCTL_DSP_RESET
-#define SOUND_PCM_SYNC                 SNDCTL_DSP_SYNC
-#define SOUND_PCM_SUBDIVIDE            SNDCTL_DSP_SUBDIVIDE
-#define SOUND_PCM_SETFRAGMENT          SNDCTL_DSP_SETFRAGMENT
-#define SOUND_PCM_GETFMTS              SNDCTL_DSP_GETFMTS
-#define SOUND_PCM_SETFMT               SNDCTL_DSP_SETFMT
-#define SOUND_PCM_GETOSPACE            SNDCTL_DSP_GETOSPACE
-#define SOUND_PCM_GETISPACE            SNDCTL_DSP_GETISPACE
-#define SOUND_PCM_NONBLOCK             SNDCTL_DSP_NONBLOCK
-#define SOUND_PCM_GETCAPS              SNDCTL_DSP_GETCAPS
-#define SOUND_PCM_GETTRIGGER           SNDCTL_DSP_GETTRIGGER
-#define SOUND_PCM_SETTRIGGER           SNDCTL_DSP_SETTRIGGER
-#define SOUND_PCM_SETSYNCRO            SNDCTL_DSP_SETSYNCRO
-#define SOUND_PCM_GETIPTR              SNDCTL_DSP_GETIPTR
-#define SOUND_PCM_GETOPTR              SNDCTL_DSP_GETOPTR
-#define SOUND_PCM_MAPINBUF             SNDCTL_DSP_MAPINBUF
-#define SOUND_PCM_MAPOUTBUF            SNDCTL_DSP_MAPOUTBUF
-
-/*
- * ioctl calls to be used in communication with coprocessors and
- * DSP chips.
- */
-
-typedef struct copr_buffer {
-               int command;    /* Set to 0 if not used */
-               int flags;
-#define CPF_NONE               0x0000
-#define CPF_FIRST              0x0001  /* First block */
-#define CPF_LAST               0x0002  /* Last block */
-               int len;
-               int offs;       /* If required by the device (0 if not used) */
-
-               unsigned char data[4000]; /* NOTE! 4000 is not 4k */
-       } copr_buffer;
-
-typedef struct copr_debug_buf {
-               int command;    /* Used internally. Set to 0 */
-               int parm1;
-               int parm2;
-               int flags;      
-               int len;        /* Length of data in bytes */
-       } copr_debug_buf;
-
-typedef struct copr_msg {
-               int len;
-               unsigned char data[4000];
-       } copr_msg;
-
-#define SNDCTL_COPR_RESET             _SIO  ('C',  0)
-#define SNDCTL_COPR_LOAD             _SIOWR('C',  1, copr_buffer)
-#define SNDCTL_COPR_RDATA            _SIOWR('C',  2, copr_debug_buf)
-#define SNDCTL_COPR_RCODE            _SIOWR('C',  3, copr_debug_buf)
-#define SNDCTL_COPR_WDATA            _SIOW ('C',  4, copr_debug_buf)
-#define SNDCTL_COPR_WCODE            _SIOW ('C',  5, copr_debug_buf)
-#define SNDCTL_COPR_RUN                      _SIOWR('C',  6, copr_debug_buf)
-#define SNDCTL_COPR_HALT             _SIOWR('C',  7, copr_debug_buf)
-#define SNDCTL_COPR_SENDMSG          _SIOWR('C',  8, copr_msg)
-#define SNDCTL_COPR_RCVMSG           _SIOR ('C',  9, copr_msg)
-
-/*********************************************
- * IOCTL commands for /dev/mixer
- */
-       
-/* 
- * Mixer devices
- *
- * There can be up to 20 different analog mixer channels. The
- * SOUND_MIXER_NRDEVICES gives the currently supported maximum. 
- * The SOUND_MIXER_READ_DEVMASK returns a bitmask which tells
- * the devices supported by the particular mixer.
- */
-
-#define SOUND_MIXER_NRDEVICES  25
-#define SOUND_MIXER_VOLUME     0
-#define SOUND_MIXER_BASS       1
-#define SOUND_MIXER_TREBLE     2
-#define SOUND_MIXER_SYNTH      3
-#define SOUND_MIXER_PCM                4
-#define SOUND_MIXER_SPEAKER    5
-#define SOUND_MIXER_LINE       6
-#define SOUND_MIXER_MIC                7
-#define SOUND_MIXER_CD         8
-#define SOUND_MIXER_IMIX       9       /*  Recording monitor  */
-#define SOUND_MIXER_ALTPCM     10
-#define SOUND_MIXER_RECLEV     11      /* Recording level */
-#define SOUND_MIXER_IGAIN      12      /* Input gain */
-#define SOUND_MIXER_OGAIN      13      /* Output gain */
-/* 
- * The AD1848 codec and compatibles have three line level inputs
- * (line, aux1 and aux2). Since each card manufacturer have assigned
- * different meanings to these inputs, it's inpractical to assign
- * specific meanings (line, cd, synth etc.) to them.
- */
-#define SOUND_MIXER_LINE1      14      /* Input source 1  (aux1) */
-#define SOUND_MIXER_LINE2      15      /* Input source 2  (aux2) */
-#define SOUND_MIXER_LINE3      16      /* Input source 3  (line) */
-#define SOUND_MIXER_DIGITAL1   17      /* Digital (input) 1 */
-#define SOUND_MIXER_DIGITAL2   18      /* Digital (input) 2 */
-#define SOUND_MIXER_DIGITAL3   19      /* Digital (input) 3 */
-#define SOUND_MIXER_PHONEIN    20      /* Phone input */
-#define SOUND_MIXER_PHONEOUT   21      /* Phone output */
-#define SOUND_MIXER_VIDEO      22      /* Video/TV (audio) in */
-#define SOUND_MIXER_RADIO      23      /* Radio in */
-#define SOUND_MIXER_MONITOR    24      /* Monitor (usually mic) volume */
-
-/* Some on/off settings (SOUND_SPECIAL_MIN - SOUND_SPECIAL_MAX) */
-/* Not counted to SOUND_MIXER_NRDEVICES, but use the same number space */
-#define SOUND_ONOFF_MIN                28
-#define SOUND_ONOFF_MAX                30
-
-/* Note!       Number 31 cannot be used since the sign bit is reserved */
-#define SOUND_MIXER_NONE       31
-
-/*
- * The following unsupported macros are no longer functional.
- * Use SOUND_MIXER_PRIVATE# macros in future.
- */
-#define SOUND_MIXER_ENHANCE    SOUND_MIXER_NONE
-#define SOUND_MIXER_MUTE       SOUND_MIXER_NONE
-#define SOUND_MIXER_LOUD       SOUND_MIXER_NONE
-
-
-#define SOUND_DEVICE_LABELS    {"Vol  ", "Bass ", "Trebl", "Synth", "Pcm  ", "Spkr ", "Line ", \
-                                "Mic  ", "CD   ", "Mix  ", "Pcm2 ", "Rec  ", "IGain", "OGain", \
-                                "Line1", "Line2", "Line3", "Digital1", "Digital2", "Digital3", \
-                                "PhoneIn", "PhoneOut", "Video", "Radio", "Monitor"}
-
-#define SOUND_DEVICE_NAMES     {"vol", "bass", "treble", "synth", "pcm", "speaker", "line", \
-                                "mic", "cd", "mix", "pcm2", "rec", "igain", "ogain", \
-                                "line1", "line2", "line3", "dig1", "dig2", "dig3", \
-                                "phin", "phout", "video", "radio", "monitor"}
-
-/*     Device bitmask identifiers      */
-
-#define SOUND_MIXER_RECSRC     0xff    /* Arg contains a bit for each recording source */
-#define SOUND_MIXER_DEVMASK    0xfe    /* Arg contains a bit for each supported device */
-#define SOUND_MIXER_RECMASK    0xfd    /* Arg contains a bit for each supported recording source */
-#define SOUND_MIXER_CAPS       0xfc
-#      define SOUND_CAP_EXCL_INPUT     0x00000001      /* Only one recording source at a time */
-#define SOUND_MIXER_STEREODEVS 0xfb    /* Mixer channels supporting stereo */
-#define SOUND_MIXER_OUTSRC     0xfa    /* Arg contains a bit for each input source to output */
-#define SOUND_MIXER_OUTMASK    0xf9    /* Arg contains a bit for each supported input source to output */
-
-/*     Device mask bits        */
-
-#define SOUND_MASK_VOLUME      (1 << SOUND_MIXER_VOLUME)
-#define SOUND_MASK_BASS                (1 << SOUND_MIXER_BASS)
-#define SOUND_MASK_TREBLE      (1 << SOUND_MIXER_TREBLE)
-#define SOUND_MASK_SYNTH       (1 << SOUND_MIXER_SYNTH)
-#define SOUND_MASK_PCM         (1 << SOUND_MIXER_PCM)
-#define SOUND_MASK_SPEAKER     (1 << SOUND_MIXER_SPEAKER)
-#define SOUND_MASK_LINE                (1 << SOUND_MIXER_LINE)
-#define SOUND_MASK_MIC         (1 << SOUND_MIXER_MIC)
-#define SOUND_MASK_CD          (1 << SOUND_MIXER_CD)
-#define SOUND_MASK_IMIX                (1 << SOUND_MIXER_IMIX)
-#define SOUND_MASK_ALTPCM      (1 << SOUND_MIXER_ALTPCM)
-#define SOUND_MASK_RECLEV      (1 << SOUND_MIXER_RECLEV)
-#define SOUND_MASK_IGAIN       (1 << SOUND_MIXER_IGAIN)
-#define SOUND_MASK_OGAIN       (1 << SOUND_MIXER_OGAIN)
-#define SOUND_MASK_LINE1       (1 << SOUND_MIXER_LINE1)
-#define SOUND_MASK_LINE2       (1 << SOUND_MIXER_LINE2)
-#define SOUND_MASK_LINE3       (1 << SOUND_MIXER_LINE3)
-#define SOUND_MASK_DIGITAL1    (1 << SOUND_MIXER_DIGITAL1)
-#define SOUND_MASK_DIGITAL2    (1 << SOUND_MIXER_DIGITAL2)
-#define SOUND_MASK_DIGITAL3    (1 << SOUND_MIXER_DIGITAL3)
-#define SOUND_MASK_PHONEIN     (1 << SOUND_MIXER_PHONEIN)
-#define SOUND_MASK_PHONEOUT    (1 << SOUND_MIXER_PHONEOUT)
-#define SOUND_MASK_RADIO       (1 << SOUND_MIXER_RADIO)
-#define SOUND_MASK_VIDEO       (1 << SOUND_MIXER_VIDEO)
-#define SOUND_MASK_MONITOR     (1 << SOUND_MIXER_MONITOR)
-
-/* Obsolete macros */
-#define SOUND_MASK_MUTE                (1 << SOUND_MIXER_MUTE)
-#define SOUND_MASK_ENHANCE     (1 << SOUND_MIXER_ENHANCE)
-#define SOUND_MASK_LOUD                (1 << SOUND_MIXER_LOUD)
-
-#define MIXER_READ(dev)                _SIOR('M', dev, int)
-#define SOUND_MIXER_READ_VOLUME                MIXER_READ(SOUND_MIXER_VOLUME)
-#define SOUND_MIXER_READ_BASS          MIXER_READ(SOUND_MIXER_BASS)
-#define SOUND_MIXER_READ_TREBLE                MIXER_READ(SOUND_MIXER_TREBLE)
-#define SOUND_MIXER_READ_SYNTH         MIXER_READ(SOUND_MIXER_SYNTH)
-#define SOUND_MIXER_READ_PCM           MIXER_READ(SOUND_MIXER_PCM)
-#define SOUND_MIXER_READ_SPEAKER       MIXER_READ(SOUND_MIXER_SPEAKER)
-#define SOUND_MIXER_READ_LINE          MIXER_READ(SOUND_MIXER_LINE)
-#define SOUND_MIXER_READ_MIC           MIXER_READ(SOUND_MIXER_MIC)
-#define SOUND_MIXER_READ_CD            MIXER_READ(SOUND_MIXER_CD)
-#define SOUND_MIXER_READ_IMIX          MIXER_READ(SOUND_MIXER_IMIX)
-#define SOUND_MIXER_READ_ALTPCM                MIXER_READ(SOUND_MIXER_ALTPCM)
-#define SOUND_MIXER_READ_RECLEV                MIXER_READ(SOUND_MIXER_RECLEV)
-#define SOUND_MIXER_READ_IGAIN         MIXER_READ(SOUND_MIXER_IGAIN)
-#define SOUND_MIXER_READ_OGAIN         MIXER_READ(SOUND_MIXER_OGAIN)
-#define SOUND_MIXER_READ_LINE1         MIXER_READ(SOUND_MIXER_LINE1)
-#define SOUND_MIXER_READ_LINE2         MIXER_READ(SOUND_MIXER_LINE2)
-#define SOUND_MIXER_READ_LINE3         MIXER_READ(SOUND_MIXER_LINE3)
-
-/* Obsolete macros */
-#define SOUND_MIXER_READ_MUTE          MIXER_READ(SOUND_MIXER_MUTE)
-#define SOUND_MIXER_READ_ENHANCE       MIXER_READ(SOUND_MIXER_ENHANCE)
-#define SOUND_MIXER_READ_LOUD          MIXER_READ(SOUND_MIXER_LOUD)
-
-#define SOUND_MIXER_READ_RECSRC                MIXER_READ(SOUND_MIXER_RECSRC)
-#define SOUND_MIXER_READ_DEVMASK       MIXER_READ(SOUND_MIXER_DEVMASK)
-#define SOUND_MIXER_READ_RECMASK       MIXER_READ(SOUND_MIXER_RECMASK)
-#define SOUND_MIXER_READ_STEREODEVS    MIXER_READ(SOUND_MIXER_STEREODEVS)
-#define SOUND_MIXER_READ_CAPS          MIXER_READ(SOUND_MIXER_CAPS)
-
-#define MIXER_WRITE(dev)               _SIOWR('M', dev, int)
-#define SOUND_MIXER_WRITE_VOLUME       MIXER_WRITE(SOUND_MIXER_VOLUME)
-#define SOUND_MIXER_WRITE_BASS         MIXER_WRITE(SOUND_MIXER_BASS)
-#define SOUND_MIXER_WRITE_TREBLE       MIXER_WRITE(SOUND_MIXER_TREBLE)
-#define SOUND_MIXER_WRITE_SYNTH                MIXER_WRITE(SOUND_MIXER_SYNTH)
-#define SOUND_MIXER_WRITE_PCM          MIXER_WRITE(SOUND_MIXER_PCM)
-#define SOUND_MIXER_WRITE_SPEAKER      MIXER_WRITE(SOUND_MIXER_SPEAKER)
-#define SOUND_MIXER_WRITE_LINE         MIXER_WRITE(SOUND_MIXER_LINE)
-#define SOUND_MIXER_WRITE_MIC          MIXER_WRITE(SOUND_MIXER_MIC)
-#define SOUND_MIXER_WRITE_CD           MIXER_WRITE(SOUND_MIXER_CD)
-#define SOUND_MIXER_WRITE_IMIX         MIXER_WRITE(SOUND_MIXER_IMIX)
-#define SOUND_MIXER_WRITE_ALTPCM       MIXER_WRITE(SOUND_MIXER_ALTPCM)
-#define SOUND_MIXER_WRITE_RECLEV       MIXER_WRITE(SOUND_MIXER_RECLEV)
-#define SOUND_MIXER_WRITE_IGAIN                MIXER_WRITE(SOUND_MIXER_IGAIN)
-#define SOUND_MIXER_WRITE_OGAIN                MIXER_WRITE(SOUND_MIXER_OGAIN)
-#define SOUND_MIXER_WRITE_LINE1                MIXER_WRITE(SOUND_MIXER_LINE1)
-#define SOUND_MIXER_WRITE_LINE2                MIXER_WRITE(SOUND_MIXER_LINE2)
-#define SOUND_MIXER_WRITE_LINE3                MIXER_WRITE(SOUND_MIXER_LINE3)
-
-/* Obsolete macros */
-#define SOUND_MIXER_WRITE_MUTE         MIXER_WRITE(SOUND_MIXER_MUTE)
-#define SOUND_MIXER_WRITE_ENHANCE      MIXER_WRITE(SOUND_MIXER_ENHANCE)
-#define SOUND_MIXER_WRITE_LOUD         MIXER_WRITE(SOUND_MIXER_LOUD)
-
-#define SOUND_MIXER_WRITE_RECSRC       MIXER_WRITE(SOUND_MIXER_RECSRC)
-
-typedef struct mixer_info
-{
-  char id[16];
-  char name[32];
-  int  modify_counter;
-  int fillers[10];
-} mixer_info;
-
-typedef struct _old_mixer_info /* Obsolete */
-{
-  char id[16];
-  char name[32];
-} _old_mixer_info;
-
-#define SOUND_MIXER_INFO               _SIOR ('M', 101, mixer_info)
-#define SOUND_OLD_MIXER_INFO           _SIOR ('M', 101, _old_mixer_info)
-
-/*
- * A mechanism for accessing "proprietary" mixer features. This method
- * permits passing 128 bytes of arbitrary data between a mixer application
- * and the mixer driver. Interpretation of the record is defined by
- * the particular mixer driver.
- */
-typedef unsigned char mixer_record[128];
-
-#define SOUND_MIXER_ACCESS             _SIOWR('M', 102, mixer_record)
-
-/*
- * Two ioctls for special souncard function
- */
-#define SOUND_MIXER_AGC  _SIOWR('M', 103, int)
-#define SOUND_MIXER_3DSE  _SIOWR('M', 104, int)
-
-/*
- * The SOUND_MIXER_PRIVATE# commands can be redefined by low level drivers.
- * These features can be used when accessing device specific features.
- */
-#define SOUND_MIXER_PRIVATE1           _SIOWR('M', 111, int)
-#define SOUND_MIXER_PRIVATE2           _SIOWR('M', 112, int)
-#define SOUND_MIXER_PRIVATE3           _SIOWR('M', 113, int)
-#define SOUND_MIXER_PRIVATE4           _SIOWR('M', 114, int)
-#define SOUND_MIXER_PRIVATE5           _SIOWR('M', 115, int)
-
-/*
- * SOUND_MIXER_GETLEVELS and SOUND_MIXER_SETLEVELS calls can be used
- * for querying current mixer settings from the driver and for loading
- * default volume settings _prior_ activating the mixer (loading
- * doesn't affect current state of the mixer hardware). These calls
- * are for internal use only.
- */
-
-typedef struct mixer_vol_table {
-  int num;     /* Index to volume table */
-  char name[32];
-  int levels[32];
-} mixer_vol_table;
-
-#define SOUND_MIXER_GETLEVELS          _SIOWR('M', 116, mixer_vol_table)
-#define SOUND_MIXER_SETLEVELS          _SIOWR('M', 117, mixer_vol_table)
-
-/* 
- * An ioctl for identifying the driver version. It will return value
- * of the SOUND_VERSION macro used when compiling the driver.
- * This call was introduced in OSS version 3.6 and it will not work
- * with earlier versions (returns EINVAL).
- */
-#define OSS_GETVERSION                 _SIOR ('M', 118, int)
-
-/*
- * Level 2 event types for /dev/sequencer
- */
-
-/*
- * The 4 most significant bits of byte 0 specify the class of
- * the event: 
- *
- *     0x8X = system level events,
- *     0x9X = device/port specific events, event[1] = device/port,
- *             The last 4 bits give the subtype:
- *                     0x02    = Channel event (event[3] = chn).
- *                     0x01    = note event (event[4] = note).
- *                     (0x01 is not used alone but always with bit 0x02).
- *            event[2] = MIDI message code (0x80=note off etc.)
- *
- */
-
-#define EV_SEQ_LOCAL           0x80
-#define EV_TIMING              0x81
-#define EV_CHN_COMMON          0x92
-#define EV_CHN_VOICE           0x93
-#define EV_SYSEX               0x94
-/*
- * Event types 200 to 220 are reserved for application use.
- * These numbers will not be used by the driver.
- */
-
-/*
- * Events for event type EV_CHN_VOICE
- */
-
-#define MIDI_NOTEOFF           0x80
-#define MIDI_NOTEON            0x90
-#define MIDI_KEY_PRESSURE      0xA0
-
-/*
- * Events for event type EV_CHN_COMMON
- */
-
-#define MIDI_CTL_CHANGE                0xB0
-#define MIDI_PGM_CHANGE                0xC0
-#define MIDI_CHN_PRESSURE      0xD0
-#define MIDI_PITCH_BEND                0xE0
-
-#define MIDI_SYSTEM_PREFIX     0xF0
-
-/*
- * Timer event types
- */
-#define TMR_WAIT_REL           1       /* Time relative to the prev time */
-#define TMR_WAIT_ABS           2       /* Absolute time since TMR_START */
-#define TMR_STOP               3
-#define TMR_START              4
-#define TMR_CONTINUE           5
-#define TMR_TEMPO              6
-#define TMR_ECHO               8
-#define TMR_CLOCK              9       /* MIDI clock */
-#define TMR_SPP                        10      /* Song position pointer */
-#define TMR_TIMESIG            11      /* Time signature */
-
-/*
- *     Local event types
- */
-#define LOCL_STARTAUDIO                1
-
-/*
- *     Some convenience macros to simplify programming of the
- *     /dev/sequencer interface
- *
- *     This is a legacy interface for applications written against
- *     the OSSlib-3.8 style interface. It is no longer possible
- *     to actually link against OSSlib with this header, but we
- *     still provide these macros for programs using them.
- *
- *     If you want to use OSSlib, it is recommended that you get
- *     the GPL version of OSS-4.x and build against that version
- *     of the header.
- *
- *     We redefine the extern keyword so that make headers_check
- *     does not complain about SEQ_USE_EXTBUF.
- */
-#define SEQ_DECLAREBUF()               SEQ_USE_EXTBUF()
-
-void seqbuf_dump(void);        /* This function must be provided by programs */
-
-#define SEQ_PM_DEFINES int __foo_bar___
-
-#define SEQ_LOAD_GMINSTR(dev, instr)
-#define SEQ_LOAD_GMDRUM(dev, drum)
-
-#define _SEQ_EXTERN extern
-#define SEQ_USE_EXTBUF() \
-               _SEQ_EXTERN unsigned char _seqbuf[]; \
-               _SEQ_EXTERN int _seqbuflen; _SEQ_EXTERN int _seqbufptr
-
-#ifndef USE_SIMPLE_MACROS
-/* Sample seqbuf_dump() implementation:
- *
- *     SEQ_DEFINEBUF (2048);   -- Defines a buffer for 2048 bytes
- *
- *     int seqfd;              -- The file descriptor for /dev/sequencer.
- *
- *     void
- *     seqbuf_dump ()
- *     {
- *       if (_seqbufptr)
- *         if (write (seqfd, _seqbuf, _seqbufptr) == -1)
- *           {
- *             perror ("write /dev/sequencer");
- *             exit (-1);
- *           }
- *       _seqbufptr = 0;
- *     }
- */
-
-#define SEQ_DEFINEBUF(len)             unsigned char _seqbuf[len]; int _seqbuflen = len;int _seqbufptr = 0
-#define _SEQ_NEEDBUF(len)              if ((_seqbufptr+(len)) > _seqbuflen) seqbuf_dump()
-#define _SEQ_ADVBUF(len)               _seqbufptr += len
-#define SEQ_DUMPBUF                    seqbuf_dump
-#else
-/*
- * This variation of the sequencer macros is used just to format one event
- * using fixed buffer.
- * 
- * The program using the macro library must define the following macros before
- * using this library.
- *
- * #define _seqbuf              name of the buffer (unsigned char[]) 
- * #define _SEQ_ADVBUF(len)     If the applic needs to know the exact
- *                              size of the event, this macro can be used.
- *                              Otherwise this must be defined as empty.
- * #define _seqbufptr           Define the name of index variable or 0 if
- *                              not required. 
- */
-#define _SEQ_NEEDBUF(len)      /* empty */
-#endif
-
-#define SEQ_VOLUME_MODE(dev, mode)     {_SEQ_NEEDBUF(8);\
-                                       _seqbuf[_seqbufptr] = SEQ_EXTENDED;\
-                                       _seqbuf[_seqbufptr+1] = SEQ_VOLMODE;\
-                                       _seqbuf[_seqbufptr+2] = (dev);\
-                                       _seqbuf[_seqbufptr+3] = (mode);\
-                                       _seqbuf[_seqbufptr+4] = 0;\
-                                       _seqbuf[_seqbufptr+5] = 0;\
-                                       _seqbuf[_seqbufptr+6] = 0;\
-                                       _seqbuf[_seqbufptr+7] = 0;\
-                                       _SEQ_ADVBUF(8);}
-
-/*
- * Midi voice messages
- */
-
-#define _CHN_VOICE(dev, event, chn, note, parm) \
-                                       {_SEQ_NEEDBUF(8);\
-                                       _seqbuf[_seqbufptr] = EV_CHN_VOICE;\
-                                       _seqbuf[_seqbufptr+1] = (dev);\
-                                       _seqbuf[_seqbufptr+2] = (event);\
-                                       _seqbuf[_seqbufptr+3] = (chn);\
-                                       _seqbuf[_seqbufptr+4] = (note);\
-                                       _seqbuf[_seqbufptr+5] = (parm);\
-                                       _seqbuf[_seqbufptr+6] = (0);\
-                                       _seqbuf[_seqbufptr+7] = 0;\
-                                       _SEQ_ADVBUF(8);}
-
-#define SEQ_START_NOTE(dev, chn, note, vol) \
-               _CHN_VOICE(dev, MIDI_NOTEON, chn, note, vol)
-
-#define SEQ_STOP_NOTE(dev, chn, note, vol) \
-               _CHN_VOICE(dev, MIDI_NOTEOFF, chn, note, vol)
-
-#define SEQ_KEY_PRESSURE(dev, chn, note, pressure) \
-               _CHN_VOICE(dev, MIDI_KEY_PRESSURE, chn, note, pressure)
-
-/*
- * Midi channel messages
- */
-
-#define _CHN_COMMON(dev, event, chn, p1, p2, w14) \
-                                       {_SEQ_NEEDBUF(8);\
-                                       _seqbuf[_seqbufptr] = EV_CHN_COMMON;\
-                                       _seqbuf[_seqbufptr+1] = (dev);\
-                                       _seqbuf[_seqbufptr+2] = (event);\
-                                       _seqbuf[_seqbufptr+3] = (chn);\
-                                       _seqbuf[_seqbufptr+4] = (p1);\
-                                       _seqbuf[_seqbufptr+5] = (p2);\
-                                       *(short *)&_seqbuf[_seqbufptr+6] = (w14);\
-                                       _SEQ_ADVBUF(8);}
-/*
- * SEQ_SYSEX permits sending of sysex messages. (It may look that it permits
- * sending any MIDI bytes but it's absolutely not possible. Trying to do
- * so _will_ cause problems with MPU401 intelligent mode).
- *
- * Sysex messages are sent in blocks of 1 to 6 bytes. Longer messages must be 
- * sent by calling SEQ_SYSEX() several times (there must be no other events
- * between them). First sysex fragment must have 0xf0 in the first byte
- * and the last byte (buf[len-1] of the last fragment must be 0xf7. No byte
- * between these sysex start and end markers cannot be larger than 0x7f. Also
- * lengths of each fragments (except the last one) must be 6.
- *
- * Breaking the above rules may work with some MIDI ports but is likely to
- * cause fatal problems with some other devices (such as MPU401).
- */
-#define SEQ_SYSEX(dev, buf, len) \
-                                       {int ii, ll=(len); \
-                                        unsigned char *bufp=buf;\
-                                        if (ll>6)ll=6;\
-                                       _SEQ_NEEDBUF(8);\
-                                       _seqbuf[_seqbufptr] = EV_SYSEX;\
-                                       _seqbuf[_seqbufptr+1] = (dev);\
-                                       for(ii=0;ii<ll;ii++)\
-                                          _seqbuf[_seqbufptr+ii+2] = bufp[ii];\
-                                       for(ii=ll;ii<6;ii++)\
-                                          _seqbuf[_seqbufptr+ii+2] = 0xff;\
-                                       _SEQ_ADVBUF(8);}
-
-#define SEQ_CHN_PRESSURE(dev, chn, pressure) \
-               _CHN_COMMON(dev, MIDI_CHN_PRESSURE, chn, pressure, 0, 0)
-
-#define SEQ_SET_PATCH SEQ_PGM_CHANGE
-#define SEQ_PGM_CHANGE(dev, chn, patch) \
-               _CHN_COMMON(dev, MIDI_PGM_CHANGE, chn, patch, 0, 0)
-
-#define SEQ_CONTROL(dev, chn, controller, value) \
-               _CHN_COMMON(dev, MIDI_CTL_CHANGE, chn, controller, 0, value)
-
-#define SEQ_BENDER(dev, chn, value) \
-               _CHN_COMMON(dev, MIDI_PITCH_BEND, chn, 0, 0, value)
-
-
-#define SEQ_V2_X_CONTROL(dev, voice, controller, value)        {_SEQ_NEEDBUF(8);\
-                                       _seqbuf[_seqbufptr] = SEQ_EXTENDED;\
-                                       _seqbuf[_seqbufptr+1] = SEQ_CONTROLLER;\
-                                       _seqbuf[_seqbufptr+2] = (dev);\
-                                       _seqbuf[_seqbufptr+3] = (voice);\
-                                       _seqbuf[_seqbufptr+4] = (controller);\
-                                       _seqbuf[_seqbufptr+5] = ((value)&0xff);\
-                                       _seqbuf[_seqbufptr+6] = ((value>>8)&0xff);\
-                                       _seqbuf[_seqbufptr+7] = 0;\
-                                       _SEQ_ADVBUF(8);}
-/*
- * The following 5 macros are incorrectly implemented and obsolete.
- * Use SEQ_BENDER and SEQ_CONTROL (with proper controller) instead.
- */
-#define SEQ_PITCHBEND(dev, voice, value) SEQ_V2_X_CONTROL(dev, voice, CTRL_PITCH_BENDER, value)
-#define SEQ_BENDER_RANGE(dev, voice, value) SEQ_V2_X_CONTROL(dev, voice, CTRL_PITCH_BENDER_RANGE, value)
-#define SEQ_EXPRESSION(dev, voice, value) SEQ_CONTROL(dev, voice, CTL_EXPRESSION, value*128)
-#define SEQ_MAIN_VOLUME(dev, voice, value) SEQ_CONTROL(dev, voice, CTL_MAIN_VOLUME, (value*16383)/100)
-#define SEQ_PANNING(dev, voice, pos) SEQ_CONTROL(dev, voice, CTL_PAN, (pos+128) / 2)
-
-/*
- * Timing and synchronization macros
- */
-
-#define _TIMER_EVENT(ev, parm)         {_SEQ_NEEDBUF(8);\
-                                       _seqbuf[_seqbufptr+0] = EV_TIMING; \
-                                       _seqbuf[_seqbufptr+1] = (ev); \
-                                       _seqbuf[_seqbufptr+2] = 0;\
-                                       _seqbuf[_seqbufptr+3] = 0;\
-                                       *(unsigned int *)&_seqbuf[_seqbufptr+4] = (parm); \
-                                       _SEQ_ADVBUF(8);}
-
-#define SEQ_START_TIMER()              _TIMER_EVENT(TMR_START, 0)
-#define SEQ_STOP_TIMER()               _TIMER_EVENT(TMR_STOP, 0)
-#define SEQ_CONTINUE_TIMER()           _TIMER_EVENT(TMR_CONTINUE, 0)
-#define SEQ_WAIT_TIME(ticks)           _TIMER_EVENT(TMR_WAIT_ABS, ticks)
-#define SEQ_DELTA_TIME(ticks)          _TIMER_EVENT(TMR_WAIT_REL, ticks)
-#define SEQ_ECHO_BACK(key)             _TIMER_EVENT(TMR_ECHO, key)
-#define SEQ_SET_TEMPO(value)           _TIMER_EVENT(TMR_TEMPO, value)
-#define SEQ_SONGPOS(pos)               _TIMER_EVENT(TMR_SPP, pos)
-#define SEQ_TIME_SIGNATURE(sig)                _TIMER_EVENT(TMR_TIMESIG, sig)
-
-/*
- * Local control events
- */
-
-#define _LOCAL_EVENT(ev, parm)         {_SEQ_NEEDBUF(8);\
-                                       _seqbuf[_seqbufptr+0] = EV_SEQ_LOCAL; \
-                                       _seqbuf[_seqbufptr+1] = (ev); \
-                                       _seqbuf[_seqbufptr+2] = 0;\
-                                       _seqbuf[_seqbufptr+3] = 0;\
-                                       *(unsigned int *)&_seqbuf[_seqbufptr+4] = (parm); \
-                                       _SEQ_ADVBUF(8);}
-
-#define SEQ_PLAYAUDIO(devmask)         _LOCAL_EVENT(LOCL_STARTAUDIO, devmask)
-/*
- * Events for the level 1 interface only 
- */
-
-#define SEQ_MIDIOUT(device, byte)      {_SEQ_NEEDBUF(4);\
-                                       _seqbuf[_seqbufptr] = SEQ_MIDIPUTC;\
-                                       _seqbuf[_seqbufptr+1] = (byte);\
-                                       _seqbuf[_seqbufptr+2] = (device);\
-                                       _seqbuf[_seqbufptr+3] = 0;\
-                                       _SEQ_ADVBUF(4);}
-
-/*
- * Patch loading.
- */
-#define SEQ_WRPATCH(patchx, len) \
-               {if (_seqbufptr) SEQ_DUMPBUF();\
-                if (write(seqfd, (char*)(patchx), len)==-1) \
-                   perror("Write patch: /dev/sequencer");}
-#define SEQ_WRPATCH2(patchx, len) \
-               (SEQ_DUMPBUF(), write(seqfd, (char*)(patchx), len))
-
-#endif
diff --git a/fdmdv2/branches/0.97/notes/portaudio_notes.txt b/fdmdv2/branches/0.97/notes/portaudio_notes.txt
deleted file mode 100644 (file)
index 63f1bc7..0000000
+++ /dev/null
@@ -1,481 +0,0 @@
-David Witten wittend@wwrinc.com\r
-10:17 AM (0 minutes ago)\r
-\r
-to david \r
-David,\r
-\r
-First, you mentioned audio breakups you were experiencing on Linux.\r
-My sources related to Portaudio say that this is usually a frame\r
-buffer sizing issue.  More frames introduces latency, but less can\r
-cause breakups in the flow.\r
-\r
-Short answer:  Concerning that header file, assuming that you\r
-downloaded and expanded the PortAudio source tarball (or zip file) you\r
-need a path to [ portaudio/bindings/cpp/source/portaudiocpp/ ] for\r
-your include search.\r
-\r
-You may not want to run against the default windows shared libraries.\r
-I believe that they default to WMMA, which is pretty poor.\r
-\r
-This gets you into the fun parts of building portaudio stuff.  I\r
-attaching that particular file because I can't remember if it was\r
-missing for some reason or just not in an obvious place.\r
-\r
-I have notes about portaudio in fdmdv2/notes,  but the upshot is that\r
-I built the main dll with:\r
-\r
- ./configure --with-winapi=directx --with-dxdir=/dxsdk\r
---enable-cxx=yes --enable-shared=yes  --with-host_os=mingw\r
-make\r
-make install\r
-\r
-This puts the libfiles in predictable places in msys's little\r
-universe, so that they can be found by the linker.  This does not\r
-necessarily make them easy to find when you want to run fdmdv2 from\r
-the desktop, so I usually move a copy to wherever I am trying to run\r
-fdmdv2 from.\r
-\r
-I intend to clean up some of this business before I'm done, but the\r
-project as it stands uses portaudio in two ways.  The main structure\r
-of the program accesses portaudio through a thin wrapper that I wrote\r
-(fdmdv_pa_wrapper.h).  The current (largely non-functional)  audio\r
-configuration dialog uses the portaudiocpp binding wrapper provided by\r
-the portaudio bundle.  The code for it lives in [\r
-portaudio/bindings/cpp ] and involves a separate Makefile that lives\r
-in there.  There is no good reason for this, it is the consequence of\r
-multiple strategies I explored.\r
-\r
-Portaudio *can* be built in a way that supports multiple Windows sound\r
-APIs simultaneously.  The FLDigi people seem to have done this.  If\r
-you drop in the dll's lifted from a recent DLDigi implementation for\r
-Windows, GCC will link with them and will see all of the APS's\r
-available.  I posted the question of how to build the DLLs myself in\r
-this way on the appropriate portaudio list and was told that it could\r
-only be done using SCons.  I decided that life was too short for that\r
-right now and just built the dlls for direct sound, which has good\r
-latency and is supported by Microsoft.\r
-\r
-Even restricting myself to DirectSound, I found that things were *not*\r
-completely simple.  I had to locate a version of the direct sound SDK\r
-that had stuff where the build expected it to be.  The most current\r
-ones did not seem to work. I can zip this up and put it into the SVN,\r
-but it is MS's code.\r
-\r
-I also built libraries for ASIO, WMMA, and other options early on, but\r
-it seemed somewhat pointless at that point.  The ones I am using are\r
-just for DirectSound.  I can use the ones from FLDigi if I want.  You\r
-will find my built DLLs scattered around the build, often in the\r
-/Release subfolders.  This is sloppy but is just for my convenience.\r
-\r
-Good luck,\r
-\r
-Dave\r
-\r
-===========================================\r
-!!! Track record trying to build PortAudio\r
-===========================================\r
-\r
-build:\r
-make clean\r
-./configure ...\r
-make\r
-make install\r
-\r
-\r
- ./configure --with-winapi=wmme --with-winapi=directx --with-winapi=asio --with-winapi=wasapi --with-asiodir=/p/Radio/ASIOSDK2 --with-dxdir=/p/Radio/dx7sdk --enable-cxx=yes --enable-shared=yes\r
-\r
-!!! didn't work !!! (Only configured wmme)!\r
-===========================================\r
-\r
-Trying:\r
-\r
- ./configure --with-winapi=directx --with-dxdir=/p/Radio/dx7sdk --enable-cxx=yes --enable-shared=yes  --with-host_os=mingw\r
-\r
- !!! didn't work !!! (build failed) \r
-===========================================\r
-\r
-Try ASIO:\r
\r
-./configure --with-winapi=asio  --with-asiodir=/p/Radio/ASIOSDK2  --enable-cxx=yes --enable-shared=yes --with-host_os=mingw\r
-\r
-Configuration summary:\r
-\r
-  Target ...................... i686-pc-mingw32\r
-  C++ bindings ................ yes\r
-  Debug output ................ no\r
-\r
-  WMME ........................ no\r
-  DSound ...................... no\r
-  ASIO ........................ yes (/p/Radio/ASIOSDK2)\r
-  WASAPI ...................... no\r
-  WDMKS ....................... no\r
-\r
-\r
- !!! didn't work !!! (build failed libtool errors, It wants a uuid file, and it wants to find a copy of libportaudio.dll.la in /usr/lib !!???)\r
-===========================================\r
-Final lines of the build:\r
-\r
-/bin/sh ./libtool --mode=compile --tag=CXX g++ -c -g -O2 -DPA_LITTLE_ENDIAN -I./include -I./src/common -I./src/os/win -DPA_USE_WMME=\r
-0 -DPA_USE_ASIO=0 -DPA_USE_WDMKS=0 -DPA_USE_DS=0 -DPA_USE_WASAPI=0 -ffast-math -fomit-frame-pointer -I./src/hostapi/asio -I/p/Radio/\r
-ASIOSDK2/host/pc -I/p/Radio/ASIOSDK2/common -I/p/Radio/ASIOSDK2/host -UPA_USE_ASIO -DPA_USE_ASIO=1 -DWINDOWS -D_WIN32_WINNT=0x0501 -\r
-DWINVER=0x0501 /p/Radio/ASIOSDK2/host/pc/asiolist.cpp -o /p/Radio/ASIOSDK2/host/pc/asiolist.lo\r
-libtool: compile:  g++ -c -g -O2 -DPA_LITTLE_ENDIAN -I./include -I./src/common -I./src/os/win -DPA_USE_WMME=0 -DPA_USE_ASIO=0 -DPA_U\r
-SE_WDMKS=0 -DPA_USE_DS=0 -DPA_USE_WASAPI=0 -ffast-math -fomit-frame-pointer -I./src/hostapi/asio -I/p/Radio/ASIOSDK2/host/pc -I/p/Ra\r
-dio/ASIOSDK2/common -I/p/Radio/ASIOSDK2/host -UPA_USE_ASIO -DPA_USE_ASIO=1 -DWINDOWS -D_WIN32_WINNT=0x0501 -DWINVER=0x0501 /p/Radio/\r
-ASIOSDK2/host/pc/asiolist.cpp  -DDLL_EXPORT -DPIC -o /p/Radio/ASIOSDK2/host/pc/.libs/asiolist.o\r
-libtool: compile:  g++ -c -g -O2 -DPA_LITTLE_ENDIAN -I./include -I./src/common -I./src/os/win -DPA_USE_WMME=0 -DPA_USE_ASIO=0 -DPA_U\r
-SE_WDMKS=0 -DPA_USE_DS=0 -DPA_USE_WASAPI=0 -ffast-math -fomit-frame-pointer -I./src/hostapi/asio -I/p/Radio/ASIOSDK2/host/pc -I/p/Ra\r
-dio/ASIOSDK2/common -I/p/Radio/ASIOSDK2/host -UPA_USE_ASIO -DPA_USE_ASIO=1 -DWINDOWS -D_WIN32_WINNT=0x0501 -DWINVER=0x0501 /p/Radio/\r
-ASIOSDK2/host/pc/asiolist.cpp -o /p/Radio/ASIOSDK2/host/pc/asiolist.o >/dev/null 2>&1\r
-/bin/sh ./libtool --mode=link --tag=CXX g++  -shared -rpath /usr/local/lib -no-undefined -export-symbols-regex "(Pa|PaMacCore|PaJack\r
-|PaAlsa|PaAsio|PaOSS)_.*" -version-info 2:0:0 -o lib/libportaudio.la src/common/pa_allocation.lo src/common/pa_converters.lo src/com\r
-mon/pa_cpuload.lo src/common/pa_dither.lo src/common/pa_debugprint.lo src/common/pa_front.lo src/common/pa_process.lo src/common/pa_\r
-stream.lo src/common/pa_trace.lo src/hostapi/skeleton/pa_hostapi_skeleton.lo src/hostapi/asio/pa_asio.lo src/common/pa_ringbuffer.lo\r
- src/os/win/pa_win_hostapis.lo src/os/win/pa_win_util.lo src/os/win/pa_win_coinitialize.lo src/hostapi/asio/iasiothiscallresolver.lo\r
- /p/Radio/ASIOSDK2/common/asio.lo /p/Radio/ASIOSDK2/host/asiodrivers.lo /p/Radio/ASIOSDK2/host/pc/asiolist.lo -lwinmm -lm -lole32 -l\r
-uuid\r
-\r
-*** Warning: linker path does not have real file for library -luuid.\r
-*** I have the capability to make that library automatically link in when\r
-*** you link to this library.  But I can only do this if you have a\r
-*** shared version of the library, which you do not appear to have\r
-*** because I did check the linker path looking for a file starting\r
-*** with libuuid and none of the candidates passed a file format test\r
-*** using a file magic. Last file checked: /mingw/lib/libuuid.a\r
-*** The inter-library dependencies that have been dropped here will be\r
-*** automatically added whenever a program is linked with this library\r
-*** or is declared to -dlopen it.\r
-\r
-*** Since this library must not contain undefined symbols,\r
-*** because either the platform does not support them or\r
-*** it was explicitly requested with -no-undefined,\r
-*** libtool will only create a static version of it.\r
-libtool: link: /mingw/bin/ar cru lib/.libs/libportaudio.a src/common/.libs/pa_allocation.o src/common/.libs/pa_converters.o src/comm\r
-on/.libs/pa_cpuload.o src/common/.libs/pa_dither.o src/common/.libs/pa_debugprint.o src/common/.libs/pa_front.o src/common/.libs/pa_\r
-process.o src/common/.libs/pa_stream.o src/common/.libs/pa_trace.o src/hostapi/skeleton/.libs/pa_hostapi_skeleton.o src/hostapi/asio\r
-/.libs/pa_asio.o src/common/.libs/pa_ringbuffer.o src/os/win/.libs/pa_win_hostapis.o src/os/win/.libs/pa_win_util.o src/os/win/.libs\r
-/pa_win_coinitialize.o src/hostapi/asio/.libs/iasiothiscallresolver.o /p/Radio/ASIOSDK2/common/.libs/asio.o /p/Radio/ASIOSDK2/host/.\r
-libs/asiodrivers.o /p/Radio/ASIOSDK2/host/pc/.libs/asiolist.o\r
-libtool: link: ranlib lib/.libs/libportaudio.a\r
-libtool: link: ( cd "lib/.libs" && rm -f "libportaudio.la" && cp -p "../libportaudio.la" "libportaudio.la" )\r
-if test -n " bindings/cpp" ; then for dir in " bindings/cpp"; do make -C $dir all; done ; fi\r
-make[1]: Entering directory `/p/Radio/portaudio/bindings/cpp'\r
-Making all in lib\r
-make[2]: Entering directory `/p/Radio/portaudio/bindings/cpp/lib'\r
-/bin/sh ../libtool --tag=CXX   --mode=link g++  -g -O2 -Wall -ansi -pedantic -version-info 0:12:0 -no-undefined  -o libportaudiocpp.\r
-la -rpath /usr/local/lib BlockingStream.lo CallbackInterface.lo CallbackStream.lo CFunCallbackStream.lo CppFunCallbackStream.lo Devi\r
-ce.lo DirectionSpecificStreamParameters.lo Exception.lo HostApi.lo InterfaceCallbackStream.lo MemFunCallbackStream.lo Stream.lo Stre\r
-amParameters.lo System.lo SystemDeviceIterator.lo SystemHostApiIterator.lo ../../../lib/libportaudio.la\r
-\r
-*** Warning: This system can not link to static lib archive ../../../lib/libportaudio.la.\r
-*** I have the capability to make that library automatically link in when\r
-*** you link to this library.  But I can only do this if you have a\r
-*** shared version of the library, which you do not appear to have.\r
-libtool: link: rm -fr  .libs/libportaudiocpp.dll.a\r
-libtool: link: g++ -shared -nostdlib c:/bin/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../dllcrt2.o c:/bin/mingw/bin/../lib/gcc/mingw3\r
-2/4.6.2/crtbegin.o  .libs/BlockingStream.o .libs/CallbackInterface.o .libs/CallbackStream.o .libs/CFunCallbackStream.o .libs/CppFunC\r
-allbackStream.o .libs/Device.o .libs/DirectionSpecificStreamParameters.o .libs/Exception.o .libs/HostApi.o .libs/InterfaceCallbackSt\r
-ream.o .libs/MemFunCallbackStream.o .libs/Stream.o .libs/StreamParameters.o .libs/System.o .libs/SystemDeviceIterator.o .libs/System\r
-HostApiIterator.o   -Lc:/bin/mingw/bin/../lib/gcc/mingw32/4.6.2 -Lc:/bin/mingw/bin/../lib/gcc -Lc:/bin/mingw/bin/../lib/gcc/mingw32/\r
-4.6.2/../../../../mingw32/lib -Lc:/bin/mingw/bin/../lib/gcc/mingw32/4.6.2/../../.. -lstdc++ -lmingw32 -lgcc_s -lgcc -lmoldname -lmin\r
-gwex -lmsvcrt -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt c:/bin/mingw/bin/../lib\r
-/gcc/mingw32/4.6.2/crtend.o  -O2   -o .libs/libportaudiocpp-0.dll -Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker .libs/\r
-libportaudiocpp.dll.a\r
-Creating library file: .libs/libportaudiocpp.dll.a\r
-.libs/BlockingStream.o: In function `ZN9portaudio14BlockingStream4openERKNS_16StreamParametersE':\r
-C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/BlockingStream.cxx:39: undefined reference to `Pa_\r
-OpenStream'\r
-.libs/BlockingStream.o: In function `ZN9portaudio14BlockingStream4readEPvm':\r
-C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/BlockingStream.cxx:51: undefined reference to `Pa_\r
-ReadStream'\r
-.libs/BlockingStream.o: In function `ZN9portaudio14BlockingStream5writeEPKvm':\r
-C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/BlockingStream.cxx:61: undefined reference to `Pa_\r
-WriteStream'\r
-.libs/BlockingStream.o: In function `ZNK9portaudio14BlockingStream17availableReadSizeEv':\r
-C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/BlockingStream.cxx:73: undefined reference to `Pa_\r
-GetStreamReadAvailable'\r
-.libs/BlockingStream.o: In function `ZNK9portaudio14BlockingStream18availableWriteSizeEv':\r
-C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/BlockingStream.cxx:85: undefined reference to `Pa_\r
-GetStreamWriteAvailable'\r
-.libs/CallbackStream.o: In function `ZNK9portaudio14CallbackStream7cpuLoadEv':\r
-C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/CallbackStream.cxx:17: undefined reference to `Pa_\r
-GetStreamCpuLoad'\r
-.libs/CFunCallbackStream.o: In function `ZN9portaudio18CFunCallbackStream4openERKNS_16StreamParametersEPFiPKvPvmPK24PaStreamCallback\r
-TimeInfomS6_ES6_':\r
-C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/CFunCallbackStream.cxx:34: undefined reference to\r
-`Pa_OpenStream'\r
-.libs/CppFunCallbackStream.o: In function `ZN9portaudio17FunCallbackStream4openERKNS_16StreamParametersE':\r
-C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/CppFunCallbackStream.cxx:72: undefined reference t\r
-o `Pa_OpenStream'\r
-.libs/Device.o: In function `Device':\r
-C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/Device.cxx:19: undefined reference to `Pa_GetDevic\r
-eInfo'\r
-.libs/Exception.o: In function `ZNK9portaudio11PaException11paErrorTextEv':\r
-C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/Exception.cxx:41: undefined reference to `Pa_GetEr\r
-rorText'\r
-.libs/Exception.o: In function `ZNK9portaudio11PaException16lastHostApiErrorEv':\r
-C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/Exception.cxx:58: undefined reference to `Pa_GetLa\r
-stHostErrorInfo'\r
-.libs/Exception.o: In function `ZNK9portaudio11PaException20lastHostApiErrorTextEv':\r
-C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/Exception.cxx:68: undefined reference to `Pa_GetLa\r
-stHostErrorInfo'\r
-.libs/Exception.o: In function `ZNK9portaudio11PaException11paErrorTextEv':\r
-C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/Exception.cxx:41: undefined reference to `Pa_GetEr\r
-rorText'\r
-.libs/HostApi.o: In function `HostApi':\r
-C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/HostApi.cxx:17: undefined reference to `Pa_GetHost\r
-ApiInfo'\r
-C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/HostApi.cxx:26: undefined reference to `Pa_HostApi\r
-DeviceIndexToDeviceIndex'\r
-.libs/HostApi.o: In function `ZNK9portaudio7HostApi5indexEv':\r
-C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/HostApi.cxx:61: undefined reference to `Pa_HostApi\r
-TypeIdToHostApiIndex'\r
-.libs/InterfaceCallbackStream.o: In function `ZN9portaudio23InterfaceCallbackStream4openERKNS_16StreamParametersERNS_17CallbackInter\r
-faceE':\r
-C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/InterfaceCallbackStream.cxx:38: undefined referenc\r
-e to `Pa_OpenStream'\r
-.libs/Stream.o: In function `ZN9portaudio6Stream5closeEv':\r
-C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/Stream.cxx:33: undefined reference to `Pa_CloseStr\r
-eam'\r
-.libs/Stream.o: In function `ZN9portaudio6Stream25setStreamFinishedCallbackEPFvPvE':\r
-C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/Stream.cxx:53: undefined reference to `Pa_SetStrea\r
-mFinishedCallback'\r
-.libs/Stream.o: In function `ZN9portaudio6Stream5startEv':\r
-C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/Stream.cxx:63: undefined reference to `Pa_StartStr\r
-eam'\r
-.libs/Stream.o: In function `ZN9portaudio6Stream4stopEv':\r
-C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/Stream.cxx:71: undefined reference to `Pa_StopStre\r
-am'\r
-.libs/Stream.o: In function `ZN9portaudio6Stream5abortEv':\r
-C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/Stream.cxx:79: undefined reference to `Pa_AbortStr\r
-eam'\r
-.libs/Stream.o: In function `ZNK9portaudio6Stream9isStoppedEv':\r
-C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/Stream.cxx:87: undefined reference to `Pa_IsStream\r
-Stopped'\r
-.libs/Stream.o: In function `ZNK9portaudio6Stream8isActiveEv':\r
-C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/Stream.cxx:97: undefined reference to `Pa_IsStream\r
-Active'\r
-.libs/Stream.o: In function `ZNK9portaudio6Stream12inputLatencyEv':\r
-C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/Stream.cxx:115: undefined reference to `Pa_GetStre\r
-amInfo'\r
-.libs/Stream.o: In function `ZNK9portaudio6Stream13outputLatencyEv':\r
-C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/Stream.cxx:133: undefined reference to `Pa_GetStre\r
-amInfo'\r
-.libs/Stream.o: In function `ZNK9portaudio6Stream10sampleRateEv':\r
-C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/Stream.cxx:152: undefined reference to `Pa_GetStre\r
-amInfo'\r
-.libs/Stream.o: In function `ZNK9portaudio6Stream4timeEv':\r
-C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/Stream.cxx:166: undefined reference to `Pa_GetStre\r
-amTime'\r
-.libs/StreamParameters.o: In function `ZNK9portaudio16StreamParameters11isSupportedEv':\r
-C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/StreamParameters.cxx:103: undefined reference to `\r
-Pa_IsFormatSupported'\r
-.libs/System.o: In function `ZN9portaudio6System14defaultHostApiEv':\r
-C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/System.cxx:165: undefined reference to `Pa_GetDefa\r
-ultHostApi'\r
-.libs/System.o: In function `ZN9portaudio6System15hostApiByTypeIdE15PaHostApiTypeId':\r
-C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/System.cxx:175: undefined reference to `Pa_HostApi\r
-TypeIdToHostApiIndex'\r
-.libs/System.o: In function `ZN9portaudio6System12hostApiCountEv':\r
-C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/System.cxx:193: undefined reference to `Pa_GetHost\r
-ApiCount'\r
-.libs/System.o: In function `ZN9portaudio6System11deviceCountEv':\r
-C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/System.cxx:261: undefined reference to `Pa_GetDevi\r
-ceCount'\r
-.libs/System.o: In function `ZN9portaudio6System19defaultOutputDeviceEv':\r
-C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/System.cxx:237: undefined reference to `Pa_GetDefa\r
-ultOutputDevice'\r
-.libs/System.o: In function `ZN9portaudio6System18defaultInputDeviceEv':\r
-C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/System.cxx:227: undefined reference to `Pa_GetDefa\r
-ultInputDevice'\r
-.libs/System.o: In function `ZN9portaudio6System10initializeEv':\r
-C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/System.cxx:48: undefined reference to `Pa_Initiali\r
-ze'\r
-.libs/System.o: In function `ZN9portaudio6System9terminateEv':\r
-C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/System.cxx:118: undefined reference to `Pa_Termina\r
-te'\r
-.libs/System.o: In function `ZN9portaudio6System12sizeOfSampleEm':\r
-C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/System.cxx:283: undefined reference to `Pa_GetSamp\r
-leSize'\r
-.libs/System.o: In function `ZN9portaudio6System7versionEv':\r
-C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/System.cxx:28: undefined reference to `Pa_GetVersi\r
-on'\r
-.libs/System.o: In function `ZN9portaudio6System11versionTextEv':\r
-C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/System.cxx:33: undefined reference to `Pa_GetVersi\r
-onText'\r
-.libs/System.o: In function `ZN9portaudio6System5sleepEl':\r
-C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/System.cxx:278: undefined reference to `Pa_Sleep'\r
-collect2: ld returned 1 exit status\r
-make[2]: *** [libportaudiocpp.la] Error 1\r
-make[2]: Leaving directory `/p/Radio/portaudio/bindings/cpp/lib'\r
-make[1]: *** [all-recursive] Error 1\r
-make[1]: Leaving directory `/p/Radio/portaudio/bindings/cpp'\r
-make: *** [all-recursive] Error 2\r
\r
-\r
-Try a static build & DSound:\r
-===========================================\r
- ./configure  --with-winapi=directx  --with-dxdir=/p/Radio/dx7sdk --enable-cxx=yes --enable-shared=no  --with-host_os=mingw\r
-\r
-As usual with DSound, configure goes Ok, but the last build messages I get are:\r
-/bin/sh ./libtool --mode=compile gcc -c -g -O2 -DPA_LITTLE_ENDIAN -I./include -I./src/common -I./src/os/win -DPA_USE_WMME=0 -DPA_USE\r
-_ASIO=0 -DPA_USE_WDMKS=0 -DPA_USE_DS=0 -DPA_USE_WASAPI=0 -I/p/Radio/dx7sdk/include -UPA_USE_DS -DPA_USE_DS=1 -mthreads -DPACKAGE_NAM\r
-E=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DSTDC_HEADER\r
-S=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPE\r
-S_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DLT_OBJDIR=\".libs/\" -DSIZEOF_SHORT=2 -DSIZEOF_INT=4 -DSIZEOF_LONG=4 src/hostapi/dsound/\r
-pa_win_ds.c -o src/hostapi/dsound/pa_win_ds.lo\r
-libtool: compile:  gcc -c -g -O2 -DPA_LITTLE_ENDIAN -I./include -I./src/common -I./src/os/win -DPA_USE_WMME=0 -DPA_USE_ASIO=0 -DPA_U\r
-SE_WDMKS=0 -DPA_USE_DS=0 -DPA_USE_WASAPI=0 -I/p/Radio/dx7sdk/include -UPA_USE_DS -DPA_USE_DS=1 -mthreads -DPACKAGE_NAME=\"\" -DPACKA\r
-GE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS\r
-_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_S\r
-TDINT_H=1 -DHAVE_UNISTD_H=1 -DLT_OBJDIR=\".libs/\" -DSIZEOF_SHORT=2 -DSIZEOF_INT=4 -DSIZEOF_LONG=4 src/hostapi/dsound/pa_win_ds.c -o\r
- src/hostapi/dsound/pa_win_ds.o\r
-src/hostapi/dsound/pa_win_ds.c:68:20: fatal error: dsound.h: No such file or directory\r
-compilation terminated.\r
-make: *** [src/hostapi/dsound/pa_win_ds.lo] Error 1\r
-\r
\r
-Try a static build& ASIO:\r
-===========================================\r
-\r
-./configure --with-winapi=asio  --with-asiodir=/p/Radio/ASIOSDK2  --enable-cxx=yes --enable-shared=no --with-host_os=mingw\r
-\r
-\r
-Configuration summary:\r
-\r
-  Target ...................... i686-pc-mingw32\r
-  C++ bindings ................ yes\r
-  Debug output ................ no\r
-\r
-  WMME ........................ no\r
-  DSound ...................... no\r
-  ASIO ........................ yes (/p/Radio/ASIOSDK2)\r
-  WASAPI ...................... no\r
-  WDMKS ....................... no\r
-\r
-This one Worked!\r
-====================\r
-====================\r
-\r
-next:\r
-\r
-$ make install\r
-/bin/install -c -d /usr/local/lib\r
-/bin/sh ./libtool --mode=install /bin/install -c lib/libportaudio.la /usr/local/lib\r
-libtool: install: /bin/install -c lib/.libs/libportaudio.lai /usr/local/lib/libportaudio.la\r
-libtool: install: /bin/install -c lib/.libs/libportaudio.a /usr/local/lib/libportaudio.a\r
-libtool: install: chmod 644 /usr/local/lib/libportaudio.a\r
-libtool: install: ranlib /usr/local/lib/libportaudio.a\r
-/bin/install -c -d /usr/local/include\r
-for include in portaudio.h; do \\r
-                /bin/install -c -m 644 -m 644 ./include/$include /usr/local/include/$include; \\r
-        done\r
-/bin/install -c -d /usr/local/lib/pkgconfig\r
-/bin/install -c -m 644 portaudio-2.0.pc /usr/local/lib/pkgconfig/portaudio-2.0.pc\r
-\r
-------------------------------------------------------------\r
-PortAudio was successfully installed.\r
-\r
-On some systems (e.g. Linux) you should run 'ldconfig' now\r
-to make the shared object available.  You may also need to\r
-modify your LD_LIBRARY_PATH environment variable to include\r
-the directory /usr/local/lib\r
-------------------------------------------------------------\r
-\r
-make install-recursive\r
-make[1]: Entering directory `/p/Radio/portaudio'\r
-if test -n " bindings/cpp" ; then for dir in " bindings/cpp"; do make -C $dir install; done ; fi\r
-make[2]: Entering directory `/p/Radio/portaudio/bindings/cpp'\r
-Making install in lib\r
-make[3]: Entering directory `/p/Radio/portaudio/bindings/cpp/lib'\r
-make[4]: Entering directory `/p/Radio/portaudio/bindings/cpp/lib'\r
-test -z "/usr/local/lib" || /bin/mkdir -p "/usr/local/lib"\r
- /bin/sh ../libtool   --mode=install /bin/install -c   libportaudiocpp.la '/usr/local/lib'\r
-libtool: install: /bin/install -c .libs/libportaudiocpp.lai /usr/local/lib/libportaudiocpp.la\r
-libtool: install: /bin/install -c .libs/libportaudiocpp.a /usr/local/lib/libportaudiocpp.a\r
-libtool: install: chmod 644 /usr/local/lib/libportaudiocpp.a\r
-libtool: install: ranlib /usr/local/lib/libportaudiocpp.a\r
-make[4]: Nothing to be done for `install-data-am'.\r
-make[4]: Leaving directory `/p/Radio/portaudio/bindings/cpp/lib'\r
-make[3]: Leaving directory `/p/Radio/portaudio/bindings/cpp/lib'\r
-Making install in include\r
-make[3]: Entering directory `/p/Radio/portaudio/bindings/cpp/include'\r
-make[4]: Entering directory `/p/Radio/portaudio/bindings/cpp/include'\r
-make[4]: Nothing to be done for `install-exec-am'.\r
-test -z "/usr/local/include/portaudiocpp" || /bin/mkdir -p "/usr/local/include/portaudiocpp"\r
- /bin/install -c -m 644 portaudiocpp/AutoSystem.hxx portaudiocpp/BlockingStream.hxx portaudiocpp/CallbackInterface.hxx portaudiocpp/\r
-CallbackStream.hxx portaudiocpp/CFunCallbackStream.hxx portaudiocpp/CppFunCallbackStream.hxx portaudiocpp/Device.hxx portaudiocpp/Di\r
-rectionSpecificStreamParameters.hxx portaudiocpp/Exception.hxx portaudiocpp/HostApi.hxx portaudiocpp/InterfaceCallbackStream.hxx por\r
-taudiocpp/MemFunCallbackStream.hxx portaudiocpp/PortAudioCpp.hxx portaudiocpp/SampleDataFormat.hxx portaudiocpp/Stream.hxx portaudio\r
-cpp/StreamParameters.hxx portaudiocpp/SystemDeviceIterator.hxx portaudiocpp/SystemHostApiIterator.hxx portaudiocpp/System.hxx '/usr/\r
-local/include/portaudiocpp'\r
-make[4]: Leaving directory `/p/Radio/portaudio/bindings/cpp/include'\r
-make[3]: Leaving directory `/p/Radio/portaudio/bindings/cpp/include'\r
-Making install in bin\r
-make[3]: Entering directory `/p/Radio/portaudio/bindings/cpp/bin'\r
-make[4]: Entering directory `/p/Radio/portaudio/bindings/cpp/bin'\r
-make[4]: Nothing to be done for `install-exec-am'.\r
-make[4]: Nothing to be done for `install-data-am'.\r
-make[4]: Leaving directory `/p/Radio/portaudio/bindings/cpp/bin'\r
-make[3]: Leaving directory `/p/Radio/portaudio/bindings/cpp/bin'\r
-make[3]: Entering directory `/p/Radio/portaudio/bindings/cpp'\r
-make[4]: Entering directory `/p/Radio/portaudio/bindings/cpp'\r
-make[4]: Nothing to be done for `install-exec-am'.\r
-test -z "/usr/local/lib/pkgconfig" || /bin/mkdir -p "/usr/local/lib/pkgconfig"\r
- /bin/install -c -m 644 portaudiocpp.pc '/usr/local/lib/pkgconfig'\r
-make[4]: Leaving directory `/p/Radio/portaudio/bindings/cpp'\r
-make[3]: Leaving directory `/p/Radio/portaudio/bindings/cpp'\r
-make[2]: Leaving directory `/p/Radio/portaudio/bindings/cpp'\r
-make[1]: Leaving directory `/p/Radio/portaudio'\r
-  \r
-  \r
-Trying both Direct Sound & Asio at the same time dynamicly:\r
-============================================================\r
-$ ./configure  --with-winapi=directx  --with-dxdir=/p/Radio/dx7sdk --with-winapi=asio  --with-asiodir=/p/Radio/ASIOSDK2  --enable-c\r
-xx=yes --enable-shared=yes  --with-host_os=mingw\r
-\r
-Configuration summary:\r
-\r
-  Target ...................... i686-pc-mingw32\r
-  C++ bindings ................ yes\r
-  Debug output ................ no\r
-\r
-  WMME ........................ no\r
-  DSound ...................... no\r
-  ASIO ........................ yes (/p/Radio/ASIOSDK2)\r
-  WASAPI ...................... no\r
-  WDMKS ....................... no\r
-  \r
-Fail!  configures only the last specified API (ASIO)\r
-\r
-\r
-Trying just Dsound:\r
-============================================================\r
-\r
-moved the DirectX sdk into c:/bin/ms_dxsdk/\r
-then mapped /bin/ms_dxsdk to /dxsdkin msys's /etc/fstab file.\r
-moved sal.h from MSVC10/include into /dxsdk/include.\r
-then did:\r
-\r
- ./configure --with-winapi=directx --with-dxdir=/dxsdk --enable-cxx=yes --enable-shared=yes  --with-host_os=mingw\r
-\r
-got:\r
\r
-Configuration summary:\r
-\r
-  Target ...................... i686-pc-mingw32\r
-  C++ bindings ................ yes\r
-  Debug output ................ no\r
-\r
-  WMME ........................ no\r
-  DSound ...................... yes (/dxsdk)\r
-  ASIO ........................ no\r
-  WASAPI ...................... no\r
-  WDMKS ....................... no\r
-\r
-and did: \r
-\r
-  make\r
-\r
-  Everything seemed to work! Finally!\r
-  \r
diff --git a/fdmdv2/branches/0.97/obsolete/README.Win32 b/fdmdv2/branches/0.97/obsolete/README.Win32
deleted file mode 100644 (file)
index 3fc3f28..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-README.Win32\r
-David Rowe 27 Oct 2012\r
-\r
-Debugging Under Windows\r
------------------------\r
-\r
-printfs don't appear until after the program finishes.  wxLogDebug()\r
-works but you need to run DebugView available from\r
-http://www.sysinternals.com to capture the messages.\r
-\r
-Building fdmdv2 for Windows\r
----------------------------\r
-\r
-This is how David R did it, Dave Witten used a different approach.\r
-Many variations are possible.\r
-\r
-1. Install MinGW & the mysys shell\r
-   + pwd -W prints true Win32 directory\r
-   + I also installed emacs, "tortise svn", and DebugView\r
-\r
-2. "make install" for various packages below put DLLs in /usr/local/lib\r
-   "cd /usr/local/lib; pwd -W" to find the Win32 directory\r
-   add this to the Windows PATH (Control Panel - System - Advanced)\r
-\r
-3. WxWidgets:\r
-   download 2.9.4 tar ball\r
-   mkdir build-debug; cd build-debug\r
-   ./configure --with-msw\r
-   make && make install\r
-\r
-4. PortAudio:\r
-   download latest V19\r
-   ./configure --enable-cxx\r
-   make && make install\r
-\r
-5. libsndfile:\r
-   download lastest source tar ball (not Win32 binaries)\r
-   ./configure && make && make install\r
-\r
-6. libsamplerate:\r
-   download latest source tar ball:\r
-       http://www.mega-nerd.com/SRC/libsamplerate-0.1.8.tar.gz(not Win32 binaries)\r
-   ./configure && make && make install\r
-\r
-7. hamlib\r
-\r
-   I couldn't get this to compile from source, so used the pre-built Win32\r
-   DLLs:\r
-\r
-   Download https://downloads.sourceforge.net/project/hamlib/hamlib/1.2.15.3/hamlib-win32-1.2.15.3.zip\r
-   Open hamlib-win32-1.2.15.3.zip with a GUI archive tool\r
-   Copy hamlib/include/* to /usr/local/include\r
-   Copy hamlib/bin/hamlib*.dll to /usr/local/lib\r
-   Copy hamlib/lib/gcc to /usr/local/lib\r
-\r
-8. sox (used for Filter - EQ)\r
-\r
-   $ wget http://sourceforge.net/projects/sox/files/sox/14.4.0/sox-14.4.0.tar.gz\r
-   $ tar xvzf sox-14.4.0.tar.gz\r
-   $ ./configure --enable-shared=no --without-id3tag --without-png --disable-gomp --with-oggvorbis=no --with-oss=no --with-flac=no --disable-dl-sndfile --with-waveaudio=no\r
-   $ make && make install\r
-\r
-   I couldn't find an install command line that worked, so manually copied the libs and include files.\r
-\r
-9. Codec 2\r
-   $ wget https://freetel.svn.sourceforge.net/svnroot/freetel/codec2\r
-   $ cd codec2\r
-   $ ./configure && make\r
-\r
-10. svn co fdmdv2\r
-    cd fdmdv2/src\r
-    make -f Makefile.Win32\r
-\r
diff --git a/fdmdv2/branches/0.97/obsolete/README.linux b/fdmdv2/branches/0.97/obsolete/README.linux
deleted file mode 100644 (file)
index 37cf9e1..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-README.linux for fdmdv2
-Created by David Rowe
-Oct 14 2012
-
-BUILDING FreeDV for Linux
-=========================
-
-1. FreeDV was developed on Ubuntu 9.1 and 10.04 systems. It has been
-   tested on OSS (Ubuntu 9.1) and ALSA (Ubuntu 10.04) sound systems.
-
-2. A typical ALSA installation (e.g., Ubuntu 10.04) first install the
-   following packages:
-
-   $ sudo apt-get install libgtk2.0-dev libsamplerate0-dev libsndfile1-dev libasound2-dev
-
-3. If you would like to use OSS rather than ALSA do not install libasound2-dev.
-
-4. Makefile.linux will download the libraries you need, configure and
-   build them, then build FreeDV.  Makefile.linux will _not_ install
-   any of the libraries built for FreeDV on your system.
-
-   cd fdmdv2/src 
-   make -f Makefile.linux
-
-Linux usage Notes
-=================
-
-1. Config is stored in ~/.FreeDV, rm this file to restore defaults
-
-
-TODO
-====
-
-[ ] Stopping Waterfall
-    + When Stop pressed lower 25% of Waterfall isn't erased
-
-[ ] release clean up
-    [ ] remove/comment out debug printfs
-    [ ] help about with URL (hyperlink?) to web site & donations
-    [ ] buffer sizes, maybe make a config number
-    [ ] tool tip help for audio config dialog
-
-IDEAS
-=====
-
-1. Tabbed page option that draws block diagram of system and draws
-   line between sound devices and modem blocks.  Lines move depending
-   if we are in sync, audio pass thru etc
-
-2. Way to I/O to/from files on each "port", for example:
-   + monitor input speech or feed input speech
-
-3. (Thomas Kocourek n4fwd) Context sensitive help.
-
-4. Look at how people hook up and use program, stop common mistakes or assumptions
-
-5. Squelch implementation.  Effect of SNR bouncing around might be to
-   have audio cut in and out.  We might need a better way of
-   triggering mute, such as amplitude of pilots, or smoother SNR.  Or
-   hysteresis in Squelch.
-
-User Manual Notes
------------------
-
-Count 5 seconds when removing/installing USB sound devices before
-pressing refesh.
-
-Describe what a valid one card and two card configuration looks like.
-Draw a block diagram, image of set up dialog.
-
-What a good scatter diagram/spectrum looks like
-
-Setting up in audio loopback
-
-Right click drag tabs, new window, tab order
diff --git a/fdmdv2/branches/0.97/obsolete/README.osx b/fdmdv2/branches/0.97/obsolete/README.osx
deleted file mode 100644 (file)
index 1e3eeca..0000000
+++ /dev/null
@@ -1,801 +0,0 @@
-README.osx
-David Witten 29 Dec 2012
-==========================
-
-Received today:
-
-Mooneer Salem 
-Re: [digitalvoice] Re: Mac build for fdmdv2
-
-Yep. I'm attaching a patch to this email with the modifications I had to make to get FreeDV to build on OSX. I develop on 10.8.2, but it should work with 10.5-10.7 I think. Unfortunately it's 32-bit only due to a dependency on Carbon, which Apple deprecated.
-
-Directions (requires MacPorts to build dependencies):
-
-1. Apply patch.
-2. $ sudo port install wxWidgets30 +aui +universal portaudio +universal sox +universal libsndfile +universal libsamplerate +universal
-3. $ cd src && make -f Makefile.osx
-
-This will create a folder named FreeDV.app in the src folder (shows up as a single file in Finder) that when double-clicked, starts the application. I'll probably need to figure out how to include dependencies in the .app folder so that people won't need to install MacPorts just to run FreeDV ;)
-
-The patch also includes the change away from libctb. It compiles on POSIX compliant platforms, but I'm not sure about the Windows implementation due to not having a Windows development setup here at home.
-
-...
--Mooneer KG6AOV
-
-Mooneer's patch is included as /freedv_osx_port.patch.gz in the SVN checkout or just snip & run the following --
-Patch:<cut here->
-
-Index: src/Makefile.linux
-===================================================================
---- src/Makefile.linux (revision 1152)
-+++ src/Makefile.linux (working copy)
-@@ -36,12 +36,6 @@
- SOX_INC=-I$(SOX)/src/
- SOX_LIB=$(SOX)/src/.libs/libsox.a
--# CTB ---------------------------------------------------
--
--CTB=libctb-0.16
--CTB_INC=-I$(CTB)/include
--CTB_LIB=$(CTB)/lib/libctb-0.16.a
--
- # if libasound is available, PortAudio will be using it, so we will
- # need to add it to freedv link line.  To test if it is present, we try
- # to link a small C program with -lasound
-@@ -50,8 +44,8 @@
- # FreeDV ------------------------------------------------
--CPP_FLAGS = -D_NO_AUTOTOOLS_ $(WX_CPPFLAGS) $(PORTAUDIO_INC) $(CODEC2_INC) $(SOX_INC) $(CTB_INC) -I. -g -Wall -O3 -DSVN_REVISION=\"$(SVN_REVISION)\"
--FREEDV_LIBS = $(WX_LIBS) $(PORTAUDIO_LIB) $(CODEC2_LIB) $(SOX_LIB) $(CTB_LIB) -lm -lpthread -lsndfile -lsamplerate $(LIBASOUND)
-+CPP_FLAGS = -D_NO_AUTOTOOLS_ $(WX_CPPFLAGS) $(PORTAUDIO_INC) $(CODEC2_INC) $(SOX_INC) -I. -g -Wall -O3 -DSVN_REVISION=\"$(SVN_REVISION)\"
-+FREEDV_LIBS = $(WX_LIBS) $(PORTAUDIO_LIB) $(CODEC2_LIB) $(SOX_LIB) -lm -lpthread -lsndfile -lsamplerate $(LIBASOUND)
- OBJS = topFrame.o \
- fdmdv2_main.o \
-@@ -65,11 +59,12 @@
- dlg_comports.o \
- dlg_filter.o \
- varicode.o \
--sox_biquad.o
-+sox_biquad.o \
-+serialport.o
--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
-+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 serialport.h
--all: $(WXWIDGETS)/.built $(PORTAUDIO)/.built $(CODEC2)/.built $(SOX)/.built $(CTB)/.built freedv
-+all: $(WXWIDGETS)/.built $(PORTAUDIO)/.built $(CODEC2)/.built $(SOX)/.built freedv
- freedv: $(OBJS) 
-       g++ -o freedv $(OBJS) $(CPP_FLAGS) $(FREEDV_LIBS)
-@@ -81,7 +76,7 @@
-       rm -f *.o fdmdv2 
- clean-lib:
--      rm -Rf $(WXWIDGETS) $(PORTAUDIO) $(CODEC2) $(SOX) $(CTB)  
-+      rm -Rf $(WXWIDGETS) $(PORTAUDIO) $(CODEC2) $(SOX) 
-       rm -f *.o fdmdv2 
- # wxWidgets ---------------------------------------------------------
-@@ -126,14 +121,3 @@
-        
- $(SOX).tar.bz2:
-       wget http://downloads.sourceforge.net/project/sox/sox/14.4.0/sox-14.4.0.tar.bz2
--
--# CTB -------------------------------------------------------------
--
--$(CTB)/.built: $(CTB)
--      cd $(CTB)/build && make && touch ../.built
--               
--$(CTB) : $(CTB).tar.gz
--      tar xvzf $(CTB).tar.gz
--       
--$(CTB).tar.gz:
--      wget https://iftools.com/download/ctb/0.16/libctb-0.16.tar.gz
-Index: src/Makefile.linux.dmw
-===================================================================
---- src/Makefile.linux.dmw     (revision 1152)
-+++ src/Makefile.linux.dmw     (working copy)
-@@ -36,7 +36,8 @@
- dlg_comports.o \
- dlg_filter.o \
- varicode.o \
--sox_biquad.o
-+sox_biquad.o \
-+serialport.o
- all: fdmdv2
-@@ -44,7 +45,7 @@
- fdmdv2: $(OBJS) fdmdv2_main.h
-       g++ -o fdmdv2 $(OBJS) $(CPP_FLAGS) $(LIBS)
--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
-+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 serialport.h
- %.o: %.cpp
-       g++ $(CPP_FLAGS) -c $< -o $@
-Index: src/Makefile.osx
-===================================================================
---- src/Makefile.osx   (revision 0)
-+++ src/Makefile.osx   (working copy)
-@@ -0,0 +1,76 @@
-+# src/Makefile.osx
-+# Mooneer Salem 28 Dec 2012
-+#
-+# Makefile for OSX - assumes MacPorts for some libraries and builds the others locally.
-+# Note: dependencies must be installed with universal binary support due to the use of Carbon by portaudio and others.
-+#       (Carbon is officially deprecated by Apple and does not have 64-bit support.)
-+#
-+# $ sudo port install wxWidgets30 +aui +universal portaudio +universal sox +universal libsndfile +universal libsamplerate +universal
-+# $ make -f Makefile.osx
-+
-+SVN_REVISION=$(shell svnversion)
-+MACPORTS_FOLDER=/opt/local
-+
-+# Codec 2 -----------------------------------------------
-+
-+CODEC2=codec2
-+CODEC2_INC=-I$(CODEC2)/src
-+CODEC2_LIB=$(CODEC2)/src/.libs/libcodec2.a
-+
-+# FreeDV ------------------------------------------------
-+
-+CPP_FLAGS = -D_NO_AUTOTOOLS_ -I$(MACPORTS_FOLDER)/include -arch i386 `wx-config --cppflags` $(CODEC2_INC) -I. -g -Wall -O3 -DSVN_REVISION=\"$(SVN_REVISION)\"
-+FREEDV_LIBS = -arch i386 -L$(MACPORTS_FOLDER)/lib `wx-config --libs all` -lportaudio $(CODEC2_LIB) -lm -lpthread -lsndfile -lsamplerate -lsox
-+
-+OBJS = topFrame.o \
-+fdmdv2_main.o \
-+fdmdv2_plot.o \
-+fdmdv2_plot_scalar.o \
-+fdmdv2_plot_scatter.o \
-+fdmdv2_plot_spectrum.o \
-+fdmdv2_plot_waterfall_linux.o \
-+fdmdv2_pa_wrapper.o \
-+dlg_audiooptions.o \
-+dlg_comports.o \
-+dlg_filter.o \
-+varicode.o \
-+sox_biquad.o \
-+serialport.o
-+
-+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 serialport.h
-+
-+all: $(CODEC2)/.built freedv FreeDV.app
-+
-+freedv: $(OBJS)
-+      g++ -o freedv $(OBJS) $(CPP_FLAGS) $(FREEDV_LIBS)
-+
-+FreeDV.app: info.plist freedv
-+      -mkdir -p $@/Contents/MacOS
-+      -mkdir -p $@/Contents/Resources/English.lproj
-+      cp info.plist $@/Contents
-+      echo -n "APPL????" > $@/Contents/PkgInfo
-+      cp freedv $@/Contents/MacOS/FreeDV
-+      
-+%.o: %.cpp $(HDRS)
-+      g++ $(CPP_FLAGS) -c $< -o $@
-+
-+sox_biquad.o: sox_biquad.c
-+      gcc $(CPP_FLAGS) -c sox_biquad.c -o sox_biquad.o
-+
-+varicode.o: varicode.c
-+      cc $(CPP_FLAGS) -c varicode.c -o varicode.o
-+
-+clean:
-+      rm -f *.o fdmdv2 
-+      rm -rf FreeDV.app/
-+      
-+clean-lib: clean
-+      rm -Rf $(CODEC2)
-+ 
-+# Codec 2 ----------------------------------------------------------
-+
-+$(CODEC2)/.built: $(CODEC2)
-+      cd $(CODEC2) && CPPFLAGS="-arch i386" LDFLAGS="-arch i386" ./configure && make && touch .built
-+
-+$(CODEC2):
-+      svn co https://freetel.svn.sourceforge.net/svnroot/freetel/codec2
-\ No newline at end of file
-Index: src/Makefile.win32
-===================================================================
---- src/Makefile.win32 (revision 1152)
-+++ src/Makefile.win32 (working copy)
-@@ -16,7 +16,7 @@
- CODEC2_LIB=$(CODEC2_PATH)/src/.libs/libcodec2.a
- CPP_FLAGS = -D_NO_AUTOTOOLS_ -I$(INCLUDE_PATH) $(WX_CPPFLAGS) -I$(CODEC2_INC) -I../extern/include -g -Wall -DSVN_REVISION=\"$(SVN_REVISION)\"
--LIBS = $(WX_LIBS) $(CODEC2_LIB) -lm -lportaudiocpp -lportaudio -lpthread -lsndfile -lsamplerate -lctb-0.16 -lsox
-+LIBS = $(WX_LIBS) $(CODEC2_LIB) -lm -lportaudiocpp -lportaudio -lpthread -lsndfile -lsamplerate -lsox
- OBJS = topFrame.o \
- fdmdv2_main.o \
-@@ -30,9 +30,10 @@
- dlg_comports.o \
- dlg_filter.o \
- varicode.o \
--sox_biquad.o
-+sox_biquad.o \
-+serialport.o
--HDRS = ../version.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 dlg_audiooptions.h topFrame.h varicode.h
-+HDRS = ../version.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 dlg_audiooptions.h topFrame.h varicode.h serialport.h
- all: freedv
-Index: src/Makefile.win32.dmw
-===================================================================
---- src/Makefile.win32.dmw     (revision 1152)
-+++ src/Makefile.win32.dmw     (working copy)
-@@ -40,10 +40,11 @@
- dlg_comports.o \
- dlg_filter.o \
- varicode.o \
--sox_biquad.o
-+sox_biquad.o \
-+serialport.o
--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
-+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 serialport.h
- all: freedv
-Index: src/dlg_comports.cpp
-===================================================================
---- src/dlg_comports.cpp       (revision 1152)
-+++ src/dlg_comports.cpp       (working copy)
-@@ -21,7 +21,6 @@
- //==========================================================================
- #include "dlg_comports.h"
- #include "fdmdv2_main.h"
--#include <wx/msw/registry.h>
- #include <sstream>
- //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-@@ -62,8 +61,9 @@
-     wxArrayString m_listCtrlPortsArr;
-     m_listCtrlPorts = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxSize(-1,45), m_listCtrlPortsArr, wxLB_SINGLE | wxLB_SORT);
-     staticBoxSizer31->Add(m_listCtrlPorts, 1, wxALIGN_CENTER, 0);
--#endif
--#ifdef __WXGTK__
-+#else
-+/*#endif
-+#ifdef __WXGTK__*/
-     wxBoxSizer* bSizer83;
-     bSizer83 = new wxBoxSizer(wxHORIZONTAL);
-Index: src/fdmdv2_main.cpp
-===================================================================
---- src/fdmdv2_main.cpp        (revision 1152)
-+++ src/fdmdv2_main.cpp        (working copy)
-@@ -163,7 +163,6 @@
- {
-     m_zoom              = 1.;
-     m_serialPort        = NULL;
--    m_device            = NULL;
-     
-     tools->AppendSeparator();
-     wxMenuItem* m_menuItemToolsConfigDelete;
-@@ -857,22 +856,22 @@
-             {
-                 if(wxGetApp().m_boolRTSPos) // RTS asserted HIGH
-                 {
--                    m_serialPort->SetLineState(ctb::LinestateRts);
-+                    m_serialPort->setRTS(true);
-                 }
-                 else                        // RTS asserted LOW
-                 {
--                    m_serialPort->ClrLineState(ctb::LinestateRts);
-+                    m_serialPort->setRTS(false);
-                 }
-             }
-             else                            // Use DTR
-             {
-                 if(wxGetApp().m_boolDTRPos) // DTR asserted HIGH
-                 {
--                    m_serialPort->SetLineState(ctb::LinestateDtr);
-+                    m_serialPort->setDTR(true);
-                 }
-                 else                        // DTR asserted LOW
-                 {
--                    m_serialPort->ClrLineState(ctb::LinestateDtr);
-+                    m_serialPort->setDTR(false);
-                 }
-             }
-         } 
-@@ -882,22 +881,22 @@
-             {
-                 if(wxGetApp().m_boolRTSPos) // RTS cleared LOW
-                 {
--                    m_serialPort->ClrLineState(ctb::LinestateRts);
-+                    m_serialPort->setRTS(false);
-                 }
-                 else                        // RTS cleared HIGH
-                 {
--                    m_serialPort->SetLineState(ctb::LinestateRts);
-+                    m_serialPort->setRTS(true);
-                 }
-             }
-             else                            // Use DTR
-             {
-                 if(wxGetApp().m_boolDTRPos) // DTR cleared LOW
-                 {
--                    m_serialPort->ClrLineState(ctb::LinestateDtr);
-+                    m_serialPort->setDTR(false);
-                 }
-                 else                        // DTR cleared HIGH
-                 {
--                    m_serialPort->SetLineState(ctb::LinestateDtr);
-+                    m_serialPort->setDTR(true);
-                 }
-             }
-         } 
-@@ -1351,13 +1350,15 @@
- {
-     wxUnusedVar(event);
-     int rv = 0;
--    int  iLineState  = 0;
-+    bool rtsEnabled = false;
-+    bool dtrEnabled = false;
-     //bool bPTTEnabled = m_btnTogPTT->IsEnabled();
-     //bool bPTTState   = m_btnTogPTT->GetValue();
-     if(m_serialPort != NULL)
-     {
--        int iLineState   = m_serialPort->GetLineState();
-+        rtsEnabled = m_serialPort->getRTS();
-+        dtrEnabled = m_serialPort->getDTR();
-         CloseSerialPort();
-     }
-     ComPortsDlg *dlg = new ComPortsDlg(NULL);
-@@ -1372,21 +1373,21 @@
-         SetupSerialPort();
-         if(m_serialPort != NULL)
-         {
--            if(iLineState | ctb::LinestateRts)
-+            if(rtsEnabled)
-             {
--                m_serialPort->SetLineState(ctb::LinestateRts);
-+                m_serialPort->setRTS(true);
-             }
-             else
-             {
--                m_serialPort->ClrLineState(ctb::LinestateRts);
-+                m_serialPort->setRTS(false);
-             }
--            if(iLineState | ctb::LinestateDtr)
-+            if(dtrEnabled)
-             {
--                m_serialPort->SetLineState(ctb::LinestateDtr);
-+                m_serialPort->setDTR(true);
-             }
-             else
-             {
--                m_serialPort->ClrLineState(ctb::LinestateDtr);
-+                m_serialPort->setDTR(false);
-             }
-         // m_btnTogPTT->Enable(bPTTEnabled);
-         // m_btnTogPTT->SetValue(bPTTState);
-@@ -2631,26 +2632,25 @@
-     if(!wxGetApp().m_strRigCtrlPort.IsEmpty())
-     {
-         wxString protocol = wxGetApp().m_strRigCtrlDatabits + wxGetApp().m_strRigCtrlParity + wxGetApp().m_strRigCtrlStopbits;
--        m_serialPort = new ctb::SerialPort();
--        if(m_serialPort->Open(wxGetApp().m_strRigCtrlPort.c_str(), baudrate, protocol.c_str(), ctb::SerialPort::NoFlowControl ) >= 0 ) 
-+        m_serialPort = new SerialPort(wxGetApp().m_strRigCtrlPort.ToAscii().data());
-+        if(m_serialPort->open(/*baudrate, protocol.c_str()*/ ) >= 0 ) 
-         {
--            m_device = m_serialPort;
-             //  always start with PTT cleared
-             if(wxGetApp().m_boolRTSPos) // RTS cleared LOW
-             {
--                m_serialPort->ClrLineState(ctb::LinestateRts);
-+                m_serialPort->setRTS(false);
-             }
-             else                        // RTS cleared HIGH
-             {
--                m_serialPort->SetLineState(ctb::LinestateRts);
-+                m_serialPort->setRTS(true);
-             }
-             if(wxGetApp().m_boolDTRPos) // DTR cleared LOW
-             {
--                m_serialPort->ClrLineState(ctb::LinestateDtr);
-+                m_serialPort->setDTR(false);
-             }
-             else                        // DTR cleared HIGH
-             {
--                m_serialPort->SetLineState(ctb::LinestateDtr);
-+                m_serialPort->setDTR(true);
-             }
-             //m_btnTogPTT->Enable(true);
-             m_btnTogPTT->SetValue(false);
-@@ -2658,7 +2658,6 @@
-         else
-         {
-             m_serialPort = NULL;
--            m_device     = NULL;
-             //m_btnTogPTT->Disable();
-         }
-     }
-@@ -2675,11 +2674,10 @@
- //----------------------------------------------------------------
- void MainFrame::CloseSerialPort(void)
- {
--    if((m_serialPort != NULL) && m_serialPort->IsOpen())
-+    if((m_serialPort != NULL) && m_serialPort->isOpen())
-     {
--        m_serialPort->Close();
-+        m_serialPort->close();
-         m_serialPort = NULL;
--        m_device     = NULL; 
-         //m_btnTogPTT->SetLabel(wxT("PTT"));
-         //m_btnTogPTT->Enable(false);
-     }
-Index: src/fdmdv2_main.h
-===================================================================
---- src/fdmdv2_main.h  (revision 1152)
-+++ src/fdmdv2_main.h  (working copy)
-@@ -55,10 +55,7 @@
- #include "codec2_fdmdv.h"
- #include "codec2_fifo.h"
--#include "ctb-0.16/ctb.h"
--#include "ctb-0.16/portscan.h"
--#include "ctb-0.16/serportx.h"
--#include "ctb-0.16/serport.h"
-+#include "serialport.h"
- #include "topFrame.h"
- #include "dlg_comports.h"
-@@ -353,8 +350,7 @@
-     protected:
--        ctb::IOBase*            m_device;
--        ctb::SerialPort*        m_serialPort;
-+        SerialPort*             m_serialPort;
-         void setsnrBeta(bool snrSlow);
-Index: src/info.plist
-===================================================================
---- src/info.plist     (revision 0)
-+++ src/info.plist     (working copy)
-@@ -0,0 +1,34 @@
-+<?xml version="1.0" encoding="UTF-8"?>
-+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-+<plist version="1.0">
-+<dict>
-+      <key>CFBundleDevelopmentRegion</key>
-+      <string>en</string>
-+      <key>CFBundleExecutable</key>
-+      <string>freedv</string>
-+      <key>CFBundleIconFile</key>
-+      <string></string>
-+      <key>CFBundleIdentifier</key>
-+      <string>org.freedv.freedv</string>
-+      <key>CFBundleInfoDictionaryVersion</key>
-+      <string>6.0</string>
-+      <key>CFBundleName</key>
-+      <string>FreeDV</string>
-+      <key>CFBundlePackageType</key>
-+      <string>APPL</string>
-+      <key>CFBundleShortVersionString</key>
-+      <string>1.0</string>
-+      <key>CFBundleSignature</key>
-+      <string>????</string>
-+      <key>CFBundleVersion</key>
-+      <string>1</string>
-+      <key>LSMinimumSystemVersion</key>
-+      <string>10.5</string>
-+      <key>NSHumanReadableCopyright</key>
-+      <string>Copyright Â© 2012 FreeDV. All rights reserved.</string>
-+      <!--<key>NSMainNibFile</key>
-+      <string>MainMenu</string>-->
-+      <key>NSPrincipalClass</key>
-+      <string>NSApplication</string>
-+</dict>
-+</plist>
-\ No newline at end of file
-Index: src/serialport.cpp
-===================================================================
---- src/serialport.cpp (revision 0)
-+++ src/serialport.cpp (working copy)
-@@ -0,0 +1,207 @@
-+//==========================================================================
-+// Name:            serialport.cpp
-+//
-+// Purpose:         Serial port management.
-+// Created:         Dec. 28, 2012
-+// Authors:         Mooneer Salem
-+// 
-+// License:
-+//
-+//  This program is free software; you can redistribute it and/or modify
-+//  it under the terms of the GNU General 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 License
-+//  along with this program; if not, see <http://www.gnu.org/licenses/>.
-+//
-+//==========================================================================
-+
-+#ifndef WIN32
-+#include <fcntl.h>
-+#include <termios.h>
-+#include <unistd.h>
-+#include <sys/ioctl.h>
-+#endif // !WIN32
-+
-+#include "serialport.h"
-+
-+#define ERROR_CONDITION (-1)
-+#ifdef WIN32
-+#define INVALID_FILE_DESCRIPTOR (INVALID_HANDLE_VALUE)
-+#else
-+#define INVALID_FILE_DESCRIPTOR (-1)
-+#endif // WIN32
-+
-+SerialPort::SerialPort(const std::string &portName)
-+    : _portName(portName)
-+    , _fileDescriptor(INVALID_FILE_DESCRIPTOR)
-+#ifdef WIN32
-+    , _rtsEnabled(false)
-+    , _dtrEnabled(false)
-+#endif // WIN32
-+{
-+    // No action here until open() is called.
-+}
-+
-+SerialPort::~SerialPort()
-+{
-+    // Close serial port if needed.
-+    if (isOpen())
-+    {
-+        close();
-+    }
-+}
-+
-+#ifndef WIN32
-+static int posixGetModemControlBits(const int fileDescriptor)
-+{
-+    int modemControlBits = 0;
-+    
-+    if (ioctl(fileDescriptor, TIOCMGET, &modemControlBits) == 0)
-+    {
-+        return modemControlBits;
-+    }
-+    else
-+    {
-+        return ERROR_CONDITION;
-+    }
-+}
-+
-+static int posixSetModemControlBits(const int fileDescriptor, int modemControlBits)
-+{
-+    if (ioctl(fileDescriptor, TIOCMSET, &modemControlBits) == 0)
-+    {
-+        return modemControlBits;
-+    }
-+    else
-+    {
-+        return ERROR_CONDITION;
-+    }
-+}
-+#endif // !WIN32
-+
-+bool SerialPort::getRTS() const
-+{
-+#ifdef WIN32
-+    // No way to get DTR/RTS directly from Windows, so we have to
-+    // grab what the caller put in during a previous set*() call.
-+    return _rtsEnabled;
-+#else
-+    int tmpbits = posixGetModemControlBits(_fileDescriptor);
-+    if (tmpbits != ERROR_CONDITION)
-+    {
-+        return tmpbits & TIOCM_RTS;
-+    }
-+    else
-+    {
-+        return ERROR_CONDITION;
-+    }
-+#endif // WIN32
-+}
-+
-+void SerialPort::setRTS(const bool newRTS)
-+{
-+#ifdef WIN32
-+    if (newRTS)
-+    {
-+        EscapeCommFunction(_fileDescriptor, SETRTS);
-+    }
-+    else
-+    {
-+        EscapeCommFunction(_fileDescriptor, CLRRTS);
-+    }
-+    _rtsEnabled = newRTS;
-+#else
-+    int tmpbits = posixGetModemControlBits(_fileDescriptor);
-+    if (tmpbits != ERROR_CONDITION)
-+    {
-+        if (newRTS) tmpbits |= TIOCM_RTS;
-+        else tmpbits &= ~TIOCM_RTS;
-+        posixSetModemControlBits(_fileDescriptor, tmpbits);
-+    }
-+#endif // WIN32
-+}
-+    
-+bool SerialPort::getDTR() const
-+{
-+#ifdef WIN32
-+    // No way to get DTR/RTS directly from Windows, so we have to
-+    // grab what the caller put in during a previous set*() call.
-+    return _dtrEnabled;
-+#else
-+    int tmpbits = posixGetModemControlBits(_fileDescriptor);
-+    if (tmpbits != ERROR_CONDITION)
-+    {
-+        return tmpbits & TIOCM_DTR;
-+    }
-+    else
-+    {
-+        return ERROR_CONDITION;
-+    }
-+#endif // WIN32
-+}
-+
-+void SerialPort::setDTR(const bool newDTR)
-+{
-+#ifdef WIN32
-+    if (newDTR)
-+    {
-+        EscapeCommFunction(_fileDescriptor, SETDTR);
-+    }
-+    else
-+    {
-+        EscapeCommFunction(_fileDescriptor, CLRDTR);
-+    }
-+    _dtrEnabled = newDTR;
-+#else
-+    int tmpbits = posixGetModemControlBits(_fileDescriptor);
-+    if (tmpbits != ERROR_CONDITION)
-+    {
-+        if (newDTR) tmpbits |= TIOCM_DTR;
-+        else tmpbits &= ~TIOCM_DTR;
-+        posixSetModemControlBits(_fileDescriptor, tmpbits);
-+    }
-+#endif // WIN32
-+}
-+    
-+int SerialPort::open()
-+{
-+#ifdef WIN32
-+    TCHAR portName[32];
-+    _stprintf_s(portName, sizeof(portName)/sizeof(TCHAR), _T("\\\\.\\%s"), _portName.c_str());
-+    
-+    _fileDescriptor = CreateFile(
-+        portName, 
-+        GENERIC_READ | GENERIC_WRITE,
-+        0, 
-+        0, 
-+        OPEN_EXISTING, 
-+        FILE_FLAG_OVERLAPPED, 
-+        0);
-+#else
-+    _fileDescriptor = ::open(_portName.c_str(), O_RDWR);
-+#endif // WIN32
-+
-+    return (int)_fileDescriptor;
-+}
-+
-+int SerialPort::close()
-+{
-+#ifdef WIN32
-+    int rv = CloseHandle(_fileDescriptor);
-+#else
-+    int rv = ::close(_fileDescriptor);
-+#endif // WIN32
-+
-+    _fileDescriptor = INVALID_FILE_DESCRIPTOR;
-+    return rv;
-+}
-+    
-+bool SerialPort::isOpen() const
-+{
-+    return _fileDescriptor != INVALID_FILE_DESCRIPTOR;
-+}
-\ No newline at end of file
-Index: src/serialport.h
-===================================================================
---- src/serialport.h   (revision 0)
-+++ src/serialport.h   (working copy)
-@@ -0,0 +1,81 @@
-+//==========================================================================
-+// Name:            serialport.h
-+//
-+// Purpose:         Serial port management.
-+// Created:         Dec. 28, 2012
-+// Authors:         Mooneer Salem
-+// 
-+// License:
-+//
-+//  This program is free software; you can redistribute it and/or modify
-+//  it under the terms of the GNU General 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 License
-+//  along with this program; if not, see <http://www.gnu.org/licenses/>.
-+//
-+//==========================================================================
-+
-+#ifndef SERIAL_PORT_H
-+#define SERIAL_PORT_H
-+
-+#ifdef WIN32
-+#include <windows.h>
-+#endif // WIN32
-+
-+#include <string>
-+
-+enum SerialPortParity
-+{
-+    NONE,
-+    EVEN,
-+    ODD
-+};
-+
-+// Quick and dirty serial port class that supports the minimum necessary to
-+// do PTT (for now). Can be extended later (send/receive data for CAT control, 
-+// for example).
-+class SerialPort
-+{
-+public:
-+    // portName is a path to the serial port, in one of the following formats:
-+    // OSX: /dev/tty.*
-+    // Linux: /dev/ttyS*
-+    // Windows: COM*:
-+    SerialPort(const std::string &portName);
-+    virtual ~SerialPort();
-+    
-+    bool getRTS() const;
-+    void setRTS(const bool newRTS);
-+    
-+    bool getDTR() const;
-+    void setDTR(const bool newDTR);
-+    
-+    int open();
-+    int close();
-+    
-+    bool isOpen() const;
-+    
-+private:
-+    const std::string _portName;
-+    
-+#ifdef WIN32
-+    HANDLE _fileDescriptor;
-+    
-+    bool _rtsEnabled;
-+    bool _dtrEnabled;
-+#else
-+    int _fileDescriptor;
-+#endif // WIN32
-+        
-+    // Object should not be copied since there can be only one handle open
-+    // per serial port. An attempt to use the copy constructor here, even
-+    // implicitly, will result in a compile error due to the declaration below.
-+    SerialPort(const SerialPort&);
-+};
-+
-+#endif // SERIAL_PORT_H
-\ No newline at end of file
diff --git a/fdmdv2/branches/0.97/obsolete/freedv_osx_port.patch.gz b/fdmdv2/branches/0.97/obsolete/freedv_osx_port.patch.gz
deleted file mode 100644 (file)
index 107a9d6..0000000
Binary files a/fdmdv2/branches/0.97/obsolete/freedv_osx_port.patch.gz and /dev/null differ
diff --git a/fdmdv2/branches/0.97/src/CMakeLists.txt b/fdmdv2/branches/0.97/src/CMakeLists.txt
deleted file mode 100644 (file)
index 080bebf..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-set(FREEDV_SOURCES
-    dlg_about.cpp
-    dlg_audiooptions.cpp
-    dlg_filter.cpp
-    dlg_options.cpp
-    dlg_ptt.cpp
-    fdmdv2_main.cpp
-    fdmdv2_pa_wrapper.cpp
-    fdmdv2_plot.cpp
-    fdmdv2_plot_scalar.cpp
-    fdmdv2_plot_scatter.cpp
-    fdmdv2_plot_spectrum.cpp
-    fdmdv2_plot_waterfall.cpp
-    hamlib.cpp
-    topFrame.cpp
-    sox_biquad.c
-    varicode.c
-    comp.h
-    dlg_about.h
-    dlg_audiooptions.h
-    dlg_filter.h
-    dlg_options.h
-    dlg_ptt.h
-    fdmdv2_defines.h
-    fdmdv2_main.h
-    fdmdv2_pa_wrapper.h
-    fdmdv2_plot.h
-    fdmdv2_plot_scalar.h
-    fdmdv2_plot_scatter.h
-    fdmdv2_plot_spectrum.h
-    fdmdv2_plot_waterfall.h
-    hamlib.h
-    sox_biquad.h
-    sox.h
-    topFrame.h
-    varicode.h
-    varicode_table.h
-    version.h
-)
-
-# WIN32 is needed for Windows GUI apps and is ignored for UNIX like systems.
-add_executable(freedv WIN32 ${FREEDV_SOURCES} ${RES_FILES})
-target_link_libraries(freedv ${FREEDV_LINK_LIBS})
-include_directories(${CMAKE_CURRENT_SOURCE_DIR})
-if(FREEDV_STATIC_DEPS)
-    add_dependencies(freedv ${FREEDV_STATIC_DEPS})
-endif(FREEDV_STATIC_DEPS)
-install(TARGETS freedv
-    RUNTIME DESTINATION bin)
diff --git a/fdmdv2/branches/0.97/src/comp.h b/fdmdv2/branches/0.97/src/comp.h
deleted file mode 100644 (file)
index a3a1bd9..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*---------------------------------------------------------------------------*\
-
-  FILE........: comp.h
-  AUTHOR......: David Rowe
-  DATE CREATED: 24/08/09
-
-  Complex number definition.
-
-\*---------------------------------------------------------------------------*/
-
-/*
-  Copyright (C) 2009 David Rowe
-
-  All rights reserved.
-
-  This program is free software; you can redistribute it and/or modify
-  it under the terms of the GNU Lesser 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 Lesser General Public License
-  along with this program; if not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef __COMP__
-#define __COMP__
-
-/* Complex number */
-
-typedef struct
-{
-    float real;
-    float imag;
-} COMP;
-
-#endif
diff --git a/fdmdv2/branches/0.97/src/credits.txt b/fdmdv2/branches/0.97/src/credits.txt
deleted file mode 100644 (file)
index 2214b14..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-Credits (code or ideas borrowed from):\r
-==============================================\r
-David Rowe (obviously)\r
-Mel Whitten\r
-Don Mak\r
-Steve Nance (K5FR)\r
-James Ahlstrom (Quisk)\r
-FLDIGI\r
diff --git a/fdmdv2/branches/0.97/src/dlg_about.cpp b/fdmdv2/branches/0.97/src/dlg_about.cpp
deleted file mode 100644 (file)
index 5680821..0000000
+++ /dev/null
@@ -1,225 +0,0 @@
-//==========================================================================
-// 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#include <wx/ffile.h>
-#include <wx/dcmemory.h>
-#include "dlg_about.h"\r
-//#include "contributers.h"\r
-
-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://svn.code.sf.net/p/freetel/code/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("<h2>p/freetel/code - Revision ");
-            int startIndex = htmldata.find(s) + s.Length();
-            int endIndex = htmldata.find(wxT(": /fdmdv2</h2>"));
-            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()
-{
-}
-/*\r
-AboutDlg::AboutDlg(wxWindow* parent, const wxString &mainTitle) : AboutDlgBase(parent)\r
-{
-    wxFileName splashscreen(ManagerST::Get()->GetStarupDirectory() +
-                            wxFileName::GetPathSeparator() + 
-                            wxT("images") + 
-                            wxFileName::GetPathSeparator() + 
-                            wxT("splashscreen.png"));
-\r
-    m_bmp.LoadFile(splashscreen.GetFullPath(), wxBITMAP_TYPE_PNG);\r
-    m_bitmap->SetBitmap(m_bmp);\r
-    GetSizer()->Fit(this);
-    
-    BitmapLoader bmpLoader;
-    m_bitmapPayPal->SetBitmap(bmpLoader.LoadBitmap(wxT("about/32/paypal")));
-    \r
-    // set the page content\r
-    m_htmlWin3->SetPage(wxString::FromUTF8(about_hex));\r
-    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();\r
-}\r
-\r
-AboutDlg::~AboutDlg()
-{
-}
-*/
-\r
-void AboutDlg::ExchangeData(int inout)\r
-{\r
-//    return m_staticTextInformation->GetLabelText();\r
-}
diff --git a/fdmdv2/branches/0.97/src/dlg_about.h b/fdmdv2/branches/0.97/src/dlg_about.h
deleted file mode 100644 (file)
index ffdc12c..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-//==========================================================================\r
-// Name:            dlg_about.h\r
-// Purpose:         Provides an 'about' dialog.\r
-// Created:         Dec 06, 2012\r
-// Authors:         David Rowe, David Witten\r
-// \r
-// License:\r
-//\r
-//  This program is free software; you can redistribute it and/or modify\r
-//  it under the terms of the GNU General Public License version 2.1,\r
-//  as published by the Free Software Foundation.  This program is\r
-//  distributed in the hope that it will be useful, but WITHOUT ANY\r
-//  WARRANTY; without even the implied warranty of MERCHANTABILITY or\r
-//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public\r
-//  License for more details.\r
-//\r
-//  You should have received a copy of the GNU General Public License\r
-//  along with this program; if not, see <http://www.gnu.org/licenses/>.\r
-//\r
-//==========================================================================\r
-#ifndef __AboutDlg__\r
-#define __AboutDlg__\r
-\r
-#include "fdmdv2_main.h"\r
-#include "wx/bitmap.h"\r
-#include <wx/xrc/xmlres.h>\r
-#include <wx/settings.h>\r
-#include <wx/font.h>
-#include <wx/colour.h>
-#include <wx/settings.h>
-#include <wx/sizer.h>
-#include <wx/panel.h>
-#include <wx/html/htmlwin.h>
-#include <wx/textctrl.h>
-#include <wx/notebook.h>
-#include <wx/stattext.h>
-#include <wx/hyperlink.h>
-#include <wx/statbox.h>
-#include <wx/button.h>
-#include <wx/dialog.h>
-#include <wx/bitmap.h>
-
-/** Implementing AboutDlg */\r
-class AboutDlg : public wxDialog\r
-{\r
-   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:\r
-        /** Constructor */\r
-        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();\r
-        void ExchangeData(int inout);\r
-};\r
-\r
-#endif // __AboutDlg__\r
diff --git a/fdmdv2/branches/0.97/src/dlg_audiooptions.cpp b/fdmdv2/branches/0.97/src/dlg_audiooptions.cpp
deleted file mode 100644 (file)
index 1c312ef..0000000
+++ /dev/null
@@ -1,1264 +0,0 @@
-//=========================================================================
-// Name:            AudioOptsDialog.cpp
-// Purpose:         Implements an Audio options selection dialog.
-//
-// Authors:         David Rowe, David Witten
-// License:
-//
-//  All rights reserved.
-//
-//  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 <http://www.gnu.org/licenses/>.
-//
-//=========================================================================
-#include "fdmdv2_main.h"
-#include "dlg_audiooptions.h"
-
-// constants for test waveform plots
-
-#define TEST_WAVEFORM_X          180
-#define TEST_WAVEFORM_Y          180
-#define TEST_WAVEFORM_PLOT_TIME  2.0
-#define TEST_WAVEFORM_PLOT_FS    400
-#define TEST_BUF_SIZE           1024
-#define TEST_FS                 48000.0
-#define TEST_DT                 0.1      // time between plot updates in seconds
-#define TEST_WAVEFORM_PLOT_BUF  ((int)(DT*400))
-
-void AudioOptsDialog::Pa_Init(void)
-{
-    m_isPaInitialized = false;
-
-    if((pa_err = Pa_Initialize()) == paNoError)
-    {
-        m_isPaInitialized = true;
-    }
-    else
-    {
-        wxMessageBox(wxT("Port Audio failed to initialize"), wxT("Pa_Initialize"), wxOK);
-        return;
-    }
-}
-
-
-void AudioOptsDialog::buildTestControls(PlotScalar **plotScalar, wxButton **btnTest, 
-                                        wxPanel *parentPanel, wxBoxSizer *bSizer, wxString buttonLabel)
-{
-    wxBoxSizer* bSizer1 = new wxBoxSizer(wxVERTICAL);
-
-    wxPanel *panel = new wxPanel(parentPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0);
-    *plotScalar = new PlotScalar((wxFrame*) panel, 1, TEST_WAVEFORM_PLOT_TIME, 1.0/TEST_WAVEFORM_PLOT_FS, -1, 1, 1, 0.2, "", 1);
-    (*plotScalar)->SetClientSize(wxSize(TEST_WAVEFORM_X,TEST_WAVEFORM_Y));
-    bSizer1->Add(panel, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 8);
-
-    *btnTest = new wxButton(parentPanel, wxID_ANY, buttonLabel, wxDefaultPosition, wxDefaultSize);
-    bSizer1->Add(*btnTest, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 0);
-
-    bSizer->Add(bSizer1, 0, wxALIGN_CENTER_HORIZONTAL |wxALIGN_CENTER_VERTICAL );
-}
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// AudioOptsDialog()
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-AudioOptsDialog::AudioOptsDialog(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style)
-{
-    this->SetSizeHints(wxSize(850, 600), wxDefaultSize);
-
-    Pa_Init();
-
-    wxBoxSizer* mainSizer;
-    mainSizer = new wxBoxSizer(wxVERTICAL);
-    m_panel1 = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
-    wxBoxSizer* bSizer4;
-    bSizer4 = new wxBoxSizer(wxVERTICAL);
-    m_notebook1 = new wxNotebook(m_panel1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxNB_BOTTOM);
-    m_panelRx = new wxPanel(m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
-    wxBoxSizer* bSizer20;
-    bSizer20 = new wxBoxSizer(wxVERTICAL);
-    wxGridSizer* gSizer4;
-    gSizer4 = new wxGridSizer(2, 1, 0, 0);
-
-    // Rx In -----------------------------------------------------------------------
-
-    wxStaticBoxSizer* sbSizer2;
-    sbSizer2 = new wxStaticBoxSizer(new wxStaticBox(m_panelRx, wxID_ANY, _("From Radio")), wxHORIZONTAL);
-
-    wxBoxSizer* bSizer811a = new wxBoxSizer(wxVERTICAL);
-
-    m_listCtrlRxInDevices = new wxListCtrl(m_panelRx, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VRULES);
-    bSizer811a->Add(m_listCtrlRxInDevices, 1, wxALL|wxEXPAND, 1);
-
-    wxBoxSizer* bSizer811;
-    bSizer811 = new wxBoxSizer(wxHORIZONTAL);
-    m_staticText51 = new wxStaticText(m_panelRx, wxID_ANY, _("Device:"), wxDefaultPosition, wxDefaultSize, 0);
-    m_staticText51->Wrap(-1);
-    bSizer811->Add(m_staticText51, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5);
-    m_textCtrlRxIn = new wxTextCtrl(m_panelRx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
-    bSizer811->Add(m_textCtrlRxIn, 1, wxALIGN_CENTER_VERTICAL|wxALL, 1);
-    m_staticText6 = new wxStaticText(m_panelRx, wxID_ANY, _("Sample Rate:"), wxDefaultPosition, wxDefaultSize, 0);
-    m_staticText6->Wrap(-1);
-    bSizer811->Add(m_staticText6, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5);
-    m_cbSampleRateRxIn = new wxComboBox(m_panelRx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(90,-1), 0, NULL, wxCB_DROPDOWN);
-    bSizer811->Add(m_cbSampleRateRxIn, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1);
-
-    bSizer811a->Add(bSizer811, 0, wxEXPAND, 5);
-
-    sbSizer2->Add(bSizer811a, 1, wxEXPAND, 2);
-    buildTestControls(&m_plotScalarRxIn, &m_btnRxInTest, m_panelRx, sbSizer2, _("Rec 2s"));
-
-    gSizer4->Add(sbSizer2, 1, wxEXPAND, 5);
-
-    // Rx Out -----------------------------------------------------------------------
-
-    wxStaticBoxSizer* sbSizer3;
-    sbSizer3 = new wxStaticBoxSizer(new wxStaticBox(m_panelRx, wxID_ANY, _("To Speaker/Headphones")), wxHORIZONTAL);
-
-    wxBoxSizer* bSizer81a = new wxBoxSizer(wxVERTICAL);
-
-    m_listCtrlRxOutDevices = new wxListCtrl(m_panelRx, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VRULES);
-    bSizer81a->Add(m_listCtrlRxOutDevices, 1, wxALL|wxEXPAND, 1);
-
-    wxBoxSizer* bSizer81;
-    bSizer81 = new wxBoxSizer(wxHORIZONTAL);
-    m_staticText9 = new wxStaticText(m_panelRx, wxID_ANY, _("Device:"), wxDefaultPosition, wxDefaultSize, 0);
-    m_staticText9->Wrap(-1);
-    bSizer81->Add(m_staticText9, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
-    m_textCtrlRxOut = new wxTextCtrl(m_panelRx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
-    bSizer81->Add(m_textCtrlRxOut, 1, wxALIGN_CENTER_VERTICAL|wxALL, 1);
-    m_staticText10 = new wxStaticText(m_panelRx, wxID_ANY, _("Sample Rate:"), wxDefaultPosition, wxDefaultSize, 0);
-    m_staticText10->Wrap(-1);
-    bSizer81->Add(m_staticText10, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5);
-    m_cbSampleRateRxOut = new wxComboBox(m_panelRx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(90,-1), 0, NULL, wxCB_DROPDOWN);
-    bSizer81->Add(m_cbSampleRateRxOut, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1);
-
-    bSizer81a->Add(bSizer81, 0, wxEXPAND, 5);
-
-    sbSizer3->Add(bSizer81a, 1, wxEXPAND, 2);
-    buildTestControls(&m_plotScalarRxOut, &m_btnRxOutTest, m_panelRx, sbSizer3, _("Play 2s"));
-    gSizer4->Add(sbSizer3, 1, wxEXPAND, 2);
-    bSizer20->Add(gSizer4, 1, wxEXPAND, 1);
-    m_panelRx->SetSizer(bSizer20);
-    m_panelRx->Layout();
-    bSizer20->Fit(m_panelRx);
-    m_notebook1->AddPage(m_panelRx, _("Receive"), true);
-
-    // Tx Tab -------------------------------------------------------------------------------
-
-    m_panelTx = new wxPanel(m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
-    wxBoxSizer* bSizer18;
-    bSizer18 = new wxBoxSizer(wxVERTICAL);
-    wxGridSizer* gSizer2;
-    gSizer2 = new wxGridSizer(2, 1, 0, 0);
-
-    // Tx In ----------------------------------------------------------------------------------
-
-    wxStaticBoxSizer* sbSizer22;
-    sbSizer22 = new wxStaticBoxSizer(new wxStaticBox(m_panelTx, wxID_ANY, _("From Microphone")), wxHORIZONTAL);
-
-    wxBoxSizer* bSizer83a = new wxBoxSizer(wxVERTICAL);
-
-    m_listCtrlTxInDevices = new wxListCtrl(m_panelTx, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VRULES);
-    bSizer83a->Add(m_listCtrlTxInDevices, 1, wxALL|wxEXPAND, 1);
-    wxBoxSizer* bSizer83;
-    bSizer83 = new wxBoxSizer(wxHORIZONTAL);
-    m_staticText12 = new wxStaticText(m_panelTx, wxID_ANY, _("Device:"), wxDefaultPosition, wxDefaultSize, 0);
-    m_staticText12->Wrap(-1);
-    bSizer83->Add(m_staticText12, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5);
-    m_textCtrlTxIn = new wxTextCtrl(m_panelTx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
-    bSizer83->Add(m_textCtrlTxIn, 1, wxALIGN_CENTER_VERTICAL|wxALL, 1);
-    m_staticText11 = new wxStaticText(m_panelTx, wxID_ANY, _("Sample Rate:"), wxDefaultPosition, wxDefaultSize, 0);
-    m_staticText11->Wrap(-1);
-    bSizer83->Add(m_staticText11, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5);
-    m_cbSampleRateTxIn = new wxComboBox(m_panelTx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(90,-1), 0, NULL, wxCB_DROPDOWN);
-    bSizer83->Add(m_cbSampleRateTxIn, 0, wxALL, 1);
-
-    bSizer83a->Add(bSizer83, 0, wxEXPAND, 5);
-
-    sbSizer22->Add(bSizer83a, 1, wxEXPAND, 2);
-    buildTestControls(&m_plotScalarTxIn, &m_btnTxInTest, m_panelTx, sbSizer22, _("Rec 2s"));
-
-    gSizer2->Add(sbSizer22, 1, wxEXPAND, 5);
-
-    // Tx Out ----------------------------------------------------------------------------------
-
-    wxStaticBoxSizer* sbSizer21;
-    sbSizer21 = new wxStaticBoxSizer(new wxStaticBox(m_panelTx, wxID_ANY, _("To Radio")), wxHORIZONTAL);
-
-    wxBoxSizer* bSizer82a = new wxBoxSizer(wxVERTICAL);
-
-    m_listCtrlTxOutDevices = new wxListCtrl(m_panelTx, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VRULES);
-    bSizer82a->Add(m_listCtrlTxOutDevices, 1, wxALL|wxEXPAND, 2);
-    wxBoxSizer* bSizer82;
-    bSizer82 = new wxBoxSizer(wxHORIZONTAL);
-    m_staticText81 = new wxStaticText(m_panelTx, wxID_ANY, _("Device:"), wxDefaultPosition, wxDefaultSize, 0);
-    m_staticText81->Wrap(-1);
-    bSizer82->Add(m_staticText81, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
-    m_textCtrlTxOut = new wxTextCtrl(m_panelTx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
-    bSizer82->Add(m_textCtrlTxOut, 1, wxALIGN_CENTER_VERTICAL|wxALL, 1);
-    m_staticText71 = new wxStaticText(m_panelTx, wxID_ANY, _("Sample Rate:"), wxDefaultPosition, wxDefaultSize, 0);
-    m_staticText71->Wrap(-1);
-    bSizer82->Add(m_staticText71, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5);
-    m_cbSampleRateTxOut = new wxComboBox(m_panelTx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(90,-1), 0, NULL, wxCB_DROPDOWN);
-    bSizer82->Add(m_cbSampleRateTxOut, 0, wxALL, 1);
-
-    bSizer82a->Add(bSizer82, 0, wxEXPAND, 5);
-
-    sbSizer21->Add(bSizer82a, 1, wxEXPAND, 2);
-    buildTestControls(&m_plotScalarTxOut, &m_btnTxOutTest, m_panelTx, sbSizer21, _("Play 2s"));
-
-    gSizer2->Add(sbSizer21, 1, wxEXPAND, 5);
-    bSizer18->Add(gSizer2, 1, wxEXPAND, 1);
-    m_panelTx->SetSizer(bSizer18);
-    m_panelTx->Layout();
-    bSizer18->Fit(m_panelTx);
-    m_notebook1->AddPage(m_panelTx, _("Transmit"), false);
-
-    // API Tab -------------------------------------------------------------------
-
-    m_panelAPI = new wxPanel(m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
-    wxBoxSizer* bSizer12;
-    bSizer12 = new wxBoxSizer(wxHORIZONTAL);
-    wxGridSizer* gSizer31;
-    gSizer31 = new wxGridSizer(2, 1, 0, 0);
-    wxStaticBoxSizer* sbSizer1;
-    sbSizer1 = new wxStaticBoxSizer(new wxStaticBox(m_panelAPI, wxID_ANY, _("PortAudio")), wxVERTICAL);
-
-    wxGridSizer* gSizer3;
-    gSizer3 = new wxGridSizer(4, 2, 0, 0);
-
-    m_staticText7 = new wxStaticText(m_panelAPI, wxID_ANY, _("PortAudio Version String:"), wxDefaultPosition, wxDefaultSize, 0);
-    m_staticText7->Wrap(-1);
-    gSizer3->Add(m_staticText7, 1, wxALIGN_RIGHT|wxALL|wxALIGN_CENTER_VERTICAL, 10);
-    m_textStringVer = new wxStaticText(m_panelAPI, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
-    gSizer3->Add(m_textStringVer, 1, wxALIGN_LEFT|wxALL|wxALIGN_CENTER_VERTICAL, 10);
-
-    m_staticText8 = new wxStaticText(m_panelAPI, wxID_ANY, _("PortAudio Int Version:"), wxDefaultPosition, wxDefaultSize, 0);
-    m_staticText8->Wrap(-1);
-    gSizer3->Add(m_staticText8, 1, wxALIGN_RIGHT|wxALL|wxALIGN_CENTER_VERTICAL, 10);
-    m_textIntVer = new wxStaticText(m_panelAPI, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(45,-1), 0);
-    gSizer3->Add(m_textIntVer, 1, wxALIGN_LEFT|wxALL|wxALIGN_CENTER_VERTICAL, 10);
-
-    m_staticText5 = new wxStaticText(m_panelAPI, wxID_ANY, _("Device Count:"), wxDefaultPosition, wxDefaultSize, 0);
-    m_staticText5->Wrap(-1);
-    gSizer3->Add(m_staticText5, 1, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 10);
-    m_textCDevCount = new wxStaticText(m_panelAPI, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(45,-1), 0);
-    gSizer3->Add(m_textCDevCount, 1, wxALIGN_LEFT|wxALL|wxALIGN_CENTER_VERTICAL, 10);
-
-    m_staticText4 = new wxStaticText(m_panelAPI, wxID_ANY, _("API Count:"), wxDefaultPosition, wxDefaultSize, 0);
-    m_staticText4->Wrap(-1);
-    gSizer3->Add(m_staticText4, 1, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 10);
-    m_textAPICount = new wxStaticText(m_panelAPI, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(45,-1), 0);
-    m_textAPICount->SetMaxSize(wxSize(45,-1));
-    gSizer3->Add(m_textAPICount, 1, wxALIGN_LEFT|wxALL|wxALIGN_CENTER_VERTICAL, 10);
-
-    sbSizer1->Add(gSizer3, 1, wxEXPAND, 2);
-    gSizer31->Add(sbSizer1, 1, wxEXPAND, 2);
-    wxStaticBoxSizer* sbSizer6;
-    sbSizer6 = new wxStaticBoxSizer(new wxStaticBox(m_panelAPI, wxID_ANY, _("Other")), wxVERTICAL);
-    gSizer31->Add(sbSizer6, 1, wxEXPAND, 5);
-    bSizer12->Add(gSizer31, 1, wxEXPAND, 5);
-    m_panelAPI->SetSizer(bSizer12);
-    m_panelAPI->Layout();
-    bSizer12->Fit(m_panelAPI);
-    m_notebook1->AddPage(m_panelAPI, _("API Info"), false);
-    bSizer4->Add(m_notebook1, 1, wxEXPAND | wxALL, 0);
-    m_panel1->SetSizer(bSizer4);
-    m_panel1->Layout();
-    bSizer4->Fit(m_panel1);
-    mainSizer->Add(m_panel1, 1, wxEXPAND | wxALL, 1);
-
-    wxBoxSizer* bSizer6;
-    bSizer6 = new wxBoxSizer(wxHORIZONTAL);
-    m_btnRefresh = new wxButton(this, wxID_ANY, _("Refresh"), wxDefaultPosition, wxDefaultSize, 0);
-    bSizer6->Add(m_btnRefresh, 0, wxALIGN_CENTER|wxALL, 2);
-
-    m_sdbSizer1 = new wxStdDialogButtonSizer();
-
-    m_sdbSizer1OK = new wxButton(this, wxID_OK);
-    m_sdbSizer1->AddButton(m_sdbSizer1OK);
-
-    m_sdbSizer1Cancel = new wxButton(this, wxID_CANCEL);
-    m_sdbSizer1->AddButton(m_sdbSizer1Cancel);
-
-    m_sdbSizer1Apply = new wxButton(this, wxID_APPLY);
-    m_sdbSizer1->AddButton(m_sdbSizer1Apply);
-
-    m_sdbSizer1->Realize();
-
-    bSizer6->Add(m_sdbSizer1, 1, wxALIGN_CENTER_VERTICAL, 2);
-    mainSizer->Add(bSizer6, 0, wxEXPAND, 2);
-    this->SetSizer(mainSizer);
-    this->Layout();
-    this->Centre(wxBOTH);
-//    this->Centre(wxBOTH);
-
-    m_notebook1->SetSelection(0);
-
-    showAPIInfo();
-    m_RxInDevices.m_listDevices   = m_listCtrlRxInDevices;
-    m_RxInDevices.direction       = AUDIO_IN;
-    m_RxInDevices.m_textDevice    = m_textCtrlRxIn;
-    m_RxInDevices.m_cbSampleRate  = m_cbSampleRateRxIn;
-
-    m_RxOutDevices.m_listDevices  = m_listCtrlRxOutDevices;
-    m_RxOutDevices.direction      = AUDIO_OUT;
-    m_RxOutDevices.m_textDevice   = m_textCtrlRxOut;
-    m_RxOutDevices.m_cbSampleRate = m_cbSampleRateRxOut;
-
-    m_TxInDevices.m_listDevices   = m_listCtrlTxInDevices;
-    m_TxInDevices.direction       = AUDIO_IN;
-    m_TxInDevices.m_textDevice    = m_textCtrlTxIn;
-    m_TxInDevices.m_cbSampleRate  = m_cbSampleRateTxIn;
-
-    m_TxOutDevices.m_listDevices  = m_listCtrlTxOutDevices;
-    m_TxOutDevices.direction      = AUDIO_OUT;
-    m_TxOutDevices.m_textDevice   = m_textCtrlTxOut;
-    m_TxOutDevices.m_cbSampleRate = m_cbSampleRateTxOut;
-
-    populateParams(m_RxInDevices);
-    populateParams(m_RxOutDevices);
-    populateParams(m_TxInDevices);
-    populateParams(m_TxOutDevices);
-
-    m_listCtrlRxInDevices->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( AudioOptsDialog::OnRxInDeviceSelect ), NULL, this );
-    m_listCtrlRxOutDevices->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( AudioOptsDialog::OnRxOutDeviceSelect ), NULL, this );
-    m_listCtrlTxInDevices->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( AudioOptsDialog::OnTxInDeviceSelect ), NULL, this );
-    m_listCtrlTxOutDevices->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( AudioOptsDialog::OnTxOutDeviceSelect ), NULL, this );
-
-    // wire up test buttons
-    m_btnRxInTest->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnRxInTest ), NULL, this );
-    m_btnRxOutTest->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnRxOutTest ), NULL, this );
-    m_btnTxInTest->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnTxInTest ), NULL, this );
-    m_btnTxOutTest->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnTxOutTest ), NULL, this );
-
-    m_btnRefresh->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnRefreshClick ), NULL, this );
-    m_sdbSizer1Apply->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnApplyAudioParameters ), NULL, this );
-    m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnCancelAudioParameters ), NULL, this );
-    m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnOkAudioParameters ), NULL, this );
-/*
-        void OnClose( wxCloseEvent& event ) { event.Skip(); }
-        void OnHibernate( wxActivateEvent& event ) { event.Skip(); }
-        void OnIconize( wxIconizeEvent& event ) { event.Skip(); }
-        void OnInitDialog( wxInitDialogEvent& event ) { event.Skip(); }
-*/
-//    this->Connect(wxEVT_CLOSE_WINDOW, wxCloseEventHandler(AudioOptsDialog::OnClose));
-    this->Connect(wxEVT_HIBERNATE, wxActivateEventHandler(AudioOptsDialog::OnHibernate));
-    this->Connect(wxEVT_ICONIZE, wxIconizeEventHandler(AudioOptsDialog::OnIconize));
-    this->Connect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(AudioOptsDialog::OnInitDialog));
-}
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// ~AudioOptsDialog()
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-AudioOptsDialog::~AudioOptsDialog()
-{
-    Pa_Terminate();
-
-    // Disconnect Events
-    this->Disconnect(wxEVT_HIBERNATE, wxActivateEventHandler(AudioOptsDialog::OnHibernate));
-    this->Disconnect(wxEVT_ICONIZE, wxIconizeEventHandler(AudioOptsDialog::OnIconize));
-    this->Disconnect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(AudioOptsDialog::OnInitDialog));
-
-    m_listCtrlRxInDevices->Disconnect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(AudioOptsDialog::OnRxInDeviceSelect), NULL, this);
-    m_listCtrlRxOutDevices->Disconnect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(AudioOptsDialog::OnRxOutDeviceSelect), NULL, this);
-    m_listCtrlTxInDevices->Disconnect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(AudioOptsDialog::OnTxInDeviceSelect), NULL, this);
-    m_listCtrlTxOutDevices->Disconnect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(AudioOptsDialog::OnTxOutDeviceSelect), NULL, this);
-
-    m_btnRxInTest->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnRxInTest ), NULL, this );
-    m_btnRxOutTest->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnRxOutTest ), NULL, this );
-    m_btnTxInTest->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnTxInTest ), NULL, this );
-    m_btnTxOutTest->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnTxOutTest ), NULL, this );
-
-    m_btnRefresh->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AudioOptsDialog::OnRefreshClick), NULL, this);
-    m_sdbSizer1Apply->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AudioOptsDialog::OnApplyAudioParameters), NULL, this);
-    m_sdbSizer1Cancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AudioOptsDialog::OnCancelAudioParameters), NULL, this);
-    m_sdbSizer1OK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AudioOptsDialog::OnOkAudioParameters), NULL, this);
-
-}
-
-//-------------------------------------------------------------------------
-// OnInitDialog()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnInitDialog( wxInitDialogEvent& event )
-{
-    ExchangeData(EXCHANGE_DATA_IN);
-}
-
-//-------------------------------------------------------------------------
-// OnInitDialog()
-//
-// helper function to look up name of devNum, and if it exists write
-// name to textCtrl.  Used to trap dissapearing devices.
-//-------------------------------------------------------------------------
-int AudioOptsDialog::setTextCtrlIfDevNumValid(wxTextCtrl *textCtrl, wxListCtrl *listCtrl, int devNum)
-{
-    int i, aDevNum, found_devNum;
-
-    // ignore last list entry as it is the "none" entry
-
-    found_devNum = 0;
-    for(i=0; i<listCtrl->GetItemCount()-1; i++) {
-        aDevNum = wxAtoi(listCtrl->GetItemText(i, 1));
-        //printf("aDevNum: %d devNum: %d\n", aDevNum, devNum);
-        if (aDevNum == devNum) {
-            found_devNum = 1;
-            textCtrl->SetValue(listCtrl->GetItemText(i, 0) + " (" + wxString::Format(wxT("%i"),devNum) + ")");
-            printf("setting focus of %d\n", i);
-            listCtrl->SetItemState(i, wxLIST_STATE_FOCUSED, wxLIST_STATE_FOCUSED);
-        }
-    }
-
-    if (found_devNum) 
-        return devNum;
-    else {
-        textCtrl->SetValue("none");
-        return -1;
-    }
-}
-
-//-------------------------------------------------------------------------
-// ExchangeData()
-//-------------------------------------------------------------------------
-int AudioOptsDialog::ExchangeData(int inout)
-{
-    if(inout == EXCHANGE_DATA_IN)
-    {
-        // Map sound card device numbers to tx/rx device numbers depending
-        // on number of sound cards in use
-
-        printf("EXCHANGE_DATA_IN:\n");
-        printf("  g_nSoundCards: %d\n", g_nSoundCards);
-        printf("  g_soundCard1InDeviceNum: %d\n", g_soundCard1InDeviceNum);
-        printf("  g_soundCard1OutDeviceNum: %d\n", g_soundCard1OutDeviceNum);
-        printf("  g_soundCard1SampleRate: %d\n", g_soundCard1SampleRate);
-        printf("  g_soundCard2InDeviceNum: %d\n", g_soundCard2InDeviceNum);
-        printf("  g_soundCard2OutDeviceNum: %d\n", g_soundCard2OutDeviceNum);
-        printf("  g_soundCard2SampleRate: %d\n", g_soundCard2SampleRate);
-
-        if (g_nSoundCards == 0) {
-            m_textCtrlRxIn ->SetValue("none"); rxInAudioDeviceNum  = -1;
-            m_textCtrlRxOut->SetValue("none"); rxOutAudioDeviceNum = -1;
-            m_textCtrlTxIn ->SetValue("none"); txInAudioDeviceNum  = -1;
-            m_textCtrlTxOut->SetValue("none"); txOutAudioDeviceNum = -1;           
-        }
-
-        if (g_nSoundCards == 1) {
-            rxInAudioDeviceNum  = setTextCtrlIfDevNumValid(m_textCtrlRxIn, 
-                                                           m_listCtrlRxInDevices, 
-                                                           g_soundCard1InDeviceNum);
-
-            rxOutAudioDeviceNum = setTextCtrlIfDevNumValid(m_textCtrlRxOut, 
-                                                           m_listCtrlRxOutDevices, 
-                                                           g_soundCard1OutDeviceNum);
-
-            if ((rxInAudioDeviceNum != -1) && (rxInAudioDeviceNum != -1)) {
-                m_cbSampleRateRxIn->SetValue(wxString::Format(wxT("%i"),g_soundCard1SampleRate));
-                m_cbSampleRateRxOut->SetValue(wxString::Format(wxT("%i"),g_soundCard1SampleRate));
-            }
-
-            m_textCtrlTxIn ->SetValue("none"); txInAudioDeviceNum  = -1;
-            m_textCtrlTxOut->SetValue("none"); txOutAudioDeviceNum = -1;           
-        }
-
-        if (g_nSoundCards == 2) {
-            rxInAudioDeviceNum  = setTextCtrlIfDevNumValid(m_textCtrlRxIn, 
-                                                           m_listCtrlRxInDevices, 
-                                                           g_soundCard1InDeviceNum);
-
-            rxOutAudioDeviceNum = setTextCtrlIfDevNumValid(m_textCtrlRxOut, 
-                                                           m_listCtrlRxOutDevices, 
-                                                           g_soundCard2OutDeviceNum);
-
-            txInAudioDeviceNum  = setTextCtrlIfDevNumValid(m_textCtrlTxIn, 
-                                                           m_listCtrlTxInDevices, 
-                                                           g_soundCard2InDeviceNum);
-
-            txOutAudioDeviceNum = setTextCtrlIfDevNumValid(m_textCtrlTxOut, 
-                                                           m_listCtrlTxOutDevices, 
-                                                           g_soundCard1OutDeviceNum);
-
-            if ((rxInAudioDeviceNum != -1) && (txOutAudioDeviceNum != -1)) {
-                m_cbSampleRateRxIn->SetValue(wxString::Format(wxT("%i"),g_soundCard1SampleRate));
-                m_cbSampleRateTxOut->SetValue(wxString::Format(wxT("%i"),g_soundCard1SampleRate));
-            }
-
-            if ((txInAudioDeviceNum != -1) && (rxOutAudioDeviceNum != -1)) {
-                m_cbSampleRateTxIn->SetValue(wxString::Format(wxT("%i"),g_soundCard2SampleRate));
-                m_cbSampleRateRxOut->SetValue(wxString::Format(wxT("%i"),g_soundCard2SampleRate));
-            }
-        }
-        printf("  rxInAudioDeviceNum: %d\n  rxOutAudioDeviceNum: %d\n  txInAudioDeviceNum: %d\n  txOutAudioDeviceNum: %d\n",
-               rxInAudioDeviceNum, rxOutAudioDeviceNum, txInAudioDeviceNum, txOutAudioDeviceNum);
-    }
-
-    if(inout == EXCHANGE_DATA_OUT)
-    {
-        int valid_one_card_config = 0;
-        int valid_two_card_config = 0;
-        wxString sampleRate1, sampleRate2;
-
-        printf("EXCHANGE_DATA_OUT:\n");
-        printf("  rxInAudioDeviceNum: %d\n  rxOutAudioDeviceNum: %d\n  txInAudioDeviceNum: %d\n  txOutAudioDeviceNum: %d\n",
-               rxInAudioDeviceNum, rxOutAudioDeviceNum, txInAudioDeviceNum, txOutAudioDeviceNum);
-
-        // ---------------------------------------------------------------
-        // check we have a valid 1 or 2 sound card configuration
-        // ---------------------------------------------------------------
-
-        // one sound card config, tx device numbers should be set to -1 
-
-        if ((rxInAudioDeviceNum != -1) && (rxOutAudioDeviceNum != -1) &&
-            (txInAudioDeviceNum == -1) && (txOutAudioDeviceNum == -1)) {
-            valid_one_card_config = 1; 
-
-            // in and out sample rate must be the same, as there is one callback
-            
-            sampleRate1 = m_cbSampleRateRxIn->GetValue();
-            if (!sampleRate1.IsSameAs(m_cbSampleRateRxOut->GetValue())) {
-                wxMessageBox(wxT("With a single sound card the Sample Rate of "
-                                 "From Radio and To Speaker/Headphones must be the same."), wxT(""), wxOK);
-                return -1;
-            }
-        }
-
-        // two card configuration
-
-        if ((rxInAudioDeviceNum != -1) && (rxOutAudioDeviceNum != -1) &&
-            (txInAudioDeviceNum != -1) && (txOutAudioDeviceNum != -1)) {
-
-            valid_two_card_config = 1; 
-
-            // Check we haven't doubled up on sound devices
-
-            if (rxInAudioDeviceNum == txInAudioDeviceNum) {
-                wxMessageBox(wxT("You must use different devices for From Radio and From Microphone"), wxT(""), wxOK);
-                return -1;
-            }
-
-            if (rxOutAudioDeviceNum == txOutAudioDeviceNum) {
-                wxMessageBox(wxT("You must use different devices for To Radio and To Speaker/Headphones"), wxT(""), wxOK);
-                return -1;
-            }
-
-            // Check sample rates for callback 1 devices are the same,
-            // as input and output are handled synchronously by one
-            // portaudio callback
-            
-            sampleRate1 = m_cbSampleRateRxIn->GetValue();
-            if (!sampleRate1.IsSameAs(m_cbSampleRateTxOut->GetValue())) {
-                wxMessageBox(wxT("With two sound cards the Sample Rate "
-                                 "of From Radio and To Radio must be the same."), wxT(""), wxOK);
-                return -1;
-            }
-            // check sample rate for callback 2 devices is the same
-
-            sampleRate2 = m_cbSampleRateTxIn->GetValue();
-            if (!sampleRate2.IsSameAs(m_cbSampleRateRxOut->GetValue())) {
-                wxMessageBox(wxT("With two sound cards the Sample Rate of "
-                                 "From Microphone and To Speaker/Headphones must be the same."), wxT(""), wxOK);
-                return -1;
-            }
-        }
-
-        printf("  valid_one_card_config: %d  valid_two_card_config: %d\n", valid_one_card_config, valid_two_card_config);
-
-        if (!valid_one_card_config && !valid_two_card_config) {
-            wxMessageBox(wxT("Invalid one or two sound card configuration"), wxT(""), wxOK);
-            return -1;
-        }
-
-        // ---------------------------------------------------------------
-        // Map Rx/TX device numbers to sound card device numbers used
-        // in callbacks. Portaudio uses one callback per sound card so
-        // we have to be soundcard oriented at run time rather than
-        // Tx/Rx oriented as in this dialog.
-        // ---------------------------------------------------------------
-        g_nSoundCards = 0;
-        g_soundCard1InDeviceNum = g_soundCard1OutDeviceNum = g_soundCard2InDeviceNum = g_soundCard2OutDeviceNum = -1;
-
-        if (valid_one_card_config) {
-
-            // Only callback 1 used
-
-            g_nSoundCards = 1;
-            g_soundCard1InDeviceNum  = rxInAudioDeviceNum;
-            g_soundCard1OutDeviceNum = rxOutAudioDeviceNum;
-            g_soundCard1SampleRate = wxAtoi(sampleRate1);
-        }
-
-        if (valid_two_card_config) {
-            g_nSoundCards = 2;
-            g_soundCard1InDeviceNum  = rxInAudioDeviceNum;
-            g_soundCard1OutDeviceNum = txOutAudioDeviceNum;
-            g_soundCard1SampleRate   = wxAtoi(sampleRate1);
-            g_soundCard2InDeviceNum  = txInAudioDeviceNum;
-            g_soundCard2OutDeviceNum = rxOutAudioDeviceNum;
-            g_soundCard2SampleRate   = wxAtoi(sampleRate2);
-        }
-
-        printf("  g_nSoundCards: %d\n", g_nSoundCards);
-        printf("  g_soundCard1InDeviceNum: %d\n", g_soundCard1InDeviceNum);
-        printf("  g_soundCard1OutDeviceNum: %d\n", g_soundCard1OutDeviceNum);
-        printf("  g_soundCard1SampleRate: %d\n", g_soundCard1SampleRate);
-        printf("  g_soundCard2InDeviceNum: %d\n", g_soundCard2InDeviceNum);
-        printf("  g_soundCard2OutDeviceNum: %d\n", g_soundCard2OutDeviceNum);
-        printf("  g_soundCard2SampleRate: %d\n", g_soundCard2SampleRate);
-
-        wxConfigBase *pConfig = wxConfigBase::Get();
-        pConfig->Write(wxT("/Audio/soundCard1InDeviceNum"),       g_soundCard1InDeviceNum);
-        pConfig->Write(wxT("/Audio/soundCard1OutDeviceNum"),      g_soundCard1OutDeviceNum);
-        pConfig->Write(wxT("/Audio/soundCard1SampleRate"),        g_soundCard1SampleRate );
-
-        pConfig->Write(wxT("/Audio/soundCard2InDeviceNum"),       g_soundCard2InDeviceNum);
-        pConfig->Write(wxT("/Audio/soundCard2OutDeviceNum"),      g_soundCard2OutDeviceNum);
-        pConfig->Write(wxT("/Audio/soundCard2SampleRate"),        g_soundCard2SampleRate );
-
-        pConfig->Flush();
-        delete wxConfigBase::Set((wxConfigBase *) NULL);
-    }
-
-    return 0;
-}
-
-//-------------------------------------------------------------------------
-// buildListOfSupportedSampleRates()
-//-------------------------------------------------------------------------
-int AudioOptsDialog:: buildListOfSupportedSampleRates(wxComboBox *cbSampleRate, int devNum, int in_out)
-{
-    // every sound device has a different list of supported sample rates, so
-    // we work out which ones are supported and populate the list ctrl
-
-    static double standardSampleRates[] =
-    {
-        8000.0,     9600.0,
-        11025.0,    12000.0,
-        16000.0,    22050.0,
-        24000.0,    32000.0,
-        44100.0,    48000.0,
-        88200.0,    96000.0,
-        192000.0,   -1          // negative terminated  list
-    };
-
-    const PaDeviceInfo  *deviceInfo;
-    PaStreamParameters   inputParameters, outputParameters;
-    PaError              err;
-    wxString             str;
-    int                  i, numSampleRates;
-
-    deviceInfo = Pa_GetDeviceInfo(devNum);
-    if (deviceInfo == NULL) {
-        printf("Pa_GetDeviceInfo(%d) failed!\n", devNum);
-        cbSampleRate->Clear();
-        return 0;
-    }
-
-    inputParameters.device = devNum;
-    inputParameters.channelCount = deviceInfo->maxInputChannels;
-    inputParameters.sampleFormat = paInt16;
-    inputParameters.suggestedLatency = 0;
-    inputParameters.hostApiSpecificStreamInfo = NULL;
-        
-    outputParameters.device = devNum;
-    outputParameters.channelCount = deviceInfo->maxOutputChannels;
-    outputParameters.sampleFormat = paInt16;
-    outputParameters.suggestedLatency = 0;
-    outputParameters.hostApiSpecificStreamInfo = NULL;
-    
-    cbSampleRate->Clear();
-    //printf("devNum %d supports: ", devNum);
-    numSampleRates = 0;
-    for(i = 0; standardSampleRates[i] > 0; i++)
-    {      
-        if (in_out == AUDIO_IN)
-            err = Pa_IsFormatSupported(&inputParameters, NULL, standardSampleRates[i]);
-        else
-            err = Pa_IsFormatSupported(NULL, &outputParameters, standardSampleRates[i]);
-
-        if( err == paFormatIsSupported ) {
-            str.Printf("%i", (int)standardSampleRates[i]);
-            cbSampleRate->AppendString(str);
-            printf("%i ", (int)standardSampleRates[i]);
-            numSampleRates++;
-        }
-    }
-    printf("\n");
-
-    return numSampleRates;
-}
-
-//-------------------------------------------------------------------------
-// showAPIInfo()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::showAPIInfo()
-{
-    wxString    strval;
-    int         apiVersion;
-    int         apiCount        = 0;
-    int         numDevices      = 0;
-
-    strval = Pa_GetVersionText();
-    m_textStringVer->SetLabel(strval);
-
-    apiVersion = Pa_GetVersion();
-    strval.Printf(wxT("%d"), apiVersion);
-    m_textIntVer->SetLabel(strval);
-
-    apiCount = Pa_GetHostApiCount();
-    strval.Printf(wxT("%d"), apiCount);
-    m_textAPICount->SetLabel(strval);
-
-    numDevices = Pa_GetDeviceCount();
-    strval.Printf(wxT("%d"), numDevices);
-    m_textCDevCount->SetLabel(strval);
-}
-
-//-------------------------------------------------------------------------
-// populateParams()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::populateParams(AudioInfoDisplay ai)
-{
-    const       PaDeviceInfo *deviceInfo = NULL;
-    wxListCtrl* ctrl    = ai.m_listDevices;
-    int         in_out  = ai.direction;
-    long        idx;
-    int         numDevices;
-    wxListItem  listItem;
-    wxString    buf;
-    int         devn;
-    int         col = 0;
-
-    numDevices = Pa_GetDeviceCount();
-
-    if(ctrl->GetColumnCount() > 0)
-    {
-        ctrl->ClearAll();
-    }
-
-    listItem.SetAlign(wxLIST_FORMAT_LEFT);
-    listItem.SetText(wxT("Device"));
-    idx = ctrl->InsertColumn(col, listItem);
-    ctrl->SetColumnWidth(col++, 300);
-
-    listItem.SetAlign(wxLIST_FORMAT_CENTRE);
-    listItem.SetText(wxT("ID"));
-    idx = ctrl->InsertColumn(col, listItem);
-    ctrl->SetColumnWidth(col++, 45);
-
-    listItem.SetAlign(wxLIST_FORMAT_LEFT);
-    listItem.SetText(wxT("API"));
-    idx = ctrl->InsertColumn(col, listItem);
-    ctrl->SetColumnWidth(col++, 100);
-
-    if(in_out == AUDIO_IN)
-    {
-        listItem.SetAlign(wxLIST_FORMAT_CENTRE);
-        listItem.SetText(wxT("Default Sample Rate"));
-        idx = ctrl->InsertColumn(col, listItem);
-        ctrl->SetColumnWidth(col++, 160);
-    }
-    else if(in_out == AUDIO_OUT)
-    {
-        listItem.SetAlign(wxLIST_FORMAT_CENTRE);
-        listItem.SetText(wxT("Default Sample Rate"));
-        idx = ctrl->InsertColumn(col, listItem);
-        ctrl->SetColumnWidth(col++, 160);
-    }
-
-    #ifdef LATENCY
-    listItem.SetAlign(wxLIST_FORMAT_CENTRE);
-    listItem.SetText(wxT("Min Latency"));
-    ctrl->InsertColumn(col, listItem);
-    ctrl->SetColumnWidth(col++, 100);
-
-    listItem.SetAlign(wxLIST_FORMAT_CENTRE);
-    listItem.SetText(wxT("Max Latency"));
-    ctrl->InsertColumn(col, listItem);
-    ctrl->SetColumnWidth(col++, 100);
-    #endif
-
-    for(devn = 0; devn < numDevices; devn++)
-    {
-        buf.Printf(wxT(""));
-        deviceInfo = Pa_GetDeviceInfo(devn);
-        if( ((in_out == AUDIO_IN) && (deviceInfo->maxInputChannels > 0)) ||
-            ((in_out == AUDIO_OUT) && (deviceInfo->maxOutputChannels > 0)))
-        {
-            col = 0;
-            buf.Printf(wxT("%s"), deviceInfo->name);
-            idx = ctrl->InsertItem(ctrl->GetItemCount(), buf);
-            col++;
-                
-            buf.Printf(wxT("%d"), devn);
-            ctrl->SetItem(idx, col++, buf);
-
-            buf.Printf(wxT("%s"), Pa_GetHostApiInfo(deviceInfo->hostApi)->name);
-            ctrl->SetItem(idx, col++, buf);
-
-            buf.Printf(wxT("%i"), (int)deviceInfo->defaultSampleRate);
-            ctrl->SetItem(idx, col++, buf);
-
-            #ifdef LATENCY
-            if (in_out == AUDIO_IN)
-                buf.Printf(wxT("%8.4f"), deviceInfo->defaultLowInputLatency);
-            else
-                buf.Printf(wxT("%8.4f"), deviceInfo->defaultLowOutputLatency);               
-            ctrl->SetItem(idx, col++, buf);
-
-            if (in_out == AUDIO_IN)
-                buf.Printf(wxT("%8.4f"), deviceInfo->defaultHighInputLatency);
-            else
-                 buf.Printf(wxT("%8.4f"), deviceInfo->defaultHighOutputLatency);             
-            ctrl->SetItem(idx, col++, buf);
-            #endif
-        }        
-    }
-
-    // add "none" option at end
-
-    buf.Printf(wxT("%s"), "none");
-    idx = ctrl->InsertItem(ctrl->GetItemCount(), buf);
-}
-
-//-------------------------------------------------------------------------
-// OnDeviceSelect()
-//
-// helper function to set up "Device:" and "Sample Rate:" fields when
-// we click on a line in the list of devices box
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnDeviceSelect(wxComboBox *cbSampleRate, 
-                                     wxTextCtrl *textCtrl, 
-                                     int        *devNum, 
-                                     wxListCtrl *listCtrlDevices, 
-                                     int         index,
-                                     int         in_out)
-{
-
-    wxString devName = listCtrlDevices->GetItemText(index, 0);
-     if (devName.IsSameAs("none")) {
-        *devNum = -1;
-        textCtrl->SetValue("none");
-    }
-    else {
-        *devNum = wxAtoi(listCtrlDevices->GetItemText(index, 1));
-        textCtrl->SetValue(devName + " (" + wxString::Format(wxT("%i"),*devNum) + ")");
-
-        int numSampleRates = buildListOfSupportedSampleRates(cbSampleRate, *devNum, in_out);
-        if (numSampleRates) {
-            wxString defSampleRate = listCtrlDevices->GetItemText(index, 3);        
-            cbSampleRate->SetValue(defSampleRate);
-        }
-        else {
-             cbSampleRate->SetValue("None");           
-        }
-    }
-}
-
-//-------------------------------------------------------------------------
-// OnRxInDeviceSelect()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnRxInDeviceSelect(wxListEvent& evt)
-{
-    OnDeviceSelect(m_cbSampleRateRxIn, 
-                   m_textCtrlRxIn, 
-                   &rxInAudioDeviceNum, 
-                   m_listCtrlRxInDevices, 
-                   evt.GetIndex(),
-                   AUDIO_IN);
-}
-
-//-------------------------------------------------------------------------
-// OnRxOutDeviceSelect()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnRxOutDeviceSelect(wxListEvent& evt)
-{
-    OnDeviceSelect(m_cbSampleRateRxOut, 
-                   m_textCtrlRxOut, 
-                   &rxOutAudioDeviceNum, 
-                   m_listCtrlRxOutDevices, 
-                   evt.GetIndex(),
-                   AUDIO_OUT);
-}
-
-//-------------------------------------------------------------------------
-// OnTxInDeviceSelect()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnTxInDeviceSelect(wxListEvent& evt)
-{
-    OnDeviceSelect(m_cbSampleRateTxIn, 
-                   m_textCtrlTxIn, 
-                   &txInAudioDeviceNum, 
-                   m_listCtrlTxInDevices, 
-                   evt.GetIndex(),
-                   AUDIO_IN);
-}
-
-//-------------------------------------------------------------------------
-// OnTxOutDeviceSelect()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnTxOutDeviceSelect(wxListEvent& evt)
-{
-    OnDeviceSelect(m_cbSampleRateTxOut, 
-                   m_textCtrlTxOut, 
-                   &txOutAudioDeviceNum, 
-                   m_listCtrlTxOutDevices, 
-                   evt.GetIndex(),
-                   AUDIO_OUT);
-}
-
-//-------------------------------------------------------------------------
-// plotDeviceInputForAFewSecs()
-//
-// opens a record device and plots the input speech for a few seconds.  This is "modal" using
-// synchronous portaudio functions, so the GUI will not respond until after test sample has been
-// taken
-//-------------------------------------------------------------------------
-void AudioOptsDialog::plotDeviceInputForAFewSecs(int devNum, PlotScalar *plotScalar) {
-    PaStreamParameters  inputParameters;
-    const PaDeviceInfo *deviceInfo = NULL;
-    PaStream           *stream = NULL;
-    PaError             err;
-    short               in48k_stereo_short[2*TEST_BUF_SIZE];
-    short               in48k_short[TEST_BUF_SIZE];
-    short               in8k_short[TEST_BUF_SIZE];
-    int                 numDevices, nBufs, i, j, src_error,inputChannels;
-    float               t;
-    SRC_STATE          *src;
-    FIFO               *fifo;
-
-    // a basic sanity check
-    numDevices = Pa_GetDeviceCount();
-    if (devNum >= numDevices)
-        return;
-    if (devNum < 0)
-        return;
-    printf("devNum %d\n", devNum);
-
-    fifo = fifo_create((int)(DT*TEST_WAVEFORM_PLOT_FS*2)); assert(fifo != NULL);
-    src = src_new(SRC_SINC_FASTEST, 1, &src_error); assert(src != NULL);
-
-    // work out how many input channels this device supports.
-
-    deviceInfo = Pa_GetDeviceInfo(devNum);
-    if (deviceInfo == NULL) {
-        wxMessageBox(wxT("Couldn't get device info from Port Audio for Sound Card "), wxT("Error"), wxOK);
-        return;
-    }
-    if (deviceInfo->maxInputChannels == 1)
-        inputChannels = 1;
-    else
-        inputChannels = 2;
-
-    // open device
-
-    inputParameters.device = devNum;
-    inputParameters.channelCount = inputChannels;
-    inputParameters.sampleFormat = paInt16;
-    inputParameters.suggestedLatency = Pa_GetDeviceInfo( inputParameters.device )->defaultHighInputLatency;
-    inputParameters.hostApiSpecificStreamInfo = NULL;
-
-    nBufs = TEST_WAVEFORM_PLOT_TIME*TEST_FS/TEST_BUF_SIZE;
-    printf("inputChannels: %d nBufs %d\n", inputChannels, nBufs);
-
-    err = Pa_OpenStream(
-              &stream,
-              &inputParameters,
-              NULL,
-              TEST_FS,
-              TEST_BUF_SIZE,
-              paClipOff,    
-              NULL,       // no callback, use blocking API
-              NULL ); 
-    if (err != paNoError) {
-        wxMessageBox(wxT("Couldn't initialise sound device."), wxT("Error"), wxOK);       
-        return;
-    }
-
-    err = Pa_StartStream(stream);
-    if (err != paNoError) {
-        wxMessageBox(wxT("Couldn't start sound device."), wxT("Error"), wxOK);       
-        return;
-    }
-
-    for(i=0, t=0.0; i<nBufs; i++, t+=(float)TEST_BUF_SIZE/TEST_FS) {
-        Pa_ReadStream(stream, in48k_stereo_short, TEST_BUF_SIZE);
-        if (inputChannels == 2) {
-            for(j=0; j<TEST_BUF_SIZE; j++)
-                in48k_short[j] = in48k_stereo_short[2*j]; // left channel only
-        }
-        else {
-            for(j=0; j<TEST_BUF_SIZE; j++)
-                in48k_short[j] = in48k_stereo_short[j]; 
-        }
-        int n8k = resample(src, in8k_short, in48k_short, 8000, TEST_FS, TEST_BUF_SIZE, TEST_BUF_SIZE);
-        resample_for_plot(fifo, in8k_short, n8k);
-
-        // every TEST_DT seconds update plot, unfortunately plot
-        // doesnt get updated to end as we are blocking events in this
-        // function
-
-        if (t > TEST_DT) {
-            t -= TEST_DT;
-            short plotSamples[TEST_WAVEFORM_PLOT_BUF];
-            if (fifo_read(fifo, plotSamples, TEST_WAVEFORM_PLOT_BUF))
-                memset(plotSamples, 0, TEST_WAVEFORM_PLOT_BUF*sizeof(short));
-            plotScalar->add_new_short_samples(0, plotSamples, TEST_WAVEFORM_PLOT_BUF, 32767);
-            plotScalar->Refresh();
-       }
-    }
-   
-    err = Pa_StopStream(stream);
-    if (err != paNoError) {
-        wxMessageBox(wxT("Couldn't stop sound device."), wxT("Error"), wxOK);       
-        return;
-    }
-    Pa_CloseStream(stream);
-
-    fifo_destroy(fifo);
-    src_delete(src);
-}
-
-//-------------------------------------------------------------------------
-// plotDeviceOutputForAFewSecs()
-//
-// opens a play device and plays a tone for a few seconds.  This is "modal" using
-// synchronous portaudio functions, so the GUI will not respond until after test sample has been
-// taken.  Also plots a pretty picture like the record versions
-//-------------------------------------------------------------------------
-void AudioOptsDialog::plotDeviceOutputForAFewSecs(int devNum, PlotScalar *plotScalar) {
-    PaStreamParameters  outputParameters;
-    const PaDeviceInfo *deviceInfo = NULL;
-    PaStream           *stream = NULL;
-    PaError             err;
-    short               out48k_stereo_short[2*TEST_BUF_SIZE];
-    short               out48k_short[TEST_BUF_SIZE];
-    short               out8k_short[TEST_BUF_SIZE];
-    int                 numDevices, nBufs, i, j, src_error, n, outputChannels;
-    float               t;
-    SRC_STATE          *src;
-    FIFO               *fifo;
-
-    // a basic sanity check
-    numDevices = Pa_GetDeviceCount();
-    if (devNum >= numDevices)
-        return;
-    if (devNum < 0)
-        return;
-
-    fifo = fifo_create((int)(DT*TEST_WAVEFORM_PLOT_FS*2)); assert(fifo != NULL);
-    src = src_new(SRC_SINC_FASTEST, 1, &src_error); assert(src != NULL);
-
-    // work out how many output channels this device supports.
-
-    deviceInfo = Pa_GetDeviceInfo(devNum);
-    if (deviceInfo == NULL) {
-        wxMessageBox(wxT("Couldn't get device info from Port Audio for Sound Card "), wxT("Error"), wxOK);
-        return;
-    }
-    if (deviceInfo->maxOutputChannels == 1)
-        outputChannels = 1;
-    else
-        outputChannels = 2;
-
-    printf("outputChannels: %d\n", outputChannels);
-
-    outputParameters.device = devNum;
-    outputParameters.channelCount = outputChannels;
-    outputParameters.sampleFormat = paInt16;
-    outputParameters.suggestedLatency = Pa_GetDeviceInfo( outputParameters.device )->defaultHighOutputLatency;
-    outputParameters.hostApiSpecificStreamInfo = NULL;
-
-    nBufs = TEST_WAVEFORM_PLOT_TIME*TEST_FS/TEST_BUF_SIZE;
-
-    err = Pa_OpenStream(
-              &stream,
-              NULL,
-              &outputParameters,
-              TEST_FS,
-              TEST_BUF_SIZE,
-              paClipOff,    
-              NULL,       // no callback, use blocking API
-              NULL ); 
-    if (err != paNoError) {
-        wxMessageBox(wxT("Couldn't initialise sound device."), wxT("Error"), wxOK);       
-        return;
-    }
-
-    err = Pa_StartStream(stream);
-    if (err != paNoError) {
-        wxMessageBox(wxT("Couldn't start sound device."), wxT("Error"), wxOK);       
-        return;
-    }
-
-    for(i=0, t=0.0, n=0; i<nBufs; i++, t+=(float)TEST_BUF_SIZE/TEST_FS) {
-        for(j=0; j<TEST_BUF_SIZE; j++,n++) {
-            out48k_short[j] = 2000.0*cos(6.2832*(n++)*400.0/TEST_FS);
-            if (outputChannels == 2) {
-                out48k_stereo_short[2*j] = out48k_short[j];   // left channel
-                out48k_stereo_short[2*j+1] = out48k_short[j]; // right channel
-            }
-            else {
-                out48k_stereo_short[j] = out48k_short[j];     // mono
-            }
-        }
-        Pa_WriteStream(stream, out48k_stereo_short, TEST_BUF_SIZE);
-
-        // convert back to 8kHz just for plotting
-        int n8k = resample(src, out8k_short, out48k_short, 8000, TEST_FS, TEST_BUF_SIZE, TEST_BUF_SIZE);
-        resample_for_plot(fifo, out8k_short, n8k);
-
-        // every TEST_DT seconds update plot
-
-        if (t > TEST_DT) {
-            t -= TEST_DT;
-            short plotSamples[TEST_WAVEFORM_PLOT_BUF];
-            if (fifo_read(fifo, plotSamples, TEST_WAVEFORM_PLOT_BUF))
-                memset(plotSamples, 0, TEST_WAVEFORM_PLOT_BUF*sizeof(short));
-            plotScalar->add_new_short_samples(0, plotSamples, TEST_WAVEFORM_PLOT_BUF, 32767);
-            plotScalar->Refresh();
-       }
-    }
-   
-    err = Pa_StopStream(stream);
-    if (err != paNoError) {
-        wxMessageBox(wxT("Couldn't stop sound device."), wxT("Error"), wxOK);       
-        return;
-    }
-    Pa_CloseStream(stream);
-
-    fifo_destroy(fifo);
-    src_delete(src);
-}
-
-//-------------------------------------------------------------------------
-// OnRxInTest()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnRxInTest(wxCommandEvent& event)
-{
-    plotDeviceInputForAFewSecs(rxInAudioDeviceNum, m_plotScalarRxIn);
-}
-
-//-------------------------------------------------------------------------
-// OnRxOutTest()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnRxOutTest(wxCommandEvent& event)
-{
-    plotDeviceOutputForAFewSecs(rxOutAudioDeviceNum, m_plotScalarRxOut);
-}
-
-//-------------------------------------------------------------------------
-// OnTxInTest()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnTxInTest(wxCommandEvent& event)
-{
-    plotDeviceInputForAFewSecs(txInAudioDeviceNum, m_plotScalarTxIn);
-}
-
-//-------------------------------------------------------------------------
-// OnTxOutTest()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnTxOutTest(wxCommandEvent& event)
-{
-    plotDeviceOutputForAFewSecs(txOutAudioDeviceNum, m_plotScalarTxOut);
-}
-
-//-------------------------------------------------------------------------
-// OnRefreshClick()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnRefreshClick(wxCommandEvent& event)
-{
-    // restart portaudio, to re-sample available devices
-
-    Pa_Terminate();
-    Pa_Init();
-
-    m_notebook1->SetSelection(0);
-    showAPIInfo();
-    populateParams(m_RxInDevices);
-    populateParams(m_RxOutDevices);
-    populateParams(m_TxInDevices);
-    populateParams(m_TxOutDevices);
-
-    // some devices may have dissapeared, so possibily change sound
-    // card config
-
-    ExchangeData(EXCHANGE_DATA_IN);
-}
-
-//-------------------------------------------------------------------------
-// OnApplyAudioParameters()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnApplyAudioParameters(wxCommandEvent& event)
-{
-    ExchangeData(EXCHANGE_DATA_OUT);
-    if(m_isPaInitialized)
-    {
-        if((pa_err = Pa_Terminate()) == paNoError)
-        {
-            m_isPaInitialized = false;
-        }
-        else
-        {
-            wxMessageBox(wxT("Port Audio failed to Terminate"), wxT("Pa_Terminate"), wxOK);
-        }
-    }
-}
-
-//-------------------------------------------------------------------------
-// OnCancelAudioParameters()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnCancelAudioParameters(wxCommandEvent& event)
-{
-    if(m_isPaInitialized)
-    {
-        if((pa_err = Pa_Terminate()) == paNoError)
-        {
-            m_isPaInitialized = false;
-        }
-        else
-        {
-            wxMessageBox(wxT("Port Audio failed to Terminate"), wxT("Pa_Terminate"), wxOK);
-        }
-    }
-    EndModal(wxCANCEL);
-}
-
-//-------------------------------------------------------------------------
-// OnOkAudioParameters()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnOkAudioParameters(wxCommandEvent& event)
-{
-    int status = ExchangeData(EXCHANGE_DATA_OUT);
-
-    // We only accept OK if config sucessful
-
-    printf("status: %d m_isPaInitialized: %d\n", status, m_isPaInitialized);
-    if (status == 0) {
-        if(m_isPaInitialized)
-        {
-            if((pa_err = Pa_Terminate()) == paNoError)
-            {
-                printf("terminated OK\n");
-                m_isPaInitialized = false;
-            }
-            else
-            {
-                wxMessageBox(wxT("Port Audio failed to Terminate"), wxT("Pa_Terminate"), wxOK);
-            }
-        }
-        EndModal(wxOK);
-    }
-
-}
diff --git a/fdmdv2/branches/0.97/src/dlg_audiooptions.h b/fdmdv2/branches/0.97/src/dlg_audiooptions.h
deleted file mode 100644 (file)
index 7a78b59..0000000
+++ /dev/null
@@ -1,176 +0,0 @@
-//=========================================================================
-// Name:          AudioInfoDisplay.h
-// Purpose:       Declares simple wxWidgets application with GUI
-//                created using wxFormBuilder.
-// 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 <http://www.gnu.org/licenses/>.
-//
-//=========================================================================
-#ifndef __AudioOptsDialog__
-#define __AudioOptsDialog__
-
-#include "fdmdv2_main.h"
-
-#define ID_AUDIO_OPTIONS    1000
-#define AUDIO_IN            0
-#define AUDIO_OUT           1
-
-#include "portaudio.h"
-#ifdef WIN32
-#if PA_USE_ASIO
-#include "pa_asio.h"
-#endif
-#endif
-#include "codec2_fifo.h"
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// AudioInfoDisplay
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class AudioInfoDisplay
-{
-    public:
-        wxListCtrl*     m_listDevices;
-        int             direction;
-        wxTextCtrl*     m_textDevice;
-        wxComboBox*     m_cbSampleRate;
-};
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// class AudioOptsDialog
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class AudioOptsDialog : public wxDialog
-{
-    private:
-
-    protected:
-        PaError         pa_err;
-        bool            m_isPaInitialized;
-
-        int             rxInAudioDeviceNum;
-        int             rxOutAudioDeviceNum;
-        int             txInAudioDeviceNum;
-        int             txOutAudioDeviceNum;
-
-        void buildTestControls(PlotScalar **plotScalar, wxButton **btnTest, 
-                               wxPanel *parentPanel, wxBoxSizer *bSizer, wxString buttonLabel);
-        void plotDeviceInputForAFewSecs(int devNum, PlotScalar *plotScalar);
-        void plotDeviceOutputForAFewSecs(int devNum, PlotScalar *plotScalar);
-
-        int buildListOfSupportedSampleRates(wxComboBox *cbSampleRate, int devNum, int in_out);
-        void populateParams(AudioInfoDisplay);
-        void showAPIInfo();
-        int setTextCtrlIfDevNumValid(wxTextCtrl *textCtrl, wxListCtrl *listCtrl, int devNum);
-        void Pa_Init(void);
-        void OnDeviceSelect(wxComboBox *cbSampleRate, 
-                            wxTextCtrl *textCtrl, 
-                            int        *devNum, 
-                            wxListCtrl *listCtrlDevices, 
-                            int         index,
-                            int         in_out);
-
-        AudioInfoDisplay m_RxInDevices;
-        AudioInfoDisplay m_RxOutDevices;
-        AudioInfoDisplay m_TxInDevices;
-        AudioInfoDisplay m_TxOutDevices;
-        wxPanel* m_panel1;
-        wxNotebook* m_notebook1;
-
-        wxPanel* m_panelRx;
-
-        wxListCtrl* m_listCtrlRxInDevices;
-        wxStaticText* m_staticText51;
-        wxTextCtrl* m_textCtrlRxIn;
-        wxStaticText* m_staticText6;
-        wxComboBox* m_cbSampleRateRxIn;
-
-        wxButton* m_btnRxInTest;
-        PlotScalar* m_plotScalarRxIn;
-
-        wxListCtrl* m_listCtrlRxOutDevices;
-        wxStaticText* m_staticText9;
-        wxTextCtrl* m_textCtrlRxOut;
-        wxStaticText* m_staticText10;
-        wxComboBox* m_cbSampleRateRxOut;
-
-        wxButton* m_btnRxOutTest;
-        PlotScalar* m_plotScalarRxOut;
-
-        wxPanel* m_panelTx;
-
-        wxListCtrl* m_listCtrlTxInDevices;
-        wxStaticText* m_staticText12;
-        wxTextCtrl* m_textCtrlTxIn;
-        wxStaticText* m_staticText11;
-        wxComboBox* m_cbSampleRateTxIn;
-
-        wxButton* m_btnTxInTest;
-        PlotScalar* m_plotScalarTxIn;
-
-        wxListCtrl* m_listCtrlTxOutDevices;
-        wxStaticText* m_staticText81;
-        wxTextCtrl* m_textCtrlTxOut;
-        wxStaticText* m_staticText71;
-        wxComboBox* m_cbSampleRateTxOut;
-
-        wxButton* m_btnTxOutTest;
-        PlotScalar* m_plotScalarTxOut;
-
-        wxPanel* m_panelAPI;
-
-        wxStaticText* m_staticText7;
-        wxStaticText* m_textStringVer;
-        wxStaticText* m_staticText8;
-        wxStaticText* m_textIntVer;
-        wxStaticText* m_staticText5;
-        wxStaticText* m_textCDevCount;
-        wxStaticText* m_staticText4;
-        wxStaticText* m_textAPICount;
-        wxButton* m_btnRefresh;
-        wxStdDialogButtonSizer* m_sdbSizer1;
-        wxButton* m_sdbSizer1OK;
-        wxButton* m_sdbSizer1Apply;
-        wxButton* m_sdbSizer1Cancel;
-
-        // Virtual event handlers, overide them in your derived class
-        //virtual void OnActivateApp( wxActivateEvent& event ) { event.Skip(); }
-//        virtual void OnCloseFrame( wxCloseEvent& event ) { event.Skip(); }
-
-        void OnRxInDeviceSelect( wxListEvent& event );
-
-        void OnRxInTest( wxCommandEvent& event );
-        void OnRxOutTest( wxCommandEvent& event );
-        void OnTxInTest( wxCommandEvent& event );
-        void OnTxOutTest( wxCommandEvent& event );
-
-        void OnRxOutDeviceSelect( wxListEvent& event );
-        void OnTxInDeviceSelect( wxListEvent& event );
-        void OnTxOutDeviceSelect( wxListEvent& event );
-        void OnRefreshClick( wxCommandEvent& event );
-        void OnApplyAudioParameters( wxCommandEvent& event );
-        void OnCancelAudioParameters( wxCommandEvent& event );
-        void OnOkAudioParameters( wxCommandEvent& event );
-        // Virtual event handlers, overide them in your derived class
-        void OnClose( wxCloseEvent& event ) { event.Skip(); }
-        void OnHibernate( wxActivateEvent& event ) { event.Skip(); }
-        void OnIconize( wxIconizeEvent& event ) { event.Skip(); }
-        void OnInitDialog( wxInitDialogEvent& event );
-
-    public:
-
-        AudioOptsDialog( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Audio Config"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 300,300 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
-        ~AudioOptsDialog();
-        int ExchangeData(int inout);
-};
-#endif //__AudioOptsDialog__
diff --git a/fdmdv2/branches/0.97/src/dlg_filter.cpp b/fdmdv2/branches/0.97/src/dlg_filter.cpp
deleted file mode 100644 (file)
index 879373d..0000000
+++ /dev/null
@@ -1,758 +0,0 @@
-//==========================================================================
-// Name:            dlg_filter.cpp
-// Purpose:         Dialog for controlling Codec audio filtering
-// Date:            Nov 25 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#include "dlg_filter.h"
-
-#define SLIDER_MAX 100
-#define SLIDER_LENGTH 100
-
-#define FILTER_MIN_MAG_DB -20.0
-#define FILTER_MAX_MAG_DB  20.0
-
-#define MAX_FREQ_BASS      600.00
-#define MAX_FREQ_TREBLE   3900.00
-#define MAX_FREQ_DEF      3000.00
-
-#define MIN_GAIN          -20
-#define MAX_GAIN           20
-
-#define MAX_LOG10_Q         1.0
-#define MIN_LOG10_Q        -1.0 
-
-// DFT parameters
-
-#define IMP_AMP           2000.0                     // amplitude of impulse
-#define NIMP              50                         // number of samples in impulse response
-#define F_STEP_DFT        10.0                       // frequency steps to sample spectrum
-#define F_MAG_N           (int)(MAX_F_HZ/F_STEP_DFT) // number of frequency steps
-
-extern struct CODEC2      *g_pCodec2;
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class FilterDlg
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-FilterDlg::FilterDlg(wxWindow* parent, bool running, bool *newMicInFilter, bool *newSpkOutFilter,
-                     wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style)
-{
-    m_running = running;
-    m_newMicInFilter = newMicInFilter;
-    m_newSpkOutFilter = newSpkOutFilter;
-
-    this->SetSizeHints(wxDefaultSize, wxDefaultSize);
-
-    wxBoxSizer* bSizer30;
-    bSizer30 = new wxBoxSizer(wxVERTICAL);
-
-    // LPC Post Filter --------------------------------------------------------
-
-    wxStaticBoxSizer* lpcpfs = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("LPC Post Filter")), wxHORIZONTAL);
-
-    wxBoxSizer* left = new wxBoxSizer(wxVERTICAL);
-
-    m_codec2LPCPostFilterEnable = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition,wxDefaultSize, wxCHK_2STATE);
-    left->Add(m_codec2LPCPostFilterEnable);
-
-    m_codec2LPCPostFilterBassBoost = new wxCheckBox(this, wxID_ANY, _("0-1 kHz 3dB Boost"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
-    left->Add(m_codec2LPCPostFilterBassBoost);
-    lpcpfs->Add(left, 0, wxALL, 5);
-
-    newLPCPFControl(&m_codec2LPCPostFilterBeta, &m_staticTextBeta, lpcpfs, "Beta");
-    newLPCPFControl(&m_codec2LPCPostFilterGamma, &m_staticTextGamma, lpcpfs, "Gamma");
-
-    m_LPCPostFilterDefault = new wxButton(this, wxID_ANY, wxT("Default"));
-    lpcpfs->Add(m_LPCPostFilterDefault, 0, wxALL|wxALIGN_CENTRE_HORIZONTAL|wxALIGN_CENTRE_VERTICAL, 5);
-
-    bSizer30->Add(lpcpfs, 0, wxALL, 0);
-
-    // EQ Filters -----------------------------------------------------------
-
-    wxStaticBoxSizer* eqMicInSizer = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Mic In Equaliser")), wxVERTICAL);
-    wxBoxSizer* eqMicInSizer1 = new wxBoxSizer(wxHORIZONTAL);
-    wxBoxSizer* eqMicInSizer2 = new wxBoxSizer(wxHORIZONTAL);
-
-    m_MicInBass   = newEQ(eqMicInSizer1, "Bass"  , MAX_FREQ_BASS, disableQ);
-    m_MicInTreble = newEQ(eqMicInSizer1, "Treble", MAX_FREQ_TREBLE, disableQ);
-    eqMicInSizer->Add(eqMicInSizer1);
-
-    m_MicInEnable = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition,wxDefaultSize, wxCHK_2STATE);
-    eqMicInSizer2->Add(m_MicInEnable,0,wxALIGN_CENTRE_VERTICAL|wxRIGHT,10);
-    m_MicInMid    = newEQ(eqMicInSizer2, "Mid"   , MAX_FREQ_DEF, enableQ);
-    m_MicInDefault = new wxButton(this, wxID_ANY, wxT("Default"));
-    eqMicInSizer2->Add(m_MicInDefault,0,wxALIGN_CENTRE_VERTICAL|wxLEFT,20);
-    eqMicInSizer->Add(eqMicInSizer2);
-
-    wxStaticBoxSizer* eqSpkOutSizer = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Speaker Out Equaliser")), wxVERTICAL);
-    wxBoxSizer* eqSpkOutSizer1 = new wxBoxSizer(wxHORIZONTAL);
-    wxBoxSizer* eqSpkOutSizer2 = new wxBoxSizer(wxHORIZONTAL);
-
-    m_SpkOutBass   = newEQ(eqSpkOutSizer1, "Bass"  , MAX_FREQ_BASS, disableQ);
-    m_SpkOutTreble = newEQ(eqSpkOutSizer1, "Treble", MAX_FREQ_TREBLE, disableQ);
-    eqSpkOutSizer->Add(eqSpkOutSizer1);
-
-    m_SpkOutEnable = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition,wxDefaultSize, wxCHK_2STATE);
-    eqSpkOutSizer2->Add(m_SpkOutEnable,0,wxALIGN_CENTRE_VERTICAL|wxRIGHT,10);
-    m_SpkOutMid    = newEQ(eqSpkOutSizer2, "Mid"   , MAX_FREQ_DEF, enableQ);
-    m_SpkOutDefault = new wxButton(this, wxID_ANY, wxT("Default"));
-    eqSpkOutSizer2->Add(m_SpkOutDefault,0,wxALIGN_CENTRE_VERTICAL|wxLEFT,20);
-    eqSpkOutSizer->Add(eqSpkOutSizer2);
-    
-    bSizer30->Add(eqMicInSizer, 0, wxALL, 0);
-    bSizer30->Add(eqSpkOutSizer, 0, wxALL, 0);
-
-    // Storgage for spectrum magnitude plots ------------------------------------
-
-    m_MicInMagdB = new float[F_MAG_N];
-    for(int i=0; i<F_MAG_N; i++)
-        m_MicInMagdB[i] = 0.0;
-
-    m_SpkOutMagdB = new float[F_MAG_N];
-    for(int i=0; i<F_MAG_N; i++)
-        m_SpkOutMagdB[i] = 0.0;
-
-    // Spectrum Plots -----------------------------------------------------------
-
-    long nb_style = wxAUI_NB_BOTTOM | wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_MOVE | wxAUI_NB_SCROLL_BUTTONS;
-    m_auiNotebook = new wxAuiNotebook(this, wxID_ANY, wxDefaultPosition, wxSize(-1,200), nb_style);
-    m_auiNotebook->SetFont(wxFont(8, 70, 90, 90, false, wxEmptyString));
-
-    bSizer30->Add(m_auiNotebook, 0, wxEXPAND|wxALL, 3);
-    
-    m_MicInFreqRespPlot = new PlotSpectrum((wxFrame*) m_auiNotebook, m_MicInMagdB, F_MAG_N, FILTER_MIN_MAG_DB, FILTER_MAX_MAG_DB);
-    m_auiNotebook->AddPage(m_MicInFreqRespPlot, _("Microphone In Equaliser"));
-
-    m_SpkOutFreqRespPlot = new PlotSpectrum((wxFrame*)m_auiNotebook, m_SpkOutMagdB, F_MAG_N, FILTER_MIN_MAG_DB, FILTER_MAX_MAG_DB);
-    m_auiNotebook->AddPage(m_SpkOutFreqRespPlot, _("Speaker Out Equaliser"));
-
-    //  OK - Cancel buttons at the bottom --------------------------
-
-    wxBoxSizer* bSizer31 = new wxBoxSizer(wxHORIZONTAL);
-
-    m_sdbSizer5OK = new wxButton(this, wxID_OK);
-    bSizer31->Add(m_sdbSizer5OK, 0, wxALL, 2);
-
-    m_sdbSizer5Cancel = new wxButton(this, wxID_CANCEL);
-    bSizer31->Add(m_sdbSizer5Cancel, 0, wxALL, 2);
-
-    bSizer30->Add(bSizer31, 0, wxALIGN_RIGHT|wxALL, 0);
-
-    this->SetSizer(bSizer30);
-    this->Layout();
-
-    this->Centre(wxBOTH);
-    // Connect Events -------------------------------------------------------
-
-    this->Connect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(FilterDlg::OnInitDialog));
-
-    m_codec2LPCPostFilterEnable->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnEnable), NULL, this);
-    m_codec2LPCPostFilterBassBoost->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnBassBoost), NULL, this);
-    m_codec2LPCPostFilterBeta->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnBetaScroll), NULL, this);
-    m_codec2LPCPostFilterGamma->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnGammaScroll), NULL, this);
-    m_LPCPostFilterDefault->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnLPCPostFilterDefault), NULL, this);
-
-    m_MicInBass.sliderFreq->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInBassFreqScroll), NULL, this);
-    m_MicInBass.sliderGain->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInBassGainScroll), NULL, this);
-    m_MicInTreble.sliderFreq->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInTrebleFreqScroll), NULL, this);
-    m_MicInTreble.sliderGain->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInTrebleGainScroll), NULL, this);
-    m_MicInMid.sliderFreq->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInMidFreqScroll), NULL, this);
-    m_MicInMid.sliderGain->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInMidGainScroll), NULL, this);
-    m_MicInMid.sliderQ->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInMidQScroll), NULL, this);
-    m_MicInEnable->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnMicInEnable), NULL, this);
-    m_MicInDefault->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnMicInDefault), NULL, this);
-
-    m_SpkOutBass.sliderFreq->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutBassFreqScroll), NULL, this);
-    m_SpkOutBass.sliderGain->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutBassGainScroll), NULL, this);
-    m_SpkOutTreble.sliderFreq->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutTrebleFreqScroll), NULL, this);
-    m_SpkOutTreble.sliderGain->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutTrebleGainScroll), NULL, this);
-    m_SpkOutMid.sliderFreq->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutMidFreqScroll), NULL, this);
-    m_SpkOutMid.sliderGain->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutMidGainScroll), NULL, this);
-    m_SpkOutMid.sliderQ->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutMidQScroll), NULL, this);
-    m_SpkOutEnable->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnSpkOutEnable), NULL, this);
-    m_SpkOutDefault->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnSpkOutDefault), NULL, this);
-
-    m_sdbSizer5Cancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnCancel), NULL, this);
-    m_sdbSizer5OK->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnOK), NULL, this);
-
-}
-
-//-------------------------------------------------------------------------
-// ~FilterDlg()
-//-------------------------------------------------------------------------
-FilterDlg::~FilterDlg()
-{
-    delete m_MicInMagdB;
-    delete m_SpkOutMagdB;
-
-    // Disconnect Events
-
-    this->Disconnect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(FilterDlg::OnInitDialog));
-
-    m_codec2LPCPostFilterEnable->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnEnable), NULL, this);
-    m_codec2LPCPostFilterBassBoost->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnBassBoost), NULL, this);
-    m_codec2LPCPostFilterBeta->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnBetaScroll), NULL, this);
-    m_codec2LPCPostFilterGamma->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnGammaScroll), NULL, this);
-    m_LPCPostFilterDefault->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnLPCPostFilterDefault), NULL, this);
-
-    m_MicInBass.sliderFreq->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInBassFreqScroll), NULL, this);
-    m_MicInBass.sliderGain->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInBassGainScroll), NULL, this);
-    m_MicInTreble.sliderFreq->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInTrebleFreqScroll), NULL, this);
-    m_MicInTreble.sliderGain->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInTrebleGainScroll), NULL, this);
-    m_MicInMid.sliderFreq->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInMidFreqScroll), NULL, this);
-    m_MicInMid.sliderGain->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInMidGainScroll), NULL, this);
-    m_MicInMid.sliderQ->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInMidQScroll), NULL, this);
-    m_MicInEnable->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnMicInEnable), NULL, this);
-    m_MicInDefault->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnMicInDefault), NULL, this);
-
-    m_SpkOutBass.sliderFreq->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutBassFreqScroll), NULL, this);
-    m_SpkOutBass.sliderGain->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutBassGainScroll), NULL, this);
-    m_SpkOutTreble.sliderFreq->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutTrebleFreqScroll), NULL, this);
-    m_SpkOutTreble.sliderGain->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutTrebleGainScroll), NULL, this);
-    m_SpkOutMid.sliderFreq->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutMidFreqScroll), NULL, this);
-    m_SpkOutMid.sliderGain->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutMidGainScroll), NULL, this);
-    m_SpkOutMid.sliderQ->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutMidQScroll), NULL, this);
-    m_SpkOutEnable->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnSpkOutEnable), NULL, this);
-    m_SpkOutDefault->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnSpkOutDefault), NULL, this);
-
-    m_sdbSizer5Cancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnCancel), NULL, this);
-    m_sdbSizer5OK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnOK), NULL, this);
-}
-
-void FilterDlg::newLPCPFControl(wxSlider **slider, wxStaticText **stValue, wxSizer *s, wxString controlName)
-{
-    wxBoxSizer *bs = new wxBoxSizer(wxHORIZONTAL);
-
-    wxStaticText* st = new wxStaticText(this, wxID_ANY, controlName, wxDefaultPosition, wxSize(70,-1), wxALIGN_RIGHT);
-    bs->Add(st, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 2);
-
-    *slider = new wxSlider(this, wxID_ANY, 0, 0, SLIDER_MAX, wxDefaultPosition, wxSize(SLIDER_LENGTH,wxDefaultCoord));
-    bs->Add(*slider, 1, wxALIGN_CENTER_VERTICAL|wxALL, 2);
-
-    *stValue = new wxStaticText(this, wxID_ANY, wxT("0.0"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
-    bs->Add(*stValue, 1, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxALL, 2);
-
-    s->Add(bs, 0);
-}
-
-void FilterDlg::newEQControl(wxSlider** slider, wxStaticText** value, wxStaticBoxSizer *bs, wxString controlName)
-{
-    wxStaticText* label = new wxStaticText(this, wxID_ANY, controlName, wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
-    bs->Add(label, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 0);
-
-    *slider = new wxSlider(this, wxID_ANY, 0, 0, SLIDER_MAX, wxDefaultPosition, wxSize(SLIDER_LENGTH,wxDefaultCoord));
-    bs->Add(*slider, 1, wxALIGN_CENTER_VERTICAL|wxALL, 0);
-
-    *value = new wxStaticText(this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(40,-1), wxALIGN_LEFT);
-    bs->Add(*value, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxRIGHT, 5);
-}
-
-EQ FilterDlg::newEQ(wxSizer *bs, wxString eqName, float maxFreqHz, bool enableQ)
-{
-    EQ eq;
-
-    wxStaticBoxSizer *bsEQ = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, eqName), wxHORIZONTAL);
-
-    newEQControl(&eq.sliderFreq, &eq.valueFreq, bsEQ, "Freq"); 
-    eq.maxFreqHz = maxFreqHz; 
-    eq.sliderFreqId = eq.sliderFreq->GetId();
-
-    newEQControl(&eq.sliderGain, &eq.valueGain, bsEQ, "Gain");
-    if (enableQ)
-        newEQControl(&eq.sliderQ, &eq.valueQ, bsEQ, "Q");
-    else
-        eq.sliderQ = NULL;
-
-    bs->Add(bsEQ);
-
-    return eq;
-}
-
-//-------------------------------------------------------------------------
-// ExchangeData()
-//-------------------------------------------------------------------------
-void FilterDlg::ExchangeData(int inout, bool storePersistent)
-{
-    wxConfigBase *pConfig = wxConfigBase::Get();
-    if(inout == EXCHANGE_DATA_IN)
-    {
-        // LPC Post filter
-
-        m_codec2LPCPostFilterEnable->SetValue(wxGetApp().m_codec2LPCPostFilterEnable);
-        m_codec2LPCPostFilterBassBoost->SetValue(wxGetApp().m_codec2LPCPostFilterBassBoost);
-        m_beta = wxGetApp().m_codec2LPCPostFilterBeta; setBeta();
-        m_gamma = wxGetApp().m_codec2LPCPostFilterGamma; setGamma();
-
-        // Mic In Equaliser
-
-        m_MicInBass.freqHz = wxGetApp().m_MicInBassFreqHz; 
-        m_MicInBass.freqHz = limit(m_MicInBass.freqHz, 1.0, MAX_FREQ_BASS);
-        setFreq(&m_MicInBass);
-        m_MicInBass.gaindB = wxGetApp().m_MicInBassGaindB;
-        m_MicInBass.gaindB = limit(m_MicInBass.gaindB, MIN_GAIN, MAX_GAIN);
-        setGain(&m_MicInBass);
-
-        m_MicInTreble.freqHz = wxGetApp().m_MicInTrebleFreqHz;
-        m_MicInTreble.freqHz = limit(m_MicInTreble.freqHz, 1.0, MAX_FREQ_TREBLE);
-        setFreq(&m_MicInTreble);
-        m_MicInTreble.gaindB = wxGetApp().m_MicInTrebleGaindB; 
-        m_MicInTreble.gaindB = limit(m_MicInTreble.gaindB, MIN_GAIN, MAX_GAIN);
-        setGain(&m_MicInTreble);
-
-        m_MicInMid.freqHz = wxGetApp().m_MicInMidFreqHz; 
-        m_MicInMid.freqHz = limit(m_MicInMid.freqHz, 1.0, MAX_FREQ_TREBLE);
-        setFreq(&m_MicInMid);
-        m_MicInMid.gaindB = wxGetApp().m_MicInMidGaindB; 
-        m_MicInMid.gaindB = limit(m_MicInMid.gaindB, MIN_GAIN, MAX_GAIN);
-        setGain(&m_MicInMid);
-        m_MicInMid.Q = wxGetApp().m_MicInMidQ;
-        m_MicInMid.Q = limit(m_MicInMid.Q, pow(10.0,MIN_LOG10_Q), pow(10.0, MAX_LOG10_Q));
-        setQ(&m_MicInMid);
-
-        m_MicInEnable->SetValue(wxGetApp().m_MicInEQEnable);
-
-        plotMicInFilterSpectrum();
-        // Spk Out Equaliser
-
-        m_SpkOutBass.freqHz = wxGetApp().m_SpkOutBassFreqHz;
-        m_SpkOutBass.freqHz = limit(m_SpkOutBass.freqHz, 1.0, MAX_FREQ_BASS);
-        setFreq(&m_SpkOutBass);
-        m_SpkOutBass.gaindB = wxGetApp().m_SpkOutBassGaindB; 
-        m_SpkOutBass.gaindB = limit(m_SpkOutBass.gaindB, MIN_GAIN, MAX_GAIN);
-        setGain(&m_SpkOutBass);
-
-        m_SpkOutTreble.freqHz = wxGetApp().m_SpkOutTrebleFreqHz; 
-        m_SpkOutTreble.freqHz = limit(m_SpkOutTreble.freqHz, 1.0, MAX_FREQ_TREBLE);
-        setFreq(&m_SpkOutTreble);
-        m_SpkOutTreble.gaindB = wxGetApp().m_SpkOutTrebleGaindB; 
-        m_SpkOutTreble.gaindB = limit(m_SpkOutTreble.gaindB, MIN_GAIN, MAX_GAIN);
-        setGain(&m_SpkOutTreble);
-
-        m_SpkOutMid.freqHz = wxGetApp().m_SpkOutMidFreqHz;
-        m_SpkOutMid.freqHz = limit(m_SpkOutMid.freqHz, 1.0, MAX_FREQ_TREBLE);
-        setFreq(&m_SpkOutMid);
-        m_SpkOutMid.gaindB = wxGetApp().m_SpkOutMidGaindB;
-        m_SpkOutMid.gaindB = limit(m_SpkOutMid.gaindB, MIN_GAIN, MAX_GAIN);
-        setGain(&m_SpkOutMid);
-        m_SpkOutMid.Q = wxGetApp().m_SpkOutMidQ;
-        m_SpkOutMid.Q = limit(m_SpkOutMid.Q, pow(10.0,MIN_LOG10_Q), pow(10.0, MAX_LOG10_Q));
-        setQ(&m_SpkOutMid);
-
-        m_SpkOutEnable->SetValue(wxGetApp().m_SpkOutEQEnable);
-
-        plotSpkOutFilterSpectrum();
-    }
-    if(inout == EXCHANGE_DATA_OUT)
-    {
-        // LPC Post filter
-
-        wxGetApp().m_codec2LPCPostFilterEnable     = m_codec2LPCPostFilterEnable->GetValue();
-        wxGetApp().m_codec2LPCPostFilterBassBoost  = m_codec2LPCPostFilterBassBoost->GetValue();
-        wxGetApp().m_codec2LPCPostFilterBeta       = m_beta;
-        wxGetApp().m_codec2LPCPostFilterGamma      = m_gamma;
-
-        // Mic In Equaliser
-
-        wxGetApp().m_MicInBassFreqHz = m_MicInBass.freqHz;
-        wxGetApp().m_MicInBassGaindB = m_MicInBass.gaindB;
-
-        wxGetApp().m_MicInTrebleFreqHz = m_MicInTreble.freqHz;
-        wxGetApp().m_MicInTrebleGaindB = m_MicInTreble.gaindB;
-
-        wxGetApp().m_MicInMidFreqHz = m_MicInMid.freqHz;
-        wxGetApp().m_MicInMidGaindB = m_MicInMid.gaindB;
-        wxGetApp().m_MicInMidQ = m_MicInMid.Q;
-
-        // Spk Out Equaliser
-
-        wxGetApp().m_SpkOutBassFreqHz = m_SpkOutBass.freqHz;
-        wxGetApp().m_SpkOutBassGaindB = m_SpkOutBass.gaindB;
-
-        wxGetApp().m_SpkOutTrebleFreqHz = m_SpkOutTreble.freqHz;
-        wxGetApp().m_SpkOutTrebleGaindB = m_SpkOutTreble.gaindB;
-
-        wxGetApp().m_SpkOutMidFreqHz = m_SpkOutMid.freqHz;
-        wxGetApp().m_SpkOutMidGaindB = m_SpkOutMid.gaindB;
-        wxGetApp().m_SpkOutMidQ = m_SpkOutMid.Q;
-
-        if (storePersistent) {
-            pConfig->Write(wxT("/Filter/codec2LPCPostFilterEnable"),     wxGetApp().m_codec2LPCPostFilterEnable);
-            pConfig->Write(wxT("/Filter/codec2LPCPostFilterBassBoost"),  wxGetApp().m_codec2LPCPostFilterBassBoost);
-            pConfig->Write(wxT("/Filter/codec2LPCPostFilterBeta"),       (int)(m_beta*100.0));
-            pConfig->Write(wxT("/Filter/codec2LPCPostFilterGamma"),      (int)(m_gamma*100.0));
-
-            pConfig->Write(wxT("/Filter/MicInBassFreqHz"), (int)m_MicInBass.freqHz);
-            pConfig->Write(wxT("/Filter/MicInBassGaindB"), (int)(10.0*m_MicInBass.gaindB));
-            pConfig->Write(wxT("/Filter/MicInTrebleFreqHz"), (int)m_MicInTreble.freqHz);
-            pConfig->Write(wxT("/Filter/MicInTrebleGaindB"), (int)(10.0*m_MicInTreble.gaindB));
-            pConfig->Write(wxT("/Filter/MicInMidFreqHz"), (int)m_MicInMid.freqHz);
-            pConfig->Write(wxT("/Filter/MicInMidGaindB"), (int)(10.0*m_MicInMid.gaindB));
-            pConfig->Write(wxT("/Filter/MicInMidQ"), (int)(100.0*m_MicInMid.Q));
-
-            pConfig->Write(wxT("/Filter/SpkOutBassFreqHz"), (int)m_SpkOutBass.freqHz);
-            pConfig->Write(wxT("/Filter/SpkOutBassGaindB"), (int)(10.0*m_SpkOutBass.gaindB));
-            pConfig->Write(wxT("/Filter/SpkOutTrebleFreqHz"), (int)m_SpkOutTreble.freqHz);
-            pConfig->Write(wxT("/Filter/SpkOutTrebleGaindB"), (int)(10.0*m_SpkOutTreble.gaindB));
-            pConfig->Write(wxT("/Filter/SpkOutMidQ"), (int)(100.0*m_SpkOutMid.Q));
-            pConfig->Write(wxT("/Filter/SpkOutMidFreqHz"), (int)m_SpkOutMid.freqHz);
-            pConfig->Write(wxT("/Filter/SpkOutMidGaindB"), (int)(10.0*m_SpkOutMid.gaindB));
-
-            pConfig->Flush();
-        }
-    }
-    delete wxConfigBase::Set((wxConfigBase *) NULL);
-}
-
-float FilterDlg::limit(float value, float min, float max) {
-    if (value < min) return min;
-    if (value > max) return max;
-    return value;
-}
-
-//-------------------------------------------------------------------------
-// OnCancel()
-//-------------------------------------------------------------------------
-void FilterDlg::OnCancel(wxCommandEvent& event)
-{
-    this->EndModal(wxID_CANCEL);
-}
-
-//-------------------------------------------------------------------------
-// OnDefault()
-//-------------------------------------------------------------------------
-
-void FilterDlg::OnLPCPostFilterDefault(wxCommandEvent& event)
-{
-    m_beta = CODEC2_LPC_PF_BETA; setBeta();
-    m_gamma = CODEC2_LPC_PF_GAMMA; setGamma();
-    m_codec2LPCPostFilterEnable->SetValue(true);
-    m_codec2LPCPostFilterBassBoost->SetValue(true);
-}
-
-void FilterDlg::OnMicInDefault(wxCommandEvent& event)
-{
-    m_MicInBass.freqHz = 100.0;
-    m_MicInBass.gaindB = 0.0;
-    setFreq(&m_MicInBass); setGain(&m_MicInBass); 
-
-    m_MicInTreble.freqHz = 3000.0;
-    m_MicInTreble.gaindB = 0.0;
-    setFreq(&m_MicInTreble); setGain(&m_MicInTreble); 
-
-    m_MicInMid.freqHz = 1500.0;
-    m_MicInMid.gaindB = 0.0;
-    m_MicInMid.Q = 1.0;
-    setFreq(&m_MicInMid); setGain(&m_MicInMid); setQ(&m_MicInMid); 
-
-    plotMicInFilterSpectrum();    
-}
-
-void FilterDlg::OnSpkOutDefault(wxCommandEvent& event)
-{
-    m_SpkOutBass.freqHz = 100.0;
-    m_SpkOutBass.gaindB = 0.0;
-    setFreq(&m_SpkOutBass); setGain(&m_SpkOutBass); 
-
-    m_SpkOutTreble.freqHz = 3000.0;
-    m_SpkOutTreble.gaindB = 0.0;
-    setFreq(&m_SpkOutTreble); setGain(&m_SpkOutTreble); 
-
-    m_SpkOutMid.freqHz = 1500.0;
-    m_SpkOutMid.gaindB = 0.0;
-    m_SpkOutMid.Q = 1.0;
-    setFreq(&m_SpkOutMid); setGain(&m_SpkOutMid); setQ(&m_SpkOutMid); 
-
-    plotSpkOutFilterSpectrum();    
-}
-
-//-------------------------------------------------------------------------
-// OnOK()
-//-------------------------------------------------------------------------
-void FilterDlg::OnOK(wxCommandEvent& event)
-{
-    //printf("FilterDlg::OnOK\n");
-    ExchangeData(EXCHANGE_DATA_OUT, true);
-    this->EndModal(wxID_OK);
-}
-
-//-------------------------------------------------------------------------
-// OnClose()
-//-------------------------------------------------------------------------
-void FilterDlg::OnClose(wxCloseEvent& event)
-{
-    this->EndModal(wxID_OK);
-}
-
-//-------------------------------------------------------------------------
-// OnInitDialog()
-//-------------------------------------------------------------------------
-void FilterDlg::OnInitDialog(wxInitDialogEvent& event)
-{
-    //printf("FilterDlg::OnInitDialog\n");
-    ExchangeData(EXCHANGE_DATA_IN, false);
-    //printf("m_beta: %f\n", m_beta);
-}
-
-void FilterDlg::setBeta(void) {
-    wxString buf;
-    buf.Printf(wxT("%3.2f"), m_beta);
-    m_staticTextBeta->SetLabel(buf);
-    int slider = (int)(m_beta*SLIDER_MAX + 0.5);
-    m_codec2LPCPostFilterBeta->SetValue(slider);
-}
-
-void FilterDlg::setCodec2(void) {
-    if (m_running) {
-        assert(g_pCodec2 != NULL);
-        codec2_set_lpc_post_filter(g_pCodec2, 
-                               m_codec2LPCPostFilterEnable->GetValue(), 
-                               m_codec2LPCPostFilterBassBoost->GetValue(), 
-                               m_beta, m_gamma);
-    }
-}
-
-void FilterDlg::setGamma(void) {
-    wxString buf;
-    buf.Printf(wxT("%3.2f"), m_gamma);
-    m_staticTextGamma->SetLabel(buf);
-    int slider = (int)(m_gamma*SLIDER_MAX + 0.5);
-    m_codec2LPCPostFilterGamma->SetValue(slider);
-}
-
-void FilterDlg::OnEnable(wxScrollEvent& event) {
-    setCodec2();    
-}
-
-void FilterDlg::OnBassBoost(wxScrollEvent& event) {
-    setCodec2();    
-}
-
-void FilterDlg::OnBetaScroll(wxScrollEvent& event) {
-    m_beta = (float)m_codec2LPCPostFilterBeta->GetValue()/SLIDER_MAX;
-    setBeta();
-    setCodec2();
-}
-
-void FilterDlg::OnGammaScroll(wxScrollEvent& event) {
-    m_gamma = (float)m_codec2LPCPostFilterGamma->GetValue()/SLIDER_MAX;
-    setGamma();
-    setCodec2();
-}
-
-// immediately change enable flags rather using ExchangeData() so we can switch on and off at run time
-
-void FilterDlg::OnMicInEnable(wxScrollEvent& event) {
-    wxGetApp().m_MicInEQEnable = m_MicInEnable->GetValue();
-}
-
-void FilterDlg::OnSpkOutEnable(wxScrollEvent& event) {
-    wxGetApp().m_SpkOutEQEnable = m_SpkOutEnable->GetValue();
-    //printf("wxGetApp().m_SpkOutEQEnable: %d\n", wxGetApp().m_SpkOutEQEnable);
-}
-
-void FilterDlg::setFreq(EQ *eq)
-{
-    wxString buf;
-    buf.Printf(wxT("%3.0f"), eq->freqHz);
-    eq->valueFreq->SetLabel(buf);
-    int slider = (int)((eq->freqHz/eq->maxFreqHz)*SLIDER_MAX + 0.5);
-    eq->sliderFreq->SetValue(slider);
-}
-
-void FilterDlg::sliderToFreq(EQ *eq, bool micIn)
-{
-    eq->freqHz = ((float)eq->sliderFreq->GetValue()/SLIDER_MAX)*eq->maxFreqHz;
-    if (eq->freqHz < 1.0) eq->freqHz = 1.0; // sox doesn't like 0 Hz;
-    setFreq(eq);
-    if (micIn) {
-        plotMicInFilterSpectrum();
-        adjRunTimeMicInFilter();
-    }
-    else {
-        plotSpkOutFilterSpectrum();
-        adjRunTimeSpkOutFilter();
-    }
-}
-
-void FilterDlg::setGain(EQ *eq)
-{
-    wxString buf;
-    buf.Printf(wxT("%3.1f"), eq->gaindB);
-    eq->valueGain->SetLabel(buf);
-    int slider = (int)(((eq->gaindB-MIN_GAIN)/(MAX_GAIN-MIN_GAIN))*SLIDER_MAX + 0.5);
-    eq->sliderGain->SetValue(slider);
-}
-
-void FilterDlg::sliderToGain(EQ *eq, bool micIn)
-{
-    float range = MAX_GAIN-MIN_GAIN;
-    
-    eq->gaindB = MIN_GAIN + range*((float)eq->sliderGain->GetValue()/SLIDER_MAX);
-    //printf("gaindB: %f\n", eq->gaindB);
-    setGain(eq);
-    if (micIn) {
-        plotMicInFilterSpectrum();
-        adjRunTimeMicInFilter();
-    }
-    else {
-        plotSpkOutFilterSpectrum();
-        adjRunTimeSpkOutFilter();
-    }
-        
-}
-
-void FilterDlg::setQ(EQ *eq)
-{
-    wxString buf;
-    buf.Printf(wxT("%2.1f"), eq->Q);
-    eq->valueQ->SetLabel(buf);
-
-    float log10_range = MAX_LOG10_Q - MIN_LOG10_Q;
-
-    int slider = (int)(((log10(eq->Q+1E-6)-MIN_LOG10_Q)/log10_range)*SLIDER_MAX + 0.5);
-    eq->sliderQ->SetValue(slider);
-}
-
-void FilterDlg::sliderToQ(EQ *eq, bool micIn)
-{
-    float log10_range = MAX_LOG10_Q - MIN_LOG10_Q;
-    
-    float sliderNorm = (float)eq->sliderQ->GetValue()/SLIDER_MAX;
-    float log10Q =  MIN_LOG10_Q + sliderNorm*(log10_range);
-    eq->Q = pow(10.0, log10Q);
-    //printf("log10Q: %f eq->Q: %f\n", log10Q, eq->Q);
-    setQ(eq);
-    if (micIn) {
-        plotMicInFilterSpectrum();
-        adjRunTimeMicInFilter();
-    }
-    else {
-        plotSpkOutFilterSpectrum();
-        adjRunTimeSpkOutFilter();
-    }
-}
-
-void FilterDlg::plotMicInFilterSpectrum(void) {
-    plotFilterSpectrum(&m_MicInBass, &m_MicInMid, &m_MicInTreble, m_MicInFreqRespPlot, m_MicInMagdB);
-}
-
-void FilterDlg::plotSpkOutFilterSpectrum(void) {
-    plotFilterSpectrum(&m_SpkOutBass, &m_SpkOutMid, &m_SpkOutTreble, m_SpkOutFreqRespPlot, m_SpkOutMagdB);
-}
-
-void FilterDlg::adjRunTimeMicInFilter(void) {
-    // signal an adjustment in running filter coeffs
-
-    if (m_running) {
-        ExchangeData(EXCHANGE_DATA_OUT, false);
-        *m_newMicInFilter = true;
-    }
-}
-        
-void FilterDlg::adjRunTimeSpkOutFilter(void) {
-    // signal an adjustment in running filter coeffs
-
-    if (m_running) {
-        ExchangeData(EXCHANGE_DATA_OUT, false);
-        *m_newSpkOutFilter = true;
-    }
-}
-        
-
-void FilterDlg::plotFilterSpectrum(EQ *eqBass, EQ *eqMid, EQ *eqTreble, PlotSpectrum* freqRespPlot, float *magdB) {
-    char  *argBass[10];
-    char  *argTreble[10];
-    char  *argMid[10];
-    char   argstorage[10][80];
-    float magBass[F_MAG_N];
-    float magTreble[F_MAG_N];
-    float magMid[F_MAG_N];
-    int   i;
-
-    for(i=0; i<10; i++) {
-        argBass[i] = &argstorage[i][0];
-        argTreble[i] = &argstorage[i][0];
-        argMid[i] = &argstorage[i][0];
-    }
-    sprintf(argBass[0], "bass");                
-    sprintf(argBass[1], "%f", eqBass->gaindB+1E-6);
-    sprintf(argBass[2], "%f", eqBass->freqHz);      
-
-    calcFilterSpectrum(magBass, 2, argBass);
-
-    sprintf(argTreble[0], "treble");                
-    sprintf(argTreble[1], "%f", eqTreble->gaindB+1E-6);
-    sprintf(argTreble[2], "%f", eqTreble->freqHz);      
-
-    calcFilterSpectrum(magTreble, 2, argTreble);
-
-    sprintf(argTreble[0], "equalizer");                
-    sprintf(argTreble[1], "%f", eqMid->freqHz);      
-    sprintf(argTreble[2], "%f", eqMid->Q);      
-    sprintf(argTreble[3], "%f", eqMid->gaindB+1E-6);
-
-    calcFilterSpectrum(magMid, 3, argMid);
-
-    for(i=0; i<F_MAG_N; i++)
-        magdB[i] = magBass[i] + magMid[i] + magTreble[i];
-    freqRespPlot->m_newdata = true;
-    freqRespPlot->Refresh();
-}
-
-void FilterDlg::calcFilterSpectrum(float magdB[], int argc, char *argv[]) {
-    void       *sbq;
-    short       in[NIMP];
-    short       out[NIMP];
-    COMP        X[F_MAG_N];
-    float       f, w;
-    int         i, k;
-
-    // find impulse response -----------------------------------
-
-    for(i=0; i<NIMP; i++)
-        in[i] = 0;
-    in[0] = IMP_AMP;
-
-    //printf("argv[0]: %s argv[1]: %s\n", argv[0], argv[1]);
-    sbq = sox_biquad_create(argc, (const char **)argv);
-
-    sox_biquad_filter(sbq, out, in, NIMP);
-    //for(i=0; i<NIMP; i++)
-    //    printf("%d\n", out[i]);
-   
-    sox_biquad_destroy(sbq);
-
-    //for(i=0; i<NIMP; i++)
-    //    out[i] = 0.0;
-    //out[0] = IMP_AMP;
-
-    // calculate discrete time continous frequency Fourer transform
-    // doing this from first principles rather than FFT for no good reason
-
-    for(f=0,i=0; f<MAX_F_HZ; f+=F_STEP_DFT,i++) {
-        w = M_PI*f/(FS/2);
-        X[i].real = 0.0; X[i].imag = 0.0;
-        for(k=0; k<NIMP; k++) {
-            X[i].real += ((float)out[k]/IMP_AMP) * cos(w*k);
-            X[i].imag -= ((float)out[k]/IMP_AMP) * sin(w*k);
-        }
-        magdB[i] = 10.0*log10(X[i].real* X[i].real + X[i].imag*X[i].imag + 1E-12);
-        //printf("f: %f X[%d] = %f %f magdB = %f\n", f, i, X[i].real, X[i].imag,  magdB[i]);
-    }
-}
diff --git a/fdmdv2/branches/0.97/src/dlg_filter.h b/fdmdv2/branches/0.97/src/dlg_filter.h
deleted file mode 100644 (file)
index 037ba24..0000000
+++ /dev/null
@@ -1,162 +0,0 @@
-//==========================================================================
-// Name:            dlg_filter.h
-// Purpose:         Dialog for controlling Codec audio filtering
-// Created:         Nov 25 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-
-#ifndef __FILTER_DIALOG__
-#define __FILTER_DIALOG__
-
-#include "fdmdv2_main.h"
-
-enum {disableQ = false, enableQ = true};
-
-typedef struct { 
-    wxSlider     *sliderFreq;
-    wxStaticText *valueFreq;
-    wxSlider     *sliderGain;
-    wxStaticText *valueGain;
-    wxSlider     *sliderQ;
-    wxStaticText *valueQ;
-
-    int       sliderFreqId;
-    int       sliderGainId;
-    int       sliderQId;
-    
-    float     freqHz;
-    float     gaindB;
-    float     Q;
-
-    float     maxFreqHz;
-} EQ;
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class FilterDlg
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class FilterDlg : public wxDialog
-{
-    public:
-    FilterDlg( wxWindow* parent, bool running, bool *newMicInFilter, bool *newSpkOutFilter,
-               wxWindowID id = wxID_ANY, const wxString& title = _("Filter"), 
-               const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 800, 600 ), 
-               long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
-        ~FilterDlg();
-
-        void    ExchangeData(int inout, bool storePersistent);
-
-    protected:
-        // Handlers for events.
-        void    OnCancel(wxCommandEvent& event);
-        void    OnOK(wxCommandEvent& event);
-        void    OnClose(wxCloseEvent& event);
-        void    OnInitDialog(wxInitDialogEvent& event);
-        void    OnLPCPostFilterDefault(wxCommandEvent& event);
-
-        void    OnBetaScroll(wxScrollEvent& event);
-        void    OnGammaScroll(wxScrollEvent& event);
-        void    OnEnable(wxScrollEvent& event);
-        void    OnBassBoost(wxScrollEvent& event);
-
-        void    OnMicInBassFreqScroll(wxScrollEvent& event) { sliderToFreq(&m_MicInBass, true); }
-        void    OnMicInBassGainScroll(wxScrollEvent& event) { sliderToGain(&m_MicInBass, true); }
-        void    OnMicInTrebleFreqScroll(wxScrollEvent& event) { sliderToFreq(&m_MicInTreble, true); }
-        void    OnMicInTrebleGainScroll(wxScrollEvent& event) { sliderToGain(&m_MicInTreble, true); }
-        void    OnMicInMidFreqScroll(wxScrollEvent& event) { sliderToFreq(&m_MicInMid, true); }
-        void    OnMicInMidGainScroll(wxScrollEvent& event) { sliderToGain(&m_MicInMid, true); }
-        void    OnMicInMidQScroll(wxScrollEvent& event) { sliderToQ(&m_MicInMid, true); }
-        void    OnMicInEnable(wxScrollEvent& event);
-        void    OnMicInDefault(wxCommandEvent& event);
-
-        void    OnSpkOutBassFreqScroll(wxScrollEvent& event) { sliderToFreq(&m_SpkOutBass, false); }
-        void    OnSpkOutBassGainScroll(wxScrollEvent& event) { sliderToGain(&m_SpkOutBass, false); }
-        void    OnSpkOutTrebleFreqScroll(wxScrollEvent& event) { sliderToFreq(&m_SpkOutTreble, false); }
-        void    OnSpkOutTrebleGainScroll(wxScrollEvent& event) { sliderToGain(&m_SpkOutTreble, false); }
-        void    OnSpkOutMidFreqScroll(wxScrollEvent& event) { sliderToFreq(&m_SpkOutMid, false); }
-        void    OnSpkOutMidGainScroll(wxScrollEvent& event) { sliderToGain(&m_SpkOutMid, false); }
-        void    OnSpkOutMidQScroll(wxScrollEvent& event) { sliderToQ(&m_SpkOutMid, false); }
-        void    OnSpkOutEnable(wxScrollEvent& event);
-        void    OnSpkOutDefault(wxCommandEvent& event);
-
-        wxStaticText* m_staticText8;
-        wxCheckBox*   m_codec2LPCPostFilterEnable;
-        wxStaticText* m_staticText9;
-        wxCheckBox*   m_codec2LPCPostFilterBassBoost;
-        wxStaticText* m_staticText91;
-        wxSlider*     m_codec2LPCPostFilterBeta;
-        wxStaticText* m_staticTextBeta;
-        wxStaticText* m_staticText911;
-        wxSlider*     m_codec2LPCPostFilterGamma;
-        wxStaticText* m_staticTextGamma;
-        wxButton*     m_LPCPostFilterDefault;
-
-        wxStdDialogButtonSizer* m_sdbSizer5;
-        wxButton*     m_sdbSizer5OK;
-        wxButton*     m_sdbSizer5Cancel;
-        PlotSpectrum* m_MicInFreqRespPlot;
-        PlotSpectrum* m_SpkOutFreqRespPlot;
-        
-        wxCheckBox*   m_MicInEnable;
-        wxButton*     m_MicInDefault;
-        wxCheckBox*   m_SpkOutEnable;
-        wxButton*     m_SpkOutDefault;
-
-        float        *m_MicInMagdB;
-        float        *m_SpkOutMagdB;
-
-     private:
-        bool          m_running;
-        float         m_beta;
-        float         m_gamma;
-
-        void          setBeta(void);  // sets slider and static text from m_beta
-        void          setGamma(void); // sets slider and static text from m_gamma
-        void          setCodec2(void);
-        void          newEQControl(wxSlider** slider, wxStaticText** value, wxStaticBoxSizer *bs, wxString controlName);
-        EQ            newEQ(wxSizer *bs, wxString eqName, float maxFreqHz, bool enableQ);
-        void          newLPCPFControl(wxSlider **slider, wxStaticText **stValue, wxSizer *sbs, wxString controlName);
-        wxAuiNotebook *m_auiNotebook;
-        void          setFreq(EQ *eq);
-        void          setGain(EQ *eq);
-        void          setQ(EQ *eq);
-        void          sliderToFreq(EQ *eq, bool micIn);
-        void          sliderToGain(EQ *eq, bool micIn);
-        void          sliderToQ(EQ *eq, bool micIn);
-        void          plotFilterSpectrum(EQ *eqBass, EQ *eqMid, EQ* eqTreble, PlotSpectrum* freqRespPlot, float *magdB);
-        void          calcFilterSpectrum(float magdB[], int arc, char *argv[]);
-        void          plotMicInFilterSpectrum(void);
-        void          plotSpkOutFilterSpectrum(void);
-        void          adjRunTimeMicInFilter(void);
-        void          adjRunTimeSpkOutFilter(void);
-
-        EQ            m_MicInBass;
-        EQ            m_MicInMid;
-        EQ            m_MicInTreble;
-
-        EQ            m_SpkOutBass;
-        EQ            m_SpkOutMid;
-        EQ            m_SpkOutTreble;
-
-        float         limit(float value, float min, float max);
-        bool          *m_newMicInFilter;
-        bool          *m_newSpkOutFilter;
-
-};
-
-#endif // __FILTER_DIALOG__
diff --git a/fdmdv2/branches/0.97/src/dlg_options.cpp b/fdmdv2/branches/0.97/src/dlg_options.cpp
deleted file mode 100644 (file)
index 6acca11..0000000
+++ /dev/null
@@ -1,309 +0,0 @@
-//==========================================================================
-// Name:            dlg_options.cpp
-// Purpose:         Dialog for controlling misc FreeDV options
-// Date:            May 24 2013
-// 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-
-#include "dlg_options.h"
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class OptionsDlg
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-OptionsDlg::OptionsDlg(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* bSizer30;
-    bSizer30 = new wxBoxSizer(wxVERTICAL);
-
-    //------------------------------
-    // Test Frames check box
-    //------------------------------
-
-    wxStaticBoxSizer* sbSizer_testFrames;
-    wxStaticBox *sb_testFrames = new wxStaticBox(this, wxID_ANY, _("Test Frames"));
-    sbSizer_testFrames = new wxStaticBoxSizer(sb_testFrames, wxVERTICAL);
-
-    m_ckboxTestFrame = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
-    sb_testFrames->SetToolTip(_("Send frames of known bits instead of compressed voice"));
-    sbSizer_testFrames->Add(m_ckboxTestFrame, 0, wxALIGN_LEFT, 0);
-
-    bSizer30->Add(sbSizer_testFrames,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
-
-    //------------------------------
-    // Txt Msg Text Box
-    //------------------------------
-
-    wxStaticBoxSizer* sbSizer_callSign;
-    sbSizer_callSign = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Txt Msg")), wxVERTICAL);
-
-    m_txtCtrlCallSign = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
-    m_txtCtrlCallSign->SetToolTip(_("Txt Msg you can send along with Voice"));
-    sbSizer_callSign->Add(m_txtCtrlCallSign, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3);
-
-    bSizer30->Add(sbSizer_callSign,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
-    //------------------------------
-    // Txt Encoding 
-    //------------------------------
-
-    wxStaticBoxSizer* sbSizer_encoding = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Text Encoding")), wxHORIZONTAL);
-
-    m_rb_textEncoding1 = new wxRadioButton( this, wxID_ANY, wxT("Long varicode"), wxDefaultPosition, wxDefaultSize, 0);
-    m_rb_textEncoding1->SetValue(true);
-    sbSizer_encoding->Add(m_rb_textEncoding1, 0, wxALIGN_LEFT|wxALL, 1);
-    m_rb_textEncoding2 = new wxRadioButton( this, wxID_ANY, wxT("Short Varicode"), wxDefaultPosition, wxDefaultSize, 0);
-    sbSizer_encoding->Add(m_rb_textEncoding2, 0, wxALIGN_LEFT|wxALL, 1);
-
-    bSizer30->Add(sbSizer_encoding,0, wxALL|wxEXPAND, 3);
-    //------------------------------
-    // Event processing
-    //------------------------------
-
-    wxStaticBoxSizer* sbSizer_events;
-    wxStaticBox *sb_events = new wxStaticBox(this, wxID_ANY, _("Event Processing"));
-    sbSizer_events = new wxStaticBoxSizer(sb_events, wxVERTICAL);
-
-    // event processing enable and spam timer
-
-    wxStaticBoxSizer* sbSizer_events_top;
-    wxStaticBox* sb_events1 = new wxStaticBox(this, wxID_ANY, _(""));    
-    sbSizer_events_top = new wxStaticBoxSizer(sb_events1, wxHORIZONTAL);
-
-    m_ckbox_events = new wxCheckBox(this, wxID_ANY, _("Enable System Calls    Syscall Spam Timer"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
-    sb_events->SetToolTip(_("Enable processing of events and generation of system calls"));
-    sbSizer_events_top->Add(m_ckbox_events, 0, 0, 5);
-    m_txt_spam_timer = new wxTextCtrl(this, wxID_ANY,  wxEmptyString, wxDefaultPosition, wxSize(40,-1), 0, wxTextValidator(wxFILTER_DIGITS));
-    m_txt_spam_timer->SetToolTip(_("Many matching events can cause a flood of syscalls. Set minimum time (seconds) between syscalls for each event here"));
-    sbSizer_events_top->Add(m_txt_spam_timer, 0, 0, 5);
-    m_rb_spam_timer = new wxRadioButton( this, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
-    m_rb_spam_timer->SetForegroundColour( wxColour(0, 255, 0 ) );
-    sbSizer_events_top->Add(m_rb_spam_timer, 0, 0, 10);
-    sbSizer_events->Add(sbSizer_events_top, 0, 0, 5);
-
-    // list of regexps
-
-    wxStaticBoxSizer* sbSizer_regexp = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Regular Expressions to Process Events")), wxHORIZONTAL);
-    m_txt_events_regexp_match = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(200,100), wxTE_MULTILINE);
-    m_txt_events_regexp_match->SetToolTip(_("Enter regular expressions to match events"));
-    sbSizer_regexp->Add(m_txt_events_regexp_match, 1, wxEXPAND, 5);
-    m_txt_events_regexp_replace = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(200,100), wxTE_MULTILINE);
-    m_txt_events_regexp_replace->SetToolTip(_("Enter regular expressions to replace events"));
-    sbSizer_regexp->Add(m_txt_events_regexp_replace, 1, wxEXPAND, 5);
-    sbSizer_events->Add(sbSizer_regexp, 1, wxEXPAND, 5);
-
-    // log of events and responses
-
-    wxStaticBoxSizer* sbSizer_event_log = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Log of Events and Responses")), wxVERTICAL);
-    wxBoxSizer* bSizer33 = new wxBoxSizer(wxHORIZONTAL);
-    m_txt_events_in = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(200,50), wxTE_MULTILINE | wxTE_READONLY);
-    bSizer33->Add(m_txt_events_in, 1, wxEXPAND, 5);
-    m_txt_events_out = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(200,50), wxTE_MULTILINE | wxTE_READONLY);
-    bSizer33->Add(m_txt_events_out, 1, wxEXPAND, 5);
-    sbSizer_event_log->Add(bSizer33, 1, wxEXPAND, 5);
-    sbSizer_events->Add(sbSizer_event_log, 1, wxEXPAND, 5);
-
-    bSizer30->Add(sbSizer_events,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
-
-    //------------------------------
-    // UDP control port
-    //------------------------------
-
-    wxStaticBoxSizer* sbSizer_udp;
-    wxStaticBox* sb_udp = new wxStaticBox(this, wxID_ANY, _("UDP Control Port"));
-    sbSizer_udp = new wxStaticBoxSizer(sb_udp, wxHORIZONTAL);
-    m_ckbox_udp_enable = new wxCheckBox(this, wxID_ANY, _("Enable UDP Control Port    UDP Port Number:"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
-    sb_udp->SetToolTip(_("Enable control of FreeDV via UDP port"));
-    sbSizer_udp->Add(m_ckbox_udp_enable, 0,  wxALIGN_CENTER_HORIZONTAL, 5);
-    m_txt_udp_port = new wxTextCtrl(this, wxID_ANY,  wxEmptyString, wxDefaultPosition, wxSize(50,-1), 0, wxTextValidator(wxFILTER_DIGITS));
-    sbSizer_udp->Add(m_txt_udp_port, 0, wxALIGN_CENTER_HORIZONTAL, 5);
-
-    bSizer30->Add(sbSizer_udp,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
-
-    //------------------------------
-    // OK - Cancel - Apply Buttons 
-    //------------------------------
-
-    wxBoxSizer* bSizer31 = new wxBoxSizer(wxHORIZONTAL);
-
-    m_sdbSizer5OK = new wxButton(this, wxID_OK);
-    bSizer31->Add(m_sdbSizer5OK, 0, wxALL, 2);
-
-    m_sdbSizer5Cancel = new wxButton(this, wxID_CANCEL);
-    bSizer31->Add(m_sdbSizer5Cancel, 0, wxALL, 2);
-
-    m_sdbSizer5Apply = new wxButton(this, wxID_APPLY);
-    bSizer31->Add(m_sdbSizer5Apply, 0, wxALL, 2);
-
-    bSizer30->Add(bSizer31, 0, wxALIGN_RIGHT|wxALL, 0);
-
-    this->SetSizer(bSizer30);
-    this->Layout();
-
-    this->Centre(wxBOTH);
-    // Connect Events -------------------------------------------------------
-
-    this->Connect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(OptionsDlg::OnInitDialog));
-
-    m_sdbSizer5OK->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsDlg::OnOK), NULL, this);
-    m_sdbSizer5Cancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsDlg::OnCancel), NULL, this);
-    m_sdbSizer5Apply->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsDlg::OnApply), NULL, this);
-
-    event_in_serial = 0;
-    event_out_serial = 0;
-}
-
-//-------------------------------------------------------------------------
-// ~OptionsDlg()
-//-------------------------------------------------------------------------
-OptionsDlg::~OptionsDlg()
-{
-    // Disconnect Events
-
-    this->Disconnect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(OptionsDlg::OnInitDialog));
-
-    m_sdbSizer5OK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsDlg::OnOK), NULL, this);
-    m_sdbSizer5Cancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsDlg::OnCancel), NULL, this);
-    m_sdbSizer5Apply->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsDlg::OnApply), NULL, this);
-}
-
-
-//-------------------------------------------------------------------------
-// ExchangeData()
-//-------------------------------------------------------------------------
-void OptionsDlg::ExchangeData(int inout, bool storePersistent)
-{
-    wxConfigBase *pConfig = wxConfigBase::Get();
-
-    if(inout == EXCHANGE_DATA_IN)
-    {
-        m_txtCtrlCallSign->SetValue(wxGetApp().m_callSign);
-        m_ckboxTestFrame->SetValue(wxGetApp().m_testFrames);
-
-        m_ckbox_events->SetValue(wxGetApp().m_events);
-        m_txt_spam_timer->SetValue(wxString::Format(wxT("%i"),wxGetApp().m_events_spam_timer));
-
-        m_txt_events_regexp_match->SetValue(wxGetApp().m_events_regexp_match);
-        m_txt_events_regexp_replace->SetValue(wxGetApp().m_events_regexp_replace);
-        
-        m_ckbox_udp_enable->SetValue(wxGetApp().m_udp_enable);
-        m_txt_udp_port->SetValue(wxString::Format(wxT("%i"),wxGetApp().m_udp_port));
-
-        if (wxGetApp().m_textEncoding == 1)
-            m_rb_textEncoding1->SetValue(true);
-        if (wxGetApp().m_textEncoding == 2)
-            m_rb_textEncoding2->SetValue(true);
-    }
-
-    if(inout == EXCHANGE_DATA_OUT)
-    {
-        wxGetApp().m_callSign      = m_txtCtrlCallSign->GetValue();
-        wxGetApp().m_testFrames    = m_ckboxTestFrame->GetValue();
-
-        wxGetApp().m_events        = m_ckbox_events->GetValue();
-        long spam_timer;
-        m_txt_spam_timer->GetValue().ToLong(&spam_timer);
-        wxGetApp().m_events_spam_timer = (int)spam_timer;
-
-        // make sure regexp lists are terminated by a \n
-
-        if (m_txt_events_regexp_match->GetValue().Last() != '\n') {
-            m_txt_events_regexp_match->SetValue(m_txt_events_regexp_match->GetValue()+'\n');
-        }
-        if (m_txt_events_regexp_replace->GetValue().Last() != '\n') {
-            m_txt_events_regexp_replace->SetValue(m_txt_events_regexp_replace->GetValue()+'\n');
-        }
-        wxGetApp().m_events_regexp_match = m_txt_events_regexp_match->GetValue();
-        wxGetApp().m_events_regexp_replace = m_txt_events_regexp_replace->GetValue();
-        wxGetApp().m_udp_enable     = m_ckbox_udp_enable->GetValue();
-        long port;
-        m_txt_udp_port->GetValue().ToLong(&port);
-        wxGetApp().m_udp_port       = (int)port;
-
-        if (m_rb_textEncoding1->GetValue())
-            wxGetApp().m_textEncoding = 1;
-        if (m_rb_textEncoding2->GetValue())
-            wxGetApp().m_textEncoding = 2;
-
-        if (storePersistent) {
-            pConfig->Write(wxT("/Data/CallSign"), wxGetApp().m_callSign);
-            pConfig->Write(wxT("/Data/TextEncoding"), wxGetApp().m_textEncoding);
-
-            pConfig->Write(wxT("/Events/enable"), wxGetApp().m_events);
-            pConfig->Write(wxT("/Events/spam_timer"), wxGetApp().m_events_spam_timer);
-            pConfig->Write(wxT("/Events/regexp_match"), wxGetApp().m_events_regexp_match);
-            pConfig->Write(wxT("/Events/regexp_replace"), wxGetApp().m_events_regexp_replace);
-            
-            pConfig->Write(wxT("/UDP/enable"), wxGetApp().m_udp_enable);
-            pConfig->Write(wxT("/UDP/port"),  wxGetApp().m_udp_port);
-
-            pConfig->Flush();
-        }
-    }
-    delete wxConfigBase::Set((wxConfigBase *) NULL);
-}
-
-//-------------------------------------------------------------------------
-// OnOK()
-//-------------------------------------------------------------------------
-void OptionsDlg::OnOK(wxCommandEvent& event)
-{
-    ExchangeData(EXCHANGE_DATA_OUT, true);
-    //this->EndModal(wxID_OK);
-    this->Show(false);
-}
-
-//-------------------------------------------------------------------------
-// OnCancel()
-//-------------------------------------------------------------------------
-void OptionsDlg::OnCancel(wxCommandEvent& event)
-{
-    //this->EndModal(wxID_CANCEL);
-    this->Show(false);
-}
-
-//-------------------------------------------------------------------------
-// OnApply()
-//-------------------------------------------------------------------------
-void OptionsDlg::OnApply(wxCommandEvent& event)
-{
-    ExchangeData(EXCHANGE_DATA_OUT, true);
-}
-
-//-------------------------------------------------------------------------
-// OnInitDialog()
-//-------------------------------------------------------------------------
-void OptionsDlg::OnInitDialog(wxInitDialogEvent& event)
-{
-    ExchangeData(EXCHANGE_DATA_IN, false);
-}
-
-
-void OptionsDlg::updateEventLog(wxString event_in, wxString event_out) {
-    wxString event_in_with_serial, event_out_with_serial; 
-    event_in_with_serial.Printf(_T("[%d] %s"), event_in_serial++, event_in);
-    event_out_with_serial.Printf(_T("[%d] %s"), event_out_serial++, event_out);
-
-    m_txt_events_in->AppendText(event_in_with_serial+"\n");
-    m_txt_events_out->AppendText(event_out_with_serial+"\n");
-}
-
diff --git a/fdmdv2/branches/0.97/src/dlg_options.h b/fdmdv2/branches/0.97/src/dlg_options.h
deleted file mode 100644 (file)
index bfe30d4..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-//==========================================================================
-// Name:            dlg_options.h
-// Purpose:         Dialog for controlling misc FreeDV options
-// Created:         Nov 25 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-
-#ifndef __OPTIONS_DIALOG__
-#define __OPTIONS_DIALOG__
-
-#include "fdmdv2_main.h"
-#include "fdmdv2_defines.h"
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class OptionsDlg
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class OptionsDlg : public wxDialog
-{
-    public:
-    OptionsDlg( wxWindow* parent,
-               wxWindowID id = wxID_ANY, const wxString& title = _("Options"), 
-                const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(600,580), 
-               long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
-        ~OptionsDlg();
-
-        void    ExchangeData(int inout, bool storePersistent);
-        void    updateEventLog(wxString event_in, wxString event_out);
-
-        bool    enableEventsChecked() {return m_ckbox_events->GetValue();}
-
-        void SetSpamTimerLight(bool state) {
-
-            // Colours don't work on Windows
-
-            if (state) {
-                m_rb_spam_timer->SetForegroundColour( wxColour( 255,0 , 0 ) ); // red
-                m_rb_spam_timer->SetValue(true);
-            }
-            else {
-                m_rb_spam_timer->SetForegroundColour( wxColour( 0, 255, 0 ) ); // green
-                m_rb_spam_timer->SetValue(false);
-            }
-        }
-
-
-    protected:
-        // Handlers for events.
-        void    OnOK(wxCommandEvent& event);
-        void    OnCancel(wxCommandEvent& event);
-        void    OnApply(wxCommandEvent& event);
-        void    OnClose(wxCloseEvent& event);
-        void    OnInitDialog(wxInitDialogEvent& event);
-        wxTextCtrl   *m_txtCtrlCallSign; // TODO: this should be renamed to tx_txtmsg, and rename all related incl persis strge
-        wxCheckBox   *m_ckboxTestFrame;
-
-        wxRadioButton *m_rb_textEncoding1;
-        wxRadioButton *m_rb_textEncoding2;
-
-        wxCheckBox   *m_ckbox_events;
-        wxTextCtrl   *m_txt_events_regexp_match;
-        wxTextCtrl   *m_txt_events_regexp_replace;
-        wxTextCtrl   *m_txt_events_in;
-        wxTextCtrl   *m_txt_events_out;
-        wxTextCtrl   *m_txt_spam_timer;
-        wxRadioButton *m_rb_spam_timer;
-
-        wxCheckBox   *m_ckbox_udp_enable;
-        wxTextCtrl   *m_txt_udp_port;
-
-        wxButton*     m_sdbSizer5OK;
-        wxButton*     m_sdbSizer5Cancel;
-        wxButton*     m_sdbSizer5Apply;
-
-        unsigned int  event_in_serial, event_out_serial;
-
-     private:
-};
-
-#endif // __OPTIONS_DIALOG__
diff --git a/fdmdv2/branches/0.97/src/dlg_ptt.cpp b/fdmdv2/branches/0.97/src/dlg_ptt.cpp
deleted file mode 100644 (file)
index 2643c1d..0000000
+++ /dev/null
@@ -1,416 +0,0 @@
-//==========================================================================
-// Name:            dlg_ptt.cpp
-// Purpose:         Subclasses dialog GUI for PTT Config. Creates simple 
-//                  wxWidgets dialog GUI to select real/virtual Comm ports.
-// Date:            May 11 2012
-// Authors:         David Rowe, David Witten, Joel Stanley
-// 
-// 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#include "dlg_ptt.h"
-#include "fdmdv2_main.h"
-
-#ifdef __WIN32__
-#include <wx/msw/registry.h>
-#endif
-#ifdef __FreeBSD__
-#include <glob.h>
-#include <string.h>
-#endif
-
-#include <sstream>
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class ComPortsDlg
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-ComPortsDlg::ComPortsDlg(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style)
-{
-    wxBoxSizer* mainSizer = new wxBoxSizer(wxVERTICAL);
-    this->SetSizer(mainSizer);
-    
-    //----------------------------------------------------------------------
-    // Half Duplex Flag for VOX PTT
-    //----------------------------------------------------------------------
-
-    // DR: should this be on options dialog?
-
-    wxStaticBoxSizer* staticBoxSizer28 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("VOX PTT Settings")), wxHORIZONTAL);
-    m_ckHalfDuplex = new wxCheckBox(this, wxID_ANY, _("Half Duplex"), wxDefaultPosition, wxSize(-1,-1), 0);
-    staticBoxSizer28->Add(m_ckHalfDuplex, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
-    m_ckLeftChannelVoxTone = new wxCheckBox(this, wxID_ANY, _("Left Channel Vox Tone"), wxDefaultPosition, wxSize(-1,-1), 0);
-    staticBoxSizer28->Add(m_ckLeftChannelVoxTone, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
-
-    mainSizer->Add(staticBoxSizer28, 0, wxEXPAND, 5);
-
-    //----------------------------------------------------------------------
-    // Hamlib for CAT PTT
-    //----------------------------------------------------------------------
-
-    wxStaticBoxSizer* staticBoxSizer18 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("Hamlib Settings")), wxVERTICAL);
-
-    wxBoxSizer* gridSizer100 = new wxBoxSizer(wxHORIZONTAL);
-
-    /* Use Hamlib for PTT checkbox. */
-    m_ckUseHamlibPTT = new wxCheckBox(this, wxID_ANY, _("Use Hamlib PTT"), wxDefaultPosition, wxSize(-1, -1), 0);
-    m_ckUseHamlibPTT->SetValue(false);
-    gridSizer100->Add(m_ckUseHamlibPTT, 0, wxALIGN_CENTER_VERTICAL, 0);
-
-    /* Hamlib Rig Type combobox. */
-    gridSizer100->Add(new wxStaticText(this, wxID_ANY, _("Rig Model:"), wxDefaultPosition, wxDefaultSize, 0), 
-                      0, wxALIGN_CENTER_VERTICAL | wxLEFT, 20);
-    m_cbRigName = new wxComboBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(250, -1), 0, NULL, wxCB_DROPDOWN);
-    /* TODO(Joel): this is a hack. At the least, need to gurantee that m_hamLib
-     * exists. */
-    wxGetApp().m_hamlib->populateComboBox(m_cbRigName);
-    m_cbRigName->SetSelection(wxGetApp().m_intHamlibRig);
-    gridSizer100->Add(m_cbRigName, 0, wxALIGN_CENTER_VERTICAL, 0);
-
-    /* Hamlib Serial Port combobox. */
-    gridSizer100->Add(new wxStaticText(this, wxID_ANY, _("Serial Device:"), wxDefaultPosition, wxDefaultSize, 0), 
-                      0, wxALIGN_CENTER_VERTICAL | wxLEFT, 20);
-    m_cbSerialPort = new wxComboBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(140, -1), 0, NULL, wxCB_DROPDOWN);
-    gridSizer100->Add(m_cbSerialPort, 0, wxALIGN_CENTER_VERTICAL, 0);
-
-    staticBoxSizer18->Add(gridSizer100, 1);
-    mainSizer->Add(staticBoxSizer18, 1);
-
-    //----------------------------------------------------------------------
-    // Serial port PTT
-    //----------------------------------------------------------------------
-
-    wxStaticBoxSizer* staticBoxSizer17 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("Serial Port Settings")), wxVERTICAL);
-    mainSizer->Add(staticBoxSizer17, 1, wxEXPAND, 5);
-    wxStaticBoxSizer* staticBoxSizer31 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("PTT Port")), wxVERTICAL);
-    staticBoxSizer17->Add(staticBoxSizer31, 1, wxEXPAND, 5);
-
-#ifdef __WXMSW__
-    m_ckUseSerialPTT = new wxCheckBox(this, wxID_ANY, _("Use Serial Port PTT"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_ckUseSerialPTT->SetValue(false);
-    staticBoxSizer31->Add(m_ckUseSerialPTT, 0, wxALIGN_LEFT, 20);
-
-    wxArrayString m_listCtrlPortsArr;
-    m_listCtrlPorts = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxSize(-1,45), m_listCtrlPortsArr, wxLB_SINGLE | wxLB_SORT);
-    staticBoxSizer31->Add(m_listCtrlPorts, 1, wxALIGN_CENTER, 0);
-#endif
-
-#ifdef __WXGTK__
-    wxBoxSizer* bSizer83;
-    bSizer83 = new wxBoxSizer(wxHORIZONTAL);
-
-    wxGridSizer* gridSizer200 = new wxGridSizer(1, 3, 0, 0);
-    
-    m_ckUseSerialPTT = new wxCheckBox(this, wxID_ANY, _("Use Serial Port PTT"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_ckUseSerialPTT->SetValue(false);
-    gridSizer200->Add(m_ckUseSerialPTT, 1, wxALIGN_CENTER|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 2);
-
-    m_staticText12 = new wxStaticText(this, wxID_ANY, _("Serial Device:  "), wxDefaultPosition, wxDefaultSize, 0);
-    m_staticText12->Wrap(-1);
-    gridSizer200->Add(m_staticText12, 1,wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 2);
-
-    m_cbCtlDevicePath = new wxComboBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(140, -1), 0, NULL, wxCB_DROPDOWN);
-    gridSizer200->Add(m_cbCtlDevicePath, 1, wxEXPAND|wxALIGN_CENTER|wxALIGN_RIGHT, 2);
-    
-    bSizer83->Add(gridSizer200, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT | wxALL, 2);
-    staticBoxSizer31->Add(bSizer83, 1, wxALIGN_CENTER_VERTICAL|wxALL, 1);
-#endif
-
-    wxBoxSizer* boxSizer19 = new wxBoxSizer(wxVERTICAL);
-    staticBoxSizer17->Add(boxSizer19, 1, wxEXPAND, 5);
-    wxStaticBoxSizer* staticBoxSizer16 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("Signal polarity")), wxHORIZONTAL);
-    boxSizer19->Add(staticBoxSizer16, 1, wxEXPAND|wxALIGN_CENTER|wxALIGN_RIGHT, 5);
-
-    wxGridSizer* gridSizer17 = new wxGridSizer(2, 2, 0, 0);
-    staticBoxSizer16->Add(gridSizer17, 1, wxEXPAND|wxALIGN_RIGHT, 5);
-
-    m_rbUseDTR = new wxRadioButton(this, wxID_ANY, _("Use DTR"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_rbUseDTR->SetToolTip(_("Toggle DTR line for PTT"));
-    m_rbUseDTR->SetValue(1);
-    gridSizer17->Add(m_rbUseDTR, 0, wxALIGN_CENTER|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5);
-
-    m_ckDTRPos = new wxCheckBox(this, wxID_ANY, _("DTR = +V"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_ckDTRPos->SetToolTip(_("Set Polarity of the DTR line"));
-    m_ckDTRPos->SetValue(false);
-    gridSizer17->Add(m_ckDTRPos, 0, wxALIGN_CENTER|wxALIGN_RIGHT, 5);
-
-    m_rbUseRTS = new wxRadioButton(this, wxID_ANY, _("Use RTS"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_rbUseRTS->SetToolTip(_("Toggle the RTS pin for PTT"));
-    m_rbUseRTS->SetValue(1);
-    gridSizer17->Add(m_rbUseRTS, 0, wxALIGN_CENTER|wxALIGN_RIGHT, 5);
-
-    m_ckRTSPos = new wxCheckBox(this, wxID_ANY, _("RTS = +V"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_ckRTSPos->SetValue(false);
-    m_ckRTSPos->SetToolTip(_("Set Polarity of the RTS line"));
-    gridSizer17->Add(m_ckRTSPos, 0, wxALIGN_CENTER|wxALIGN_RIGHT, 5);
-
-    //----------------------------------------------------------------------
-    // OK - Cancel - Apply
-    //----------------------------------------------------------------------
-
-    wxBoxSizer* boxSizer12 = new wxBoxSizer(wxHORIZONTAL);
-
-    m_buttonOK = new wxButton(this, wxID_OK, _("OK"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_buttonOK->SetDefault();
-    boxSizer12->Add(m_buttonOK, 0, wxLEFT|wxRIGHT|wxTOP|wxBOTTOM, 5);
-
-    m_buttonCancel = new wxButton(this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxSize(-1,-1), 0);
-    boxSizer12->Add(m_buttonCancel, 0, wxLEFT|wxRIGHT|wxTOP|wxBOTTOM, 5);
-
-    m_buttonApply = new wxButton(this, wxID_APPLY, _("Apply"), wxDefaultPosition, wxSize(-1,-1), 0);
-    boxSizer12->Add(m_buttonApply, 0, wxLEFT|wxRIGHT|wxTOP|wxBOTTOM, 5);
-
-    mainSizer->Add(boxSizer12, 0, wxLEFT|wxRIGHT|wxTOP|wxBOTTOM|wxALIGN_CENTER_HORIZONTAL, 5);
-
-    if ( GetSizer() ) 
-    {
-         GetSizer()->Fit(this);
-    }
-    Centre(wxBOTH);
-
-    // Connect events
-    this->Connect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(ComPortsDlg::OnInitDialog), NULL, this);
-    m_ckUseHamlibPTT->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(ComPortsDlg::PTTUseHamLibClicked), NULL, this);
-    m_ckUseSerialPTT->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(ComPortsDlg::PTTUseSerialClicked), NULL, this);
-    m_buttonOK->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnOK), NULL, this);
-    m_buttonCancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnCancel), NULL, this);
-    m_buttonApply->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnApply), NULL, this);
-}
-
-//-------------------------------------------------------------------------
-// ~ComPortsDlg()
-//-------------------------------------------------------------------------
-ComPortsDlg::~ComPortsDlg()
-{
-    // Disconnect Events
-    this->Disconnect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(ComPortsDlg::OnInitDialog), NULL, this);
-    m_ckUseHamlibPTT->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(ComPortsDlg::PTTUseHamLibClicked), NULL, this);
-    m_ckUseSerialPTT->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(ComPortsDlg::PTTUseSerialClicked), NULL, this);
-    m_buttonOK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnOK), NULL, this);
-    m_buttonCancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnCancel), NULL, this);
-    m_buttonApply->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnApply), NULL, this);
-}
-
-//-------------------------------------------------------------------------
-// OnInitDialog()
-//-------------------------------------------------------------------------
-void ComPortsDlg::OnInitDialog(wxInitDialogEvent& event)
-{
-    populatePortList();
-    ExchangeData(EXCHANGE_DATA_IN);
-}
-
-//-------------------------------------------------------------------------
-// populatePortList()
-//-------------------------------------------------------------------------
-void ComPortsDlg::populatePortList()
-{
-#ifdef __WXMSW__
-    m_listCtrlPorts->Clear();
-    m_cbSerialPort->Clear();
-    wxArrayString aStr;
-    wxRegKey key(wxRegKey::HKLM, _T("HARDWARE\\DEVICEMAP\\SERIALCOMM"));
-    if(!key.Exists())
-    {
-        return;
-    }
-    else
-    {
-        // Get the number of subkeys and enumerate them.
-        if(!key.Open(wxRegKey::Read))
-        {
-            return;
-        }    
-        size_t subkeys;
-        size_t values;
-        if(!key.GetKeyInfo(&subkeys, NULL, &values, NULL))
-        {
-            return;
-        }
-        if(!key.HasValues())
-        {
-            return;
-        }
-        wxString key_name;
-        long el = 1;
-        key.GetFirstValue(key_name, el);
-        wxString valType;
-        wxString key_data;
-        for(unsigned int i = 0; i < values; i++)
-        {
-            key.QueryValue(key_name, key_data);
-            //wxPrintf("Value:  %s Data: %s\n", key_name, key_data);
-            aStr.Add(key_data, 1);
-            key.GetNextValue(key_name, el);
-        }
-    }
-    m_listCtrlPorts->Append(aStr);
-    m_cbSerialPort->Append(aStr);
-#endif
-#ifdef __WXGTK__
-    m_cbSerialPort->Clear();
-    m_cbCtlDevicePath->Clear();
-#ifdef __FreeBSD__
-       glob_t  gl;
-       if(glob("/dev/tty*", GLOB_MARK, NULL, &gl)==0) {
-               for(unsigned int i=0; i<gl.gl_pathc; i++) {
-                       if(gl.gl_pathv[i][strlen(gl.gl_pathv[i])-1]=='/')
-                               continue;
-                               
-                       /* Exclude pseudo TTYs */
-                       if(gl.gl_pathv[i][8] >= 'l' && gl.gl_pathv[i][8] <= 's')
-                               continue;
-                       if(gl.gl_pathv[i][8] >= 'L' && gl.gl_pathv[i][8] <= 'S')
-                               continue;
-
-                       /* Exclude virtual TTYs */
-                       if(gl.gl_pathv[i][8] == 'v')
-                               continue;
-
-                       /* Exclude initial-state and lock-state devices */
-                       if(strchr(gl.gl_pathv[i], '.') != NULL)
-                               continue;
-
-                       m_cbSerialPort->Append(gl.gl_pathv[i]);
-                       m_cbCtlDevicePath->Append(gl.gl_pathv[i]);
-               }
-               globfree(&gl);
-       }
-#else
-    /* TODO(Joel): http://stackoverflow.com/questions/2530096/how-to-find-all-serial-devices-ttys-ttyusb-on-linux-without-opening-them */
-    m_cbSerialPort->Append("/dev/ttyUSB0");
-    m_cbSerialPort->Append("/dev/ttyUSB1");
-    m_cbSerialPort->Append("/dev/ttyS0");
-    m_cbSerialPort->Append("/dev/ttyS1");
-    m_cbCtlDevicePath->Clear();
-    m_cbCtlDevicePath->Append("/dev/ttyUSB0");
-    m_cbCtlDevicePath->Append("/dev/ttyUSB1");
-    m_cbCtlDevicePath->Append("/dev/ttyS0");
-    m_cbCtlDevicePath->Append("/dev/ttyS1");
-#endif
-#endif
-}
-
-//-------------------------------------------------------------------------
-// ExchangeData()
-//-------------------------------------------------------------------------
-void ComPortsDlg::ExchangeData(int inout)
-{
-    wxConfigBase *pConfig = wxConfigBase::Get();
-    wxString str;
-    
-    if(inout == EXCHANGE_DATA_IN)
-    {
-        m_ckHalfDuplex->SetValue(wxGetApp().m_boolHalfDuplex);
-        m_ckLeftChannelVoxTone->SetValue(wxGetApp().m_leftChannelVoxTone);
-
-        m_ckUseHamlibPTT->SetValue(wxGetApp().m_boolHamlibUseForPTT);
-        m_cbRigName->SetSelection(wxGetApp().m_intHamlibRig);
-        m_cbSerialPort->SetValue(wxGetApp().m_strHamlibSerialPort);
-
-        m_ckUseSerialPTT->SetValue(wxGetApp().m_boolUseSerialPTT);
-        str = wxGetApp().m_strRigCtrlPort;
-#ifdef __WXMSW__
-        m_listCtrlPorts->SetStringSelection(str);
-#endif
-#ifdef __WXGTK__
-        m_cbCtlDevicePath->SetValue(str);
-#endif
-        m_rbUseRTS->SetValue(wxGetApp().m_boolUseRTS);
-        m_ckRTSPos->SetValue(wxGetApp().m_boolRTSPos);
-        m_rbUseDTR->SetValue(wxGetApp().m_boolUseDTR);
-        m_ckDTRPos->SetValue(wxGetApp().m_boolDTRPos);
-    }
-    if(inout == EXCHANGE_DATA_OUT)
-    {
-        wxGetApp().m_boolHalfDuplex = m_ckHalfDuplex->GetValue();
-        pConfig->Write(wxT("/Rig/HalfDuplex"), wxGetApp().m_boolHalfDuplex);
-        wxGetApp().m_leftChannelVoxTone = m_ckLeftChannelVoxTone->GetValue();
-        pConfig->Write(wxT("/Rig/leftChannelVoxTone"), wxGetApp().m_leftChannelVoxTone);
-
-        /* Hamlib settings. */
-
-        wxGetApp().m_boolHamlibUseForPTT = m_ckUseHamlibPTT->GetValue();
-        wxGetApp().m_intHamlibRig = m_cbRigName->GetSelection();
-        wxGetApp().m_strHamlibSerialPort = m_cbSerialPort->GetValue();
-
-        pConfig->Write(wxT("/Hamlib/UseForPTT"), wxGetApp().m_boolHamlibUseForPTT);
-        pConfig->Write(wxT("/Hamlib/RigName"), wxGetApp().m_intHamlibRig);
-        pConfig->Write(wxT("/Hamlib/SerialPort"), wxGetApp().m_strHamlibSerialPort);
-
-        /* Serial settings */
-
-        wxGetApp().m_boolUseSerialPTT           = m_ckUseSerialPTT->IsChecked();
-#ifdef __WXMSW__
-        wxGetApp().m_strRigCtrlPort             = m_listCtrlPorts->GetStringSelection();
-#endif
-#ifdef __WXGTK__
-        wxGetApp().m_strRigCtrlPort             = m_cbCtlDevicePath->GetValue();
-#endif
-        wxGetApp().m_boolUseRTS                 = m_rbUseRTS->GetValue();
-        wxGetApp().m_boolRTSPos                 = m_ckRTSPos->IsChecked();
-        wxGetApp().m_boolUseDTR                 = m_rbUseDTR->GetValue();
-        wxGetApp().m_boolDTRPos                 = m_ckDTRPos->IsChecked();
-        
-        pConfig->Write(wxT("/Rig/UseSerialPTT"),    wxGetApp().m_boolUseSerialPTT);
-        pConfig->Write(wxT("/Rig/Port"),            wxGetApp().m_strRigCtrlPort); 
-        pConfig->Write(wxT("/Rig/UseRTS"),          wxGetApp().m_boolUseRTS);
-        pConfig->Write(wxT("/Rig/RTSPolarity"),     wxGetApp().m_boolRTSPos);
-        pConfig->Write(wxT("/Rig/UseDTR"),          wxGetApp().m_boolUseDTR);
-        pConfig->Write(wxT("/Rig/DTRPolarity"),     wxGetApp().m_boolDTRPos);
-
-        pConfig->Flush();
-    }
-    delete wxConfigBase::Set((wxConfigBase *) NULL);
-}
-
-//-------------------------------------------------------------------------
-// PTTUseHamLibClicked()
-//-------------------------------------------------------------------------
-void ComPortsDlg::PTTUseHamLibClicked(wxCommandEvent& event)
-{
-    m_ckUseSerialPTT->SetValue(false);    
-}
-
-//-------------------------------------------------------------------------
-// PTTUseSerialClicked()
-//-------------------------------------------------------------------------
-void ComPortsDlg::PTTUseSerialClicked(wxCommandEvent& event)
-{
-    m_ckUseHamlibPTT->SetValue(false);
-}
-
-//-------------------------------------------------------------------------
-// OnApply()
-//-------------------------------------------------------------------------
-void ComPortsDlg::OnApply(wxCommandEvent& event)
-{
-    ExchangeData(EXCHANGE_DATA_OUT);
-}
-
-//-------------------------------------------------------------------------
-// OnCancel()
-//-------------------------------------------------------------------------
-void ComPortsDlg::OnCancel(wxCommandEvent& event)
-{
-    this->EndModal(wxID_CANCEL);
-}
-
-//-------------------------------------------------------------------------
-// OnClose()
-//-------------------------------------------------------------------------
-void ComPortsDlg::OnOK(wxCommandEvent& event)
-{
-    ExchangeData(EXCHANGE_DATA_OUT);
-    this->EndModal(wxID_OK);
-}
diff --git a/fdmdv2/branches/0.97/src/dlg_ptt.h b/fdmdv2/branches/0.97/src/dlg_ptt.h
deleted file mode 100644 (file)
index 8fa9b9d..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-//==========================================================================
-// Name:            dlg_ptt.h
-// Purpose:         Subclasses dialog GUI for PTT Config.
-//                  
-// Created:         May. 11, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#ifndef __COMPORTS_DIALOG__
-#define __COMPORTS_DIALOG__
-
-#include "fdmdv2_main.h"
-#include "hamlib.h"
-#include <wx/settings.h>
-#include <wx/xrc/xmlres.h>
-#include <wx/xrc/xh_bmp.h>
-#include <wx/dialog.h>
-#include <wx/sizer.h>
-#include <wx/statbox.h>
-#include <wx/checkbox.h>
-#include <wx/listbox.h>
-#include <wx/radiobut.h>
-#include <wx/button.h>
-#include <wx/spinctrl.h>
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class ComPortsDlg
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class ComPortsDlg : public wxDialog
-{
-     public:
-        ComPortsDlg(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("PTT Config"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(450,300), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER);
-        virtual ~ComPortsDlg();
-        void    ExchangeData(int inout);
-
-    protected:
-        wxCheckBox* m_ckHalfDuplex;
-        wxCheckBox* m_ckLeftChannelVoxTone;
-
-        /* Hamlib settings.*/
-
-        wxCheckBox *m_ckUseHamlibPTT;
-        wxComboBox *m_cbRigName;
-        wxComboBox *m_cbSerialPort;
-
-        Hamlib *m_hamlib;
-
-        /* Serial Settings */
-
-        wxListBox     *m_listCtrlPorts;
-        wxCheckBox    *m_ckUseSerialPTT;
-        wxStaticText  *m_staticText12;
-        wxComboBox    *m_cbCtlDevicePath;
-        wxRadioButton *m_rbUseDTR;
-        wxCheckBox    *m_ckRTSPos;
-        wxRadioButton *m_rbUseRTS;
-        wxCheckBox    *m_ckDTRPos;
-
-        /* Ok - Cancel - Apply */
-
-        wxButton* m_buttonOK;
-        wxButton* m_buttonCancel;
-        wxButton* m_buttonApply;
-
-
-protected:
-        void populatePortList();
-
-        void PTTUseHamLibClicked(wxCommandEvent& event);
-        void PTTUseSerialClicked(wxCommandEvent& event);
-
-        void OnOK(wxCommandEvent& event);
-        void OnCancel(wxCommandEvent& event);
-        void OnApply(wxCommandEvent& event);
-        virtual void OnInitDialog(wxInitDialogEvent& event);
-};
-
-#endif // __COMPORTS_DIALOG__
diff --git a/fdmdv2/branches/0.97/src/fdmdv2_defines.h b/fdmdv2/branches/0.97/src/fdmdv2_defines.h
deleted file mode 100644 (file)
index ba11f02..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_defines.h
-// Purpose:         Definitions used by plots derived from fdmdv2_plot class.
-// Created:         August 27, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#ifndef __FDMDV2_DEFINES__
-#define __FDMDV2_DEFINES__
-
-#include "wx/wx.h"
-#include "codec2_fdmdv.h"
-
-// Spectrogram and Waterfall
-
-#define MIN_MAG_DB        -40.0     // min of spectrogram/waterfall magnitude axis
-#define MAX_MAG_DB          0.0     // max of spectrogram/waterfall magnitude axis
-#define STEP_MAG_DB         5.0     // magnitude axis step
-#define BETA                0.95    // constant for time averaging spectrum data
-#define MIN_F_HZ            0       // min freq on Waterfall and Spectrum
-#define MAX_F_HZ            3000    // max freq on Waterfall and Spectrum
-#define STEP_F_HZ           500     // major (e.g. text legend) freq step on Waterfall and Spectrum graticule
-#define STEP_MINOR_F_HZ     100     // minor (ticks) freq step on Waterfall and Spectrum graticule
-#define WATERFALL_SECS_Y    30      // number of seconds respresented by y axis of waterfall
-#define WATERFALL_SECS_STEP 5       // graticule y axis steps of waterfall
-#define DT                  0.1     // time between real time graphing updates
-#define FS                  8000    // FDMDV modem sample rate
-
-// Scatter diagram 
-
-#define SCATTER_MEM_SECS    2
-// (symbols/frame)/(graphics update period) = symbols/s sent to scatter memory
-// memory (symbols) = secs of memory * symbols/sec
-#define SCATTER_MEM_SYMS_MAX    ((int)(SCATTER_MEM_SECS*((FDMDV_NC_MAX+1)/DT)))
-
-// Waveform plotting constants
-
-#define WAVEFORM_PLOT_FS    400                            // sample rate (points/s) of waveform plotted to screen
-#define WAVEFORM_PLOT_TIME  5                              // length or entire waveform on screen
-#define WAVEFORM_PLOT_BUF   ((int)(DT*WAVEFORM_PLOT_FS))   // number of new samples we plot per DT
-
-// sample rate I/O & conversion constants
-
-#define MAX_FPB             8096                           // maximum value of portAudio framesPerBuffer
-#define PA_FPB              1024                           // nominal value of portAudio framesPerBuffer
-#define SAMPLE_RATE         48000                          // 48 kHz sampling rate rec. as we can trust accuracy of sound card
-#define N8                  FDMDV_NOM_SAMPLES_PER_FRAME    // processing buffer size at 8 kHz
-#define MEM8                (FDMDV_OS_TAPS/FDMDV_OS)
-#define N48                 (N8*FDMDV_OS)                  // processing buffer size at 48 kHz
-#define NUM_CHANNELS        2                              // I think most sound cards prefer stereo we will convert to mono
-#define VOX_TONE_FREQ       1000.0                         // optional left channel vox tone freq
-#define VOX_TONE_AMP        30000                          // optional left channel vox tone amp
-
-#define MAX_BITS_PER_CODEC_FRAME 64                            // 1600 bit/s mode
-#define MAX_BYTES_PER_CODEC_FRAME (MAX_BITS_PER_CODEC_FRAME/8)
-#define MAX_BITS_PER_FDMDV_FRAME 40                            // 2000 bit/s mode
-
-// Squelch
-#define SQ_DEFAULT_SNR      1.5
-
-// Level Gauge
-#define FROM_RADIO_MAX       0.8
-#define FROM_MIC_MAX         0.8
-#define LEVEL_BETA           0.99
-
-// SNR
-#define SNRSLOW_BETA        0.5                           // time constant for slow SNR for display
-
-// Text messaging Data
-#define MAX_CALLSIGN         80
-#define MAX_EVENT_LOG        10
-#define MAX_EVENT_RULES      100
-   
-enum
-{
-    ID_ROTATE_LEFT = wxID_HIGHEST + 1,
-    ID_ROTATE_RIGHT,
-    ID_RESIZE,
-    ID_PAINT_BG
-};
-
-// Codec 2 LPC Post Filter defaults, from codec-dev/src/quantise.c
-
-#define CODEC2_LPC_PF_GAMMA 0.5
-#define CODEC2_LPC_PF_BETA  0.2
-
-// FreeDV modes
-
-#define MODE_1400_V0_91  0   // Legacy 1400 from Dec 2012 V0.91 release with incorrect QPSK mapping
-#define MODE_1400        1   // 1400 bit/s codec, no FEC
-#define MODE_1600        2   // 1300 bit/s codec, + 300 bit/s FEC
-#define MODE_2000        3   // 1400 bit/s codec, 600 bit/s FEC on most sensitive bits, 2000 bit/s total
-#define MODE_1600_WIDE   4   // As per 2 but wide carrier spacing
-
-#define FSEP_WIDE      125
-
-#endif  //__FDMDV2_DEFINES__
diff --git a/fdmdv2/branches/0.97/src/fdmdv2_main.cpp b/fdmdv2/branches/0.97/src/fdmdv2_main.cpp
deleted file mode 100644 (file)
index 83d8b20..0000000
+++ /dev/null
@@ -1,3821 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_main.cpp
-//
-// Purpose:         FreeDV main()
-// Created:         Apr. 9, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#include "fdmdv2_main.h"
-
-#define wxUSE_FILEDLG   1
-#define wxUSE_LIBPNG    1
-#define wxUSE_LIBJPEG   1
-#define wxUSE_GIF       1
-#define wxUSE_PCX       1
-#define wxUSE_LIBTIFF   1
-
-//-------------------------------------------------------------------
-// Bunch of globals used for communication with sound card call
-// back functions
-// ------------------------------------------------------------------
-
-// Global Codec2 & modem states - just one reqd for tx & rx
-int                 g_Nc;
-int                 g_mode;
-struct CODEC2      *g_pCodec2;
-struct FDMDV       *g_pFDMDV;
-struct FDMDV_STATS  g_stats;
-float               g_pwr_scale;
-int                 g_clip;
-
-// test Frames
-int                 g_testFrames;
-int                 g_test_frame_sync_state;
-int                 g_test_frame_count;
-int                 g_total_bits;
-int                 g_total_bit_errors;
-int                 g_sz_error_pattern;
-short              *g_error_pattern;
-struct FIFO        *g_errorFifo;
-
-// time averaged magnitude spectrum used for waterfall and spectrum display
-float               g_avmag[FDMDV_NSPEC];
-
-// GUI controls that affect rx and tx processes
-int   g_SquelchActive;
-float g_SquelchLevel;
-int   g_analog;
-int   g_split;
-int   g_tx;
-float g_snr;
-bool  g_half_duplex;
-
-// sending and receiving Call Sign data
-struct FIFO         *g_txDataInFifo;
-struct VARICODE_DEC  g_varicode_dec_states;
-struct FIFO         *g_rxDataOutFifo;
-
-// tx/rx processing states
-int                 g_nRxIn = FDMDV_NOM_SAMPLES_PER_FRAME;
-int                 g_CodecBits[2*MAX_BITS_PER_FDMDV_FRAME];
-int                 g_State;
-paCallBackData     *g_rxUserdata;
-
-// FIFOs used for plotting waveforms
-struct FIFO        *g_plotDemodInFifo;
-struct FIFO        *g_plotSpeechOutFifo;
-struct FIFO        *g_plotSpeechInFifo;
-
-// Soundcard config
-int                 g_nSoundCards;
-int                 g_soundCard1InDeviceNum;
-int                 g_soundCard1OutDeviceNum;
-int                 g_soundCard1SampleRate;
-int                 g_soundCard2InDeviceNum;
-int                 g_soundCard2OutDeviceNum;
-int                 g_soundCard2SampleRate;
-
-// playing and recording from sound files
-
-SNDFILE            *g_sfPlayFile;
-bool                g_playFileToMicIn;
-bool                g_loopPlayFileToMicIn;
-int                 g_playFileToMicInEventId;
-
-SNDFILE            *g_sfRecFile;
-bool                g_recFileFromRadio;
-unsigned int        g_recFromRadioSamples;
-int                 g_recFileFromRadioEventId;
-
-SNDFILE            *g_sfPlayFileFromRadio;
-bool                g_playFileFromRadio;
-bool                g_loopPlayFileFromRadio;
-int                 g_playFileFromRadioEventId;
-
-wxWindow           *g_parent;
-
-// Click to tune rx and tx frequency offset states
-float               g_RxFreqOffsetHz;
-COMP                g_RxFreqOffsetPhaseRect;
-float               g_TxFreqOffsetHz;
-COMP                g_TxFreqOffsetPhaseRect;
-
-// experimental mutex to make sound card callbacks mutually exclusive
-// TODO: review code and see if we need this any more, as fifos should
-// now be thread safe
-
-wxMutex g_mutexProtectingCallbackData;
-
-// WxWidgets - initialize the application
-IMPLEMENT_APP(MainApp);
-
-//-------------------------------------------------------------------------
-// OnInit()
-//-------------------------------------------------------------------------
-bool MainApp::OnInit()
-{
-    if(!wxApp::OnInit())
-    {
-        return false;
-    }
-    SetVendorName(wxT("CODEC2-Project"));
-    SetAppName(wxT("FreeDV"));      // not needed, it's the default value
-
-    // DR - this is wrong define so won't be used on windows build, should be __WXMSW__
-    // So registry will be used for Win32
-#ifdef _WXMSW_
-    // Force use of file-based configuration persistance on Windows platforma
-    wxConfig *pConfig = new wxConfig();
-    wxFileConfig *pFConfig = new wxFileConfig(wxT("FreeDV"), wxT("CODEC2-Project"), wxT("FreeDV.conf"), wxT("FreeDV.conf"),  wxCONFIG_USE_LOCAL_FILE | wxCONFIG_USE_RELATIVE_PATH);
-    pConfig->Set(pFConfig);
-    pConfig->SetRecordDefaults();
-#else
-    wxConfigBase *pConfig = wxConfigBase::Get();
-    pConfig->SetRecordDefaults();
-#endif
-
-    m_rTopWindow = wxRect(0, 0, 0, 0);
-    m_strRxInAudio.Empty();
-    m_strRxOutAudio.Empty();
-    m_textVoiceInput.Empty();
-    m_textVoiceOutput.Empty();
-    m_strSampleRate.Empty();
-    m_strBitrate.Empty();
-    // Create the main application window
-    frame = new MainFrame(NULL);
-    SetTopWindow(frame);
-    // Should guarantee that the first plot tab defined is the one
-    // displayed. But it doesn't when built from command line.  Why?
-    frame->m_auiNbookCtrl->ChangeSelection(0);
-    frame->Layout();
-    frame->Show();
-    g_parent =frame;
-    return true;
-}
-
-//-------------------------------------------------------------------------
-// OnExit()
-//-------------------------------------------------------------------------
-int MainApp::OnExit()
-{
-    return 0;
-}
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class MainFrame(wxFrame* pa->ent) : TopFrame(parent)
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-MainFrame::MainFrame(wxWindow *parent) : TopFrame(parent)
-{
-    m_zoom              = 1.;
-
-    SetMinSize(wxSize(400,400));
-
-    // Init Hamlib library, but we dont start talking to any rigs yet
-
-    wxGetApp().m_hamlib = new Hamlib();
-
-    tools->AppendSeparator();
-    wxMenuItem* m_menuItemToolsConfigDelete;
-    m_menuItemToolsConfigDelete = new wxMenuItem(tools, wxID_ANY, wxString(_("&Restore defaults")) , wxT("Delete config file/keys and restore defaults"), wxITEM_NORMAL);
-    this->Connect(m_menuItemToolsConfigDelete->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::OnDeleteConfig));
-
-    tools->Append(m_menuItemToolsConfigDelete);
-
-    wxConfigBase *pConfig = wxConfigBase::Get();
-
-    // restore frame position and size
-    int x = pConfig->Read(wxT("/MainFrame/left"),       20);
-    int y = pConfig->Read(wxT("/MainFrame/top"),        20);
-    int w = pConfig->Read(wxT("/MainFrame/width"),     800);
-    int h = pConfig->Read(wxT("/MainFrame/height"),    550);
-
-    // sanitise frame position as a first pass at Win32 registry bug
-
-    printf("x = %d y = %d w = %d h = %d\n", x,y,w,h);
-    if (x < 0) x = 20;
-    if (y < 0) y = 20;
-    if (w < 0) w = 800;
-    if (h < 0) h = 550;
-
-    // note: run DebugView program to see this message under windows
-    //wxLogDebug("x = %d y = %d w = %d h = %d\n", x,y,w,h);
-    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_show_speech_in     = pConfig->Read(wxT("/MainFrame/show_speech_in"),    1);
-    wxGetApp().m_show_speech_out    = pConfig->Read(wxT("/MainFrame/show_speech_out"),   1);
-    wxGetApp().m_show_demod_in      = pConfig->Read(wxT("/MainFrame/show_demod_in"),     1);
-    wxGetApp().m_show_test_frame_errors = pConfig->Read(wxT("/MainFrame/show_test_frame_errors"),     1);
-
-    wxGetApp().m_rxNbookCtrl        = pConfig->Read(wxT("/MainFrame/rxNbookCtrl"),    (long)0);
-
-    g_SquelchActive = pConfig->Read(wxT("/Audio/SquelchActive"), 1);
-    g_SquelchLevel = pConfig->Read(wxT("/Audio/SquelchLevel"), (int)(SQ_DEFAULT_SNR*2));
-    g_SquelchLevel /= 2.0;
-
-    Move(x, y);
-    SetClientSize(w, h);
-    
-    if(wxGetApp().m_show_wf)
-    {
-        // Add Waterfall Plot window
-        m_panelWaterfall = new PlotWaterfall((wxFrame*) m_auiNbookCtrl, false, 0);
-        m_panelWaterfall->SetToolTip(_("Left click to tune, Right click to toggle mono/colour"));
-        m_auiNbookCtrl->AddPage(m_panelWaterfall, _("Waterfall"), true, wxNullBitmap);
-    }
-    if(wxGetApp().m_show_spect)
-    {
-        // Add Spectrum Plot window
-        m_panelSpectrum = new PlotSpectrum((wxFrame*) m_auiNbookCtrl, g_avmag,
-                                           FDMDV_NSPEC*((float)MAX_F_HZ/FDMDV_MAX_F_HZ));
-        m_panelSpectrum->SetToolTip(_("Left click to tune"));
-        m_auiNbookCtrl->AddPage(m_panelSpectrum, _("Spectrum"), true, wxNullBitmap);
-    }
-    if(wxGetApp().m_show_scatter)
-    {
-        // Add Scatter Plot window
-        m_panelScatter = new PlotScatter((wxFrame*) m_auiNbookCtrl);
-        m_auiNbookCtrl->AddPage(m_panelScatter, _("Scatter"), true, wxNullBitmap);
-    }
-    if(wxGetApp().m_show_demod_in)
-    {
-        // Add Demod Input window
-        m_panelDemodIn = new PlotScalar((wxFrame*) m_auiNbookCtrl, 1, WAVEFORM_PLOT_TIME, 1.0/WAVEFORM_PLOT_FS, -1, 1, 1, 0.2, "%2.1f", 0);
-        m_auiNbookCtrl->AddPage(m_panelDemodIn, _("Frm Radio"), true, wxNullBitmap);
-        g_plotDemodInFifo = fifo_create(2*WAVEFORM_PLOT_BUF);
-    }
-
-    if(wxGetApp().m_show_speech_in)
-    {
-        // Add Speech Input window
-        m_panelSpeechIn = new PlotScalar((wxFrame*) m_auiNbookCtrl, 1, WAVEFORM_PLOT_TIME, 1.0/WAVEFORM_PLOT_FS, -1, 1, 1, 0.2, "%2.1f", 0);
-        m_auiNbookCtrl->AddPage(m_panelSpeechIn, _("Frm Mic"), true, wxNullBitmap);
-        g_plotSpeechInFifo = fifo_create(2*WAVEFORM_PLOT_BUF);
-    }
-
-    if(wxGetApp().m_show_speech_out)
-    {
-        // Add Speech Output window
-        m_panelSpeechOut = new PlotScalar((wxFrame*) m_auiNbookCtrl, 1, WAVEFORM_PLOT_TIME, 1.0/WAVEFORM_PLOT_FS, -1, 1, 1, 0.2, "%2.1f", 0);
-        m_auiNbookCtrl->AddPage(m_panelSpeechOut, _("To Spkr/Hdphns"), true, wxNullBitmap);
-        g_plotSpeechOutFifo = fifo_create(2*WAVEFORM_PLOT_BUF);
-    }
-
-    if(wxGetApp().m_show_timing)
-    {
-        // Add Timing Offset window
-        m_panelTimeOffset = new PlotScalar((wxFrame*) m_auiNbookCtrl, 1, 5.0, DT, -0.5, 0.5, 1, 0.1, "%2.1f", 0);
-        m_auiNbookCtrl->AddPage(m_panelTimeOffset, L"Timing \u0394", true, wxNullBitmap);
-    }
-    if(wxGetApp().m_show_freq)
-    {
-        // Add Frequency Offset window
-        m_panelFreqOffset = new PlotScalar((wxFrame*) m_auiNbookCtrl, 1, 5.0, DT, -200, 200, 1, 50, "%3.0fHz", 0);
-        m_auiNbookCtrl->AddPage(m_panelFreqOffset, L"Frequency \u0394", true, wxNullBitmap);
-    }
-
-    if(wxGetApp().m_show_test_frame_errors)
-    {
-        // Add Test Frame Errors window
-        m_panelTestFrameErrors = new PlotScalar((wxFrame*) m_auiNbookCtrl, 2*FDMDV_NC_MAX, 30.0, DT, 0, 2*FDMDV_NC_MAX+2, 1, 1, "", 1);
-        m_auiNbookCtrl->AddPage(m_panelTestFrameErrors, L"Test Frame Errors", true, wxNullBitmap);
-    }
-
-    wxGetApp().m_framesPerBuffer = pConfig->Read(wxT("/Audio/framesPerBuffer"), PA_FPB);
-
-    g_soundCard1InDeviceNum  = pConfig->Read(wxT("/Audio/soundCard1InDeviceNum"),         -1);
-    g_soundCard1OutDeviceNum = pConfig->Read(wxT("/Audio/soundCard1OutDeviceNum"),        -1);
-    g_soundCard1SampleRate   = pConfig->Read(wxT("/Audio/soundCard1SampleRate"),          -1);
-
-    g_soundCard2InDeviceNum  = pConfig->Read(wxT("/Audio/soundCard2InDeviceNum"),         -1);
-    g_soundCard2OutDeviceNum = pConfig->Read(wxT("/Audio/soundCard2OutDeviceNum"),        -1);
-    g_soundCard2SampleRate   = pConfig->Read(wxT("/Audio/soundCard2SampleRate"),          -1);
-
-    g_nSoundCards = 0;
-    if ((g_soundCard1InDeviceNum > -1) && (g_soundCard1OutDeviceNum > -1)) {
-        g_nSoundCards = 1;
-        if ((g_soundCard2InDeviceNum > -1) && (g_soundCard2OutDeviceNum > -1))
-            g_nSoundCards = 2;
-    }
-
-    wxGetApp().m_playFileToMicInPath = pConfig->Read("/File/playFileToMicInPath",   wxT(""));
-    wxGetApp().m_recFileFromRadioPath = pConfig->Read("/File/recFileFromRadioPath", wxT(""));
-    wxGetApp().m_recFileFromRadioSecs = pConfig->Read("/File/recFileFromRadioSecs", 30);
-    wxGetApp().m_playFileFromRadioPath = pConfig->Read("/File/playFileFromRadioPath", wxT(""));
-
-    // PTT -------------------------------------------------------------------
-
-    wxGetApp().m_boolHalfDuplex     = pConfig->ReadBool(wxT("/Rig/HalfDuplex"),     true);
-    wxGetApp().m_leftChannelVoxTone = pConfig->ReadBool("/Rig/leftChannelVoxTone",  false);
-    wxGetApp().m_boolHamlibUseForPTT = pConfig->ReadBool("/Hamlib/UseForPTT", false);
-    wxGetApp().m_intHamlibRig = pConfig->ReadLong("/Hamlib/RigName", 0);
-    wxGetApp().m_strHamlibSerialPort = pConfig->Read("/Hamlib/SerialPort", "");
-    
-    wxGetApp().m_boolUseSerialPTT   = pConfig->ReadBool(wxT("/Rig/UseSerialPTT"),   false);
-    wxGetApp().m_strRigCtrlPort     = pConfig->Read(wxT("/Rig/Port"),               wxT(""));
-    wxGetApp().m_boolUseRTS         = pConfig->ReadBool(wxT("/Rig/UseRTS"),         true);
-    wxGetApp().m_boolRTSPos         = pConfig->ReadBool(wxT("/Rig/RTSPolarity"),    true);
-    wxGetApp().m_boolUseDTR         = pConfig->ReadBool(wxT("/Rig/UseDTR"),         false);
-    wxGetApp().m_boolDTRPos         = pConfig->ReadBool(wxT("/Rig/DTRPolarity"),    false);
-    com_handle = COM_HANDLE_INVALID;
-
-    // -----------------------------------------------------------------------
-
-    bool slow = false; // prevents compile error when using default bool
-    wxGetApp().m_snrSlow = pConfig->Read("/Audio/snrSlow", slow);
-
-    bool t = true;     // prevents compile error when using default bool
-    wxGetApp().m_codec2LPCPostFilterEnable     = pConfig->Read(wxT("/Filter/codec2LPCPostFilterEnable"),    t);
-    wxGetApp().m_codec2LPCPostFilterBassBoost  = pConfig->Read(wxT("/Filter/codec2LPCPostFilterBassBoost"), t);
-    wxGetApp().m_codec2LPCPostFilterGamma      = (float)pConfig->Read(wxT("/Filter/codec2LPCPostFilterGamma"),     CODEC2_LPC_PF_GAMMA*100)/100.0;
-    wxGetApp().m_codec2LPCPostFilterBeta       = (float)pConfig->Read(wxT("/Filter/codec2LPCPostFilterBeta"),      CODEC2_LPC_PF_BETA*100)/100.0;
-    //printf("main(): m_codec2LPCPostFilterBeta: %f\n", wxGetApp().m_codec2LPCPostFilterBeta);
-
-    wxGetApp().m_MicInBassFreqHz = (float)pConfig->Read(wxT("/Filter/MicInBassFreqHz"),    1);
-    wxGetApp().m_MicInBassGaindB = (float)pConfig->Read(wxT("/Filter/MicInBassGaindB"),    (long)0)/10.0;
-    wxGetApp().m_MicInTrebleFreqHz = (float)pConfig->Read(wxT("/Filter/MicInTrebleFreqHz"),    1);
-    wxGetApp().m_MicInTrebleGaindB = (float)pConfig->Read(wxT("/Filter/MicInTrebleGaindB"),    (long)0)/10.0;
-    wxGetApp().m_MicInMidFreqHz = (float)pConfig->Read(wxT("/Filter/MicInMidFreqHz"),    1);
-    wxGetApp().m_MicInMidGaindB = (float)pConfig->Read(wxT("/Filter/MicInMidGaindB"),    (long)0)/10.0;
-    wxGetApp().m_MicInMidQ = (float)pConfig->Read(wxT("/Filter/MicInMidQ"),              (long)100)/100.0;
-
-    bool f = false;
-    wxGetApp().m_MicInEQEnable = (float)pConfig->Read(wxT("/Filter/MicInEQEnable"), f);
-
-    wxGetApp().m_SpkOutBassFreqHz = (float)pConfig->Read(wxT("/Filter/SpkOutBassFreqHz"),    1);
-    wxGetApp().m_SpkOutBassGaindB = (float)pConfig->Read(wxT("/Filter/SpkOutBassGaindB"),    (long)0)/10.0;
-    wxGetApp().m_SpkOutTrebleFreqHz = (float)pConfig->Read(wxT("/Filter/SpkOutTrebleFreqHz"),    1);
-    wxGetApp().m_SpkOutTrebleGaindB = (float)pConfig->Read(wxT("/Filter/SpkOutTrebleGaindB"),    (long)0)/10.0;
-    wxGetApp().m_SpkOutMidFreqHz = (float)pConfig->Read(wxT("/Filter/SpkOutMidFreqHz"),    1);
-    wxGetApp().m_SpkOutMidGaindB = (float)pConfig->Read(wxT("/Filter/SpkOutMidGaindB"),    (long)0)/10.0;
-    wxGetApp().m_SpkOutMidQ = (float)pConfig->Read(wxT("/Filter/SpkOutMidQ"),                (long)100)/100.0;
-
-    wxGetApp().m_SpkOutEQEnable = (float)pConfig->Read(wxT("/Filter/SpkOutEQEnable"), f);
-
-    wxGetApp().m_callSign = pConfig->Read("/Data/CallSign", wxT(""));
-    wxGetApp().m_textEncoding = pConfig->Read("/Data/TextEncoding", 2);
-
-    wxGetApp().m_events = pConfig->Read("/Events/enable", f);
-    wxGetApp().m_events_spam_timer = (int)pConfig->Read(wxT("/Events/spam_timer"), 10);
-    wxGetApp().m_events_regexp_match = pConfig->Read("/Events/regexp_match", wxT("s=(.*)"));
-    wxGetApp().m_events_regexp_replace = pConfig->Read("/Events/regexp_replace", 
-                                                       wxT("curl http://qso.freedv.org/cgi-bin/onspot.cgi?s=\\1"));
-    // make sure regexp lists are terminated by a \n
-
-    if (wxGetApp().m_events_regexp_match.Last() != '\n') {
-        wxGetApp().m_events_regexp_match = wxGetApp().m_events_regexp_match+'\n';
-    }
-    if (wxGetApp().m_events_regexp_replace.Last() != '\n') {
-        wxGetApp().m_events_regexp_replace = wxGetApp().m_events_regexp_replace+'\n';
-    }
-
-    wxGetApp().m_udp_enable = (float)pConfig->Read(wxT("/UDP/enable"), f);
-    wxGetApp().m_udp_port = (int)pConfig->Read(wxT("/UDP/port"), 3000);
-
-    pConfig->SetPath(wxT("/"));
-
-//    this->Connect(m_menuItemHelpUpdates->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnHelpCheckUpdatesUI));
-    //m_togRxID->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnRxIDUI), NULL, this);
-    //m_togTxID->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnTxIDUI), NULL, this);
-    m_togBtnOnOff->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnOnOffUI), NULL, this);
-    m_togBtnSplit->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnSplitClickUI), NULL, this);
-    m_togBtnAnalog->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnAnalogClickUI), NULL, this);
-    //m_togBtnALC->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnALCClickUI), NULL, this);
-   // m_btnTogPTT->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnPTT_UI), NULL, this);
-
-    m_togBtnSplit->Disable();
-    //m_togRxID->Disable();
-    //m_togTxID->Disable();
-    m_togBtnAnalog->Disable();
-    m_btnTogPTT->Disable();
-    //m_togBtnALC->Disable();
-
-    // squelch settings
-    char sqsnr[15];
-    m_sliderSQ->SetValue((int)(g_SquelchLevel*2.0));
-    sprintf(sqsnr, "%4.1f", g_SquelchLevel);
-    wxString sqsnr_string(sqsnr);
-    m_textSQ->SetLabel(sqsnr_string);
-    m_ckboxSQ->SetValue(g_SquelchActive);
-
-    // SNR settings
-
-    m_ckboxSNR->SetValue(wxGetApp().m_snrSlow);
-    setsnrBeta(wxGetApp().m_snrSlow);
-
-#ifdef _USE_TIMER
-    Bind(wxEVT_TIMER, &MainFrame::OnTimer, this);       // ID_MY_WINDOW);
-    m_plotTimer.SetOwner(this, ID_TIMER_WATERFALL);
-    //m_panelWaterfall->Refresh();
-#endif
-
-    m_RxRunning = false;
-
-#ifdef _USE_ONIDLE
-    Connect(wxEVT_IDLE, wxIdleEventHandler(MainFrame::OnIdle), NULL, this);
-#endif //_USE_ONIDLE
-
-    g_sfPlayFile = NULL;
-    g_playFileToMicIn = false;
-    g_loopPlayFileToMicIn = false;
-
-    g_sfRecFile = NULL;
-    g_recFileFromRadio = false;
-
-    g_sfPlayFileFromRadio = NULL;
-    g_playFileFromRadio = false;
-    g_loopPlayFileFromRadio = false;
-
-    // init click-tune states
-
-    g_RxFreqOffsetHz = 0.0;
-    g_RxFreqOffsetPhaseRect.real = cos(0.0);
-    g_RxFreqOffsetPhaseRect.imag = sin(0.0);
-    m_panelWaterfall->setRxFreq(FDMDV_FCENTRE - g_RxFreqOffsetHz);
-    m_panelSpectrum->setRxFreq(FDMDV_FCENTRE - g_RxFreqOffsetHz);
-
-    g_TxFreqOffsetHz = 0.0;
-    g_TxFreqOffsetPhaseRect.real = cos(0.0);
-    g_TxFreqOffsetPhaseRect.imag = sin(0.0);
-
-    g_tx = 0;
-    g_split = 0;
-
-    // data states
-    g_txDataInFifo = fifo_create(MAX_CALLSIGN*VARICODE_MAX_BITS);
-    g_rxDataOutFifo = fifo_create(MAX_CALLSIGN*VARICODE_MAX_BITS);
-
-    sox_biquad_start();
-    golay23_init();
-
-    g_testFrames = 0;
-    g_test_frame_sync_state = 0;
-    g_total_bit_errors = 0;
-    g_total_bits = 0;
-    wxGetApp().m_testFrames = false;
-
-    m_modal = false;
-
-    // Start UDP listener thread
-
-    m_UDPThread = NULL;
-    startUDPThread();
-
-    optionsDlg = new OptionsDlg(NULL);
-    m_schedule_restore = false;
-}
-
-//-------------------------------------------------------------------------
-// ~MainFrame()
-//-------------------------------------------------------------------------
-MainFrame::~MainFrame()
-{
-    int x;
-    int y;
-    int w;
-    int h;
-
-    if (optionsDlg != NULL) {
-        delete optionsDlg;
-        optionsDlg = NULL;
-    }
-
-    stopUDPThread();
-
-    /* TOOD(Joel): the ownership of m_hamlib is probably wrong. */
-    if (wxGetApp().m_hamlib) delete wxGetApp().m_hamlib;
-
-    //MainApp *pApp = wxGetApp();
-    wxConfigBase *pConfig = wxConfigBase::Get();
-    if(pConfig)
-    {
-        if (!IsIconized()) {
-            GetClientSize(&w, &h);
-
-            // big hack - for some reason height shrinks by this much
-            // every time FreeDV runs!  I have no idea why
-
-            h += 23;
-
-            GetPosition(&x, &y);
-            printf("x = %d y = %d w = %d h = %d\n", x,y,w,h);
-            pConfig->Write(wxT("/MainFrame/left"),               (long) x);
-            pConfig->Write(wxT("/MainFrame/top"),                (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("/MainFrame/show_speech_in"),    wxGetApp().m_show_speech_in);
-        pConfig->Write(wxT("/MainFrame/show_speech_out"),   wxGetApp().m_show_speech_out);
-        pConfig->Write(wxT("/MainFrame/show_demod_in"),     wxGetApp().m_show_demod_in);
-        pConfig->Write(wxT("/MainFrame/show_test_frame_errors"), wxGetApp().m_show_test_frame_errors);
-
-        pConfig->Write(wxT("/MainFrame/rxNbookCtrl"), wxGetApp().m_rxNbookCtrl);
-
-        pConfig->Write(wxT("/Audio/SquelchActive"),         g_SquelchActive);
-        pConfig->Write(wxT("/Audio/SquelchLevel"),          (int)(g_SquelchLevel*2.0));
-
-        pConfig->Write(wxT("/Audio/framesPerBuffer"),       wxGetApp().m_framesPerBuffer);
-
-        pConfig->Write(wxT("/Audio/soundCard1InDeviceNum"),   g_soundCard1InDeviceNum);
-        pConfig->Write(wxT("/Audio/soundCard1OutDeviceNum"),  g_soundCard1OutDeviceNum);
-        pConfig->Write(wxT("/Audio/soundCard1SampleRate"),    g_soundCard1SampleRate );
-
-        pConfig->Write(wxT("/Audio/soundCard2InDeviceNum"),   g_soundCard2InDeviceNum);
-        pConfig->Write(wxT("/Audio/soundCard2OutDeviceNum"),  g_soundCard2OutDeviceNum);
-        pConfig->Write(wxT("/Audio/soundCard2SampleRate"),    g_soundCard2SampleRate );
-
-        pConfig->Write(wxT("/Rig/HalfDuplex"),              wxGetApp().m_boolHalfDuplex);
-        pConfig->Write(wxT("/Rig/leftChannelVoxTone"),      wxGetApp().m_leftChannelVoxTone);
-        pConfig->Write("/Hamlib/UseForPTT", wxGetApp().m_boolHamlibUseForPTT);
-        pConfig->Write("/Hamlib/RigName", wxGetApp().m_intHamlibRig);
-        pConfig->Write("/Hamlib/SerialPort", wxGetApp().m_strHamlibSerialPort);
-
-
-        pConfig->Write(wxT("/File/playFileToMicInPath"),    wxGetApp().m_playFileToMicInPath);
-        pConfig->Write(wxT("/File/recFileFromRadioPath"),   wxGetApp().m_recFileFromRadioPath);
-        pConfig->Write(wxT("/File/recFileFromRadioSecs"),   wxGetApp().m_recFileFromRadioSecs);
-        pConfig->Write(wxT("/File/playFileFromRadioPath"),  wxGetApp().m_playFileFromRadioPath);
-
-        pConfig->Write(wxT("/Audio/snrSlow"), wxGetApp().m_snrSlow);
-
-        pConfig->Write(wxT("/Data/CallSign"), wxGetApp().m_callSign);
-        pConfig->Write(wxT("/Data/TextEncoding"), wxGetApp().m_textEncoding);
-        pConfig->Write(wxT("/Events/enable"), wxGetApp().m_events);
-        pConfig->Write(wxT("/Events/spam_timer"), wxGetApp().m_events_spam_timer);
-        pConfig->Write(wxT("/Events/regexp_match"), wxGetApp().m_events_regexp_match);
-        pConfig->Write(wxT("/Events/regexp_replace"), wxGetApp().m_events_regexp_replace);
-        pConfig->Write(wxT("/UDP/enable"), wxGetApp().m_udp_enable);
-        pConfig->Write(wxT("/UDP/port"),  wxGetApp().m_udp_port);
-
-        pConfig->Write(wxT("/Filter/MicInEQEnable"), wxGetApp().m_MicInEQEnable);
-        pConfig->Write(wxT("/Filter/SpkOutEQEnable"), wxGetApp().m_SpkOutEQEnable);
-    }
-
-    //m_togRxID->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnRxIDUI), NULL, this);
-    //m_togTxID->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnTxIDUI), NULL, this);
-    m_togBtnOnOff->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnOnOffUI), NULL, this);
-    m_togBtnSplit->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnSplitClickUI), NULL, this);
-    m_togBtnAnalog->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnAnalogClickUI), NULL, this);
-    //m_togBtnALC->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnALCClickUI), NULL, this);
-    //m_btnTogPTT->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnPTT_UI), NULL, this);
-
-    sox_biquad_finish();
-
-    if (m_RxRunning)
-    {
-        stopRxStream();
-    }
-    if (g_sfPlayFile != NULL)
-    {
-        sf_close(g_sfPlayFile);
-        g_sfPlayFile = NULL;
-    }
-    if (g_sfRecFile != NULL)
-    {
-        sf_close(g_sfRecFile);
-        g_sfRecFile = NULL;
-    }
-#ifdef _USE_TIMER
-    if(m_plotTimer.IsRunning())
-    {
-        m_plotTimer.Stop();
-        Unbind(wxEVT_TIMER, &MainFrame::OnTimer, this);
-    }
-#endif //_USE_TIMER
-
-#ifdef _USE_ONIDLE
-    Disconnect(wxEVT_IDLE, wxIdleEventHandler(MainFrame::OnIdle), NULL, this);
-#endif // _USE_ONIDLE
-
-    delete wxConfigBase::Set((wxConfigBase *) NULL);
-}
-
-//----------------------------------------------------------------
-// closeComPort() closes the currently open com port
-//----------------------------------------------------------------
-void MainFrame::closeComPort(void)
-{
-#ifdef _WIN32
-       CloseHandle(com_handle);
-#else
-       close(com_handle);
-#endif
-       com_handle = COM_HANDLE_INVALID;
-}
-
-//----------------------------------------------------------------
-// openComPort() opens the com port specified by the string
-// ie: "COM1" on Windows or "/dev/ttyu0" on FreeBSD
-//----------------------------------------------------------------
-bool MainFrame::openComPort(const char *name)
-{
-       if(com_handle != COM_HANDLE_INVALID)
-               closeComPort();
-#ifdef _WIN32
-       {
-               COMMCONFIG CC;
-               DWORD CCsize=sizeof(CC);
-               COMMTIMEOUTS timeouts;
-               DCB     dcb;
-
-               if(GetDefaultCommConfigA(name, &CC, &CCsize)) {
-                       CC.dcb.fOutxCtsFlow             = FALSE;
-                       CC.dcb.fOutxDsrFlow             = FALSE;
-                       CC.dcb.fDtrControl              = DTR_CONTROL_DISABLE;
-                       CC.dcb.fDsrSensitivity  = FALSE;
-                       CC.dcb.fRtsControl              = RTS_CONTROL_DISABLE;
-                       SetDefaultCommConfigA(name, &CC, CCsize);
-               }
-
-               if((com_handle=CreateFileA(name
-                       ,GENERIC_READ|GENERIC_WRITE     /* Access */
-                       ,0                                                              /* Share mode */
-                       ,NULL                                                   /* Security attributes */
-                       ,OPEN_EXISTING                                  /* Create access */
-                       ,FILE_ATTRIBUTE_NORMAL                  /* File attributes */
-                       ,NULL                                                   /* Template */
-                       ))==INVALID_HANDLE_VALUE)
-                       return false;
-
-               if(GetCommTimeouts(com_handle, &timeouts)) {
-                       timeouts.ReadIntervalTimeout=MAXDWORD;
-                       timeouts.ReadTotalTimeoutMultiplier=0;
-                       timeouts.ReadTotalTimeoutConstant=0;            // No-wait read timeout
-                       timeouts.WriteTotalTimeoutMultiplier=0;
-                       timeouts.WriteTotalTimeoutConstant=5000;        // 5 seconds
-                       SetCommTimeouts(com_handle,&timeouts);
-               }
-
-               /* Force N-8-1 mode: */
-               if(GetCommState(com_handle, &dcb)==TRUE) {
-                       dcb.ByteSize            = 8;
-                       dcb.Parity                      = NOPARITY;
-                       dcb.StopBits            = ONESTOPBIT;
-                       dcb.DCBlength           = sizeof(DCB);
-                       dcb.fBinary                     = TRUE;
-                       dcb.fOutxCtsFlow        = FALSE;
-                       dcb.fOutxDsrFlow        = FALSE;
-                       dcb.fDtrControl         = DTR_CONTROL_DISABLE;
-                       dcb.fDsrSensitivity     = FALSE;
-                       dcb.fTXContinueOnXoff= TRUE;
-                       dcb.fOutX                       = FALSE;
-                       dcb.fInX                        = FALSE;
-                       dcb.fRtsControl         = RTS_CONTROL_DISABLE;
-                       dcb.fAbortOnError       = FALSE;
-                       SetCommState(com_handle, &dcb);
-               }
-       }
-#else
-       {
-               struct termios t;
-
-               if((com_handle=open(name, O_NONBLOCK|O_RDWR))==COM_HANDLE_INVALID)
-                       return false;
-
-               if(tcgetattr(com_handle, &t)==-1) {
-                       close(com_handle);
-                       com_handle = COM_HANDLE_INVALID;
-                       return false;
-               }
-
-               t.c_iflag = (
-                                         IGNBRK   /* ignore BREAK condition */
-                                       | IGNPAR   /* ignore (discard) parity errors */
-                                       );
-               t.c_oflag = 0;  /* No output processing */
-               t.c_cflag = (
-                                         CS8         /* 8 bits */
-                                       | CREAD       /* enable receiver */
-               /*
-               Fun snippet from the FreeBSD manpage:
-
-                        If CREAD is set, the receiver is enabled.  Otherwise, no character is
-                        received.  Not all hardware supports this bit.  In fact, this flag is
-                        pretty silly and if it were not part of the termios specification it
-                        would be omitted.
-               */
-                                       | CLOCAL      /* ignore modem status lines */
-                                       );
-               t.c_lflag = 0;  /* No local modes */
-               if(tcsetattr(com_handle, TCSANOW, &t)==-1) {
-                       close(com_handle);
-                       com_handle = COM_HANDLE_INVALID;
-                       return false;
-               }
-               
-       }
-#endif
-       return true;
-}
-
-#ifdef _USE_ONIDLE
-void MainFrame::OnIdle(wxIdleEvent &evt) {
-}
-#endif
-
-//----------------------------------------------------------------
-// (raise|lower)(RTS|DTR)()
-//
-// Raises/lowers the specified signal
-//----------------------------------------------------------------
-void MainFrame::raiseDTR(void)
-{
-       if(com_handle == COM_HANDLE_INVALID)
-               return;
-#ifdef _WIN32
-       EscapeCommFunction(com_handle, SETDTR);
-#else
-       {       // For C89 happiness
-               int flags = TIOCM_DTR;
-               ioctl(com_handle, TIOCMBIS, &flags);
-       }
-#endif
-}
-void MainFrame::raiseRTS(void)
-{
-       if(com_handle == COM_HANDLE_INVALID)
-               return;
-#ifdef _WIN32
-       EscapeCommFunction(com_handle, SETRTS);
-#else
-       {       // For C89 happiness
-               int flags = TIOCM_RTS;
-               ioctl(com_handle, TIOCMBIS, &flags);
-       }
-#endif
-}
-void MainFrame::lowerDTR(void)
-{
-       if(com_handle == COM_HANDLE_INVALID)
-               return;
-#ifdef _WIN32
-       EscapeCommFunction(com_handle, CLRDTR);
-#else
-       {       // For C89 happiness
-               int flags = TIOCM_DTR;
-               ioctl(com_handle, TIOCMBIC, &flags);
-       }
-#endif
-}
-void MainFrame::lowerRTS(void)
-{
-       if(com_handle == COM_HANDLE_INVALID)
-               return;
-#ifdef _WIN32
-       EscapeCommFunction(com_handle, CLRRTS);
-#else
-       {       // For C89 happiness
-               int flags = TIOCM_RTS;
-               ioctl(com_handle, TIOCMBIC, &flags);
-       }
-#endif
-}
-
-
-#ifdef _USE_TIMER
-//----------------------------------------------------------------
-// OnTimer()
-//
-// when the timer fires every DT seconds we update the GUI displays.
-// the tabs only the plot that is visible actually gets updated, this
-// keeps CPU load reasonable
-//----------------------------------------------------------------
-void MainFrame::OnTimer(wxTimerEvent &evt)
-{
-    if (m_panelWaterfall->checkDT()) {
-        m_panelWaterfall->setRxFreq(FDMDV_FCENTRE - g_RxFreqOffsetHz);
-        m_panelWaterfall->m_newdata = true;
-        m_panelWaterfall->Refresh();
-    }
-
-    m_panelSpectrum->setRxFreq(FDMDV_FCENTRE - g_RxFreqOffsetHz);
-    m_panelSpectrum->m_newdata = true;
-    m_panelSpectrum->Refresh();
-
-    m_panelScatter->add_new_samples(g_stats.rx_symbols);
-    m_panelScatter->Refresh();
-
-    // Oscilliscope type speech plots -------------------------------------------------------
-
-    short speechInPlotSamples[WAVEFORM_PLOT_BUF];
-    if (fifo_read(g_plotSpeechInFifo, speechInPlotSamples, WAVEFORM_PLOT_BUF))
-        memset(speechInPlotSamples, 0, WAVEFORM_PLOT_BUF*sizeof(short));
-    m_panelSpeechIn->add_new_short_samples(0, speechInPlotSamples, WAVEFORM_PLOT_BUF, 32767);
-    m_panelSpeechIn->Refresh();
-
-    short speechOutPlotSamples[WAVEFORM_PLOT_BUF];
-    if (fifo_read(g_plotSpeechOutFifo, speechOutPlotSamples, WAVEFORM_PLOT_BUF))
-        memset(speechOutPlotSamples, 0, WAVEFORM_PLOT_BUF*sizeof(short));
-    m_panelSpeechOut->add_new_short_samples(0, speechOutPlotSamples, WAVEFORM_PLOT_BUF, 32767);
-    m_panelSpeechOut->Refresh();
-
-    short demodInPlotSamples[WAVEFORM_PLOT_BUF];
-    if (fifo_read(g_plotDemodInFifo, demodInPlotSamples, WAVEFORM_PLOT_BUF))
-        memset(demodInPlotSamples, 0, WAVEFORM_PLOT_BUF*sizeof(short));
-    m_panelDemodIn->add_new_short_samples(0,demodInPlotSamples, WAVEFORM_PLOT_BUF, 32767);
-    m_panelDemodIn->Refresh();
-
-    // Demod states -----------------------------------------------------------------------
-
-    m_panelTimeOffset->add_new_sample(0, (float)g_stats.rx_timing/FDMDV_NOM_SAMPLES_PER_FRAME);
-    m_panelTimeOffset->Refresh();
-
-    m_panelFreqOffset->add_new_sample(0, g_stats.foff);
-    m_panelFreqOffset->Refresh();
-
-    // SNR text box and gauge ------------------------------------------------------------
-
-    // LP filter g_stats.snr_est some more to stabilise the
-    // display. g_stats.snr_est already has some low pass filtering
-    // but we need it fairly fast to activate squelch.  So we
-    // optionally perform some further filtering for the display
-    // version of SNR.  The "Slow" checkbox controls the amount of
-    // filtering.  The filtered snr also controls the squelch
-
-    g_snr = m_snrBeta*g_snr + (1.0 - m_snrBeta)*g_stats.snr_est;
-    float snr_limited = g_snr;
-
-    if (snr_limited < -9.0) snr_limited = -9.0; // stop text box overflow
-    char snr[15];
-    if (wxGetApp().m_snrSlow)
-        sprintf(snr, "%4.1f", snr_limited);
-    else
-        sprintf(snr, "%d", (int)(snr_limited+0.5)); // round to nearest dB
-    wxString snr_string(snr);
-    m_textSNR->SetLabel(snr_string);
-
-    if (snr_limited < 0.0) snr_limited = 0;
-    if (snr_limited > 20.0) snr_limited = 20.0;
-    m_gaugeSNR->SetValue((int)(snr_limited));
-
-    // Level Gauge -----------------------------------------------------------------------
-
-    float tooHighThresh;
-    if (!g_tx && m_RxRunning)
-    {
-        // receive mode - display From Radio peaks
-
-        // peak from this DT sampling period
-        int maxDemodIn = 0;
-        for(int i=0; i<WAVEFORM_PLOT_BUF; i++)
-            if (maxDemodIn < abs(demodInPlotSamples[i]))
-                maxDemodIn = abs(demodInPlotSamples[i]);
-
-        // peak from last second
-        if (maxDemodIn > m_maxLevel)
-            m_maxLevel = maxDemodIn;
-
-        tooHighThresh = FROM_RADIO_MAX;
-    }
-    else
-    {
-        // transmit mode - display From Mic peaks
-
-        // peak from this DT sampling period
-        int maxSpeechIn = 0;
-        for(int i=0; i<WAVEFORM_PLOT_BUF; i++)
-            if (maxSpeechIn < abs(speechInPlotSamples[i]))
-                maxSpeechIn = abs(speechInPlotSamples[i]);
-
-        // peak from last second
-        if (maxSpeechIn > m_maxLevel)
-            m_maxLevel = maxSpeechIn;
-
-       tooHighThresh = FROM_MIC_MAX;
-    }
-
-    // Peak Reading meter: updates peaks immediately, then slowly decays
-    int maxScaled = (int)(100.0 * ((float)m_maxLevel/32767.0));
-    m_gaugeLevel->SetValue(maxScaled);
-    if (((float)maxScaled/100) > tooHighThresh)
-        m_textLevel->SetLabel("Too High");
-    else
-        m_textLevel->SetLabel("");
-
-    m_maxLevel *= LEVEL_BETA;
-
-    // sync LED (Colours don't work on Windows) ------------------------
-
-    if (g_State) {
-        m_rbSync->SetForegroundColour( wxColour( 0, 255, 0 ) ); // green
-        m_rbSync->SetValue(true);
-    }
-    else {
-        m_rbSync->SetForegroundColour( wxColour( 255, 0, 0 ) ); // red
-        m_rbSync->SetValue(false);
-    }
-
-    // send Callsign ----------------------------------------------------
-
-    char callsign[MAX_CALLSIGN];
-    strncpy(callsign, (const char*) wxGetApp().m_callSign.mb_str(wxConvUTF8), MAX_CALLSIGN-1);
-
-    // buffer 1 txt message to senure tx data fifo doesn't "run dry"
-
-    if ((unsigned)fifo_used(g_txDataInFifo) < strlen(callsign)) {
-
-        unsigned char checksum = 0;
-        for(unsigned int i=0; i<strlen(callsign); i++)
-            checksum += callsign[i];
-        char callsign_checksum_cr[MAX_CALLSIGN+1];
-        sprintf(callsign_checksum_cr, "%s%2x", callsign, checksum);
-        //printf("callsign_checksum_cr: %s\n", callsign_checksum_cr);
-        callsign_checksum_cr[strlen(callsign)+2] = 13;
-        // varicode encode and write to tx data fifo
-
-        short varicode[MAX_CALLSIGN*VARICODE_MAX_BITS];
-        int nout = varicode_encode(varicode, callsign_checksum_cr, MAX_CALLSIGN*VARICODE_MAX_BITS, strlen(callsign)+3, wxGetApp().m_textEncoding);
-        //printf("\ntx varicode nout = %d: ", nout);
-        //for(int i=0; i<nout; i++)
-        //    printf("%d ", varicode[i]);
-        //printf("\n");
-        fifo_write(g_txDataInFifo, varicode, nout);
-        //printf("Callsign sending: %s nout: %d\n", callsign, nout);
-    }
-
-    // See if any Callsign info received --------------------------------
-
-    short ashort;
-    while (fifo_read(g_rxDataOutFifo, &ashort, 1) == 0) {
-        if ((ashort == 13) || ((m_pcallsign - m_callsign) > MAX_CALLSIGN-1)) {
-            // CR completes line
-            *m_pcallsign = 0;
-
-            // lets see if checksum is OK
-            
-            unsigned char checksum_rx = 0;
-            if (strlen(m_callsign) > 2) {
-                for(unsigned int i=0; i<strlen(m_callsign)-2; i++)
-                    checksum_rx += m_callsign[i];
-            }
-            unsigned int checksum_tx;
-            int ret = sscanf(&m_callsign[strlen(m_callsign)-2], "%2x", &checksum_tx);
-            printf("m_callsign: %s checksums: %2x %2x\n", m_callsign, checksum_tx, checksum_rx);
-
-            wxString s;
-            if (ret && (checksum_tx == checksum_rx)) {
-                m_callsign[strlen(m_callsign)-2] = 0;
-                s.Printf("%s", m_callsign);
-                m_txtCtrlCallSign->SetValue(s);
-
-                char s1[MAX_CALLSIGN];
-                sprintf(s1,"rx_txtmsg %s", m_callsign);
-                processTxtEvent(s1);
-
-                m_checksumGood++;
-                s.Printf("%d", m_checksumGood);
-                m_txtChecksumGood->SetLabel(s);              
-            }
-            else {
-                m_checksumBad++;
-                s.Printf("%d", m_checksumBad);
-                m_txtChecksumBad->SetLabel(s);              
-            }
-
-            // reset ptr to start of string
-            m_pcallsign = m_callsign;
-        }
-        else
-        {
-            *m_pcallsign++ = (char)ashort;
-        }
-    }
-
-    // Run time update of EQ filters -----------------------------------
-    if (m_newMicInFilter || m_newSpkOutFilter) {
-        g_mutexProtectingCallbackData.Lock();
-        deleteEQFilters(g_rxUserdata);
-        designEQFilters(g_rxUserdata);
-        g_mutexProtectingCallbackData.Unlock();
-        m_newMicInFilter = m_newSpkOutFilter = false;
-    }
-    g_rxUserdata->micInEQEnable = wxGetApp().m_MicInEQEnable;
-    g_rxUserdata->spkOutEQEnable = wxGetApp().m_SpkOutEQEnable;
-
-    // Test Frame Bit Error Updates ------------------------------------
-
-    // Toggle test frame mode at run time
-
-    if (!g_testFrames && wxGetApp().m_testFrames) {
-
-        // reset stats on check box off to on transition
-
-        g_test_frame_sync_state = 0;
-        g_total_bits = 0;
-        g_total_bit_errors = 0;
-    }
-    g_testFrames =  wxGetApp().m_testFrames;
-
-    if (g_State) {
-        char bits[80], errors[80], ber[80];
-
-        // update stats on main page
-
-        sprintf(bits, "Bits: %d", (int)g_total_bits); wxString bits_string(bits); m_textBits->SetLabel(bits_string);
-        sprintf(errors, "Errs: %d", (int)g_total_bit_errors); wxString errors_string(errors); m_textErrors->SetLabel(errors_string);
-        float b = (float)g_total_bit_errors/(1E-6+g_total_bits);
-        sprintf(ber, "BER: %4.3f", b); wxString ber_string(ber); m_textBER->SetLabel(ber_string);
-
-        // update error plots
-
-        short *error_pattern = new short[g_sz_error_pattern];
-
-        if (fifo_read(g_errorFifo, error_pattern, g_sz_error_pattern) == 0) {
-            int i,b;
-            for(b=0; b<g_Nc*2; b++) {
-                for(i=b; i<g_sz_error_pattern; i+= 2*g_Nc)
-                    m_panelTestFrameErrors->add_new_sample(b, b + 0.8*error_pattern[i]);
-            }
-
-            m_panelTestFrameErrors->Refresh();
-        }
-
-        delete error_pattern;
-    }
-
-    // command from UDP thread that is best processed in main thread to avoid seg faults
-
-    if (m_schedule_restore) {
-        if (IsIconized())
-            Restore();
-        m_schedule_restore = false;
-    }
-
-    // Light Spam Timer LED if at least one time is running
-
-    int i;
-    optionsDlg->SetSpamTimerLight(false);
-    for(i=0; i<MAX_EVENT_RULES; i++)
-        if (spamTimer[i].IsRunning())
-            optionsDlg->SetSpamTimerLight(true);        
-}
-
-#endif
-
-//-------------------------------------------------------------------------
-// OnCloseFrame()
-//-------------------------------------------------------------------------
-void MainFrame::OnCloseFrame(wxCloseEvent& event)
-{
-    Pa_Terminate();
-    Destroy();
-}
-
-//-------------------------------------------------------------------------
-// OnTop()
-//-------------------------------------------------------------------------
-void MainFrame::OnTop(wxCommandEvent& event)
-{
-    int style = GetWindowStyle();
-
-    if (style & wxSTAY_ON_TOP)
-    {
-        style &= ~wxSTAY_ON_TOP;
-    }
-    else
-    {
-        style |= wxSTAY_ON_TOP;
-    }
-    SetWindowStyle(style);
-}
-
-//-------------------------------------------------------------------------
-// OnDeleteConfig()
-//-------------------------------------------------------------------------
-void MainFrame::OnDeleteConfig(wxCommandEvent&)
-{
-    wxConfigBase *pConfig = wxConfigBase::Get();
-    if(pConfig->DeleteAll())
-    {
-        wxLogMessage(wxT("Config file/registry key successfully deleted."));
-
-        delete wxConfigBase::Set(NULL);
-        wxConfigBase::DontCreateOnDemand();
-    }
-    else
-    {
-        wxLogError(wxT("Deleting config file/registry key failed."));
-    }
-}
-
-//-------------------------------------------------------------------------
-// Paint()
-//-------------------------------------------------------------------------
-void MainFrame::OnPaint(wxPaintEvent& WXUNUSED(event))
-{
-    wxPaintDC dc(this);
-
-    if(GetMenuBar()->IsChecked(ID_PAINT_BG))
-    {
-        dc.Clear();
-    }
-    dc.SetUserScale(m_zoom, m_zoom);
-}
-
-//-------------------------------------------------------------------------
-// OnCmdSliderScroll()
-//-------------------------------------------------------------------------
-void MainFrame::OnCmdSliderScroll(wxScrollEvent& event)
-{
-    char sqsnr[15];
-    g_SquelchLevel = (float)m_sliderSQ->GetValue()/2.0;
-    sprintf(sqsnr, "%4.1f", g_SquelchLevel); // 0.5 dB steps
-    wxString sqsnr_string(sqsnr);
-    m_textSQ->SetLabel(sqsnr_string);
-
-    event.Skip();
-}
-
-//-------------------------------------------------------------------------
-// OnCheckSQClick()
-//-------------------------------------------------------------------------
-void MainFrame::OnCheckSQClick(wxCommandEvent& event)
-{
-    if(!g_SquelchActive)
-    {
-        g_SquelchActive = true;
-    }
-    else
-    {
-        g_SquelchActive = false;
-    }
-}
-
-void MainFrame::setsnrBeta(bool snrSlow)
-{
-    if(snrSlow)
-    {
-        m_snrBeta = 0.9; // make this closer to 1.0 to smooth SNR est further
-    }
-    else
-    {
-        m_snrBeta = 0.0; // no smoothing of SNR estimate from demodulator
-    }
-}
-
-//-------------------------------------------------------------------------
-// OnCheckSQClick()
-//-------------------------------------------------------------------------
-void MainFrame::OnCheckSNRClick(wxCommandEvent& event)
-{
-    wxGetApp().m_snrSlow = m_ckboxSNR->GetValue();
-    setsnrBeta(wxGetApp().m_snrSlow);
-    //printf("m_snrSlow: %d\n", (int)wxGetApp().m_snrSlow);
-}
-
-// check for space bar press (only when running)
-
-int MainApp::FilterEvent(wxEvent& event)
-{
-    if ((event.GetEventType() == wxEVT_KEY_DOWN) && 
-        (((wxKeyEvent&)event).GetKeyCode() == WXK_SPACE))
-        {
-            // only use space to toggle PTT if we are running and no modal dialogs (like options) up
-
-            if (frame->m_RxRunning && !frame->m_modal) {
-                if (frame->m_btnTogPTT->GetValue())
-                    frame->m_btnTogPTT->SetValue(false);
-                else
-                    frame->m_btnTogPTT->SetValue(true);
-
-                frame->togglePTT();
-
-                return true; // absorb space so we don't toggle control with focus (e.g. Start)
-
-            }
-        }
-
-    return -1;
-}
-
-//-------------------------------------------------------------------------
-// OnTogBtnPTT ()
-//-------------------------------------------------------------------------
-void MainFrame::OnTogBtnPTT (wxCommandEvent& event)
-{
-    togglePTT();
-    event.Skip();
-}
-
-void MainFrame::togglePTT(void) {
-
-    // Change tabbed page in centre panel depending on PTT state
-
-    if (g_tx)
-    {
-        // tx-> rx transition, swap to the page we were on for last rx
-        m_auiNbookCtrl->ChangeSelection(wxGetApp().m_rxNbookCtrl);
-    }
-    else
-    {
-        // rx-> tx transition, swap to Mic In page to monitor speech
-        wxGetApp().m_rxNbookCtrl = m_auiNbookCtrl->GetSelection();
-        m_auiNbookCtrl->ChangeSelection(m_auiNbookCtrl->GetPageIndex((wxWindow *)m_panelSpeechIn));
-        char e[80]; sprintf(e,"ptt"); processTxtEvent(e);
-    }
-
-    g_tx = m_btnTogPTT->GetValue();
-
-    // Hamlib PTT
-
-    if (wxGetApp().m_boolHamlibUseForPTT) {        
-        Hamlib *hamlib = wxGetApp().m_hamlib; 
-        if (wxGetApp().m_boolHamlibUseForPTT && hamlib != NULL) {
-            hamlib->ptt(g_tx);
-        }
-    }
-
-    // Serial PTT
-
-    /*  Truth table:
-
-          g_tx   RTSPos   RTS
-          -------------------
-          0      1        0
-          1      1        1
-          0      0        1
-          1      0        0
-
-          exclusive NOR
-    */
-
-    if(wxGetApp().m_boolUseSerialPTT && (com_handle != COM_HANDLE_INVALID)) {
-        if (wxGetApp().m_boolUseRTS) {
-            printf("g_tx: %d m_boolRTSPos: %d serialLine: %d\n", g_tx, wxGetApp().m_boolRTSPos, g_tx == wxGetApp().m_boolRTSPos);
-            if (g_tx == wxGetApp().m_boolRTSPos)
-                               raiseRTS();
-            else
-                               lowerRTS();
-        }
-        if (wxGetApp().m_boolUseDTR) {
-            printf("g_tx: %d m_boolDTRPos: %d serialLine: %d\n", g_tx, wxGetApp().m_boolDTRPos, g_tx == wxGetApp().m_boolDTRPos);
-            if (g_tx == wxGetApp().m_boolDTRPos)
-                               raiseDTR();
-            else
-                               lowerDTR();
-        }
-    }
-
-    // reset level gauge
-
-    m_maxLevel = 0;
-    m_textLevel->SetLabel(wxT(""));
-    m_gaugeLevel->SetValue(0);
-}
-
-//-------------------------------------------------------------------------
-// OnTogBtnRxID()
-//-------------------------------------------------------------------------
-void MainFrame::OnTogBtnRxID(wxCommandEvent& event)
-{
-    // empty any junk in rx data FIFO
-    short junk;
-    while(fifo_read(g_rxDataOutFifo,&junk,1) == 0);
-    event.Skip();
-}
-
-//-------------------------------------------------------------------------
-// OnTogBtnTxID()
-//-------------------------------------------------------------------------
-void MainFrame::OnTogBtnTxID(wxCommandEvent& event)
-{
-    event.Skip();
-}
-
-void MainFrame::OnTogBtnSplitClick(wxCommandEvent& event) {
-    if (g_split)
-        g_split = 0;
-    else
-        g_split = 1;
-    event.Skip();
-}
-
-//-------------------------------------------------------------------------
-// OnTogBtnAnalogClick()
-//-------------------------------------------------------------------------
-void MainFrame::OnTogBtnAnalogClick (wxCommandEvent& event)
-{
-    if (g_analog == 0)
-        g_analog = 1;
-    else
-        g_analog = 0;
-
-    event.Skip();
-}
-
-void MainFrame::OnCallSignReset(wxCommandEvent& event)
-{
-    m_pcallsign = m_callsign;
-    memset(m_callsign, 0, MAX_CALLSIGN);
-    wxString s;
-    s.Printf("%s", m_callsign);
-    m_txtCtrlCallSign->SetValue(s);
-    m_checksumGood = m_checksumBad = 0;
-    m_txtChecksumGood->SetLabel(_("0"));
-    m_txtChecksumBad->SetLabel(_("0"));
-}
-
-void MainFrame::OnBerReset(wxCommandEvent& event)
-{
-    g_total_bits = 0;
-    g_total_bit_errors = 0;
-}
-
-#ifdef ALC
-//-------------------------------------------------------------------------
-// OnTogBtnALCClick()
-//-------------------------------------------------------------------------
-void MainFrame::OnTogBtnALCClick(wxCommandEvent& event)
-{
-    wxMessageBox(wxT("Got Click!"), wxT("OnTogBtnALCClick"), wxOK);
-
-    event.Skip();
-}
-#endif
-
-// extra panel added to file open dialog to add loop checkbox
-MyExtraPlayFilePanel::MyExtraPlayFilePanel(wxWindow *parent): wxPanel(parent)
-{
-    m_cb = new wxCheckBox(this, -1, wxT("Loop"));
-    m_cb->SetToolTip(_("When checked file will repeat forever"));
-    m_cb->SetValue(g_loopPlayFileToMicIn);
-
-    // bug: I can't this to align right.....
-    wxBoxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
-    sizerTop->Add(m_cb, 0, wxALIGN_RIGHT, 0);
-    SetSizerAndFit(sizerTop);
-}
-
-static wxWindow* createMyExtraPlayFilePanel(wxWindow *parent)
-{
-    return new MyExtraPlayFilePanel(parent);
-}
-
-//-------------------------------------------------------------------------
-// OnPlayFileToMicIn()
-//-------------------------------------------------------------------------
-void MainFrame::OnPlayFileToMicIn(wxCommandEvent& event)
-{
-    wxUnusedVar(event);
-
-    if(g_playFileToMicIn)
-    {
-        g_mutexProtectingCallbackData.Lock();
-        g_playFileToMicIn = false;
-        sf_close(g_sfPlayFile);
-        SetStatusText(wxT(""));
-        g_mutexProtectingCallbackData.Unlock();
-    }
-    else
-    {
-        wxString    soundFile;
-        SF_INFO     sfInfo;
-
-        wxFileDialog openFileDialog(
-                                    this,
-                                    wxT("Play File to Mic In"),
-                                    wxGetApp().m_playFileToMicInPath,
-                                    wxEmptyString,
-                                    wxT("WAV and RAW files (*.wav;*.raw)|*.wav;*.raw|")
-                                    wxT("All files (*.*)|*.*"),
-                                    wxFD_OPEN | wxFD_FILE_MUST_EXIST
-                                    );
-
-        // add the loop check box
-        openFileDialog.SetExtraControlCreator(&createMyExtraPlayFilePanel);
-
-        if(openFileDialog.ShowModal() == wxID_CANCEL)
-        {
-            return;     // the user changed their mind...
-        }
-
-        wxString fileName, extension;
-        soundFile = openFileDialog.GetPath();
-        wxFileName::SplitPath(soundFile, &wxGetApp().m_playFileToMicInPath, &fileName, &extension);
-        //wxLogDebug("m_playFileToMicInPath: %s", wxGetApp().m_playFileToMicInPath);
-        sfInfo.format = 0;
-
-        if(!extension.IsEmpty())
-        {
-            extension.LowerCase();
-            if(extension == wxT("raw"))
-            {
-                sfInfo.format     = SF_FORMAT_RAW | SF_FORMAT_PCM_16;
-                sfInfo.channels   = 1;
-                sfInfo.samplerate = FS;
-            }
-        }
-        g_sfPlayFile = sf_open(soundFile, SFM_READ, &sfInfo);
-        if(g_sfPlayFile == NULL)
-        {
-            wxString strErr = sf_strerror(NULL);
-            wxMessageBox(strErr, wxT("Couldn't open sound file"), wxOK);
-            return;
-        }
-
-        wxWindow * const ctrl = openFileDialog.GetExtraControl();
-
-        // Huh?! I just copied wxWidgets-2.9.4/samples/dialogs ....
-        g_loopPlayFileToMicIn = static_cast<MyExtraPlayFilePanel*>(ctrl)->getLoopPlayFileToMicIn();
-
-        SetStatusText(wxT("Playing File: ") + fileName + wxT(" to Mic Input") , 0);
-        g_playFileToMicIn = true;
-    }
-}
-
-//-------------------------------------------------------------------------
-// OnPlayFileFromRadio()
-// This puppy "plays" a recorded file into the denmonulator input, allowing us
-// to replay off air signals.
-//-------------------------------------------------------------------------
-void MainFrame::OnPlayFileFromRadio(wxCommandEvent& event)
-{
-    wxUnusedVar(event);
-
-    printf("OnPlayFileFromRadio:: %d\n", (int)g_playFileFromRadio);
-    if (g_playFileFromRadio)
-    {
-        printf("OnPlayFileFromRadio:: Stop\n");
-        g_mutexProtectingCallbackData.Lock();
-        g_playFileFromRadio = false;
-        sf_close(g_sfPlayFileFromRadio);
-        SetStatusText(wxT(""));
-        g_mutexProtectingCallbackData.Unlock();
-    }
-    else
-    {
-        wxString    soundFile;
-        SF_INFO     sfInfo;
-
-        wxFileDialog openFileDialog(
-                                    this,
-                                    wxT("Play File - From Radio"),
-                                    wxGetApp().m_playFileFromRadioPath,
-                                    wxEmptyString,
-                                    wxT("WAV and RAW files (*.wav;*.raw)|*.wav;*.raw|")
-                                    wxT("All files (*.*)|*.*"),
-                                    wxFD_OPEN | wxFD_FILE_MUST_EXIST
-                                    );
-
-        // add the loop check box
-        openFileDialog.SetExtraControlCreator(&createMyExtraPlayFilePanel);
-
-        if(openFileDialog.ShowModal() == wxID_CANCEL)
-        {
-            return;     // the user changed their mind...
-        }
-
-        wxString fileName, extension;
-        soundFile = openFileDialog.GetPath();
-        wxFileName::SplitPath(soundFile, &wxGetApp().m_playFileFromRadioPath, &fileName, &extension);
-        //wxLogDebug("m_playFileToFromRadioPath: %s", wxGetApp().m_playFileFromRadioPath);
-        sfInfo.format = 0;
-
-        if(!extension.IsEmpty())
-        {
-            extension.LowerCase();
-            if(extension == wxT("raw"))
-            {
-                sfInfo.format     = SF_FORMAT_RAW | SF_FORMAT_PCM_16;
-                sfInfo.channels   = 1;
-                sfInfo.samplerate = FS;
-            }
-        }
-        g_sfPlayFileFromRadio = sf_open(soundFile, SFM_READ, &sfInfo);
-        if(g_sfPlayFileFromRadio == NULL)
-        {
-            wxString strErr = sf_strerror(NULL);
-            wxMessageBox(strErr, wxT("Couldn't open sound file"), wxOK);
-            return;
-        }
-
-        wxWindow * const ctrl = openFileDialog.GetExtraControl();
-
-        // Huh?! I just copied wxWidgets-2.9.4/samples/dialogs ....
-        g_loopPlayFileFromRadio = static_cast<MyExtraPlayFilePanel*>(ctrl)->getLoopPlayFileToMicIn();
-
-        SetStatusText(wxT("Playing File: ") + fileName + wxT(" into From Radio") , 0);
-        g_playFileFromRadio = true;
-    }
-}
-
-// extra panel added to file save dialog to set number of seconds to record for
-
-MyExtraRecFilePanel::MyExtraRecFilePanel(wxWindow *parent): wxPanel(parent)
-{
-    wxBoxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
-
-    wxStaticText* staticText = new wxStaticText(this, wxID_ANY, _("Seconds:"), wxDefaultPosition, wxDefaultSize, 0);
-    sizerTop->Add(staticText, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
-    m_secondsToRecord = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
-    m_secondsToRecord->SetToolTip(_("Number of seconds to record for"));
-    m_secondsToRecord->SetValue(wxString::Format(wxT("%i"), wxGetApp().m_recFileFromRadioSecs));
-    sizerTop->Add(m_secondsToRecord, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
-    SetSizerAndFit(sizerTop);
-}
-
-static wxWindow* createMyExtraRecFilePanel(wxWindow *parent)
-{
-    return new MyExtraRecFilePanel(parent);
-}
-
-//-------------------------------------------------------------------------
-// OnRecFileFromRadio()
-//-------------------------------------------------------------------------
-void MainFrame::OnRecFileFromRadio(wxCommandEvent& event)
-{
-    wxUnusedVar(event);
-
-    if (g_recFileFromRadio) {
-        printf("Stopping Record....\n");
-        g_mutexProtectingCallbackData.Lock();
-        g_recFileFromRadio = false;
-        sf_close(g_sfRecFile);
-        SetStatusText(wxT(""));
-        g_mutexProtectingCallbackData.Unlock();
-    }
-    else {
-
-        wxString    soundFile;
-        SF_INFO     sfInfo;
-
-         wxFileDialog openFileDialog(
-                                    this,
-                                    wxT("Record File From Radio"),
-                                    wxGetApp().m_recFileFromRadioPath,
-                                    wxEmptyString,
-                                    wxT("WAV and RAW files (*.wav;*.raw)|*.wav;*.raw|")
-                                    wxT("All files (*.*)|*.*"),
-                                    wxFD_SAVE
-                                    );
-
-        // add the loop check box
-        openFileDialog.SetExtraControlCreator(&createMyExtraRecFilePanel);
-
-        if(openFileDialog.ShowModal() == wxID_CANCEL)
-        {
-            return;     // the user changed their mind...
-        }
-
-        wxString fileName, extension;
-        soundFile = openFileDialog.GetPath();
-        wxFileName::SplitPath(soundFile, &wxGetApp().m_recFileFromRadioPath, &fileName, &extension);
-        wxLogDebug("m_recFileFromRadioPath: %s", wxGetApp().m_recFileFromRadioPath);
-        wxLogDebug("soundFile: %s", soundFile);
-        sfInfo.format = 0;
-
-        if(!extension.IsEmpty())
-        {
-            extension.LowerCase();
-            if(extension == wxT("raw"))
-            {
-                sfInfo.format     = SF_FORMAT_RAW | SF_FORMAT_PCM_16;
-                sfInfo.channels   = 1;
-                sfInfo.samplerate = FS;
-            }
-            else if(extension == wxT("wav"))
-            {
-                sfInfo.format     = SF_FORMAT_WAV | SF_FORMAT_PCM_16;
-                sfInfo.channels   = 1;
-                sfInfo.samplerate = FS;
-            } else {
-                wxMessageBox(wxT("Invalid file format"), wxT("Record File From Radio"), wxOK);
-                return;
-            }
-        }
-        else {
-            wxMessageBox(wxT("Invalid file format"), wxT("Record File From Radio"), wxOK);
-            return;
-        }
-
-        // Bug: on Win32 I cant read m_recFileFromRadioSecs, so have hard coded it
-#ifdef __WIN32__
-        long secs = wxGetApp().m_recFileFromRadioSecs;
-        g_recFromRadioSamples = FS*(unsigned int)secs;
-#else
-        // work out number of samples to record
-
-        wxWindow * const ctrl = openFileDialog.GetExtraControl();
-        wxString secsString = static_cast<MyExtraRecFilePanel*>(ctrl)->getSecondsToRecord();
-        wxLogDebug("test: %s secsString: %s\n", wxT("testing 123"), secsString);
-
-        long secs;
-        if (secsString.ToLong(&secs)) {
-            wxGetApp().m_recFileFromRadioSecs = (unsigned int)secs;
-            //printf(" secondsToRecord: %d\n",  (unsigned int)secs);
-            g_recFromRadioSamples = FS*(unsigned int)secs;
-            //printf("g_recFromRadioSamples: %d\n", g_recFromRadioSamples);
-        }
-        else {
-            wxMessageBox(wxT("Invalid number of Seconds"), wxT("Record File From Radio"), wxOK);
-            return;
-        }
-#endif
-
-        g_sfRecFile = sf_open(soundFile, SFM_WRITE, &sfInfo);
-        if(g_sfRecFile == NULL)
-        {
-            wxString strErr = sf_strerror(NULL);
-            wxMessageBox(strErr, wxT("Couldn't open sound file"), wxOK);
-            return;
-        }
-
-        SetStatusText(wxT("Recording File: ") + fileName + wxT(" From Radio") , 0);
-        g_recFileFromRadio = true;
-    }
-
-}
-
-//-------------------------------------------------------------------------
-// OnExit()
-//-------------------------------------------------------------------------
-void MainFrame::OnExit(wxCommandEvent& event)
-{
-    wxUnusedVar(event);
-#ifdef _USE_TIMER
-    m_plotTimer.Stop();
-#endif // _USE_TIMER
-    if(g_sfPlayFile != NULL)
-    {
-        sf_close(g_sfPlayFile);
-        g_sfPlayFile = NULL;
-    }
-    if(g_sfRecFile != NULL)
-    {
-        sf_close(g_sfRecFile);
-        g_sfRecFile = NULL;
-    }
-    if(m_RxRunning)
-    {
-        stopRxStream();
-    }
-    m_togBtnSplit->Disable();
-    //m_togRxID->Disable();
-    //m_togTxID->Disable();
-    m_togBtnAnalog->Disable();
-    //m_togBtnALC->Disable();
-    //m_btnTogPTT->Disable();
-    Pa_Terminate();
-    Destroy();
-}
-
-//-------------------------------------------------------------------------
-// OnExitClick()
-//-------------------------------------------------------------------------
-void MainFrame::OnExitClick(wxCommandEvent& event)
-{
-    OnExit(event);
-}
-
-//-------------------------------------------------------------------------
-// OnToolsAudio()
-//-------------------------------------------------------------------------
-void MainFrame::OnToolsAudio(wxCommandEvent& event)
-{
-    wxUnusedVar(event);
-    int rv = 0;
-    AudioOptsDialog *dlg = new AudioOptsDialog(NULL);
-    rv = dlg->ShowModal();
-    if(rv == wxID_OK)
-    {
-        dlg->ExchangeData(EXCHANGE_DATA_OUT);
-    }
-    delete dlg;
-}
-
-//-------------------------------------------------------------------------
-// OnToolsAudioUI()
-//-------------------------------------------------------------------------
-void MainFrame::OnToolsAudioUI(wxUpdateUIEvent& event)
-{
-    event.Enable(!m_RxRunning);
-}
-
-//-------------------------------------------------------------------------
-// OnToolsFilter()
-//-------------------------------------------------------------------------
-void MainFrame::OnToolsFilter(wxCommandEvent& event)
-{
-    wxUnusedVar(event);
-    FilterDlg *dlg = new FilterDlg(NULL, m_RxRunning, &m_newMicInFilter, &m_newSpkOutFilter);
-    dlg->ShowModal();
-    delete dlg;
-}
-
-//-------------------------------------------------------------------------
-// OnToolsOptions()
-//-------------------------------------------------------------------------
-void MainFrame::OnToolsOptions(wxCommandEvent& event)
-{
-    wxUnusedVar(event);
-    m_modal=true;
-    optionsDlg->Show();
-    m_modal=false;
-}
-
-//-------------------------------------------------------------------------
-// OnToolsOptionsUI()
-//-------------------------------------------------------------------------
-void MainFrame::OnToolsOptionsUI(wxUpdateUIEvent& event)
-{
-}
-
-//-------------------------------------------------------------------------
-// OnToolsComCfg()
-//-------------------------------------------------------------------------
-void MainFrame::OnToolsComCfg(wxCommandEvent& event)
-{
-    wxUnusedVar(event);
-
-    ComPortsDlg *dlg = new ComPortsDlg(NULL);
-
-    int rv = dlg->ShowModal();
-
-    // test Hamlib/Serial set up
-
-    if(rv == wxID_OK)
-    {
-        if (wxGetApp().m_boolHamlibUseForPTT) {
-            OpenHamlibRig();
-            wxGetApp().m_hamlib->close();
-        }
-        if (wxGetApp().m_boolUseSerialPTT) {
-            SetupSerialPort();
-            CloseSerialPort();
-        }
-    }
-
-    delete dlg;
-}
-
-//-------------------------------------------------------------------------
-// OnToolsComCfgUI()
-//-------------------------------------------------------------------------
-void MainFrame::OnToolsComCfgUI(wxUpdateUIEvent& event)
-{
-    event.Enable(!m_RxRunning);
-}
-
-//-------------------------------------------------------------------------
-// OnHelpCheckUpdates()
-//-------------------------------------------------------------------------
-void MainFrame::OnHelpCheckUpdates(wxCommandEvent& event)
-{
-    wxMessageBox("Got Click!", "OnHelpCheckUpdates", wxOK);
-    event.Skip();
-}
-
-//-------------------------------------------------------------------------
-// OnHelpCheckUpdatesUI()
-//-------------------------------------------------------------------------
-void MainFrame::OnHelpCheckUpdatesUI(wxUpdateUIEvent& event)
-{
-    event.Enable(false);
-}
-
-//-------------------------------------------------------------------------
-//OnHelpAbout()
-//-------------------------------------------------------------------------
-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
-    wxURL url(wxT("http://svn.code.sf.net/p/freetel/code/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("<h2>p/freetel/code - Revision ");
-            int startIndex = htmldata.find(s) + s.Length();
-            int endIndex = htmldata.find(wxT(": /fdmdv2</h2>"));
-            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("How much have you spent on Ham gear this year?  How did it compare to FreeDV? ")
-                wxT("FreeDV repesents an open and free future for digital voice over Ham Radio. ")
-                wxT("Please help by donating just $10 here: 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);
-
-#endif // _USE_ABOUT_DIALOG
-#ifdef USE_SIMPLE_ABOUT_DIALOG
-    wxUnusedVar(event);
-    wxAboutDialogInfo info;
-    info.SetCopyright(_("HAMLib Test"));
-    info.SetLicence(_("GPL v2 or later"));
-    info.SetDescription(_("Short description goes here"));
-    ::wxAboutBox(info);
-#endif // USE_SIMPLE_ABOUT_DIALOG
-
-}
-
-
-// Attempt to talk to rig using Hamlib
-
-bool MainFrame::OpenHamlibRig() {
-    if (wxGetApp().m_boolHamlibUseForPTT != true)
-       return false;
-    if (wxGetApp().m_intHamlibRig == 0)
-        return false;
-    if (wxGetApp().m_hamlib == NULL)
-        return false;
-
-    int rig = wxGetApp().m_intHamlibRig;
-    wxString port = wxGetApp().m_strHamlibSerialPort;
-    bool status = wxGetApp().m_hamlib->connect(rig, port.mb_str(wxConvUTF8));
-    if (status == false)
-        wxMessageBox("Couldn't connect to Radio with hamlib", wxT("About"), wxOK | wxICON_ERROR, this);
-    return status;
-} 
-
-//-------------------------------------------------------------------------
-// OnTogBtnOnOff()
-//-------------------------------------------------------------------------
-void MainFrame::OnTogBtnOnOff(wxCommandEvent& event)
-{
-    wxString startStop = m_togBtnOnOff->GetLabel();
-
-    // we are attempting to start
-
-    if (startStop.IsSameAs("Start"))
-    {
-        //
-        // Start Running -------------------------------------------------
-        //
-
-        // modify some button states when running
-
-        m_togBtnSplit->Enable();
-        //m_togRxID->Enable();
-        //m_togTxID->Enable();
-        m_togBtnAnalog->Enable();
-        m_togBtnOnOff->SetLabel(wxT("Stop"));
-        m_btnTogPTT->Enable();
-
-        m_rb1400old->Disable();
-        m_rb1600->Disable();
-        m_rb1600Wide->Disable();
-#ifdef DISABLED_FEATURE
-        m_rb1400->Disable();
-        m_rb2000->Disable();
-#endif
-        // determine what mode we are using
-
-        int codec2_mode;
-        if (m_rb1400old->GetValue()) {
-            g_mode = MODE_1400_V0_91;
-            g_Nc = 14;
-            codec2_mode = CODEC2_MODE_1400;
-        }
-
-        if (m_rb1600->GetValue()) {
-            g_mode = MODE_1600;
-            g_Nc = 16;
-            codec2_mode = CODEC2_MODE_1300;
-        }
-        if (m_rb1600Wide->GetValue()) {
-            g_mode = MODE_1600_WIDE;
-            g_Nc = 16;
-            codec2_mode = CODEC2_MODE_1300;
-        }
-#ifdef DISABLED_FEATURE
-        if (m_rb1400->GetValue()) {
-            g_mode = MODE_1400;
-            g_Nc = 14;
-            codec2_mode = CODEC2_MODE_1400;
-        }
-        if (m_rb2000->GetValue()) {
-            g_mode = MODE_2000;
-            g_Nc = 20;
-            codec2_mode = CODEC2_MODE_1400;
-        }
-        printf("g_mode: %d  Nc: %d  codec2_mode: %d\n", g_mode, g_Nc, codec2_mode);
-#endif
-
-        // init modem and codec states
-
-        g_pFDMDV  = fdmdv_create(g_Nc);
-        g_sz_error_pattern = fdmdv_error_pattern_size(g_pFDMDV);
-        g_error_pattern = (short*)malloc(g_sz_error_pattern*sizeof(short));
-        g_errorFifo = fifo_create(2*g_sz_error_pattern);
-
-        assert(g_error_pattern != NULL);
-
-        g_pCodec2 = codec2_create(codec2_mode);
-
-        if (g_mode == MODE_1400_V0_91)
-            fdmdv_use_old_qpsk_mapping(g_pFDMDV);
-        if (g_mode == MODE_1600_WIDE)
-            fdmdv_set_fsep(g_pFDMDV, FSEP_WIDE);
-
-        // adjust scatter diagram for Number of FDM carriers
-
-        m_panelScatter->setNc(g_Nc);
-
-        // scale factor for to normalise ouput power across modes
-        // note: PAPR will still be worse for higher Nc, especially in frame test mode
-
-        g_pwr_scale = sqrt((14.0+4.0)/(g_Nc+4.0));
-        g_clip = 120;
-
-        // init Codec 2 LPC Post Filter
-
-        codec2_set_lpc_post_filter(g_pCodec2,
-                                   wxGetApp().m_codec2LPCPostFilterEnable,
-                                   wxGetApp().m_codec2LPCPostFilterBassBoost,
-                                   wxGetApp().m_codec2LPCPostFilterBeta,
-                                   wxGetApp().m_codec2LPCPostFilterGamma);
-
-        g_State = 0;
-        g_snr = 0.0;
-        g_half_duplex = wxGetApp().m_boolHalfDuplex;
-
-        m_pcallsign = m_callsign;
-        m_checksumGood = m_checksumBad = 0;
-
-        m_maxLevel = 0;
-        m_textLevel->SetLabel(wxT(""));
-        m_gaugeLevel->SetValue(0);
-
-        // Init text msg decoding
-
-        varicode_decode_init(&g_varicode_dec_states, wxGetApp().m_textEncoding);      
-        //printf("m_textEncoding = %d\n", wxGetApp().m_textEncoding);
-        //printf("g_stats.snr: %f\n", g_stats.snr_est);
-
-        // attempt to start PTT ......
-        
-        if (wxGetApp().m_boolHamlibUseForPTT)
-            OpenHamlibRig();
-        if (wxGetApp().m_boolUseSerialPTT) {
-            SetupSerialPort();
-        }
-
-        // attempt to start sound cards and tx/rx processing
-
-        startRxStream();
-
-        if (m_RxRunning)
-        {
-#ifdef _USE_TIMER
-            m_plotTimer.Start(_REFRESH_TIMER_PERIOD, wxTIMER_CONTINUOUS);
-#endif // _USE_TIMER
-        }
-        char e[80]; sprintf(e,"start"); processTxtEvent(e);
-    }
-
-    // Stop was pressed or start up failed
-
-    if (startStop.IsSameAs("Stop") || !m_RxRunning ) {
-
-        //
-        // Stop Running -------------------------------------------------
-        //
-
-        optionsDlg->SetSpamTimerLight(false);
-
-#ifdef _USE_TIMER
-        m_plotTimer.Stop();
-#endif // _USE_TIMER
-
-        // ensure we are not transmitting and shut down audio processing
-
-        if (wxGetApp().m_boolHamlibUseForPTT) {
-            Hamlib *hamlib = wxGetApp().m_hamlib; 
-            if (wxGetApp().m_boolHamlibUseForPTT && hamlib != NULL) {
-                hamlib->ptt(false);
-                hamlib->close();
-            }
-        }
-
-        if (wxGetApp().m_boolUseSerialPTT)
-            CloseSerialPort();
-
-        m_btnTogPTT->SetValue(false);
-
-        stopRxStream();
-
-        // free up states
-
-        free(g_error_pattern);
-        fifo_destroy(g_errorFifo);
-        fdmdv_destroy(g_pFDMDV);
-        codec2_destroy(g_pCodec2);
-
-        m_newMicInFilter = m_newSpkOutFilter = true;
-
-        m_togBtnSplit->Disable();
-        //m_togRxID->Disable();
-        //m_togTxID->Disable();
-        m_togBtnAnalog->Disable();
-        m_btnTogPTT->Disable();
-        m_togBtnOnOff->SetLabel(wxT("Start"));
-        m_rb1400old->Enable();
-        m_rb1600->Enable();
-        m_rb1600Wide->Enable();
-#ifdef DISABLED_FEATURE
-        m_rb1400->Enable();
-        m_rb2000->Enable();
-#endif
-        char e[80]; sprintf(e,"stop"); processTxtEvent(e);
-    }
-}
-
-//-------------------------------------------------------------------------
-// stopRxStream()
-//-------------------------------------------------------------------------
-void MainFrame::stopRxStream()
-{
-    if(m_RxRunning)
-    {
-        m_RxRunning = false;
-
-        wxLogDebug("waiting for thread to stop");
-        m_txRxThread->m_run = 0;
-        m_txRxThread->Wait();
-        wxLogDebug("thread stopped");
-
-        m_rxInPa->stop();
-        m_rxInPa->streamClose();
-        delete m_rxInPa;
-        if(m_rxOutPa != m_rxInPa) {
-                       m_rxOutPa->stop();
-                       m_rxOutPa->streamClose();
-                       delete m_rxOutPa;
-               }
-
-        if (g_nSoundCards == 2) {
-            m_txInPa->stop();
-            m_txInPa->streamClose();
-            delete m_txInPa;
-            if(m_txInPa != m_txOutPa) {
-                               m_txOutPa->stop();
-                               m_txOutPa->streamClose();
-                               delete m_txOutPa;
-                       }
-        }
-
-        destroy_fifos();
-        destroy_src();
-        deleteEQFilters(g_rxUserdata);
-        delete g_rxUserdata;
-    }
-}
-
-void MainFrame::destroy_fifos(void)
-{
-    fifo_destroy(g_rxUserdata->infifo1);
-    fifo_destroy(g_rxUserdata->outfifo1);
-    fifo_destroy(g_rxUserdata->infifo2);
-    fifo_destroy(g_rxUserdata->outfifo2);
-    fifo_destroy(g_rxUserdata->rxinfifo);
-    fifo_destroy(g_rxUserdata->rxoutfifo);
-}
-
-void MainFrame::destroy_src(void)
-{
-    src_delete(g_rxUserdata->insrc1);
-    src_delete(g_rxUserdata->outsrc1);
-    src_delete(g_rxUserdata->insrc2);
-    src_delete(g_rxUserdata->outsrc2);
-}
-
-void  MainFrame::initPortAudioDevice(PortAudioWrap *pa, int inDevice, int outDevice,
-                                     int soundCard, int sampleRate, int inputChannels)
-{
-    // Note all of the wrapper functions below just set values in a
-    // portaudio struct so can't return any errors. So no need to trap
-    // any errors in this function.
-
-    // init input params
-
-    pa->setInputDevice(inDevice);
-    if(inDevice != paNoDevice) {
-               pa->setInputChannelCount(inputChannels);           // stereo input
-               pa->setInputSampleFormat(PA_SAMPLE_TYPE);
-               pa->setInputLatency(pa->getInputDefaultLowLatency());
-               pa->setInputHostApiStreamInfo(NULL);
-       }
-
-    // init output params
-
-       pa->setOutputDevice(outDevice);
-       if(outDevice != paNoDevice) {
-               pa->setOutputChannelCount(2);                      // stereo output
-               pa->setOutputSampleFormat(PA_SAMPLE_TYPE);
-               pa->setOutputLatency(pa->getOutputDefaultLowLatency());
-               pa->setOutputHostApiStreamInfo(NULL);
-       }
-
-    // init params that affect input and output
-
-    /*
-       On a good day, framesPerBuffer in callback will be PA_FPB.  It
-       was found that you don't always get framesPerBuffer exactly
-       equal PA_PFB, for example when I set PA_FPB to 960 I got
-       framesPerBuffer = 1024.
-    */
-    pa->setFramesPerBuffer(wxGetApp().m_framesPerBuffer);
-    pa->setSampleRate(sampleRate);
-    pa->setStreamFlags(paClipOff);
-}
-
-//-------------------------------------------------------------------------
-// startRxStream()
-//-------------------------------------------------------------------------
-void MainFrame::startRxStream()
-{
-    int   src_error;
-    const PaDeviceInfo *deviceInfo1 = NULL, *deviceInfo2 = NULL;
-    int   inputChannels1, inputChannels2;
-    bool  two_rx=false;
-    bool  two_tx=false;
-
-    if(!m_RxRunning) {
-        m_RxRunning = true;
-
-        if(Pa_Initialize())
-        {
-            wxMessageBox(wxT("Port Audio failed to initialize"), wxT("Pa_Initialize"), wxOK);
-        }
-
-        m_rxInPa = new PortAudioWrap();
-        if(g_soundCard1InDeviceNum != g_soundCard1OutDeviceNum)
-                       two_rx=true;
-        if(g_soundCard2InDeviceNum != g_soundCard2OutDeviceNum)
-                       two_tx=true;
-        
-        if(two_rx)
-                       m_rxOutPa = new PortAudioWrap();
-               else
-                       m_rxOutPa = m_rxInPa;
-
-        if (g_nSoundCards == 0) {
-            wxMessageBox(wxT("No Sound Cards configured, use Tools - Audio Config to configure"), wxT("Error"), wxOK);
-            delete m_rxInPa;
-            if(two_rx)
-                               delete m_rxOutPa;
-            m_RxRunning = false;
-            return;
-        }
-
-        // Init Sound card 1 ----------------------------------------------
-        // sanity check on sound card device numbers
-
-        if ((m_rxInPa->getDeviceCount() <= g_soundCard1InDeviceNum) ||
-            (m_rxOutPa->getDeviceCount() <= g_soundCard1OutDeviceNum)) {
-            wxMessageBox(wxT("Sound Card 1 not present"), wxT("Error"), wxOK);
-            delete m_rxInPa;
-            if(two_rx)
-                               delete m_rxOutPa;
-            m_RxRunning = false;
-            return;
-        }
-
-        // work out how many input channels this device supports.
-
-        deviceInfo1 = Pa_GetDeviceInfo(g_soundCard1InDeviceNum);
-        if (deviceInfo1 == NULL) {
-            wxMessageBox(wxT("Couldn't get device info from Port Audio for Sound Card 1"), wxT("Error"), wxOK);
-            delete m_rxInPa;
-            if(two_rx)
-                               delete m_rxOutPa;
-            m_RxRunning = false;
-            return;
-        }
-        if (deviceInfo1->maxInputChannels == 1)
-            inputChannels1 = 1;
-        else
-            inputChannels1 = 2;
-
-        if(two_rx) {
-            initPortAudioDevice(m_rxInPa, g_soundCard1InDeviceNum, paNoDevice, 1,
-                            g_soundCard1SampleRate, inputChannels1);
-            initPortAudioDevice(m_rxOutPa, paNoDevice, g_soundCard1OutDeviceNum, 1,
-                            g_soundCard1SampleRate, inputChannels1);
-               }
-        else
-            initPortAudioDevice(m_rxInPa, g_soundCard1InDeviceNum, g_soundCard1OutDeviceNum, 1,
-                            g_soundCard1SampleRate, inputChannels1);
-
-        // Init Sound Card 2 ------------------------------------------------
-
-        if (g_nSoundCards == 2) {
-
-            m_txInPa = new PortAudioWrap();
-            if(two_tx)
-                               m_txOutPa = new PortAudioWrap();
-                       else
-                               m_txOutPa = m_txInPa;
-
-            // sanity check on sound card device numbers
-
-            //printf("m_txInPa->getDeviceCount(): %d\n", m_txInPa->getDeviceCount());
-            //printf("g_soundCard2InDeviceNum: %d\n", g_soundCard2InDeviceNum);
-            //printf("g_soundCard2OutDeviceNum: %d\n", g_soundCard2OutDeviceNum);
-
-            if ((m_txInPa->getDeviceCount() <= g_soundCard2InDeviceNum) ||
-                (m_txOutPa->getDeviceCount() <= g_soundCard2OutDeviceNum)) {
-                wxMessageBox(wxT("Sound Card 2 not present"), wxT("Error"), wxOK);
-                delete m_rxInPa;
-                if(two_rx)
-                                       delete m_rxOutPa;
-                delete m_txInPa;
-                if(two_tx)
-                                       delete m_txOutPa;
-                m_RxRunning = false;
-                return;
-            }
-
-            deviceInfo2 = Pa_GetDeviceInfo(g_soundCard2InDeviceNum);
-            if (deviceInfo2 == NULL) {
-                wxMessageBox(wxT("Couldn't get device info from Port Audio for Sound Card 1"), wxT("Error"), wxOK);
-                delete m_rxInPa;
-                if(two_rx)
-                                       delete m_rxOutPa;
-                delete m_txInPa;
-                if(two_tx)
-                                       delete m_txOutPa;
-                m_RxRunning = false;
-                return;
-            }
-            if (deviceInfo2->maxInputChannels == 1)
-                inputChannels2 = 1;
-            else
-                inputChannels2 = 2;
-
-            if(two_tx) {
-                               initPortAudioDevice(m_txInPa, g_soundCard2InDeviceNum, paNoDevice, 2,
-                                g_soundCard2SampleRate, inputChannels2);
-                               initPortAudioDevice(m_txOutPa, paNoDevice, g_soundCard2OutDeviceNum, 2,
-                                g_soundCard2SampleRate, inputChannels2);
-                       }
-                       else
-                               initPortAudioDevice(m_txInPa, g_soundCard2InDeviceNum, g_soundCard2OutDeviceNum, 2,
-                                g_soundCard2SampleRate, inputChannels2);
-        }
-
-        // Init call back data structure ----------------------------------------------
-
-        g_rxUserdata = new paCallBackData;
-        g_rxUserdata->inputChannels1 = inputChannels1;
-        if (deviceInfo2 != NULL)
-            g_rxUserdata->inputChannels2 = inputChannels2;
-
-        // init sample rate conversion states
-
-        g_rxUserdata->insrc1 = src_new(SRC_SINC_FASTEST, 1, &src_error);
-        assert(g_rxUserdata->insrc1 != NULL);
-        g_rxUserdata->outsrc1 = src_new(SRC_SINC_FASTEST, 1, &src_error);
-        assert(g_rxUserdata->outsrc1 != NULL);
-        g_rxUserdata->insrc2 = src_new(SRC_SINC_FASTEST, 1, &src_error);
-        assert(g_rxUserdata->insrc2 != NULL);
-        g_rxUserdata->outsrc2 = src_new(SRC_SINC_FASTEST, 1, &src_error);
-        assert(g_rxUserdata->outsrc2 != NULL);
-
-        // create FIFOs used to interface between different buffer sizes
-
-        g_rxUserdata->infifo1 = fifo_create(8*N48);
-        g_rxUserdata->outfifo1 = fifo_create(8*N48);
-        g_rxUserdata->outfifo2 = fifo_create(8*N48);
-        g_rxUserdata->infifo2 = fifo_create(8*N48);
-
-        g_rxUserdata->rxinfifo = fifo_create(3 * FDMDV_NOM_SAMPLES_PER_FRAME);
-        g_rxUserdata->rxoutfifo = fifo_create(2 * codec2_samples_per_frame(g_pCodec2));
-
-        // Init Equaliser Filters ------------------------------------------------------
-
-        m_newMicInFilter = m_newSpkOutFilter = true;
-        designEQFilters(g_rxUserdata);
-        g_rxUserdata->micInEQEnable = wxGetApp().m_MicInEQEnable;
-        g_rxUserdata->spkOutEQEnable = wxGetApp().m_SpkOutEQEnable;
-
-        // otional tone in left channel to reliably trigger vox
-        
-        g_rxUserdata->leftChannelVoxTone = wxGetApp().m_leftChannelVoxTone;
-        g_rxUserdata->voxTonePhase = 0;
-
-        // Start sound card 1 ----------------------------------------------------------
-
-        m_rxInPa->setUserData(g_rxUserdata);
-        m_rxErr = m_rxInPa->setCallback(rxCallback);
-
-        m_rxErr = m_rxInPa->streamOpen();
-
-        if(m_rxErr != paNoError) {
-            wxMessageBox(wxT("Sound Card 1 Open/Setup error."), wxT("Error"), wxOK);
-                       delete m_rxInPa;
-                       if(two_rx)
-                               delete m_rxOutPa;
-                       delete m_txInPa;
-                       if(two_tx)
-                               delete m_txOutPa;
-            destroy_fifos();
-            destroy_src();
-            deleteEQFilters(g_rxUserdata);
-            delete g_rxUserdata;
-            m_RxRunning = false;
-            return;
-        }
-
-        m_rxErr = m_rxInPa->streamStart();
-        if(m_rxErr != paNoError) {
-            wxMessageBox(wxT("Sound Card 1 Stream Start Error."), wxT("Error"), wxOK);
-                       delete m_rxInPa;
-                       if(two_rx)
-                               delete m_rxOutPa;
-                       delete m_txInPa;
-                       if(two_tx)
-                               delete m_txOutPa;
-            destroy_fifos();
-            destroy_src();
-            deleteEQFilters(g_rxUserdata);
-            delete g_rxUserdata;
-            m_RxRunning = false;
-            return;
-        }
-
-               // Start separate output stream if needed
-
-               if(two_rx) {
-                       m_rxOutPa->setUserData(g_rxUserdata);
-                       m_rxErr = m_rxOutPa->setCallback(rxCallback);
-
-                       m_rxErr = m_rxOutPa->streamOpen();
-
-                       if(m_rxErr != paNoError) {
-                               wxMessageBox(wxT("Sound Card 1 Second Stream Open/Setup error."), wxT("Error"), wxOK);
-                               delete m_rxInPa;
-                               delete m_rxOutPa;
-                               delete m_txOutPa;
-                               if(two_tx)
-                                       delete m_txOutPa;
-                               destroy_fifos();
-                               destroy_src();
-                               deleteEQFilters(g_rxUserdata);
-                               delete g_rxUserdata;
-                               m_RxRunning = false;
-                               return;
-                       }
-
-                       m_rxErr = m_rxOutPa->streamStart();
-                       if(m_rxErr != paNoError) {
-                               wxMessageBox(wxT("Sound Card 1 Second Stream Start Error."), wxT("Error"), wxOK);
-                               m_rxInPa->stop();
-                               m_rxInPa->streamClose();
-                               delete m_rxInPa;
-                               delete m_rxOutPa;
-                               delete m_txOutPa;
-                               if(two_tx)
-                                       delete m_txOutPa;
-                               destroy_fifos();
-                               destroy_src();
-                               deleteEQFilters(g_rxUserdata);
-                               delete g_rxUserdata;
-                               m_RxRunning = false;
-                               return;
-                       }
-               }
-
-        // Start sound card 2 ----------------------------------------------------------
-
-        if (g_nSoundCards == 2) {
-
-            // question: can we use same callback data
-            // (g_rxUserdata)or both sound card callbacks?  Is there a
-            // chance of them both being called at the same time?  We
-            // could need a mutex ...
-
-            m_txInPa->setUserData(g_rxUserdata);
-            m_txErr = m_txInPa->setCallback(txCallback);
-            m_txErr = m_txInPa->streamOpen();
-
-            if(m_txErr != paNoError) {
-                fprintf(stderr, "Err: %d\n", m_txErr);
-                wxMessageBox(wxT("Sound Card 2 Open/Setup error."), wxT("Error"), wxOK);
-                m_rxInPa->stop();
-                m_rxInPa->streamClose();
-                delete m_rxInPa;
-                if(two_rx) {
-                                       m_rxOutPa->stop();
-                                       m_rxOutPa->streamClose();
-                                       delete m_rxOutPa;
-                               }
-                delete m_txInPa;
-                if(two_tx)
-                                       delete m_txOutPa;
-                destroy_fifos();
-                destroy_src();
-                deleteEQFilters(g_rxUserdata);
-                delete g_rxUserdata;
-                m_RxRunning = false;
-                return;
-            }
-            m_txErr = m_txInPa->streamStart();
-            if(m_txErr != paNoError) {
-                wxMessageBox(wxT("Sound Card 2 Start Error."), wxT("Error"), wxOK);
-                m_rxInPa->stop();
-                m_rxInPa->streamClose();
-                delete m_rxInPa;
-                if(two_rx) {
-                                       m_rxOutPa->stop();
-                                       m_rxOutPa->streamClose();
-                                       delete m_rxOutPa;
-                               }
-                delete m_txInPa;
-                if(two_tx)
-                                       delete m_txOutPa;
-                destroy_fifos();
-                destroy_src();
-                deleteEQFilters(g_rxUserdata);
-                delete g_rxUserdata;
-                m_RxRunning = false;
-                return;
-            }
-               // Start separate output stream if needed
-
-                       if (two_tx) {
-
-                               // question: can we use same callback data
-                               // (g_rxUserdata)or both sound card callbacks?  Is there a
-                               // chance of them both being called at the same time?  We
-                               // could need a mutex ...
-
-                               m_txOutPa->setUserData(g_rxUserdata);
-                               m_txErr = m_txOutPa->setCallback(txCallback);
-                               m_txErr = m_txOutPa->streamOpen();
-
-                               if(m_txErr != paNoError) {
-                                       wxMessageBox(wxT("Sound Card 2 Second Stream Open/Setup error."), wxT("Error"), wxOK);
-                                       m_rxInPa->stop();
-                                       m_rxInPa->streamClose();
-                                       delete m_rxInPa;
-                                       if(two_rx) {
-                                               m_rxOutPa->stop();
-                                               m_rxOutPa->streamClose();
-                                               delete m_rxOutPa;
-                                       }
-                                       m_txInPa->stop();
-                                       m_txInPa->streamClose();
-                                       delete m_txInPa;
-                                       delete m_txOutPa;
-                                       destroy_fifos();
-                                       destroy_src();
-                                       deleteEQFilters(g_rxUserdata);
-                                       delete g_rxUserdata;
-                                       m_RxRunning = false;
-                                       return;
-                               }
-                               m_txErr = m_txOutPa->streamStart();
-                               if(m_txErr != paNoError) {
-                                       wxMessageBox(wxT("Sound Card 2 Second Stream Start Error."), wxT("Error"), wxOK);
-                                       m_rxInPa->stop();
-                                       m_rxInPa->streamClose();
-                                       m_txInPa->stop();
-                                       m_txInPa->streamClose();
-                                       delete m_txInPa;
-                                       if(two_rx) {
-                                               m_rxOutPa->stop();
-                                               m_rxOutPa->streamClose();
-                                               delete m_rxOutPa;
-                                       }
-                                       delete m_txInPa;
-                                       delete m_txOutPa;
-                                       destroy_fifos();
-                                       destroy_src();
-                                       deleteEQFilters(g_rxUserdata);
-                                       delete g_rxUserdata;
-                                       m_RxRunning = false;
-                                       return;
-                               }
-                       }
-        }
-
-        // start tx/rx processing thread
-
-        m_txRxThread = new txRxThread;
-
-        if ( m_txRxThread->Create() != wxTHREAD_NO_ERROR )
-        {
-            wxLogError(wxT("Can't create thread!"));
-        }
-
-        m_txRxThread->SetPriority(WXTHREAD_MAX_PRIORITY);
-
-        if ( m_txRxThread->Run() != wxTHREAD_NO_ERROR )
-        {
-            wxLogError(wxT("Can't start thread!"));
-        }
-    }
-}
-
-
-void MainFrame::processTxtEvent(char event[]) {
-    int rule = 0;
-
-    printf("processTxtEvent:\n");
-    printf("  event: %s\n", event);
-
-    // process with regexp and issue system command
-
-    // Each regexp in our list is separated by a newline.  We want to try all of them.
-
-    wxString event_str(event);
-    int match_end, replace_end;
-    match_end = replace_end = 0;
-    wxString regexp_match_list = wxGetApp().m_events_regexp_match;
-    wxString regexp_replace_list = wxGetApp().m_events_regexp_replace;
-
-    bool found_match = false;
-
-    while (((match_end = regexp_match_list.Find('\n')) != wxNOT_FOUND) && (rule < MAX_EVENT_RULES)) {
-        //printf("match_end: %d\n", match_end);
-        if ((replace_end = regexp_replace_list.Find('\n')) != wxNOT_FOUND) {
-            //printf("replace_end = %d\n", replace_end);
-
-            // candidate match and replace regexps strings exist, so lets try them
-
-            wxString regexp_match = regexp_match_list.SubString(0, match_end-1);
-            wxString regexp_replace = regexp_replace_list.SubString(0, replace_end-1);
-            //printf("match: %s replace: %s\n", (const char *)regexp_match.c_str(), (const char *)regexp_replace.c_str());
-            wxRegEx re(regexp_match);
-            printf("  checking for match against: %s\n", (const char *)regexp_match.c_str());
-
-            // if we found a match, lets run the replace regexp and issue the system command
-
-            wxString event_str_rep = event_str;
-
-            if (re.Replace(&event_str_rep, regexp_replace) != 0) {
-                printf("  found match!\n");
-                found_match = true;
-
-                bool enableSystem = false;
-                if (wxGetApp().m_events)
-                    enableSystem = true;
-
-                // no syscall if spam timer still running
-
-                if (spamTimer[rule].IsRunning()) {
-                    enableSystem = false;
-                    printf("  spam timer running\n");
-                }
-
-                const char *event_out = event_str_rep.ToUTF8();
-                wxString event_out_with_return_code;
-
-                if (enableSystem) {
-                    int ret = wxExecute(event_str_rep);
-                    event_out_with_return_code.Printf(_T("%s -> returned %d"), event_out, ret);
-                    spamTimer[rule].Start((wxGetApp().m_events_spam_timer)*1000, wxTIMER_ONE_SHOT);
-                }
-                else
-                    event_out_with_return_code.Printf(_T("%s T: %d"), event_out, spamTimer[rule].IsRunning());
-
-                // update event log GUI if currently displayed
-                
-                if (optionsDlg != NULL) {                  
-                    optionsDlg->updateEventLog(wxString(event), event_out_with_return_code);                     
-                }
-            }
-        }
-        regexp_match_list = regexp_match_list.SubString(match_end+1, regexp_match_list.length());
-        regexp_replace_list = regexp_replace_list.SubString(replace_end+1, regexp_replace_list.length());
-
-        rule++;
-    }
-    if ((optionsDlg != NULL) && !found_match) {                  
-        optionsDlg->updateEventLog(wxString(event), _("<no match>"));                     
-    }
-}
-
-
-#define SBQ_MAX_ARGS 4
-
-void *MainFrame::designAnEQFilter(const char filterType[], float freqHz, float gaindB, float Q)
-{
-    char  *arg[SBQ_MAX_ARGS];
-    char   argstorage[SBQ_MAX_ARGS][80];
-    void  *sbq;
-    int    i, argc;
-
-    assert((strcmp(filterType, "bass") == 0)   ||
-           (strcmp(filterType, "treble") == 0) ||
-           (strcmp(filterType, "equalizer") == 0));
-
-    for(i=0; i<SBQ_MAX_ARGS; i++) {
-        arg[i] = &argstorage[i][0];
-        arg[i] = &argstorage[i][0];
-        arg[i] = &argstorage[i][0];
-    }
-
-    argc = 0;
-
-    if ((strcmp(filterType, "bass") == 0) || (strcmp(filterType, "treble") == 0)) {
-        sprintf(arg[argc++], "%s", filterType);
-        sprintf(arg[argc++], "%f", gaindB+1E-6);
-        sprintf(arg[argc++], "%f", freqHz);
-    }
-
-    if (strcmp(filterType, "equalizer") == 0) {
-        sprintf(arg[argc++], "%s", filterType);
-        sprintf(arg[argc++], "%f", freqHz);
-        sprintf(arg[argc++], "%f", Q);
-        sprintf(arg[argc++], "%f", gaindB+1E-6);
-    }
-
-    assert(argc <= SBQ_MAX_ARGS);
-
-    sbq = sox_biquad_create(argc-1, (const char **)arg);
-
-    return sbq;
-}
-
-void  MainFrame::designEQFilters(paCallBackData *cb)
-{
-    // init Mic In Equaliser Filters
-
-    if (m_newMicInFilter) {
-        //printf("designing new Min In filters\n");
-        cb->sbqMicInBass   = designAnEQFilter("bass", wxGetApp().m_MicInBassFreqHz, wxGetApp().m_MicInBassGaindB);
-        cb->sbqMicInTreble = designAnEQFilter("treble", wxGetApp().m_MicInTrebleFreqHz, wxGetApp().m_MicInTrebleGaindB);
-        cb->sbqMicInMid    = designAnEQFilter("equalizer", wxGetApp().m_MicInMidFreqHz, wxGetApp().m_MicInMidGaindB, wxGetApp().m_MicInMidQ);
-    }
-
-    // init Spk Out Equaliser Filters
-
-    if (m_newSpkOutFilter) {
-        //printf("designing new Spk Out filters\n");
-        //printf("designEQFilters: wxGetApp().m_SpkOutBassFreqHz: %f\n",wxGetApp().m_SpkOutBassFreqHz);
-        cb->sbqSpkOutBass   = designAnEQFilter("bass", wxGetApp().m_SpkOutBassFreqHz, wxGetApp().m_SpkOutBassGaindB);
-        cb->sbqSpkOutTreble = designAnEQFilter("treble", wxGetApp().m_SpkOutTrebleFreqHz, wxGetApp().m_SpkOutTrebleGaindB);
-        cb->sbqSpkOutMid    = designAnEQFilter("equalizer", wxGetApp().m_SpkOutMidFreqHz, wxGetApp().m_SpkOutMidGaindB, wxGetApp().m_SpkOutMidQ);
-    }
-}
-
-void  MainFrame::deleteEQFilters(paCallBackData *cb)
-{
-    if (m_newMicInFilter) {
-        sox_biquad_destroy(cb->sbqMicInBass);
-        sox_biquad_destroy(cb->sbqMicInTreble);
-        sox_biquad_destroy(cb->sbqMicInMid);
-    }
-    if (m_newSpkOutFilter) {
-        sox_biquad_destroy(cb->sbqSpkOutBass);
-        sox_biquad_destroy(cb->sbqSpkOutTreble);
-        sox_biquad_destroy(cb->sbqSpkOutMid);
-    }
-}
-
-// returns number of output samples generated by resampling
-int resample(SRC_STATE *src,
-            short      output_short[],
-            short      input_short[],
-            int        output_sample_rate,
-            int        input_sample_rate,
-            int        length_output_short, // maximum output array length in samples
-            int        length_input_short
-            )
-{
-    SRC_DATA src_data;
-    float    input[N48*2];
-    float    output[N48*2];
-
-    assert(src != NULL);
-    assert(length_input_short <= N48*2);
-    assert(length_output_short <= N48*2);
-
-    src_short_to_float_array(input_short, input, length_input_short);
-
-    src_data.data_in = input;
-    src_data.data_out = output;
-    src_data.input_frames = length_input_short;
-    src_data.output_frames = length_output_short;
-    src_data.end_of_input = 0;
-    src_data.src_ratio = (float)output_sample_rate/input_sample_rate;
-
-    src_process(src, &src_data);
-
-    assert(src_data.output_frames_gen <= length_output_short);
-    src_float_to_short_array(output, output_short, src_data.output_frames_gen);
-
-    return src_data.output_frames_gen;
-}
-
-
-// Decimates samples using an algorithm that produces nice plots of
-// speech signals at a low sample rate.  We want a low sample rate so
-// we don't hammer the graphics system too hard.  Saves decimated data
-// to a fifo for plotting on screen.
-void resample_for_plot(struct FIFO *plotFifo, short buf[], int length)
-{
-    int decimation = FS/WAVEFORM_PLOT_FS;
-    int nSamples, sample;
-    int i, st, en, max, min;
-    short dec_samples[2*N8];
-
-    assert(length <= 2*N8);
-
-    nSamples = length/decimation;
-
-    for(sample = 0; sample < nSamples; sample += 2)
-    {
-        st = decimation*sample;
-        en = decimation*(sample+2);
-        max = min = 0;
-        for(i=st; i<en; i++ )
-        {
-            if (max < buf[i]) max = buf[i];
-            if (min > buf[i]) min = buf[i];
-        }
-        dec_samples[sample] = max;
-        dec_samples[sample+1] = min;
-    }
-    fifo_write(plotFifo, dec_samples, nSamples);
-}
-
-void txRxProcessing()
-{
-    paCallBackData  *cbData = g_rxUserdata;
-
-    // Buffers re-used by tx and rx processing
-    // signals in in48k/out48k are at a maximum sample rate of 48k, could be 44.1kHz
-    // depending on sound hardware.
-
-    short           in8k_short[2*N8];
-    short           in48k_short[2*N48];
-    short           out8k_short[2*N8];
-    short           out48k_short[2*N48];
-    int             nout;
-
-    //wxLogDebug("start infifo1: %5d outfifo1: %5d\n", fifo_n(cbData->infifo1), fifo_n(cbData->outfifo1));
-
-    //
-    //  RX side processing --------------------------------------------
-    //
-
-    // while we have enough input samples available ...
-
-    int nsam = g_soundCard1SampleRate * (float)N8/FS;
-    assert(nsam <= N48);
-    g_mutexProtectingCallbackData.Lock();
-    while (fifo_read(cbData->infifo1, in48k_short, nsam) == 0)
-    {
-        g_mutexProtectingCallbackData.Unlock();
-        unsigned int n8k;
-
-        n8k = resample(cbData->insrc1, in8k_short, in48k_short, FS, g_soundCard1SampleRate, N8, nsam);
-
-        // optionally save "from radio" signal (write demod input to file)
-        // Really useful for testing and development as it allows us
-        // to repeat tests using off air signals
-
-        g_mutexProtectingCallbackData.Lock();
-        if (g_recFileFromRadio && (g_sfRecFile != NULL)) {
-            //printf("g_recFromRadioSamples: %d  n8k: %d \n", g_recFromRadioSamples);
-            if (g_recFromRadioSamples < n8k) {
-                sf_write_short(g_sfRecFile, in8k_short, g_recFromRadioSamples);
-                wxCommandEvent event( wxEVT_COMMAND_MENU_SELECTED, g_recFileFromRadioEventId );
-                // call stop/start record menu item, should be thread safe
-                g_parent->GetEventHandler()->AddPendingEvent( event );
-                g_recFromRadioSamples = 0;
-                //printf("finished recording g_recFromRadioSamples: %d n8k: %d!\n", g_recFileFromRadio, n8k);
-            }
-            else {
-                sf_write_short(g_sfRecFile, in8k_short, n8k);
-                g_recFromRadioSamples -= n8k;
-            }
-        }
-        g_mutexProtectingCallbackData.Unlock();
-
-        // optionally read "from radio" signal from file (read demod input from file)
-
-        g_mutexProtectingCallbackData.Lock();
-        if (g_playFileFromRadio && (g_sfPlayFileFromRadio != NULL)) {
-            int n = sf_read_short(g_sfPlayFileFromRadio, in8k_short, n8k);
-            if (n != N8) {
-                if (g_loopPlayFileFromRadio)
-                    sf_seek(g_sfPlayFileFromRadio, 0, SEEK_SET);
-                else {
-                    printf("playFileFromRadio finished, issuing event!\n");
-                    wxCommandEvent event( wxEVT_COMMAND_MENU_SELECTED, g_playFileFromRadioEventId );
-                    // call stop/start play menu item, should be thread safe
-                    g_parent->GetEventHandler()->AddPendingEvent( event );
-                }
-            }
-        }
-        g_mutexProtectingCallbackData.Unlock();
-
-        fifo_write(cbData->rxinfifo, in8k_short, n8k);
-        resample_for_plot(g_plotDemodInFifo, in8k_short, n8k);
-
-        per_frame_rx_processing(cbData->rxoutfifo, g_CodecBits, cbData->rxinfifo, &g_nRxIn, &g_State, g_pCodec2);
-
-        // Get some audio to send to headphones/speaker.  If out of
-        // sync or in analog mode we pass thru the "from radio" audio
-        // to the headphones/speaker.  When out of sync it's useful to
-        // hear the audio from the channel, e.g. as a tuning aid
-
-        if ((g_State == 0) || g_analog) {
-            memcpy(out8k_short, in8k_short, sizeof(short)*n8k);
-        }
-        else {
-            // we are in sync so use decoded audio
-            memset(out8k_short, 0, sizeof(short)*N8);
-            fifo_read(cbData->rxoutfifo, out8k_short, N8);
-        }
-
-        // Opional Spk Out EQ Filtering, need mutex as filter can change at run time
-        g_mutexProtectingCallbackData.Lock();
-        if (cbData->spkOutEQEnable) {
-            sox_biquad_filter(cbData->sbqSpkOutBass,   out8k_short, out8k_short, N8);
-            sox_biquad_filter(cbData->sbqSpkOutTreble, out8k_short, out8k_short, N8);
-            sox_biquad_filter(cbData->sbqSpkOutMid,    out8k_short, out8k_short, N8);
-        }
-        g_mutexProtectingCallbackData.Unlock();
-
-        // note squelch automatically disabled in analog mode
-
-        if (g_SquelchActive && (g_SquelchLevel > g_snr) && !g_analog) {
-            //printf("g_SquelchLevel: %f g_snr: %f\n", g_SquelchLevel, g_snr);
-            memset(out8k_short, 0, sizeof(short)*N8);
-        }
-
-        resample_for_plot(g_plotSpeechOutFifo, out8k_short, N8);
-
-        g_mutexProtectingCallbackData.Lock();
-        if (g_nSoundCards == 1) {
-            nout = resample(cbData->outsrc2, out48k_short, out8k_short, g_soundCard1SampleRate, FS, N48, N8);
-            fifo_write(cbData->outfifo1, out48k_short, nout);
-        }
-        else {
-            nout = resample(cbData->outsrc2, out48k_short, out8k_short, g_soundCard2SampleRate, FS, N48, N8);
-            fifo_write(cbData->outfifo2, out48k_short, nout);
-        }
-    }
-    g_mutexProtectingCallbackData.Unlock();
-
-    //
-    //  TX side processing --------------------------------------------
-    //
-
-    if ((g_nSoundCards == 2) && ((g_half_duplex && g_tx) || !g_half_duplex)) {
-
-        // Make sure we have at least 6 frames of modulator output
-        // samples.  This also locks the modulator to the sample rate
-        // of sound card 1.  We want to make sure that modulator
-        // samples are uninterrupted by differences in sample rate
-        // between this sound card and sound card 2.
-
-        g_mutexProtectingCallbackData.Lock();
-        while((unsigned)fifo_used(cbData->outfifo1) < 6*N48)
-        {
-            g_mutexProtectingCallbackData.Unlock();
-
-            int   nsam = g_soundCard2SampleRate * (float)codec2_samples_per_frame(g_pCodec2)/FS;
-            assert(nsam <= 2*N48);
-
-            // infifo2 is written to by another sound card so it may
-            // over or underflow, but we don't realy care.  It will
-            // just result in a short interruption in audio being fed
-            // to codec2_enc, possibly making a click every now and
-            // again in the decoded audio at the other end.
-
-            // zero speech input just in case infifo2 underflows
-            memset(in48k_short, 0, nsam*sizeof(short));
-            fifo_read(cbData->infifo2, in48k_short, nsam);
-
-            nout = resample(cbData->insrc2, in8k_short, in48k_short, FS, g_soundCard2SampleRate, 2*N8, nsam);
-
-            // optionally use file for mic input signal
-
-            g_mutexProtectingCallbackData.Lock();
-            if (g_playFileToMicIn && (g_sfPlayFile != NULL)) {
-                int n = sf_read_short(g_sfPlayFile, in8k_short, nout);
-                if (n != nout) {
-                    if (g_loopPlayFileToMicIn)
-                        sf_seek(g_sfPlayFile, 0, SEEK_SET);
-                    else {
-                        wxCommandEvent event( wxEVT_COMMAND_MENU_SELECTED, g_playFileToMicInEventId );
-                        // call stop/start play menu item, should be thread safe
-                        g_parent->GetEventHandler()->AddPendingEvent( event );
-                    }
-                }
-            }
-            g_mutexProtectingCallbackData.Unlock();
-
-            // Optional Mic In EQ Filtering, need mutex as filter can change at run time
-            g_mutexProtectingCallbackData.Lock();
-            if (cbData->micInEQEnable) {
-                sox_biquad_filter(cbData->sbqMicInBass, in8k_short, in8k_short, nout);
-                sox_biquad_filter(cbData->sbqMicInTreble, in8k_short, in8k_short, nout);
-                sox_biquad_filter(cbData->sbqMicInMid, in8k_short, in8k_short, nout);
-            }
-            g_mutexProtectingCallbackData.Unlock();
-
-            resample_for_plot(g_plotSpeechInFifo, in8k_short, nout);
-
-            if (g_analog) {
-
-                // Boost the "from mic" -> "to radio" audio in analog
-                // mode.  The need for the gain was found by
-                // experiment - analog SSB sounded too quiet compared
-                // to digital. With digital voice we generally drive
-                // the "to radio" (SSB radio mic input) at about 25%
-                // of the peak level for normal SSB voice. So we
-                // introduce 6dB gain to make analog SSB sound the
-                // same level as the digital.  Watch out for clipping.
-                for(int i=0; i<2*N8; i++) {
-                    float out = (float)in8k_short[i]*2.0;
-                    if (out > 32767) out = 32767.0;
-                    if (out < -32767) out = -32767.0;
-                    out8k_short[i] = out;
-                }
-            }
-            else
-                per_frame_tx_processing(out8k_short, in8k_short, g_pCodec2);
-
-            // output 40ms of modem tone
-            nout = resample(cbData->outsrc1, out48k_short, out8k_short, g_soundCard1SampleRate, FS, 2*N48, 2*N8);
-            g_mutexProtectingCallbackData.Lock();
-            fifo_write(cbData->outfifo1, out48k_short, nout);
-        }
-        g_mutexProtectingCallbackData.Unlock();
-    }
-    //wxLogDebug("  end infifo1: %5d outfifo1: %5d\n", fifo_n(cbData->infifo1), fifo_n(cbData->outfifo1));
-}
-
-//-------------------------------------------------------------------------
-// rxCallback()
-//-------------------------------------------------------------------------
-int MainFrame::rxCallback(
-                            const void      *inputBuffer,
-                            void            *outputBuffer,
-                            unsigned long   framesPerBuffer,
-                            const PaStreamCallbackTimeInfo* timeInfo,
-                            PaStreamCallbackFlags statusFlags,
-                            void            *userData
-                         )
-{
-    paCallBackData  *cbData = (paCallBackData*)userData;
-    short           *rptr    = (short*)inputBuffer;
-    short           *wptr    = (short*)outputBuffer;
-
-    short           indata[MAX_FPB];
-    short           outdata[MAX_FPB];
-
-    unsigned int    i;
-
-    (void) timeInfo;
-    (void) statusFlags;
-
-    wxMutexLocker lock(g_mutexProtectingCallbackData);
-
-    //if (statusFlags)
-    //    printf("cb1 statusFlags: 0x%x\n", (int)statusFlags);
-
-    //
-    //  RX side processing --------------------------------------------
-    //
-
-    // assemble a mono buffer and write to FIFO
-
-    assert(framesPerBuffer < MAX_FPB);
-
-       if(rptr) {
-               for(i = 0; i < framesPerBuffer; i++, rptr += cbData->inputChannels1)
-                    indata[i] = rptr[0];                       
-               if (fifo_write(cbData->infifo1, indata, framesPerBuffer)) {
-                       //wxLogDebug("infifo1 full\n");
-               }
-       }
-
-    // OK now set up output samples for this callback
-
-       if(wptr) {
-               if (fifo_read(cbData->outfifo1, outdata, framesPerBuffer) == 0)
-               {
-                       // write signal to both channels */
-                       for(i = 0; i < framesPerBuffer; i++, wptr += 2)
-                       {
-                            if (cbData->leftChannelVoxTone) {
-                                cbData->voxTonePhase += 2.0*M_PI*VOX_TONE_FREQ/g_soundCard1SampleRate;
-                                cbData->voxTonePhase -= 2.0*M_PI*floor(cbData->voxTonePhase/(2.0*M_PI));
-                                wptr[0] = VOX_TONE_AMP*cos(cbData->voxTonePhase);                              
-                                //printf("%f %d\n", cbData->voxTonePhase, wptr[0]);
-                            }
-                            else
-                               wptr[0] = outdata[i];
-                               
-                            wptr[1] = outdata[i];
-                       }
-               }
-               else
-               {
-                       //wxLogDebug("outfifo1 empty\n");
-                       // zero output if no data available
-                       for(i = 0; i < framesPerBuffer; i++, wptr += 2)
-                       {
-                               wptr[0] = 0;
-                               wptr[1] = 0;
-                       }
-               }
-       }
-
-    return paContinue;
-}
-
-//----------------------------------------------------------------
-// per_frame_rx_processing()
-//----------------------------------------------------------------
-void per_frame_rx_processing(
-                                            FIFO    *output_fifo,   // decoded speech samples
-                                            int      codec_bits[],  // current frame of bits for decoder
-                                            FIFO    *input_fifo,    // modem samples input to demod
-                                            int     *nin,           // amount of samples demod needs for next call
-                                            int     *state,         // used to collect codec_bits[] halves
-                                            CODEC2  *c2             // Codec 2 states
-                                        )
-{
-    int                 reliable_sync_bit;
-    short               input_buf[FDMDV_MAX_SAMPLES_PER_FRAME];
-    short               output_buf[N8*2];
-    COMP                rx_fdm[FDMDV_MAX_SAMPLES_PER_FRAME];
-    COMP                rx_fdm_offset[FDMDV_MAX_SAMPLES_PER_FRAME];
-    int                 rx_bits[MAX_BITS_PER_FDMDV_FRAME];
-    unsigned char       packed_bits[MAX_BYTES_PER_CODEC_FRAME];
-    float               rx_spec[FDMDV_NSPEC];
-    int                 i;
-    int                 nin_prev;
-    int                 bit;
-    int                 byte;
-    int                 next_state;
-    int                 bits_per_fdmdv_frame, bits_per_codec_frame, bytes_per_codec_frame;
-
-    bits_per_fdmdv_frame = fdmdv_bits_per_frame(g_pFDMDV);
-    //printf(" bits_per_fdmdv_frame: %d\n", bits_per_fdmdv_frame);
-    assert(bits_per_fdmdv_frame <= MAX_BITS_PER_FDMDV_FRAME);
-    bits_per_codec_frame = codec2_bits_per_frame(c2);
-    assert(bits_per_codec_frame <= MAX_BITS_PER_CODEC_FRAME);
-    bytes_per_codec_frame = (bits_per_codec_frame+7)/8;
-    assert(bytes_per_codec_frame <= MAX_BYTES_PER_CODEC_FRAME);
-
-    //
-    //  This while loop will run the demod 0, 1 (nominal) or 2 times:
-    //
-    //  0: when tx sample clock runs faster than rx, occasionally we
-    //     will run out of samples
-    //
-    //  1: normal, run decoder once, every 2nd frame output a frame of
-    //     speech samples to D/A
-    //
-    //  2: when tx sample clock runs slower than rx, occasionally we will
-    //     have enough samples to run demod twice.
-    //
-    //  With a +/- 10 Hz sample clock difference at FS=8000Hz (+/- 1250
-    //  ppm), case 0 or 2 occured about once every 30 seconds.  This is
-    //  no problem for the decoded audio.
-    //
-
-    //printf("state: %d sync: %d nin %d \n", *state, sync_bit, *nin);
-    while (fifo_read(input_fifo, input_buf, *nin) == 0)
-    {
-        nin_prev = *nin;
-
-        // demod per frame processing
-        for(i = 0; i < *nin; i++)
-        {
-            rx_fdm[i].real = (float)input_buf[i] / FDMDV_SCALE;
-            rx_fdm[i].imag = 0.0;
-        }
-        fdmdv_freq_shift(rx_fdm_offset, rx_fdm, g_RxFreqOffsetHz,  &g_RxFreqOffsetPhaseRect, *nin);
-        fdmdv_demod(g_pFDMDV, rx_bits, &reliable_sync_bit, rx_fdm_offset, nin);
-
-        // compute rx spectrum & get demod stats, and update GUI plot data
-        fdmdv_get_rx_spectrum(g_pFDMDV, rx_spec, rx_fdm, nin_prev);
-        fdmdv_get_demod_stats(g_pFDMDV, &g_stats);
-
-        // Average rx spectrum data using a simple IIR low pass filter
-        for(i = 0; i < FDMDV_NSPEC; i++)
-        {
-            g_avmag[i] = BETA * g_avmag[i] + (1.0 - BETA) * rx_spec[i];
-        }
-
-        //
-        //   State machine to:
-        //
-        //   + Mute decoded audio when out of sync.  The demod is synced
-        //     when we are using the fine freq estimate and SNR is above
-        //     a thresh.
-        //
-        //   + Decode codec bits only if we have a 0,1 sync bit
-        //     sequence.  Collects two frames of demod bits to decode
-        //     one frame of codec bits.
-        //
-        next_state = *state;
-        switch(*state)
-        {
-            case 0:
-                // mute output audio when out of sync
-
-                for(i = 0; i < N8; i++)
-                    output_buf[i] = 0;
-                fifo_write(output_fifo, output_buf, N8);
-
-                if(g_stats.sync == 1)
-                {
-                    next_state = 1;
-                }
-                //printf("sync state: %d\n", *state);
-                break;
-
-            case 1:
-                next_state = 2;
-                if(g_stats.sync == 0)
-                {
-                    next_state = 0;
-                }
-                if (reliable_sync_bit)
-                {
-                    next_state = 1;
-                }
-
-                // first half of frame of codec bits
-                memcpy(codec_bits, rx_bits, bits_per_fdmdv_frame * sizeof(int));
-
-                break;
-
-            case 2:
-                next_state = 1;
-                if(g_stats.sync == 0)
-                {
-                    next_state = 0;
-                }
-
-                int  data_flag_index, valid;
-
-                // second half of frame of codec bits
-                memcpy(&codec_bits[bits_per_fdmdv_frame], rx_bits, bits_per_fdmdv_frame *sizeof(int));
-
-                if (g_testFrames) {
-                    int bit_errors, ntest_bits, test_frame_sync;
-
-                    // test frame processing, g_test_frame_sync will be asserted when we detect a
-                    // valid test frame.
-
-                    fdmdv_put_test_bits(g_pFDMDV, &test_frame_sync, g_error_pattern, &bit_errors, &ntest_bits, codec_bits);
-
-                    if (test_frame_sync == 1) {
-                        g_test_frame_sync_state = 1;
-                        g_test_frame_count = 0;
-                    }
-
-                    if (g_test_frame_sync_state) {
-                        if (g_test_frame_count == 0) {
-                            //printf("bit_errors: %d ntest_bits: %d\n", bit_errors, ntest_bits);
-                            g_total_bit_errors += bit_errors;
-                            g_total_bits       += ntest_bits;
-                            fifo_write(g_errorFifo, g_error_pattern, g_sz_error_pattern);
-                        }
-                        g_test_frame_count++;
-                        if (g_test_frame_count == 4)
-                            g_test_frame_count = 0;
-                    }
-
-                    fdmdv_put_test_bits(g_pFDMDV, &test_frame_sync, g_error_pattern, &bit_errors, &ntest_bits, &codec_bits[bits_per_fdmdv_frame]);
-
-                    if (test_frame_sync == 1) {
-                        g_test_frame_sync_state = 1;
-                        g_test_frame_count = 0;
-                    }
-
-                    if (g_test_frame_sync_state) {
-                        if (g_test_frame_count == 0) {
-                            //printf("bit_errors: %d ntest_bits: %d\n", bit_errors, ntest_bits);
-                            g_total_bit_errors += bit_errors;
-                            g_total_bits       += ntest_bits;
-                            fifo_write(g_errorFifo, g_error_pattern, g_sz_error_pattern);
-                        }
-                        g_test_frame_count++;
-                        if (g_test_frame_count == 4)
-                            g_test_frame_count = 0;
-                    }
-
-                    // silent audio
-
-                    for(i=0; i<2*N8; i++)
-                        output_buf[i] = 0;
-
-                }
-                else {
-                    // regular Codec 2 frame decode
-
-                    // FEC Decoding  --------------------------------------------------------------
-
-                    if (g_mode == MODE_2000) {
-                        int recd_codeword, codeword1, codeword2;
-
-                        /* decode first codeword */
-
-                        recd_codeword = 0;
-                        for(i=0; i<12; i++) {
-                            recd_codeword <<= 1;
-                            recd_codeword |= codec_bits[i];
-                        }
-                        for(i=bits_per_codec_frame; i<bits_per_codec_frame+11; i++) {
-                            recd_codeword <<= 1;
-                            recd_codeword |= codec_bits[i];
-                        }
-                        codeword1 = golay23_decode(recd_codeword);
-                        g_total_bit_errors += golay23_count_errors(recd_codeword, codeword1);
-                        g_total_bits       += 23;
-
-                        //if (codeword1 != recd_codeword)
-                        //    printf("codeword1: 0x%x  recd_codeword: 0x%x\n", codeword1,recd_codeword );
-                        //fprintf(stderr, "received codeword1: 0x%x  decoded codeword1: 0x%x\n", recd_codeword, codeword1);
-
-                        for(i=0; i<12; i++) {
-                            codec_bits[i] = codeword1 >> (22-i);
-                        }
-
-                        /* decode second codeword */
-
-                        recd_codeword = 0;
-                        for(i=12; i<24; i++) {
-                            recd_codeword <<= 1;
-                            recd_codeword |= codec_bits[i];
-                        }
-                        for(i=bits_per_codec_frame+11; i<bits_per_codec_frame+11+11; i++) {
-                            recd_codeword <<= 1;
-                            recd_codeword |= codec_bits[i];
-                        }
-                        codeword2 = golay23_decode(recd_codeword);
-                        g_total_bit_errors += golay23_count_errors(recd_codeword, codeword2);
-                        g_total_bits       += 23;
-
-                        // if (codeword2 != recd_codeword)
-                        //    printf("codeword2: 0x%x  recd_codeword: 0x%x\n", codeword2,recd_codeword );
-                        //fprintf(stderr, "received codeword2: 0x%x  decoded codeword2: 0x%x\n", recd_codeword, codeword2);
-
-                        for(i=0; i<12; i++) {
-                            codec_bits[12+i] = codeword2 >> (22-i);
-                        }
-                    }
-
-                    if ((g_mode == MODE_1600) || (g_mode == MODE_1600_WIDE)) {
-                        int recd_codeword, codeword1, j;
-
-                        recd_codeword = 0;
-                        for(i=0; i<8; i++) {
-                            recd_codeword <<= 1;
-                            recd_codeword |= codec_bits[i];
-                        }
-                        for(i=11; i<15; i++) {
-                            recd_codeword <<= 1;
-                            recd_codeword |= codec_bits[i];
-                        }
-                        for(i=bits_per_codec_frame; i<bits_per_codec_frame+11; i++) {
-                            recd_codeword <<= 1;
-                            recd_codeword |= codec_bits[i];
-                        }
-                        codeword1 = golay23_decode(recd_codeword);
-                        g_total_bit_errors += golay23_count_errors(recd_codeword, codeword1);
-                        g_total_bits       += 23;
-
-                        //if (codeword1 != recd_codeword)
-                        //    printf("codeword1: 0x%x  recd_codeword: 0x%x\n", codeword1,recd_codeword );
-                        //codeword1 = recd_codeword;
-                        //fprintf(stderr, "received codeword1: 0x%x  decoded codeword1: 0x%x\n", recd_codeword, codeword1);
-
-                        for(i=0; i<8; i++) {
-                            codec_bits[i] = (codeword1 >> (22-i)) & 0x1;
-                        }
-                        for(i=8,j=11; i<12; i++,j++) {
-                            codec_bits[j] = (codeword1 >> (22-i)) & 0x1;
-                        }
-                    }
-
-                    // extract data bit ------------------------------------------------------------
-
-                    data_flag_index = codec2_get_spare_bit_index(c2);
-                    //printf("data_flag_index: %d\n", data_flag_index);
-                    assert(data_flag_index != -1); // not supported for all rates
-
-                    short abit[2];
-                    abit[0] = codec_bits[data_flag_index];
-                    abit[1] = codec_bits[bits_per_codec_frame+11]; // use spare bit, note not FEC protected
-                    char  ascii_out;
-
-                    //printf("rx bits %d %d %d\n", abit[0], abit[1], bits_per_codec_frame+11);
-                    int n_ascii = varicode_decode(&g_varicode_dec_states, &ascii_out, abit, 1, wxGetApp().m_textEncoding);
-                    assert((n_ascii == 0) || (n_ascii == 1));
-                    if (n_ascii) {
-                        short ashort = ascii_out;
-                        fifo_write(g_rxDataOutFifo, &ashort, 1);
-                    }
-
-                    // reconstruct missing bit we steal for data bit and decode speech
-
-                    valid = codec2_rebuild_spare_bit(c2, codec_bits);
-                    assert(valid != -1);
-
-                    // pack bits, MSB received first
-
-                    bit  = 7;
-                    byte = 0;
-                    memset(packed_bits, 0,  bytes_per_codec_frame);
-                    for(i = 0; i < bits_per_codec_frame; i++)
-                        {
-                            packed_bits[byte] |= (codec_bits[i] << bit);
-                            bit--;
-                            if(bit < 0)
-                                {
-                                    bit = 7;
-                                    byte++;
-                                }
-                        }
-
-                    // add decoded speech to end of output buffer
-
-                    assert(codec2_samples_per_frame(c2) == (2*N8));
-                    codec2_decode(c2, output_buf, packed_bits);
-                }
-
-                fifo_write(output_fifo, output_buf, codec2_samples_per_frame(c2));
-
-                break;
-        }
-        //printf("state: %d next_state: %d reliable_sync_bit: %d\n", *state, next_state, reliable_sync_bit);
-        *state = next_state;
-    }
-}
-
-void per_frame_tx_processing(
-                                            short   tx_fdm_scaled[],// ouput modulated samples
-                                            short   input_buf[],    // speech sample input
-                                            CODEC2  *c2             // Codec 2 states
-                                        )
-{
-    unsigned char  packed_bits[MAX_BYTES_PER_CODEC_FRAME];
-    int            bits[2*MAX_BITS_PER_FDMDV_FRAME];
-    COMP           tx_fdm[2*FDMDV_NOM_SAMPLES_PER_FRAME];
-    COMP           tx_fdm_offset[2*FDMDV_NOM_SAMPLES_PER_FRAME];
-    int            sync_bit;
-    int            i, j, bit, byte, data_flag_index;
-    short          abit[2];
-    int            bits_per_fdmdv_frame, bits_per_codec_frame, bytes_per_codec_frame;
-
-    bits_per_fdmdv_frame = fdmdv_bits_per_frame(g_pFDMDV);
-    assert(bits_per_fdmdv_frame <= MAX_BITS_PER_FDMDV_FRAME);
-    bits_per_codec_frame = codec2_bits_per_frame(c2);
-    assert(bits_per_codec_frame <= MAX_BITS_PER_CODEC_FRAME);
-    bytes_per_codec_frame = (bits_per_codec_frame+7)/8;
-    assert(bytes_per_codec_frame <= MAX_BYTES_PER_CODEC_FRAME);
-
-    codec2_encode(c2, packed_bits, input_buf);
-
-    /* unpack bits, MSB first */
-
-    bit = 7; byte = 0;
-    for(i=0; i<bits_per_codec_frame; i++) {
-        bits[i] = (packed_bits[byte] >> bit) & 0x1;
-        bit--;
-        if (bit < 0) {
-            bit = 7;
-            byte++;
-        }
-    }
-
-    /* add data bit  ----------------------------------*/
-
-    // spare bit in frame that codec defines.  Use this 1
-    // bit/frame to send call sign data
-
-    data_flag_index = codec2_get_spare_bit_index(c2);
-    assert(data_flag_index != -1); // not supported for all rates
-
-    abit[0] = abit[1] = 0;
-    if (fifo_read(g_txDataInFifo, abit, wxGetApp().m_textEncoding) == 0) {
-        bits[data_flag_index] = abit[0];
-        bits[bits_per_codec_frame+11] = abit[1];  // spare bit that was unused in 1600 mode
-                                                  // note fast varicode must be sent two bits at a time 
-    }
-    else {
-        bits[data_flag_index] = 0;
-        bits[bits_per_codec_frame+11] = 0; 
-        printf("tx fifo empty - sending a 00!\n");
-    }
-
-    /* add FEC  ---------------------------------------*/
-
-    if (g_mode == MODE_2000) {
-        int data, codeword1, codeword2;
-
-        /* Protect first 24 bits with (23,12) Golay Code.  The first
-           24 bits are the most sensitive, as they contain the
-           pitch/energy VQ and voicing bits. This uses 56 + 11 + 11 =
-           78 bits, so we have two spare in 80 bit frame sent to
-           modem. */
-
-        /* first codeword */
-
-        data = 0;
-        for(i=0; i<12; i++) {
-            data <<= 1;
-            data |= bits[i];
-        }
-        codeword1 = golay23_encode(data);
-        //fprintf(stderr, "data1: 0x%x codeword1: 0x%x\n", data, codeword1);
-
-        /* second codeword */
-
-        data = 0;
-        for(i=12; i<24; i++) {
-            data <<= 1;
-            data |= bits[i];
-        }
-        codeword2 = golay23_encode(data);
-        //fprintf(stderr, "data: 0x%x codeword2: 0x%x\n", data, codeword2);
-
-        /* now pack output frame with parity bits at end to make them
-           as far apart as possible from the data the protect.  Parity
-           bits are LSB of the Golay codeword */
-
-        for(i=bits_per_codec_frame,j=0; i<bits_per_codec_frame+11; i++,j++) {
-            bits[i] = (codeword1 >> (10-j)) & 0x1;
-        }
-        for(j=0; i<bits_per_codec_frame+11+11; i++,j++) {
-            bits[i] = (codeword2 >> (10-j)) & 0x1;
-        }
-        assert(i <= 2*bits_per_fdmdv_frame);
-    }
-
-    if ((g_mode == MODE_1600) || (g_mode == MODE_1600_WIDE)) {
-        int data, codeword1;
-
-        /* Protect first 12 out of first 16 excitation bits with (23,12) Golay Code:
-
-           0,1,2,3: v[0]..v[3]
-           4,5,6,7: MSB of pitch
-           11,12,13,14: MSB of energy
-
-        */
-
-        data = 0;
-        for(i=0; i<8; i++) {
-            data <<= 1;
-            data |= bits[i];
-        }
-        for(i=11; i<15; i++) {
-            data <<= 1;
-            data |= bits[i];
-        }
-        data =
-        codeword1 = golay23_encode(data);
-
-        /* now pack output frame with parity bits at end to make them
-           as far apart as possible from the data they protect.  Parity
-           bits are LSB of the Golay codeword */
-
-        for(j=0,i=bits_per_codec_frame; i<bits_per_codec_frame+11; i++,j++) {
-            bits[i] = (codeword1 >> (10-j)) & 0x1;
-        }
-    }
-
-
-    /* if in test frame mode replace codec payload data with test frames */
-
-    if (g_testFrames) {
-       fdmdv_get_test_bits(g_pFDMDV, bits);
-       fdmdv_get_test_bits(g_pFDMDV, &bits[bits_per_fdmdv_frame]);
-    }
-
-    /* modulate even and odd frames */
-
-    fdmdv_mod(g_pFDMDV, tx_fdm, bits, &sync_bit);
-    assert(sync_bit == 1);
-
-    fdmdv_mod(g_pFDMDV, &tx_fdm[FDMDV_NOM_SAMPLES_PER_FRAME], &bits[bits_per_fdmdv_frame], &sync_bit);
-    assert(sync_bit == 0);
-
-    fdmdv_freq_shift(tx_fdm_offset, tx_fdm, g_TxFreqOffsetHz, &g_TxFreqOffsetPhaseRect, 2*FDMDV_NOM_SAMPLES_PER_FRAME);
-
-    /* compute scale factor to normalise tx power for all modes */
-
-    /* scale and convert to shorts */
-
-    for(i=0; i<2*FDMDV_NOM_SAMPLES_PER_FRAME; i++) {
-        float s =  tx_fdm_offset[i].real;
-        if (s > g_clip)
-            s = (float)g_clip;
-        if (s < -g_clip)
-            s = (float)-g_clip;
-        tx_fdm_scaled[i] = FDMDV_SCALE * g_pwr_scale * s;
-    }
-
-}
-
-//-------------------------------------------------------------------------
-// txCallback()
-//-------------------------------------------------------------------------
-int MainFrame::txCallback(
-                            const void *inputBuffer,
-                            void *outputBuffer,
-                            unsigned long framesPerBuffer,
-                            const PaStreamCallbackTimeInfo *outTime,
-                            PaStreamCallbackFlags statusFlags,
-                            void *userData
-                        )
-{
-    paCallBackData  *cbData = (paCallBackData*)userData;
-    unsigned int    i;
-    short           *rptr    = (short*)inputBuffer;
-    short           *wptr    = (short*)outputBuffer;
-    short           indata[MAX_FPB];
-    short           outdata[MAX_FPB];
-
-    wxMutexLocker lock(g_mutexProtectingCallbackData);
-
-    //    if (statusFlags)
-    //  printf("cb2 statusFlags: 0x%x\n", (int)statusFlags);
-
-    // assemble a mono buffer and write to FIFO
-
-    assert(framesPerBuffer < MAX_FPB);
-
-       if(rptr) {
-               for(i = 0; i < framesPerBuffer; i++, rptr += cbData->inputChannels2)
-                    indata[i] = rptr[0];                        
-       }
-
-    //#define SC2_LOOPBACK
-#ifdef SC2_LOOPBACK
-       //TODO: This doesn't work unless using the same soundcard!
-
-       if(wptr) {
-               for(i = 0; i < framesPerBuffer; i++, wptr += 2)
-               {
-                       wptr[0] = indata[i];
-                       wptr[1] = indata[i];
-               }
-       }
-
-#else
-       if(rptr)
-               fifo_write(cbData->infifo2, indata, framesPerBuffer);
-
-    // OK now set up output samples for this callback
-
-       if(wptr) {
-               if (fifo_read(cbData->outfifo2, outdata, framesPerBuffer) == 0)
-               {
-                       // write signal to both channels */
-                       for(i = 0; i < framesPerBuffer; i++, wptr += 2)
-                       {
-                            wptr[0] = outdata[i];
-                            wptr[1] = outdata[i];
-                       }
-               }
-               else
-               {
-                       // zero output if no data available
-                       for(i = 0; i < framesPerBuffer; i++, wptr += 2)
-                       {
-                               wptr[0] = 0;
-                               wptr[1] = 0;
-                       }
-               }
-       }
-#endif
-    return paContinue;
-}
-
-// Callback from plot_spectrum & plot_waterfall.  would be nice to
-// work out a way to do this without globals.
-
-void fdmdv2_clickTune(float freq) {
-
-    // The demod is hard-wired to expect a centre frequency of
-    // FDMDV_FCENTRE.  So we want to take the signal centered on the
-    // click tune freq and re-centre it on FDMDV_FCENTRE.  For example
-    // if the click tune freq is 1500Hz, and FDMDV_CENTRE is 1200 Hz,
-    // we need to shift the input signal centred on 1500Hz down to
-    // 1200Hz, an offset of -300Hz.
-
-    if (g_split) {
-        g_RxFreqOffsetHz = FDMDV_FCENTRE - freq;
-    }
-    else {
-        g_TxFreqOffsetHz = freq - FDMDV_FCENTRE;
-        g_RxFreqOffsetHz = FDMDV_FCENTRE - freq;
-    }
-}
-
-//----------------------------------------------------------------
-// SetupSerialPort()
-//----------------------------------------------------------------
-void MainFrame::SetupSerialPort(void)
-{
-    if(!wxGetApp().m_strRigCtrlPort.IsEmpty())
-    {
-        if(openComPort(wxGetApp().m_strRigCtrlPort.c_str()))
-        {
-            // always start PTT in Rx state
-            SerialPTTRx();
-        }
-        else
-        {
-            wxMessageBox("Couldn't open Serial Port", wxT("About"), wxOK | wxICON_ERROR, this);
-        }
-    }
-}
-
-void MainFrame::SerialPTTRx(void)
-{
-    printf("m_boolUseRTS: %d m_boolRTSPos: %d m_boolUseDTR: %d m_boolDTRPos: %d\n",
-           wxGetApp().m_boolUseRTS, wxGetApp().m_boolRTSPos, wxGetApp().m_boolUseDTR, wxGetApp().m_boolDTRPos);
-
-        if(wxGetApp().m_boolRTSPos) // RTS cleared LOW
-            lowerRTS();
-        else                        // RTS cleared HIGH
-            raiseRTS();
-
-        if(wxGetApp().m_boolDTRPos) // DTR cleared LOW
-            lowerDTR();
-        else                        // DTR cleared HIGH
-            raiseDTR();
-}
-
-//----------------------------------------------------------------
-// CloseSerialPort()
-//----------------------------------------------------------------
-void MainFrame::CloseSerialPort(void)
-{
-    if (com_handle != COM_HANDLE_INVALID) {
-        // always end with PTT in rx state
-
-        SerialPTTRx();
-
-               closeComPort();
-    }
-}
-
-
-//----------------------------------------------------------------
-// PollUDP() - see if any commands on UDP port
-//----------------------------------------------------------------
-
-// test this puppy with netcat: 
-//   $ echo "hello" | nc -u -q1 localhost 3000
-
-int MainFrame::PollUDP(void)
-{
-    // this will block until message received, so we put it in it's own thread
-
-    char buf[1024];
-    char reply[80];
-    size_t n = m_udp_sock->RecvFrom(m_udp_addr, buf, sizeof(buf)).LastCount();
-
-    if (n) {
-        wxString bufstr = wxString::From8BitData(buf, n);
-        bufstr.Trim();
-        wxString ipaddr = m_udp_addr.IPAddress();
-        printf("Received: \"%s\" from %s:%u\n",
-               (const char *)bufstr.c_str(),
-               (const char *)ipaddr.c_str(), m_udp_addr.Service());
-
-        // for security only accept commands from local host
-
-        sprintf(reply,"nope\n");
-        if (ipaddr.Cmp(_("127.0.0.1")) == 0) {
-
-            // process commands
-
-            if (bufstr.Cmp(_("restore")) == 0) {
-                m_schedule_restore = true;  // Make Restore happen in main thread to avoid crashing
-                sprintf(reply,"ok\n");
-            }
-                
-            wxString itemToSet, val;
-            if (bufstr.StartsWith(_("set "), &itemToSet)) {
-                if (itemToSet.StartsWith("txtmsg ", &val)) {
-                    // note: if options dialog is open this will get overwritten
-                    wxGetApp().m_callSign = val;
-                }  
-                sprintf(reply,"ok\n");
-            }
-                
-        }
-        else {
-            printf("We only accept messages from locahost!\n");
-        }
-
-       if ( m_udp_sock->SendTo(m_udp_addr, reply, strlen(reply)).LastCount() != strlen(reply)) {
-           printf("ERROR: failed to send data\n");
-        }
-    }
-
-    return n;
-}
-
-void MainFrame::startUDPThread(void) {
-    printf("starting UDP thread!\n");
-    m_UDPThread = new UDPThread;
-    m_UDPThread->mf = this;
-    if (m_UDPThread->Create() != wxTHREAD_NO_ERROR ) {
-        wxLogError(wxT("Can't create thread!"));
-    }
-    if (m_UDPThread->Run() != wxTHREAD_NO_ERROR ) {
-        wxLogError(wxT("Can't start thread!"));
-        delete m_UDPThread;
-    }
-}
-
-void MainFrame::stopUDPThread(void) {
-    printf("stopping UDP thread!\n");
-    if ((m_UDPThread != NULL) && m_UDPThread->m_run) {
-        m_UDPThread->m_run = 0;
-        m_UDPThread->Wait();
-        m_UDPThread = NULL;
-    }
-}
-
-void *UDPThread::Entry() {
-    printf("UDP thread started!\n");
-    while (m_run) {
-        if (wxGetApp().m_udp_enable) {
-            printf("m_udp_enable\n");
-            mf->m_udp_addr.Service(wxGetApp().m_udp_port);
-            mf->m_udp_sock = new wxDatagramSocket(mf->m_udp_addr, wxSOCKET_NOWAIT);
-
-            while (m_run && wxGetApp().m_udp_enable) {
-                if (mf->PollUDP() == 0) {
-                    wxThread::Sleep(20);
-                }
-            }
-
-            delete mf->m_udp_sock;
-        }
-        wxThread::Sleep(20);
-    }
-    return NULL;
-}
diff --git a/fdmdv2/branches/0.97/src/fdmdv2_main.h b/fdmdv2/branches/0.97/src/fdmdv2_main.h
deleted file mode 100644 (file)
index 8c11fb8..0000000
+++ /dev/null
@@ -1,601 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_main.h
-//
-// Purpose:         Declares simple wxWidgets application with GUI.
-// Created:         Apr. 9, 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 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 License
-//  along with this program; if not, see <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#ifndef __FDMDV2_MAIN__
-#define __FDMDV2_MAIN__
-
-#include "version.h"
-#ifndef _NO_AUTOTOOLS_
-#include "../config.h"
-#endif
-#include <wx/wx.h>
-
-#include <wx/tglbtn.h>
-#include <wx/app.h>
-//#include <wx/aboutdlg.h>
-#include "wx/rawbmp.h"
-#include "wx/file.h"
-#include "wx/filename.h"
-#include "wx/config.h"
-#include <wx/fileconf.h>
-#include "wx/graphics.h"
-#include "wx/mstream.h"
-#include "wx/wfstream.h"
-#include "wx/quantize.h"
-#include "wx/scopedptr.h"
-#include "wx/stopwatch.h"
-#include "wx/versioninfo.h"
-#include <wx/sound.h>
-#include <wx/url.h>
-#include <wx/sstream.h>
-#include <wx/listbox.h>
-#include <wx/textdlg.h>
-#include <wx/regex.h>
-#include <wx/socket.h>
-
-#include <samplerate.h>
-
-#include <hamlib.h> 
-#ifdef _WIN32
-#include <windows.h>
-#else
-#include <termios.h>
-#include <sys/ioctl.h>
-#endif
-
-#include "codec2.h"
-#include "codec2_fdmdv.h"
-#include "codec2_fifo.h"
-#include "golay23.h"
-
-#include "topFrame.h"
-#include "dlg_ptt.h"
-#include "dlg_options.h"
-#include "fdmdv2_plot.h"
-#include "fdmdv2_plot_scalar.h"
-#include "fdmdv2_plot_scatter.h"
-#include "fdmdv2_plot_waterfall.h"
-#include "fdmdv2_plot_spectrum.h"
-#include "fdmdv2_pa_wrapper.h"
-#include "sndfile.h"
-#include "portaudio.h"
-#include "dlg_audiooptions.h"
-#include "dlg_filter.h"
-#include "dlg_about.h"
-#include "dlg_options.h"
-#include "varicode.h"
-#include "sox_biquad.h"
-
-#define _USE_TIMER              1
-#define _USE_ONIDLE             1
-#define _DUMMY_DATA             1
-//#define _AUDIO_PASSTHROUGH    1
-#define _REFRESH_TIMER_PERIOD   (DT*1000)
-//#define _USE_ABOUT_DIALOG       1
-
-enum {
-        ID_START = wxID_HIGHEST,
-        ID_TIMER_WATERFALL,
-        ID_TIMER_SPECTRUM,
-        ID_TIMER_SCATTER,
-        ID_TIMER_SCALAR
-     };
-
-#define EXCHANGE_DATA_IN    0
-#define EXCHANGE_DATA_OUT   1
-
-#ifdef _WIN32
-#define COM_HANDLE_INVALID                     INVALID_HANDLE_VALUE
-typedef HANDLE      com_handle_t;
-#else
-#define COM_HANDLE_INVALID                     -1
-typedef int         com_handle_t;
-#endif
-
-extern int                 g_nSoundCards;
-extern int                 g_soundCard1InDeviceNum;
-extern int                 g_soundCard1OutDeviceNum;
-extern int                 g_soundCard1SampleRate;
-extern int                 g_soundCard2InDeviceNum;
-extern int                 g_soundCard2OutDeviceNum;
-extern int                 g_soundCard2SampleRate;
-
-class MainFrame;
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class MainApp
-//
-// @class $(Name)
-// @author $(User)
-// @date $(Date)
-// @file $(CurrentFileName).$(CurrentFileExt)
-// @brief
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class MainApp : public wxApp
-{
-    public:
-        virtual bool        OnInit();
-        virtual int         OnExit();
-
-        wxString            m_strVendName;
-        wxString            m_StrAppName;
-
-        wxString            m_textNumChOut;
-        wxString            m_textNumChIn;
-
-        wxString            m_strRxInAudio;
-        wxString            m_strRxOutAudio;
-        wxString            m_textVoiceInput;
-        wxString            m_textVoiceOutput;
-        wxString            m_strSampleRate;
-        wxString            m_strBitrate;
-
-        // PTT -----------------------------------
-
-        bool                m_boolHalfDuplex;
-
-        bool                m_boolHamlibUseForPTT;
-        unsigned int        m_intHamlibRig;
-        wxString            m_strHamlibSerialPort;
-        Hamlib              *m_hamlib;
-
-        bool                m_boolUseSerialPTT;
-        wxString            m_strRigCtrlPort;
-        bool                m_boolUseRTS;
-        bool                m_boolRTSPos;
-        bool                m_boolUseDTR;
-        bool                m_boolDTRPos;
-
-        // Play/Rec files
-
-        wxString            m_playFileToMicInPath;
-        wxString            m_recFileFromRadioPath;
-        unsigned int        m_recFileFromRadioSecs;
-        wxString            m_playFileFromRadioPath;
-
-        // Options dialog
-
-        wxString            m_callSign;
-        bool                m_events;
-        int                 m_events_spam_timer;
-        unsigned int        m_textEncoding;
-        wxString            m_events_regexp_match;
-        wxString            m_events_regexp_replace;
-
-        bool                m_snrSlow;
-
-        // LPC Post Filter
-        bool                m_codec2LPCPostFilterEnable;
-        bool                m_codec2LPCPostFilterBassBoost;
-        float               m_codec2LPCPostFilterGamma;
-        float               m_codec2LPCPostFilterBeta;
-        
-        // Mic In Equaliser
-        float               m_MicInBassFreqHz;
-        float               m_MicInBassGaindB;
-        float               m_MicInTrebleFreqHz;
-        float               m_MicInTrebleGaindB;
-        float               m_MicInMidFreqHz;
-        float               m_MicInMidGaindB;
-        float               m_MicInMidQ;
-        bool                m_MicInEQEnable;
-
-        // Spk Out Equaliser
-        float               m_SpkOutBassFreqHz;
-        float               m_SpkOutBassGaindB;
-        float               m_SpkOutTrebleFreqHz;
-        float               m_SpkOutTrebleGaindB;
-        float               m_SpkOutMidFreqHz;
-        float               m_SpkOutMidGaindB;
-        float               m_SpkOutMidQ;
-        bool                m_SpkOutEQEnable;
-
-        // Flags for displaying windows
-        int                 m_show_wf;
-        int                 m_show_spect;
-        int                 m_show_scatter;
-        int                 m_show_timing;
-        int                 m_show_freq;
-        int                 m_show_speech_in;
-        int                 m_show_speech_out;
-        int                 m_show_demod_in;
-        int                 m_show_test_frame_errors;
-
-        // optional vox trigger tone
-        bool                m_leftChannelVoxTone;
-
-        // UDP control port
-        bool                m_udp_enable;
-        int                 m_udp_port;
-
-        // notebook display after tx->rxtransition
-        int                 m_rxNbookCtrl;
-
-        wxRect              m_rTopWindow;
-
-        int                 m_framesPerBuffer;
-
-        bool                loadConfig();
-        bool                saveConfig();
-
-        // misc
-
-        bool        m_testFrames;
-
-        int        FilterEvent(wxEvent& event);
-        MainFrame *frame;
-    protected:
-};
-
-// declare global static function wxGetApp()
-DECLARE_APP(MainApp)
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// paCallBackData
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-typedef struct
-{
-    // libresample states for 48 to 8 kHz conversions
-
-    SRC_STATE      *insrc1;
-    SRC_STATE      *outsrc1;
-    SRC_STATE      *insrc2;
-    SRC_STATE      *outsrc2;
-
-    // FIFOs attached to first sound card
-
-    struct FIFO    *infifo1;
-    struct FIFO    *outfifo1;
-
-    // FIFOs attached to second sound card
-    struct FIFO    *infifo2;
-    struct FIFO    *outfifo2;
-
-    // FIFOs for rx process
-    struct FIFO    *rxinfifo;
-    struct FIFO    *rxoutfifo;
-
-    int             inputChannels1, inputChannels2;
-
-    // EQ filter states
-    void           *sbqMicInBass;
-    void           *sbqMicInTreble;
-    void           *sbqMicInMid;
-    void           *sbqSpkOutBass;
-    void           *sbqSpkOutTreble;
-    void           *sbqSpkOutMid;
-
-    bool            micInEQEnable;
-    bool            spkOutEQEnable;
-
-    // optional loud tone on left channel to reliably trigger vox
-    bool            leftChannelVoxTone;
-    float           voxTonePhase;
-
-} paCallBackData;
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// panel with custom loop checkbox for play file dialog
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class MyExtraPlayFilePanel : public wxPanel
-{
-public:
-    MyExtraPlayFilePanel(wxWindow *parent);
-    void setLoopPlayFileToMicIn(bool checked) { m_cb->SetValue(checked); }
-    bool getLoopPlayFileToMicIn(void) { return m_cb->GetValue(); }
-private:
-    wxCheckBox *m_cb;
-};
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// panel with custom Seconds-to-record control for record file dialog
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class MyExtraRecFilePanel : public wxPanel
-{
-public:
-    MyExtraRecFilePanel(wxWindow *parent);
-    ~MyExtraRecFilePanel() 
-    {
-        wxLogDebug("Destructor\n");
-    }
-    void setSecondsToRecord(wxString value) { m_secondsToRecord->SetValue(value); }
-    wxString getSecondsToRecord(void) 
-    { 
-        wxLogDebug("getSecondsToRecord: %s\n",m_secondsToRecord->GetValue());
-        return m_secondsToRecord->GetValue(); 
-    }
-private:
-    wxTextCtrl *m_secondsToRecord;
-};
-
-class txRxThread;
-class UDPThread;
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class MainFrame
-//
-// @class $(Name)
-// @author $(User)
-// @date $(Date)
-// @file $(CurrentFileName).$(CurrentFileExt)
-// @brief
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class MainFrame : public TopFrame
-{
-    public:
-        MainFrame(wxWindow *parent);
-        virtual ~MainFrame();
-
-        PlotSpectrum*           m_panelSpectrum;
-        PlotWaterfall*          m_panelWaterfall;
-        PlotScatter*            m_panelScatter;
-        PlotScalar*             m_panelTimeOffset;
-        PlotScalar*             m_panelFreqOffset;
-        PlotScalar*             m_panelSpeechIn;
-        PlotScalar*             m_panelSpeechOut;
-        PlotScalar*             m_panelDemodIn;
-        PlotScalar*             m_panelTestFrameErrors;
-
-        bool                    m_RxRunning;
-
-        PortAudioWrap           *m_rxInPa;
-        PortAudioWrap           *m_rxOutPa;
-        PortAudioWrap           *m_txInPa;
-        PortAudioWrap           *m_txOutPa;
-
-        PaError                 m_rxErr;
-        PaError                 m_txErr;
-        
-        txRxThread*             m_txRxThread;
-
-        bool                    OpenHamlibRig();
-        void                    SetupSerialPort(void);
-        void                    CloseSerialPort(void);
-        void                    SerialPTTRx(void);
-
-        bool                    m_modal;
-
-#ifdef _USE_TIMER
-        wxTimer                 m_plotTimer;
-#endif
-
-    void destroy_fifos(void);
-    void destroy_src(void);
-    void autoDetectSoundCards(PortAudioWrap *pa);
-
-        static int rxCallback(
-                                const void *inBuffer,
-                                void *outBuffer,
-                                unsigned long framesPerBuffer,
-                                const PaStreamCallbackTimeInfo *outTime,
-                                PaStreamCallbackFlags statusFlags,
-                                void *userData
-                             );
-        static int txCallback(
-                                const void *inBuffer,
-                                void *outBuffer,
-                                unsigned long framesPerBuffer,
-                                const PaStreamCallbackTimeInfo *outTime,
-                                PaStreamCallbackFlags statusFlags,
-                                void *userData
-                             );
-
-
-    void initPortAudioDevice(PortAudioWrap *pa, int inDevice, int outDevice, 
-                             int soundCard, int sampleRate, int inputChannels);
-
-    void togglePTT(void);
-
-    wxIPV4address           m_udp_addr;
-    wxDatagramSocket       *m_udp_sock;
-    UDPThread              *m_UDPThread;
-    void                    startUDPThread(void);
-    void                    stopUDPThread(void);
-    int                     PollUDP();
-    bool                    m_schedule_restore;
-
-    protected:
-
-#ifdef _WIN32
-#define COM_HANDLE_INVALID                     INVALID_HANDLE_VALUE
-        com_handle_t  com_handle;
-#else
-#define COM_HANDLE_INVALID                     -1
-        com_handle_t  com_handle;
-#endif
-        void raiseDTR(void);
-        void lowerDTR(void);
-        void raiseRTS(void);
-        void lowerRTS(void);
-        bool openComPort(const char *port);
-        void closeComPort(void);
-
-        void setsnrBeta(bool snrSlow);
-
-        // protected event handlers
-        virtual void OnCloseFrame(wxCloseEvent& event);
-        void OnExitClick(wxCommandEvent& event);
-
-        void startTxStream();
-        void startRxStream();
-        void stopTxStream();
-        void stopRxStream();
-        void abortTxStream();
-        void abortRxStream();
-        
-        void OnTop(wxCommandEvent& event);
-        void OnExit( wxCommandEvent& event );
-
-        void OnToolsAudio( wxCommandEvent& event );
-        void OnToolsAudioUI( wxUpdateUIEvent& event );
-        void OnToolsComCfg( wxCommandEvent& event );
-        void OnToolsComCfgUI( wxUpdateUIEvent& event );
-        void OnToolsFilter( wxCommandEvent& event );
-        void OnToolsOptions(wxCommandEvent& event);
-        void OnToolsOptionsUI(wxUpdateUIEvent& event);
-
-        void OnPlayFileToMicIn( wxCommandEvent& event );
-        void OnRecFileFromRadio( wxCommandEvent& event );
-        void OnPlayFileFromRadio( wxCommandEvent& event );
-
-        void OnHelpCheckUpdates( wxCommandEvent& event );
-        void OnHelpCheckUpdatesUI( wxUpdateUIEvent& event );
-        void OnHelpAbout( wxCommandEvent& event );
-        void OnCmdSliderScroll( wxScrollEvent& event );
-//        void OnSliderScrollBottom( wxScrollEvent& event );
-//        void OnCmdSliderScrollChanged( wxScrollEvent& event );
-//        void OnSliderScrollTop( wxScrollEvent& event );
-        void OnCheckSQClick( wxCommandEvent& event );
-        void OnCheckSNRClick( wxCommandEvent& event );
-
-        // Toggle Buttons
-        void OnTogBtnSplitClick(wxCommandEvent& event);
-        void OnTogBtnAnalogClick(wxCommandEvent& event);
-        void OnTogBtnRxID( wxCommandEvent& event );
-        void OnTogBtnTxID( wxCommandEvent& event );
-        void OnTogBtnPTT( wxCommandEvent& event );
-        void OnTogBtnOnOff( wxCommandEvent& event );
-
-        void OnCallSignReset( wxCommandEvent& event );
-        void OnBerReset( wxCommandEvent& event );
-
-        //System Events
-        void OnPaint(wxPaintEvent& event);
-        void OnSize( wxSizeEvent& event );
-        void OnUpdateUI( wxUpdateUIEvent& event );
-        void OnDeleteConfig(wxCommandEvent&);
-#ifdef _USE_TIMER
-        void OnTimer(wxTimerEvent &evt);
-#endif
-#ifdef _USE_ONIDLE
-        void OnIdle(wxIdleEvent &evt);
-#endif
-
-    private:
-        bool        m_useMemory;
-        wxTextCtrl* m_tc;
-        int         m_zoom;
-        float       m_snrBeta;
-        
-        // Callsign/text messaging
-        char        m_callsign[MAX_CALLSIGN];
-        char       *m_pcallsign;
-        unsigned int m_checksumGood;
-        unsigned int m_checksumBad;
-        
-        // Events
-        void        processTxtEvent(char event[]);
-        class OptionsDlg *optionsDlg;
-        wxTimer     spamTimer[MAX_EVENT_RULES];
-
-        // level Gauge
-        float       m_maxLevel;
-        // flags to indicate when new EQ filters need to be designed
-
-        bool        m_newMicInFilter;
-        bool        m_newSpkOutFilter;
-
-        void*       designAnEQFilter(const char filterType[], float freqHz, float gaindB, float Q = 0.0);
-        void        designEQFilters(paCallBackData *cb);
-        void        deleteEQFilters(paCallBackData *cb);
-};
-
-void txRxProcessing();
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// class txRxThread - experimental tx/rx processing thread
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class txRxThread : public wxThread
-{
-public:
-    txRxThread(void) : wxThread(wxTHREAD_JOINABLE) { m_run = 1; }
-
-    // thread execution starts here
-    void *Entry() 
-    {
-        while (m_run) 
-        {
-            txRxProcessing();        
-            wxThread::Sleep(20);
-        }
-        return NULL;
-    }
-
-    // called when the thread exits - whether it terminates normally or is
-    // stopped with Delete() (but not when it is Kill()ed!)
-    void OnExit() { }
-
-public:
-    bool  m_run;
-};
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// class UDPThread - waits for UDP messages
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class UDPThread : public wxThread
-{
-public:
-    UDPThread(void) : wxThread(wxTHREAD_JOINABLE) { m_run = 1; }
-
-    // thread execution starts here
-    void *Entry();
-
-    // called when the thread exits - whether it terminates normally or is
-    // stopped with Delete() (but not when it is Kill()ed!)
-    void OnExit() { }
-
-public:
-    MainFrame              *mf;
-    bool                    m_run;
-};
-
-void resample_for_plot(struct FIFO *plotFifo, short buf[], int length);
-
-int resample(SRC_STATE *src,
-             short      output_short[],
-             short      input_short[],
-             int        output_sample_rate,
-             int        input_sample_rate,
-             int        length_output_short, // maximum output array length in samples
-             int        length_input_short
-             );
-void txRxProcessing();
-void per_frame_rx_processing(
-                                        FIFO    *output_fifo,   // decoded speech samples
-                                        int     codec_bits[],  // current frame of bits for decoder
-                                        FIFO    *input_fifo,   // modem samples input to demod
-                                        int     *nin,          // amount of samples demod needs for next call
-                                        int     *state,        // used to collect codec_bits[] halves
-                                        struct  CODEC2 *c2     // Codec 2 states
-                                    );
-
-void per_frame_tx_processing(
-                                            short   tx_fdm_scaled[], // ouput modulated samples
-                                            short   input_buf[],     // speech sample input
-                                            CODEC2  *c2              // Codec 2 states
-                        );
-
-
-#endif //__FDMDV2_MAIN__
diff --git a/fdmdv2/branches/0.97/src/fdmdv2_pa_wrapper.cpp b/fdmdv2/branches/0.97/src/fdmdv2_pa_wrapper.cpp
deleted file mode 100644 (file)
index 0812087..0000000
+++ /dev/null
@@ -1,337 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_pa_wrapper.cpp
-// Purpose:         Implements a wrapper class around the PortAudio library.
-// Created:         August 12, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#include "fdmdv2_pa_wrapper.h"
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// PortAudioWrap()
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-PortAudioWrap::PortAudioWrap()
-{
-    m_pStream                   = NULL;
-    m_pUserData                 = NULL;
-    m_samplerate                = 0;
-    m_framesPerBuffer           = 0;
-    m_statusFlags               = 0;
-    m_pStreamCallback           = NULL;
-    m_pStreamFinishedCallback   = NULL;
-    m_pTimeInfo                 = 0;
-    m_newdata                   = false;
-
-//    loadData();
-}
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// ~PortAudioWrap()
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-PortAudioWrap::~PortAudioWrap()
-{
-}
-
-//----------------------------------------------------------------
-// streamOpen()
-//----------------------------------------------------------------
-PaError PortAudioWrap::streamOpen()
-{
-    return Pa_OpenStream(
-                            &m_pStream,
-                            m_inputBuffer.device == paNoDevice ? NULL : &m_inputBuffer,
-                            m_outputBuffer.device == paNoDevice ? NULL : &m_outputBuffer,
-                            m_samplerate,
-                            m_framesPerBuffer,
-                            m_statusFlags,
-                            *m_pStreamCallback,
-                            m_pUserData
-                        );
-}
-
-//----------------------------------------------------------------
-// streamStart()
-//----------------------------------------------------------------
-PaError PortAudioWrap::streamStart()
-{
-    return Pa_StartStream(m_pStream);
-}
-
-//----------------------------------------------------------------
-// streamClose()
-//----------------------------------------------------------------
-PaError PortAudioWrap::streamClose()
-{
-    if(isOpen())
-    {
-        PaError rv = Pa_CloseStream(m_pStream);
-        return rv;
-    }
-    else
-    {
-        return paNoError;
-    }
-}
-
-//----------------------------------------------------------------
-// terminate()
-//----------------------------------------------------------------
-void PortAudioWrap::terminate()
-{
-    if(Pa_IsStreamStopped(m_pStream) != paNoError)
-    {
-        Pa_StopStream(m_pStream);
-    }
-    Pa_Terminate();
-}
-
-//----------------------------------------------------------------
-// stop()
-//----------------------------------------------------------------
-void PortAudioWrap::stop()
-{
-    Pa_StopStream(m_pStream);
-}
-
-//----------------------------------------------------------------
-// abort()
-//----------------------------------------------------------------
-void PortAudioWrap::abort()
-{
-    Pa_AbortStream(m_pStream);
-}
-
-//----------------------------------------------------------------
-// isStopped()
-//----------------------------------------------------------------
-bool PortAudioWrap::isStopped() const
-{
-    PaError ret = Pa_IsStreamStopped(m_pStream);
-    return ret;
-}
-
-//----------------------------------------------------------------
-// isActive()
-//----------------------------------------------------------------
-bool PortAudioWrap::isActive() const
-{
-    PaError ret = Pa_IsStreamActive(m_pStream);
-    return ret;
-}
-
-//----------------------------------------------------------------
-// isOpen()
-//----------------------------------------------------------------
-bool PortAudioWrap::isOpen() const
-{
-    return (m_pStream != NULL);
-}
-
-//----------------------------------------------------------------
-// getDefaultInputDevice()
-//----------------------------------------------------------------
-PaDeviceIndex PortAudioWrap::getDefaultInputDevice()
-{
-    return Pa_GetDefaultInputDevice();
-}
-
-//----------------------------------------------------------------
-// getDefaultOutputDevice()
-//----------------------------------------------------------------
-PaDeviceIndex PortAudioWrap::getDefaultOutputDevice()
-{
-    return Pa_GetDefaultOutputDevice();
-}
-
-//----------------------------------------------------------------
-// setInputChannelCount()
-//----------------------------------------------------------------
-PaError PortAudioWrap::setInputChannelCount(int count)
-{
-    m_inputBuffer.channelCount = count;
-    return paNoError;
-}
-
-//----------------------------------------------------------------
-// getInputChannelCount()
-//----------------------------------------------------------------
-PaError PortAudioWrap::getInputChannelCount()
-{
-    return m_inputBuffer.channelCount;
-}
-
-//----------------------------------------------------------------
-// setInputSampleFormat()
-//----------------------------------------------------------------
-PaError PortAudioWrap::setInputSampleFormat(PaSampleFormat format)
-{
-    m_inputBuffer.sampleFormat = format;
-    return paNoError;
-}
-
-//----------------------------------------------------------------
-// setInputLatency()
-//----------------------------------------------------------------
-PaError PortAudioWrap::setInputLatency(PaTime latency)
-{
-    m_inputBuffer.suggestedLatency = latency;
-    return paNoError;
-}
-
-//----------------------------------------------------------------
-// setInputHostApiStreamInfo()
-//----------------------------------------------------------------
-void PortAudioWrap::setInputHostApiStreamInfo(void *info)
-{
-    m_inputBuffer.hostApiSpecificStreamInfo = info;
-}
-
-//----------------------------------------------------------------
-// getInputDefaultLowLatency()
-//----------------------------------------------------------------
-PaTime  PortAudioWrap::getInputDefaultLowLatency()
-{
-    return Pa_GetDeviceInfo(m_inputBuffer.device)->defaultLowInputLatency;
-}
-
-//----------------------------------------------------------------
-// setOutputChannelCount()
-//----------------------------------------------------------------
-PaError PortAudioWrap::setOutputChannelCount(int count)
-{
-    m_outputBuffer.channelCount = count;
-    return paNoError;
-}
-
-//----------------------------------------------------------------
-// getOutputChannelCount()
-//----------------------------------------------------------------
-const int PortAudioWrap::getOutputChannelCount()
-{
-    return m_outputBuffer.channelCount;
-}
-
-//----------------------------------------------------------------
-// getDeviceName()
-//----------------------------------------------------------------
-const char *PortAudioWrap::getDeviceName(PaDeviceIndex dev)
-{
-    const PaDeviceInfo *info;
-    info = Pa_GetDeviceInfo(dev);
-    return info->name;
-}
-
-//----------------------------------------------------------------
-// setOutputSampleFormat()
-//----------------------------------------------------------------
-PaError PortAudioWrap::setOutputSampleFormat(PaSampleFormat format)
-{
-    m_outputBuffer.sampleFormat = format;
-    return paNoError;
-}
-
-//----------------------------------------------------------------
-// setOutputLatency()
-//----------------------------------------------------------------
-PaError PortAudioWrap::setOutputLatency(PaTime latency)
-{
-    m_outputBuffer.suggestedLatency = latency;
-    return paNoError;
-}
-
-//----------------------------------------------------------------
-// setOutputHostApiStreamInfo()
-//----------------------------------------------------------------
-void PortAudioWrap::setOutputHostApiStreamInfo(void *info)
-{
-    m_outputBuffer.hostApiSpecificStreamInfo = info;
-}
-
-//----------------------------------------------------------------
-// getOutputDefaultLowLatency()
-//----------------------------------------------------------------
-PaTime  PortAudioWrap::getOutputDefaultLowLatency()
-{
-    return Pa_GetDeviceInfo(m_outputBuffer.device)->defaultLowOutputLatency;
-}
-
-//----------------------------------------------------------------
-// setFramesPerBuffer()
-//----------------------------------------------------------------
-PaError PortAudioWrap::setFramesPerBuffer(unsigned long size)
-{
-    m_framesPerBuffer = size;
-    return paNoError;
-}
-
-//----------------------------------------------------------------
-// setSampleRate()
-//----------------------------------------------------------------
-PaError PortAudioWrap::setSampleRate(unsigned long rate)
-{
-    m_samplerate = rate;
-    return paNoError;
-}
-
-//----------------------------------------------------------------
-// setStreamFlags()
-//----------------------------------------------------------------
-PaError PortAudioWrap::setStreamFlags(PaStreamFlags flags)
-{
-    m_statusFlags = flags;
-    return paNoError;
-}
-
-//----------------------------------------------------------------
-// setInputDevice()
-//----------------------------------------------------------------
-PaError PortAudioWrap::setInputDevice(PaDeviceIndex index)
-{
-    m_inputBuffer.device = index;
-    return paNoError;
-}
-
-//----------------------------------------------------------------
-// setOutputDevice()
-//----------------------------------------------------------------
-PaError PortAudioWrap::setOutputDevice(PaDeviceIndex index)
-{
-    m_outputBuffer.device = index;
-    return paNoError;
-}
-
-//----------------------------------------------------------------
-// setCallback()
-//----------------------------------------------------------------
-PaError PortAudioWrap::setCallback(PaStreamCallback *callback)
-{
-    m_pStreamCallback = callback;
-    return paNoError;
-}
-
-/*
-//----------------------------------------------------------------
-// loadData() : create Dummy Data
-//----------------------------------------------------------------
-void PortAudioWrap::loadData()
-{
-    int i;
-    for(i = 0; i < FDMDV_NSPEC; i++)
-    {
-        m_av_mag[i] = i;
-    }
-}
-*/
diff --git a/fdmdv2/branches/0.97/src/fdmdv2_pa_wrapper.h b/fdmdv2/branches/0.97/src/fdmdv2_pa_wrapper.h
deleted file mode 100644 (file)
index 3d216c0..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_pa_wrapper.h
-// Purpose:         Defines a wrapper class around PortAudio
-// Created:         August 12, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#include <stdio.h>
-#include <math.h>
-#include "fdmdv2_defines.h"
-#include "codec2_fdmdv.h"
-#include "codec2.h"
-#include "portaudio.h"
-
-#define PA_SAMPLE_TYPE      paInt16         //paFloat32
-#define FRAMES_PER_BUFFER   (64)
-
-typedef float SAMPLE;
-
-class PortAudioWrap
-{
-    public:
-        PortAudioWrap();
-        ~PortAudioWrap();
-
-//        float                           m_av_mag[FDMDV_NSPEC];
-
-    private:
-        PaStream                        *m_pStream;
-        void                            *m_pUserData;
-        PaStreamCallback                *m_pStreamCallback;
-        PaStreamFinishedCallback        *m_pStreamFinishedCallback;
-        const PaStreamCallbackTimeInfo  *m_pTimeInfo;
-        struct FDMDV                    *m_pFDMDV_state;
-        PaStreamParameters              m_inputBuffer;
-        PaStreamParameters              m_outputBuffer;
-        int                             m_samplerate;
-        unsigned long                   m_framesPerBuffer;
-        PaStreamCallbackFlags           m_statusFlags;
-        bool                            m_newdata;
-
-    public:
-
-        void                averageData(float mag_dB[]);
-
-        int                 getDeviceCount() { return Pa_GetDeviceCount(); }
-        PaDeviceIndex       getDefaultInputDevice();
-        PaDeviceIndex       getDefaultOutputDevice();
-        PaStreamParameters  *getDeviceInfo(PaDeviceIndex idx);
-
-        PaError             setFramesPerBuffer(unsigned long size);
-        PaError             setSampleRate(unsigned long size);
-
-        PaError             setStreamFlags(PaStreamFlags flags);
-        PaError             setCallback(PaStreamCallback *m_pStreamCallback);
-        PaError             setStreamCallback(PaStream *stream, PaStreamCallback* callback) { m_pStreamCallback = callback; return 0;}
-        PaError             setStreamFinishedCallback(PaStream *stream, PaStreamFinishedCallback* m_pStreamFinishedCallback);
-
-        void                setInputBuffer(const PaStreamParameters& inputBuffer)   {this->m_inputBuffer = inputBuffer;}
-        PaError             setInputDevice(PaDeviceIndex dev);
-        PaError             setInputChannelCount(int count);
-        int                 getInputChannelCount();
-        PaError             setInputSampleFormat(PaSampleFormat format);
-        PaError             setInputSampleRate(PaSampleFormat format);
-        PaError             setInputLatency(PaTime latency);
-        void                setInputHostApiStreamInfo(void *info = NULL);
-        PaTime              getInputDefaultLowLatency();
-        const char          *getDeviceName(PaDeviceIndex dev);
-
-        PaError             setOutputDevice(PaDeviceIndex dev);
-        PaError             setOutputChannelCount(int count);
-        const int           getOutputChannelCount();
-        PaError             setOutputSampleFormat(PaSampleFormat format);
-        PaError             setOutputLatency(PaTime latency);
-        void                setOutputHostApiStreamInfo(void *info = NULL);
-        PaTime              getOutputDefaultLowLatency();
-
-        void                setFdmdvState(FDMDV* fdmdv_state)                       {this->m_pFDMDV_state = fdmdv_state;}
-        void                setOutputBuffer(const PaStreamParameters& outputBuffer) {this->m_outputBuffer = outputBuffer;}
-        void                setTimeInfo(PaStreamCallbackTimeInfo* timeInfo)         {this->m_pTimeInfo = timeInfo;}
-        void                setUserData(void* userData)                             {this->m_pUserData = userData;}
-        unsigned long       getFramesPerBuffer() const                              {return m_framesPerBuffer;}
-        const               PaStreamParameters& getInputBuffer() const              {return m_inputBuffer;}
-        const               PaStreamParameters& getOutputBuffer() const             {return m_outputBuffer;}
-        const               PaStreamCallbackFlags& getStatusFlags() const           {return m_statusFlags;}
-
-        FDMDV*              getFdmdvState()                                         {return m_pFDMDV_state;}
-        int                 getSamplerate() const                                   {return m_samplerate;}
-        PaStream*           getStream()                                             {return m_pStream;}
-        void                *getUserData()                                          {return m_pUserData;}
-        bool                getDataAvail()                                          {return m_newdata;}
-        PaError             streamStart();
-        PaError             streamClose();
-        PaError             streamOpen();
-        void                terminate();
-        void                stop();
-        void                abort();
-        bool                isOpen() const;
-        bool                isStopped() const;
-        bool                isActive() const;
-//        void                loadData();
-};
diff --git a/fdmdv2/branches/0.97/src/fdmdv2_plot.cpp b/fdmdv2/branches/0.97/src/fdmdv2_plot.cpp
deleted file mode 100644 (file)
index 1b85cd9..0000000
+++ /dev/null
@@ -1,283 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_plot.cpp
-// Purpose:         Implements simple wxWidgets application with GUI.
-// Created:         Apr. 9, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#include <string.h>
-#include "fdmdv2_plot.h"
-
-BEGIN_EVENT_TABLE(PlotPanel, wxPanel)
-    EVT_PAINT           (PlotPanel::OnPaint)
-    EVT_MOTION          (PlotPanel::OnMouseMove)
-    EVT_LEFT_DOWN       (PlotPanel::OnMouseLeftDown)
-    EVT_LEFT_UP         (PlotPanel::OnMouseLeftUp)
-    EVT_RIGHT_DOWN      (PlotPanel::OnMouseRightDown)
-    EVT_MOUSEWHEEL      (PlotPanel::OnMouseWheelMoved)
-    EVT_SIZE            (PlotPanel::OnSize)
-    EVT_SHOW            (PlotPanel::OnShow)
-END_EVENT_TABLE()
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class PlotPanel(wxFrame* parent) : wxPanel(parent)
-//
-// @class $(Name)
-// @author $(User)
-// @date $(Date)
-// @file $(CurrentFileName).$(CurrentFileExt)
-// @brief
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-PlotPanel::PlotPanel(wxFrame* parent) : wxPanel(parent)
-{
-    m_pNoteBook         = (wxAuiNotebook *) parent;
-    m_pTopFrame         = (MainFrame *)m_pNoteBook->GetParent();
-    m_zoomFactor        = 1.0;
-    m_pBmp              = NULL;
-    m_pPix              = NULL;
-    m_firstPass         = true;
-    m_line_color        = 0;
-    m_newdata           = false;
-    m_clip              = false;
-    m_use_bitmap        = true;
-    m_rubberBand        = false;
-    m_mouseDown         = false;
-    m_penShortDash      = wxPen(wxColor(0xA0, 0xA0, 0xA0), 1, wxPENSTYLE_SHORT_DASH);
-    m_penDotDash        = wxPen(wxColor(0xD0, 0xD0, 0xD0), 1, wxPENSTYLE_DOT_DASH);
-    m_penSolid          = wxPen(wxColor(0x00, 0x00, 0x00), 1, wxPENSTYLE_SOLID);
-    SetBackgroundStyle(wxBG_STYLE_PAINT);
-    SetLabelSize(10.0);
-}
-
-//-------------------------------------------------------------------------
-// ~PlotPanel()
-//-------------------------------------------------------------------------
-PlotPanel::~PlotPanel()
-{
-    if(m_pBmp != NULL)
-    {
-        delete m_pBmp;
-    }
-}
-
-//-------------------------------------------------------------------------
-// GetLabelSize()
-//-------------------------------------------------------------------------
-double PlotPanel::GetLabelSize()
-{
-    return m_label_size;
-}
-
-//-------------------------------------------------------------------------
-// SetLabelSize()
-//-------------------------------------------------------------------------
-void PlotPanel::SetLabelSize(double size)
-{
-    m_label_size = size;
-}
-
-//-------------------------------------------------------------------------
-// OnShow()
-//-------------------------------------------------------------------------
-void PlotPanel::OnShow(wxShowEvent& event)
-{
-    this->Refresh();
-}
-
-//-------------------------------------------------------------------------
-// OnErase()
-//-------------------------------------------------------------------------
-void PlotPanel::OnErase(wxEraseEvent& event)
-{
-    event.Skip();
-}
-
-//-------------------------------------------------------------------------
-// OnSize()
-//-------------------------------------------------------------------------
-void PlotPanel::OnSize(wxSizeEvent& event)
-{
-    m_rCtrlPrev = m_rCtrl;
-    m_rCtrl     = GetClientRect();
-    if(m_use_bitmap)
-    {
-        if(!m_oImage.IsOk())
-        {
-            m_oImage.Create(m_rCtrl.GetWidth(), m_rCtrl.GetHeight(), true);
-        }
-        else
-        {
-            m_oImage.Rescale(m_rCtrl.GetWidth(), m_rCtrl.GetHeight());
-        }
-        m_pBmp = new wxBitmap(m_oImage, wxBITMAP_SCREEN_DEPTH);
-        m_firstPass = true;
-    }
-    this->Refresh();
-}
-
-//-------------------------------------------------------------------------
-// OnMouseMove()
-//-------------------------------------------------------------------------
-void PlotPanel::OnMouseMove(wxMouseEvent& event)
-{
-//    if(m_mouseDown)
-//    {
-//        paintNow();
-//    }
-}
-
-//-------------------------------------------------------------------------
-// OnMouseLeftDown()
-//-------------------------------------------------------------------------
-void PlotPanel::OnMouseLeftDown(wxMouseEvent& event)
-{
-}
-
-//-------------------------------------------------------------------------
-// OnMouseRightDown()
-//-------------------------------------------------------------------------
-void PlotPanel::OnMouseRightDown(wxMouseEvent& event)
-{
-}
-
-//-------------------------------------------------------------------------
-// OnMouseWheelMoved()
-//-------------------------------------------------------------------------
-void PlotPanel::OnMouseWheelMoved(wxMouseEvent& event)
-{
-}
-
-//-------------------------------------------------------------------------
-// OnMouseLeftUp()
-//-------------------------------------------------------------------------
-void PlotPanel::OnMouseLeftUp(wxMouseEvent& event)
-{
-    m_mouseDown = false;
-}
-
-//-------------------------------------------------------------------------
-// SetZoomFactor()
-//-------------------------------------------------------------------------
-double PlotPanel::SetZoomFactor(double zf)
-{
-    if((zf > 0) && (zf < 5.0))
-    {
-        m_zoomFactor = zf;
-    }
-    return zf;
-}
-
-//-------------------------------------------------------------------------
-// GetZoomFactor()
-//-------------------------------------------------------------------------
-double PlotPanel::GetZoomFactor(double zf)
-{
-    return m_zoomFactor;
-}
-
-//-------------------------------------------------------------------------
-// draw()
-//-------------------------------------------------------------------------
-void PlotPanel::draw(wxAutoBufferedPaintDC& pDC)
-{
-    printf("PlotPanel::draw()");
-    wxMemoryDC m_mDC;
-    m_mDC.SelectObject(*m_pBmp);
-    m_rCtrl  = GetClientRect();
-    m_rGrid  = m_rCtrl;
-
-    m_rGrid = m_rGrid.Deflate(PLOT_BORDER + (XLEFT_OFFSET/2), (PLOT_BORDER + (YBOTTOM_OFFSET/2)));
-    m_rGrid.Offset(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER);
-
-    pDC.Clear();
-    m_rPlot = wxRect(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER, m_rGrid.GetWidth(), m_rGrid.GetHeight());
-    if(m_firstPass)
-    {
-        m_firstPass = false;
-        m_mDC.FloodFill(0, 0, VERY_LTGREY_COLOR);
-
-        // Draw a filled rectangle with aborder
-        wxBrush ltGraphBkgBrush = wxBrush(DARK_BLUE_COLOR);
-        m_mDC.SetBrush(ltGraphBkgBrush);
-        m_mDC.SetPen(wxPen(BLACK_COLOR, 0));
-        m_mDC.DrawRectangle(m_rPlot);
-    }
-    if(m_newdata)
-    {
-        m_newdata = false;
-        int t = m_rPlot.GetTop();
-        int l = m_rPlot.GetLeft();
-//        int r = m_rPlot.GetRight();
-        int h = m_rPlot.GetHeight();
-        int w = m_rPlot.GetWidth();
-        pDC.Blit(l, t, w, h, &m_mDC, l, t);
-    }
-    drawGraticule(pDC);
-    m_mDC.SetBrush(wxNullBrush);
-    m_mDC.SelectObject(wxNullBitmap);
-}
-
-//-------------------------------------------------------------------------
-// drawGraticule()
-//-------------------------------------------------------------------------
-void PlotPanel::drawGraticule(wxAutoBufferedPaintDC& pDC)
-{
-    int p;
-    char buf[15];
-    wxString s;
-
-    // Vertical gridlines
-    pDC.SetPen(m_penShortDash);
-    for(p = (PLOT_BORDER + XLEFT_OFFSET + GRID_INCREMENT); p < ((m_rGrid.GetWidth() - XLEFT_OFFSET) + GRID_INCREMENT); p += GRID_INCREMENT)
-    {
-        pDC.DrawLine(p, (m_rGrid.GetHeight() + PLOT_BORDER), p, PLOT_BORDER);
-    }
-    // Horizontal gridlines
-    pDC.SetPen(m_penDotDash);
-    for(p = (m_rGrid.GetHeight() - GRID_INCREMENT); p > PLOT_BORDER; p -= GRID_INCREMENT)
-    {
-        pDC.DrawLine(PLOT_BORDER + XLEFT_OFFSET, (p + PLOT_BORDER), (m_rGrid.GetWidth() + PLOT_BORDER + XLEFT_OFFSET), (p + PLOT_BORDER));
-    }
-    // Label the X-Axis
-    pDC.SetPen(wxPen(GREY_COLOR, 1));
-    for(p = GRID_INCREMENT; p < (m_rGrid.GetWidth() - YBOTTOM_OFFSET); p += GRID_INCREMENT)
-    {
-        sprintf(buf, "%1.1f Hz",(double)(p / 10));
-        pDC.DrawText(buf, p - PLOT_BORDER + XLEFT_OFFSET, m_rGrid.GetHeight() + YBOTTOM_OFFSET/2);
-    }
-    // Label the Y-Axis
-    //for(p = GRID_INCREMENT; p < (h - YBOTTOM_OFFSET); p += GRID_INCREMENT)
-    for(p = (m_rGrid.GetHeight() - GRID_INCREMENT); p > PLOT_BORDER; p -= GRID_INCREMENT)
-    {
-        sprintf(buf, "%1.0f", (double)((m_rGrid.GetHeight() - p) * -10));
-        pDC.DrawText(buf, XLEFT_TEXT_OFFSET, p);
-    }
-}
-
-//-------------------------------------------------------------------------
-// paintEvent()
-//
-// Called by the system of by wxWidgets when the panel needs
-// to be redrawn. You can also trigger this call by calling
-// Refresh()/Update().
-//-------------------------------------------------------------------------
-void PlotPanel::OnPaint(wxPaintEvent & evt)
-{
-    wxAutoBufferedPaintDC pdc(this);
-    draw(pdc);
-}
-
diff --git a/fdmdv2/branches/0.97/src/fdmdv2_plot.h b/fdmdv2/branches/0.97/src/fdmdv2_plot.h
deleted file mode 100644 (file)
index 25309d3..0000000
+++ /dev/null
@@ -1,150 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_plot.h
-// Purpose:         Declares simple wxWidgets application with GUI
-// Created:         Apr. 10, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-//#include "fdmdv2_main.h"
-#ifndef __FDMDV2_PLOT__
-#define __FDMDV2_PLOT__
-#include <wx/wx.h>
-#include <wx/aui/auibook.h>
-#include <wx/rawbmp.h>
-#include <wx/image.h>
-#include <wx/dcbuffer.h>
-
-#define MAX_ZOOM            7
-#define MAX_BMP_X           (400 * MAX_ZOOM)
-#define MAX_BMP_Y           (400 * MAX_ZOOM)
-#define DATA_LINE_HEIGHT    10
-#define TEXT_BASELINE_OFFSET_Y  -5
-
-
-#define wxUSE_FILEDLG       1
-#define wxUSE_LIBPNG        1
-#define wxUSE_LIBJPEG       1
-#define wxUSE_GIF           1
-#define wxUSE_PCX           1
-#define wxUSE_LIBTIFF       1
-
-#define PLOT_BORDER         12
-#define XLEFT_OFFSET        40
-#define XLEFT_TEXT_OFFSET   6
-#define YBOTTOM_OFFSET      20
-#define YBOTTOM_TEXT_OFFSET 15
-#define GRID_INCREMENT      50
-
-#define BLACK_COLOR         wxColor(0x00, 0x00, 0x00)
-#define GREY_COLOR          wxColor(0x80, 0x80, 0x80)
-#define DARK_GREY_COLOR     wxColor(0x40, 0x40, 0x40)
-#define MEDIUM_GREY_COLOR   wxColor(0xC0, 0xC0, 0xC0)
-#define LIGHT_GREY_COLOR    wxColor(0xE0, 0xE0, 0xE0)
-#define VERY_LTGREY_COLOR   wxColor(0xF8, 0xF8, 0xF8)
-#define WHITE_COLOR         wxColor(0xFF, 0xFF, 0xFF)
-
-#define DARK_BLUE_COLOR     wxColor(0x00, 0x00, 0x60)
-#define BLUE_COLOR          wxColor(0x00, 0x00, 0xFF)
-#define LIGHT_BLUE_COLOR    wxColor(0x80, 0x80, 0xFF)
-
-#define RED_COLOR           wxColor(0xFF, 0x5E, 0x5E)
-#define LIGHT_RED_COLOR     wxColor(0xFF, 0xE0, 0xE0)
-#define DARK_RED_COLOR      wxColor(0xFF, 0x00, 0x00)
-#define PINK_COLOR          wxColor(0xFF, 0x80, 0xFF)
-
-#define LIGHT_GREEN_COLOR   wxColor(0xE3, 0xFF, 0xE0)
-#define GREEN_COLOR         wxColor(0x95, 0xFF, 0x8A)
-#define DARK_GREEN_COLOR    wxColor(0x20, 0xFF, 0x08)
-#define VERY_GREEN_COLOR    wxColor(0x00, 0xFF, 0x00)
-
-#define YELLOW_COLOR        wxColor(0xFF, 0xFF, 0x5E)
-#define LIGHT_YELLOW_COLOR  wxColor(0xFF, 0xFF, 0xB5)
-#define DARK_YELLOW_COLOR   wxColor(0xFF, 0xFF, 0x08)
-
-class MainFrame;
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class PlotPanel
-//
-// @class $(Name)
-// @author $(User)
-// @date $(Date)
-// @file $(CurrentFileName).$(CurrentFileExt)
-// @brief
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class PlotPanel : public wxPanel
-{
-    public:
-        PlotPanel(wxFrame* parent);
-        ~PlotPanel();
-        wxPen               m_penShortDash;
-        wxPen               m_penDotDash;
-        wxPen               m_penSolid;
-        wxRect              m_rCtrlPrev;
-        wxRect              m_rCtrl;
-        wxRect              m_rGrid;
-        wxRect              m_rPlot;
-        MainFrame           *m_pTopFrame;
-        wxAuiNotebook       *m_pNoteBook;
-        double              m_label_size;
-        wxSize              m_Bufsz;
-        bool                m_newdata;
-        wxImage             m_oImage;
-        wxBitmap            *m_pBmp;
-        wxNativePixelData   *m_pPix;
-
-        // some useful events
-        void            OnMouseMove(wxMouseEvent& event);
-        virtual void    OnMouseLeftDown(wxMouseEvent& event);
-        void            OnMouseLeftUp(wxMouseEvent& event);
-        virtual void    OnMouseRightDown(wxMouseEvent& event);
-        void            OnMouseWheelMoved(wxMouseEvent& event);
-        void            OnClose(wxCloseEvent& event ){ event.Skip(); }
-        void            OnSize( wxSizeEvent& event );
-        void            OnErase(wxEraseEvent& event);
-        void            OnPaint(wxPaintEvent& event);
-        //void OnUpdateUI( wxUpdateUIEvent& event ){ event.Skip(); }
-
-        void            paintEvent(wxPaintEvent & evt);
-        virtual void    draw(wxAutoBufferedPaintDC&  pdc);
-        virtual void    drawGraticule(wxAutoBufferedPaintDC&  pdc);
-        virtual double  SetZoomFactor(double zf);
-        virtual double  GetZoomFactor(double zf);
-        virtual void    OnShow(wxShowEvent& event);
-        virtual double  GetLabelSize();
-        virtual void    SetLabelSize(double size);
-
-    protected:
-        int             m_x;
-        int             m_y;
-        int             m_left;
-        int             m_top;
-        int             m_prev_w;
-        int             m_prev_h;
-        int             m_prev_x;
-        int             m_prev_y;
-        bool            m_use_bitmap;
-        bool            m_clip;
-        bool            m_rubberBand;
-        bool            m_mouseDown;
-        bool            m_firstPass;
-        double          m_zoomFactor;
-        int             m_greyscale;
-        int             m_line_color;
-    DECLARE_EVENT_TABLE()
-};
-#endif //__FDMDV2_PLOT__
diff --git a/fdmdv2/branches/0.97/src/fdmdv2_plot_scalar.cpp b/fdmdv2/branches/0.97/src/fdmdv2_plot_scalar.cpp
deleted file mode 100644 (file)
index a29911f..0000000
+++ /dev/null
@@ -1,281 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_plot_scalar.cpp
-// Purpose:         Plots scalar amplitude against time
-// Created:         June 22, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#include <string.h>
-#include "wx/wx.h"
-#include "fdmdv2_main.h"
-#include "fdmdv2_plot_scalar.h"
-
-BEGIN_EVENT_TABLE(PlotScalar, PlotPanel)
-    EVT_PAINT           (PlotScalar::OnPaint)
-    EVT_MOTION          (PlotScalar::OnMouseMove)
-    EVT_MOUSEWHEEL      (PlotScalar::OnMouseWheelMoved)
-    EVT_SIZE            (PlotScalar::OnSize)
-    EVT_SHOW            (PlotScalar::OnShow)
-//    EVT_ERASE_BACKGROUND(PlotScalar::OnErase)
-END_EVENT_TABLE()
-
-//----------------------------------------------------------------
-// PlotScalar()
-//----------------------------------------------------------------
-PlotScalar::PlotScalar(wxFrame* parent, 
-                       int    channels,           // number on channel to plot
-                      float  t_secs,             // time covered by entire x axis in seconds
-                      float  sample_period_secs, // time between each sample in seconds
-                      float  a_min,              // min ampltude of samples being plotted
-                      float  a_max,              // max ampltude of samples being plotted
-                      float  graticule_t_step,   // time step of x (time) axis graticule in seconds
-                      float  graticule_a_step,   // step of amplitude axis graticule
-                      const char a_fmt[],        // printf format string for amlitude axis labels
-                       int    mini                // true for mini-plot - don't draw graticule
-                      ): PlotPanel(parent)
-{
-    int i;
-
-    m_rCtrl = GetClientRect();
-
-    m_channels = channels;
-    m_t_secs = t_secs;
-    m_sample_period_secs = sample_period_secs;
-    m_a_min = a_min;
-    m_a_max = a_max;
-    m_graticule_t_step = graticule_t_step;
-    m_graticule_a_step = graticule_a_step;
-    assert(strlen(a_fmt) < 15);
-    strcpy(m_a_fmt, a_fmt);
-    m_mini = mini;
-
-    // work out number of samples we will store and allocate storage
-
-    m_samples = m_t_secs/m_sample_period_secs;
-    m_mem = new float[m_samples*m_channels];
-
-    for(i = 0; i < m_samples*m_channels; i++)
-    {
-        m_mem[i] = 0.0;
-    }
-}
-
-//----------------------------------------------------------------
-// ~PlotScalar()
-//----------------------------------------------------------------
-PlotScalar::~PlotScalar()
-{
-    delete m_mem;
-}
-
-//----------------------------------------------------------------
-// add_new_sample()
-//----------------------------------------------------------------
-void PlotScalar::add_new_sample(int channel, float sample)
-{
-    int i;
-    int offset = channel*m_samples;
-
-    assert(channel < m_channels);
-
-    for(i = 0; i < m_samples-1; i++)
-    {
-        m_mem[offset+i] = m_mem[offset+i+1];
-    }
-    m_mem[offset+m_samples-1] = sample;
-}
-
-//----------------------------------------------------------------
-// add_new_samples()
-//----------------------------------------------------------------
-void  PlotScalar::add_new_short_samples(int channel, short samples[], int length, float scale_factor)
-{
-    int i;
-    int offset = channel*m_samples;
-
-    assert(channel < m_channels);
-
-    for(i = 0; i < m_samples-length; i++)
-        m_mem[offset+i] = m_mem[offset+i+length];
-    for(; i < m_samples; i++)
-       m_mem[offset+i] = (float)*samples++/scale_factor;
-}
-
-//----------------------------------------------------------------
-// draw()
-//----------------------------------------------------------------
-void PlotScalar::draw(wxAutoBufferedPaintDC&  dc)
-{
-    float index_to_px;
-    float a_to_py;
-    int   i;
-    int   x, y;
-    int   prev_x, prev_y;
-    float a;
-
-    m_rCtrl = GetClientRect();
-    m_rGrid = m_rCtrl;
-    if (!m_mini)
-        m_rGrid = m_rGrid.Deflate(PLOT_BORDER + (XLEFT_OFFSET/2), (PLOT_BORDER + (YBOTTOM_OFFSET/2)));
-
-    //printf("h %d w %d\n", m_rCtrl.GetWidth(), m_rCtrl.GetHeight());
-    //printf("h %d w %d\n", m_rGrid.GetWidth(), m_rGrid.GetHeight());
-
-    // black background
-
-    dc.Clear();
-    if (m_mini)
-        m_rPlot = wxRect(0, 0, m_rGrid.GetWidth(), m_rGrid.GetHeight());        
-    else
-        m_rPlot = wxRect(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER, m_rGrid.GetWidth(), m_rGrid.GetHeight());
-   
-    wxBrush ltGraphBkgBrush = wxBrush(BLACK_COLOR);
-    dc.SetBrush(ltGraphBkgBrush);
-    dc.SetPen(wxPen(BLACK_COLOR, 0));
-    dc.DrawRectangle(m_rPlot);
-
-    index_to_px = (float)m_rGrid.GetWidth()/m_samples;
-    a_to_py = (float)m_rGrid.GetHeight()/(m_a_max - m_a_min);
-
-    wxPen pen;
-    pen.SetColour(DARK_GREEN_COLOR);
-    pen.SetWidth(1);
-    dc.SetPen(pen);
-
-    // draw all samples
-
-    prev_x = prev_y = 0; // stop warning
-
-    // plot each channel 
-
-    int offset;
-    for(offset=0; offset<m_channels*m_samples; offset+=m_samples) {
-
-        for(i = 0; i < m_samples; i++) {
-            x = index_to_px * i;
-            a = m_mem[offset+i];
-            if (a < m_a_min) a = m_a_min;
-            if (a > m_a_max) a = m_a_max;
-
-            // invert y axis and offset by minimum
-
-            y = m_rGrid.GetHeight() - a_to_py * a + m_a_min*a_to_py;
-
-            // put inside plot window
-
-            if (!m_mini) {
-                x += PLOT_BORDER + XLEFT_OFFSET;
-                y += PLOT_BORDER;
-            }
-
-            if (i)
-                dc.DrawLine(x, y, prev_x, prev_y);
-            prev_x = x; prev_y = y;
-        }
-    }
-
-    drawGraticule(dc);
-}
-
-//-------------------------------------------------------------------------
-// drawGraticule()
-//-------------------------------------------------------------------------
-void PlotScalar::drawGraticule(wxAutoBufferedPaintDC&  dc)
-{
-    float    t, a;
-    int      x, y, text_w, text_h;
-    char     buf[15];
-    wxString s;
-    float    sec_to_px;
-    float    a_to_py;
-
-    wxBrush ltGraphBkgBrush;
-    ltGraphBkgBrush.SetStyle(wxBRUSHSTYLE_TRANSPARENT);
-    ltGraphBkgBrush.SetColour(*wxBLACK);
-    dc.SetBrush(ltGraphBkgBrush);
-    dc.SetPen(wxPen(BLACK_COLOR, 1));
-
-    sec_to_px = (float)m_rGrid.GetWidth()/m_t_secs;
-    a_to_py = (float)m_rGrid.GetHeight()/(m_a_max - m_a_min);
-
-    // upper LH coords of plot area are (PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER)
-    // lower RH coords of plot area are (PLOT_BORDER + XLEFT_OFFSET + m_rGrid.GetWidth(), 
-    //                                   PLOT_BORDER + m_rGrid.GetHeight())
-
-    // Vertical gridlines
-
-    dc.SetPen(m_penShortDash);
-    for(t=0; t<=m_t_secs; t+=m_graticule_t_step) {
-       x = t*sec_to_px;
-       if (m_mini) {
-            dc.DrawLine(x, m_rGrid.GetHeight(), x, 0);
-        }
-        else {
-            x += PLOT_BORDER + XLEFT_OFFSET;
-            dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, PLOT_BORDER);
-        }
-        if (!m_mini) {
-            sprintf(buf, "%2.1fs", t);
-            GetTextExtent(buf, &text_w, &text_h);
-            dc.DrawText(buf, x - text_w/2, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET);
-        }
-    }
-
-    // Horizontal gridlines
-
-    dc.SetPen(m_penDotDash);
-    for(a=m_a_min; a<m_a_max; a+=m_graticule_a_step) {
-       y = m_rGrid.GetHeight() - a*a_to_py + m_a_min*a_to_py;
-       if (m_mini) {
-            dc.DrawLine(0, y, m_rGrid.GetWidth(), y);
-        }
-        else {
-            y += PLOT_BORDER;
-            dc.DrawLine(PLOT_BORDER + XLEFT_OFFSET, y, 
-                        (m_rGrid.GetWidth() + PLOT_BORDER + XLEFT_OFFSET), y);
-        }
-        if (!m_mini) {
-            sprintf(buf, m_a_fmt, a);
-            GetTextExtent(buf, &text_w, &text_h);
-            dc.DrawText(buf, PLOT_BORDER + XLEFT_OFFSET - text_w - XLEFT_TEXT_OFFSET, y-text_h/2);
-        }
-   }
-
-
-}
-
-//----------------------------------------------------------------
-// OnPaint()
-//----------------------------------------------------------------
-void PlotScalar::OnPaint(wxPaintEvent& event)
-{
-    wxAutoBufferedPaintDC dc(this);
-    draw(dc);
-}
-
-//----------------------------------------------------------------
-// OnSize()
-//----------------------------------------------------------------
-void PlotScalar::OnSize(wxSizeEvent& event)
-{
-}
-
-//----------------------------------------------------------------
-// OnShow()
-//----------------------------------------------------------------
-void PlotScalar::OnShow(wxShowEvent& event)
-{
-}
diff --git a/fdmdv2/branches/0.97/src/fdmdv2_plot_scalar.h b/fdmdv2/branches/0.97/src/fdmdv2_plot_scalar.h
deleted file mode 100644 (file)
index 7043987..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_plot_scalar.h
-// Purpose:         Defines a scalar plot derivative of fdmdv2_plot.
-// Created:         June 22, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#ifndef __FDMDV2_PLOT_SCALAR__
-#define __FDMDV2_PLOT_SCALAR__
-
-#include "fdmdv2_plot.h"
-#include "fdmdv2_defines.h"
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class PlotScalar
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class PlotScalar: public PlotPanel
-{
-    public:
-
-    PlotScalar(wxFrame* parent,
-               int   channels,
-              float t_secs, 
-              float sample_period_secs,
-              float a_min,
-              float a_max,
-              float graticule_t_step,   
-              float graticule_a_step,
-              const char  a_fmt[],
-               int   mini
-              );
-        ~PlotScalar();
-         void add_new_sample(int channel, float sample);
-         void add_new_short_samples(int channel, short samples[], int length, float scale_factor);
-
-    protected:
-
-         int      m_channels;
-        float    m_t_secs;
-        float    m_sample_period_secs;
-        float    m_a_min;
-        float    m_a_max;
-        float    m_graticule_t_step;   
-        float    m_graticule_a_step;
-        char     m_a_fmt[15];
-         int      m_mini;
-        int      m_samples;
-        float   *m_mem;              
-
-        void draw(wxAutoBufferedPaintDC&  dc);
-       void drawGraticule(wxAutoBufferedPaintDC&  dc);
-        void OnPaint(wxPaintEvent& event);
-        void OnSize(wxSizeEvent& event);
-        void OnShow(wxShowEvent& event);
-
-        DECLARE_EVENT_TABLE()
-};
-
-#endif // __FDMDV2_PLOT_SCALAR__
-
diff --git a/fdmdv2/branches/0.97/src/fdmdv2_plot_scatter.cpp b/fdmdv2/branches/0.97/src/fdmdv2_plot_scatter.cpp
deleted file mode 100644 (file)
index b9f5f7e..0000000
+++ /dev/null
@@ -1,176 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_plot_scatter.cpp
-// Purpose:         A scatter plot derivative of fdmdv2_plot.
-// Created:         June 24, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#include <string.h>
-#include "wx/wx.h"
-#include "fdmdv2_plot_scatter.h"
-
-BEGIN_EVENT_TABLE(PlotScatter, PlotPanel)
-    EVT_PAINT           (PlotScatter::OnPaint)
-    EVT_MOTION          (PlotScatter::OnMouseMove)
-    EVT_MOUSEWHEEL      (PlotScatter::OnMouseWheelMoved)
-    EVT_SIZE            (PlotScatter::OnSize)
-    EVT_SHOW            (PlotScatter::OnShow)
-//    EVT_ERASE_BACKGROUND(PlotScatter::OnErase)
-END_EVENT_TABLE()
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// PlotScatter
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-PlotScatter::PlotScatter(wxFrame* parent) : PlotPanel(parent)
-{
-    int i;
-
-    for(i=0; i < SCATTER_MEM_SYMS_MAX; i++)
-    {
-        m_mem[i].real = 0.0;
-        m_mem[i].imag = 0.0;
-    }
-
-    m_filter_max_xy = 0.1;
-
-    // defaults so we start off with something sensible
-
-    Nsym = 14+1;
-    scatterMemSyms = ((int)(SCATTER_MEM_SECS*(Nsym/DT)));
-    assert(scatterMemSyms <= SCATTER_MEM_SYMS_MAX);
-        
-}
-
-// changing number of carriers changes number of symoles to plot
-void PlotScatter::setNc(int Nc) {
-    Nsym = Nc+1;
-    assert(Nsym <= (FDMDV_NC_MAX+1));
-    scatterMemSyms = ((int)(SCATTER_MEM_SECS*(Nsym/DT)));
-    assert(scatterMemSyms <= SCATTER_MEM_SYMS_MAX);
-}
-
-//----------------------------------------------------------------
-// draw()
-//----------------------------------------------------------------
-void PlotScatter::draw(wxAutoBufferedPaintDC& dc)
-{
-    float x_scale;
-    float y_scale;
-    int   i,j;
-    int   x;
-    int   y;
-
-    m_rCtrl = GetClientRect();
-    m_rGrid = m_rCtrl;
-    m_rGrid = m_rGrid.Deflate(PLOT_BORDER + (XLEFT_OFFSET/2), (PLOT_BORDER + (YBOTTOM_OFFSET/2)));
-
-    // black background
-
-    dc.Clear();
-    m_rPlot = wxRect(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER, m_rGrid.GetWidth(), m_rGrid.GetHeight());
-    wxBrush ltGraphBkgBrush = wxBrush(BLACK_COLOR);
-    dc.SetBrush(ltGraphBkgBrush);
-    dc.SetPen(wxPen(BLACK_COLOR, 0));
-    dc.DrawRectangle(m_rPlot);
-    wxPen pen;
-    pen.SetColour(LIGHT_GREEN_COLOR);
-    pen.SetWidth(1);
-    dc.SetPen(pen);
-
-    // shift memory
-
-    for(i = 0; i < scatterMemSyms - Nsym; i++)
-    {
-        m_mem[i] = m_mem[i+Nsym];
-    }
-
-    // new samples
-
-    for(j=0; i < scatterMemSyms; i++,j++)
-    {
-        m_mem[i] = m_new_samples[j];
-    }
-
-    // automatically scale
-
-    float max_xy = 1E-12;
-    float real,imag;
-    for(i=0; i< scatterMemSyms; i++) {
-        real = fabs(m_mem[i].real);
-        imag = fabs(m_mem[i].imag);
-        if (real > max_xy)
-            max_xy = real;
-        if (imag > max_xy)
-            max_xy = imag;
-    }
-    m_filter_max_xy = BETA*m_filter_max_xy + (1 - BETA)*2.5*max_xy;
-    if (m_filter_max_xy < 0.001)
-        m_filter_max_xy = 0.001;
-    //printf("max_xy: %f m_filter_max_xy: %f\n", max_xy, m_filter_max_xy);
-
-    x_scale = (float)m_rGrid.GetWidth()/m_filter_max_xy;
-    y_scale = (float)m_rGrid.GetHeight()/m_filter_max_xy;
-
-    // draw all samples
-
-    for(i = 0; i < scatterMemSyms; i++)
-    {
-        x = x_scale * m_mem[i].real + m_rGrid.GetWidth()/2;
-        y = y_scale * m_mem[i].imag + m_rGrid.GetHeight()/2;
-       x += PLOT_BORDER + XLEFT_OFFSET;
-       y += PLOT_BORDER;
-       dc.DrawPoint(x, y);
-    }
-}
-
-//----------------------------------------------------------------
-// add_new_samples()
-//----------------------------------------------------------------
-void PlotScatter::add_new_samples(COMP samples[])
-{
-    int i;
-
-    for(i = 0; i < Nsym; i++)
-    {
-        m_new_samples[i] = samples[i];
-    }
-}
-
-//----------------------------------------------------------------
-// OnPaint()
-//----------------------------------------------------------------
-void PlotScatter::OnPaint(wxPaintEvent& event)
-{
-    wxAutoBufferedPaintDC dc(this);
-    draw(dc);
-}
-
-//----------------------------------------------------------------
-// OnSize()
-//----------------------------------------------------------------
-void PlotScatter::OnSize(wxSizeEvent& event)
-{
-    // todo: clear screen
-}
-
-//----------------------------------------------------------------
-// OnShow()
-//----------------------------------------------------------------
-void PlotScatter::OnShow(wxShowEvent& event)
-{
-}
-
diff --git a/fdmdv2/branches/0.97/src/fdmdv2_plot_scatter.h b/fdmdv2/branches/0.97/src/fdmdv2_plot_scatter.h
deleted file mode 100644 (file)
index 702f633..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_plot_scatter.h
-// Purpose:         A scatter plot derivative of fdmdv2_plot.
-// Created:         June 24, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#ifndef __FDMDV2_PLOT_SCATTER__
-#define __FDMDV2_PLOT_SCATTER__
-
-#include "comp.h"
-#include "fdmdv2_plot.h"
-#include "fdmdv2_defines.h"
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class PlotScatter
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class PlotScatter : public PlotPanel
-{
-    public:
-        PlotScatter(wxFrame* parent);
-        ~PlotScatter(){};
-       void add_new_samples(COMP samples[]);
-       void setNc(int Nc);
-
-    protected:
-        COMP m_mem[SCATTER_MEM_SYMS_MAX];
-        COMP m_new_samples[FDMDV_NC_MAX+1];
-
-        void draw(wxAutoBufferedPaintDC&  dc);
-        void OnPaint(wxPaintEvent& event);
-        void OnSize(wxSizeEvent& event);
-        void OnShow(wxShowEvent& event);
-
-        DECLARE_EVENT_TABLE()
-
-    private:
-        int   Nsym;
-        int   scatterMemSyms;
-        float m_filter_max_xy;
-};
-
-#endif //__FDMDV2_PLOT_SCATTER__
diff --git a/fdmdv2/branches/0.97/src/fdmdv2_plot_spectrum.cpp b/fdmdv2/branches/0.97/src/fdmdv2_plot_spectrum.cpp
deleted file mode 100644 (file)
index c08154e..0000000
+++ /dev/null
@@ -1,268 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_plot_waterfall.cpp
-// Purpose:         Implements a waterfall plot derivative of fdmdv2_plot.
-// Created:         June 23, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#include <string.h>
-#include "wx/wx.h"
-
-#include "fdmdv2_main.h"
-
-extern float g_avmag[];                 // average mag data passed to draw() 
-void fdmdv2_clickTune(float frequency); // callback to pass new click freq
-
-BEGIN_EVENT_TABLE(PlotSpectrum, PlotPanel)
-    EVT_MOTION          (PlotSpectrum::OnMouseMove)
-    EVT_LEFT_DOWN       (PlotSpectrum::OnMouseLeftDown)
-    EVT_LEFT_UP         (PlotSpectrum::OnMouseLeftUp)
-    EVT_MOUSEWHEEL      (PlotSpectrum::OnMouseWheelMoved)
-    EVT_PAINT           (PlotSpectrum::OnPaint)
-    EVT_SHOW            (PlotSpectrum::OnShow)
-END_EVENT_TABLE()
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class PlotSpectrum
-//
-// @class $(Name)
-// @author $(User)
-// @date $(Date)
-// @file $(CurrentFileName).$(CurrentFileExt)
-// @brief
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-PlotSpectrum::PlotSpectrum(wxFrame* parent, float *magdB, int n_magdB, 
-                           float min_mag_db, float max_mag_db, bool clickTune): PlotPanel(parent)
-{
-    m_greyscale     = 0;
-    m_Bufsz         = GetMaxClientSize();
-    m_newdata       = false;
-    m_firstPass     = true;
-    m_line_color    = 0;
-    SetLabelSize(10.0);
-
-    m_magdB         = magdB;
-    m_n_magdB       = n_magdB;     // number of points in magdB that covers 0 ... MAX_F_HZ of spectrum
-    m_max_mag_db    = max_mag_db;
-    m_min_mag_db    = min_mag_db;
-    m_rxFreq        = 0.0;
-    m_clickTune     = clickTune;
-}
-
-//----------------------------------------------------------------
-// ~PlotSpectrum()
-//----------------------------------------------------------------
-PlotSpectrum::~PlotSpectrum()
-{
-}
-
-//----------------------------------------------------------------
-// OnSize()
-//----------------------------------------------------------------
-void PlotSpectrum::OnSize(wxSizeEvent& event) {
-}
-
-//----------------------------------------------------------------
-// OnPaint()
-//----------------------------------------------------------------
-void PlotSpectrum::OnPaint(wxPaintEvent& event)
-{
-    wxAutoBufferedPaintDC dc(this);
-    draw(dc);
-}
-
-//----------------------------------------------------------------
-// OnShow()
-//----------------------------------------------------------------
-void PlotSpectrum::OnShow(wxShowEvent& event)
-{
-}
-
-//----------------------------------------------------------------
-// draw()
-//----------------------------------------------------------------
-void PlotSpectrum::draw(wxAutoBufferedPaintDC& dc)
-{
-    m_rCtrl  = GetClientRect();
-
-    // m_rGrid is coords of inner window we actually plot to.  We deflate it a bit
-    // to leave room for axis labels.  We need to work this out every time we draw
-    // as OnSize() may not be called before OnPaint(), for example when a new tab
-    // is selected
-
-    m_rGrid  = m_rCtrl;
-    m_rGrid = m_rGrid.Deflate(PLOT_BORDER + (XLEFT_OFFSET/2), (PLOT_BORDER + (YBOTTOM_OFFSET/2)));
-
-    dc.Clear();
-
-    // black background
-
-    m_rPlot = wxRect(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER, m_rGrid.GetWidth(), m_rGrid.GetHeight());
-    wxBrush ltGraphBkgBrush = wxBrush(BLACK_COLOR);
-    dc.SetBrush(ltGraphBkgBrush);
-    dc.SetPen(wxPen(BLACK_COLOR, 0));
-    dc.DrawRectangle(m_rPlot);
-
-    // draw spectrum
-
-    int   x, y, prev_x, prev_y, index;
-    float index_to_px, mag_dB_to_py, mag;
-
-    m_newdata = false;
-
-    wxPen pen;
-    pen.SetColour(DARK_GREEN_COLOR);
-    pen.SetWidth(1);
-    dc.SetPen(pen);
-
-    //index_to_px = ((float)FDMDV_MAX_F_HZ/(float)MAX_F_HZ)*(float)m_rGrid.GetWidth()/FDMDV_NSPEC;
-    index_to_px = (float)m_rGrid.GetWidth()/m_n_magdB;
-    mag_dB_to_py = (float)m_rGrid.GetHeight()/(m_max_mag_db - m_min_mag_db);
-    //int last_index = ((float)MAX_F_HZ/(float)FDMDV_MAX_F_HZ)*FDMDV_NSPEC;
-
-    prev_x = PLOT_BORDER + XLEFT_OFFSET;
-    prev_y = PLOT_BORDER;
-    for(index = 0; index < m_n_magdB; index++)
-    {
-        x = index*index_to_px;
-        mag = m_magdB[index];
-        if (mag > m_max_mag_db) mag = m_max_mag_db;
-        if (mag < m_min_mag_db) mag = m_min_mag_db;
-        y = -(mag - m_max_mag_db) * mag_dB_to_py;
-
-        x += PLOT_BORDER + XLEFT_OFFSET;
-        y += PLOT_BORDER;
-
-        if (index)
-            dc.DrawLine(x, y, prev_x, prev_y);
-        prev_x = x; prev_y = y;
-    }
-
-    // and finally draw Graticule
-
-    drawGraticule(dc);
-
-}
-
-//-------------------------------------------------------------------------
-// drawGraticule()
-//-------------------------------------------------------------------------
-void PlotSpectrum::drawGraticule(wxAutoBufferedPaintDC&  dc)
-{
-    int      x, y, text_w, text_h;
-    char     buf[15];
-    wxString s;
-    float    f, mag, freq_hz_to_px, mag_dB_to_py;
-
-    wxBrush ltGraphBkgBrush;
-    ltGraphBkgBrush.SetStyle(wxBRUSHSTYLE_TRANSPARENT);
-    ltGraphBkgBrush.SetColour(*wxBLACK);
-    dc.SetBrush(ltGraphBkgBrush);
-    dc.SetPen(wxPen(BLACK_COLOR, 1));
-
-    freq_hz_to_px = (float)m_rGrid.GetWidth()/(MAX_F_HZ-MIN_F_HZ);
-    mag_dB_to_py = (float)m_rGrid.GetHeight()/(m_max_mag_db - m_min_mag_db);
-
-    // upper LH coords of plot area are (PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER)
-    // lower RH coords of plot area are (PLOT_BORDER + XLEFT_OFFSET + m_rGrid.GetWidth(), 
-    //                                   PLOT_BORDER + m_rGrid.GetHeight())
-
-    // Check if small screen size means text will overlap
-
-    int textXStep = STEP_F_HZ*freq_hz_to_px;
-    int textYStep = STEP_MAG_DB*mag_dB_to_py;
-    sprintf(buf, "%4.0fHz", (float)MAX_F_HZ - STEP_F_HZ);
-    GetTextExtent(buf, &text_w, &text_h);
-    int overlappedText = (text_w > textXStep) || (text_h > textYStep);
-    //printf("text_w: %d textXStep: %d text_h: %d textYStep: %d  overlappedText: %d\n", text_w, textXStep, 
-    //      text_h, textYStep, overlappedText);
-
-    // Vertical gridlines
-
-    for(f=STEP_F_HZ; f<MAX_F_HZ; f+=STEP_F_HZ) {
-       x = f*freq_hz_to_px;
-       x += PLOT_BORDER + XLEFT_OFFSET;
-
-        dc.SetPen(m_penShortDash);
-        dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, PLOT_BORDER);
-        dc.SetPen(wxPen(BLACK_COLOR, 1));
-        dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET);
-
-        sprintf(buf, "%4.0fHz", f);
-       GetTextExtent(buf, &text_w, &text_h);
-        if (!overlappedText)
-            dc.DrawText(buf, x - text_w/2, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET);
-    }
-
-    dc.SetPen(wxPen(BLACK_COLOR, 1));
-    for(f=STEP_MINOR_F_HZ; f<MAX_F_HZ; f+=STEP_MINOR_F_HZ) 
-    {
-        x = f*freq_hz_to_px;
-        x += PLOT_BORDER + XLEFT_OFFSET;
-        dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET-5);
-    }
-    
-    // Horizontal gridlines
-
-    dc.SetPen(m_penDotDash);
-    for(mag=m_min_mag_db; mag<=m_max_mag_db; mag+=STEP_MAG_DB) {
-       y = -(mag - m_max_mag_db) * mag_dB_to_py;
-       y += PLOT_BORDER;
-       dc.DrawLine(PLOT_BORDER + XLEFT_OFFSET, y, 
-                   (m_rGrid.GetWidth() + PLOT_BORDER + XLEFT_OFFSET), y);
-        sprintf(buf, "%3.0fdB", mag);
-       GetTextExtent(buf, &text_w, &text_h);
-        if (!overlappedText)
-            dc.DrawText(buf, PLOT_BORDER + XLEFT_OFFSET - text_w - XLEFT_TEXT_OFFSET, y-text_h/2);
-    }
-
-    // red rx tuning line
-    
-    if (m_rxFreq != 0.0) {
-        dc.SetPen(wxPen(RED_COLOR, 2));
-        x = m_rxFreq*freq_hz_to_px;
-        x += PLOT_BORDER + XLEFT_OFFSET;
-        //printf("m_rxFreq %f x %d\n", m_rxFreq, x);
-        dc.DrawLine(x, m_rGrid.GetHeight()+ PLOT_BORDER, x, m_rCtrl.GetHeight());
-    }
-
-}
-
-//-------------------------------------------------------------------------
-// OnMouseDown()
-//-------------------------------------------------------------------------
-void PlotSpectrum::OnMouseLeftDown(wxMouseEvent& event)
-{
-    m_mouseDown = true;
-    wxClientDC dc(this);
-
-    wxPoint pt(event.GetLogicalPosition(dc));
-
-    // map x coord to edges of actual plot
-    pt.x -= PLOT_BORDER + XLEFT_OFFSET;
-    pt.y -= PLOT_BORDER;
-
-    // valid click if inside of plot
-    if ((pt.x >= 0) && (pt.x <= m_rGrid.GetWidth()) && (pt.y >=0) && m_clickTune) {
-        float freq_hz_to_px = (float)m_rGrid.GetWidth()/(MAX_F_HZ-MIN_F_HZ);
-        float clickFreq = (float)pt.x/freq_hz_to_px;
-
-        // see PlotWaterfall::OnMouseDown()
-
-        fdmdv2_clickTune(clickFreq);
-    }
-}
diff --git a/fdmdv2/branches/0.97/src/fdmdv2_plot_spectrum.h b/fdmdv2/branches/0.97/src/fdmdv2_plot_spectrum.h
deleted file mode 100644 (file)
index d3d579c..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_plot_spectrum.h
-// Purpose:         Defines a spectrum plot derived from fdmdv2_plot class.
-// Created:         June 22, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#ifndef __FDMDV2_PLOT_SPECTRUM__
-#define __FDMDV2_PLOT_SPECTRUM__
-
-#include "fdmdv2_plot.h"
-#include "fdmdv2_defines.h"
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class Waterfall
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class PlotSpectrum : public PlotPanel
-{
-    public:
-    PlotSpectrum(wxFrame* parent, float *magdB, int n_magdB, 
-                 float min_mag_db=MIN_MAG_DB, float max_mag_db=MAX_MAG_DB, bool clickTune=true);
-        ~PlotSpectrum();
-        void setRxFreq(float rxFreq) { m_rxFreq = rxFreq; }
-
-    protected:
-        void        OnPaint(wxPaintEvent& event);
-        void        OnSize(wxSizeEvent& event);
-        void        OnShow(wxShowEvent& event);
-        void        drawGraticule(wxAutoBufferedPaintDC& dc);
-        void        draw(wxAutoBufferedPaintDC& dc);
-        void        OnMouseLeftDown(wxMouseEvent& event);
-
-   private:
-        float       m_rxFreq;
-        float       m_max_mag_db;
-        float       m_min_mag_db;
-        float      *m_magdB;
-        int         m_n_magdB;  
-        bool        m_clickTune;
-
-        DECLARE_EVENT_TABLE()
-};
-
-#endif //__FDMDV2_PLOT_SPECTRUM__
diff --git a/fdmdv2/branches/0.97/src/fdmdv2_plot_waterfall.cpp b/fdmdv2/branches/0.97/src/fdmdv2_plot_waterfall.cpp
deleted file mode 100644 (file)
index b65c208..0000000
+++ /dev/null
@@ -1,481 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_plot_waterfall.cpp
-// Purpose:         Implements a waterfall plot derivative of fdmdv2_plot.
-// Created:         June 22, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#include <string.h>
-#include "wx/wx.h"
-#include "fdmdv2_main.h"
-
-extern float g_avmag[];                 // av mag spec passed in to draw() 
-void fdmdv2_clickTune(float frequency); // callback to pass new click freq
-
-BEGIN_EVENT_TABLE(PlotWaterfall, PlotPanel)
-    EVT_PAINT           (PlotWaterfall::OnPaint)
-    EVT_MOTION          (PlotWaterfall::OnMouseMove)
-    EVT_LEFT_DOWN       (PlotWaterfall::OnMouseLeftDown)
-    EVT_RIGHT_DOWN      (PlotWaterfall::OnMouseRightDown)
-    EVT_LEFT_UP         (PlotWaterfall::OnMouseLeftUp)
-    EVT_MOUSEWHEEL      (PlotWaterfall::OnMouseWheelMoved)
-    EVT_SIZE            (PlotWaterfall::OnSize)
-    EVT_SHOW            (PlotWaterfall::OnShow)
-END_EVENT_TABLE()
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class WaterfallPlot
-//
-// @class   WaterfallPlot
-// @author  David Witten
-// @date    $(Date)
-// @file    $(CurrentFileName).$(CurrentFileExt)
-// @brief
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-PlotWaterfall::PlotWaterfall(wxFrame* parent, bool graticule, int colour): PlotPanel(parent)
-{
-
-    for(int i = 0; i < 255; i++)
-    {
-        m_heatmap_lut[i] = heatmap((float)i, 0.0, 255.0);
-    }
-    m_graticule     = graticule;
-    m_colour        = colour;
-    m_Bufsz         = GetMaxClientSize();
-    m_newdata       = false;
-    m_firstPass     = true;
-    m_line_color    = 0;
-    SetLabelSize(10.0);
-
-    m_pBmp = NULL;
-    m_max_mag = MAX_MAG_DB;
-    m_min_mag = MIN_MAG_DB;
-}
-
-// When the window size gets set we can work outthe size of the window
-// we plot in and allocate a bit map of the correct size
-void PlotWaterfall::OnSize(wxSizeEvent& event) 
-{
-    // resize bit map
-
-    delete m_pBmp;
-    
-    m_rCtrl  = GetClientRect();
-
-    // m_rGrid is coords of inner window we actually plot to.  We deflate it a bit
-    // to leave room for axis labels.
-
-    m_rGrid  = m_rCtrl;
-    m_rGrid = m_rGrid.Deflate(PLOT_BORDER + (XLEFT_OFFSET/2), (PLOT_BORDER + (YBOTTOM_OFFSET/2)));
-
-    // we want a bit map the size of m_rGrid
-
-    m_pBmp = new wxBitmap(m_rGrid.GetWidth(), m_rGrid.GetHeight(), 24);
-
-    m_dT = DT;
-}
-
-//----------------------------------------------------------------
-// paintEvent()
-//
-// @class $(Name)
-// @author $(User)
-// @date $(Date)
-// @file $(CurrentFileName).$(CurrentFileExt)
-// @brief
-//
-// Called by the system of by wxWidgets when the panel needs
-// to be redrawn. You can also trigger this call by calling
-// Refresh()/Update().
-//----------------------------------------------------------------
-void PlotWaterfall::OnPaint(wxPaintEvent & evt)
-{
-    wxAutoBufferedPaintDC dc(this);
-    draw(dc);
-}
-
-//----------------------------------------------------------------
-// OnShow()
-//----------------------------------------------------------------
-void PlotWaterfall::OnShow(wxShowEvent& event)
-{
-}
-
-//----------------------------------------------------------------
-// ~PlotWaterfall()
-//----------------------------------------------------------------
-PlotWaterfall::~PlotWaterfall()
-{
-}
-
-//----------------------------------------------------------------
-// heatmap()
-// map val to a rgb colour
-// from http://eddiema.ca/2011/01/21/c-sharp-heatmaps/
-//----------------------------------------------------------------
-unsigned PlotWaterfall::heatmap(float val, float min, float max)
-{
-    unsigned r = 0;
-    unsigned g = 0;
-    unsigned b = 0;
-
-    val = (val - min) / (max - min);
-    if(val <= 0.2)
-    {
-        b = (unsigned)((val / 0.2) * 255);
-    }
-    else if(val >  0.2 &&  val <= 0.7)
-    {
-        b = (unsigned)((1.0 - ((val - 0.2) / 0.5)) * 255);
-    }
-    if(val >= 0.2 &&  val <= 0.6)
-    {
-        g = (unsigned)(((val - 0.2) / 0.4) * 255);
-    }
-    else if(val >  0.6 &&  val <= 0.9)
-    {
-        g = (unsigned)((1.0 - ((val - 0.6) / 0.3)) * 255);
-    }
-    if(val >= 0.5)
-    {
-        r = (unsigned)(((val - 0.5) / 0.5) * 255);
-    }
-    //printf("%f %x %x %x\n", val, r, g, b);
-    return  (b << 16) + (g << 8) + r;
-}
-
-bool PlotWaterfall::checkDT(void)
-{
-    // Check dY is > 1 pixel before proceeding. For small screens
-    // and large WATERFALL_SECS_Y we might have less than one
-    // block per pixel.  In this case increase m_dT and perform draw
-    // less often
-
-    float px_per_sec = (float)m_rGrid.GetHeight() / WATERFALL_SECS_Y;
-    float dy = m_dT * px_per_sec;
-    
-    if (dy < 1.0) {
-        m_dT += DT;
-        return false;
-    }
-    else
-        return true;
-}
-
-//----------------------------------------------------------------
-// draw()
-//----------------------------------------------------------------
-void PlotWaterfall::draw(wxAutoBufferedPaintDC& dc)
-{
-
-    m_rCtrl  = GetClientRect();
-
-    // m_rGrid is coords of inner window we actually plot to.  We deflate it a bit
-    // to leave room for axis labels.
-
-    m_rGrid = m_rCtrl;
-    m_rGrid = m_rGrid.Deflate(PLOT_BORDER + (XLEFT_OFFSET/2), (PLOT_BORDER + (YBOTTOM_OFFSET/2)));
-
-    if (m_pBmp == NULL) 
-    {
-        // we want a bit map the size of m_rGrid
-        m_pBmp = new wxBitmap(m_rGrid.GetWidth(), m_rGrid.GetHeight(), 24);
-    }
-
-    dc.Clear();
-
-    if(m_newdata)
-    {
-        m_newdata = false;
-        plotPixelData();
-        dc.DrawBitmap(*m_pBmp, PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER);
-        m_dT = DT;
-    }
-    else 
-    {
-
-        // no data to plot so just erase to black.  Blue looks nicer
-        // but is same colour as low amplitude signal
-
-        // Bug on Linux: When Stop is pressed this code doesn't erase
-        // the lower 25% of the Waterfall Window
-
-        m_rPlot = wxRect(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER, m_rGrid.GetWidth(), m_rGrid.GetHeight());
-        wxBrush ltGraphBkgBrush = wxBrush(BLACK_COLOR);
-        dc.SetBrush(ltGraphBkgBrush);
-        dc.SetPen(wxPen(BLACK_COLOR, 0));
-        dc.DrawRectangle(m_rPlot);
-    }
-    drawGraticule(dc);
-}
-
-//-------------------------------------------------------------------------
-// drawGraticule()
-//-------------------------------------------------------------------------
-void PlotWaterfall::drawGraticule(wxAutoBufferedPaintDC& dc)
-{
-    int      x, y, text_w, text_h;
-    char     buf[15];
-    wxString s;
-    float    f, time, freq_hz_to_px, time_s_to_py;
-
-    wxBrush ltGraphBkgBrush;
-    ltGraphBkgBrush.SetStyle(wxBRUSHSTYLE_TRANSPARENT);
-    ltGraphBkgBrush.SetColour(*wxBLACK);
-    dc.SetBrush(ltGraphBkgBrush);
-    dc.SetPen(wxPen(BLACK_COLOR, 1));
-
-    freq_hz_to_px = (float)m_rGrid.GetWidth()/(MAX_F_HZ-MIN_F_HZ);
-    time_s_to_py = (float)m_rGrid.GetHeight()/WATERFALL_SECS_Y;
-
-    // upper LH coords of plot area are (PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER)
-    // lower RH coords of plot area are (PLOT_BORDER + XLEFT_OFFSET + m_rGrid.GetWidth(), 
-    //                                   PLOT_BORDER + m_rGrid.GetHeight())
-
-    // Check if small screen size means text will overlap
-
-    int textXStep = STEP_F_HZ*freq_hz_to_px;
-    int textYStep = WATERFALL_SECS_STEP*time_s_to_py;
-    sprintf(buf, "%4.0fHz", (float)MAX_F_HZ - STEP_F_HZ);
-    GetTextExtent(buf, &text_w, &text_h);
-    int overlappedText = (text_w > textXStep) || (text_h > textYStep);
-
-    // Major Vertical gridlines and legend
-    //dc.SetPen(m_penShortDash);
-    for(f=STEP_F_HZ; f<MAX_F_HZ; f+=STEP_F_HZ) 
-    {
-        x = f*freq_hz_to_px;
-        x += PLOT_BORDER + XLEFT_OFFSET;
-
-        if (m_graticule)
-            dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, PLOT_BORDER);
-        else
-            dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET);
-            
-        sprintf(buf, "%4.0fHz", f);
-        GetTextExtent(buf, &text_w, &text_h);
-        if (!overlappedText)
-            dc.DrawText(buf, x - text_w/2, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET);
-    }
-
-    for(f=STEP_MINOR_F_HZ; f<MAX_F_HZ; f+=STEP_MINOR_F_HZ) 
-    {
-        x = f*freq_hz_to_px;
-        x += PLOT_BORDER + XLEFT_OFFSET;
-        dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET-5);
-    }
-    
-    // Horizontal gridlines
-    dc.SetPen(m_penDotDash);
-    for(time=0; time<=WATERFALL_SECS_Y; time+=WATERFALL_SECS_STEP) {
-       y = m_rGrid.GetHeight() - time*time_s_to_py;
-       y += PLOT_BORDER;
-
-        if (m_graticule)
-            dc.DrawLine(PLOT_BORDER + XLEFT_OFFSET, y, 
-                        (m_rGrid.GetWidth() + PLOT_BORDER + XLEFT_OFFSET), y);
-        sprintf(buf, "%3.0fs", time);
-       GetTextExtent(buf, &text_w, &text_h);
-        if (!overlappedText)
-            dc.DrawText(buf, PLOT_BORDER + XLEFT_OFFSET - text_w - XLEFT_TEXT_OFFSET, y-text_h/2);
-   }
-
-    // red rx tuning line
-    dc.SetPen(wxPen(RED_COLOR, 2));
-    x = m_rxFreq*freq_hz_to_px;
-    x += PLOT_BORDER + XLEFT_OFFSET;
-    //printf("m_rxFreq %f x %d\n", m_rxFreq, x);
-    dc.DrawLine(x, m_rGrid.GetHeight()+ PLOT_BORDER, x, m_rCtrl.GetHeight());
-    
-}
-
-//-------------------------------------------------------------------------
-// plotPixelData()
-//-------------------------------------------------------------------------
-void PlotWaterfall::plotPixelData()
-{
-    float       spec_index_per_px;
-    float       intensity_per_dB;
-    float       px_per_sec;
-    int         index;
-    float       dy;
-    int         dy_blocks;
-    int         b;
-    int         px;
-    int         py;
-    int         intensity;
-
-    /*
-      Design Notes:
-
-      The height in pixels represents WATERFALL_SECS_Y of data.  Every DT
-      seconds we get a vector of FDMDV_NSPEC spectrum samples which we use
-      to update the last row.  The height of each row is dy pixels, which
-      maps to DT seconds.  We call each dy high rectangle of pixels a
-      block.
-
-    */
-
-    // determine dy, the height of one "block"
-    px_per_sec = (float)m_rGrid.GetHeight() / WATERFALL_SECS_Y;
-    dy = m_dT * px_per_sec;
-
-    // number of dy high blocks in spectrogram
-    dy_blocks = m_rGrid.GetHeight()/ dy;
-
-    // update min and max amplitude estimates
-    float max_mag = MIN_MAG_DB;
-
-    int min_fft_bin=((float)200/FDMDV_MAX_F_HZ)*FDMDV_NSPEC;
-    int max_fft_bin=((float)2800/FDMDV_MAX_F_HZ)*FDMDV_NSPEC;
-
-    for(int i=min_fft_bin; i<max_fft_bin; i++) 
-    {
-        if (g_avmag[i] > max_mag)
-        {
-            max_mag = g_avmag[i];
-        }
-    }
-
-    m_max_mag = BETA*m_max_mag + (1 - BETA)*max_mag;
-    m_min_mag = max_mag - 20.0;
-    //printf("max_mag: %f m_max_mag: %f\n", max_mag, m_max_mag);
-    //intensity_per_dB  = (float)256 /(MAX_MAG_DB - MIN_MAG_DB);
-    intensity_per_dB  = (float)256 /(m_max_mag - m_min_mag);
-    spec_index_per_px = ((float)(MAX_F_HZ)/(float)FDMDV_MAX_F_HZ)*(float)FDMDV_NSPEC / (float) m_rGrid.GetWidth();
-
-    /*
-    printf("h %d w %d px_per_sec %d dy %d dy_blocks %d spec_index_per_px: %f\n", 
-       m_rGrid.GetHeight(), m_rGrid.GetWidth(), px_per_sec, 
-       dy, dy_blocks, spec_index_per_px);
-    */
-
-    // Shift previous bit map up one row of blocks ----------------------------
-    wxNativePixelData data(*m_pBmp);
-    wxNativePixelData::Iterator bitMapStart(data);
-    wxNativePixelData::Iterator p = bitMapStart;
-
-    for(b = 0; b < dy_blocks - 1; b++) 
-    {
-        wxNativePixelData::Iterator psrc = bitMapStart;
-        wxNativePixelData::Iterator pdest = bitMapStart;
-        pdest.OffsetY(data, dy * b);
-        psrc.OffsetY(data, dy * (b+1));
-
-        // copy one line of blocks
-
-        for(py = 0; py < dy; py++) 
-        {
-            wxNativePixelData::Iterator pdestRowStart = pdest;
-            wxNativePixelData::Iterator psrcRowStart = psrc;
-
-            for(px = 0; px < m_rGrid.GetWidth(); px++) 
-            {
-                pdest.Red() = psrc.Red();
-                pdest.Green() = psrc.Green();
-                pdest.Blue() = psrc.Blue();
-                pdest++;
-                psrc++;
-            }
-            pdest = pdestRowStart;
-            pdest.OffsetY(data, 1);
-            psrc = psrcRowStart;
-            psrc.OffsetY(data, 1);         
-        }
-    }
-
-    // Draw last line of blocks using latest amplitude data ------------------
-    p = bitMapStart;
-    p.OffsetY(data, dy *(dy_blocks - 1));
-    for(py = 0; py < dy; py++)
-    {
-        wxNativePixelData::Iterator rowStart = p;
-
-        for(px = 0; px < m_rGrid.GetWidth(); px++)
-        {
-            index = px * spec_index_per_px;
-            assert(index < FDMDV_NSPEC);
-
-            intensity = intensity_per_dB * (g_avmag[index] - m_min_mag);
-            if(intensity > 255) intensity = 255;
-            if (intensity < 0) intensity = 0;
-            //printf("%d %f %d \n", index, g_avmag[index], intensity);
-
-            switch (m_colour) {
-            case 0:
-                p.Red() = m_heatmap_lut[intensity] & 0xff;
-                p.Green() = (m_heatmap_lut[intensity] >> 8) & 0xff;
-                p.Blue() = (m_heatmap_lut[intensity] >> 16) & 0xff;
-                break;
-            case 1:
-                p.Red() = intensity;
-                p.Green() = intensity;
-                p.Blue() = intensity;       
-                break;
-            case 2:
-                p.Red() = intensity;
-                p.Green() = intensity;
-                if (intensity < 127)
-                    p.Blue() = intensity*2;
-                else
-                    p.Blue() = 255;
-                        
-                break;
-            }
-            ++p;
-        }
-        p = rowStart;
-        p.OffsetY(data, 1);
-    }
-
-}
-
-//-------------------------------------------------------------------------
-// OnMouseLeftDown()
-//-------------------------------------------------------------------------
-void PlotWaterfall::OnMouseLeftDown(wxMouseEvent& event)
-{
-    m_mouseDown = true;
-    wxClientDC dc(this);
-
-    wxPoint pt(event.GetLogicalPosition(dc));
-
-    // map x coord to edges of actual plot
-    pt.x -= PLOT_BORDER + XLEFT_OFFSET;
-    pt.y -= PLOT_BORDER;
-
-    // valid click if inside of plot
-    if ((pt.x >= 0) && (pt.x <= m_rGrid.GetWidth()) && (pt.y >=0)) 
-    {
-        float freq_hz_to_px = (float)m_rGrid.GetWidth()/(MAX_F_HZ-MIN_F_HZ);
-        float clickFreq = (float)pt.x/freq_hz_to_px;
-
-        // communicate back to other threads
-        fdmdv2_clickTune(clickFreq);
-    }
-}
-
-//-------------------------------------------------------------------------
-// OnMouseRightDown()
-//-------------------------------------------------------------------------
-void PlotWaterfall::OnMouseRightDown(wxMouseEvent& event)
-{
-    m_colour++;
-    if (m_colour == 3)
-        m_colour = 0;
-}
-
diff --git a/fdmdv2/branches/0.97/src/fdmdv2_plot_waterfall.h b/fdmdv2/branches/0.97/src/fdmdv2_plot_waterfall.h
deleted file mode 100644 (file)
index e5c0e83..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_plot_waterfall.h
-// Purpose:         Defines a waterfall plot derivative of fdmdv2_plot.
-// Created:         June 22, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#ifndef __FDMDV2_PLOT_WATERFALL__
-#define __FDMDV2_PLOT_WATERFALL__
-
-#include "fdmdv2_plot.h"
-#include "fdmdv2_defines.h"
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class PlotWaterfall
-//
-// @class $(Name)
-// @author $(User)
-// @date $(Date)
-// @file $(CurrentFileName).$(CurrentFileExt)
-// @brief
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class PlotWaterfall : public PlotPanel
-{
-    public:
-    PlotWaterfall(wxFrame* parent, bool graticule, int colour);
-        ~PlotWaterfall();
-        bool checkDT(void);
-        void setGreyscale(bool greyscale) { m_greyscale = greyscale; }
-        void setRxFreq(float rxFreq) { m_rxFreq = rxFreq; }
-
-    protected:
-        unsigned    m_heatmap_lut[256];
-
-        unsigned    heatmap(float val, float min, float max);
-
-        void        OnPaint(wxPaintEvent & evt);
-        void        OnSize(wxSizeEvent& event);
-        void        OnShow(wxShowEvent& event);
-        void        drawGraticule(wxAutoBufferedPaintDC&  dc);
-        void        draw(wxAutoBufferedPaintDC& dc);
-        void        plotPixelData();
-        void        OnMouseLeftDown(wxMouseEvent& event);
-        void        OnMouseRightDown(wxMouseEvent& event);
-
-    private:
-        float       m_dT;
-        float       m_rxFreq;
-        bool        m_graticule;
-        float       m_min_mag;
-        float       m_max_mag;
-        int         m_colour;
-
-        DECLARE_EVENT_TABLE()
-};
-
-#endif //__FDMDV2_PLOT_WATERFALL__
diff --git a/fdmdv2/branches/0.97/src/hamlib.cpp b/fdmdv2/branches/0.97/src/hamlib.cpp
deleted file mode 100644 (file)
index 575f36a..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-//==========================================================================
-// Name:            hamlib.cpp
-//
-// Purpose:         Hamlib integration for FreeDV
-// Created:         May 2013
-// Authors:         Joel Stanley
-//
-// 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#include <hamlib.h>
-
-#include <vector>
-#include <algorithm>
-
-using namespace std;
-
-typedef std::vector<const struct rig_caps *> riglist_t;
-
-static bool rig_cmp(const struct rig_caps *rig1, const struct rig_caps *rig2);
-static int build_list(const struct rig_caps *rig, rig_ptr_t);
-
-Hamlib::Hamlib() : m_rig(NULL) {
-    /* Stop hamlib from spewing info to stderr. */
-    rig_set_debug(RIG_DEBUG_NONE);
-
-    /* Create sorted list of rigs. */
-    rig_load_all_backends();
-    rig_list_foreach(build_list, &m_rigList);
-    sort(m_rigList.begin(), m_rigList.end(), rig_cmp);
-
-    /* Reset debug output. */
-    rig_set_debug(RIG_DEBUG_VERBOSE);
-
-       m_rig = NULL;
-}
-
-Hamlib::~Hamlib() {
-       if(m_rig)
-               close();
-}
-
-static int build_list(const struct rig_caps *rig, rig_ptr_t rigList) {
-    ((riglist_t *)rigList)->push_back(rig); 
-    return 1;
-}
-
-static bool rig_cmp(const struct rig_caps *rig1, const struct rig_caps *rig2) {
-    /* Compare manufacturer. */
-    int r = strcasecmp(rig1->mfg_name, rig2->mfg_name);
-    if (r != 0)
-        return r < 0;
-
-    /* Compare model. */
-    r = strcasecmp(rig1->model_name, rig2->model_name);
-    if (r != 0)
-        return r < 0;
-
-    /* Compare rig ID. */
-    return rig1->rig_model < rig2->rig_model;
-}
-
-void Hamlib::populateComboBox(wxComboBox *cb) {
-
-    riglist_t::const_iterator rig = m_rigList.begin();
-    for (; rig !=m_rigList.end(); rig++) {
-        char name[128];
-        snprintf(name, 128, "%s %s", (*rig)->mfg_name, (*rig)->model_name); 
-        cb->Append(name);
-    }
-}
-
-bool Hamlib::connect(unsigned int rig_index, const char *serial_port) {
-    /* Look up model from index. */
-    if (rig_index >= m_rigList.size()) {
-        return false;
-    }
-    printf("rig: %s %s (%d)\n", m_rigList[rig_index]->mfg_name,
-            m_rigList[rig_index]->model_name, m_rigList[rig_index]->rig_model);
-
-       if(m_rig) {
-               printf("Closing old hamlib instance!\n");
-               close();
-       }
-
-    /* Initialise, configure and open. */
-    m_rig = rig_init(m_rigList[rig_index]->rig_model);
-    /* TODO: Also use baud rate from the screen. */
-    if (!m_rig)
-        return false;
-    token_t token = rig_token_lookup(m_rig, "rig_pathname");
-    if (rig_set_conf(m_rig, token, serial_port) != RIG_OK) {
-        return false;
-    }
-    if (rig_open(m_rig) == RIG_OK) {
-        return true;
-    }
-    return false;
-}
-
-bool Hamlib::ptt(bool press) {
-       if(!m_rig)
-               return false;
-    /* TODO(Joel): make ON_DATA and ON configurable. */
-    ptt_t on = press ? RIG_PTT_ON : RIG_PTT_OFF;
-    /* TODO(Joel): what should the VFO option be? */
-    return rig_set_ptt(m_rig, RIG_VFO_CURR, on) == RIG_OK;
-}
-
-void Hamlib::close(void) {
-       if(m_rig) {
-               rig_close(m_rig);
-               rig_cleanup(m_rig);
-               m_rig = NULL;
-       }
-}
diff --git a/fdmdv2/branches/0.97/src/hamlib.h b/fdmdv2/branches/0.97/src/hamlib.h
deleted file mode 100644 (file)
index fe3496f..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-#ifndef HAMLIB_H
-#define HAMLIB_H
-
-extern "C" {
-#include <hamlib/rig.h>
-}
-#include <wx/combobox.h>
-#include <vector>
-
-class Hamlib {
-
-    public:
-        Hamlib();
-        ~Hamlib();
-        void populateComboBox(wxComboBox *cb);
-        bool connect(unsigned int rig_index, const char *serial_port);
-        bool ptt(bool press);
-        void close(void);
-
-        typedef std::vector<const struct rig_caps *> riglist_t;
-
-    private:
-        RIG *m_rig;
-        /* Sorted list of rigs. */
-        riglist_t m_rigList;
-};
-
-#endif /*HAMLIB_H*/
diff --git a/fdmdv2/branches/0.97/src/sox.h b/fdmdv2/branches/0.97/src/sox.h
deleted file mode 100644 (file)
index 07aedeb..0000000
+++ /dev/null
@@ -1,2608 +0,0 @@
-/* libSoX Library Public Interface
- *
- * Copyright 1999-2011 Chris Bagwell and SoX Contributors.
- *
- * This source code is freely redistributable and may be used for
- * any purpose.  This copyright notice must be maintained.
- * Chris Bagwell And SoX Contributors are not responsible for
- * the consequences of using this software.
- */
-
-/** @file
-Contains the interface exposed to clients of the libSoX library.
-Symbols starting with "sox_" or "SOX_" are part of the public interface for
-libSoX clients (applications that consume libSoX). Symbols starting with
-"lsx_" or "LSX_" are internal use by libSoX and plugins.
-LSX_ and lsx_ symbols should not be used by libSoX-based applications.
-*/
-
-#ifndef SOX_H
-#define SOX_H /**< Client API: This macro is defined if sox.h has been included. */
-
-#include <limits.h>
-#include <stdarg.h>
-#include <stddef.h>
-
-#if defined(__cplusplus)
-extern "C" {
-#endif
-
-/* Suppress warnings from use of type long long. */
-#if defined __GNUC__
-#pragma GCC system_header
-#endif
-
-/*****************************************************************************
-API decoration macros:
-Mostly for documentation purposes. For some compilers, decorations also affect
-code generation, influence compiler warnings or activate compiler
-optimizations.
-*****************************************************************************/
-
-/**
-Plugins API:
-Attribute required on all functions exported by libSoX and on all function
-pointer types used by the libSoX API.
-*/
-#ifdef __GNUC__
-#define LSX_API  __attribute__ ((cdecl)) /* libSoX function */
-#elif _MSC_VER
-#define LSX_API  __cdecl /* libSoX function */
-#else
-#define LSX_API /* libSoX function */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter or local variable to suppress warnings about
-the variable being unused (especially in macro-generated code).
-*/
-#ifdef __GNUC__
-#define LSX_UNUSED  __attribute__ ((unused)) /* Parameter or local variable is intentionally unused. */
-#else
-#define LSX_UNUSED /* Parameter or local variable is intentionally unused. */
-#endif
-
-/**
-Plugins API:
-LSX_PRINTF12: Attribute applied to a function to indicate that it requires
-a printf-style format string for arg1 and that printf parameters start at
-arg2.
-*/
-#ifdef __GNUC__
-#define LSX_PRINTF12  __attribute__ ((format (printf, 1, 2))) /* Function has printf-style arguments. */
-#else
-#define LSX_PRINTF12 /* Function has printf-style arguments. */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a function to indicate that it has no side effects and
-depends only its input parameters and global memory. If called repeatedly, it
-returns the same result each time.
-*/
-#ifdef __GNUC__
-#define LSX_RETURN_PURE __attribute__ ((pure)) /* Function is pure. */
-#else
-#define LSX_RETURN_PURE /* Function is pure. */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a function to indicate that the
-return value is always a pointer to a valid object (never NULL).
-*/
-#ifdef _Ret_
-#define LSX_RETURN_VALID _Ret_ /* Function always returns a valid object (never NULL). */
-#else
-#define LSX_RETURN_VALID /* Function always returns a valid object (never NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a function to indicate that the return value is always a
-pointer to a valid array (never NULL).
-*/
-#ifdef _Ret_valid_
-#define LSX_RETURN_ARRAY _Ret_valid_ /* Function always returns a valid array (never NULL). */
-#else
-#define LSX_RETURN_ARRAY /* Function always returns a valid array (never NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a function to indicate that the return value is always a
-pointer to a valid 0-terminated array (never NULL).
-*/
-#ifdef _Ret_z_
-#define LSX_RETURN_VALID_Z _Ret_z_ /* Function always returns a 0-terminated array (never NULL). */
-#else
-#define LSX_RETURN_VALID_Z /* Function always returns a 0-terminated array (never NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a function to indicate that the returned pointer may be
-null.
-*/
-#ifdef _Ret_opt_
-#define LSX_RETURN_OPT _Ret_opt_ /* Function may return NULL. */
-#else
-#define LSX_RETURN_OPT /* Function may return NULL. */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a valid
-pointer to one const element of the pointed-to type (never NULL).
-*/
-#ifdef _In_
-#define LSX_PARAM_IN _In_ /* Required const pointer to a valid object (never NULL). */
-#else
-#define LSX_PARAM_IN /* Required const pointer to a valid object (never NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a valid
-pointer to a const 0-terminated string (never NULL).
-*/
-#ifdef _In_z_
-#define LSX_PARAM_IN_Z _In_z_ /* Required const pointer to 0-terminated string (never NULL). */
-#else
-#define LSX_PARAM_IN_Z /* Required const pointer to 0-terminated string (never NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a const
-pointer to a 0-terminated printf format string.
-*/
-#ifdef _Printf_format_string_
-#define LSX_PARAM_IN_PRINTF _Printf_format_string_ /* Required const pointer to 0-terminated printf format string (never NULL). */
-#else
-#define LSX_PARAM_IN_PRINTF /* Required const pointer to 0-terminated printf format string (never NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a valid
-pointer to (len) const initialized elements of the pointed-to type, where
-(len) is the name of another parameter.
-@param len The parameter that contains the number of elements in the array.
-*/
-#ifdef _In_count_
-#define LSX_PARAM_IN_COUNT(len) _In_count_(len) /* Required const pointer to (len) valid objects (never NULL). */
-#else
-#define LSX_PARAM_IN_COUNT(len) /* Required const pointer to (len) valid objects (never NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a valid
-pointer to (len) const bytes of initialized data, where (len) is the name of
-another parameter.
-@param len The parameter that contains the number of bytes in the array.
-*/
-#ifdef _In_bytecount_
-#define LSX_PARAM_IN_BYTECOUNT(len) _In_bytecount_(len) /* Required const pointer to (len) bytes of data (never NULL). */
-#else
-#define LSX_PARAM_IN_BYTECOUNT(len) /* Required const pointer to (len) bytes of data (never NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is either NULL
-or a valid pointer to one const element of the pointed-to type.
-*/
-#ifdef _In_opt_
-#define LSX_PARAM_IN_OPT _In_opt_ /* Optional const pointer to a valid object (may be NULL). */
-#else
-#define LSX_PARAM_IN_OPT /* Optional const pointer to a valid object (may be NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is either NULL
-or a valid pointer to a const 0-terminated string.
-*/
-#ifdef _In_opt_z_
-#define LSX_PARAM_IN_OPT_Z _In_opt_z_ /* Optional const pointer to 0-terminated string (may be NULL). */
-#else
-#define LSX_PARAM_IN_OPT_Z /* Optional const pointer to 0-terminated string (may be NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a valid
-pointer to one initialized element of the pointed-to type (never NULL). The
-function may modify the element.
-*/
-#ifdef _Inout_
-#define LSX_PARAM_INOUT _Inout_ /* Required pointer to a valid object (never NULL). */
-#else
-#define LSX_PARAM_INOUT /* Required pointer to a valid object (never NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a valid
-pointer to (len) initialized elements of the pointed-to type (never NULL). The
-function may modify the elements.
-@param len The parameter that contains the number of elements in the array.
-*/
-#ifdef _Inout_count_x_
-#define LSX_PARAM_INOUT_COUNT(len) _Inout_count_x_(len) /* Required pointer to (len) valid objects (never NULL). */
-#else
-#define LSX_PARAM_INOUT_COUNT(len) /* Required pointer to (len) valid objects (never NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a valid
-pointer to memory sufficient for one element of the pointed-to type (never
-NULL). The function will initialize the element.
-*/
-#ifdef _Out_
-#define LSX_PARAM_OUT _Out_ /* Required pointer to an object to be initialized (never NULL). */
-#else
-#define LSX_PARAM_OUT /* Required pointer to an object to be initialized (never NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a valid
-pointer to memory sufficient for (len) bytes of data (never NULL), where (len)
-is the name of another parameter. The function may write up to len bytes of
-data to this memory.
-@param len The parameter that contains the number of bytes in the array.
-*/
-#ifdef _Out_bytecap_
-#define LSX_PARAM_OUT_BYTECAP(len) _Out_bytecap_(len) /* Required pointer to writable buffer with room for len bytes. */
-#else
-#define LSX_PARAM_OUT_BYTECAP(len) /* Required pointer to writable buffer with room for len bytes. */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a valid
-pointer to memory sufficient for (len) elements of the pointed-to type (never
-NULL), where (len) is the name of another parameter. On return, (filled)
-elements will have been initialized, where (filled) is either the dereference
-of another pointer parameter (for example "*written") or the "return"
-parameter (indicating that the function returns the number of elements
-written).
-@param len The parameter that contains the number of elements in the array.
-@param filled The dereference of the parameter that receives the number of elements written to the array, or "return" if the value is returned.
-*/
-#ifdef _Out_cap_post_count_
-#define LSX_PARAM_OUT_CAP_POST_COUNT(len,filled) _Out_cap_post_count_(len,filled) /* Required pointer to buffer for (len) elements (never NULL); on return, (filled) elements will have been initialized. */
-#else
-#define LSX_PARAM_OUT_CAP_POST_COUNT(len,filled) /* Required pointer to buffer for (len) elements (never NULL); on return, (filled) elements will have been initialized. */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a valid
-pointer to memory sufficient for (len) elements of the pointed-to type (never
-NULL), where (len) is the name of another parameter. On return, (filled+1)
-elements will have been initialized, with the last element having been
-initialized to 0, where (filled) is either the dereference of another pointer
-parameter (for example, "*written") or the "return" parameter (indicating that
-the function returns the number of elements written).
-@param len The parameter that contains the number of elements in the array.
-@param filled The dereference of the parameter that receives the number of elements written to the array (not counting the terminating null), or "return" if the value is returned.
-*/
-#ifdef _Out_z_cap_post_count_
-#define LSX_PARAM_OUT_Z_CAP_POST_COUNT(len,filled) _Out_z_cap_post_count_(len,filled) /* Required pointer to buffer for (len) elements (never NULL); on return, (filled+1) elements will have been initialized, and the array will be 0-terminated. */
-#else
-#define LSX_PARAM_OUT_Z_CAP_POST_COUNT(len,filled) /* Required pointer to buffer for (len) elements (never NULL); on return, (filled+1) elements will have been initialized, and the array will be 0-terminated. */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is either NULL
-or a valid pointer to memory sufficient for one element of the pointed-to
-type. The function will initialize the element.
-*/
-#ifdef _Out_opt_
-#define LSX_PARAM_OUT_OPT _Out_opt_ /* Optional pointer to an object to be initialized (may be NULL). */
-#else
-#define LSX_PARAM_OUT_OPT /* Optional pointer to an object to be initialized (may be NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a valid
-pointer (never NULL) to another pointer which may be NULL when the function is
-invoked.
-*/
-#ifdef _Deref_pre_maybenull_
-#define LSX_PARAM_DEREF_PRE_MAYBENULL _Deref_pre_maybenull_ /* Required pointer (never NULL) to another pointer (may be NULL). */
-#else
-#define LSX_PARAM_DEREF_PRE_MAYBENULL /* Required pointer (never NULL) to another pointer (may be NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a valid
-pointer (never NULL) to another pointer which will be NULL when the function
-returns.
-*/
-#ifdef _Deref_post_null_
-#define LSX_PARAM_DEREF_POST_NULL _Deref_post_null_ /* Required pointer (never NULL) to another pointer, which will be NULL on exit. */
-#else
-#define LSX_PARAM_DEREF_POST_NULL /* Required pointer (never NULL) to another pointer, which will be NULL on exit. */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a valid
-pointer (never NULL) to another pointer which will be non-NULL when the
-function returns.
-*/
-#ifdef _Deref_post_notnull_
-#define LSX_PARAM_DEREF_POST_NOTNULL _Deref_post_notnull_ /* Required pointer (never NULL) to another pointer, which will be valid (not NULL) on exit. */
-#else
-#define LSX_PARAM_DEREF_POST_NOTNULL /* Required pointer (never NULL) to another pointer, which will be valid (not NULL) on exit. */
-#endif
-
-/**
-Plugins API:
-Expression that "uses" a potentially-unused variable to avoid compiler
-warnings (especially in macro-generated code).
-*/
-#ifdef _PREFAST_
-#define LSX_USE_VAR(x)  ((void)(x=0)) /* During static analysis, initialize unused variables to 0. */
-#else
-#define LSX_USE_VAR(x)  ((void)(x)) /* Parameter or variable is intentionally unused. */
-#endif
-
-/**
-Plugins API:
-Compile-time assertion. Causes a compile error if the expression is false.
-@param e  The expression to test. If expression is false, compilation will fail.
-@param f  A unique identifier for the test, for example foo_must_not_be_zero.
-*/
-#define lsx_static_assert(e,f) enum {lsx_static_assert_##f = 1/((e) ? 1 : 0)}
-
-/*****************************************************************************
-Basic typedefs:
-*****************************************************************************/
-
-/**
-Client API:
-Signed twos-complement 8-bit type. Typically defined as signed char.
-*/
-#if SCHAR_MAX==127 && SCHAR_MIN==(-128)
-typedef signed char sox_int8_t;
-#elif CHAR_MAX==127 && CHAR_MIN==(-128)
-typedef char sox_int8_t;
-#else
-#error Unable to determine an appropriate definition for sox_int8_t.
-#endif
-
-/**
-Client API:
-Unsigned 8-bit type. Typically defined as unsigned char.
-*/
-#if UCHAR_MAX==0xff
-typedef unsigned char sox_uint8_t;
-#elif CHAR_MAX==0xff && CHAR_MIN==0
-typedef char sox_uint8_t;
-#else
-#error Unable to determine an appropriate definition for sox_uint8_t.
-#endif
-
-/**
-Client API:
-Signed twos-complement 16-bit type. Typically defined as short.
-*/
-#if SHRT_MAX==32767 && SHRT_MIN==(-32768)
-typedef short sox_int16_t;
-#elif INT_MAX==32767 && INT_MIN==(-32768)
-typedef int sox_int16_t;
-#else
-#error Unable to determine an appropriate definition for sox_int16_t.
-#endif
-
-/**
-Client API:
-Unsigned 16-bit type. Typically defined as unsigned short.
-*/
-#if USHRT_MAX==0xffff
-typedef unsigned short sox_uint16_t;
-#elif UINT_MAX==0xffff
-typedef unsigned int sox_uint16_t;
-#else
-#error Unable to determine an appropriate definition for sox_uint16_t.
-#endif
-
-/**
-Client API:
-Signed twos-complement 32-bit type. Typically defined as int.
-*/
-#if INT_MAX==2147483647 && INT_MIN==(-2147483647-1)
-typedef int sox_int32_t;
-#elif LONG_MAX==2147483647 && LONG_MIN==(-2147483647-1)
-typedef long sox_int32_t;
-#else
-#error Unable to determine an appropriate definition for sox_int32_t.
-#endif
-
-/**
-Client API:
-Unsigned 32-bit type. Typically defined as unsigned int.
-*/
-#if UINT_MAX==0xffffffff
-typedef unsigned int sox_uint32_t;
-#elif ULONG_MAX==0xffffffff
-typedef unsigned long sox_uint32_t;
-#else
-#error Unable to determine an appropriate definition for sox_uint32_t.
-#endif
-
-/**
-Client API:
-Signed twos-complement 64-bit type. Typically defined as long or long long.
-*/
-#if LONG_MAX==9223372036854775807 && LONG_MIN==(-9223372036854775807-1)
-typedef long sox_int64_t;
-#elif defined(_MSC_VER)
-typedef __int64 sox_int64_t;
-#else
-typedef long long sox_int64_t;
-#endif
-
-/**
-Client API:
-Unsigned 64-bit type. Typically defined as unsigned long or unsigned long long.
-*/
-#if ULONG_MAX==0xffffffffffffffff
-typedef unsigned long sox_uint64_t;
-#elif defined(_MSC_VER)
-typedef unsigned __int64 sox_uint64_t;
-#else
-typedef unsigned long long sox_uint64_t;
-#endif
-
-#ifndef _DOXYGEN_
-lsx_static_assert(sizeof(sox_int8_t)==1,   sox_int8_size);
-lsx_static_assert(sizeof(sox_uint8_t)==1,  sox_uint8_size);
-lsx_static_assert(sizeof(sox_int16_t)==2,  sox_int16_size);
-lsx_static_assert(sizeof(sox_uint16_t)==2, sox_uint16_size);
-lsx_static_assert(sizeof(sox_int32_t)==4,  sox_int32_size);
-lsx_static_assert(sizeof(sox_uint32_t)==4, sox_uint32_size);
-lsx_static_assert(sizeof(sox_int64_t)==8,  sox_int64_size);
-lsx_static_assert(sizeof(sox_uint64_t)==8, sox_uint64_size);
-#endif
-
-/**
-Client API:
-Alias for sox_int32_t (beware of the extra byte).
-*/
-typedef sox_int32_t sox_int24_t;
-
-/**
-Client API:
-Alias for sox_uint32_t (beware of the extra byte).
-*/
-typedef sox_uint32_t sox_uint24_t;
-
-/**
-Client API:
-Native SoX audio sample type (alias for sox_int32_t).
-*/
-typedef sox_int32_t sox_sample_t;
-
-/**
-Client API:
-Samples per second is stored as a double.
-*/
-typedef double sox_rate_t;
-
-/**
-Client API:
-File's metadata, access via sox_*_comments functions.
-*/
-typedef char * * sox_comments_t;
-
-/*****************************************************************************
-Enumerations:
-*****************************************************************************/
-
-/**
-Client API:
-Boolean type, assignment (but not necessarily binary) compatible with C++ bool.
-*/
-typedef enum sox_bool {
-    sox_false, /**< False = 0. */
-    sox_true   /**< True = 1. */
-} sox_bool;
-
-/**
-Client API:
-no, yes, or default (default usually implies some kind of auto-detect logic).
-*/
-typedef enum sox_option_t {
-    sox_option_no,      /**< Option specified as no = 0. */
-    sox_option_yes,     /**< Option specified as yes = 1. */
-    sox_option_default  /**< Option unspecified = 2. */
-} sox_option_t;
-
-/**
-Client API:
-The libSoX-specific error codes.
-libSoX functions may return these codes or others that map from errno codes.
-*/
-enum sox_error_t {
-  SOX_SUCCESS = 0,     /**< Function succeeded = 0 */
-  SOX_EOF = -1,        /**< End Of File or other error = -1 */
-  SOX_EHDR = 2000,     /**< Invalid Audio Header = 2000 */
-  SOX_EFMT,            /**< Unsupported data format = 2001 */
-  SOX_ENOMEM,          /**< Can't alloc memory = 2002 */
-  SOX_EPERM,           /**< Operation not permitted = 2003 */
-  SOX_ENOTSUP,         /**< Operation not supported = 2004 */
-  SOX_EINVAL           /**< Invalid argument = 2005 */
-};
-
-/**
-Client API:
-Flags indicating whether optional features are present in this build of libSoX.
-*/
-typedef enum sox_version_flags_t {
-    sox_version_none = 0,         /**< No special features = 0. */
-    sox_version_have_popen = 1,   /**< popen = 1. */
-    sox_version_have_magic = 2,   /**< magic = 2. */
-    sox_version_have_threads = 4, /**< threads = 4. */
-    sox_version_have_memopen = 8  /**< memopen = 8. */
-} sox_version_flags_t;
-
-/**
-Client API:
-Format of sample data.
-*/
-typedef enum sox_encoding_t {
-  SOX_ENCODING_UNKNOWN   , /**< encoding has not yet been determined */
-
-  SOX_ENCODING_SIGN2     , /**< signed linear 2's comp: Mac */
-  SOX_ENCODING_UNSIGNED  , /**< unsigned linear: Sound Blaster */
-  SOX_ENCODING_FLOAT     , /**< floating point (binary format) */
-  SOX_ENCODING_FLOAT_TEXT, /**< floating point (text format) */
-  SOX_ENCODING_FLAC      , /**< FLAC compression */
-  SOX_ENCODING_HCOM      , /**< Mac FSSD files with Huffman compression */
-  SOX_ENCODING_WAVPACK   , /**< WavPack with integer samples */
-  SOX_ENCODING_WAVPACKF  , /**< WavPack with float samples */
-  SOX_ENCODING_ULAW      , /**< u-law signed logs: US telephony, SPARC */
-  SOX_ENCODING_ALAW      , /**< A-law signed logs: non-US telephony, Psion */
-  SOX_ENCODING_G721      , /**< G.721 4-bit ADPCM */
-  SOX_ENCODING_G723      , /**< G.723 3 or 5 bit ADPCM */
-  SOX_ENCODING_CL_ADPCM  , /**< Creative Labs 8 --> 2,3,4 bit Compressed PCM */
-  SOX_ENCODING_CL_ADPCM16, /**< Creative Labs 16 --> 4 bit Compressed PCM */
-  SOX_ENCODING_MS_ADPCM  , /**< Microsoft Compressed PCM */
-  SOX_ENCODING_IMA_ADPCM , /**< IMA Compressed PCM */
-  SOX_ENCODING_OKI_ADPCM , /**< Dialogic/OKI Compressed PCM */
-  SOX_ENCODING_DPCM      , /**< Differential PCM: Fasttracker 2 (xi) */
-  SOX_ENCODING_DWVW      , /**< Delta Width Variable Word */
-  SOX_ENCODING_DWVWN     , /**< Delta Width Variable Word N-bit */
-  SOX_ENCODING_GSM       , /**< GSM 6.10 33byte frame lossy compression */
-  SOX_ENCODING_MP3       , /**< MP3 compression */
-  SOX_ENCODING_VORBIS    , /**< Vorbis compression */
-  SOX_ENCODING_AMR_WB    , /**< AMR-WB compression */
-  SOX_ENCODING_AMR_NB    , /**< AMR-NB compression */
-  SOX_ENCODING_CVSD      , /**< Continuously Variable Slope Delta modulation */
-  SOX_ENCODING_LPC10     , /**< Linear Predictive Coding */
-
-  SOX_ENCODINGS            /**< End of list marker */
-} sox_encoding_t;
-
-/**
-Client API:
-Flags for sox_encodings_info_t: lossless/lossy1/lossy2.
-*/
-typedef enum sox_encodings_flags_t {
-  sox_encodings_none   = 0, /**< no flags specified (implies lossless encoding) = 0. */
-  sox_encodings_lossy1 = 1, /**< encode, decode: lossy once = 1. */
-  sox_encodings_lossy2 = 2  /**< encode, decode, encode, decode: lossy twice = 2. */
-} sox_encodings_flags_t;
-
-/**
-Client API:
-Type of plot.
-*/
-typedef enum sox_plot_t {
-    sox_plot_off,     /**< No plot = 0. */
-    sox_plot_octave,  /**< Octave plot = 1. */
-    sox_plot_gnuplot, /**< Gnuplot plot = 2. */
-    sox_plot_data     /**< Plot data = 3. */
-} sox_plot_t;
-
-/**
-Client API:
-Loop modes: upper 4 bits mask the loop blass, lower 4 bits describe
-the loop behaviour, for example single shot, bidirectional etc.
-*/
-enum sox_loop_flags_t {
-  sox_loop_none = 0,          /**< single-shot = 0 */
-  sox_loop_forward = 1,       /**< forward loop = 1 */
-  sox_loop_forward_back = 2,  /**< forward/back loop = 2 */
-  sox_loop_8 = 32,            /**< 8 loops (??) = 32 */
-  sox_loop_sustain_decay = 64 /**< AIFF style, one sustain & one decay loop = 64 */
-};
-
-/**
-Plugins API:
-Is file a real file, a pipe, or a url?
-*/
-typedef enum lsx_io_type
-{
-    lsx_io_file, /**< File is a real file = 0. */
-    lsx_io_pipe, /**< File is a pipe (no seeking) = 1. */
-    lsx_io_url   /**< File is a URL (no seeking) = 2. */
-} lsx_io_type;
-
-/*****************************************************************************
-Macros:
-*****************************************************************************/
-
-/**
-Client API:
-Compute a 32-bit integer API version from three 8-bit parts.
-@param a Major version.
-@param b Minor version.
-@param c Revision or build number.
-@returns 32-bit integer API version 0x000a0b0c.
-*/
-#define SOX_LIB_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
-
-/**
-Client API:
-The API version of the sox.h file. It is not meant to follow the version
-number of SoX but it has historically. Please do not count on
-SOX_LIB_VERSION_CODE staying in sync with the libSoX version.
-*/
-#define SOX_LIB_VERSION_CODE   SOX_LIB_VERSION(14, 4, 0)
-
-/**
-Client API:
-Returns the smallest (negative) value storable in a twos-complement signed
-integer with the specified number of bits, cast to an unsigned integer;
-for example, SOX_INT_MIN(8) = 0x80, SOX_INT_MIN(16) = 0x8000, etc.
-@param bits Size of value for which to calculate minimum.
-@returns the smallest (negative) value storable in a twos-complement signed
-integer with the specified number of bits, cast to an unsigned integer.
-*/
-#define SOX_INT_MIN(bits) (1 <<((bits)-1))
-
-/**
-Client API:
-Returns the largest (positive) value storable in a twos-complement signed
-integer with the specified number of bits, cast to an unsigned integer;
-for example, SOX_INT_MAX(8) = 0x7F, SOX_INT_MAX(16) = 0x7FFF, etc.
-@param bits Size of value for which to calculate maximum.
-@returns the largest (positive) value storable in a twos-complement signed
-integer with the specified number of bits, cast to an unsigned integer.
-*/
-#define SOX_INT_MAX(bits) (((unsigned)-1)>>(33-(bits)))
-
-/**
-Client API:
-Returns the largest value storable in an unsigned integer with the specified
-number of bits; for example, SOX_UINT_MAX(8) = 0xFF,
-SOX_UINT_MAX(16) = 0xFFFF, etc.
-@param bits Size of value for which to calculate maximum.
-@returns the largest value storable in an unsigned integer with the specified
-number of bits.
-*/
-#define SOX_UINT_MAX(bits) (SOX_INT_MIN(bits)|SOX_INT_MAX(bits))
-
-/**
-Client API:
-Returns 0x7F.
-*/
-#define SOX_INT8_MAX  SOX_INT_MAX(8)
-
-/**
-Client API:
-Returns 0x7FFF.
-*/
-#define SOX_INT16_MAX SOX_INT_MAX(16)
-
-/**
-Client API:
-Returns 0x7FFFFF.
-*/
-#define SOX_INT24_MAX SOX_INT_MAX(24)
-
-/**
-Client API:
-Returns 0x7FFFFFFF.
-*/
-#define SOX_INT32_MAX SOX_INT_MAX(32)
-
-/**
-Client API:
-Bits in a sox_sample_t = 32.
-*/
-#define SOX_SAMPLE_PRECISION 32
-
-/**
-Client API:
-Max value for sox_sample_t = 0x7FFFFFFF.
-*/
-#define SOX_SAMPLE_MAX (sox_sample_t)SOX_INT_MAX(32)
-
-/**
-Client API:
-Min value for sox_sample_t = 0x80000000.
-*/
-#define SOX_SAMPLE_MIN (sox_sample_t)SOX_INT_MIN(32)
-
-
-/*                Conversions: Linear PCM <--> sox_sample_t
- *
- *   I/O      Input    sox_sample_t Clips?   Input    sox_sample_t Clips?
- *  Format   Minimum     Minimum     I O    Maximum     Maximum     I O
- *  ------  ---------  ------------ -- --   --------  ------------ -- --
- *  Float     -inf         -1        y n      inf      1 - 5e-10    y n
- *  Int8      -128        -128       n n      127     127.9999999   n y
- *  Int16    -32768      -32768      n n     32767    32767.99998   n y
- *  Int24   -8388608    -8388608     n n    8388607   8388607.996   n y
- *  Int32  -2147483648 -2147483648   n n   2147483647 2147483647    n n
- *
- * Conversions are as accurate as possible (with rounding).
- *
- * Rounding: halves toward +inf, all others to nearest integer.
- *
- * Clips? shows whether on not there is the possibility of a conversion
- * clipping to the minimum or maximum value when inputing from or outputing
- * to a given type.
- *
- * Unsigned integers are converted to and from signed integers by flipping
- * the upper-most bit then treating them as signed integers.
- */
-
-/**
-Client API:
-Declares the temporary local variables that are required when using SOX
-conversion macros.
-*/
-#define SOX_SAMPLE_LOCALS sox_sample_t sox_macro_temp_sample LSX_UNUSED; \
-  double sox_macro_temp_double LSX_UNUSED
-
-/**
-Client API:
-Sign bit for sox_sample_t = 0x80000000.
-*/
-#define SOX_SAMPLE_NEG SOX_INT_MIN(32)
-
-/**
-Client API:
-Converts sox_sample_t to an unsigned integer of width (bits).
-@param bits  Width of resulting sample (1 through 32).
-@param d     Input sample to be converted.
-@param clips Variable that is incremented if the result is too big.
-@returns Unsigned integer of width (bits).
-*/
-#define SOX_SAMPLE_TO_UNSIGNED(bits,d,clips) \
-  (sox_uint##bits##_t)(SOX_SAMPLE_TO_SIGNED(bits,d,clips)^SOX_INT_MIN(bits))
-
-/**
-Client API:
-Converts sox_sample_t to a signed integer of width (bits).
-@param bits  Width of resulting sample (1 through 32).
-@param d     Input sample to be converted.
-@param clips Variable that is incremented if the result is too big.
-@returns Signed integer of width (bits).
-*/
-#define SOX_SAMPLE_TO_SIGNED(bits,d,clips) \
-  (sox_int##bits##_t)(LSX_USE_VAR(sox_macro_temp_double),sox_macro_temp_sample=(d),sox_macro_temp_sample>SOX_SAMPLE_MAX-(1<<(31-bits))?++(clips),SOX_INT_MAX(bits):((sox_uint32_t)(sox_macro_temp_sample+(1<<(31-bits))))>>(32-bits))
-
-/**
-Client API:
-Converts signed integer of width (bits) to sox_sample_t.
-@param bits Width of input sample (1 through 32).
-@param d    Input sample to be converted.
-@returns SoX native sample value.
-*/
-#define SOX_SIGNED_TO_SAMPLE(bits,d)((sox_sample_t)(d)<<(32-bits))
-
-/**
-Client API:
-Converts unsigned integer of width (bits) to sox_sample_t.
-@param bits Width of input sample (1 through 32).
-@param d    Input sample to be converted.
-@returns SoX native sample value.
-*/
-#define SOX_UNSIGNED_TO_SAMPLE(bits,d)(SOX_SIGNED_TO_SAMPLE(bits,d)^SOX_SAMPLE_NEG)
-
-/**
-Client API:
-Converts unsigned 8-bit integer to sox_sample_t.
-@param d     Input sample to be converted.
-@param clips The parameter is not used.
-@returns SoX native sample value.
-*/
-#define SOX_UNSIGNED_8BIT_TO_SAMPLE(d,clips) SOX_UNSIGNED_TO_SAMPLE(8,d)
-
-/**
-Client API:
-Converts signed 8-bit integer to sox_sample_t.
-@param d    Input sample to be converted.
-@param clips The parameter is not used.
-@returns SoX native sample value.
-*/
-#define SOX_SIGNED_8BIT_TO_SAMPLE(d,clips) SOX_SIGNED_TO_SAMPLE(8,d)
-
-/**
-Client API:
-Converts unsigned 16-bit integer to sox_sample_t.
-@param d     Input sample to be converted.
-@param clips The parameter is not used.
-@returns SoX native sample value.
-*/
-#define SOX_UNSIGNED_16BIT_TO_SAMPLE(d,clips) SOX_UNSIGNED_TO_SAMPLE(16,d)
-
-/**
-Client API:
-Converts signed 16-bit integer to sox_sample_t.
-@param d    Input sample to be converted.
-@param clips The parameter is not used.
-@returns SoX native sample value.
-*/
-#define SOX_SIGNED_16BIT_TO_SAMPLE(d,clips) SOX_SIGNED_TO_SAMPLE(16,d)
-
-/**
-Client API:
-Converts unsigned 24-bit integer to sox_sample_t.
-@param d     Input sample to be converted.
-@param clips The parameter is not used.
-@returns SoX native sample value.
-*/
-#define SOX_UNSIGNED_24BIT_TO_SAMPLE(d,clips) SOX_UNSIGNED_TO_SAMPLE(24,d)
-
-/**
-Client API:
-Converts signed 24-bit integer to sox_sample_t.
-@param d    Input sample to be converted.
-@param clips The parameter is not used.
-@returns SoX native sample value.
-*/
-#define SOX_SIGNED_24BIT_TO_SAMPLE(d,clips) SOX_SIGNED_TO_SAMPLE(24,d)
-
-/**
-Client API:
-Converts unsigned 32-bit integer to sox_sample_t.
-@param d     Input sample to be converted.
-@param clips The parameter is not used.
-@returns SoX native sample value.
-*/
-#define SOX_UNSIGNED_32BIT_TO_SAMPLE(d,clips) ((sox_sample_t)(d)^SOX_SAMPLE_NEG)
-
-/**
-Client API:
-Converts signed 32-bit integer to sox_sample_t.
-@param d    Input sample to be converted.
-@param clips The parameter is not used.
-@returns SoX native sample value.
-*/
-#define SOX_SIGNED_32BIT_TO_SAMPLE(d,clips) (sox_sample_t)(d)
-
-/**
-Client API:
-Converts 32-bit float to sox_sample_t.
-@param d     Input sample to be converted, range [-1, 1).
-@param clips Variable to increment if the input sample is too large or too small.
-@returns SoX native sample value.
-*/
-#define SOX_FLOAT_32BIT_TO_SAMPLE(d,clips) (sox_sample_t)(LSX_USE_VAR(sox_macro_temp_sample),sox_macro_temp_double=(d)*(SOX_SAMPLE_MAX+1.),sox_macro_temp_double<SOX_SAMPLE_MIN?++(clips),SOX_SAMPLE_MIN:sox_macro_temp_double>=SOX_SAMPLE_MAX+1.?sox_macro_temp_double>SOX_SAMPLE_MAX+1.?++(clips),SOX_SAMPLE_MAX:SOX_SAMPLE_MAX:sox_macro_temp_double)
-
-/**
-Client API:
-Converts 64-bit float to sox_sample_t.
-@param d     Input sample to be converted, range [-1, 1).
-@param clips Variable to increment if the input sample is too large or too small.
-@returns SoX native sample value.
-*/
-#define SOX_FLOAT_64BIT_TO_SAMPLE(d,clips) (sox_sample_t)(LSX_USE_VAR(sox_macro_temp_sample),sox_macro_temp_double=(d)*(SOX_SAMPLE_MAX+1.),sox_macro_temp_double<0?sox_macro_temp_double<=SOX_SAMPLE_MIN-.5?++(clips),SOX_SAMPLE_MIN:sox_macro_temp_double-.5:sox_macro_temp_double>=SOX_SAMPLE_MAX+.5?sox_macro_temp_double>SOX_SAMPLE_MAX+1.?++(clips),SOX_SAMPLE_MAX:SOX_SAMPLE_MAX:sox_macro_temp_double+.5)
-
-/**
-Client API:
-Converts SoX native sample to an unsigned 8-bit integer.
-@param d Input sample to be converted.
-@param clips Variable to increment if input sample is too large.
-*/
-#define SOX_SAMPLE_TO_UNSIGNED_8BIT(d,clips) SOX_SAMPLE_TO_UNSIGNED(8,d,clips)
-
-/**
-Client API:
-Converts SoX native sample to an signed 8-bit integer.
-@param d Input sample to be converted.
-@param clips Variable to increment if input sample is too large.
-*/
-#define SOX_SAMPLE_TO_SIGNED_8BIT(d,clips) SOX_SAMPLE_TO_SIGNED(8,d,clips)
-
-/**
-Client API:
-Converts SoX native sample to an unsigned 16-bit integer.
-@param d Input sample to be converted.
-@param clips Variable to increment if input sample is too large.
-*/
-#define SOX_SAMPLE_TO_UNSIGNED_16BIT(d,clips) SOX_SAMPLE_TO_UNSIGNED(16,d,clips)
-
-/**
-Client API:
-Converts SoX native sample to a signed 16-bit integer.
-@param d Input sample to be converted.
-@param clips Variable to increment if input sample is too large.
-*/
-#define SOX_SAMPLE_TO_SIGNED_16BIT(d,clips) SOX_SAMPLE_TO_SIGNED(16,d,clips)
-
-/**
-Client API:
-Converts SoX native sample to an unsigned 24-bit integer.
-@param d Input sample to be converted.
-@param clips Variable to increment if input sample is too large.
-*/
-#define SOX_SAMPLE_TO_UNSIGNED_24BIT(d,clips) SOX_SAMPLE_TO_UNSIGNED(24,d,clips)
-
-/**
-Client API:
-Converts SoX native sample to a signed 24-bit integer.
-@param d Input sample to be converted.
-@param clips Variable to increment if input sample is too large.
-*/
-#define SOX_SAMPLE_TO_SIGNED_24BIT(d,clips) SOX_SAMPLE_TO_SIGNED(24,d,clips)
-
-/**
-Client API:
-Converts SoX native sample to an unsigned 32-bit integer.
-@param d Input sample to be converted.
-@param clips The parameter is not used.
-*/
-#define SOX_SAMPLE_TO_UNSIGNED_32BIT(d,clips) (sox_uint32_t)((d)^SOX_SAMPLE_NEG)
-
-/**
-Client API:
-Converts SoX native sample to a signed 32-bit integer.
-@param d Input sample to be converted.
-@param clips The parameter is not used.
-*/
-#define SOX_SAMPLE_TO_SIGNED_32BIT(d,clips) (sox_int32_t)(d)
-
-/**
-Client API:
-Converts SoX native sample to a 32-bit float.
-@param d Input sample to be converted.
-@param clips Variable to increment if input sample is too large.
-*/
-#define SOX_SAMPLE_TO_FLOAT_32BIT(d,clips) (LSX_USE_VAR(sox_macro_temp_double),sox_macro_temp_sample=(d),sox_macro_temp_sample>SOX_SAMPLE_MAX-128?++(clips),1:(((sox_macro_temp_sample+128)&~255)*(1./(SOX_SAMPLE_MAX+1.))))
-
-/**
-Client API:
-Converts SoX native sample to a 64-bit float.
-@param d Input sample to be converted.
-@param clips The parameter is not used.
-*/
-#define SOX_SAMPLE_TO_FLOAT_64BIT(d,clips) ((d)*(1./(SOX_SAMPLE_MAX+1.)))
-
-/**
-Client API:
-Clips a value of a type that is larger then sox_sample_t (for example, int64)
-to sox_sample_t's limits and increment a counter if clipping occurs.
-@param samp Value (lvalue) to be clipped, updated as necessary.
-@param clips Value (lvalue) that is incremented if clipping is needed.
-*/
-#define SOX_SAMPLE_CLIP_COUNT(samp, clips) \
-  do { \
-    if (samp > SOX_SAMPLE_MAX) \
-      { samp = SOX_SAMPLE_MAX; clips++; } \
-    else if (samp < SOX_SAMPLE_MIN) \
-      { samp = SOX_SAMPLE_MIN; clips++; } \
-  } while (0)
-
-/**
-Client API:
-Clips a value of a type that is larger then sox_sample_t (for example, int64)
-to sox_sample_t's limits and increment a counter if clipping occurs.
-@param d Value (rvalue) to be clipped.
-@param clips Value (lvalue) that is incremented if clipping is needed.
-@returns Clipped value.
-*/
-#define SOX_ROUND_CLIP_COUNT(d, clips) \
-  ((d) < 0? (d) <= SOX_SAMPLE_MIN - 0.5? ++(clips), SOX_SAMPLE_MIN: (d) - 0.5 \
-        : (d) >= SOX_SAMPLE_MAX + 0.5? ++(clips), SOX_SAMPLE_MAX: (d) + 0.5)
-
-/**
-Client API:
-Clips a value to the limits of a signed integer of the specified width
-and increment a counter if clipping occurs.
-@param bits Width (in bits) of target integer type.
-@param i Value (rvalue) to be clipped.
-@param clips Value (lvalue) that is incremented if clipping is needed.
-@returns Clipped value.
-*/
-#define SOX_INTEGER_CLIP_COUNT(bits,i,clips) ( \
-  (i) >(1 << ((bits)-1))- 1? ++(clips),(1 << ((bits)-1))- 1 : \
-  (i) <-1 << ((bits)-1)    ? ++(clips),-1 << ((bits)-1) : (i))
-
-/**
-Client API:
-Clips a value to the limits of a 16-bit signed integer and increment a counter
-if clipping occurs.
-@param i Value (rvalue) to be clipped.
-@param clips Value (lvalue) that is incremented if clipping is needed.
-@returns Clipped value.
-*/
-#define SOX_16BIT_CLIP_COUNT(i,clips) SOX_INTEGER_CLIP_COUNT(16,i,clips)
-
-/**
-Client API:
-Clips a value to the limits of a 24-bit signed integer and increment a counter
-if clipping occurs.
-@param i Value (rvalue) to be clipped.
-@param clips Value (lvalue) that is incremented if clipping is needed.
-@returns Clipped value.
-*/
-#define SOX_24BIT_CLIP_COUNT(i,clips) SOX_INTEGER_CLIP_COUNT(24,i,clips)
-
-#define SOX_SIZE_MAX ((size_t)(-1)) /**< Client API: Maximum value of size_t. */
-
-#define SOX_UNSPEC 0                         /**< Client API: Members of sox_signalinfo_t are set to SOX_UNSPEC (= 0) if the actual value is not yet known. */
-#define SOX_UNKNOWN_LEN (sox_uint64_t)(-1) /**< Client API: sox_signalinfo_t.length is set to SOX_UNKNOWN_LEN (= -1) within the effects chain if the actual length is not known. Format handlers currently use SOX_UNSPEC instead. */
-#define SOX_IGNORE_LENGTH (sox_uint64_t)(-2) /**< Client API: sox_signalinfo_t.length is set to SOX_IGNORE_LENGTH (= -2) to indicate that a format handler should ignore length information in file headers. */
-
-#define SOX_DEFAULT_CHANNELS  2     /**< Client API: Default channel count is 2 (stereo). */
-#define SOX_DEFAULT_RATE      48000 /**< Client API: Default rate is 48000Hz. */
-#define SOX_DEFAULT_PRECISION 16    /**< Client API: Default precision is 16 bits per sample. */
-#define SOX_DEFAULT_ENCODING  SOX_ENCODING_SIGN2 /**< Client API: Default encoding is SIGN2 (linear 2's complement PCM). */
-
-#define SOX_LOOP_NONE          ((unsigned char)sox_loop_none)          /**< Client API: single-shot = 0 */
-#define SOX_LOOP_8             ((unsigned char)sox_loop_8)             /**< Client API: 8 loops = 32 */
-#define SOX_LOOP_SUSTAIN_DECAY ((unsigned char)sox_loop_sustain_decay) /**< Client API: AIFF style, one sustain & one decay loop = 64 */
-
-#define SOX_MAX_NLOOPS         8 /**< Client API: Maximum number of loops supported by sox_oob_t = 8. */
-
-#define SOX_FILE_NOSTDIO 0x0001 /**< Client API: Does not use stdio routines */
-#define SOX_FILE_DEVICE  0x0002 /**< Client API: File is an audio device */
-#define SOX_FILE_PHONY   0x0004 /**< Client API: Phony file/device (for example /dev/null) */
-#define SOX_FILE_REWIND  0x0008 /**< Client API: File should be rewound to write header */
-#define SOX_FILE_BIT_REV 0x0010 /**< Client API: Is file bit-reversed? */
-#define SOX_FILE_NIB_REV 0x0020 /**< Client API: Is file nibble-reversed? */
-#define SOX_FILE_ENDIAN  0x0040 /**< Client API: Is file format endian? */
-#define SOX_FILE_ENDBIG  0x0080 /**< Client API: For endian file format, is it big endian? */
-#define SOX_FILE_MONO    0x0100 /**< Client API: Do channel restrictions allow mono? */
-#define SOX_FILE_STEREO  0x0200 /**< Client API: Do channel restrictions allow stereo? */
-#define SOX_FILE_QUAD    0x0400 /**< Client API: Do channel restrictions allow quad? */
-
-#define SOX_FILE_CHANS   (SOX_FILE_MONO | SOX_FILE_STEREO | SOX_FILE_QUAD) /**< Client API: No channel restrictions */
-#define SOX_FILE_LIT_END (SOX_FILE_ENDIAN | 0)                             /**< Client API: File is little-endian */
-#define SOX_FILE_BIG_END (SOX_FILE_ENDIAN | SOX_FILE_ENDBIG)               /**< Client API: File is big-endian */
-
-#define SOX_EFF_CHAN     1           /**< Client API: Effect might alter the number of channels */
-#define SOX_EFF_RATE     2           /**< Client API: Effect might alter sample rate */
-#define SOX_EFF_PREC     4           /**< Client API: Effect does its own calculation of output sample precision (otherwise a default value is taken, depending on the presence of SOX_EFF_MODIFY) */
-#define SOX_EFF_LENGTH   8           /**< Client API: Effect might alter audio length (as measured in time units, not necessarily in samples) */
-#define SOX_EFF_MCHAN    16          /**< Client API: Effect handles multiple channels internally */
-#define SOX_EFF_NULL     32          /**< Client API: Effect does nothing (can be optimized out of chain) */
-#define SOX_EFF_DEPRECATED 64        /**< Client API: Effect will soon be removed from SoX */
-#define SOX_EFF_GAIN     128         /**< Client API: Effect does not support gain -r */
-#define SOX_EFF_MODIFY   256         /**< Client API: Effect does not modify sample values (but might remove or duplicate samples or insert zeros) */
-#define SOX_EFF_ALPHA    512         /**< Client API: Effect is experimental/incomplete */
-#define SOX_EFF_INTERNAL 1024        /**< Client API: Effect present in libSoX but not valid for use by SoX command-line tools */
-
-/**
-Client API:
-When used as the "whence" parameter of sox_seek, indicates that the specified
-offset is relative to the beginning of the file.
-*/
-#define SOX_SEEK_SET 0
-
-/*****************************************************************************
-Forward declarations:
-*****************************************************************************/
-
-typedef struct sox_format_t sox_format_t;
-typedef struct sox_effect_t sox_effect_t;
-typedef struct sox_effect_handler_t sox_effect_handler_t;
-typedef struct sox_format_handler_t sox_format_handler_t;
-
-/*****************************************************************************
-Function pointers:
-*****************************************************************************/
-
-/**
-Client API:
-Callback to write a message to an output device (console or log file),
-used by sox_globals_t.output_message_handler.
-*/
-typedef void (LSX_API * sox_output_message_handler_t)(
-    unsigned level,                       /* 1 = FAIL, 2 = WARN, 3 = INFO, 4 = DEBUG, 5 = DEBUG_MORE, 6 = DEBUG_MOST. */
-    LSX_PARAM_IN_Z char const * filename, /* Source code __FILENAME__ from which message originates. */
-    LSX_PARAM_IN_PRINTF char const * fmt, /* Message format string. */
-    LSX_PARAM_IN va_list ap               /* Message format parameters. */
-    );
-
-/**
-Client API:
-Callback to retrieve information about a format handler,
-used by sox_format_tab_t.fn.
-@returns format handler information.
-*/
-typedef sox_format_handler_t const * (LSX_API * sox_format_fn_t)(void);
-
-/**
-Client API:
-Callback to get information about an effect handler,
-used by the table returned from sox_get_effect_fns(void).
-@returns Pointer to information about an effect handler.
-*/
-typedef sox_effect_handler_t const * (LSX_API *sox_effect_fn_t)(void);
-
-/**
-Client API:
-Callback to initialize reader (decoder), used by
-sox_format_handler.startread.
-@returns SOX_SUCCESS if successful.
-*/
-typedef int (LSX_API * sox_format_handler_startread)(
-    LSX_PARAM_INOUT sox_format_t * ft /**< Format pointer. */
-    );
-
-/**
-Client API:
-Callback to read (decode) a block of samples,
-used by sox_format_handler.read.
-@returns number of samples read, or 0 if unsuccessful.
-*/
-typedef size_t (LSX_API * sox_format_handler_read)(
-    LSX_PARAM_INOUT sox_format_t * ft, /**< Format pointer. */
-    LSX_PARAM_OUT_CAP_POST_COUNT(len,return) sox_sample_t *buf, /**< Buffer from which to read samples. */
-    size_t len /**< Number of samples available in buf. */
-    );
-
-/**
-Client API:
-Callback to close reader (decoder),
-used by sox_format_handler.stopread.
-@returns SOX_SUCCESS if successful.
-*/
-typedef int (LSX_API * sox_format_handler_stopread)(
-    LSX_PARAM_INOUT sox_format_t * ft /**< Format pointer. */
-    );
-
-/**
-Client API:
-Callback to initialize writer (encoder),
-used by sox_format_handler.startwrite.
-@returns SOX_SUCCESS if successful.
-*/
-typedef int (LSX_API * sox_format_handler_startwrite)(
-    LSX_PARAM_INOUT sox_format_t * ft /**< Format pointer. */
-    );
-
-/**
-Client API:
-Callback to write (encode) a block of samples,
-used by sox_format_handler.write.
-@returns number of samples written, or 0 if unsuccessful.
-*/
-typedef size_t (LSX_API * sox_format_handler_write)(
-    LSX_PARAM_INOUT sox_format_t * ft, /**< Format pointer. */
-    LSX_PARAM_IN_COUNT(len) sox_sample_t const * buf, /**< Buffer to which samples are written. */
-    size_t len /**< Capacity of buf, measured in samples. */
-    );
-
-/**
-Client API:
-Callback to close writer (decoder),
-used by sox_format_handler.stopwrite.
-@returns SOX_SUCCESS if successful.
-*/
-typedef int (LSX_API * sox_format_handler_stopwrite)(
-    LSX_PARAM_INOUT sox_format_t * ft /**< Format pointer. */
-    );
-
-/**
-Client API:
-Callback to reposition reader,
-used by sox_format_handler.seek.
-@returns SOX_SUCCESS if successful.
-*/
-typedef int (LSX_API * sox_format_handler_seek)(
-    LSX_PARAM_INOUT sox_format_t * ft, /**< Format pointer. */
-    sox_uint64_t offset /**< Sample offset to which reader should be positioned. */
-    );
-
-/**
-Client API:
-Callback to parse command-line arguments (called once per effect),
-used by sox_effect_handler.getopts.
-@returns SOX_SUCCESS if successful.
-*/
-typedef int (LSX_API * sox_effect_handler_getopts)(
-    LSX_PARAM_INOUT sox_effect_t * effp, /**< Effect pointer. */
-    int argc, /**< Number of arguments in argv. */
-    LSX_PARAM_IN_COUNT(argc) char *argv[] /**< Array of command-line arguments. */
-    );
-
-/**
-Client API:
-Callback to initialize effect (called once per flow),
-used by sox_effect_handler.start.
-@returns SOX_SUCCESS if successful.
-*/
-typedef int (LSX_API * sox_effect_handler_start)(
-    LSX_PARAM_INOUT sox_effect_t * effp /**< Effect pointer. */
-    );
-
-/**
-Client API:
-Callback to process samples,
-used by sox_effect_handler.flow.
-@returns SOX_SUCCESS if successful.
-*/
-typedef int (LSX_API * sox_effect_handler_flow)(
-    LSX_PARAM_INOUT sox_effect_t * effp, /**< Effect pointer. */
-    LSX_PARAM_IN_COUNT(*isamp) sox_sample_t const * ibuf, /**< Buffer from which to read samples. */
-    LSX_PARAM_OUT_CAP_POST_COUNT(*osamp,*osamp) sox_sample_t * obuf, /**< Buffer to which samples are written. */
-    LSX_PARAM_INOUT size_t *isamp, /**< On entry, contains capacity of ibuf; on exit, contains number of samples consumed. */
-    LSX_PARAM_INOUT size_t *osamp /**< On entry, contains capacity of obuf; on exit, contains number of samples written. */
-    );
-
-/**
-Client API:
-Callback to finish getting output after input is complete,
-used by sox_effect_handler.drain.
-@returns SOX_SUCCESS if successful.
-*/
-typedef int (LSX_API * sox_effect_handler_drain)(
-    LSX_PARAM_INOUT sox_effect_t * effp, /**< Effect pointer. */
-    LSX_PARAM_OUT_CAP_POST_COUNT(*osamp,*osamp) sox_sample_t *obuf, /**< Buffer to which samples are written. */
-    LSX_PARAM_INOUT size_t *osamp /**< On entry, contains capacity of obuf; on exit, contains number of samples written. */
-    );
-
-/**
-Client API:
-Callback to shut down effect (called once per flow),
-used by sox_effect_handler.stop.
-@returns SOX_SUCCESS if successful.
-*/
-typedef int (LSX_API * sox_effect_handler_stop)(
-    LSX_PARAM_INOUT sox_effect_t * effp /**< Effect pointer. */
-    );
-
-/**
-Client API:
-Callback to shut down effect (called once per effect),
-used by sox_effect_handler.kill.
-@returns SOX_SUCCESS if successful.
-*/
-typedef int (LSX_API * sox_effect_handler_kill)(
-    LSX_PARAM_INOUT sox_effect_t * effp /**< Effect pointer. */
-    );
-
-/**
-Client API:
-Callback called while flow is running (called once per buffer),
-used by sox_flow_effects.callback.
-@returns SOX_SUCCESS to continue, other value to abort flow.
-*/
-typedef int (LSX_API * sox_flow_effects_callback)(
-    sox_bool all_done,
-    void * client_data
-    );
-
-/**
-Client API:
-Callback for enumerating the contents of a playlist,
-used by the sox_parse_playlist function.
-@returns SOX_SUCCESS if successful, any other value to abort playlist enumeration.
-*/
-typedef int (LSX_API * sox_playlist_callback_t)(
-    void * callback_data,
-    LSX_PARAM_IN_Z char const * filename
-    );
-
-/*****************************************************************************
-Structures:
-*****************************************************************************/
-
-/**
-Client API:
-Information about a build of libSoX, returned from the sox_version_info
-function.
-*/
-typedef struct sox_version_info_t {
-    size_t       size;         /**< structure size = sizeof(sox_version_info_t) */
-    sox_version_flags_t flags; /**< feature flags = popen | magic | threads | memopen */
-    sox_uint32_t version_code; /**< version number = 0x140400 */
-    char const * version;      /**< version string = sox_version(), for example, "14.4.0" */
-    char const * version_extra;/**< version extra info or null = "PACKAGE_EXTRA", for example, "beta" */
-    char const * time;         /**< build time = "__DATE__ __TIME__", for example, "Jan  7 2010 03:31:50" */
-    char const * distro;       /**< distro or null = "DISTRO", for example, "Debian" */
-    char const * compiler;     /**< compiler info or null, for example, "msvc 160040219" */
-    char const * arch;         /**< arch, for example, "1248 48 44 L OMP" */
-    /* new info should be added at the end for version backwards-compatibility. */
-} sox_version_info_t;
-
-/**
-Client API:
-Global parameters (for effects & formats), returned from the sox_get_globals
-function.
-*/
-typedef struct sox_globals_t {
-/* public: */
-  unsigned     verbosity; /**< messages are only written if globals.verbosity >= message.level */
-  sox_output_message_handler_t output_message_handler; /**< client-specified message output callback */
-  sox_bool     repeatable; /**< true to use pre-determined timestamps and PRNG seed */
-
-  /**
-  Default size (in bytes) used by libSoX for blocks of sample data.
-  Plugins should use similarly-sized buffers to get best performance.
-  */
-  size_t       bufsiz;
-
-  /**
-  Default size (in bytes) used by libSoX for blocks of input sample data.
-  Plugins should use similarly-sized buffers to get best performance.
-  */
-  size_t       input_bufsiz;
-
-  sox_int32_t  ranqd1; /**< Can be used to re-seed libSoX's PRNG */
-
-  char const * stdin_in_use_by;  /**< Private: tracks the name of the handler currently using stdin */
-  char const * stdout_in_use_by; /**< Private: tracks the name of the handler currently using stdout */
-  char const * subsystem;        /**< Private: tracks the name of the handler currently writing an output message */
-  char       * tmp_path;         /**< Private: client-configured path to use for temporary files */
-  sox_bool     use_magic;        /**< Private: true if client has requested use of 'magic' file-type detection */
-  sox_bool     use_threads;      /**< Private: true if client has requested parallel effects processing */
-} sox_globals_t;
-
-/**
-Client API:
-Signal parameters; members should be set to SOX_UNSPEC (= 0) if unknown.
-*/
-typedef struct sox_signalinfo_t {
-  sox_rate_t       rate;         /**< samples per second, 0 if unknown */
-  unsigned         channels;     /**< number of sound channels, 0 if unknown */
-  unsigned         precision;    /**< bits per sample, 0 if unknown */
-  sox_uint64_t     length;       /**< samples * chans in file, 0 if unknown, -1 if unspecified */
-  double           * mult;       /**< Effects headroom multiplier; may be null */
-} sox_signalinfo_t;
-
-/**
-Client API:
-Basic information about an encoding.
-*/
-typedef struct sox_encodings_info_t {
-  sox_encodings_flags_t flags; /**< lossy once (lossy1), lossy twice (lossy2), or lossless (none). */
-  char const * name;           /**< encoding name. */
-  char const * desc;           /**< encoding description. */
-} sox_encodings_info_t;
-
-/**
-Client API:
-Encoding parameters.
-*/
-typedef struct sox_encodinginfo_t {
-  sox_encoding_t encoding; /**< format of sample numbers */
-  unsigned bits_per_sample;/**< 0 if unknown or variable; uncompressed value if lossless; compressed value if lossy */
-  double compression;      /**< compression factor (where applicable) */
-
-  /**
-  Should bytes be reversed? If this is default during sox_open_read or
-  sox_open_write, libSoX will set them to either no or yes according to the
-  machine or format default.
-  */
-  sox_option_t reverse_bytes;
-
-  /**
-  Should nibbles be reversed? If this is default during sox_open_read or
-  sox_open_write, libSoX will set them to either no or yes according to the
-  machine or format default.
-  */
-  sox_option_t reverse_nibbles;
-
-  /**
-  Should bits be reversed? If this is default during sox_open_read or
-  sox_open_write, libSoX will set them to either no or yes according to the
-  machine or format default.
-  */
-  sox_option_t reverse_bits;
-
-  /**
-  If set to true, the format should reverse its default endianness.
-  */
-  sox_bool opposite_endian;
-} sox_encodinginfo_t;
-
-/**
-Client API:
-Looping parameters (out-of-band data).
-*/
-typedef struct sox_loopinfo_t {
-  sox_uint64_t  start;  /**< first sample */
-  sox_uint64_t  length; /**< length */
-  unsigned      count;  /**< number of repeats, 0=forever */
-  unsigned char type;   /**< 0=no, 1=forward, 2=forward/back (see sox_loop_* for valid values). */
-} sox_loopinfo_t;
-
-/**
-Client API:
-Instrument information.
-*/
-typedef struct sox_instrinfo_t{
-  signed char MIDInote;   /**< for unity pitch playback */
-  signed char MIDIlow;    /**< MIDI pitch-bend low range */
-  signed char MIDIhi;     /**< MIDI pitch-bend high range */
-  unsigned char loopmode; /**< 0=no, 1=forward, 2=forward/back (see sox_loop_* values) */
-  unsigned nloops;  /**< number of active loops (max SOX_MAX_NLOOPS). */
-} sox_instrinfo_t;
-
-/**
-Client API:
-File buffer info.  Holds info so that data can be read in blocks.
-*/
-typedef struct sox_fileinfo_t {
-  char          *buf;                 /**< Pointer to data buffer */
-  size_t        size;                 /**< Size of buffer in bytes */
-  size_t        count;                /**< Count read into buffer */
-  size_t        pos;                  /**< Position in buffer */
-} sox_fileinfo_t;
-
-/**
-Client API:
-Handler structure defined by each format.
-*/
-struct sox_format_handler_t {
-  unsigned     sox_lib_version_code;  /**< Checked on load; must be 1st in struct*/
-  char         const * description;   /**< short description of format */
-  char         const * const * names; /**< null-terminated array of filename extensions that are handled by this format */
-  unsigned int flags;                 /**< File flags (SOX_FILE_* values). */
-  sox_format_handler_startread startread; /**< called to initialize reader (decoder) */
-  sox_format_handler_read read;       /**< called to read (decode) a block of samples */
-  sox_format_handler_stopread stopread; /**< called to close reader (decoder); may be null if no closing necessary */
-  sox_format_handler_startwrite startwrite; /**< called to initialize writer (encoder) */
-  sox_format_handler_write write;     /**< called to write (encode) a block of samples */
-  sox_format_handler_stopwrite stopwrite; /**< called to close writer (decoder); may be null if no closing necessary */
-  sox_format_handler_seek seek;       /**< called to reposition reader; may be null if not supported */
-
-  /**
-  Array of values indicating the encodings and precisions supported for
-  writing (encoding). Precisions specified with default precision first.
-  Encoding, precision, precision, ..., 0, repeat. End with one more 0.
-  Example:
-  unsigned const * formats = {
-    SOX_ENCODING_SIGN2, 16, 24, 0, // Support SIGN2 at 16 and 24 bits, default to 16 bits.
-    SOX_ENCODING_UNSIGNED, 8, 0,   // Support UNSIGNED at 8 bits, default to 8 bits.
-    0 // No more supported encodings.
-  };
-  */
-  unsigned     const * write_formats;
-
-  /**
-  Array of sample rates (samples per second) supported for writing (encoding).
-  NULL if all (or almost all) rates are supported. End with 0.
-  */
-  sox_rate_t   const * write_rates;
-
-  /**
-  SoX will automatically allocate a buffer in which the handler can store data.
-  Specify the size of the buffer needed here. Usually this will be sizeof(your_struct).
-  The buffer will be allocated and zeroed before the call to startread/startwrite.
-  The buffer will be freed after the call to stopread/stopwrite.
-  The buffer will be provided via format.priv in each call to the handler.
-  */
-  size_t       priv_size;
-};
-
-/**
-Client API:
-Comments, instrument info, loop info (out-of-band data).
-*/
-typedef struct sox_oob_t{
-  /* Decoded: */
-  sox_comments_t   comments;              /**< Comment strings in id=value format. */
-  sox_instrinfo_t  instr;                 /**< Instrument specification */
-  sox_loopinfo_t   loops[SOX_MAX_NLOOPS]; /**< Looping specification */
-
-  /* TBD: Non-decoded chunks, etc: */
-} sox_oob_t;
-
-/**
-Client API:
-Data passed to/from the format handler
-*/
-struct sox_format_t {
-  char             * filename;      /**< File name */
-
-  /**
-  Signal specifications for reader (decoder) or writer (encoder):
-  sample rate, number of channels, precision, length, headroom multiplier.
-  Any info specified by the user is here on entry to startread or
-  startwrite. Info will be SOX_UNSPEC if the user provided no info.
-  At exit from startread, should be completely filled in, using
-  either data from the file's headers (if available) or whatever
-  the format is guessing/assuming (if header data is not available).
-  At exit from startwrite, should be completely filled in, using
-  either the data that was specified, or values chosen by the format
-  based on the format's defaults or capabilities.
-  */
-  sox_signalinfo_t signal;
-
-  /**
-  Encoding specifications for reader (decoder) or writer (encoder):
-  encoding (sample format), bits per sample, compression rate, endianness.
-  Should be filled in by startread. Values specified should be used
-  by startwrite when it is configuring the encoding parameters.
-  */
-  sox_encodinginfo_t encoding;
-
-  char             * filetype;      /**< Type of file, as determined by header inspection or libmagic. */
-  sox_oob_t        oob;             /**< comments, instrument info, loop info (out-of-band data) */
-  sox_bool         seekable;        /**< Can seek on this file */
-  char             mode;            /**< Read or write mode ('r' or 'w') */
-  sox_uint64_t     olength;         /**< Samples * chans written to file */
-  sox_uint64_t     clips;           /**< Incremented if clipping occurs */
-  int              sox_errno;       /**< Failure error code */
-  char             sox_errstr[256]; /**< Failure error text */
-  void             * fp;            /**< File stream pointer */
-  lsx_io_type      io_type;         /**< Stores whether this is a file, pipe or URL */
-  sox_uint64_t     tell_off;        /**< Current offset within file */
-  sox_uint64_t     data_start;      /**< Offset at which headers end and sound data begins (set by lsx_check_read_params) */
-  sox_format_handler_t handler;     /**< Format handler for this file */
-  void             * priv;          /**< Format handler's private data area */
-};
-
-/**
-Client API:
-Information about a loaded format handler, including the format name and a
-function pointer that can be invoked to get additional information about the
-format.
-*/
-typedef struct sox_format_tab_t {
-  char *name;         /**< Name of format handler */
-  sox_format_fn_t fn; /**< Function to call to get format handler's information */
-} sox_format_tab_t;
-
-/**
-Client API:
-Global parameters for effects.
-*/
-typedef struct sox_effects_globals_t {
-  sox_plot_t plot;         /**< To help the user choose effect & options */
-  sox_globals_t * global_info; /**< Pointer to associated SoX globals */
-} sox_effects_globals_t;
-
-/**
-Client API:
-Effect handler information.
-*/
-struct sox_effect_handler_t {
-  char const * name;  /**< Effect name */
-  char const * usage; /**< Short explanation of parameters accepted by effect */
-  unsigned int flags; /**< Combination of SOX_EFF_* flags */
-  sox_effect_handler_getopts getopts; /**< Called to parse command-line arguments (called once per effect). */
-  sox_effect_handler_start start;     /**< Called to initialize effect (called once per flow). */
-  sox_effect_handler_flow flow;       /**< Called to process samples. */
-  sox_effect_handler_drain drain;     /**< Called to finish getting output after input is complete. */
-  sox_effect_handler_stop stop;       /**< Called to shut down effect (called once per flow). */
-  sox_effect_handler_kill kill;       /**< Called to shut down effect (called once per effect). */
-  size_t       priv_size;             /**< Size of private data SoX should pre-allocate for effect */
-};
-
-/**
-Client API:
-Effect information.
-*/
-struct sox_effect_t {
-  sox_effects_globals_t    * global_info; /**< global effect parameters */
-  sox_signalinfo_t         in_signal;     /**< Information about the incoming data stream */
-  sox_signalinfo_t         out_signal;    /**< Information about the outgoing data stream */
-  sox_encodinginfo_t       const * in_encoding;  /**< Information about the incoming data encoding */
-  sox_encodinginfo_t       const * out_encoding; /**< Information about the outgoing data encoding */
-  sox_effect_handler_t     handler;   /**< The handler for this effect */
-  sox_sample_t             * obuf;    /**< output buffer */
-  size_t                   obeg;      /**< output buffer: start of valid data section */
-  size_t                   oend;      /**< output buffer: one past valid data section (oend-obeg is length of current content) */
-  size_t               imin;          /**< minimum input buffer content required for calling this effect's flow function; set via lsx_effect_set_imin() */
-  sox_uint64_t         clips;         /**< increment if clipping occurs */
-  size_t               flows;         /**< 1 if MCHAN, number of chans otherwise */
-  size_t               flow;          /**< flow number */
-  void                 * priv;        /**< Effect's private data area (each flow has a separate copy) */
-};
-
-/**
-Client API:
-Chain of effects to be applied to a stream.
-*/
-typedef struct sox_effects_chain_t {
-  sox_effect_t **effects;                  /**< Table of effects to be applied to a stream */
-  unsigned table_size;                     /**< Number of entries in effects table */
-  unsigned length;                         /**< Number of effects to be applied */
-  sox_sample_t **ibufc;                    /**< Channel interleave buffer */
-  sox_sample_t **obufc;                    /**< Channel interleave buffer */
-  sox_effects_globals_t global_info;       /**< Copy of global effects settings */
-  sox_encodinginfo_t const * in_enc;       /**< Input encoding */
-  sox_encodinginfo_t const * out_enc;      /**< Output encoding */
-} sox_effects_chain_t;
-
-/*****************************************************************************
-Functions:
-*****************************************************************************/
-
-/**
-Client API:
-Returns version number string of libSoX, for example, "14.4.0".
-@returns The version number string of libSoX, for example, "14.4.0".
-*/
-LSX_RETURN_VALID_Z LSX_RETURN_PURE
-char const *
-LSX_API
-sox_version(void);
-
-/**
-Client API:
-Returns information about this build of libsox.
-@returns Pointer to a version information structure.
-*/
-LSX_RETURN_VALID LSX_RETURN_PURE
-sox_version_info_t const *
-LSX_API
-sox_version_info(void);
-
-/**
-Client API:
-Returns a pointer to the structure with libSoX's global settings.
-@returns a pointer to the structure with libSoX's global settings.
-*/
-LSX_RETURN_VALID LSX_RETURN_PURE
-sox_globals_t *
-LSX_API
-sox_get_globals(void);
-
-/**
-Client API:
-Deprecated macro that returns the structure with libSoX's global settings
-as an lvalue.
-*/
-#define sox_globals (*sox_get_globals())
-
-/**
-Client API:
-Returns a pointer to the list of available encodings.
-End of list indicated by name == NULL.
-@returns pointer to the list of available encodings.
-*/
-LSX_RETURN_ARRAY LSX_RETURN_PURE
-sox_encodings_info_t const *
-LSX_API
-sox_get_encodings_info(void);
-
-/**
-Client API:
-Deprecated macro that returns the list of available encodings.
-End of list indicated by name == NULL.
-*/
-#define sox_encodings_info (sox_get_encodings_info())
-
-/**
-Client API:
-Fills in an encodinginfo with default values.
-*/
-void
-LSX_API
-sox_init_encodinginfo(
-    LSX_PARAM_OUT sox_encodinginfo_t * e /**< Pointer to uninitialized encoding info structure to be initialized. */
-    );
-
-/**
-Client API:
-Given an encoding (for example, SIGN2) and the encoded bits_per_sample (for
-example, 16), returns the number of useful bits per sample in the decoded data
-(for example, 16), or returns 0 to indicate that the value returned by the
-format handler should be used instead of a pre-determined precision.
-@returns the number of useful bits per sample in the decoded data (for example
-16), or returns 0 to indicate that the value returned by the format handler
-should be used instead of a pre-determined precision.
-*/
-LSX_RETURN_PURE
-unsigned
-LSX_API
-sox_precision(
-    sox_encoding_t encoding,   /**< Encoding for which to lookup precision information. */
-    unsigned bits_per_sample   /**< The number of encoded bits per sample. */
-    );
-
-/**
-Client API:
-Returns the number of items in the metadata block.
-@returns the number of items in the metadata block.
-*/
-size_t
-LSX_API
-sox_num_comments(
-    LSX_PARAM_IN_OPT sox_comments_t comments /**< Metadata block. */
-    );
-
-/**
-Client API:
-Adds an "id=value" item to the metadata block.
-*/
-void
-LSX_API
-sox_append_comment(
-    LSX_PARAM_DEREF_PRE_MAYBENULL LSX_PARAM_DEREF_POST_NOTNULL sox_comments_t * comments, /**< Metadata block. */
-    LSX_PARAM_IN_Z char const * item /**< Item to be added in "id=value" format. */
-    );
-
-/**
-Client API:
-Adds a newline-delimited list of "id=value" items to the metadata block.
-*/
-void
-LSX_API
-sox_append_comments(
-    LSX_PARAM_DEREF_PRE_MAYBENULL LSX_PARAM_DEREF_POST_NOTNULL sox_comments_t * comments, /**< Metadata block. */
-    LSX_PARAM_IN_Z char const * items /**< Newline-separated list of items to be added, for example "id1=value1\\nid2=value2". */
-    );
-
-/**
-Client API:
-Duplicates the metadata block.
-@returns the copied metadata block.
-*/
-LSX_RETURN_OPT
-sox_comments_t
-LSX_API
-sox_copy_comments(
-    LSX_PARAM_IN_OPT sox_comments_t comments /**< Metadata block to copy. */
-    );
-
-/**
-Client API:
-Frees the metadata block.
-*/
-void
-LSX_API
-sox_delete_comments(
-    LSX_PARAM_DEREF_PRE_MAYBENULL LSX_PARAM_DEREF_POST_NULL sox_comments_t * comments /**< Metadata block. */
-    );
-
-/**
-Client API:
-If "id=value" is found, return value, else return null.
-@returns value, or null if value not found.
-*/
-LSX_RETURN_OPT
-char const *
-LSX_API
-sox_find_comment(
-    LSX_PARAM_IN_OPT sox_comments_t comments, /**< Metadata block in which to search. */
-    LSX_PARAM_IN_Z char const * id /**< Id for which to search */
-    );
-
-/**
-Client API:
-Find and load format handler plugins.
-@returns SOX_SUCCESS if successful.
-*/
-int
-LSX_API
-sox_format_init(void);
-
-/**
-Client API:
-Unload format handler plugins.
-*/
-void
-LSX_API
-sox_format_quit(void);
-
-/**
-Client API:
-Initialize effects library.
-@returns SOX_SUCCESS if successful.
-*/
-int
-LSX_API
-sox_init(void);
-
-/**
-Client API:
-Close effects library and unload format handler plugins.
-@returns SOX_SUCCESS if successful.
-*/
-int
-LSX_API
-sox_quit(void);
-
-/**
-Client API:
-Returns the table of format handler names and functions.
-@returns the table of format handler names and functions.
-*/
-LSX_RETURN_ARRAY LSX_RETURN_PURE
-sox_format_tab_t const *
-LSX_API
-sox_get_format_fns(void);
-
-/**
-Client API:
-Deprecated macro that returns the table of format handler names and functions.
-*/
-#define sox_format_fns (sox_get_format_fns())
-
-/**
-Client API:
-Opens a decoding session for a file. Returned handle must be closed with sox_close().
-@returns The handle for the new session, or null on failure.
-*/
-LSX_RETURN_OPT
-sox_format_t *
-LSX_API
-sox_open_read(
-    LSX_PARAM_IN_Z   char               const * path,      /**< Path to file to be opened (required). */
-    LSX_PARAM_IN_OPT sox_signalinfo_t   const * signal,    /**< Information already known about audio stream, or NULL if none. */
-    LSX_PARAM_IN_OPT sox_encodinginfo_t const * encoding,  /**< Information already known about sample encoding, or NULL if none. */
-    LSX_PARAM_IN_OPT_Z char             const * filetype   /**< Previously-determined file type, or NULL to auto-detect. */
-    );
-
-/**
-Client API:
-Opens a decoding session for a memory buffer. Returned handle must be closed with sox_close().
-@returns The handle for the new session, or null on failure.
-*/
-LSX_RETURN_OPT
-sox_format_t *
-LSX_API
-sox_open_mem_read(
-    LSX_PARAM_IN_BYTECOUNT(buffer_size) void  * buffer,     /**< Pointer to audio data buffer (required). */
-    size_t                                      buffer_size,/**< Number of bytes to read from audio data buffer. */
-    LSX_PARAM_IN_OPT sox_signalinfo_t   const * signal,     /**< Information already known about audio stream, or NULL if none. */
-    LSX_PARAM_IN_OPT sox_encodinginfo_t const * encoding,   /**< Information already known about sample encoding, or NULL if none. */
-    LSX_PARAM_IN_OPT_Z char             const * filetype    /**< Previously-determined file type, or NULL to auto-detect. */
-    );
-
-/**
-Client API:
-Returns true if the format handler for the specified file type supports the specified encoding.
-@returns true if the format handler for the specified file type supports the specified encoding.
-*/
-sox_bool
-LSX_API
-sox_format_supports_encoding(
-    LSX_PARAM_IN_OPT_Z char               const * path,       /**< Path to file to be examined (required if filetype is NULL). */
-    LSX_PARAM_IN_OPT_Z char               const * filetype,   /**< Previously-determined file type, or NULL to use extension from path. */
-    LSX_PARAM_IN       sox_encodinginfo_t const * encoding    /**< Encoding for which format handler should be queried. */
-    );
-
-/**
-Client API:
-Gets the format handler for a specified file type.
-@returns The found format handler, or null if not found.
-*/
-LSX_RETURN_OPT
-sox_format_handler_t const *
-LSX_API
-sox_write_handler(
-    LSX_PARAM_IN_OPT_Z char               const * path,         /**< Path to file (required if filetype is NULL). */
-    LSX_PARAM_IN_OPT_Z char               const * filetype,     /**< Filetype for which handler is needed, or NULL to use extension from path. */
-    LSX_PARAM_OUT_OPT  char               const * * filetype1   /**< Receives the filetype that was detected. Pass NULL if not needed. */
-    );
-
-/**
-Client API:
-Opens an encoding session for a file. Returned handle must be closed with sox_close().
-@returns The new session handle, or null on failure.
-*/
-LSX_RETURN_OPT
-sox_format_t *
-LSX_API
-sox_open_write(
-    LSX_PARAM_IN_Z     char               const * path,     /**< Path to file to be written (required). */
-    LSX_PARAM_IN       sox_signalinfo_t   const * signal,   /**< Information about desired audio stream (required). */
-    LSX_PARAM_IN_OPT   sox_encodinginfo_t const * encoding, /**< Information about desired sample encoding, or NULL to use defaults. */
-    LSX_PARAM_IN_OPT_Z char               const * filetype, /**< Previously-determined file type, or NULL to auto-detect. */
-    LSX_PARAM_IN_OPT   sox_oob_t          const * oob,      /**< Out-of-band data to add to file, or NULL if none. */
-    LSX_PARAM_IN_OPT   sox_bool           (LSX_API * overwrite_permitted)(LSX_PARAM_IN_Z char const * filename) /**< Called if file exists to determine whether overwrite is ok. */
-    );
-
-/**
-Client API:
-Opens an encoding session for a memory buffer. Returned handle must be closed with sox_close().
-@returns The new session handle, or null on failure.
-*/
-LSX_RETURN_OPT
-sox_format_t *
-LSX_API
-sox_open_mem_write(
-    LSX_PARAM_OUT_BYTECAP(buffer_size) void                     * buffer,      /**< Pointer to audio data buffer that receives data (required). */
-    LSX_PARAM_IN                       size_t                     buffer_size, /**< Maximum number of bytes to write to audio data buffer. */
-    LSX_PARAM_IN                       sox_signalinfo_t   const * signal,      /**< Information about desired audio stream (required). */
-    LSX_PARAM_IN_OPT                   sox_encodinginfo_t const * encoding,    /**< Information about desired sample encoding, or NULL to use defaults. */
-    LSX_PARAM_IN_OPT_Z                 char               const * filetype,    /**< Previously-determined file type, or NULL to auto-detect. */
-    LSX_PARAM_IN_OPT                   sox_oob_t          const * oob          /**< Out-of-band data to add to file, or NULL if none. */
-    );
-
-/**
-Client API:
-Opens an encoding session for a memstream buffer. Returned handle must be closed with sox_close().
-@returns The new session handle, or null on failure.
-*/
-LSX_RETURN_OPT
-sox_format_t *
-LSX_API
-sox_open_memstream_write(
-    LSX_PARAM_OUT      char                     * * buffer_ptr,    /**< Receives pointer to audio data buffer that receives data (required). */
-    LSX_PARAM_OUT      size_t                   * buffer_size_ptr, /**< Receives size of data written to audio data buffer (required). */
-    LSX_PARAM_IN       sox_signalinfo_t   const * signal,          /**< Information about desired audio stream (required). */
-    LSX_PARAM_IN_OPT   sox_encodinginfo_t const * encoding,        /**< Information about desired sample encoding, or NULL to use defaults. */
-    LSX_PARAM_IN_OPT_Z char               const * filetype,        /**< Previously-determined file type, or NULL to auto-detect. */
-    LSX_PARAM_IN_OPT   sox_oob_t          const * oob              /**< Out-of-band data to add to file, or NULL if none. */
-    );
-
-/**
-Client API:
-Reads samples from a decoding session into a sample buffer.
-@returns Number of samples decoded, or 0 for EOF.
-*/
-size_t
-LSX_API
-sox_read(
-    LSX_PARAM_INOUT sox_format_t * ft, /**< Format pointer. */
-    LSX_PARAM_OUT_CAP_POST_COUNT(len,return) sox_sample_t *buf, /**< Buffer from which to read samples. */
-    size_t len /**< Number of samples available in buf. */
-    );
-
-/**
-Client API:
-Writes samples to an encoding session from a sample buffer.
-@returns Number of samples encoded.
-*/
-size_t
-LSX_API
-sox_write(
-    LSX_PARAM_INOUT sox_format_t * ft, /**< Format pointer. */
-    LSX_PARAM_IN_COUNT(len) sox_sample_t const * buf, /**< Buffer from which to read samples. */
-    size_t len /**< Number of samples available in buf. */
-    );
-
-/**
-Client API:
-Closes an encoding or decoding session.
-@returns SOX_SUCCESS if successful.
-*/
-int
-LSX_API
-sox_close(
-    LSX_PARAM_INOUT sox_format_t * ft /**< Format pointer. */
-    );
-
-/**
-Client API:
-Sets the location at which next samples will be decoded. Returns SOX_SUCCESS if successful.
-@returns SOX_SUCCESS if successful.
-*/
-int
-LSX_API
-sox_seek(
-    LSX_PARAM_INOUT sox_format_t * ft, /**< Format pointer. */
-    sox_uint64_t offset, /**< Sample offset at which to position reader. */
-    int whence /**< Set to SOX_SEEK_SET. */
-    );
-
-/**
-Client API:
-Finds a format handler by name.
-@returns Format handler data, or null if not found.
-*/
-LSX_RETURN_OPT
-sox_format_handler_t const *
-LSX_API
-sox_find_format(
-    LSX_PARAM_IN_Z char const * name, /**< Name of format handler to find. */
-    sox_bool ignore_devices /**< Set to true to ignore device names. */
-    );
-
-/**
-Client API:
-Returns global parameters for effects
-@returns global parameters for effects.
-*/
-LSX_RETURN_VALID LSX_RETURN_PURE
-sox_effects_globals_t *
-LSX_API
-sox_get_effects_globals(void);
-
-/**
-Client API:
-Deprecated macro that returns global parameters for effects.
-*/
-#define sox_effects_globals (*sox_get_effects_globals())
-
-/**
-Client API:
-Finds the effect handler with the given name.
-@returns Effect pointer, or null if not found.
-*/
-LSX_RETURN_OPT LSX_RETURN_PURE
-sox_effect_handler_t const *
-LSX_API
-sox_find_effect(
-    LSX_PARAM_IN_Z char const * name /**< Name of effect to find. */
-    );
-
-/**
-Client API:
-Creates an effect using the given handler.
-@returns The new effect, or null if not found.
-*/
-LSX_RETURN_OPT
-sox_effect_t *
-LSX_API
-sox_create_effect(
-    LSX_PARAM_IN sox_effect_handler_t const * eh /**< Handler to use for effect. */
-    );
-
-/**
-Client API:
-Applies the command-line options to the effect.
-@returns the number of arguments consumed.
-*/
-int
-LSX_API
-sox_effect_options(
-    LSX_PARAM_IN sox_effect_t *effp, /**< Effect pointer on which to set options. */
-    int argc, /**< Number of arguments in argv. */
-    LSX_PARAM_IN_COUNT(argc) char * const argv[] /**< Array of command-line options. */
-    );
-
-/**
-Client API:
-Returns an array containing the known effect handlers.
-@returns An array containing the known effect handlers.
-*/
-LSX_RETURN_VALID_Z LSX_RETURN_PURE
-sox_effect_fn_t const *
-LSX_API
-sox_get_effect_fns(void);
-
-/**
-Client API:
-Deprecated macro that returns an array containing the known effect handlers.
-*/
-#define sox_effect_fns (sox_get_effect_fns())
-
-/**
-Client API:
-Initializes an effects chain. Returned handle must be closed with sox_delete_effects_chain().
-@returns Handle, or null on failure.
-*/
-LSX_RETURN_OPT
-sox_effects_chain_t *
-LSX_API
-sox_create_effects_chain(
-    LSX_PARAM_IN sox_encodinginfo_t const * in_enc, /**< Input encoding. */
-    LSX_PARAM_IN sox_encodinginfo_t const * out_enc /**< Output encoding. */
-    );
-
-/**
-Client API:
-Closes an effects chain.
-*/
-void
-LSX_API
-sox_delete_effects_chain(
-    LSX_PARAM_INOUT sox_effects_chain_t *ecp /**< Effects chain pointer. */
-    );
-
-/**
-Client API:
-Adds an effect to the effects chain, returns SOX_SUCCESS if successful.
-@returns SOX_SUCCESS if successful.
-*/
-int
-LSX_API
-sox_add_effect(
-    LSX_PARAM_INOUT sox_effects_chain_t * chain, /**< Effects chain to which effect should be added . */
-    LSX_PARAM_INOUT sox_effect_t * effp, /**< Effect to be added. */
-    LSX_PARAM_INOUT sox_signalinfo_t * in, /**< Input format. */
-    LSX_PARAM_IN    sox_signalinfo_t const * out /**< Output format. */
-    );
-
-/**
-Client API:
-Runs the effects chain, returns SOX_SUCCESS if successful.
-@returns SOX_SUCCESS if successful.
-*/
-int
-LSX_API
-sox_flow_effects(
-    LSX_PARAM_INOUT  sox_effects_chain_t * chain, /**< Effects chain to run. */
-    LSX_PARAM_IN_OPT sox_flow_effects_callback callback, /**< Callback for monitoring flow progress. */
-    LSX_PARAM_IN_OPT void * client_data /**< Data to pass into callback. */
-    );
-
-/**
-Client API:
-Gets the number of clips that occurred while running an effects chain.
-@returns the number of clips that occurred while running an effects chain.
-*/
-sox_uint64_t
-LSX_API
-sox_effects_clips(
-    LSX_PARAM_IN sox_effects_chain_t * chain /**< Effects chain from which to read clip information. */
-    );
-
-/**
-Client API:
-Shuts down an effect (calls stop on each of its flows).
-@returns the number of clips from all flows.
-*/
-sox_uint64_t
-LSX_API
-sox_stop_effect(
-    LSX_PARAM_INOUT_COUNT(effp->flows) sox_effect_t * effp /**< Effect to stop. */
-    );
-
-/**
-Client API:
-Adds an already-initialized effect to the end of the chain.
-*/
-void
-LSX_API
-sox_push_effect_last(
-    LSX_PARAM_INOUT sox_effects_chain_t * chain, /**< Effects chain to which effect should be added. */
-    LSX_PARAM_INOUT sox_effect_t * effp /**< Effect to be added. */
-    );
-
-/**
-Client API:
-Removes and returns an effect from the end of the chain.
-@returns the removed effect, or null if no effects.
-*/
-LSX_RETURN_OPT
-sox_effect_t *
-LSX_API
-sox_pop_effect_last(
-    LSX_PARAM_INOUT sox_effects_chain_t *chain /**< Effects chain from which to remove an effect. */
-    );
-
-/**
-Client API:
-Shut down and delete an effect.
-*/
-void
-LSX_API
-sox_delete_effect(
-    LSX_PARAM_INOUT_COUNT(effp->flows) sox_effect_t *effp /**< Effect to be deleted. */
-    );
-
-/**
-Client API:
-Shut down and delete the last effect in the chain.
-*/
-void
-LSX_API
-sox_delete_effect_last(
-    LSX_PARAM_INOUT sox_effects_chain_t *chain /**< Effects chain from which to remove the last effect. */
-    );
-
-/**
-Client API:
-Shut down and delete all effects in the chain.
-*/
-void
-LSX_API
-sox_delete_effects(
-    LSX_PARAM_INOUT sox_effects_chain_t *chain /**< Effects chain from which to delete effects. */
-    );
-
-/**
-Client API:
-Gets the sample offset of the start of the trim, useful for efficiently
-skipping the part that will be trimmed anyway (get trim start, seek, then
-clear trim start).
-@returns the sample offset of the start of the trim.
-*/
-sox_uint64_t
-LSX_API
-sox_trim_get_start(
-    LSX_PARAM_IN sox_effect_t * effp /**< Trim effect. */
-    );
-
-/**
-Client API:
-Clears the start of the trim to 0.
-*/
-void
-LSX_API
-sox_trim_clear_start(
-    LSX_PARAM_INOUT sox_effect_t * effp /**< Trim effect. */
-    );
-
-/**
-Client API:
-Returns true if the specified file is a known playlist file type.
-@returns true if the specified file is a known playlist file type.
-*/
-sox_bool
-LSX_API
-sox_is_playlist(
-    LSX_PARAM_IN_Z char const * filename /**< Name of file to examine. */
-    );
-
-/**
-Client API:
-Parses the specified playlist file.
-@returns SOX_SUCCESS if successful.
-*/
-int
-LSX_API
-sox_parse_playlist(
-    LSX_PARAM_IN sox_playlist_callback_t callback, /**< Callback to call for each item in the playlist. */
-    void * p, /**< Data to pass to callback. */
-    LSX_PARAM_IN char const * const listname /**< Filename of playlist file. */
-    );
-
-/**
-Client API:
-Converts a SoX error code into an error string.
-@returns error string corresponding to the specified error code,
-or a generic message if the error code is not recognized.
-*/
-LSX_RETURN_VALID_Z LSX_RETURN_PURE
-char const *
-LSX_API
-sox_strerror(
-    int sox_errno /**< Error code to look up. */
-    );
-
-/**
-Client API:
-Gets the basename of the specified file; for example, the basename of
-"/a/b/c.d" would be "c".
-@returns the number of characters written to base_buffer, excluding the null,
-or 0 on failure.
-*/
-size_t
-LSX_API
-sox_basename(
-    LSX_PARAM_OUT_Z_CAP_POST_COUNT(base_buffer_len,return) char * base_buffer, /**< Buffer into which basename should be written. */
-    size_t base_buffer_len, /**< Size of base_buffer, in bytes. */
-    LSX_PARAM_IN_Z char const * filename /**< Filename from which to extract basename. */
-    );
-
-/*****************************************************************************
-Internal API:
-WARNING - The items in this section are subject to instability. They only
-exist in the public header because sox (the application) currently uses them.
-These may be changed or removed in future versions of libSoX.
-*****************************************************************************/
-
-/**
-Plugins API:
-Print a fatal error in libSoX.
-*/
-void
-LSX_API
-lsx_fail_impl(
-    LSX_PARAM_IN_PRINTF char const * fmt, /**< printf-style format string. */
-    ...)
-    LSX_PRINTF12;
-
-/**
-Plugins API:
-Print a warning in libSoX.
-*/
-void
-LSX_API
-lsx_warn_impl(
-    LSX_PARAM_IN_PRINTF char const * fmt, /**< printf-style format string. */
-    ...)
-    LSX_PRINTF12;
-
-/**
-Plugins API:
-Print an informational message in libSoX.
-*/
-void
-LSX_API
-lsx_report_impl(
-    LSX_PARAM_IN_PRINTF char const * fmt, /**< printf-style format string. */
-    ...)
-    LSX_PRINTF12;
-
-/**
-Plugins API:
-Print a debug message in libSoX.
-*/
-void
-LSX_API
-lsx_debug_impl(
-    LSX_PARAM_IN_PRINTF char const * fmt, /**< printf-style format string. */
-    ...)
-    LSX_PRINTF12;
-
-/**
-Plugins API:
-Report a fatal error in libSoX; printf-style arguments must follow.
-*/
-#define lsx_fail       sox_get_globals()->subsystem=__FILE__,lsx_fail_impl
-
-/**
-Plugins API:
-Report a warning in libSoX; printf-style arguments must follow.
-*/
-#define lsx_warn       sox_get_globals()->subsystem=__FILE__,lsx_warn_impl
-
-/**
-Plugins API:
-Report an informational message in libSoX; printf-style arguments must follow.
-*/
-#define lsx_report     sox_get_globals()->subsystem=__FILE__,lsx_report_impl
-
-/**
-Plugins API:
-Report a debug message in libSoX; printf-style arguments must follow.
-*/
-#define lsx_debug      sox_get_globals()->subsystem=__FILE__,lsx_debug_impl
-
-/**
-Plugins API:
-String name and integer values for enumerated types (type metadata), for use
-with LSX_ENUM_ITEM, lsx_find_enum_text, and lsx_find_enum_value.
-*/
-typedef struct lsx_enum_item {
-    char const *text; /**< String name of enumeration. */
-    unsigned value;   /**< Integer value of enumeration. */
-} lsx_enum_item;
-
-/**
-Plugins API:
-Declares a static instance of an lsx_enum_item structure in format
-{ "item", prefixitem }, for use in declaring lsx_enum_item[] arrays.
-@param prefix The prefix to prepend to the item in the enumeration symbolic name.
-@param item   The user-visible text name of the item (must also be a valid C symbol name).
-*/
-#define LSX_ENUM_ITEM(prefix, item) {#item, prefix##item},
-
-/**
-Plugins API:
-Flags for use with lsx_find_enum_item.
-*/
-enum
-{
-    lsx_find_enum_item_none = 0, /**< Default parameters (case-insensitive). */
-    lsx_find_enum_item_case_sensitive = 1 /**< Enable case-sensitive search. */
-};
-
-/**
-Plugins API:
-Looks up an enumeration by name in an array of lsx_enum_items.
-@returns the corresponding item, or null if not found.
-*/
-LSX_RETURN_OPT LSX_RETURN_PURE
-lsx_enum_item const *
-LSX_API
-lsx_find_enum_text(
-    LSX_PARAM_IN_Z char const * text, /**< Name of enumeration to find. */
-    LSX_PARAM_IN lsx_enum_item const * lsx_enum_items, /**< Array of items to search, with text == NULL for last item. */
-    int flags /**< Search flags: 0 (case-insensitive) or lsx_find_enum_item_case_sensitive (case-sensitive). */
-    );
-
-/**
-Plugins API:
-Looks up an enumeration by value in an array of lsx_enum_items.
-@returns the corresponding item, or null if not found.
-*/
-LSX_RETURN_OPT LSX_RETURN_PURE
-lsx_enum_item const *
-LSX_API
-lsx_find_enum_value(
-    unsigned value, /**< Enumeration value to find. */
-    LSX_PARAM_IN lsx_enum_item const * lsx_enum_items /**< Array of items to search, with text == NULL for last item. */
-    );
-
-/**
-Plugins API:
-Looks up a command-line argument in a set of enumeration names, showing an
-error message if the argument is not found in the set of names.
-@returns The enumeration value corresponding to the matching enumeration, or
-INT_MAX if the argument does not match any enumeration name.
-*/
-LSX_RETURN_PURE
-int
-LSX_API
-lsx_enum_option(
-    int c, /**< Option character to which arg is associated, for example with -a, c would be 'a'. */
-    LSX_PARAM_IN_Z char const * arg, /**< Argument to find in enumeration list. */
-    LSX_PARAM_IN lsx_enum_item const * items /**< Array of items to search, with text == NULL for last item. */
-    );
-
-/**
-Plugins API:
-Determines whether the specified string ends with the specified suffix (case-sensitive).
-@returns true if the specified string ends with the specified suffix.
-*/
-LSX_RETURN_PURE
-sox_bool
-LSX_API
-lsx_strends(
-    LSX_PARAM_IN_Z char const * str, /**< String to search. */
-    LSX_PARAM_IN_Z char const * end  /**< Suffix to search for. */
-    );
-
-/**
-Plugins API:
-Finds the file extension for a filename.
-@returns the file extension, not including the '.', or null if filename does
-not have an extension.
-*/
-LSX_RETURN_VALID_Z LSX_RETURN_PURE
-char const *
-LSX_API
-lsx_find_file_extension(
-    LSX_PARAM_IN_Z char const * pathname /**< Filename to search for extension. */
-    );
-
-/**
-Plugins API:
-Formats the specified number with up to three significant figures and adds a
-metric suffix in place of the exponent, such as 1.23G.
-@returns A static buffer with the formatted number, valid until the next time
-this function is called (note: not thread safe).
-*/
-LSX_RETURN_VALID_Z
-char const *
-LSX_API
-lsx_sigfigs3(
-    double number /**< Number to be formatted. */
-    );
-
-/**
-Plugins API:
-Formats the specified number as a percentage, showing up to three significant
-figures.
-@returns A static buffer with the formatted number, valid until the next time
-this function is called (note: not thread safe).
-*/
-LSX_RETURN_VALID_Z
-char const *
-LSX_API
-lsx_sigfigs3p(
-    double percentage /**< Number to be formatted. */
-    );
-
-/**
-Plugins API:
-Allocates, deallocates, or resizes; like C's realloc, except that this version
-terminates the running application if unable to allocate the requested memory.
-@returns New buffer, or null if buffer was freed.
-*/
-LSX_RETURN_OPT
-void *
-LSX_API
-lsx_realloc(
-    LSX_PARAM_IN_OPT void *ptr, /**< Pointer to be freed or resized, or null if allocating a new buffer. */
-    size_t newsize /**< New size for buffer, or 0 to free the buffer. */
-    );
-
-/**
-Plugins API:
-Like strcmp, except that the characters are compared without regard to case.
-@returns 0 (s1 == s2), negative (s1 < s2), or positive (s1 > s2).
-*/
-LSX_RETURN_PURE
-int
-LSX_API
-lsx_strcasecmp(
-    LSX_PARAM_IN_Z char const * s1, /**< First string. */
-    LSX_PARAM_IN_Z char const * s2  /**< Second string. */
-    );
-
-
-/**
-Plugins API:
-Like strncmp, except that the characters are compared without regard to case.
-@returns 0 (s1 == s2), negative (s1 < s2), or positive (s1 > s2).
-*/
-LSX_RETURN_PURE
-int
-LSX_API
-lsx_strncasecmp(
-    LSX_PARAM_IN_Z char const * s1, /**< First string. */
-    LSX_PARAM_IN_Z char const * s2, /**< Second string. */
-    size_t n /**< Maximum number of characters to examine. */
-    );
-
-/**
-Plugins API:
-Is option argument unsupported, required, or optional.
-*/
-typedef enum lsx_option_arg_t {
-    lsx_option_arg_none, /**< Option does not have an argument. */
-    lsx_option_arg_required, /**< Option requires an argument. */
-    lsx_option_arg_optional /**< Option can optionally be followed by an argument. */
-} lsx_option_arg_t;
-
-/**
-Plugins API:
-lsx_getopt_init options.
-*/
-typedef enum lsx_getopt_flags_t {
-    lsx_getopt_flag_none = 0,      /**< no flags (no output, not long-only) */
-    lsx_getopt_flag_opterr = 1,    /**< if set, invalid options trigger lsx_warn output */
-    lsx_getopt_flag_longonly = 2   /**< if set, recognize -option as a long option */
-} lsx_getopt_flags_t;
-
-/**
-Plugins API:
-lsx_getopt long option descriptor.
-*/
-typedef struct lsx_option_t {
-    char const *     name;    /**< Name of the long option. */
-    lsx_option_arg_t has_arg; /**< Whether the long option supports an argument and, if so, whether the argument is required or optional. */
-    int *            flag;    /**< Flag to set if argument is present. */
-    int              val;     /**< Value to put in flag if argument is present. */
-} lsx_option_t;
-
-/**
-Plugins API:
-lsx_getopt session information (initialization data and state).
-*/
-typedef struct lsx_getopt_t {
-    int                  argc;     /**< IN    argc:      Number of arguments in argv */
-    char * const *       argv;     /**< IN    argv:      Array of arguments */
-    char const *         shortopts;/**< IN    shortopts: Short option characters */
-    lsx_option_t const * longopts; /**< IN    longopts:  Array of long option descriptors */
-    lsx_getopt_flags_t   flags;    /**< IN    flags:     Flags for longonly and opterr */
-    char const *         curpos;   /**< INOUT curpos:    Maintains state between calls to lsx_getopt */
-    int                  ind;      /**< INOUT optind:    Maintains the index of next element to be processed */
-    int                  opt;      /**< OUT   optopt:    Receives the option character that caused error */
-    char const *         arg;      /**< OUT   optarg:    Receives the value of the option's argument */
-    int                  lngind;   /**< OUT   lngind:    Receives the index of the matched long option or -1 if not a long option */
-} lsx_getopt_t;
-
-/**
-Plugins API:
-Initializes an lsx_getopt_t structure for use with lsx_getopt.
-*/
-void
-LSX_API
-lsx_getopt_init(
-    LSX_PARAM_IN             int argc,                      /**< Number of arguments in argv */
-    LSX_PARAM_IN_COUNT(argc) char * const * argv,           /**< Array of arguments */
-    LSX_PARAM_IN_Z           char const * shortopts,        /**< Short options, for example ":abc:def::ghi" (+/- not supported) */
-    LSX_PARAM_IN_OPT         lsx_option_t const * longopts, /**< Array of long option descriptors */
-    LSX_PARAM_IN             lsx_getopt_flags_t flags,      /**< Flags for longonly and opterr */
-    LSX_PARAM_IN             int first,                     /**< First argv to check (usually 1) */
-    LSX_PARAM_OUT            lsx_getopt_t * state           /**< State object to be initialized */
-    );
-
-/**
-Plugins API:
-Gets the next option. Options are parameters that start with "-" or "--".
-If no more options, returns -1. If unrecognized short option, returns '?'.
-If a recognized short option is missing a required argument,
-return (shortopts[0]==':' ? ':' : '?'). If successfully recognized short
-option, return the recognized character. If successfully recognized long
-option, returns (option.flag ? 0 : option.val).
-Note: lsx_getopt does not permute the non-option arguments.
-@returns option character (short), val or 0 (long), or -1 (no more).
-*/
-int
-LSX_API
-lsx_getopt(
-    LSX_PARAM_INOUT lsx_getopt_t * state /**< The getopt state pointer. */
-    );
-
-/* WARNING END */
-
-#if defined(__cplusplus)
-}
-#endif
-
-#endif /* SOX_H */
diff --git a/fdmdv2/branches/0.97/src/sox_biquad.c b/fdmdv2/branches/0.97/src/sox_biquad.c
deleted file mode 100644 (file)
index f5a0913..0000000
+++ /dev/null
@@ -1,129 +0,0 @@
-//==========================================================================
-// Name:            sox_biquad.h
-// Purpose:         Interface into Sox Biquad filters 
-// Created:         Dec 1, 2012
-// Authors:         David Rowe
-// 
-// To test:
-//          $ gcc sox_biquad.c -o sox_biquad -DSOX_BIQUAD_UNITTEST -Wall \
-//            /path/to/sox-14.4.0/src/.libs/libsox.a -lm -lsndfile
-//          $ ./sox_biquad
-//
-// 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-
-#include <assert.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include "sox.h"
-
-#include "sox_biquad.h"
-
-
-#define N_MAX 1024
-
-int lsx_biquad_flow(sox_effect_t * effp, const sox_sample_t *ibuf,
-                    sox_sample_t *obuf, size_t *isamp, size_t *osamp);
-
-void sox_biquad_start(void)
-{
-    int r = sox_init();
-    assert(r == SOX_SUCCESS);
-}
-
-void sox_biquad_finish(void)
-{
-    sox_quit();
-}
-
-/*
-  Effect must be implemented by biquads.c in sox, arguments are just
-  like sox command line, for example:
-
-  char *argv[10];
-  argv[0] = "highpass"; argv[1]="1000"; argc=1;
-*/
-
-void *sox_biquad_create(int argc, const char *argv[])
-{
-    int ret;
-    sox_effect_t *e;
-    int (*start)(sox_effect_t *); /* function pointer to effect start func */
-    
-    e = sox_create_effect(sox_find_effect(argv[0])); assert(e != NULL);
-    ret = sox_effect_options(e, argc, (char * const*)&argv[1]);
-    assert(ret == SOX_SUCCESS);
-
-    start = e->handler.start;
-    e->in_signal.rate = 8000;     /* locked at FS=8000 Hz */
-    ret = start(e); assert(ret == SOX_SUCCESS);
-    
-    return (void *)e;
-}
-
-void sox_biquad_destroy(void *sbq) {
-    sox_effect_t *e = (sox_effect_t *)sbq;
-    free(e);
-}
-
-void sox_biquad_filter(void *sbq, short out[], short in[], int n)
-{
-    sox_effect_t *e = (sox_effect_t *)sbq;
-    sox_sample_t ibuf[N_MAX];
-    sox_sample_t obuf[N_MAX];
-    size_t isamp, osamp;
-    unsigned int clips;
-    SOX_SAMPLE_LOCALS; 
-    int i;
-
-    assert(n <= N_MAX);
-
-    clips = 0;
-    for(i=0; i<n; i++)
-        ibuf[i] = SOX_SIGNED_16BIT_TO_SAMPLE(in[i], clips);
-    isamp = osamp = (unsigned int)n;
-    lsx_biquad_flow(e, ibuf, obuf, &isamp, &osamp);
-    for(i=0; i<n; i++)
-        out[i] = SOX_SAMPLE_TO_SIGNED_16BIT(obuf[i], clips); 
-}
-
-
-#ifdef SOX_BIQUAD_UNITTEST
-#define N 20
-int main(void) {
-    void *sbq;
-    char *argv[10];
-    short in[N];
-    short out[N];
-    int   i, argc;;
-
-    for(i=0; i<N; i++)
-        in[i] = 0;
-    in[0] = 8000;
-
-    sox_biquad_start();
-    argv[0] = "highpass"; argv[1]="1000"; argc=1;
-    sbq = sox_biquad_create(argc, argv);
-
-    sox_biquad_filter(sbq, out, in, N);
-    for(i=0; i<N; i++)
-        printf("%d\n", out[i]);
-   
-    sox_biquad_destroy(sbq);
-    sox_biquad_finish();
-
-    return 0;
-}
-#endif
diff --git a/fdmdv2/branches/0.97/src/sox_biquad.h b/fdmdv2/branches/0.97/src/sox_biquad.h
deleted file mode 100644 (file)
index f38de64..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-//==========================================================================
-// Name:            sox_biquad.h
-// Purpose:         Interface into Sox Biquad filters 
-// Created:         Dec 1, 2012
-// Authors:         David Rowe
-// 
-// 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-
-#ifndef __SOX_BIQUAD__
-#define __SOX_BIQUAD__
-
-#ifdef __cplusplus
-extern "C" {
-
-#endif
-
-void sox_biquad_start(void);
-void sox_biquad_finish(void);
-void *sox_biquad_create(int argc, const char *argv[]);
-void sox_biquad_destroy(void *sbq);
-void sox_biquad_filter(void *sbq, short out[], short in[], int n);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/fdmdv2/branches/0.97/src/topFrame.cpp b/fdmdv2/branches/0.97/src/topFrame.cpp
deleted file mode 100644 (file)
index c383a8f..0000000
+++ /dev/null
@@ -1,549 +0,0 @@
-//==========================================================================
-// Name:            topFrame.cpp
-//
-// Purpose:         Implements simple wxWidgets application with GUI.
-// Created:         Apr. 9, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#include "topFrame.h"
-
-extern int g_playFileToMicInEventId;
-extern int g_recFileFromRadioEventId;
-extern int g_playFileFromRadioEventId;
-
-//=========================================================================
-// Code that lays out the main application window
-//=========================================================================
-TopFrame::TopFrame(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxFrame(parent, id, title, pos, size, style)
-{
-    this->SetSizeHints(wxDefaultSize, wxDefaultSize);
-    this->SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
-    this->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DLIGHT));
-    this->SetSizeHints(wxDefaultSize, wxDefaultSize);
-    this->SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
-    this->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DLIGHT));
-    //=====================================================
-    // Menubar Setup
-    m_menubarMain = new wxMenuBar(wxMB_DOCKABLE);
-    file = new wxMenu();
-
-    wxMenuItem* m_menuItemOnTop;
-    m_menuItemOnTop = new wxMenuItem(file, wxID_ANY, wxString(_("On Top")) , _("Always Top Window"), wxITEM_NORMAL);
-    file->Append(m_menuItemOnTop);
-
-    wxMenuItem* m_menuItemExit;
-    m_menuItemExit = new wxMenuItem(file, ID_EXIT, wxString(_("E&xit")) , _("Exit Program"), wxITEM_NORMAL);
-    file->Append(m_menuItemExit);
-
-    m_menubarMain->Append(file, _("&File"));
-
-    tools = new wxMenu();
-    wxMenuItem* m_menuItemAudio;
-    m_menuItemAudio = new wxMenuItem(tools, wxID_ANY, wxString(_("&Audio Config")) , wxEmptyString, wxITEM_NORMAL);
-    tools->Append(m_menuItemAudio);
-
-    wxMenuItem* m_menuItemRigCtrlCfg;
-    m_menuItemRigCtrlCfg = new wxMenuItem(tools, wxID_ANY, wxString(_("&PTT Config")) , wxEmptyString, wxITEM_NORMAL);
-    tools->Append(m_menuItemRigCtrlCfg);
-
-    wxMenuItem* m_menuItemOptions;
-    m_menuItemOptions = new wxMenuItem(tools, wxID_ANY, wxString(_("Options")) , wxEmptyString, wxITEM_NORMAL);
-    tools->Append(m_menuItemOptions);
-
-    wxMenuItem* m_menuItemFilter;
-    m_menuItemFilter = new wxMenuItem(tools, wxID_ANY, wxString(_("&Filter")) , wxEmptyString, wxITEM_NORMAL);
-    tools->Append(m_menuItemFilter);
-
-    wxMenuItem* m_menuItemPlayFileToMicIn;
-    m_menuItemPlayFileToMicIn = new wxMenuItem(tools, wxID_ANY, wxString(_("Start/Stop Play File - Mic In")) , wxEmptyString, wxITEM_NORMAL);
-    g_playFileToMicInEventId = m_menuItemPlayFileToMicIn->GetId();
-    tools->Append(m_menuItemPlayFileToMicIn);
-
-    wxMenuItem* m_menuItemRecFileFromRadio;
-    m_menuItemRecFileFromRadio = new wxMenuItem(tools, wxID_ANY, wxString(_("Start/Stop Record File - From Radio")) , wxEmptyString, wxITEM_NORMAL);
-    g_recFileFromRadioEventId = m_menuItemRecFileFromRadio->GetId();
-    tools->Append(m_menuItemRecFileFromRadio);
-
-    wxMenuItem* m_menuItemPlayFileFromRadio;
-    m_menuItemPlayFileFromRadio = new wxMenuItem(tools, wxID_ANY, wxString(_("Start/Stop Play File - From Radio")) , wxEmptyString, wxITEM_NORMAL);
-    g_playFileFromRadioEventId = m_menuItemPlayFileFromRadio->GetId();
-    tools->Append(m_menuItemPlayFileFromRadio);
-    m_menubarMain->Append(tools, _("&Tools"));
-
-    help = new wxMenu();
-    wxMenuItem* m_menuItemHelpUpdates;
-    m_menuItemHelpUpdates = new wxMenuItem(help, wxID_ANY, wxString(_("Check for Updates")) , wxEmptyString, wxITEM_NORMAL);
-    help->Append(m_menuItemHelpUpdates);
-    m_menuItemHelpUpdates->Enable(false);
-
-    wxMenuItem* m_menuItemAbout;
-    m_menuItemAbout = new wxMenuItem(help, ID_ABOUT, wxString(_("&About")) , _("About this program"), wxITEM_NORMAL);
-    help->Append(m_menuItemAbout);
-
-    m_menubarMain->Append(help, _("&Help"));
-
-    this->SetMenuBar(m_menubarMain);
-
-    wxBoxSizer* bSizer1;
-    bSizer1 = new wxBoxSizer(wxHORIZONTAL);
-
-    //=====================================================
-    // Left side
-    //=====================================================
-    wxBoxSizer* leftSizer;
-    leftSizer = new wxBoxSizer(wxVERTICAL);
-
-    wxStaticBoxSizer* snrSizer;
-    snrSizer = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("SNR")), wxVERTICAL);
-
-    //------------------------------
-    // S/N ratio Guage (vert. bargraph)
-    //------------------------------
-    m_gaugeSNR = new wxGauge(this, wxID_ANY, 20, wxDefaultPosition, wxSize(15,135), wxGA_SMOOTH|wxGA_VERTICAL);
-    m_gaugeSNR->SetToolTip(_("Displays signal to noise ratio in dB."));
-    snrSizer->Add(m_gaugeSNR, 1, wxALIGN_CENTER_HORIZONTAL|wxALL, 10);
-
-    //------------------------------
-    // Box for S/N ratio (Numeric)
-    //------------------------------
-    m_textSNR = new wxStaticText(this, wxID_ANY, wxT(" 0.0"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE);
-    snrSizer->Add(m_textSNR, 0, wxALIGN_CENTER_HORIZONTAL, 1);
-
-    //------------------------------
-    // S/N ratio slow Checkbox
-    //------------------------------
-    m_ckboxSNR = new wxCheckBox(this, wxID_ANY, _("Slow"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
-    m_ckboxSNR->SetToolTip(_("Smooth but slow SNR estimation"));
-    snrSizer->Add(m_ckboxSNR, 0, wxALIGN_CENTER_HORIZONTAL, 5);
-
-    leftSizer->Add(snrSizer, 2, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxALL, 1);
-
-    //------------------------------
-    // Sync  Indicator box
-    //------------------------------
-    wxStaticBoxSizer* sbSizer3_33;
-    sbSizer3_33 = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Sync")), wxVERTICAL);
-
-    m_rbSync = new wxRadioButton( this, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
-    m_rbSync->SetForegroundColour( wxColour( 255, 0, 0 ) );
-    sbSizer3_33->Add(m_rbSync, 0, wxALIGN_CENTER|wxALL, 1);
-    leftSizer->Add(sbSizer3_33,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
-
-    //------------------------------
-    // BER Frames box
-    //------------------------------
-
-    wxStaticBoxSizer* sbSizer_ber;
-    sbSizer_ber = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Bit Error Rate")), wxVERTICAL);
-
-    m_BtnBerReset = new wxButton(this, wxID_ANY, _("Reset"), wxDefaultPosition, wxDefaultSize, 0);
-    sbSizer_ber->Add(m_BtnBerReset, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
-
-    m_textBits = new wxStaticText(this, wxID_ANY, wxT("Bits: 0"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
-    sbSizer_ber->Add(m_textBits, 0, wxALIGN_LEFT, 1);
-    m_textErrors = new wxStaticText(this, wxID_ANY, wxT("Errs: 0"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
-    sbSizer_ber->Add(m_textErrors, 0, wxALIGN_LEFT, 1);
-    m_textBER = new wxStaticText(this, wxID_ANY, wxT("BER: 0.0"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
-    sbSizer_ber->Add(m_textBER, 0, wxALIGN_LEFT, 1);
-
-    leftSizer->Add(sbSizer_ber,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
-
-    //------------------------------
-    // Signal Level(vert. bargraph)
-    //------------------------------
-    wxStaticBoxSizer* levelSizer;
-    levelSizer = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Level")), wxVERTICAL);
-
-    m_textLevel = new wxStaticText(this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(60,-1), wxALIGN_CENTRE);
-    m_textLevel->SetForegroundColour(wxColour(255,0,0));
-    levelSizer->Add(m_textLevel, 0, wxALIGN_LEFT, 1);
-
-    m_gaugeLevel = new wxGauge(this, wxID_ANY, 100, wxDefaultPosition, wxSize(15,135), wxGA_SMOOTH|wxGA_VERTICAL);
-    m_gaugeLevel->SetToolTip(_("Peak of From Radio in Rx, or peak of From Mic in Tx mode.  If Red you should reduce your levels"));
-    levelSizer->Add(m_gaugeLevel, 1, wxALIGN_CENTER_HORIZONTAL|wxALL, 10);
-
-    leftSizer->Add(levelSizer, 2, wxALIGN_CENTER|wxALL|wxEXPAND, 1);
-
-    bSizer1->Add(leftSizer, 0, wxALL|wxEXPAND, 5);
-
-    //=====================================================
-    // Center Section
-    //=====================================================
-    wxBoxSizer* centerSizer;
-    centerSizer = new wxBoxSizer(wxVERTICAL);
-    wxBoxSizer* upperSizer;
-    upperSizer = new wxBoxSizer(wxVERTICAL);
-
-    //=====================================================
-    // Tabbed Notebook control containing display graphs
-    //=====================================================
-    //m_auiNbookCtrl = new wxAuiNotebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_NB_BOTTOM|wxAUI_NB_DEFAULT_STYLE);
-    //long style = wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_MOVE | wxAUI_NB_SCROLL_BUTTONS | wxAUI_NB_CLOSE_ON_ACTIVE_TAB | wxAUI_NB_MIDDLE_CLICK_CLOSE;
-    long nb_style = wxAUI_NB_BOTTOM | wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_MOVE | wxAUI_NB_SCROLL_BUTTONS;
-    m_auiNbookCtrl = new wxAuiNotebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, nb_style);
-    // This line sets the fontsize for the tabs on the notebook control
-    m_auiNbookCtrl->SetFont(wxFont(8, 70, 90, 90, false, wxEmptyString));
-
-    upperSizer->Add(m_auiNbookCtrl, 1, wxALIGN_TOP|wxEXPAND, 1);
-    centerSizer->Add(upperSizer, 1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALIGN_TOP|wxEXPAND, 0);
-
-    // lower middle used for user ID
-
-    wxBoxSizer* lowerSizer;
-    lowerSizer = new wxBoxSizer(wxHORIZONTAL);
-
-    m_BtnCallSignReset = new wxButton(this, wxID_ANY, _("Clear"), wxDefaultPosition, wxDefaultSize, 0);
-    lowerSizer->Add(m_BtnCallSignReset, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
-
-    wxBoxSizer* bSizer15;
-    bSizer15 = new wxBoxSizer(wxVERTICAL);
-    m_txtCtrlCallSign = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
-    m_txtCtrlCallSign->SetToolTip(_("Call Sign of transmitting station will appear here"));
-    bSizer15->Add(m_txtCtrlCallSign, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 5);
-    lowerSizer->Add(bSizer15, 1, wxEXPAND, 5);
-
-    wxStaticBoxSizer* sbSizer_Checksum = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Checksums")), wxHORIZONTAL);
-
-    wxStaticText *goodLabel = new wxStaticText(this, wxID_ANY, wxT("Good: "), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE);
-    sbSizer_Checksum->Add(goodLabel, 0, 0, 2);
-    m_txtChecksumGood = new wxStaticText(this, wxID_ANY, wxT("0"), wxDefaultPosition, wxSize(30,-1), wxALIGN_CENTRE);
-    sbSizer_Checksum->Add(m_txtChecksumGood, 0, 0, 2);
-
-    wxStaticText *badLabel = new wxStaticText(this, wxID_ANY, wxT("Bad: "), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE);
-    sbSizer_Checksum->Add(badLabel, 0, 0, 1);
-    m_txtChecksumBad = new wxStaticText(this, wxID_ANY, wxT("0"), wxDefaultPosition, wxSize(30,-1), wxALIGN_CENTRE);
-    sbSizer_Checksum->Add(m_txtChecksumBad, 0, 0, 1);
-
-    lowerSizer->Add(sbSizer_Checksum, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
-
-    //=====================================================
-    // These are the buttons that autosend the userid (?)
-    //=====================================================
-
-    // DR 4 Dec - taken off for screen for Beta release to avoid questions on their use until
-    // we implement this feature
- #ifdef UNIMPLEMENTED
-    wxBoxSizer* bSizer141;
-    bSizer141 = new wxBoxSizer(wxHORIZONTAL);
-
-    // TxID
-    //---------
-    m_togTxID = new wxToggleButton(this, wxID_ANY, _("TxID"), wxDefaultPosition, wxDefaultSize, 0);
-    m_togTxID->SetToolTip(_("Send Tx ID information"));
-    bSizer141->Add(m_togTxID, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
-
-    // RxID
-    //---------
-    m_togRxID = new wxToggleButton(this, wxID_ANY, _("RxID"), wxDefaultPosition, wxDefaultSize, 0);
-    m_togRxID->SetToolTip(_("Enable reception of ID information"));
-    bSizer141->Add(m_togRxID, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_LEFT|wxALL|wxFIXED_MINSIZE, 5);
-
-    lowerSizer->Add(bSizer141, 0, wxALIGN_RIGHT, 5);
-#endif
-
-    centerSizer->Add(lowerSizer, 0, wxALIGN_BOTTOM|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 2);
-    bSizer1->Add(centerSizer, 4, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 1);
-
-    //=====================================================
-    // Right side
-    //=====================================================
-    wxBoxSizer* rightSizer;
-    rightSizer = new wxBoxSizer(wxVERTICAL);
-
-    //=====================================================
-    // Squelch Slider Control
-    //=====================================================
-    wxStaticBoxSizer* sbSizer3;
-    sbSizer3 = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Squelch")), wxVERTICAL);
-
-    m_sliderSQ = new wxSlider(this, wxID_ANY, 0, 0, 40, wxDefaultPosition, wxSize(-1,80), wxSL_AUTOTICKS|wxSL_INVERSE|wxSL_VERTICAL);
-    m_sliderSQ->SetToolTip(_("Set Squelch level in dB."));
-
-    sbSizer3->Add(m_sliderSQ, 1, wxALIGN_CENTER_HORIZONTAL, 0);
-
-    //------------------------------
-    // Squelch Level static text box
-    //------------------------------
-    m_textSQ = new wxStaticText(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE);
-
-    sbSizer3->Add(m_textSQ, 0, wxALIGN_CENTER_HORIZONTAL, 0);
-
-    //------------------------------
-    // Squelch Toggle Checkbox
-    //------------------------------
-    m_ckboxSQ = new wxCheckBox(this, wxID_ANY, _(""), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
-
-    sbSizer3->Add(m_ckboxSQ, 0, wxALIGN_CENTER_HORIZONTAL, 0);
-    rightSizer->Add(sbSizer3, 2, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 0);
-
-    //rightSizer->Add(sbSizer3_33,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
-
-    /* new --- */
-
-    //------------------------------
-    // Mode box
-    //------------------------------
-    wxStaticBoxSizer* sbSizer_mode;
-    sbSizer_mode = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Mode")), wxVERTICAL);
-
-    m_rb1400old = new wxRadioButton( this, wxID_ANY, wxT("1400 V0.91"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
-    sbSizer_mode->Add(m_rb1400old, 0, wxALIGN_LEFT|wxALL, 1);
-#ifdef DISABLED_FEATURE
-    m_rb1400 = new wxRadioButton( this, wxID_ANY, wxT("1400"), wxDefaultPosition, wxDefaultSize, 0);
-    sbSizer_mode->Add(m_rb1400, 0, wxALIGN_LEFT|wxALL, 1);
-#endif
-    m_rb1600 = new wxRadioButton( this, wxID_ANY, wxT("1600"), wxDefaultPosition, wxDefaultSize, 0);
-    sbSizer_mode->Add(m_rb1600, 0, wxALIGN_LEFT|wxALL, 1);
-    m_rb1600->SetValue(true);
-    m_rb1600Wide = new wxRadioButton( this, wxID_ANY, wxT("1600 Wide"), wxDefaultPosition, wxDefaultSize, 0);
-    sbSizer_mode->Add(m_rb1600Wide, 0, wxALIGN_LEFT|wxALL, 1);
-#ifdef DISABLED_FEATURE
-    m_rb2000 = new wxRadioButton( this, wxID_ANY, wxT("2000"), wxDefaultPosition, wxDefaultSize, 0);
-    sbSizer_mode->Add(m_rb2000, 0, wxALIGN_LEFT|wxALL, 1);
-#endif
-
-    rightSizer->Add(sbSizer_mode,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
-
-    #ifdef MOVED_TO_OPTIONS_DIALOG
-    /* new --- */
-
-    //------------------------------
-    // Test Frames box
-    //------------------------------
-
-    wxStaticBoxSizer* sbSizer_testFrames;
-    sbSizer_testFrames = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Test Frames")), wxVERTICAL);
-
-    m_ckboxTestFrame = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
-    sbSizer_testFrames->Add(m_ckboxTestFrame, 0, wxALIGN_LEFT, 0);
-
-    rightSizer->Add(sbSizer_testFrames,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
-    #endif
-
-    //=====================================================
-    // Control Toggles box
-    //=====================================================
-    wxStaticBoxSizer* sbSizer5;
-    sbSizer5 = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Control")), wxVERTICAL);
-    wxBoxSizer* bSizer1511;
-    bSizer1511 = new wxBoxSizer(wxVERTICAL);
-
-    //-------------------------------
-    // Stop/Stop signal processing (rx and tx)
-    //-------------------------------
-    m_togBtnOnOff = new wxToggleButton(this, wxID_ANY, _("Start"), wxDefaultPosition, wxDefaultSize, 0);
-    m_togBtnOnOff->SetToolTip(_("Begin/End receiving data."));
-    bSizer1511->Add(m_togBtnOnOff, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
-    sbSizer5->Add(bSizer1511, 0, wxEXPAND, 1);
-
-#ifdef UNIMPLEMENTED
-    //------------------------------
-    // Toggle Loopback button for RX
-    //------------------------------
-    wxBoxSizer* bSizer15113;
-    bSizer15113 = new wxBoxSizer(wxHORIZONTAL);
-    wxBoxSizer* bSizer15111;
-    bSizer15111 = new wxBoxSizer(wxVERTICAL);
-    wxSize wxSz = wxSize(44, 30);
-    m_togBtnLoopRx = new wxToggleButton(this, wxID_ANY, _("Loop\nRX"), wxDefaultPosition, wxSz, 0);
-    m_togBtnLoopRx->SetFont(wxFont(6, 70, 90, 90, false, wxEmptyString));
-    m_togBtnLoopRx->SetToolTip(_("Loopback Receive audio data."));
-
-    bSizer15111->Add(m_togBtnLoopRx, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 0);
-
-    //sbSizer5->Add(bSizer15111, 0, wxEXPAND, 1);
-    bSizer15113->Add(bSizer15111, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 0);
-
-    //------------------------------
-    // Toggle Loopback button for Tx
-    //------------------------------
-    wxBoxSizer* bSizer15112;
-    bSizer15112 = new wxBoxSizer(wxVERTICAL);
-    m_togBtnLoopTx = new wxToggleButton(this, wxID_ANY, _("Loop\nTX"), wxDefaultPosition, wxSz, 0);
-    m_togBtnLoopTx->SetFont(wxFont(6, 70, 90, 90, false, wxEmptyString));
-    m_togBtnLoopTx->SetToolTip(_("Loopback Transmit audio data."));
-
-    bSizer15112->Add(m_togBtnLoopTx, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 0);
-    bSizer15113->Add(bSizer15112, 0,  wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 0);
-
-    sbSizer5->Add(bSizer15113, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
-#endif
-
-    //------------------------------
-    // Split Frequency Mode Toggle
-    //------------------------------
-    wxBoxSizer* bSizer151;
-    bSizer151 = new wxBoxSizer(wxVERTICAL);
-
-    m_togBtnSplit = new wxToggleButton(this, wxID_ANY, _("Split"), wxDefaultPosition, wxDefaultSize, 0);
-    m_togBtnSplit->SetToolTip(_("Toggle split frequency mode."));
-
-    bSizer151->Add(m_togBtnSplit, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
-    sbSizer5->Add(bSizer151, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 1);
-    wxBoxSizer* bSizer13;
-    bSizer13 = new wxBoxSizer(wxVERTICAL);
-
-    //------------------------------
-    // Analog Passthrough Toggle
-    //------------------------------
-    m_togBtnAnalog = new wxToggleButton(this, wxID_ANY, _("Analog"), wxDefaultPosition, wxDefaultSize, 0);
-    m_togBtnAnalog->SetToolTip(_("Toggle analog/digital operation."));
-    bSizer13->Add(m_togBtnAnalog, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
-    sbSizer5->Add(bSizer13, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
-
-    // not implemented on fdmdv2
-#ifdef ALC
-    //------------------------------
-    // Toggle for ALC
-    //------------------------------
-    wxBoxSizer* bSizer14;
-    bSizer14 = new wxBoxSizer(wxVERTICAL);
-    m_togBtnALC = new wxToggleButton(this, wxID_ANY, _("ALC"), wxDefaultPosition, wxDefaultSize, 0);
-    m_togBtnALC->SetToolTip(_("Toggle automatic level control mode."));
-
-    bSizer14->Add(m_togBtnALC, 0, wxALL, 1);
-    sbSizer5->Add(bSizer14, 0, wxALIGN_CENTER|wxALIGN_CENTER_HORIZONTAL|wxALL, 1);
-#endif
-
-    //------------------------------
-    // Toggle Transmit/Receive relays
-    //------------------------------
-    wxBoxSizer* bSizer11;
-    bSizer11 = new wxBoxSizer(wxVERTICAL);
-    m_btnTogPTT = new wxToggleButton(this, wxID_ANY, _("PTT"), wxDefaultPosition, wxDefaultSize, 0);
-    m_btnTogPTT->SetToolTip(_("Push to Talk - Switch between Receive and Transmit - you can also use the space bar "));
-    bSizer11->Add(m_btnTogPTT, 1, wxALIGN_CENTER|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
-    sbSizer5->Add(bSizer11, 2, wxEXPAND, 1);
-    rightSizer->Add(sbSizer5, 2, wxALIGN_CENTER|wxALL|wxEXPAND, 3);
-    bSizer1->Add(rightSizer, 0, wxALL|wxEXPAND, 3);
-    this->SetSizer(bSizer1);
-    this->Layout();
-    m_statusBar1 = this->CreateStatusBar(3, wxST_SIZEGRIP, wxID_ANY);
-
-    //=====================================================
-    // End of layout
-    //=====================================================
-
-    //-------------------
-    // Connect Events
-    //-------------------
-    this->Connect(wxEVT_CLOSE_WINDOW, wxCloseEventHandler(TopFrame::topFrame_OnClose));
-    this->Connect(wxEVT_PAINT, wxPaintEventHandler(TopFrame::topFrame_OnPaint));
-    this->Connect(wxEVT_SIZE, wxSizeEventHandler(TopFrame::topFrame_OnSize));
-    this->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::topFrame_OnUpdateUI));
-
-    this->Connect(m_menuItemExit->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnExit));
-    this->Connect(m_menuItemOnTop->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnTop));
-
-    this->Connect(m_menuItemAudio->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsAudio));
-    this->Connect(m_menuItemAudio->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsAudioUI));
-    this->Connect(m_menuItemFilter->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsFilter));
-    this->Connect(m_menuItemFilter->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsFilterUI));
-    this->Connect(m_menuItemRigCtrlCfg->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsComCfg));
-    this->Connect(m_menuItemRigCtrlCfg->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsComCfgUI));
-    this->Connect(m_menuItemOptions->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsOptions));
-    this->Connect(m_menuItemOptions->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsOptionsUI));
-
-    this->Connect(m_menuItemPlayFileToMicIn->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnPlayFileToMicIn));
-    this->Connect(m_menuItemRecFileFromRadio->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnRecFileFromRadio));
-    this->Connect(m_menuItemPlayFileFromRadio->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnPlayFileFromRadio));
-
-    this->Connect(m_menuItemHelpUpdates->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnHelpCheckUpdates));
-    this->Connect(m_menuItemHelpUpdates->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnHelpCheckUpdatesUI));
-    this->Connect(m_menuItemAbout->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnHelpAbout));
-    //m_togRxID->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnRxID), NULL, this);
-    //m_togTxID->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnTxID), NULL, this);
-    m_sliderSQ->Connect(wxEVT_SCROLL_TOP, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Connect(wxEVT_SCROLL_BOTTOM, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Connect(wxEVT_SCROLL_LINEUP, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Connect(wxEVT_SCROLL_LINEDOWN, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Connect(wxEVT_SCROLL_PAGEUP, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Connect(wxEVT_SCROLL_PAGEDOWN, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Connect(wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Connect(wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Connect(wxEVT_SCROLL_BOTTOM, wxScrollEventHandler(TopFrame::OnSliderScrollBottom), NULL, this);
-    m_sliderSQ->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(TopFrame::OnCmdSliderScrollChanged), NULL, this);
-    m_sliderSQ->Connect(wxEVT_SCROLL_TOP, wxScrollEventHandler(TopFrame::OnSliderScrollTop), NULL, this);
-    m_ckboxSQ->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(TopFrame::OnCheckSQClick), NULL, this);
-
-    m_ckboxSNR->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(TopFrame::OnCheckSNRClick), NULL, this);
-
-    m_togBtnOnOff->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnOnOff), NULL, this);
-    m_togBtnSplit->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnSplitClick), NULL, this);
-    m_togBtnAnalog->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnAnalogClick), NULL, this);
-#ifdef ALC
-    m_togBtnALC->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnALCClick), NULL, this);
-#endif
-    m_btnTogPTT->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnPTT), NULL, this);
-
-    m_BtnCallSignReset->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnCallSignReset), NULL, this);
-    m_BtnBerReset->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnBerReset), NULL, this);
-}
-
-TopFrame::~TopFrame()
-{
-    //-------------------
-    // Disconnect Events
-    //-------------------
-    this->Disconnect(wxEVT_CLOSE_WINDOW, wxCloseEventHandler(TopFrame::topFrame_OnClose));
-    this->Disconnect(wxEVT_PAINT, wxPaintEventHandler(TopFrame::topFrame_OnPaint));
-    this->Disconnect(wxEVT_SIZE, wxSizeEventHandler(TopFrame::topFrame_OnSize));
-    this->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::topFrame_OnUpdateUI));
-    this->Disconnect(ID_EXIT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnExit));
-    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsAudio));
-    this->Disconnect(wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsAudioUI));
-    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsFilter));
-    this->Disconnect(wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsFilterUI));
-    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsComCfg));
-    this->Disconnect(wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsComCfgUI));
-    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsOptions));
-    this->Disconnect(wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsOptionsUI));
-
-    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnPlayFileToMicIn));
-    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnRecFileFromRadio));
-    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnPlayFileFromRadio));
-
-    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnHelpCheckUpdates));
-    this->Disconnect(wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnHelpCheckUpdatesUI));
-    this->Disconnect(ID_ABOUT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnHelpAbout));
-    //m_togRxID->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnRxID), NULL, this);
-    //m_togTxID->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnTxID), NULL, this);
-    m_sliderSQ->Disconnect(wxEVT_SCROLL_TOP, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Disconnect(wxEVT_SCROLL_BOTTOM, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Disconnect(wxEVT_SCROLL_LINEUP, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Disconnect(wxEVT_SCROLL_LINEDOWN, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Disconnect(wxEVT_SCROLL_PAGEUP, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Disconnect(wxEVT_SCROLL_PAGEDOWN, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Disconnect(wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Disconnect(wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Disconnect(wxEVT_SCROLL_BOTTOM, wxScrollEventHandler(TopFrame::OnSliderScrollBottom), NULL, this);
-    m_sliderSQ->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(TopFrame::OnCmdSliderScrollChanged), NULL, this);
-    m_sliderSQ->Disconnect(wxEVT_SCROLL_TOP, wxScrollEventHandler(TopFrame::OnSliderScrollTop), NULL, this);
-    m_ckboxSQ->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(TopFrame::OnCheckSQClick), NULL, this);
-
-    m_togBtnOnOff->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnOnOff), NULL, this);
-    m_togBtnSplit->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnSplitClick), NULL, this);
-    m_togBtnAnalog->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnAnalogClick), NULL, this);
-#ifdef ALC
-    m_togBtnALC->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnALCClick), NULL, this);
-#endif
-    m_btnTogPTT->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnPTT), NULL, this);
-
-}
-
diff --git a/fdmdv2/branches/0.97/src/topFrame.h b/fdmdv2/branches/0.97/src/topFrame.h
deleted file mode 100644 (file)
index 86ddb38..0000000
+++ /dev/null
@@ -1,182 +0,0 @@
-//==========================================================================
-// Name:            topFrame.h
-//
-// Purpose:         Implements simple wxWidgets application with GUI.
-// Created:         Apr. 9, 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 Lesser 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 Lesser General Public License
-//  along with this program; if not, see <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#ifndef __TOPFRAME_H__
-#define __TOPFRAME_H__
-
-#include "version.h"
-#include <wx/artprov.h>
-#include <wx/xrc/xmlres.h>
-#include <wx/intl.h>
-#include <wx/string.h>
-#include <wx/bitmap.h>
-#include <wx/image.h>
-#include <wx/icon.h>
-#include <wx/menu.h>
-#include <wx/gdicmn.h>
-#include <wx/font.h>
-#include <wx/colour.h>
-#include <wx/settings.h>
-#include <wx/gauge.h>
-#include <wx/textctrl.h>
-#include <wx/sizer.h>
-#include <wx/statbox.h>
-#include <wx/aui/auibook.h>
-#include <wx/tglbtn.h>
-#include <wx/slider.h>
-#include <wx/checkbox.h>
-#include <wx/statusbr.h>
-#include <wx/frame.h>
-#include <wx/statbmp.h>
-#include <wx/stattext.h>
-#include <wx/button.h>
-#include <wx/dialog.h>
-#include <wx/radiobut.h>
-#include <wx/combobox.h>
-#include <wx/panel.h>
-#include <wx/listbox.h>
-#include <wx/notebook.h>
-#include <wx/listctrl.h>
-
-
-///////////////////////////////////////////////////////////////////////////
-
-#define ID_OPEN 1000
-#define ID_SAVE 1001
-#define ID_CLOSE 1002
-#define ID_EXIT 1003
-#define ID_COPY 1004
-#define ID_CUT 1005
-#define ID_PASTE 1006
-#define ID_OPTIONS 1007
-#define ID_ABOUT 1008
-
-///////////////////////////////////////////////////////////////////////////////
-/// Class TopFrame
-///////////////////////////////////////////////////////////////////////////////
-class TopFrame : public wxFrame
-{
-    private:
-
-    protected:
-        wxMenuBar* m_menubarMain;
-        wxMenu* file;
-        wxMenu* edit;
-        wxMenu* tools;
-        wxMenu* help;
-        wxGauge* m_gaugeSNR;
-        wxStaticText* m_textSNR;
-        wxCheckBox* m_ckboxSNR;
-        wxGauge* m_gaugeLevel;
-        wxStaticText* m_textLevel;
-
-        wxButton*     m_BtnCallSignReset;
-        wxTextCtrl*   m_txtCtrlCallSign;
-        wxStaticText* m_txtChecksumGood;
-        wxStaticText* m_txtChecksumBad;
-
-        wxSlider* m_sliderSQ;
-        wxCheckBox* m_ckboxSQ;
-        wxStaticText* m_textSQ;
-        wxStatusBar* m_statusBar1;
-
-        wxButton*     m_BtnBerReset;
-        wxStaticText  *m_textBits;
-        wxStaticText  *m_textErrors;
-        wxStaticText  *m_textBER;
-
-        wxRadioButton *m_rbSync;
-        wxRadioButton *m_rb1400old;
-        wxRadioButton *m_rb1400;
-        wxRadioButton *m_rb1600;
-        wxRadioButton *m_rb2000;
-        wxRadioButton *m_rb1600Wide;
-
-        // Virtual event handlers, overide them in your derived class
-        virtual void topFrame_OnClose( wxCloseEvent& event ) { event.Skip(); }
-        virtual void topFrame_OnPaint( wxPaintEvent& event ) { event.Skip(); }
-        virtual void topFrame_OnSize( wxSizeEvent& event ) { event.Skip(); }
-        virtual void topFrame_OnUpdateUI( wxUpdateUIEvent& event ) { event.Skip(); }
-
-        virtual void OnExit( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnTop( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnToolsAudio( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnToolsAudioUI( wxUpdateUIEvent& event ) { event.Skip(); }
-        virtual void OnToolsFilter( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnToolsFilterUI( wxUpdateUIEvent& event ) { event.Skip(); }
-        virtual void OnToolsOptions( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnToolsUDP( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnToolsOptionsUI( wxUpdateUIEvent& event ) { event.Skip(); }
-        virtual void OnToolsComCfg( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnToolsComCfgUI( wxUpdateUIEvent& event ) { event.Skip(); }
-        virtual void OnPlayFileToMicIn( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnRecFileFromRadio( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnPlayFileFromRadio( wxCommandEvent& event ) { event.Skip(); }
-
-        virtual void OnHelpCheckUpdates( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnHelpCheckUpdatesUI( wxUpdateUIEvent& event ) { event.Skip(); }
-        virtual void OnHelpAbout( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnTogBtnRxID( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnTogBtnTxID( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnCmdSliderScroll( wxScrollEvent& event ) { event.Skip(); }
-        virtual void OnSliderScrollBottom( wxScrollEvent& event ) { event.Skip(); }
-        virtual void OnCmdSliderScrollChanged( wxScrollEvent& event ) { event.Skip(); }
-        virtual void OnSliderScrollTop( wxScrollEvent& event ) { event.Skip(); }
-        virtual void OnCheckSQClick( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnCheckSNRClick( wxCommandEvent& event ) { event.Skip(); }
-
-        virtual void OnTogBtnLoopRx( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnTogBtnLoopTx( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnTogBtnOnOff( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnTogBtnSplitClick( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnTogBtnAnalogClick( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnTogBtnALCClick( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnTogBtnPTT( wxCommandEvent& event ) { event.Skip(); }
-
-        virtual void OnTogBtnSplitClickUI(wxUpdateUIEvent& event) { event.Skip(); }
-        virtual void OnTogBtnAnalogClickUI(wxUpdateUIEvent& event) { event.Skip(); }
-        virtual void OnTogBtnALCClickUI(wxUpdateUIEvent& event) { event.Skip(); }
-        virtual void OnTogBtnRxIDUI(wxUpdateUIEvent& event ) { event.Skip(); }
-        virtual void OnTogBtnTxIDUI(wxUpdateUIEvent& event ) { event.Skip(); }
-        virtual void OnTogBtnPTT_UI(wxUpdateUIEvent& event ) { event.Skip(); }
-        virtual void OnTogBtnOnOffUI(wxUpdateUIEvent& event ) { event.Skip(); }
-
-        virtual void OnCallSignReset( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnBerReset( wxCommandEvent& event ) { event.Skip(); }
-
-    public:
-        wxToggleButton* m_togRxID;
-        wxToggleButton* m_togTxID;
-        wxToggleButton* m_togBtnOnOff;
-        wxToggleButton* m_togBtnSplit;
-        wxToggleButton* m_togBtnAnalog;
-        wxToggleButton* m_togBtnALC;
-        wxToggleButton* m_btnTogPTT;
-        wxToggleButton* m_togBtnLoopRx;
-        wxToggleButton* m_togBtnLoopTx;
-        wxAuiNotebook* m_auiNbookCtrl;
-
-        TopFrame( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("FreeDV ") + _(FREEDV_VERSION), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(561,300 ), long style = wxDEFAULT_FRAME_STYLE|wxRESIZE_BORDER|wxTAB_TRAVERSAL );
-
-        ~TopFrame();
-};
-
-#endif //__TOPFRAME_H__
diff --git a/fdmdv2/branches/0.97/src/varicode.c b/fdmdv2/branches/0.97/src/varicode.c
deleted file mode 100644 (file)
index 26de09a..0000000
+++ /dev/null
@@ -1,479 +0,0 @@
-//==========================================================================
-// Name:            varicode.h
-// Purpose:         Varicode encoded and decode functions
-// Created:         Nov 24, 2012
-// Authors:         David Rowe
-//
-// To test:
-//          $ gcc varicode.c -o varicode -DVARICODE_UNITTEST -Wall
-//          $ ./varicode
-// 
-// 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-
-#include <assert.h>
-#include <ctype.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "varicode.h"
-#include "varicode_table.h"
-
-
-/*
-  output is an unpacked array of bits of maximum size max_out.  Note
-  unpacked arrays are a more suitable form for modulator input.
-
-  Code 1 covers the entire ASCII char set.
-*/
-
-int varicode_encode1(short varicode_out[], char ascii_in[], int max_out, int n_in) {
-    int            n_out, index, n_zeros, v_len;
-    unsigned short byte1, byte2, packed;
-
-    n_out = 0;
-
-    while(n_in && (n_out < max_out)) {
-
-        assert((unsigned int)(*ascii_in) < 128);
-
-        index = 2*(unsigned int)(*ascii_in);
-        byte1 = varicode_table1[index];
-        byte2 = varicode_table1[index+1];
-        packed = (byte1 << 8) + byte2;
-
-        //printf("n_in: %d ascii_in: %c index: %d packed 0x%x\n", n_in, *ascii_in, index, packed);
-        ascii_in++;
-
-        n_zeros = 0;
-        v_len = 0;
-        while ((n_zeros < 2) && (n_out < max_out) && (v_len <= VARICODE_MAX_BITS)) {
-            if (packed & 0x8000) {
-                *varicode_out = 1;
-                n_zeros = 0;
-            }
-            else {
-                *varicode_out = 0;
-                n_zeros++;
-            }
-            //printf("packed: 0x%x *varicode_out: %d n_zeros: %d v_len: %d\n", packed, *varicode_out, n_zeros,v_len );
-            packed <<= 1;
-            varicode_out++;
-            n_out++;
-            v_len++;                
-        }
-        assert(v_len <= VARICODE_MAX_BITS);
-
-        n_in--;            
-    }
-
-    return n_out;
-}
-
-
-/*
-  Code 2 covers a subset, but is more efficient that Code 1 (282
-  compared to 1315 bits on unittest) Unsupported characters are
-  replaced by spaces.  We encode/decode two bits at a time.  
-*/
-
-int varicode_encode2(short varicode_out[], char ascii_in[], int max_out, int n_in) {
-    int            n_out, n_zeros, v_len, i;
-    unsigned short packed;
-
-    n_out = 0;
-
-    while(n_in && (n_out < max_out)) {
-
-        packed = varicode_table2[0]; // default to space if char not found
-          
-        // see if our character exists
-        for(i=0; i<sizeof(varicode_table2); i+=2) {
-            if (varicode_table2[i] == *ascii_in)
-                packed = (unsigned short)varicode_table2[i+1] << 8;
-        }
-
-        //printf("n_in: %d ascii_in: %c index: %d packed 0x%x\n", n_in, *ascii_in, index, packed);
-        ascii_in++;
-
-        n_zeros = 0;
-        v_len = 0;
-        while ((n_zeros < 2) && (n_out < max_out) && (v_len <= VARICODE_MAX_BITS)) {
-            if (packed & 0x8000)
-                varicode_out[0] = 1;
-            else
-                varicode_out[0] = 0;
-                    
-            if (packed & 0x4000)
-                varicode_out[1] = 1;
-            else
-                varicode_out[1] = 0;
-                
-            if (packed & 0xc000)
-                n_zeros = 0;
-            else
-                n_zeros += 2;
-
-            //printf("packed: 0x%x *varicode_out: %d n_zeros: %d v_len: %d\n", packed, *varicode_out, n_zeros,v_len );
-            packed <<= 2;
-            varicode_out +=2;
-            n_out += 2;
-            v_len += 2;
-        }
-        assert(v_len <= VARICODE_MAX_BITS);
-
-        n_in--;            
-    }
-
-    assert((n_out % 2) == 0);  /* outputs two bits at a time */
-
-    return n_out;
-}
-
-
-int varicode_encode(short varicode_out[], char ascii_in[], int max_out, int n_in, int code_num) {
-    
-    assert((code_num ==1) || (code_num ==2));
-
-    if (code_num == 1)
-        return varicode_encode1(varicode_out, ascii_in, max_out, n_in);
-    else
-       return  varicode_encode2(varicode_out, ascii_in, max_out, n_in);
-}
-
-
-void varicode_decode_init(struct VARICODE_DEC *dec_states, int code_num)
-{
-    assert((code_num ==1) || (code_num == 2));
-
-    dec_states->state = 0;
-    dec_states->n_zeros = 0;
-    dec_states->v_len = 0;
-    dec_states->packed = 0;
-    dec_states->code_num = code_num;
-    dec_states->n_in = 0;
-    dec_states->in[0] = dec_states->in[1] = 0;
-}
-
-
-/* Code 1 decode function, accepts one bit at a time */
-
-static int decode_one_bit(struct VARICODE_DEC *s, char *single_ascii, short varicode_in, int long_code)
-{
-    int            found=0, i;
-    unsigned short byte1, byte2;
-
-    //printf("decode_one_bit : state: %d varicode_in: %d packed: 0x%x n_zeros: %d\n",
-    //       s->state, varicode_in, s->packed, s->n_zeros);
-
-    if (s->state == 0) {
-        if (!varicode_in)
-            return 0;
-        else 
-            s->state = 1;
-    }
-
-    if (s->state == 1) {
-        if (varicode_in) {
-            s->packed |= (0x8000 >> s->v_len);
-            s->n_zeros = 0;
-        }
-        else {
-            s->n_zeros++;
-        }
-        s->v_len++;
-        found = 0;
-
-        /* end of character code */
-
-        if (s->n_zeros == 2) {
-            if (s->v_len) {
-                /* run thru table but note with bit errors we might not actually find a match */
-
-                byte1 = s->packed >> 8;
-                //printf("looking for byte1 : 0x%x ... ", byte1);
-                byte2 = s->packed & 0xff;
-
-                for(i=0; i<128; i++) {
-                    if ((byte1 == varicode_table1[2*i]) && (byte2 == varicode_table1[2*i+1])) {
-                        found = 1;
-                        *single_ascii = i;
-                    }
-                }
-            }
-            varicode_decode_init(s, s->code_num);
-        }
-
-        /* code can run too long if we have a bit error */
-
-        if (s->v_len > VARICODE_MAX_BITS)
-            varicode_decode_init(s, s->code_num);
-    }
-
-    return found;
-}
-
-
-/* Code 2 decode function, accepts two bits at a time */
-
-static int decode_two_bits(struct VARICODE_DEC *s, char *single_ascii, short varicode_in1, short varicode_in2)
-{
-    int            found=0, i;
-    unsigned short byte1;
-
-    if (s->state == 0) {
-        if (!(varicode_in1 || varicode_in2))
-            return 0;
-        else 
-            s->state = 1;
-    }
-
-    if (s->state == 1) {
-        if (varicode_in1)
-            s->packed |= (0x8000 >> s->v_len);
-        if (varicode_in2)
-            s->packed |= (0x4000 >> s->v_len);
-        if (varicode_in1 || varicode_in2)
-            s->n_zeros = 0;
-        else
-            s->n_zeros+=2;
-
-        s->v_len+=2;            
-        found = 0;
-
-        /* end of character code */
-
-        if (s->n_zeros == 2) {
-            if (s->v_len) {
-                /* run thru table but note with bit errors we might not actually find a match */
-
-                byte1 = s->packed >> 8;
-                //printf("looking for byte1 : 0x%x ... ", byte1);
-                for(i=0; i<sizeof(varicode_table2); i+=2) {
-                    //printf("byte1: 0x%x 0x%x\n", byte1, (unsigned char)varicode_table2[i+1]);
-                    if (byte1 == (unsigned char)varicode_table2[i+1]) {
-                        found = 1;
-                        *single_ascii = varicode_table2[i];
-                        //printf("found: %d i=%d char=%c ", found, i, *single_ascii);
-                    }
-                }
-            }
-            varicode_decode_init(s, s->code_num);
-        }
-
-        /* code can run too long if we have a bit error */
-
-        if (s->v_len > VARICODE_MAX_BITS)
-            varicode_decode_init(s, s->code_num);
-    }
-
-    return found;
-}
-
-
-int varicode_decode1(struct VARICODE_DEC *dec_states, char ascii_out[], short varicode_in[], int max_out, int n_in) {
-    int            output, n_out;
-    char           single_ascii = 0;
-
-    n_out = 0;
-
-    //printf("varicode_decode: n_in: %d\n", n_in);
-
-    while(n_in && (n_out < max_out)) {
-        output = decode_one_bit(dec_states, &single_ascii, varicode_in[0], 0);
-        varicode_in++;
-        n_in--;
-
-        if (output) {
-            *ascii_out++ = single_ascii;
-            n_out++;
-        }            
-    }
-
-    return n_out;
-}
-
-
-int varicode_decode2(struct VARICODE_DEC *dec_states, char ascii_out[], short varicode_in[], int max_out, int n_in) {
-    int            output, n_out;
-    char           single_ascii = 0;
-
-    n_out = 0;
-
-    //printf("varicode_decode2: n_in: %d varicode_in[0] %d dec_states->n_in: %d\n", n_in, varicode_in[0], dec_states->n_in);
-    //printf("%d ", varicode_in[0]);
-    while(n_in && (n_out < max_out)) {
-
-        // keep two bit buffer so we can process two at a time
-
-        dec_states->in[0] = dec_states->in[1];
-        dec_states->in[1] = varicode_in[0];
-        dec_states->n_in++;
-        varicode_in++;
-        n_in--;
-
-        if (dec_states->n_in == 2) {
-            output = decode_two_bits(dec_states, &single_ascii, dec_states->in[0], dec_states->in[1]);
-
-            dec_states->n_in = 0;
-            if (output) {
-                //printf("  output: %d single_ascii: 0x%x %c\n", output, (int)single_ascii, single_ascii);
-                *ascii_out++ = single_ascii;
-                n_out++;
-            }            
-        }
-    }
-
-    return n_out;
-}
-
-
-int varicode_decode(struct VARICODE_DEC *dec_states, char ascii_out[], short varicode_in[], int max_out, int n_in) {
-    if (dec_states->code_num == 1)
-        return varicode_decode1(dec_states, ascii_out, varicode_in, max_out, n_in);
-    else
-        return varicode_decode2(dec_states, ascii_out, varicode_in, max_out, n_in);
-}
-
-
-#ifdef VARICODE_UNITTEST
-void test_varicode(int code_num) {
-    char *ascii_in;
-    short *varicode;
-    int  i, n_varicode_bits_out, n_ascii_chars_out, length, half, n_out, j, len;
-    char *ascii_out;
-    struct VARICODE_DEC dec_states;
-
-    if (code_num == 1) {
-        printf("long code:\n");
-        length = sizeof(varicode_table1)/2;
-    }
-    else {
-        printf("short code:\n");
-        length = sizeof(varicode_table2)/2;
-    }
-    //length = 10;
-    ascii_in = (char*)malloc(length);
-    varicode = (short*)malloc(VARICODE_MAX_BITS*sizeof(short)*length);
-    ascii_out = (char*)malloc(length);
-
-    // 1. test all Varicode codes -------------------------------------------------------------
-
-    if (code_num == 1) {
-        for(i=0; i<length; i++)
-            ascii_in[i] = (char)i;
-    }
-    else {
-        for(i=0; i<length; i++)
-            ascii_in[i] = varicode_table2[2*i];
-    }
-    //printf("  ascii_in: %s\n", ascii_in);
-    n_varicode_bits_out = varicode_encode(varicode, ascii_in, VARICODE_MAX_BITS*length, length, code_num);
-
-    printf("  n_varicode_bits_out: %d\n", n_varicode_bits_out);
-    //for(i=0; i<n_varicode_bits_out; i++) {
-    //    printf("%d \n", varicode[i]);
-    //}
-
-    // split decode in half to test how it preserves state between calls 
-
-    varicode_decode_init(&dec_states, code_num);
-    half = n_varicode_bits_out/2;
-    n_ascii_chars_out  = varicode_decode(&dec_states, ascii_out, varicode, length, half);
-    // printf("  n_ascii_chars_out: %d\n", n_ascii_chars_out);
-
-    n_ascii_chars_out += varicode_decode(&dec_states, &ascii_out[n_ascii_chars_out], 
-                                         &varicode[half], length-n_ascii_chars_out, n_varicode_bits_out - half);
-    assert(n_ascii_chars_out == length);
-
-    printf("  n_ascii_chars_out: %d\n", n_ascii_chars_out);
-    printf("  average bits/character: %3.2f\n", (float)n_varicode_bits_out/n_ascii_chars_out);
-
-    //printf("ascii_out: %s\n", ascii_out);
-
-    if (memcmp(ascii_in, ascii_out, length) == 0)
-        printf("  Test 1 Pass\n");
-    else
-        printf("  Test 1 Fail\n");
-
-    // 2. Test some ascii with a run of zeros -----------------------------------------------------
-
-    sprintf(ascii_in, "CQ CQ CQ this is VK5DGR");
-        
-    assert(strlen(ascii_in) < length);
-    if (code_num == 2)
-        for(i=0; i<strlen(ascii_in); i++)
-            ascii_in[i] = tolower(ascii_in[i]);
-
-    for(i=0; i<3; i++) {
-        n_varicode_bits_out = varicode_encode(varicode, ascii_in, VARICODE_MAX_BITS*length, strlen(ascii_in), code_num);
-        n_ascii_chars_out   = varicode_decode(&dec_states, ascii_out, varicode, length, n_varicode_bits_out);
-        ascii_out[n_ascii_chars_out] = 0;
-
-        printf("  ascii_out: %s\n", ascii_out);
-        if (strcmp(ascii_in, ascii_out) == 0)
-            printf("  Test 2 Pass\n");
-        else
-            printf("  Test 2 Fail\n");
-
-        memset(varicode, 0, sizeof(short)*20);
-        n_ascii_chars_out = varicode_decode(&dec_states, ascii_out, varicode, length, 20);
-        assert(n_ascii_chars_out == 0);
-    }
-
-    // 3. Test receiving one bit at a time -----------------------------------------------------
-
-    sprintf(ascii_in, "s=vk5dgr qth=adelaide");
-    len = strlen(ascii_in);
-    ascii_in[len] = 13;
-    ascii_in[len+1] = 0;
-
-    assert(strlen(ascii_in) < length);
-    if (code_num == 2)
-        for(i=0; i<strlen(ascii_in); i++)
-            ascii_in[i] = tolower(ascii_in[i]);
-
-    for(i=0; i<3; i++) {
-        n_varicode_bits_out = varicode_encode(varicode, ascii_in, VARICODE_MAX_BITS*length, strlen(ascii_in), code_num);
-        printf("n_varicode_bits_out: %d\n", n_varicode_bits_out);
-
-        n_ascii_chars_out = 0;
-        for(j=0; j<n_varicode_bits_out; j++) {
-            n_out = varicode_decode(&dec_states, &ascii_out[n_ascii_chars_out], &varicode[j], 1, 1);
-            if (n_out) 
-                n_ascii_chars_out++;
-        }
-        ascii_out[n_ascii_chars_out] = 0;
-
-        printf("  ascii_out: %s\n", ascii_out);
-        if (strcmp(ascii_in, ascii_out) == 0)
-            printf("  Test 3 Pass\n");
-        else
-            printf("  Test 3 Fail\n");
-    }
-
-    free(ascii_in);
-    free(ascii_out);
-    free(varicode);
-}
-
-int main(void) {
-    test_varicode(1);
-    test_varicode(2);
-    return 0;
-}
-#endif
diff --git a/fdmdv2/branches/0.97/src/varicode.h b/fdmdv2/branches/0.97/src/varicode.h
deleted file mode 100644 (file)
index 4834a95..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-//==========================================================================
-// Name:            varicode.h
-// Purpose:         Varicode encoded and decode functions
-// Created:         Nov 24, 2012
-// Authors:         David Rowe
-// 
-// 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-
-#ifndef __VARICODE__
-#define __VARICODE__
-
-#ifdef __cplusplus
-extern "C" {
-
-#endif
-
-#define VARICODE_MAX_BITS (10+2) /* max varicode bits for each ascii character */
-                                 /* 10 bits for code plus 2 0 bits for inter-character space */
-
-struct VARICODE_DEC {
-    int            state;
-    int            n_zeros;
-    int            v_len;
-    unsigned short packed;
-    int            code_num;
-    int            n_in;
-    int            in[2];
-};
-    
-int varicode_encode(short varicode_out[], char ascii_in[], int max_out, int n_in, int code_num);
-void varicode_decode_init(struct VARICODE_DEC *dec_states, int code_num);
-int varicode_decode(struct VARICODE_DEC *dec_states, char ascii_out[], short varicode_in[], int max_out, int n_in);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/fdmdv2/branches/0.97/src/varicode_table.h b/fdmdv2/branches/0.97/src/varicode_table.h
deleted file mode 100644 (file)
index 08f38fd..0000000
+++ /dev/null
@@ -1,338 +0,0 @@
-//==========================================================================
-// Name:            varicode_table.h
-// Purpose:         Varicode look up table
-// Created:         Nov 24, 2012
-// Authors:         Clint Turner, KA7OEI,  Peter Martinez, G3PLX
-// 
-// 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-
-/* The following table defines the PKS31 varicode.  There are 128 entries,
-corresponding to ASCII characters 0-127 with two bytes for each entry.  The bits
-for the varicode are to be shifted out MSB-first for both bytes, with the first byte
-in the table being the first one to be sent.
-
-More than one zero in sequence signifies the end of the character (i.e.
-two zeroes are the intercharacter sequence, so at least two zeroes should always be
-sent before the next character is sent.
-
-This file is constructed with information from the article "PSK31 Fundamentals"
-by Peter Martinez, G3PLX by Clint Turner, KA7OEI
-*/
-unsigned char const varicode_table1[256] =     {
-    0b10101010,
-    0b11000000, // 0 NUL
-    0b10110110,
-    0b11000000, // 1 SOH
-    0b10111011,
-    0b01000000, // 2 STX
-    0b11011101,
-    0b11000000, // 3 ETX
-    0b10111010,
-    0b11000000, // 4 EOT
-    0b11010111,
-    0b11000000, // 5 ENQ
-    0b10111011,
-    0b11000000, // 6 ACK
-    0b10111111,
-    0b01000000, // 7 BEL
-    0b10111111,
-    0b11000000, // 8 BS
-    0b11101111,
-    0b00000000, // 9 HT
-    0b11101000,
-    0b00000000, // 10 LF
-    0b11011011,
-    0b11000000, // 11 VT
-    0b10110111,
-    0b01000000, // 12 FF
-    0b11111000,
-    0b00000000, // 13 CR
-    0b11011101,
-    0b01000000, // 14 SO
-    0b11101010,
-    0b11000000, // 15 SI
-    0b10111101,
-    0b11000000, // 16 DLE
-    0b10111101,
-    0b01000000, // 17 DC1
-    0b11101011,
-    0b01000000, // 18 DC2
-    0b11101011,
-    0b11000000, // 19 DC3
-    0b11010110,
-    0b11000000, // 20 DC4
-    0b11011010,
-    0b11000000, // 21 NAK
-    0b11011011,
-    0b01000000, // 22 SYN
-    0b11010101,
-    0b11000000, // 23 ETB
-    0b11011110,
-    0b11000000, // 24 CAN
-    0b11011111,
-    0b01000000, // 25 EM
-    0b11101101,
-    0b11000000, // 26 SUB
-    0b11010101,
-    0b01000000, // 27 ESC
-    0b11010111,
-    0b01000000, // 28 FS
-    0b11101110,
-    0b11000000, // 29 GS
-    0b10111110,
-    0b11000000, // 30 RS
-    0b11011111,
-    0b11000000, // 31 US
-    0b10000000,
-    0b00000000, // 32 SP
-    0b11111111,
-    0b10000000, // 33 !
-    0b10101111,
-    0b10000000, // 34 "
-    0b11111010,
-    0b10000000, // 35 #
-    0b11101101,
-    0b10000000, // 36 $
-    0b10110101,
-    0b01000000, // 37 %
-    0b10101110,
-    0b11000000, // 38 &
-    0b10111111,
-    0b10000000, // 39 '
-    0b11111011,
-    0b00000000, // 40 (
-    0b11110111,
-    0b00000000, // 41 )
-    0b10110111,
-    0b10000000, // 42 *
-    0b11101111,
-    0b10000000, // 43 +
-    0b11101010,
-    0b00000000, // 44 ,
-    0b11010100,
-    0b00000000, // 45 -
-    0b10101110,
-    0b00000000, // 46 .
-    0b11010111,
-    0b10000000, // 47 /
-    0b10110111,
-    0b00000000, // 48 0
-    0b10111101,
-    0b00000000, // 49 1
-    0b11101101,
-    0b00000000, // 50 2
-    0b11111111,
-    0b00000000, // 51 3
-    0b10111011,
-    0b10000000, // 52 4
-    0b10101101,
-    0b10000000, // 53 5
-    0b10110101,
-    0b10000000, // 54 6
-    0b11010110,
-    0b10000000, // 55 7
-    0b11010101,
-    0b10000000, // 56 8
-    0b11011011,
-    0b10000000, // 57 9
-    0b11110101,
-    0b00000000, // 58 :
-    0b11011110,
-    0b10000000, // 59 ;
-    0b11110110,
-    0b10000000, // 60 <
-    0b10101010,
-    0b00000000, // 61 =
-    0b11101011,
-    0b10000000, // 62 >
-    0b10101011,
-    0b11000000, // 63 ?
-    0b10101111,
-    0b01000000, // 64 @
-    0b11111010,
-    0b00000000, // 65 A
-    0b11101011,
-    0b00000000, // 66 B
-    0b10101101,
-    0b00000000, // 67 C
-    0b10110101,
-    0b00000000, // 68 D
-    0b11101110,
-    0b00000000, // 69 E
-    0b11011011,
-    0b00000000, // 70 F
-    0b11111101,
-    0b00000000, // 71 G
-    0b10101010,
-    0b10000000, // 72 H
-    0b11111110,
-    0b00000000, // 73 I
-    0b11111110,
-    0b10000000, // 74 J
-    0b10111110,
-    0b10000000, // 75 K
-    0b11010111,
-    0b00000000, // 76 L
-    0b10111011,
-    0b00000000, // 77 M
-    0b11011101,
-    0b00000000, // 78 N
-    0b10101011,
-    0b00000000, // 79 O
-    0b11010101,
-    0b00000000, // 80 P
-    0b11101110,
-    0b10000000, // 81 Q
-    0b10101111,
-    0b00000000, // 82 R
-    0b11011110,
-    0b00000000, // 83 S
-    0b11011010,
-    0b00000000, // 84 T
-    0b10101011,
-    0b10000000, // 85 U
-    0b11011010,
-    0b10000000, // 86 V
-    0b10101110,
-    0b10000000, // 87 W
-    0b10111010,
-    0b10000000, // 88 X
-    0b10111101,
-    0b10000000, // 89 Y
-    0b10101011,
-    0b01000000, // 90 Z
-    0b11111011,
-    0b10000000, // 91 [
-    0b11110111,
-    0b10000000, // 92 "\"
-    0b11111101,
-    0b10000000, // 93 ]
-    0b10101111,
-    0b11000000, // 94 ^
-    0b10110110,
-    0b10000000, // 95 _ (underline)
-    0b10110111,
-    0b11000000, // 96 `
-    0b10110000,
-    0b00000000, // 97 a
-    0b10111110,
-    0b00000000, // 98 b
-    0b10111100,
-    0b00000000, // 99 c
-    0b10110100,
-    0b00000000, // 100 d
-    0b11000000,
-    0b00000000, // 101 e
-    0b11110100,
-    0b00000000, // 102 f
-    0b10110110,
-    0b00000000, // 103 g
-    0b10101100,
-    0b00000000, // 104 h
-    0b11010000,
-    0b00000000, // 105 i
-    0b11110101,
-    0b10000000, // 106 j
-    0b10111111,
-    0b00000000, // 107 k
-    0b11011000,
-    0b00000000, // 108 l
-    0b11101100,
-    0b00000000, // 109 m
-    0b11110000,
-    0b00000000, // 110 n
-    0b11100000,
-    0b00000000, // 111 o
-    0b11111100,
-    0b00000000, // 112 p
-    0b11011111,
-    0b10000000, // 113 q
-    0b10101000,
-    0b00000000, // 114 r
-    0b10111000,
-    0b00000000, // 115 s
-    0b10100000,
-    0b00000000, // 116 t
-    0b11011100,
-    0b00000000, // 117 u
-    0b11110110,
-    0b00000000, // 118 v
-    0b11010110,
-    0b00000000, // 119 w
-    0b11011111,
-    0b00000000, // 120 x
-    0b10111010,
-    0b00000000, // 121 y
-    0b11101010,
-    0b10000000, // 122 z
-    0b10101101,
-    0b11000000, // 123 {
-    0b11011101,
-    0b10000000, // 124 |
-    0b10101101,
-    0b01000000, // 125 }
-    0b10110101,
-    0b11000000, // 126 ~
-    0b11101101,
-    0b01000000, // 127 (del)
-};
-
-// This code was used on FDMDV version 1, and is more compact that Code 1, but only covers a subset
-// of the ASCII cahacter set
-char const varicode_table2[] = {
-
-    ' ' ,0b11000000,
-    13  ,0b01000000, // CR, end of message
-    '=' ,0b10000000, 
-    '1' ,0b11110000,
-    '2' ,0b01110000,
-    '3' ,0b10110000,
-    '4' ,0b11010000,
-    '5' ,0b01010000,
-    '6' ,0b10010000,
-    '7' ,0b11100000,
-    '8' ,0b01100000,
-    '9' ,0b10100000,
-    'a' ,0b11111100,
-    'b' ,0b01111100,
-    'c' ,0b10111100,
-    'd' ,0b11011100,
-    'e' ,0b01011100,
-    'f' ,0b10011100,
-    'g' ,0b11101100,
-    'h' ,0b01101100,
-    'i' ,0b10101100,
-    'j' ,0b11110100,
-    'k' ,0b01110100,
-    'l' ,0b10110100,
-    'm' ,0b11010100,
-    'n' ,0b01010100,
-    'o' ,0b10010100,
-    'p' ,0b11100100,
-    'q' ,0b01100100,
-    'r' ,0b10100100,
-    's' ,0b11111000,
-    't' ,0b01111000,
-    'u' ,0b10111000,
-    'v' ,0b11011000,
-    'w' ,0b01011000,
-    'x' ,0b10011000,
-    'y' ,0b11101000,
-    'z' ,0b01101000,
-    '0' ,0b10101000
-};
-
diff --git a/fdmdv2/branches/0.97/src/version.h b/fdmdv2/branches/0.97/src/version.h
deleted file mode 100644 (file)
index fa80cbe..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef FREEDV_VER_DOT_H
-#define FREEDV_VER_DOT_H 1
-
-#define FREEDV_VERSION_MAJOR 0
-#define FREEDV_VERSION_MINOR 97
-#define FREEDV_VERSION_PATCH 0
-#define FREEDV_VERSION_SUFFIX "Beta"
-
-#define FREEDV_VERSION "0.97.0 Beta"
-
-#endif //FREEDV_VER_DOT_H
diff --git a/fdmdv2/branches/0.97/svn.ico b/fdmdv2/branches/0.97/svn.ico
deleted file mode 100644 (file)
index ba63376..0000000
Binary files a/fdmdv2/branches/0.97/svn.ico and /dev/null differ
diff --git a/fdmdv2/branches/0.99/.clang/.gitignore b/fdmdv2/branches/0.99/.clang/.gitignore
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/fdmdv2/branches/0.99/CMakeLists.txt b/fdmdv2/branches/0.99/CMakeLists.txt
deleted file mode 100644 (file)
index 40e95e3..0000000
+++ /dev/null
@@ -1,487 +0,0 @@
-#
-# FreeDV - HF Digital Voice for Radio Amateurs
-#
-# CMake configuration contributed by Richard Shaw (KF5OIM)
-# Please report questions, comments, problems, or patches to the freetel
-# mailing list: https://lists.sourceforge.net/lists/listinfo/freetel-codec2
-#
-
-cmake_minimum_required(VERSION 2.8)
-
-# Prevent in-source builds to protect automake/autoconf config.
-# If an in-source build is attempted, you will still need to clean up a few
-# files manually.
-set(CMAKE_DISABLE_SOURCE_CHANGES ON)
-set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
-if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
-  message(FATAL_ERROR "In-source builds in ${CMAKE_BINARY_DIR} are not "   
-   "allowed, please remove ./CMakeCache.txt and ./CMakeFiles/, create a "
-   "separate build directory and run cmake from there.")
-endif("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
-
-# Set local module path.
-list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
-
-project(FreeDV)
-
-#
-# Set FreeDV version and generate src/version.h
-#
-set(FREEDV_VERSION_MAJOR 0)
-set(FREEDV_VERSION_MINOR 99)
-set(FREEDV_VERSION_PATCH FALSE)
-set(FREEDV_VERSION ${FREEDV_VERSION_MAJOR}.${FREEDV_VERSION_MINOR})
-if(FREEDV_VERSION_PATCH)
-    set(FREEDV_VERSION ${FREEDV_VERSION}.${FREEDV_VERSION_PATCH})
-endif()
-set(FREEDV_VERSION_SUFFIX "Beta")
-if(FREEDV_VERSION_SUFFIX)
-    set(FREEDV_VERSION_STRING "${FREEDV_VERSION} ${FREEDV_VERSION_SUFFIX}")
-endif()
-message(STATUS "FreeDV version: ${FREEDV_VERSION_STRING}")
-configure_file(cmake/version.h.in src/version.h @ONLY)
-
-# Set default build type
-if(NOT CMAKE_BUILD_TYPE)
-    set(CMAKE_BUILD_TYPE "Release")
-    message(STATUS "Build type not specified, defaulting to ${CMAKE_BUILD_TYPE}")
-endif(NOT CMAKE_BUILD_TYPE)
-
-
-# Work around for not using a svn working copy.
-add_definitions(-D_NO_AUTOTOOLS_)
-find_program(SVNVERSION_PATH svnversion)
-if(SVNVERSION_PATH)
-    execute_process(COMMAND ${SVNVERSION_PATH} .
-        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-        RESULT_VARIABLE SVN_REVISION_RESULT
-        OUTPUT_VARIABLE SVN_CURRENT_REVISION
-        ERROR_QUIET
-    )
-else()
-    set(SVN_REVISION_RESULT 1)
-endif()
-if(SVN_REVISION_RESULT EQUAL 0)
-string(STRIP ${SVN_CURRENT_REVISION} SVN_REVISION)
-add_definitions(-DSVN_REVISION="${SVN_REVISION}")
-else()
-add_definitions(-DSVN_REVISION="Unversioned directory")
-endif()
-
-
-# Set default build flags.
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
-
-#
-# Setup cmake options
-#
-set(CMAKE_VERBOSE_MAKEFILE TRUE CACHE BOOL "Verbose makefile.")
-set(USE_STATIC_DEPS FALSE CACHE BOOL 
-    "Download and build static libraries instead of system libraries.")
-set(USE_STATIC_PORTAUDIO FALSE CACHE BOOL 
-    "Download and build static portaudio instead of the system library.")
-set(USE_STATIC_SNDFILE FALSE CACHE BOOL
-    "Download and build static sndfile instead of the system library.")
-set(USE_STATIC_SAMPLERATE FALSE CACHE BOOL
-    "Download and build static samplerate instead of the system library.")
-set(USE_STATIC_SOX FALSE CACHE BOOL
-    "Download and build static sox instead of the system library.")
-set(USE_STATIC_CODEC2 FALSE CACHE BOOL
-    "Download and build static codec2 instead of the system library.")
-set(USE_STATIC_SPEEXDSP FALSE CACHE BOOL
-    "Download and build static speex instead of the system library.")
-set(BOOTSTRAP_WXWIDGETS FALSE CACHE BOOL
-    "Download and build static wxWidgets instead of the system library.")
-
-if(USE_STATIC_DEPS)
-    set(USE_STATIC_PORTAUDIO TRUE FORCE)
-    set(USE_STATIC_SNDFILE TRUE FORCE)
-    set(USE_STATIC_SAMPLERATE TRUE FORCE)
-    set(USE_STATIC_SOX TRUE FORCE)
-    set(USE_STATIC_CODEC2 TRUE FORCE)
-endif(USE_STATIC_DEPS)
-
-#
-# Pull in external wxWidgets target if performing static build.
-#
-if(BOOTSTRAP_WXWIDGETS)
-    message(STATUS "Adding wxWidgets build target...")
-    include(cmake/BuildWxWidgets.cmake)
-endif(BOOTSTRAP_WXWIDGETS)
-
-#
-# Perform bootstrap build of wxWidgets
-#
-if(BOOTSTRAP_WXWIDGETS AND NOT EXISTS ${WXCONFIG})
-    message(STATUS "Will perform bootstrap build of wxWidgets.
-   After make step completes, re-run cmake and make again to perform FreeDV build.")
-#
-# Continue normal build if not bootstrapping wxWidgets or is already built.
-#
-else(BOOTSTRAP_WXWIDGETS AND NOT EXISTS ${WXCONFIG})
-
-
-#
-# Various hacks and work arounds for building under MinGW.
-#
-if(MINGW)
-    message(STATUS "System is MinGW.")
-    # Setup HOST variable.
-    include(cmake/MinGW.cmake)
-    # This sets up the exe icon for windows under mingw.
-    set(RES_FILES "")
-    set(RES_FILES "${CMAKE_SOURCE_DIR}/contrib/freedv.rc")
-    set(CMAKE_RC_COMPILER_INIT windres)
-    enable_language(RC)
-    set(CMAKE_RC_COMPILE_OBJECT
-        "<CMAKE_RC_COMPILER> <FLAGS> -O coff <DEFINES> -i <SOURCE> -o <OBJECT>")
-    # These are DLOPEN'ed and can't be automatically pulled in by dependency.
-    foreach(RUNTIME
-        hamlib-adat.dll
-        hamlib-alinco.dll
-        hamlib-amsat.dll
-        hamlib-aor.dll
-        hamlib-ars.dll
-        hamlib-celestron.dll
-        hamlib-drake.dll
-        hamlib-dummy.dll
-        hamlib-easycomm.dll
-        hamlib-flexradio.dll
-        hamlib-fodtrack.dll
-        hamlib-gs232a.dll
-        hamlib-heathkit.dll
-        hamlib-icom.dll
-        hamlib-jrc.dll
-        hamlib-kachina.dll
-        hamlib-kenwood.dll
-        hamlib-kit.dll
-        hamlib-lowe.dll
-        hamlib-m2.dll
-        hamlib-pcr.dll
-        hamlib-prm80.dll
-        hamlib-racal.dll
-        hamlib-rft.dll
-        hamlib-rotorez.dll
-        hamlib-rs.dll
-        hamlib-sartek.dll
-        hamlib-skanti.dll
-        hamlib-spid.dll
-        hamlib-tapr.dll
-        hamlib-tentec.dll
-        hamlib-ts7400.dll
-        hamlib-tuner.dll
-        hamlib-uniden.dll
-        hamlib-winradio.dll
-        hamlib-wj.dll
-        hamlib-yaesu.dll)
-        message(STATUS "Checking for ${RUNTIME}")
-        find_library(${RUNTIME}_LIB ${RUNTIME}
-            PATH_SUFFIXES hamlib)
-        message(STATUS "runtime found: ${${RUNTIME}_LIB}")
-        list(APPEND CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS ${${RUNTIME}_LIB})
-    endforeach()
-    include(InstallRequiredSystemLibraries)
-endif(MINGW)
-
-# Math library is automatic on MinGW
-if(UNIX)
-    set(CMAKE_REQUIRED_INCLUDES math.h)
-    set(CMAKE_REQUIRED_LIBRARIES m)
-endif(UNIX)
-
-# Find some standard headers and functions.
-include(CheckIncludeFiles)
-check_include_files("limits.h" HAVE_LIMITS_H)
-check_include_files("stddef.h" HAVE_STDDEF_H)
-check_include_files("stdlib.h" HAVE_STDLIB_H)
-check_include_files("string.h" HAVE_STRING_H)
-
-include(CheckTypeSize)
-check_type_size("int" SIZEOF_INT)
-
-include(CheckFunctionExists)
-check_function_exists(floor HAVE_FLOOR)
-check_function_exists(memset HAVE_MEMSET)
-check_function_exists(pow HAVE_POW)
-check_function_exists(sqrt HAVE_SQRT)
-
-# fdmdv2_main.h requires patching to find config.h as it current looks in the
-# source directory and the generated file goes in the binary directory.
-configure_file ("${PROJECT_SOURCE_DIR}/cmake/config.h.in"
-                "${PROJECT_BINARY_DIR}/config.h" )
-include_directories(${PROJECT_BINARY_DIR})
-add_definitions(-DHAVE_CONFIG_H)
-
-# Pthread Library
-find_package(Threads REQUIRED)
-message(STATUS "Threads library flags: ${CMAKE_THREAD_LIBS_INIT}")
-
-#
-# Find codec2
-#
-if(NOT USE_STATIC_CODEC2)
-    message(STATUS "Looking for codec2...")
-    find_package(codec2 CONFIG QUIET)
-    if(codec2_FOUND)
-        get_target_property(CODEC2_LIBRARY codec2 LOCATION)
-        message(STATUS "  codec2 library: ${CODEC2_LIBRARY}")
-        message(STATUS "  codec2 headers: ${codec2_INCLUDE_DIRS}")
-    else()
-        # Try to find manually
-        find_path(CODEC2_INCLUDE_DIRS codec2.h
-                  PATH_SUFFIXES codec2)
-        find_library(CODEC2_LIBRARY NAMES codec2)
-        if(CODEC2_LIBRARY AND CODEC2_INCLUDE_DIRS)
-            message(STATUS "  codec2 library: ${CODEC2_LIBRARY}")
-            message(STATUS "  codec2 headers: ${CODEC2_INCLUDE_DIRS}")
-            list(APPEND FREEDV_LINK_LIBS ${CODEC2_LIBRARY})
-            include_directories(${CODEC2_INCLUDE_DIRS})
-        else()
-            message(FATAL_ERROR "codec2 library not found.
-Linux: 
-Codec2 may not be in your distribution so build yourself or use the cmake option to build statically into FreeDV.
-Windws:
-It's easiest to use the cmake option: USE_STATIC_CODEC2"
-        )
-        endif()
-    endif()
-else(NOT USE_STATIC_CODEC2)
-    message(STATUS "Will attempt static build of codec2.")
-    include(cmake/BuildCodec2.cmake)
-endif(NOT USE_STATIC_CODEC2)
-
-#
-# Find or build portaudio Library
-#
-if(NOT USE_STATIC_PORTAUDIO)
-    message(STATUS "Looking for portaudio...")
-    find_package(Portaudio REQUIRED)
-    if(PORTAUDIO_FOUND)
-        message(STATUS "  portaudio library: ${PORTAUDIO_LIBRARIES}")
-        message(STATUS "  portaudio headers: ${PORTAUDIO_INCLUDE_DIRS}")
-        list(APPEND FREEDV_LINK_LIBS ${PORTAUDIO_LIBRARIES})
-        include_directories(${PORTAUDIO_INCLUDE_DIRS})
-    else()
-        message(FATAL_ERROR "portaudio library not found.
-On Linux systems try installing:
-    portaudio-devel  (RPM based systems)
-    libportaudio-dev (DEB based systems)
-On Windows it's easiest to use the cmake option: USE_STATIC_PORTAUDIO"
-        )
-    endif()
-    if(NOT ${PORTAUDIO_VERSION} EQUAL 19)
-        message(WARNING "Portaudio versions other than 19 are known to have issues. You have been warned!")
-    endif()
-else(NOT USE_STATIC_PORTAUDIO)
-    message(STATUS "Will attempt static build of portaudio.")
-    include(cmake/BuildPortaudio.cmake)
-endif(NOT USE_STATIC_PORTAUDIO)
-
-#
-# Hamlib library
-#
-message(STATUS "Looking for hamlib...")
-find_path(HAMLIB_INCLUDE_DIR hamlib/rig.h)
-find_library(HAMLIB_LIBRARY hamlib)
-message(STATUS "Hamlib library: ${HAMLIB_LIBRARY}")
-message(STATUS "Hamlib headers: ${HAMLIB_INCLUDE_DIR}")
-if(HAMLIB_LIBRARY AND HAMLIB_INCLUDE_DIR)
-    message(STATUS "Hamlib library found.")
-    include_directories(${HAMLIB_INCLUDE_DIR})
-    list(APPEND FREEDV_LINK_LIBS ${HAMLIB_LIBRARY})
-else(HAMLIB_LIBRARY AND HAMLIB_INCLUDE_DIR)
-    message(FATAL_ERROR "hamlib not found.
-On Linux systems try installing:
-    hamlib-devel  (RPM based systems)
-    libhamlib-dev (DEB based systems)"
-    )
-endif(HAMLIB_LIBRARY AND HAMLIB_INCLUDE_DIR)
-
-
-#
-# Samplerate Library
-#
-if(NOT USE_STATIC_SAMPLERATE)
-    message(STATUS "Looking for samplerate...")
-    find_library(LIBSAMPLERATE samplerate)
-    find_path(LIBSAMPLERATE_INCLUDE_DIR samplerate.h)
-    message(STATUS "  samplerate library: ${LIBSAMPLERATE}")
-    message(STATUS "  samplerate headers: ${LIBSAMPLERATE_INCLUDE_DIR}")
-    if(LIBSAMPLERATE AND LIBSAMPLERATE_INCLUDE_DIR)
-        list(APPEND FREEDV_LINK_LIBS ${LIBSAMPLERATE})
-        include_directories(${LIBSAMPLERATE_INCLUDE_DIR})
-    else(LIBSTAMPLERATE AND LIBSAMPLERATE_INCLUDE_DIR)
-        message(FATAL_ERROR "samplerate library not found.
-On Linux systems try installing:
-    samplerate-devel  (RPM based systems)
-    libsamplerate-dev (DEB based systems)
-On Windows it's easiest to use the cmake option: USE_STATIC_SAMPLERATE"
-        )
-    endif(LIBSAMPLERATE AND LIBSAMPLERATE_INCLUDE_DIR)
-else(NOT USE_STATIC_SAMPLERATE)
-    message(STATUS "Will attempt static build of samplerate.")
-    include(cmake/BuildSamplerate.cmake)
-endif(NOT USE_STATIC_SAMPLERATE)
-
-#
-# Find sox library
-#
-if(NOT USE_STATIC_SOX)
-    message(STATUS "Looking for sox...")
-    find_library(LIBSOX_LIBRARY sox)
-    find_path(LIBSOX_INCLUDE_DIR NAMES sox/sox.h sox.h)
-    message(STATUS "  sox library: ${LIBSOX_LIBRARY}")
-    message(STATUS "  sox headers: ${LIBSOX_INCLUDE_DIR}")
-    if(LIBSOX_LIBRARY AND LIBSOX_INCLUDE_DIR)
-        list(APPEND FREEDV_LINK_LIBS ${LIBSOX_LIBRARY})
-        include_directories(${LIBSOX_INCLUDE_DIR})
-    else(LIBSOX_LIBRARY AND LIBSOX_INCLUDE_DIR)
-        message(FATAL_ERROR "sox library not found.
-On Linux systems try installing:
-    sox-devel (RPM based systems)
-    libsox-dev (DEB based systems)
-On Windows it's easiest to use the cmake option: USE_STATIC_SOX"
-        )
-    endif(LIBSOX_LIBRARY AND LIBSOX_INCLUDE_DIR)
-else(NOT USE_STATIC_SOX)
-    message(STATUS "Will attempt static build of sox.")
-    include(cmake/BuildSox.cmake)
-endif(NOT USE_STATIC_SOX)
-
-#    
-# sndfile Library
-#
-if(NOT USE_STATIC_SNDFILE)
-    message(STATUS "Looking for sndfile...")
-    find_library(LIBSNDFILE sndfile)
-    find_path(LIBSNDFILE_INCLUDE_DIR sndfile.h)
-    message(STATUS "  sndfile library: ${LIBSNDFILE}")
-    message(STATUS "  sndfile headers: ${LIBSNDFILE_INCLUDE_DIR}")
-    if(LIBSNDFILE AND LIBSNDFILE_INCLUDE_DIR)
-        list(APPEND FREEDV_LINK_LIBS ${LIBSNDFILE})
-    else(LIBSNDFILE AND LIBSNDFILE_INCLUDE_DIR)
-        message(FATAL_ERROR "sndfile library not found.
-On Linux systems try installing:
-    libsndfile-devel (RPM based systems)
-    libsndfile-dev   (DEB based systems)
-On Windows it's easiest to use the cmake option: USE_STATIC_SNDFILE"
-        )
-    endif(LIBSNDFILE AND LIBSNDFILE_INCLUDE_DIR)
-else(NOT USE_STATIC_SNDFILE)
-    message(STATUS "Will attempt static build of sndfile.")
-    include(cmake/BuildSndfile.cmake)
-endif(NOT USE_STATIC_SNDFILE)
-
-#
-# Find wxWidgets
-#
-if(NOT BOOTSTRAP_WXWIDGETS)
-    set(WXCONFIG "" CACHE FILEPATH "Location of wx-config binary.")
-    set(WXRC "" CACHE FILEPATH "Location of wxrc binary.")
-endif(NOT BOOTSTRAP_WXWIDGETS)
-#if(BOOTSTRAP_WXWIDGETS)
-#    set(WXCONFIG "${CMAKE_BINARY_DIR}/external/dist/bin/wx-config")
-#    set(WXRC "${CMAKE_BINARY_DIR}/external/dist/bin/wxrc")
-#    list(APPEND FREEDV_STATIC_DEPS wxWidgets)
-#endif(BOOTSTRAP_WXWIDGETS)
-message(STATUS "Looking for wxWidgets...")
-if(WXCONFIG)
-    message(STATUS "wx-config: ${WXCONFIG}")
-    set(wxWidgets_CONFIG_EXECUTABLE ${WXCONFIG})
-endif(WXCONFIG)
-if(WXRC)
-    message(STATUS "wxrc: ${WXRC}")
-    set(wxWidgets_wxrc_EXECUTABLE ${WXRC})
-endif(WXRC)
-set(WX_VERSION_MIN 3.0.0)
-find_package(wxWidgets REQUIRED core base aui html net adv)
-execute_process(COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}" --version
-    OUTPUT_VARIABLE WX_VERSION)
-string(STRIP ${WX_VERSION} WX_VERSION)
-if(WX_VERSION VERSION_EQUAL ${WX_VERSION_MIN}
-    OR WX_VERSION VERSION_GREATER ${WX_VERSION_MIN})
-   message(STATUS "wxWidgets version: ${WX_VERSION}")
-else()
-    message(FATAL_ERROR "wxWidgets must be installed on your system.
-Please check that wx-config is in path, the directory
-where wxWidgets libraries are installed (returned by
-'wx-config --libs' or 'wx-config --static --libs' command)
-is in LD_LIBRARY_PATH or equivalent variable and
-wxWidgets version is ${WX_VERSION_MIN} or above.")
-endif()
-if(wxWidgets_FOUND)
-    include("${wxWidgets_USE_FILE}")
-    list(APPEND FREEDV_LINK_LIBS ${wxWidgets_LIBRARIES})
-endif(wxWidgets_FOUND)
-
-#
-# Find speex library
-#
-if(NOT USE_STATIC_SPEEXDSP)
-    message(STATUS "Looking for Speex DSP library.")
-    find_path(SPEEXDSP_INCLUDE_DIR speex/speex.h)
-    find_library(SPEEXDSP_LIBRARY speexdsp)
-    message(STATUS "  Speex DSP headers: ${SPEEXDSP_INCLUDE_DIR}")
-    message(STATUS "  Speex DSP library: ${SPEEXDSP_LIBRARY}")
-    if(SPEEXDSP_INCLUDE_DIR AND SPEEXDSP_LIBRARY)
-        include_directories(${SPEEXDSP_INCLUDE_DIR})
-        list(APPEND FREEDV_LINK_LIBS ${SPEEXDSP_LIBRARY})
-    else(SPEEXDSP_INCLUDE_DIR AND SPEEXDSP_LIBRARY)
-        message(FATAL_ERROR "Speex DSP library not found!")
-    endif(SPEEXDSP_INCLUDE_DIR AND SPEEXDSP_LIBRARY)
-else()
-    message(STATUS "Will attempt static build of speex.")
-    include(cmake/BuildSpeex.cmake)
-endif()
-    
-#Freedv 
-add_subdirectory(src)
-
-# Icons and desktop file
-add_subdirectory(contrib)
-
-message(STATUS "Build type will be: ${CMAKE_BUILD_TYPE}")
-
-#
-# Cpack NSIS configuration for Windows.
-#
-if(WIN32)
-    # Detect if we're doing a 32-bit or 64-bit windows build.
-    if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
-        set(CMAKE_CL_64 TRUE)
-    endif()
-    if(NOT ${CMAKE_BUILD_TYPE} STREQUAL "Debug")
-        set(CPACK_STRIP_FILES TRUE)
-    endif()
-    configure_file(cmake/GetDependencies.cmake.in cmake/GetDependencies.cmake
-        @ONLY
-    )
-    install(SCRIPT ${CMAKE_BINARY_DIR}/cmake/GetDependencies.cmake)
-    set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "HF Digital Voice for Radio Amateurs")
-    set(CPACK_PACKAGE_VENDOR "CMake")
-    #set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
-    set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
-    set(CPACK_PACKAGE_VERSION_MAJOR ${FREEDV_VERSION_MAJOR})
-    set(CPACK_PACKAGE_VERSION_MINOR ${FREEDV_VERSION_MINOR})
-    # CPack expects a patch level version so set it here and override if we
-    # are actually setting one.
-    set(CPACK_PACKAGE_VERSION_PATCH 0)
-    if(FREEDV_VERSION_PATCH)
-        set(CPACK_PACKAGE_VERSION_PATCH ${FREEDV_VERSION_PATCH})
-    endif()
-    if(FREEDV_VERSION_SUFFIX)
-        set(CPACK_PACKAGE_VERSION_PATCH "${CPACK_PACKAGE_VERSION_PATCH}-${FREEDV_VERSION_SUFFIX}")
-    endif()
-    # There is a bug in NSI that does not handle full unix paths properly. Make
-    # sure there is at least one set of four (4) backlasshes.
-    #set(CPACK_PACKAGE_ICON "${CMake_SOURCE_DIR}/Utilities/Release\\\\InstallIcon.bmp")
-    set(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\freedv.exe")
-    set(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}")
-    set(CPACK_NSIS_PACKAGE_NAME "FreeDV")
-    set(CPACK_NSIS_URL_INFO_ABOUT "http://freedv.org")
-    set(CPACK_NSIS_MODIFY_PATH OFF)
-    set(CPACK_NSIS_MENU_LINKS "http://freedv.org" "FreeDV Homepage")
-    include(CPack)
-endif(WIN32)
-
-endif(BOOTSTRAP_WXWIDGETS AND NOT EXISTS ${WXCONFIG})
diff --git a/fdmdv2/branches/0.99/COPYING b/fdmdv2/branches/0.99/COPYING
deleted file mode 100644 (file)
index cfd4e99..0000000
+++ /dev/null
@@ -1,502 +0,0 @@
-                  GNU LESSER GENERAL PUBLIC LICENSE
-                       Version 2.1, February 1999
-
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.
- 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the Lesser GPL.  It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
-                            Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
-  This license, the Lesser General Public License, applies to some
-specially designated software packages--typically libraries--of the
-Free Software Foundation and other authors who decide to use it.  You
-can use it too, but we suggest you first think carefully about whether
-this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations below.
-
-  When we speak of free software, we are referring to freedom of use,
-not price.  Our General Public Licenses are designed to make sure that
-you have the freedom to distribute copies of free software (and charge
-for this service if you wish); that you receive source code or can get
-it if you want it; that you can change the software and use pieces of
-it in new free programs; and that you are informed that you can do
-these things.
-
-  To protect your rights, we need to make restrictions that forbid
-distributors to deny you these rights or to ask you to surrender these
-rights.  These restrictions translate to certain responsibilities for
-you if you distribute copies of the library or if you modify it.
-
-  For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you.  You must make sure that they, too, receive or can get the source
-code.  If you link other code with the library, you must provide
-complete object files to the recipients, so that they can relink them
-with the library after making changes to the library and recompiling
-it.  And you must show them these terms so they know their rights.
-
-  We protect your rights with a two-step method: (1) we copyright the
-library, and (2) we offer you this license, which gives you legal
-permission to copy, distribute and/or modify the library.
-
-  To protect each distributor, we want to make it very clear that
-there is no warranty for the free library.  Also, if the library is
-modified by someone else and passed on, the recipients should know
-that what they have is not the original version, so that the original
-author's reputation will not be affected by problems that might be
-introduced by others.
-\f
-  Finally, software patents pose a constant threat to the existence of
-any free program.  We wish to make sure that a company cannot
-effectively restrict the users of a free program by obtaining a
-restrictive license from a patent holder.  Therefore, we insist that
-any patent license obtained for a version of the library must be
-consistent with the full freedom of use specified in this license.
-
-  Most GNU software, including some libraries, is covered by the
-ordinary GNU General Public License.  This license, the GNU Lesser
-General Public License, applies to certain designated libraries, and
-is quite different from the ordinary General Public License.  We use
-this license for certain libraries in order to permit linking those
-libraries into non-free programs.
-
-  When a program is linked with a library, whether statically or using
-a shared library, the combination of the two is legally speaking a
-combined work, a derivative of the original library.  The ordinary
-General Public License therefore permits such linking only if the
-entire combination fits its criteria of freedom.  The Lesser General
-Public License permits more lax criteria for linking other code with
-the library.
-
-  We call this license the "Lesser" General Public License because it
-does Less to protect the user's freedom than the ordinary General
-Public License.  It also provides other free software developers Less
-of an advantage over competing non-free programs.  These disadvantages
-are the reason we use the ordinary General Public License for many
-libraries.  However, the Lesser license provides advantages in certain
-special circumstances.
-
-  For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it becomes
-a de-facto standard.  To achieve this, non-free programs must be
-allowed to use the library.  A more frequent case is that a free
-library does the same job as widely used non-free libraries.  In this
-case, there is little to gain by limiting the free library to free
-software only, so we use the Lesser General Public License.
-
-  In other cases, permission to use a particular library in non-free
-programs enables a greater number of people to use a large body of
-free software.  For example, permission to use the GNU C Library in
-non-free programs enables many more people to use the whole GNU
-operating system, as well as its variant, the GNU/Linux operating
-system.
-
-  Although the Lesser General Public License is Less protective of the
-users' freedom, it does ensure that the user of a program that is
-linked with the Library has the freedom and the wherewithal to run
-that program using a modified version of the Library.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.  Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library".  The
-former contains code derived from the library, whereas the latter must
-be combined with the library in order to run.
-\f
-                  GNU LESSER GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License Agreement applies to any software library or other
-program which contains a notice placed by the copyright holder or
-other authorized party saying it may be distributed under the terms of
-this Lesser General Public License (also called "this License").
-Each licensee is addressed as "you".
-
-  A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
-  The "Library", below, refers to any such software library or work
-which has been distributed under these terms.  A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language.  (Hereinafter, translation is
-included without limitation in the term "modification".)
-
-  "Source code" for a work means the preferred form of the work for
-making modifications to it.  For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
-  Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it).  Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-
-  1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
-  You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-\f
-  2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) The modified work must itself be a software library.
-
-    b) You must cause the files modified to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    c) You must cause the whole of the work to be licensed at no
-    charge to all third parties under the terms of this License.
-
-    d) If a facility in the modified Library refers to a function or a
-    table of data to be supplied by an application program that uses
-    the facility, other than as an argument passed when the facility
-    is invoked, then you must make a good faith effort to ensure that,
-    in the event an application does not supply such function or
-    table, the facility still operates, and performs whatever part of
-    its purpose remains meaningful.
-
-    (For example, a function in a library to compute square roots has
-    a purpose that is entirely well-defined independent of the
-    application.  Therefore, Subsection 2d requires that any
-    application-supplied function or table used by this function must
-    be optional: if the application does not supply it, the square
-    root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library.  To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License.  (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.)  Do not make any other change in
-these notices.
-\f
-  Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
-  This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
-  4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
-  If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-  5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library".  Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
-  However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library".  The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
-  When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library.  The
-threshold for this to be true is not precisely defined by law.
-
-  If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work.  (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
-  Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-\f
-  6. As an exception to the Sections above, you may also combine or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
-  You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License.  You must supply a copy of this License.  If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License.  Also, you must do one
-of these things:
-
-    a) Accompany the work with the complete corresponding
-    machine-readable source code for the Library including whatever
-    changes were used in the work (which must be distributed under
-    Sections 1 and 2 above); and, if the work is an executable linked
-    with the Library, with the complete machine-readable "work that
-    uses the Library", as object code and/or source code, so that the
-    user can modify the Library and then relink to produce a modified
-    executable containing the modified Library.  (It is understood
-    that the user who changes the contents of definitions files in the
-    Library will not necessarily be able to recompile the application
-    to use the modified definitions.)
-
-    b) Use a suitable shared library mechanism for linking with the
-    Library.  A suitable mechanism is one that (1) uses at run time a
-    copy of the library already present on the user's computer system,
-    rather than copying library functions into the executable, and (2)
-    will operate properly with a modified version of the library, if
-    the user installs one, as long as the modified version is
-    interface-compatible with the version that the work was made with.
-
-    c) Accompany the work with a written offer, valid for at
-    least three years, to give the same user the materials
-    specified in Subsection 6a, above, for a charge no more
-    than the cost of performing this distribution.
-
-    d) If distribution of the work is made by offering access to copy
-    from a designated place, offer equivalent access to copy the above
-    specified materials from the same place.
-
-    e) Verify that the user has already received a copy of these
-    materials or that you have already sent this user a copy.
-
-  For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it.  However, as a special exception,
-the materials to be distributed need not include anything that is
-normally distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
-  It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system.  Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-\f
-  7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
-    a) Accompany the combined library with a copy of the same work
-    based on the Library, uncombined with any other library
-    facilities.  This must be distributed under the terms of the
-    Sections above.
-
-    b) Give prominent notice with the combined library of the fact
-    that part of it is a work based on the Library, and explaining
-    where to find the accompanying uncombined form of the same work.
-
-  8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License.  Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License.  However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
-  9. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Library or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
-  10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties with
-this License.
-\f
-  11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-  12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License may add
-an explicit geographical distribution limitation excluding those countries,
-so that distribution is permitted only in or among countries not thus
-excluded.  In such case, this License incorporates the limitation as if
-written in the body of this License.
-
-  13. The Free Software Foundation may publish revised and/or new
-versions of the Lesser General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation.  If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-\f
-  14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission.  For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this.  Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
-                            NO WARRANTY
-
-  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
-                     END OF TERMS AND CONDITIONS
-\f
-           How to Apply These Terms to Your New Libraries
-
-  If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change.  You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
-  To apply these terms, attach the following notices to the library.  It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the library's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library 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
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, see
-    <http://www.gnu.org/licenses/>.
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the
-  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
-  <signature of Ty Coon>, 1 April 1990
-  Ty Coon, President of Vice
-
-That's all there is to it!
diff --git a/fdmdv2/branches/0.99/README.txt b/fdmdv2/branches/0.99/README.txt
deleted file mode 100644 (file)
index f28f204..0000000
+++ /dev/null
@@ -1,274 +0,0 @@
-==================================
- Building and installing on Linux
-==================================
-
-Quickstart 1
------------
-
-Builds static versions of wxWidgets, portaudio, codec2-dev, which are commonly
-missing on many Linux systems, or of the wrong (older) version.
-
-1/ Assuming the fdmdv2-dev source is checked out into ~/fdmdv2-dev:
-
-  $ sudo apt-get install libgtk2.0-dev libhamlib-dev libsamplerate-dev libasound2-dev libao-dev
-  $ cd fdmdv2-dev
-  $ mkdir build_linux
-  $ cd build_linux
-  $ cmake -DBOOTSTRAP_WXWIDGETS=TRUE ~/fdmdv2-dev
-  $ make
-
-2/ Then you can configure FreeDV using your local codec-dev, something like:
-
-  $ cmake -DCMAKE_BUILD_TYPE=Debug -DBOOTSTRAP_WXWIDGETS=TRUE -DCODEC2_INCLUDE_DIRS=/path/to/codec2-dev/src -DCODEC2_LIBRARY=/path/to/codec2-dev/build_linux/src/libcodec2.so -DUSE_STATIC_CODEC2=FALSE -DUSE_STATIC_PORTAUDIO=TRUE -DUSE_STATIC_SOX=TRUE ../
-
-3/ OR build a local copy of codec2-dev:
-
-  $ cmake -DBOOTSTRAP_WXWIDGETS=TRUE -DUSE_STATIC_CODEC2=TRUE -DUSE_STATIC_PORTAUDIO=TRUE -DUSE_STATIC_SOX=TRUE ../
-  
-4/ Build and run FreeDV:
-
-   $ make
-   $ ./src/freedv
-
-Quickstart 2
-------------
-
-1/ Assuming you have all the dependant libraries:
-
-  $ cd /path/to/fdmdv2
-  $ mkdir build_linux
-  $ cd build_linux
-  $ cmake ../ (defaults to /usr/local, use CMAKE_INSTALL_PREFIX to override)
-  (if no errors)
-  $ make
-  (as root)
-  $ make install
-
-
-=======================================================
- Building for Windows on Ubuntu Linux (Cross compiling)
-=======================================================
-
-1/ Install the cross compiling toolchain:
-
-  $ sudo apt-get install mingw-w64
-
-2/ Patch cmake using: http://www.cmake.org/gitweb?p=stage/cmake.git;a=patch;h=33286235048495ceafb636d549d9a4e8891967ae
-
-3/ Checkout a fresh copy of codec2-dev and build for Windows, pointing to the generate_codebook built by a linux build of generate_codebook, using this cmake line
-
-  $ cmake .. -DCMAKE_TOOLCHAIN_FILE=../fdmdv2-dev/cmake/Toolchain-Ubuntu-mingw32.cmake -DUNITTEST=FALSE -DGENERATE_CODEBOOK=/home/david/codec2-dev/build_linux/src/generate_codebook 
-
-4/ Build WxWidgets
-
-  $ cd /path/to/fdmdv2-dev
-  $ mkdir build_windows
-  $ cd build_windows
-  $ cmake -DBOOTSTRAP_WXWIDGETS=TRUE .. -DCMAKE_TOOLCHAIN_FILE=cmake/Toolchain-Ubuntu-mingw32.cmake -DCMAKE_BUILD_TYPE=Debug
-  $ make
-
-5/ Download and install the Windows version of Hamlib:
-
-  $ wget http://internode.dl.sourceforge.net/project/hamlib/hamlib/1.2.15.3/hamlib-win32-1.2.15.3.zip
-  $ unzip hamlib-win32-1.2.15.3.zip
-
-6/ Build All the libraries and FreeDV:
-
-  $ cmake -DBOOTSTRAP_WXWIDGETS=TRUE -DCMAKE_TOOLCHAIN_FILE=cmake/Toolchain-Ubuntu-mingw32.cmake -DUSE_STATIC_PORTAUDIO=TRUE -DUSE_STATIC_SNDFILE=TRUE -DUSE_STATIC_SAMPLERATE=TRUE -DUSE_STATIC_SOX=TRUE -DUSE_STATIC_CODEC2=FALSE -DCODEC2_INCLUDE_DIRS=/home/david/tmp/codec2-dev/src -DCODEC2_LIBRARY=/home/david/tmp/codec2-dev/build_windows/src/libcodec2.dll.a -DHAMLIB_INCLUDE_DIR=hamlib-win32-1.2.15.3/include -DHAMLIB_LIBRARY=hamlib-win32-1.2.15.3/lib/gcc/libhamlib.dll.a -DCMAKE_BUILD_TYPE=Debug ..
-  $ make
-
-====================================
- Building and installing on Windows
-====================================
-
-The windows build is similar to linux and follows the same basic workflow,
-however, while codec2 and FreeDV (fdmdv2) build well on windows, some of the
-dependencies do not. For that reson current windows releases are cross-compiled
-from linux.
-
-Only MinGW is supported. While it is likely possible to perform a pure MinGW
-build, installing MSYS2 will make your life easier.
-
-CMake may not automatically detect that you're in the MSYS environment. If this
-occurs you need to pass cmake the proper generator:
-
-cmake -G"MSYS Makefiles" [other options] </path/to/source>
-
-===============================
- Bootstrapping wxWidgets build
-===============================
-
-If wxWidgets (>= 3.0) is not available then one option is to have CMake boot-
-strap the build for FreeDV.
-
-This is required because the tool wx-config is used to get the correct compiler
-and linker flags of the wxWidgets components needed by FreeDV. Since this is
-normally done at configure time, not during "make", it is not possible for CMake
-or have this information prior to building wxWidgets.
-
-In order to work around this issue you can "bootstrap" the wxWidgets build using
-the CMake option, "BOOTSTRAP_WXWIDGETS". wxWidgets will be built using static
-libraries.
-
-NOTE: This forces "USE_STATIC_WXWIDGETS" to be true internally regarless of the
-value set manually.
-
-(from any directory, but empty directory outside of the source is prefered.)
-$ cmake -DBOOTSTRAP_WXWIDGETS=TRUE /path/to/fdmdv2
-$ make
-(wxWidgets is downloaded and built)
-$ cmake .
-(wxWidgets build should be detected)
-$ make
-(if all goes well, as root)
-$ make install
-
-====================================
- Building and installing on OSX
-====================================
-
-====================================
- Building and installing on FreeBSD
-====================================
-
-As per "Quickstart 2" above but change build_linux to build_freebsd
-
-=======
-Editing
-=======
-
-Please make sure your text editor does not insert tabs, and
-used indents of 4 spaces.  The following .emacs code was used to
-configure emacs:
-
-(setq-default indent-tabs-mode nil)
-
-(add-hook 'c-mode-common-hook
-          (function (lambda ()
-                      (setq c-basic-offset 4)
-                      )))
-
-====
-TODO
-====
-
-[ ] Open R&D questions
-    + Goal is to develop an open source DV mode that performs comparably to SSB
-    [ ] Does 700 perform OK next to SSB?
-        + approx same tx pk level (hard to measure exactly)
-        + try some low SNR channels
-        + try some fast fading/nasty channels
-    [ ] Is 700 speech quality acceptable?
-
-[X] test frames 
-    [X] freedv API support
-    [X] BER displayed on GUI for 700 and 1600
-    [X] plot error patterns for 700 and 1600
-        + callback for error patterns, or poll via stats interface
-    [X] plot error histograms for 700 and 1600
-        + map bit error to carrier, have done this in tcohpsk?
-        + how to reset histogram?  On error reset?
-        + histogram screen ... new code?
-        + test with filter
-
-[X] Bugs
-    [X] resync issue
-    [X] equalise power on 700 and 1600
-    [X] research real and complex PAPR
-    [X] waterfall and spectrum in analog mode
-    [X] The waterfall in analog mode appears to quit working sometimes?
-
-    [X] On TX, intermittently PTT will cause signal to be heard in speakers.  Toggle PTT or 
-        Stop/Start toggle and then starts working.
-    [X] Squelch control on 1600 mode will not open up squelch to 0 (appears to be around 2 dB)
-    [X] space bar keys PTT when entering text info box
-    [X] checksum based txt reception
-        + only print if valid
-    [X] IC7200 audio breakup
-    [ ] short varicode doesn't work
-        + #ifdef-ed out for now
-        + cld be broken in freedv_api
-    [X] On 700 audio sounds tinny and clicky when out of sync compared to 1600 why?
-        + clue: only when analog not pressed
-        + this was 7.5 to 8kHz interpolator bug
-    [X] spectrum and waterfall scale changes when analog pressed
-    [X] ocassional test frames error counter goes crazy
-    [ ] 700 syncs up to 1000Hz sine waves
-        + shouldn't trigger sync logic, will be a problem with carriers
-    [ ] "clip" led, encourage people to adjust gain to hit that occ when speaking
-    [ ] Win32 record from radio time
-
-[ ] FreeDV 700 improvements
-    [ ] bpf filter after clipping to remove clicks
-        [ ] tcohpsk first, measure PAPR, impl loss
-    [ ] error masking
-        [ ] C version
-        [ ] training off air?  Switchable?
-        [ ] excitation params
-        [ ] training
-    [ ] plotting other demod stats like ch ampl and phase ests
-    [ ] profile with perf, different libresample routine
-    [ ] check for occassional freedv 700 loss of sync
-        + scatter seems to jump
-    [ ] switchable diversity (narrowband) option
-        + measure difference on a few channels
-        + blog
-
-[X] win32
-    [X] X-compile works
-    [X] basic installer
-    [X] Win32 installer
-        + Richard has taken care of this
-
-[ ] Small fixes
-    [X] Playfile bug
-    [X] running again
-    [X] bump ver number
-    [X] long varicode default
-    [X] option to _not_ require checksum, on by default
-    [X] default squelch 2dB
-    [X] scatter diagram tweaks
-        + e.g. meaningful plots on fading channels in real time 
-        [X] agc with hysteresis
-            + changed to log steps
-        [X] longer persistance
-            + changed to 6 seconds
-        [X] diversity addtions on 700
-            + still not real obvious on plot
-            + might be useful to make this switchable
-    [X] scatter diagram different colours/carrier
-    [X] remember what mode you were in
-    [ ] cmd line file decode
-    [ ] Waterfall direction
-    [ ] documentation or use, walk through, you tube, blog posts
-
-[ ] Web support for Presence/spotting hooks
-
-=================
-USER GUIDE NOTES
-=================
-
-TODO: Put this in a more usable form, video tutorials etc
-
-1/ Error Histogram.  Displays BER of each carrier when in "test frame"
- mode.  As each QPSK carrier has 2 bits there are 2*Nc histogram
- points.
-
- Ideally all carriers will have about the same BER (+/- 20% after 5000
- total bit errors).  However problems can occur with filtering in the
- tx path.  If one carrier has less power, then it will have a higher
- BER.  The errors in this carrier will tend to dominate overall
- BER. For example if one carrier is attenuated due to SSB filter
- ripple in the tx path then the BER on that carrier will be higher.
- This is bad news for DV.
-
- Suggested usage: Transmit FreeDV in test frame mode.  Use a 2nd rx
- (or get a friend) to monitor your rx signal with FreeDV in test frame
- mode.  Adjust your rx SNR to get a BER of a few % (e.g. reduce tx power,
- use a short antenna for the rx, point your beam away, adjust rx RF
- gain).  Monitor the error histogram for a few minutes, until you have
- say 5000 total bit errors.  You have a problem if the BER of any
- carrier is more than 20% different from the rest.
-
-  A typical issue will be one carrier at 1.0, the others at 0.5,
-  indicating the poorer carrier BER is twice the larger.
diff --git a/fdmdv2/branches/0.99/cmake/BuildCodec2.cmake b/fdmdv2/branches/0.99/cmake/BuildCodec2.cmake
deleted file mode 100644 (file)
index 471eef8..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-set(SPEEXDSP_CMAKE_ARGS -DBUILD_SHARED_LIBS=FALSE -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/external/dist)
-
-if(USE_STATIC_SPEEXDSP)
-    list(APPEND SPEEXDSP_CMAKE_ARGS 
-        -DSPEEXDSP_LIBRARIES=${CMAKE_BINARY_DIR}/external/dist/lib/libspeexdsp.a
-        -DSPEEXDSP_INCLUDE_DIR=${CMAKE_BINARY_DIR}/external/dist/include)
-endif()
-
-if(CMAKE_CROSSCOMPILING)
-    set(CODEC2_CMAKE_ARGS "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
-endif()
-
-include(ExternalProject)
-ExternalProject_Add(codec2
-   SVN_REPOSITORY https://svn.code.sf.net/p/freetel/code/codec2-dev
-   CMAKE_ARGS ${CODEC2_CMAKE_ARGS} ${SPEEXDSP_CMAKE_ARGS}
-   INSTALL_COMMAND ""
-)
-set(CODEC2_LIBRARIES
-    ${CMAKE_BINARY_DIR}/codec2-prefix/src/codec2-build/src/libcodec2.a)
-include_directories(${CMAKE_BINARY_DIR}/codec2-prefix/src/codec2/src)
-list(APPEND FREEDV_LINK_LIBS ${CODEC2_LIBRARIES})
-list(APPEND FREEDV_STATIC_DEPS codec2)
diff --git a/fdmdv2/branches/0.99/cmake/BuildPortaudio.cmake b/fdmdv2/branches/0.99/cmake/BuildPortaudio.cmake
deleted file mode 100644 (file)
index cc33d06..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-set(PORTAUDIO_TARBALL "pa_stable_v19_20111121")
-
-# required linking libraries on linux. Not sure about windows.
-find_library(ALSA_LIBRARIES asound)
-
-if(UNIX AND NOT ALSA_LIBRARIES)
-    message(ERROR "Could not find alsa library which is required for portaudio.
-On Linux systems try installing:
-    alsa-lib-devel  (RPM based systems)
-    libasound2-dev  (DEB based systems)"
-    )
-endif()
-
-# Make sure that configure knows what system we're using when cross-compiling.
-if(MINGW AND CMAKE_CROSSCOMPILING)
-    include(cmake/MinGW.cmake)
-    set(CONFIGURE_COMMAND ./configure --build=${HOST} --host=${HOST} --target=${HOST} --enable-cxx --without-jack --disable-shared --prefix=${CMAKE_BINARY_DIR}/external/dist)
-else()
-    set(CONFIGURE_COMMAND ./configure --enable-cxx --without-jack --disable-shared --prefix=${CMAKE_BINARY_DIR}/external/dist)
-endif()
-
-include(ExternalProject)
-ExternalProject_Add(portaudio
-    URL http://www.portaudio.com/archives/${PORTAUDIO_TARBALL}.tgz
-    BUILD_IN_SOURCE 1
-    INSTALL_DIR external/dist
-    CONFIGURE_COMMAND ${CONFIGURE_COMMAND}
-    BUILD_COMMAND $(MAKE)
-    INSTALL_COMMAND $(MAKE) install
-)
-if(WIN32)
-    set(PORTAUDIO_LIBRARIES 
-        ${CMAKE_BINARY_DIR}/external/dist/lib/libportaudio.a
-        ${CMAKE_BINARY_DIR}/external/dist/lib/libportaudiocpp.a
-)
-else(WIN32)
-    find_library(RT rt)
-    find_library(ASOUND asound)
-    set(PORTAUDIO_LIBRARIES
-        ${CMAKE_BINARY_DIR}/external/dist/lib/libportaudio.a
-        ${CMAKE_BINARY_DIR}/external/dist/lib/libportaudiocpp.a
-        ${RT}
-        ${ASOUND}
-    )
-endif(WIN32)
-include_directories(${CMAKE_BINARY_DIR}/external/dist/include)
-
-# Add the portaudio library to the list of libraries that must be linked.
-list(APPEND FREEDV_LINK_LIBS ${PORTAUDIO_LIBRARIES})
-
-# Setup a dependency so that this gets built before linking to freedv.
-list(APPEND FREEDV_STATIC_DEPS portaudio)
diff --git a/fdmdv2/branches/0.99/cmake/BuildSamplerate.cmake b/fdmdv2/branches/0.99/cmake/BuildSamplerate.cmake
deleted file mode 100644 (file)
index aa09f85..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-set(SAMPLERATE_TARBALL "libsamplerate-0.1.8")
-
-if(MINGW AND CMAKE_CROSSCOMPILING)
-    set(CONFIGURE_COMMAND ./configure --build=${HOST} --host=${HOST} --target=${HOST} --prefix=${CMAKE_BINARY_DIR}/external/dist --disable-sndfile)
-else()
-    set(CONFIGURE_COMMAND ./configure --prefix=${CMAKE_BINARY_DIR}/external/dist)
-endif()
-
-include(ExternalProject)
-ExternalProject_Add(samplerate
-    URL http://www.mega-nerd.com/SRC/${SAMPLERATE_TARBALL}.tar.gz 
-    BUILD_IN_SOURCE 1
-    INSTALL_DIR external/dist
-    CONFIGURE_COMMAND ${CONFIGURE_COMMAND}
-    BUILD_COMMAND $(MAKE)
-    INSTALL_COMMAND $(MAKE) install
-)
-if(WIN32)
-    set(SAMPLERATE_LIBRARIES
-        ${CMAKE_BINARY_DIR}/external/dist/lib/libsamplerate.a)
-else(WIN32)
-    set(SAMPLERATE_LIBRARIES
-        ${CMAKE_BINARY_DIR}/external/dist/lib/libsamplerate.a)
-endif(WIN32)
-include_directories(${CMAKE_BINARY_DIR}/external/dist/include)
-list(APPEND FREEDV_LINK_LIBS ${SAMPLERATE_LIBRARIES})
-list(APPEND FREEDV_STATIC_DEPS samplerate)
diff --git a/fdmdv2/branches/0.99/cmake/BuildSndfile.cmake b/fdmdv2/branches/0.99/cmake/BuildSndfile.cmake
deleted file mode 100644 (file)
index 43233fb..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-set(SNDFILE_TARBALL "libsndfile-1.0.25")
-
-if(MINGW AND CMAKE_CROSSCOMPILING)
-    set(CONFIGURE_COMMAND ./configure --host=${HOST}  --prefix=${CMAKE_BINARY_DIR}/external/dist --disable-external-libs --disable-shared)
-else()
-    set(CONFIGURE_COMMAND ./configure --prefix=${CMAKE_BINARY_DIR}/external/dist --disable-external-libs --disable-shared --disable-external-libs)
-endif()
-
-include(ExternalProject)
-ExternalProject_Add(sndfile
-    URL http://www.mega-nerd.com/libsndfile/files/${SNDFILE_TARBALL}.tar.gz
-    BUILD_IN_SOURCE 1
-    INSTALL_DIR external/dist
-    CONFIGURE_COMMAND ${CONFIGURE_COMMAND}
-    BUILD_COMMAND $(MAKE) V=1
-    INSTALL_COMMAND $(MAKE) install
-)
-if(MINGW)
-    set(SNDFILE_LIBRARIES ${CMAKE_BINARY_DIR}/external/dist/lib/libsndfile.a)
-else()
-    set(SNDFILE_LIBRARIES ${CMAKE_BINARY_DIR}/external/dist/lib/libsndfile.a)
-endif()
-
-include_directories(${CMAKE_BINARY_DIR}/external/dist/include)
-list(APPEND FREEDV_LINK_LIBS ${SNDFILE_LIBRARIES})
-list(APPEND FREEDV_STATIC_DEPS sndfile)
diff --git a/fdmdv2/branches/0.99/cmake/BuildSox.cmake b/fdmdv2/branches/0.99/cmake/BuildSox.cmake
deleted file mode 100644 (file)
index d54488b..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-set(SOX_TARBALL "sox-14.4.1")
-
-# required linking libraries on linux. Not sure about windows.
-find_library(ALSA_LIBRARIES asound)
-find_library(AO_LIBRARIES ao)
-find_library(GSM_LIBRARIES gsm)
-
-if(UNIX AND NOT ALSA_LIBRARIES)
-    message(ERROR "Could not find alsa library.
-On Linux systems try installing:
-    alsa-lib-devel  (RPM based systems)
-    libasound2-dev  (DEB based systems)"
-    )
-endif(UNIX AND NOT ALSA_LIBRARIES)
-
-if(UNIX AND NOT AO_LIBRARIES)
-    message(ERROR "Could not find libao.
-On Linux systems try installing:
-    libao-devel  (RPM based systems)
-    libao-dev    (DEB based systems)"
-    )
-endif(UNIX AND NOT AO_LIBRARIES)
-
-if(MINGW AND CMAKE_CROSSCOMPILING)
-    set(CONFIGURE_COMMAND ./configure --host=${HOST} --enable-shared=no --without-id3tag --without-png --disable-gomp --with-oggvorbis=no --with-oss=no --with-flac=no --with-amrnb=no --with-amrwb=no --with-mp3=no --with-wavpack=no --disable-dl-sndfile --with-pulseaudio=no --without-magic --with-gsm --prefix=${CMAKE_BINARY_DIR}/external/dist)
-else()
-    set(CONFIGURE_COMMAND ./configure --enable-shared=no --without-id3tag --without-png --disable-gomp --with-oggvorbis=no --with-oss=no --with-flac=no --with-amrnb=no --with-amrwb=no --with-mp3=no --with-wavpack=no --disable-dl-sndfile --with-pulseaudio=no --without-magic --with-gsm --prefix=${CMAKE_BINARY_DIR}/external/dist)
-endif()
-
-include(ExternalProject)
-ExternalProject_Add(sox
-    URL http://downloads.sourceforge.net/sox/${SOX_TARBALL}.tar.gz
-    BUILD_IN_SOURCE 1
-    INSTALL_DIR external/dist
-    CONFIGURE_COMMAND ${CONFIGURE_COMMAND}
-    BUILD_COMMAND $(MAKE) V=1
-    INSTALL_COMMAND $(MAKE) install
-)
-set(SOX_LIBRARIES ${CMAKE_BINARY_DIR}/external/dist/lib/libsox.a)
-if(UNIX)
-    list(APPEND SOX_LIBRARIES ${ALSA_LIBRARIES} ${AO_LIBRARIES} ${GSM_LIBRARIES})
-endif()
-if(MINGW)
-    list(APPEND SOX_LIBRARIES winmm)
-endif()
-include_directories(${CMAKE_BINARY_DIR}/external/dist/include)
-list(APPEND FREEDV_LINK_LIBS ${SOX_LIBRARIES})
-list(APPEND FREEDV_STATIC_DEPS sox)
diff --git a/fdmdv2/branches/0.99/cmake/BuildSpeex.cmake b/fdmdv2/branches/0.99/cmake/BuildSpeex.cmake
deleted file mode 100644 (file)
index 262d558..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-set(SPEEXDSP_TARBALL "speexdsp-1.2rc3.tar.gz")
-
-if(MINGW AND CMAKE_CROSSCOMPILING)
-    include(cmake/MinGW.cmake)
-    set(CONFIGURE_COMMAND ./configure --host=${HOST} --prefix=${CMAKE_BINARY_DIR}/external/dist --disable-examples)
-else()
-    set(CONFIGURE_COMMAND ./configure --prefix=${CMAKE_BINARY_DIR}/external/dist --disable-examples)
-endif()
-
-include(ExternalProject)
-ExternalProject_Add(speex
-   URL http://downloads.xiph.org/releases/speex/${SPEEXDSP_TARBALL}
-   BUILD_IN_SOURCE 1
-   INSTALL_DIR external/dist
-   CONFIGURE_COMMAND ${CONFIGURE_COMMAND}
-   BUILD_COMMAND $(MAKE)
-   INSTALL_COMMAND $(MAKE) install
-)
-
-set(SPEEXDSP_LIBRARIES ${CMAKE_BINARY_DIR}/external/dist/lib/libspeexdsp.a)
-include_directories(${CMAKE_BINARY_DIR}/external/dist/include)
-list(APPEND FREEDV_LINK_LIBS ${SPEEXDSP_LIBRARIES})
-list(APPEND FREEDV_STATIC_DEPS speex)
-if(USE_STATIC_CODEC2)
-    add_dependencies(codec2 speex)
-endif()
diff --git a/fdmdv2/branches/0.99/cmake/BuildWxWidgets.cmake b/fdmdv2/branches/0.99/cmake/BuildWxWidgets.cmake
deleted file mode 100644 (file)
index 901d806..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-set(WXWIDGETS_TARBALL "wxWidgets-3.0.2")
-
-# If we're cross-compiling then we need to set the target host manually.
-if(MINGW AND CMAKE_CROSSCOMPILING)
-    include(cmake/MinGW.cmake)
-endif()
-
-# If not cross-compiling then use the built-in makefile, otherwise use standard configure.
-if(MINGW AND NOT CMAKE_CROSSCOMPILING)
-#    set(CONFIGURE_COMMAND "true")
-#    set(MAKE_COMMAND $(MAKE) -C build/msw -f makefile.gcc SHARED=0 UNICODE=1 BUILD=release PREFIX=${CMAKE_BINARY_DIR}/external/dist)
-    set(CONFIGURE_COMMAND ./configure --disable-shared --prefix=${CMAKE_BINARY_DIR}/external/dist)
-       set(MAKE_COMMAND $(MAKE))
-endif()
-
-if(MINGW AND CMAKE_CROSSCOMPILING)
-    set(CONFIGURE_COMMAND ./configure --build=${HOST} --host=${HOST} --target=${HOST} --disable-shared --prefix=${CMAKE_BINARY_DIR}/external/dist)
-       set(MAKE_COMMAND $(MAKE))
-endif()
-
-if(NOT MINGW)
-    set(CONFIGURE_COMMAND ./configure --host=${HOST} --target=${HOST} --disable-shared --prefix=${CMAKE_BINARY_DIR}/external/dist)
-       set(MAKE_COMMAND $(MAKE))
-endif()
-
-include(ExternalProject)
-ExternalProject_Add(wxWidgets
-    URL http://downloads.sourceforge.net/wxwindows/${WXWIDGETS_TARBALL}.tar.bz2
-    BUILD_IN_SOURCE 1
-    INSTALL_DIR external/dist
-    CONFIGURE_COMMAND ${CONFIGURE_COMMAND}
-    BUILD_COMMAND ${MAKE_COMMAND}
-    INSTALL_COMMAND $(MAKE) install
-)
-
-ExternalProject_Get_Property(wxWidgets install_dir)
-message(STATUS "wxWidgets install dir: ${install_dir}")
-if(NOT WXCONFIG)
-    set(WXCONFIG "${install_dir}/bin/wx-config")
-endif()
-if(EXISTS ${WXCONFIG})
-    set(BS_WX_DONE TRUE)
-endif()
diff --git a/fdmdv2/branches/0.99/cmake/FindPortaudio.cmake b/fdmdv2/branches/0.99/cmake/FindPortaudio.cmake
deleted file mode 100644 (file)
index 158e20e..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-# - Try to find Portaudio
-# Once done this will define
-#
-#  PORTAUDIO_FOUND - system has Portaudio
-#  PORTAUDIO_INCLUDE_DIRS - the Portaudio include directory
-#  PORTAUDIO_LIBRARIES - Link these to use Portaudio
-#  PORTAUDIO_DEFINITIONS - Compiler switches required for using Portaudio
-#  PORTAUDIO_VERSION - Portaudio version
-#
-#  Copyright (c) 2006 Andreas Schneider <mail@cynapses.org>
-#
-# Redistribution and use is allowed according to the terms of the New BSD license.
-# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
-#
-
-
-if (PORTAUDIO_LIBRARIES AND PORTAUDIO_INCLUDE_DIRS)
-  # in cache already
-  set(PORTAUDIO_FOUND TRUE)
-else (PORTAUDIO_LIBRARIES AND PORTAUDIO_INCLUDE_DIRS)
-  if (NOT WIN32)
-   include(FindPkgConfig)
-   pkg_check_modules(PORTAUDIO2 portaudio-2.0)
-  endif (NOT WIN32)
-
-  if (PORTAUDIO2_FOUND)
-    set(PORTAUDIO_INCLUDE_DIRS
-      ${PORTAUDIO2_INCLUDE_DIRS}
-    )
-    if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
-      set(PORTAUDIO_LIBRARIES "${PORTAUDIO2_LIBRARY_DIRS}/lib${PORTAUDIO2_LIBRARIES}.dylib")
-    else (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
-      set(PORTAUDIO_LIBRARIES
-        ${PORTAUDIO2_LIBRARIES}
-      )
-    endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
-    set(PORTAUDIO_VERSION
-      19
-    )
-    set(PORTAUDIO_FOUND TRUE)
-  else (PORTAUDIO2_FOUND)
-    find_path(PORTAUDIO_INCLUDE_DIR
-      NAMES
-        portaudio.h
-      PATHS
-        /usr/include
-        /usr/local/include
-        /opt/local/include
-        /sw/include
-    )
-   
-    find_library(PORTAUDIO_LIBRARY
-      NAMES
-        portaudio
-      PATHS
-        /usr/lib
-        /usr/local/lib
-        /opt/local/lib
-        /sw/lib
-    )
-   
-    find_path(PORTAUDIO_LIBRARY_DIR
-      NAMES
-        portaudio
-      PATHS
-        /usr/lib
-        /usr/local/lib
-        /opt/local/lib
-        /sw/lib
-    )
-   
-    set(PORTAUDIO_INCLUDE_DIRS
-      ${PORTAUDIO_INCLUDE_DIR}
-    )
-    set(PORTAUDIO_LIBRARIES
-      ${PORTAUDIO_LIBRARY}
-    )
-   
-    set(PORTAUDIO_LIBRARY_DIRS
-      ${PORTAUDIO_LIBRARY_DIR}
-    )
-   
-    set(PORTAUDIO_VERSION
-      18
-    )
-   
-    if (PORTAUDIO_INCLUDE_DIRS AND PORTAUDIO_LIBRARIES)
-       set(PORTAUDIO_FOUND TRUE)
-    endif (PORTAUDIO_INCLUDE_DIRS AND PORTAUDIO_LIBRARIES)
-   
-    if (PORTAUDIO_FOUND)
-      if (NOT Portaudio_FIND_QUIETLY)
-        message(STATUS "Found Portaudio: ${PORTAUDIO_LIBRARIES}")
-      endif (NOT Portaudio_FIND_QUIETLY)
-    else (PORTAUDIO_FOUND)
-      if (Portaudio_FIND_REQUIRED)
-        message(FATAL_ERROR "Could not find Portaudio")
-      endif (Portaudio_FIND_REQUIRED)
-    endif (PORTAUDIO_FOUND)
-  endif (PORTAUDIO2_FOUND)
-
-
-  # show the PORTAUDIO_INCLUDE_DIRS and PORTAUDIO_LIBRARIES variables only in the advanced view
-  mark_as_advanced(PORTAUDIO_INCLUDE_DIRS PORTAUDIO_LIBRARIES)
-
-endif (PORTAUDIO_LIBRARIES AND PORTAUDIO_INCLUDE_DIRS)
-
diff --git a/fdmdv2/branches/0.99/cmake/GetDependencies.cmake.in b/fdmdv2/branches/0.99/cmake/GetDependencies.cmake.in
deleted file mode 100644 (file)
index 93204dd..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# As this script is run in a new cmake instance, it does not have access to
-# the existing cache variables. Pass them in via the configure_file command.
-set(CMAKE_BINARY_DIR @CMAKE_BINARY_DIR@)
-set(CMAKE_SOURCE_DIR @CMAKE_SOURCE_DIR@)
-set(UNIX @UNIX@)
-set(WIN32 @WIN32@)
-set(CMAKE_CROSSCOMPILING @CMAKE_CROSSCOMPILING@)
-set(CMAKE_FIND_LIBRARY_SUFFIXES @CMAKE_FIND_LIBRARY_SUFFIXES@)
-set(CMAKE_FIND_LIBRARY_PREFIXES @CMAKE_FIND_LIBRARY_PREFIXES@)
-set(CMAKE_SYSTEM_LIBRARY_PATH @CMAKE_SYSTEM_LIBRARY_PATH@)
-set(CMAKE_FIND_ROOT_PATH @CMAKE_FIND_ROOT_PATH@)
-
-set(FREEDV_EXE ${CMAKE_BINARY_DIR}/src/freedv.exe)
-
-include(GetPrerequisites)
-get_prerequisites("${FREEDV_EXE}" _deps 1 1 "" "${CMAKE_SYSTEM_LIBRARY_PATH}")
-foreach(_runtime ${_deps})
-    message("Looking for ${_runtime}")
-    find_library(RUNTIME_${_runtime} ${_runtime})
-    message("${RUNTIME_${_runtime}}")
-    if(RUNTIME_${_runtime})
-        file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/bin"
-        TYPE EXECUTABLE FILES "${RUNTIME_${_runtime}}")
-    endif()
-endforeach()
diff --git a/fdmdv2/branches/0.99/cmake/MinGW.cmake b/fdmdv2/branches/0.99/cmake/MinGW.cmake
deleted file mode 100644 (file)
index 333c1dc..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-# If we're cross-compiling then we need to set the target host manually.
-if(MINGW AND CMAKE_CROSSCOMPILING)
-    if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
-        set(HOST x86_64-w64-mingw32)
-    else()
-        set(HOST i686-w64-mingw32)
-    endif()
-endif()
diff --git a/fdmdv2/branches/0.99/cmake/Toolchain-Ubuntu-mingw32.cmake b/fdmdv2/branches/0.99/cmake/Toolchain-Ubuntu-mingw32.cmake
deleted file mode 100644 (file)
index 3507d72..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# Sample toolchain file for building for Windows from an Ubuntu Linux system.
-#
-# Typical usage:
-#    *) install cross compiler: `sudo apt-get install mingw-w64 g++-mingw-w64`
-#    *) cd build
-#    *) cmake -DCMAKE_TOOLCHAIN_FILE=~/Toolchain-Ubuntu-mingw32.cmake ..
-
-set(CMAKE_SYSTEM_NAME Windows)
-set(TOOLCHAIN_PREFIX i686-w64-mingw32)
-
-# cross compilers to use for C and C++
-set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc)
-set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
-set(CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres)
-
-# target environment on the build host system
-#   set 1st to dir with the cross compiler's C/C++ headers/libs
-set(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX})
-
-# modify default behavior of FIND_XXX() commands to
-# search for headers/libs in the target environment and
-# search for programs in the build host environment
-set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
-set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
-set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
diff --git a/fdmdv2/branches/0.99/cmake/config.h.in b/fdmdv2/branches/0.99/cmake/config.h.in
deleted file mode 100644 (file)
index 8e3ab76..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/*--------------------------------------------------------------------------
- ** This file is autogenerated from config.h.in 
- ** during the cmake configuration of your project. If you need to make changes
- ** edit the original file NOT THIS FILE.
- ** --------------------------------------------------------------------------*/
-#ifndef _CONFIGURATION_HEADER_GUARD_H_
-#define _CONFIGURATION_HEADER_GUARD_H_
-
-#define SIZEOF_INT @SIZEOF_INT@
-#cmakedefine HAVE_LIMITS_H @HAVE_LIMITS_H@
-#cmakedefine HAVE_STDINT_H @HAVE_STDINT_H@
-#cmakedefine HAVE_STDDEF_H @HAVE_STDDEF_H@
-#cmakedefine HAVE_STDLIB_H @HAVE_STDLIB_H@
-#cmakedefine HAVE_STRING_H @HAVE_STRING_H@
-#cmakedefine HAVE_FLOOR @HAVE_FLOOR@
-#cmakedefine HAVE_MEMSET @HAVE_MEMSET@
-#cmakedefine HAVE_POW @HAVE_POW@
-#cmakedefine HAVE_SQRT @HAVE_SQRT@
-#endif
diff --git a/fdmdv2/branches/0.99/cmake/version.h.in b/fdmdv2/branches/0.99/cmake/version.h.in
deleted file mode 100644 (file)
index 43b3b7a..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef FREEDV_VER_DOT_H
-#define FREEDV_VER_DOT_H 1
-
-#define FREEDV_VERSION_MAJOR @FREEDV_VERSION_MAJOR@
-#define FREEDV_VERSION_MINOR @FREEDV_VERSION_MINOR@
-#define FREEDV_VERSION_PATCH @FREEDV_VERSION_PATCH@
-#define FREEDV_VERSION_SUFFIX "@FREEDV_VERSION_SUFFIX@"
-
-#define FREEDV_VERSION "@FREEDV_VERSION_STRING@"
-
-#endif //FREEDV_VER_DOT_H
diff --git a/fdmdv2/branches/0.99/contrib/CMakeLists.txt b/fdmdv2/branches/0.99/contrib/CMakeLists.txt
deleted file mode 100644 (file)
index 3f4b7e0..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-# Install icons if we're on most *nix systems.
-if(UNIX AND NOT APPLE)
-    set(ICON_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor
-        CACHE PATH "Prefix to use for installing icons.")
-    install(FILES freedv48x48.png
-        DESTINATION ${ICON_INSTALL_PREFIX}/48x48/apps
-        RENAME freedv.png)
-    install(FILES freedv64x64.png
-        DESTINATION ${ICON_INSTALL_PREFIX}/64x64/apps
-        RENAME freedv.png)
-    install(FILES freedv128x128.png
-        DESTINATION ${ICON_INSTALL_PREFIX}/128x128/apps
-        RENAME freedv.png)
-    install(FILES freedv256x256.png
-        DESTINATION ${ICON_INSTALL_PREFIX}/256x256/apps
-        RENAME freedv.png)
-
-    set(DESKTOP_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/applications
-        CACHE PATH "Location to install desktop files.")
-    install(FILES freedv.desktop
-        DESTINATION ${DESKTOP_INSTALL_DIR})
-endif(UNIX AND NOT APPLE)
diff --git a/fdmdv2/branches/0.99/contrib/LICENSE b/fdmdv2/branches/0.99/contrib/LICENSE
deleted file mode 100644 (file)
index dc8853a..0000000
+++ /dev/null
@@ -1,393 +0,0 @@
-Attribution 4.0 International
-
-=======================================================================
-
-Creative Commons Corporation ("Creative Commons") is not a law firm and
-does not provide legal services or legal advice. Distribution of
-Creative Commons public licenses does not create a lawyer-client or
-other relationship. Creative Commons makes its licenses and related
-information available on an "as-is" basis. Creative Commons gives no
-warranties regarding its licenses, any material licensed under their
-terms and conditions, or any related information. Creative Commons
-disclaims all liability for damages resulting from their use to the
-fullest extent possible.
-
-Using Creative Commons Public Licenses
-
-Creative Commons public licenses provide a standard set of terms and
-conditions that creators and other rights holders may use to share
-original works of authorship and other material subject to copyright
-and certain other rights specified in the public license below. The
-following considerations are for informational purposes only, are not
-exhaustive, and do not form part of our licenses.
-
-     Considerations for licensors: Our public licenses are
-     intended for use by those authorized to give the public
-     permission to use material in ways otherwise restricted by
-     copyright and certain other rights. Our licenses are
-     irrevocable. Licensors should read and understand the terms
-     and conditions of the license they choose before applying it.
-     Licensors should also secure all rights necessary before
-     applying our licenses so that the public can reuse the
-     material as expected. Licensors should clearly mark any
-     material not subject to the license. This includes other CC-
-     licensed material, or material used under an exception or
-     limitation to copyright. More considerations for licensors:
-       wiki.creativecommons.org/Considerations_for_licensors
-
-     Considerations for the public: By using one of our public
-     licenses, a licensor grants the public permission to use the
-     licensed material under specified terms and conditions. If
-     the licensor's permission is not necessary for any reason--for
-     example, because of any applicable exception or limitation to
-     copyright--then that use is not regulated by the license. Our
-     licenses grant only permissions under copyright and certain
-     other rights that a licensor has authority to grant. Use of
-     the licensed material may still be restricted for other
-     reasons, including because others have copyright or other
-     rights in the material. A licensor may make special requests,
-     such as asking that all changes be marked or described.
-     Although not required by our licenses, you are encouraged to
-     respect those requests where reasonable. More_considerations
-     for the public: 
-       wiki.creativecommons.org/Considerations_for_licensees
-
-=======================================================================
-
-Creative Commons Attribution 4.0 International Public License
-
-By exercising the Licensed Rights (defined below), You accept and agree
-to be bound by the terms and conditions of this Creative Commons
-Attribution 4.0 International Public License ("Public License"). To the
-extent this Public License may be interpreted as a contract, You are
-granted the Licensed Rights in consideration of Your acceptance of
-these terms and conditions, and the Licensor grants You such rights in
-consideration of benefits the Licensor receives from making the
-Licensed Material available under these terms and conditions.
-
-
-Section 1 -- Definitions.
-
-  a. Adapted Material means material subject to Copyright and Similar
-     Rights that is derived from or based upon the Licensed Material
-     and in which the Licensed Material is translated, altered,
-     arranged, transformed, or otherwise modified in a manner requiring
-     permission under the Copyright and Similar Rights held by the
-     Licensor. For purposes of this Public License, where the Licensed
-     Material is a musical work, performance, or sound recording,
-     Adapted Material is always produced where the Licensed Material is
-     synched in timed relation with a moving image.
-
-  b. Adapter's License means the license You apply to Your Copyright
-     and Similar Rights in Your contributions to Adapted Material in
-     accordance with the terms and conditions of this Public License.
-
-  c. Copyright and Similar Rights means copyright and/or similar rights
-     closely related to copyright including, without limitation,
-     performance, broadcast, sound recording, and Sui Generis Database
-     Rights, without regard to how the rights are labeled or
-     categorized. For purposes of this Public License, the rights
-     specified in Section 2(b)(1)-(2) are not Copyright and Similar
-     Rights.
-
-  d. Effective Technological Measures means those measures that, in the
-     absence of proper authority, may not be circumvented under laws
-     fulfilling obligations under Article 11 of the WIPO Copyright
-     Treaty adopted on December 20, 1996, and/or similar international
-     agreements.
-
-  e. Exceptions and Limitations means fair use, fair dealing, and/or
-     any other exception or limitation to Copyright and Similar Rights
-     that applies to Your use of the Licensed Material.
-
-  f. Licensed Material means the artistic or literary work, database,
-     or other material to which the Licensor applied this Public
-     License.
-
-  g. Licensed Rights means the rights granted to You subject to the
-     terms and conditions of this Public License, which are limited to
-     all Copyright and Similar Rights that apply to Your use of the
-     Licensed Material and that the Licensor has authority to license.
-
-  h. Licensor means the individual(s) or entity(ies) granting rights
-     under this Public License.
-
-  i. Share means to provide material to the public by any means or
-     process that requires permission under the Licensed Rights, such
-     as reproduction, public display, public performance, distribution,
-     dissemination, communication, or importation, and to make material
-     available to the public including in ways that members of the
-     public may access the material from a place and at a time
-     individually chosen by them.
-
-  j. Sui Generis Database Rights means rights other than copyright
-     resulting from Directive 96/9/EC of the European Parliament and of
-     the Council of 11 March 1996 on the legal protection of databases,
-     as amended and/or succeeded, as well as other essentially
-     equivalent rights anywhere in the world.
-
-  k. You means the individual or entity exercising the Licensed Rights
-     under this Public License. Your has a corresponding meaning.
-
-
-Section 2 -- Scope.
-
-  a. License grant.
-
-       1. Subject to the terms and conditions of this Public License,
-          the Licensor hereby grants You a worldwide, royalty-free,
-          non-sublicensable, non-exclusive, irrevocable license to
-          exercise the Licensed Rights in the Licensed Material to:
-
-            a. reproduce and Share the Licensed Material, in whole or
-               in part; and
-
-            b. produce, reproduce, and Share Adapted Material.
-
-       2. Exceptions and Limitations. For the avoidance of doubt, where
-          Exceptions and Limitations apply to Your use, this Public
-          License does not apply, and You do not need to comply with
-          its terms and conditions.
-
-       3. Term. The term of this Public License is specified in Section
-          6(a).
-
-       4. Media and formats; technical modifications allowed. The
-          Licensor authorizes You to exercise the Licensed Rights in
-          all media and formats whether now known or hereafter created,
-          and to make technical modifications necessary to do so. The
-          Licensor waives and/or agrees not to assert any right or
-          authority to forbid You from making technical modifications
-          necessary to exercise the Licensed Rights, including
-          technical modifications necessary to circumvent Effective
-          Technological Measures. For purposes of this Public License,
-          simply making modifications authorized by this Section 2(a)
-          (4) never produces Adapted Material.
-
-       5. Downstream recipients.
-
-            a. Offer from the Licensor -- Licensed Material. Every
-               recipient of the Licensed Material automatically
-               receives an offer from the Licensor to exercise the
-               Licensed Rights under the terms and conditions of this
-               Public License.
-
-            b. No downstream restrictions. You may not offer or impose
-               any additional or different terms or conditions on, or
-               apply any Effective Technological Measures to, the
-               Licensed Material if doing so restricts exercise of the
-               Licensed Rights by any recipient of the Licensed
-               Material.
-
-       6. No endorsement. Nothing in this Public License constitutes or
-          may be construed as permission to assert or imply that You
-          are, or that Your use of the Licensed Material is, connected
-          with, or sponsored, endorsed, or granted official status by,
-          the Licensor or others designated to receive attribution as
-          provided in Section 3(a)(1)(A)(i).
-
-  b. Other rights.
-
-       1. Moral rights, such as the right of integrity, are not
-          licensed under this Public License, nor are publicity,
-          privacy, and/or other similar personality rights; however, to
-          the extent possible, the Licensor waives and/or agrees not to
-          assert any such rights held by the Licensor to the limited
-          extent necessary to allow You to exercise the Licensed
-          Rights, but not otherwise.
-
-       2. Patent and trademark rights are not licensed under this
-          Public License.
-
-       3. To the extent possible, the Licensor waives any right to
-          collect royalties from You for the exercise of the Licensed
-          Rights, whether directly or through a collecting society
-          under any voluntary or waivable statutory or compulsory
-          licensing scheme. In all other cases the Licensor expressly
-          reserves any right to collect such royalties.
-
-
-Section 3 -- License Conditions.
-
-Your exercise of the Licensed Rights is expressly made subject to the
-following conditions.
-
-  a. Attribution.
-
-       1. If You Share the Licensed Material (including in modified
-          form), You must:
-
-            a. retain the following if it is supplied by the Licensor
-               with the Licensed Material:
-
-                 i. identification of the creator(s) of the Licensed
-                    Material and any others designated to receive
-                    attribution, in any reasonable manner requested by
-                    the Licensor (including by pseudonym if
-                    designated);
-
-                ii. a copyright notice;
-
-               iii. a notice that refers to this Public License;
-
-                iv. a notice that refers to the disclaimer of
-                    warranties;
-
-                 v. a URI or hyperlink to the Licensed Material to the
-                    extent reasonably practicable;
-
-            b. indicate if You modified the Licensed Material and
-               retain an indication of any previous modifications; and
-
-            c. indicate the Licensed Material is licensed under this
-               Public License, and include the text of, or the URI or
-               hyperlink to, this Public License.
-
-       2. You may satisfy the conditions in Section 3(a)(1) in any
-          reasonable manner based on the medium, means, and context in
-          which You Share the Licensed Material. For example, it may be
-          reasonable to satisfy the conditions by providing a URI or
-          hyperlink to a resource that includes the required
-          information.
-
-       3. If requested by the Licensor, You must remove any of the
-          information required by Section 3(a)(1)(A) to the extent
-          reasonably practicable.
-
-       4. If You Share Adapted Material You produce, the Adapter's
-          License You apply must not prevent recipients of the Adapted
-          Material from complying with this Public License.
-
-
-Section 4 -- Sui Generis Database Rights.
-
-Where the Licensed Rights include Sui Generis Database Rights that
-apply to Your use of the Licensed Material:
-
-  a. for the avoidance of doubt, Section 2(a)(1) grants You the right
-     to extract, reuse, reproduce, and Share all or a substantial
-     portion of the contents of the database;
-
-  b. if You include all or a substantial portion of the database
-     contents in a database in which You have Sui Generis Database
-     Rights, then the database in which You have Sui Generis Database
-     Rights (but not its individual contents) is Adapted Material; and
-
-  c. You must comply with the conditions in Section 3(a) if You Share
-     all or a substantial portion of the contents of the database.
-
-For the avoidance of doubt, this Section 4 supplements and does not
-replace Your obligations under this Public License where the Licensed
-Rights include other Copyright and Similar Rights.
-
-
-Section 5 -- Disclaimer of Warranties and Limitation of Liability.
-
-  a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
-     EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
-     AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
-     ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
-     IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
-     WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
-     PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
-     ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
-     KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
-     ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
-
-  b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
-     TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
-     NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
-     INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
-     COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
-     USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
-     ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
-     DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
-     IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
-
-  c. The disclaimer of warranties and limitation of liability provided
-     above shall be interpreted in a manner that, to the extent
-     possible, most closely approximates an absolute disclaimer and
-     waiver of all liability.
-
-
-Section 6 -- Term and Termination.
-
-  a. This Public License applies for the term of the Copyright and
-     Similar Rights licensed here. However, if You fail to comply with
-     this Public License, then Your rights under this Public License
-     terminate automatically.
-
-  b. Where Your right to use the Licensed Material has terminated under
-     Section 6(a), it reinstates:
-
-       1. automatically as of the date the violation is cured, provided
-          it is cured within 30 days of Your discovery of the
-          violation; or
-
-       2. upon express reinstatement by the Licensor.
-
-     For the avoidance of doubt, this Section 6(b) does not affect any
-     right the Licensor may have to seek remedies for Your violations
-     of this Public License.
-
-  c. For the avoidance of doubt, the Licensor may also offer the
-     Licensed Material under separate terms or conditions or stop
-     distributing the Licensed Material at any time; however, doing so
-     will not terminate this Public License.
-
-  d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
-     License.
-
-
-Section 7 -- Other Terms and Conditions.
-
-  a. The Licensor shall not be bound by any additional or different
-     terms or conditions communicated by You unless expressly agreed.
-
-  b. Any arrangements, understandings, or agreements regarding the
-     Licensed Material not stated herein are separate from and
-     independent of the terms and conditions of this Public License.
-
-
-Section 8 -- Interpretation.
-
-  a. For the avoidance of doubt, this Public License does not, and
-     shall not be interpreted to, reduce, limit, restrict, or impose
-     conditions on any use of the Licensed Material that could lawfully
-     be made without permission under this Public License.
-
-  b. To the extent possible, if any provision of this Public License is
-     deemed unenforceable, it shall be automatically reformed to the
-     minimum extent necessary to make it enforceable. If the provision
-     cannot be reformed, it shall be severed from this Public License
-     without affecting the enforceability of the remaining terms and
-     conditions.
-
-  c. No term or condition of this Public License will be waived and no
-     failure to comply consented to unless expressly agreed to by the
-     Licensor.
-
-  d. Nothing in this Public License constitutes or may be interpreted
-     as a limitation upon, or waiver of, any privileges and immunities
-     that apply to the Licensor or You, including from the legal
-     processes of any jurisdiction or authority.
-
-
-=======================================================================
-
-Creative Commons is not a party to its public licenses.
-Notwithstanding, Creative Commons may elect to apply one of its public
-licenses to material it publishes and in those instances will be
-considered the "Licensor." Except for the limited purpose of indicating
-that material is shared under a Creative Commons public license or as
-otherwise permitted by the Creative Commons policies published at
-creativecommons.org/policies, Creative Commons does not authorize the
-use of the trademark "Creative Commons" or any other trademark or logo
-of Creative Commons without its prior written consent including,
-without limitation, in connection with any unauthorized modifications
-to any of its public licenses or any other arrangements,
-understandings, or agreements concerning use of licensed material. For
-the avoidance of doubt, this paragraph does not form part of the public
-licenses.
-
-Creative Commons may be contacted at creativecommons.org.
diff --git a/fdmdv2/branches/0.99/contrib/freedv.desktop b/fdmdv2/branches/0.99/contrib/freedv.desktop
deleted file mode 100644 (file)
index 96e8293..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-[Desktop Entry]
-Version=1.0
-Name=FreeDV
-Exec=freedv
-Icon=freedv
-Type=Application
-Terminal=false
-Categories=GTK;GNOME;AudioVideo;Audio;HamRadio;
diff --git a/fdmdv2/branches/0.99/contrib/freedv.ico b/fdmdv2/branches/0.99/contrib/freedv.ico
deleted file mode 100644 (file)
index e6b9a20..0000000
Binary files a/fdmdv2/branches/0.99/contrib/freedv.ico and /dev/null differ
diff --git a/fdmdv2/branches/0.99/contrib/freedv.rc b/fdmdv2/branches/0.99/contrib/freedv.rc
deleted file mode 100644 (file)
index 2e6655d..0000000
+++ /dev/null
@@ -1 +0,0 @@
-id ICON "./freedv.ico"
diff --git a/fdmdv2/branches/0.99/contrib/freedv128x128.png b/fdmdv2/branches/0.99/contrib/freedv128x128.png
deleted file mode 100644 (file)
index 5190a77..0000000
Binary files a/fdmdv2/branches/0.99/contrib/freedv128x128.png and /dev/null differ
diff --git a/fdmdv2/branches/0.99/contrib/freedv256x256.png b/fdmdv2/branches/0.99/contrib/freedv256x256.png
deleted file mode 100644 (file)
index b3eb5d7..0000000
Binary files a/fdmdv2/branches/0.99/contrib/freedv256x256.png and /dev/null differ
diff --git a/fdmdv2/branches/0.99/contrib/freedv48x48.png b/fdmdv2/branches/0.99/contrib/freedv48x48.png
deleted file mode 100644 (file)
index bd5efc6..0000000
Binary files a/fdmdv2/branches/0.99/contrib/freedv48x48.png and /dev/null differ
diff --git a/fdmdv2/branches/0.99/contrib/freedv64x64.png b/fdmdv2/branches/0.99/contrib/freedv64x64.png
deleted file mode 100644 (file)
index eb89773..0000000
Binary files a/fdmdv2/branches/0.99/contrib/freedv64x64.png and /dev/null differ
diff --git a/fdmdv2/branches/0.99/credits.txt b/fdmdv2/branches/0.99/credits.txt
deleted file mode 100644 (file)
index 431e399..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-Credits (code or ideas borrowed from):
-==============================================
-Dave Witten and David Rowe (obviously)
-Mel Whitten K0PFX (material and moral support)
-Bruce Perens (cheerleader, promotion and publicity)
-Mooneer Salem KG6AOV(Mac OSX Patch)
-Soeren Straarup OZ2DAK (FreeBSD Port)
-Don Mak
-Steve Nance (K5FR)
-Joel Stanley (Hamlib prototyping) and Mark Jessop (Mac OSX) 
-James Ahlstrom (Quisk)
-FLDIGI
-All the folks on the digital voice google group...
diff --git a/fdmdv2/branches/0.99/db/current b/fdmdv2/branches/0.99/db/current
deleted file mode 100644 (file)
index d00491f..0000000
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/fdmdv2/branches/0.99/db/format b/fdmdv2/branches/0.99/db/format
deleted file mode 100644 (file)
index db06890..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-4
-layout sharded 1000
diff --git a/fdmdv2/branches/0.99/db/fs-type b/fdmdv2/branches/0.99/db/fs-type
deleted file mode 100644 (file)
index 4fdd953..0000000
+++ /dev/null
@@ -1 +0,0 @@
-fsfs
diff --git a/fdmdv2/branches/0.99/db/fsfs.conf b/fdmdv2/branches/0.99/db/fsfs.conf
deleted file mode 100644 (file)
index cc08ceb..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-### This file controls the configuration of the FSFS filesystem.\r
-\r
-[memcached-servers]\r
-### These options name memcached servers used to cache internal FSFS\r
-### data.  See http://www.danga.com/memcached/ for more information on\r
-### memcached.  To use memcached with FSFS, run one or more memcached\r
-### servers, and specify each of them as an option like so:\r
-# first-server = 127.0.0.1:11211\r
-# remote-memcached = mymemcached.corp.example.com:11212\r
-### The option name is ignored; the value is of the form HOST:PORT.\r
-### memcached servers can be shared between multiple repositories;\r
-### however, if you do this, you *must* ensure that repositories have\r
-### distinct UUIDs and paths, or else cached data from one repository\r
-### might be used by another accidentally.  Note also that memcached has\r
-### no authentication for reads or writes, so you must ensure that your\r
-### memcached servers are only accessible by trusted users.\r
-\r
-[caches]\r
-### When a cache-related error occurs, normally Subversion ignores it\r
-### and continues, logging an error if the server is appropriately\r
-### configured (and ignoring it with file:// access).  To make\r
-### Subversion never ignore cache errors, uncomment this line.\r
-# fail-stop = true\r
-\r
-[rep-sharing]\r
-### To conserve space, the filesystem can optionally avoid storing\r
-### duplicate representations.  This comes at a slight cost in\r
-### performance, as maintaining a database of shared representations can\r
-### increase commit times.  The space savings are dependent upon the size\r
-### of the repository, the number of objects it contains and the amount of\r
-### duplication between them, usually a function of the branching and\r
-### merging process.\r
-###\r
-### The following parameter enables rep-sharing in the repository.  It can\r
-### be switched on and off at will, but for best space-saving results\r
-### should be enabled consistently over the life of the repository.\r
-### rep-sharing is enabled by default.\r
-# enable-rep-sharing = true\r
diff --git a/fdmdv2/branches/0.99/db/min-unpacked-rev b/fdmdv2/branches/0.99/db/min-unpacked-rev
deleted file mode 100644 (file)
index 573541a..0000000
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/fdmdv2/branches/0.99/db/rep-cache.db b/fdmdv2/branches/0.99/db/rep-cache.db
deleted file mode 100644 (file)
index 63c6f0b..0000000
Binary files a/fdmdv2/branches/0.99/db/rep-cache.db and /dev/null differ
diff --git a/fdmdv2/branches/0.99/db/revprops/0/0 b/fdmdv2/branches/0.99/db/revprops/0/0
deleted file mode 100644 (file)
index d0b90de..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-K 8
-svn:date
-V 27
-2012-08-21T18:27:59.389906Z
-END
diff --git a/fdmdv2/branches/0.99/db/revprops/0/1 b/fdmdv2/branches/0.99/db/revprops/0/1
deleted file mode 100644 (file)
index 0af71a2..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-K 10
-svn:author
-V 9
-OFA-Staff
-K 8
-svn:date
-V 27
-2012-08-21T18:28:08.741468Z
-K 7
-svn:log
-V 25
-Imported folder structure
-END
diff --git a/fdmdv2/branches/0.99/db/revs/0/0 b/fdmdv2/branches/0.99/db/revs/0/0
deleted file mode 100644 (file)
index 10f5c45..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-PLAIN
-END
-ENDREP
-id: 0.0.r0/17
-type: dir
-count: 0
-text: 0 0 4 4 2d2977d1c96f487abe4a1e202dd03b4e
-cpath: /
-
-
-17 107
diff --git a/fdmdv2/branches/0.99/db/revs/0/1 b/fdmdv2/branches/0.99/db/revs/0/1
deleted file mode 100644 (file)
index fd802a9..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-id: 3-1.0.r1/0
-type: dir
-count: 0
-cpath: /tags
-copyroot: 0 /
-
-id: 0-1.0.r1/62
-type: dir
-count: 0
-cpath: /trunk
-copyroot: 0 /
-
-id: 2-1.0.r1/126
-type: dir
-count: 0
-cpath: /branches
-copyroot: 0 /
-
-PLAIN
-K 8
-branches
-V 16
-dir 2-1.0.r1/126
-K 4
-tags
-V 14
-dir 3-1.0.r1/0
-K 5
-trunk
-V 15
-dir 0-1.0.r1/62
-END
-ENDREP
-id: 0.0.r1/306
-type: dir
-pred: 0.0.r0/17
-count: 1
-text: 1 194 99 99 7b6cc14dddba4e09be5255b475d1a0a8
-cpath: /
-copyroot: 0 /
-
-_0.0.t0-0 add-dir false false /trunk
-
-_2.0.t0-0 add-dir false false /branches
-
-_3.0.t0-0 add-dir false false /tags
-
-
-306 431
diff --git a/fdmdv2/branches/0.99/db/transactions/.gitignore b/fdmdv2/branches/0.99/db/transactions/.gitignore
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/fdmdv2/branches/0.99/db/txn-current b/fdmdv2/branches/0.99/db/txn-current
deleted file mode 100644 (file)
index d00491f..0000000
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/fdmdv2/branches/0.99/db/txn-current-lock b/fdmdv2/branches/0.99/db/txn-current-lock
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/fdmdv2/branches/0.99/db/txn-protorevs/.gitignore b/fdmdv2/branches/0.99/db/txn-protorevs/.gitignore
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/fdmdv2/branches/0.99/db/uuid b/fdmdv2/branches/0.99/db/uuid
deleted file mode 100644 (file)
index 0f36297..0000000
+++ /dev/null
@@ -1 +0,0 @@
-a56d66ce-6468-4744-9be7-52ce95ca47a4
diff --git a/fdmdv2/branches/0.99/db/write-lock b/fdmdv2/branches/0.99/db/write-lock
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/fdmdv2/branches/0.99/src/CMakeLists.txt b/fdmdv2/branches/0.99/src/CMakeLists.txt
deleted file mode 100644 (file)
index 44ccfe7..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-set(FREEDV_SOURCES
-    dlg_audiooptions.cpp
-    dlg_filter.cpp
-    dlg_options.cpp
-    dlg_ptt.cpp
-    fdmdv2_main.cpp
-    fdmdv2_pa_wrapper.cpp
-    fdmdv2_plot.cpp
-    fdmdv2_plot_scalar.cpp
-    fdmdv2_plot_scatter.cpp
-    fdmdv2_plot_spectrum.cpp
-    fdmdv2_plot_waterfall.cpp
-    hamlib.cpp
-    topFrame.cpp
-    sox_biquad.c
-    comp.h
-    dlg_audiooptions.h
-    dlg_filter.h
-    dlg_options.h
-    dlg_ptt.h
-    fdmdv2_defines.h
-    fdmdv2_main.h
-    fdmdv2_pa_wrapper.h
-    fdmdv2_plot.h
-    fdmdv2_plot_scalar.h
-    fdmdv2_plot_scatter.h
-    fdmdv2_plot_spectrum.h
-    fdmdv2_plot_waterfall.h
-    hamlib.h
-    sox_biquad.h
-    sox.h
-    topFrame.h
-    version.h
-)
-
-# WIN32 is needed for Windows GUI apps and is ignored for UNIX like systems.
-add_executable(freedv WIN32 ${FREEDV_SOURCES} ${RES_FILES})
-target_link_libraries(freedv ${FREEDV_LINK_LIBS})
-include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
-if(FREEDV_STATIC_DEPS)
-    add_dependencies(freedv ${FREEDV_STATIC_DEPS})
-endif(FREEDV_STATIC_DEPS)
-install(TARGETS freedv
-    RUNTIME DESTINATION bin)
diff --git a/fdmdv2/branches/0.99/src/Makefile.win32 b/fdmdv2/branches/0.99/src/Makefile.win32
deleted file mode 100644 (file)
index 932e851..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-# src/Makefile.win32
-# David Rowe 26 Oct 2012
-#
-# Makefile for Win32 on msys/Mingw to help David R get up to speed
-#
-# $ make -f Makefile.Win32
-
-CODEC2_PATH=$(HOME)/codec2-dev
-INCLUDE_PATH=/usr/local/include
-
-WX_CONFIG=wx-config
-WX_CPPFLAGS = $(shell $(WX_CONFIG) --cxxflags) -D__WXDEBUG__
-WX_LIBS = $(shell $(WX_CONFIG) --libs core, base, aui, adv, net)
-SVN_REVISION=$(shell svnversion)
-CODEC2_INC=$(CODEC2_PATH)/src 
-CODEC2_LIB=$(CODEC2_PATH)/build_win32/src/
-
-CPP_FLAGS = -D_NO_AUTOTOOLS_ -I$(INCLUDE_PATH) $(WX_CPPFLAGS) -I$(CODEC2_INC) -I../extern/include -I. -g -Wall -DSVN_REVISION=\"$(SVN_REVISION)\"
-LIBS = $(WX_LIBS) -L$(CODEC2_LIB) -lcodec2 -lm -lportaudiocpp -lportaudio -lpthread -lsndfile -lsamplerate -lhamlib -lsox -lspeexdsp
-
-OBJS = topFrame.o \
-fdmdv2_main.o \
-fdmdv2_plot.o \
-fdmdv2_plot_scalar.o \
-fdmdv2_plot_scatter.o \
-fdmdv2_plot_spectrum.o \
-fdmdv2_plot_waterfall.o \
-fdmdv2_pa_wrapper.o \
-dlg_audiooptions.o \
-dlg_ptt.o \
-dlg_options.o \
-dlg_filter.o \
-sox_biquad.o \
-hamlib.o \
-../../codec2-dev/src/golay23.o
-
-HDRS = version.h dlg_audiooptions.h dlg_ptt.h dlg_filter.h fdmdv2_main.h fdmdv2_defines.h fdmdv2_plot.h fdmdv2_plot_scalar.h fdmdv2_plot_waterfall.h fdmdv2_plot_scatter.h fdmdv2_plot_spectrum.h fdmdv2_pa_wrapper.h topFrame.h dlg_audiooptions.h topFrame.h varicode.h ../../codec2-dev/src/golay23.h hamlib.h
-
-all: freedv
-
-freedv: $(OBJS) 
-       g++ -o freedv $(OBJS) $(CPP_FLAGS) $(LIBS)
-
-%.o: %.cpp $(HDRS) Makefile.win32
-       g++ $(CPP_FLAGS) -c $< -o $@
-
-%.o: %.c $(HDRS) Makefile.win32
-       gcc $(CPP_FLAGS) -c $< -o $@
-
-clean:
-       rm -f *.o fdmdv2
-
diff --git a/fdmdv2/branches/0.99/src/comp.h b/fdmdv2/branches/0.99/src/comp.h
deleted file mode 100644 (file)
index a3a1bd9..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*---------------------------------------------------------------------------*\
-
-  FILE........: comp.h
-  AUTHOR......: David Rowe
-  DATE CREATED: 24/08/09
-
-  Complex number definition.
-
-\*---------------------------------------------------------------------------*/
-
-/*
-  Copyright (C) 2009 David Rowe
-
-  All rights reserved.
-
-  This program is free software; you can redistribute it and/or modify
-  it under the terms of the GNU Lesser 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 Lesser General Public License
-  along with this program; if not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef __COMP__
-#define __COMP__
-
-/* Complex number */
-
-typedef struct
-{
-    float real;
-    float imag;
-} COMP;
-
-#endif
diff --git a/fdmdv2/branches/0.99/src/dlg_audiooptions.cpp b/fdmdv2/branches/0.99/src/dlg_audiooptions.cpp
deleted file mode 100644 (file)
index 7d23a08..0000000
+++ /dev/null
@@ -1,1264 +0,0 @@
-//=========================================================================
-// Name:            AudioOptsDialog.cpp
-// Purpose:         Implements an Audio options selection dialog.
-//
-// Authors:         David Rowe, David Witten
-// License:
-//
-//  All rights reserved.
-//
-//  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 <http://www.gnu.org/licenses/>.
-//
-//=========================================================================
-#include "fdmdv2_main.h"
-#include "dlg_audiooptions.h"
-
-// constants for test waveform plots
-
-#define TEST_WAVEFORM_X          180
-#define TEST_WAVEFORM_Y          180
-#define TEST_WAVEFORM_PLOT_TIME  2.0
-#define TEST_WAVEFORM_PLOT_FS    400
-#define TEST_BUF_SIZE           1024
-#define TEST_FS                 48000.0
-#define TEST_DT                 0.1      // time between plot updates in seconds
-#define TEST_WAVEFORM_PLOT_BUF  ((int)(DT*400))
-
-void AudioOptsDialog::Pa_Init(void)
-{
-    m_isPaInitialized = false;
-
-    if((pa_err = Pa_Initialize()) == paNoError)
-    {
-        m_isPaInitialized = true;
-    }
-    else
-    {
-        wxMessageBox(wxT("Port Audio failed to initialize"), wxT("Pa_Initialize"), wxOK);
-        return;
-    }
-}
-
-
-void AudioOptsDialog::buildTestControls(PlotScalar **plotScalar, wxButton **btnTest, 
-                                        wxPanel *parentPanel, wxBoxSizer *bSizer, wxString buttonLabel)
-{
-    wxBoxSizer* bSizer1 = new wxBoxSizer(wxVERTICAL);
-
-    wxPanel *panel = new wxPanel(parentPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0);
-    *plotScalar = new PlotScalar((wxFrame*) panel, 1, TEST_WAVEFORM_PLOT_TIME, 1.0/TEST_WAVEFORM_PLOT_FS, -1, 1, 1, 0.2, "", 1);
-    (*plotScalar)->SetClientSize(wxSize(TEST_WAVEFORM_X,TEST_WAVEFORM_Y));
-    bSizer1->Add(panel, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 8);
-
-    *btnTest = new wxButton(parentPanel, wxID_ANY, buttonLabel, wxDefaultPosition, wxDefaultSize);
-    bSizer1->Add(*btnTest, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 0);
-
-    bSizer->Add(bSizer1, 0, wxALIGN_CENTER_HORIZONTAL |wxALIGN_CENTER_VERTICAL );
-}
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// AudioOptsDialog()
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-AudioOptsDialog::AudioOptsDialog(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style)
-{
-    this->SetSizeHints(wxSize(850, 600), wxDefaultSize);
-
-    Pa_Init();
-
-    wxBoxSizer* mainSizer;
-    mainSizer = new wxBoxSizer(wxVERTICAL);
-    m_panel1 = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
-    wxBoxSizer* bSizer4;
-    bSizer4 = new wxBoxSizer(wxVERTICAL);
-    m_notebook1 = new wxNotebook(m_panel1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxNB_BOTTOM);
-    m_panelRx = new wxPanel(m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
-    wxBoxSizer* bSizer20;
-    bSizer20 = new wxBoxSizer(wxVERTICAL);
-    wxGridSizer* gSizer4;
-    gSizer4 = new wxGridSizer(2, 1, 0, 0);
-
-    // Rx In -----------------------------------------------------------------------
-
-    wxStaticBoxSizer* sbSizer2;
-    sbSizer2 = new wxStaticBoxSizer(new wxStaticBox(m_panelRx, wxID_ANY, _("From Radio")), wxHORIZONTAL);
-
-    wxBoxSizer* bSizer811a = new wxBoxSizer(wxVERTICAL);
-
-    m_listCtrlRxInDevices = new wxListCtrl(m_panelRx, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VRULES);
-    bSizer811a->Add(m_listCtrlRxInDevices, 1, wxALL|wxEXPAND, 1);
-
-    wxBoxSizer* bSizer811;
-    bSizer811 = new wxBoxSizer(wxHORIZONTAL);
-    m_staticText51 = new wxStaticText(m_panelRx, wxID_ANY, _("Device:"), wxDefaultPosition, wxDefaultSize, 0);
-    m_staticText51->Wrap(-1);
-    bSizer811->Add(m_staticText51, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5);
-    m_textCtrlRxIn = new wxTextCtrl(m_panelRx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
-    bSizer811->Add(m_textCtrlRxIn, 1, wxALIGN_CENTER_VERTICAL|wxALL, 1);
-    m_staticText6 = new wxStaticText(m_panelRx, wxID_ANY, _("Sample Rate:"), wxDefaultPosition, wxDefaultSize, 0);
-    m_staticText6->Wrap(-1);
-    bSizer811->Add(m_staticText6, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5);
-    m_cbSampleRateRxIn = new wxComboBox(m_panelRx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(90,-1), 0, NULL, wxCB_DROPDOWN);
-    bSizer811->Add(m_cbSampleRateRxIn, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1);
-
-    bSizer811a->Add(bSizer811, 0, wxEXPAND, 5);
-
-    sbSizer2->Add(bSizer811a, 1, wxEXPAND, 2);
-    buildTestControls(&m_plotScalarRxIn, &m_btnRxInTest, m_panelRx, sbSizer2, _("Rec 2s"));
-
-    gSizer4->Add(sbSizer2, 1, wxEXPAND, 5);
-
-    // Rx Out -----------------------------------------------------------------------
-
-    wxStaticBoxSizer* sbSizer3;
-    sbSizer3 = new wxStaticBoxSizer(new wxStaticBox(m_panelRx, wxID_ANY, _("To Speaker/Headphones")), wxHORIZONTAL);
-
-    wxBoxSizer* bSizer81a = new wxBoxSizer(wxVERTICAL);
-
-    m_listCtrlRxOutDevices = new wxListCtrl(m_panelRx, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VRULES);
-    bSizer81a->Add(m_listCtrlRxOutDevices, 1, wxALL|wxEXPAND, 1);
-
-    wxBoxSizer* bSizer81;
-    bSizer81 = new wxBoxSizer(wxHORIZONTAL);
-    m_staticText9 = new wxStaticText(m_panelRx, wxID_ANY, _("Device:"), wxDefaultPosition, wxDefaultSize, 0);
-    m_staticText9->Wrap(-1);
-    bSizer81->Add(m_staticText9, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
-    m_textCtrlRxOut = new wxTextCtrl(m_panelRx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
-    bSizer81->Add(m_textCtrlRxOut, 1, wxALIGN_CENTER_VERTICAL|wxALL, 1);
-    m_staticText10 = new wxStaticText(m_panelRx, wxID_ANY, _("Sample Rate:"), wxDefaultPosition, wxDefaultSize, 0);
-    m_staticText10->Wrap(-1);
-    bSizer81->Add(m_staticText10, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5);
-    m_cbSampleRateRxOut = new wxComboBox(m_panelRx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(90,-1), 0, NULL, wxCB_DROPDOWN);
-    bSizer81->Add(m_cbSampleRateRxOut, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1);
-
-    bSizer81a->Add(bSizer81, 0, wxEXPAND, 5);
-
-    sbSizer3->Add(bSizer81a, 1, wxEXPAND, 2);
-    buildTestControls(&m_plotScalarRxOut, &m_btnRxOutTest, m_panelRx, sbSizer3, _("Play 2s"));
-    gSizer4->Add(sbSizer3, 1, wxEXPAND, 2);
-    bSizer20->Add(gSizer4, 1, wxEXPAND, 1);
-    m_panelRx->SetSizer(bSizer20);
-    m_panelRx->Layout();
-    bSizer20->Fit(m_panelRx);
-    m_notebook1->AddPage(m_panelRx, _("Receive"), true);
-
-    // Tx Tab -------------------------------------------------------------------------------
-
-    m_panelTx = new wxPanel(m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
-    wxBoxSizer* bSizer18;
-    bSizer18 = new wxBoxSizer(wxVERTICAL);
-    wxGridSizer* gSizer2;
-    gSizer2 = new wxGridSizer(2, 1, 0, 0);
-
-    // Tx In ----------------------------------------------------------------------------------
-
-    wxStaticBoxSizer* sbSizer22;
-    sbSizer22 = new wxStaticBoxSizer(new wxStaticBox(m_panelTx, wxID_ANY, _("From Microphone")), wxHORIZONTAL);
-
-    wxBoxSizer* bSizer83a = new wxBoxSizer(wxVERTICAL);
-
-    m_listCtrlTxInDevices = new wxListCtrl(m_panelTx, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VRULES);
-    bSizer83a->Add(m_listCtrlTxInDevices, 1, wxALL|wxEXPAND, 1);
-    wxBoxSizer* bSizer83;
-    bSizer83 = new wxBoxSizer(wxHORIZONTAL);
-    m_staticText12 = new wxStaticText(m_panelTx, wxID_ANY, _("Device:"), wxDefaultPosition, wxDefaultSize, 0);
-    m_staticText12->Wrap(-1);
-    bSizer83->Add(m_staticText12, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5);
-    m_textCtrlTxIn = new wxTextCtrl(m_panelTx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
-    bSizer83->Add(m_textCtrlTxIn, 1, wxALIGN_CENTER_VERTICAL|wxALL, 1);
-    m_staticText11 = new wxStaticText(m_panelTx, wxID_ANY, _("Sample Rate:"), wxDefaultPosition, wxDefaultSize, 0);
-    m_staticText11->Wrap(-1);
-    bSizer83->Add(m_staticText11, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5);
-    m_cbSampleRateTxIn = new wxComboBox(m_panelTx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(90,-1), 0, NULL, wxCB_DROPDOWN);
-    bSizer83->Add(m_cbSampleRateTxIn, 0, wxALL, 1);
-
-    bSizer83a->Add(bSizer83, 0, wxEXPAND, 5);
-
-    sbSizer22->Add(bSizer83a, 1, wxEXPAND, 2);
-    buildTestControls(&m_plotScalarTxIn, &m_btnTxInTest, m_panelTx, sbSizer22, _("Rec 2s"));
-
-    gSizer2->Add(sbSizer22, 1, wxEXPAND, 5);
-
-    // Tx Out ----------------------------------------------------------------------------------
-
-    wxStaticBoxSizer* sbSizer21;
-    sbSizer21 = new wxStaticBoxSizer(new wxStaticBox(m_panelTx, wxID_ANY, _("To Radio")), wxHORIZONTAL);
-
-    wxBoxSizer* bSizer82a = new wxBoxSizer(wxVERTICAL);
-
-    m_listCtrlTxOutDevices = new wxListCtrl(m_panelTx, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VRULES);
-    bSizer82a->Add(m_listCtrlTxOutDevices, 1, wxALL|wxEXPAND, 2);
-    wxBoxSizer* bSizer82;
-    bSizer82 = new wxBoxSizer(wxHORIZONTAL);
-    m_staticText81 = new wxStaticText(m_panelTx, wxID_ANY, _("Device:"), wxDefaultPosition, wxDefaultSize, 0);
-    m_staticText81->Wrap(-1);
-    bSizer82->Add(m_staticText81, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
-    m_textCtrlTxOut = new wxTextCtrl(m_panelTx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
-    bSizer82->Add(m_textCtrlTxOut, 1, wxALIGN_CENTER_VERTICAL|wxALL, 1);
-    m_staticText71 = new wxStaticText(m_panelTx, wxID_ANY, _("Sample Rate:"), wxDefaultPosition, wxDefaultSize, 0);
-    m_staticText71->Wrap(-1);
-    bSizer82->Add(m_staticText71, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5);
-    m_cbSampleRateTxOut = new wxComboBox(m_panelTx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(90,-1), 0, NULL, wxCB_DROPDOWN);
-    bSizer82->Add(m_cbSampleRateTxOut, 0, wxALL, 1);
-
-    bSizer82a->Add(bSizer82, 0, wxEXPAND, 5);
-
-    sbSizer21->Add(bSizer82a, 1, wxEXPAND, 2);
-    buildTestControls(&m_plotScalarTxOut, &m_btnTxOutTest, m_panelTx, sbSizer21, _("Play 2s"));
-
-    gSizer2->Add(sbSizer21, 1, wxEXPAND, 5);
-    bSizer18->Add(gSizer2, 1, wxEXPAND, 1);
-    m_panelTx->SetSizer(bSizer18);
-    m_panelTx->Layout();
-    bSizer18->Fit(m_panelTx);
-    m_notebook1->AddPage(m_panelTx, _("Transmit"), false);
-
-    // API Tab -------------------------------------------------------------------
-
-    m_panelAPI = new wxPanel(m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
-    wxBoxSizer* bSizer12;
-    bSizer12 = new wxBoxSizer(wxHORIZONTAL);
-    wxGridSizer* gSizer31;
-    gSizer31 = new wxGridSizer(2, 1, 0, 0);
-    wxStaticBoxSizer* sbSizer1;
-    sbSizer1 = new wxStaticBoxSizer(new wxStaticBox(m_panelAPI, wxID_ANY, _("PortAudio")), wxVERTICAL);
-
-    wxGridSizer* gSizer3;
-    gSizer3 = new wxGridSizer(4, 2, 0, 0);
-
-    m_staticText7 = new wxStaticText(m_panelAPI, wxID_ANY, _("PortAudio Version String:"), wxDefaultPosition, wxDefaultSize, 0);
-    m_staticText7->Wrap(-1);
-    gSizer3->Add(m_staticText7, 1, wxALIGN_RIGHT|wxALL|wxALIGN_CENTER_VERTICAL, 10);
-    m_textStringVer = new wxStaticText(m_panelAPI, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
-    gSizer3->Add(m_textStringVer, 1, wxALIGN_LEFT|wxALL|wxALIGN_CENTER_VERTICAL, 10);
-
-    m_staticText8 = new wxStaticText(m_panelAPI, wxID_ANY, _("PortAudio Int Version:"), wxDefaultPosition, wxDefaultSize, 0);
-    m_staticText8->Wrap(-1);
-    gSizer3->Add(m_staticText8, 1, wxALIGN_RIGHT|wxALL|wxALIGN_CENTER_VERTICAL, 10);
-    m_textIntVer = new wxStaticText(m_panelAPI, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(45,-1), 0);
-    gSizer3->Add(m_textIntVer, 1, wxALIGN_LEFT|wxALL|wxALIGN_CENTER_VERTICAL, 10);
-
-    m_staticText5 = new wxStaticText(m_panelAPI, wxID_ANY, _("Device Count:"), wxDefaultPosition, wxDefaultSize, 0);
-    m_staticText5->Wrap(-1);
-    gSizer3->Add(m_staticText5, 1, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 10);
-    m_textCDevCount = new wxStaticText(m_panelAPI, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(45,-1), 0);
-    gSizer3->Add(m_textCDevCount, 1, wxALIGN_LEFT|wxALL|wxALIGN_CENTER_VERTICAL, 10);
-
-    m_staticText4 = new wxStaticText(m_panelAPI, wxID_ANY, _("API Count:"), wxDefaultPosition, wxDefaultSize, 0);
-    m_staticText4->Wrap(-1);
-    gSizer3->Add(m_staticText4, 1, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 10);
-    m_textAPICount = new wxStaticText(m_panelAPI, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(45,-1), 0);
-    m_textAPICount->SetMaxSize(wxSize(45,-1));
-    gSizer3->Add(m_textAPICount, 1, wxALIGN_LEFT|wxALL|wxALIGN_CENTER_VERTICAL, 10);
-
-    sbSizer1->Add(gSizer3, 1, wxEXPAND, 2);
-    gSizer31->Add(sbSizer1, 1, wxEXPAND, 2);
-    wxStaticBoxSizer* sbSizer6;
-    sbSizer6 = new wxStaticBoxSizer(new wxStaticBox(m_panelAPI, wxID_ANY, _("Other")), wxVERTICAL);
-    gSizer31->Add(sbSizer6, 1, wxEXPAND, 5);
-    bSizer12->Add(gSizer31, 1, wxEXPAND, 5);
-    m_panelAPI->SetSizer(bSizer12);
-    m_panelAPI->Layout();
-    bSizer12->Fit(m_panelAPI);
-    m_notebook1->AddPage(m_panelAPI, _("API Info"), false);
-    bSizer4->Add(m_notebook1, 1, wxEXPAND | wxALL, 0);
-    m_panel1->SetSizer(bSizer4);
-    m_panel1->Layout();
-    bSizer4->Fit(m_panel1);
-    mainSizer->Add(m_panel1, 1, wxEXPAND | wxALL, 1);
-
-    wxBoxSizer* bSizer6;
-    bSizer6 = new wxBoxSizer(wxHORIZONTAL);
-    m_btnRefresh = new wxButton(this, wxID_ANY, _("Refresh"), wxDefaultPosition, wxDefaultSize, 0);
-    bSizer6->Add(m_btnRefresh, 0, wxALIGN_CENTER|wxALL, 2);
-
-    m_sdbSizer1 = new wxStdDialogButtonSizer();
-
-    m_sdbSizer1OK = new wxButton(this, wxID_OK);
-    m_sdbSizer1->AddButton(m_sdbSizer1OK);
-
-    m_sdbSizer1Cancel = new wxButton(this, wxID_CANCEL);
-    m_sdbSizer1->AddButton(m_sdbSizer1Cancel);
-
-    m_sdbSizer1Apply = new wxButton(this, wxID_APPLY);
-    m_sdbSizer1->AddButton(m_sdbSizer1Apply);
-
-    m_sdbSizer1->Realize();
-
-    bSizer6->Add(m_sdbSizer1, 1, wxALIGN_CENTER_VERTICAL, 2);
-    mainSizer->Add(bSizer6, 0, wxEXPAND, 2);
-    this->SetSizer(mainSizer);
-    this->Layout();
-    this->Centre(wxBOTH);
-//    this->Centre(wxBOTH);
-
-    m_notebook1->SetSelection(0);
-
-    showAPIInfo();
-    m_RxInDevices.m_listDevices   = m_listCtrlRxInDevices;
-    m_RxInDevices.direction       = AUDIO_IN;
-    m_RxInDevices.m_textDevice    = m_textCtrlRxIn;
-    m_RxInDevices.m_cbSampleRate  = m_cbSampleRateRxIn;
-
-    m_RxOutDevices.m_listDevices  = m_listCtrlRxOutDevices;
-    m_RxOutDevices.direction      = AUDIO_OUT;
-    m_RxOutDevices.m_textDevice   = m_textCtrlRxOut;
-    m_RxOutDevices.m_cbSampleRate = m_cbSampleRateRxOut;
-
-    m_TxInDevices.m_listDevices   = m_listCtrlTxInDevices;
-    m_TxInDevices.direction       = AUDIO_IN;
-    m_TxInDevices.m_textDevice    = m_textCtrlTxIn;
-    m_TxInDevices.m_cbSampleRate  = m_cbSampleRateTxIn;
-
-    m_TxOutDevices.m_listDevices  = m_listCtrlTxOutDevices;
-    m_TxOutDevices.direction      = AUDIO_OUT;
-    m_TxOutDevices.m_textDevice   = m_textCtrlTxOut;
-    m_TxOutDevices.m_cbSampleRate = m_cbSampleRateTxOut;
-
-    populateParams(m_RxInDevices);
-    populateParams(m_RxOutDevices);
-    populateParams(m_TxInDevices);
-    populateParams(m_TxOutDevices);
-
-    m_listCtrlRxInDevices->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( AudioOptsDialog::OnRxInDeviceSelect ), NULL, this );
-    m_listCtrlRxOutDevices->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( AudioOptsDialog::OnRxOutDeviceSelect ), NULL, this );
-    m_listCtrlTxInDevices->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( AudioOptsDialog::OnTxInDeviceSelect ), NULL, this );
-    m_listCtrlTxOutDevices->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( AudioOptsDialog::OnTxOutDeviceSelect ), NULL, this );
-
-    // wire up test buttons
-    m_btnRxInTest->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnRxInTest ), NULL, this );
-    m_btnRxOutTest->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnRxOutTest ), NULL, this );
-    m_btnTxInTest->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnTxInTest ), NULL, this );
-    m_btnTxOutTest->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnTxOutTest ), NULL, this );
-
-    m_btnRefresh->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnRefreshClick ), NULL, this );
-    m_sdbSizer1Apply->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnApplyAudioParameters ), NULL, this );
-    m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnCancelAudioParameters ), NULL, this );
-    m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnOkAudioParameters ), NULL, this );
-/*
-        void OnClose( wxCloseEvent& event ) { event.Skip(); }
-        void OnHibernate( wxActivateEvent& event ) { event.Skip(); }
-        void OnIconize( wxIconizeEvent& event ) { event.Skip(); }
-        void OnInitDialog( wxInitDialogEvent& event ) { event.Skip(); }
-*/
-//    this->Connect(wxEVT_CLOSE_WINDOW, wxCloseEventHandler(AudioOptsDialog::OnClose));
-    this->Connect(wxEVT_HIBERNATE, wxActivateEventHandler(AudioOptsDialog::OnHibernate));
-    this->Connect(wxEVT_ICONIZE, wxIconizeEventHandler(AudioOptsDialog::OnIconize));
-    this->Connect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(AudioOptsDialog::OnInitDialog));
-}
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// ~AudioOptsDialog()
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-AudioOptsDialog::~AudioOptsDialog()
-{
-    Pa_Terminate();
-
-    // Disconnect Events
-    this->Disconnect(wxEVT_HIBERNATE, wxActivateEventHandler(AudioOptsDialog::OnHibernate));
-    this->Disconnect(wxEVT_ICONIZE, wxIconizeEventHandler(AudioOptsDialog::OnIconize));
-    this->Disconnect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(AudioOptsDialog::OnInitDialog));
-
-    m_listCtrlRxInDevices->Disconnect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(AudioOptsDialog::OnRxInDeviceSelect), NULL, this);
-    m_listCtrlRxOutDevices->Disconnect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(AudioOptsDialog::OnRxOutDeviceSelect), NULL, this);
-    m_listCtrlTxInDevices->Disconnect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(AudioOptsDialog::OnTxInDeviceSelect), NULL, this);
-    m_listCtrlTxOutDevices->Disconnect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(AudioOptsDialog::OnTxOutDeviceSelect), NULL, this);
-
-    m_btnRxInTest->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnRxInTest ), NULL, this );
-    m_btnRxOutTest->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnRxOutTest ), NULL, this );
-    m_btnTxInTest->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnTxInTest ), NULL, this );
-    m_btnTxOutTest->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnTxOutTest ), NULL, this );
-
-    m_btnRefresh->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AudioOptsDialog::OnRefreshClick), NULL, this);
-    m_sdbSizer1Apply->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AudioOptsDialog::OnApplyAudioParameters), NULL, this);
-    m_sdbSizer1Cancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AudioOptsDialog::OnCancelAudioParameters), NULL, this);
-    m_sdbSizer1OK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AudioOptsDialog::OnOkAudioParameters), NULL, this);
-
-}
-
-//-------------------------------------------------------------------------
-// OnInitDialog()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnInitDialog( wxInitDialogEvent& event )
-{
-    ExchangeData(EXCHANGE_DATA_IN);
-}
-
-//-------------------------------------------------------------------------
-// OnInitDialog()
-//
-// helper function to look up name of devNum, and if it exists write
-// name to textCtrl.  Used to trap dissapearing devices.
-//-------------------------------------------------------------------------
-int AudioOptsDialog::setTextCtrlIfDevNumValid(wxTextCtrl *textCtrl, wxListCtrl *listCtrl, int devNum)
-{
-    int i, aDevNum, found_devNum;
-
-    // ignore last list entry as it is the "none" entry
-
-    found_devNum = 0;
-    for(i=0; i<listCtrl->GetItemCount()-1; i++) {
-        aDevNum = wxAtoi(listCtrl->GetItemText(i, 1));
-        //printf("aDevNum: %d devNum: %d\n", aDevNum, devNum);
-        if (aDevNum == devNum) {
-            found_devNum = 1;
-            textCtrl->SetValue(listCtrl->GetItemText(i, 0) + " (" + wxString::Format(wxT("%i"),devNum) + ")");
-            printf("setting focus of %d\n", i);
-            listCtrl->SetItemState(i, wxLIST_STATE_FOCUSED, wxLIST_STATE_FOCUSED);
-        }
-    }
-
-    if (found_devNum) 
-        return devNum;
-    else {
-        textCtrl->SetValue("none");
-        return -1;
-    }
-}
-
-//-------------------------------------------------------------------------
-// ExchangeData()
-//-------------------------------------------------------------------------
-int AudioOptsDialog::ExchangeData(int inout)
-{
-    if(inout == EXCHANGE_DATA_IN)
-    {
-        // Map sound card device numbers to tx/rx device numbers depending
-        // on number of sound cards in use
-
-        printf("EXCHANGE_DATA_IN:\n");
-        printf("  g_nSoundCards: %d\n", g_nSoundCards);
-        printf("  g_soundCard1InDeviceNum: %d\n", g_soundCard1InDeviceNum);
-        printf("  g_soundCard1OutDeviceNum: %d\n", g_soundCard1OutDeviceNum);
-        printf("  g_soundCard1SampleRate: %d\n", g_soundCard1SampleRate);
-        printf("  g_soundCard2InDeviceNum: %d\n", g_soundCard2InDeviceNum);
-        printf("  g_soundCard2OutDeviceNum: %d\n", g_soundCard2OutDeviceNum);
-        printf("  g_soundCard2SampleRate: %d\n", g_soundCard2SampleRate);
-
-        if (g_nSoundCards == 0) {
-            m_textCtrlRxIn ->SetValue("none"); rxInAudioDeviceNum  = -1;
-            m_textCtrlRxOut->SetValue("none"); rxOutAudioDeviceNum = -1;
-            m_textCtrlTxIn ->SetValue("none"); txInAudioDeviceNum  = -1;
-            m_textCtrlTxOut->SetValue("none"); txOutAudioDeviceNum = -1;           
-        }
-
-        if (g_nSoundCards == 1) {
-            rxInAudioDeviceNum  = setTextCtrlIfDevNumValid(m_textCtrlRxIn, 
-                                                           m_listCtrlRxInDevices, 
-                                                           g_soundCard1InDeviceNum);
-
-            rxOutAudioDeviceNum = setTextCtrlIfDevNumValid(m_textCtrlRxOut, 
-                                                           m_listCtrlRxOutDevices, 
-                                                           g_soundCard1OutDeviceNum);
-
-            if ((rxInAudioDeviceNum != -1) && (rxInAudioDeviceNum != -1)) {
-                m_cbSampleRateRxIn->SetValue(wxString::Format(wxT("%i"),g_soundCard1SampleRate));
-                m_cbSampleRateRxOut->SetValue(wxString::Format(wxT("%i"),g_soundCard1SampleRate));
-            }
-
-            m_textCtrlTxIn ->SetValue("none"); txInAudioDeviceNum  = -1;
-            m_textCtrlTxOut->SetValue("none"); txOutAudioDeviceNum = -1;           
-        }
-
-        if (g_nSoundCards == 2) {
-            rxInAudioDeviceNum  = setTextCtrlIfDevNumValid(m_textCtrlRxIn, 
-                                                           m_listCtrlRxInDevices, 
-                                                           g_soundCard1InDeviceNum);
-
-            rxOutAudioDeviceNum = setTextCtrlIfDevNumValid(m_textCtrlRxOut, 
-                                                           m_listCtrlRxOutDevices, 
-                                                           g_soundCard2OutDeviceNum);
-
-            txInAudioDeviceNum  = setTextCtrlIfDevNumValid(m_textCtrlTxIn, 
-                                                           m_listCtrlTxInDevices, 
-                                                           g_soundCard2InDeviceNum);
-
-            txOutAudioDeviceNum = setTextCtrlIfDevNumValid(m_textCtrlTxOut, 
-                                                           m_listCtrlTxOutDevices, 
-                                                           g_soundCard1OutDeviceNum);
-
-            if ((rxInAudioDeviceNum != -1) && (txOutAudioDeviceNum != -1)) {
-                m_cbSampleRateRxIn->SetValue(wxString::Format(wxT("%i"),g_soundCard1SampleRate));
-                m_cbSampleRateTxOut->SetValue(wxString::Format(wxT("%i"),g_soundCard1SampleRate));
-            }
-
-            if ((txInAudioDeviceNum != -1) && (rxOutAudioDeviceNum != -1)) {
-                m_cbSampleRateTxIn->SetValue(wxString::Format(wxT("%i"),g_soundCard2SampleRate));
-                m_cbSampleRateRxOut->SetValue(wxString::Format(wxT("%i"),g_soundCard2SampleRate));
-            }
-        }
-        printf("  rxInAudioDeviceNum: %d\n  rxOutAudioDeviceNum: %d\n  txInAudioDeviceNum: %d\n  txOutAudioDeviceNum: %d\n",
-               rxInAudioDeviceNum, rxOutAudioDeviceNum, txInAudioDeviceNum, txOutAudioDeviceNum);
-    }
-
-    if(inout == EXCHANGE_DATA_OUT)
-    {
-        int valid_one_card_config = 0;
-        int valid_two_card_config = 0;
-        wxString sampleRate1, sampleRate2;
-
-        printf("EXCHANGE_DATA_OUT:\n");
-        printf("  rxInAudioDeviceNum: %d\n  rxOutAudioDeviceNum: %d\n  txInAudioDeviceNum: %d\n  txOutAudioDeviceNum: %d\n",
-               rxInAudioDeviceNum, rxOutAudioDeviceNum, txInAudioDeviceNum, txOutAudioDeviceNum);
-
-        // ---------------------------------------------------------------
-        // check we have a valid 1 or 2 sound card configuration
-        // ---------------------------------------------------------------
-
-        // one sound card config, tx device numbers should be set to -1 
-
-        if ((rxInAudioDeviceNum != -1) && (rxOutAudioDeviceNum != -1) &&
-            (txInAudioDeviceNum == -1) && (txOutAudioDeviceNum == -1)) {
-            valid_one_card_config = 1; 
-
-            // in and out sample rate must be the same, as there is one callback
-            
-            sampleRate1 = m_cbSampleRateRxIn->GetValue();
-            if (!sampleRate1.IsSameAs(m_cbSampleRateRxOut->GetValue())) {
-                wxMessageBox(wxT("With a single sound card the Sample Rate of "
-                                 "From Radio and To Speaker/Headphones must be the same."), wxT(""), wxOK);
-                return -1;
-            }
-        }
-
-        // two card configuration
-
-        if ((rxInAudioDeviceNum != -1) && (rxOutAudioDeviceNum != -1) &&
-            (txInAudioDeviceNum != -1) && (txOutAudioDeviceNum != -1)) {
-
-            valid_two_card_config = 1; 
-
-            // Check we haven't doubled up on sound devices
-
-            if (rxInAudioDeviceNum == txInAudioDeviceNum) {
-                wxMessageBox(wxT("You must use different devices for From Radio and From Microphone"), wxT(""), wxOK);
-                return -1;
-            }
-
-            if (rxOutAudioDeviceNum == txOutAudioDeviceNum) {
-                wxMessageBox(wxT("You must use different devices for To Radio and To Speaker/Headphones"), wxT(""), wxOK);
-                return -1;
-            }
-
-            // Check sample rates for callback 1 devices are the same,
-            // as input and output are handled synchronously by one
-            // portaudio callback
-            
-            sampleRate1 = m_cbSampleRateRxIn->GetValue();
-            if (!sampleRate1.IsSameAs(m_cbSampleRateTxOut->GetValue())) {
-                wxMessageBox(wxT("With two sound cards the Sample Rate "
-                                 "of From Radio and To Radio must be the same."), wxT(""), wxOK);
-                return -1;
-            }
-            // check sample rate for callback 2 devices is the same
-
-            sampleRate2 = m_cbSampleRateTxIn->GetValue();
-            if (!sampleRate2.IsSameAs(m_cbSampleRateRxOut->GetValue())) {
-                wxMessageBox(wxT("With two sound cards the Sample Rate of "
-                                 "From Microphone and To Speaker/Headphones must be the same."), wxT(""), wxOK);
-                return -1;
-            }
-        }
-
-        printf("  valid_one_card_config: %d  valid_two_card_config: %d\n", valid_one_card_config, valid_two_card_config);
-
-        if (!valid_one_card_config && !valid_two_card_config) {
-            wxMessageBox(wxT("Invalid one or two sound card configuration"), wxT(""), wxOK);
-            return -1;
-        }
-
-        // ---------------------------------------------------------------
-        // Map Rx/TX device numbers to sound card device numbers used
-        // in callbacks. Portaudio uses one callback per sound card so
-        // we have to be soundcard oriented at run time rather than
-        // Tx/Rx oriented as in this dialog.
-        // ---------------------------------------------------------------
-        g_nSoundCards = 0;
-        g_soundCard1InDeviceNum = g_soundCard1OutDeviceNum = g_soundCard2InDeviceNum = g_soundCard2OutDeviceNum = -1;
-
-        if (valid_one_card_config) {
-
-            // Only callback 1 used
-
-            g_nSoundCards = 1;
-            g_soundCard1InDeviceNum  = rxInAudioDeviceNum;
-            g_soundCard1OutDeviceNum = rxOutAudioDeviceNum;
-            g_soundCard1SampleRate = wxAtoi(sampleRate1);
-        }
-
-        if (valid_two_card_config) {
-            g_nSoundCards = 2;
-            g_soundCard1InDeviceNum  = rxInAudioDeviceNum;
-            g_soundCard1OutDeviceNum = txOutAudioDeviceNum;
-            g_soundCard1SampleRate   = wxAtoi(sampleRate1);
-            g_soundCard2InDeviceNum  = txInAudioDeviceNum;
-            g_soundCard2OutDeviceNum = rxOutAudioDeviceNum;
-            g_soundCard2SampleRate   = wxAtoi(sampleRate2);
-        }
-
-        printf("  g_nSoundCards: %d\n", g_nSoundCards);
-        printf("  g_soundCard1InDeviceNum: %d\n", g_soundCard1InDeviceNum);
-        printf("  g_soundCard1OutDeviceNum: %d\n", g_soundCard1OutDeviceNum);
-        printf("  g_soundCard1SampleRate: %d\n", g_soundCard1SampleRate);
-        printf("  g_soundCard2InDeviceNum: %d\n", g_soundCard2InDeviceNum);
-        printf("  g_soundCard2OutDeviceNum: %d\n", g_soundCard2OutDeviceNum);
-        printf("  g_soundCard2SampleRate: %d\n", g_soundCard2SampleRate);
-
-        wxConfigBase *pConfig = wxConfigBase::Get();
-        pConfig->Write(wxT("/Audio/soundCard1InDeviceNum"),       g_soundCard1InDeviceNum);
-        pConfig->Write(wxT("/Audio/soundCard1OutDeviceNum"),      g_soundCard1OutDeviceNum);
-        pConfig->Write(wxT("/Audio/soundCard1SampleRate"),        g_soundCard1SampleRate );
-
-        pConfig->Write(wxT("/Audio/soundCard2InDeviceNum"),       g_soundCard2InDeviceNum);
-        pConfig->Write(wxT("/Audio/soundCard2OutDeviceNum"),      g_soundCard2OutDeviceNum);
-        pConfig->Write(wxT("/Audio/soundCard2SampleRate"),        g_soundCard2SampleRate );
-
-        pConfig->Flush();
-        delete wxConfigBase::Set((wxConfigBase *) NULL);
-    }
-
-    return 0;
-}
-
-//-------------------------------------------------------------------------
-// buildListOfSupportedSampleRates()
-//-------------------------------------------------------------------------
-int AudioOptsDialog:: buildListOfSupportedSampleRates(wxComboBox *cbSampleRate, int devNum, int in_out)
-{
-    // every sound device has a different list of supported sample rates, so
-    // we work out which ones are supported and populate the list ctrl
-
-    static double standardSampleRates[] =
-    {
-        8000.0,     9600.0,
-        11025.0,    12000.0,
-        16000.0,    22050.0,
-        24000.0,    32000.0,
-        44100.0,    48000.0,
-        88200.0,    96000.0,
-        192000.0,   -1          // negative terminated  list
-    };
-
-    const PaDeviceInfo  *deviceInfo;
-    PaStreamParameters   inputParameters, outputParameters;
-    PaError              err;
-    wxString             str;
-    int                  i, numSampleRates;
-
-    deviceInfo = Pa_GetDeviceInfo(devNum);
-    if (deviceInfo == NULL) {
-        printf("Pa_GetDeviceInfo(%d) failed!\n", devNum);
-        cbSampleRate->Clear();
-        return 0;
-    }
-
-    inputParameters.device = devNum;
-    inputParameters.channelCount = deviceInfo->maxInputChannels;
-    inputParameters.sampleFormat = paInt16;
-    inputParameters.suggestedLatency = 0;
-    inputParameters.hostApiSpecificStreamInfo = NULL;
-        
-    outputParameters.device = devNum;
-    outputParameters.channelCount = deviceInfo->maxOutputChannels;
-    outputParameters.sampleFormat = paInt16;
-    outputParameters.suggestedLatency = 0;
-    outputParameters.hostApiSpecificStreamInfo = NULL;
-    
-    cbSampleRate->Clear();
-    //printf("devNum %d supports: ", devNum);
-    numSampleRates = 0;
-    for(i = 0; standardSampleRates[i] > 0; i++)
-    {      
-        if (in_out == AUDIO_IN)
-            err = Pa_IsFormatSupported(&inputParameters, NULL, standardSampleRates[i]);
-        else
-            err = Pa_IsFormatSupported(NULL, &outputParameters, standardSampleRates[i]);
-
-        if( err == paFormatIsSupported ) {
-            str.Printf("%i", (int)standardSampleRates[i]);
-            cbSampleRate->AppendString(str);
-            printf("%i ", (int)standardSampleRates[i]);
-            numSampleRates++;
-        }
-    }
-    printf("\n");
-
-    return numSampleRates;
-}
-
-//-------------------------------------------------------------------------
-// showAPIInfo()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::showAPIInfo()
-{
-    wxString    strval;
-    int         apiVersion;
-    int         apiCount        = 0;
-    int         numDevices      = 0;
-
-    strval = Pa_GetVersionText();
-    m_textStringVer->SetLabel(strval);
-
-    apiVersion = Pa_GetVersion();
-    strval.Printf(wxT("%d"), apiVersion);
-    m_textIntVer->SetLabel(strval);
-
-    apiCount = Pa_GetHostApiCount();
-    strval.Printf(wxT("%d"), apiCount);
-    m_textAPICount->SetLabel(strval);
-
-    numDevices = Pa_GetDeviceCount();
-    strval.Printf(wxT("%d"), numDevices);
-    m_textCDevCount->SetLabel(strval);
-}
-
-//-------------------------------------------------------------------------
-// populateParams()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::populateParams(AudioInfoDisplay ai)
-{
-    const       PaDeviceInfo *deviceInfo = NULL;
-    wxListCtrl* ctrl    = ai.m_listDevices;
-    int         in_out  = ai.direction;
-    long        idx;
-    int         numDevices;
-    wxListItem  listItem;
-    wxString    buf;
-    int         devn;
-    int         col = 0;
-
-    numDevices = Pa_GetDeviceCount();
-
-    if(ctrl->GetColumnCount() > 0)
-    {
-        ctrl->ClearAll();
-    }
-
-    listItem.SetAlign(wxLIST_FORMAT_LEFT);
-    listItem.SetText(wxT("Device"));
-    idx = ctrl->InsertColumn(col, listItem);
-    ctrl->SetColumnWidth(col++, 300);
-
-    listItem.SetAlign(wxLIST_FORMAT_CENTRE);
-    listItem.SetText(wxT("ID"));
-    idx = ctrl->InsertColumn(col, listItem);
-    ctrl->SetColumnWidth(col++, 45);
-
-    listItem.SetAlign(wxLIST_FORMAT_LEFT);
-    listItem.SetText(wxT("API"));
-    idx = ctrl->InsertColumn(col, listItem);
-    ctrl->SetColumnWidth(col++, 100);
-
-    if(in_out == AUDIO_IN)
-    {
-        listItem.SetAlign(wxLIST_FORMAT_CENTRE);
-        listItem.SetText(wxT("Default Sample Rate"));
-        idx = ctrl->InsertColumn(col, listItem);
-        ctrl->SetColumnWidth(col++, 160);
-    }
-    else if(in_out == AUDIO_OUT)
-    {
-        listItem.SetAlign(wxLIST_FORMAT_CENTRE);
-        listItem.SetText(wxT("Default Sample Rate"));
-        idx = ctrl->InsertColumn(col, listItem);
-        ctrl->SetColumnWidth(col++, 160);
-    }
-
-    #ifdef LATENCY
-    listItem.SetAlign(wxLIST_FORMAT_CENTRE);
-    listItem.SetText(wxT("Min Latency"));
-    ctrl->InsertColumn(col, listItem);
-    ctrl->SetColumnWidth(col++, 100);
-
-    listItem.SetAlign(wxLIST_FORMAT_CENTRE);
-    listItem.SetText(wxT("Max Latency"));
-    ctrl->InsertColumn(col, listItem);
-    ctrl->SetColumnWidth(col++, 100);
-    #endif
-
-    for(devn = 0; devn < numDevices; devn++)
-    {
-        buf.Printf(wxT(""));
-        deviceInfo = Pa_GetDeviceInfo(devn);
-        if( ((in_out == AUDIO_IN) && (deviceInfo->maxInputChannels > 0)) ||
-            ((in_out == AUDIO_OUT) && (deviceInfo->maxOutputChannels > 0)))
-        {
-            col = 0;
-            buf.Printf(wxT("%s"), deviceInfo->name);
-            idx = ctrl->InsertItem(ctrl->GetItemCount(), buf);
-            col++;
-                
-            buf.Printf(wxT("%d"), devn);
-            ctrl->SetItem(idx, col++, buf);
-
-            buf.Printf(wxT("%s"), Pa_GetHostApiInfo(deviceInfo->hostApi)->name);
-            ctrl->SetItem(idx, col++, buf);
-
-            buf.Printf(wxT("%i"), (int)deviceInfo->defaultSampleRate);
-            ctrl->SetItem(idx, col++, buf);
-
-            #ifdef LATENCY
-            if (in_out == AUDIO_IN)
-                buf.Printf(wxT("%8.4f"), deviceInfo->defaultLowInputLatency);
-            else
-                buf.Printf(wxT("%8.4f"), deviceInfo->defaultLowOutputLatency);               
-            ctrl->SetItem(idx, col++, buf);
-
-            if (in_out == AUDIO_IN)
-                buf.Printf(wxT("%8.4f"), deviceInfo->defaultHighInputLatency);
-            else
-                 buf.Printf(wxT("%8.4f"), deviceInfo->defaultHighOutputLatency);             
-            ctrl->SetItem(idx, col++, buf);
-            #endif
-        }        
-    }
-
-    // add "none" option at end
-
-    buf.Printf(wxT("%s"), "none");
-    idx = ctrl->InsertItem(ctrl->GetItemCount(), buf);
-}
-
-//-------------------------------------------------------------------------
-// OnDeviceSelect()
-//
-// helper function to set up "Device:" and "Sample Rate:" fields when
-// we click on a line in the list of devices box
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnDeviceSelect(wxComboBox *cbSampleRate, 
-                                     wxTextCtrl *textCtrl, 
-                                     int        *devNum, 
-                                     wxListCtrl *listCtrlDevices, 
-                                     int         index,
-                                     int         in_out)
-{
-
-    wxString devName = listCtrlDevices->GetItemText(index, 0);
-     if (devName.IsSameAs("none")) {
-        *devNum = -1;
-        textCtrl->SetValue("none");
-    }
-    else {
-        *devNum = wxAtoi(listCtrlDevices->GetItemText(index, 1));
-        textCtrl->SetValue(devName + " (" + wxString::Format(wxT("%i"),*devNum) + ")");
-
-        int numSampleRates = buildListOfSupportedSampleRates(cbSampleRate, *devNum, in_out);
-        if (numSampleRates) {
-            wxString defSampleRate = listCtrlDevices->GetItemText(index, 3);        
-            cbSampleRate->SetValue(defSampleRate);
-        }
-        else {
-             cbSampleRate->SetValue("None");           
-        }
-    }
-}
-
-//-------------------------------------------------------------------------
-// OnRxInDeviceSelect()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnRxInDeviceSelect(wxListEvent& evt)
-{
-    OnDeviceSelect(m_cbSampleRateRxIn, 
-                   m_textCtrlRxIn, 
-                   &rxInAudioDeviceNum, 
-                   m_listCtrlRxInDevices, 
-                   evt.GetIndex(),
-                   AUDIO_IN);
-}
-
-//-------------------------------------------------------------------------
-// OnRxOutDeviceSelect()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnRxOutDeviceSelect(wxListEvent& evt)
-{
-    OnDeviceSelect(m_cbSampleRateRxOut, 
-                   m_textCtrlRxOut, 
-                   &rxOutAudioDeviceNum, 
-                   m_listCtrlRxOutDevices, 
-                   evt.GetIndex(),
-                   AUDIO_OUT);
-}
-
-//-------------------------------------------------------------------------
-// OnTxInDeviceSelect()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnTxInDeviceSelect(wxListEvent& evt)
-{
-    OnDeviceSelect(m_cbSampleRateTxIn, 
-                   m_textCtrlTxIn, 
-                   &txInAudioDeviceNum, 
-                   m_listCtrlTxInDevices, 
-                   evt.GetIndex(),
-                   AUDIO_IN);
-}
-
-//-------------------------------------------------------------------------
-// OnTxOutDeviceSelect()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnTxOutDeviceSelect(wxListEvent& evt)
-{
-    OnDeviceSelect(m_cbSampleRateTxOut, 
-                   m_textCtrlTxOut, 
-                   &txOutAudioDeviceNum, 
-                   m_listCtrlTxOutDevices, 
-                   evt.GetIndex(),
-                   AUDIO_OUT);
-}
-
-//-------------------------------------------------------------------------
-// plotDeviceInputForAFewSecs()
-//
-// opens a record device and plots the input speech for a few seconds.  This is "modal" using
-// synchronous portaudio functions, so the GUI will not respond until after test sample has been
-// taken
-//-------------------------------------------------------------------------
-void AudioOptsDialog::plotDeviceInputForAFewSecs(int devNum, PlotScalar *plotScalar) {
-    PaStreamParameters  inputParameters;
-    const PaDeviceInfo *deviceInfo = NULL;
-    PaStream           *stream = NULL;
-    PaError             err;
-    short               in48k_stereo_short[2*TEST_BUF_SIZE];
-    short               in48k_short[TEST_BUF_SIZE];
-    short               in8k_short[TEST_BUF_SIZE];
-    int                 numDevices, nBufs, i, j, src_error,inputChannels;
-    float               t;
-    SRC_STATE          *src;
-    FIFO               *fifo;
-
-    // a basic sanity check
-    numDevices = Pa_GetDeviceCount();
-    if (devNum >= numDevices)
-        return;
-    if (devNum < 0)
-        return;
-    printf("devNum %d\n", devNum);
-
-    fifo = fifo_create((int)(DT*TEST_WAVEFORM_PLOT_FS*2)); assert(fifo != NULL);
-    src = src_new(SRC_SINC_FASTEST, 1, &src_error); assert(src != NULL);
-
-    // work out how many input channels this device supports.
-
-    deviceInfo = Pa_GetDeviceInfo(devNum);
-    if (deviceInfo == NULL) {
-        wxMessageBox(wxT("Couldn't get device info from Port Audio for Sound Card "), wxT("Error"), wxOK);
-        return;
-    }
-    if (deviceInfo->maxInputChannels == 1)
-        inputChannels = 1;
-    else
-        inputChannels = 2;
-
-    // open device
-
-    inputParameters.device = devNum;
-    inputParameters.channelCount = inputChannels;
-    inputParameters.sampleFormat = paInt16;
-    inputParameters.suggestedLatency = Pa_GetDeviceInfo( inputParameters.device )->defaultHighInputLatency;
-    inputParameters.hostApiSpecificStreamInfo = NULL;
-
-    nBufs = TEST_WAVEFORM_PLOT_TIME*TEST_FS/TEST_BUF_SIZE;
-    printf("inputChannels: %d nBufs %d\n", inputChannels, nBufs);
-
-    err = Pa_OpenStream(
-              &stream,
-              &inputParameters,
-              NULL,
-              TEST_FS,
-              TEST_BUF_SIZE,
-              paClipOff,    
-              NULL,       // no callback, use blocking API
-              NULL ); 
-    if (err != paNoError) {
-        wxMessageBox(wxT("Couldn't initialise sound device."), wxT("Error"), wxOK);       
-        return;
-    }
-
-    err = Pa_StartStream(stream);
-    if (err != paNoError) {
-        wxMessageBox(wxT("Couldn't start sound device."), wxT("Error"), wxOK);       
-        return;
-    }
-
-    for(i=0, t=0.0; i<nBufs; i++, t+=(float)TEST_BUF_SIZE/TEST_FS) {
-        Pa_ReadStream(stream, in48k_stereo_short, TEST_BUF_SIZE);
-        if (inputChannels == 2) {
-            for(j=0; j<TEST_BUF_SIZE; j++)
-                in48k_short[j] = in48k_stereo_short[2*j]; // left channel only
-        }
-        else {
-            for(j=0; j<TEST_BUF_SIZE; j++)
-                in48k_short[j] = in48k_stereo_short[j]; 
-        }
-        int n8k = resample(src, in8k_short, in48k_short, 8000, TEST_FS, TEST_BUF_SIZE, TEST_BUF_SIZE);
-        resample_for_plot(fifo, in8k_short, n8k, FS);
-
-        // every TEST_DT seconds update plot, unfortunately plot
-        // doesnt get updated to end as we are blocking events in this
-        // function
-
-        if (t > TEST_DT) {
-            t -= TEST_DT;
-            short plotSamples[TEST_WAVEFORM_PLOT_BUF];
-            if (fifo_read(fifo, plotSamples, TEST_WAVEFORM_PLOT_BUF))
-                memset(plotSamples, 0, TEST_WAVEFORM_PLOT_BUF*sizeof(short));
-            plotScalar->add_new_short_samples(0, plotSamples, TEST_WAVEFORM_PLOT_BUF, 32767);
-            plotScalar->Refresh();
-       }
-    }
-   
-    err = Pa_StopStream(stream);
-    if (err != paNoError) {
-        wxMessageBox(wxT("Couldn't stop sound device."), wxT("Error"), wxOK);       
-        return;
-    }
-    Pa_CloseStream(stream);
-
-    fifo_destroy(fifo);
-    src_delete(src);
-}
-
-//-------------------------------------------------------------------------
-// plotDeviceOutputForAFewSecs()
-//
-// opens a play device and plays a tone for a few seconds.  This is "modal" using
-// synchronous portaudio functions, so the GUI will not respond until after test sample has been
-// taken.  Also plots a pretty picture like the record versions
-//-------------------------------------------------------------------------
-void AudioOptsDialog::plotDeviceOutputForAFewSecs(int devNum, PlotScalar *plotScalar) {
-    PaStreamParameters  outputParameters;
-    const PaDeviceInfo *deviceInfo = NULL;
-    PaStream           *stream = NULL;
-    PaError             err;
-    short               out48k_stereo_short[2*TEST_BUF_SIZE];
-    short               out48k_short[TEST_BUF_SIZE];
-    short               out8k_short[TEST_BUF_SIZE];
-    int                 numDevices, nBufs, i, j, src_error, n, outputChannels;
-    float               t;
-    SRC_STATE          *src;
-    FIFO               *fifo;
-
-    // a basic sanity check
-    numDevices = Pa_GetDeviceCount();
-    if (devNum >= numDevices)
-        return;
-    if (devNum < 0)
-        return;
-
-    fifo = fifo_create((int)(DT*TEST_WAVEFORM_PLOT_FS*2)); assert(fifo != NULL);
-    src = src_new(SRC_SINC_FASTEST, 1, &src_error); assert(src != NULL);
-
-    // work out how many output channels this device supports.
-
-    deviceInfo = Pa_GetDeviceInfo(devNum);
-    if (deviceInfo == NULL) {
-        wxMessageBox(wxT("Couldn't get device info from Port Audio for Sound Card "), wxT("Error"), wxOK);
-        return;
-    }
-    if (deviceInfo->maxOutputChannels == 1)
-        outputChannels = 1;
-    else
-        outputChannels = 2;
-
-    printf("outputChannels: %d\n", outputChannels);
-
-    outputParameters.device = devNum;
-    outputParameters.channelCount = outputChannels;
-    outputParameters.sampleFormat = paInt16;
-    outputParameters.suggestedLatency = Pa_GetDeviceInfo( outputParameters.device )->defaultHighOutputLatency;
-    outputParameters.hostApiSpecificStreamInfo = NULL;
-
-    nBufs = TEST_WAVEFORM_PLOT_TIME*TEST_FS/TEST_BUF_SIZE;
-
-    err = Pa_OpenStream(
-              &stream,
-              NULL,
-              &outputParameters,
-              TEST_FS,
-              TEST_BUF_SIZE,
-              paClipOff,    
-              NULL,       // no callback, use blocking API
-              NULL ); 
-    if (err != paNoError) {
-        wxMessageBox(wxT("Couldn't initialise sound device."), wxT("Error"), wxOK);       
-        return;
-    }
-
-    err = Pa_StartStream(stream);
-    if (err != paNoError) {
-        wxMessageBox(wxT("Couldn't start sound device."), wxT("Error"), wxOK);       
-        return;
-    }
-
-    for(i=0, t=0.0, n=0; i<nBufs; i++, t+=(float)TEST_BUF_SIZE/TEST_FS) {
-        for(j=0; j<TEST_BUF_SIZE; j++,n++) {
-            out48k_short[j] = 2000.0*cos(6.2832*(n++)*400.0/TEST_FS);
-            if (outputChannels == 2) {
-                out48k_stereo_short[2*j] = out48k_short[j];   // left channel
-                out48k_stereo_short[2*j+1] = out48k_short[j]; // right channel
-            }
-            else {
-                out48k_stereo_short[j] = out48k_short[j];     // mono
-            }
-        }
-        Pa_WriteStream(stream, out48k_stereo_short, TEST_BUF_SIZE);
-
-        // convert back to 8kHz just for plotting
-        int n8k = resample(src, out8k_short, out48k_short, 8000, TEST_FS, TEST_BUF_SIZE, TEST_BUF_SIZE);
-        resample_for_plot(fifo, out8k_short, n8k, FS);
-
-        // every TEST_DT seconds update plot
-
-        if (t > TEST_DT) {
-            t -= TEST_DT;
-            short plotSamples[TEST_WAVEFORM_PLOT_BUF];
-            if (fifo_read(fifo, plotSamples, TEST_WAVEFORM_PLOT_BUF))
-                memset(plotSamples, 0, TEST_WAVEFORM_PLOT_BUF*sizeof(short));
-            plotScalar->add_new_short_samples(0, plotSamples, TEST_WAVEFORM_PLOT_BUF, 32767);
-            plotScalar->Refresh();
-       }
-    }
-   
-    err = Pa_StopStream(stream);
-    if (err != paNoError) {
-        wxMessageBox(wxT("Couldn't stop sound device."), wxT("Error"), wxOK);       
-        return;
-    }
-    Pa_CloseStream(stream);
-
-    fifo_destroy(fifo);
-    src_delete(src);
-}
-
-//-------------------------------------------------------------------------
-// OnRxInTest()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnRxInTest(wxCommandEvent& event)
-{
-    plotDeviceInputForAFewSecs(rxInAudioDeviceNum, m_plotScalarRxIn);
-}
-
-//-------------------------------------------------------------------------
-// OnRxOutTest()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnRxOutTest(wxCommandEvent& event)
-{
-    plotDeviceOutputForAFewSecs(rxOutAudioDeviceNum, m_plotScalarRxOut);
-}
-
-//-------------------------------------------------------------------------
-// OnTxInTest()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnTxInTest(wxCommandEvent& event)
-{
-    plotDeviceInputForAFewSecs(txInAudioDeviceNum, m_plotScalarTxIn);
-}
-
-//-------------------------------------------------------------------------
-// OnTxOutTest()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnTxOutTest(wxCommandEvent& event)
-{
-    plotDeviceOutputForAFewSecs(txOutAudioDeviceNum, m_plotScalarTxOut);
-}
-
-//-------------------------------------------------------------------------
-// OnRefreshClick()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnRefreshClick(wxCommandEvent& event)
-{
-    // restart portaudio, to re-sample available devices
-
-    Pa_Terminate();
-    Pa_Init();
-
-    m_notebook1->SetSelection(0);
-    showAPIInfo();
-    populateParams(m_RxInDevices);
-    populateParams(m_RxOutDevices);
-    populateParams(m_TxInDevices);
-    populateParams(m_TxOutDevices);
-
-    // some devices may have dissapeared, so possibily change sound
-    // card config
-
-    ExchangeData(EXCHANGE_DATA_IN);
-}
-
-//-------------------------------------------------------------------------
-// OnApplyAudioParameters()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnApplyAudioParameters(wxCommandEvent& event)
-{
-    ExchangeData(EXCHANGE_DATA_OUT);
-    if(m_isPaInitialized)
-    {
-        if((pa_err = Pa_Terminate()) == paNoError)
-        {
-            m_isPaInitialized = false;
-        }
-        else
-        {
-            wxMessageBox(wxT("Port Audio failed to Terminate"), wxT("Pa_Terminate"), wxOK);
-        }
-    }
-}
-
-//-------------------------------------------------------------------------
-// OnCancelAudioParameters()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnCancelAudioParameters(wxCommandEvent& event)
-{
-    if(m_isPaInitialized)
-    {
-        if((pa_err = Pa_Terminate()) == paNoError)
-        {
-            m_isPaInitialized = false;
-        }
-        else
-        {
-            wxMessageBox(wxT("Port Audio failed to Terminate"), wxT("Pa_Terminate"), wxOK);
-        }
-    }
-    EndModal(wxCANCEL);
-}
-
-//-------------------------------------------------------------------------
-// OnOkAudioParameters()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnOkAudioParameters(wxCommandEvent& event)
-{
-    int status = ExchangeData(EXCHANGE_DATA_OUT);
-
-    // We only accept OK if config sucessful
-
-    printf("status: %d m_isPaInitialized: %d\n", status, m_isPaInitialized);
-    if (status == 0) {
-        if(m_isPaInitialized)
-        {
-            if((pa_err = Pa_Terminate()) == paNoError)
-            {
-                printf("terminated OK\n");
-                m_isPaInitialized = false;
-            }
-            else
-            {
-                wxMessageBox(wxT("Port Audio failed to Terminate"), wxT("Pa_Terminate"), wxOK);
-            }
-        }
-        EndModal(wxOK);
-    }
-
-}
diff --git a/fdmdv2/branches/0.99/src/dlg_audiooptions.h b/fdmdv2/branches/0.99/src/dlg_audiooptions.h
deleted file mode 100644 (file)
index 7a78b59..0000000
+++ /dev/null
@@ -1,176 +0,0 @@
-//=========================================================================
-// Name:          AudioInfoDisplay.h
-// Purpose:       Declares simple wxWidgets application with GUI
-//                created using wxFormBuilder.
-// 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 <http://www.gnu.org/licenses/>.
-//
-//=========================================================================
-#ifndef __AudioOptsDialog__
-#define __AudioOptsDialog__
-
-#include "fdmdv2_main.h"
-
-#define ID_AUDIO_OPTIONS    1000
-#define AUDIO_IN            0
-#define AUDIO_OUT           1
-
-#include "portaudio.h"
-#ifdef WIN32
-#if PA_USE_ASIO
-#include "pa_asio.h"
-#endif
-#endif
-#include "codec2_fifo.h"
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// AudioInfoDisplay
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class AudioInfoDisplay
-{
-    public:
-        wxListCtrl*     m_listDevices;
-        int             direction;
-        wxTextCtrl*     m_textDevice;
-        wxComboBox*     m_cbSampleRate;
-};
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// class AudioOptsDialog
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class AudioOptsDialog : public wxDialog
-{
-    private:
-
-    protected:
-        PaError         pa_err;
-        bool            m_isPaInitialized;
-
-        int             rxInAudioDeviceNum;
-        int             rxOutAudioDeviceNum;
-        int             txInAudioDeviceNum;
-        int             txOutAudioDeviceNum;
-
-        void buildTestControls(PlotScalar **plotScalar, wxButton **btnTest, 
-                               wxPanel *parentPanel, wxBoxSizer *bSizer, wxString buttonLabel);
-        void plotDeviceInputForAFewSecs(int devNum, PlotScalar *plotScalar);
-        void plotDeviceOutputForAFewSecs(int devNum, PlotScalar *plotScalar);
-
-        int buildListOfSupportedSampleRates(wxComboBox *cbSampleRate, int devNum, int in_out);
-        void populateParams(AudioInfoDisplay);
-        void showAPIInfo();
-        int setTextCtrlIfDevNumValid(wxTextCtrl *textCtrl, wxListCtrl *listCtrl, int devNum);
-        void Pa_Init(void);
-        void OnDeviceSelect(wxComboBox *cbSampleRate, 
-                            wxTextCtrl *textCtrl, 
-                            int        *devNum, 
-                            wxListCtrl *listCtrlDevices, 
-                            int         index,
-                            int         in_out);
-
-        AudioInfoDisplay m_RxInDevices;
-        AudioInfoDisplay m_RxOutDevices;
-        AudioInfoDisplay m_TxInDevices;
-        AudioInfoDisplay m_TxOutDevices;
-        wxPanel* m_panel1;
-        wxNotebook* m_notebook1;
-
-        wxPanel* m_panelRx;
-
-        wxListCtrl* m_listCtrlRxInDevices;
-        wxStaticText* m_staticText51;
-        wxTextCtrl* m_textCtrlRxIn;
-        wxStaticText* m_staticText6;
-        wxComboBox* m_cbSampleRateRxIn;
-
-        wxButton* m_btnRxInTest;
-        PlotScalar* m_plotScalarRxIn;
-
-        wxListCtrl* m_listCtrlRxOutDevices;
-        wxStaticText* m_staticText9;
-        wxTextCtrl* m_textCtrlRxOut;
-        wxStaticText* m_staticText10;
-        wxComboBox* m_cbSampleRateRxOut;
-
-        wxButton* m_btnRxOutTest;
-        PlotScalar* m_plotScalarRxOut;
-
-        wxPanel* m_panelTx;
-
-        wxListCtrl* m_listCtrlTxInDevices;
-        wxStaticText* m_staticText12;
-        wxTextCtrl* m_textCtrlTxIn;
-        wxStaticText* m_staticText11;
-        wxComboBox* m_cbSampleRateTxIn;
-
-        wxButton* m_btnTxInTest;
-        PlotScalar* m_plotScalarTxIn;
-
-        wxListCtrl* m_listCtrlTxOutDevices;
-        wxStaticText* m_staticText81;
-        wxTextCtrl* m_textCtrlTxOut;
-        wxStaticText* m_staticText71;
-        wxComboBox* m_cbSampleRateTxOut;
-
-        wxButton* m_btnTxOutTest;
-        PlotScalar* m_plotScalarTxOut;
-
-        wxPanel* m_panelAPI;
-
-        wxStaticText* m_staticText7;
-        wxStaticText* m_textStringVer;
-        wxStaticText* m_staticText8;
-        wxStaticText* m_textIntVer;
-        wxStaticText* m_staticText5;
-        wxStaticText* m_textCDevCount;
-        wxStaticText* m_staticText4;
-        wxStaticText* m_textAPICount;
-        wxButton* m_btnRefresh;
-        wxStdDialogButtonSizer* m_sdbSizer1;
-        wxButton* m_sdbSizer1OK;
-        wxButton* m_sdbSizer1Apply;
-        wxButton* m_sdbSizer1Cancel;
-
-        // Virtual event handlers, overide them in your derived class
-        //virtual void OnActivateApp( wxActivateEvent& event ) { event.Skip(); }
-//        virtual void OnCloseFrame( wxCloseEvent& event ) { event.Skip(); }
-
-        void OnRxInDeviceSelect( wxListEvent& event );
-
-        void OnRxInTest( wxCommandEvent& event );
-        void OnRxOutTest( wxCommandEvent& event );
-        void OnTxInTest( wxCommandEvent& event );
-        void OnTxOutTest( wxCommandEvent& event );
-
-        void OnRxOutDeviceSelect( wxListEvent& event );
-        void OnTxInDeviceSelect( wxListEvent& event );
-        void OnTxOutDeviceSelect( wxListEvent& event );
-        void OnRefreshClick( wxCommandEvent& event );
-        void OnApplyAudioParameters( wxCommandEvent& event );
-        void OnCancelAudioParameters( wxCommandEvent& event );
-        void OnOkAudioParameters( wxCommandEvent& event );
-        // Virtual event handlers, overide them in your derived class
-        void OnClose( wxCloseEvent& event ) { event.Skip(); }
-        void OnHibernate( wxActivateEvent& event ) { event.Skip(); }
-        void OnIconize( wxIconizeEvent& event ) { event.Skip(); }
-        void OnInitDialog( wxInitDialogEvent& event );
-
-    public:
-
-        AudioOptsDialog( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Audio Config"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 300,300 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
-        ~AudioOptsDialog();
-        int ExchangeData(int inout);
-};
-#endif //__AudioOptsDialog__
diff --git a/fdmdv2/branches/0.99/src/dlg_filter.cpp b/fdmdv2/branches/0.99/src/dlg_filter.cpp
deleted file mode 100644 (file)
index 0de8e8c..0000000
+++ /dev/null
@@ -1,786 +0,0 @@
-//==========================================================================
-// Name:            dlg_filter.cpp
-// Purpose:         Dialog for controlling Codec audio filtering
-// Date:            Nov 25 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#include "dlg_filter.h"
-
-#define SLIDER_MAX 100
-#define SLIDER_LENGTH 100
-
-#define FILTER_MIN_MAG_DB -20.0
-#define FILTER_MAX_MAG_DB  20.0
-
-#define MAX_FREQ_BASS      600.00
-#define MAX_FREQ_TREBLE   3900.00
-#define MAX_FREQ_DEF      3000.00
-
-#define MIN_GAIN          -20
-#define MAX_GAIN           20
-
-#define MAX_LOG10_Q         1.0
-#define MIN_LOG10_Q        -1.0 
-
-// DFT parameters
-
-#define IMP_AMP           2000.0                     // amplitude of impulse
-#define NIMP              50                         // number of samples in impulse response
-#define F_STEP_DFT        10.0                       // frequency steps to sample spectrum
-#define F_MAG_N           (int)(MAX_F_HZ/F_STEP_DFT) // number of frequency steps
-
-extern struct freedv      *g_pfreedv;
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class FilterDlg
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-FilterDlg::FilterDlg(wxWindow* parent, bool running, bool *newMicInFilter, bool *newSpkOutFilter,
-                     wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style)
-{
-    m_running = running;
-    m_newMicInFilter = newMicInFilter;
-    m_newSpkOutFilter = newSpkOutFilter;
-
-    this->SetSizeHints(wxDefaultSize, wxDefaultSize);
-
-    wxBoxSizer* bSizer30;
-    bSizer30 = new wxBoxSizer(wxVERTICAL);
-
-    // LPC Post Filter --------------------------------------------------------
-
-    wxStaticBoxSizer* lpcpfs = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("LPC Post Filter")), wxHORIZONTAL);
-
-    wxBoxSizer* left = new wxBoxSizer(wxVERTICAL);
-
-    m_codec2LPCPostFilterEnable = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition,wxDefaultSize, wxCHK_2STATE);
-    left->Add(m_codec2LPCPostFilterEnable);
-
-    m_codec2LPCPostFilterBassBoost = new wxCheckBox(this, wxID_ANY, _("0-1 kHz 3dB Boost"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
-    left->Add(m_codec2LPCPostFilterBassBoost);
-    lpcpfs->Add(left, 0, wxALL, 5);
-
-    newLPCPFControl(&m_codec2LPCPostFilterBeta, &m_staticTextBeta, lpcpfs, "Beta");
-    newLPCPFControl(&m_codec2LPCPostFilterGamma, &m_staticTextGamma, lpcpfs, "Gamma");
-
-    m_LPCPostFilterDefault = new wxButton(this, wxID_ANY, wxT("Default"));
-    lpcpfs->Add(m_LPCPostFilterDefault, 0, wxALL|wxALIGN_CENTRE_HORIZONTAL|wxALIGN_CENTRE_VERTICAL, 5);
-
-    bSizer30->Add(lpcpfs, 0, wxALL, 0);
-
-    // Speex pre-processor --------------------------------------------------
-
-    wxStaticBoxSizer* sbSizer_speexpp;
-    wxStaticBox *sb_speexpp = new wxStaticBox(this, wxID_ANY, _("Speex Mic Audio Pre-Processor"));
-    sbSizer_speexpp = new wxStaticBoxSizer(sb_speexpp, wxVERTICAL);
-
-    m_ckboxSpeexpp = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
-    sb_speexpp->SetToolTip(_("Enable noise supression, dereverberation, AGC of mic signal"));
-    sbSizer_speexpp->Add(m_ckboxSpeexpp, wxALIGN_LEFT, 2);
-
-    bSizer30->Add(sbSizer_speexpp, 0, wxALL, 0);   
-
-    // EQ Filters -----------------------------------------------------------
-
-    wxStaticBoxSizer* eqMicInSizer = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Mic In Equaliser")), wxVERTICAL);
-    wxBoxSizer* eqMicInSizer1 = new wxBoxSizer(wxHORIZONTAL);
-    wxBoxSizer* eqMicInSizer2 = new wxBoxSizer(wxHORIZONTAL);
-
-    m_MicInBass   = newEQ(eqMicInSizer1, "Bass"  , MAX_FREQ_BASS, disableQ);
-    m_MicInTreble = newEQ(eqMicInSizer1, "Treble", MAX_FREQ_TREBLE, disableQ);
-    eqMicInSizer->Add(eqMicInSizer1);
-
-    m_MicInEnable = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition,wxDefaultSize, wxCHK_2STATE);
-    eqMicInSizer2->Add(m_MicInEnable,0,wxALIGN_CENTRE_VERTICAL|wxRIGHT,10);
-    m_MicInMid    = newEQ(eqMicInSizer2, "Mid"   , MAX_FREQ_DEF, enableQ);
-    m_MicInDefault = new wxButton(this, wxID_ANY, wxT("Default"));
-    eqMicInSizer2->Add(m_MicInDefault,0,wxALIGN_CENTRE_VERTICAL|wxLEFT,20);
-    eqMicInSizer->Add(eqMicInSizer2);
-
-    wxStaticBoxSizer* eqSpkOutSizer = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Speaker Out Equaliser")), wxVERTICAL);
-    wxBoxSizer* eqSpkOutSizer1 = new wxBoxSizer(wxHORIZONTAL);
-    wxBoxSizer* eqSpkOutSizer2 = new wxBoxSizer(wxHORIZONTAL);
-
-    m_SpkOutBass   = newEQ(eqSpkOutSizer1, "Bass"  , MAX_FREQ_BASS, disableQ);
-    m_SpkOutTreble = newEQ(eqSpkOutSizer1, "Treble", MAX_FREQ_TREBLE, disableQ);
-    eqSpkOutSizer->Add(eqSpkOutSizer1);
-
-    m_SpkOutEnable = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition,wxDefaultSize, wxCHK_2STATE);
-    eqSpkOutSizer2->Add(m_SpkOutEnable,0,wxALIGN_CENTRE_VERTICAL|wxRIGHT,10);
-    m_SpkOutMid    = newEQ(eqSpkOutSizer2, "Mid"   , MAX_FREQ_DEF, enableQ);
-    m_SpkOutDefault = new wxButton(this, wxID_ANY, wxT("Default"));
-    eqSpkOutSizer2->Add(m_SpkOutDefault,0,wxALIGN_CENTRE_VERTICAL|wxLEFT,20);
-    eqSpkOutSizer->Add(eqSpkOutSizer2);
-    
-    bSizer30->Add(eqMicInSizer, 0, wxALL, 0);
-    bSizer30->Add(eqSpkOutSizer, 0, wxALL, 0);
-
-    // Storgage for spectrum magnitude plots ------------------------------------
-
-    m_MicInMagdB = new float[F_MAG_N];
-    for(int i=0; i<F_MAG_N; i++)
-        m_MicInMagdB[i] = 0.0;
-
-    m_SpkOutMagdB = new float[F_MAG_N];
-    for(int i=0; i<F_MAG_N; i++)
-        m_SpkOutMagdB[i] = 0.0;
-
-    // Spectrum Plots -----------------------------------------------------------
-
-    long nb_style = wxAUI_NB_BOTTOM | wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_MOVE | wxAUI_NB_SCROLL_BUTTONS;
-    m_auiNotebook = new wxAuiNotebook(this, wxID_ANY, wxDefaultPosition, wxSize(-1,200), nb_style);
-    m_auiNotebook->SetFont(wxFont(8, 70, 90, 90, false, wxEmptyString));
-
-    bSizer30->Add(m_auiNotebook, 0, wxEXPAND|wxALL, 3);
-    
-    m_MicInFreqRespPlot = new PlotSpectrum((wxFrame*) m_auiNotebook, m_MicInMagdB, F_MAG_N, FILTER_MIN_MAG_DB, FILTER_MAX_MAG_DB);
-    m_auiNotebook->AddPage(m_MicInFreqRespPlot, _("Microphone In Equaliser"));
-
-    m_SpkOutFreqRespPlot = new PlotSpectrum((wxFrame*)m_auiNotebook, m_SpkOutMagdB, F_MAG_N, FILTER_MIN_MAG_DB, FILTER_MAX_MAG_DB);
-    m_auiNotebook->AddPage(m_SpkOutFreqRespPlot, _("Speaker Out Equaliser"));
-
-    //  OK - Cancel buttons at the bottom --------------------------
-
-    wxBoxSizer* bSizer31 = new wxBoxSizer(wxHORIZONTAL);
-
-    m_sdbSizer5OK = new wxButton(this, wxID_OK);
-    bSizer31->Add(m_sdbSizer5OK, 0, wxALL, 2);
-
-    m_sdbSizer5Cancel = new wxButton(this, wxID_CANCEL);
-    bSizer31->Add(m_sdbSizer5Cancel, 0, wxALL, 2);
-
-    bSizer30->Add(bSizer31, 0, wxALIGN_RIGHT|wxALL, 0);
-
-    this->SetSizer(bSizer30);
-    this->Layout();
-
-    this->Centre(wxBOTH);
-    // Connect Events -------------------------------------------------------
-
-    this->Connect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(FilterDlg::OnInitDialog));
-
-    m_codec2LPCPostFilterEnable->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnEnable), NULL, this);
-    m_codec2LPCPostFilterBassBoost->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnBassBoost), NULL, this);
-    m_codec2LPCPostFilterBeta->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnBetaScroll), NULL, this);
-    m_codec2LPCPostFilterGamma->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnGammaScroll), NULL, this);
-    m_LPCPostFilterDefault->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnLPCPostFilterDefault), NULL, this);
-
-    m_ckboxSpeexpp->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnSpeexppEnable), NULL, this);
-
-    m_MicInBass.sliderFreq->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInBassFreqScroll), NULL, this);
-    m_MicInBass.sliderGain->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInBassGainScroll), NULL, this);
-    m_MicInTreble.sliderFreq->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInTrebleFreqScroll), NULL, this);
-    m_MicInTreble.sliderGain->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInTrebleGainScroll), NULL, this);
-    m_MicInMid.sliderFreq->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInMidFreqScroll), NULL, this);
-    m_MicInMid.sliderGain->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInMidGainScroll), NULL, this);
-    m_MicInMid.sliderQ->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInMidQScroll), NULL, this);
-    m_MicInEnable->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnMicInEnable), NULL, this);
-    m_MicInDefault->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnMicInDefault), NULL, this);
-
-    m_SpkOutBass.sliderFreq->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutBassFreqScroll), NULL, this);
-    m_SpkOutBass.sliderGain->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutBassGainScroll), NULL, this);
-    m_SpkOutTreble.sliderFreq->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutTrebleFreqScroll), NULL, this);
-    m_SpkOutTreble.sliderGain->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutTrebleGainScroll), NULL, this);
-    m_SpkOutMid.sliderFreq->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutMidFreqScroll), NULL, this);
-    m_SpkOutMid.sliderGain->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutMidGainScroll), NULL, this);
-    m_SpkOutMid.sliderQ->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutMidQScroll), NULL, this);
-    m_SpkOutEnable->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnSpkOutEnable), NULL, this);
-    m_SpkOutDefault->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnSpkOutDefault), NULL, this);
-
-    m_sdbSizer5Cancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnCancel), NULL, this);
-    m_sdbSizer5OK->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnOK), NULL, this);
-
-}
-
-//-------------------------------------------------------------------------
-// ~FilterDlg()
-//-------------------------------------------------------------------------
-FilterDlg::~FilterDlg()
-{
-    delete m_MicInMagdB;
-    delete m_SpkOutMagdB;
-
-    // Disconnect Events
-
-    this->Disconnect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(FilterDlg::OnInitDialog));
-
-    m_codec2LPCPostFilterEnable->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnEnable), NULL, this);
-    m_codec2LPCPostFilterBassBoost->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnBassBoost), NULL, this);
-    m_codec2LPCPostFilterBeta->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnBetaScroll), NULL, this);
-    m_codec2LPCPostFilterGamma->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnGammaScroll), NULL, this);
-    m_LPCPostFilterDefault->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnLPCPostFilterDefault), NULL, this);
-
-    m_MicInBass.sliderFreq->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInBassFreqScroll), NULL, this);
-    m_MicInBass.sliderGain->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInBassGainScroll), NULL, this);
-    m_MicInTreble.sliderFreq->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInTrebleFreqScroll), NULL, this);
-    m_MicInTreble.sliderGain->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInTrebleGainScroll), NULL, this);
-    m_MicInMid.sliderFreq->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInMidFreqScroll), NULL, this);
-    m_MicInMid.sliderGain->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInMidGainScroll), NULL, this);
-    m_MicInMid.sliderQ->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInMidQScroll), NULL, this);
-    m_MicInEnable->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnMicInEnable), NULL, this);
-    m_MicInDefault->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnMicInDefault), NULL, this);
-
-    m_SpkOutBass.sliderFreq->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutBassFreqScroll), NULL, this);
-    m_SpkOutBass.sliderGain->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutBassGainScroll), NULL, this);
-    m_SpkOutTreble.sliderFreq->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutTrebleFreqScroll), NULL, this);
-    m_SpkOutTreble.sliderGain->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutTrebleGainScroll), NULL, this);
-    m_SpkOutMid.sliderFreq->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutMidFreqScroll), NULL, this);
-    m_SpkOutMid.sliderGain->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutMidGainScroll), NULL, this);
-    m_SpkOutMid.sliderQ->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutMidQScroll), NULL, this);
-    m_SpkOutEnable->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnSpkOutEnable), NULL, this);
-    m_SpkOutDefault->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnSpkOutDefault), NULL, this);
-
-    m_sdbSizer5Cancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnCancel), NULL, this);
-    m_sdbSizer5OK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnOK), NULL, this);
-}
-
-void FilterDlg::newLPCPFControl(wxSlider **slider, wxStaticText **stValue, wxSizer *s, wxString controlName)
-{
-    wxBoxSizer *bs = new wxBoxSizer(wxHORIZONTAL);
-
-    wxStaticText* st = new wxStaticText(this, wxID_ANY, controlName, wxDefaultPosition, wxSize(70,-1), wxALIGN_RIGHT);
-    bs->Add(st, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 2);
-
-    *slider = new wxSlider(this, wxID_ANY, 0, 0, SLIDER_MAX, wxDefaultPosition, wxSize(SLIDER_LENGTH,wxDefaultCoord));
-    bs->Add(*slider, 1, wxALIGN_CENTER_VERTICAL|wxALL, 2);
-
-    *stValue = new wxStaticText(this, wxID_ANY, wxT("0.0"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
-    bs->Add(*stValue, 1, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxALL, 2);
-
-    s->Add(bs, 0);
-}
-
-void FilterDlg::newEQControl(wxSlider** slider, wxStaticText** value, wxStaticBoxSizer *bs, wxString controlName)
-{
-    wxStaticText* label = new wxStaticText(this, wxID_ANY, controlName, wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
-    bs->Add(label, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 0);
-
-    *slider = new wxSlider(this, wxID_ANY, 0, 0, SLIDER_MAX, wxDefaultPosition, wxSize(SLIDER_LENGTH,wxDefaultCoord));
-    bs->Add(*slider, 1, wxALIGN_CENTER_VERTICAL|wxALL, 0);
-
-    *value = new wxStaticText(this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(40,-1), wxALIGN_LEFT);
-    bs->Add(*value, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxRIGHT, 5);
-}
-
-EQ FilterDlg::newEQ(wxSizer *bs, wxString eqName, float maxFreqHz, bool enableQ)
-{
-    EQ eq;
-
-    wxStaticBoxSizer *bsEQ = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, eqName), wxHORIZONTAL);
-
-    newEQControl(&eq.sliderFreq, &eq.valueFreq, bsEQ, "Freq"); 
-    eq.maxFreqHz = maxFreqHz; 
-    eq.sliderFreqId = eq.sliderFreq->GetId();
-
-    newEQControl(&eq.sliderGain, &eq.valueGain, bsEQ, "Gain");
-    if (enableQ)
-        newEQControl(&eq.sliderQ, &eq.valueQ, bsEQ, "Q");
-    else
-        eq.sliderQ = NULL;
-
-    bs->Add(bsEQ);
-
-    return eq;
-}
-
-//-------------------------------------------------------------------------
-// ExchangeData()
-//-------------------------------------------------------------------------
-void FilterDlg::ExchangeData(int inout, bool storePersistent)
-{
-    wxConfigBase *pConfig = wxConfigBase::Get();
-    if(inout == EXCHANGE_DATA_IN)
-    {
-        // LPC Post filter
-
-        m_codec2LPCPostFilterEnable->SetValue(wxGetApp().m_codec2LPCPostFilterEnable);
-        m_codec2LPCPostFilterBassBoost->SetValue(wxGetApp().m_codec2LPCPostFilterBassBoost);
-        m_beta = wxGetApp().m_codec2LPCPostFilterBeta; setBeta();
-        m_gamma = wxGetApp().m_codec2LPCPostFilterGamma; setGamma();
-
-        // Speex Pre-Processor
-
-        m_ckboxSpeexpp->SetValue(wxGetApp().m_speexpp_enable);
-
-        // Mic In Equaliser
-
-        m_MicInBass.freqHz = wxGetApp().m_MicInBassFreqHz; 
-        m_MicInBass.freqHz = limit(m_MicInBass.freqHz, 1.0, MAX_FREQ_BASS);
-        setFreq(&m_MicInBass);
-        m_MicInBass.gaindB = wxGetApp().m_MicInBassGaindB;
-        m_MicInBass.gaindB = limit(m_MicInBass.gaindB, MIN_GAIN, MAX_GAIN);
-        setGain(&m_MicInBass);
-
-        m_MicInTreble.freqHz = wxGetApp().m_MicInTrebleFreqHz;
-        m_MicInTreble.freqHz = limit(m_MicInTreble.freqHz, 1.0, MAX_FREQ_TREBLE);
-        setFreq(&m_MicInTreble);
-        m_MicInTreble.gaindB = wxGetApp().m_MicInTrebleGaindB; 
-        m_MicInTreble.gaindB = limit(m_MicInTreble.gaindB, MIN_GAIN, MAX_GAIN);
-        setGain(&m_MicInTreble);
-
-        m_MicInMid.freqHz = wxGetApp().m_MicInMidFreqHz; 
-        m_MicInMid.freqHz = limit(m_MicInMid.freqHz, 1.0, MAX_FREQ_TREBLE);
-        setFreq(&m_MicInMid);
-        m_MicInMid.gaindB = wxGetApp().m_MicInMidGaindB; 
-        m_MicInMid.gaindB = limit(m_MicInMid.gaindB, MIN_GAIN, MAX_GAIN);
-        setGain(&m_MicInMid);
-        m_MicInMid.Q = wxGetApp().m_MicInMidQ;
-        m_MicInMid.Q = limit(m_MicInMid.Q, pow(10.0,MIN_LOG10_Q), pow(10.0, MAX_LOG10_Q));
-        setQ(&m_MicInMid);
-
-        m_MicInEnable->SetValue(wxGetApp().m_MicInEQEnable);
-
-        plotMicInFilterSpectrum();
-        // Spk Out Equaliser
-
-        m_SpkOutBass.freqHz = wxGetApp().m_SpkOutBassFreqHz;
-        m_SpkOutBass.freqHz = limit(m_SpkOutBass.freqHz, 1.0, MAX_FREQ_BASS);
-        setFreq(&m_SpkOutBass);
-        m_SpkOutBass.gaindB = wxGetApp().m_SpkOutBassGaindB; 
-        m_SpkOutBass.gaindB = limit(m_SpkOutBass.gaindB, MIN_GAIN, MAX_GAIN);
-        setGain(&m_SpkOutBass);
-
-        m_SpkOutTreble.freqHz = wxGetApp().m_SpkOutTrebleFreqHz; 
-        m_SpkOutTreble.freqHz = limit(m_SpkOutTreble.freqHz, 1.0, MAX_FREQ_TREBLE);
-        setFreq(&m_SpkOutTreble);
-        m_SpkOutTreble.gaindB = wxGetApp().m_SpkOutTrebleGaindB; 
-        m_SpkOutTreble.gaindB = limit(m_SpkOutTreble.gaindB, MIN_GAIN, MAX_GAIN);
-        setGain(&m_SpkOutTreble);
-
-        m_SpkOutMid.freqHz = wxGetApp().m_SpkOutMidFreqHz;
-        m_SpkOutMid.freqHz = limit(m_SpkOutMid.freqHz, 1.0, MAX_FREQ_TREBLE);
-        setFreq(&m_SpkOutMid);
-        m_SpkOutMid.gaindB = wxGetApp().m_SpkOutMidGaindB;
-        m_SpkOutMid.gaindB = limit(m_SpkOutMid.gaindB, MIN_GAIN, MAX_GAIN);
-        setGain(&m_SpkOutMid);
-        m_SpkOutMid.Q = wxGetApp().m_SpkOutMidQ;
-        m_SpkOutMid.Q = limit(m_SpkOutMid.Q, pow(10.0,MIN_LOG10_Q), pow(10.0, MAX_LOG10_Q));
-        setQ(&m_SpkOutMid);
-
-        m_SpkOutEnable->SetValue(wxGetApp().m_SpkOutEQEnable);
-
-        plotSpkOutFilterSpectrum();
-    }
-    if(inout == EXCHANGE_DATA_OUT)
-    {
-        // LPC Post filter
-
-        wxGetApp().m_codec2LPCPostFilterEnable     = m_codec2LPCPostFilterEnable->GetValue();
-        wxGetApp().m_codec2LPCPostFilterBassBoost  = m_codec2LPCPostFilterBassBoost->GetValue();
-        wxGetApp().m_codec2LPCPostFilterBeta       = m_beta;
-        wxGetApp().m_codec2LPCPostFilterGamma      = m_gamma;
-
-        // Speex Pre-Processor
-
-        wxGetApp().m_speexpp_enable = m_ckboxSpeexpp->GetValue();
-
-        // Mic In Equaliser
-
-        wxGetApp().m_MicInBassFreqHz = m_MicInBass.freqHz;
-        wxGetApp().m_MicInBassGaindB = m_MicInBass.gaindB;
-
-        wxGetApp().m_MicInTrebleFreqHz = m_MicInTreble.freqHz;
-        wxGetApp().m_MicInTrebleGaindB = m_MicInTreble.gaindB;
-
-        wxGetApp().m_MicInMidFreqHz = m_MicInMid.freqHz;
-        wxGetApp().m_MicInMidGaindB = m_MicInMid.gaindB;
-        wxGetApp().m_MicInMidQ = m_MicInMid.Q;
-
-        // Spk Out Equaliser
-
-        wxGetApp().m_SpkOutBassFreqHz = m_SpkOutBass.freqHz;
-        wxGetApp().m_SpkOutBassGaindB = m_SpkOutBass.gaindB;
-
-        wxGetApp().m_SpkOutTrebleFreqHz = m_SpkOutTreble.freqHz;
-        wxGetApp().m_SpkOutTrebleGaindB = m_SpkOutTreble.gaindB;
-
-        wxGetApp().m_SpkOutMidFreqHz = m_SpkOutMid.freqHz;
-        wxGetApp().m_SpkOutMidGaindB = m_SpkOutMid.gaindB;
-        wxGetApp().m_SpkOutMidQ = m_SpkOutMid.Q;
-
-        if (storePersistent) {
-            pConfig->Write(wxT("/Filter/codec2LPCPostFilterEnable"),     wxGetApp().m_codec2LPCPostFilterEnable);
-            pConfig->Write(wxT("/Filter/codec2LPCPostFilterBassBoost"),  wxGetApp().m_codec2LPCPostFilterBassBoost);
-            pConfig->Write(wxT("/Filter/codec2LPCPostFilterBeta"),       (int)(m_beta*100.0));
-            pConfig->Write(wxT("/Filter/codec2LPCPostFilterGamma"),      (int)(m_gamma*100.0));
-
-            pConfig->Write(wxT("/Filter/speexpp_enable"),                wxGetApp().m_speexpp_enable);
-
-            pConfig->Write(wxT("/Filter/MicInBassFreqHz"), (int)m_MicInBass.freqHz);
-            pConfig->Write(wxT("/Filter/MicInBassGaindB"), (int)(10.0*m_MicInBass.gaindB));
-            pConfig->Write(wxT("/Filter/MicInTrebleFreqHz"), (int)m_MicInTreble.freqHz);
-            pConfig->Write(wxT("/Filter/MicInTrebleGaindB"), (int)(10.0*m_MicInTreble.gaindB));
-            pConfig->Write(wxT("/Filter/MicInMidFreqHz"), (int)m_MicInMid.freqHz);
-            pConfig->Write(wxT("/Filter/MicInMidGaindB"), (int)(10.0*m_MicInMid.gaindB));
-            pConfig->Write(wxT("/Filter/MicInMidQ"), (int)(100.0*m_MicInMid.Q));
-
-            pConfig->Write(wxT("/Filter/SpkOutBassFreqHz"), (int)m_SpkOutBass.freqHz);
-            pConfig->Write(wxT("/Filter/SpkOutBassGaindB"), (int)(10.0*m_SpkOutBass.gaindB));
-            pConfig->Write(wxT("/Filter/SpkOutTrebleFreqHz"), (int)m_SpkOutTreble.freqHz);
-            pConfig->Write(wxT("/Filter/SpkOutTrebleGaindB"), (int)(10.0*m_SpkOutTreble.gaindB));
-            pConfig->Write(wxT("/Filter/SpkOutMidQ"), (int)(100.0*m_SpkOutMid.Q));
-            pConfig->Write(wxT("/Filter/SpkOutMidFreqHz"), (int)m_SpkOutMid.freqHz);
-            pConfig->Write(wxT("/Filter/SpkOutMidGaindB"), (int)(10.0*m_SpkOutMid.gaindB));
-
-            pConfig->Flush();
-        }
-    }
-    delete wxConfigBase::Set((wxConfigBase *) NULL);
-}
-
-float FilterDlg::limit(float value, float min, float max) {
-    if (value < min) return min;
-    if (value > max) return max;
-    return value;
-}
-
-//-------------------------------------------------------------------------
-// OnCancel()
-//-------------------------------------------------------------------------
-void FilterDlg::OnCancel(wxCommandEvent& event)
-{
-    this->EndModal(wxID_CANCEL);
-}
-
-//-------------------------------------------------------------------------
-// OnDefault()
-//-------------------------------------------------------------------------
-
-void FilterDlg::OnLPCPostFilterDefault(wxCommandEvent& event)
-{
-    m_beta = CODEC2_LPC_PF_BETA; setBeta();
-    m_gamma = CODEC2_LPC_PF_GAMMA; setGamma();
-    m_codec2LPCPostFilterEnable->SetValue(true);
-    m_codec2LPCPostFilterBassBoost->SetValue(true);
-}
-
-void FilterDlg::OnMicInDefault(wxCommandEvent& event)
-{
-    m_MicInBass.freqHz = 100.0;
-    m_MicInBass.gaindB = 0.0;
-    setFreq(&m_MicInBass); setGain(&m_MicInBass); 
-
-    m_MicInTreble.freqHz = 3000.0;
-    m_MicInTreble.gaindB = 0.0;
-    setFreq(&m_MicInTreble); setGain(&m_MicInTreble); 
-
-    m_MicInMid.freqHz = 1500.0;
-    m_MicInMid.gaindB = 0.0;
-    m_MicInMid.Q = 1.0;
-    setFreq(&m_MicInMid); setGain(&m_MicInMid); setQ(&m_MicInMid); 
-
-    plotMicInFilterSpectrum();    
-}
-
-void FilterDlg::OnSpkOutDefault(wxCommandEvent& event)
-{
-    m_SpkOutBass.freqHz = 100.0;
-    m_SpkOutBass.gaindB = 0.0;
-    setFreq(&m_SpkOutBass); setGain(&m_SpkOutBass); 
-
-    m_SpkOutTreble.freqHz = 3000.0;
-    m_SpkOutTreble.gaindB = 0.0;
-    setFreq(&m_SpkOutTreble); setGain(&m_SpkOutTreble); 
-
-    m_SpkOutMid.freqHz = 1500.0;
-    m_SpkOutMid.gaindB = 0.0;
-    m_SpkOutMid.Q = 1.0;
-    setFreq(&m_SpkOutMid); setGain(&m_SpkOutMid); setQ(&m_SpkOutMid); 
-
-    plotSpkOutFilterSpectrum();    
-}
-
-//-------------------------------------------------------------------------
-// OnOK()
-//-------------------------------------------------------------------------
-void FilterDlg::OnOK(wxCommandEvent& event)
-{
-    //printf("FilterDlg::OnOK\n");
-    ExchangeData(EXCHANGE_DATA_OUT, true);
-    this->EndModal(wxID_OK);
-}
-
-//-------------------------------------------------------------------------
-// OnClose()
-//-------------------------------------------------------------------------
-void FilterDlg::OnClose(wxCloseEvent& event)
-{
-    this->EndModal(wxID_OK);
-}
-
-//-------------------------------------------------------------------------
-// OnInitDialog()
-//-------------------------------------------------------------------------
-void FilterDlg::OnInitDialog(wxInitDialogEvent& event)
-{
-    //printf("FilterDlg::OnInitDialog\n");
-    ExchangeData(EXCHANGE_DATA_IN, false);
-    //printf("m_beta: %f\n", m_beta);
-}
-
-void FilterDlg::setBeta(void) {
-    wxString buf;
-    buf.Printf(wxT("%3.2f"), m_beta);
-    m_staticTextBeta->SetLabel(buf);
-    int slider = (int)(m_beta*SLIDER_MAX + 0.5);
-    m_codec2LPCPostFilterBeta->SetValue(slider);
-}
-
-void FilterDlg::setCodec2(void) {
-    if (m_running) {
-        assert(g_pfreedv->codec2 != NULL);
-        codec2_set_lpc_post_filter(g_pfreedv->codec2, 
-                               m_codec2LPCPostFilterEnable->GetValue(), 
-                               m_codec2LPCPostFilterBassBoost->GetValue(), 
-                               m_beta, m_gamma);
-    }
-}
-
-void FilterDlg::setGamma(void) {
-    wxString buf;
-    buf.Printf(wxT("%3.2f"), m_gamma);
-    m_staticTextGamma->SetLabel(buf);
-    int slider = (int)(m_gamma*SLIDER_MAX + 0.5);
-    m_codec2LPCPostFilterGamma->SetValue(slider);
-}
-
-void FilterDlg::OnEnable(wxScrollEvent& event) {
-    setCodec2();    
-}
-
-void FilterDlg::OnBassBoost(wxScrollEvent& event) {
-    setCodec2();    
-}
-
-void FilterDlg::OnBetaScroll(wxScrollEvent& event) {
-    m_beta = (float)m_codec2LPCPostFilterBeta->GetValue()/SLIDER_MAX;
-    setBeta();
-    setCodec2();
-}
-
-void FilterDlg::OnGammaScroll(wxScrollEvent& event) {
-    m_gamma = (float)m_codec2LPCPostFilterGamma->GetValue()/SLIDER_MAX;
-    setGamma();
-    setCodec2();
-}
-
-// immediately change enable flags rather using ExchangeData() so we can switch on and off at run time
-
-void FilterDlg::OnSpeexppEnable(wxScrollEvent& event) {
-    wxGetApp().m_speexpp_enable = m_ckboxSpeexpp->GetValue();
-}
-
-void FilterDlg::OnMicInEnable(wxScrollEvent& event) {
-    wxGetApp().m_MicInEQEnable = m_MicInEnable->GetValue();
-}
-
-void FilterDlg::OnSpkOutEnable(wxScrollEvent& event) {
-    wxGetApp().m_SpkOutEQEnable = m_SpkOutEnable->GetValue();
-    //printf("wxGetApp().m_SpkOutEQEnable: %d\n", wxGetApp().m_SpkOutEQEnable);
-}
-
-void FilterDlg::setFreq(EQ *eq)
-{
-    wxString buf;
-    buf.Printf(wxT("%3.0f"), eq->freqHz);
-    eq->valueFreq->SetLabel(buf);
-    int slider = (int)((eq->freqHz/eq->maxFreqHz)*SLIDER_MAX + 0.5);
-    eq->sliderFreq->SetValue(slider);
-}
-
-void FilterDlg::sliderToFreq(EQ *eq, bool micIn)
-{
-    eq->freqHz = ((float)eq->sliderFreq->GetValue()/SLIDER_MAX)*eq->maxFreqHz;
-    if (eq->freqHz < 1.0) eq->freqHz = 1.0; // sox doesn't like 0 Hz;
-    setFreq(eq);
-    if (micIn) {
-        plotMicInFilterSpectrum();
-        adjRunTimeMicInFilter();
-    }
-    else {
-        plotSpkOutFilterSpectrum();
-        adjRunTimeSpkOutFilter();
-    }
-}
-
-void FilterDlg::setGain(EQ *eq)
-{
-    wxString buf;
-    buf.Printf(wxT("%3.1f"), eq->gaindB);
-    eq->valueGain->SetLabel(buf);
-    int slider = (int)(((eq->gaindB-MIN_GAIN)/(MAX_GAIN-MIN_GAIN))*SLIDER_MAX + 0.5);
-    eq->sliderGain->SetValue(slider);
-}
-
-void FilterDlg::sliderToGain(EQ *eq, bool micIn)
-{
-    float range = MAX_GAIN-MIN_GAIN;
-    
-    eq->gaindB = MIN_GAIN + range*((float)eq->sliderGain->GetValue()/SLIDER_MAX);
-    //printf("gaindB: %f\n", eq->gaindB);
-    setGain(eq);
-    if (micIn) {
-        plotMicInFilterSpectrum();
-        adjRunTimeMicInFilter();
-    }
-    else {
-        plotSpkOutFilterSpectrum();
-        adjRunTimeSpkOutFilter();
-    }
-        
-}
-
-void FilterDlg::setQ(EQ *eq)
-{
-    wxString buf;
-    buf.Printf(wxT("%2.1f"), eq->Q);
-    eq->valueQ->SetLabel(buf);
-
-    float log10_range = MAX_LOG10_Q - MIN_LOG10_Q;
-
-    int slider = (int)(((log10(eq->Q+1E-6)-MIN_LOG10_Q)/log10_range)*SLIDER_MAX + 0.5);
-    eq->sliderQ->SetValue(slider);
-}
-
-void FilterDlg::sliderToQ(EQ *eq, bool micIn)
-{
-    float log10_range = MAX_LOG10_Q - MIN_LOG10_Q;
-    
-    float sliderNorm = (float)eq->sliderQ->GetValue()/SLIDER_MAX;
-    float log10Q =  MIN_LOG10_Q + sliderNorm*(log10_range);
-    eq->Q = pow(10.0, log10Q);
-    //printf("log10Q: %f eq->Q: %f\n", log10Q, eq->Q);
-    setQ(eq);
-    if (micIn) {
-        plotMicInFilterSpectrum();
-        adjRunTimeMicInFilter();
-    }
-    else {
-        plotSpkOutFilterSpectrum();
-        adjRunTimeSpkOutFilter();
-    }
-}
-
-void FilterDlg::plotMicInFilterSpectrum(void) {
-    plotFilterSpectrum(&m_MicInBass, &m_MicInMid, &m_MicInTreble, m_MicInFreqRespPlot, m_MicInMagdB);
-}
-
-void FilterDlg::plotSpkOutFilterSpectrum(void) {
-    plotFilterSpectrum(&m_SpkOutBass, &m_SpkOutMid, &m_SpkOutTreble, m_SpkOutFreqRespPlot, m_SpkOutMagdB);
-}
-
-void FilterDlg::adjRunTimeMicInFilter(void) {
-    // signal an adjustment in running filter coeffs
-
-    if (m_running) {
-        ExchangeData(EXCHANGE_DATA_OUT, false);
-        *m_newMicInFilter = true;
-    }
-}
-        
-void FilterDlg::adjRunTimeSpkOutFilter(void) {
-    // signal an adjustment in running filter coeffs
-
-    if (m_running) {
-        ExchangeData(EXCHANGE_DATA_OUT, false);
-        *m_newSpkOutFilter = true;
-    }
-}
-        
-
-void FilterDlg::plotFilterSpectrum(EQ *eqBass, EQ *eqMid, EQ *eqTreble, PlotSpectrum* freqRespPlot, float *magdB) {
-    char  *argBass[10];
-    char  *argTreble[10];
-    char  *argMid[10];
-    char   argstorage[10][80];
-    float magBass[F_MAG_N];
-    float magTreble[F_MAG_N];
-    float magMid[F_MAG_N];
-    int   i;
-
-    for(i=0; i<10; i++) {
-        argBass[i] = &argstorage[i][0];
-        argTreble[i] = &argstorage[i][0];
-        argMid[i] = &argstorage[i][0];
-    }
-    sprintf(argBass[0], "bass");                
-    sprintf(argBass[1], "%f", eqBass->gaindB+1E-6);
-    sprintf(argBass[2], "%f", eqBass->freqHz);      
-
-    calcFilterSpectrum(magBass, 2, argBass);
-
-    sprintf(argTreble[0], "treble");                
-    sprintf(argTreble[1], "%f", eqTreble->gaindB+1E-6);
-    sprintf(argTreble[2], "%f", eqTreble->freqHz);      
-
-    calcFilterSpectrum(magTreble, 2, argTreble);
-
-    sprintf(argTreble[0], "equalizer");                
-    sprintf(argTreble[1], "%f", eqMid->freqHz);      
-    sprintf(argTreble[2], "%f", eqMid->Q);      
-    sprintf(argTreble[3], "%f", eqMid->gaindB+1E-6);
-
-    calcFilterSpectrum(magMid, 3, argMid);
-
-    for(i=0; i<F_MAG_N; i++)
-        magdB[i] = magBass[i] + magMid[i] + magTreble[i];
-    freqRespPlot->m_newdata = true;
-    freqRespPlot->Refresh();
-}
-
-void FilterDlg::calcFilterSpectrum(float magdB[], int argc, char *argv[]) {
-    void       *sbq;
-    short       in[NIMP];
-    short       out[NIMP];
-    COMP        X[F_MAG_N];
-    float       f, w;
-    int         i, k;
-
-    // find impulse response -----------------------------------
-
-    for(i=0; i<NIMP; i++)
-        in[i] = 0;
-    in[0] = IMP_AMP;
-
-    //printf("argv[0]: %s argv[1]: %s\n", argv[0], argv[1]);
-    sbq = sox_biquad_create(argc, (const char **)argv);
-
-    sox_biquad_filter(sbq, out, in, NIMP);
-    //for(i=0; i<NIMP; i++)
-    //    printf("%d\n", out[i]);
-   
-    sox_biquad_destroy(sbq);
-
-    //for(i=0; i<NIMP; i++)
-    //    out[i] = 0.0;
-    //out[0] = IMP_AMP;
-
-    // calculate discrete time continous frequency Fourer transform
-    // doing this from first principles rather than FFT for no good reason
-
-    for(f=0,i=0; f<MAX_F_HZ; f+=F_STEP_DFT,i++) {
-        w = M_PI*f/(FS/2);
-        X[i].real = 0.0; X[i].imag = 0.0;
-        for(k=0; k<NIMP; k++) {
-            X[i].real += ((float)out[k]/IMP_AMP) * cos(w*k);
-            X[i].imag -= ((float)out[k]/IMP_AMP) * sin(w*k);
-        }
-        magdB[i] = 10.0*log10(X[i].real* X[i].real + X[i].imag*X[i].imag + 1E-12);
-        //printf("f: %f X[%d] = %f %f magdB = %f\n", f, i, X[i].real, X[i].imag,  magdB[i]);
-    }
-}
diff --git a/fdmdv2/branches/0.99/src/dlg_filter.h b/fdmdv2/branches/0.99/src/dlg_filter.h
deleted file mode 100644 (file)
index 82c43df..0000000
+++ /dev/null
@@ -1,166 +0,0 @@
-//==========================================================================
-// Name:            dlg_filter.h
-// Purpose:         Dialog for controlling Codec audio filtering
-// Created:         Nov 25 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-
-#ifndef __FILTER_DIALOG__
-#define __FILTER_DIALOG__
-
-#include "fdmdv2_main.h"
-
-enum {disableQ = false, enableQ = true};
-
-typedef struct { 
-    wxSlider     *sliderFreq;
-    wxStaticText *valueFreq;
-    wxSlider     *sliderGain;
-    wxStaticText *valueGain;
-    wxSlider     *sliderQ;
-    wxStaticText *valueQ;
-
-    int       sliderFreqId;
-    int       sliderGainId;
-    int       sliderQId;
-    
-    float     freqHz;
-    float     gaindB;
-    float     Q;
-
-    float     maxFreqHz;
-} EQ;
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class FilterDlg
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class FilterDlg : public wxDialog
-{
-    public:
-    FilterDlg( wxWindow* parent, bool running, bool *newMicInFilter, bool *newSpkOutFilter,
-               wxWindowID id = wxID_ANY, const wxString& title = _("Filter"), 
-               const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 800, 630 ), 
-               long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
-        ~FilterDlg();
-
-        void    ExchangeData(int inout, bool storePersistent);
-
-    protected:
-        // Handlers for events.
-        void    OnCancel(wxCommandEvent& event);
-        void    OnOK(wxCommandEvent& event);
-        void    OnClose(wxCloseEvent& event);
-        void    OnInitDialog(wxInitDialogEvent& event);
-        void    OnLPCPostFilterDefault(wxCommandEvent& event);
-
-        void    OnBetaScroll(wxScrollEvent& event);
-        void    OnGammaScroll(wxScrollEvent& event);
-        void    OnEnable(wxScrollEvent& event);
-        void    OnBassBoost(wxScrollEvent& event);
-
-        void    OnSpeexppEnable(wxScrollEvent& event);
-
-        void    OnMicInBassFreqScroll(wxScrollEvent& event) { sliderToFreq(&m_MicInBass, true); }
-        void    OnMicInBassGainScroll(wxScrollEvent& event) { sliderToGain(&m_MicInBass, true); }
-        void    OnMicInTrebleFreqScroll(wxScrollEvent& event) { sliderToFreq(&m_MicInTreble, true); }
-        void    OnMicInTrebleGainScroll(wxScrollEvent& event) { sliderToGain(&m_MicInTreble, true); }
-        void    OnMicInMidFreqScroll(wxScrollEvent& event) { sliderToFreq(&m_MicInMid, true); }
-        void    OnMicInMidGainScroll(wxScrollEvent& event) { sliderToGain(&m_MicInMid, true); }
-        void    OnMicInMidQScroll(wxScrollEvent& event) { sliderToQ(&m_MicInMid, true); }
-        void    OnMicInEnable(wxScrollEvent& event);
-        void    OnMicInDefault(wxCommandEvent& event);
-
-        void    OnSpkOutBassFreqScroll(wxScrollEvent& event) { sliderToFreq(&m_SpkOutBass, false); }
-        void    OnSpkOutBassGainScroll(wxScrollEvent& event) { sliderToGain(&m_SpkOutBass, false); }
-        void    OnSpkOutTrebleFreqScroll(wxScrollEvent& event) { sliderToFreq(&m_SpkOutTreble, false); }
-        void    OnSpkOutTrebleGainScroll(wxScrollEvent& event) { sliderToGain(&m_SpkOutTreble, false); }
-        void    OnSpkOutMidFreqScroll(wxScrollEvent& event) { sliderToFreq(&m_SpkOutMid, false); }
-        void    OnSpkOutMidGainScroll(wxScrollEvent& event) { sliderToGain(&m_SpkOutMid, false); }
-        void    OnSpkOutMidQScroll(wxScrollEvent& event) { sliderToQ(&m_SpkOutMid, false); }
-        void    OnSpkOutEnable(wxScrollEvent& event);
-        void    OnSpkOutDefault(wxCommandEvent& event);
-
-        wxStaticText* m_staticText8;
-        wxCheckBox*   m_codec2LPCPostFilterEnable;
-        wxStaticText* m_staticText9;
-        wxCheckBox*   m_codec2LPCPostFilterBassBoost;
-        wxStaticText* m_staticText91;
-        wxSlider*     m_codec2LPCPostFilterBeta;
-        wxStaticText* m_staticTextBeta;
-        wxStaticText* m_staticText911;
-        wxSlider*     m_codec2LPCPostFilterGamma;
-        wxStaticText* m_staticTextGamma;
-        wxButton*     m_LPCPostFilterDefault;
-
-        wxCheckBox*   m_ckboxSpeexpp;
-
-        wxStdDialogButtonSizer* m_sdbSizer5;
-        wxButton*     m_sdbSizer5OK;
-        wxButton*     m_sdbSizer5Cancel;
-        PlotSpectrum* m_MicInFreqRespPlot;
-        PlotSpectrum* m_SpkOutFreqRespPlot;
-        
-        wxCheckBox*   m_MicInEnable;
-        wxButton*     m_MicInDefault;
-        wxCheckBox*   m_SpkOutEnable;
-        wxButton*     m_SpkOutDefault;
-
-        float        *m_MicInMagdB;
-        float        *m_SpkOutMagdB;
-
-     private:
-        bool          m_running;
-        float         m_beta;
-        float         m_gamma;
-
-        void          setBeta(void);  // sets slider and static text from m_beta
-        void          setGamma(void); // sets slider and static text from m_gamma
-        void          setCodec2(void);
-        void          newEQControl(wxSlider** slider, wxStaticText** value, wxStaticBoxSizer *bs, wxString controlName);
-        EQ            newEQ(wxSizer *bs, wxString eqName, float maxFreqHz, bool enableQ);
-        void          newLPCPFControl(wxSlider **slider, wxStaticText **stValue, wxSizer *sbs, wxString controlName);
-        wxAuiNotebook *m_auiNotebook;
-        void          setFreq(EQ *eq);
-        void          setGain(EQ *eq);
-        void          setQ(EQ *eq);
-        void          sliderToFreq(EQ *eq, bool micIn);
-        void          sliderToGain(EQ *eq, bool micIn);
-        void          sliderToQ(EQ *eq, bool micIn);
-        void          plotFilterSpectrum(EQ *eqBass, EQ *eqMid, EQ* eqTreble, PlotSpectrum* freqRespPlot, float *magdB);
-        void          calcFilterSpectrum(float magdB[], int arc, char *argv[]);
-        void          plotMicInFilterSpectrum(void);
-        void          plotSpkOutFilterSpectrum(void);
-        void          adjRunTimeMicInFilter(void);
-        void          adjRunTimeSpkOutFilter(void);
-
-        EQ            m_MicInBass;
-        EQ            m_MicInMid;
-        EQ            m_MicInTreble;
-
-        EQ            m_SpkOutBass;
-        EQ            m_SpkOutMid;
-        EQ            m_SpkOutTreble;
-
-        float         limit(float value, float min, float max);
-        bool          *m_newMicInFilter;
-        bool          *m_newSpkOutFilter;
-
-};
-
-#endif // __FILTER_DIALOG__
diff --git a/fdmdv2/branches/0.99/src/dlg_options.cpp b/fdmdv2/branches/0.99/src/dlg_options.cpp
deleted file mode 100644 (file)
index 9189feb..0000000
+++ /dev/null
@@ -1,363 +0,0 @@
-//==========================================================================
-// Name:            dlg_options.cpp
-// Purpose:         Dialog for controlling misc FreeDV options
-// Date:            May 24 2013
-// 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-
-#include "dlg_options.h"
-extern bool g_modal;
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class OptionsDlg
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-OptionsDlg::OptionsDlg(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* bSizer30;
-    bSizer30 = new wxBoxSizer(wxVERTICAL);
-
-    //------------------------------
-    // Test Frames check box
-    //------------------------------
-
-    wxStaticBoxSizer* sbSizer_testFrames;
-    wxStaticBox *sb_testFrames = new wxStaticBox(this, wxID_ANY, _("Test Frames"));
-    sbSizer_testFrames = new wxStaticBoxSizer(sb_testFrames, wxHORIZONTAL);
-
-    m_ckboxTestFrame = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
-    m_ckboxTestFrame->SetToolTip(_("Send frames of known bits instead of compressed voice"));
-    sbSizer_testFrames->Add(m_ckboxTestFrame, 0, wxALIGN_LEFT, 0);
-
-    m_ckboxChannelNoise = new wxCheckBox(this, wxID_ANY, _("Channel Noise"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
-    m_ckboxChannelNoise->SetToolTip(_("Add simulated AWGN channel noise to received signal"));
-    sbSizer_testFrames->Add(m_ckboxChannelNoise, 0, wxALIGN_LEFT, 0);
-
-    bSizer30->Add(sbSizer_testFrames,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
-
-    //------------------------------
-    // FreeDV 700 Options
-    //------------------------------
-
-    wxStaticBoxSizer* sbSizer_freedv700;
-    wxStaticBox *sb_freedv700 = new wxStaticBox(this, wxID_ANY, _("FreeDV 700 Clipping"));
-    sbSizer_freedv700 = new wxStaticBoxSizer(sb_freedv700, wxHORIZONTAL);
-
-    m_ckboxFreeDV700txClip = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
-    m_ckboxFreeDV700txClip->SetToolTip(_("Clip FreeDv 700 tx waveform to reduce Peak to Average Power Ratio (PAPR)"));
-    sbSizer_freedv700->Add(m_ckboxFreeDV700txClip, 0, wxALIGN_LEFT, 0);
-
-    bSizer30->Add(sbSizer_freedv700,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
-
-    //------------------------------
-    // Txt Msg Text Box
-    //------------------------------
-
-    wxStaticBoxSizer* sbSizer_callSign;
-    wxStaticBox *sb_textMsg = new wxStaticBox(this, wxID_ANY, _("Txt Msg"));
-    sbSizer_callSign = new wxStaticBoxSizer(sb_textMsg, wxVERTICAL);
-
-    m_txtCtrlCallSign = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
-    m_txtCtrlCallSign->SetToolTip(_("Txt Msg you can send along with Voice"));
-    sbSizer_callSign->Add(m_txtCtrlCallSign, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3);
-
-    bSizer30->Add(sbSizer_callSign,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
-    //------------------------------
-    // Txt Encoding 
-    //------------------------------
-
-    wxStaticBoxSizer* sbSizer_encoding = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Text Encoding")), wxHORIZONTAL);
-
-#ifdef SHORT_VARICODE
-    m_rb_textEncoding1 = new wxRadioButton( this, wxID_ANY, wxT("Long varicode"), wxDefaultPosition, wxDefaultSize, 0);
-    m_rb_textEncoding1->SetValue(true);
-    sbSizer_encoding->Add(m_rb_textEncoding1, 0, wxALIGN_LEFT|wxALL, 1);
-    m_rb_textEncoding2 = new wxRadioButton( this, wxID_ANY, wxT("Short Varicode"), wxDefaultPosition, wxDefaultSize, 0);
-    sbSizer_encoding->Add(m_rb_textEncoding2, 0, wxALIGN_LEFT|wxALL, 1);
-#endif
-
-    m_ckboxEnableChecksum = new wxCheckBox(this, wxID_ANY, _("Use Checksum on Rx"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
-    sbSizer_encoding->Add(m_ckboxEnableChecksum, 0, wxALIGN_LEFT, 0);
-
-    bSizer30->Add(sbSizer_encoding,0, wxALL|wxEXPAND, 3);
-    //------------------------------
-    // Event processing
-    //------------------------------
-
-    wxStaticBoxSizer* sbSizer_events;
-    wxStaticBox *sb_events = new wxStaticBox(this, wxID_ANY, _("Event Processing"));
-    sbSizer_events = new wxStaticBoxSizer(sb_events, wxVERTICAL);
-
-    // event processing enable and spam timer
-
-    wxStaticBoxSizer* sbSizer_events_top;
-    wxStaticBox* sb_events1 = new wxStaticBox(this, wxID_ANY, _(""));    
-    sbSizer_events_top = new wxStaticBoxSizer(sb_events1, wxHORIZONTAL);
-
-    m_ckbox_events = new wxCheckBox(this, wxID_ANY, _("Enable System Calls    Syscall Spam Timer"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
-    sb_events->SetToolTip(_("Enable processing of events and generation of system calls"));
-    sbSizer_events_top->Add(m_ckbox_events, 0, 0, 5);
-    m_txt_spam_timer = new wxTextCtrl(this, wxID_ANY,  wxEmptyString, wxDefaultPosition, wxSize(40,-1), 0, wxTextValidator(wxFILTER_DIGITS));
-    m_txt_spam_timer->SetToolTip(_("Many matching events can cause a flood of syscalls. Set minimum time (seconds) between syscalls for each event here"));
-    sbSizer_events_top->Add(m_txt_spam_timer, 0, 0, 5);
-    m_rb_spam_timer = new wxRadioButton( this, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
-    m_rb_spam_timer->SetForegroundColour( wxColour(0, 255, 0 ) );
-    sbSizer_events_top->Add(m_rb_spam_timer, 0, 0, 10);
-    sbSizer_events->Add(sbSizer_events_top, 0, 0, 5);
-
-    // list of regexps
-
-    wxStaticBoxSizer* sbSizer_regexp = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Regular Expressions to Process Events")), wxHORIZONTAL);
-    m_txt_events_regexp_match = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(200,100), wxTE_MULTILINE);
-    m_txt_events_regexp_match->SetToolTip(_("Enter regular expressions to match events"));
-    sbSizer_regexp->Add(m_txt_events_regexp_match, 1, wxEXPAND, 5);
-    m_txt_events_regexp_replace = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(200,100), wxTE_MULTILINE);
-    m_txt_events_regexp_replace->SetToolTip(_("Enter regular expressions to replace events"));
-    sbSizer_regexp->Add(m_txt_events_regexp_replace, 1, wxEXPAND, 5);
-    sbSizer_events->Add(sbSizer_regexp, 1, wxEXPAND, 5);
-
-    // log of events and responses
-
-    wxStaticBoxSizer* sbSizer_event_log = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Log of Events and Responses")), wxVERTICAL);
-    wxBoxSizer* bSizer33 = new wxBoxSizer(wxHORIZONTAL);
-    m_txt_events_in = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(200,50), wxTE_MULTILINE | wxTE_READONLY);
-    bSizer33->Add(m_txt_events_in, 1, wxEXPAND, 5);
-    m_txt_events_out = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(200,50), wxTE_MULTILINE | wxTE_READONLY);
-    bSizer33->Add(m_txt_events_out, 1, wxEXPAND, 5);
-    sbSizer_event_log->Add(bSizer33, 1, wxEXPAND, 5);
-    sbSizer_events->Add(sbSizer_event_log, 1, wxEXPAND, 5);
-
-    bSizer30->Add(sbSizer_events,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
-
-    //------------------------------
-    // UDP control port
-    //------------------------------
-
-    wxStaticBoxSizer* sbSizer_udp;
-    wxStaticBox* sb_udp = new wxStaticBox(this, wxID_ANY, _("UDP Control Port"));
-    sbSizer_udp = new wxStaticBoxSizer(sb_udp, wxHORIZONTAL);
-    m_ckbox_udp_enable = new wxCheckBox(this, wxID_ANY, _("Enable UDP Control Port    UDP Port Number:"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
-    sb_udp->SetToolTip(_("Enable control of FreeDV via UDP port"));
-    sbSizer_udp->Add(m_ckbox_udp_enable, 0,  wxALIGN_CENTER_HORIZONTAL, 5);
-    m_txt_udp_port = new wxTextCtrl(this, wxID_ANY,  wxEmptyString, wxDefaultPosition, wxSize(50,-1), 0, wxTextValidator(wxFILTER_DIGITS));
-    sbSizer_udp->Add(m_txt_udp_port, 0, wxALIGN_CENTER_HORIZONTAL, 5);
-
-    bSizer30->Add(sbSizer_udp,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
-
-    //------------------------------
-    // OK - Cancel - Apply Buttons 
-    //------------------------------
-
-    wxBoxSizer* bSizer31 = new wxBoxSizer(wxHORIZONTAL);
-
-    m_sdbSizer5OK = new wxButton(this, wxID_OK);
-    bSizer31->Add(m_sdbSizer5OK, 0, wxALL, 2);
-
-    m_sdbSizer5Cancel = new wxButton(this, wxID_CANCEL);
-    bSizer31->Add(m_sdbSizer5Cancel, 0, wxALL, 2);
-
-    m_sdbSizer5Apply = new wxButton(this, wxID_APPLY);
-    bSizer31->Add(m_sdbSizer5Apply, 0, wxALL, 2);
-
-    bSizer30->Add(bSizer31, 0, wxALIGN_RIGHT|wxALL, 0);
-
-    this->SetSizer(bSizer30);
-    this->Layout();
-
-    this->Centre(wxBOTH);
-    // Connect Events -------------------------------------------------------
-
-    this->Connect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(OptionsDlg::OnInitDialog));
-
-    m_sdbSizer5OK->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsDlg::OnOK), NULL, this);
-    m_sdbSizer5Cancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsDlg::OnCancel), NULL, this);
-    m_sdbSizer5Apply->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsDlg::OnApply), NULL, this);
-
-    m_ckboxFreeDV700txClip->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(OptionsDlg::OnFreeDV700txClip), NULL, this);
-
-    event_in_serial = 0;
-    event_out_serial = 0;
-}
-
-//-------------------------------------------------------------------------
-// ~OptionsDlg()
-//-------------------------------------------------------------------------
-OptionsDlg::~OptionsDlg()
-{
-
-    // Disconnect Events
-
-    this->Disconnect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(OptionsDlg::OnInitDialog));
-
-    m_sdbSizer5OK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsDlg::OnOK), NULL, this);
-    m_sdbSizer5Cancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsDlg::OnCancel), NULL, this);
-    m_sdbSizer5Apply->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsDlg::OnApply), NULL, this);
-    m_ckboxFreeDV700txClip->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(OptionsDlg::OnFreeDV700txClip), NULL, this);
-}
-
-
-//-------------------------------------------------------------------------
-// ExchangeData()
-//-------------------------------------------------------------------------
-void OptionsDlg::ExchangeData(int inout, bool storePersistent)
-{
-    wxConfigBase *pConfig = wxConfigBase::Get();
-
-    if(inout == EXCHANGE_DATA_IN)
-    {
-        m_txtCtrlCallSign->SetValue(wxGetApp().m_callSign);
-        m_ckboxTestFrame->SetValue(wxGetApp().m_testFrames);
-        m_ckboxChannelNoise->SetValue(wxGetApp().m_channel_noise);
-
-        m_ckbox_events->SetValue(wxGetApp().m_events);
-        m_txt_spam_timer->SetValue(wxString::Format(wxT("%i"),wxGetApp().m_events_spam_timer));
-
-        m_txt_events_regexp_match->SetValue(wxGetApp().m_events_regexp_match);
-        m_txt_events_regexp_replace->SetValue(wxGetApp().m_events_regexp_replace);
-        
-        m_ckbox_udp_enable->SetValue(wxGetApp().m_udp_enable);
-        m_txt_udp_port->SetValue(wxString::Format(wxT("%i"),wxGetApp().m_udp_port));
-
-#ifdef SHORT_VARICODE
-        if (wxGetApp().m_textEncoding == 1)
-            m_rb_textEncoding1->SetValue(true);
-        if (wxGetApp().m_textEncoding == 2)
-            m_rb_textEncoding2->SetValue(true);
-#endif
-        m_ckboxEnableChecksum->SetValue(wxGetApp().m_enable_checksum);
-
-        m_ckboxFreeDV700txClip->SetValue(wxGetApp().m_FreeDV700txClip);
-    }
-
-    if(inout == EXCHANGE_DATA_OUT)
-    {
-        wxGetApp().m_callSign      = m_txtCtrlCallSign->GetValue();
-        wxGetApp().m_testFrames    = m_ckboxTestFrame->GetValue();
-        wxGetApp().m_channel_noise = m_ckboxChannelNoise->GetValue();
-
-        wxGetApp().m_events        = m_ckbox_events->GetValue();
-        long spam_timer;
-        m_txt_spam_timer->GetValue().ToLong(&spam_timer);
-        wxGetApp().m_events_spam_timer = (int)spam_timer;
-
-        // make sure regexp lists are terminated by a \n
-
-        if (m_txt_events_regexp_match->GetValue().Last() != '\n') {
-            m_txt_events_regexp_match->SetValue(m_txt_events_regexp_match->GetValue()+'\n');
-        }
-        if (m_txt_events_regexp_replace->GetValue().Last() != '\n') {
-            m_txt_events_regexp_replace->SetValue(m_txt_events_regexp_replace->GetValue()+'\n');
-        }
-        wxGetApp().m_events_regexp_match = m_txt_events_regexp_match->GetValue();
-        wxGetApp().m_events_regexp_replace = m_txt_events_regexp_replace->GetValue();
-        wxGetApp().m_udp_enable     = m_ckbox_udp_enable->GetValue();
-        long port;
-        m_txt_udp_port->GetValue().ToLong(&port);
-        wxGetApp().m_udp_port       = (int)port;
-
-#ifdef SHORT_VARICODE
-        if (m_rb_textEncoding1->GetValue())
-            wxGetApp().m_textEncoding = 1;
-        if (m_rb_textEncoding2->GetValue())
-            wxGetApp().m_textEncoding = 2;
-#endif
-        wxGetApp().m_enable_checksum = m_ckboxEnableChecksum->GetValue();
-
-        wxGetApp().m_FreeDV700txClip = m_ckboxFreeDV700txClip->GetValue();
-
-        if (storePersistent) {
-            pConfig->Write(wxT("/Data/CallSign"), wxGetApp().m_callSign);
-#ifdef SHORT_VARICODE
-            pConfig->Write(wxT("/Data/TextEncoding"), wxGetApp().m_textEncoding);
-#endif
-            pConfig->Write(wxT("/Data/EnableChecksumOnMsgRx"), wxGetApp().m_enable_checksum);
-
-            pConfig->Write(wxT("/Events/enable"), wxGetApp().m_events);
-            pConfig->Write(wxT("/Events/spam_timer"), wxGetApp().m_events_spam_timer);
-            pConfig->Write(wxT("/Events/regexp_match"), wxGetApp().m_events_regexp_match);
-            pConfig->Write(wxT("/Events/regexp_replace"), wxGetApp().m_events_regexp_replace);
-            
-            pConfig->Write(wxT("/UDP/enable"), wxGetApp().m_udp_enable);
-            pConfig->Write(wxT("/UDP/port"),  wxGetApp().m_udp_port);
-
-            pConfig->Write(wxT("/FreeDV700/txClip"), wxGetApp().m_FreeDV700txClip);
-
-            pConfig->Flush();
-        }
-    }
-    delete wxConfigBase::Set((wxConfigBase *) NULL);
-}
-
-//-------------------------------------------------------------------------
-// OnOK()
-//-------------------------------------------------------------------------
-void OptionsDlg::OnOK(wxCommandEvent& event)
-{
-    ExchangeData(EXCHANGE_DATA_OUT, true);
-    //this->EndModal(wxID_OK);
-    g_modal = false;
-    this->Show(false);
-}
-
-//-------------------------------------------------------------------------
-// OnCancel()
-//-------------------------------------------------------------------------
-void OptionsDlg::OnCancel(wxCommandEvent& event)
-{
-    //this->EndModal(wxID_CANCEL);
-    g_modal = false;
-    this->Show(false);
-}
-
-//-------------------------------------------------------------------------
-// OnApply()
-//-------------------------------------------------------------------------
-void OptionsDlg::OnApply(wxCommandEvent& event)
-{
-    ExchangeData(EXCHANGE_DATA_OUT, true);
-}
-
-//-------------------------------------------------------------------------
-// OnInitDialog()
-//-------------------------------------------------------------------------
-void OptionsDlg::OnInitDialog(wxInitDialogEvent& event)
-{
-    ExchangeData(EXCHANGE_DATA_IN, false);
-}
-
-// immediately change flags rather using ExchangeData() so we can switch on and off at run time
-
-void OptionsDlg::OnFreeDV700txClip(wxScrollEvent& event) {
-    wxGetApp().m_FreeDV700txClip = m_ckboxFreeDV700txClip->GetValue();
-}
-
-
-void OptionsDlg::updateEventLog(wxString event_in, wxString event_out) {
-    wxString event_in_with_serial, event_out_with_serial; 
-    event_in_with_serial.Printf(_T("[%d] %s"), event_in_serial++, event_in);
-    event_out_with_serial.Printf(_T("[%d] %s"), event_out_serial++, event_out);
-
-    m_txt_events_in->AppendText(event_in_with_serial+"\n");
-    m_txt_events_out->AppendText(event_out_with_serial+"\n");
-}
-
diff --git a/fdmdv2/branches/0.99/src/dlg_options.h b/fdmdv2/branches/0.99/src/dlg_options.h
deleted file mode 100644 (file)
index fe355ac..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-//==========================================================================
-// Name:            dlg_options.h
-// Purpose:         Dialog for controlling misc FreeDV options
-// Created:         Nov 25 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-
-#ifndef __OPTIONS_DIALOG__
-#define __OPTIONS_DIALOG__
-
-#include "fdmdv2_main.h"
-#include "fdmdv2_defines.h"
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class OptionsDlg
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class OptionsDlg : public wxDialog
-{
-    public:
-    OptionsDlg( wxWindow* parent,
-               wxWindowID id = wxID_ANY, const wxString& title = _("Options"), 
-                const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(600,630), 
-               long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
-        ~OptionsDlg();
-
-        void    ExchangeData(int inout, bool storePersistent);
-        void    updateEventLog(wxString event_in, wxString event_out);
-
-        bool    enableEventsChecked() {return m_ckbox_events->GetValue();}
-
-        void SetSpamTimerLight(bool state) {
-
-            // Colours don't work on Windows
-
-            if (state) {
-                m_rb_spam_timer->SetForegroundColour( wxColour( 255,0 , 0 ) ); // red
-                m_rb_spam_timer->SetValue(true);
-            }
-            else {
-                m_rb_spam_timer->SetForegroundColour( wxColour( 0, 255, 0 ) ); // green
-                m_rb_spam_timer->SetValue(false);
-            }
-        }
-
-
-    protected:
-        // Handlers for events.
-        void    OnOK(wxCommandEvent& event);
-        void    OnCancel(wxCommandEvent& event);
-        void    OnApply(wxCommandEvent& event);
-        void    OnClose(wxCloseEvent& event);
-        void    OnInitDialog(wxInitDialogEvent& event);
-        void    OnFreeDV700txClip(wxScrollEvent& event);
-
-        wxTextCtrl   *m_txtCtrlCallSign; // TODO: this should be renamed to tx_txtmsg, and rename all related incl persis strge
-        wxCheckBox   *m_ckboxTestFrame;
-        wxCheckBox   *m_ckboxChannelNoise;
-        wxCheckBox   *m_ckboxFreeDV700txClip;
-
-        wxRadioButton *m_rb_textEncoding1;
-        wxRadioButton *m_rb_textEncoding2;
-        wxCheckBox    *m_ckboxEnableChecksum;
-
-        wxCheckBox   *m_ckbox_events;
-        wxTextCtrl   *m_txt_events_regexp_match;
-        wxTextCtrl   *m_txt_events_regexp_replace;
-        wxTextCtrl   *m_txt_events_in;
-        wxTextCtrl   *m_txt_events_out;
-        wxTextCtrl   *m_txt_spam_timer;
-        wxRadioButton *m_rb_spam_timer;
-
-        wxCheckBox   *m_ckbox_udp_enable;
-        wxTextCtrl   *m_txt_udp_port;
-
-        wxButton*     m_sdbSizer5OK;
-        wxButton*     m_sdbSizer5Cancel;
-        wxButton*     m_sdbSizer5Apply;
-
-        unsigned int  event_in_serial, event_out_serial;
-
-     private:
-};
-
-#endif // __OPTIONS_DIALOG__
diff --git a/fdmdv2/branches/0.99/src/dlg_ptt.cpp b/fdmdv2/branches/0.99/src/dlg_ptt.cpp
deleted file mode 100644 (file)
index 2643c1d..0000000
+++ /dev/null
@@ -1,416 +0,0 @@
-//==========================================================================
-// Name:            dlg_ptt.cpp
-// Purpose:         Subclasses dialog GUI for PTT Config. Creates simple 
-//                  wxWidgets dialog GUI to select real/virtual Comm ports.
-// Date:            May 11 2012
-// Authors:         David Rowe, David Witten, Joel Stanley
-// 
-// 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#include "dlg_ptt.h"
-#include "fdmdv2_main.h"
-
-#ifdef __WIN32__
-#include <wx/msw/registry.h>
-#endif
-#ifdef __FreeBSD__
-#include <glob.h>
-#include <string.h>
-#endif
-
-#include <sstream>
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class ComPortsDlg
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-ComPortsDlg::ComPortsDlg(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style)
-{
-    wxBoxSizer* mainSizer = new wxBoxSizer(wxVERTICAL);
-    this->SetSizer(mainSizer);
-    
-    //----------------------------------------------------------------------
-    // Half Duplex Flag for VOX PTT
-    //----------------------------------------------------------------------
-
-    // DR: should this be on options dialog?
-
-    wxStaticBoxSizer* staticBoxSizer28 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("VOX PTT Settings")), wxHORIZONTAL);
-    m_ckHalfDuplex = new wxCheckBox(this, wxID_ANY, _("Half Duplex"), wxDefaultPosition, wxSize(-1,-1), 0);
-    staticBoxSizer28->Add(m_ckHalfDuplex, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
-    m_ckLeftChannelVoxTone = new wxCheckBox(this, wxID_ANY, _("Left Channel Vox Tone"), wxDefaultPosition, wxSize(-1,-1), 0);
-    staticBoxSizer28->Add(m_ckLeftChannelVoxTone, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
-
-    mainSizer->Add(staticBoxSizer28, 0, wxEXPAND, 5);
-
-    //----------------------------------------------------------------------
-    // Hamlib for CAT PTT
-    //----------------------------------------------------------------------
-
-    wxStaticBoxSizer* staticBoxSizer18 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("Hamlib Settings")), wxVERTICAL);
-
-    wxBoxSizer* gridSizer100 = new wxBoxSizer(wxHORIZONTAL);
-
-    /* Use Hamlib for PTT checkbox. */
-    m_ckUseHamlibPTT = new wxCheckBox(this, wxID_ANY, _("Use Hamlib PTT"), wxDefaultPosition, wxSize(-1, -1), 0);
-    m_ckUseHamlibPTT->SetValue(false);
-    gridSizer100->Add(m_ckUseHamlibPTT, 0, wxALIGN_CENTER_VERTICAL, 0);
-
-    /* Hamlib Rig Type combobox. */
-    gridSizer100->Add(new wxStaticText(this, wxID_ANY, _("Rig Model:"), wxDefaultPosition, wxDefaultSize, 0), 
-                      0, wxALIGN_CENTER_VERTICAL | wxLEFT, 20);
-    m_cbRigName = new wxComboBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(250, -1), 0, NULL, wxCB_DROPDOWN);
-    /* TODO(Joel): this is a hack. At the least, need to gurantee that m_hamLib
-     * exists. */
-    wxGetApp().m_hamlib->populateComboBox(m_cbRigName);
-    m_cbRigName->SetSelection(wxGetApp().m_intHamlibRig);
-    gridSizer100->Add(m_cbRigName, 0, wxALIGN_CENTER_VERTICAL, 0);
-
-    /* Hamlib Serial Port combobox. */
-    gridSizer100->Add(new wxStaticText(this, wxID_ANY, _("Serial Device:"), wxDefaultPosition, wxDefaultSize, 0), 
-                      0, wxALIGN_CENTER_VERTICAL | wxLEFT, 20);
-    m_cbSerialPort = new wxComboBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(140, -1), 0, NULL, wxCB_DROPDOWN);
-    gridSizer100->Add(m_cbSerialPort, 0, wxALIGN_CENTER_VERTICAL, 0);
-
-    staticBoxSizer18->Add(gridSizer100, 1);
-    mainSizer->Add(staticBoxSizer18, 1);
-
-    //----------------------------------------------------------------------
-    // Serial port PTT
-    //----------------------------------------------------------------------
-
-    wxStaticBoxSizer* staticBoxSizer17 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("Serial Port Settings")), wxVERTICAL);
-    mainSizer->Add(staticBoxSizer17, 1, wxEXPAND, 5);
-    wxStaticBoxSizer* staticBoxSizer31 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("PTT Port")), wxVERTICAL);
-    staticBoxSizer17->Add(staticBoxSizer31, 1, wxEXPAND, 5);
-
-#ifdef __WXMSW__
-    m_ckUseSerialPTT = new wxCheckBox(this, wxID_ANY, _("Use Serial Port PTT"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_ckUseSerialPTT->SetValue(false);
-    staticBoxSizer31->Add(m_ckUseSerialPTT, 0, wxALIGN_LEFT, 20);
-
-    wxArrayString m_listCtrlPortsArr;
-    m_listCtrlPorts = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxSize(-1,45), m_listCtrlPortsArr, wxLB_SINGLE | wxLB_SORT);
-    staticBoxSizer31->Add(m_listCtrlPorts, 1, wxALIGN_CENTER, 0);
-#endif
-
-#ifdef __WXGTK__
-    wxBoxSizer* bSizer83;
-    bSizer83 = new wxBoxSizer(wxHORIZONTAL);
-
-    wxGridSizer* gridSizer200 = new wxGridSizer(1, 3, 0, 0);
-    
-    m_ckUseSerialPTT = new wxCheckBox(this, wxID_ANY, _("Use Serial Port PTT"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_ckUseSerialPTT->SetValue(false);
-    gridSizer200->Add(m_ckUseSerialPTT, 1, wxALIGN_CENTER|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 2);
-
-    m_staticText12 = new wxStaticText(this, wxID_ANY, _("Serial Device:  "), wxDefaultPosition, wxDefaultSize, 0);
-    m_staticText12->Wrap(-1);
-    gridSizer200->Add(m_staticText12, 1,wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 2);
-
-    m_cbCtlDevicePath = new wxComboBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(140, -1), 0, NULL, wxCB_DROPDOWN);
-    gridSizer200->Add(m_cbCtlDevicePath, 1, wxEXPAND|wxALIGN_CENTER|wxALIGN_RIGHT, 2);
-    
-    bSizer83->Add(gridSizer200, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT | wxALL, 2);
-    staticBoxSizer31->Add(bSizer83, 1, wxALIGN_CENTER_VERTICAL|wxALL, 1);
-#endif
-
-    wxBoxSizer* boxSizer19 = new wxBoxSizer(wxVERTICAL);
-    staticBoxSizer17->Add(boxSizer19, 1, wxEXPAND, 5);
-    wxStaticBoxSizer* staticBoxSizer16 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("Signal polarity")), wxHORIZONTAL);
-    boxSizer19->Add(staticBoxSizer16, 1, wxEXPAND|wxALIGN_CENTER|wxALIGN_RIGHT, 5);
-
-    wxGridSizer* gridSizer17 = new wxGridSizer(2, 2, 0, 0);
-    staticBoxSizer16->Add(gridSizer17, 1, wxEXPAND|wxALIGN_RIGHT, 5);
-
-    m_rbUseDTR = new wxRadioButton(this, wxID_ANY, _("Use DTR"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_rbUseDTR->SetToolTip(_("Toggle DTR line for PTT"));
-    m_rbUseDTR->SetValue(1);
-    gridSizer17->Add(m_rbUseDTR, 0, wxALIGN_CENTER|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5);
-
-    m_ckDTRPos = new wxCheckBox(this, wxID_ANY, _("DTR = +V"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_ckDTRPos->SetToolTip(_("Set Polarity of the DTR line"));
-    m_ckDTRPos->SetValue(false);
-    gridSizer17->Add(m_ckDTRPos, 0, wxALIGN_CENTER|wxALIGN_RIGHT, 5);
-
-    m_rbUseRTS = new wxRadioButton(this, wxID_ANY, _("Use RTS"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_rbUseRTS->SetToolTip(_("Toggle the RTS pin for PTT"));
-    m_rbUseRTS->SetValue(1);
-    gridSizer17->Add(m_rbUseRTS, 0, wxALIGN_CENTER|wxALIGN_RIGHT, 5);
-
-    m_ckRTSPos = new wxCheckBox(this, wxID_ANY, _("RTS = +V"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_ckRTSPos->SetValue(false);
-    m_ckRTSPos->SetToolTip(_("Set Polarity of the RTS line"));
-    gridSizer17->Add(m_ckRTSPos, 0, wxALIGN_CENTER|wxALIGN_RIGHT, 5);
-
-    //----------------------------------------------------------------------
-    // OK - Cancel - Apply
-    //----------------------------------------------------------------------
-
-    wxBoxSizer* boxSizer12 = new wxBoxSizer(wxHORIZONTAL);
-
-    m_buttonOK = new wxButton(this, wxID_OK, _("OK"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_buttonOK->SetDefault();
-    boxSizer12->Add(m_buttonOK, 0, wxLEFT|wxRIGHT|wxTOP|wxBOTTOM, 5);
-
-    m_buttonCancel = new wxButton(this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxSize(-1,-1), 0);
-    boxSizer12->Add(m_buttonCancel, 0, wxLEFT|wxRIGHT|wxTOP|wxBOTTOM, 5);
-
-    m_buttonApply = new wxButton(this, wxID_APPLY, _("Apply"), wxDefaultPosition, wxSize(-1,-1), 0);
-    boxSizer12->Add(m_buttonApply, 0, wxLEFT|wxRIGHT|wxTOP|wxBOTTOM, 5);
-
-    mainSizer->Add(boxSizer12, 0, wxLEFT|wxRIGHT|wxTOP|wxBOTTOM|wxALIGN_CENTER_HORIZONTAL, 5);
-
-    if ( GetSizer() ) 
-    {
-         GetSizer()->Fit(this);
-    }
-    Centre(wxBOTH);
-
-    // Connect events
-    this->Connect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(ComPortsDlg::OnInitDialog), NULL, this);
-    m_ckUseHamlibPTT->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(ComPortsDlg::PTTUseHamLibClicked), NULL, this);
-    m_ckUseSerialPTT->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(ComPortsDlg::PTTUseSerialClicked), NULL, this);
-    m_buttonOK->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnOK), NULL, this);
-    m_buttonCancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnCancel), NULL, this);
-    m_buttonApply->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnApply), NULL, this);
-}
-
-//-------------------------------------------------------------------------
-// ~ComPortsDlg()
-//-------------------------------------------------------------------------
-ComPortsDlg::~ComPortsDlg()
-{
-    // Disconnect Events
-    this->Disconnect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(ComPortsDlg::OnInitDialog), NULL, this);
-    m_ckUseHamlibPTT->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(ComPortsDlg::PTTUseHamLibClicked), NULL, this);
-    m_ckUseSerialPTT->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(ComPortsDlg::PTTUseSerialClicked), NULL, this);
-    m_buttonOK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnOK), NULL, this);
-    m_buttonCancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnCancel), NULL, this);
-    m_buttonApply->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnApply), NULL, this);
-}
-
-//-------------------------------------------------------------------------
-// OnInitDialog()
-//-------------------------------------------------------------------------
-void ComPortsDlg::OnInitDialog(wxInitDialogEvent& event)
-{
-    populatePortList();
-    ExchangeData(EXCHANGE_DATA_IN);
-}
-
-//-------------------------------------------------------------------------
-// populatePortList()
-//-------------------------------------------------------------------------
-void ComPortsDlg::populatePortList()
-{
-#ifdef __WXMSW__
-    m_listCtrlPorts->Clear();
-    m_cbSerialPort->Clear();
-    wxArrayString aStr;
-    wxRegKey key(wxRegKey::HKLM, _T("HARDWARE\\DEVICEMAP\\SERIALCOMM"));
-    if(!key.Exists())
-    {
-        return;
-    }
-    else
-    {
-        // Get the number of subkeys and enumerate them.
-        if(!key.Open(wxRegKey::Read))
-        {
-            return;
-        }    
-        size_t subkeys;
-        size_t values;
-        if(!key.GetKeyInfo(&subkeys, NULL, &values, NULL))
-        {
-            return;
-        }
-        if(!key.HasValues())
-        {
-            return;
-        }
-        wxString key_name;
-        long el = 1;
-        key.GetFirstValue(key_name, el);
-        wxString valType;
-        wxString key_data;
-        for(unsigned int i = 0; i < values; i++)
-        {
-            key.QueryValue(key_name, key_data);
-            //wxPrintf("Value:  %s Data: %s\n", key_name, key_data);
-            aStr.Add(key_data, 1);
-            key.GetNextValue(key_name, el);
-        }
-    }
-    m_listCtrlPorts->Append(aStr);
-    m_cbSerialPort->Append(aStr);
-#endif
-#ifdef __WXGTK__
-    m_cbSerialPort->Clear();
-    m_cbCtlDevicePath->Clear();
-#ifdef __FreeBSD__
-       glob_t  gl;
-       if(glob("/dev/tty*", GLOB_MARK, NULL, &gl)==0) {
-               for(unsigned int i=0; i<gl.gl_pathc; i++) {
-                       if(gl.gl_pathv[i][strlen(gl.gl_pathv[i])-1]=='/')
-                               continue;
-                               
-                       /* Exclude pseudo TTYs */
-                       if(gl.gl_pathv[i][8] >= 'l' && gl.gl_pathv[i][8] <= 's')
-                               continue;
-                       if(gl.gl_pathv[i][8] >= 'L' && gl.gl_pathv[i][8] <= 'S')
-                               continue;
-
-                       /* Exclude virtual TTYs */
-                       if(gl.gl_pathv[i][8] == 'v')
-                               continue;
-
-                       /* Exclude initial-state and lock-state devices */
-                       if(strchr(gl.gl_pathv[i], '.') != NULL)
-                               continue;
-
-                       m_cbSerialPort->Append(gl.gl_pathv[i]);
-                       m_cbCtlDevicePath->Append(gl.gl_pathv[i]);
-               }
-               globfree(&gl);
-       }
-#else
-    /* TODO(Joel): http://stackoverflow.com/questions/2530096/how-to-find-all-serial-devices-ttys-ttyusb-on-linux-without-opening-them */
-    m_cbSerialPort->Append("/dev/ttyUSB0");
-    m_cbSerialPort->Append("/dev/ttyUSB1");
-    m_cbSerialPort->Append("/dev/ttyS0");
-    m_cbSerialPort->Append("/dev/ttyS1");
-    m_cbCtlDevicePath->Clear();
-    m_cbCtlDevicePath->Append("/dev/ttyUSB0");
-    m_cbCtlDevicePath->Append("/dev/ttyUSB1");
-    m_cbCtlDevicePath->Append("/dev/ttyS0");
-    m_cbCtlDevicePath->Append("/dev/ttyS1");
-#endif
-#endif
-}
-
-//-------------------------------------------------------------------------
-// ExchangeData()
-//-------------------------------------------------------------------------
-void ComPortsDlg::ExchangeData(int inout)
-{
-    wxConfigBase *pConfig = wxConfigBase::Get();
-    wxString str;
-    
-    if(inout == EXCHANGE_DATA_IN)
-    {
-        m_ckHalfDuplex->SetValue(wxGetApp().m_boolHalfDuplex);
-        m_ckLeftChannelVoxTone->SetValue(wxGetApp().m_leftChannelVoxTone);
-
-        m_ckUseHamlibPTT->SetValue(wxGetApp().m_boolHamlibUseForPTT);
-        m_cbRigName->SetSelection(wxGetApp().m_intHamlibRig);
-        m_cbSerialPort->SetValue(wxGetApp().m_strHamlibSerialPort);
-
-        m_ckUseSerialPTT->SetValue(wxGetApp().m_boolUseSerialPTT);
-        str = wxGetApp().m_strRigCtrlPort;
-#ifdef __WXMSW__
-        m_listCtrlPorts->SetStringSelection(str);
-#endif
-#ifdef __WXGTK__
-        m_cbCtlDevicePath->SetValue(str);
-#endif
-        m_rbUseRTS->SetValue(wxGetApp().m_boolUseRTS);
-        m_ckRTSPos->SetValue(wxGetApp().m_boolRTSPos);
-        m_rbUseDTR->SetValue(wxGetApp().m_boolUseDTR);
-        m_ckDTRPos->SetValue(wxGetApp().m_boolDTRPos);
-    }
-    if(inout == EXCHANGE_DATA_OUT)
-    {
-        wxGetApp().m_boolHalfDuplex = m_ckHalfDuplex->GetValue();
-        pConfig->Write(wxT("/Rig/HalfDuplex"), wxGetApp().m_boolHalfDuplex);
-        wxGetApp().m_leftChannelVoxTone = m_ckLeftChannelVoxTone->GetValue();
-        pConfig->Write(wxT("/Rig/leftChannelVoxTone"), wxGetApp().m_leftChannelVoxTone);
-
-        /* Hamlib settings. */
-
-        wxGetApp().m_boolHamlibUseForPTT = m_ckUseHamlibPTT->GetValue();
-        wxGetApp().m_intHamlibRig = m_cbRigName->GetSelection();
-        wxGetApp().m_strHamlibSerialPort = m_cbSerialPort->GetValue();
-
-        pConfig->Write(wxT("/Hamlib/UseForPTT"), wxGetApp().m_boolHamlibUseForPTT);
-        pConfig->Write(wxT("/Hamlib/RigName"), wxGetApp().m_intHamlibRig);
-        pConfig->Write(wxT("/Hamlib/SerialPort"), wxGetApp().m_strHamlibSerialPort);
-
-        /* Serial settings */
-
-        wxGetApp().m_boolUseSerialPTT           = m_ckUseSerialPTT->IsChecked();
-#ifdef __WXMSW__
-        wxGetApp().m_strRigCtrlPort             = m_listCtrlPorts->GetStringSelection();
-#endif
-#ifdef __WXGTK__
-        wxGetApp().m_strRigCtrlPort             = m_cbCtlDevicePath->GetValue();
-#endif
-        wxGetApp().m_boolUseRTS                 = m_rbUseRTS->GetValue();
-        wxGetApp().m_boolRTSPos                 = m_ckRTSPos->IsChecked();
-        wxGetApp().m_boolUseDTR                 = m_rbUseDTR->GetValue();
-        wxGetApp().m_boolDTRPos                 = m_ckDTRPos->IsChecked();
-        
-        pConfig->Write(wxT("/Rig/UseSerialPTT"),    wxGetApp().m_boolUseSerialPTT);
-        pConfig->Write(wxT("/Rig/Port"),            wxGetApp().m_strRigCtrlPort); 
-        pConfig->Write(wxT("/Rig/UseRTS"),          wxGetApp().m_boolUseRTS);
-        pConfig->Write(wxT("/Rig/RTSPolarity"),     wxGetApp().m_boolRTSPos);
-        pConfig->Write(wxT("/Rig/UseDTR"),          wxGetApp().m_boolUseDTR);
-        pConfig->Write(wxT("/Rig/DTRPolarity"),     wxGetApp().m_boolDTRPos);
-
-        pConfig->Flush();
-    }
-    delete wxConfigBase::Set((wxConfigBase *) NULL);
-}
-
-//-------------------------------------------------------------------------
-// PTTUseHamLibClicked()
-//-------------------------------------------------------------------------
-void ComPortsDlg::PTTUseHamLibClicked(wxCommandEvent& event)
-{
-    m_ckUseSerialPTT->SetValue(false);    
-}
-
-//-------------------------------------------------------------------------
-// PTTUseSerialClicked()
-//-------------------------------------------------------------------------
-void ComPortsDlg::PTTUseSerialClicked(wxCommandEvent& event)
-{
-    m_ckUseHamlibPTT->SetValue(false);
-}
-
-//-------------------------------------------------------------------------
-// OnApply()
-//-------------------------------------------------------------------------
-void ComPortsDlg::OnApply(wxCommandEvent& event)
-{
-    ExchangeData(EXCHANGE_DATA_OUT);
-}
-
-//-------------------------------------------------------------------------
-// OnCancel()
-//-------------------------------------------------------------------------
-void ComPortsDlg::OnCancel(wxCommandEvent& event)
-{
-    this->EndModal(wxID_CANCEL);
-}
-
-//-------------------------------------------------------------------------
-// OnClose()
-//-------------------------------------------------------------------------
-void ComPortsDlg::OnOK(wxCommandEvent& event)
-{
-    ExchangeData(EXCHANGE_DATA_OUT);
-    this->EndModal(wxID_OK);
-}
diff --git a/fdmdv2/branches/0.99/src/dlg_ptt.h b/fdmdv2/branches/0.99/src/dlg_ptt.h
deleted file mode 100644 (file)
index 8fa9b9d..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-//==========================================================================
-// Name:            dlg_ptt.h
-// Purpose:         Subclasses dialog GUI for PTT Config.
-//                  
-// Created:         May. 11, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#ifndef __COMPORTS_DIALOG__
-#define __COMPORTS_DIALOG__
-
-#include "fdmdv2_main.h"
-#include "hamlib.h"
-#include <wx/settings.h>
-#include <wx/xrc/xmlres.h>
-#include <wx/xrc/xh_bmp.h>
-#include <wx/dialog.h>
-#include <wx/sizer.h>
-#include <wx/statbox.h>
-#include <wx/checkbox.h>
-#include <wx/listbox.h>
-#include <wx/radiobut.h>
-#include <wx/button.h>
-#include <wx/spinctrl.h>
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class ComPortsDlg
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class ComPortsDlg : public wxDialog
-{
-     public:
-        ComPortsDlg(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("PTT Config"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(450,300), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER);
-        virtual ~ComPortsDlg();
-        void    ExchangeData(int inout);
-
-    protected:
-        wxCheckBox* m_ckHalfDuplex;
-        wxCheckBox* m_ckLeftChannelVoxTone;
-
-        /* Hamlib settings.*/
-
-        wxCheckBox *m_ckUseHamlibPTT;
-        wxComboBox *m_cbRigName;
-        wxComboBox *m_cbSerialPort;
-
-        Hamlib *m_hamlib;
-
-        /* Serial Settings */
-
-        wxListBox     *m_listCtrlPorts;
-        wxCheckBox    *m_ckUseSerialPTT;
-        wxStaticText  *m_staticText12;
-        wxComboBox    *m_cbCtlDevicePath;
-        wxRadioButton *m_rbUseDTR;
-        wxCheckBox    *m_ckRTSPos;
-        wxRadioButton *m_rbUseRTS;
-        wxCheckBox    *m_ckDTRPos;
-
-        /* Ok - Cancel - Apply */
-
-        wxButton* m_buttonOK;
-        wxButton* m_buttonCancel;
-        wxButton* m_buttonApply;
-
-
-protected:
-        void populatePortList();
-
-        void PTTUseHamLibClicked(wxCommandEvent& event);
-        void PTTUseSerialClicked(wxCommandEvent& event);
-
-        void OnOK(wxCommandEvent& event);
-        void OnCancel(wxCommandEvent& event);
-        void OnApply(wxCommandEvent& event);
-        virtual void OnInitDialog(wxInitDialogEvent& event);
-};
-
-#endif // __COMPORTS_DIALOG__
diff --git a/fdmdv2/branches/0.99/src/fdmdv2_defines.h b/fdmdv2/branches/0.99/src/fdmdv2_defines.h
deleted file mode 100644 (file)
index 64aa606..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_defines.h
-// Purpose:         Definitions used by plots derived from fdmdv2_plot class.
-// Created:         August 27, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#ifndef __FDMDV2_DEFINES__
-#define __FDMDV2_DEFINES__
-
-#include "wx/wx.h"
-#include "freedv_api.h"
-#include "freedv_api_internal.h"
-
-// Spectrogram and Waterfall
-
-#define MIN_MAG_DB        -40.0     // min of spectrogram/waterfall magnitude axis
-#define MAX_MAG_DB          0.0     // max of spectrogram/waterfall magnitude axis
-#define STEP_MAG_DB         5.0     // magnitude axis step
-#define BETA                0.95    // constant for time averaging spectrum data
-#define MIN_F_HZ            0       // min freq on Waterfall and Spectrum
-#define MAX_F_HZ            3000    // max freq on Waterfall and Spectrum
-#define STEP_F_HZ           500     // major (e.g. text legend) freq step on Waterfall and Spectrum graticule
-#define STEP_MINOR_F_HZ     100     // minor (ticks) freq step on Waterfall and Spectrum graticule
-#define WATERFALL_SECS_Y    30      // number of seconds respresented by y axis of waterfall
-#define WATERFALL_SECS_STEP 5       // graticule y axis steps of waterfall
-#define DT                  0.1     // time between real time graphing updates
-#define FS                  8000    // FDMDV modem sample rate
-
-// Scatter diagram 
-
-#define SCATTER_MEM_SECS    10
-// (symbols/frame)/(graphics update period) = symbols/s sent to scatter memory
-// memory (symbols) = secs of memory * symbols/sec
-#define SCATTER_MEM_SYMS_MAX    ((int)(SCATTER_MEM_SECS*((FDMDV_NC_MAX+1)/DT)))
-
-// Waveform plotting constants
-
-#define WAVEFORM_PLOT_FS    400                            // sample rate (points/s) of waveform plotted to screen
-#define WAVEFORM_PLOT_TIME  5                              // length or entire waveform on screen
-#define WAVEFORM_PLOT_BUF   ((int)(DT*WAVEFORM_PLOT_FS))   // number of new samples we plot per DT
-
-// sample rate I/O & conversion constants
-
-#define MAX_FPB             8096                           // maximum value of portAudio framesPerBuffer
-#define PA_FPB              1024                           // nominal value of portAudio framesPerBuffer
-#define SAMPLE_RATE         48000                          // 48 kHz sampling rate rec. as we can trust accuracy of sound card
-#define N8                  160                            // processing buffer size at 8 kHz
-#define MEM8                (FDMDV_OS_TAPS/FDMDV_OS)
-#define N48                 (N8*SAMPLE_RATE/FS)            // processing buffer size at 48 kHz
-#define NUM_CHANNELS        2                              // I think most sound cards prefer stereo we will convert to mono
-#define VOX_TONE_FREQ       1000.0                         // optional left channel vox tone freq
-#define VOX_TONE_AMP        30000                          // optional left channel vox tone amp
-
-#define MAX_BITS_PER_CODEC_FRAME 64                            // 1600 bit/s mode
-#define MAX_BYTES_PER_CODEC_FRAME (MAX_BITS_PER_CODEC_FRAME/8)
-#define MAX_BITS_PER_FDMDV_FRAME 40                            // 2000 bit/s mode
-
-// Squelch
-#define SQ_DEFAULT_SNR       2.0
-
-// Level Gauge
-#define FROM_RADIO_MAX       0.8
-#define FROM_MIC_MAX         0.8
-#define LEVEL_BETA           0.99
-
-// SNR
-#define SNRSLOW_BETA        0.5                           // time constant for slow SNR for display
-
-// Text messaging Data
-#define MAX_CALLSIGN         80
-#define MAX_EVENT_LOG        10
-#define MAX_EVENT_RULES      100
-   
-enum
-{
-    ID_ROTATE_LEFT = wxID_HIGHEST + 1,
-    ID_ROTATE_RIGHT,
-    ID_RESIZE,
-    ID_PAINT_BG
-};
-
-// Codec 2 LPC Post Filter defaults, from codec-dev/src/quantise.c
-
-#define CODEC2_LPC_PF_GAMMA 0.5
-#define CODEC2_LPC_PF_BETA  0.2
-
-
-#endif  //__FDMDV2_DEFINES__
diff --git a/fdmdv2/branches/0.99/src/fdmdv2_main.cpp b/fdmdv2/branches/0.99/src/fdmdv2_main.cpp
deleted file mode 100644 (file)
index 2adec2c..0000000
+++ /dev/null
@@ -1,3686 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_main.cpp
-//
-// Purpose:         FreeDV main()
-// Created:         Apr. 9, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-
-#include "fdmdv2_main.h"
-
-#define wxUSE_FILEDLG   1
-#define wxUSE_LIBPNG    1
-#define wxUSE_LIBJPEG   1
-#define wxUSE_GIF       1
-#define wxUSE_PCX       1
-#define wxUSE_LIBTIFF   1
-
-//-------------------------------------------------------------------
-// Bunch of globals used for communication with sound card call
-// back functions
-// ------------------------------------------------------------------
-
-int g_in, g_out;
-
-// Global Codec2 & modem states - just one reqd for tx & rx
-int                 g_Nc;
-int                 g_mode;
-struct freedv      *g_pfreedv;
-struct MODEM_STATS  g_stats;
-float               g_pwr_scale;
-int                 g_clip;
-
-// test Frames
-int                 g_testFrames;
-int                 g_test_frame_sync_state;
-int                 g_test_frame_count;
-int                 g_total_bits;
-int                 g_total_bit_errors;
-int                 g_channel_noise;
-float               g_sig_pwr_av = 0.0;
-struct FIFO        *g_error_pattern_fifo;
-short              *g_error_hist;
-// time averaged magnitude spectrum used for waterfall and spectrum display
-float               g_avmag[MODEM_STATS_NSPEC];
-
-// GUI controls that affect rx and tx processes
-int   g_SquelchActive;
-float g_SquelchLevel;
-int   g_analog;
-int   g_split;
-int   g_tx;
-float g_snr;
-bool  g_half_duplex;
-bool  g_modal;
-
-// sending and receiving Call Sign data
-struct FIFO         *g_txDataInFifo;
-struct FIFO         *g_rxDataOutFifo;
-
-// tx/rx processing states
-int                 g_State;
-paCallBackData     *g_rxUserdata;
-
-// FIFOs used for plotting waveforms
-struct FIFO        *g_plotDemodInFifo;
-struct FIFO        *g_plotSpeechOutFifo;
-struct FIFO        *g_plotSpeechInFifo;
-
-// Soundcard config
-int                 g_nSoundCards;
-int                 g_soundCard1InDeviceNum;
-int                 g_soundCard1OutDeviceNum;
-int                 g_soundCard1SampleRate;
-int                 g_soundCard2InDeviceNum;
-int                 g_soundCard2OutDeviceNum;
-int                 g_soundCard2SampleRate;
-
-// playing and recording from sound files
-
-SNDFILE            *g_sfPlayFile;
-bool                g_playFileToMicIn;
-bool                g_loopPlayFileToMicIn;
-int                 g_playFileToMicInEventId;
-
-SNDFILE            *g_sfRecFile;
-bool                g_recFileFromRadio;
-unsigned int        g_recFromRadioSamples;
-int                 g_recFileFromRadioEventId;
-
-SNDFILE            *g_sfPlayFileFromRadio;
-bool                g_playFileFromRadio;
-int                 g_sfFs;
-bool                g_loopPlayFileFromRadio;
-int                 g_playFileFromRadioEventId;
-float               g_blink;
-
-wxWindow           *g_parent;
-
-// Click to tune rx and tx frequency offset states
-float               g_RxFreqOffsetHz;
-COMP                g_RxFreqOffsetPhaseRect;
-float               g_TxFreqOffsetHz;
-COMP                g_TxFreqOffsetPhaseRect;
-
-// experimental mutex to make sound card callbacks mutually exclusive
-// TODO: review code and see if we need this any more, as fifos should
-// now be thread safe
-
-wxMutex g_mutexProtectingCallbackData;
-
-// Speex pre-processor states
-
-SpeexPreprocessState *g_speex_st;
-
-// WxWidgets - initialize the application
-IMPLEMENT_APP(MainApp);
-
-//FILE *ft;
-FILE *g_logfile;
-
-//-------------------------------------------------------------------------
-// OnInit()
-//-------------------------------------------------------------------------
-bool MainApp::OnInit()
-{
-    if(!wxApp::OnInit())
-    {
-        return false;
-    }
-    SetVendorName(wxT("CODEC2-Project"));
-    SetAppName(wxT("FreeDV"));      // not needed, it's the default value
-
-    // DR - this is wrong define so won't be used on windows build, should be __WXMSW__
-    // So registry will be used for Win32
-#ifdef _WXMSW_
-    // Force use of file-based configuration persistance on Windows platforma
-    wxConfig *pConfig = new wxConfig();
-    wxFileConfig *pFConfig = new wxFileConfig(wxT("FreeDV"), wxT("CODEC2-Project"), wxT("FreeDV.conf"), wxT("FreeDV.conf"),  wxCONFIG_USE_LOCAL_FILE | wxCONFIG_USE_RELATIVE_PATH);
-    pConfig->Set(pFConfig);
-    pConfig->SetRecordDefaults();
-#else
-    wxConfigBase *pConfig = wxConfigBase::Get();
-    pConfig->SetRecordDefaults();
-#endif
-
-    m_rTopWindow = wxRect(0, 0, 0, 0);
-    m_strRxInAudio.Empty();
-    m_strRxOutAudio.Empty();
-    m_textVoiceInput.Empty();
-    m_textVoiceOutput.Empty();
-    m_strSampleRate.Empty();
-    m_strBitrate.Empty();
-    // Create the main application window
-    frame = new MainFrame(NULL);
-    SetTopWindow(frame);
-    // Should guarantee that the first plot tab defined is the one
-    // displayed. But it doesn't when built from command line.  Why?
-    frame->m_auiNbookCtrl->ChangeSelection(0);
-    frame->Layout();
-    frame->Show();
-    g_parent =frame;
-
-    //ft = fopen("tmp.raw","wb");
-    //assert(ft != NULL);
-
-    return true;
-}
-
-//-------------------------------------------------------------------------
-// OnExit()
-//-------------------------------------------------------------------------
-int MainApp::OnExit()
-{
-    return 0;
-}
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class MainFrame(wxFrame* pa->ent) : TopFrame(parent)
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-MainFrame::MainFrame(wxWindow *parent) : TopFrame(parent)
-{
-    m_zoom              = 1.;
-
-    #ifdef __WXMSW__
-    g_logfile = fopen("log.txt","wt");
-    #else
-    g_logfile = stderr;
-    #endif
-
-    SetMinSize(wxSize(400,400));
-
-    // Init Hamlib library, but we dont start talking to any rigs yet
-
-    wxGetApp().m_hamlib = new Hamlib();
-
-    tools->AppendSeparator();
-    wxMenuItem* m_menuItemToolsConfigDelete;
-    m_menuItemToolsConfigDelete = new wxMenuItem(tools, wxID_ANY, wxString(_("&Restore defaults")) , wxT("Delete config file/keys and restore defaults"), wxITEM_NORMAL);
-    this->Connect(m_menuItemToolsConfigDelete->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::OnDeleteConfig));
-
-    tools->Append(m_menuItemToolsConfigDelete);
-
-    wxConfigBase *pConfig = wxConfigBase::Get();
-
-    // restore frame position and size
-    int x = pConfig->Read(wxT("/MainFrame/left"),       20);
-    int y = pConfig->Read(wxT("/MainFrame/top"),        20);
-    int w = pConfig->Read(wxT("/MainFrame/width"),     800);
-    int h = pConfig->Read(wxT("/MainFrame/height"),    550);
-
-    // sanitise frame position as a first pass at Win32 registry bug
-
-    fprintf(g_logfile, "x = %d y = %d w = %d h = %d\n", x,y,w,h);
-    if (x < 0 || x > 2048) x = 20;
-    if (y < 0 || y > 2048) y = 20;
-    if (w < 0 || w > 2048) w = 800;
-    if (h < 0 || h > 2048) h = 550;
-
-    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_show_speech_in     = pConfig->Read(wxT("/MainFrame/show_speech_in"),    1);
-    wxGetApp().m_show_speech_out    = pConfig->Read(wxT("/MainFrame/show_speech_out"),   1);
-    wxGetApp().m_show_demod_in      = pConfig->Read(wxT("/MainFrame/show_demod_in"),     1);
-    wxGetApp().m_show_test_frame_errors = pConfig->Read(wxT("/MainFrame/show_test_frame_errors"),     1);
-    wxGetApp().m_show_test_frame_errors_hist = pConfig->Read(wxT("/MainFrame/show_test_frame_errors_hist"),     1);
-
-    wxGetApp().m_rxNbookCtrl        = pConfig->Read(wxT("/MainFrame/rxNbookCtrl"),    (long)0);
-
-    g_SquelchActive = pConfig->Read(wxT("/Audio/SquelchActive"), (long)0);
-    g_SquelchLevel = pConfig->Read(wxT("/Audio/SquelchLevel"), (int)(SQ_DEFAULT_SNR*2));
-    g_SquelchLevel /= 2.0;
-
-    Move(x, y);
-    SetClientSize(w, h);
-    
-    if(wxGetApp().m_show_wf)
-    {
-        // Add Waterfall Plot window
-        m_panelWaterfall = new PlotWaterfall((wxFrame*) m_auiNbookCtrl, false, 0);
-        m_panelWaterfall->SetToolTip(_("Left click to tune, Right click to toggle mono/colour"));
-        m_auiNbookCtrl->AddPage(m_panelWaterfall, _("Waterfall"), true, wxNullBitmap);
-    }
-    if(wxGetApp().m_show_spect)
-    {
-        // Add Spectrum Plot window
-        m_panelSpectrum = new PlotSpectrum((wxFrame*) m_auiNbookCtrl, g_avmag,
-                                           MODEM_STATS_NSPEC*((float)MAX_F_HZ/MODEM_STATS_MAX_F_HZ));
-        m_panelSpectrum->SetToolTip(_("Left click to tune"));
-        m_auiNbookCtrl->AddPage(m_panelSpectrum, _("Spectrum"), true, wxNullBitmap);
-    }
-    if(wxGetApp().m_show_scatter)
-    {
-        // Add Scatter Plot window
-        m_panelScatter = new PlotScatter((wxFrame*) m_auiNbookCtrl);
-        m_auiNbookCtrl->AddPage(m_panelScatter, _("Scatter"), true, wxNullBitmap);
-    }
-    if(wxGetApp().m_show_demod_in)
-    {
-        // Add Demod Input window
-        m_panelDemodIn = new PlotScalar((wxFrame*) m_auiNbookCtrl, 1, WAVEFORM_PLOT_TIME, 1.0/WAVEFORM_PLOT_FS, -1, 1, 1, 0.2, "%2.1f", 0);
-        m_auiNbookCtrl->AddPage(m_panelDemodIn, _("Frm Radio"), true, wxNullBitmap);
-        g_plotDemodInFifo = fifo_create(2*WAVEFORM_PLOT_BUF);
-    }
-
-    if(wxGetApp().m_show_speech_in)
-    {
-        // Add Speech Input window
-        m_panelSpeechIn = new PlotScalar((wxFrame*) m_auiNbookCtrl, 1, WAVEFORM_PLOT_TIME, 1.0/WAVEFORM_PLOT_FS, -1, 1, 1, 0.2, "%2.1f", 0);
-        m_auiNbookCtrl->AddPage(m_panelSpeechIn, _("Frm Mic"), true, wxNullBitmap);
-        g_plotSpeechInFifo = fifo_create(4*WAVEFORM_PLOT_BUF);
-    }
-
-    if(wxGetApp().m_show_speech_out)
-    {
-        // Add Speech Output window
-        m_panelSpeechOut = new PlotScalar((wxFrame*) m_auiNbookCtrl, 1, WAVEFORM_PLOT_TIME, 1.0/WAVEFORM_PLOT_FS, -1, 1, 1, 0.2, "%2.1f", 0);
-        m_auiNbookCtrl->AddPage(m_panelSpeechOut, _("To Spkr/Hdphns"), true, wxNullBitmap);
-        g_plotSpeechOutFifo = fifo_create(2*WAVEFORM_PLOT_BUF);
-    }
-
-    if(wxGetApp().m_show_timing)
-    {
-        // Add Timing Offset window
-        m_panelTimeOffset = new PlotScalar((wxFrame*) m_auiNbookCtrl, 1, 5.0, DT, -0.5, 0.5, 1, 0.1, "%2.1f", 0);
-        m_auiNbookCtrl->AddPage(m_panelTimeOffset, L"Timing \u0394", true, wxNullBitmap);
-    }
-    if(wxGetApp().m_show_freq)
-    {
-        // Add Frequency Offset window
-        m_panelFreqOffset = new PlotScalar((wxFrame*) m_auiNbookCtrl, 1, 5.0, DT, -200, 200, 1, 50, "%3.0fHz", 0);
-        m_auiNbookCtrl->AddPage(m_panelFreqOffset, L"Frequency \u0394", true, wxNullBitmap);
-    }
-
-    if(wxGetApp().m_show_test_frame_errors)
-    {
-        // Add Test Frame Errors window
-        m_panelTestFrameErrors = new PlotScalar((wxFrame*) m_auiNbookCtrl, 2*MODEM_STATS_NC_MAX, 30.0, DT, 0, 2*MODEM_STATS_NC_MAX+2, 1, 1, "", 1);
-        m_auiNbookCtrl->AddPage(m_panelTestFrameErrors, L"Test Frame Errors", true, wxNullBitmap);
-    }
-
-    if(wxGetApp().m_show_test_frame_errors_hist)
-    {
-        // Add Test Frame Errors window
-        m_panelTestFrameErrorsHist = new PlotScalar((wxFrame*) m_auiNbookCtrl, 1, 1.0, 1.0/(2*FDMDV_NC_MAX), 0.0, 1.0, 1.0/FDMDV_NC_MAX, 0.1, "%3.2f", 0);
-        m_auiNbookCtrl->AddPage(m_panelTestFrameErrorsHist, L"Test Frame Histogram", true, wxNullBitmap);
-    }
-
-    wxGetApp().m_framesPerBuffer = pConfig->Read(wxT("/Audio/framesPerBuffer"), PA_FPB);
-
-    g_soundCard1InDeviceNum  = pConfig->Read(wxT("/Audio/soundCard1InDeviceNum"),         -1);
-    g_soundCard1OutDeviceNum = pConfig->Read(wxT("/Audio/soundCard1OutDeviceNum"),        -1);
-    g_soundCard1SampleRate   = pConfig->Read(wxT("/Audio/soundCard1SampleRate"),          -1);
-
-    g_soundCard2InDeviceNum  = pConfig->Read(wxT("/Audio/soundCard2InDeviceNum"),         -1);
-    g_soundCard2OutDeviceNum = pConfig->Read(wxT("/Audio/soundCard2OutDeviceNum"),        -1);
-    g_soundCard2SampleRate   = pConfig->Read(wxT("/Audio/soundCard2SampleRate"),          -1);
-
-    g_nSoundCards = 0;
-    if ((g_soundCard1InDeviceNum > -1) && (g_soundCard1OutDeviceNum > -1)) {
-        g_nSoundCards = 1;
-        if ((g_soundCard2InDeviceNum > -1) && (g_soundCard2OutDeviceNum > -1))
-            g_nSoundCards = 2;
-    }
-
-    wxGetApp().m_playFileToMicInPath = pConfig->Read("/File/playFileToMicInPath",   wxT(""));
-    wxGetApp().m_recFileFromRadioPath = pConfig->Read("/File/recFileFromRadioPath", wxT(""));
-    wxGetApp().m_recFileFromRadioSecs = pConfig->Read("/File/recFileFromRadioSecs", 30);
-    wxGetApp().m_playFileFromRadioPath = pConfig->Read("/File/playFileFromRadioPath", wxT(""));
-
-    // PTT -------------------------------------------------------------------
-
-    wxGetApp().m_boolHalfDuplex     = pConfig->ReadBool(wxT("/Rig/HalfDuplex"),     true);
-    wxGetApp().m_leftChannelVoxTone = pConfig->ReadBool("/Rig/leftChannelVoxTone",  false);
-    wxGetApp().m_boolHamlibUseForPTT = pConfig->ReadBool("/Hamlib/UseForPTT", false);
-    wxGetApp().m_intHamlibRig = pConfig->ReadLong("/Hamlib/RigName", 0);
-    wxGetApp().m_strHamlibSerialPort = pConfig->Read("/Hamlib/SerialPort", "");
-    
-    wxGetApp().m_boolUseSerialPTT   = pConfig->ReadBool(wxT("/Rig/UseSerialPTT"),   false);
-    wxGetApp().m_strRigCtrlPort     = pConfig->Read(wxT("/Rig/Port"),               wxT(""));
-    wxGetApp().m_boolUseRTS         = pConfig->ReadBool(wxT("/Rig/UseRTS"),         true);
-    wxGetApp().m_boolRTSPos         = pConfig->ReadBool(wxT("/Rig/RTSPolarity"),    true);
-    wxGetApp().m_boolUseDTR         = pConfig->ReadBool(wxT("/Rig/UseDTR"),         false);
-    wxGetApp().m_boolDTRPos         = pConfig->ReadBool(wxT("/Rig/DTRPolarity"),    false);
-    com_handle = COM_HANDLE_INVALID;
-
-    // -----------------------------------------------------------------------
-
-    bool slow = false; // prevents compile error when using default bool
-    wxGetApp().m_snrSlow = pConfig->Read("/Audio/snrSlow", slow);
-
-    bool t = true;     // prevents compile error when using default bool
-    wxGetApp().m_codec2LPCPostFilterEnable     = pConfig->Read(wxT("/Filter/codec2LPCPostFilterEnable"),    t);
-    wxGetApp().m_codec2LPCPostFilterBassBoost  = pConfig->Read(wxT("/Filter/codec2LPCPostFilterBassBoost"), t);
-    wxGetApp().m_codec2LPCPostFilterGamma      = (float)pConfig->Read(wxT("/Filter/codec2LPCPostFilterGamma"),     CODEC2_LPC_PF_GAMMA*100)/100.0;
-    wxGetApp().m_codec2LPCPostFilterBeta       = (float)pConfig->Read(wxT("/Filter/codec2LPCPostFilterBeta"),      CODEC2_LPC_PF_BETA*100)/100.0;
-    //printf("main(): m_codec2LPCPostFilterBeta: %f\n", wxGetApp().m_codec2LPCPostFilterBeta);
-
-    wxGetApp().m_speexpp_enable     = pConfig->Read(wxT("/Filter/speexpp_enable"),    t);
-
-    wxGetApp().m_MicInBassFreqHz = (float)pConfig->Read(wxT("/Filter/MicInBassFreqHz"),    1);
-    wxGetApp().m_MicInBassGaindB = (float)pConfig->Read(wxT("/Filter/MicInBassGaindB"),    (long)0)/10.0;
-    wxGetApp().m_MicInTrebleFreqHz = (float)pConfig->Read(wxT("/Filter/MicInTrebleFreqHz"),    1);
-    wxGetApp().m_MicInTrebleGaindB = (float)pConfig->Read(wxT("/Filter/MicInTrebleGaindB"),    (long)0)/10.0;
-    wxGetApp().m_MicInMidFreqHz = (float)pConfig->Read(wxT("/Filter/MicInMidFreqHz"),    1);
-    wxGetApp().m_MicInMidGaindB = (float)pConfig->Read(wxT("/Filter/MicInMidGaindB"),    (long)0)/10.0;
-    wxGetApp().m_MicInMidQ = (float)pConfig->Read(wxT("/Filter/MicInMidQ"),              (long)100)/100.0;
-
-    bool f = false;
-    wxGetApp().m_MicInEQEnable = (float)pConfig->Read(wxT("/Filter/MicInEQEnable"), f);
-
-    wxGetApp().m_SpkOutBassFreqHz = (float)pConfig->Read(wxT("/Filter/SpkOutBassFreqHz"),    1);
-    wxGetApp().m_SpkOutBassGaindB = (float)pConfig->Read(wxT("/Filter/SpkOutBassGaindB"),    (long)0)/10.0;
-    wxGetApp().m_SpkOutTrebleFreqHz = (float)pConfig->Read(wxT("/Filter/SpkOutTrebleFreqHz"),    1);
-    wxGetApp().m_SpkOutTrebleGaindB = (float)pConfig->Read(wxT("/Filter/SpkOutTrebleGaindB"),    (long)0)/10.0;
-    wxGetApp().m_SpkOutMidFreqHz = (float)pConfig->Read(wxT("/Filter/SpkOutMidFreqHz"),    1);
-    wxGetApp().m_SpkOutMidGaindB = (float)pConfig->Read(wxT("/Filter/SpkOutMidGaindB"),    (long)0)/10.0;
-    wxGetApp().m_SpkOutMidQ = (float)pConfig->Read(wxT("/Filter/SpkOutMidQ"),                (long)100)/100.0;
-
-    wxGetApp().m_SpkOutEQEnable = (float)pConfig->Read(wxT("/Filter/SpkOutEQEnable"), f);
-
-    wxGetApp().m_callSign = pConfig->Read("/Data/CallSign", wxT(""));
-    wxGetApp().m_textEncoding = pConfig->Read("/Data/TextEncoding", 1);
-    wxGetApp().m_enable_checksum = pConfig->Read("/Data/EnableChecksumOnMsgRx", f);
-
-    wxGetApp().m_events = pConfig->Read("/Events/enable", f);
-    wxGetApp().m_events_spam_timer = (int)pConfig->Read(wxT("/Events/spam_timer"), 10);
-    wxGetApp().m_events_regexp_match = pConfig->Read("/Events/regexp_match", wxT("s=(.*)"));
-    wxGetApp().m_events_regexp_replace = pConfig->Read("/Events/regexp_replace", 
-                                                       wxT("curl http://qso.freedv.org/cgi-bin/onspot.cgi?s=\\1"));
-    // make sure regexp lists are terminated by a \n
-
-    if (wxGetApp().m_events_regexp_match.Last() != '\n') {
-        wxGetApp().m_events_regexp_match = wxGetApp().m_events_regexp_match+'\n';
-    }
-    if (wxGetApp().m_events_regexp_replace.Last() != '\n') {
-        wxGetApp().m_events_regexp_replace = wxGetApp().m_events_regexp_replace+'\n';
-    }
-
-    wxGetApp().m_udp_enable = (float)pConfig->Read(wxT("/UDP/enable"), f);
-    wxGetApp().m_udp_port = (int)pConfig->Read(wxT("/UDP/port"), 3000);
-
-    wxGetApp().m_FreeDV700txClip = (float)pConfig->Read(wxT("/FreeDV700/txClip"), t);
-
-    int mode  = pConfig->Read(wxT("/Audio/mode"), (long)0);
-    if (mode == 0)
-        m_rb1600->SetValue(1);
-    if (mode == 1)
-        m_rb700->SetValue(1);
-        
-    pConfig->SetPath(wxT("/"));
-
-//    this->Connect(m_menuItemHelpUpdates->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnHelpCheckUpdatesUI));
-    //m_togRxID->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnRxIDUI), NULL, this);
-    //m_togTxID->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnTxIDUI), NULL, this);
-    m_togBtnOnOff->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnOnOffUI), NULL, this);
-    m_togBtnSplit->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnSplitClickUI), NULL, this);
-    m_togBtnAnalog->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnAnalogClickUI), NULL, this);
-    //m_togBtnALC->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnALCClickUI), NULL, this);
-   // m_btnTogPTT->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnPTT_UI), NULL, this);
-
-    m_togBtnSplit->Disable();
-    //m_togRxID->Disable();
-    //m_togTxID->Disable();
-    m_togBtnAnalog->Disable();
-    m_btnTogPTT->Disable();
-    //m_togBtnALC->Disable();
-
-    // squelch settings
-    char sqsnr[15];
-    m_sliderSQ->SetValue((int)((g_SquelchLevel+5.0)*2.0));
-    sprintf(sqsnr, "%4.1f", g_SquelchLevel);
-    wxString sqsnr_string(sqsnr);
-    m_textSQ->SetLabel(sqsnr_string);
-    m_ckboxSQ->SetValue(g_SquelchActive);
-
-    // SNR settings
-
-    m_ckboxSNR->SetValue(wxGetApp().m_snrSlow);
-    setsnrBeta(wxGetApp().m_snrSlow);
-
-#ifdef _USE_TIMER
-    Bind(wxEVT_TIMER, &MainFrame::OnTimer, this);       // ID_MY_WINDOW);
-    m_plotTimer.SetOwner(this, ID_TIMER_WATERFALL);
-    //m_panelWaterfall->Refresh();
-#endif
-
-    m_RxRunning = false;
-
-#ifdef _USE_ONIDLE
-    Connect(wxEVT_IDLE, wxIdleEventHandler(MainFrame::OnIdle), NULL, this);
-#endif //_USE_ONIDLE
-
-    g_sfPlayFile = NULL;
-    g_playFileToMicIn = false;
-    g_loopPlayFileToMicIn = false;
-
-    g_sfRecFile = NULL;
-    g_recFileFromRadio = false;
-
-    g_sfPlayFileFromRadio = NULL;
-    g_playFileFromRadio = false;
-    g_loopPlayFileFromRadio = false;
-
-    // init click-tune states
-
-    g_RxFreqOffsetHz = 0.0;
-    g_RxFreqOffsetPhaseRect.real = cos(0.0);
-    g_RxFreqOffsetPhaseRect.imag = sin(0.0);
-    m_panelWaterfall->setRxFreq(FDMDV_FCENTRE - g_RxFreqOffsetHz);
-    m_panelSpectrum->setRxFreq(FDMDV_FCENTRE - g_RxFreqOffsetHz);
-
-    g_TxFreqOffsetHz = 0.0;
-    g_TxFreqOffsetPhaseRect.real = cos(0.0);
-    g_TxFreqOffsetPhaseRect.imag = sin(0.0);
-
-    g_tx = 0;
-    g_split = 0;
-
-    // data states
-    g_txDataInFifo = fifo_create(MAX_CALLSIGN*VARICODE_MAX_BITS);
-    g_rxDataOutFifo = fifo_create(MAX_CALLSIGN*VARICODE_MAX_BITS);
-
-    sox_biquad_start();
-    golay23_init();
-
-    g_testFrames = 0;
-    g_test_frame_sync_state = 0;
-    g_total_bit_errors = 0;
-    g_total_bits = 0;
-    wxGetApp().m_testFrames = false;
-
-    g_modal = false;
-
-    // Start UDP listener thread
-
-    m_UDPThread = NULL;
-    startUDPThread();
-
-    optionsDlg = new OptionsDlg(NULL);
-    m_schedule_restore = false;
-
-}
-
-//-------------------------------------------------------------------------
-// ~MainFrame()
-//-------------------------------------------------------------------------
-MainFrame::~MainFrame()
-{
-    int x;
-    int y;
-    int w;
-    int h;
-
-    //fclose(ft);
-    #ifdef __WXMSW__
-    fclose(g_logfile);
-    #endif
-
-    if (optionsDlg != NULL) {
-        delete optionsDlg;
-        optionsDlg = NULL;
-    }
-
-    stopUDPThread();
-
-    /* TOOD(Joel): the ownership of m_hamlib is probably wrong. */
-    if (wxGetApp().m_hamlib) delete wxGetApp().m_hamlib;
-
-    //MainApp *pApp = wxGetApp();
-    wxConfigBase *pConfig = wxConfigBase::Get();
-    if(pConfig)
-    {
-        if (!IsIconized()) {
-            GetClientSize(&w, &h);
-
-            // big hack - for some reason height shrinks by this much
-            // every time FreeDV runs!  I have no idea why
-
-            h += 23;
-
-            GetPosition(&x, &y);
-            printf("x = %d y = %d w = %d h = %d\n", x,y,w,h);
-            pConfig->Write(wxT("/MainFrame/left"),               (long) x);
-            pConfig->Write(wxT("/MainFrame/top"),                (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("/MainFrame/show_speech_in"),    wxGetApp().m_show_speech_in);
-        pConfig->Write(wxT("/MainFrame/show_speech_out"),   wxGetApp().m_show_speech_out);
-        pConfig->Write(wxT("/MainFrame/show_demod_in"),     wxGetApp().m_show_demod_in);
-        pConfig->Write(wxT("/MainFrame/show_test_frame_errors"), wxGetApp().m_show_test_frame_errors);
-        pConfig->Write(wxT("/MainFrame/show_test_frame_errors_hist"), wxGetApp().m_show_test_frame_errors_hist);
-
-        pConfig->Write(wxT("/MainFrame/rxNbookCtrl"), wxGetApp().m_rxNbookCtrl);
-
-        pConfig->Write(wxT("/Audio/SquelchActive"),         g_SquelchActive);
-        pConfig->Write(wxT("/Audio/SquelchLevel"),          (int)(g_SquelchLevel*2.0));
-
-        pConfig->Write(wxT("/Audio/framesPerBuffer"),       wxGetApp().m_framesPerBuffer);
-
-        pConfig->Write(wxT("/Audio/soundCard1InDeviceNum"),   g_soundCard1InDeviceNum);
-        pConfig->Write(wxT("/Audio/soundCard1OutDeviceNum"),  g_soundCard1OutDeviceNum);
-        pConfig->Write(wxT("/Audio/soundCard1SampleRate"),    g_soundCard1SampleRate );
-
-        pConfig->Write(wxT("/Audio/soundCard2InDeviceNum"),   g_soundCard2InDeviceNum);
-        pConfig->Write(wxT("/Audio/soundCard2OutDeviceNum"),  g_soundCard2OutDeviceNum);
-        pConfig->Write(wxT("/Audio/soundCard2SampleRate"),    g_soundCard2SampleRate );
-
-        pConfig->Write(wxT("/Rig/HalfDuplex"),              wxGetApp().m_boolHalfDuplex);
-        pConfig->Write(wxT("/Rig/leftChannelVoxTone"),      wxGetApp().m_leftChannelVoxTone);
-        pConfig->Write("/Hamlib/UseForPTT", wxGetApp().m_boolHamlibUseForPTT);
-        pConfig->Write("/Hamlib/RigName", wxGetApp().m_intHamlibRig);
-        pConfig->Write("/Hamlib/SerialPort", wxGetApp().m_strHamlibSerialPort);
-
-
-        pConfig->Write(wxT("/File/playFileToMicInPath"),    wxGetApp().m_playFileToMicInPath);
-        pConfig->Write(wxT("/File/recFileFromRadioPath"),   wxGetApp().m_recFileFromRadioPath);
-        pConfig->Write(wxT("/File/recFileFromRadioSecs"),   wxGetApp().m_recFileFromRadioSecs);
-        pConfig->Write(wxT("/File/playFileFromRadioPath"),  wxGetApp().m_playFileFromRadioPath);
-
-        pConfig->Write(wxT("/Audio/snrSlow"), wxGetApp().m_snrSlow);
-
-        pConfig->Write(wxT("/Data/CallSign"), wxGetApp().m_callSign);
-        pConfig->Write(wxT("/Data/TextEncoding"), wxGetApp().m_textEncoding);
-        pConfig->Write(wxT("/Data/EnableChecksumOnMsgRx"), wxGetApp().m_enable_checksum);
-        pConfig->Write(wxT("/Events/enable"), wxGetApp().m_events);
-        pConfig->Write(wxT("/Events/spam_timer"), wxGetApp().m_events_spam_timer);
-        pConfig->Write(wxT("/Events/regexp_match"), wxGetApp().m_events_regexp_match);
-        pConfig->Write(wxT("/Events/regexp_replace"), wxGetApp().m_events_regexp_replace);
-        pConfig->Write(wxT("/UDP/enable"), wxGetApp().m_udp_enable);
-        pConfig->Write(wxT("/UDP/port"),  wxGetApp().m_udp_port);
-
-        pConfig->Write(wxT("/Filter/MicInEQEnable"), wxGetApp().m_MicInEQEnable);
-        pConfig->Write(wxT("/Filter/SpkOutEQEnable"), wxGetApp().m_SpkOutEQEnable);
-
-        pConfig->Write(wxT("/FreeDV700/txClip"), wxGetApp().m_FreeDV700txClip);
-
-        int mode;
-        if (m_rb1600->GetValue())
-            mode = 0;
-        if (m_rb700->GetValue())
-            mode = 1;
-        pConfig->Write(wxT("/Audio/mode"), mode);
-    }
-
-    //m_togRxID->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnRxIDUI), NULL, this);
-    //m_togTxID->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnTxIDUI), NULL, this);
-    m_togBtnOnOff->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnOnOffUI), NULL, this);
-    m_togBtnSplit->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnSplitClickUI), NULL, this);
-    m_togBtnAnalog->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnAnalogClickUI), NULL, this);
-    //m_togBtnALC->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnALCClickUI), NULL, this);
-    //m_btnTogPTT->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnPTT_UI), NULL, this);
-
-    sox_biquad_finish();
-
-    if (m_RxRunning)
-    {
-        stopRxStream();
-    }
-    if (g_sfPlayFile != NULL)
-    {
-        sf_close(g_sfPlayFile);
-        g_sfPlayFile = NULL;
-    }
-    if (g_sfRecFile != NULL)
-    {
-        sf_close(g_sfRecFile);
-        g_sfRecFile = NULL;
-    }
-#ifdef _USE_TIMER
-    if(m_plotTimer.IsRunning())
-    {
-        m_plotTimer.Stop();
-        Unbind(wxEVT_TIMER, &MainFrame::OnTimer, this);
-    }
-#endif //_USE_TIMER
-
-#ifdef _USE_ONIDLE
-    Disconnect(wxEVT_IDLE, wxIdleEventHandler(MainFrame::OnIdle), NULL, this);
-#endif // _USE_ONIDLE
-
-    delete wxConfigBase::Set((wxConfigBase *) NULL);
-}
-
-//----------------------------------------------------------------
-// closeComPort() closes the currently open com port
-//----------------------------------------------------------------
-void MainFrame::closeComPort(void)
-{
-#ifdef _WIN32
-       CloseHandle(com_handle);
-#else
-       close(com_handle);
-#endif
-       com_handle = COM_HANDLE_INVALID;
-}
-
-//----------------------------------------------------------------
-// openComPort() opens the com port specified by the string
-// ie: "COM1" on Windows or "/dev/ttyu0" on FreeBSD
-//----------------------------------------------------------------
-bool MainFrame::openComPort(const char *name)
-{
-       if(com_handle != COM_HANDLE_INVALID)
-               closeComPort();
-#ifdef _WIN32
-       {
-               COMMCONFIG CC;
-               DWORD CCsize=sizeof(CC);
-               COMMTIMEOUTS timeouts;
-               DCB     dcb;
-
-               if(GetDefaultCommConfigA(name, &CC, &CCsize)) {
-                       CC.dcb.fOutxCtsFlow             = FALSE;
-                       CC.dcb.fOutxDsrFlow             = FALSE;
-                       CC.dcb.fDtrControl              = DTR_CONTROL_DISABLE;
-                       CC.dcb.fDsrSensitivity  = FALSE;
-                       CC.dcb.fRtsControl              = RTS_CONTROL_DISABLE;
-                       SetDefaultCommConfigA(name, &CC, CCsize);
-               }
-
-               if((com_handle=CreateFileA(name
-                       ,GENERIC_READ|GENERIC_WRITE     /* Access */
-                       ,0                                                              /* Share mode */
-                       ,NULL                                                   /* Security attributes */
-                       ,OPEN_EXISTING                                  /* Create access */
-                       ,FILE_ATTRIBUTE_NORMAL                  /* File attributes */
-                       ,NULL                                                   /* Template */
-                       ))==INVALID_HANDLE_VALUE)
-                       return false;
-
-               if(GetCommTimeouts(com_handle, &timeouts)) {
-                       timeouts.ReadIntervalTimeout=MAXDWORD;
-                       timeouts.ReadTotalTimeoutMultiplier=0;
-                       timeouts.ReadTotalTimeoutConstant=0;            // No-wait read timeout
-                       timeouts.WriteTotalTimeoutMultiplier=0;
-                       timeouts.WriteTotalTimeoutConstant=5000;        // 5 seconds
-                       SetCommTimeouts(com_handle,&timeouts);
-               }
-
-               /* Force N-8-1 mode: */
-               if(GetCommState(com_handle, &dcb)==TRUE) {
-                       dcb.ByteSize            = 8;
-                       dcb.Parity                      = NOPARITY;
-                       dcb.StopBits            = ONESTOPBIT;
-                       dcb.DCBlength           = sizeof(DCB);
-                       dcb.fBinary                     = TRUE;
-                       dcb.fOutxCtsFlow        = FALSE;
-                       dcb.fOutxDsrFlow        = FALSE;
-                       dcb.fDtrControl         = DTR_CONTROL_DISABLE;
-                       dcb.fDsrSensitivity     = FALSE;
-                       dcb.fTXContinueOnXoff= TRUE;
-                       dcb.fOutX                       = FALSE;
-                       dcb.fInX                        = FALSE;
-                       dcb.fRtsControl         = RTS_CONTROL_DISABLE;
-                       dcb.fAbortOnError       = FALSE;
-                       SetCommState(com_handle, &dcb);
-               }
-       }
-#else
-       {
-               struct termios t;
-
-               if((com_handle=open(name, O_NONBLOCK|O_RDWR))==COM_HANDLE_INVALID)
-                       return false;
-
-               if(tcgetattr(com_handle, &t)==-1) {
-                       close(com_handle);
-                       com_handle = COM_HANDLE_INVALID;
-                       return false;
-               }
-
-               t.c_iflag = (
-                                         IGNBRK   /* ignore BREAK condition */
-                                       | IGNPAR   /* ignore (discard) parity errors */
-                                       );
-               t.c_oflag = 0;  /* No output processing */
-               t.c_cflag = (
-                                         CS8         /* 8 bits */
-                                       | CREAD       /* enable receiver */
-               /*
-               Fun snippet from the FreeBSD manpage:
-
-                        If CREAD is set, the receiver is enabled.  Otherwise, no character is
-                        received.  Not all hardware supports this bit.  In fact, this flag is
-                        pretty silly and if it were not part of the termios specification it
-                        would be omitted.
-               */
-                                       | CLOCAL      /* ignore modem status lines */
-                                       );
-               t.c_lflag = 0;  /* No local modes */
-               if(tcsetattr(com_handle, TCSANOW, &t)==-1) {
-                       close(com_handle);
-                       com_handle = COM_HANDLE_INVALID;
-                       return false;
-               }
-               
-       }
-#endif
-       return true;
-}
-
-#ifdef _USE_ONIDLE
-void MainFrame::OnIdle(wxIdleEvent &evt) {
-}
-#endif
-
-//----------------------------------------------------------------
-// (raise|lower)(RTS|DTR)()
-//
-// Raises/lowers the specified signal
-//----------------------------------------------------------------
-void MainFrame::raiseDTR(void)
-{
-       if(com_handle == COM_HANDLE_INVALID)
-               return;
-#ifdef _WIN32
-       EscapeCommFunction(com_handle, SETDTR);
-#else
-       {       // For C89 happiness
-               int flags = TIOCM_DTR;
-               ioctl(com_handle, TIOCMBIS, &flags);
-       }
-#endif
-}
-void MainFrame::raiseRTS(void)
-{
-       if(com_handle == COM_HANDLE_INVALID)
-               return;
-#ifdef _WIN32
-       EscapeCommFunction(com_handle, SETRTS);
-#else
-       {       // For C89 happiness
-               int flags = TIOCM_RTS;
-               ioctl(com_handle, TIOCMBIS, &flags);
-       }
-#endif
-}
-void MainFrame::lowerDTR(void)
-{
-       if(com_handle == COM_HANDLE_INVALID)
-               return;
-#ifdef _WIN32
-       EscapeCommFunction(com_handle, CLRDTR);
-#else
-       {       // For C89 happiness
-               int flags = TIOCM_DTR;
-               ioctl(com_handle, TIOCMBIC, &flags);
-       }
-#endif
-}
-void MainFrame::lowerRTS(void)
-{
-       if(com_handle == COM_HANDLE_INVALID)
-               return;
-#ifdef _WIN32
-       EscapeCommFunction(com_handle, CLRRTS);
-#else
-       {       // For C89 happiness
-               int flags = TIOCM_RTS;
-               ioctl(com_handle, TIOCMBIC, &flags);
-       }
-#endif
-}
-
-
-#ifdef _USE_TIMER
-//----------------------------------------------------------------
-// OnTimer()
-//
-// when the timer fires every DT seconds we update the GUI displays.
-// the tabs only the plot that is visible actually gets updated, this
-// keeps CPU load reasonable
-//----------------------------------------------------------------
-void MainFrame::OnTimer(wxTimerEvent &evt)
-{
-
-    int r,c;
-
-    if (m_panelWaterfall->checkDT()) {
-        m_panelWaterfall->setRxFreq(FDMDV_FCENTRE - g_RxFreqOffsetHz);
-        m_panelWaterfall->m_newdata = true;
-        m_panelWaterfall->Refresh();
-    }
-
-    m_panelSpectrum->setRxFreq(FDMDV_FCENTRE - g_RxFreqOffsetHz);
-    m_panelSpectrum->m_newdata = true;
-    m_panelSpectrum->Refresh();
-
-    /* update scatter plot -----------------------------------------------------------------*/
-
-    for (r=0; r<g_stats.nr; r++) {
-        
-        if (g_pfreedv->mode == FREEDV_MODE_1600) {
-            m_panelScatter->add_new_samples(&g_stats.rx_symbols[r][0]);
-        }
-
-        if (g_pfreedv->mode == FREEDV_MODE_700) {
-
-            /* 
-               FreeDV 700 uses diversity, so combine symbols for
-               scatter plot, as combined symbols are used for
-               demodulation.  Note we need to use a copy of the
-               symbols, as we are not sure when the stats will be
-               updated.
-            */
-
-            COMP rx_symbols_copy[g_Nc/2];
-
-            for(c=0; c<g_Nc/2; c++)
-                rx_symbols_copy[c] = cadd(g_stats.rx_symbols[r][c], g_stats.rx_symbols[r][c+g_Nc/2]);
-            m_panelScatter->add_new_samples(rx_symbols_copy);
-        }
-       
-    }
-
-    m_panelScatter->Refresh();
-
-    // Oscilliscope type speech plots -------------------------------------------------------
-
-    short speechInPlotSamples[WAVEFORM_PLOT_BUF];
-    if (fifo_read(g_plotSpeechInFifo, speechInPlotSamples, WAVEFORM_PLOT_BUF)) {
-        memset(speechInPlotSamples, 0, WAVEFORM_PLOT_BUF*sizeof(short));
-        //fprintf(stderr, "empty!\n");
-    }
-    m_panelSpeechIn->add_new_short_samples(0, speechInPlotSamples, WAVEFORM_PLOT_BUF, 32767);
-    m_panelSpeechIn->Refresh();
-
-    short speechOutPlotSamples[WAVEFORM_PLOT_BUF];
-    if (fifo_read(g_plotSpeechOutFifo, speechOutPlotSamples, WAVEFORM_PLOT_BUF))
-        memset(speechOutPlotSamples, 0, WAVEFORM_PLOT_BUF*sizeof(short));
-    m_panelSpeechOut->add_new_short_samples(0, speechOutPlotSamples, WAVEFORM_PLOT_BUF, 32767);
-    m_panelSpeechOut->Refresh();
-
-    short demodInPlotSamples[WAVEFORM_PLOT_BUF];
-    if (fifo_read(g_plotDemodInFifo, demodInPlotSamples, WAVEFORM_PLOT_BUF)) {
-        memset(demodInPlotSamples, 0, WAVEFORM_PLOT_BUF*sizeof(short));
-    }
-    m_panelDemodIn->add_new_short_samples(0,demodInPlotSamples, WAVEFORM_PLOT_BUF, 32767);
-    m_panelDemodIn->Refresh();
-
-    // Demod states -----------------------------------------------------------------------
-
-    m_panelTimeOffset->add_new_sample(0, (float)g_stats.rx_timing/FDMDV_NOM_SAMPLES_PER_FRAME);
-    m_panelTimeOffset->Refresh();
-
-    m_panelFreqOffset->add_new_sample(0, g_stats.foff);
-    m_panelFreqOffset->Refresh();
-
-    // SNR text box and gauge ------------------------------------------------------------
-
-    // LP filter g_stats.snr_est some more to stabilise the
-    // display. g_stats.snr_est already has some low pass filtering
-    // but we need it fairly fast to activate squelch.  So we
-    // optionally perform some further filtering for the display
-    // version of SNR.  The "Slow" checkbox controls the amount of
-    // filtering.  The filtered snr also controls the squelch
-
-    g_snr = m_snrBeta*g_snr + (1.0 - m_snrBeta)*g_stats.snr_est;
-    float snr_limited = g_snr;
-    if (snr_limited < -5.0) snr_limited = -5.0;
-    if (snr_limited > 20.0) snr_limited = 20.0;
-
-    char snr[15];
-    sprintf(snr, "%d", (int)(g_snr+0.5)); // round to nearest dB
-
-    //printf("snr_est: %f m_snrBeta: %f g_snr: %f snr_limited: %f\n", g_stats.snr_est,  m_snrBeta, g_snr, snr_limited);
-
-    wxString snr_string(snr);
-    m_textSNR->SetLabel(snr_string);
-    m_gaugeSNR->SetValue((int)(snr_limited+5));
-
-    // Level Gauge -----------------------------------------------------------------------
-
-    float tooHighThresh;
-    if (!g_tx && m_RxRunning)
-    {
-        // receive mode - display From Radio peaks
-        // peak from this DT sampling period
-        int maxDemodIn = 0;
-        for(int i=0; i<WAVEFORM_PLOT_BUF; i++)
-            if (maxDemodIn < abs(demodInPlotSamples[i]))
-                maxDemodIn = abs(demodInPlotSamples[i]);
-
-        // peak from last second
-        if (maxDemodIn > m_maxLevel)
-            m_maxLevel = maxDemodIn;
-
-        tooHighThresh = FROM_RADIO_MAX;
-    }
-    else
-    {
-        // transmit mode - display From Mic peaks
-
-        // peak from this DT sampling period
-        int maxSpeechIn = 0;
-        for(int i=0; i<WAVEFORM_PLOT_BUF; i++)
-            if (maxSpeechIn < abs(speechInPlotSamples[i]))
-                maxSpeechIn = abs(speechInPlotSamples[i]);
-
-        // peak from last second
-        if (maxSpeechIn > m_maxLevel)
-            m_maxLevel = maxSpeechIn;
-
-       tooHighThresh = FROM_MIC_MAX;
-    }
-
-    // Peak Reading meter: updates peaks immediately, then slowly decays
-    int maxScaled = (int)(100.0 * ((float)m_maxLevel/32767.0));
-    m_gaugeLevel->SetValue(maxScaled);
-    //printf("maxScaled: %d\n", maxScaled);
-    if (((float)maxScaled/100) > tooHighThresh)
-        m_textLevel->SetLabel("Too High");
-    else
-        m_textLevel->SetLabel("");
-
-    m_maxLevel *= LEVEL_BETA;
-
-    // sync LED (Colours don't work on Windows) ------------------------
-
-    if (g_State) {
-        m_rbSync->SetForegroundColour( wxColour( 0, 255, 0 ) ); // green
-        m_rbSync->SetValue(true);
-    }
-    else {
-        m_rbSync->SetForegroundColour( wxColour( 255, 0, 0 ) ); // red
-        m_rbSync->SetValue(false);
-    }
-
-    // send Callsign ----------------------------------------------------
-
-    char callsign[MAX_CALLSIGN];
-    strncpy(callsign, (const char*) wxGetApp().m_callSign.mb_str(wxConvUTF8), MAX_CALLSIGN-1);
-
-    // buffer 1 txt message to ensure tx data fifo doesn't "run dry"
-
-    if ((unsigned)fifo_used(g_txDataInFifo) < strlen(callsign)) {
-        unsigned int  i;
-
-        //fprintf(g_logfile, "tx callsign: %s.\n", callsign);
-
-        /* optionally append checksum */
-
-        if (wxGetApp().m_enable_checksum) {
-
-            unsigned char checksum = 0;
-            char callsign_checksum_cr[MAX_CALLSIGN+1];
-
-            for(i=0; i<strlen(callsign); i++)
-                checksum += callsign[i];
-            sprintf(callsign_checksum_cr, "%s%2x", callsign, checksum);
-            callsign_checksum_cr[strlen(callsign)+2] = 13;
-            callsign_checksum_cr[strlen(callsign)+3] = 0;
-            strcpy(callsign, callsign_checksum_cr);
-        }
-        else {
-            callsign[strlen(callsign)] = 13;
-            callsign[strlen(callsign)+1] = 0;
-        }
-
-        //fprintf(g_logfile, "tx callsign: %s.\n", callsign);
-
-        // write chars to tx data fifo
-
-        for(i=0; i<strlen(callsign); i++) {
-            short ashort = (short)callsign[i];
-            fifo_write(g_txDataInFifo, &ashort, 1);
-        }
-    }
-
-    // See if any Callsign info received --------------------------------
-
-    short ashort;
-    while (fifo_read(g_rxDataOutFifo, &ashort, 1) == 0) {
-
-        if ((ashort == 13) || ((m_pcallsign - m_callsign) > MAX_CALLSIGN-1)) {
-            // CR completes line
-            *m_pcallsign = 0;
-            
-            /* Checksums can be disabled, e.g. for compatability with
-               older vesions.  In that case we print msg but don't do
-               any event processing.  If checksums enabled, only print
-               out when checksum is good. */
-
-            if (wxGetApp().m_enable_checksum) {
-                // lets see if checksum is OK
-            
-                unsigned char checksum_rx = 0;
-                if (strlen(m_callsign) > 2) {
-                    for(unsigned int i=0; i<strlen(m_callsign)-2; i++)
-                        checksum_rx += m_callsign[i];
-                }
-                unsigned int checksum_tx;
-                int ret = sscanf(&m_callsign[strlen(m_callsign)-2], "%2x", &checksum_tx);
-                //fprintf(g_logfile, "rx callsign: %s.\n  checksum tx: %02x checksum rx: %02x\n", m_callsign, checksum_tx, checksum_rx);
-
-                wxString s;
-                if (ret && (checksum_tx == checksum_rx)) {
-                    m_callsign[strlen(m_callsign)-2] = 0;
-                    s.Printf("%s", m_callsign);
-                    m_txtCtrlCallSign->SetValue(s);
-
-                    char s1[MAX_CALLSIGN];
-                    sprintf(s1,"rx_txtmsg %s", m_callsign);
-                    processTxtEvent(s1);
-
-                    m_checksumGood++;
-                    s.Printf("%d", m_checksumGood);
-                    m_txtChecksumGood->SetLabel(s);              
-                }
-                else {
-                    m_checksumBad++;
-                    s.Printf("%d", m_checksumBad);
-                    m_txtChecksumBad->SetLabel(s);        
-                }
-            }
-
-            //fprintf(g_logfile,"resetting callsign %s %ld\n", m_callsign, m_pcallsign-m_callsign);
-            // reset ptr to start of string
-            m_pcallsign = m_callsign;
-        }
-        else {
-            //fprintf(g_logfile, "new char %d %c\n", ashort, (char)ashort);
-            *m_pcallsign++ = (char)ashort;
-        }
-
-        /* If checksums disabled, display txt chars as they arrive */
-
-        if (!wxGetApp().m_enable_checksum) {
-            m_txtCtrlCallSign->SetValue(m_callsign);
-        }
-    }
-
-    // Run time update of EQ filters -----------------------------------
-    if (m_newMicInFilter || m_newSpkOutFilter) {
-        g_mutexProtectingCallbackData.Lock();
-        deleteEQFilters(g_rxUserdata);
-        designEQFilters(g_rxUserdata);
-        g_mutexProtectingCallbackData.Unlock();
-        m_newMicInFilter = m_newSpkOutFilter = false;
-    }
-    g_rxUserdata->micInEQEnable = wxGetApp().m_MicInEQEnable;
-    g_rxUserdata->spkOutEQEnable = wxGetApp().m_SpkOutEQEnable;
-
-    // Run time update of FreeDV 700 tx clipper
-
-    g_pfreedv->clip = (int)wxGetApp().m_FreeDV700txClip;
-
-    // Test Frame Bit Error Updates ------------------------------------
-
-    // Toggle test frame mode at run time
-
-    if (!g_pfreedv->test_frames && wxGetApp().m_testFrames) {
-
-        // reset stats on check box off to on transition
-
-        g_pfreedv->test_frames = 1;
-        g_pfreedv->test_frame_sync_state = 0;
-        g_pfreedv->total_bits = 0;
-        g_pfreedv->total_bit_errors = 0;
-    }
-    g_pfreedv->test_frames =  wxGetApp().m_testFrames;
-    g_channel_noise =  wxGetApp().m_channel_noise;
-
-    if (g_State) {
-        char bits[80], errors[80], ber[80];
-
-        // update stats on main page
-
-        sprintf(bits, "Bits: %d", (int)g_pfreedv->total_bits); wxString bits_string(bits); m_textBits->SetLabel(bits_string);
-        sprintf(errors, "Errs: %d", (int)g_pfreedv->total_bit_errors); wxString errors_string(errors); m_textErrors->SetLabel(errors_string);
-        float b = (float)g_pfreedv->total_bit_errors/(1E-6+g_pfreedv->total_bits);
-        sprintf(ber, "BER: %4.3f", b); wxString ber_string(ber); m_textBER->SetLabel(ber_string);
-
-        // update error plots
-
-        int sz_error_pattern = g_pfreedv->sz_error_pattern;
-        short error_pattern[sz_error_pattern];
-
-        if (fifo_read(g_error_pattern_fifo, error_pattern, sz_error_pattern) == 0) {
-            int i,b;
-
-            /* both modes map IQ to alternate bits, but one same carrier */
-
-            if (g_pfreedv->mode == FREEDV_MODE_1600) {
-                /* FreeDV 1600 mapping from error pattern to bit on each carrier */
-
-                for(b=0; b<g_Nc*2; b++) {
-                    for(i=b; i<sz_error_pattern; i+= 2*g_Nc) {
-                        m_panelTestFrameErrors->add_new_sample(b, b + 0.8*error_pattern[i]);
-                        g_error_hist[b] += error_pattern[i];
-                    }
-                    //if (b%2)
-                    //    printf("g_error_hist[%d]: %d\n", b/2, g_error_hist[b/2]);
-                }
-
-                int max_hist = 0;
-                for(b=0; b<g_Nc; b++)
-                    if (g_error_hist[b] > max_hist)
-                        max_hist = g_error_hist[b];
-
-                m_panelTestFrameErrorsHist->add_new_short_samples(0, g_error_hist, 2*FDMDV_NC_MAX, max_hist);
-            }
-       
-            if (g_pfreedv->mode == FREEDV_MODE_700) {
-                int c;
-
-                /* FreeDV 700 mapping from error pattern to bit on each
-                   carrier.  Note we don't have access to carriers before
-                   diversity re-combination, so this won't give us the full
-                   picture, we have to assume Nc/2 carriers. */
-
-                for(i=0; i<sz_error_pattern; i++) {
-                    c = i/4;
-                    m_panelTestFrameErrors->add_new_sample(c, c + 0.8*error_pattern[i]);
-                    g_error_hist[c] += error_pattern[i];
-                    //printf("i: %d c: %d\n", i, c);
-                }
-
-                int max_hist = 0;
-                for(b=0; b<g_Nc; b++)
-                    if (g_error_hist[b] > max_hist)
-                        max_hist = g_error_hist[b];
-                m_panelTestFrameErrorsHist->add_new_short_samples(0, g_error_hist, 2*FDMDV_NC_MAX, max_hist);                
-            }
-            m_panelTestFrameErrors->Refresh();       
-            m_panelTestFrameErrorsHist->Refresh();
-        }
-    }
-
-    // command from UDP thread that is best processed in main thread to avoid seg faults
-
-    if (m_schedule_restore) {
-        if (IsIconized())
-            Restore();
-        m_schedule_restore = false;
-    }
-
-    // Light Spam Timer LED if at least one timer is running
-
-    int i;
-    optionsDlg->SetSpamTimerLight(false);
-    for(i=0; i<MAX_EVENT_RULES; i++)
-        if (spamTimer[i].IsRunning())
-            optionsDlg->SetSpamTimerLight(true);        
-
-    // Blink file playback status line
-
-    if (g_playFileFromRadio) {
-        g_blink += DT;
-        //fprintf(g_logfile, "g_blink: %f\n", g_blink);
-        if ((g_blink >= 1.0) && (g_blink < 2.0))
-            SetStatusText(wxT("Playing into from radio"), 0);
-        if (g_blink >= 2.0) {
-            SetStatusText(wxT(""), 0);
-            g_blink = 0.0;
-        }
-    }
-
-}
-#endif
-
-
-//-------------------------------------------------------------------------
-// OnCloseFrame()
-//-------------------------------------------------------------------------
-void MainFrame::OnCloseFrame(wxCloseEvent& event)
-{
-    Pa_Terminate();
-    Destroy();
-}
-
-//-------------------------------------------------------------------------
-// OnTop()
-//-------------------------------------------------------------------------
-void MainFrame::OnTop(wxCommandEvent& event)
-{
-    int style = GetWindowStyle();
-
-    if (style & wxSTAY_ON_TOP)
-    {
-        style &= ~wxSTAY_ON_TOP;
-    }
-    else
-    {
-        style |= wxSTAY_ON_TOP;
-    }
-    SetWindowStyle(style);
-}
-
-//-------------------------------------------------------------------------
-// OnDeleteConfig()
-//-------------------------------------------------------------------------
-void MainFrame::OnDeleteConfig(wxCommandEvent&)
-{
-    wxConfigBase *pConfig = wxConfigBase::Get();
-    if(pConfig->DeleteAll())
-    {
-        wxLogMessage(wxT("Config file/registry key successfully deleted."));
-
-        delete wxConfigBase::Set(NULL);
-        wxConfigBase::DontCreateOnDemand();
-    }
-    else
-    {
-        wxLogError(wxT("Deleting config file/registry key failed."));
-    }
-}
-
-//-------------------------------------------------------------------------
-// Paint()
-//-------------------------------------------------------------------------
-void MainFrame::OnPaint(wxPaintEvent& WXUNUSED(event))
-{
-    wxPaintDC dc(this);
-
-    if(GetMenuBar()->IsChecked(ID_PAINT_BG))
-    {
-        dc.Clear();
-    }
-    dc.SetUserScale(m_zoom, m_zoom);
-}
-
-//-------------------------------------------------------------------------
-// OnCmdSliderScroll()
-//-------------------------------------------------------------------------
-void MainFrame::OnCmdSliderScroll(wxScrollEvent& event)
-{
-    char sqsnr[15];
-    g_SquelchLevel = (float)m_sliderSQ->GetValue()/2.0 - 5.0;   
-    sprintf(sqsnr, "%4.1f", g_SquelchLevel); // 0.5 dB steps
-    wxString sqsnr_string(sqsnr);
-    m_textSQ->SetLabel(sqsnr_string);
-
-    event.Skip();
-}
-
-//-------------------------------------------------------------------------
-// OnCheckSQClick()
-//-------------------------------------------------------------------------
-void MainFrame::OnCheckSQClick(wxCommandEvent& event)
-{
-    if(!g_SquelchActive)
-    {
-        g_SquelchActive = true;
-    }
-    else
-    {
-        g_SquelchActive = false;
-    }
-}
-
-void MainFrame::setsnrBeta(bool snrSlow)
-{
-    if(snrSlow)
-    {
-        m_snrBeta = 0.95; // make this closer to 1.0 to smooth SNR est further
-    }
-    else
-    {
-        m_snrBeta = 0.0; // no smoothing of SNR estimate from demodulator
-    }
-}
-
-//-------------------------------------------------------------------------
-// OnCheckSQClick()
-//-------------------------------------------------------------------------
-void MainFrame::OnCheckSNRClick(wxCommandEvent& event)
-{
-    wxGetApp().m_snrSlow = m_ckboxSNR->GetValue();
-    setsnrBeta(wxGetApp().m_snrSlow);
-    //printf("m_snrSlow: %d\n", (int)wxGetApp().m_snrSlow);
-}
-
-// check for space bar press (only when running)
-
-int MainApp::FilterEvent(wxEvent& event)
-{
-    if ((event.GetEventType() == wxEVT_KEY_DOWN) && 
-        (((wxKeyEvent&)event).GetKeyCode() == WXK_SPACE))
-        {
-            // only use space to toggle PTT if we are running and no modal dialogs (like options) up
-            //fprintf(stderr,"frame->m_RxRunning: %d g_modal: %d\n",
-            //        frame->m_RxRunning, g_modal);
-            if (frame->m_RxRunning && !g_modal) {
-                if (frame->m_btnTogPTT->GetValue())
-                    frame->m_btnTogPTT->SetValue(false);
-                else
-                    frame->m_btnTogPTT->SetValue(true);
-
-                frame->togglePTT();
-
-                return true; // absorb space so we don't toggle control with focus (e.g. Start)
-
-            }
-        }
-
-    return -1;
-}
-
-//-------------------------------------------------------------------------
-// OnTogBtnPTT ()
-//-------------------------------------------------------------------------
-void MainFrame::OnTogBtnPTT (wxCommandEvent& event)
-{
-    togglePTT();
-    event.Skip();
-}
-
-void MainFrame::togglePTT(void) {
-
-    // Change tabbed page in centre panel depending on PTT state
-
-    if (g_tx)
-    {
-        // tx-> rx transition, swap to the page we were on for last rx
-        m_auiNbookCtrl->ChangeSelection(wxGetApp().m_rxNbookCtrl);
-    }
-    else
-    {
-        // rx-> tx transition, swap to Mic In page to monitor speech
-        wxGetApp().m_rxNbookCtrl = m_auiNbookCtrl->GetSelection();
-        m_auiNbookCtrl->ChangeSelection(m_auiNbookCtrl->GetPageIndex((wxWindow *)m_panelSpeechIn));
-        char e[80]; sprintf(e,"ptt"); processTxtEvent(e);
-    }
-
-    g_tx = m_btnTogPTT->GetValue();
-
-    // Hamlib PTT
-
-    if (wxGetApp().m_boolHamlibUseForPTT) {        
-        Hamlib *hamlib = wxGetApp().m_hamlib; 
-        if (wxGetApp().m_boolHamlibUseForPTT && hamlib != NULL) {
-            hamlib->ptt(g_tx);
-        }
-    }
-
-    // Serial PTT
-
-    /*  Truth table:
-
-          g_tx   RTSPos   RTS
-          -------------------
-          0      1        0
-          1      1        1
-          0      0        1
-          1      0        0
-
-          exclusive NOR
-    */
-
-    if(wxGetApp().m_boolUseSerialPTT && (com_handle != COM_HANDLE_INVALID)) {
-        if (wxGetApp().m_boolUseRTS) {
-            printf("g_tx: %d m_boolRTSPos: %d serialLine: %d\n", g_tx, wxGetApp().m_boolRTSPos, g_tx == wxGetApp().m_boolRTSPos);
-            if (g_tx == wxGetApp().m_boolRTSPos)
-                raiseRTS();
-            else
-                lowerRTS();
-        }
-        if (wxGetApp().m_boolUseDTR) {
-            printf("g_tx: %d m_boolDTRPos: %d serialLine: %d\n", g_tx, wxGetApp().m_boolDTRPos, g_tx == wxGetApp().m_boolDTRPos);
-            if (g_tx == wxGetApp().m_boolDTRPos)
-                raiseDTR();
-            else
-                lowerDTR();
-        }
-    }
-
-    // reset level gauge
-
-    m_maxLevel = 0;
-    m_textLevel->SetLabel(wxT(""));
-    m_gaugeLevel->SetValue(0);
-}
-
-//-------------------------------------------------------------------------
-// OnTogBtnRxID()
-//-------------------------------------------------------------------------
-void MainFrame::OnTogBtnRxID(wxCommandEvent& event)
-{
-    // empty any junk in rx data FIFO
-    short junk;
-    while(fifo_read(g_rxDataOutFifo,&junk,1) == 0);
-    event.Skip();
-}
-
-//-------------------------------------------------------------------------
-// OnTogBtnTxID()
-//-------------------------------------------------------------------------
-void MainFrame::OnTogBtnTxID(wxCommandEvent& event)
-{
-    event.Skip();
-}
-
-void MainFrame::OnTogBtnSplitClick(wxCommandEvent& event) {
-    if (g_split)
-        g_split = 0;
-    else
-        g_split = 1;
-    event.Skip();
-}
-
-//-------------------------------------------------------------------------
-// OnTogBtnAnalogClick()
-//-------------------------------------------------------------------------
-void MainFrame::OnTogBtnAnalogClick (wxCommandEvent& event)
-{
-    if (g_analog == 0) {
-        g_analog = 1;
-        m_panelSpectrum->setFreqScale(MODEM_STATS_NSPEC*((float)MAX_F_HZ/(FS/2)));
-        m_panelWaterfall->setFs(FS);
-    }
-    else {
-        g_analog = 0;
-        m_panelSpectrum->setFreqScale(MODEM_STATS_NSPEC*((float)MAX_F_HZ/(g_pfreedv->modem_sample_rate/2)));
-        m_panelWaterfall->setFs(g_pfreedv->modem_sample_rate);
-    }
-
-    g_State = 0;
-    g_stats.snr_est = 0;
-
-    event.Skip();
-}
-
-void MainFrame::OnCallSignReset(wxCommandEvent& event)
-{
-    m_pcallsign = m_callsign;
-    memset(m_callsign, 0, MAX_CALLSIGN);
-    wxString s;
-    s.Printf("%s", m_callsign);
-    m_txtCtrlCallSign->SetValue(s);
-    m_checksumGood = m_checksumBad = 0;
-    m_txtChecksumGood->SetLabel(_("0"));
-    m_txtChecksumBad->SetLabel(_("0"));
-}
-
-void MainFrame::OnBerReset(wxCommandEvent& event)
-{
-    g_pfreedv->total_bits = 0;
-    g_pfreedv->total_bit_errors = 0;
-    int i;
-    for(i=0; i<2*g_Nc; i++)
-        g_error_hist[i] = 0;
-    
-}
-
-#ifdef ALC
-//-------------------------------------------------------------------------
-// OnTogBtnALCClick()
-//-------------------------------------------------------------------------
-void MainFrame::OnTogBtnALCClick(wxCommandEvent& event)
-{
-    wxMessageBox(wxT("Got Click!"), wxT("OnTogBtnALCClick"), wxOK);
-
-    event.Skip();
-}
-#endif
-
-// extra panel added to file open dialog to add loop checkbox
-MyExtraPlayFilePanel::MyExtraPlayFilePanel(wxWindow *parent): wxPanel(parent)
-{
-    m_cb = new wxCheckBox(this, -1, wxT("Loop"));
-    m_cb->SetToolTip(_("When checked file will repeat forever"));
-    m_cb->SetValue(g_loopPlayFileToMicIn);
-
-    // bug: I can't this to align right.....
-    wxBoxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
-    sizerTop->Add(m_cb, 0, wxALIGN_RIGHT, 0);
-    SetSizerAndFit(sizerTop);
-}
-
-static wxWindow* createMyExtraPlayFilePanel(wxWindow *parent)
-{
-    return new MyExtraPlayFilePanel(parent);
-}
-
-//-------------------------------------------------------------------------
-// OnPlayFileToMicIn()
-//-------------------------------------------------------------------------
-void MainFrame::OnPlayFileToMicIn(wxCommandEvent& event)
-{
-    wxUnusedVar(event);
-
-    if(g_playFileToMicIn)
-    {
-        g_mutexProtectingCallbackData.Lock();
-        g_playFileToMicIn = false;
-        sf_close(g_sfPlayFile);
-        SetStatusText(wxT(""));
-        g_mutexProtectingCallbackData.Unlock();
-    }
-    else
-    {
-        wxString    soundFile;
-        SF_INFO     sfInfo;
-
-        wxFileDialog openFileDialog(
-                                    this,
-                                    wxT("Play File to Mic In"),
-                                    wxGetApp().m_playFileToMicInPath,
-                                    wxEmptyString,
-                                    wxT("WAV and RAW files (*.wav;*.raw)|*.wav;*.raw|")
-                                    wxT("All files (*.*)|*.*"),
-                                    wxFD_OPEN | wxFD_FILE_MUST_EXIST
-                                    );
-
-        // add the loop check box
-        openFileDialog.SetExtraControlCreator(&createMyExtraPlayFilePanel);
-
-        if(openFileDialog.ShowModal() == wxID_CANCEL)
-        {
-            return;     // the user changed their mind...
-        }
-
-        wxString fileName, extension;
-        soundFile = openFileDialog.GetPath();
-        wxFileName::SplitPath(soundFile, &wxGetApp().m_playFileToMicInPath, &fileName, &extension);
-        //wxLogDebug("m_playFileToMicInPath: %s", wxGetApp().m_playFileToMicInPath);
-        sfInfo.format = 0;
-
-        if(!extension.IsEmpty())
-        {
-            extension.LowerCase();
-            if(extension == wxT("raw"))
-            {
-                sfInfo.format     = SF_FORMAT_RAW | SF_FORMAT_PCM_16;
-                sfInfo.channels   = 1;
-                sfInfo.samplerate = FS;
-            }
-        }
-        g_sfPlayFile = sf_open(soundFile, SFM_READ, &sfInfo);
-        if(g_sfPlayFile == NULL)
-        {
-            wxString strErr = sf_strerror(NULL);
-            wxMessageBox(strErr, wxT("Couldn't open sound file"), wxOK);
-            return;
-        }
-
-        wxWindow * const ctrl = openFileDialog.GetExtraControl();
-
-        // Huh?! I just copied wxWidgets-2.9.4/samples/dialogs ....
-        g_loopPlayFileToMicIn = static_cast<MyExtraPlayFilePanel*>(ctrl)->getLoopPlayFileToMicIn();
-
-        SetStatusText(wxT("Playing File: ") + fileName + wxT(" to Mic Input") , 0);
-        g_playFileToMicIn = true;
-    }
-}
-
-//-------------------------------------------------------------------------
-// OnPlayFileFromRadio()
-// This puppy "plays" a recorded file into the demodulator input, allowing us
-// to replay off air signals.
-//-------------------------------------------------------------------------
-void MainFrame::OnPlayFileFromRadio(wxCommandEvent& event)
-{
-    wxUnusedVar(event);
-
-    printf("OnPlayFileFromRadio:: %d\n", (int)g_playFileFromRadio);
-    if (g_playFileFromRadio)
-    {
-        printf("OnPlayFileFromRadio:: Stop\n");
-        g_mutexProtectingCallbackData.Lock();
-        g_playFileFromRadio = false;
-        sf_close(g_sfPlayFileFromRadio);
-        SetStatusText(wxT(""),0);
-        SetStatusText(wxT(""),1);
-        g_mutexProtectingCallbackData.Unlock();
-    }
-    else
-    {
-        wxString    soundFile;
-        SF_INFO     sfInfo;
-
-        wxFileDialog openFileDialog(
-                                    this,
-                                    wxT("Play File - From Radio"),
-                                    wxGetApp().m_playFileFromRadioPath,
-                                    wxEmptyString,
-                                    wxT("WAV and RAW files (*.wav;*.raw)|*.wav;*.raw|")
-                                    wxT("All files (*.*)|*.*"),
-                                    wxFD_OPEN | wxFD_FILE_MUST_EXIST
-                                    );
-
-        // add the loop check box
-        openFileDialog.SetExtraControlCreator(&createMyExtraPlayFilePanel);
-
-        if(openFileDialog.ShowModal() == wxID_CANCEL)
-        {
-            return;     // the user changed their mind...
-        }
-
-        wxString fileName, extension;
-        soundFile = openFileDialog.GetPath();
-        wxFileName::SplitPath(soundFile, &wxGetApp().m_playFileFromRadioPath, &fileName, &extension);
-        //wxLogDebug("m_playFileToFromRadioPath: %s", wxGetApp().m_playFileFromRadioPath);
-        sfInfo.format = 0;
-
-        if(!extension.IsEmpty())
-        {
-            extension.LowerCase();
-            if(extension == wxT("raw"))
-            {
-                sfInfo.format     = SF_FORMAT_RAW | SF_FORMAT_PCM_16;
-                sfInfo.channels   = 1;
-                sfInfo.samplerate = g_pfreedv->modem_sample_rate;
-            }
-        }
-        g_sfPlayFileFromRadio = sf_open(soundFile, SFM_READ, &sfInfo);
-        g_sfFs = sfInfo.samplerate;
-        if(g_sfPlayFileFromRadio == NULL)
-        {
-            wxString strErr = sf_strerror(NULL);
-            wxMessageBox(strErr, wxT("Couldn't open sound file"), wxOK);
-            return;
-        }
-
-        wxWindow * const ctrl = openFileDialog.GetExtraControl();
-
-        // Huh?! I just copied wxWidgets-2.9.4/samples/dialogs ....
-        g_loopPlayFileFromRadio = static_cast<MyExtraPlayFilePanel*>(ctrl)->getLoopPlayFileToMicIn();
-
-        SetStatusText(wxT("Playing into from radio"), 0);
-        if(extension == wxT("raw")) {
-            wxString stringnumber = wxString::Format(wxT("%d"), (int)sfInfo.samplerate);
-            SetStatusText(wxT("raw file assuming Fs=") + stringnumber, 1);          
-        }
-        fprintf(g_logfile, "OnPlayFileFromRadio:: Playing File\n");
-        g_playFileFromRadio = true;
-        g_blink = 0.0;
-    }
-}
-
-// extra panel added to file save dialog to set number of seconds to record for
-
-MyExtraRecFilePanel::MyExtraRecFilePanel(wxWindow *parent): wxPanel(parent)
-{
-    wxBoxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
-
-    wxStaticText* staticText = new wxStaticText(this, wxID_ANY, _("Seconds:"), wxDefaultPosition, wxDefaultSize, 0);
-    sizerTop->Add(staticText, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
-    m_secondsToRecord = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
-    m_secondsToRecord->SetToolTip(_("Number of seconds to record for"));
-    m_secondsToRecord->SetValue(wxString::Format(wxT("%i"), wxGetApp().m_recFileFromRadioSecs));
-    sizerTop->Add(m_secondsToRecord, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
-    SetSizerAndFit(sizerTop);
-}
-
-static wxWindow* createMyExtraRecFilePanel(wxWindow *parent)
-{
-    return new MyExtraRecFilePanel(parent);
-}
-
-//-------------------------------------------------------------------------
-// OnRecFileFromRadio()
-//-------------------------------------------------------------------------
-void MainFrame::OnRecFileFromRadio(wxCommandEvent& event)
-{
-    wxUnusedVar(event);
-
-    if (g_recFileFromRadio) {
-        printf("Stopping Record....\n");
-        g_mutexProtectingCallbackData.Lock();
-        g_recFileFromRadio = false;
-        sf_close(g_sfRecFile);
-        SetStatusText(wxT(""));
-        g_mutexProtectingCallbackData.Unlock();
-    }
-    else {
-
-        wxString    soundFile;
-        SF_INFO     sfInfo;
-
-         wxFileDialog openFileDialog(
-                                    this,
-                                    wxT("Record File From Radio"),
-                                    wxGetApp().m_recFileFromRadioPath,
-                                    wxEmptyString,
-                                    wxT("WAV and RAW files (*.wav;*.raw)|*.wav;*.raw|")
-                                    wxT("All files (*.*)|*.*"),
-                                    wxFD_SAVE
-                                    );
-
-        // add the loop check box
-        openFileDialog.SetExtraControlCreator(&createMyExtraRecFilePanel);
-
-        if(openFileDialog.ShowModal() == wxID_CANCEL)
-        {
-            return;     // the user changed their mind...
-        }
-
-        wxString fileName, extension;
-        soundFile = openFileDialog.GetPath();
-        wxFileName::SplitPath(soundFile, &wxGetApp().m_recFileFromRadioPath, &fileName, &extension);
-        wxLogDebug("m_recFileFromRadioPath: %s", wxGetApp().m_recFileFromRadioPath);
-        wxLogDebug("soundFile: %s", soundFile);
-        sfInfo.format = 0;
-
-        if(!extension.IsEmpty())
-        {
-            extension.LowerCase();
-            if(extension == wxT("raw"))
-            {
-                sfInfo.format     = SF_FORMAT_RAW | SF_FORMAT_PCM_16;
-                sfInfo.channels   = 1;
-                sfInfo.samplerate = g_pfreedv->modem_sample_rate;
-            }
-            else if(extension == wxT("wav"))
-            {
-                sfInfo.format     = SF_FORMAT_WAV | SF_FORMAT_PCM_16;
-                sfInfo.channels   = 1;
-                sfInfo.samplerate = g_pfreedv->modem_sample_rate;
-            } else {
-                wxMessageBox(wxT("Invalid file format"), wxT("Record File From Radio"), wxOK);
-                return;
-            }
-        }
-        else {
-            wxMessageBox(wxT("Invalid file format"), wxT("Record File From Radio"), wxOK);
-            return;
-        }
-
-        // Bug: on Win32 I cant read m_recFileFromRadioSecs, so have hard coded it
-#ifdef __WIN32__
-        long secs = wxGetApp().m_recFileFromRadioSecs;
-        g_recFromRadioSamples = FS*(unsigned int)secs;
-#else
-        // work out number of samples to record
-
-        wxWindow * const ctrl = openFileDialog.GetExtraControl();
-        wxString secsString = static_cast<MyExtraRecFilePanel*>(ctrl)->getSecondsToRecord();
-        wxLogDebug("test: %s secsString: %s\n", wxT("testing 123"), secsString);
-
-        long secs;
-        if (secsString.ToLong(&secs)) {
-            wxGetApp().m_recFileFromRadioSecs = (unsigned int)secs;
-            //printf(" secondsToRecord: %d\n",  (unsigned int)secs);
-            g_recFromRadioSamples = FS*(unsigned int)secs;
-            //printf("g_recFromRadioSamples: %d\n", g_recFromRadioSamples);
-        }
-        else {
-            wxMessageBox(wxT("Invalid number of Seconds"), wxT("Record File From Radio"), wxOK);
-            return;
-        }
-#endif
-
-        g_sfRecFile = sf_open(soundFile, SFM_WRITE, &sfInfo);
-        if(g_sfRecFile == NULL)
-        {
-            wxString strErr = sf_strerror(NULL);
-            wxMessageBox(strErr, wxT("Couldn't open sound file"), wxOK);
-            return;
-        }
-
-        SetStatusText(wxT("Recording File: ") + fileName + wxT(" From Radio") , 0);
-        g_recFileFromRadio = true;
-    }
-
-}
-
-//-------------------------------------------------------------------------
-// OnExit()
-//-------------------------------------------------------------------------
-void MainFrame::OnExit(wxCommandEvent& event)
-{
-    wxUnusedVar(event);
-#ifdef _USE_TIMER
-    m_plotTimer.Stop();
-#endif // _USE_TIMER
-    if(g_sfPlayFile != NULL)
-    {
-        sf_close(g_sfPlayFile);
-        g_sfPlayFile = NULL;
-    }
-    if(g_sfRecFile != NULL)
-    {
-        sf_close(g_sfRecFile);
-        g_sfRecFile = NULL;
-    }
-    if(m_RxRunning)
-    {
-        stopRxStream();
-    }
-    m_togBtnSplit->Disable();
-    //m_togRxID->Disable();
-    //m_togTxID->Disable();
-    m_togBtnAnalog->Disable();
-    //m_togBtnALC->Disable();
-    //m_btnTogPTT->Disable();
-    Pa_Terminate();
-    Destroy();
-}
-
-//-------------------------------------------------------------------------
-// OnExitClick()
-//-------------------------------------------------------------------------
-void MainFrame::OnExitClick(wxCommandEvent& event)
-{
-    OnExit(event);
-}
-
-//-------------------------------------------------------------------------
-// OnToolsAudio()
-//-------------------------------------------------------------------------
-void MainFrame::OnToolsAudio(wxCommandEvent& event)
-{
-    wxUnusedVar(event);
-    int rv = 0;
-    AudioOptsDialog *dlg = new AudioOptsDialog(NULL);
-    rv = dlg->ShowModal();
-    if(rv == wxID_OK)
-    {
-        dlg->ExchangeData(EXCHANGE_DATA_OUT);
-    }
-    delete dlg;
-}
-
-//-------------------------------------------------------------------------
-// OnToolsAudioUI()
-//-------------------------------------------------------------------------
-void MainFrame::OnToolsAudioUI(wxUpdateUIEvent& event)
-{
-    event.Enable(!m_RxRunning);
-}
-
-//-------------------------------------------------------------------------
-// OnToolsFilter()
-//-------------------------------------------------------------------------
-void MainFrame::OnToolsFilter(wxCommandEvent& event)
-{
-    wxUnusedVar(event);
-    FilterDlg *dlg = new FilterDlg(NULL, m_RxRunning, &m_newMicInFilter, &m_newSpkOutFilter);
-    dlg->ShowModal();
-    delete dlg;
-}
-
-//-------------------------------------------------------------------------
-// OnToolsOptions()
-//-------------------------------------------------------------------------
-void MainFrame::OnToolsOptions(wxCommandEvent& event)
-{
-    wxUnusedVar(event);
-    g_modal = true;
-    //fprintf(stderr,"g_modal: %d\n", g_modal);
-    optionsDlg->Show();
-}
-
-//-------------------------------------------------------------------------
-// OnToolsOptionsUI()
-//-------------------------------------------------------------------------
-void MainFrame::OnToolsOptionsUI(wxUpdateUIEvent& event)
-{
-}
-
-//-------------------------------------------------------------------------
-// OnToolsComCfg()
-//-------------------------------------------------------------------------
-void MainFrame::OnToolsComCfg(wxCommandEvent& event)
-{
-    wxUnusedVar(event);
-
-    ComPortsDlg *dlg = new ComPortsDlg(NULL);
-
-    int rv = dlg->ShowModal();
-
-    // test Hamlib/Serial set up
-
-    if(rv == wxID_OK)
-    {
-        if (wxGetApp().m_boolHamlibUseForPTT) {
-            OpenHamlibRig();
-            wxGetApp().m_hamlib->close();
-        }
-        if (wxGetApp().m_boolUseSerialPTT) {
-            SetupSerialPort();
-            CloseSerialPort();
-        }
-    }
-
-    delete dlg;
-}
-
-//-------------------------------------------------------------------------
-// OnToolsComCfgUI()
-//-------------------------------------------------------------------------
-void MainFrame::OnToolsComCfgUI(wxUpdateUIEvent& event)
-{
-    event.Enable(!m_RxRunning);
-}
-
-//-------------------------------------------------------------------------
-// OnHelpCheckUpdates()
-//-------------------------------------------------------------------------
-void MainFrame::OnHelpCheckUpdates(wxCommandEvent& event)
-{
-    wxMessageBox("Got Click!", "OnHelpCheckUpdates", wxOK);
-    event.Skip();
-}
-
-//-------------------------------------------------------------------------
-// OnHelpCheckUpdatesUI()
-//-------------------------------------------------------------------------
-void MainFrame::OnHelpCheckUpdatesUI(wxUpdateUIEvent& event)
-{
-    event.Enable(false);
-}
-
-//-------------------------------------------------------------------------
-//OnHelpAbout()
-//-------------------------------------------------------------------------
-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
-    wxURL url(wxT("http://svn.code.sf.net/p/freetel/code/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("<h2>p/freetel/code - Revision ");
-            int startIndex = htmldata.find(s) + s.Length();
-            int endIndex = htmldata.find(wxT(": /fdmdv2</h2>"));
-            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("How much have you spent on Ham gear this year?  How did it compare to FreeDV? ")
-                wxT("FreeDV repesents an open and free future for digital voice over Ham Radio. ")
-                wxT("Please help by donating just $10 here: 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);
-
-#endif // _USE_ABOUT_DIALOG
-#ifdef USE_SIMPLE_ABOUT_DIALOG
-    wxUnusedVar(event);
-    wxAboutDialogInfo info;
-    info.SetCopyright(_("HAMLib Test"));
-    info.SetLicence(_("GPL v2 or later"));
-    info.SetDescription(_("Short description goes here"));
-    ::wxAboutBox(info);
-#endif // USE_SIMPLE_ABOUT_DIALOG
-
-}
-
-
-// Attempt to talk to rig using Hamlib
-
-bool MainFrame::OpenHamlibRig() {
-    if (wxGetApp().m_boolHamlibUseForPTT != true)
-       return false;
-    if (wxGetApp().m_intHamlibRig == 0)
-        return false;
-    if (wxGetApp().m_hamlib == NULL)
-        return false;
-
-    int rig = wxGetApp().m_intHamlibRig;
-    wxString port = wxGetApp().m_strHamlibSerialPort;
-    bool status = wxGetApp().m_hamlib->connect(rig, port.mb_str(wxConvUTF8));
-    if (status == false)
-        wxMessageBox("Couldn't connect to Radio with hamlib", wxT("About"), wxOK | wxICON_ERROR, this);
-    return status;
-} 
-
-//-------------------------------------------------------------------------
-// OnTogBtnOnOff()
-//-------------------------------------------------------------------------
-void MainFrame::OnTogBtnOnOff(wxCommandEvent& event)
-{
-    wxString startStop = m_togBtnOnOff->GetLabel();
-
-    // we are attempting to start
-
-    if (startStop.IsSameAs("Start"))
-    {
-        //
-        // Start Running -------------------------------------------------
-        //
-
-        // modify some button states when running
-
-        m_togBtnSplit->Enable();
-        m_togBtnAnalog->Enable();
-        m_togBtnOnOff->SetLabel(wxT("Stop"));
-        m_btnTogPTT->Enable();
-
-        m_rb1600->Disable();
-        m_rb700->Disable();
-
-        // determine what mode we are using
-
-        if (m_rb1600->GetValue()) {
-            g_mode = FREEDV_MODE_1600;
-            g_Nc = 16;
-            m_panelScatter->setNc(g_Nc);
-        }
-        if (m_rb700->GetValue()) {
-            g_mode = FREEDV_MODE_700;
-            g_Nc = 14;
-            m_panelScatter->setNc(g_Nc/2-1);  /* due to diversity, -1 due to no pilot like FreeDV 1600 */
-        }
-   
-        // init freedv states
-
-        g_pfreedv = freedv_open(g_mode);
-        g_pfreedv->callback_state = NULL;
-        g_pfreedv->freedv_get_next_tx_char = &my_get_next_tx_char;
-        g_pfreedv->freedv_put_next_rx_char = &my_put_next_rx_char;
-
-        g_pfreedv->error_pattern_callback_state = (void*)m_panelTestFrameErrors;
-        g_pfreedv->freedv_put_error_pattern = &my_freedv_put_error_pattern;
-        g_error_pattern_fifo = fifo_create(2*g_pfreedv->sz_error_pattern);
-        g_error_hist = new short[FDMDV_NC_MAX*2];
-        int i;
-        for(i=0; i<2*FDMDV_NC_MAX; i++)
-            g_error_hist[i] = 0;
-
-        //if (g_mode == FREEDV_MODE_700)
-        //    cohpsk_set_verbose(g_pfreedv->cohpsk, 1);
-
-        //cohpsk_set_verbose(g_pfreedv->cohpsk, 1);
-        assert(g_pfreedv != NULL);
-        modem_stats_open(&g_stats);
-
-        // Init Speex pre-processor states
-        // by inspecting Speex source it seems that only denoiser is on be default
-
-        g_speex_st = speex_preprocess_state_init(g_pfreedv->n_speech_samples, FS); 
-
-        // adjust spectrum and waterfall freq scaling base on mode
-
-        m_panelSpectrum->setFreqScale(MODEM_STATS_NSPEC*((float)MAX_F_HZ/(g_pfreedv->modem_sample_rate/2)));
-        m_panelWaterfall->setFs(g_pfreedv->modem_sample_rate);
-
-        // adjust scatter diagram for Number of FDM carriers
-
-        // init Codec 2 LPC Post Filter
-
-        codec2_set_lpc_post_filter(g_pfreedv->codec2,
-                                   wxGetApp().m_codec2LPCPostFilterEnable,
-                                   wxGetApp().m_codec2LPCPostFilterBassBoost,
-                                   wxGetApp().m_codec2LPCPostFilterBeta,
-                                   wxGetApp().m_codec2LPCPostFilterGamma);
-
-        g_State = 0;
-        g_snr = 0.0;
-        g_half_duplex = wxGetApp().m_boolHalfDuplex;
-
-        m_pcallsign = m_callsign;
-        memset(m_callsign, 0, sizeof(m_callsign));
-        m_checksumGood = m_checksumBad = 0;
-        wxString s;
-        s.Printf("%d", m_checksumGood);
-        m_txtChecksumGood->SetLabel(s);              
-        s.Printf("%d", m_checksumBad);
-        m_txtChecksumBad->SetLabel(s);        
-
-        m_maxLevel = 0;
-        m_textLevel->SetLabel(wxT(""));
-        m_gaugeLevel->SetValue(0);
-
-        // Init text msg decoding
-
-        varicode_set_code_num(&g_pfreedv->varicode_dec_states, wxGetApp().m_textEncoding);
-        //printf("m_textEncoding = %d\n", wxGetApp().m_textEncoding);
-        //printf("g_stats.snr: %f\n", g_stats.snr_est);
-
-        // attempt to start PTT ......
-        
-        if (wxGetApp().m_boolHamlibUseForPTT)
-            OpenHamlibRig();
-        if (wxGetApp().m_boolUseSerialPTT) {
-            SetupSerialPort();
-        }
-
-        // attempt to start sound cards and tx/rx processing
-
-        startRxStream();
-
-        if (m_RxRunning)
-        {
-#ifdef _USE_TIMER
-            m_plotTimer.Start(_REFRESH_TIMER_PERIOD, wxTIMER_CONTINUOUS);
-#endif // _USE_TIMER
-        }
-        char e[80]; sprintf(e,"start"); processTxtEvent(e);
-    }
-
-    // Stop was pressed or start up failed
-
-    if (startStop.IsSameAs("Stop") || !m_RxRunning ) {
-
-        //
-        // Stop Running -------------------------------------------------
-        //
-
-        optionsDlg->SetSpamTimerLight(false);
-
-#ifdef _USE_TIMER
-        m_plotTimer.Stop();
-#endif // _USE_TIMER
-
-        // ensure we are not transmitting and shut down audio processing
-
-        if (wxGetApp().m_boolHamlibUseForPTT) {
-            Hamlib *hamlib = wxGetApp().m_hamlib; 
-            if (wxGetApp().m_boolHamlibUseForPTT && hamlib != NULL) {
-                hamlib->ptt(false);
-                hamlib->close();
-            }
-        }
-
-        if (wxGetApp().m_boolUseSerialPTT)
-            CloseSerialPort();
-
-        m_btnTogPTT->SetValue(false);
-
-        stopRxStream();
-
-        // free up states
-
-        modem_stats_close(&g_stats);
-        delete g_error_hist;
-        fifo_destroy(g_error_pattern_fifo);
-        freedv_close(g_pfreedv);
-        speex_preprocess_state_destroy(g_speex_st);
-        m_newMicInFilter = m_newSpkOutFilter = true;
-
-        m_togBtnSplit->Disable();
-        //m_togRxID->Disable();
-        //m_togTxID->Disable();
-        m_togBtnAnalog->Disable();
-        m_btnTogPTT->Disable();
-        m_togBtnOnOff->SetLabel(wxT("Start"));
-        m_rb1600->Enable();
-        m_rb700->Enable();
-#ifdef DISABLED_FEATURE
-        m_rb1400old->Enable();
-        m_rb1600Wide->Enable();
-        m_rb1400->Enable();
-        m_rb2000->Enable();
-#endif
-        char e[80]; sprintf(e,"stop"); processTxtEvent(e);
-    }
-}
-
-//-------------------------------------------------------------------------
-// stopRxStream()
-//-------------------------------------------------------------------------
-void MainFrame::stopRxStream()
-{
-    if(m_RxRunning)
-    {
-        m_RxRunning = false;
-
-        fprintf(g_logfile, "waiting for thread to stop");
-        m_txRxThread->m_run = 0;
-        m_txRxThread->Wait();
-        fprintf(g_logfile, "thread stopped");
-
-        m_rxInPa->stop();
-        m_rxInPa->streamClose();
-        delete m_rxInPa;
-        if(m_rxOutPa != m_rxInPa) {
-                       m_rxOutPa->stop();
-                       m_rxOutPa->streamClose();
-                       delete m_rxOutPa;
-               }
-
-        if (g_nSoundCards == 2) {
-            m_txInPa->stop();
-            m_txInPa->streamClose();
-            delete m_txInPa;
-            if(m_txInPa != m_txOutPa) {
-                               m_txOutPa->stop();
-                               m_txOutPa->streamClose();
-                               delete m_txOutPa;
-                       }
-        }
-
-        destroy_fifos();
-        destroy_src();
-        deleteEQFilters(g_rxUserdata);
-        delete g_rxUserdata;
-    }
-}
-
-void MainFrame::destroy_fifos(void)
-{
-    fifo_destroy(g_rxUserdata->infifo1);
-    fifo_destroy(g_rxUserdata->outfifo1);
-    fifo_destroy(g_rxUserdata->infifo2);
-    fifo_destroy(g_rxUserdata->outfifo2);
-    fifo_destroy(g_rxUserdata->rxinfifo);
-    fifo_destroy(g_rxUserdata->rxoutfifo);
-}
-
-void MainFrame::destroy_src(void)
-{
-    src_delete(g_rxUserdata->insrc1);
-    src_delete(g_rxUserdata->outsrc1);
-    src_delete(g_rxUserdata->insrc2);
-    src_delete(g_rxUserdata->outsrc2);
-    src_delete(g_rxUserdata->insrcsf);
-}
-
-void  MainFrame::initPortAudioDevice(PortAudioWrap *pa, int inDevice, int outDevice,
-                                     int soundCard, int sampleRate, int inputChannels)
-{
-    // Note all of the wrapper functions below just set values in a
-    // portaudio struct so can't return any errors. So no need to trap
-    // any errors in this function.
-
-    // init input params
-
-    pa->setInputDevice(inDevice);
-    if(inDevice != paNoDevice) {
-        pa->setInputChannelCount(inputChannels);           // stereo input
-        pa->setInputSampleFormat(PA_SAMPLE_TYPE);
-        pa->setInputLatency(pa->getInputDefaultLowLatency());
-        pa->setInputHostApiStreamInfo(NULL);
-    }
-
-    pa->setOutputDevice(paNoDevice);
-    
-    // init output params
-    
-    pa->setOutputDevice(outDevice);
-    if(outDevice != paNoDevice) {
-        pa->setOutputChannelCount(2);                      // stereo output
-        pa->setOutputSampleFormat(PA_SAMPLE_TYPE);
-        pa->setOutputLatency(pa->getOutputDefaultLowLatency());
-        pa->setOutputHostApiStreamInfo(NULL);
-    }
-
-    // init params that affect input and output
-
-    /*
-      On Linux, setting this to wxGetApp().m_framesPerBuffer caused
-      intermittant break up on the audio from my IC7200 on Ubuntu 14.
-      After a day of bug hunting I found that 0, as recommended by the
-      PortAudio docunmentation, fixed the problem.
-    */
-
-    //pa->setFramesPerBuffer(wxGetApp().m_framesPerBuffer);
-    pa->setFramesPerBuffer(0);
-
-    pa->setSampleRate(sampleRate);
-    pa->setStreamFlags(paClipOff);
-}
-
-//-------------------------------------------------------------------------
-// startRxStream()
-//-------------------------------------------------------------------------
-void MainFrame::startRxStream()
-{
-    int   src_error;
-    const PaDeviceInfo *deviceInfo1 = NULL, *deviceInfo2 = NULL;
-    int   inputChannels1, inputChannels2;
-    bool  two_rx=false;
-    bool  two_tx=false;
-
-    if(!m_RxRunning) {
-        m_RxRunning = true;
-
-        if(Pa_Initialize())
-        {
-            wxMessageBox(wxT("Port Audio failed to initialize"), wxT("Pa_Initialize"), wxOK);
-        }
-
-        m_rxInPa = new PortAudioWrap();
-        if(g_soundCard1InDeviceNum != g_soundCard1OutDeviceNum)
-            two_rx=true;
-        if(g_soundCard2InDeviceNum != g_soundCard2OutDeviceNum)
-            two_tx=true;
-        
-        fprintf(g_logfile, "two_rx: %d two_tx: %d\n", two_rx, two_tx);
-        if(two_rx)
-            m_rxOutPa = new PortAudioWrap();
-        else
-            m_rxOutPa = m_rxInPa;
-
-        if (g_nSoundCards == 0) {
-            wxMessageBox(wxT("No Sound Cards configured, use Tools - Audio Config to configure"), wxT("Error"), wxOK);
-            delete m_rxInPa;
-            if(two_rx)
-                delete m_rxOutPa;
-            m_RxRunning = false;
-            return;
-        }
-
-        // Init Sound card 1 ----------------------------------------------
-        // sanity check on sound card device numbers
-
-        if ((m_rxInPa->getDeviceCount() <= g_soundCard1InDeviceNum) ||
-            (m_rxOutPa->getDeviceCount() <= g_soundCard1OutDeviceNum)) {
-            wxMessageBox(wxT("Sound Card 1 not present"), wxT("Error"), wxOK);
-            delete m_rxInPa;
-            if(two_rx)
-                               delete m_rxOutPa;
-            m_RxRunning = false;
-            return;
-        }
-
-        // work out how many input channels this device supports.
-
-        deviceInfo1 = Pa_GetDeviceInfo(g_soundCard1InDeviceNum);
-        if (deviceInfo1 == NULL) {
-            wxMessageBox(wxT("Couldn't get device info from Port Audio for Sound Card 1"), wxT("Error"), wxOK);
-            delete m_rxInPa;
-            if(two_rx)
-                               delete m_rxOutPa;
-            m_RxRunning = false;
-            return;
-        }
-        if (deviceInfo1->maxInputChannels == 1)
-            inputChannels1 = 1;
-        else
-            inputChannels1 = 2;
-
-        if(two_rx) {
-            initPortAudioDevice(m_rxInPa, g_soundCard1InDeviceNum, paNoDevice, 1,
-                            g_soundCard1SampleRate, inputChannels1);
-            initPortAudioDevice(m_rxOutPa, paNoDevice, g_soundCard1OutDeviceNum, 1,
-                            g_soundCard1SampleRate, inputChannels1);
-               }
-        else
-            initPortAudioDevice(m_rxInPa, g_soundCard1InDeviceNum, g_soundCard1OutDeviceNum, 1,
-                            g_soundCard1SampleRate, inputChannels1);
-
-        // Init Sound Card 2 ------------------------------------------------
-
-        if (g_nSoundCards == 2) {
-
-            m_txInPa = new PortAudioWrap();
-            if(two_tx)
-                m_txOutPa = new PortAudioWrap();
-            else
-                m_txOutPa = m_txInPa;
-
-            // sanity check on sound card device numbers
-
-            //printf("m_txInPa->getDeviceCount(): %d\n", m_txInPa->getDeviceCount());
-            //printf("g_soundCard2InDeviceNum: %d\n", g_soundCard2InDeviceNum);
-            //printf("g_soundCard2OutDeviceNum: %d\n", g_soundCard2OutDeviceNum);
-
-            if ((m_txInPa->getDeviceCount() <= g_soundCard2InDeviceNum) ||
-                (m_txOutPa->getDeviceCount() <= g_soundCard2OutDeviceNum)) {
-                wxMessageBox(wxT("Sound Card 2 not present"), wxT("Error"), wxOK);
-                delete m_rxInPa;
-                if(two_rx)
-                    delete m_rxOutPa;
-                delete m_txInPa;
-                if(two_tx)
-                    delete m_txOutPa;
-                m_RxRunning = false;
-                return;
-            }
-
-            deviceInfo2 = Pa_GetDeviceInfo(g_soundCard2InDeviceNum);
-            if (deviceInfo2 == NULL) {
-                wxMessageBox(wxT("Couldn't get device info from Port Audio for Sound Card 1"), wxT("Error"), wxOK);
-                delete m_rxInPa;
-                if(two_rx)
-                                       delete m_rxOutPa;
-                delete m_txInPa;
-                if(two_tx)
-                                       delete m_txOutPa;
-                m_RxRunning = false;
-                return;
-            }
-            if (deviceInfo2->maxInputChannels == 1)
-                inputChannels2 = 1;
-            else
-                inputChannels2 = 2;
-
-            if(two_tx) {
-                               initPortAudioDevice(m_txInPa, g_soundCard2InDeviceNum, paNoDevice, 2,
-                                g_soundCard2SampleRate, inputChannels2);
-                               initPortAudioDevice(m_txOutPa, paNoDevice, g_soundCard2OutDeviceNum, 2,
-                                g_soundCard2SampleRate, inputChannels2);
-                       }
-                       else
-                               initPortAudioDevice(m_txInPa, g_soundCard2InDeviceNum, g_soundCard2OutDeviceNum, 2,
-                                g_soundCard2SampleRate, inputChannels2);
-        }
-
-        // Init call back data structure ----------------------------------------------
-
-        g_rxUserdata = new paCallBackData;
-        g_rxUserdata->inputChannels1 = inputChannels1;
-        if (deviceInfo2 != NULL)
-            g_rxUserdata->inputChannels2 = inputChannels2;
-
-        // init sample rate conversion states
-
-        g_rxUserdata->insrc1 = src_new(SRC_SINC_FASTEST, 1, &src_error);
-        assert(g_rxUserdata->insrc1 != NULL);
-        g_rxUserdata->outsrc1 = src_new(SRC_SINC_FASTEST, 1, &src_error);
-        assert(g_rxUserdata->outsrc1 != NULL);
-        g_rxUserdata->insrc2 = src_new(SRC_SINC_FASTEST, 1, &src_error);
-        assert(g_rxUserdata->insrc2 != NULL);
-        g_rxUserdata->outsrc2 = src_new(SRC_SINC_FASTEST, 1, &src_error);
-        assert(g_rxUserdata->outsrc2 != NULL);
-
-        g_rxUserdata->insrcsf = src_new(SRC_SINC_FASTEST, 1, &src_error);
-        assert(g_rxUserdata->insrcsf != NULL);
-
-        // create FIFOs used to interface between different buffer sizes
-
-        g_rxUserdata->infifo1 = fifo_create(8*N48);
-        g_rxUserdata->outfifo1 = fifo_create(10*N48);
-        g_rxUserdata->outfifo2 = fifo_create(8*N48);
-        g_rxUserdata->infifo2 = fifo_create(8*N48);
-        printf("N48: %d\n", N48);
-
-        g_rxUserdata->rxinfifo = fifo_create(3 * g_pfreedv->n_speech_samples);
-        g_rxUserdata->rxoutfifo = fifo_create(2 * g_pfreedv->n_speech_samples);
-
-        // Init Equaliser Filters ------------------------------------------------------
-
-        m_newMicInFilter = m_newSpkOutFilter = true;
-        designEQFilters(g_rxUserdata);
-        g_rxUserdata->micInEQEnable = wxGetApp().m_MicInEQEnable;
-        g_rxUserdata->spkOutEQEnable = wxGetApp().m_SpkOutEQEnable;
-
-        // optional tone in left channel to reliably trigger vox
-        
-        g_rxUserdata->leftChannelVoxTone = wxGetApp().m_leftChannelVoxTone;
-        g_rxUserdata->voxTonePhase = 0;
-
-        // Start sound card 1 ----------------------------------------------------------
-
-        m_rxInPa->setUserData(g_rxUserdata);
-        m_rxErr = m_rxInPa->setCallback(rxCallback);
-
-        m_rxErr = m_rxInPa->streamOpen();
-
-        if(m_rxErr != paNoError) {
-            wxMessageBox(wxT("Sound Card 1 Open/Setup error."), wxT("Error"), wxOK);
-                       delete m_rxInPa;
-                       if(two_rx)
-                               delete m_rxOutPa;
-                       delete m_txInPa;
-                       if(two_tx)
-                               delete m_txOutPa;
-            destroy_fifos();
-            destroy_src();
-            deleteEQFilters(g_rxUserdata);
-            delete g_rxUserdata;
-            m_RxRunning = false;
-            return;
-        }
-
-        m_rxErr = m_rxInPa->streamStart();
-        if(m_rxErr != paNoError) {
-            wxMessageBox(wxT("Sound Card 1 Stream Start Error."), wxT("Error"), wxOK);
-                       delete m_rxInPa;
-                       if(two_rx)
-                               delete m_rxOutPa;
-                       delete m_txInPa;
-                       if(two_tx)
-                               delete m_txOutPa;
-            destroy_fifos();
-            destroy_src();
-            deleteEQFilters(g_rxUserdata);
-            delete g_rxUserdata;
-            m_RxRunning = false;
-            return;
-        }
-
-        // Start separate output stream if needed
-
-        if(two_rx) {
-            m_rxOutPa->setUserData(g_rxUserdata);
-            m_rxErr = m_rxOutPa->setCallback(rxCallback);
-
-            m_rxErr = m_rxOutPa->streamOpen();
-
-            if(m_rxErr != paNoError) {
-                wxMessageBox(wxT("Sound Card 1 Second Stream Open/Setup error."), wxT("Error"), wxOK);
-                delete m_rxInPa;
-                delete m_rxOutPa;
-                delete m_txOutPa;
-                if(two_tx)
-                    delete m_txOutPa;
-                destroy_fifos();
-                destroy_src();
-                deleteEQFilters(g_rxUserdata);
-                delete g_rxUserdata;
-                m_RxRunning = false;
-                return;
-            }
-
-            m_rxErr = m_rxOutPa->streamStart();
-            if(m_rxErr != paNoError) {
-                wxMessageBox(wxT("Sound Card 1 Second Stream Start Error."), wxT("Error"), wxOK);
-                m_rxInPa->stop();
-                m_rxInPa->streamClose();
-                delete m_rxInPa;
-                delete m_rxOutPa;
-                delete m_txOutPa;
-                if(two_tx)
-                    delete m_txOutPa;
-                destroy_fifos();
-                destroy_src();
-                deleteEQFilters(g_rxUserdata);
-                delete g_rxUserdata;
-                m_RxRunning = false;
-                return;
-            }
-        }
-
-        // Start sound card 2 ----------------------------------------------------------
-
-        if (g_nSoundCards == 2) {
-
-            // question: can we use same callback data
-            // (g_rxUserdata)or both sound card callbacks?  Is there a
-            // chance of them both being called at the same time?  We
-            // could need a mutex ...
-
-            m_txInPa->setUserData(g_rxUserdata);
-            m_txErr = m_txInPa->setCallback(txCallback);
-            m_txErr = m_txInPa->streamOpen();
-
-            if(m_txErr != paNoError) {
-                fprintf(stderr, "Err: %d\n", m_txErr);
-                wxMessageBox(wxT("Sound Card 2 Open/Setup error."), wxT("Error"), wxOK);
-                m_rxInPa->stop();
-                m_rxInPa->streamClose();
-                delete m_rxInPa;
-                if(two_rx) {
-                    m_rxOutPa->stop();
-                    m_rxOutPa->streamClose();
-                    delete m_rxOutPa;
-                }
-                delete m_txInPa;
-                if(two_tx)
-                    delete m_txOutPa;
-                destroy_fifos();
-                destroy_src();
-                deleteEQFilters(g_rxUserdata);
-                delete g_rxUserdata;
-                m_RxRunning = false;
-                return;
-            }
-            m_txErr = m_txInPa->streamStart();
-            if(m_txErr != paNoError) {
-                wxMessageBox(wxT("Sound Card 2 Start Error."), wxT("Error"), wxOK);
-                m_rxInPa->stop();
-                m_rxInPa->streamClose();
-                delete m_rxInPa;
-                if(two_rx) {
-                    m_rxOutPa->stop();
-                    m_rxOutPa->streamClose();
-                    delete m_rxOutPa;
-                }
-                delete m_txInPa;
-                if(two_tx)
-                    delete m_txOutPa;
-                destroy_fifos();
-                destroy_src();
-                deleteEQFilters(g_rxUserdata);
-                delete g_rxUserdata;
-                m_RxRunning = false;
-                return;
-            }
-
-            // Start separate output stream if needed
-
-            if (two_tx) {
-
-                // question: can we use same callback data
-                // (g_rxUserdata)or both sound card callbacks?  Is there a
-                // chance of them both being called at the same time?  We
-                // could need a mutex ...
-
-                m_txOutPa->setUserData(g_rxUserdata);
-                m_txErr = m_txOutPa->setCallback(txCallback);
-                m_txErr = m_txOutPa->streamOpen();
-
-                if(m_txErr != paNoError) {
-                    wxMessageBox(wxT("Sound Card 2 Second Stream Open/Setup error."), wxT("Error"), wxOK);
-                    m_rxInPa->stop();
-                    m_rxInPa->streamClose();
-                    delete m_rxInPa;
-                    if(two_rx) {
-                        m_rxOutPa->stop();
-                        m_rxOutPa->streamClose();
-                        delete m_rxOutPa;
-                    }
-                    m_txInPa->stop();
-                    m_txInPa->streamClose();
-                    delete m_txInPa;
-                    delete m_txOutPa;
-                    destroy_fifos();
-                    destroy_src();
-                    deleteEQFilters(g_rxUserdata);
-                    delete g_rxUserdata;
-                    m_RxRunning = false;
-                    return;
-                }
-                m_txErr = m_txOutPa->streamStart();
-                if(m_txErr != paNoError) {
-                    wxMessageBox(wxT("Sound Card 2 Second Stream Start Error."), wxT("Error"), wxOK);
-                    m_rxInPa->stop();
-                    m_rxInPa->streamClose();
-                    m_txInPa->stop();
-                    m_txInPa->streamClose();
-                    delete m_txInPa;
-                    if(two_rx) {
-                        m_rxOutPa->stop();
-                        m_rxOutPa->streamClose();
-                        delete m_rxOutPa;
-                    }
-                    delete m_txInPa;
-                    delete m_txOutPa;
-                    destroy_fifos();
-                    destroy_src();
-                    deleteEQFilters(g_rxUserdata);
-                    delete g_rxUserdata;
-                    m_RxRunning = false;
-                    return;
-                }
-            }
-        }
-
-        // start tx/rx processing thread
-
-        m_txRxThread = new txRxThread;
-
-        if ( m_txRxThread->Create() != wxTHREAD_NO_ERROR )
-        {
-            wxLogError(wxT("Can't create thread!"));
-        }
-
-        m_txRxThread->SetPriority(WXTHREAD_MAX_PRIORITY);
-
-        if ( m_txRxThread->Run() != wxTHREAD_NO_ERROR )
-        {
-            wxLogError(wxT("Can't start thread!"));
-        }
-
-    }
-}
-
-
-void MainFrame::processTxtEvent(char event[]) {
-    int rule = 0;
-
-    //printf("processTxtEvent:\n");
-    //printf("  event: %s\n", event);
-
-    // process with regexp and issue system command
-
-    // Each regexp in our list is separated by a newline.  We want to try all of them.
-
-    wxString event_str(event);
-    int match_end, replace_end;
-    match_end = replace_end = 0;
-    wxString regexp_match_list = wxGetApp().m_events_regexp_match;
-    wxString regexp_replace_list = wxGetApp().m_events_regexp_replace;
-
-    bool found_match = false;
-
-    while (((match_end = regexp_match_list.Find('\n')) != wxNOT_FOUND) && (rule < MAX_EVENT_RULES)) {
-        //printf("match_end: %d\n", match_end);
-        if ((replace_end = regexp_replace_list.Find('\n')) != wxNOT_FOUND) {
-            //printf("replace_end = %d\n", replace_end);
-
-            // candidate match and replace regexps strings exist, so lets try them
-
-            wxString regexp_match = regexp_match_list.SubString(0, match_end-1);
-            wxString regexp_replace = regexp_replace_list.SubString(0, replace_end-1);
-            //printf("match: %s replace: %s\n", (const char *)regexp_match.c_str(), (const char *)regexp_replace.c_str());
-            wxRegEx re(regexp_match);
-            //printf("  checking for match against: %s\n", (const char *)regexp_match.c_str());
-
-            // if we found a match, lets run the replace regexp and issue the system command
-
-            wxString event_str_rep = event_str;
-
-            if (re.Replace(&event_str_rep, regexp_replace) != 0) {
-                //printf("  found match!\n");
-                found_match = true;
-
-                bool enableSystem = false;
-                if (wxGetApp().m_events)
-                    enableSystem = true;
-
-                // no syscall if spam timer still running
-
-                if (spamTimer[rule].IsRunning()) {
-                    enableSystem = false;
-                    //printf("  spam timer running\n");
-                }
-
-                const char *event_out = event_str_rep.ToUTF8();
-                wxString event_out_with_return_code;
-
-                if (enableSystem) {
-                    int ret = wxExecute(event_str_rep);
-                    event_out_with_return_code.Printf(_T("%s -> returned %d"), event_out, ret);
-                    spamTimer[rule].Start((wxGetApp().m_events_spam_timer)*1000, wxTIMER_ONE_SHOT);
-                }
-                else
-                    event_out_with_return_code.Printf(_T("%s T: %d"), event_out, spamTimer[rule].IsRunning());
-
-                // update event log GUI if currently displayed
-                
-                if (optionsDlg != NULL) {                  
-                    optionsDlg->updateEventLog(wxString(event), event_out_with_return_code);                     
-                }
-            }
-        }
-        regexp_match_list = regexp_match_list.SubString(match_end+1, regexp_match_list.length());
-        regexp_replace_list = regexp_replace_list.SubString(replace_end+1, regexp_replace_list.length());
-
-        rule++;
-    }
-    if ((optionsDlg != NULL) && !found_match) {                  
-        optionsDlg->updateEventLog(wxString(event), _("<no match>"));                     
-    }
-}
-
-
-#define SBQ_MAX_ARGS 4
-
-void *MainFrame::designAnEQFilter(const char filterType[], float freqHz, float gaindB, float Q)
-{
-    char  *arg[SBQ_MAX_ARGS];
-    char   argstorage[SBQ_MAX_ARGS][80];
-    void  *sbq;
-    int    i, argc;
-
-    assert((strcmp(filterType, "bass") == 0)   ||
-           (strcmp(filterType, "treble") == 0) ||
-           (strcmp(filterType, "equalizer") == 0));
-
-    for(i=0; i<SBQ_MAX_ARGS; i++) {
-        arg[i] = &argstorage[i][0];
-        arg[i] = &argstorage[i][0];
-        arg[i] = &argstorage[i][0];
-    }
-
-    argc = 0;
-
-    if ((strcmp(filterType, "bass") == 0) || (strcmp(filterType, "treble") == 0)) {
-        sprintf(arg[argc++], "%s", filterType);
-        sprintf(arg[argc++], "%f", gaindB+1E-6);
-        sprintf(arg[argc++], "%f", freqHz);
-    }
-
-    if (strcmp(filterType, "equalizer") == 0) {
-        sprintf(arg[argc++], "%s", filterType);
-        sprintf(arg[argc++], "%f", freqHz);
-        sprintf(arg[argc++], "%f", Q);
-        sprintf(arg[argc++], "%f", gaindB+1E-6);
-    }
-
-    assert(argc <= SBQ_MAX_ARGS);
-
-    sbq = sox_biquad_create(argc-1, (const char **)arg);
-
-    return sbq;
-}
-
-void  MainFrame::designEQFilters(paCallBackData *cb)
-{
-    // init Mic In Equaliser Filters
-
-    if (m_newMicInFilter) {
-        //printf("designing new Min In filters\n");
-        cb->sbqMicInBass   = designAnEQFilter("bass", wxGetApp().m_MicInBassFreqHz, wxGetApp().m_MicInBassGaindB);
-        cb->sbqMicInTreble = designAnEQFilter("treble", wxGetApp().m_MicInTrebleFreqHz, wxGetApp().m_MicInTrebleGaindB);
-        cb->sbqMicInMid    = designAnEQFilter("equalizer", wxGetApp().m_MicInMidFreqHz, wxGetApp().m_MicInMidGaindB, wxGetApp().m_MicInMidQ);
-    }
-
-    // init Spk Out Equaliser Filters
-
-    if (m_newSpkOutFilter) {
-        //printf("designing new Spk Out filters\n");
-        //printf("designEQFilters: wxGetApp().m_SpkOutBassFreqHz: %f\n",wxGetApp().m_SpkOutBassFreqHz);
-        cb->sbqSpkOutBass   = designAnEQFilter("bass", wxGetApp().m_SpkOutBassFreqHz, wxGetApp().m_SpkOutBassGaindB);
-        cb->sbqSpkOutTreble = designAnEQFilter("treble", wxGetApp().m_SpkOutTrebleFreqHz, wxGetApp().m_SpkOutTrebleGaindB);
-        cb->sbqSpkOutMid    = designAnEQFilter("equalizer", wxGetApp().m_SpkOutMidFreqHz, wxGetApp().m_SpkOutMidGaindB, wxGetApp().m_SpkOutMidQ);
-    }
-}
-
-void  MainFrame::deleteEQFilters(paCallBackData *cb)
-{
-    if (m_newMicInFilter) {
-        sox_biquad_destroy(cb->sbqMicInBass);
-        sox_biquad_destroy(cb->sbqMicInTreble);
-        sox_biquad_destroy(cb->sbqMicInMid);
-    }
-    if (m_newSpkOutFilter) {
-        sox_biquad_destroy(cb->sbqSpkOutBass);
-        sox_biquad_destroy(cb->sbqSpkOutTreble);
-        sox_biquad_destroy(cb->sbqSpkOutMid);
-    }
-}
-
-// returns number of output samples generated by resampling
-int resample(SRC_STATE *src,
-            short      output_short[],
-            short      input_short[],
-            int        output_sample_rate,
-            int        input_sample_rate,
-            int        length_output_short, // maximum output array length in samples
-            int        length_input_short
-            )
-{
-    SRC_DATA src_data;
-    float    input[N48*4];
-    float    output[N48*4];
-    int      ret;
-
-    assert(src != NULL);
-    assert(length_input_short <= N48*4);
-    assert(length_output_short <= N48*4);
-
-    src_short_to_float_array(input_short, input, length_input_short);
-
-    src_data.data_in = input;
-    src_data.data_out = output;
-    src_data.input_frames = length_input_short;
-    src_data.output_frames = length_output_short;
-    src_data.end_of_input = 0;
-    src_data.src_ratio = (float)output_sample_rate/input_sample_rate;
-
-    ret = src_process(src, &src_data);
-    assert(ret == 0);
-
-    assert(src_data.output_frames_gen <= length_output_short);
-    src_float_to_short_array(output, output_short, src_data.output_frames_gen);
-
-    return src_data.output_frames_gen;
-}
-
-
-// Decimates samples using an algorithm that produces nice plots of
-// speech signals at a low sample rate.  We want a low sample rate so
-// we don't hammer the graphics system too hard.  Saves decimated data
-// to a fifo for plotting on screen.
-void resample_for_plot(struct FIFO *plotFifo, short buf[], int length, int fs)
-{
-    int decimation = fs/WAVEFORM_PLOT_FS;
-    int nSamples, sample;
-    int i, st, en, max, min;
-    short dec_samples[length];
-
-    nSamples = length/decimation;
-
-    for(sample = 0; sample < nSamples; sample += 2)
-    {
-        st = decimation*sample;
-        en = decimation*(sample+2);
-        max = min = 0;
-        for(i=st; i<en; i++ )
-        {
-            if (max < buf[i]) max = buf[i];
-            if (min > buf[i]) min = buf[i];
-        }
-        dec_samples[sample] = max;
-        dec_samples[sample+1] = min;
-    }
-    fifo_write(plotFifo, dec_samples, nSamples);
-}
-
-void txRxProcessing()
-{
-
-    paCallBackData  *cbData = g_rxUserdata;
-
-    // Buffers re-used by tx and rx processing
-    // signals in in48k/out48k are at a maximum sample rate of 48k, could be 44.1kHz
-    // depending on sound hardware.
-
-    short           in8k_short[4*N8];
-    short           in48k_short[4*N48];
-    short           out8k_short[4*N8];
-    short           out48k_short[4*N48];
-    int             nout, samplerate, n_samples;
-
-    //fprintf(g_logfile, "start infifo1: %5d outfifo2: %5d\n", fifo_used(cbData->infifo1), fifo_used(cbData->outfifo2));
-
-    // FreeDV 700 uses a modem sample rate of 7500 Hz which requires some special treatment
-
-    if (g_analog) 
-        samplerate = FS;
-    else
-        samplerate = g_pfreedv->modem_sample_rate;
-
-    //
-    //  RX side processing --------------------------------------------
-    //
-
-    // while we have enough input samples available ...
-
-    int nsam = g_soundCard1SampleRate * (float)N8/FS;
-    assert(nsam <= N48);
-    g_mutexProtectingCallbackData.Lock();
-    while ((fifo_read(cbData->infifo1, in48k_short, nsam) == 0) && ((g_half_duplex && !g_tx) || !g_half_duplex)) 
-    {
-        g_mutexProtectingCallbackData.Unlock();
-        unsigned int n8k;
-
-        n8k = resample(cbData->insrc1, in8k_short, in48k_short, samplerate, g_soundCard1SampleRate, N8, nsam);
-        assert(n8k <= N8);
-
-        // optionally save "from radio" signal (write demod input to file)
-        // Really useful for testing and development as it allows us
-        // to repeat tests using off air signals
-
-        g_mutexProtectingCallbackData.Lock();
-        if (g_recFileFromRadio && (g_sfRecFile != NULL)) {
-            //printf("g_recFromRadioSamples: %d  n8k: %d \n", g_recFromRadioSamples);
-            if (g_recFromRadioSamples < n8k) {
-                sf_write_short(g_sfRecFile, in8k_short, g_recFromRadioSamples);
-                wxCommandEvent event( wxEVT_COMMAND_MENU_SELECTED, g_recFileFromRadioEventId );
-                // call stop/start record menu item, should be thread safe
-                g_parent->GetEventHandler()->AddPendingEvent( event );
-                g_recFromRadioSamples = 0;
-                //printf("finished recording g_recFromRadioSamples: %d n8k: %d!\n", g_recFileFromRadio, n8k);
-            }
-            else {
-                sf_write_short(g_sfRecFile, in8k_short, n8k);
-                g_recFromRadioSamples -= n8k;
-            }
-        }
-        g_mutexProtectingCallbackData.Unlock();
-
-        // optionally read "from radio" signal from file (read demod input from file)
-
-        g_mutexProtectingCallbackData.Lock();
-        if (g_playFileFromRadio && (g_sfPlayFileFromRadio != NULL)) {
-            unsigned int nsf = n8k*g_sfFs/samplerate;
-            short        insf_short[nsf];
-            unsigned int n = sf_read_short(g_sfPlayFileFromRadio, insf_short, nsf);
-            n8k = resample(cbData->insrcsf, in8k_short, insf_short, samplerate, g_sfFs, N8, nsf);
-            //fprintf(g_logfile, "n: %d nsnf: %d n8k: %d\n", n, nsf, n8k);
-            assert(n8k <= N8);
-
-            if (n == 0) {
-                if (g_loopPlayFileFromRadio)
-                    sf_seek(g_sfPlayFileFromRadio, 0, SEEK_SET);
-                else {
-                    printf("playFileFromRadio finished, issuing event!\n");
-                    wxCommandEvent event( wxEVT_COMMAND_MENU_SELECTED, g_playFileFromRadioEventId );
-                    // call stop/start play menu item, should be thread safe
-                    g_parent->GetEventHandler()->AddPendingEvent( event );
-                }
-            }
-        }
-        g_mutexProtectingCallbackData.Unlock();
-
-        resample_for_plot(g_plotDemodInFifo, in8k_short, n8k, samplerate);
-
-        // send latest squelch level to FreeDV API, as it handles squelch internally
-
-        g_pfreedv->squelch_en = g_SquelchActive;
-        g_pfreedv->snr_squelch_thresh = g_SquelchLevel;
-        //fprintf(g_logfile, "snr_squelch_thresh: %f\n",  g_pfreedv->snr_squelch_thresh);
-
-        // Get some audio to send to headphones/speaker.  If in analog
-        // mode we pass thru the "from radio" audio to the
-        // headphones/speaker.
-
-        if (g_analog) {
-            memcpy(out8k_short, in8k_short, sizeof(short)*n8k);
-            
-            // compute rx spectrum 
-
-            COMP  rx_fdm[n8k];
-            float rx_spec[MODEM_STATS_NSPEC];
-            unsigned int   i;
-
-            for(i=0; i<n8k; i++) {
-                rx_fdm[i].real = in8k_short[i];
-                rx_fdm[i].imag = 0.0;
-            }            
-            modem_stats_get_rx_spectrum(&g_stats, rx_spec, rx_fdm, n8k);
-
-            // Average rx spectrum data using a simple IIR low pass filter
-
-            for(i = 0; i<MODEM_STATS_NSPEC; i++) {
-                g_avmag[i] = BETA * g_avmag[i] + (1.0 - BETA) * rx_spec[i];
-            }
-        }
-        else {
-            fifo_write(cbData->rxinfifo, in8k_short, n8k);
-            per_frame_rx_processing(cbData->rxoutfifo, cbData->rxinfifo);
-            memset(out8k_short, 0, sizeof(short)*N8);
-            fifo_read(cbData->rxoutfifo, out8k_short, N8);
-        }
-
-
-        // Optional Spk Out EQ Filtering, need mutex as filter can change at run time
-        g_mutexProtectingCallbackData.Lock();
-        if (cbData->spkOutEQEnable) {
-            sox_biquad_filter(cbData->sbqSpkOutBass,   out8k_short, out8k_short, N8);
-            sox_biquad_filter(cbData->sbqSpkOutTreble, out8k_short, out8k_short, N8);
-            sox_biquad_filter(cbData->sbqSpkOutMid,    out8k_short, out8k_short, N8);
-        }
-        g_mutexProtectingCallbackData.Unlock();
-
-        resample_for_plot(g_plotSpeechOutFifo, out8k_short, N8, FS);
-
-        g_mutexProtectingCallbackData.Lock();
-        if (g_nSoundCards == 1) {
-            nout = resample(cbData->outsrc2, out48k_short, out8k_short, g_soundCard1SampleRate, FS, N48, N8);
-            fifo_write(cbData->outfifo1, out48k_short, nout);
-        }
-        else {
-            nout = resample(cbData->outsrc2, out48k_short, out8k_short, g_soundCard2SampleRate, FS, N48, N8);
-            fifo_write(cbData->outfifo2, out48k_short, nout);
-        }
-    }
-    g_mutexProtectingCallbackData.Unlock();
-
-    //
-    //  TX side processing --------------------------------------------
-    //
-
-    if ((g_nSoundCards == 2) && ((g_half_duplex && g_tx) || !g_half_duplex)) {
-        int ret;
-
-        // Make sure we have q few frames of modulator output
-        // samples.  This also locks the modulator to the sample rate
-        // of sound card 1.  We want to make sure that modulator
-        // samples are uninterrupted by differences in sample rate
-        // between this sound card and sound card 2.
-
-        g_mutexProtectingCallbackData.Lock();
-        while((unsigned)fifo_used(cbData->outfifo1) < 6*N48)
-        {
-            g_mutexProtectingCallbackData.Unlock();
-
-            int   nsam = g_soundCard2SampleRate * g_pfreedv->n_speech_samples/FS;
-            assert(nsam <= 4*N48);
-
-            // infifo2 is written to by another sound card so it may
-            // over or underflow, but we don't realy care.  It will
-            // just result in a short interruption in audio being fed
-            // to codec2_enc, possibly making a click every now and
-            // again in the decoded audio at the other end.
-
-            // zero speech input just in case infifo2 underflows
-            memset(in48k_short, 0, nsam*sizeof(short));
-            fifo_read(cbData->infifo2, in48k_short, nsam);
-
-            nout = resample(cbData->insrc2, in8k_short, in48k_short, FS, g_soundCard2SampleRate, 4*N8, nsam);
-
-            // optionally use file for mic input signal
-
-            g_mutexProtectingCallbackData.Lock();
-            if (g_playFileToMicIn && (g_sfPlayFile != NULL)) {
-                int n = sf_read_short(g_sfPlayFile, in8k_short, nout);
-                //fprintf(stderr, "n: %d nout: %d\n", n, nout);
-                if (n != nout) {
-                    if (g_loopPlayFileToMicIn)
-                        sf_seek(g_sfPlayFile, 0, SEEK_SET);
-                    else {
-                        wxCommandEvent event( wxEVT_COMMAND_MENU_SELECTED, g_playFileToMicInEventId );
-                        // call stop/start play menu item, should be thread safe
-                        g_parent->GetEventHandler()->AddPendingEvent( event );
-                    }
-                }
-            }
-            g_mutexProtectingCallbackData.Unlock();
-
-            // Optional Speex pre-processor for acoustic noise reduction
-
-            if (wxGetApp().m_speexpp_enable) {
-                speex_preprocess_run(g_speex_st, in8k_short);
-            }
-
-            // Optional Mic In EQ Filtering, need mutex as filter can change at run time
-
-            g_mutexProtectingCallbackData.Lock();
-            if (cbData->micInEQEnable) {
-                sox_biquad_filter(cbData->sbqMicInBass, in8k_short, in8k_short, nout);
-                sox_biquad_filter(cbData->sbqMicInTreble, in8k_short, in8k_short, nout);
-                sox_biquad_filter(cbData->sbqMicInMid, in8k_short, in8k_short, nout);
-            }
-            g_mutexProtectingCallbackData.Unlock();
-
-            resample_for_plot(g_plotSpeechInFifo, in8k_short, nout, FS);
-
-            n_samples = g_pfreedv->n_nom_modem_samples;
-
-            if (g_analog) {
-                n_samples = g_pfreedv->n_speech_samples;
-
-                // Boost the "from mic" -> "to radio" audio in analog
-                // mode.  The need for the gain was found by
-                // experiment - analog SSB sounded too quiet compared
-                // to digital. With digital voice we generally drive
-                // the "to radio" (SSB radio mic input) at about 25%
-                // of the peak level for normal SSB voice. So we
-                // introduce 6dB gain to make analog SSB sound the
-                // same level as the digital.  Watch out for clipping.
-                for(int i=0; i<n_samples; i++) {
-                    float out = (float)in8k_short[i]*2.0;
-                    if (out > 32767) out = 32767.0;
-                    if (out < -32767) out = -32767.0;
-                    out8k_short[i] = out;
-                }
-            }
-            else {
-                COMP tx_fdm[g_pfreedv->n_nom_modem_samples];
-                COMP tx_fdm_offset[g_pfreedv->n_nom_modem_samples];
-                int  i;
-
-                freedv_comptx(g_pfreedv, tx_fdm, in8k_short);
-  
-                fdmdv_freq_shift_coh(tx_fdm_offset, tx_fdm, g_TxFreqOffsetHz, g_pfreedv->modem_sample_rate, &g_TxFreqOffsetPhaseRect, g_pfreedv->n_nom_modem_samples);
-                for(i=0; i<g_pfreedv->n_nom_modem_samples; i++)
-                    out8k_short[i] = tx_fdm_offset[i].real;
-            }
-
-            // output one frame of modem signal
-            nout = resample(cbData->outsrc1, out48k_short, out8k_short, g_soundCard1SampleRate, samplerate, N48*4, n_samples);
-            g_mutexProtectingCallbackData.Lock();
-            ret = fifo_write(cbData->outfifo1, out48k_short, nout);
-            //fprintf(stderr,"nout: %d ret: %d N48*4: %d\n", nout, ret, N48*4);
-
-            assert(ret != -1);
-        }
-        g_mutexProtectingCallbackData.Unlock();
-    }
-   
-    //fprintf(g_logfile, "  end infifo1: %5d outfifo2: %5d\n", fifo_used(cbData->infifo1), fifo_used(cbData->outfifo2));
-
-}
-
-//----------------------------------------------------------------
-// per_frame_rx_processing()
-//----------------------------------------------------------------
-
-void per_frame_rx_processing(
-                                            FIFO    *output_fifo,   // decoded speech samples
-                                            FIFO    *input_fifo
-                                        )
-{
-    short               input_buf[g_pfreedv->n_max_modem_samples];
-    short               output_buf[g_pfreedv->n_speech_samples];
-    COMP                rx_fdm[g_pfreedv->n_max_modem_samples];
-    COMP                rx_fdm_offset[g_pfreedv->n_max_modem_samples];
-    float               rx_spec[MODEM_STATS_NSPEC];
-    int                 i;
-    int                 nin, nin_prev, nout;
-
-    nin = freedv_nin(g_pfreedv);
-    while (fifo_read(input_fifo, input_buf, nin) == 0)
-    {
-        assert(nin <= g_pfreedv->n_max_modem_samples);
-
-        nin_prev = nin;
-        //fwrite(input_buf, sizeof(short), nin, ft);
-
-        // demod per frame processing
-        for(i=0; i<nin; i++)
-        {
-            rx_fdm[i].real = (float)input_buf[i];
-            rx_fdm[i].imag = 0.0;
-        }
-       
-        if (g_channel_noise) {
-            float snr;
-
-            /* enough noise to get a couple of % errors */
-
-            if (g_pfreedv->mode == FREEDV_MODE_1600)
-                snr = 2.0;
-             if (g_pfreedv->mode == FREEDV_MODE_700)
-                snr = -1.0;           
-            fdmdv_simulate_channel(&g_sig_pwr_av, rx_fdm, nin, snr);
-        }
-        fdmdv_freq_shift_coh(rx_fdm_offset, rx_fdm, g_RxFreqOffsetHz, g_pfreedv->modem_sample_rate, &g_RxFreqOffsetPhaseRect, nin);
-        nout = freedv_comprx(g_pfreedv, output_buf, rx_fdm_offset);
-        
-        fifo_write(output_fifo, output_buf, nout);
-        
-        nin = freedv_nin(g_pfreedv);
-        g_State = g_pfreedv->sync;
-        //fprintf(g_logfile, "g_State: %d g_stats.sync: %d snr: %f \n", g_State, g_stats.sync, f->snr);
-
-        // compute rx spectrum 
-
-        modem_stats_get_rx_spectrum(&g_stats, rx_spec, rx_fdm, nin_prev);
-        // Average rx spectrum data using a simple IIR low pass filter
-
-        for(i = 0; i<MODEM_STATS_NSPEC; i++) {
-            g_avmag[i] = BETA * g_avmag[i] + (1.0 - BETA) * rx_spec[i];
-        }
-
-        if (g_pfreedv->mode == FREEDV_MODE_1600)
-            fdmdv_get_demod_stats(g_pfreedv->fdmdv, &g_stats);
-        if (g_pfreedv->mode == FREEDV_MODE_700)
-            cohpsk_get_demod_stats(g_pfreedv->cohpsk, &g_stats);
-
-    }
-}
-
-
-//-------------------------------------------------------------------------
-// rxCallback()
-//
-// Sound card 1 callback from PortAudio, that is used for processing rx
-// side:
-//
-// + infifo1 is the "from radio" off air modem signal from the SSB rx that we send to the demod.
-// + In single sound card mode outfifo1 is the "to speaker/headphones" decoded speech output.
-// + In dual sound card mode outfifo1 is the "to radio" modulator signal to the SSB tx.
-//
-//-------------------------------------------------------------------------
-int MainFrame::rxCallback(
-                            const void      *inputBuffer,
-                            void            *outputBuffer,
-                            unsigned long   framesPerBuffer,
-                            const PaStreamCallbackTimeInfo* timeInfo,
-                            PaStreamCallbackFlags statusFlags,
-                            void            *userData
-                         )
-{
-    paCallBackData  *cbData = (paCallBackData*)userData;
-    short           *rptr    = (short*)inputBuffer;
-    short           *wptr    = (short*)outputBuffer;
-
-    short           indata[MAX_FPB];
-    short           outdata[MAX_FPB];
-
-    unsigned int    i;
-
-    (void) timeInfo;
-    (void) statusFlags;
-
-    wxMutexLocker lock(g_mutexProtectingCallbackData);
-
-    //fprintf(g_logfile, "cb1 statusFlags: 0x%x framesPerBuffer: %d rptr: 0x%x wptr: 0x%x \n", (int)statusFlags,
-    //        framesPerBuffer, rptr, wptr);
-
-    //
-    //  RX side processing --------------------------------------------
-    //
-
-    // assemble a mono buffer and write to FIFO
-
-    assert(framesPerBuffer < MAX_FPB);
-
-    if(rptr) {
-        //fprintf(g_logfile,"in %ld %d\n",  framesPerBuffer, g_in++);
-        //g_indata += framesPerBuffer;
-        for(i = 0; i < framesPerBuffer; i++, rptr += cbData->inputChannels1)
-            indata[i] = rptr[0];                       
-        if (fifo_write(cbData->infifo1, indata, framesPerBuffer)) {
-            //fprintf(g_logfile, "infifo1 full\n");
-        }
-        //fifo_write(cbData->outfifo1, indata, framesPerBuffer);
-    }
-
-    // OK now set up output samples for this callback
-
-    if(wptr) {
-        //fprintf(g_logfile,"out %ld %d\n",  framesPerBuffer, g_out++);
-        if (fifo_read(cbData->outfifo1, outdata, framesPerBuffer) == 0) {
-
-            // write signal to both channels
-
-            for(i = 0; i < framesPerBuffer; i++, wptr += 2) {
-                if (cbData->leftChannelVoxTone) {
-                    cbData->voxTonePhase += 2.0*M_PI*VOX_TONE_FREQ/g_soundCard1SampleRate;
-                    cbData->voxTonePhase -= 2.0*M_PI*floor(cbData->voxTonePhase/(2.0*M_PI));
-                    wptr[0] = VOX_TONE_AMP*cos(cbData->voxTonePhase);                              
-                    //printf("%f %d\n", cbData->voxTonePhase, wptr[0]);
-                }
-                else
-                    wptr[0] = outdata[i];
-                               
-                wptr[1] = outdata[i];
-            }
-        }
-        else {
-            //fprintf(g_logfile, "outfifo1 empty\n");
-            // zero output if no data available
-            for(i = 0; i < framesPerBuffer; i++, wptr += 2) {
-                wptr[0] = 0;
-                wptr[1] = 0;
-            }
-        }
-    }
-
-    return paContinue;
-}
-
-
-//-------------------------------------------------------------------------
-// txCallback()
-//-------------------------------------------------------------------------
-int MainFrame::txCallback(
-                            const void *inputBuffer,
-                            void *outputBuffer,
-                            unsigned long framesPerBuffer,
-                            const PaStreamCallbackTimeInfo *outTime,
-                            PaStreamCallbackFlags statusFlags,
-                            void *userData
-                        )
-{
-    paCallBackData  *cbData = (paCallBackData*)userData;
-    unsigned int    i;
-    short           *rptr    = (short*)inputBuffer;
-    short           *wptr    = (short*)outputBuffer;
-    short           indata[MAX_FPB];
-    short           outdata[MAX_FPB];
-
-    wxMutexLocker lock(g_mutexProtectingCallbackData);
-
-    //    if (statusFlags)
-    //    printf("cb2 statusFlags: 0x%x\n", (int)statusFlags);
-
-    // assemble a mono buffer and write to FIFO
-
-    assert(framesPerBuffer < MAX_FPB);
-
-    if(rptr) {
-        for(i = 0; i < framesPerBuffer; i++, rptr += cbData->inputChannels2)
-            indata[i] = rptr[0];                        
-    }
-
-    //#define SC2_LOOPBACK
-#ifdef SC2_LOOPBACK
-    //TODO: This doesn't work unless using the same soundcard!
-
-    if(wptr) {
-        for(i = 0; i < framesPerBuffer; i++, wptr += 2) {
-            wptr[0] = indata[i];
-            wptr[1] = indata[i];
-        }
-    }
-
-#else
-    if(rptr) {
-        if (fifo_write(cbData->infifo2, indata, framesPerBuffer)) {
-            //fprintf(g_logfile, "infifo2 full\n");
-        }
-    }
-
-    // OK now set up output samples for this callback
-
-    if(wptr) {
-        if (fifo_read(cbData->outfifo2, outdata, framesPerBuffer) == 0) {
-               
-            // write signal to both channels */
-            for(i = 0; i < framesPerBuffer; i++, wptr += 2) {
-                wptr[0] = outdata[i];
-                wptr[1] = outdata[i];
-            }
-        }
-        else {
-            //fprintf(g_logfile, "outfifo2 empty\n");
-            // zero output if no data available
-            for(i = 0; i < framesPerBuffer; i++, wptr += 2) {
-                wptr[0] = 0;
-                wptr[1] = 0;
-            }
-        }
-    }
-#endif
-    return paContinue;
-}
-
-// Callback from plot_spectrum & plot_waterfall.  would be nice to
-// work out a way to do this without globals.
-
-void fdmdv2_clickTune(float freq) {
-
-    // The demod is hard-wired to expect a centre frequency of
-    // FDMDV_FCENTRE.  So we want to take the signal centered on the
-    // click tune freq and re-centre it on FDMDV_FCENTRE.  For example
-    // if the click tune freq is 1500Hz, and FDMDV_CENTRE is 1200 Hz,
-    // we need to shift the input signal centred on 1500Hz down to
-    // 1200Hz, an offset of -300Hz.
-
-    if (g_split) {
-        g_RxFreqOffsetHz = FDMDV_FCENTRE - freq;
-    }
-    else {
-        g_TxFreqOffsetHz = freq - FDMDV_FCENTRE;
-        g_RxFreqOffsetHz = FDMDV_FCENTRE - freq;
-    }
-}
-
-//----------------------------------------------------------------
-// SetupSerialPort()
-//----------------------------------------------------------------
-void MainFrame::SetupSerialPort(void)
-{
-    if(!wxGetApp().m_strRigCtrlPort.IsEmpty())
-    {
-        if(openComPort(wxGetApp().m_strRigCtrlPort.c_str()))
-        {
-            // always start PTT in Rx state
-            SerialPTTRx();
-        }
-        else
-        {
-            wxMessageBox("Couldn't open Serial Port", wxT("About"), wxOK | wxICON_ERROR, this);
-        }
-    }
-}
-
-void MainFrame::SerialPTTRx(void)
-{
-    printf("m_boolUseRTS: %d m_boolRTSPos: %d m_boolUseDTR: %d m_boolDTRPos: %d\n",
-           wxGetApp().m_boolUseRTS, wxGetApp().m_boolRTSPos, wxGetApp().m_boolUseDTR, wxGetApp().m_boolDTRPos);
-
-        if(wxGetApp().m_boolRTSPos) // RTS cleared LOW
-            lowerRTS();
-        else                        // RTS cleared HIGH
-            raiseRTS();
-
-        if(wxGetApp().m_boolDTRPos) // DTR cleared LOW
-            lowerDTR();
-        else                        // DTR cleared HIGH
-            raiseDTR();
-}
-
-//----------------------------------------------------------------
-// CloseSerialPort()
-//----------------------------------------------------------------
-void MainFrame::CloseSerialPort(void)
-{
-    if (com_handle != COM_HANDLE_INVALID) {
-        // always end with PTT in rx state
-
-        SerialPTTRx();
-
-               closeComPort();
-    }
-}
-
-
-//----------------------------------------------------------------
-// PollUDP() - see if any commands on UDP port
-//----------------------------------------------------------------
-
-// test this puppy with netcat: 
-//   $ echo "hello" | nc -u -q1 localhost 3000
-
-int MainFrame::PollUDP(void)
-{
-    // this will block until message received, so we put it in it's own thread
-
-    char buf[1024];
-    char reply[80];
-    size_t n = m_udp_sock->RecvFrom(m_udp_addr, buf, sizeof(buf)).LastCount();
-
-    if (n) {
-        wxString bufstr = wxString::From8BitData(buf, n);
-        bufstr.Trim();
-        wxString ipaddr = m_udp_addr.IPAddress();
-        printf("Received: \"%s\" from %s:%u\n",
-               (const char *)bufstr.c_str(),
-               (const char *)ipaddr.c_str(), m_udp_addr.Service());
-
-        // for security only accept commands from local host
-
-        sprintf(reply,"nope\n");
-        if (ipaddr.Cmp(_("127.0.0.1")) == 0) {
-
-            // process commands
-
-            if (bufstr.Cmp(_("restore")) == 0) {
-                m_schedule_restore = true;  // Make Restore happen in main thread to avoid crashing
-                sprintf(reply,"ok\n");
-            }
-                
-            wxString itemToSet, val;
-            if (bufstr.StartsWith(_("set "), &itemToSet)) {
-                if (itemToSet.StartsWith("txtmsg ", &val)) {
-                    // note: if options dialog is open this will get overwritten
-                    wxGetApp().m_callSign = val;
-                }  
-                sprintf(reply,"ok\n");
-            }
-                
-        }
-        else {
-            printf("We only accept messages from locahost!\n");
-        }
-
-       if ( m_udp_sock->SendTo(m_udp_addr, reply, strlen(reply)).LastCount() != strlen(reply)) {
-           printf("ERROR: failed to send data\n");
-        }
-    }
-
-    return n;
-}
-
-void MainFrame::startUDPThread(void) {
-    printf("starting UDP thread!\n");
-    m_UDPThread = new UDPThread;
-    m_UDPThread->mf = this;
-    if (m_UDPThread->Create() != wxTHREAD_NO_ERROR ) {
-        wxLogError(wxT("Can't create thread!"));
-    }
-    if (m_UDPThread->Run() != wxTHREAD_NO_ERROR ) {
-        wxLogError(wxT("Can't start thread!"));
-        delete m_UDPThread;
-    }
-}
-
-void MainFrame::stopUDPThread(void) {
-    printf("stopping UDP thread!\n");
-    if ((m_UDPThread != NULL) && m_UDPThread->m_run) {
-        m_UDPThread->m_run = 0;
-        m_UDPThread->Wait();
-        m_UDPThread = NULL;
-    }
-}
-
-void *UDPThread::Entry() {
-    printf("UDP thread started!\n");
-    while (m_run) {
-        if (wxGetApp().m_udp_enable) {
-            printf("m_udp_enable\n");
-            mf->m_udp_addr.Service(wxGetApp().m_udp_port);
-            mf->m_udp_sock = new wxDatagramSocket(mf->m_udp_addr, wxSOCKET_NOWAIT);
-
-            while (m_run && wxGetApp().m_udp_enable) {
-                if (mf->PollUDP() == 0) {
-                    wxThread::Sleep(20);
-                }
-            }
-
-            delete mf->m_udp_sock;
-        }
-        wxThread::Sleep(20);
-    }
-    return NULL;
-}
-
-
-char my_get_next_tx_char(void *callback_state) {
-    short ch = 0;
-    
-    fifo_read(g_txDataInFifo, &ch, 1);
-    //fprintf(stderr, "get_next_tx_char: %c\n", (char)ch);
-    return (char)ch;
-}
-
-void my_put_next_rx_char(void *callback_state, char c) {
-    short ch = (short)c;
-    //fprintf(stderr, "put_next_rx_char: %c\n", (char)c);
-    fifo_write(g_rxDataOutFifo, &ch, 1);
-}
-
-// Callback from FreeDv API to update error plots
-
-void my_freedv_put_error_pattern(void *state, short error_pattern[], int sz_error_pattern) {
-    fifo_write(g_error_pattern_fifo, error_pattern, sz_error_pattern);
-}
diff --git a/fdmdv2/branches/0.99/src/fdmdv2_main.h b/fdmdv2/branches/0.99/src/fdmdv2_main.h
deleted file mode 100644 (file)
index 25a1e70..0000000
+++ /dev/null
@@ -1,614 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_main.h
-//
-// Purpose:         Declares simple wxWidgets application with GUI.
-// Created:         Apr. 9, 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 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 License
-//  along with this program; if not, see <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#ifndef __FDMDV2_MAIN__
-#define __FDMDV2_MAIN__
-
-#include "version.h"
-#ifndef _NO_AUTOTOOLS_
-#include "../config.h"
-#endif
-#include <wx/wx.h>
-
-#include <wx/tglbtn.h>
-#include <wx/app.h>
-//#include <wx/aboutdlg.h>
-#include "wx/rawbmp.h"
-#include "wx/file.h"
-#include "wx/filename.h"
-#include "wx/config.h"
-#include <wx/fileconf.h>
-#include "wx/graphics.h"
-#include "wx/mstream.h"
-#include "wx/wfstream.h"
-#include "wx/quantize.h"
-#include "wx/scopedptr.h"
-#include "wx/stopwatch.h"
-#include "wx/versioninfo.h"
-#include <wx/sound.h>
-#include <wx/url.h>
-#include <wx/sstream.h>
-#include <wx/listbox.h>
-#include <wx/textdlg.h>
-#include <wx/regex.h>
-#include <wx/socket.h>
-
-#include <samplerate.h>
-
-#include <hamlib.h> 
-#include <stdint.h>
-#include <speex/speex_preprocess.h>
-
-#ifdef _WIN32
-#include <windows.h>
-#else
-#include <termios.h>
-#include <sys/ioctl.h>
-#endif
-
-#include "codec2.h"
-#include "codec2_fdmdv.h"
-#include "codec2_fifo.h"
-#include "golay23.h"
-#include "modem_stats.h"
-
-#include "topFrame.h"
-#include "dlg_ptt.h"
-#include "dlg_options.h"
-#include "fdmdv2_plot.h"
-#include "fdmdv2_plot_scalar.h"
-#include "fdmdv2_plot_scatter.h"
-#include "fdmdv2_plot_waterfall.h"
-#include "fdmdv2_plot_spectrum.h"
-#include "fdmdv2_pa_wrapper.h"
-#include "sndfile.h"
-#include "portaudio.h"
-#include "dlg_audiooptions.h"
-#include "dlg_filter.h"
-#include "dlg_options.h"
-#include "varicode.h"
-#include "sox_biquad.h"
-#include "comp_prim.h"
-
-#define _USE_TIMER              1
-#define _USE_ONIDLE             1
-#define _DUMMY_DATA             1
-//#define _AUDIO_PASSTHROUGH    1
-#define _REFRESH_TIMER_PERIOD   (DT*1000)
-//#define _USE_ABOUT_DIALOG       1
-
-enum {
-        ID_START = wxID_HIGHEST,
-        ID_TIMER_WATERFALL,
-        ID_TIMER_SPECTRUM,
-        ID_TIMER_SCATTER,
-        ID_TIMER_SCALAR
-     };
-
-#define EXCHANGE_DATA_IN    0
-#define EXCHANGE_DATA_OUT   1
-
-#ifdef _WIN32
-#define COM_HANDLE_INVALID                     INVALID_HANDLE_VALUE
-typedef HANDLE      com_handle_t;
-#else
-#define COM_HANDLE_INVALID                     -1
-typedef int         com_handle_t;
-#endif
-
-extern int                 g_nSoundCards;
-extern int                 g_soundCard1InDeviceNum;
-extern int                 g_soundCard1OutDeviceNum;
-extern int                 g_soundCard1SampleRate;
-extern int                 g_soundCard2InDeviceNum;
-extern int                 g_soundCard2OutDeviceNum;
-extern int                 g_soundCard2SampleRate;
-
-class MainFrame;
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class MainApp
-//
-// @class $(Name)
-// @author $(User)
-// @date $(Date)
-// @file $(CurrentFileName).$(CurrentFileExt)
-// @brief
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class MainApp : public wxApp
-{
-    public:
-        virtual bool        OnInit();
-        virtual int         OnExit();
-
-        wxString            m_strVendName;
-        wxString            m_StrAppName;
-
-        wxString            m_textNumChOut;
-        wxString            m_textNumChIn;
-
-        wxString            m_strRxInAudio;
-        wxString            m_strRxOutAudio;
-        wxString            m_textVoiceInput;
-        wxString            m_textVoiceOutput;
-        wxString            m_strSampleRate;
-        wxString            m_strBitrate;
-
-        // PTT -----------------------------------
-
-        bool                m_boolHalfDuplex;
-
-        bool                m_boolHamlibUseForPTT;
-        unsigned int        m_intHamlibRig;
-        wxString            m_strHamlibSerialPort;
-        Hamlib              *m_hamlib;
-
-        bool                m_boolUseSerialPTT;
-        wxString            m_strRigCtrlPort;
-        bool                m_boolUseRTS;
-        bool                m_boolRTSPos;
-        bool                m_boolUseDTR;
-        bool                m_boolDTRPos;
-
-        // Play/Rec files
-
-        wxString            m_playFileToMicInPath;
-        wxString            m_recFileFromRadioPath;
-        unsigned int        m_recFileFromRadioSecs;
-        wxString            m_playFileFromRadioPath;
-
-        // Options dialog
-
-        wxString            m_callSign;
-        bool                m_events;
-        int                 m_events_spam_timer;
-        unsigned int        m_textEncoding;
-        bool                m_enable_checksum;
-        wxString            m_events_regexp_match;
-        wxString            m_events_regexp_replace;
-
-        bool                m_snrSlow;
-
-        // LPC Post Filter
-        bool                m_codec2LPCPostFilterEnable;
-        bool                m_codec2LPCPostFilterBassBoost;
-        float               m_codec2LPCPostFilterGamma;
-        float               m_codec2LPCPostFilterBeta;
-        
-        // Speex Pre-Processor
-        bool                m_speexpp_enable;
-
-        // Mic In Equaliser
-        float               m_MicInBassFreqHz;
-        float               m_MicInBassGaindB;
-        float               m_MicInTrebleFreqHz;
-        float               m_MicInTrebleGaindB;
-        float               m_MicInMidFreqHz;
-        float               m_MicInMidGaindB;
-        float               m_MicInMidQ;
-        bool                m_MicInEQEnable;
-
-        // Spk Out Equaliser
-        float               m_SpkOutBassFreqHz;
-        float               m_SpkOutBassGaindB;
-        float               m_SpkOutTrebleFreqHz;
-        float               m_SpkOutTrebleGaindB;
-        float               m_SpkOutMidFreqHz;
-        float               m_SpkOutMidGaindB;
-        float               m_SpkOutMidQ;
-        bool                m_SpkOutEQEnable;
-
-        // Flags for displaying windows
-        int                 m_show_wf;
-        int                 m_show_spect;
-        int                 m_show_scatter;
-        int                 m_show_timing;
-        int                 m_show_freq;
-        int                 m_show_speech_in;
-        int                 m_show_speech_out;
-        int                 m_show_demod_in;
-        int                 m_show_test_frame_errors;
-        int                 m_show_test_frame_errors_hist;
-
-        // optional vox trigger tone
-        bool                m_leftChannelVoxTone;
-
-        // UDP control port
-        bool                m_udp_enable;
-        int                 m_udp_port;
-
-        // notebook display after tx->rxtransition
-        int                 m_rxNbookCtrl;
-
-        wxRect              m_rTopWindow;
-
-        int                 m_framesPerBuffer;
-
-        bool                loadConfig();
-        bool                saveConfig();
-
-        // misc
-
-        bool       m_testFrames;
-        bool       m_channel_noise;
-        float      m_channel_snr_dB;
-
-        int        FilterEvent(wxEvent& event);
-        MainFrame *frame;
-
-        bool       m_FreeDV700txClip;
-    protected:
-};
-
-// declare global static function wxGetApp()
-DECLARE_APP(MainApp)
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// paCallBackData
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-typedef struct
-{
-    // libresample states for 48 to 8 kHz conversions
-
-    SRC_STATE      *insrc1;
-    SRC_STATE      *outsrc1;
-    SRC_STATE      *insrc2;
-    SRC_STATE      *outsrc2;
-    SRC_STATE      *insrcsf;
-
-    // FIFOs attached to first sound card
-
-    struct FIFO    *infifo1;
-    struct FIFO    *outfifo1;
-
-    // FIFOs attached to second sound card
-    struct FIFO    *infifo2;
-    struct FIFO    *outfifo2;
-
-    // FIFOs for rx process
-    struct FIFO    *rxinfifo;
-    struct FIFO    *rxoutfifo;
-
-    int             inputChannels1, inputChannels2;
-
-    // EQ filter states
-    void           *sbqMicInBass;
-    void           *sbqMicInTreble;
-    void           *sbqMicInMid;
-    void           *sbqSpkOutBass;
-    void           *sbqSpkOutTreble;
-    void           *sbqSpkOutMid;
-
-    bool            micInEQEnable;
-    bool            spkOutEQEnable;
-
-    // optional loud tone on left channel to reliably trigger vox
-    bool            leftChannelVoxTone;
-    float           voxTonePhase;
-
-} paCallBackData;
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// panel with custom loop checkbox for play file dialog
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class MyExtraPlayFilePanel : public wxPanel
-{
-public:
-    MyExtraPlayFilePanel(wxWindow *parent);
-    void setLoopPlayFileToMicIn(bool checked) { m_cb->SetValue(checked); }
-    bool getLoopPlayFileToMicIn(void) { return m_cb->GetValue(); }
-private:
-    wxCheckBox *m_cb;
-};
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// panel with custom Seconds-to-record control for record file dialog
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class MyExtraRecFilePanel : public wxPanel
-{
-public:
-    MyExtraRecFilePanel(wxWindow *parent);
-    ~MyExtraRecFilePanel() 
-    {
-        wxLogDebug("Destructor\n");
-    }
-    void setSecondsToRecord(wxString value) { m_secondsToRecord->SetValue(value); }
-    wxString getSecondsToRecord(void) 
-    { 
-        wxLogDebug("getSecondsToRecord: %s\n",m_secondsToRecord->GetValue());
-        return m_secondsToRecord->GetValue(); 
-    }
-private:
-    wxTextCtrl *m_secondsToRecord;
-};
-
-class txRxThread;
-class UDPThread;
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class MainFrame
-//
-// @class $(Name)
-// @author $(User)
-// @date $(Date)
-// @file $(CurrentFileName).$(CurrentFileExt)
-// @brief
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class MainFrame : public TopFrame
-{
-    public:
-        MainFrame(wxWindow *parent);
-        virtual ~MainFrame();
-
-        PlotSpectrum*           m_panelSpectrum;
-        PlotWaterfall*          m_panelWaterfall;
-        PlotScatter*            m_panelScatter;
-        PlotScalar*             m_panelTimeOffset;
-        PlotScalar*             m_panelFreqOffset;
-        PlotScalar*             m_panelSpeechIn;
-        PlotScalar*             m_panelSpeechOut;
-        PlotScalar*             m_panelDemodIn;
-        PlotScalar*             m_panelTestFrameErrors;
-        PlotScalar*             m_panelTestFrameErrorsHist;
-
-        bool                    m_RxRunning;
-
-        PortAudioWrap           *m_rxInPa;
-        PortAudioWrap           *m_rxOutPa;
-        PortAudioWrap           *m_txInPa;
-        PortAudioWrap           *m_txOutPa;
-
-        PaError                 m_rxErr;
-        PaError                 m_txErr;
-        
-        txRxThread*             m_txRxThread;
-
-        bool                    OpenHamlibRig();
-        void                    SetupSerialPort(void);
-        void                    CloseSerialPort(void);
-        void                    SerialPTTRx(void);
-
-        bool                    m_modal;
-
-#ifdef _USE_TIMER
-        wxTimer                 m_plotTimer;
-#endif
-
-    void destroy_fifos(void);
-    void destroy_src(void);
-    void autoDetectSoundCards(PortAudioWrap *pa);
-
-        static int rxCallback(
-                                const void *inBuffer,
-                                void *outBuffer,
-                                unsigned long framesPerBuffer,
-                                const PaStreamCallbackTimeInfo *outTime,
-                                PaStreamCallbackFlags statusFlags,
-                                void *userData
-                             );
-        static int txCallback(
-                                const void *inBuffer,
-                                void *outBuffer,
-                                unsigned long framesPerBuffer,
-                                const PaStreamCallbackTimeInfo *outTime,
-                                PaStreamCallbackFlags statusFlags,
-                                void *userData
-                             );
-
-
-    void initPortAudioDevice(PortAudioWrap *pa, int inDevice, int outDevice, 
-                             int soundCard, int sampleRate, int inputChannels);
-
-    void togglePTT(void);
-
-    wxIPV4address           m_udp_addr;
-    wxDatagramSocket       *m_udp_sock;
-    UDPThread              *m_UDPThread;
-    void                    startUDPThread(void);
-    void                    stopUDPThread(void);
-    int                     PollUDP();
-    bool                    m_schedule_restore;
-
-    protected:
-
-#ifdef _WIN32
-#define COM_HANDLE_INVALID                     INVALID_HANDLE_VALUE
-        com_handle_t  com_handle;
-#else
-#define COM_HANDLE_INVALID                     -1
-        com_handle_t  com_handle;
-#endif
-        void raiseDTR(void);
-        void lowerDTR(void);
-        void raiseRTS(void);
-        void lowerRTS(void);
-        bool openComPort(const char *port);
-        void closeComPort(void);
-
-        void setsnrBeta(bool snrSlow);
-
-        // protected event handlers
-        virtual void OnCloseFrame(wxCloseEvent& event);
-        void OnExitClick(wxCommandEvent& event);
-
-        void startTxStream();
-        void startRxStream();
-        void stopTxStream();
-        void stopRxStream();
-        void abortTxStream();
-        void abortRxStream();
-        
-        void OnTop(wxCommandEvent& event);
-        void OnExit( wxCommandEvent& event );
-
-        void OnToolsAudio( wxCommandEvent& event );
-        void OnToolsAudioUI( wxUpdateUIEvent& event );
-        void OnToolsComCfg( wxCommandEvent& event );
-        void OnToolsComCfgUI( wxUpdateUIEvent& event );
-        void OnToolsFilter( wxCommandEvent& event );
-        void OnToolsOptions(wxCommandEvent& event);
-        void OnToolsOptionsUI(wxUpdateUIEvent& event);
-
-        void OnPlayFileToMicIn( wxCommandEvent& event );
-        void OnRecFileFromRadio( wxCommandEvent& event );
-        void OnPlayFileFromRadio( wxCommandEvent& event );
-
-        void OnHelpCheckUpdates( wxCommandEvent& event );
-        void OnHelpCheckUpdatesUI( wxUpdateUIEvent& event );
-        void OnHelpAbout( wxCommandEvent& event );
-        void OnCmdSliderScroll( wxScrollEvent& event );
-//        void OnSliderScrollBottom( wxScrollEvent& event );
-//        void OnCmdSliderScrollChanged( wxScrollEvent& event );
-//        void OnSliderScrollTop( wxScrollEvent& event );
-        void OnCheckSQClick( wxCommandEvent& event );
-        void OnCheckSNRClick( wxCommandEvent& event );
-
-        // Toggle Buttons
-        void OnTogBtnSplitClick(wxCommandEvent& event);
-        void OnTogBtnAnalogClick(wxCommandEvent& event);
-        void OnTogBtnRxID( wxCommandEvent& event );
-        void OnTogBtnTxID( wxCommandEvent& event );
-        void OnTogBtnPTT( wxCommandEvent& event );
-        void OnTogBtnOnOff( wxCommandEvent& event );
-
-        void OnCallSignReset( wxCommandEvent& event );
-        void OnBerReset( wxCommandEvent& event );
-
-        //System Events
-        void OnPaint(wxPaintEvent& event);
-        void OnSize( wxSizeEvent& event );
-        void OnUpdateUI( wxUpdateUIEvent& event );
-        void OnDeleteConfig(wxCommandEvent&);
-#ifdef _USE_TIMER
-        void OnTimer(wxTimerEvent &evt);
-#endif
-#ifdef _USE_ONIDLE
-        void OnIdle(wxIdleEvent &evt);
-#endif
-
-    private:
-        bool        m_useMemory;
-        wxTextCtrl* m_tc;
-        int         m_zoom;
-        float       m_snrBeta;
-        
-        // Callsign/text messaging
-        char        m_callsign[MAX_CALLSIGN];
-        char       *m_pcallsign;
-        unsigned int m_checksumGood;
-        unsigned int m_checksumBad;
-        
-        // Events
-        void        processTxtEvent(char event[]);
-        class OptionsDlg *optionsDlg;
-        wxTimer     spamTimer[MAX_EVENT_RULES];
-
-        // level Gauge
-        float       m_maxLevel;
-        // flags to indicate when new EQ filters need to be designed
-
-        bool        m_newMicInFilter;
-        bool        m_newSpkOutFilter;
-
-        void*       designAnEQFilter(const char filterType[], float freqHz, float gaindB, float Q = 0.0);
-        void        designEQFilters(paCallBackData *cb);
-        void        deleteEQFilters(paCallBackData *cb);
-};
-
-void txRxProcessing();
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// class txRxThread - experimental tx/rx processing thread
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class txRxThread : public wxThread
-{
-public:
-    txRxThread(void) : wxThread(wxTHREAD_JOINABLE) { m_run = 1; }
-
-    // thread execution starts here
-    void *Entry() 
-    {
-        while (m_run) 
-        {
-            txRxProcessing();        
-            wxThread::Sleep(20);
-        }
-        return NULL;
-    }
-
-    // called when the thread exits - whether it terminates normally or is
-    // stopped with Delete() (but not when it is Kill()ed!)
-    void OnExit() { }
-
-public:
-    bool  m_run;
-};
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// class UDPThread - waits for UDP messages
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class UDPThread : public wxThread
-{
-public:
-    UDPThread(void) : wxThread(wxTHREAD_JOINABLE) { m_run = 1; }
-
-    // thread execution starts here
-    void *Entry();
-
-    // called when the thread exits - whether it terminates normally or is
-    // stopped with Delete() (but not when it is Kill()ed!)
-    void OnExit() { }
-
-public:
-    MainFrame              *mf;
-    bool                    m_run;
-};
-
-void resample_for_plot(struct FIFO *plotFifo, short buf[], int length, int fs);
-
-int resample(SRC_STATE *src,
-             short      output_short[],
-             short      input_short[],
-             int        output_sample_rate,
-             int        input_sample_rate,
-             int        length_output_short, // maximum output array length in samples
-             int        length_input_short
-             );
-void txRxProcessing();
-void per_frame_rx_processing(
-                                        FIFO    *output_fifo,   // decoded speech samples
-                                        FIFO    *input_fifo     // modem samples input to demod
-                                    );
-
-// FreeDv API calls this when there is a test frame that needs a-plottin'
-
-void my_freedv_put_error_pattern(void *state, short error_pattern[], int sz_error_pattern);
-
-// FreeDv API calls these puppies when it needs/receives a text char 
-
-char my_get_next_tx_char(void *callback_state);
-void my_put_next_rx_char(void *callback_state, char c);
-
-#endif //__FDMDV2_MAIN__
diff --git a/fdmdv2/branches/0.99/src/fdmdv2_pa_wrapper.cpp b/fdmdv2/branches/0.99/src/fdmdv2_pa_wrapper.cpp
deleted file mode 100644 (file)
index 2f67ca2..0000000
+++ /dev/null
@@ -1,324 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_pa_wrapper.cpp
-// Purpose:         Implements a wrapper class around the PortAudio library.
-// Created:         August 12, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#include "fdmdv2_pa_wrapper.h"
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// PortAudioWrap()
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-PortAudioWrap::PortAudioWrap()
-{
-    m_pStream                   = NULL;
-    m_pUserData                 = NULL;
-    m_samplerate                = 0;
-    m_framesPerBuffer           = 0;
-    m_statusFlags               = 0;
-    m_pStreamCallback           = NULL;
-    m_pStreamFinishedCallback   = NULL;
-    m_pTimeInfo                 = 0;
-    m_newdata                   = false;
-
-//    loadData();
-}
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// ~PortAudioWrap()
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-PortAudioWrap::~PortAudioWrap()
-{
-}
-
-//----------------------------------------------------------------
-// streamOpen()
-//----------------------------------------------------------------
-PaError PortAudioWrap::streamOpen()
-{
-    return Pa_OpenStream(
-                            &m_pStream,
-                            m_inputBuffer.device == paNoDevice ? NULL : &m_inputBuffer,
-                            m_outputBuffer.device == paNoDevice ? NULL : &m_outputBuffer,
-                            m_samplerate,
-                            m_framesPerBuffer,
-                            m_statusFlags,
-                            *m_pStreamCallback,
-                            m_pUserData
-                        );
-}
-
-//----------------------------------------------------------------
-// streamStart()
-//----------------------------------------------------------------
-PaError PortAudioWrap::streamStart()
-{
-    return Pa_StartStream(m_pStream);
-}
-
-//----------------------------------------------------------------
-// streamClose()
-//----------------------------------------------------------------
-PaError PortAudioWrap::streamClose()
-{
-    if(isOpen())
-    {
-        PaError rv = Pa_CloseStream(m_pStream);
-        return rv;
-    }
-    else
-    {
-        return paNoError;
-    }
-}
-
-//----------------------------------------------------------------
-// terminate()
-//----------------------------------------------------------------
-void PortAudioWrap::terminate()
-{
-    if(Pa_IsStreamStopped(m_pStream) != paNoError)
-    {
-        Pa_StopStream(m_pStream);
-    }
-    Pa_Terminate();
-}
-
-//----------------------------------------------------------------
-// stop()
-//----------------------------------------------------------------
-void PortAudioWrap::stop()
-{
-    Pa_StopStream(m_pStream);
-}
-
-//----------------------------------------------------------------
-// abort()
-//----------------------------------------------------------------
-void PortAudioWrap::abort()
-{
-    Pa_AbortStream(m_pStream);
-}
-
-//----------------------------------------------------------------
-// isStopped()
-//----------------------------------------------------------------
-bool PortAudioWrap::isStopped() const
-{
-    PaError ret = Pa_IsStreamStopped(m_pStream);
-    return ret;
-}
-
-//----------------------------------------------------------------
-// isActive()
-//----------------------------------------------------------------
-bool PortAudioWrap::isActive() const
-{
-    PaError ret = Pa_IsStreamActive(m_pStream);
-    return ret;
-}
-
-//----------------------------------------------------------------
-// isOpen()
-//----------------------------------------------------------------
-bool PortAudioWrap::isOpen() const
-{
-    return (m_pStream != NULL);
-}
-
-//----------------------------------------------------------------
-// getDefaultInputDevice()
-//----------------------------------------------------------------
-PaDeviceIndex PortAudioWrap::getDefaultInputDevice()
-{
-    return Pa_GetDefaultInputDevice();
-}
-
-//----------------------------------------------------------------
-// getDefaultOutputDevice()
-//----------------------------------------------------------------
-PaDeviceIndex PortAudioWrap::getDefaultOutputDevice()
-{
-    return Pa_GetDefaultOutputDevice();
-}
-
-//----------------------------------------------------------------
-// setInputChannelCount()
-//----------------------------------------------------------------
-PaError PortAudioWrap::setInputChannelCount(int count)
-{
-    m_inputBuffer.channelCount = count;
-    return paNoError;
-}
-
-//----------------------------------------------------------------
-// getInputChannelCount()
-//----------------------------------------------------------------
-PaError PortAudioWrap::getInputChannelCount()
-{
-    return m_inputBuffer.channelCount;
-}
-
-//----------------------------------------------------------------
-// setInputSampleFormat()
-//----------------------------------------------------------------
-PaError PortAudioWrap::setInputSampleFormat(PaSampleFormat format)
-{
-    m_inputBuffer.sampleFormat = format;
-    return paNoError;
-}
-
-//----------------------------------------------------------------
-// setInputLatency()
-//----------------------------------------------------------------
-PaError PortAudioWrap::setInputLatency(PaTime latency)
-{
-    m_inputBuffer.suggestedLatency = latency;
-    return paNoError;
-}
-
-//----------------------------------------------------------------
-// setInputHostApiStreamInfo()
-//----------------------------------------------------------------
-void PortAudioWrap::setInputHostApiStreamInfo(void *info)
-{
-    m_inputBuffer.hostApiSpecificStreamInfo = info;
-}
-
-//----------------------------------------------------------------
-// getInputDefaultLowLatency()
-//----------------------------------------------------------------
-PaTime  PortAudioWrap::getInputDefaultLowLatency()
-{
-    return Pa_GetDeviceInfo(m_inputBuffer.device)->defaultLowInputLatency;
-}
-
-//----------------------------------------------------------------
-// setOutputChannelCount()
-//----------------------------------------------------------------
-PaError PortAudioWrap::setOutputChannelCount(int count)
-{
-    m_outputBuffer.channelCount = count;
-    return paNoError;
-}
-
-//----------------------------------------------------------------
-// getOutputChannelCount()
-//----------------------------------------------------------------
-const int PortAudioWrap::getOutputChannelCount()
-{
-    return m_outputBuffer.channelCount;
-}
-
-//----------------------------------------------------------------
-// getDeviceName()
-//----------------------------------------------------------------
-const char *PortAudioWrap::getDeviceName(PaDeviceIndex dev)
-{
-    const PaDeviceInfo *info;
-    info = Pa_GetDeviceInfo(dev);
-    return info->name;
-}
-
-//----------------------------------------------------------------
-// setOutputSampleFormat()
-//----------------------------------------------------------------
-PaError PortAudioWrap::setOutputSampleFormat(PaSampleFormat format)
-{
-    m_outputBuffer.sampleFormat = format;
-    return paNoError;
-}
-
-//----------------------------------------------------------------
-// setOutputLatency()
-//----------------------------------------------------------------
-PaError PortAudioWrap::setOutputLatency(PaTime latency)
-{
-    m_outputBuffer.suggestedLatency = latency;
-    return paNoError;
-}
-
-//----------------------------------------------------------------
-// setOutputHostApiStreamInfo()
-//----------------------------------------------------------------
-void PortAudioWrap::setOutputHostApiStreamInfo(void *info)
-{
-    m_outputBuffer.hostApiSpecificStreamInfo = info;
-}
-
-//----------------------------------------------------------------
-// getOutputDefaultLowLatency()
-//----------------------------------------------------------------
-PaTime  PortAudioWrap::getOutputDefaultLowLatency()
-{
-    return Pa_GetDeviceInfo(m_outputBuffer.device)->defaultLowOutputLatency;
-}
-
-//----------------------------------------------------------------
-// setFramesPerBuffer()
-//----------------------------------------------------------------
-PaError PortAudioWrap::setFramesPerBuffer(unsigned long size)
-{
-    m_framesPerBuffer = size;
-    return paNoError;
-}
-
-//----------------------------------------------------------------
-// setSampleRate()
-//----------------------------------------------------------------
-PaError PortAudioWrap::setSampleRate(unsigned long rate)
-{
-    m_samplerate = rate;
-    return paNoError;
-}
-
-//----------------------------------------------------------------
-// setStreamFlags()
-//----------------------------------------------------------------
-PaError PortAudioWrap::setStreamFlags(PaStreamFlags flags)
-{
-    m_statusFlags = flags;
-    return paNoError;
-}
-
-//----------------------------------------------------------------
-// setInputDevice()
-//----------------------------------------------------------------
-PaError PortAudioWrap::setInputDevice(PaDeviceIndex index)
-{
-    m_inputBuffer.device = index;
-    return paNoError;
-}
-
-//----------------------------------------------------------------
-// setOutputDevice()
-//----------------------------------------------------------------
-PaError PortAudioWrap::setOutputDevice(PaDeviceIndex index)
-{
-    m_outputBuffer.device = index;
-    return paNoError;
-}
-
-//----------------------------------------------------------------
-// setCallback()
-//----------------------------------------------------------------
-PaError PortAudioWrap::setCallback(PaStreamCallback *callback)
-{
-    m_pStreamCallback = callback;
-    return paNoError;
-}
-
diff --git a/fdmdv2/branches/0.99/src/fdmdv2_pa_wrapper.h b/fdmdv2/branches/0.99/src/fdmdv2_pa_wrapper.h
deleted file mode 100644 (file)
index 3d216c0..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_pa_wrapper.h
-// Purpose:         Defines a wrapper class around PortAudio
-// Created:         August 12, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#include <stdio.h>
-#include <math.h>
-#include "fdmdv2_defines.h"
-#include "codec2_fdmdv.h"
-#include "codec2.h"
-#include "portaudio.h"
-
-#define PA_SAMPLE_TYPE      paInt16         //paFloat32
-#define FRAMES_PER_BUFFER   (64)
-
-typedef float SAMPLE;
-
-class PortAudioWrap
-{
-    public:
-        PortAudioWrap();
-        ~PortAudioWrap();
-
-//        float                           m_av_mag[FDMDV_NSPEC];
-
-    private:
-        PaStream                        *m_pStream;
-        void                            *m_pUserData;
-        PaStreamCallback                *m_pStreamCallback;
-        PaStreamFinishedCallback        *m_pStreamFinishedCallback;
-        const PaStreamCallbackTimeInfo  *m_pTimeInfo;
-        struct FDMDV                    *m_pFDMDV_state;
-        PaStreamParameters              m_inputBuffer;
-        PaStreamParameters              m_outputBuffer;
-        int                             m_samplerate;
-        unsigned long                   m_framesPerBuffer;
-        PaStreamCallbackFlags           m_statusFlags;
-        bool                            m_newdata;
-
-    public:
-
-        void                averageData(float mag_dB[]);
-
-        int                 getDeviceCount() { return Pa_GetDeviceCount(); }
-        PaDeviceIndex       getDefaultInputDevice();
-        PaDeviceIndex       getDefaultOutputDevice();
-        PaStreamParameters  *getDeviceInfo(PaDeviceIndex idx);
-
-        PaError             setFramesPerBuffer(unsigned long size);
-        PaError             setSampleRate(unsigned long size);
-
-        PaError             setStreamFlags(PaStreamFlags flags);
-        PaError             setCallback(PaStreamCallback *m_pStreamCallback);
-        PaError             setStreamCallback(PaStream *stream, PaStreamCallback* callback) { m_pStreamCallback = callback; return 0;}
-        PaError             setStreamFinishedCallback(PaStream *stream, PaStreamFinishedCallback* m_pStreamFinishedCallback);
-
-        void                setInputBuffer(const PaStreamParameters& inputBuffer)   {this->m_inputBuffer = inputBuffer;}
-        PaError             setInputDevice(PaDeviceIndex dev);
-        PaError             setInputChannelCount(int count);
-        int                 getInputChannelCount();
-        PaError             setInputSampleFormat(PaSampleFormat format);
-        PaError             setInputSampleRate(PaSampleFormat format);
-        PaError             setInputLatency(PaTime latency);
-        void                setInputHostApiStreamInfo(void *info = NULL);
-        PaTime              getInputDefaultLowLatency();
-        const char          *getDeviceName(PaDeviceIndex dev);
-
-        PaError             setOutputDevice(PaDeviceIndex dev);
-        PaError             setOutputChannelCount(int count);
-        const int           getOutputChannelCount();
-        PaError             setOutputSampleFormat(PaSampleFormat format);
-        PaError             setOutputLatency(PaTime latency);
-        void                setOutputHostApiStreamInfo(void *info = NULL);
-        PaTime              getOutputDefaultLowLatency();
-
-        void                setFdmdvState(FDMDV* fdmdv_state)                       {this->m_pFDMDV_state = fdmdv_state;}
-        void                setOutputBuffer(const PaStreamParameters& outputBuffer) {this->m_outputBuffer = outputBuffer;}
-        void                setTimeInfo(PaStreamCallbackTimeInfo* timeInfo)         {this->m_pTimeInfo = timeInfo;}
-        void                setUserData(void* userData)                             {this->m_pUserData = userData;}
-        unsigned long       getFramesPerBuffer() const                              {return m_framesPerBuffer;}
-        const               PaStreamParameters& getInputBuffer() const              {return m_inputBuffer;}
-        const               PaStreamParameters& getOutputBuffer() const             {return m_outputBuffer;}
-        const               PaStreamCallbackFlags& getStatusFlags() const           {return m_statusFlags;}
-
-        FDMDV*              getFdmdvState()                                         {return m_pFDMDV_state;}
-        int                 getSamplerate() const                                   {return m_samplerate;}
-        PaStream*           getStream()                                             {return m_pStream;}
-        void                *getUserData()                                          {return m_pUserData;}
-        bool                getDataAvail()                                          {return m_newdata;}
-        PaError             streamStart();
-        PaError             streamClose();
-        PaError             streamOpen();
-        void                terminate();
-        void                stop();
-        void                abort();
-        bool                isOpen() const;
-        bool                isStopped() const;
-        bool                isActive() const;
-//        void                loadData();
-};
diff --git a/fdmdv2/branches/0.99/src/fdmdv2_plot.cpp b/fdmdv2/branches/0.99/src/fdmdv2_plot.cpp
deleted file mode 100644 (file)
index 1b85cd9..0000000
+++ /dev/null
@@ -1,283 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_plot.cpp
-// Purpose:         Implements simple wxWidgets application with GUI.
-// Created:         Apr. 9, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#include <string.h>
-#include "fdmdv2_plot.h"
-
-BEGIN_EVENT_TABLE(PlotPanel, wxPanel)
-    EVT_PAINT           (PlotPanel::OnPaint)
-    EVT_MOTION          (PlotPanel::OnMouseMove)
-    EVT_LEFT_DOWN       (PlotPanel::OnMouseLeftDown)
-    EVT_LEFT_UP         (PlotPanel::OnMouseLeftUp)
-    EVT_RIGHT_DOWN      (PlotPanel::OnMouseRightDown)
-    EVT_MOUSEWHEEL      (PlotPanel::OnMouseWheelMoved)
-    EVT_SIZE            (PlotPanel::OnSize)
-    EVT_SHOW            (PlotPanel::OnShow)
-END_EVENT_TABLE()
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class PlotPanel(wxFrame* parent) : wxPanel(parent)
-//
-// @class $(Name)
-// @author $(User)
-// @date $(Date)
-// @file $(CurrentFileName).$(CurrentFileExt)
-// @brief
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-PlotPanel::PlotPanel(wxFrame* parent) : wxPanel(parent)
-{
-    m_pNoteBook         = (wxAuiNotebook *) parent;
-    m_pTopFrame         = (MainFrame *)m_pNoteBook->GetParent();
-    m_zoomFactor        = 1.0;
-    m_pBmp              = NULL;
-    m_pPix              = NULL;
-    m_firstPass         = true;
-    m_line_color        = 0;
-    m_newdata           = false;
-    m_clip              = false;
-    m_use_bitmap        = true;
-    m_rubberBand        = false;
-    m_mouseDown         = false;
-    m_penShortDash      = wxPen(wxColor(0xA0, 0xA0, 0xA0), 1, wxPENSTYLE_SHORT_DASH);
-    m_penDotDash        = wxPen(wxColor(0xD0, 0xD0, 0xD0), 1, wxPENSTYLE_DOT_DASH);
-    m_penSolid          = wxPen(wxColor(0x00, 0x00, 0x00), 1, wxPENSTYLE_SOLID);
-    SetBackgroundStyle(wxBG_STYLE_PAINT);
-    SetLabelSize(10.0);
-}
-
-//-------------------------------------------------------------------------
-// ~PlotPanel()
-//-------------------------------------------------------------------------
-PlotPanel::~PlotPanel()
-{
-    if(m_pBmp != NULL)
-    {
-        delete m_pBmp;
-    }
-}
-
-//-------------------------------------------------------------------------
-// GetLabelSize()
-//-------------------------------------------------------------------------
-double PlotPanel::GetLabelSize()
-{
-    return m_label_size;
-}
-
-//-------------------------------------------------------------------------
-// SetLabelSize()
-//-------------------------------------------------------------------------
-void PlotPanel::SetLabelSize(double size)
-{
-    m_label_size = size;
-}
-
-//-------------------------------------------------------------------------
-// OnShow()
-//-------------------------------------------------------------------------
-void PlotPanel::OnShow(wxShowEvent& event)
-{
-    this->Refresh();
-}
-
-//-------------------------------------------------------------------------
-// OnErase()
-//-------------------------------------------------------------------------
-void PlotPanel::OnErase(wxEraseEvent& event)
-{
-    event.Skip();
-}
-
-//-------------------------------------------------------------------------
-// OnSize()
-//-------------------------------------------------------------------------
-void PlotPanel::OnSize(wxSizeEvent& event)
-{
-    m_rCtrlPrev = m_rCtrl;
-    m_rCtrl     = GetClientRect();
-    if(m_use_bitmap)
-    {
-        if(!m_oImage.IsOk())
-        {
-            m_oImage.Create(m_rCtrl.GetWidth(), m_rCtrl.GetHeight(), true);
-        }
-        else
-        {
-            m_oImage.Rescale(m_rCtrl.GetWidth(), m_rCtrl.GetHeight());
-        }
-        m_pBmp = new wxBitmap(m_oImage, wxBITMAP_SCREEN_DEPTH);
-        m_firstPass = true;
-    }
-    this->Refresh();
-}
-
-//-------------------------------------------------------------------------
-// OnMouseMove()
-//-------------------------------------------------------------------------
-void PlotPanel::OnMouseMove(wxMouseEvent& event)
-{
-//    if(m_mouseDown)
-//    {
-//        paintNow();
-//    }
-}
-
-//-------------------------------------------------------------------------
-// OnMouseLeftDown()
-//-------------------------------------------------------------------------
-void PlotPanel::OnMouseLeftDown(wxMouseEvent& event)
-{
-}
-
-//-------------------------------------------------------------------------
-// OnMouseRightDown()
-//-------------------------------------------------------------------------
-void PlotPanel::OnMouseRightDown(wxMouseEvent& event)
-{
-}
-
-//-------------------------------------------------------------------------
-// OnMouseWheelMoved()
-//-------------------------------------------------------------------------
-void PlotPanel::OnMouseWheelMoved(wxMouseEvent& event)
-{
-}
-
-//-------------------------------------------------------------------------
-// OnMouseLeftUp()
-//-------------------------------------------------------------------------
-void PlotPanel::OnMouseLeftUp(wxMouseEvent& event)
-{
-    m_mouseDown = false;
-}
-
-//-------------------------------------------------------------------------
-// SetZoomFactor()
-//-------------------------------------------------------------------------
-double PlotPanel::SetZoomFactor(double zf)
-{
-    if((zf > 0) && (zf < 5.0))
-    {
-        m_zoomFactor = zf;
-    }
-    return zf;
-}
-
-//-------------------------------------------------------------------------
-// GetZoomFactor()
-//-------------------------------------------------------------------------
-double PlotPanel::GetZoomFactor(double zf)
-{
-    return m_zoomFactor;
-}
-
-//-------------------------------------------------------------------------
-// draw()
-//-------------------------------------------------------------------------
-void PlotPanel::draw(wxAutoBufferedPaintDC& pDC)
-{
-    printf("PlotPanel::draw()");
-    wxMemoryDC m_mDC;
-    m_mDC.SelectObject(*m_pBmp);
-    m_rCtrl  = GetClientRect();
-    m_rGrid  = m_rCtrl;
-
-    m_rGrid = m_rGrid.Deflate(PLOT_BORDER + (XLEFT_OFFSET/2), (PLOT_BORDER + (YBOTTOM_OFFSET/2)));
-    m_rGrid.Offset(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER);
-
-    pDC.Clear();
-    m_rPlot = wxRect(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER, m_rGrid.GetWidth(), m_rGrid.GetHeight());
-    if(m_firstPass)
-    {
-        m_firstPass = false;
-        m_mDC.FloodFill(0, 0, VERY_LTGREY_COLOR);
-
-        // Draw a filled rectangle with aborder
-        wxBrush ltGraphBkgBrush = wxBrush(DARK_BLUE_COLOR);
-        m_mDC.SetBrush(ltGraphBkgBrush);
-        m_mDC.SetPen(wxPen(BLACK_COLOR, 0));
-        m_mDC.DrawRectangle(m_rPlot);
-    }
-    if(m_newdata)
-    {
-        m_newdata = false;
-        int t = m_rPlot.GetTop();
-        int l = m_rPlot.GetLeft();
-//        int r = m_rPlot.GetRight();
-        int h = m_rPlot.GetHeight();
-        int w = m_rPlot.GetWidth();
-        pDC.Blit(l, t, w, h, &m_mDC, l, t);
-    }
-    drawGraticule(pDC);
-    m_mDC.SetBrush(wxNullBrush);
-    m_mDC.SelectObject(wxNullBitmap);
-}
-
-//-------------------------------------------------------------------------
-// drawGraticule()
-//-------------------------------------------------------------------------
-void PlotPanel::drawGraticule(wxAutoBufferedPaintDC& pDC)
-{
-    int p;
-    char buf[15];
-    wxString s;
-
-    // Vertical gridlines
-    pDC.SetPen(m_penShortDash);
-    for(p = (PLOT_BORDER + XLEFT_OFFSET + GRID_INCREMENT); p < ((m_rGrid.GetWidth() - XLEFT_OFFSET) + GRID_INCREMENT); p += GRID_INCREMENT)
-    {
-        pDC.DrawLine(p, (m_rGrid.GetHeight() + PLOT_BORDER), p, PLOT_BORDER);
-    }
-    // Horizontal gridlines
-    pDC.SetPen(m_penDotDash);
-    for(p = (m_rGrid.GetHeight() - GRID_INCREMENT); p > PLOT_BORDER; p -= GRID_INCREMENT)
-    {
-        pDC.DrawLine(PLOT_BORDER + XLEFT_OFFSET, (p + PLOT_BORDER), (m_rGrid.GetWidth() + PLOT_BORDER + XLEFT_OFFSET), (p + PLOT_BORDER));
-    }
-    // Label the X-Axis
-    pDC.SetPen(wxPen(GREY_COLOR, 1));
-    for(p = GRID_INCREMENT; p < (m_rGrid.GetWidth() - YBOTTOM_OFFSET); p += GRID_INCREMENT)
-    {
-        sprintf(buf, "%1.1f Hz",(double)(p / 10));
-        pDC.DrawText(buf, p - PLOT_BORDER + XLEFT_OFFSET, m_rGrid.GetHeight() + YBOTTOM_OFFSET/2);
-    }
-    // Label the Y-Axis
-    //for(p = GRID_INCREMENT; p < (h - YBOTTOM_OFFSET); p += GRID_INCREMENT)
-    for(p = (m_rGrid.GetHeight() - GRID_INCREMENT); p > PLOT_BORDER; p -= GRID_INCREMENT)
-    {
-        sprintf(buf, "%1.0f", (double)((m_rGrid.GetHeight() - p) * -10));
-        pDC.DrawText(buf, XLEFT_TEXT_OFFSET, p);
-    }
-}
-
-//-------------------------------------------------------------------------
-// paintEvent()
-//
-// Called by the system of by wxWidgets when the panel needs
-// to be redrawn. You can also trigger this call by calling
-// Refresh()/Update().
-//-------------------------------------------------------------------------
-void PlotPanel::OnPaint(wxPaintEvent & evt)
-{
-    wxAutoBufferedPaintDC pdc(this);
-    draw(pdc);
-}
-
diff --git a/fdmdv2/branches/0.99/src/fdmdv2_plot.h b/fdmdv2/branches/0.99/src/fdmdv2_plot.h
deleted file mode 100644 (file)
index 25309d3..0000000
+++ /dev/null
@@ -1,150 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_plot.h
-// Purpose:         Declares simple wxWidgets application with GUI
-// Created:         Apr. 10, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-//#include "fdmdv2_main.h"
-#ifndef __FDMDV2_PLOT__
-#define __FDMDV2_PLOT__
-#include <wx/wx.h>
-#include <wx/aui/auibook.h>
-#include <wx/rawbmp.h>
-#include <wx/image.h>
-#include <wx/dcbuffer.h>
-
-#define MAX_ZOOM            7
-#define MAX_BMP_X           (400 * MAX_ZOOM)
-#define MAX_BMP_Y           (400 * MAX_ZOOM)
-#define DATA_LINE_HEIGHT    10
-#define TEXT_BASELINE_OFFSET_Y  -5
-
-
-#define wxUSE_FILEDLG       1
-#define wxUSE_LIBPNG        1
-#define wxUSE_LIBJPEG       1
-#define wxUSE_GIF           1
-#define wxUSE_PCX           1
-#define wxUSE_LIBTIFF       1
-
-#define PLOT_BORDER         12
-#define XLEFT_OFFSET        40
-#define XLEFT_TEXT_OFFSET   6
-#define YBOTTOM_OFFSET      20
-#define YBOTTOM_TEXT_OFFSET 15
-#define GRID_INCREMENT      50
-
-#define BLACK_COLOR         wxColor(0x00, 0x00, 0x00)
-#define GREY_COLOR          wxColor(0x80, 0x80, 0x80)
-#define DARK_GREY_COLOR     wxColor(0x40, 0x40, 0x40)
-#define MEDIUM_GREY_COLOR   wxColor(0xC0, 0xC0, 0xC0)
-#define LIGHT_GREY_COLOR    wxColor(0xE0, 0xE0, 0xE0)
-#define VERY_LTGREY_COLOR   wxColor(0xF8, 0xF8, 0xF8)
-#define WHITE_COLOR         wxColor(0xFF, 0xFF, 0xFF)
-
-#define DARK_BLUE_COLOR     wxColor(0x00, 0x00, 0x60)
-#define BLUE_COLOR          wxColor(0x00, 0x00, 0xFF)
-#define LIGHT_BLUE_COLOR    wxColor(0x80, 0x80, 0xFF)
-
-#define RED_COLOR           wxColor(0xFF, 0x5E, 0x5E)
-#define LIGHT_RED_COLOR     wxColor(0xFF, 0xE0, 0xE0)
-#define DARK_RED_COLOR      wxColor(0xFF, 0x00, 0x00)
-#define PINK_COLOR          wxColor(0xFF, 0x80, 0xFF)
-
-#define LIGHT_GREEN_COLOR   wxColor(0xE3, 0xFF, 0xE0)
-#define GREEN_COLOR         wxColor(0x95, 0xFF, 0x8A)
-#define DARK_GREEN_COLOR    wxColor(0x20, 0xFF, 0x08)
-#define VERY_GREEN_COLOR    wxColor(0x00, 0xFF, 0x00)
-
-#define YELLOW_COLOR        wxColor(0xFF, 0xFF, 0x5E)
-#define LIGHT_YELLOW_COLOR  wxColor(0xFF, 0xFF, 0xB5)
-#define DARK_YELLOW_COLOR   wxColor(0xFF, 0xFF, 0x08)
-
-class MainFrame;
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class PlotPanel
-//
-// @class $(Name)
-// @author $(User)
-// @date $(Date)
-// @file $(CurrentFileName).$(CurrentFileExt)
-// @brief
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class PlotPanel : public wxPanel
-{
-    public:
-        PlotPanel(wxFrame* parent);
-        ~PlotPanel();
-        wxPen               m_penShortDash;
-        wxPen               m_penDotDash;
-        wxPen               m_penSolid;
-        wxRect              m_rCtrlPrev;
-        wxRect              m_rCtrl;
-        wxRect              m_rGrid;
-        wxRect              m_rPlot;
-        MainFrame           *m_pTopFrame;
-        wxAuiNotebook       *m_pNoteBook;
-        double              m_label_size;
-        wxSize              m_Bufsz;
-        bool                m_newdata;
-        wxImage             m_oImage;
-        wxBitmap            *m_pBmp;
-        wxNativePixelData   *m_pPix;
-
-        // some useful events
-        void            OnMouseMove(wxMouseEvent& event);
-        virtual void    OnMouseLeftDown(wxMouseEvent& event);
-        void            OnMouseLeftUp(wxMouseEvent& event);
-        virtual void    OnMouseRightDown(wxMouseEvent& event);
-        void            OnMouseWheelMoved(wxMouseEvent& event);
-        void            OnClose(wxCloseEvent& event ){ event.Skip(); }
-        void            OnSize( wxSizeEvent& event );
-        void            OnErase(wxEraseEvent& event);
-        void            OnPaint(wxPaintEvent& event);
-        //void OnUpdateUI( wxUpdateUIEvent& event ){ event.Skip(); }
-
-        void            paintEvent(wxPaintEvent & evt);
-        virtual void    draw(wxAutoBufferedPaintDC&  pdc);
-        virtual void    drawGraticule(wxAutoBufferedPaintDC&  pdc);
-        virtual double  SetZoomFactor(double zf);
-        virtual double  GetZoomFactor(double zf);
-        virtual void    OnShow(wxShowEvent& event);
-        virtual double  GetLabelSize();
-        virtual void    SetLabelSize(double size);
-
-    protected:
-        int             m_x;
-        int             m_y;
-        int             m_left;
-        int             m_top;
-        int             m_prev_w;
-        int             m_prev_h;
-        int             m_prev_x;
-        int             m_prev_y;
-        bool            m_use_bitmap;
-        bool            m_clip;
-        bool            m_rubberBand;
-        bool            m_mouseDown;
-        bool            m_firstPass;
-        double          m_zoomFactor;
-        int             m_greyscale;
-        int             m_line_color;
-    DECLARE_EVENT_TABLE()
-};
-#endif //__FDMDV2_PLOT__
diff --git a/fdmdv2/branches/0.99/src/fdmdv2_plot_scalar.cpp b/fdmdv2/branches/0.99/src/fdmdv2_plot_scalar.cpp
deleted file mode 100644 (file)
index 7a07f46..0000000
+++ /dev/null
@@ -1,281 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_plot_scalar.cpp
-// Purpose:         Plots scalar amplitude against time
-// Created:         June 22, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#include <string.h>
-#include "wx/wx.h"
-#include "fdmdv2_main.h"
-#include "fdmdv2_plot_scalar.h"
-
-BEGIN_EVENT_TABLE(PlotScalar, PlotPanel)
-    EVT_PAINT           (PlotScalar::OnPaint)
-    EVT_MOTION          (PlotScalar::OnMouseMove)
-    EVT_MOUSEWHEEL      (PlotScalar::OnMouseWheelMoved)
-    EVT_SIZE            (PlotScalar::OnSize)
-    EVT_SHOW            (PlotScalar::OnShow)
-//    EVT_ERASE_BACKGROUND(PlotScalar::OnErase)
-END_EVENT_TABLE()
-
-//----------------------------------------------------------------
-// PlotScalar()
-//----------------------------------------------------------------
-PlotScalar::PlotScalar(wxFrame* parent, 
-                       int    channels,           // number on channels to plot
-                      float  t_secs,             // time covered by entire x axis in seconds
-                      float  sample_period_secs, // time between each sample in seconds
-                      float  a_min,              // min ampltude of samples being plotted
-                      float  a_max,              // max ampltude of samples being plotted
-                      float  graticule_t_step,   // time step of x (time) axis graticule in seconds
-                      float  graticule_a_step,   // step of amplitude axis graticule
-                      const char a_fmt[],        // printf format string for amplitude axis labels
-                       int    mini                // true for mini-plot - don't draw graticule
-                      ): PlotPanel(parent)
-{
-    int i;
-
-    m_rCtrl = GetClientRect();
-
-    m_channels = channels;
-    m_t_secs = t_secs;
-    m_sample_period_secs = sample_period_secs;
-    m_a_min = a_min;
-    m_a_max = a_max;
-    m_graticule_t_step = graticule_t_step;
-    m_graticule_a_step = graticule_a_step;
-    assert(strlen(a_fmt) < 15);
-    strcpy(m_a_fmt, a_fmt);
-    m_mini = mini;
-
-    // work out number of samples we will store and allocate storage
-
-    m_samples = m_t_secs/m_sample_period_secs;
-    m_mem = new float[m_samples*m_channels];
-
-    for(i = 0; i < m_samples*m_channels; i++)
-    {
-        m_mem[i] = 0.0;
-    }
-}
-
-//----------------------------------------------------------------
-// ~PlotScalar()
-//----------------------------------------------------------------
-PlotScalar::~PlotScalar()
-{
-    delete m_mem;
-}
-
-//----------------------------------------------------------------
-// add_new_sample()
-//----------------------------------------------------------------
-void PlotScalar::add_new_sample(int channel, float sample)
-{
-    int i;
-    int offset = channel*m_samples;
-
-    assert(channel < m_channels);
-
-    for(i = 0; i < m_samples-1; i++)
-    {
-        m_mem[offset+i] = m_mem[offset+i+1];
-    }
-    m_mem[offset+m_samples-1] = sample;
-}
-
-//----------------------------------------------------------------
-// add_new_samples()
-//----------------------------------------------------------------
-void  PlotScalar::add_new_short_samples(int channel, short samples[], int length, float scale_factor)
-{
-    int i;
-    int offset = channel*m_samples;
-
-    assert(channel < m_channels);
-
-    for(i = 0; i < m_samples-length; i++)
-        m_mem[offset+i] = m_mem[offset+i+length];
-    for(; i < m_samples; i++)
-       m_mem[offset+i] = (float)*samples++/scale_factor;
-}
-
-//----------------------------------------------------------------
-// draw()
-//----------------------------------------------------------------
-void PlotScalar::draw(wxAutoBufferedPaintDC&  dc)
-{
-    float index_to_px;
-    float a_to_py;
-    int   i;
-    int   x, y;
-    int   prev_x, prev_y;
-    float a;
-
-    m_rCtrl = GetClientRect();
-    m_rGrid = m_rCtrl;
-    if (!m_mini)
-        m_rGrid = m_rGrid.Deflate(PLOT_BORDER + (XLEFT_OFFSET/2), (PLOT_BORDER + (YBOTTOM_OFFSET/2)));
-
-    //printf("h %d w %d\n", m_rCtrl.GetWidth(), m_rCtrl.GetHeight());
-    //printf("h %d w %d\n", m_rGrid.GetWidth(), m_rGrid.GetHeight());
-
-    // black background
-
-    dc.Clear();
-    if (m_mini)
-        m_rPlot = wxRect(0, 0, m_rGrid.GetWidth(), m_rGrid.GetHeight());        
-    else
-        m_rPlot = wxRect(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER, m_rGrid.GetWidth(), m_rGrid.GetHeight());
-   
-    wxBrush ltGraphBkgBrush = wxBrush(BLACK_COLOR);
-    dc.SetBrush(ltGraphBkgBrush);
-    dc.SetPen(wxPen(BLACK_COLOR, 0));
-    dc.DrawRectangle(m_rPlot);
-
-    index_to_px = (float)m_rGrid.GetWidth()/m_samples;
-    a_to_py = (float)m_rGrid.GetHeight()/(m_a_max - m_a_min);
-
-    wxPen pen;
-    pen.SetColour(DARK_GREEN_COLOR);
-    pen.SetWidth(1);
-    dc.SetPen(pen);
-
-    // draw all samples
-
-    prev_x = prev_y = 0; // stop warning
-
-    // plot each channel 
-
-    int offset;
-    for(offset=0; offset<m_channels*m_samples; offset+=m_samples) {
-
-        for(i = 0; i < m_samples; i++) {
-            x = index_to_px * i;
-            a = m_mem[offset+i];
-            if (a < m_a_min) a = m_a_min;
-            if (a > m_a_max) a = m_a_max;
-
-            // invert y axis and offset by minimum
-
-            y = m_rGrid.GetHeight() - a_to_py * a + m_a_min*a_to_py;
-
-            // put inside plot window
-
-            if (!m_mini) {
-                x += PLOT_BORDER + XLEFT_OFFSET;
-                y += PLOT_BORDER;
-            }
-
-            if (i)
-                dc.DrawLine(x, y, prev_x, prev_y);
-            prev_x = x; prev_y = y;
-        }
-    }
-
-    drawGraticule(dc);
-}
-
-//-------------------------------------------------------------------------
-// drawGraticule()
-//-------------------------------------------------------------------------
-void PlotScalar::drawGraticule(wxAutoBufferedPaintDC&  dc)
-{
-    float    t, a;
-    int      x, y, text_w, text_h;
-    char     buf[15];
-    wxString s;
-    float    sec_to_px;
-    float    a_to_py;
-
-    wxBrush ltGraphBkgBrush;
-    ltGraphBkgBrush.SetStyle(wxBRUSHSTYLE_TRANSPARENT);
-    ltGraphBkgBrush.SetColour(*wxBLACK);
-    dc.SetBrush(ltGraphBkgBrush);
-    dc.SetPen(wxPen(BLACK_COLOR, 1));
-
-    sec_to_px = (float)m_rGrid.GetWidth()/m_t_secs;
-    a_to_py = (float)m_rGrid.GetHeight()/(m_a_max - m_a_min);
-
-    // upper LH coords of plot area are (PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER)
-    // lower RH coords of plot area are (PLOT_BORDER + XLEFT_OFFSET + m_rGrid.GetWidth(), 
-    //                                   PLOT_BORDER + m_rGrid.GetHeight())
-
-    // Vertical gridlines
-
-    dc.SetPen(m_penShortDash);
-    for(t=0; t<=m_t_secs; t+=m_graticule_t_step) {
-       x = t*sec_to_px;
-       if (m_mini) {
-            dc.DrawLine(x, m_rGrid.GetHeight(), x, 0);
-        }
-        else {
-            x += PLOT_BORDER + XLEFT_OFFSET;
-            dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, PLOT_BORDER);
-        }
-        if (!m_mini) {
-            sprintf(buf, "%2.1fs", t);
-            GetTextExtent(buf, &text_w, &text_h);
-            dc.DrawText(buf, x - text_w/2, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET);
-        }
-    }
-
-    // Horizontal gridlines
-
-    dc.SetPen(m_penDotDash);
-    for(a=m_a_min; a<m_a_max; a+=m_graticule_a_step) {
-       y = m_rGrid.GetHeight() - a*a_to_py + m_a_min*a_to_py;
-       if (m_mini) {
-            dc.DrawLine(0, y, m_rGrid.GetWidth(), y);
-        }
-        else {
-            y += PLOT_BORDER;
-            dc.DrawLine(PLOT_BORDER + XLEFT_OFFSET, y, 
-                        (m_rGrid.GetWidth() + PLOT_BORDER + XLEFT_OFFSET), y);
-        }
-        if (!m_mini) {
-            sprintf(buf, m_a_fmt, a);
-            GetTextExtent(buf, &text_w, &text_h);
-            dc.DrawText(buf, PLOT_BORDER + XLEFT_OFFSET - text_w - XLEFT_TEXT_OFFSET, y-text_h/2);
-        }
-   }
-
-
-}
-
-//----------------------------------------------------------------
-// OnPaint()
-//----------------------------------------------------------------
-void PlotScalar::OnPaint(wxPaintEvent& event)
-{
-    wxAutoBufferedPaintDC dc(this);
-    draw(dc);
-}
-
-//----------------------------------------------------------------
-// OnSize()
-//----------------------------------------------------------------
-void PlotScalar::OnSize(wxSizeEvent& event)
-{
-}
-
-//----------------------------------------------------------------
-// OnShow()
-//----------------------------------------------------------------
-void PlotScalar::OnShow(wxShowEvent& event)
-{
-}
diff --git a/fdmdv2/branches/0.99/src/fdmdv2_plot_scalar.h b/fdmdv2/branches/0.99/src/fdmdv2_plot_scalar.h
deleted file mode 100644 (file)
index 7043987..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_plot_scalar.h
-// Purpose:         Defines a scalar plot derivative of fdmdv2_plot.
-// Created:         June 22, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#ifndef __FDMDV2_PLOT_SCALAR__
-#define __FDMDV2_PLOT_SCALAR__
-
-#include "fdmdv2_plot.h"
-#include "fdmdv2_defines.h"
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class PlotScalar
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class PlotScalar: public PlotPanel
-{
-    public:
-
-    PlotScalar(wxFrame* parent,
-               int   channels,
-              float t_secs, 
-              float sample_period_secs,
-              float a_min,
-              float a_max,
-              float graticule_t_step,   
-              float graticule_a_step,
-              const char  a_fmt[],
-               int   mini
-              );
-        ~PlotScalar();
-         void add_new_sample(int channel, float sample);
-         void add_new_short_samples(int channel, short samples[], int length, float scale_factor);
-
-    protected:
-
-         int      m_channels;
-        float    m_t_secs;
-        float    m_sample_period_secs;
-        float    m_a_min;
-        float    m_a_max;
-        float    m_graticule_t_step;   
-        float    m_graticule_a_step;
-        char     m_a_fmt[15];
-         int      m_mini;
-        int      m_samples;
-        float   *m_mem;              
-
-        void draw(wxAutoBufferedPaintDC&  dc);
-       void drawGraticule(wxAutoBufferedPaintDC&  dc);
-        void OnPaint(wxPaintEvent& event);
-        void OnSize(wxSizeEvent& event);
-        void OnShow(wxShowEvent& event);
-
-        DECLARE_EVENT_TABLE()
-};
-
-#endif // __FDMDV2_PLOT_SCALAR__
-
diff --git a/fdmdv2/branches/0.99/src/fdmdv2_plot_scatter.cpp b/fdmdv2/branches/0.99/src/fdmdv2_plot_scatter.cpp
deleted file mode 100644 (file)
index 3c0b155..0000000
+++ /dev/null
@@ -1,199 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_plot_scatter.cpp
-// Purpose:         A scatter plot derivative of fdmdv2_plot.
-// Created:         June 24, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#include <string.h>
-#include "wx/wx.h"
-#include "fdmdv2_plot_scatter.h"
-
-BEGIN_EVENT_TABLE(PlotScatter, PlotPanel)
-    EVT_PAINT           (PlotScatter::OnPaint)
-    EVT_MOTION          (PlotScatter::OnMouseMove)
-    EVT_MOUSEWHEEL      (PlotScatter::OnMouseWheelMoved)
-    EVT_SIZE            (PlotScatter::OnSize)
-    EVT_SHOW            (PlotScatter::OnShow)
-//    EVT_ERASE_BACKGROUND(PlotScatter::OnErase)
-END_EVENT_TABLE()
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// PlotScatter
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-PlotScatter::PlotScatter(wxFrame* parent) : PlotPanel(parent)
-{
-    int i;
-
-    for(i=0; i < SCATTER_MEM_SYMS_MAX; i++)
-    {
-        m_mem[i].real = 0.0;
-        m_mem[i].imag = 0.0;
-    }
-
-    m_filter_max_xy = 0.1;
-
-    // defaults so we start off with something sensible
-
-    Nsym = 14+1;
-    scatterMemSyms = ((int)(SCATTER_MEM_SECS*(Nsym/DT)));
-    assert(scatterMemSyms <= SCATTER_MEM_SYMS_MAX);
-        
-}
-
-// changing number of carriers changes number of symbols to plot
-void PlotScatter::setNc(int Nc) {
-    Nsym = Nc+1;
-    assert(Nsym <= (FDMDV_NC_MAX+1));
-    scatterMemSyms = ((int)(SCATTER_MEM_SECS*(Nsym/DT)));
-    assert(scatterMemSyms <= SCATTER_MEM_SYMS_MAX);
-}
-
-//----------------------------------------------------------------
-// draw()
-//----------------------------------------------------------------
-void PlotScatter::draw(wxAutoBufferedPaintDC& dc)
-{
-    float x_scale;
-    float y_scale;
-    int   i;
-    int   x;
-    int   y;
-    wxColour sym_to_colour[] = {wxColor(0,0,255), 
-                                wxColor(0,255,0),
-                                wxColor(0,255,255),
-                                wxColor(255,0,0),
-                                wxColor(255,0,255), 
-                                wxColor(255,255,0),
-                                wxColor(255,255,255),
-                                wxColor(0,0,255), 
-                                wxColor(0,255,0),
-                                wxColor(0,255,255),
-                                wxColor(255,0,0),
-                                wxColor(255,0,255), 
-                                wxColor(255,255,0),
-                                wxColor(255,255,255),
-                                wxColor(0,0,255), 
-                                wxColor(0,255,0),
-                                wxColor(0,255,255),
-                                wxColor(255,0,0),
-                                wxColor(255,0,255)
-    };
-
-    m_rCtrl = GetClientRect();
-    m_rGrid = m_rCtrl;
-    m_rGrid = m_rGrid.Deflate(PLOT_BORDER + (XLEFT_OFFSET/2), (PLOT_BORDER + (YBOTTOM_OFFSET/2)));
-
-    // black background
-
-    dc.Clear();
-    m_rPlot = wxRect(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER, m_rGrid.GetWidth(), m_rGrid.GetHeight());
-    wxBrush ltGraphBkgBrush = wxBrush(BLACK_COLOR);
-    dc.SetBrush(ltGraphBkgBrush);
-    dc.SetPen(wxPen(BLACK_COLOR, 0));
-    dc.DrawRectangle(m_rPlot);
-    wxPen pen;
-    pen.SetWidth(1); // note this is ignored by DrawPoint
-
-    // automatically scale, first measure the maximum value
-
-    float max_xy = 1E-12;
-    float real,imag;
-    for(i=0; i< scatterMemSyms; i++) {
-        real = fabs(m_mem[i].real);
-        imag = fabs(m_mem[i].imag);
-        if (real > max_xy)
-            max_xy = real;
-        if (imag > max_xy)
-            max_xy = imag;
-    }
-
-    // smooth it out and set a lower limit to prevent didev by 0 issues
-
-    m_filter_max_xy = BETA*m_filter_max_xy + (1 - BETA)*2.5*max_xy;
-    if (m_filter_max_xy < 0.001)
-        m_filter_max_xy = 0.001;
-
-    // quantise to log steps to prevent scatter scaling bobbing about too
-    // much as scaling varies
-
-    float quant_m_filter_max_xy = exp(floor(0.5+log(m_filter_max_xy)));
-    //printf("max_xy: %f m_filter_max_xy: %f quant_m_filter_max_xy: %f\n", max_xy, m_filter_max_xy, quant_m_filter_max_xy);
-
-    x_scale = (float)m_rGrid.GetWidth()/quant_m_filter_max_xy;
-    y_scale = (float)m_rGrid.GetHeight()/quant_m_filter_max_xy;
-
-    // draw all samples
-
-    for(i = 0; i < scatterMemSyms; i++)
-    {
-        x = x_scale * m_mem[i].real + m_rGrid.GetWidth()/2;
-        y = y_scale * m_mem[i].imag + m_rGrid.GetHeight()/2;
-       x += PLOT_BORDER + XLEFT_OFFSET;
-       y += PLOT_BORDER;
-        pen.SetColour(sym_to_colour[i%Nsym]);
-        dc.SetPen(pen);
-       dc.DrawPoint(x, y);
-    }
-}
-
-//----------------------------------------------------------------
-// add_new_samples()
-//----------------------------------------------------------------
-void PlotScatter::add_new_samples(COMP samples[])
-{
-    int i,j;
-
-    // shift memory
-
-    for(i = 0; i < scatterMemSyms - Nsym; i++)
-    {
-        m_mem[i] = m_mem[i+Nsym];
-    }
-
-    // new samples
-
-    for(j=0; i < scatterMemSyms; i++,j++)
-    {
-        m_mem[i] = samples[j];
-    }
-}
-
-//----------------------------------------------------------------
-// OnPaint()
-//----------------------------------------------------------------
-void PlotScatter::OnPaint(wxPaintEvent& event)
-{
-    wxAutoBufferedPaintDC dc(this);
-    draw(dc);
-}
-
-//----------------------------------------------------------------
-// OnSize()
-//----------------------------------------------------------------
-void PlotScatter::OnSize(wxSizeEvent& event)
-{
-    // todo: clear screen
-}
-
-//----------------------------------------------------------------
-// OnShow()
-//----------------------------------------------------------------
-void PlotScatter::OnShow(wxShowEvent& event)
-{
-}
-
diff --git a/fdmdv2/branches/0.99/src/fdmdv2_plot_scatter.h b/fdmdv2/branches/0.99/src/fdmdv2_plot_scatter.h
deleted file mode 100644 (file)
index 702f633..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_plot_scatter.h
-// Purpose:         A scatter plot derivative of fdmdv2_plot.
-// Created:         June 24, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#ifndef __FDMDV2_PLOT_SCATTER__
-#define __FDMDV2_PLOT_SCATTER__
-
-#include "comp.h"
-#include "fdmdv2_plot.h"
-#include "fdmdv2_defines.h"
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class PlotScatter
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class PlotScatter : public PlotPanel
-{
-    public:
-        PlotScatter(wxFrame* parent);
-        ~PlotScatter(){};
-       void add_new_samples(COMP samples[]);
-       void setNc(int Nc);
-
-    protected:
-        COMP m_mem[SCATTER_MEM_SYMS_MAX];
-        COMP m_new_samples[FDMDV_NC_MAX+1];
-
-        void draw(wxAutoBufferedPaintDC&  dc);
-        void OnPaint(wxPaintEvent& event);
-        void OnSize(wxSizeEvent& event);
-        void OnShow(wxShowEvent& event);
-
-        DECLARE_EVENT_TABLE()
-
-    private:
-        int   Nsym;
-        int   scatterMemSyms;
-        float m_filter_max_xy;
-};
-
-#endif //__FDMDV2_PLOT_SCATTER__
diff --git a/fdmdv2/branches/0.99/src/fdmdv2_plot_spectrum.cpp b/fdmdv2/branches/0.99/src/fdmdv2_plot_spectrum.cpp
deleted file mode 100644 (file)
index d9c72d0..0000000
+++ /dev/null
@@ -1,266 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_plot_waterfall.cpp
-// Purpose:         Implements a waterfall plot derivative of fdmdv2_plot.
-// Created:         June 23, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#include <string.h>
-#include "wx/wx.h"
-
-#include "fdmdv2_main.h"
-
-extern float g_avmag[];                 // average mag data passed to draw() 
-void fdmdv2_clickTune(float frequency); // callback to pass new click freq
-
-BEGIN_EVENT_TABLE(PlotSpectrum, PlotPanel)
-    EVT_MOTION          (PlotSpectrum::OnMouseMove)
-    EVT_LEFT_DOWN       (PlotSpectrum::OnMouseLeftDown)
-    EVT_LEFT_UP         (PlotSpectrum::OnMouseLeftUp)
-    EVT_MOUSEWHEEL      (PlotSpectrum::OnMouseWheelMoved)
-    EVT_PAINT           (PlotSpectrum::OnPaint)
-    EVT_SHOW            (PlotSpectrum::OnShow)
-END_EVENT_TABLE()
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class PlotSpectrum
-//
-// @class $(Name)
-// @author $(User)
-// @date $(Date)
-// @file $(CurrentFileName).$(CurrentFileExt)
-// @brief
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-PlotSpectrum::PlotSpectrum(wxFrame* parent, float *magdB, int n_magdB, 
-                           float min_mag_db, float max_mag_db, bool clickTune): PlotPanel(parent)
-{
-    m_greyscale     = 0;
-    m_Bufsz         = GetMaxClientSize();
-    m_newdata       = false;
-    m_firstPass     = true;
-    m_line_color    = 0;
-    SetLabelSize(10.0);
-
-    m_magdB         = magdB;
-    m_n_magdB       = n_magdB;     // number of points in magdB that covers 0 ... MAX_F_HZ of spectrum
-    m_max_mag_db    = max_mag_db;
-    m_min_mag_db    = min_mag_db;
-    m_rxFreq        = 0.0;
-    m_clickTune     = clickTune;
-}
-
-//----------------------------------------------------------------
-// ~PlotSpectrum()
-//----------------------------------------------------------------
-PlotSpectrum::~PlotSpectrum()
-{
-}
-
-//----------------------------------------------------------------
-// OnSize()
-//----------------------------------------------------------------
-void PlotSpectrum::OnSize(wxSizeEvent& event) {
-}
-
-//----------------------------------------------------------------
-// OnPaint()
-//----------------------------------------------------------------
-void PlotSpectrum::OnPaint(wxPaintEvent& event)
-{
-    wxAutoBufferedPaintDC dc(this);
-    draw(dc);
-}
-
-//----------------------------------------------------------------
-// OnShow()
-//----------------------------------------------------------------
-void PlotSpectrum::OnShow(wxShowEvent& event)
-{
-}
-
-//----------------------------------------------------------------
-// draw()
-//----------------------------------------------------------------
-void PlotSpectrum::draw(wxAutoBufferedPaintDC& dc)
-{
-    m_rCtrl  = GetClientRect();
-
-    // m_rGrid is coords of inner window we actually plot to.  We deflate it a bit
-    // to leave room for axis labels.  We need to work this out every time we draw
-    // as OnSize() may not be called before OnPaint(), for example when a new tab
-    // is selected
-
-    m_rGrid  = m_rCtrl;
-    m_rGrid = m_rGrid.Deflate(PLOT_BORDER + (XLEFT_OFFSET/2), (PLOT_BORDER + (YBOTTOM_OFFSET/2)));
-
-    dc.Clear();
-
-    // black background
-
-    m_rPlot = wxRect(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER, m_rGrid.GetWidth(), m_rGrid.GetHeight());
-    wxBrush ltGraphBkgBrush = wxBrush(BLACK_COLOR);
-    dc.SetBrush(ltGraphBkgBrush);
-    dc.SetPen(wxPen(BLACK_COLOR, 0));
-    dc.DrawRectangle(m_rPlot);
-
-    // draw spectrum
-
-    int   x, y, prev_x, prev_y, index;
-    float index_to_px, mag_dB_to_py, mag;
-
-    m_newdata = false;
-
-    wxPen pen;
-    pen.SetColour(DARK_GREEN_COLOR);
-    pen.SetWidth(1);
-    dc.SetPen(pen);
-
-    index_to_px = (float)m_rGrid.GetWidth()/m_n_magdB;
-    mag_dB_to_py = (float)m_rGrid.GetHeight()/(m_max_mag_db - m_min_mag_db);
-
-    prev_x = PLOT_BORDER + XLEFT_OFFSET;
-    prev_y = PLOT_BORDER;
-    for(index = 0; index < m_n_magdB; index++)
-    {
-        x = index*index_to_px;
-        mag = m_magdB[index];
-        if (mag > m_max_mag_db) mag = m_max_mag_db;
-        if (mag < m_min_mag_db) mag = m_min_mag_db;
-        y = -(mag - m_max_mag_db) * mag_dB_to_py;
-
-        x += PLOT_BORDER + XLEFT_OFFSET;
-        y += PLOT_BORDER;
-
-        if (index)
-            dc.DrawLine(x, y, prev_x, prev_y);
-        prev_x = x; prev_y = y;
-    }
-
-    // and finally draw Graticule
-
-    drawGraticule(dc);
-
-}
-
-//-------------------------------------------------------------------------
-// drawGraticule()
-//-------------------------------------------------------------------------
-void PlotSpectrum::drawGraticule(wxAutoBufferedPaintDC&  dc)
-{
-    int      x, y, text_w, text_h;
-    char     buf[15];
-    wxString s;
-    float    f, mag, freq_hz_to_px, mag_dB_to_py;
-
-    wxBrush ltGraphBkgBrush;
-    ltGraphBkgBrush.SetStyle(wxBRUSHSTYLE_TRANSPARENT);
-    ltGraphBkgBrush.SetColour(*wxBLACK);
-    dc.SetBrush(ltGraphBkgBrush);
-    dc.SetPen(wxPen(BLACK_COLOR, 1));
-
-    freq_hz_to_px = (float)m_rGrid.GetWidth()/(MAX_F_HZ-MIN_F_HZ);
-    mag_dB_to_py = (float)m_rGrid.GetHeight()/(m_max_mag_db - m_min_mag_db);
-
-    // upper LH coords of plot area are (PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER)
-    // lower RH coords of plot area are (PLOT_BORDER + XLEFT_OFFSET + m_rGrid.GetWidth(), 
-    //                                   PLOT_BORDER + m_rGrid.GetHeight())
-
-    // Check if small screen size means text will overlap
-
-    int textXStep = STEP_F_HZ*freq_hz_to_px;
-    int textYStep = STEP_MAG_DB*mag_dB_to_py;
-    sprintf(buf, "%4.0fHz", (float)MAX_F_HZ - STEP_F_HZ);
-    GetTextExtent(buf, &text_w, &text_h);
-    int overlappedText = (text_w > textXStep) || (text_h > textYStep);
-    //printf("text_w: %d textXStep: %d text_h: %d textYStep: %d  overlappedText: %d\n", text_w, textXStep, 
-    //      text_h, textYStep, overlappedText);
-
-    // Vertical gridlines
-
-    for(f=STEP_F_HZ; f<MAX_F_HZ; f+=STEP_F_HZ) {
-       x = f*freq_hz_to_px;
-       x += PLOT_BORDER + XLEFT_OFFSET;
-
-        dc.SetPen(m_penShortDash);
-        dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, PLOT_BORDER);
-        dc.SetPen(wxPen(BLACK_COLOR, 1));
-        dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET);
-
-        sprintf(buf, "%4.0fHz", f);
-       GetTextExtent(buf, &text_w, &text_h);
-        if (!overlappedText)
-            dc.DrawText(buf, x - text_w/2, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET);
-    }
-
-    dc.SetPen(wxPen(BLACK_COLOR, 1));
-    for(f=STEP_MINOR_F_HZ; f<MAX_F_HZ; f+=STEP_MINOR_F_HZ) 
-    {
-        x = f*freq_hz_to_px;
-        x += PLOT_BORDER + XLEFT_OFFSET;
-        dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET-5);
-    }
-    
-    // Horizontal gridlines
-
-    dc.SetPen(m_penDotDash);
-    for(mag=m_min_mag_db; mag<=m_max_mag_db; mag+=STEP_MAG_DB) {
-       y = -(mag - m_max_mag_db) * mag_dB_to_py;
-       y += PLOT_BORDER;
-       dc.DrawLine(PLOT_BORDER + XLEFT_OFFSET, y, 
-                   (m_rGrid.GetWidth() + PLOT_BORDER + XLEFT_OFFSET), y);
-        sprintf(buf, "%3.0fdB", mag);
-       GetTextExtent(buf, &text_w, &text_h);
-        if (!overlappedText)
-            dc.DrawText(buf, PLOT_BORDER + XLEFT_OFFSET - text_w - XLEFT_TEXT_OFFSET, y-text_h/2);
-    }
-
-    // red rx tuning line
-    
-    if (m_rxFreq != 0.0) {
-        dc.SetPen(wxPen(RED_COLOR, 2));
-        x = m_rxFreq*freq_hz_to_px;
-        x += PLOT_BORDER + XLEFT_OFFSET;
-        //printf("m_rxFreq %f x %d\n", m_rxFreq, x);
-        dc.DrawLine(x, m_rGrid.GetHeight()+ PLOT_BORDER, x, m_rCtrl.GetHeight());
-    }
-
-}
-
-//-------------------------------------------------------------------------
-// OnMouseDown()
-//-------------------------------------------------------------------------
-void PlotSpectrum::OnMouseLeftDown(wxMouseEvent& event)
-{
-    m_mouseDown = true;
-    wxClientDC dc(this);
-
-    wxPoint pt(event.GetLogicalPosition(dc));
-
-    // map x coord to edges of actual plot
-    pt.x -= PLOT_BORDER + XLEFT_OFFSET;
-    pt.y -= PLOT_BORDER;
-
-    // valid click if inside of plot
-    if ((pt.x >= 0) && (pt.x <= m_rGrid.GetWidth()) && (pt.y >=0) && m_clickTune) {
-        float freq_hz_to_px = (float)m_rGrid.GetWidth()/(MAX_F_HZ-MIN_F_HZ);
-        float clickFreq = (float)pt.x/freq_hz_to_px;
-
-        // see PlotWaterfall::OnMouseDown()
-
-        fdmdv2_clickTune(clickFreq);
-    }
-}
diff --git a/fdmdv2/branches/0.99/src/fdmdv2_plot_spectrum.h b/fdmdv2/branches/0.99/src/fdmdv2_plot_spectrum.h
deleted file mode 100644 (file)
index 353f312..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_plot_spectrum.h
-// Purpose:         Defines a spectrum plot derived from fdmdv2_plot class.
-// Created:         June 22, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#ifndef __FDMDV2_PLOT_SPECTRUM__
-#define __FDMDV2_PLOT_SPECTRUM__
-
-#include "fdmdv2_plot.h"
-#include "fdmdv2_defines.h"
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class Waterfall
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class PlotSpectrum : public PlotPanel
-{
-    public:
-    PlotSpectrum(wxFrame* parent, float *magdB, int n_magdB, 
-                 float min_mag_db=MIN_MAG_DB, float max_mag_db=MAX_MAG_DB, bool clickTune=true);
-        ~PlotSpectrum();
-        void setRxFreq(float rxFreq) { m_rxFreq = rxFreq; }
-        void setFreqScale(int n_magdB) { m_n_magdB = n_magdB; }
-
-    protected:
-        void        OnPaint(wxPaintEvent& event);
-        void        OnSize(wxSizeEvent& event);
-        void        OnShow(wxShowEvent& event);
-        void        drawGraticule(wxAutoBufferedPaintDC& dc);
-        void        draw(wxAutoBufferedPaintDC& dc);
-        void        OnMouseLeftDown(wxMouseEvent& event);
-
-   private:
-        float       m_rxFreq;
-        float       m_max_mag_db;
-        float       m_min_mag_db;
-        float      *m_magdB;
-        int         m_n_magdB;  
-        bool        m_clickTune;
-
-        DECLARE_EVENT_TABLE()
-};
-
-#endif //__FDMDV2_PLOT_SPECTRUM__
diff --git a/fdmdv2/branches/0.99/src/fdmdv2_plot_waterfall.cpp b/fdmdv2/branches/0.99/src/fdmdv2_plot_waterfall.cpp
deleted file mode 100644 (file)
index 4a8b447..0000000
+++ /dev/null
@@ -1,483 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_plot_waterfall.cpp
-// Purpose:         Implements a waterfall plot derivative of fdmdv2_plot.
-// Created:         June 22, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#include <string.h>
-#include "wx/wx.h"
-#include "fdmdv2_main.h"
-
-extern float g_avmag[];                 // av mag spec passed in to draw() 
-void fdmdv2_clickTune(float frequency); // callback to pass new click freq
-
-BEGIN_EVENT_TABLE(PlotWaterfall, PlotPanel)
-    EVT_PAINT           (PlotWaterfall::OnPaint)
-    EVT_MOTION          (PlotWaterfall::OnMouseMove)
-    EVT_LEFT_DOWN       (PlotWaterfall::OnMouseLeftDown)
-    EVT_RIGHT_DOWN      (PlotWaterfall::OnMouseRightDown)
-    EVT_LEFT_UP         (PlotWaterfall::OnMouseLeftUp)
-    EVT_MOUSEWHEEL      (PlotWaterfall::OnMouseWheelMoved)
-    EVT_SIZE            (PlotWaterfall::OnSize)
-    EVT_SHOW            (PlotWaterfall::OnShow)
-END_EVENT_TABLE()
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class WaterfallPlot
-//
-// @class   WaterfallPlot
-// @author  David Witten
-// @date    $(Date)
-// @file    $(CurrentFileName).$(CurrentFileExt)
-// @brief
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-PlotWaterfall::PlotWaterfall(wxFrame* parent, bool graticule, int colour): PlotPanel(parent)
-{
-
-    for(int i = 0; i < 255; i++)
-    {
-        m_heatmap_lut[i] = heatmap((float)i, 0.0, 255.0);
-    }
-    m_graticule     = graticule;
-    m_colour        = colour;
-    m_Bufsz         = GetMaxClientSize();
-    m_newdata       = false;
-    m_firstPass     = true;
-    m_line_color    = 0;
-    m_modem_stats_max_f_hz = MODEM_STATS_MAX_F_HZ;
-
-    SetLabelSize(10.0);
-
-    m_pBmp = NULL;
-    m_max_mag = MAX_MAG_DB;
-    m_min_mag = MIN_MAG_DB;
-}
-
-// When the window size gets set we can work outthe size of the window
-// we plot in and allocate a bit map of the correct size
-void PlotWaterfall::OnSize(wxSizeEvent& event) 
-{
-    // resize bit map
-
-    delete m_pBmp;
-    
-    m_rCtrl  = GetClientRect();
-
-    // m_rGrid is coords of inner window we actually plot to.  We deflate it a bit
-    // to leave room for axis labels.
-
-    m_rGrid  = m_rCtrl;
-    m_rGrid = m_rGrid.Deflate(PLOT_BORDER + (XLEFT_OFFSET/2), (PLOT_BORDER + (YBOTTOM_OFFSET/2)));
-
-    // we want a bit map the size of m_rGrid
-
-    m_pBmp = new wxBitmap(m_rGrid.GetWidth(), m_rGrid.GetHeight(), 24);
-
-    m_dT = DT;
-}
-
-//----------------------------------------------------------------
-// paintEvent()
-//
-// @class $(Name)
-// @author $(User)
-// @date $(Date)
-// @file $(CurrentFileName).$(CurrentFileExt)
-// @brief
-//
-// Called by the system of by wxWidgets when the panel needs
-// to be redrawn. You can also trigger this call by calling
-// Refresh()/Update().
-//----------------------------------------------------------------
-void PlotWaterfall::OnPaint(wxPaintEvent & evt)
-{
-    wxAutoBufferedPaintDC dc(this);
-    draw(dc);
-}
-
-//----------------------------------------------------------------
-// OnShow()
-//----------------------------------------------------------------
-void PlotWaterfall::OnShow(wxShowEvent& event)
-{
-}
-
-//----------------------------------------------------------------
-// ~PlotWaterfall()
-//----------------------------------------------------------------
-PlotWaterfall::~PlotWaterfall()
-{
-}
-
-//----------------------------------------------------------------
-// heatmap()
-// map val to a rgb colour
-// from http://eddiema.ca/2011/01/21/c-sharp-heatmaps/
-//----------------------------------------------------------------
-unsigned PlotWaterfall::heatmap(float val, float min, float max)
-{
-    unsigned r = 0;
-    unsigned g = 0;
-    unsigned b = 0;
-
-    val = (val - min) / (max - min);
-    if(val <= 0.2)
-    {
-        b = (unsigned)((val / 0.2) * 255);
-    }
-    else if(val >  0.2 &&  val <= 0.7)
-    {
-        b = (unsigned)((1.0 - ((val - 0.2) / 0.5)) * 255);
-    }
-    if(val >= 0.2 &&  val <= 0.6)
-    {
-        g = (unsigned)(((val - 0.2) / 0.4) * 255);
-    }
-    else if(val >  0.6 &&  val <= 0.9)
-    {
-        g = (unsigned)((1.0 - ((val - 0.6) / 0.3)) * 255);
-    }
-    if(val >= 0.5)
-    {
-        r = (unsigned)(((val - 0.5) / 0.5) * 255);
-    }
-    //printf("%f %x %x %x\n", val, r, g, b);
-    return  (b << 16) + (g << 8) + r;
-}
-
-bool PlotWaterfall::checkDT(void)
-{
-    // Check dY is > 1 pixel before proceeding. For small screens
-    // and large WATERFALL_SECS_Y we might have less than one
-    // block per pixel.  In this case increase m_dT and perform draw
-    // less often
-
-    float px_per_sec = (float)m_rGrid.GetHeight() / WATERFALL_SECS_Y;
-    float dy = m_dT * px_per_sec;
-    
-    if (dy < 1.0) {
-        m_dT += DT;
-        return false;
-    }
-    else
-        return true;
-}
-
-//----------------------------------------------------------------
-// draw()
-//----------------------------------------------------------------
-void PlotWaterfall::draw(wxAutoBufferedPaintDC& dc)
-{
-
-    m_rCtrl  = GetClientRect();
-
-    // m_rGrid is coords of inner window we actually plot to.  We deflate it a bit
-    // to leave room for axis labels.
-
-    m_rGrid = m_rCtrl;
-    m_rGrid = m_rGrid.Deflate(PLOT_BORDER + (XLEFT_OFFSET/2), (PLOT_BORDER + (YBOTTOM_OFFSET/2)));
-
-    if (m_pBmp == NULL) 
-    {
-        // we want a bit map the size of m_rGrid
-        m_pBmp = new wxBitmap(m_rGrid.GetWidth(), m_rGrid.GetHeight(), 24);
-    }
-
-    dc.Clear();
-
-    if(m_newdata)
-    {
-        m_newdata = false;
-        plotPixelData();
-        dc.DrawBitmap(*m_pBmp, PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER);
-        m_dT = DT;
-    }
-    else 
-    {
-
-        // no data to plot so just erase to black.  Blue looks nicer
-        // but is same colour as low amplitude signal
-
-        // Bug on Linux: When Stop is pressed this code doesn't erase
-        // the lower 25% of the Waterfall Window
-
-        m_rPlot = wxRect(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER, m_rGrid.GetWidth(), m_rGrid.GetHeight());
-        wxBrush ltGraphBkgBrush = wxBrush(BLACK_COLOR);
-        dc.SetBrush(ltGraphBkgBrush);
-        dc.SetPen(wxPen(BLACK_COLOR, 0));
-        dc.DrawRectangle(m_rPlot);
-    }
-    drawGraticule(dc);
-}
-
-//-------------------------------------------------------------------------
-// drawGraticule()
-//-------------------------------------------------------------------------
-void PlotWaterfall::drawGraticule(wxAutoBufferedPaintDC& dc)
-{
-    int      x, y, text_w, text_h;
-    char     buf[15];
-    wxString s;
-    float    f, time, freq_hz_to_px, time_s_to_py;
-
-    wxBrush ltGraphBkgBrush;
-    ltGraphBkgBrush.SetStyle(wxBRUSHSTYLE_TRANSPARENT);
-    ltGraphBkgBrush.SetColour(*wxBLACK);
-    dc.SetBrush(ltGraphBkgBrush);
-    dc.SetPen(wxPen(BLACK_COLOR, 1));
-
-    freq_hz_to_px = (float)m_rGrid.GetWidth()/(MAX_F_HZ-MIN_F_HZ);
-    time_s_to_py = (float)m_rGrid.GetHeight()/WATERFALL_SECS_Y;
-
-    // upper LH coords of plot area are (PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER)
-    // lower RH coords of plot area are (PLOT_BORDER + XLEFT_OFFSET + m_rGrid.GetWidth(), 
-    //                                   PLOT_BORDER + m_rGrid.GetHeight())
-
-    // Check if small screen size means text will overlap
-
-    int textXStep = STEP_F_HZ*freq_hz_to_px;
-    int textYStep = WATERFALL_SECS_STEP*time_s_to_py;
-    sprintf(buf, "%4.0fHz", (float)MAX_F_HZ - STEP_F_HZ);
-    GetTextExtent(buf, &text_w, &text_h);
-    int overlappedText = (text_w > textXStep) || (text_h > textYStep);
-
-    // Major Vertical gridlines and legend
-    //dc.SetPen(m_penShortDash);
-    for(f=STEP_F_HZ; f<MAX_F_HZ; f+=STEP_F_HZ) 
-    {
-        x = f*freq_hz_to_px;
-        x += PLOT_BORDER + XLEFT_OFFSET;
-
-        if (m_graticule)
-            dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, PLOT_BORDER);
-        else
-            dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET);
-            
-        sprintf(buf, "%4.0fHz", f);
-        GetTextExtent(buf, &text_w, &text_h);
-        if (!overlappedText)
-            dc.DrawText(buf, x - text_w/2, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET);
-    }
-
-    for(f=STEP_MINOR_F_HZ; f<MAX_F_HZ; f+=STEP_MINOR_F_HZ) 
-    {
-        x = f*freq_hz_to_px;
-        x += PLOT_BORDER + XLEFT_OFFSET;
-        dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET-5);
-    }
-    
-    // Horizontal gridlines
-    dc.SetPen(m_penDotDash);
-    for(time=0; time<=WATERFALL_SECS_Y; time+=WATERFALL_SECS_STEP) {
-       y = m_rGrid.GetHeight() - time*time_s_to_py;
-       y += PLOT_BORDER;
-
-        if (m_graticule)
-            dc.DrawLine(PLOT_BORDER + XLEFT_OFFSET, y, 
-                        (m_rGrid.GetWidth() + PLOT_BORDER + XLEFT_OFFSET), y);
-        sprintf(buf, "%3.0fs", time);
-       GetTextExtent(buf, &text_w, &text_h);
-        if (!overlappedText)
-            dc.DrawText(buf, PLOT_BORDER + XLEFT_OFFSET - text_w - XLEFT_TEXT_OFFSET, y-text_h/2);
-   }
-
-    // red rx tuning line
-    dc.SetPen(wxPen(RED_COLOR, 2));
-    x = m_rxFreq*freq_hz_to_px;
-    x += PLOT_BORDER + XLEFT_OFFSET;
-    //printf("m_rxFreq %f x %d\n", m_rxFreq, x);
-    dc.DrawLine(x, m_rGrid.GetHeight()+ PLOT_BORDER, x, m_rCtrl.GetHeight());
-    
-}
-
-//-------------------------------------------------------------------------
-// plotPixelData()
-//-------------------------------------------------------------------------
-void PlotWaterfall::plotPixelData()
-{
-    float       spec_index_per_px;
-    float       intensity_per_dB;
-    float       px_per_sec;
-    int         index;
-    float       dy;
-    int         dy_blocks;
-    int         b;
-    int         px;
-    int         py;
-    int         intensity;
-
-    /*
-      Design Notes:
-
-      The height in pixels represents WATERFALL_SECS_Y of data.  Every DT
-      seconds we get a vector of MODEM_STATS_NSPEC spectrum samples which we use
-      to update the last row.  The height of each row is dy pixels, which
-      maps to DT seconds.  We call each dy high rectangle of pixels a
-      block.
-
-    */
-
-    // determine dy, the height of one "block"
-    px_per_sec = (float)m_rGrid.GetHeight() / WATERFALL_SECS_Y;
-    dy = m_dT * px_per_sec;
-
-    // number of dy high blocks in spectrogram
-    dy_blocks = m_rGrid.GetHeight()/ dy;
-
-    // update min and max amplitude estimates
-    float max_mag = MIN_MAG_DB;
-
-    int min_fft_bin=((float)200/m_modem_stats_max_f_hz)*MODEM_STATS_NSPEC;
-    int max_fft_bin=((float)2800/m_modem_stats_max_f_hz)*MODEM_STATS_NSPEC;
-
-    for(int i=min_fft_bin; i<max_fft_bin; i++) 
-    {
-        if (g_avmag[i] > max_mag)
-        {
-            max_mag = g_avmag[i];
-        }
-    }
-
-    m_max_mag = BETA*m_max_mag + (1 - BETA)*max_mag;
-    m_min_mag = max_mag - 20.0;
-    //printf("max_mag: %f m_max_mag: %f\n", max_mag, m_max_mag);
-    intensity_per_dB  = (float)256 /(MAX_MAG_DB - MIN_MAG_DB);
-    //intensity_per_dB  = (float)256 /(m_max_mag - m_min_mag);
-    spec_index_per_px = ((float)(MAX_F_HZ)/(float)m_modem_stats_max_f_hz)*(float)MODEM_STATS_NSPEC / (float) m_rGrid.GetWidth();
-
-    /*
-    printf("h %d w %d px_per_sec %d dy %d dy_blocks %d spec_index_per_px: %f\n", 
-       m_rGrid.GetHeight(), m_rGrid.GetWidth(), px_per_sec, 
-       dy, dy_blocks, spec_index_per_px);
-    */
-
-    // Shift previous bit map up one row of blocks ----------------------------
-    wxNativePixelData data(*m_pBmp);
-    wxNativePixelData::Iterator bitMapStart(data);
-    wxNativePixelData::Iterator p = bitMapStart;
-
-    for(b = 0; b < dy_blocks - 1; b++) 
-    {
-        wxNativePixelData::Iterator psrc = bitMapStart;
-        wxNativePixelData::Iterator pdest = bitMapStart;
-        pdest.OffsetY(data, dy * b);
-        psrc.OffsetY(data, dy * (b+1));
-
-        // copy one line of blocks
-
-        for(py = 0; py < dy; py++) 
-        {
-            wxNativePixelData::Iterator pdestRowStart = pdest;
-            wxNativePixelData::Iterator psrcRowStart = psrc;
-
-            for(px = 0; px < m_rGrid.GetWidth(); px++) 
-            {
-                pdest.Red() = psrc.Red();
-                pdest.Green() = psrc.Green();
-                pdest.Blue() = psrc.Blue();
-                pdest++;
-                psrc++;
-            }
-            pdest = pdestRowStart;
-            pdest.OffsetY(data, 1);
-            psrc = psrcRowStart;
-            psrc.OffsetY(data, 1);         
-        }
-    }
-
-    // Draw last line of blocks using latest amplitude data ------------------
-    p = bitMapStart;
-    p.OffsetY(data, dy *(dy_blocks - 1));
-    for(py = 0; py < dy; py++)
-    {
-        wxNativePixelData::Iterator rowStart = p;
-
-        for(px = 0; px < m_rGrid.GetWidth(); px++)
-        {
-            index = px * spec_index_per_px;
-            assert(index < MODEM_STATS_NSPEC);
-
-            intensity = intensity_per_dB * (g_avmag[index] - m_min_mag);
-            if(intensity > 255) intensity = 255;
-            if (intensity < 0) intensity = 0;
-            //printf("%d %f %d \n", index, g_avmag[index], intensity);
-
-            switch (m_colour) {
-            case 0:
-                p.Red() = m_heatmap_lut[intensity] & 0xff;
-                p.Green() = (m_heatmap_lut[intensity] >> 8) & 0xff;
-                p.Blue() = (m_heatmap_lut[intensity] >> 16) & 0xff;
-                break;
-            case 1:
-                p.Red() = intensity;
-                p.Green() = intensity;
-                p.Blue() = intensity;       
-                break;
-            case 2:
-                p.Red() = intensity;
-                p.Green() = intensity;
-                if (intensity < 127)
-                    p.Blue() = intensity*2;
-                else
-                    p.Blue() = 255;
-                        
-                break;
-            }
-            ++p;
-        }
-        p = rowStart;
-        p.OffsetY(data, 1);
-    }
-
-}
-
-//-------------------------------------------------------------------------
-// OnMouseLeftDown()
-//-------------------------------------------------------------------------
-void PlotWaterfall::OnMouseLeftDown(wxMouseEvent& event)
-{
-    m_mouseDown = true;
-    wxClientDC dc(this);
-
-    wxPoint pt(event.GetLogicalPosition(dc));
-
-    // map x coord to edges of actual plot
-    pt.x -= PLOT_BORDER + XLEFT_OFFSET;
-    pt.y -= PLOT_BORDER;
-
-    // valid click if inside of plot
-    if ((pt.x >= 0) && (pt.x <= m_rGrid.GetWidth()) && (pt.y >=0)) 
-    {
-        float freq_hz_to_px = (float)m_rGrid.GetWidth()/(MAX_F_HZ-MIN_F_HZ);
-        float clickFreq = (float)pt.x/freq_hz_to_px;
-
-        // communicate back to other threads
-        fdmdv2_clickTune(clickFreq);
-    }
-}
-
-//-------------------------------------------------------------------------
-// OnMouseRightDown()
-//-------------------------------------------------------------------------
-void PlotWaterfall::OnMouseRightDown(wxMouseEvent& event)
-{
-    m_colour++;
-    if (m_colour == 3)
-        m_colour = 0;
-}
-
diff --git a/fdmdv2/branches/0.99/src/fdmdv2_plot_waterfall.h b/fdmdv2/branches/0.99/src/fdmdv2_plot_waterfall.h
deleted file mode 100644 (file)
index 77058fd..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_plot_waterfall.h
-// Purpose:         Defines a waterfall plot derivative of fdmdv2_plot.
-// Created:         June 22, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#ifndef __FDMDV2_PLOT_WATERFALL__
-#define __FDMDV2_PLOT_WATERFALL__
-
-#include "fdmdv2_plot.h"
-#include "fdmdv2_defines.h"
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class PlotWaterfall
-//
-// @class $(Name)
-// @author $(User)
-// @date $(Date)
-// @file $(CurrentFileName).$(CurrentFileExt)
-// @brief
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class PlotWaterfall : public PlotPanel
-{
-    public:
-    PlotWaterfall(wxFrame* parent, bool graticule, int colour);
-        ~PlotWaterfall();
-        bool checkDT(void);
-        void setGreyscale(bool greyscale) { m_greyscale = greyscale; }
-        void setRxFreq(float rxFreq) { m_rxFreq = rxFreq; }
-        void setFs(int fs) { m_modem_stats_max_f_hz = fs/2; }
-
-    protected:
-        unsigned    m_heatmap_lut[256];
-
-        unsigned    heatmap(float val, float min, float max);
-
-        void        OnPaint(wxPaintEvent & evt);
-        void        OnSize(wxSizeEvent& event);
-        void        OnShow(wxShowEvent& event);
-        void        drawGraticule(wxAutoBufferedPaintDC&  dc);
-        void        draw(wxAutoBufferedPaintDC& dc);
-        void        plotPixelData();
-        void        OnMouseLeftDown(wxMouseEvent& event);
-        void        OnMouseRightDown(wxMouseEvent& event);
-
-    private:
-        float       m_dT;
-        float       m_rxFreq;
-        bool        m_graticule;
-        float       m_min_mag;
-        float       m_max_mag;
-        int         m_colour;
-        int         m_modem_stats_max_f_hz;
-
-        DECLARE_EVENT_TABLE()
-};
-
-#endif //__FDMDV2_PLOT_WATERFALL__
diff --git a/fdmdv2/branches/0.99/src/hamlib.cpp b/fdmdv2/branches/0.99/src/hamlib.cpp
deleted file mode 100644 (file)
index 575f36a..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-//==========================================================================
-// Name:            hamlib.cpp
-//
-// Purpose:         Hamlib integration for FreeDV
-// Created:         May 2013
-// Authors:         Joel Stanley
-//
-// 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#include <hamlib.h>
-
-#include <vector>
-#include <algorithm>
-
-using namespace std;
-
-typedef std::vector<const struct rig_caps *> riglist_t;
-
-static bool rig_cmp(const struct rig_caps *rig1, const struct rig_caps *rig2);
-static int build_list(const struct rig_caps *rig, rig_ptr_t);
-
-Hamlib::Hamlib() : m_rig(NULL) {
-    /* Stop hamlib from spewing info to stderr. */
-    rig_set_debug(RIG_DEBUG_NONE);
-
-    /* Create sorted list of rigs. */
-    rig_load_all_backends();
-    rig_list_foreach(build_list, &m_rigList);
-    sort(m_rigList.begin(), m_rigList.end(), rig_cmp);
-
-    /* Reset debug output. */
-    rig_set_debug(RIG_DEBUG_VERBOSE);
-
-       m_rig = NULL;
-}
-
-Hamlib::~Hamlib() {
-       if(m_rig)
-               close();
-}
-
-static int build_list(const struct rig_caps *rig, rig_ptr_t rigList) {
-    ((riglist_t *)rigList)->push_back(rig); 
-    return 1;
-}
-
-static bool rig_cmp(const struct rig_caps *rig1, const struct rig_caps *rig2) {
-    /* Compare manufacturer. */
-    int r = strcasecmp(rig1->mfg_name, rig2->mfg_name);
-    if (r != 0)
-        return r < 0;
-
-    /* Compare model. */
-    r = strcasecmp(rig1->model_name, rig2->model_name);
-    if (r != 0)
-        return r < 0;
-
-    /* Compare rig ID. */
-    return rig1->rig_model < rig2->rig_model;
-}
-
-void Hamlib::populateComboBox(wxComboBox *cb) {
-
-    riglist_t::const_iterator rig = m_rigList.begin();
-    for (; rig !=m_rigList.end(); rig++) {
-        char name[128];
-        snprintf(name, 128, "%s %s", (*rig)->mfg_name, (*rig)->model_name); 
-        cb->Append(name);
-    }
-}
-
-bool Hamlib::connect(unsigned int rig_index, const char *serial_port) {
-    /* Look up model from index. */
-    if (rig_index >= m_rigList.size()) {
-        return false;
-    }
-    printf("rig: %s %s (%d)\n", m_rigList[rig_index]->mfg_name,
-            m_rigList[rig_index]->model_name, m_rigList[rig_index]->rig_model);
-
-       if(m_rig) {
-               printf("Closing old hamlib instance!\n");
-               close();
-       }
-
-    /* Initialise, configure and open. */
-    m_rig = rig_init(m_rigList[rig_index]->rig_model);
-    /* TODO: Also use baud rate from the screen. */
-    if (!m_rig)
-        return false;
-    token_t token = rig_token_lookup(m_rig, "rig_pathname");
-    if (rig_set_conf(m_rig, token, serial_port) != RIG_OK) {
-        return false;
-    }
-    if (rig_open(m_rig) == RIG_OK) {
-        return true;
-    }
-    return false;
-}
-
-bool Hamlib::ptt(bool press) {
-       if(!m_rig)
-               return false;
-    /* TODO(Joel): make ON_DATA and ON configurable. */
-    ptt_t on = press ? RIG_PTT_ON : RIG_PTT_OFF;
-    /* TODO(Joel): what should the VFO option be? */
-    return rig_set_ptt(m_rig, RIG_VFO_CURR, on) == RIG_OK;
-}
-
-void Hamlib::close(void) {
-       if(m_rig) {
-               rig_close(m_rig);
-               rig_cleanup(m_rig);
-               m_rig = NULL;
-       }
-}
diff --git a/fdmdv2/branches/0.99/src/hamlib.h b/fdmdv2/branches/0.99/src/hamlib.h
deleted file mode 100644 (file)
index fe3496f..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-#ifndef HAMLIB_H
-#define HAMLIB_H
-
-extern "C" {
-#include <hamlib/rig.h>
-}
-#include <wx/combobox.h>
-#include <vector>
-
-class Hamlib {
-
-    public:
-        Hamlib();
-        ~Hamlib();
-        void populateComboBox(wxComboBox *cb);
-        bool connect(unsigned int rig_index, const char *serial_port);
-        bool ptt(bool press);
-        void close(void);
-
-        typedef std::vector<const struct rig_caps *> riglist_t;
-
-    private:
-        RIG *m_rig;
-        /* Sorted list of rigs. */
-        riglist_t m_rigList;
-};
-
-#endif /*HAMLIB_H*/
diff --git a/fdmdv2/branches/0.99/src/sox.h b/fdmdv2/branches/0.99/src/sox.h
deleted file mode 100644 (file)
index 07aedeb..0000000
+++ /dev/null
@@ -1,2608 +0,0 @@
-/* libSoX Library Public Interface
- *
- * Copyright 1999-2011 Chris Bagwell and SoX Contributors.
- *
- * This source code is freely redistributable and may be used for
- * any purpose.  This copyright notice must be maintained.
- * Chris Bagwell And SoX Contributors are not responsible for
- * the consequences of using this software.
- */
-
-/** @file
-Contains the interface exposed to clients of the libSoX library.
-Symbols starting with "sox_" or "SOX_" are part of the public interface for
-libSoX clients (applications that consume libSoX). Symbols starting with
-"lsx_" or "LSX_" are internal use by libSoX and plugins.
-LSX_ and lsx_ symbols should not be used by libSoX-based applications.
-*/
-
-#ifndef SOX_H
-#define SOX_H /**< Client API: This macro is defined if sox.h has been included. */
-
-#include <limits.h>
-#include <stdarg.h>
-#include <stddef.h>
-
-#if defined(__cplusplus)
-extern "C" {
-#endif
-
-/* Suppress warnings from use of type long long. */
-#if defined __GNUC__
-#pragma GCC system_header
-#endif
-
-/*****************************************************************************
-API decoration macros:
-Mostly for documentation purposes. For some compilers, decorations also affect
-code generation, influence compiler warnings or activate compiler
-optimizations.
-*****************************************************************************/
-
-/**
-Plugins API:
-Attribute required on all functions exported by libSoX and on all function
-pointer types used by the libSoX API.
-*/
-#ifdef __GNUC__
-#define LSX_API  __attribute__ ((cdecl)) /* libSoX function */
-#elif _MSC_VER
-#define LSX_API  __cdecl /* libSoX function */
-#else
-#define LSX_API /* libSoX function */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter or local variable to suppress warnings about
-the variable being unused (especially in macro-generated code).
-*/
-#ifdef __GNUC__
-#define LSX_UNUSED  __attribute__ ((unused)) /* Parameter or local variable is intentionally unused. */
-#else
-#define LSX_UNUSED /* Parameter or local variable is intentionally unused. */
-#endif
-
-/**
-Plugins API:
-LSX_PRINTF12: Attribute applied to a function to indicate that it requires
-a printf-style format string for arg1 and that printf parameters start at
-arg2.
-*/
-#ifdef __GNUC__
-#define LSX_PRINTF12  __attribute__ ((format (printf, 1, 2))) /* Function has printf-style arguments. */
-#else
-#define LSX_PRINTF12 /* Function has printf-style arguments. */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a function to indicate that it has no side effects and
-depends only its input parameters and global memory. If called repeatedly, it
-returns the same result each time.
-*/
-#ifdef __GNUC__
-#define LSX_RETURN_PURE __attribute__ ((pure)) /* Function is pure. */
-#else
-#define LSX_RETURN_PURE /* Function is pure. */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a function to indicate that the
-return value is always a pointer to a valid object (never NULL).
-*/
-#ifdef _Ret_
-#define LSX_RETURN_VALID _Ret_ /* Function always returns a valid object (never NULL). */
-#else
-#define LSX_RETURN_VALID /* Function always returns a valid object (never NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a function to indicate that the return value is always a
-pointer to a valid array (never NULL).
-*/
-#ifdef _Ret_valid_
-#define LSX_RETURN_ARRAY _Ret_valid_ /* Function always returns a valid array (never NULL). */
-#else
-#define LSX_RETURN_ARRAY /* Function always returns a valid array (never NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a function to indicate that the return value is always a
-pointer to a valid 0-terminated array (never NULL).
-*/
-#ifdef _Ret_z_
-#define LSX_RETURN_VALID_Z _Ret_z_ /* Function always returns a 0-terminated array (never NULL). */
-#else
-#define LSX_RETURN_VALID_Z /* Function always returns a 0-terminated array (never NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a function to indicate that the returned pointer may be
-null.
-*/
-#ifdef _Ret_opt_
-#define LSX_RETURN_OPT _Ret_opt_ /* Function may return NULL. */
-#else
-#define LSX_RETURN_OPT /* Function may return NULL. */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a valid
-pointer to one const element of the pointed-to type (never NULL).
-*/
-#ifdef _In_
-#define LSX_PARAM_IN _In_ /* Required const pointer to a valid object (never NULL). */
-#else
-#define LSX_PARAM_IN /* Required const pointer to a valid object (never NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a valid
-pointer to a const 0-terminated string (never NULL).
-*/
-#ifdef _In_z_
-#define LSX_PARAM_IN_Z _In_z_ /* Required const pointer to 0-terminated string (never NULL). */
-#else
-#define LSX_PARAM_IN_Z /* Required const pointer to 0-terminated string (never NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a const
-pointer to a 0-terminated printf format string.
-*/
-#ifdef _Printf_format_string_
-#define LSX_PARAM_IN_PRINTF _Printf_format_string_ /* Required const pointer to 0-terminated printf format string (never NULL). */
-#else
-#define LSX_PARAM_IN_PRINTF /* Required const pointer to 0-terminated printf format string (never NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a valid
-pointer to (len) const initialized elements of the pointed-to type, where
-(len) is the name of another parameter.
-@param len The parameter that contains the number of elements in the array.
-*/
-#ifdef _In_count_
-#define LSX_PARAM_IN_COUNT(len) _In_count_(len) /* Required const pointer to (len) valid objects (never NULL). */
-#else
-#define LSX_PARAM_IN_COUNT(len) /* Required const pointer to (len) valid objects (never NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a valid
-pointer to (len) const bytes of initialized data, where (len) is the name of
-another parameter.
-@param len The parameter that contains the number of bytes in the array.
-*/
-#ifdef _In_bytecount_
-#define LSX_PARAM_IN_BYTECOUNT(len) _In_bytecount_(len) /* Required const pointer to (len) bytes of data (never NULL). */
-#else
-#define LSX_PARAM_IN_BYTECOUNT(len) /* Required const pointer to (len) bytes of data (never NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is either NULL
-or a valid pointer to one const element of the pointed-to type.
-*/
-#ifdef _In_opt_
-#define LSX_PARAM_IN_OPT _In_opt_ /* Optional const pointer to a valid object (may be NULL). */
-#else
-#define LSX_PARAM_IN_OPT /* Optional const pointer to a valid object (may be NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is either NULL
-or a valid pointer to a const 0-terminated string.
-*/
-#ifdef _In_opt_z_
-#define LSX_PARAM_IN_OPT_Z _In_opt_z_ /* Optional const pointer to 0-terminated string (may be NULL). */
-#else
-#define LSX_PARAM_IN_OPT_Z /* Optional const pointer to 0-terminated string (may be NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a valid
-pointer to one initialized element of the pointed-to type (never NULL). The
-function may modify the element.
-*/
-#ifdef _Inout_
-#define LSX_PARAM_INOUT _Inout_ /* Required pointer to a valid object (never NULL). */
-#else
-#define LSX_PARAM_INOUT /* Required pointer to a valid object (never NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a valid
-pointer to (len) initialized elements of the pointed-to type (never NULL). The
-function may modify the elements.
-@param len The parameter that contains the number of elements in the array.
-*/
-#ifdef _Inout_count_x_
-#define LSX_PARAM_INOUT_COUNT(len) _Inout_count_x_(len) /* Required pointer to (len) valid objects (never NULL). */
-#else
-#define LSX_PARAM_INOUT_COUNT(len) /* Required pointer to (len) valid objects (never NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a valid
-pointer to memory sufficient for one element of the pointed-to type (never
-NULL). The function will initialize the element.
-*/
-#ifdef _Out_
-#define LSX_PARAM_OUT _Out_ /* Required pointer to an object to be initialized (never NULL). */
-#else
-#define LSX_PARAM_OUT /* Required pointer to an object to be initialized (never NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a valid
-pointer to memory sufficient for (len) bytes of data (never NULL), where (len)
-is the name of another parameter. The function may write up to len bytes of
-data to this memory.
-@param len The parameter that contains the number of bytes in the array.
-*/
-#ifdef _Out_bytecap_
-#define LSX_PARAM_OUT_BYTECAP(len) _Out_bytecap_(len) /* Required pointer to writable buffer with room for len bytes. */
-#else
-#define LSX_PARAM_OUT_BYTECAP(len) /* Required pointer to writable buffer with room for len bytes. */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a valid
-pointer to memory sufficient for (len) elements of the pointed-to type (never
-NULL), where (len) is the name of another parameter. On return, (filled)
-elements will have been initialized, where (filled) is either the dereference
-of another pointer parameter (for example "*written") or the "return"
-parameter (indicating that the function returns the number of elements
-written).
-@param len The parameter that contains the number of elements in the array.
-@param filled The dereference of the parameter that receives the number of elements written to the array, or "return" if the value is returned.
-*/
-#ifdef _Out_cap_post_count_
-#define LSX_PARAM_OUT_CAP_POST_COUNT(len,filled) _Out_cap_post_count_(len,filled) /* Required pointer to buffer for (len) elements (never NULL); on return, (filled) elements will have been initialized. */
-#else
-#define LSX_PARAM_OUT_CAP_POST_COUNT(len,filled) /* Required pointer to buffer for (len) elements (never NULL); on return, (filled) elements will have been initialized. */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a valid
-pointer to memory sufficient for (len) elements of the pointed-to type (never
-NULL), where (len) is the name of another parameter. On return, (filled+1)
-elements will have been initialized, with the last element having been
-initialized to 0, where (filled) is either the dereference of another pointer
-parameter (for example, "*written") or the "return" parameter (indicating that
-the function returns the number of elements written).
-@param len The parameter that contains the number of elements in the array.
-@param filled The dereference of the parameter that receives the number of elements written to the array (not counting the terminating null), or "return" if the value is returned.
-*/
-#ifdef _Out_z_cap_post_count_
-#define LSX_PARAM_OUT_Z_CAP_POST_COUNT(len,filled) _Out_z_cap_post_count_(len,filled) /* Required pointer to buffer for (len) elements (never NULL); on return, (filled+1) elements will have been initialized, and the array will be 0-terminated. */
-#else
-#define LSX_PARAM_OUT_Z_CAP_POST_COUNT(len,filled) /* Required pointer to buffer for (len) elements (never NULL); on return, (filled+1) elements will have been initialized, and the array will be 0-terminated. */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is either NULL
-or a valid pointer to memory sufficient for one element of the pointed-to
-type. The function will initialize the element.
-*/
-#ifdef _Out_opt_
-#define LSX_PARAM_OUT_OPT _Out_opt_ /* Optional pointer to an object to be initialized (may be NULL). */
-#else
-#define LSX_PARAM_OUT_OPT /* Optional pointer to an object to be initialized (may be NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a valid
-pointer (never NULL) to another pointer which may be NULL when the function is
-invoked.
-*/
-#ifdef _Deref_pre_maybenull_
-#define LSX_PARAM_DEREF_PRE_MAYBENULL _Deref_pre_maybenull_ /* Required pointer (never NULL) to another pointer (may be NULL). */
-#else
-#define LSX_PARAM_DEREF_PRE_MAYBENULL /* Required pointer (never NULL) to another pointer (may be NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a valid
-pointer (never NULL) to another pointer which will be NULL when the function
-returns.
-*/
-#ifdef _Deref_post_null_
-#define LSX_PARAM_DEREF_POST_NULL _Deref_post_null_ /* Required pointer (never NULL) to another pointer, which will be NULL on exit. */
-#else
-#define LSX_PARAM_DEREF_POST_NULL /* Required pointer (never NULL) to another pointer, which will be NULL on exit. */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a valid
-pointer (never NULL) to another pointer which will be non-NULL when the
-function returns.
-*/
-#ifdef _Deref_post_notnull_
-#define LSX_PARAM_DEREF_POST_NOTNULL _Deref_post_notnull_ /* Required pointer (never NULL) to another pointer, which will be valid (not NULL) on exit. */
-#else
-#define LSX_PARAM_DEREF_POST_NOTNULL /* Required pointer (never NULL) to another pointer, which will be valid (not NULL) on exit. */
-#endif
-
-/**
-Plugins API:
-Expression that "uses" a potentially-unused variable to avoid compiler
-warnings (especially in macro-generated code).
-*/
-#ifdef _PREFAST_
-#define LSX_USE_VAR(x)  ((void)(x=0)) /* During static analysis, initialize unused variables to 0. */
-#else
-#define LSX_USE_VAR(x)  ((void)(x)) /* Parameter or variable is intentionally unused. */
-#endif
-
-/**
-Plugins API:
-Compile-time assertion. Causes a compile error if the expression is false.
-@param e  The expression to test. If expression is false, compilation will fail.
-@param f  A unique identifier for the test, for example foo_must_not_be_zero.
-*/
-#define lsx_static_assert(e,f) enum {lsx_static_assert_##f = 1/((e) ? 1 : 0)}
-
-/*****************************************************************************
-Basic typedefs:
-*****************************************************************************/
-
-/**
-Client API:
-Signed twos-complement 8-bit type. Typically defined as signed char.
-*/
-#if SCHAR_MAX==127 && SCHAR_MIN==(-128)
-typedef signed char sox_int8_t;
-#elif CHAR_MAX==127 && CHAR_MIN==(-128)
-typedef char sox_int8_t;
-#else
-#error Unable to determine an appropriate definition for sox_int8_t.
-#endif
-
-/**
-Client API:
-Unsigned 8-bit type. Typically defined as unsigned char.
-*/
-#if UCHAR_MAX==0xff
-typedef unsigned char sox_uint8_t;
-#elif CHAR_MAX==0xff && CHAR_MIN==0
-typedef char sox_uint8_t;
-#else
-#error Unable to determine an appropriate definition for sox_uint8_t.
-#endif
-
-/**
-Client API:
-Signed twos-complement 16-bit type. Typically defined as short.
-*/
-#if SHRT_MAX==32767 && SHRT_MIN==(-32768)
-typedef short sox_int16_t;
-#elif INT_MAX==32767 && INT_MIN==(-32768)
-typedef int sox_int16_t;
-#else
-#error Unable to determine an appropriate definition for sox_int16_t.
-#endif
-
-/**
-Client API:
-Unsigned 16-bit type. Typically defined as unsigned short.
-*/
-#if USHRT_MAX==0xffff
-typedef unsigned short sox_uint16_t;
-#elif UINT_MAX==0xffff
-typedef unsigned int sox_uint16_t;
-#else
-#error Unable to determine an appropriate definition for sox_uint16_t.
-#endif
-
-/**
-Client API:
-Signed twos-complement 32-bit type. Typically defined as int.
-*/
-#if INT_MAX==2147483647 && INT_MIN==(-2147483647-1)
-typedef int sox_int32_t;
-#elif LONG_MAX==2147483647 && LONG_MIN==(-2147483647-1)
-typedef long sox_int32_t;
-#else
-#error Unable to determine an appropriate definition for sox_int32_t.
-#endif
-
-/**
-Client API:
-Unsigned 32-bit type. Typically defined as unsigned int.
-*/
-#if UINT_MAX==0xffffffff
-typedef unsigned int sox_uint32_t;
-#elif ULONG_MAX==0xffffffff
-typedef unsigned long sox_uint32_t;
-#else
-#error Unable to determine an appropriate definition for sox_uint32_t.
-#endif
-
-/**
-Client API:
-Signed twos-complement 64-bit type. Typically defined as long or long long.
-*/
-#if LONG_MAX==9223372036854775807 && LONG_MIN==(-9223372036854775807-1)
-typedef long sox_int64_t;
-#elif defined(_MSC_VER)
-typedef __int64 sox_int64_t;
-#else
-typedef long long sox_int64_t;
-#endif
-
-/**
-Client API:
-Unsigned 64-bit type. Typically defined as unsigned long or unsigned long long.
-*/
-#if ULONG_MAX==0xffffffffffffffff
-typedef unsigned long sox_uint64_t;
-#elif defined(_MSC_VER)
-typedef unsigned __int64 sox_uint64_t;
-#else
-typedef unsigned long long sox_uint64_t;
-#endif
-
-#ifndef _DOXYGEN_
-lsx_static_assert(sizeof(sox_int8_t)==1,   sox_int8_size);
-lsx_static_assert(sizeof(sox_uint8_t)==1,  sox_uint8_size);
-lsx_static_assert(sizeof(sox_int16_t)==2,  sox_int16_size);
-lsx_static_assert(sizeof(sox_uint16_t)==2, sox_uint16_size);
-lsx_static_assert(sizeof(sox_int32_t)==4,  sox_int32_size);
-lsx_static_assert(sizeof(sox_uint32_t)==4, sox_uint32_size);
-lsx_static_assert(sizeof(sox_int64_t)==8,  sox_int64_size);
-lsx_static_assert(sizeof(sox_uint64_t)==8, sox_uint64_size);
-#endif
-
-/**
-Client API:
-Alias for sox_int32_t (beware of the extra byte).
-*/
-typedef sox_int32_t sox_int24_t;
-
-/**
-Client API:
-Alias for sox_uint32_t (beware of the extra byte).
-*/
-typedef sox_uint32_t sox_uint24_t;
-
-/**
-Client API:
-Native SoX audio sample type (alias for sox_int32_t).
-*/
-typedef sox_int32_t sox_sample_t;
-
-/**
-Client API:
-Samples per second is stored as a double.
-*/
-typedef double sox_rate_t;
-
-/**
-Client API:
-File's metadata, access via sox_*_comments functions.
-*/
-typedef char * * sox_comments_t;
-
-/*****************************************************************************
-Enumerations:
-*****************************************************************************/
-
-/**
-Client API:
-Boolean type, assignment (but not necessarily binary) compatible with C++ bool.
-*/
-typedef enum sox_bool {
-    sox_false, /**< False = 0. */
-    sox_true   /**< True = 1. */
-} sox_bool;
-
-/**
-Client API:
-no, yes, or default (default usually implies some kind of auto-detect logic).
-*/
-typedef enum sox_option_t {
-    sox_option_no,      /**< Option specified as no = 0. */
-    sox_option_yes,     /**< Option specified as yes = 1. */
-    sox_option_default  /**< Option unspecified = 2. */
-} sox_option_t;
-
-/**
-Client API:
-The libSoX-specific error codes.
-libSoX functions may return these codes or others that map from errno codes.
-*/
-enum sox_error_t {
-  SOX_SUCCESS = 0,     /**< Function succeeded = 0 */
-  SOX_EOF = -1,        /**< End Of File or other error = -1 */
-  SOX_EHDR = 2000,     /**< Invalid Audio Header = 2000 */
-  SOX_EFMT,            /**< Unsupported data format = 2001 */
-  SOX_ENOMEM,          /**< Can't alloc memory = 2002 */
-  SOX_EPERM,           /**< Operation not permitted = 2003 */
-  SOX_ENOTSUP,         /**< Operation not supported = 2004 */
-  SOX_EINVAL           /**< Invalid argument = 2005 */
-};
-
-/**
-Client API:
-Flags indicating whether optional features are present in this build of libSoX.
-*/
-typedef enum sox_version_flags_t {
-    sox_version_none = 0,         /**< No special features = 0. */
-    sox_version_have_popen = 1,   /**< popen = 1. */
-    sox_version_have_magic = 2,   /**< magic = 2. */
-    sox_version_have_threads = 4, /**< threads = 4. */
-    sox_version_have_memopen = 8  /**< memopen = 8. */
-} sox_version_flags_t;
-
-/**
-Client API:
-Format of sample data.
-*/
-typedef enum sox_encoding_t {
-  SOX_ENCODING_UNKNOWN   , /**< encoding has not yet been determined */
-
-  SOX_ENCODING_SIGN2     , /**< signed linear 2's comp: Mac */
-  SOX_ENCODING_UNSIGNED  , /**< unsigned linear: Sound Blaster */
-  SOX_ENCODING_FLOAT     , /**< floating point (binary format) */
-  SOX_ENCODING_FLOAT_TEXT, /**< floating point (text format) */
-  SOX_ENCODING_FLAC      , /**< FLAC compression */
-  SOX_ENCODING_HCOM      , /**< Mac FSSD files with Huffman compression */
-  SOX_ENCODING_WAVPACK   , /**< WavPack with integer samples */
-  SOX_ENCODING_WAVPACKF  , /**< WavPack with float samples */
-  SOX_ENCODING_ULAW      , /**< u-law signed logs: US telephony, SPARC */
-  SOX_ENCODING_ALAW      , /**< A-law signed logs: non-US telephony, Psion */
-  SOX_ENCODING_G721      , /**< G.721 4-bit ADPCM */
-  SOX_ENCODING_G723      , /**< G.723 3 or 5 bit ADPCM */
-  SOX_ENCODING_CL_ADPCM  , /**< Creative Labs 8 --> 2,3,4 bit Compressed PCM */
-  SOX_ENCODING_CL_ADPCM16, /**< Creative Labs 16 --> 4 bit Compressed PCM */
-  SOX_ENCODING_MS_ADPCM  , /**< Microsoft Compressed PCM */
-  SOX_ENCODING_IMA_ADPCM , /**< IMA Compressed PCM */
-  SOX_ENCODING_OKI_ADPCM , /**< Dialogic/OKI Compressed PCM */
-  SOX_ENCODING_DPCM      , /**< Differential PCM: Fasttracker 2 (xi) */
-  SOX_ENCODING_DWVW      , /**< Delta Width Variable Word */
-  SOX_ENCODING_DWVWN     , /**< Delta Width Variable Word N-bit */
-  SOX_ENCODING_GSM       , /**< GSM 6.10 33byte frame lossy compression */
-  SOX_ENCODING_MP3       , /**< MP3 compression */
-  SOX_ENCODING_VORBIS    , /**< Vorbis compression */
-  SOX_ENCODING_AMR_WB    , /**< AMR-WB compression */
-  SOX_ENCODING_AMR_NB    , /**< AMR-NB compression */
-  SOX_ENCODING_CVSD      , /**< Continuously Variable Slope Delta modulation */
-  SOX_ENCODING_LPC10     , /**< Linear Predictive Coding */
-
-  SOX_ENCODINGS            /**< End of list marker */
-} sox_encoding_t;
-
-/**
-Client API:
-Flags for sox_encodings_info_t: lossless/lossy1/lossy2.
-*/
-typedef enum sox_encodings_flags_t {
-  sox_encodings_none   = 0, /**< no flags specified (implies lossless encoding) = 0. */
-  sox_encodings_lossy1 = 1, /**< encode, decode: lossy once = 1. */
-  sox_encodings_lossy2 = 2  /**< encode, decode, encode, decode: lossy twice = 2. */
-} sox_encodings_flags_t;
-
-/**
-Client API:
-Type of plot.
-*/
-typedef enum sox_plot_t {
-    sox_plot_off,     /**< No plot = 0. */
-    sox_plot_octave,  /**< Octave plot = 1. */
-    sox_plot_gnuplot, /**< Gnuplot plot = 2. */
-    sox_plot_data     /**< Plot data = 3. */
-} sox_plot_t;
-
-/**
-Client API:
-Loop modes: upper 4 bits mask the loop blass, lower 4 bits describe
-the loop behaviour, for example single shot, bidirectional etc.
-*/
-enum sox_loop_flags_t {
-  sox_loop_none = 0,          /**< single-shot = 0 */
-  sox_loop_forward = 1,       /**< forward loop = 1 */
-  sox_loop_forward_back = 2,  /**< forward/back loop = 2 */
-  sox_loop_8 = 32,            /**< 8 loops (??) = 32 */
-  sox_loop_sustain_decay = 64 /**< AIFF style, one sustain & one decay loop = 64 */
-};
-
-/**
-Plugins API:
-Is file a real file, a pipe, or a url?
-*/
-typedef enum lsx_io_type
-{
-    lsx_io_file, /**< File is a real file = 0. */
-    lsx_io_pipe, /**< File is a pipe (no seeking) = 1. */
-    lsx_io_url   /**< File is a URL (no seeking) = 2. */
-} lsx_io_type;
-
-/*****************************************************************************
-Macros:
-*****************************************************************************/
-
-/**
-Client API:
-Compute a 32-bit integer API version from three 8-bit parts.
-@param a Major version.
-@param b Minor version.
-@param c Revision or build number.
-@returns 32-bit integer API version 0x000a0b0c.
-*/
-#define SOX_LIB_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
-
-/**
-Client API:
-The API version of the sox.h file. It is not meant to follow the version
-number of SoX but it has historically. Please do not count on
-SOX_LIB_VERSION_CODE staying in sync with the libSoX version.
-*/
-#define SOX_LIB_VERSION_CODE   SOX_LIB_VERSION(14, 4, 0)
-
-/**
-Client API:
-Returns the smallest (negative) value storable in a twos-complement signed
-integer with the specified number of bits, cast to an unsigned integer;
-for example, SOX_INT_MIN(8) = 0x80, SOX_INT_MIN(16) = 0x8000, etc.
-@param bits Size of value for which to calculate minimum.
-@returns the smallest (negative) value storable in a twos-complement signed
-integer with the specified number of bits, cast to an unsigned integer.
-*/
-#define SOX_INT_MIN(bits) (1 <<((bits)-1))
-
-/**
-Client API:
-Returns the largest (positive) value storable in a twos-complement signed
-integer with the specified number of bits, cast to an unsigned integer;
-for example, SOX_INT_MAX(8) = 0x7F, SOX_INT_MAX(16) = 0x7FFF, etc.
-@param bits Size of value for which to calculate maximum.
-@returns the largest (positive) value storable in a twos-complement signed
-integer with the specified number of bits, cast to an unsigned integer.
-*/
-#define SOX_INT_MAX(bits) (((unsigned)-1)>>(33-(bits)))
-
-/**
-Client API:
-Returns the largest value storable in an unsigned integer with the specified
-number of bits; for example, SOX_UINT_MAX(8) = 0xFF,
-SOX_UINT_MAX(16) = 0xFFFF, etc.
-@param bits Size of value for which to calculate maximum.
-@returns the largest value storable in an unsigned integer with the specified
-number of bits.
-*/
-#define SOX_UINT_MAX(bits) (SOX_INT_MIN(bits)|SOX_INT_MAX(bits))
-
-/**
-Client API:
-Returns 0x7F.
-*/
-#define SOX_INT8_MAX  SOX_INT_MAX(8)
-
-/**
-Client API:
-Returns 0x7FFF.
-*/
-#define SOX_INT16_MAX SOX_INT_MAX(16)
-
-/**
-Client API:
-Returns 0x7FFFFF.
-*/
-#define SOX_INT24_MAX SOX_INT_MAX(24)
-
-/**
-Client API:
-Returns 0x7FFFFFFF.
-*/
-#define SOX_INT32_MAX SOX_INT_MAX(32)
-
-/**
-Client API:
-Bits in a sox_sample_t = 32.
-*/
-#define SOX_SAMPLE_PRECISION 32
-
-/**
-Client API:
-Max value for sox_sample_t = 0x7FFFFFFF.
-*/
-#define SOX_SAMPLE_MAX (sox_sample_t)SOX_INT_MAX(32)
-
-/**
-Client API:
-Min value for sox_sample_t = 0x80000000.
-*/
-#define SOX_SAMPLE_MIN (sox_sample_t)SOX_INT_MIN(32)
-
-
-/*                Conversions: Linear PCM <--> sox_sample_t
- *
- *   I/O      Input    sox_sample_t Clips?   Input    sox_sample_t Clips?
- *  Format   Minimum     Minimum     I O    Maximum     Maximum     I O
- *  ------  ---------  ------------ -- --   --------  ------------ -- --
- *  Float     -inf         -1        y n      inf      1 - 5e-10    y n
- *  Int8      -128        -128       n n      127     127.9999999   n y
- *  Int16    -32768      -32768      n n     32767    32767.99998   n y
- *  Int24   -8388608    -8388608     n n    8388607   8388607.996   n y
- *  Int32  -2147483648 -2147483648   n n   2147483647 2147483647    n n
- *
- * Conversions are as accurate as possible (with rounding).
- *
- * Rounding: halves toward +inf, all others to nearest integer.
- *
- * Clips? shows whether on not there is the possibility of a conversion
- * clipping to the minimum or maximum value when inputing from or outputing
- * to a given type.
- *
- * Unsigned integers are converted to and from signed integers by flipping
- * the upper-most bit then treating them as signed integers.
- */
-
-/**
-Client API:
-Declares the temporary local variables that are required when using SOX
-conversion macros.
-*/
-#define SOX_SAMPLE_LOCALS sox_sample_t sox_macro_temp_sample LSX_UNUSED; \
-  double sox_macro_temp_double LSX_UNUSED
-
-/**
-Client API:
-Sign bit for sox_sample_t = 0x80000000.
-*/
-#define SOX_SAMPLE_NEG SOX_INT_MIN(32)
-
-/**
-Client API:
-Converts sox_sample_t to an unsigned integer of width (bits).
-@param bits  Width of resulting sample (1 through 32).
-@param d     Input sample to be converted.
-@param clips Variable that is incremented if the result is too big.
-@returns Unsigned integer of width (bits).
-*/
-#define SOX_SAMPLE_TO_UNSIGNED(bits,d,clips) \
-  (sox_uint##bits##_t)(SOX_SAMPLE_TO_SIGNED(bits,d,clips)^SOX_INT_MIN(bits))
-
-/**
-Client API:
-Converts sox_sample_t to a signed integer of width (bits).
-@param bits  Width of resulting sample (1 through 32).
-@param d     Input sample to be converted.
-@param clips Variable that is incremented if the result is too big.
-@returns Signed integer of width (bits).
-*/
-#define SOX_SAMPLE_TO_SIGNED(bits,d,clips) \
-  (sox_int##bits##_t)(LSX_USE_VAR(sox_macro_temp_double),sox_macro_temp_sample=(d),sox_macro_temp_sample>SOX_SAMPLE_MAX-(1<<(31-bits))?++(clips),SOX_INT_MAX(bits):((sox_uint32_t)(sox_macro_temp_sample+(1<<(31-bits))))>>(32-bits))
-
-/**
-Client API:
-Converts signed integer of width (bits) to sox_sample_t.
-@param bits Width of input sample (1 through 32).
-@param d    Input sample to be converted.
-@returns SoX native sample value.
-*/
-#define SOX_SIGNED_TO_SAMPLE(bits,d)((sox_sample_t)(d)<<(32-bits))
-
-/**
-Client API:
-Converts unsigned integer of width (bits) to sox_sample_t.
-@param bits Width of input sample (1 through 32).
-@param d    Input sample to be converted.
-@returns SoX native sample value.
-*/
-#define SOX_UNSIGNED_TO_SAMPLE(bits,d)(SOX_SIGNED_TO_SAMPLE(bits,d)^SOX_SAMPLE_NEG)
-
-/**
-Client API:
-Converts unsigned 8-bit integer to sox_sample_t.
-@param d     Input sample to be converted.
-@param clips The parameter is not used.
-@returns SoX native sample value.
-*/
-#define SOX_UNSIGNED_8BIT_TO_SAMPLE(d,clips) SOX_UNSIGNED_TO_SAMPLE(8,d)
-
-/**
-Client API:
-Converts signed 8-bit integer to sox_sample_t.
-@param d    Input sample to be converted.
-@param clips The parameter is not used.
-@returns SoX native sample value.
-*/
-#define SOX_SIGNED_8BIT_TO_SAMPLE(d,clips) SOX_SIGNED_TO_SAMPLE(8,d)
-
-/**
-Client API:
-Converts unsigned 16-bit integer to sox_sample_t.
-@param d     Input sample to be converted.
-@param clips The parameter is not used.
-@returns SoX native sample value.
-*/
-#define SOX_UNSIGNED_16BIT_TO_SAMPLE(d,clips) SOX_UNSIGNED_TO_SAMPLE(16,d)
-
-/**
-Client API:
-Converts signed 16-bit integer to sox_sample_t.
-@param d    Input sample to be converted.
-@param clips The parameter is not used.
-@returns SoX native sample value.
-*/
-#define SOX_SIGNED_16BIT_TO_SAMPLE(d,clips) SOX_SIGNED_TO_SAMPLE(16,d)
-
-/**
-Client API:
-Converts unsigned 24-bit integer to sox_sample_t.
-@param d     Input sample to be converted.
-@param clips The parameter is not used.
-@returns SoX native sample value.
-*/
-#define SOX_UNSIGNED_24BIT_TO_SAMPLE(d,clips) SOX_UNSIGNED_TO_SAMPLE(24,d)
-
-/**
-Client API:
-Converts signed 24-bit integer to sox_sample_t.
-@param d    Input sample to be converted.
-@param clips The parameter is not used.
-@returns SoX native sample value.
-*/
-#define SOX_SIGNED_24BIT_TO_SAMPLE(d,clips) SOX_SIGNED_TO_SAMPLE(24,d)
-
-/**
-Client API:
-Converts unsigned 32-bit integer to sox_sample_t.
-@param d     Input sample to be converted.
-@param clips The parameter is not used.
-@returns SoX native sample value.
-*/
-#define SOX_UNSIGNED_32BIT_TO_SAMPLE(d,clips) ((sox_sample_t)(d)^SOX_SAMPLE_NEG)
-
-/**
-Client API:
-Converts signed 32-bit integer to sox_sample_t.
-@param d    Input sample to be converted.
-@param clips The parameter is not used.
-@returns SoX native sample value.
-*/
-#define SOX_SIGNED_32BIT_TO_SAMPLE(d,clips) (sox_sample_t)(d)
-
-/**
-Client API:
-Converts 32-bit float to sox_sample_t.
-@param d     Input sample to be converted, range [-1, 1).
-@param clips Variable to increment if the input sample is too large or too small.
-@returns SoX native sample value.
-*/
-#define SOX_FLOAT_32BIT_TO_SAMPLE(d,clips) (sox_sample_t)(LSX_USE_VAR(sox_macro_temp_sample),sox_macro_temp_double=(d)*(SOX_SAMPLE_MAX+1.),sox_macro_temp_double<SOX_SAMPLE_MIN?++(clips),SOX_SAMPLE_MIN:sox_macro_temp_double>=SOX_SAMPLE_MAX+1.?sox_macro_temp_double>SOX_SAMPLE_MAX+1.?++(clips),SOX_SAMPLE_MAX:SOX_SAMPLE_MAX:sox_macro_temp_double)
-
-/**
-Client API:
-Converts 64-bit float to sox_sample_t.
-@param d     Input sample to be converted, range [-1, 1).
-@param clips Variable to increment if the input sample is too large or too small.
-@returns SoX native sample value.
-*/
-#define SOX_FLOAT_64BIT_TO_SAMPLE(d,clips) (sox_sample_t)(LSX_USE_VAR(sox_macro_temp_sample),sox_macro_temp_double=(d)*(SOX_SAMPLE_MAX+1.),sox_macro_temp_double<0?sox_macro_temp_double<=SOX_SAMPLE_MIN-.5?++(clips),SOX_SAMPLE_MIN:sox_macro_temp_double-.5:sox_macro_temp_double>=SOX_SAMPLE_MAX+.5?sox_macro_temp_double>SOX_SAMPLE_MAX+1.?++(clips),SOX_SAMPLE_MAX:SOX_SAMPLE_MAX:sox_macro_temp_double+.5)
-
-/**
-Client API:
-Converts SoX native sample to an unsigned 8-bit integer.
-@param d Input sample to be converted.
-@param clips Variable to increment if input sample is too large.
-*/
-#define SOX_SAMPLE_TO_UNSIGNED_8BIT(d,clips) SOX_SAMPLE_TO_UNSIGNED(8,d,clips)
-
-/**
-Client API:
-Converts SoX native sample to an signed 8-bit integer.
-@param d Input sample to be converted.
-@param clips Variable to increment if input sample is too large.
-*/
-#define SOX_SAMPLE_TO_SIGNED_8BIT(d,clips) SOX_SAMPLE_TO_SIGNED(8,d,clips)
-
-/**
-Client API:
-Converts SoX native sample to an unsigned 16-bit integer.
-@param d Input sample to be converted.
-@param clips Variable to increment if input sample is too large.
-*/
-#define SOX_SAMPLE_TO_UNSIGNED_16BIT(d,clips) SOX_SAMPLE_TO_UNSIGNED(16,d,clips)
-
-/**
-Client API:
-Converts SoX native sample to a signed 16-bit integer.
-@param d Input sample to be converted.
-@param clips Variable to increment if input sample is too large.
-*/
-#define SOX_SAMPLE_TO_SIGNED_16BIT(d,clips) SOX_SAMPLE_TO_SIGNED(16,d,clips)
-
-/**
-Client API:
-Converts SoX native sample to an unsigned 24-bit integer.
-@param d Input sample to be converted.
-@param clips Variable to increment if input sample is too large.
-*/
-#define SOX_SAMPLE_TO_UNSIGNED_24BIT(d,clips) SOX_SAMPLE_TO_UNSIGNED(24,d,clips)
-
-/**
-Client API:
-Converts SoX native sample to a signed 24-bit integer.
-@param d Input sample to be converted.
-@param clips Variable to increment if input sample is too large.
-*/
-#define SOX_SAMPLE_TO_SIGNED_24BIT(d,clips) SOX_SAMPLE_TO_SIGNED(24,d,clips)
-
-/**
-Client API:
-Converts SoX native sample to an unsigned 32-bit integer.
-@param d Input sample to be converted.
-@param clips The parameter is not used.
-*/
-#define SOX_SAMPLE_TO_UNSIGNED_32BIT(d,clips) (sox_uint32_t)((d)^SOX_SAMPLE_NEG)
-
-/**
-Client API:
-Converts SoX native sample to a signed 32-bit integer.
-@param d Input sample to be converted.
-@param clips The parameter is not used.
-*/
-#define SOX_SAMPLE_TO_SIGNED_32BIT(d,clips) (sox_int32_t)(d)
-
-/**
-Client API:
-Converts SoX native sample to a 32-bit float.
-@param d Input sample to be converted.
-@param clips Variable to increment if input sample is too large.
-*/
-#define SOX_SAMPLE_TO_FLOAT_32BIT(d,clips) (LSX_USE_VAR(sox_macro_temp_double),sox_macro_temp_sample=(d),sox_macro_temp_sample>SOX_SAMPLE_MAX-128?++(clips),1:(((sox_macro_temp_sample+128)&~255)*(1./(SOX_SAMPLE_MAX+1.))))
-
-/**
-Client API:
-Converts SoX native sample to a 64-bit float.
-@param d Input sample to be converted.
-@param clips The parameter is not used.
-*/
-#define SOX_SAMPLE_TO_FLOAT_64BIT(d,clips) ((d)*(1./(SOX_SAMPLE_MAX+1.)))
-
-/**
-Client API:
-Clips a value of a type that is larger then sox_sample_t (for example, int64)
-to sox_sample_t's limits and increment a counter if clipping occurs.
-@param samp Value (lvalue) to be clipped, updated as necessary.
-@param clips Value (lvalue) that is incremented if clipping is needed.
-*/
-#define SOX_SAMPLE_CLIP_COUNT(samp, clips) \
-  do { \
-    if (samp > SOX_SAMPLE_MAX) \
-      { samp = SOX_SAMPLE_MAX; clips++; } \
-    else if (samp < SOX_SAMPLE_MIN) \
-      { samp = SOX_SAMPLE_MIN; clips++; } \
-  } while (0)
-
-/**
-Client API:
-Clips a value of a type that is larger then sox_sample_t (for example, int64)
-to sox_sample_t's limits and increment a counter if clipping occurs.
-@param d Value (rvalue) to be clipped.
-@param clips Value (lvalue) that is incremented if clipping is needed.
-@returns Clipped value.
-*/
-#define SOX_ROUND_CLIP_COUNT(d, clips) \
-  ((d) < 0? (d) <= SOX_SAMPLE_MIN - 0.5? ++(clips), SOX_SAMPLE_MIN: (d) - 0.5 \
-        : (d) >= SOX_SAMPLE_MAX + 0.5? ++(clips), SOX_SAMPLE_MAX: (d) + 0.5)
-
-/**
-Client API:
-Clips a value to the limits of a signed integer of the specified width
-and increment a counter if clipping occurs.
-@param bits Width (in bits) of target integer type.
-@param i Value (rvalue) to be clipped.
-@param clips Value (lvalue) that is incremented if clipping is needed.
-@returns Clipped value.
-*/
-#define SOX_INTEGER_CLIP_COUNT(bits,i,clips) ( \
-  (i) >(1 << ((bits)-1))- 1? ++(clips),(1 << ((bits)-1))- 1 : \
-  (i) <-1 << ((bits)-1)    ? ++(clips),-1 << ((bits)-1) : (i))
-
-/**
-Client API:
-Clips a value to the limits of a 16-bit signed integer and increment a counter
-if clipping occurs.
-@param i Value (rvalue) to be clipped.
-@param clips Value (lvalue) that is incremented if clipping is needed.
-@returns Clipped value.
-*/
-#define SOX_16BIT_CLIP_COUNT(i,clips) SOX_INTEGER_CLIP_COUNT(16,i,clips)
-
-/**
-Client API:
-Clips a value to the limits of a 24-bit signed integer and increment a counter
-if clipping occurs.
-@param i Value (rvalue) to be clipped.
-@param clips Value (lvalue) that is incremented if clipping is needed.
-@returns Clipped value.
-*/
-#define SOX_24BIT_CLIP_COUNT(i,clips) SOX_INTEGER_CLIP_COUNT(24,i,clips)
-
-#define SOX_SIZE_MAX ((size_t)(-1)) /**< Client API: Maximum value of size_t. */
-
-#define SOX_UNSPEC 0                         /**< Client API: Members of sox_signalinfo_t are set to SOX_UNSPEC (= 0) if the actual value is not yet known. */
-#define SOX_UNKNOWN_LEN (sox_uint64_t)(-1) /**< Client API: sox_signalinfo_t.length is set to SOX_UNKNOWN_LEN (= -1) within the effects chain if the actual length is not known. Format handlers currently use SOX_UNSPEC instead. */
-#define SOX_IGNORE_LENGTH (sox_uint64_t)(-2) /**< Client API: sox_signalinfo_t.length is set to SOX_IGNORE_LENGTH (= -2) to indicate that a format handler should ignore length information in file headers. */
-
-#define SOX_DEFAULT_CHANNELS  2     /**< Client API: Default channel count is 2 (stereo). */
-#define SOX_DEFAULT_RATE      48000 /**< Client API: Default rate is 48000Hz. */
-#define SOX_DEFAULT_PRECISION 16    /**< Client API: Default precision is 16 bits per sample. */
-#define SOX_DEFAULT_ENCODING  SOX_ENCODING_SIGN2 /**< Client API: Default encoding is SIGN2 (linear 2's complement PCM). */
-
-#define SOX_LOOP_NONE          ((unsigned char)sox_loop_none)          /**< Client API: single-shot = 0 */
-#define SOX_LOOP_8             ((unsigned char)sox_loop_8)             /**< Client API: 8 loops = 32 */
-#define SOX_LOOP_SUSTAIN_DECAY ((unsigned char)sox_loop_sustain_decay) /**< Client API: AIFF style, one sustain & one decay loop = 64 */
-
-#define SOX_MAX_NLOOPS         8 /**< Client API: Maximum number of loops supported by sox_oob_t = 8. */
-
-#define SOX_FILE_NOSTDIO 0x0001 /**< Client API: Does not use stdio routines */
-#define SOX_FILE_DEVICE  0x0002 /**< Client API: File is an audio device */
-#define SOX_FILE_PHONY   0x0004 /**< Client API: Phony file/device (for example /dev/null) */
-#define SOX_FILE_REWIND  0x0008 /**< Client API: File should be rewound to write header */
-#define SOX_FILE_BIT_REV 0x0010 /**< Client API: Is file bit-reversed? */
-#define SOX_FILE_NIB_REV 0x0020 /**< Client API: Is file nibble-reversed? */
-#define SOX_FILE_ENDIAN  0x0040 /**< Client API: Is file format endian? */
-#define SOX_FILE_ENDBIG  0x0080 /**< Client API: For endian file format, is it big endian? */
-#define SOX_FILE_MONO    0x0100 /**< Client API: Do channel restrictions allow mono? */
-#define SOX_FILE_STEREO  0x0200 /**< Client API: Do channel restrictions allow stereo? */
-#define SOX_FILE_QUAD    0x0400 /**< Client API: Do channel restrictions allow quad? */
-
-#define SOX_FILE_CHANS   (SOX_FILE_MONO | SOX_FILE_STEREO | SOX_FILE_QUAD) /**< Client API: No channel restrictions */
-#define SOX_FILE_LIT_END (SOX_FILE_ENDIAN | 0)                             /**< Client API: File is little-endian */
-#define SOX_FILE_BIG_END (SOX_FILE_ENDIAN | SOX_FILE_ENDBIG)               /**< Client API: File is big-endian */
-
-#define SOX_EFF_CHAN     1           /**< Client API: Effect might alter the number of channels */
-#define SOX_EFF_RATE     2           /**< Client API: Effect might alter sample rate */
-#define SOX_EFF_PREC     4           /**< Client API: Effect does its own calculation of output sample precision (otherwise a default value is taken, depending on the presence of SOX_EFF_MODIFY) */
-#define SOX_EFF_LENGTH   8           /**< Client API: Effect might alter audio length (as measured in time units, not necessarily in samples) */
-#define SOX_EFF_MCHAN    16          /**< Client API: Effect handles multiple channels internally */
-#define SOX_EFF_NULL     32          /**< Client API: Effect does nothing (can be optimized out of chain) */
-#define SOX_EFF_DEPRECATED 64        /**< Client API: Effect will soon be removed from SoX */
-#define SOX_EFF_GAIN     128         /**< Client API: Effect does not support gain -r */
-#define SOX_EFF_MODIFY   256         /**< Client API: Effect does not modify sample values (but might remove or duplicate samples or insert zeros) */
-#define SOX_EFF_ALPHA    512         /**< Client API: Effect is experimental/incomplete */
-#define SOX_EFF_INTERNAL 1024        /**< Client API: Effect present in libSoX but not valid for use by SoX command-line tools */
-
-/**
-Client API:
-When used as the "whence" parameter of sox_seek, indicates that the specified
-offset is relative to the beginning of the file.
-*/
-#define SOX_SEEK_SET 0
-
-/*****************************************************************************
-Forward declarations:
-*****************************************************************************/
-
-typedef struct sox_format_t sox_format_t;
-typedef struct sox_effect_t sox_effect_t;
-typedef struct sox_effect_handler_t sox_effect_handler_t;
-typedef struct sox_format_handler_t sox_format_handler_t;
-
-/*****************************************************************************
-Function pointers:
-*****************************************************************************/
-
-/**
-Client API:
-Callback to write a message to an output device (console or log file),
-used by sox_globals_t.output_message_handler.
-*/
-typedef void (LSX_API * sox_output_message_handler_t)(
-    unsigned level,                       /* 1 = FAIL, 2 = WARN, 3 = INFO, 4 = DEBUG, 5 = DEBUG_MORE, 6 = DEBUG_MOST. */
-    LSX_PARAM_IN_Z char const * filename, /* Source code __FILENAME__ from which message originates. */
-    LSX_PARAM_IN_PRINTF char const * fmt, /* Message format string. */
-    LSX_PARAM_IN va_list ap               /* Message format parameters. */
-    );
-
-/**
-Client API:
-Callback to retrieve information about a format handler,
-used by sox_format_tab_t.fn.
-@returns format handler information.
-*/
-typedef sox_format_handler_t const * (LSX_API * sox_format_fn_t)(void);
-
-/**
-Client API:
-Callback to get information about an effect handler,
-used by the table returned from sox_get_effect_fns(void).
-@returns Pointer to information about an effect handler.
-*/
-typedef sox_effect_handler_t const * (LSX_API *sox_effect_fn_t)(void);
-
-/**
-Client API:
-Callback to initialize reader (decoder), used by
-sox_format_handler.startread.
-@returns SOX_SUCCESS if successful.
-*/
-typedef int (LSX_API * sox_format_handler_startread)(
-    LSX_PARAM_INOUT sox_format_t * ft /**< Format pointer. */
-    );
-
-/**
-Client API:
-Callback to read (decode) a block of samples,
-used by sox_format_handler.read.
-@returns number of samples read, or 0 if unsuccessful.
-*/
-typedef size_t (LSX_API * sox_format_handler_read)(
-    LSX_PARAM_INOUT sox_format_t * ft, /**< Format pointer. */
-    LSX_PARAM_OUT_CAP_POST_COUNT(len,return) sox_sample_t *buf, /**< Buffer from which to read samples. */
-    size_t len /**< Number of samples available in buf. */
-    );
-
-/**
-Client API:
-Callback to close reader (decoder),
-used by sox_format_handler.stopread.
-@returns SOX_SUCCESS if successful.
-*/
-typedef int (LSX_API * sox_format_handler_stopread)(
-    LSX_PARAM_INOUT sox_format_t * ft /**< Format pointer. */
-    );
-
-/**
-Client API:
-Callback to initialize writer (encoder),
-used by sox_format_handler.startwrite.
-@returns SOX_SUCCESS if successful.
-*/
-typedef int (LSX_API * sox_format_handler_startwrite)(
-    LSX_PARAM_INOUT sox_format_t * ft /**< Format pointer. */
-    );
-
-/**
-Client API:
-Callback to write (encode) a block of samples,
-used by sox_format_handler.write.
-@returns number of samples written, or 0 if unsuccessful.
-*/
-typedef size_t (LSX_API * sox_format_handler_write)(
-    LSX_PARAM_INOUT sox_format_t * ft, /**< Format pointer. */
-    LSX_PARAM_IN_COUNT(len) sox_sample_t const * buf, /**< Buffer to which samples are written. */
-    size_t len /**< Capacity of buf, measured in samples. */
-    );
-
-/**
-Client API:
-Callback to close writer (decoder),
-used by sox_format_handler.stopwrite.
-@returns SOX_SUCCESS if successful.
-*/
-typedef int (LSX_API * sox_format_handler_stopwrite)(
-    LSX_PARAM_INOUT sox_format_t * ft /**< Format pointer. */
-    );
-
-/**
-Client API:
-Callback to reposition reader,
-used by sox_format_handler.seek.
-@returns SOX_SUCCESS if successful.
-*/
-typedef int (LSX_API * sox_format_handler_seek)(
-    LSX_PARAM_INOUT sox_format_t * ft, /**< Format pointer. */
-    sox_uint64_t offset /**< Sample offset to which reader should be positioned. */
-    );
-
-/**
-Client API:
-Callback to parse command-line arguments (called once per effect),
-used by sox_effect_handler.getopts.
-@returns SOX_SUCCESS if successful.
-*/
-typedef int (LSX_API * sox_effect_handler_getopts)(
-    LSX_PARAM_INOUT sox_effect_t * effp, /**< Effect pointer. */
-    int argc, /**< Number of arguments in argv. */
-    LSX_PARAM_IN_COUNT(argc) char *argv[] /**< Array of command-line arguments. */
-    );
-
-/**
-Client API:
-Callback to initialize effect (called once per flow),
-used by sox_effect_handler.start.
-@returns SOX_SUCCESS if successful.
-*/
-typedef int (LSX_API * sox_effect_handler_start)(
-    LSX_PARAM_INOUT sox_effect_t * effp /**< Effect pointer. */
-    );
-
-/**
-Client API:
-Callback to process samples,
-used by sox_effect_handler.flow.
-@returns SOX_SUCCESS if successful.
-*/
-typedef int (LSX_API * sox_effect_handler_flow)(
-    LSX_PARAM_INOUT sox_effect_t * effp, /**< Effect pointer. */
-    LSX_PARAM_IN_COUNT(*isamp) sox_sample_t const * ibuf, /**< Buffer from which to read samples. */
-    LSX_PARAM_OUT_CAP_POST_COUNT(*osamp,*osamp) sox_sample_t * obuf, /**< Buffer to which samples are written. */
-    LSX_PARAM_INOUT size_t *isamp, /**< On entry, contains capacity of ibuf; on exit, contains number of samples consumed. */
-    LSX_PARAM_INOUT size_t *osamp /**< On entry, contains capacity of obuf; on exit, contains number of samples written. */
-    );
-
-/**
-Client API:
-Callback to finish getting output after input is complete,
-used by sox_effect_handler.drain.
-@returns SOX_SUCCESS if successful.
-*/
-typedef int (LSX_API * sox_effect_handler_drain)(
-    LSX_PARAM_INOUT sox_effect_t * effp, /**< Effect pointer. */
-    LSX_PARAM_OUT_CAP_POST_COUNT(*osamp,*osamp) sox_sample_t *obuf, /**< Buffer to which samples are written. */
-    LSX_PARAM_INOUT size_t *osamp /**< On entry, contains capacity of obuf; on exit, contains number of samples written. */
-    );
-
-/**
-Client API:
-Callback to shut down effect (called once per flow),
-used by sox_effect_handler.stop.
-@returns SOX_SUCCESS if successful.
-*/
-typedef int (LSX_API * sox_effect_handler_stop)(
-    LSX_PARAM_INOUT sox_effect_t * effp /**< Effect pointer. */
-    );
-
-/**
-Client API:
-Callback to shut down effect (called once per effect),
-used by sox_effect_handler.kill.
-@returns SOX_SUCCESS if successful.
-*/
-typedef int (LSX_API * sox_effect_handler_kill)(
-    LSX_PARAM_INOUT sox_effect_t * effp /**< Effect pointer. */
-    );
-
-/**
-Client API:
-Callback called while flow is running (called once per buffer),
-used by sox_flow_effects.callback.
-@returns SOX_SUCCESS to continue, other value to abort flow.
-*/
-typedef int (LSX_API * sox_flow_effects_callback)(
-    sox_bool all_done,
-    void * client_data
-    );
-
-/**
-Client API:
-Callback for enumerating the contents of a playlist,
-used by the sox_parse_playlist function.
-@returns SOX_SUCCESS if successful, any other value to abort playlist enumeration.
-*/
-typedef int (LSX_API * sox_playlist_callback_t)(
-    void * callback_data,
-    LSX_PARAM_IN_Z char const * filename
-    );
-
-/*****************************************************************************
-Structures:
-*****************************************************************************/
-
-/**
-Client API:
-Information about a build of libSoX, returned from the sox_version_info
-function.
-*/
-typedef struct sox_version_info_t {
-    size_t       size;         /**< structure size = sizeof(sox_version_info_t) */
-    sox_version_flags_t flags; /**< feature flags = popen | magic | threads | memopen */
-    sox_uint32_t version_code; /**< version number = 0x140400 */
-    char const * version;      /**< version string = sox_version(), for example, "14.4.0" */
-    char const * version_extra;/**< version extra info or null = "PACKAGE_EXTRA", for example, "beta" */
-    char const * time;         /**< build time = "__DATE__ __TIME__", for example, "Jan  7 2010 03:31:50" */
-    char const * distro;       /**< distro or null = "DISTRO", for example, "Debian" */
-    char const * compiler;     /**< compiler info or null, for example, "msvc 160040219" */
-    char const * arch;         /**< arch, for example, "1248 48 44 L OMP" */
-    /* new info should be added at the end for version backwards-compatibility. */
-} sox_version_info_t;
-
-/**
-Client API:
-Global parameters (for effects & formats), returned from the sox_get_globals
-function.
-*/
-typedef struct sox_globals_t {
-/* public: */
-  unsigned     verbosity; /**< messages are only written if globals.verbosity >= message.level */
-  sox_output_message_handler_t output_message_handler; /**< client-specified message output callback */
-  sox_bool     repeatable; /**< true to use pre-determined timestamps and PRNG seed */
-
-  /**
-  Default size (in bytes) used by libSoX for blocks of sample data.
-  Plugins should use similarly-sized buffers to get best performance.
-  */
-  size_t       bufsiz;
-
-  /**
-  Default size (in bytes) used by libSoX for blocks of input sample data.
-  Plugins should use similarly-sized buffers to get best performance.
-  */
-  size_t       input_bufsiz;
-
-  sox_int32_t  ranqd1; /**< Can be used to re-seed libSoX's PRNG */
-
-  char const * stdin_in_use_by;  /**< Private: tracks the name of the handler currently using stdin */
-  char const * stdout_in_use_by; /**< Private: tracks the name of the handler currently using stdout */
-  char const * subsystem;        /**< Private: tracks the name of the handler currently writing an output message */
-  char       * tmp_path;         /**< Private: client-configured path to use for temporary files */
-  sox_bool     use_magic;        /**< Private: true if client has requested use of 'magic' file-type detection */
-  sox_bool     use_threads;      /**< Private: true if client has requested parallel effects processing */
-} sox_globals_t;
-
-/**
-Client API:
-Signal parameters; members should be set to SOX_UNSPEC (= 0) if unknown.
-*/
-typedef struct sox_signalinfo_t {
-  sox_rate_t       rate;         /**< samples per second, 0 if unknown */
-  unsigned         channels;     /**< number of sound channels, 0 if unknown */
-  unsigned         precision;    /**< bits per sample, 0 if unknown */
-  sox_uint64_t     length;       /**< samples * chans in file, 0 if unknown, -1 if unspecified */
-  double           * mult;       /**< Effects headroom multiplier; may be null */
-} sox_signalinfo_t;
-
-/**
-Client API:
-Basic information about an encoding.
-*/
-typedef struct sox_encodings_info_t {
-  sox_encodings_flags_t flags; /**< lossy once (lossy1), lossy twice (lossy2), or lossless (none). */
-  char const * name;           /**< encoding name. */
-  char const * desc;           /**< encoding description. */
-} sox_encodings_info_t;
-
-/**
-Client API:
-Encoding parameters.
-*/
-typedef struct sox_encodinginfo_t {
-  sox_encoding_t encoding; /**< format of sample numbers */
-  unsigned bits_per_sample;/**< 0 if unknown or variable; uncompressed value if lossless; compressed value if lossy */
-  double compression;      /**< compression factor (where applicable) */
-
-  /**
-  Should bytes be reversed? If this is default during sox_open_read or
-  sox_open_write, libSoX will set them to either no or yes according to the
-  machine or format default.
-  */
-  sox_option_t reverse_bytes;
-
-  /**
-  Should nibbles be reversed? If this is default during sox_open_read or
-  sox_open_write, libSoX will set them to either no or yes according to the
-  machine or format default.
-  */
-  sox_option_t reverse_nibbles;
-
-  /**
-  Should bits be reversed? If this is default during sox_open_read or
-  sox_open_write, libSoX will set them to either no or yes according to the
-  machine or format default.
-  */
-  sox_option_t reverse_bits;
-
-  /**
-  If set to true, the format should reverse its default endianness.
-  */
-  sox_bool opposite_endian;
-} sox_encodinginfo_t;
-
-/**
-Client API:
-Looping parameters (out-of-band data).
-*/
-typedef struct sox_loopinfo_t {
-  sox_uint64_t  start;  /**< first sample */
-  sox_uint64_t  length; /**< length */
-  unsigned      count;  /**< number of repeats, 0=forever */
-  unsigned char type;   /**< 0=no, 1=forward, 2=forward/back (see sox_loop_* for valid values). */
-} sox_loopinfo_t;
-
-/**
-Client API:
-Instrument information.
-*/
-typedef struct sox_instrinfo_t{
-  signed char MIDInote;   /**< for unity pitch playback */
-  signed char MIDIlow;    /**< MIDI pitch-bend low range */
-  signed char MIDIhi;     /**< MIDI pitch-bend high range */
-  unsigned char loopmode; /**< 0=no, 1=forward, 2=forward/back (see sox_loop_* values) */
-  unsigned nloops;  /**< number of active loops (max SOX_MAX_NLOOPS). */
-} sox_instrinfo_t;
-
-/**
-Client API:
-File buffer info.  Holds info so that data can be read in blocks.
-*/
-typedef struct sox_fileinfo_t {
-  char          *buf;                 /**< Pointer to data buffer */
-  size_t        size;                 /**< Size of buffer in bytes */
-  size_t        count;                /**< Count read into buffer */
-  size_t        pos;                  /**< Position in buffer */
-} sox_fileinfo_t;
-
-/**
-Client API:
-Handler structure defined by each format.
-*/
-struct sox_format_handler_t {
-  unsigned     sox_lib_version_code;  /**< Checked on load; must be 1st in struct*/
-  char         const * description;   /**< short description of format */
-  char         const * const * names; /**< null-terminated array of filename extensions that are handled by this format */
-  unsigned int flags;                 /**< File flags (SOX_FILE_* values). */
-  sox_format_handler_startread startread; /**< called to initialize reader (decoder) */
-  sox_format_handler_read read;       /**< called to read (decode) a block of samples */
-  sox_format_handler_stopread stopread; /**< called to close reader (decoder); may be null if no closing necessary */
-  sox_format_handler_startwrite startwrite; /**< called to initialize writer (encoder) */
-  sox_format_handler_write write;     /**< called to write (encode) a block of samples */
-  sox_format_handler_stopwrite stopwrite; /**< called to close writer (decoder); may be null if no closing necessary */
-  sox_format_handler_seek seek;       /**< called to reposition reader; may be null if not supported */
-
-  /**
-  Array of values indicating the encodings and precisions supported for
-  writing (encoding). Precisions specified with default precision first.
-  Encoding, precision, precision, ..., 0, repeat. End with one more 0.
-  Example:
-  unsigned const * formats = {
-    SOX_ENCODING_SIGN2, 16, 24, 0, // Support SIGN2 at 16 and 24 bits, default to 16 bits.
-    SOX_ENCODING_UNSIGNED, 8, 0,   // Support UNSIGNED at 8 bits, default to 8 bits.
-    0 // No more supported encodings.
-  };
-  */
-  unsigned     const * write_formats;
-
-  /**
-  Array of sample rates (samples per second) supported for writing (encoding).
-  NULL if all (or almost all) rates are supported. End with 0.
-  */
-  sox_rate_t   const * write_rates;
-
-  /**
-  SoX will automatically allocate a buffer in which the handler can store data.
-  Specify the size of the buffer needed here. Usually this will be sizeof(your_struct).
-  The buffer will be allocated and zeroed before the call to startread/startwrite.
-  The buffer will be freed after the call to stopread/stopwrite.
-  The buffer will be provided via format.priv in each call to the handler.
-  */
-  size_t       priv_size;
-};
-
-/**
-Client API:
-Comments, instrument info, loop info (out-of-band data).
-*/
-typedef struct sox_oob_t{
-  /* Decoded: */
-  sox_comments_t   comments;              /**< Comment strings in id=value format. */
-  sox_instrinfo_t  instr;                 /**< Instrument specification */
-  sox_loopinfo_t   loops[SOX_MAX_NLOOPS]; /**< Looping specification */
-
-  /* TBD: Non-decoded chunks, etc: */
-} sox_oob_t;
-
-/**
-Client API:
-Data passed to/from the format handler
-*/
-struct sox_format_t {
-  char             * filename;      /**< File name */
-
-  /**
-  Signal specifications for reader (decoder) or writer (encoder):
-  sample rate, number of channels, precision, length, headroom multiplier.
-  Any info specified by the user is here on entry to startread or
-  startwrite. Info will be SOX_UNSPEC if the user provided no info.
-  At exit from startread, should be completely filled in, using
-  either data from the file's headers (if available) or whatever
-  the format is guessing/assuming (if header data is not available).
-  At exit from startwrite, should be completely filled in, using
-  either the data that was specified, or values chosen by the format
-  based on the format's defaults or capabilities.
-  */
-  sox_signalinfo_t signal;
-
-  /**
-  Encoding specifications for reader (decoder) or writer (encoder):
-  encoding (sample format), bits per sample, compression rate, endianness.
-  Should be filled in by startread. Values specified should be used
-  by startwrite when it is configuring the encoding parameters.
-  */
-  sox_encodinginfo_t encoding;
-
-  char             * filetype;      /**< Type of file, as determined by header inspection or libmagic. */
-  sox_oob_t        oob;             /**< comments, instrument info, loop info (out-of-band data) */
-  sox_bool         seekable;        /**< Can seek on this file */
-  char             mode;            /**< Read or write mode ('r' or 'w') */
-  sox_uint64_t     olength;         /**< Samples * chans written to file */
-  sox_uint64_t     clips;           /**< Incremented if clipping occurs */
-  int              sox_errno;       /**< Failure error code */
-  char             sox_errstr[256]; /**< Failure error text */
-  void             * fp;            /**< File stream pointer */
-  lsx_io_type      io_type;         /**< Stores whether this is a file, pipe or URL */
-  sox_uint64_t     tell_off;        /**< Current offset within file */
-  sox_uint64_t     data_start;      /**< Offset at which headers end and sound data begins (set by lsx_check_read_params) */
-  sox_format_handler_t handler;     /**< Format handler for this file */
-  void             * priv;          /**< Format handler's private data area */
-};
-
-/**
-Client API:
-Information about a loaded format handler, including the format name and a
-function pointer that can be invoked to get additional information about the
-format.
-*/
-typedef struct sox_format_tab_t {
-  char *name;         /**< Name of format handler */
-  sox_format_fn_t fn; /**< Function to call to get format handler's information */
-} sox_format_tab_t;
-
-/**
-Client API:
-Global parameters for effects.
-*/
-typedef struct sox_effects_globals_t {
-  sox_plot_t plot;         /**< To help the user choose effect & options */
-  sox_globals_t * global_info; /**< Pointer to associated SoX globals */
-} sox_effects_globals_t;
-
-/**
-Client API:
-Effect handler information.
-*/
-struct sox_effect_handler_t {
-  char const * name;  /**< Effect name */
-  char const * usage; /**< Short explanation of parameters accepted by effect */
-  unsigned int flags; /**< Combination of SOX_EFF_* flags */
-  sox_effect_handler_getopts getopts; /**< Called to parse command-line arguments (called once per effect). */
-  sox_effect_handler_start start;     /**< Called to initialize effect (called once per flow). */
-  sox_effect_handler_flow flow;       /**< Called to process samples. */
-  sox_effect_handler_drain drain;     /**< Called to finish getting output after input is complete. */
-  sox_effect_handler_stop stop;       /**< Called to shut down effect (called once per flow). */
-  sox_effect_handler_kill kill;       /**< Called to shut down effect (called once per effect). */
-  size_t       priv_size;             /**< Size of private data SoX should pre-allocate for effect */
-};
-
-/**
-Client API:
-Effect information.
-*/
-struct sox_effect_t {
-  sox_effects_globals_t    * global_info; /**< global effect parameters */
-  sox_signalinfo_t         in_signal;     /**< Information about the incoming data stream */
-  sox_signalinfo_t         out_signal;    /**< Information about the outgoing data stream */
-  sox_encodinginfo_t       const * in_encoding;  /**< Information about the incoming data encoding */
-  sox_encodinginfo_t       const * out_encoding; /**< Information about the outgoing data encoding */
-  sox_effect_handler_t     handler;   /**< The handler for this effect */
-  sox_sample_t             * obuf;    /**< output buffer */
-  size_t                   obeg;      /**< output buffer: start of valid data section */
-  size_t                   oend;      /**< output buffer: one past valid data section (oend-obeg is length of current content) */
-  size_t               imin;          /**< minimum input buffer content required for calling this effect's flow function; set via lsx_effect_set_imin() */
-  sox_uint64_t         clips;         /**< increment if clipping occurs */
-  size_t               flows;         /**< 1 if MCHAN, number of chans otherwise */
-  size_t               flow;          /**< flow number */
-  void                 * priv;        /**< Effect's private data area (each flow has a separate copy) */
-};
-
-/**
-Client API:
-Chain of effects to be applied to a stream.
-*/
-typedef struct sox_effects_chain_t {
-  sox_effect_t **effects;                  /**< Table of effects to be applied to a stream */
-  unsigned table_size;                     /**< Number of entries in effects table */
-  unsigned length;                         /**< Number of effects to be applied */
-  sox_sample_t **ibufc;                    /**< Channel interleave buffer */
-  sox_sample_t **obufc;                    /**< Channel interleave buffer */
-  sox_effects_globals_t global_info;       /**< Copy of global effects settings */
-  sox_encodinginfo_t const * in_enc;       /**< Input encoding */
-  sox_encodinginfo_t const * out_enc;      /**< Output encoding */
-} sox_effects_chain_t;
-
-/*****************************************************************************
-Functions:
-*****************************************************************************/
-
-/**
-Client API:
-Returns version number string of libSoX, for example, "14.4.0".
-@returns The version number string of libSoX, for example, "14.4.0".
-*/
-LSX_RETURN_VALID_Z LSX_RETURN_PURE
-char const *
-LSX_API
-sox_version(void);
-
-/**
-Client API:
-Returns information about this build of libsox.
-@returns Pointer to a version information structure.
-*/
-LSX_RETURN_VALID LSX_RETURN_PURE
-sox_version_info_t const *
-LSX_API
-sox_version_info(void);
-
-/**
-Client API:
-Returns a pointer to the structure with libSoX's global settings.
-@returns a pointer to the structure with libSoX's global settings.
-*/
-LSX_RETURN_VALID LSX_RETURN_PURE
-sox_globals_t *
-LSX_API
-sox_get_globals(void);
-
-/**
-Client API:
-Deprecated macro that returns the structure with libSoX's global settings
-as an lvalue.
-*/
-#define sox_globals (*sox_get_globals())
-
-/**
-Client API:
-Returns a pointer to the list of available encodings.
-End of list indicated by name == NULL.
-@returns pointer to the list of available encodings.
-*/
-LSX_RETURN_ARRAY LSX_RETURN_PURE
-sox_encodings_info_t const *
-LSX_API
-sox_get_encodings_info(void);
-
-/**
-Client API:
-Deprecated macro that returns the list of available encodings.
-End of list indicated by name == NULL.
-*/
-#define sox_encodings_info (sox_get_encodings_info())
-
-/**
-Client API:
-Fills in an encodinginfo with default values.
-*/
-void
-LSX_API
-sox_init_encodinginfo(
-    LSX_PARAM_OUT sox_encodinginfo_t * e /**< Pointer to uninitialized encoding info structure to be initialized. */
-    );
-
-/**
-Client API:
-Given an encoding (for example, SIGN2) and the encoded bits_per_sample (for
-example, 16), returns the number of useful bits per sample in the decoded data
-(for example, 16), or returns 0 to indicate that the value returned by the
-format handler should be used instead of a pre-determined precision.
-@returns the number of useful bits per sample in the decoded data (for example
-16), or returns 0 to indicate that the value returned by the format handler
-should be used instead of a pre-determined precision.
-*/
-LSX_RETURN_PURE
-unsigned
-LSX_API
-sox_precision(
-    sox_encoding_t encoding,   /**< Encoding for which to lookup precision information. */
-    unsigned bits_per_sample   /**< The number of encoded bits per sample. */
-    );
-
-/**
-Client API:
-Returns the number of items in the metadata block.
-@returns the number of items in the metadata block.
-*/
-size_t
-LSX_API
-sox_num_comments(
-    LSX_PARAM_IN_OPT sox_comments_t comments /**< Metadata block. */
-    );
-
-/**
-Client API:
-Adds an "id=value" item to the metadata block.
-*/
-void
-LSX_API
-sox_append_comment(
-    LSX_PARAM_DEREF_PRE_MAYBENULL LSX_PARAM_DEREF_POST_NOTNULL sox_comments_t * comments, /**< Metadata block. */
-    LSX_PARAM_IN_Z char const * item /**< Item to be added in "id=value" format. */
-    );
-
-/**
-Client API:
-Adds a newline-delimited list of "id=value" items to the metadata block.
-*/
-void
-LSX_API
-sox_append_comments(
-    LSX_PARAM_DEREF_PRE_MAYBENULL LSX_PARAM_DEREF_POST_NOTNULL sox_comments_t * comments, /**< Metadata block. */
-    LSX_PARAM_IN_Z char const * items /**< Newline-separated list of items to be added, for example "id1=value1\\nid2=value2". */
-    );
-
-/**
-Client API:
-Duplicates the metadata block.
-@returns the copied metadata block.
-*/
-LSX_RETURN_OPT
-sox_comments_t
-LSX_API
-sox_copy_comments(
-    LSX_PARAM_IN_OPT sox_comments_t comments /**< Metadata block to copy. */
-    );
-
-/**
-Client API:
-Frees the metadata block.
-*/
-void
-LSX_API
-sox_delete_comments(
-    LSX_PARAM_DEREF_PRE_MAYBENULL LSX_PARAM_DEREF_POST_NULL sox_comments_t * comments /**< Metadata block. */
-    );
-
-/**
-Client API:
-If "id=value" is found, return value, else return null.
-@returns value, or null if value not found.
-*/
-LSX_RETURN_OPT
-char const *
-LSX_API
-sox_find_comment(
-    LSX_PARAM_IN_OPT sox_comments_t comments, /**< Metadata block in which to search. */
-    LSX_PARAM_IN_Z char const * id /**< Id for which to search */
-    );
-
-/**
-Client API:
-Find and load format handler plugins.
-@returns SOX_SUCCESS if successful.
-*/
-int
-LSX_API
-sox_format_init(void);
-
-/**
-Client API:
-Unload format handler plugins.
-*/
-void
-LSX_API
-sox_format_quit(void);
-
-/**
-Client API:
-Initialize effects library.
-@returns SOX_SUCCESS if successful.
-*/
-int
-LSX_API
-sox_init(void);
-
-/**
-Client API:
-Close effects library and unload format handler plugins.
-@returns SOX_SUCCESS if successful.
-*/
-int
-LSX_API
-sox_quit(void);
-
-/**
-Client API:
-Returns the table of format handler names and functions.
-@returns the table of format handler names and functions.
-*/
-LSX_RETURN_ARRAY LSX_RETURN_PURE
-sox_format_tab_t const *
-LSX_API
-sox_get_format_fns(void);
-
-/**
-Client API:
-Deprecated macro that returns the table of format handler names and functions.
-*/
-#define sox_format_fns (sox_get_format_fns())
-
-/**
-Client API:
-Opens a decoding session for a file. Returned handle must be closed with sox_close().
-@returns The handle for the new session, or null on failure.
-*/
-LSX_RETURN_OPT
-sox_format_t *
-LSX_API
-sox_open_read(
-    LSX_PARAM_IN_Z   char               const * path,      /**< Path to file to be opened (required). */
-    LSX_PARAM_IN_OPT sox_signalinfo_t   const * signal,    /**< Information already known about audio stream, or NULL if none. */
-    LSX_PARAM_IN_OPT sox_encodinginfo_t const * encoding,  /**< Information already known about sample encoding, or NULL if none. */
-    LSX_PARAM_IN_OPT_Z char             const * filetype   /**< Previously-determined file type, or NULL to auto-detect. */
-    );
-
-/**
-Client API:
-Opens a decoding session for a memory buffer. Returned handle must be closed with sox_close().
-@returns The handle for the new session, or null on failure.
-*/
-LSX_RETURN_OPT
-sox_format_t *
-LSX_API
-sox_open_mem_read(
-    LSX_PARAM_IN_BYTECOUNT(buffer_size) void  * buffer,     /**< Pointer to audio data buffer (required). */
-    size_t                                      buffer_size,/**< Number of bytes to read from audio data buffer. */
-    LSX_PARAM_IN_OPT sox_signalinfo_t   const * signal,     /**< Information already known about audio stream, or NULL if none. */
-    LSX_PARAM_IN_OPT sox_encodinginfo_t const * encoding,   /**< Information already known about sample encoding, or NULL if none. */
-    LSX_PARAM_IN_OPT_Z char             const * filetype    /**< Previously-determined file type, or NULL to auto-detect. */
-    );
-
-/**
-Client API:
-Returns true if the format handler for the specified file type supports the specified encoding.
-@returns true if the format handler for the specified file type supports the specified encoding.
-*/
-sox_bool
-LSX_API
-sox_format_supports_encoding(
-    LSX_PARAM_IN_OPT_Z char               const * path,       /**< Path to file to be examined (required if filetype is NULL). */
-    LSX_PARAM_IN_OPT_Z char               const * filetype,   /**< Previously-determined file type, or NULL to use extension from path. */
-    LSX_PARAM_IN       sox_encodinginfo_t const * encoding    /**< Encoding for which format handler should be queried. */
-    );
-
-/**
-Client API:
-Gets the format handler for a specified file type.
-@returns The found format handler, or null if not found.
-*/
-LSX_RETURN_OPT
-sox_format_handler_t const *
-LSX_API
-sox_write_handler(
-    LSX_PARAM_IN_OPT_Z char               const * path,         /**< Path to file (required if filetype is NULL). */
-    LSX_PARAM_IN_OPT_Z char               const * filetype,     /**< Filetype for which handler is needed, or NULL to use extension from path. */
-    LSX_PARAM_OUT_OPT  char               const * * filetype1   /**< Receives the filetype that was detected. Pass NULL if not needed. */
-    );
-
-/**
-Client API:
-Opens an encoding session for a file. Returned handle must be closed with sox_close().
-@returns The new session handle, or null on failure.
-*/
-LSX_RETURN_OPT
-sox_format_t *
-LSX_API
-sox_open_write(
-    LSX_PARAM_IN_Z     char               const * path,     /**< Path to file to be written (required). */
-    LSX_PARAM_IN       sox_signalinfo_t   const * signal,   /**< Information about desired audio stream (required). */
-    LSX_PARAM_IN_OPT   sox_encodinginfo_t const * encoding, /**< Information about desired sample encoding, or NULL to use defaults. */
-    LSX_PARAM_IN_OPT_Z char               const * filetype, /**< Previously-determined file type, or NULL to auto-detect. */
-    LSX_PARAM_IN_OPT   sox_oob_t          const * oob,      /**< Out-of-band data to add to file, or NULL if none. */
-    LSX_PARAM_IN_OPT   sox_bool           (LSX_API * overwrite_permitted)(LSX_PARAM_IN_Z char const * filename) /**< Called if file exists to determine whether overwrite is ok. */
-    );
-
-/**
-Client API:
-Opens an encoding session for a memory buffer. Returned handle must be closed with sox_close().
-@returns The new session handle, or null on failure.
-*/
-LSX_RETURN_OPT
-sox_format_t *
-LSX_API
-sox_open_mem_write(
-    LSX_PARAM_OUT_BYTECAP(buffer_size) void                     * buffer,      /**< Pointer to audio data buffer that receives data (required). */
-    LSX_PARAM_IN                       size_t                     buffer_size, /**< Maximum number of bytes to write to audio data buffer. */
-    LSX_PARAM_IN                       sox_signalinfo_t   const * signal,      /**< Information about desired audio stream (required). */
-    LSX_PARAM_IN_OPT                   sox_encodinginfo_t const * encoding,    /**< Information about desired sample encoding, or NULL to use defaults. */
-    LSX_PARAM_IN_OPT_Z                 char               const * filetype,    /**< Previously-determined file type, or NULL to auto-detect. */
-    LSX_PARAM_IN_OPT                   sox_oob_t          const * oob          /**< Out-of-band data to add to file, or NULL if none. */
-    );
-
-/**
-Client API:
-Opens an encoding session for a memstream buffer. Returned handle must be closed with sox_close().
-@returns The new session handle, or null on failure.
-*/
-LSX_RETURN_OPT
-sox_format_t *
-LSX_API
-sox_open_memstream_write(
-    LSX_PARAM_OUT      char                     * * buffer_ptr,    /**< Receives pointer to audio data buffer that receives data (required). */
-    LSX_PARAM_OUT      size_t                   * buffer_size_ptr, /**< Receives size of data written to audio data buffer (required). */
-    LSX_PARAM_IN       sox_signalinfo_t   const * signal,          /**< Information about desired audio stream (required). */
-    LSX_PARAM_IN_OPT   sox_encodinginfo_t const * encoding,        /**< Information about desired sample encoding, or NULL to use defaults. */
-    LSX_PARAM_IN_OPT_Z char               const * filetype,        /**< Previously-determined file type, or NULL to auto-detect. */
-    LSX_PARAM_IN_OPT   sox_oob_t          const * oob              /**< Out-of-band data to add to file, or NULL if none. */
-    );
-
-/**
-Client API:
-Reads samples from a decoding session into a sample buffer.
-@returns Number of samples decoded, or 0 for EOF.
-*/
-size_t
-LSX_API
-sox_read(
-    LSX_PARAM_INOUT sox_format_t * ft, /**< Format pointer. */
-    LSX_PARAM_OUT_CAP_POST_COUNT(len,return) sox_sample_t *buf, /**< Buffer from which to read samples. */
-    size_t len /**< Number of samples available in buf. */
-    );
-
-/**
-Client API:
-Writes samples to an encoding session from a sample buffer.
-@returns Number of samples encoded.
-*/
-size_t
-LSX_API
-sox_write(
-    LSX_PARAM_INOUT sox_format_t * ft, /**< Format pointer. */
-    LSX_PARAM_IN_COUNT(len) sox_sample_t const * buf, /**< Buffer from which to read samples. */
-    size_t len /**< Number of samples available in buf. */
-    );
-
-/**
-Client API:
-Closes an encoding or decoding session.
-@returns SOX_SUCCESS if successful.
-*/
-int
-LSX_API
-sox_close(
-    LSX_PARAM_INOUT sox_format_t * ft /**< Format pointer. */
-    );
-
-/**
-Client API:
-Sets the location at which next samples will be decoded. Returns SOX_SUCCESS if successful.
-@returns SOX_SUCCESS if successful.
-*/
-int
-LSX_API
-sox_seek(
-    LSX_PARAM_INOUT sox_format_t * ft, /**< Format pointer. */
-    sox_uint64_t offset, /**< Sample offset at which to position reader. */
-    int whence /**< Set to SOX_SEEK_SET. */
-    );
-
-/**
-Client API:
-Finds a format handler by name.
-@returns Format handler data, or null if not found.
-*/
-LSX_RETURN_OPT
-sox_format_handler_t const *
-LSX_API
-sox_find_format(
-    LSX_PARAM_IN_Z char const * name, /**< Name of format handler to find. */
-    sox_bool ignore_devices /**< Set to true to ignore device names. */
-    );
-
-/**
-Client API:
-Returns global parameters for effects
-@returns global parameters for effects.
-*/
-LSX_RETURN_VALID LSX_RETURN_PURE
-sox_effects_globals_t *
-LSX_API
-sox_get_effects_globals(void);
-
-/**
-Client API:
-Deprecated macro that returns global parameters for effects.
-*/
-#define sox_effects_globals (*sox_get_effects_globals())
-
-/**
-Client API:
-Finds the effect handler with the given name.
-@returns Effect pointer, or null if not found.
-*/
-LSX_RETURN_OPT LSX_RETURN_PURE
-sox_effect_handler_t const *
-LSX_API
-sox_find_effect(
-    LSX_PARAM_IN_Z char const * name /**< Name of effect to find. */
-    );
-
-/**
-Client API:
-Creates an effect using the given handler.
-@returns The new effect, or null if not found.
-*/
-LSX_RETURN_OPT
-sox_effect_t *
-LSX_API
-sox_create_effect(
-    LSX_PARAM_IN sox_effect_handler_t const * eh /**< Handler to use for effect. */
-    );
-
-/**
-Client API:
-Applies the command-line options to the effect.
-@returns the number of arguments consumed.
-*/
-int
-LSX_API
-sox_effect_options(
-    LSX_PARAM_IN sox_effect_t *effp, /**< Effect pointer on which to set options. */
-    int argc, /**< Number of arguments in argv. */
-    LSX_PARAM_IN_COUNT(argc) char * const argv[] /**< Array of command-line options. */
-    );
-
-/**
-Client API:
-Returns an array containing the known effect handlers.
-@returns An array containing the known effect handlers.
-*/
-LSX_RETURN_VALID_Z LSX_RETURN_PURE
-sox_effect_fn_t const *
-LSX_API
-sox_get_effect_fns(void);
-
-/**
-Client API:
-Deprecated macro that returns an array containing the known effect handlers.
-*/
-#define sox_effect_fns (sox_get_effect_fns())
-
-/**
-Client API:
-Initializes an effects chain. Returned handle must be closed with sox_delete_effects_chain().
-@returns Handle, or null on failure.
-*/
-LSX_RETURN_OPT
-sox_effects_chain_t *
-LSX_API
-sox_create_effects_chain(
-    LSX_PARAM_IN sox_encodinginfo_t const * in_enc, /**< Input encoding. */
-    LSX_PARAM_IN sox_encodinginfo_t const * out_enc /**< Output encoding. */
-    );
-
-/**
-Client API:
-Closes an effects chain.
-*/
-void
-LSX_API
-sox_delete_effects_chain(
-    LSX_PARAM_INOUT sox_effects_chain_t *ecp /**< Effects chain pointer. */
-    );
-
-/**
-Client API:
-Adds an effect to the effects chain, returns SOX_SUCCESS if successful.
-@returns SOX_SUCCESS if successful.
-*/
-int
-LSX_API
-sox_add_effect(
-    LSX_PARAM_INOUT sox_effects_chain_t * chain, /**< Effects chain to which effect should be added . */
-    LSX_PARAM_INOUT sox_effect_t * effp, /**< Effect to be added. */
-    LSX_PARAM_INOUT sox_signalinfo_t * in, /**< Input format. */
-    LSX_PARAM_IN    sox_signalinfo_t const * out /**< Output format. */
-    );
-
-/**
-Client API:
-Runs the effects chain, returns SOX_SUCCESS if successful.
-@returns SOX_SUCCESS if successful.
-*/
-int
-LSX_API
-sox_flow_effects(
-    LSX_PARAM_INOUT  sox_effects_chain_t * chain, /**< Effects chain to run. */
-    LSX_PARAM_IN_OPT sox_flow_effects_callback callback, /**< Callback for monitoring flow progress. */
-    LSX_PARAM_IN_OPT void * client_data /**< Data to pass into callback. */
-    );
-
-/**
-Client API:
-Gets the number of clips that occurred while running an effects chain.
-@returns the number of clips that occurred while running an effects chain.
-*/
-sox_uint64_t
-LSX_API
-sox_effects_clips(
-    LSX_PARAM_IN sox_effects_chain_t * chain /**< Effects chain from which to read clip information. */
-    );
-
-/**
-Client API:
-Shuts down an effect (calls stop on each of its flows).
-@returns the number of clips from all flows.
-*/
-sox_uint64_t
-LSX_API
-sox_stop_effect(
-    LSX_PARAM_INOUT_COUNT(effp->flows) sox_effect_t * effp /**< Effect to stop. */
-    );
-
-/**
-Client API:
-Adds an already-initialized effect to the end of the chain.
-*/
-void
-LSX_API
-sox_push_effect_last(
-    LSX_PARAM_INOUT sox_effects_chain_t * chain, /**< Effects chain to which effect should be added. */
-    LSX_PARAM_INOUT sox_effect_t * effp /**< Effect to be added. */
-    );
-
-/**
-Client API:
-Removes and returns an effect from the end of the chain.
-@returns the removed effect, or null if no effects.
-*/
-LSX_RETURN_OPT
-sox_effect_t *
-LSX_API
-sox_pop_effect_last(
-    LSX_PARAM_INOUT sox_effects_chain_t *chain /**< Effects chain from which to remove an effect. */
-    );
-
-/**
-Client API:
-Shut down and delete an effect.
-*/
-void
-LSX_API
-sox_delete_effect(
-    LSX_PARAM_INOUT_COUNT(effp->flows) sox_effect_t *effp /**< Effect to be deleted. */
-    );
-
-/**
-Client API:
-Shut down and delete the last effect in the chain.
-*/
-void
-LSX_API
-sox_delete_effect_last(
-    LSX_PARAM_INOUT sox_effects_chain_t *chain /**< Effects chain from which to remove the last effect. */
-    );
-
-/**
-Client API:
-Shut down and delete all effects in the chain.
-*/
-void
-LSX_API
-sox_delete_effects(
-    LSX_PARAM_INOUT sox_effects_chain_t *chain /**< Effects chain from which to delete effects. */
-    );
-
-/**
-Client API:
-Gets the sample offset of the start of the trim, useful for efficiently
-skipping the part that will be trimmed anyway (get trim start, seek, then
-clear trim start).
-@returns the sample offset of the start of the trim.
-*/
-sox_uint64_t
-LSX_API
-sox_trim_get_start(
-    LSX_PARAM_IN sox_effect_t * effp /**< Trim effect. */
-    );
-
-/**
-Client API:
-Clears the start of the trim to 0.
-*/
-void
-LSX_API
-sox_trim_clear_start(
-    LSX_PARAM_INOUT sox_effect_t * effp /**< Trim effect. */
-    );
-
-/**
-Client API:
-Returns true if the specified file is a known playlist file type.
-@returns true if the specified file is a known playlist file type.
-*/
-sox_bool
-LSX_API
-sox_is_playlist(
-    LSX_PARAM_IN_Z char const * filename /**< Name of file to examine. */
-    );
-
-/**
-Client API:
-Parses the specified playlist file.
-@returns SOX_SUCCESS if successful.
-*/
-int
-LSX_API
-sox_parse_playlist(
-    LSX_PARAM_IN sox_playlist_callback_t callback, /**< Callback to call for each item in the playlist. */
-    void * p, /**< Data to pass to callback. */
-    LSX_PARAM_IN char const * const listname /**< Filename of playlist file. */
-    );
-
-/**
-Client API:
-Converts a SoX error code into an error string.
-@returns error string corresponding to the specified error code,
-or a generic message if the error code is not recognized.
-*/
-LSX_RETURN_VALID_Z LSX_RETURN_PURE
-char const *
-LSX_API
-sox_strerror(
-    int sox_errno /**< Error code to look up. */
-    );
-
-/**
-Client API:
-Gets the basename of the specified file; for example, the basename of
-"/a/b/c.d" would be "c".
-@returns the number of characters written to base_buffer, excluding the null,
-or 0 on failure.
-*/
-size_t
-LSX_API
-sox_basename(
-    LSX_PARAM_OUT_Z_CAP_POST_COUNT(base_buffer_len,return) char * base_buffer, /**< Buffer into which basename should be written. */
-    size_t base_buffer_len, /**< Size of base_buffer, in bytes. */
-    LSX_PARAM_IN_Z char const * filename /**< Filename from which to extract basename. */
-    );
-
-/*****************************************************************************
-Internal API:
-WARNING - The items in this section are subject to instability. They only
-exist in the public header because sox (the application) currently uses them.
-These may be changed or removed in future versions of libSoX.
-*****************************************************************************/
-
-/**
-Plugins API:
-Print a fatal error in libSoX.
-*/
-void
-LSX_API
-lsx_fail_impl(
-    LSX_PARAM_IN_PRINTF char const * fmt, /**< printf-style format string. */
-    ...)
-    LSX_PRINTF12;
-
-/**
-Plugins API:
-Print a warning in libSoX.
-*/
-void
-LSX_API
-lsx_warn_impl(
-    LSX_PARAM_IN_PRINTF char const * fmt, /**< printf-style format string. */
-    ...)
-    LSX_PRINTF12;
-
-/**
-Plugins API:
-Print an informational message in libSoX.
-*/
-void
-LSX_API
-lsx_report_impl(
-    LSX_PARAM_IN_PRINTF char const * fmt, /**< printf-style format string. */
-    ...)
-    LSX_PRINTF12;
-
-/**
-Plugins API:
-Print a debug message in libSoX.
-*/
-void
-LSX_API
-lsx_debug_impl(
-    LSX_PARAM_IN_PRINTF char const * fmt, /**< printf-style format string. */
-    ...)
-    LSX_PRINTF12;
-
-/**
-Plugins API:
-Report a fatal error in libSoX; printf-style arguments must follow.
-*/
-#define lsx_fail       sox_get_globals()->subsystem=__FILE__,lsx_fail_impl
-
-/**
-Plugins API:
-Report a warning in libSoX; printf-style arguments must follow.
-*/
-#define lsx_warn       sox_get_globals()->subsystem=__FILE__,lsx_warn_impl
-
-/**
-Plugins API:
-Report an informational message in libSoX; printf-style arguments must follow.
-*/
-#define lsx_report     sox_get_globals()->subsystem=__FILE__,lsx_report_impl
-
-/**
-Plugins API:
-Report a debug message in libSoX; printf-style arguments must follow.
-*/
-#define lsx_debug      sox_get_globals()->subsystem=__FILE__,lsx_debug_impl
-
-/**
-Plugins API:
-String name and integer values for enumerated types (type metadata), for use
-with LSX_ENUM_ITEM, lsx_find_enum_text, and lsx_find_enum_value.
-*/
-typedef struct lsx_enum_item {
-    char const *text; /**< String name of enumeration. */
-    unsigned value;   /**< Integer value of enumeration. */
-} lsx_enum_item;
-
-/**
-Plugins API:
-Declares a static instance of an lsx_enum_item structure in format
-{ "item", prefixitem }, for use in declaring lsx_enum_item[] arrays.
-@param prefix The prefix to prepend to the item in the enumeration symbolic name.
-@param item   The user-visible text name of the item (must also be a valid C symbol name).
-*/
-#define LSX_ENUM_ITEM(prefix, item) {#item, prefix##item},
-
-/**
-Plugins API:
-Flags for use with lsx_find_enum_item.
-*/
-enum
-{
-    lsx_find_enum_item_none = 0, /**< Default parameters (case-insensitive). */
-    lsx_find_enum_item_case_sensitive = 1 /**< Enable case-sensitive search. */
-};
-
-/**
-Plugins API:
-Looks up an enumeration by name in an array of lsx_enum_items.
-@returns the corresponding item, or null if not found.
-*/
-LSX_RETURN_OPT LSX_RETURN_PURE
-lsx_enum_item const *
-LSX_API
-lsx_find_enum_text(
-    LSX_PARAM_IN_Z char const * text, /**< Name of enumeration to find. */
-    LSX_PARAM_IN lsx_enum_item const * lsx_enum_items, /**< Array of items to search, with text == NULL for last item. */
-    int flags /**< Search flags: 0 (case-insensitive) or lsx_find_enum_item_case_sensitive (case-sensitive). */
-    );
-
-/**
-Plugins API:
-Looks up an enumeration by value in an array of lsx_enum_items.
-@returns the corresponding item, or null if not found.
-*/
-LSX_RETURN_OPT LSX_RETURN_PURE
-lsx_enum_item const *
-LSX_API
-lsx_find_enum_value(
-    unsigned value, /**< Enumeration value to find. */
-    LSX_PARAM_IN lsx_enum_item const * lsx_enum_items /**< Array of items to search, with text == NULL for last item. */
-    );
-
-/**
-Plugins API:
-Looks up a command-line argument in a set of enumeration names, showing an
-error message if the argument is not found in the set of names.
-@returns The enumeration value corresponding to the matching enumeration, or
-INT_MAX if the argument does not match any enumeration name.
-*/
-LSX_RETURN_PURE
-int
-LSX_API
-lsx_enum_option(
-    int c, /**< Option character to which arg is associated, for example with -a, c would be 'a'. */
-    LSX_PARAM_IN_Z char const * arg, /**< Argument to find in enumeration list. */
-    LSX_PARAM_IN lsx_enum_item const * items /**< Array of items to search, with text == NULL for last item. */
-    );
-
-/**
-Plugins API:
-Determines whether the specified string ends with the specified suffix (case-sensitive).
-@returns true if the specified string ends with the specified suffix.
-*/
-LSX_RETURN_PURE
-sox_bool
-LSX_API
-lsx_strends(
-    LSX_PARAM_IN_Z char const * str, /**< String to search. */
-    LSX_PARAM_IN_Z char const * end  /**< Suffix to search for. */
-    );
-
-/**
-Plugins API:
-Finds the file extension for a filename.
-@returns the file extension, not including the '.', or null if filename does
-not have an extension.
-*/
-LSX_RETURN_VALID_Z LSX_RETURN_PURE
-char const *
-LSX_API
-lsx_find_file_extension(
-    LSX_PARAM_IN_Z char const * pathname /**< Filename to search for extension. */
-    );
-
-/**
-Plugins API:
-Formats the specified number with up to three significant figures and adds a
-metric suffix in place of the exponent, such as 1.23G.
-@returns A static buffer with the formatted number, valid until the next time
-this function is called (note: not thread safe).
-*/
-LSX_RETURN_VALID_Z
-char const *
-LSX_API
-lsx_sigfigs3(
-    double number /**< Number to be formatted. */
-    );
-
-/**
-Plugins API:
-Formats the specified number as a percentage, showing up to three significant
-figures.
-@returns A static buffer with the formatted number, valid until the next time
-this function is called (note: not thread safe).
-*/
-LSX_RETURN_VALID_Z
-char const *
-LSX_API
-lsx_sigfigs3p(
-    double percentage /**< Number to be formatted. */
-    );
-
-/**
-Plugins API:
-Allocates, deallocates, or resizes; like C's realloc, except that this version
-terminates the running application if unable to allocate the requested memory.
-@returns New buffer, or null if buffer was freed.
-*/
-LSX_RETURN_OPT
-void *
-LSX_API
-lsx_realloc(
-    LSX_PARAM_IN_OPT void *ptr, /**< Pointer to be freed or resized, or null if allocating a new buffer. */
-    size_t newsize /**< New size for buffer, or 0 to free the buffer. */
-    );
-
-/**
-Plugins API:
-Like strcmp, except that the characters are compared without regard to case.
-@returns 0 (s1 == s2), negative (s1 < s2), or positive (s1 > s2).
-*/
-LSX_RETURN_PURE
-int
-LSX_API
-lsx_strcasecmp(
-    LSX_PARAM_IN_Z char const * s1, /**< First string. */
-    LSX_PARAM_IN_Z char const * s2  /**< Second string. */
-    );
-
-
-/**
-Plugins API:
-Like strncmp, except that the characters are compared without regard to case.
-@returns 0 (s1 == s2), negative (s1 < s2), or positive (s1 > s2).
-*/
-LSX_RETURN_PURE
-int
-LSX_API
-lsx_strncasecmp(
-    LSX_PARAM_IN_Z char const * s1, /**< First string. */
-    LSX_PARAM_IN_Z char const * s2, /**< Second string. */
-    size_t n /**< Maximum number of characters to examine. */
-    );
-
-/**
-Plugins API:
-Is option argument unsupported, required, or optional.
-*/
-typedef enum lsx_option_arg_t {
-    lsx_option_arg_none, /**< Option does not have an argument. */
-    lsx_option_arg_required, /**< Option requires an argument. */
-    lsx_option_arg_optional /**< Option can optionally be followed by an argument. */
-} lsx_option_arg_t;
-
-/**
-Plugins API:
-lsx_getopt_init options.
-*/
-typedef enum lsx_getopt_flags_t {
-    lsx_getopt_flag_none = 0,      /**< no flags (no output, not long-only) */
-    lsx_getopt_flag_opterr = 1,    /**< if set, invalid options trigger lsx_warn output */
-    lsx_getopt_flag_longonly = 2   /**< if set, recognize -option as a long option */
-} lsx_getopt_flags_t;
-
-/**
-Plugins API:
-lsx_getopt long option descriptor.
-*/
-typedef struct lsx_option_t {
-    char const *     name;    /**< Name of the long option. */
-    lsx_option_arg_t has_arg; /**< Whether the long option supports an argument and, if so, whether the argument is required or optional. */
-    int *            flag;    /**< Flag to set if argument is present. */
-    int              val;     /**< Value to put in flag if argument is present. */
-} lsx_option_t;
-
-/**
-Plugins API:
-lsx_getopt session information (initialization data and state).
-*/
-typedef struct lsx_getopt_t {
-    int                  argc;     /**< IN    argc:      Number of arguments in argv */
-    char * const *       argv;     /**< IN    argv:      Array of arguments */
-    char const *         shortopts;/**< IN    shortopts: Short option characters */
-    lsx_option_t const * longopts; /**< IN    longopts:  Array of long option descriptors */
-    lsx_getopt_flags_t   flags;    /**< IN    flags:     Flags for longonly and opterr */
-    char const *         curpos;   /**< INOUT curpos:    Maintains state between calls to lsx_getopt */
-    int                  ind;      /**< INOUT optind:    Maintains the index of next element to be processed */
-    int                  opt;      /**< OUT   optopt:    Receives the option character that caused error */
-    char const *         arg;      /**< OUT   optarg:    Receives the value of the option's argument */
-    int                  lngind;   /**< OUT   lngind:    Receives the index of the matched long option or -1 if not a long option */
-} lsx_getopt_t;
-
-/**
-Plugins API:
-Initializes an lsx_getopt_t structure for use with lsx_getopt.
-*/
-void
-LSX_API
-lsx_getopt_init(
-    LSX_PARAM_IN             int argc,                      /**< Number of arguments in argv */
-    LSX_PARAM_IN_COUNT(argc) char * const * argv,           /**< Array of arguments */
-    LSX_PARAM_IN_Z           char const * shortopts,        /**< Short options, for example ":abc:def::ghi" (+/- not supported) */
-    LSX_PARAM_IN_OPT         lsx_option_t const * longopts, /**< Array of long option descriptors */
-    LSX_PARAM_IN             lsx_getopt_flags_t flags,      /**< Flags for longonly and opterr */
-    LSX_PARAM_IN             int first,                     /**< First argv to check (usually 1) */
-    LSX_PARAM_OUT            lsx_getopt_t * state           /**< State object to be initialized */
-    );
-
-/**
-Plugins API:
-Gets the next option. Options are parameters that start with "-" or "--".
-If no more options, returns -1. If unrecognized short option, returns '?'.
-If a recognized short option is missing a required argument,
-return (shortopts[0]==':' ? ':' : '?'). If successfully recognized short
-option, return the recognized character. If successfully recognized long
-option, returns (option.flag ? 0 : option.val).
-Note: lsx_getopt does not permute the non-option arguments.
-@returns option character (short), val or 0 (long), or -1 (no more).
-*/
-int
-LSX_API
-lsx_getopt(
-    LSX_PARAM_INOUT lsx_getopt_t * state /**< The getopt state pointer. */
-    );
-
-/* WARNING END */
-
-#if defined(__cplusplus)
-}
-#endif
-
-#endif /* SOX_H */
diff --git a/fdmdv2/branches/0.99/src/sox_biquad.c b/fdmdv2/branches/0.99/src/sox_biquad.c
deleted file mode 100644 (file)
index f5a0913..0000000
+++ /dev/null
@@ -1,129 +0,0 @@
-//==========================================================================
-// Name:            sox_biquad.h
-// Purpose:         Interface into Sox Biquad filters 
-// Created:         Dec 1, 2012
-// Authors:         David Rowe
-// 
-// To test:
-//          $ gcc sox_biquad.c -o sox_biquad -DSOX_BIQUAD_UNITTEST -Wall \
-//            /path/to/sox-14.4.0/src/.libs/libsox.a -lm -lsndfile
-//          $ ./sox_biquad
-//
-// 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-
-#include <assert.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include "sox.h"
-
-#include "sox_biquad.h"
-
-
-#define N_MAX 1024
-
-int lsx_biquad_flow(sox_effect_t * effp, const sox_sample_t *ibuf,
-                    sox_sample_t *obuf, size_t *isamp, size_t *osamp);
-
-void sox_biquad_start(void)
-{
-    int r = sox_init();
-    assert(r == SOX_SUCCESS);
-}
-
-void sox_biquad_finish(void)
-{
-    sox_quit();
-}
-
-/*
-  Effect must be implemented by biquads.c in sox, arguments are just
-  like sox command line, for example:
-
-  char *argv[10];
-  argv[0] = "highpass"; argv[1]="1000"; argc=1;
-*/
-
-void *sox_biquad_create(int argc, const char *argv[])
-{
-    int ret;
-    sox_effect_t *e;
-    int (*start)(sox_effect_t *); /* function pointer to effect start func */
-    
-    e = sox_create_effect(sox_find_effect(argv[0])); assert(e != NULL);
-    ret = sox_effect_options(e, argc, (char * const*)&argv[1]);
-    assert(ret == SOX_SUCCESS);
-
-    start = e->handler.start;
-    e->in_signal.rate = 8000;     /* locked at FS=8000 Hz */
-    ret = start(e); assert(ret == SOX_SUCCESS);
-    
-    return (void *)e;
-}
-
-void sox_biquad_destroy(void *sbq) {
-    sox_effect_t *e = (sox_effect_t *)sbq;
-    free(e);
-}
-
-void sox_biquad_filter(void *sbq, short out[], short in[], int n)
-{
-    sox_effect_t *e = (sox_effect_t *)sbq;
-    sox_sample_t ibuf[N_MAX];
-    sox_sample_t obuf[N_MAX];
-    size_t isamp, osamp;
-    unsigned int clips;
-    SOX_SAMPLE_LOCALS; 
-    int i;
-
-    assert(n <= N_MAX);
-
-    clips = 0;
-    for(i=0; i<n; i++)
-        ibuf[i] = SOX_SIGNED_16BIT_TO_SAMPLE(in[i], clips);
-    isamp = osamp = (unsigned int)n;
-    lsx_biquad_flow(e, ibuf, obuf, &isamp, &osamp);
-    for(i=0; i<n; i++)
-        out[i] = SOX_SAMPLE_TO_SIGNED_16BIT(obuf[i], clips); 
-}
-
-
-#ifdef SOX_BIQUAD_UNITTEST
-#define N 20
-int main(void) {
-    void *sbq;
-    char *argv[10];
-    short in[N];
-    short out[N];
-    int   i, argc;;
-
-    for(i=0; i<N; i++)
-        in[i] = 0;
-    in[0] = 8000;
-
-    sox_biquad_start();
-    argv[0] = "highpass"; argv[1]="1000"; argc=1;
-    sbq = sox_biquad_create(argc, argv);
-
-    sox_biquad_filter(sbq, out, in, N);
-    for(i=0; i<N; i++)
-        printf("%d\n", out[i]);
-   
-    sox_biquad_destroy(sbq);
-    sox_biquad_finish();
-
-    return 0;
-}
-#endif
diff --git a/fdmdv2/branches/0.99/src/sox_biquad.h b/fdmdv2/branches/0.99/src/sox_biquad.h
deleted file mode 100644 (file)
index f38de64..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-//==========================================================================
-// Name:            sox_biquad.h
-// Purpose:         Interface into Sox Biquad filters 
-// Created:         Dec 1, 2012
-// Authors:         David Rowe
-// 
-// 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-
-#ifndef __SOX_BIQUAD__
-#define __SOX_BIQUAD__
-
-#ifdef __cplusplus
-extern "C" {
-
-#endif
-
-void sox_biquad_start(void);
-void sox_biquad_finish(void);
-void *sox_biquad_create(int argc, const char *argv[]);
-void sox_biquad_destroy(void *sbq);
-void sox_biquad_filter(void *sbq, short out[], short in[], int n);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/fdmdv2/branches/0.99/src/topFrame.cpp b/fdmdv2/branches/0.99/src/topFrame.cpp
deleted file mode 100644 (file)
index 54ea80a..0000000
+++ /dev/null
@@ -1,551 +0,0 @@
-//==========================================================================
-// Name:            topFrame.cpp
-//
-// Purpose:         Implements simple wxWidgets application with GUI.
-// Created:         Apr. 9, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#include "topFrame.h"
-
-extern int g_playFileToMicInEventId;
-extern int g_recFileFromRadioEventId;
-extern int g_playFileFromRadioEventId;
-
-//=========================================================================
-// Code that lays out the main application window
-//=========================================================================
-TopFrame::TopFrame(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxFrame(parent, id, title, pos, size, style)
-{
-    this->SetSizeHints(wxDefaultSize, wxDefaultSize);
-    this->SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
-    this->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DLIGHT));
-    this->SetSizeHints(wxDefaultSize, wxDefaultSize);
-    this->SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
-    this->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DLIGHT));
-    //=====================================================
-    // Menubar Setup
-    m_menubarMain = new wxMenuBar(wxMB_DOCKABLE);
-    file = new wxMenu();
-
-    wxMenuItem* m_menuItemOnTop;
-    m_menuItemOnTop = new wxMenuItem(file, wxID_ANY, wxString(_("On Top")) , _("Always Top Window"), wxITEM_NORMAL);
-    file->Append(m_menuItemOnTop);
-
-    wxMenuItem* m_menuItemExit;
-    m_menuItemExit = new wxMenuItem(file, ID_EXIT, wxString(_("E&xit")) , _("Exit Program"), wxITEM_NORMAL);
-    file->Append(m_menuItemExit);
-
-    m_menubarMain->Append(file, _("&File"));
-
-    tools = new wxMenu();
-    wxMenuItem* m_menuItemAudio;
-    m_menuItemAudio = new wxMenuItem(tools, wxID_ANY, wxString(_("&Audio Config")) , wxEmptyString, wxITEM_NORMAL);
-    tools->Append(m_menuItemAudio);
-
-    wxMenuItem* m_menuItemRigCtrlCfg;
-    m_menuItemRigCtrlCfg = new wxMenuItem(tools, wxID_ANY, wxString(_("&PTT Config")) , wxEmptyString, wxITEM_NORMAL);
-    tools->Append(m_menuItemRigCtrlCfg);
-
-    wxMenuItem* m_menuItemOptions;
-    m_menuItemOptions = new wxMenuItem(tools, wxID_ANY, wxString(_("Options")) , wxEmptyString, wxITEM_NORMAL);
-    tools->Append(m_menuItemOptions);
-
-    wxMenuItem* m_menuItemFilter;
-    m_menuItemFilter = new wxMenuItem(tools, wxID_ANY, wxString(_("&Filter")) , wxEmptyString, wxITEM_NORMAL);
-    tools->Append(m_menuItemFilter);
-
-    wxMenuItem* m_menuItemPlayFileToMicIn;
-    m_menuItemPlayFileToMicIn = new wxMenuItem(tools, wxID_ANY, wxString(_("Start/Stop Play File - Mic In")) , wxEmptyString, wxITEM_NORMAL);
-    g_playFileToMicInEventId = m_menuItemPlayFileToMicIn->GetId();
-    tools->Append(m_menuItemPlayFileToMicIn);
-
-    wxMenuItem* m_menuItemRecFileFromRadio;
-    m_menuItemRecFileFromRadio = new wxMenuItem(tools, wxID_ANY, wxString(_("Start/Stop Record File - From Radio")) , wxEmptyString, wxITEM_NORMAL);
-    g_recFileFromRadioEventId = m_menuItemRecFileFromRadio->GetId();
-    tools->Append(m_menuItemRecFileFromRadio);
-
-    wxMenuItem* m_menuItemPlayFileFromRadio;
-    m_menuItemPlayFileFromRadio = new wxMenuItem(tools, wxID_ANY, wxString(_("Start/Stop Play File - From Radio")) , wxEmptyString, wxITEM_NORMAL);
-    g_playFileFromRadioEventId = m_menuItemPlayFileFromRadio->GetId();
-    tools->Append(m_menuItemPlayFileFromRadio);
-    m_menubarMain->Append(tools, _("&Tools"));
-
-    help = new wxMenu();
-    wxMenuItem* m_menuItemHelpUpdates;
-    m_menuItemHelpUpdates = new wxMenuItem(help, wxID_ANY, wxString(_("Check for Updates")) , wxEmptyString, wxITEM_NORMAL);
-    help->Append(m_menuItemHelpUpdates);
-    m_menuItemHelpUpdates->Enable(false);
-
-    wxMenuItem* m_menuItemAbout;
-    m_menuItemAbout = new wxMenuItem(help, ID_ABOUT, wxString(_("&About")) , _("About this program"), wxITEM_NORMAL);
-    help->Append(m_menuItemAbout);
-
-    m_menubarMain->Append(help, _("&Help"));
-
-    this->SetMenuBar(m_menubarMain);
-
-    wxBoxSizer* bSizer1;
-    bSizer1 = new wxBoxSizer(wxHORIZONTAL);
-
-    //=====================================================
-    // Left side
-    //=====================================================
-    wxBoxSizer* leftSizer;
-    leftSizer = new wxBoxSizer(wxVERTICAL);
-
-    wxStaticBoxSizer* snrSizer;
-    snrSizer = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("SNR")), wxVERTICAL);
-
-    //------------------------------
-    // S/N ratio Guage (vert. bargraph)
-    //------------------------------
-    m_gaugeSNR = new wxGauge(this, wxID_ANY, 25, wxDefaultPosition, wxSize(15,135), wxGA_SMOOTH|wxGA_VERTICAL);
-    m_gaugeSNR->SetToolTip(_("Displays signal to noise ratio in dB."));
-    snrSizer->Add(m_gaugeSNR, 1, wxALIGN_CENTER_HORIZONTAL|wxALL, 10);
-
-    //------------------------------
-    // Box for S/N ratio (Numeric)
-    //------------------------------
-    m_textSNR = new wxStaticText(this, wxID_ANY, wxT(" 0.0"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE);
-    snrSizer->Add(m_textSNR, 0, wxALIGN_CENTER_HORIZONTAL, 1);
-
-    //------------------------------
-    // S/N ratio slow Checkbox
-    //------------------------------
-    m_ckboxSNR = new wxCheckBox(this, wxID_ANY, _("Slow"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
-    m_ckboxSNR->SetToolTip(_("Smooth but slow SNR estimation"));
-    snrSizer->Add(m_ckboxSNR, 0, wxALIGN_CENTER_HORIZONTAL, 5);
-
-    leftSizer->Add(snrSizer, 2, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxALL, 1);
-
-    //------------------------------
-    // Sync  Indicator box
-    //------------------------------
-    wxStaticBoxSizer* sbSizer3_33;
-    sbSizer3_33 = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Sync")), wxVERTICAL);
-
-    m_rbSync = new wxRadioButton( this, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
-    m_rbSync->SetForegroundColour( wxColour( 255, 0, 0 ) );
-    sbSizer3_33->Add(m_rbSync, 0, wxALIGN_CENTER|wxALL, 1);
-    leftSizer->Add(sbSizer3_33,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
-
-    //------------------------------
-    // BER Frames box
-    //------------------------------
-
-    wxStaticBoxSizer* sbSizer_ber;
-    sbSizer_ber = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Bit Error Rate")), wxVERTICAL);
-
-    m_BtnBerReset = new wxButton(this, wxID_ANY, _("Reset"), wxDefaultPosition, wxDefaultSize, 0);
-    sbSizer_ber->Add(m_BtnBerReset, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
-
-    m_textBits = new wxStaticText(this, wxID_ANY, wxT("Bits: 0"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
-    sbSizer_ber->Add(m_textBits, 0, wxALIGN_LEFT, 1);
-    m_textErrors = new wxStaticText(this, wxID_ANY, wxT("Errs: 0"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
-    sbSizer_ber->Add(m_textErrors, 0, wxALIGN_LEFT, 1);
-    m_textBER = new wxStaticText(this, wxID_ANY, wxT("BER: 0.0"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
-    sbSizer_ber->Add(m_textBER, 0, wxALIGN_LEFT, 1);
-
-    leftSizer->Add(sbSizer_ber,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
-
-    //------------------------------
-    // Signal Level(vert. bargraph)
-    //------------------------------
-    wxStaticBoxSizer* levelSizer;
-    levelSizer = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Level")), wxVERTICAL);
-
-    m_textLevel = new wxStaticText(this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(60,-1), wxALIGN_CENTRE);
-    m_textLevel->SetForegroundColour(wxColour(255,0,0));
-    levelSizer->Add(m_textLevel, 0, wxALIGN_LEFT, 1);
-
-    m_gaugeLevel = new wxGauge(this, wxID_ANY, 100, wxDefaultPosition, wxSize(15,135), wxGA_SMOOTH|wxGA_VERTICAL);
-    m_gaugeLevel->SetToolTip(_("Peak of From Radio in Rx, or peak of From Mic in Tx mode.  If Red you should reduce your levels"));
-    levelSizer->Add(m_gaugeLevel, 1, wxALIGN_CENTER_HORIZONTAL|wxALL, 10);
-
-    leftSizer->Add(levelSizer, 2, wxALIGN_CENTER|wxALL|wxEXPAND, 1);
-
-    bSizer1->Add(leftSizer, 0, wxALL|wxEXPAND, 5);
-
-    //=====================================================
-    // Center Section
-    //=====================================================
-    wxBoxSizer* centerSizer;
-    centerSizer = new wxBoxSizer(wxVERTICAL);
-    wxBoxSizer* upperSizer;
-    upperSizer = new wxBoxSizer(wxVERTICAL);
-
-    //=====================================================
-    // Tabbed Notebook control containing display graphs
-    //=====================================================
-    //m_auiNbookCtrl = new wxAuiNotebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_NB_BOTTOM|wxAUI_NB_DEFAULT_STYLE);
-    //long style = wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_MOVE | wxAUI_NB_SCROLL_BUTTONS | wxAUI_NB_CLOSE_ON_ACTIVE_TAB | wxAUI_NB_MIDDLE_CLICK_CLOSE;
-    long nb_style = wxAUI_NB_BOTTOM | wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_MOVE | wxAUI_NB_SCROLL_BUTTONS;
-    m_auiNbookCtrl = new wxAuiNotebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, nb_style);
-    // This line sets the fontsize for the tabs on the notebook control
-    m_auiNbookCtrl->SetFont(wxFont(8, 70, 90, 90, false, wxEmptyString));
-
-    upperSizer->Add(m_auiNbookCtrl, 1, wxALIGN_TOP|wxEXPAND, 1);
-    centerSizer->Add(upperSizer, 1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALIGN_TOP|wxEXPAND, 0);
-
-    // lower middle used for user ID
-
-    wxBoxSizer* lowerSizer;
-    lowerSizer = new wxBoxSizer(wxHORIZONTAL);
-
-    m_BtnCallSignReset = new wxButton(this, wxID_ANY, _("Clear"), wxDefaultPosition, wxDefaultSize, 0);
-    lowerSizer->Add(m_BtnCallSignReset, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
-
-    wxBoxSizer* bSizer15;
-    bSizer15 = new wxBoxSizer(wxVERTICAL);
-    m_txtCtrlCallSign = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
-    m_txtCtrlCallSign->SetToolTip(_("Call Sign of transmitting station will appear here"));
-    bSizer15->Add(m_txtCtrlCallSign, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 5);
-    lowerSizer->Add(bSizer15, 1, wxEXPAND, 5);
-
-    wxStaticBoxSizer* sbSizer_Checksum = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Checksums")), wxHORIZONTAL);
-
-    wxStaticText *goodLabel = new wxStaticText(this, wxID_ANY, wxT("Good: "), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE);
-    sbSizer_Checksum->Add(goodLabel, 0, 0, 2);
-    m_txtChecksumGood = new wxStaticText(this, wxID_ANY, wxT("0"), wxDefaultPosition, wxSize(30,-1), wxALIGN_CENTRE);
-    sbSizer_Checksum->Add(m_txtChecksumGood, 0, 0, 2);
-
-    wxStaticText *badLabel = new wxStaticText(this, wxID_ANY, wxT("Bad: "), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE);
-    sbSizer_Checksum->Add(badLabel, 0, 0, 1);
-    m_txtChecksumBad = new wxStaticText(this, wxID_ANY, wxT("0"), wxDefaultPosition, wxSize(30,-1), wxALIGN_CENTRE);
-    sbSizer_Checksum->Add(m_txtChecksumBad, 0, 0, 1);
-
-    lowerSizer->Add(sbSizer_Checksum, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
-
-    //=====================================================
-    // These are the buttons that autosend the userid (?)
-    //=====================================================
-
-    // DR 4 Dec - taken off for screen for Beta release to avoid questions on their use until
-    // we implement this feature
- #ifdef UNIMPLEMENTED
-    wxBoxSizer* bSizer141;
-    bSizer141 = new wxBoxSizer(wxHORIZONTAL);
-
-    // TxID
-    //---------
-    m_togTxID = new wxToggleButton(this, wxID_ANY, _("TxID"), wxDefaultPosition, wxDefaultSize, 0);
-    m_togTxID->SetToolTip(_("Send Tx ID information"));
-    bSizer141->Add(m_togTxID, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
-
-    // RxID
-    //---------
-    m_togRxID = new wxToggleButton(this, wxID_ANY, _("RxID"), wxDefaultPosition, wxDefaultSize, 0);
-    m_togRxID->SetToolTip(_("Enable reception of ID information"));
-    bSizer141->Add(m_togRxID, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_LEFT|wxALL|wxFIXED_MINSIZE, 5);
-
-    lowerSizer->Add(bSizer141, 0, wxALIGN_RIGHT, 5);
-#endif
-
-    centerSizer->Add(lowerSizer, 0, wxALIGN_BOTTOM|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 2);
-    bSizer1->Add(centerSizer, 4, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 1);
-
-    //=====================================================
-    // Right side
-    //=====================================================
-    wxBoxSizer* rightSizer;
-    rightSizer = new wxBoxSizer(wxVERTICAL);
-
-    //=====================================================
-    // Squelch Slider Control
-    //=====================================================
-    wxStaticBoxSizer* sbSizer3;
-    sbSizer3 = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Squelch")), wxVERTICAL);
-
-    m_sliderSQ = new wxSlider(this, wxID_ANY, 0, 0, 40, wxDefaultPosition, wxSize(-1,80), wxSL_AUTOTICKS|wxSL_INVERSE|wxSL_VERTICAL);
-    m_sliderSQ->SetToolTip(_("Set Squelch level in dB."));
-
-    sbSizer3->Add(m_sliderSQ, 1, wxALIGN_CENTER_HORIZONTAL, 0);
-
-    //------------------------------
-    // Squelch Level static text box
-    //------------------------------
-    m_textSQ = new wxStaticText(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE);
-
-    sbSizer3->Add(m_textSQ, 0, wxALIGN_CENTER_HORIZONTAL, 0);
-
-    //------------------------------
-    // Squelch Toggle Checkbox
-    //------------------------------
-    m_ckboxSQ = new wxCheckBox(this, wxID_ANY, _(""), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
-
-    sbSizer3->Add(m_ckboxSQ, 0, wxALIGN_CENTER_HORIZONTAL, 0);
-    rightSizer->Add(sbSizer3, 2, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 0);
-
-    //rightSizer->Add(sbSizer3_33,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
-
-    /* new --- */
-
-    //------------------------------
-    // Mode box
-    //------------------------------
-    wxStaticBoxSizer* sbSizer_mode;
-    sbSizer_mode = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Mode")), wxVERTICAL);
-
-#ifdef DISABLED_FEATURE
-    m_rb1400old = new wxRadioButton( this, wxID_ANY, wxT("1400 V0.91"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
-    sbSizer_mode->Add(m_rb1400old, 0, wxALIGN_LEFT|wxALL, 1);
-    m_rb1400 = new wxRadioButton( this, wxID_ANY, wxT("1400"), wxDefaultPosition, wxDefaultSize, 0);
-    sbSizer_mode->Add(m_rb1400, 0, wxALIGN_LEFT|wxALL, 1);
-#endif
-    m_rb700 = new wxRadioButton( this, wxID_ANY, wxT("700"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
-    sbSizer_mode->Add(m_rb700, 0, wxALIGN_LEFT|wxALL, 1);
-    m_rb1600 = new wxRadioButton( this, wxID_ANY, wxT("1600"), wxDefaultPosition, wxDefaultSize, 0);
-    sbSizer_mode->Add(m_rb1600, 0, wxALIGN_LEFT|wxALL, 1);
-    m_rb1600->SetValue(true);
-#ifdef DISABLED_FEATURE
-    m_rb1600Wide = new wxRadioButton( this, wxID_ANY, wxT("1600 Wide"), wxDefaultPosition, wxDefaultSize, 0);
-    sbSizer_mode->Add(m_rb1600Wide, 0, wxALIGN_LEFT|wxALL, 1);
-    m_rb2000 = new wxRadioButton( this, wxID_ANY, wxT("2000"), wxDefaultPosition, wxDefaultSize, 0);
-    sbSizer_mode->Add(m_rb2000, 0, wxALIGN_LEFT|wxALL, 1);
-#endif
-
-    rightSizer->Add(sbSizer_mode,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
-
-    #ifdef MOVED_TO_OPTIONS_DIALOG
-    /* new --- */
-
-    //------------------------------
-    // Test Frames box
-    //------------------------------
-
-    wxStaticBoxSizer* sbSizer_testFrames;
-    sbSizer_testFrames = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Test Frames")), wxVERTICAL);
-
-    m_ckboxTestFrame = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
-    sbSizer_testFrames->Add(m_ckboxTestFrame, 0, wxALIGN_LEFT, 0);
-
-    rightSizer->Add(sbSizer_testFrames,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
-    #endif
-
-    //=====================================================
-    // Control Toggles box
-    //=====================================================
-    wxStaticBoxSizer* sbSizer5;
-    sbSizer5 = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Control")), wxVERTICAL);
-    wxBoxSizer* bSizer1511;
-    bSizer1511 = new wxBoxSizer(wxVERTICAL);
-
-    //-------------------------------
-    // Stop/Stop signal processing (rx and tx)
-    //-------------------------------
-    m_togBtnOnOff = new wxToggleButton(this, wxID_ANY, _("Start"), wxDefaultPosition, wxDefaultSize, 0);
-    m_togBtnOnOff->SetToolTip(_("Begin/End receiving data."));
-    bSizer1511->Add(m_togBtnOnOff, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
-    sbSizer5->Add(bSizer1511, 0, wxEXPAND, 1);
-
-#ifdef UNIMPLEMENTED
-    //------------------------------
-    // Toggle Loopback button for RX
-    //------------------------------
-    wxBoxSizer* bSizer15113;
-    bSizer15113 = new wxBoxSizer(wxHORIZONTAL);
-    wxBoxSizer* bSizer15111;
-    bSizer15111 = new wxBoxSizer(wxVERTICAL);
-    wxSize wxSz = wxSize(44, 30);
-    m_togBtnLoopRx = new wxToggleButton(this, wxID_ANY, _("Loop\nRX"), wxDefaultPosition, wxSz, 0);
-    m_togBtnLoopRx->SetFont(wxFont(6, 70, 90, 90, false, wxEmptyString));
-    m_togBtnLoopRx->SetToolTip(_("Loopback Receive audio data."));
-
-    bSizer15111->Add(m_togBtnLoopRx, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 0);
-
-    //sbSizer5->Add(bSizer15111, 0, wxEXPAND, 1);
-    bSizer15113->Add(bSizer15111, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 0);
-
-    //------------------------------
-    // Toggle Loopback button for Tx
-    //------------------------------
-    wxBoxSizer* bSizer15112;
-    bSizer15112 = new wxBoxSizer(wxVERTICAL);
-    m_togBtnLoopTx = new wxToggleButton(this, wxID_ANY, _("Loop\nTX"), wxDefaultPosition, wxSz, 0);
-    m_togBtnLoopTx->SetFont(wxFont(6, 70, 90, 90, false, wxEmptyString));
-    m_togBtnLoopTx->SetToolTip(_("Loopback Transmit audio data."));
-
-    bSizer15112->Add(m_togBtnLoopTx, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 0);
-    bSizer15113->Add(bSizer15112, 0,  wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 0);
-
-    sbSizer5->Add(bSizer15113, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
-#endif
-
-    //------------------------------
-    // Split Frequency Mode Toggle
-    //------------------------------
-    wxBoxSizer* bSizer151;
-    bSizer151 = new wxBoxSizer(wxVERTICAL);
-
-    m_togBtnSplit = new wxToggleButton(this, wxID_ANY, _("Split"), wxDefaultPosition, wxDefaultSize, 0);
-    m_togBtnSplit->SetToolTip(_("Toggle split frequency mode."));
-
-    bSizer151->Add(m_togBtnSplit, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
-    sbSizer5->Add(bSizer151, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 1);
-    wxBoxSizer* bSizer13;
-    bSizer13 = new wxBoxSizer(wxVERTICAL);
-
-    //------------------------------
-    // Analog Passthrough Toggle
-    //------------------------------
-    m_togBtnAnalog = new wxToggleButton(this, wxID_ANY, _("Analog"), wxDefaultPosition, wxDefaultSize, 0);
-    m_togBtnAnalog->SetToolTip(_("Toggle analog/digital operation."));
-    bSizer13->Add(m_togBtnAnalog, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
-    sbSizer5->Add(bSizer13, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
-
-    // not implemented on fdmdv2
-#ifdef ALC
-    //------------------------------
-    // Toggle for ALC
-    //------------------------------
-    wxBoxSizer* bSizer14;
-    bSizer14 = new wxBoxSizer(wxVERTICAL);
-    m_togBtnALC = new wxToggleButton(this, wxID_ANY, _("ALC"), wxDefaultPosition, wxDefaultSize, 0);
-    m_togBtnALC->SetToolTip(_("Toggle automatic level control mode."));
-
-    bSizer14->Add(m_togBtnALC, 0, wxALL, 1);
-    sbSizer5->Add(bSizer14, 0, wxALIGN_CENTER|wxALIGN_CENTER_HORIZONTAL|wxALL, 1);
-#endif
-
-    //------------------------------
-    // Toggle Transmit/Receive relays
-    //------------------------------
-    wxBoxSizer* bSizer11;
-    bSizer11 = new wxBoxSizer(wxVERTICAL);
-    m_btnTogPTT = new wxToggleButton(this, wxID_ANY, _("PTT"), wxDefaultPosition, wxDefaultSize, 0);
-    m_btnTogPTT->SetToolTip(_("Push to Talk - Switch between Receive and Transmit - you can also use the space bar "));
-    bSizer11->Add(m_btnTogPTT, 1, wxALIGN_CENTER|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
-    sbSizer5->Add(bSizer11, 2, wxEXPAND, 1);
-    rightSizer->Add(sbSizer5, 2, wxALIGN_CENTER|wxALL|wxEXPAND, 3);
-    bSizer1->Add(rightSizer, 0, wxALL|wxEXPAND, 3);
-    this->SetSizer(bSizer1);
-    this->Layout();
-    m_statusBar1 = this->CreateStatusBar(3, wxST_SIZEGRIP, wxID_ANY);
-
-    //=====================================================
-    // End of layout
-    //=====================================================
-
-    //-------------------
-    // Connect Events
-    //-------------------
-    this->Connect(wxEVT_CLOSE_WINDOW, wxCloseEventHandler(TopFrame::topFrame_OnClose));
-    this->Connect(wxEVT_PAINT, wxPaintEventHandler(TopFrame::topFrame_OnPaint));
-    this->Connect(wxEVT_SIZE, wxSizeEventHandler(TopFrame::topFrame_OnSize));
-    this->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::topFrame_OnUpdateUI));
-
-    this->Connect(m_menuItemExit->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnExit));
-    this->Connect(m_menuItemOnTop->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnTop));
-
-    this->Connect(m_menuItemAudio->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsAudio));
-    this->Connect(m_menuItemAudio->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsAudioUI));
-    this->Connect(m_menuItemFilter->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsFilter));
-    this->Connect(m_menuItemFilter->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsFilterUI));
-    this->Connect(m_menuItemRigCtrlCfg->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsComCfg));
-    this->Connect(m_menuItemRigCtrlCfg->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsComCfgUI));
-    this->Connect(m_menuItemOptions->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsOptions));
-    this->Connect(m_menuItemOptions->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsOptionsUI));
-
-    this->Connect(m_menuItemPlayFileToMicIn->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnPlayFileToMicIn));
-    this->Connect(m_menuItemRecFileFromRadio->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnRecFileFromRadio));
-    this->Connect(m_menuItemPlayFileFromRadio->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnPlayFileFromRadio));
-
-    this->Connect(m_menuItemHelpUpdates->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnHelpCheckUpdates));
-    this->Connect(m_menuItemHelpUpdates->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnHelpCheckUpdatesUI));
-    this->Connect(m_menuItemAbout->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnHelpAbout));
-    //m_togRxID->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnRxID), NULL, this);
-    //m_togTxID->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnTxID), NULL, this);
-    m_sliderSQ->Connect(wxEVT_SCROLL_TOP, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Connect(wxEVT_SCROLL_BOTTOM, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Connect(wxEVT_SCROLL_LINEUP, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Connect(wxEVT_SCROLL_LINEDOWN, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Connect(wxEVT_SCROLL_PAGEUP, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Connect(wxEVT_SCROLL_PAGEDOWN, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Connect(wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Connect(wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Connect(wxEVT_SCROLL_BOTTOM, wxScrollEventHandler(TopFrame::OnSliderScrollBottom), NULL, this);
-    m_sliderSQ->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(TopFrame::OnCmdSliderScrollChanged), NULL, this);
-    m_sliderSQ->Connect(wxEVT_SCROLL_TOP, wxScrollEventHandler(TopFrame::OnSliderScrollTop), NULL, this);
-    m_ckboxSQ->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(TopFrame::OnCheckSQClick), NULL, this);
-
-    m_ckboxSNR->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(TopFrame::OnCheckSNRClick), NULL, this);
-
-    m_togBtnOnOff->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnOnOff), NULL, this);
-    m_togBtnSplit->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnSplitClick), NULL, this);
-    m_togBtnAnalog->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnAnalogClick), NULL, this);
-#ifdef ALC
-    m_togBtnALC->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnALCClick), NULL, this);
-#endif
-    m_btnTogPTT->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnPTT), NULL, this);
-
-    m_BtnCallSignReset->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnCallSignReset), NULL, this);
-    m_BtnBerReset->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnBerReset), NULL, this);
-}
-
-TopFrame::~TopFrame()
-{
-    //-------------------
-    // Disconnect Events
-    //-------------------
-    this->Disconnect(wxEVT_CLOSE_WINDOW, wxCloseEventHandler(TopFrame::topFrame_OnClose));
-    this->Disconnect(wxEVT_PAINT, wxPaintEventHandler(TopFrame::topFrame_OnPaint));
-    this->Disconnect(wxEVT_SIZE, wxSizeEventHandler(TopFrame::topFrame_OnSize));
-    this->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::topFrame_OnUpdateUI));
-    this->Disconnect(ID_EXIT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnExit));
-    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsAudio));
-    this->Disconnect(wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsAudioUI));
-    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsFilter));
-    this->Disconnect(wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsFilterUI));
-    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsComCfg));
-    this->Disconnect(wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsComCfgUI));
-    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsOptions));
-    this->Disconnect(wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsOptionsUI));
-
-    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnPlayFileToMicIn));
-    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnRecFileFromRadio));
-    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnPlayFileFromRadio));
-
-    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnHelpCheckUpdates));
-    this->Disconnect(wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnHelpCheckUpdatesUI));
-    this->Disconnect(ID_ABOUT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnHelpAbout));
-    //m_togRxID->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnRxID), NULL, this);
-    //m_togTxID->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnTxID), NULL, this);
-    m_sliderSQ->Disconnect(wxEVT_SCROLL_TOP, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Disconnect(wxEVT_SCROLL_BOTTOM, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Disconnect(wxEVT_SCROLL_LINEUP, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Disconnect(wxEVT_SCROLL_LINEDOWN, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Disconnect(wxEVT_SCROLL_PAGEUP, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Disconnect(wxEVT_SCROLL_PAGEDOWN, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Disconnect(wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Disconnect(wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Disconnect(wxEVT_SCROLL_BOTTOM, wxScrollEventHandler(TopFrame::OnSliderScrollBottom), NULL, this);
-    m_sliderSQ->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(TopFrame::OnCmdSliderScrollChanged), NULL, this);
-    m_sliderSQ->Disconnect(wxEVT_SCROLL_TOP, wxScrollEventHandler(TopFrame::OnSliderScrollTop), NULL, this);
-    m_ckboxSQ->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(TopFrame::OnCheckSQClick), NULL, this);
-
-    m_togBtnOnOff->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnOnOff), NULL, this);
-    m_togBtnSplit->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnSplitClick), NULL, this);
-    m_togBtnAnalog->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnAnalogClick), NULL, this);
-#ifdef ALC
-    m_togBtnALC->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnALCClick), NULL, this);
-#endif
-    m_btnTogPTT->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnPTT), NULL, this);
-
-}
-
diff --git a/fdmdv2/branches/0.99/src/topFrame.h b/fdmdv2/branches/0.99/src/topFrame.h
deleted file mode 100644 (file)
index 4341315..0000000
+++ /dev/null
@@ -1,183 +0,0 @@
-//==========================================================================
-// Name:            topFrame.h
-//
-// Purpose:         Implements simple wxWidgets application with GUI.
-// Created:         Apr. 9, 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 Lesser 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 Lesser General Public License
-//  along with this program; if not, see <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#ifndef __TOPFRAME_H__
-#define __TOPFRAME_H__
-
-#include "version.h"
-#include <wx/artprov.h>
-#include <wx/xrc/xmlres.h>
-#include <wx/intl.h>
-#include <wx/string.h>
-#include <wx/bitmap.h>
-#include <wx/image.h>
-#include <wx/icon.h>
-#include <wx/menu.h>
-#include <wx/gdicmn.h>
-#include <wx/font.h>
-#include <wx/colour.h>
-#include <wx/settings.h>
-#include <wx/gauge.h>
-#include <wx/textctrl.h>
-#include <wx/sizer.h>
-#include <wx/statbox.h>
-#include <wx/aui/auibook.h>
-#include <wx/tglbtn.h>
-#include <wx/slider.h>
-#include <wx/checkbox.h>
-#include <wx/statusbr.h>
-#include <wx/frame.h>
-#include <wx/statbmp.h>
-#include <wx/stattext.h>
-#include <wx/button.h>
-#include <wx/dialog.h>
-#include <wx/radiobut.h>
-#include <wx/combobox.h>
-#include <wx/panel.h>
-#include <wx/listbox.h>
-#include <wx/notebook.h>
-#include <wx/listctrl.h>
-
-
-///////////////////////////////////////////////////////////////////////////
-
-#define ID_OPEN 1000
-#define ID_SAVE 1001
-#define ID_CLOSE 1002
-#define ID_EXIT 1003
-#define ID_COPY 1004
-#define ID_CUT 1005
-#define ID_PASTE 1006
-#define ID_OPTIONS 1007
-#define ID_ABOUT 1008
-
-///////////////////////////////////////////////////////////////////////////////
-/// Class TopFrame
-///////////////////////////////////////////////////////////////////////////////
-class TopFrame : public wxFrame
-{
-    private:
-
-    protected:
-        wxMenuBar* m_menubarMain;
-        wxMenu* file;
-        wxMenu* edit;
-        wxMenu* tools;
-        wxMenu* help;
-        wxGauge* m_gaugeSNR;
-        wxStaticText* m_textSNR;
-        wxCheckBox* m_ckboxSNR;
-        wxGauge* m_gaugeLevel;
-        wxStaticText* m_textLevel;
-
-        wxButton*     m_BtnCallSignReset;
-        wxTextCtrl*   m_txtCtrlCallSign;
-        wxStaticText* m_txtChecksumGood;
-        wxStaticText* m_txtChecksumBad;
-
-        wxSlider* m_sliderSQ;
-        wxCheckBox* m_ckboxSQ;
-        wxStaticText* m_textSQ;
-        wxStatusBar* m_statusBar1;
-
-        wxButton*     m_BtnBerReset;
-        wxStaticText  *m_textBits;
-        wxStaticText  *m_textErrors;
-        wxStaticText  *m_textBER;
-
-        wxRadioButton *m_rbSync;
-        wxRadioButton *m_rb1400old;
-        wxRadioButton *m_rb1400;
-        wxRadioButton *m_rb700;
-        wxRadioButton *m_rb1600;
-        wxRadioButton *m_rb2000;
-        wxRadioButton *m_rb1600Wide;
-
-        // Virtual event handlers, overide them in your derived class
-        virtual void topFrame_OnClose( wxCloseEvent& event ) { event.Skip(); }
-        virtual void topFrame_OnPaint( wxPaintEvent& event ) { event.Skip(); }
-        virtual void topFrame_OnSize( wxSizeEvent& event ) { event.Skip(); }
-        virtual void topFrame_OnUpdateUI( wxUpdateUIEvent& event ) { event.Skip(); }
-
-        virtual void OnExit( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnTop( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnToolsAudio( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnToolsAudioUI( wxUpdateUIEvent& event ) { event.Skip(); }
-        virtual void OnToolsFilter( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnToolsFilterUI( wxUpdateUIEvent& event ) { event.Skip(); }
-        virtual void OnToolsOptions( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnToolsUDP( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnToolsOptionsUI( wxUpdateUIEvent& event ) { event.Skip(); }
-        virtual void OnToolsComCfg( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnToolsComCfgUI( wxUpdateUIEvent& event ) { event.Skip(); }
-        virtual void OnPlayFileToMicIn( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnRecFileFromRadio( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnPlayFileFromRadio( wxCommandEvent& event ) { event.Skip(); }
-
-        virtual void OnHelpCheckUpdates( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnHelpCheckUpdatesUI( wxUpdateUIEvent& event ) { event.Skip(); }
-        virtual void OnHelpAbout( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnTogBtnRxID( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnTogBtnTxID( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnCmdSliderScroll( wxScrollEvent& event ) { event.Skip(); }
-        virtual void OnSliderScrollBottom( wxScrollEvent& event ) { event.Skip(); }
-        virtual void OnCmdSliderScrollChanged( wxScrollEvent& event ) { event.Skip(); }
-        virtual void OnSliderScrollTop( wxScrollEvent& event ) { event.Skip(); }
-        virtual void OnCheckSQClick( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnCheckSNRClick( wxCommandEvent& event ) { event.Skip(); }
-
-        virtual void OnTogBtnLoopRx( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnTogBtnLoopTx( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnTogBtnOnOff( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnTogBtnSplitClick( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnTogBtnAnalogClick( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnTogBtnALCClick( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnTogBtnPTT( wxCommandEvent& event ) { event.Skip(); }
-
-        virtual void OnTogBtnSplitClickUI(wxUpdateUIEvent& event) { event.Skip(); }
-        virtual void OnTogBtnAnalogClickUI(wxUpdateUIEvent& event) { event.Skip(); }
-        virtual void OnTogBtnALCClickUI(wxUpdateUIEvent& event) { event.Skip(); }
-        virtual void OnTogBtnRxIDUI(wxUpdateUIEvent& event ) { event.Skip(); }
-        virtual void OnTogBtnTxIDUI(wxUpdateUIEvent& event ) { event.Skip(); }
-        virtual void OnTogBtnPTT_UI(wxUpdateUIEvent& event ) { event.Skip(); }
-        virtual void OnTogBtnOnOffUI(wxUpdateUIEvent& event ) { event.Skip(); }
-
-        virtual void OnCallSignReset( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnBerReset( wxCommandEvent& event ) { event.Skip(); }
-
-    public:
-        wxToggleButton* m_togRxID;
-        wxToggleButton* m_togTxID;
-        wxToggleButton* m_togBtnOnOff;
-        wxToggleButton* m_togBtnSplit;
-        wxToggleButton* m_togBtnAnalog;
-        wxToggleButton* m_togBtnALC;
-        wxToggleButton* m_btnTogPTT;
-        wxToggleButton* m_togBtnLoopRx;
-        wxToggleButton* m_togBtnLoopTx;
-        wxAuiNotebook* m_auiNbookCtrl;
-
-        TopFrame( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("FreeDV ") + _(FREEDV_VERSION), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(561,300 ), long style = wxDEFAULT_FRAME_STYLE|wxRESIZE_BORDER|wxTAB_TRAVERSAL );
-
-        ~TopFrame();
-};
-
-#endif //__TOPFRAME_H__
diff --git a/fdmdv2/cmake/.gitignore b/fdmdv2/cmake/.gitignore
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/fdmdv2/src/.gitignore b/fdmdv2/src/.gitignore
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/fdmdv2/tags/0.99-Beta/.clang/.gitignore b/fdmdv2/tags/0.99-Beta/.clang/.gitignore
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/fdmdv2/tags/0.99-Beta/CMakeLists.txt b/fdmdv2/tags/0.99-Beta/CMakeLists.txt
deleted file mode 100644 (file)
index 40e95e3..0000000
+++ /dev/null
@@ -1,487 +0,0 @@
-#
-# FreeDV - HF Digital Voice for Radio Amateurs
-#
-# CMake configuration contributed by Richard Shaw (KF5OIM)
-# Please report questions, comments, problems, or patches to the freetel
-# mailing list: https://lists.sourceforge.net/lists/listinfo/freetel-codec2
-#
-
-cmake_minimum_required(VERSION 2.8)
-
-# Prevent in-source builds to protect automake/autoconf config.
-# If an in-source build is attempted, you will still need to clean up a few
-# files manually.
-set(CMAKE_DISABLE_SOURCE_CHANGES ON)
-set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
-if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
-  message(FATAL_ERROR "In-source builds in ${CMAKE_BINARY_DIR} are not "   
-   "allowed, please remove ./CMakeCache.txt and ./CMakeFiles/, create a "
-   "separate build directory and run cmake from there.")
-endif("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
-
-# Set local module path.
-list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
-
-project(FreeDV)
-
-#
-# Set FreeDV version and generate src/version.h
-#
-set(FREEDV_VERSION_MAJOR 0)
-set(FREEDV_VERSION_MINOR 99)
-set(FREEDV_VERSION_PATCH FALSE)
-set(FREEDV_VERSION ${FREEDV_VERSION_MAJOR}.${FREEDV_VERSION_MINOR})
-if(FREEDV_VERSION_PATCH)
-    set(FREEDV_VERSION ${FREEDV_VERSION}.${FREEDV_VERSION_PATCH})
-endif()
-set(FREEDV_VERSION_SUFFIX "Beta")
-if(FREEDV_VERSION_SUFFIX)
-    set(FREEDV_VERSION_STRING "${FREEDV_VERSION} ${FREEDV_VERSION_SUFFIX}")
-endif()
-message(STATUS "FreeDV version: ${FREEDV_VERSION_STRING}")
-configure_file(cmake/version.h.in src/version.h @ONLY)
-
-# Set default build type
-if(NOT CMAKE_BUILD_TYPE)
-    set(CMAKE_BUILD_TYPE "Release")
-    message(STATUS "Build type not specified, defaulting to ${CMAKE_BUILD_TYPE}")
-endif(NOT CMAKE_BUILD_TYPE)
-
-
-# Work around for not using a svn working copy.
-add_definitions(-D_NO_AUTOTOOLS_)
-find_program(SVNVERSION_PATH svnversion)
-if(SVNVERSION_PATH)
-    execute_process(COMMAND ${SVNVERSION_PATH} .
-        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-        RESULT_VARIABLE SVN_REVISION_RESULT
-        OUTPUT_VARIABLE SVN_CURRENT_REVISION
-        ERROR_QUIET
-    )
-else()
-    set(SVN_REVISION_RESULT 1)
-endif()
-if(SVN_REVISION_RESULT EQUAL 0)
-string(STRIP ${SVN_CURRENT_REVISION} SVN_REVISION)
-add_definitions(-DSVN_REVISION="${SVN_REVISION}")
-else()
-add_definitions(-DSVN_REVISION="Unversioned directory")
-endif()
-
-
-# Set default build flags.
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
-
-#
-# Setup cmake options
-#
-set(CMAKE_VERBOSE_MAKEFILE TRUE CACHE BOOL "Verbose makefile.")
-set(USE_STATIC_DEPS FALSE CACHE BOOL 
-    "Download and build static libraries instead of system libraries.")
-set(USE_STATIC_PORTAUDIO FALSE CACHE BOOL 
-    "Download and build static portaudio instead of the system library.")
-set(USE_STATIC_SNDFILE FALSE CACHE BOOL
-    "Download and build static sndfile instead of the system library.")
-set(USE_STATIC_SAMPLERATE FALSE CACHE BOOL
-    "Download and build static samplerate instead of the system library.")
-set(USE_STATIC_SOX FALSE CACHE BOOL
-    "Download and build static sox instead of the system library.")
-set(USE_STATIC_CODEC2 FALSE CACHE BOOL
-    "Download and build static codec2 instead of the system library.")
-set(USE_STATIC_SPEEXDSP FALSE CACHE BOOL
-    "Download and build static speex instead of the system library.")
-set(BOOTSTRAP_WXWIDGETS FALSE CACHE BOOL
-    "Download and build static wxWidgets instead of the system library.")
-
-if(USE_STATIC_DEPS)
-    set(USE_STATIC_PORTAUDIO TRUE FORCE)
-    set(USE_STATIC_SNDFILE TRUE FORCE)
-    set(USE_STATIC_SAMPLERATE TRUE FORCE)
-    set(USE_STATIC_SOX TRUE FORCE)
-    set(USE_STATIC_CODEC2 TRUE FORCE)
-endif(USE_STATIC_DEPS)
-
-#
-# Pull in external wxWidgets target if performing static build.
-#
-if(BOOTSTRAP_WXWIDGETS)
-    message(STATUS "Adding wxWidgets build target...")
-    include(cmake/BuildWxWidgets.cmake)
-endif(BOOTSTRAP_WXWIDGETS)
-
-#
-# Perform bootstrap build of wxWidgets
-#
-if(BOOTSTRAP_WXWIDGETS AND NOT EXISTS ${WXCONFIG})
-    message(STATUS "Will perform bootstrap build of wxWidgets.
-   After make step completes, re-run cmake and make again to perform FreeDV build.")
-#
-# Continue normal build if not bootstrapping wxWidgets or is already built.
-#
-else(BOOTSTRAP_WXWIDGETS AND NOT EXISTS ${WXCONFIG})
-
-
-#
-# Various hacks and work arounds for building under MinGW.
-#
-if(MINGW)
-    message(STATUS "System is MinGW.")
-    # Setup HOST variable.
-    include(cmake/MinGW.cmake)
-    # This sets up the exe icon for windows under mingw.
-    set(RES_FILES "")
-    set(RES_FILES "${CMAKE_SOURCE_DIR}/contrib/freedv.rc")
-    set(CMAKE_RC_COMPILER_INIT windres)
-    enable_language(RC)
-    set(CMAKE_RC_COMPILE_OBJECT
-        "<CMAKE_RC_COMPILER> <FLAGS> -O coff <DEFINES> -i <SOURCE> -o <OBJECT>")
-    # These are DLOPEN'ed and can't be automatically pulled in by dependency.
-    foreach(RUNTIME
-        hamlib-adat.dll
-        hamlib-alinco.dll
-        hamlib-amsat.dll
-        hamlib-aor.dll
-        hamlib-ars.dll
-        hamlib-celestron.dll
-        hamlib-drake.dll
-        hamlib-dummy.dll
-        hamlib-easycomm.dll
-        hamlib-flexradio.dll
-        hamlib-fodtrack.dll
-        hamlib-gs232a.dll
-        hamlib-heathkit.dll
-        hamlib-icom.dll
-        hamlib-jrc.dll
-        hamlib-kachina.dll
-        hamlib-kenwood.dll
-        hamlib-kit.dll
-        hamlib-lowe.dll
-        hamlib-m2.dll
-        hamlib-pcr.dll
-        hamlib-prm80.dll
-        hamlib-racal.dll
-        hamlib-rft.dll
-        hamlib-rotorez.dll
-        hamlib-rs.dll
-        hamlib-sartek.dll
-        hamlib-skanti.dll
-        hamlib-spid.dll
-        hamlib-tapr.dll
-        hamlib-tentec.dll
-        hamlib-ts7400.dll
-        hamlib-tuner.dll
-        hamlib-uniden.dll
-        hamlib-winradio.dll
-        hamlib-wj.dll
-        hamlib-yaesu.dll)
-        message(STATUS "Checking for ${RUNTIME}")
-        find_library(${RUNTIME}_LIB ${RUNTIME}
-            PATH_SUFFIXES hamlib)
-        message(STATUS "runtime found: ${${RUNTIME}_LIB}")
-        list(APPEND CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS ${${RUNTIME}_LIB})
-    endforeach()
-    include(InstallRequiredSystemLibraries)
-endif(MINGW)
-
-# Math library is automatic on MinGW
-if(UNIX)
-    set(CMAKE_REQUIRED_INCLUDES math.h)
-    set(CMAKE_REQUIRED_LIBRARIES m)
-endif(UNIX)
-
-# Find some standard headers and functions.
-include(CheckIncludeFiles)
-check_include_files("limits.h" HAVE_LIMITS_H)
-check_include_files("stddef.h" HAVE_STDDEF_H)
-check_include_files("stdlib.h" HAVE_STDLIB_H)
-check_include_files("string.h" HAVE_STRING_H)
-
-include(CheckTypeSize)
-check_type_size("int" SIZEOF_INT)
-
-include(CheckFunctionExists)
-check_function_exists(floor HAVE_FLOOR)
-check_function_exists(memset HAVE_MEMSET)
-check_function_exists(pow HAVE_POW)
-check_function_exists(sqrt HAVE_SQRT)
-
-# fdmdv2_main.h requires patching to find config.h as it current looks in the
-# source directory and the generated file goes in the binary directory.
-configure_file ("${PROJECT_SOURCE_DIR}/cmake/config.h.in"
-                "${PROJECT_BINARY_DIR}/config.h" )
-include_directories(${PROJECT_BINARY_DIR})
-add_definitions(-DHAVE_CONFIG_H)
-
-# Pthread Library
-find_package(Threads REQUIRED)
-message(STATUS "Threads library flags: ${CMAKE_THREAD_LIBS_INIT}")
-
-#
-# Find codec2
-#
-if(NOT USE_STATIC_CODEC2)
-    message(STATUS "Looking for codec2...")
-    find_package(codec2 CONFIG QUIET)
-    if(codec2_FOUND)
-        get_target_property(CODEC2_LIBRARY codec2 LOCATION)
-        message(STATUS "  codec2 library: ${CODEC2_LIBRARY}")
-        message(STATUS "  codec2 headers: ${codec2_INCLUDE_DIRS}")
-    else()
-        # Try to find manually
-        find_path(CODEC2_INCLUDE_DIRS codec2.h
-                  PATH_SUFFIXES codec2)
-        find_library(CODEC2_LIBRARY NAMES codec2)
-        if(CODEC2_LIBRARY AND CODEC2_INCLUDE_DIRS)
-            message(STATUS "  codec2 library: ${CODEC2_LIBRARY}")
-            message(STATUS "  codec2 headers: ${CODEC2_INCLUDE_DIRS}")
-            list(APPEND FREEDV_LINK_LIBS ${CODEC2_LIBRARY})
-            include_directories(${CODEC2_INCLUDE_DIRS})
-        else()
-            message(FATAL_ERROR "codec2 library not found.
-Linux: 
-Codec2 may not be in your distribution so build yourself or use the cmake option to build statically into FreeDV.
-Windws:
-It's easiest to use the cmake option: USE_STATIC_CODEC2"
-        )
-        endif()
-    endif()
-else(NOT USE_STATIC_CODEC2)
-    message(STATUS "Will attempt static build of codec2.")
-    include(cmake/BuildCodec2.cmake)
-endif(NOT USE_STATIC_CODEC2)
-
-#
-# Find or build portaudio Library
-#
-if(NOT USE_STATIC_PORTAUDIO)
-    message(STATUS "Looking for portaudio...")
-    find_package(Portaudio REQUIRED)
-    if(PORTAUDIO_FOUND)
-        message(STATUS "  portaudio library: ${PORTAUDIO_LIBRARIES}")
-        message(STATUS "  portaudio headers: ${PORTAUDIO_INCLUDE_DIRS}")
-        list(APPEND FREEDV_LINK_LIBS ${PORTAUDIO_LIBRARIES})
-        include_directories(${PORTAUDIO_INCLUDE_DIRS})
-    else()
-        message(FATAL_ERROR "portaudio library not found.
-On Linux systems try installing:
-    portaudio-devel  (RPM based systems)
-    libportaudio-dev (DEB based systems)
-On Windows it's easiest to use the cmake option: USE_STATIC_PORTAUDIO"
-        )
-    endif()
-    if(NOT ${PORTAUDIO_VERSION} EQUAL 19)
-        message(WARNING "Portaudio versions other than 19 are known to have issues. You have been warned!")
-    endif()
-else(NOT USE_STATIC_PORTAUDIO)
-    message(STATUS "Will attempt static build of portaudio.")
-    include(cmake/BuildPortaudio.cmake)
-endif(NOT USE_STATIC_PORTAUDIO)
-
-#
-# Hamlib library
-#
-message(STATUS "Looking for hamlib...")
-find_path(HAMLIB_INCLUDE_DIR hamlib/rig.h)
-find_library(HAMLIB_LIBRARY hamlib)
-message(STATUS "Hamlib library: ${HAMLIB_LIBRARY}")
-message(STATUS "Hamlib headers: ${HAMLIB_INCLUDE_DIR}")
-if(HAMLIB_LIBRARY AND HAMLIB_INCLUDE_DIR)
-    message(STATUS "Hamlib library found.")
-    include_directories(${HAMLIB_INCLUDE_DIR})
-    list(APPEND FREEDV_LINK_LIBS ${HAMLIB_LIBRARY})
-else(HAMLIB_LIBRARY AND HAMLIB_INCLUDE_DIR)
-    message(FATAL_ERROR "hamlib not found.
-On Linux systems try installing:
-    hamlib-devel  (RPM based systems)
-    libhamlib-dev (DEB based systems)"
-    )
-endif(HAMLIB_LIBRARY AND HAMLIB_INCLUDE_DIR)
-
-
-#
-# Samplerate Library
-#
-if(NOT USE_STATIC_SAMPLERATE)
-    message(STATUS "Looking for samplerate...")
-    find_library(LIBSAMPLERATE samplerate)
-    find_path(LIBSAMPLERATE_INCLUDE_DIR samplerate.h)
-    message(STATUS "  samplerate library: ${LIBSAMPLERATE}")
-    message(STATUS "  samplerate headers: ${LIBSAMPLERATE_INCLUDE_DIR}")
-    if(LIBSAMPLERATE AND LIBSAMPLERATE_INCLUDE_DIR)
-        list(APPEND FREEDV_LINK_LIBS ${LIBSAMPLERATE})
-        include_directories(${LIBSAMPLERATE_INCLUDE_DIR})
-    else(LIBSTAMPLERATE AND LIBSAMPLERATE_INCLUDE_DIR)
-        message(FATAL_ERROR "samplerate library not found.
-On Linux systems try installing:
-    samplerate-devel  (RPM based systems)
-    libsamplerate-dev (DEB based systems)
-On Windows it's easiest to use the cmake option: USE_STATIC_SAMPLERATE"
-        )
-    endif(LIBSAMPLERATE AND LIBSAMPLERATE_INCLUDE_DIR)
-else(NOT USE_STATIC_SAMPLERATE)
-    message(STATUS "Will attempt static build of samplerate.")
-    include(cmake/BuildSamplerate.cmake)
-endif(NOT USE_STATIC_SAMPLERATE)
-
-#
-# Find sox library
-#
-if(NOT USE_STATIC_SOX)
-    message(STATUS "Looking for sox...")
-    find_library(LIBSOX_LIBRARY sox)
-    find_path(LIBSOX_INCLUDE_DIR NAMES sox/sox.h sox.h)
-    message(STATUS "  sox library: ${LIBSOX_LIBRARY}")
-    message(STATUS "  sox headers: ${LIBSOX_INCLUDE_DIR}")
-    if(LIBSOX_LIBRARY AND LIBSOX_INCLUDE_DIR)
-        list(APPEND FREEDV_LINK_LIBS ${LIBSOX_LIBRARY})
-        include_directories(${LIBSOX_INCLUDE_DIR})
-    else(LIBSOX_LIBRARY AND LIBSOX_INCLUDE_DIR)
-        message(FATAL_ERROR "sox library not found.
-On Linux systems try installing:
-    sox-devel (RPM based systems)
-    libsox-dev (DEB based systems)
-On Windows it's easiest to use the cmake option: USE_STATIC_SOX"
-        )
-    endif(LIBSOX_LIBRARY AND LIBSOX_INCLUDE_DIR)
-else(NOT USE_STATIC_SOX)
-    message(STATUS "Will attempt static build of sox.")
-    include(cmake/BuildSox.cmake)
-endif(NOT USE_STATIC_SOX)
-
-#    
-# sndfile Library
-#
-if(NOT USE_STATIC_SNDFILE)
-    message(STATUS "Looking for sndfile...")
-    find_library(LIBSNDFILE sndfile)
-    find_path(LIBSNDFILE_INCLUDE_DIR sndfile.h)
-    message(STATUS "  sndfile library: ${LIBSNDFILE}")
-    message(STATUS "  sndfile headers: ${LIBSNDFILE_INCLUDE_DIR}")
-    if(LIBSNDFILE AND LIBSNDFILE_INCLUDE_DIR)
-        list(APPEND FREEDV_LINK_LIBS ${LIBSNDFILE})
-    else(LIBSNDFILE AND LIBSNDFILE_INCLUDE_DIR)
-        message(FATAL_ERROR "sndfile library not found.
-On Linux systems try installing:
-    libsndfile-devel (RPM based systems)
-    libsndfile-dev   (DEB based systems)
-On Windows it's easiest to use the cmake option: USE_STATIC_SNDFILE"
-        )
-    endif(LIBSNDFILE AND LIBSNDFILE_INCLUDE_DIR)
-else(NOT USE_STATIC_SNDFILE)
-    message(STATUS "Will attempt static build of sndfile.")
-    include(cmake/BuildSndfile.cmake)
-endif(NOT USE_STATIC_SNDFILE)
-
-#
-# Find wxWidgets
-#
-if(NOT BOOTSTRAP_WXWIDGETS)
-    set(WXCONFIG "" CACHE FILEPATH "Location of wx-config binary.")
-    set(WXRC "" CACHE FILEPATH "Location of wxrc binary.")
-endif(NOT BOOTSTRAP_WXWIDGETS)
-#if(BOOTSTRAP_WXWIDGETS)
-#    set(WXCONFIG "${CMAKE_BINARY_DIR}/external/dist/bin/wx-config")
-#    set(WXRC "${CMAKE_BINARY_DIR}/external/dist/bin/wxrc")
-#    list(APPEND FREEDV_STATIC_DEPS wxWidgets)
-#endif(BOOTSTRAP_WXWIDGETS)
-message(STATUS "Looking for wxWidgets...")
-if(WXCONFIG)
-    message(STATUS "wx-config: ${WXCONFIG}")
-    set(wxWidgets_CONFIG_EXECUTABLE ${WXCONFIG})
-endif(WXCONFIG)
-if(WXRC)
-    message(STATUS "wxrc: ${WXRC}")
-    set(wxWidgets_wxrc_EXECUTABLE ${WXRC})
-endif(WXRC)
-set(WX_VERSION_MIN 3.0.0)
-find_package(wxWidgets REQUIRED core base aui html net adv)
-execute_process(COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}" --version
-    OUTPUT_VARIABLE WX_VERSION)
-string(STRIP ${WX_VERSION} WX_VERSION)
-if(WX_VERSION VERSION_EQUAL ${WX_VERSION_MIN}
-    OR WX_VERSION VERSION_GREATER ${WX_VERSION_MIN})
-   message(STATUS "wxWidgets version: ${WX_VERSION}")
-else()
-    message(FATAL_ERROR "wxWidgets must be installed on your system.
-Please check that wx-config is in path, the directory
-where wxWidgets libraries are installed (returned by
-'wx-config --libs' or 'wx-config --static --libs' command)
-is in LD_LIBRARY_PATH or equivalent variable and
-wxWidgets version is ${WX_VERSION_MIN} or above.")
-endif()
-if(wxWidgets_FOUND)
-    include("${wxWidgets_USE_FILE}")
-    list(APPEND FREEDV_LINK_LIBS ${wxWidgets_LIBRARIES})
-endif(wxWidgets_FOUND)
-
-#
-# Find speex library
-#
-if(NOT USE_STATIC_SPEEXDSP)
-    message(STATUS "Looking for Speex DSP library.")
-    find_path(SPEEXDSP_INCLUDE_DIR speex/speex.h)
-    find_library(SPEEXDSP_LIBRARY speexdsp)
-    message(STATUS "  Speex DSP headers: ${SPEEXDSP_INCLUDE_DIR}")
-    message(STATUS "  Speex DSP library: ${SPEEXDSP_LIBRARY}")
-    if(SPEEXDSP_INCLUDE_DIR AND SPEEXDSP_LIBRARY)
-        include_directories(${SPEEXDSP_INCLUDE_DIR})
-        list(APPEND FREEDV_LINK_LIBS ${SPEEXDSP_LIBRARY})
-    else(SPEEXDSP_INCLUDE_DIR AND SPEEXDSP_LIBRARY)
-        message(FATAL_ERROR "Speex DSP library not found!")
-    endif(SPEEXDSP_INCLUDE_DIR AND SPEEXDSP_LIBRARY)
-else()
-    message(STATUS "Will attempt static build of speex.")
-    include(cmake/BuildSpeex.cmake)
-endif()
-    
-#Freedv 
-add_subdirectory(src)
-
-# Icons and desktop file
-add_subdirectory(contrib)
-
-message(STATUS "Build type will be: ${CMAKE_BUILD_TYPE}")
-
-#
-# Cpack NSIS configuration for Windows.
-#
-if(WIN32)
-    # Detect if we're doing a 32-bit or 64-bit windows build.
-    if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
-        set(CMAKE_CL_64 TRUE)
-    endif()
-    if(NOT ${CMAKE_BUILD_TYPE} STREQUAL "Debug")
-        set(CPACK_STRIP_FILES TRUE)
-    endif()
-    configure_file(cmake/GetDependencies.cmake.in cmake/GetDependencies.cmake
-        @ONLY
-    )
-    install(SCRIPT ${CMAKE_BINARY_DIR}/cmake/GetDependencies.cmake)
-    set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "HF Digital Voice for Radio Amateurs")
-    set(CPACK_PACKAGE_VENDOR "CMake")
-    #set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
-    set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
-    set(CPACK_PACKAGE_VERSION_MAJOR ${FREEDV_VERSION_MAJOR})
-    set(CPACK_PACKAGE_VERSION_MINOR ${FREEDV_VERSION_MINOR})
-    # CPack expects a patch level version so set it here and override if we
-    # are actually setting one.
-    set(CPACK_PACKAGE_VERSION_PATCH 0)
-    if(FREEDV_VERSION_PATCH)
-        set(CPACK_PACKAGE_VERSION_PATCH ${FREEDV_VERSION_PATCH})
-    endif()
-    if(FREEDV_VERSION_SUFFIX)
-        set(CPACK_PACKAGE_VERSION_PATCH "${CPACK_PACKAGE_VERSION_PATCH}-${FREEDV_VERSION_SUFFIX}")
-    endif()
-    # There is a bug in NSI that does not handle full unix paths properly. Make
-    # sure there is at least one set of four (4) backlasshes.
-    #set(CPACK_PACKAGE_ICON "${CMake_SOURCE_DIR}/Utilities/Release\\\\InstallIcon.bmp")
-    set(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\freedv.exe")
-    set(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}")
-    set(CPACK_NSIS_PACKAGE_NAME "FreeDV")
-    set(CPACK_NSIS_URL_INFO_ABOUT "http://freedv.org")
-    set(CPACK_NSIS_MODIFY_PATH OFF)
-    set(CPACK_NSIS_MENU_LINKS "http://freedv.org" "FreeDV Homepage")
-    include(CPack)
-endif(WIN32)
-
-endif(BOOTSTRAP_WXWIDGETS AND NOT EXISTS ${WXCONFIG})
diff --git a/fdmdv2/tags/0.99-Beta/COPYING b/fdmdv2/tags/0.99-Beta/COPYING
deleted file mode 100644 (file)
index cfd4e99..0000000
+++ /dev/null
@@ -1,502 +0,0 @@
-                  GNU LESSER GENERAL PUBLIC LICENSE
-                       Version 2.1, February 1999
-
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.
- 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the Lesser GPL.  It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
-                            Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
-  This license, the Lesser General Public License, applies to some
-specially designated software packages--typically libraries--of the
-Free Software Foundation and other authors who decide to use it.  You
-can use it too, but we suggest you first think carefully about whether
-this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations below.
-
-  When we speak of free software, we are referring to freedom of use,
-not price.  Our General Public Licenses are designed to make sure that
-you have the freedom to distribute copies of free software (and charge
-for this service if you wish); that you receive source code or can get
-it if you want it; that you can change the software and use pieces of
-it in new free programs; and that you are informed that you can do
-these things.
-
-  To protect your rights, we need to make restrictions that forbid
-distributors to deny you these rights or to ask you to surrender these
-rights.  These restrictions translate to certain responsibilities for
-you if you distribute copies of the library or if you modify it.
-
-  For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you.  You must make sure that they, too, receive or can get the source
-code.  If you link other code with the library, you must provide
-complete object files to the recipients, so that they can relink them
-with the library after making changes to the library and recompiling
-it.  And you must show them these terms so they know their rights.
-
-  We protect your rights with a two-step method: (1) we copyright the
-library, and (2) we offer you this license, which gives you legal
-permission to copy, distribute and/or modify the library.
-
-  To protect each distributor, we want to make it very clear that
-there is no warranty for the free library.  Also, if the library is
-modified by someone else and passed on, the recipients should know
-that what they have is not the original version, so that the original
-author's reputation will not be affected by problems that might be
-introduced by others.
-\f
-  Finally, software patents pose a constant threat to the existence of
-any free program.  We wish to make sure that a company cannot
-effectively restrict the users of a free program by obtaining a
-restrictive license from a patent holder.  Therefore, we insist that
-any patent license obtained for a version of the library must be
-consistent with the full freedom of use specified in this license.
-
-  Most GNU software, including some libraries, is covered by the
-ordinary GNU General Public License.  This license, the GNU Lesser
-General Public License, applies to certain designated libraries, and
-is quite different from the ordinary General Public License.  We use
-this license for certain libraries in order to permit linking those
-libraries into non-free programs.
-
-  When a program is linked with a library, whether statically or using
-a shared library, the combination of the two is legally speaking a
-combined work, a derivative of the original library.  The ordinary
-General Public License therefore permits such linking only if the
-entire combination fits its criteria of freedom.  The Lesser General
-Public License permits more lax criteria for linking other code with
-the library.
-
-  We call this license the "Lesser" General Public License because it
-does Less to protect the user's freedom than the ordinary General
-Public License.  It also provides other free software developers Less
-of an advantage over competing non-free programs.  These disadvantages
-are the reason we use the ordinary General Public License for many
-libraries.  However, the Lesser license provides advantages in certain
-special circumstances.
-
-  For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it becomes
-a de-facto standard.  To achieve this, non-free programs must be
-allowed to use the library.  A more frequent case is that a free
-library does the same job as widely used non-free libraries.  In this
-case, there is little to gain by limiting the free library to free
-software only, so we use the Lesser General Public License.
-
-  In other cases, permission to use a particular library in non-free
-programs enables a greater number of people to use a large body of
-free software.  For example, permission to use the GNU C Library in
-non-free programs enables many more people to use the whole GNU
-operating system, as well as its variant, the GNU/Linux operating
-system.
-
-  Although the Lesser General Public License is Less protective of the
-users' freedom, it does ensure that the user of a program that is
-linked with the Library has the freedom and the wherewithal to run
-that program using a modified version of the Library.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.  Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library".  The
-former contains code derived from the library, whereas the latter must
-be combined with the library in order to run.
-\f
-                  GNU LESSER GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License Agreement applies to any software library or other
-program which contains a notice placed by the copyright holder or
-other authorized party saying it may be distributed under the terms of
-this Lesser General Public License (also called "this License").
-Each licensee is addressed as "you".
-
-  A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
-  The "Library", below, refers to any such software library or work
-which has been distributed under these terms.  A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language.  (Hereinafter, translation is
-included without limitation in the term "modification".)
-
-  "Source code" for a work means the preferred form of the work for
-making modifications to it.  For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
-  Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it).  Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-
-  1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
-  You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-\f
-  2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) The modified work must itself be a software library.
-
-    b) You must cause the files modified to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    c) You must cause the whole of the work to be licensed at no
-    charge to all third parties under the terms of this License.
-
-    d) If a facility in the modified Library refers to a function or a
-    table of data to be supplied by an application program that uses
-    the facility, other than as an argument passed when the facility
-    is invoked, then you must make a good faith effort to ensure that,
-    in the event an application does not supply such function or
-    table, the facility still operates, and performs whatever part of
-    its purpose remains meaningful.
-
-    (For example, a function in a library to compute square roots has
-    a purpose that is entirely well-defined independent of the
-    application.  Therefore, Subsection 2d requires that any
-    application-supplied function or table used by this function must
-    be optional: if the application does not supply it, the square
-    root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library.  To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License.  (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.)  Do not make any other change in
-these notices.
-\f
-  Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
-  This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
-  4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
-  If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-  5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library".  Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
-  However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library".  The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
-  When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library.  The
-threshold for this to be true is not precisely defined by law.
-
-  If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work.  (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
-  Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-\f
-  6. As an exception to the Sections above, you may also combine or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
-  You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License.  You must supply a copy of this License.  If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License.  Also, you must do one
-of these things:
-
-    a) Accompany the work with the complete corresponding
-    machine-readable source code for the Library including whatever
-    changes were used in the work (which must be distributed under
-    Sections 1 and 2 above); and, if the work is an executable linked
-    with the Library, with the complete machine-readable "work that
-    uses the Library", as object code and/or source code, so that the
-    user can modify the Library and then relink to produce a modified
-    executable containing the modified Library.  (It is understood
-    that the user who changes the contents of definitions files in the
-    Library will not necessarily be able to recompile the application
-    to use the modified definitions.)
-
-    b) Use a suitable shared library mechanism for linking with the
-    Library.  A suitable mechanism is one that (1) uses at run time a
-    copy of the library already present on the user's computer system,
-    rather than copying library functions into the executable, and (2)
-    will operate properly with a modified version of the library, if
-    the user installs one, as long as the modified version is
-    interface-compatible with the version that the work was made with.
-
-    c) Accompany the work with a written offer, valid for at
-    least three years, to give the same user the materials
-    specified in Subsection 6a, above, for a charge no more
-    than the cost of performing this distribution.
-
-    d) If distribution of the work is made by offering access to copy
-    from a designated place, offer equivalent access to copy the above
-    specified materials from the same place.
-
-    e) Verify that the user has already received a copy of these
-    materials or that you have already sent this user a copy.
-
-  For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it.  However, as a special exception,
-the materials to be distributed need not include anything that is
-normally distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
-  It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system.  Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-\f
-  7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
-    a) Accompany the combined library with a copy of the same work
-    based on the Library, uncombined with any other library
-    facilities.  This must be distributed under the terms of the
-    Sections above.
-
-    b) Give prominent notice with the combined library of the fact
-    that part of it is a work based on the Library, and explaining
-    where to find the accompanying uncombined form of the same work.
-
-  8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License.  Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License.  However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
-  9. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Library or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
-  10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties with
-this License.
-\f
-  11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-  12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License may add
-an explicit geographical distribution limitation excluding those countries,
-so that distribution is permitted only in or among countries not thus
-excluded.  In such case, this License incorporates the limitation as if
-written in the body of this License.
-
-  13. The Free Software Foundation may publish revised and/or new
-versions of the Lesser General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation.  If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-\f
-  14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission.  For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this.  Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
-                            NO WARRANTY
-
-  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
-                     END OF TERMS AND CONDITIONS
-\f
-           How to Apply These Terms to Your New Libraries
-
-  If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change.  You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
-  To apply these terms, attach the following notices to the library.  It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the library's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library 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
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, see
-    <http://www.gnu.org/licenses/>.
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the
-  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
-  <signature of Ty Coon>, 1 April 1990
-  Ty Coon, President of Vice
-
-That's all there is to it!
diff --git a/fdmdv2/tags/0.99-Beta/README.txt b/fdmdv2/tags/0.99-Beta/README.txt
deleted file mode 100644 (file)
index f28f204..0000000
+++ /dev/null
@@ -1,274 +0,0 @@
-==================================
- Building and installing on Linux
-==================================
-
-Quickstart 1
------------
-
-Builds static versions of wxWidgets, portaudio, codec2-dev, which are commonly
-missing on many Linux systems, or of the wrong (older) version.
-
-1/ Assuming the fdmdv2-dev source is checked out into ~/fdmdv2-dev:
-
-  $ sudo apt-get install libgtk2.0-dev libhamlib-dev libsamplerate-dev libasound2-dev libao-dev
-  $ cd fdmdv2-dev
-  $ mkdir build_linux
-  $ cd build_linux
-  $ cmake -DBOOTSTRAP_WXWIDGETS=TRUE ~/fdmdv2-dev
-  $ make
-
-2/ Then you can configure FreeDV using your local codec-dev, something like:
-
-  $ cmake -DCMAKE_BUILD_TYPE=Debug -DBOOTSTRAP_WXWIDGETS=TRUE -DCODEC2_INCLUDE_DIRS=/path/to/codec2-dev/src -DCODEC2_LIBRARY=/path/to/codec2-dev/build_linux/src/libcodec2.so -DUSE_STATIC_CODEC2=FALSE -DUSE_STATIC_PORTAUDIO=TRUE -DUSE_STATIC_SOX=TRUE ../
-
-3/ OR build a local copy of codec2-dev:
-
-  $ cmake -DBOOTSTRAP_WXWIDGETS=TRUE -DUSE_STATIC_CODEC2=TRUE -DUSE_STATIC_PORTAUDIO=TRUE -DUSE_STATIC_SOX=TRUE ../
-  
-4/ Build and run FreeDV:
-
-   $ make
-   $ ./src/freedv
-
-Quickstart 2
-------------
-
-1/ Assuming you have all the dependant libraries:
-
-  $ cd /path/to/fdmdv2
-  $ mkdir build_linux
-  $ cd build_linux
-  $ cmake ../ (defaults to /usr/local, use CMAKE_INSTALL_PREFIX to override)
-  (if no errors)
-  $ make
-  (as root)
-  $ make install
-
-
-=======================================================
- Building for Windows on Ubuntu Linux (Cross compiling)
-=======================================================
-
-1/ Install the cross compiling toolchain:
-
-  $ sudo apt-get install mingw-w64
-
-2/ Patch cmake using: http://www.cmake.org/gitweb?p=stage/cmake.git;a=patch;h=33286235048495ceafb636d549d9a4e8891967ae
-
-3/ Checkout a fresh copy of codec2-dev and build for Windows, pointing to the generate_codebook built by a linux build of generate_codebook, using this cmake line
-
-  $ cmake .. -DCMAKE_TOOLCHAIN_FILE=../fdmdv2-dev/cmake/Toolchain-Ubuntu-mingw32.cmake -DUNITTEST=FALSE -DGENERATE_CODEBOOK=/home/david/codec2-dev/build_linux/src/generate_codebook 
-
-4/ Build WxWidgets
-
-  $ cd /path/to/fdmdv2-dev
-  $ mkdir build_windows
-  $ cd build_windows
-  $ cmake -DBOOTSTRAP_WXWIDGETS=TRUE .. -DCMAKE_TOOLCHAIN_FILE=cmake/Toolchain-Ubuntu-mingw32.cmake -DCMAKE_BUILD_TYPE=Debug
-  $ make
-
-5/ Download and install the Windows version of Hamlib:
-
-  $ wget http://internode.dl.sourceforge.net/project/hamlib/hamlib/1.2.15.3/hamlib-win32-1.2.15.3.zip
-  $ unzip hamlib-win32-1.2.15.3.zip
-
-6/ Build All the libraries and FreeDV:
-
-  $ cmake -DBOOTSTRAP_WXWIDGETS=TRUE -DCMAKE_TOOLCHAIN_FILE=cmake/Toolchain-Ubuntu-mingw32.cmake -DUSE_STATIC_PORTAUDIO=TRUE -DUSE_STATIC_SNDFILE=TRUE -DUSE_STATIC_SAMPLERATE=TRUE -DUSE_STATIC_SOX=TRUE -DUSE_STATIC_CODEC2=FALSE -DCODEC2_INCLUDE_DIRS=/home/david/tmp/codec2-dev/src -DCODEC2_LIBRARY=/home/david/tmp/codec2-dev/build_windows/src/libcodec2.dll.a -DHAMLIB_INCLUDE_DIR=hamlib-win32-1.2.15.3/include -DHAMLIB_LIBRARY=hamlib-win32-1.2.15.3/lib/gcc/libhamlib.dll.a -DCMAKE_BUILD_TYPE=Debug ..
-  $ make
-
-====================================
- Building and installing on Windows
-====================================
-
-The windows build is similar to linux and follows the same basic workflow,
-however, while codec2 and FreeDV (fdmdv2) build well on windows, some of the
-dependencies do not. For that reson current windows releases are cross-compiled
-from linux.
-
-Only MinGW is supported. While it is likely possible to perform a pure MinGW
-build, installing MSYS2 will make your life easier.
-
-CMake may not automatically detect that you're in the MSYS environment. If this
-occurs you need to pass cmake the proper generator:
-
-cmake -G"MSYS Makefiles" [other options] </path/to/source>
-
-===============================
- Bootstrapping wxWidgets build
-===============================
-
-If wxWidgets (>= 3.0) is not available then one option is to have CMake boot-
-strap the build for FreeDV.
-
-This is required because the tool wx-config is used to get the correct compiler
-and linker flags of the wxWidgets components needed by FreeDV. Since this is
-normally done at configure time, not during "make", it is not possible for CMake
-or have this information prior to building wxWidgets.
-
-In order to work around this issue you can "bootstrap" the wxWidgets build using
-the CMake option, "BOOTSTRAP_WXWIDGETS". wxWidgets will be built using static
-libraries.
-
-NOTE: This forces "USE_STATIC_WXWIDGETS" to be true internally regarless of the
-value set manually.
-
-(from any directory, but empty directory outside of the source is prefered.)
-$ cmake -DBOOTSTRAP_WXWIDGETS=TRUE /path/to/fdmdv2
-$ make
-(wxWidgets is downloaded and built)
-$ cmake .
-(wxWidgets build should be detected)
-$ make
-(if all goes well, as root)
-$ make install
-
-====================================
- Building and installing on OSX
-====================================
-
-====================================
- Building and installing on FreeBSD
-====================================
-
-As per "Quickstart 2" above but change build_linux to build_freebsd
-
-=======
-Editing
-=======
-
-Please make sure your text editor does not insert tabs, and
-used indents of 4 spaces.  The following .emacs code was used to
-configure emacs:
-
-(setq-default indent-tabs-mode nil)
-
-(add-hook 'c-mode-common-hook
-          (function (lambda ()
-                      (setq c-basic-offset 4)
-                      )))
-
-====
-TODO
-====
-
-[ ] Open R&D questions
-    + Goal is to develop an open source DV mode that performs comparably to SSB
-    [ ] Does 700 perform OK next to SSB?
-        + approx same tx pk level (hard to measure exactly)
-        + try some low SNR channels
-        + try some fast fading/nasty channels
-    [ ] Is 700 speech quality acceptable?
-
-[X] test frames 
-    [X] freedv API support
-    [X] BER displayed on GUI for 700 and 1600
-    [X] plot error patterns for 700 and 1600
-        + callback for error patterns, or poll via stats interface
-    [X] plot error histograms for 700 and 1600
-        + map bit error to carrier, have done this in tcohpsk?
-        + how to reset histogram?  On error reset?
-        + histogram screen ... new code?
-        + test with filter
-
-[X] Bugs
-    [X] resync issue
-    [X] equalise power on 700 and 1600
-    [X] research real and complex PAPR
-    [X] waterfall and spectrum in analog mode
-    [X] The waterfall in analog mode appears to quit working sometimes?
-
-    [X] On TX, intermittently PTT will cause signal to be heard in speakers.  Toggle PTT or 
-        Stop/Start toggle and then starts working.
-    [X] Squelch control on 1600 mode will not open up squelch to 0 (appears to be around 2 dB)
-    [X] space bar keys PTT when entering text info box
-    [X] checksum based txt reception
-        + only print if valid
-    [X] IC7200 audio breakup
-    [ ] short varicode doesn't work
-        + #ifdef-ed out for now
-        + cld be broken in freedv_api
-    [X] On 700 audio sounds tinny and clicky when out of sync compared to 1600 why?
-        + clue: only when analog not pressed
-        + this was 7.5 to 8kHz interpolator bug
-    [X] spectrum and waterfall scale changes when analog pressed
-    [X] ocassional test frames error counter goes crazy
-    [ ] 700 syncs up to 1000Hz sine waves
-        + shouldn't trigger sync logic, will be a problem with carriers
-    [ ] "clip" led, encourage people to adjust gain to hit that occ when speaking
-    [ ] Win32 record from radio time
-
-[ ] FreeDV 700 improvements
-    [ ] bpf filter after clipping to remove clicks
-        [ ] tcohpsk first, measure PAPR, impl loss
-    [ ] error masking
-        [ ] C version
-        [ ] training off air?  Switchable?
-        [ ] excitation params
-        [ ] training
-    [ ] plotting other demod stats like ch ampl and phase ests
-    [ ] profile with perf, different libresample routine
-    [ ] check for occassional freedv 700 loss of sync
-        + scatter seems to jump
-    [ ] switchable diversity (narrowband) option
-        + measure difference on a few channels
-        + blog
-
-[X] win32
-    [X] X-compile works
-    [X] basic installer
-    [X] Win32 installer
-        + Richard has taken care of this
-
-[ ] Small fixes
-    [X] Playfile bug
-    [X] running again
-    [X] bump ver number
-    [X] long varicode default
-    [X] option to _not_ require checksum, on by default
-    [X] default squelch 2dB
-    [X] scatter diagram tweaks
-        + e.g. meaningful plots on fading channels in real time 
-        [X] agc with hysteresis
-            + changed to log steps
-        [X] longer persistance
-            + changed to 6 seconds
-        [X] diversity addtions on 700
-            + still not real obvious on plot
-            + might be useful to make this switchable
-    [X] scatter diagram different colours/carrier
-    [X] remember what mode you were in
-    [ ] cmd line file decode
-    [ ] Waterfall direction
-    [ ] documentation or use, walk through, you tube, blog posts
-
-[ ] Web support for Presence/spotting hooks
-
-=================
-USER GUIDE NOTES
-=================
-
-TODO: Put this in a more usable form, video tutorials etc
-
-1/ Error Histogram.  Displays BER of each carrier when in "test frame"
- mode.  As each QPSK carrier has 2 bits there are 2*Nc histogram
- points.
-
- Ideally all carriers will have about the same BER (+/- 20% after 5000
- total bit errors).  However problems can occur with filtering in the
- tx path.  If one carrier has less power, then it will have a higher
- BER.  The errors in this carrier will tend to dominate overall
- BER. For example if one carrier is attenuated due to SSB filter
- ripple in the tx path then the BER on that carrier will be higher.
- This is bad news for DV.
-
- Suggested usage: Transmit FreeDV in test frame mode.  Use a 2nd rx
- (or get a friend) to monitor your rx signal with FreeDV in test frame
- mode.  Adjust your rx SNR to get a BER of a few % (e.g. reduce tx power,
- use a short antenna for the rx, point your beam away, adjust rx RF
- gain).  Monitor the error histogram for a few minutes, until you have
- say 5000 total bit errors.  You have a problem if the BER of any
- carrier is more than 20% different from the rest.
-
-  A typical issue will be one carrier at 1.0, the others at 0.5,
-  indicating the poorer carrier BER is twice the larger.
diff --git a/fdmdv2/tags/0.99-Beta/cmake/BuildCodec2.cmake b/fdmdv2/tags/0.99-Beta/cmake/BuildCodec2.cmake
deleted file mode 100644 (file)
index 471eef8..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-set(SPEEXDSP_CMAKE_ARGS -DBUILD_SHARED_LIBS=FALSE -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/external/dist)
-
-if(USE_STATIC_SPEEXDSP)
-    list(APPEND SPEEXDSP_CMAKE_ARGS 
-        -DSPEEXDSP_LIBRARIES=${CMAKE_BINARY_DIR}/external/dist/lib/libspeexdsp.a
-        -DSPEEXDSP_INCLUDE_DIR=${CMAKE_BINARY_DIR}/external/dist/include)
-endif()
-
-if(CMAKE_CROSSCOMPILING)
-    set(CODEC2_CMAKE_ARGS "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
-endif()
-
-include(ExternalProject)
-ExternalProject_Add(codec2
-   SVN_REPOSITORY https://svn.code.sf.net/p/freetel/code/codec2-dev
-   CMAKE_ARGS ${CODEC2_CMAKE_ARGS} ${SPEEXDSP_CMAKE_ARGS}
-   INSTALL_COMMAND ""
-)
-set(CODEC2_LIBRARIES
-    ${CMAKE_BINARY_DIR}/codec2-prefix/src/codec2-build/src/libcodec2.a)
-include_directories(${CMAKE_BINARY_DIR}/codec2-prefix/src/codec2/src)
-list(APPEND FREEDV_LINK_LIBS ${CODEC2_LIBRARIES})
-list(APPEND FREEDV_STATIC_DEPS codec2)
diff --git a/fdmdv2/tags/0.99-Beta/cmake/BuildPortaudio.cmake b/fdmdv2/tags/0.99-Beta/cmake/BuildPortaudio.cmake
deleted file mode 100644 (file)
index cc33d06..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-set(PORTAUDIO_TARBALL "pa_stable_v19_20111121")
-
-# required linking libraries on linux. Not sure about windows.
-find_library(ALSA_LIBRARIES asound)
-
-if(UNIX AND NOT ALSA_LIBRARIES)
-    message(ERROR "Could not find alsa library which is required for portaudio.
-On Linux systems try installing:
-    alsa-lib-devel  (RPM based systems)
-    libasound2-dev  (DEB based systems)"
-    )
-endif()
-
-# Make sure that configure knows what system we're using when cross-compiling.
-if(MINGW AND CMAKE_CROSSCOMPILING)
-    include(cmake/MinGW.cmake)
-    set(CONFIGURE_COMMAND ./configure --build=${HOST} --host=${HOST} --target=${HOST} --enable-cxx --without-jack --disable-shared --prefix=${CMAKE_BINARY_DIR}/external/dist)
-else()
-    set(CONFIGURE_COMMAND ./configure --enable-cxx --without-jack --disable-shared --prefix=${CMAKE_BINARY_DIR}/external/dist)
-endif()
-
-include(ExternalProject)
-ExternalProject_Add(portaudio
-    URL http://www.portaudio.com/archives/${PORTAUDIO_TARBALL}.tgz
-    BUILD_IN_SOURCE 1
-    INSTALL_DIR external/dist
-    CONFIGURE_COMMAND ${CONFIGURE_COMMAND}
-    BUILD_COMMAND $(MAKE)
-    INSTALL_COMMAND $(MAKE) install
-)
-if(WIN32)
-    set(PORTAUDIO_LIBRARIES 
-        ${CMAKE_BINARY_DIR}/external/dist/lib/libportaudio.a
-        ${CMAKE_BINARY_DIR}/external/dist/lib/libportaudiocpp.a
-)
-else(WIN32)
-    find_library(RT rt)
-    find_library(ASOUND asound)
-    set(PORTAUDIO_LIBRARIES
-        ${CMAKE_BINARY_DIR}/external/dist/lib/libportaudio.a
-        ${CMAKE_BINARY_DIR}/external/dist/lib/libportaudiocpp.a
-        ${RT}
-        ${ASOUND}
-    )
-endif(WIN32)
-include_directories(${CMAKE_BINARY_DIR}/external/dist/include)
-
-# Add the portaudio library to the list of libraries that must be linked.
-list(APPEND FREEDV_LINK_LIBS ${PORTAUDIO_LIBRARIES})
-
-# Setup a dependency so that this gets built before linking to freedv.
-list(APPEND FREEDV_STATIC_DEPS portaudio)
diff --git a/fdmdv2/tags/0.99-Beta/cmake/BuildSamplerate.cmake b/fdmdv2/tags/0.99-Beta/cmake/BuildSamplerate.cmake
deleted file mode 100644 (file)
index aa09f85..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-set(SAMPLERATE_TARBALL "libsamplerate-0.1.8")
-
-if(MINGW AND CMAKE_CROSSCOMPILING)
-    set(CONFIGURE_COMMAND ./configure --build=${HOST} --host=${HOST} --target=${HOST} --prefix=${CMAKE_BINARY_DIR}/external/dist --disable-sndfile)
-else()
-    set(CONFIGURE_COMMAND ./configure --prefix=${CMAKE_BINARY_DIR}/external/dist)
-endif()
-
-include(ExternalProject)
-ExternalProject_Add(samplerate
-    URL http://www.mega-nerd.com/SRC/${SAMPLERATE_TARBALL}.tar.gz 
-    BUILD_IN_SOURCE 1
-    INSTALL_DIR external/dist
-    CONFIGURE_COMMAND ${CONFIGURE_COMMAND}
-    BUILD_COMMAND $(MAKE)
-    INSTALL_COMMAND $(MAKE) install
-)
-if(WIN32)
-    set(SAMPLERATE_LIBRARIES
-        ${CMAKE_BINARY_DIR}/external/dist/lib/libsamplerate.a)
-else(WIN32)
-    set(SAMPLERATE_LIBRARIES
-        ${CMAKE_BINARY_DIR}/external/dist/lib/libsamplerate.a)
-endif(WIN32)
-include_directories(${CMAKE_BINARY_DIR}/external/dist/include)
-list(APPEND FREEDV_LINK_LIBS ${SAMPLERATE_LIBRARIES})
-list(APPEND FREEDV_STATIC_DEPS samplerate)
diff --git a/fdmdv2/tags/0.99-Beta/cmake/BuildSndfile.cmake b/fdmdv2/tags/0.99-Beta/cmake/BuildSndfile.cmake
deleted file mode 100644 (file)
index 43233fb..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-set(SNDFILE_TARBALL "libsndfile-1.0.25")
-
-if(MINGW AND CMAKE_CROSSCOMPILING)
-    set(CONFIGURE_COMMAND ./configure --host=${HOST}  --prefix=${CMAKE_BINARY_DIR}/external/dist --disable-external-libs --disable-shared)
-else()
-    set(CONFIGURE_COMMAND ./configure --prefix=${CMAKE_BINARY_DIR}/external/dist --disable-external-libs --disable-shared --disable-external-libs)
-endif()
-
-include(ExternalProject)
-ExternalProject_Add(sndfile
-    URL http://www.mega-nerd.com/libsndfile/files/${SNDFILE_TARBALL}.tar.gz
-    BUILD_IN_SOURCE 1
-    INSTALL_DIR external/dist
-    CONFIGURE_COMMAND ${CONFIGURE_COMMAND}
-    BUILD_COMMAND $(MAKE) V=1
-    INSTALL_COMMAND $(MAKE) install
-)
-if(MINGW)
-    set(SNDFILE_LIBRARIES ${CMAKE_BINARY_DIR}/external/dist/lib/libsndfile.a)
-else()
-    set(SNDFILE_LIBRARIES ${CMAKE_BINARY_DIR}/external/dist/lib/libsndfile.a)
-endif()
-
-include_directories(${CMAKE_BINARY_DIR}/external/dist/include)
-list(APPEND FREEDV_LINK_LIBS ${SNDFILE_LIBRARIES})
-list(APPEND FREEDV_STATIC_DEPS sndfile)
diff --git a/fdmdv2/tags/0.99-Beta/cmake/BuildSox.cmake b/fdmdv2/tags/0.99-Beta/cmake/BuildSox.cmake
deleted file mode 100644 (file)
index d54488b..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-set(SOX_TARBALL "sox-14.4.1")
-
-# required linking libraries on linux. Not sure about windows.
-find_library(ALSA_LIBRARIES asound)
-find_library(AO_LIBRARIES ao)
-find_library(GSM_LIBRARIES gsm)
-
-if(UNIX AND NOT ALSA_LIBRARIES)
-    message(ERROR "Could not find alsa library.
-On Linux systems try installing:
-    alsa-lib-devel  (RPM based systems)
-    libasound2-dev  (DEB based systems)"
-    )
-endif(UNIX AND NOT ALSA_LIBRARIES)
-
-if(UNIX AND NOT AO_LIBRARIES)
-    message(ERROR "Could not find libao.
-On Linux systems try installing:
-    libao-devel  (RPM based systems)
-    libao-dev    (DEB based systems)"
-    )
-endif(UNIX AND NOT AO_LIBRARIES)
-
-if(MINGW AND CMAKE_CROSSCOMPILING)
-    set(CONFIGURE_COMMAND ./configure --host=${HOST} --enable-shared=no --without-id3tag --without-png --disable-gomp --with-oggvorbis=no --with-oss=no --with-flac=no --with-amrnb=no --with-amrwb=no --with-mp3=no --with-wavpack=no --disable-dl-sndfile --with-pulseaudio=no --without-magic --with-gsm --prefix=${CMAKE_BINARY_DIR}/external/dist)
-else()
-    set(CONFIGURE_COMMAND ./configure --enable-shared=no --without-id3tag --without-png --disable-gomp --with-oggvorbis=no --with-oss=no --with-flac=no --with-amrnb=no --with-amrwb=no --with-mp3=no --with-wavpack=no --disable-dl-sndfile --with-pulseaudio=no --without-magic --with-gsm --prefix=${CMAKE_BINARY_DIR}/external/dist)
-endif()
-
-include(ExternalProject)
-ExternalProject_Add(sox
-    URL http://downloads.sourceforge.net/sox/${SOX_TARBALL}.tar.gz
-    BUILD_IN_SOURCE 1
-    INSTALL_DIR external/dist
-    CONFIGURE_COMMAND ${CONFIGURE_COMMAND}
-    BUILD_COMMAND $(MAKE) V=1
-    INSTALL_COMMAND $(MAKE) install
-)
-set(SOX_LIBRARIES ${CMAKE_BINARY_DIR}/external/dist/lib/libsox.a)
-if(UNIX)
-    list(APPEND SOX_LIBRARIES ${ALSA_LIBRARIES} ${AO_LIBRARIES} ${GSM_LIBRARIES})
-endif()
-if(MINGW)
-    list(APPEND SOX_LIBRARIES winmm)
-endif()
-include_directories(${CMAKE_BINARY_DIR}/external/dist/include)
-list(APPEND FREEDV_LINK_LIBS ${SOX_LIBRARIES})
-list(APPEND FREEDV_STATIC_DEPS sox)
diff --git a/fdmdv2/tags/0.99-Beta/cmake/BuildSpeex.cmake b/fdmdv2/tags/0.99-Beta/cmake/BuildSpeex.cmake
deleted file mode 100644 (file)
index 262d558..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-set(SPEEXDSP_TARBALL "speexdsp-1.2rc3.tar.gz")
-
-if(MINGW AND CMAKE_CROSSCOMPILING)
-    include(cmake/MinGW.cmake)
-    set(CONFIGURE_COMMAND ./configure --host=${HOST} --prefix=${CMAKE_BINARY_DIR}/external/dist --disable-examples)
-else()
-    set(CONFIGURE_COMMAND ./configure --prefix=${CMAKE_BINARY_DIR}/external/dist --disable-examples)
-endif()
-
-include(ExternalProject)
-ExternalProject_Add(speex
-   URL http://downloads.xiph.org/releases/speex/${SPEEXDSP_TARBALL}
-   BUILD_IN_SOURCE 1
-   INSTALL_DIR external/dist
-   CONFIGURE_COMMAND ${CONFIGURE_COMMAND}
-   BUILD_COMMAND $(MAKE)
-   INSTALL_COMMAND $(MAKE) install
-)
-
-set(SPEEXDSP_LIBRARIES ${CMAKE_BINARY_DIR}/external/dist/lib/libspeexdsp.a)
-include_directories(${CMAKE_BINARY_DIR}/external/dist/include)
-list(APPEND FREEDV_LINK_LIBS ${SPEEXDSP_LIBRARIES})
-list(APPEND FREEDV_STATIC_DEPS speex)
-if(USE_STATIC_CODEC2)
-    add_dependencies(codec2 speex)
-endif()
diff --git a/fdmdv2/tags/0.99-Beta/cmake/BuildWxWidgets.cmake b/fdmdv2/tags/0.99-Beta/cmake/BuildWxWidgets.cmake
deleted file mode 100644 (file)
index 901d806..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-set(WXWIDGETS_TARBALL "wxWidgets-3.0.2")
-
-# If we're cross-compiling then we need to set the target host manually.
-if(MINGW AND CMAKE_CROSSCOMPILING)
-    include(cmake/MinGW.cmake)
-endif()
-
-# If not cross-compiling then use the built-in makefile, otherwise use standard configure.
-if(MINGW AND NOT CMAKE_CROSSCOMPILING)
-#    set(CONFIGURE_COMMAND "true")
-#    set(MAKE_COMMAND $(MAKE) -C build/msw -f makefile.gcc SHARED=0 UNICODE=1 BUILD=release PREFIX=${CMAKE_BINARY_DIR}/external/dist)
-    set(CONFIGURE_COMMAND ./configure --disable-shared --prefix=${CMAKE_BINARY_DIR}/external/dist)
-       set(MAKE_COMMAND $(MAKE))
-endif()
-
-if(MINGW AND CMAKE_CROSSCOMPILING)
-    set(CONFIGURE_COMMAND ./configure --build=${HOST} --host=${HOST} --target=${HOST} --disable-shared --prefix=${CMAKE_BINARY_DIR}/external/dist)
-       set(MAKE_COMMAND $(MAKE))
-endif()
-
-if(NOT MINGW)
-    set(CONFIGURE_COMMAND ./configure --host=${HOST} --target=${HOST} --disable-shared --prefix=${CMAKE_BINARY_DIR}/external/dist)
-       set(MAKE_COMMAND $(MAKE))
-endif()
-
-include(ExternalProject)
-ExternalProject_Add(wxWidgets
-    URL http://downloads.sourceforge.net/wxwindows/${WXWIDGETS_TARBALL}.tar.bz2
-    BUILD_IN_SOURCE 1
-    INSTALL_DIR external/dist
-    CONFIGURE_COMMAND ${CONFIGURE_COMMAND}
-    BUILD_COMMAND ${MAKE_COMMAND}
-    INSTALL_COMMAND $(MAKE) install
-)
-
-ExternalProject_Get_Property(wxWidgets install_dir)
-message(STATUS "wxWidgets install dir: ${install_dir}")
-if(NOT WXCONFIG)
-    set(WXCONFIG "${install_dir}/bin/wx-config")
-endif()
-if(EXISTS ${WXCONFIG})
-    set(BS_WX_DONE TRUE)
-endif()
diff --git a/fdmdv2/tags/0.99-Beta/cmake/FindPortaudio.cmake b/fdmdv2/tags/0.99-Beta/cmake/FindPortaudio.cmake
deleted file mode 100644 (file)
index 158e20e..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-# - Try to find Portaudio
-# Once done this will define
-#
-#  PORTAUDIO_FOUND - system has Portaudio
-#  PORTAUDIO_INCLUDE_DIRS - the Portaudio include directory
-#  PORTAUDIO_LIBRARIES - Link these to use Portaudio
-#  PORTAUDIO_DEFINITIONS - Compiler switches required for using Portaudio
-#  PORTAUDIO_VERSION - Portaudio version
-#
-#  Copyright (c) 2006 Andreas Schneider <mail@cynapses.org>
-#
-# Redistribution and use is allowed according to the terms of the New BSD license.
-# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
-#
-
-
-if (PORTAUDIO_LIBRARIES AND PORTAUDIO_INCLUDE_DIRS)
-  # in cache already
-  set(PORTAUDIO_FOUND TRUE)
-else (PORTAUDIO_LIBRARIES AND PORTAUDIO_INCLUDE_DIRS)
-  if (NOT WIN32)
-   include(FindPkgConfig)
-   pkg_check_modules(PORTAUDIO2 portaudio-2.0)
-  endif (NOT WIN32)
-
-  if (PORTAUDIO2_FOUND)
-    set(PORTAUDIO_INCLUDE_DIRS
-      ${PORTAUDIO2_INCLUDE_DIRS}
-    )
-    if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
-      set(PORTAUDIO_LIBRARIES "${PORTAUDIO2_LIBRARY_DIRS}/lib${PORTAUDIO2_LIBRARIES}.dylib")
-    else (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
-      set(PORTAUDIO_LIBRARIES
-        ${PORTAUDIO2_LIBRARIES}
-      )
-    endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
-    set(PORTAUDIO_VERSION
-      19
-    )
-    set(PORTAUDIO_FOUND TRUE)
-  else (PORTAUDIO2_FOUND)
-    find_path(PORTAUDIO_INCLUDE_DIR
-      NAMES
-        portaudio.h
-      PATHS
-        /usr/include
-        /usr/local/include
-        /opt/local/include
-        /sw/include
-    )
-   
-    find_library(PORTAUDIO_LIBRARY
-      NAMES
-        portaudio
-      PATHS
-        /usr/lib
-        /usr/local/lib
-        /opt/local/lib
-        /sw/lib
-    )
-   
-    find_path(PORTAUDIO_LIBRARY_DIR
-      NAMES
-        portaudio
-      PATHS
-        /usr/lib
-        /usr/local/lib
-        /opt/local/lib
-        /sw/lib
-    )
-   
-    set(PORTAUDIO_INCLUDE_DIRS
-      ${PORTAUDIO_INCLUDE_DIR}
-    )
-    set(PORTAUDIO_LIBRARIES
-      ${PORTAUDIO_LIBRARY}
-    )
-   
-    set(PORTAUDIO_LIBRARY_DIRS
-      ${PORTAUDIO_LIBRARY_DIR}
-    )
-   
-    set(PORTAUDIO_VERSION
-      18
-    )
-   
-    if (PORTAUDIO_INCLUDE_DIRS AND PORTAUDIO_LIBRARIES)
-       set(PORTAUDIO_FOUND TRUE)
-    endif (PORTAUDIO_INCLUDE_DIRS AND PORTAUDIO_LIBRARIES)
-   
-    if (PORTAUDIO_FOUND)
-      if (NOT Portaudio_FIND_QUIETLY)
-        message(STATUS "Found Portaudio: ${PORTAUDIO_LIBRARIES}")
-      endif (NOT Portaudio_FIND_QUIETLY)
-    else (PORTAUDIO_FOUND)
-      if (Portaudio_FIND_REQUIRED)
-        message(FATAL_ERROR "Could not find Portaudio")
-      endif (Portaudio_FIND_REQUIRED)
-    endif (PORTAUDIO_FOUND)
-  endif (PORTAUDIO2_FOUND)
-
-
-  # show the PORTAUDIO_INCLUDE_DIRS and PORTAUDIO_LIBRARIES variables only in the advanced view
-  mark_as_advanced(PORTAUDIO_INCLUDE_DIRS PORTAUDIO_LIBRARIES)
-
-endif (PORTAUDIO_LIBRARIES AND PORTAUDIO_INCLUDE_DIRS)
-
diff --git a/fdmdv2/tags/0.99-Beta/cmake/GetDependencies.cmake.in b/fdmdv2/tags/0.99-Beta/cmake/GetDependencies.cmake.in
deleted file mode 100644 (file)
index 93204dd..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# As this script is run in a new cmake instance, it does not have access to
-# the existing cache variables. Pass them in via the configure_file command.
-set(CMAKE_BINARY_DIR @CMAKE_BINARY_DIR@)
-set(CMAKE_SOURCE_DIR @CMAKE_SOURCE_DIR@)
-set(UNIX @UNIX@)
-set(WIN32 @WIN32@)
-set(CMAKE_CROSSCOMPILING @CMAKE_CROSSCOMPILING@)
-set(CMAKE_FIND_LIBRARY_SUFFIXES @CMAKE_FIND_LIBRARY_SUFFIXES@)
-set(CMAKE_FIND_LIBRARY_PREFIXES @CMAKE_FIND_LIBRARY_PREFIXES@)
-set(CMAKE_SYSTEM_LIBRARY_PATH @CMAKE_SYSTEM_LIBRARY_PATH@)
-set(CMAKE_FIND_ROOT_PATH @CMAKE_FIND_ROOT_PATH@)
-
-set(FREEDV_EXE ${CMAKE_BINARY_DIR}/src/freedv.exe)
-
-include(GetPrerequisites)
-get_prerequisites("${FREEDV_EXE}" _deps 1 1 "" "${CMAKE_SYSTEM_LIBRARY_PATH}")
-foreach(_runtime ${_deps})
-    message("Looking for ${_runtime}")
-    find_library(RUNTIME_${_runtime} ${_runtime})
-    message("${RUNTIME_${_runtime}}")
-    if(RUNTIME_${_runtime})
-        file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/bin"
-        TYPE EXECUTABLE FILES "${RUNTIME_${_runtime}}")
-    endif()
-endforeach()
diff --git a/fdmdv2/tags/0.99-Beta/cmake/MinGW.cmake b/fdmdv2/tags/0.99-Beta/cmake/MinGW.cmake
deleted file mode 100644 (file)
index 333c1dc..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-# If we're cross-compiling then we need to set the target host manually.
-if(MINGW AND CMAKE_CROSSCOMPILING)
-    if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
-        set(HOST x86_64-w64-mingw32)
-    else()
-        set(HOST i686-w64-mingw32)
-    endif()
-endif()
diff --git a/fdmdv2/tags/0.99-Beta/cmake/Toolchain-Ubuntu-mingw32.cmake b/fdmdv2/tags/0.99-Beta/cmake/Toolchain-Ubuntu-mingw32.cmake
deleted file mode 100644 (file)
index 3507d72..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# Sample toolchain file for building for Windows from an Ubuntu Linux system.
-#
-# Typical usage:
-#    *) install cross compiler: `sudo apt-get install mingw-w64 g++-mingw-w64`
-#    *) cd build
-#    *) cmake -DCMAKE_TOOLCHAIN_FILE=~/Toolchain-Ubuntu-mingw32.cmake ..
-
-set(CMAKE_SYSTEM_NAME Windows)
-set(TOOLCHAIN_PREFIX i686-w64-mingw32)
-
-# cross compilers to use for C and C++
-set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc)
-set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
-set(CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres)
-
-# target environment on the build host system
-#   set 1st to dir with the cross compiler's C/C++ headers/libs
-set(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX})
-
-# modify default behavior of FIND_XXX() commands to
-# search for headers/libs in the target environment and
-# search for programs in the build host environment
-set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
-set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
-set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
diff --git a/fdmdv2/tags/0.99-Beta/cmake/config.h.in b/fdmdv2/tags/0.99-Beta/cmake/config.h.in
deleted file mode 100644 (file)
index 8e3ab76..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/*--------------------------------------------------------------------------
- ** This file is autogenerated from config.h.in 
- ** during the cmake configuration of your project. If you need to make changes
- ** edit the original file NOT THIS FILE.
- ** --------------------------------------------------------------------------*/
-#ifndef _CONFIGURATION_HEADER_GUARD_H_
-#define _CONFIGURATION_HEADER_GUARD_H_
-
-#define SIZEOF_INT @SIZEOF_INT@
-#cmakedefine HAVE_LIMITS_H @HAVE_LIMITS_H@
-#cmakedefine HAVE_STDINT_H @HAVE_STDINT_H@
-#cmakedefine HAVE_STDDEF_H @HAVE_STDDEF_H@
-#cmakedefine HAVE_STDLIB_H @HAVE_STDLIB_H@
-#cmakedefine HAVE_STRING_H @HAVE_STRING_H@
-#cmakedefine HAVE_FLOOR @HAVE_FLOOR@
-#cmakedefine HAVE_MEMSET @HAVE_MEMSET@
-#cmakedefine HAVE_POW @HAVE_POW@
-#cmakedefine HAVE_SQRT @HAVE_SQRT@
-#endif
diff --git a/fdmdv2/tags/0.99-Beta/cmake/version.h.in b/fdmdv2/tags/0.99-Beta/cmake/version.h.in
deleted file mode 100644 (file)
index 43b3b7a..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef FREEDV_VER_DOT_H
-#define FREEDV_VER_DOT_H 1
-
-#define FREEDV_VERSION_MAJOR @FREEDV_VERSION_MAJOR@
-#define FREEDV_VERSION_MINOR @FREEDV_VERSION_MINOR@
-#define FREEDV_VERSION_PATCH @FREEDV_VERSION_PATCH@
-#define FREEDV_VERSION_SUFFIX "@FREEDV_VERSION_SUFFIX@"
-
-#define FREEDV_VERSION "@FREEDV_VERSION_STRING@"
-
-#endif //FREEDV_VER_DOT_H
diff --git a/fdmdv2/tags/0.99-Beta/contrib/CMakeLists.txt b/fdmdv2/tags/0.99-Beta/contrib/CMakeLists.txt
deleted file mode 100644 (file)
index 3f4b7e0..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-# Install icons if we're on most *nix systems.
-if(UNIX AND NOT APPLE)
-    set(ICON_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor
-        CACHE PATH "Prefix to use for installing icons.")
-    install(FILES freedv48x48.png
-        DESTINATION ${ICON_INSTALL_PREFIX}/48x48/apps
-        RENAME freedv.png)
-    install(FILES freedv64x64.png
-        DESTINATION ${ICON_INSTALL_PREFIX}/64x64/apps
-        RENAME freedv.png)
-    install(FILES freedv128x128.png
-        DESTINATION ${ICON_INSTALL_PREFIX}/128x128/apps
-        RENAME freedv.png)
-    install(FILES freedv256x256.png
-        DESTINATION ${ICON_INSTALL_PREFIX}/256x256/apps
-        RENAME freedv.png)
-
-    set(DESKTOP_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/applications
-        CACHE PATH "Location to install desktop files.")
-    install(FILES freedv.desktop
-        DESTINATION ${DESKTOP_INSTALL_DIR})
-endif(UNIX AND NOT APPLE)
diff --git a/fdmdv2/tags/0.99-Beta/contrib/LICENSE b/fdmdv2/tags/0.99-Beta/contrib/LICENSE
deleted file mode 100644 (file)
index dc8853a..0000000
+++ /dev/null
@@ -1,393 +0,0 @@
-Attribution 4.0 International
-
-=======================================================================
-
-Creative Commons Corporation ("Creative Commons") is not a law firm and
-does not provide legal services or legal advice. Distribution of
-Creative Commons public licenses does not create a lawyer-client or
-other relationship. Creative Commons makes its licenses and related
-information available on an "as-is" basis. Creative Commons gives no
-warranties regarding its licenses, any material licensed under their
-terms and conditions, or any related information. Creative Commons
-disclaims all liability for damages resulting from their use to the
-fullest extent possible.
-
-Using Creative Commons Public Licenses
-
-Creative Commons public licenses provide a standard set of terms and
-conditions that creators and other rights holders may use to share
-original works of authorship and other material subject to copyright
-and certain other rights specified in the public license below. The
-following considerations are for informational purposes only, are not
-exhaustive, and do not form part of our licenses.
-
-     Considerations for licensors: Our public licenses are
-     intended for use by those authorized to give the public
-     permission to use material in ways otherwise restricted by
-     copyright and certain other rights. Our licenses are
-     irrevocable. Licensors should read and understand the terms
-     and conditions of the license they choose before applying it.
-     Licensors should also secure all rights necessary before
-     applying our licenses so that the public can reuse the
-     material as expected. Licensors should clearly mark any
-     material not subject to the license. This includes other CC-
-     licensed material, or material used under an exception or
-     limitation to copyright. More considerations for licensors:
-       wiki.creativecommons.org/Considerations_for_licensors
-
-     Considerations for the public: By using one of our public
-     licenses, a licensor grants the public permission to use the
-     licensed material under specified terms and conditions. If
-     the licensor's permission is not necessary for any reason--for
-     example, because of any applicable exception or limitation to
-     copyright--then that use is not regulated by the license. Our
-     licenses grant only permissions under copyright and certain
-     other rights that a licensor has authority to grant. Use of
-     the licensed material may still be restricted for other
-     reasons, including because others have copyright or other
-     rights in the material. A licensor may make special requests,
-     such as asking that all changes be marked or described.
-     Although not required by our licenses, you are encouraged to
-     respect those requests where reasonable. More_considerations
-     for the public: 
-       wiki.creativecommons.org/Considerations_for_licensees
-
-=======================================================================
-
-Creative Commons Attribution 4.0 International Public License
-
-By exercising the Licensed Rights (defined below), You accept and agree
-to be bound by the terms and conditions of this Creative Commons
-Attribution 4.0 International Public License ("Public License"). To the
-extent this Public License may be interpreted as a contract, You are
-granted the Licensed Rights in consideration of Your acceptance of
-these terms and conditions, and the Licensor grants You such rights in
-consideration of benefits the Licensor receives from making the
-Licensed Material available under these terms and conditions.
-
-
-Section 1 -- Definitions.
-
-  a. Adapted Material means material subject to Copyright and Similar
-     Rights that is derived from or based upon the Licensed Material
-     and in which the Licensed Material is translated, altered,
-     arranged, transformed, or otherwise modified in a manner requiring
-     permission under the Copyright and Similar Rights held by the
-     Licensor. For purposes of this Public License, where the Licensed
-     Material is a musical work, performance, or sound recording,
-     Adapted Material is always produced where the Licensed Material is
-     synched in timed relation with a moving image.
-
-  b. Adapter's License means the license You apply to Your Copyright
-     and Similar Rights in Your contributions to Adapted Material in
-     accordance with the terms and conditions of this Public License.
-
-  c. Copyright and Similar Rights means copyright and/or similar rights
-     closely related to copyright including, without limitation,
-     performance, broadcast, sound recording, and Sui Generis Database
-     Rights, without regard to how the rights are labeled or
-     categorized. For purposes of this Public License, the rights
-     specified in Section 2(b)(1)-(2) are not Copyright and Similar
-     Rights.
-
-  d. Effective Technological Measures means those measures that, in the
-     absence of proper authority, may not be circumvented under laws
-     fulfilling obligations under Article 11 of the WIPO Copyright
-     Treaty adopted on December 20, 1996, and/or similar international
-     agreements.
-
-  e. Exceptions and Limitations means fair use, fair dealing, and/or
-     any other exception or limitation to Copyright and Similar Rights
-     that applies to Your use of the Licensed Material.
-
-  f. Licensed Material means the artistic or literary work, database,
-     or other material to which the Licensor applied this Public
-     License.
-
-  g. Licensed Rights means the rights granted to You subject to the
-     terms and conditions of this Public License, which are limited to
-     all Copyright and Similar Rights that apply to Your use of the
-     Licensed Material and that the Licensor has authority to license.
-
-  h. Licensor means the individual(s) or entity(ies) granting rights
-     under this Public License.
-
-  i. Share means to provide material to the public by any means or
-     process that requires permission under the Licensed Rights, such
-     as reproduction, public display, public performance, distribution,
-     dissemination, communication, or importation, and to make material
-     available to the public including in ways that members of the
-     public may access the material from a place and at a time
-     individually chosen by them.
-
-  j. Sui Generis Database Rights means rights other than copyright
-     resulting from Directive 96/9/EC of the European Parliament and of
-     the Council of 11 March 1996 on the legal protection of databases,
-     as amended and/or succeeded, as well as other essentially
-     equivalent rights anywhere in the world.
-
-  k. You means the individual or entity exercising the Licensed Rights
-     under this Public License. Your has a corresponding meaning.
-
-
-Section 2 -- Scope.
-
-  a. License grant.
-
-       1. Subject to the terms and conditions of this Public License,
-          the Licensor hereby grants You a worldwide, royalty-free,
-          non-sublicensable, non-exclusive, irrevocable license to
-          exercise the Licensed Rights in the Licensed Material to:
-
-            a. reproduce and Share the Licensed Material, in whole or
-               in part; and
-
-            b. produce, reproduce, and Share Adapted Material.
-
-       2. Exceptions and Limitations. For the avoidance of doubt, where
-          Exceptions and Limitations apply to Your use, this Public
-          License does not apply, and You do not need to comply with
-          its terms and conditions.
-
-       3. Term. The term of this Public License is specified in Section
-          6(a).
-
-       4. Media and formats; technical modifications allowed. The
-          Licensor authorizes You to exercise the Licensed Rights in
-          all media and formats whether now known or hereafter created,
-          and to make technical modifications necessary to do so. The
-          Licensor waives and/or agrees not to assert any right or
-          authority to forbid You from making technical modifications
-          necessary to exercise the Licensed Rights, including
-          technical modifications necessary to circumvent Effective
-          Technological Measures. For purposes of this Public License,
-          simply making modifications authorized by this Section 2(a)
-          (4) never produces Adapted Material.
-
-       5. Downstream recipients.
-
-            a. Offer from the Licensor -- Licensed Material. Every
-               recipient of the Licensed Material automatically
-               receives an offer from the Licensor to exercise the
-               Licensed Rights under the terms and conditions of this
-               Public License.
-
-            b. No downstream restrictions. You may not offer or impose
-               any additional or different terms or conditions on, or
-               apply any Effective Technological Measures to, the
-               Licensed Material if doing so restricts exercise of the
-               Licensed Rights by any recipient of the Licensed
-               Material.
-
-       6. No endorsement. Nothing in this Public License constitutes or
-          may be construed as permission to assert or imply that You
-          are, or that Your use of the Licensed Material is, connected
-          with, or sponsored, endorsed, or granted official status by,
-          the Licensor or others designated to receive attribution as
-          provided in Section 3(a)(1)(A)(i).
-
-  b. Other rights.
-
-       1. Moral rights, such as the right of integrity, are not
-          licensed under this Public License, nor are publicity,
-          privacy, and/or other similar personality rights; however, to
-          the extent possible, the Licensor waives and/or agrees not to
-          assert any such rights held by the Licensor to the limited
-          extent necessary to allow You to exercise the Licensed
-          Rights, but not otherwise.
-
-       2. Patent and trademark rights are not licensed under this
-          Public License.
-
-       3. To the extent possible, the Licensor waives any right to
-          collect royalties from You for the exercise of the Licensed
-          Rights, whether directly or through a collecting society
-          under any voluntary or waivable statutory or compulsory
-          licensing scheme. In all other cases the Licensor expressly
-          reserves any right to collect such royalties.
-
-
-Section 3 -- License Conditions.
-
-Your exercise of the Licensed Rights is expressly made subject to the
-following conditions.
-
-  a. Attribution.
-
-       1. If You Share the Licensed Material (including in modified
-          form), You must:
-
-            a. retain the following if it is supplied by the Licensor
-               with the Licensed Material:
-
-                 i. identification of the creator(s) of the Licensed
-                    Material and any others designated to receive
-                    attribution, in any reasonable manner requested by
-                    the Licensor (including by pseudonym if
-                    designated);
-
-                ii. a copyright notice;
-
-               iii. a notice that refers to this Public License;
-
-                iv. a notice that refers to the disclaimer of
-                    warranties;
-
-                 v. a URI or hyperlink to the Licensed Material to the
-                    extent reasonably practicable;
-
-            b. indicate if You modified the Licensed Material and
-               retain an indication of any previous modifications; and
-
-            c. indicate the Licensed Material is licensed under this
-               Public License, and include the text of, or the URI or
-               hyperlink to, this Public License.
-
-       2. You may satisfy the conditions in Section 3(a)(1) in any
-          reasonable manner based on the medium, means, and context in
-          which You Share the Licensed Material. For example, it may be
-          reasonable to satisfy the conditions by providing a URI or
-          hyperlink to a resource that includes the required
-          information.
-
-       3. If requested by the Licensor, You must remove any of the
-          information required by Section 3(a)(1)(A) to the extent
-          reasonably practicable.
-
-       4. If You Share Adapted Material You produce, the Adapter's
-          License You apply must not prevent recipients of the Adapted
-          Material from complying with this Public License.
-
-
-Section 4 -- Sui Generis Database Rights.
-
-Where the Licensed Rights include Sui Generis Database Rights that
-apply to Your use of the Licensed Material:
-
-  a. for the avoidance of doubt, Section 2(a)(1) grants You the right
-     to extract, reuse, reproduce, and Share all or a substantial
-     portion of the contents of the database;
-
-  b. if You include all or a substantial portion of the database
-     contents in a database in which You have Sui Generis Database
-     Rights, then the database in which You have Sui Generis Database
-     Rights (but not its individual contents) is Adapted Material; and
-
-  c. You must comply with the conditions in Section 3(a) if You Share
-     all or a substantial portion of the contents of the database.
-
-For the avoidance of doubt, this Section 4 supplements and does not
-replace Your obligations under this Public License where the Licensed
-Rights include other Copyright and Similar Rights.
-
-
-Section 5 -- Disclaimer of Warranties and Limitation of Liability.
-
-  a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
-     EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
-     AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
-     ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
-     IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
-     WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
-     PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
-     ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
-     KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
-     ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
-
-  b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
-     TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
-     NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
-     INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
-     COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
-     USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
-     ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
-     DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
-     IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
-
-  c. The disclaimer of warranties and limitation of liability provided
-     above shall be interpreted in a manner that, to the extent
-     possible, most closely approximates an absolute disclaimer and
-     waiver of all liability.
-
-
-Section 6 -- Term and Termination.
-
-  a. This Public License applies for the term of the Copyright and
-     Similar Rights licensed here. However, if You fail to comply with
-     this Public License, then Your rights under this Public License
-     terminate automatically.
-
-  b. Where Your right to use the Licensed Material has terminated under
-     Section 6(a), it reinstates:
-
-       1. automatically as of the date the violation is cured, provided
-          it is cured within 30 days of Your discovery of the
-          violation; or
-
-       2. upon express reinstatement by the Licensor.
-
-     For the avoidance of doubt, this Section 6(b) does not affect any
-     right the Licensor may have to seek remedies for Your violations
-     of this Public License.
-
-  c. For the avoidance of doubt, the Licensor may also offer the
-     Licensed Material under separate terms or conditions or stop
-     distributing the Licensed Material at any time; however, doing so
-     will not terminate this Public License.
-
-  d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
-     License.
-
-
-Section 7 -- Other Terms and Conditions.
-
-  a. The Licensor shall not be bound by any additional or different
-     terms or conditions communicated by You unless expressly agreed.
-
-  b. Any arrangements, understandings, or agreements regarding the
-     Licensed Material not stated herein are separate from and
-     independent of the terms and conditions of this Public License.
-
-
-Section 8 -- Interpretation.
-
-  a. For the avoidance of doubt, this Public License does not, and
-     shall not be interpreted to, reduce, limit, restrict, or impose
-     conditions on any use of the Licensed Material that could lawfully
-     be made without permission under this Public License.
-
-  b. To the extent possible, if any provision of this Public License is
-     deemed unenforceable, it shall be automatically reformed to the
-     minimum extent necessary to make it enforceable. If the provision
-     cannot be reformed, it shall be severed from this Public License
-     without affecting the enforceability of the remaining terms and
-     conditions.
-
-  c. No term or condition of this Public License will be waived and no
-     failure to comply consented to unless expressly agreed to by the
-     Licensor.
-
-  d. Nothing in this Public License constitutes or may be interpreted
-     as a limitation upon, or waiver of, any privileges and immunities
-     that apply to the Licensor or You, including from the legal
-     processes of any jurisdiction or authority.
-
-
-=======================================================================
-
-Creative Commons is not a party to its public licenses.
-Notwithstanding, Creative Commons may elect to apply one of its public
-licenses to material it publishes and in those instances will be
-considered the "Licensor." Except for the limited purpose of indicating
-that material is shared under a Creative Commons public license or as
-otherwise permitted by the Creative Commons policies published at
-creativecommons.org/policies, Creative Commons does not authorize the
-use of the trademark "Creative Commons" or any other trademark or logo
-of Creative Commons without its prior written consent including,
-without limitation, in connection with any unauthorized modifications
-to any of its public licenses or any other arrangements,
-understandings, or agreements concerning use of licensed material. For
-the avoidance of doubt, this paragraph does not form part of the public
-licenses.
-
-Creative Commons may be contacted at creativecommons.org.
diff --git a/fdmdv2/tags/0.99-Beta/contrib/freedv.desktop b/fdmdv2/tags/0.99-Beta/contrib/freedv.desktop
deleted file mode 100644 (file)
index 96e8293..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-[Desktop Entry]
-Version=1.0
-Name=FreeDV
-Exec=freedv
-Icon=freedv
-Type=Application
-Terminal=false
-Categories=GTK;GNOME;AudioVideo;Audio;HamRadio;
diff --git a/fdmdv2/tags/0.99-Beta/contrib/freedv.ico b/fdmdv2/tags/0.99-Beta/contrib/freedv.ico
deleted file mode 100644 (file)
index e6b9a20..0000000
Binary files a/fdmdv2/tags/0.99-Beta/contrib/freedv.ico and /dev/null differ
diff --git a/fdmdv2/tags/0.99-Beta/contrib/freedv.rc b/fdmdv2/tags/0.99-Beta/contrib/freedv.rc
deleted file mode 100644 (file)
index 2e6655d..0000000
+++ /dev/null
@@ -1 +0,0 @@
-id ICON "./freedv.ico"
diff --git a/fdmdv2/tags/0.99-Beta/contrib/freedv128x128.png b/fdmdv2/tags/0.99-Beta/contrib/freedv128x128.png
deleted file mode 100644 (file)
index 5190a77..0000000
Binary files a/fdmdv2/tags/0.99-Beta/contrib/freedv128x128.png and /dev/null differ
diff --git a/fdmdv2/tags/0.99-Beta/contrib/freedv256x256.png b/fdmdv2/tags/0.99-Beta/contrib/freedv256x256.png
deleted file mode 100644 (file)
index b3eb5d7..0000000
Binary files a/fdmdv2/tags/0.99-Beta/contrib/freedv256x256.png and /dev/null differ
diff --git a/fdmdv2/tags/0.99-Beta/contrib/freedv48x48.png b/fdmdv2/tags/0.99-Beta/contrib/freedv48x48.png
deleted file mode 100644 (file)
index bd5efc6..0000000
Binary files a/fdmdv2/tags/0.99-Beta/contrib/freedv48x48.png and /dev/null differ
diff --git a/fdmdv2/tags/0.99-Beta/contrib/freedv64x64.png b/fdmdv2/tags/0.99-Beta/contrib/freedv64x64.png
deleted file mode 100644 (file)
index eb89773..0000000
Binary files a/fdmdv2/tags/0.99-Beta/contrib/freedv64x64.png and /dev/null differ
diff --git a/fdmdv2/tags/0.99-Beta/credits.txt b/fdmdv2/tags/0.99-Beta/credits.txt
deleted file mode 100644 (file)
index 431e399..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-Credits (code or ideas borrowed from):
-==============================================
-Dave Witten and David Rowe (obviously)
-Mel Whitten K0PFX (material and moral support)
-Bruce Perens (cheerleader, promotion and publicity)
-Mooneer Salem KG6AOV(Mac OSX Patch)
-Soeren Straarup OZ2DAK (FreeBSD Port)
-Don Mak
-Steve Nance (K5FR)
-Joel Stanley (Hamlib prototyping) and Mark Jessop (Mac OSX) 
-James Ahlstrom (Quisk)
-FLDIGI
-All the folks on the digital voice google group...
diff --git a/fdmdv2/tags/0.99-Beta/db/current b/fdmdv2/tags/0.99-Beta/db/current
deleted file mode 100644 (file)
index d00491f..0000000
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/fdmdv2/tags/0.99-Beta/db/format b/fdmdv2/tags/0.99-Beta/db/format
deleted file mode 100644 (file)
index db06890..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-4
-layout sharded 1000
diff --git a/fdmdv2/tags/0.99-Beta/db/fs-type b/fdmdv2/tags/0.99-Beta/db/fs-type
deleted file mode 100644 (file)
index 4fdd953..0000000
+++ /dev/null
@@ -1 +0,0 @@
-fsfs
diff --git a/fdmdv2/tags/0.99-Beta/db/fsfs.conf b/fdmdv2/tags/0.99-Beta/db/fsfs.conf
deleted file mode 100644 (file)
index cc08ceb..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-### This file controls the configuration of the FSFS filesystem.\r
-\r
-[memcached-servers]\r
-### These options name memcached servers used to cache internal FSFS\r
-### data.  See http://www.danga.com/memcached/ for more information on\r
-### memcached.  To use memcached with FSFS, run one or more memcached\r
-### servers, and specify each of them as an option like so:\r
-# first-server = 127.0.0.1:11211\r
-# remote-memcached = mymemcached.corp.example.com:11212\r
-### The option name is ignored; the value is of the form HOST:PORT.\r
-### memcached servers can be shared between multiple repositories;\r
-### however, if you do this, you *must* ensure that repositories have\r
-### distinct UUIDs and paths, or else cached data from one repository\r
-### might be used by another accidentally.  Note also that memcached has\r
-### no authentication for reads or writes, so you must ensure that your\r
-### memcached servers are only accessible by trusted users.\r
-\r
-[caches]\r
-### When a cache-related error occurs, normally Subversion ignores it\r
-### and continues, logging an error if the server is appropriately\r
-### configured (and ignoring it with file:// access).  To make\r
-### Subversion never ignore cache errors, uncomment this line.\r
-# fail-stop = true\r
-\r
-[rep-sharing]\r
-### To conserve space, the filesystem can optionally avoid storing\r
-### duplicate representations.  This comes at a slight cost in\r
-### performance, as maintaining a database of shared representations can\r
-### increase commit times.  The space savings are dependent upon the size\r
-### of the repository, the number of objects it contains and the amount of\r
-### duplication between them, usually a function of the branching and\r
-### merging process.\r
-###\r
-### The following parameter enables rep-sharing in the repository.  It can\r
-### be switched on and off at will, but for best space-saving results\r
-### should be enabled consistently over the life of the repository.\r
-### rep-sharing is enabled by default.\r
-# enable-rep-sharing = true\r
diff --git a/fdmdv2/tags/0.99-Beta/db/min-unpacked-rev b/fdmdv2/tags/0.99-Beta/db/min-unpacked-rev
deleted file mode 100644 (file)
index 573541a..0000000
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/fdmdv2/tags/0.99-Beta/db/rep-cache.db b/fdmdv2/tags/0.99-Beta/db/rep-cache.db
deleted file mode 100644 (file)
index 63c6f0b..0000000
Binary files a/fdmdv2/tags/0.99-Beta/db/rep-cache.db and /dev/null differ
diff --git a/fdmdv2/tags/0.99-Beta/db/revprops/0/0 b/fdmdv2/tags/0.99-Beta/db/revprops/0/0
deleted file mode 100644 (file)
index d0b90de..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-K 8
-svn:date
-V 27
-2012-08-21T18:27:59.389906Z
-END
diff --git a/fdmdv2/tags/0.99-Beta/db/revprops/0/1 b/fdmdv2/tags/0.99-Beta/db/revprops/0/1
deleted file mode 100644 (file)
index 0af71a2..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-K 10
-svn:author
-V 9
-OFA-Staff
-K 8
-svn:date
-V 27
-2012-08-21T18:28:08.741468Z
-K 7
-svn:log
-V 25
-Imported folder structure
-END
diff --git a/fdmdv2/tags/0.99-Beta/db/revs/0/0 b/fdmdv2/tags/0.99-Beta/db/revs/0/0
deleted file mode 100644 (file)
index 10f5c45..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-PLAIN
-END
-ENDREP
-id: 0.0.r0/17
-type: dir
-count: 0
-text: 0 0 4 4 2d2977d1c96f487abe4a1e202dd03b4e
-cpath: /
-
-
-17 107
diff --git a/fdmdv2/tags/0.99-Beta/db/revs/0/1 b/fdmdv2/tags/0.99-Beta/db/revs/0/1
deleted file mode 100644 (file)
index fd802a9..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-id: 3-1.0.r1/0
-type: dir
-count: 0
-cpath: /tags
-copyroot: 0 /
-
-id: 0-1.0.r1/62
-type: dir
-count: 0
-cpath: /trunk
-copyroot: 0 /
-
-id: 2-1.0.r1/126
-type: dir
-count: 0
-cpath: /branches
-copyroot: 0 /
-
-PLAIN
-K 8
-branches
-V 16
-dir 2-1.0.r1/126
-K 4
-tags
-V 14
-dir 3-1.0.r1/0
-K 5
-trunk
-V 15
-dir 0-1.0.r1/62
-END
-ENDREP
-id: 0.0.r1/306
-type: dir
-pred: 0.0.r0/17
-count: 1
-text: 1 194 99 99 7b6cc14dddba4e09be5255b475d1a0a8
-cpath: /
-copyroot: 0 /
-
-_0.0.t0-0 add-dir false false /trunk
-
-_2.0.t0-0 add-dir false false /branches
-
-_3.0.t0-0 add-dir false false /tags
-
-
-306 431
diff --git a/fdmdv2/tags/0.99-Beta/db/transactions/.gitignore b/fdmdv2/tags/0.99-Beta/db/transactions/.gitignore
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/fdmdv2/tags/0.99-Beta/db/txn-current b/fdmdv2/tags/0.99-Beta/db/txn-current
deleted file mode 100644 (file)
index d00491f..0000000
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/fdmdv2/tags/0.99-Beta/db/txn-current-lock b/fdmdv2/tags/0.99-Beta/db/txn-current-lock
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/fdmdv2/tags/0.99-Beta/db/txn-protorevs/.gitignore b/fdmdv2/tags/0.99-Beta/db/txn-protorevs/.gitignore
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/fdmdv2/tags/0.99-Beta/db/uuid b/fdmdv2/tags/0.99-Beta/db/uuid
deleted file mode 100644 (file)
index 0f36297..0000000
+++ /dev/null
@@ -1 +0,0 @@
-a56d66ce-6468-4744-9be7-52ce95ca47a4
diff --git a/fdmdv2/tags/0.99-Beta/db/write-lock b/fdmdv2/tags/0.99-Beta/db/write-lock
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/fdmdv2/tags/0.99-Beta/src/CMakeLists.txt b/fdmdv2/tags/0.99-Beta/src/CMakeLists.txt
deleted file mode 100644 (file)
index 44ccfe7..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-set(FREEDV_SOURCES
-    dlg_audiooptions.cpp
-    dlg_filter.cpp
-    dlg_options.cpp
-    dlg_ptt.cpp
-    fdmdv2_main.cpp
-    fdmdv2_pa_wrapper.cpp
-    fdmdv2_plot.cpp
-    fdmdv2_plot_scalar.cpp
-    fdmdv2_plot_scatter.cpp
-    fdmdv2_plot_spectrum.cpp
-    fdmdv2_plot_waterfall.cpp
-    hamlib.cpp
-    topFrame.cpp
-    sox_biquad.c
-    comp.h
-    dlg_audiooptions.h
-    dlg_filter.h
-    dlg_options.h
-    dlg_ptt.h
-    fdmdv2_defines.h
-    fdmdv2_main.h
-    fdmdv2_pa_wrapper.h
-    fdmdv2_plot.h
-    fdmdv2_plot_scalar.h
-    fdmdv2_plot_scatter.h
-    fdmdv2_plot_spectrum.h
-    fdmdv2_plot_waterfall.h
-    hamlib.h
-    sox_biquad.h
-    sox.h
-    topFrame.h
-    version.h
-)
-
-# WIN32 is needed for Windows GUI apps and is ignored for UNIX like systems.
-add_executable(freedv WIN32 ${FREEDV_SOURCES} ${RES_FILES})
-target_link_libraries(freedv ${FREEDV_LINK_LIBS})
-include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
-if(FREEDV_STATIC_DEPS)
-    add_dependencies(freedv ${FREEDV_STATIC_DEPS})
-endif(FREEDV_STATIC_DEPS)
-install(TARGETS freedv
-    RUNTIME DESTINATION bin)
diff --git a/fdmdv2/tags/0.99-Beta/src/Makefile.win32 b/fdmdv2/tags/0.99-Beta/src/Makefile.win32
deleted file mode 100644 (file)
index 932e851..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-# src/Makefile.win32
-# David Rowe 26 Oct 2012
-#
-# Makefile for Win32 on msys/Mingw to help David R get up to speed
-#
-# $ make -f Makefile.Win32
-
-CODEC2_PATH=$(HOME)/codec2-dev
-INCLUDE_PATH=/usr/local/include
-
-WX_CONFIG=wx-config
-WX_CPPFLAGS = $(shell $(WX_CONFIG) --cxxflags) -D__WXDEBUG__
-WX_LIBS = $(shell $(WX_CONFIG) --libs core, base, aui, adv, net)
-SVN_REVISION=$(shell svnversion)
-CODEC2_INC=$(CODEC2_PATH)/src 
-CODEC2_LIB=$(CODEC2_PATH)/build_win32/src/
-
-CPP_FLAGS = -D_NO_AUTOTOOLS_ -I$(INCLUDE_PATH) $(WX_CPPFLAGS) -I$(CODEC2_INC) -I../extern/include -I. -g -Wall -DSVN_REVISION=\"$(SVN_REVISION)\"
-LIBS = $(WX_LIBS) -L$(CODEC2_LIB) -lcodec2 -lm -lportaudiocpp -lportaudio -lpthread -lsndfile -lsamplerate -lhamlib -lsox -lspeexdsp
-
-OBJS = topFrame.o \
-fdmdv2_main.o \
-fdmdv2_plot.o \
-fdmdv2_plot_scalar.o \
-fdmdv2_plot_scatter.o \
-fdmdv2_plot_spectrum.o \
-fdmdv2_plot_waterfall.o \
-fdmdv2_pa_wrapper.o \
-dlg_audiooptions.o \
-dlg_ptt.o \
-dlg_options.o \
-dlg_filter.o \
-sox_biquad.o \
-hamlib.o \
-../../codec2-dev/src/golay23.o
-
-HDRS = version.h dlg_audiooptions.h dlg_ptt.h dlg_filter.h fdmdv2_main.h fdmdv2_defines.h fdmdv2_plot.h fdmdv2_plot_scalar.h fdmdv2_plot_waterfall.h fdmdv2_plot_scatter.h fdmdv2_plot_spectrum.h fdmdv2_pa_wrapper.h topFrame.h dlg_audiooptions.h topFrame.h varicode.h ../../codec2-dev/src/golay23.h hamlib.h
-
-all: freedv
-
-freedv: $(OBJS) 
-       g++ -o freedv $(OBJS) $(CPP_FLAGS) $(LIBS)
-
-%.o: %.cpp $(HDRS) Makefile.win32
-       g++ $(CPP_FLAGS) -c $< -o $@
-
-%.o: %.c $(HDRS) Makefile.win32
-       gcc $(CPP_FLAGS) -c $< -o $@
-
-clean:
-       rm -f *.o fdmdv2
-
diff --git a/fdmdv2/tags/0.99-Beta/src/comp.h b/fdmdv2/tags/0.99-Beta/src/comp.h
deleted file mode 100644 (file)
index a3a1bd9..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*---------------------------------------------------------------------------*\
-
-  FILE........: comp.h
-  AUTHOR......: David Rowe
-  DATE CREATED: 24/08/09
-
-  Complex number definition.
-
-\*---------------------------------------------------------------------------*/
-
-/*
-  Copyright (C) 2009 David Rowe
-
-  All rights reserved.
-
-  This program is free software; you can redistribute it and/or modify
-  it under the terms of the GNU Lesser 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 Lesser General Public License
-  along with this program; if not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef __COMP__
-#define __COMP__
-
-/* Complex number */
-
-typedef struct
-{
-    float real;
-    float imag;
-} COMP;
-
-#endif
diff --git a/fdmdv2/tags/0.99-Beta/src/dlg_audiooptions.cpp b/fdmdv2/tags/0.99-Beta/src/dlg_audiooptions.cpp
deleted file mode 100644 (file)
index 7d23a08..0000000
+++ /dev/null
@@ -1,1264 +0,0 @@
-//=========================================================================
-// Name:            AudioOptsDialog.cpp
-// Purpose:         Implements an Audio options selection dialog.
-//
-// Authors:         David Rowe, David Witten
-// License:
-//
-//  All rights reserved.
-//
-//  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 <http://www.gnu.org/licenses/>.
-//
-//=========================================================================
-#include "fdmdv2_main.h"
-#include "dlg_audiooptions.h"
-
-// constants for test waveform plots
-
-#define TEST_WAVEFORM_X          180
-#define TEST_WAVEFORM_Y          180
-#define TEST_WAVEFORM_PLOT_TIME  2.0
-#define TEST_WAVEFORM_PLOT_FS    400
-#define TEST_BUF_SIZE           1024
-#define TEST_FS                 48000.0
-#define TEST_DT                 0.1      // time between plot updates in seconds
-#define TEST_WAVEFORM_PLOT_BUF  ((int)(DT*400))
-
-void AudioOptsDialog::Pa_Init(void)
-{
-    m_isPaInitialized = false;
-
-    if((pa_err = Pa_Initialize()) == paNoError)
-    {
-        m_isPaInitialized = true;
-    }
-    else
-    {
-        wxMessageBox(wxT("Port Audio failed to initialize"), wxT("Pa_Initialize"), wxOK);
-        return;
-    }
-}
-
-
-void AudioOptsDialog::buildTestControls(PlotScalar **plotScalar, wxButton **btnTest, 
-                                        wxPanel *parentPanel, wxBoxSizer *bSizer, wxString buttonLabel)
-{
-    wxBoxSizer* bSizer1 = new wxBoxSizer(wxVERTICAL);
-
-    wxPanel *panel = new wxPanel(parentPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0);
-    *plotScalar = new PlotScalar((wxFrame*) panel, 1, TEST_WAVEFORM_PLOT_TIME, 1.0/TEST_WAVEFORM_PLOT_FS, -1, 1, 1, 0.2, "", 1);
-    (*plotScalar)->SetClientSize(wxSize(TEST_WAVEFORM_X,TEST_WAVEFORM_Y));
-    bSizer1->Add(panel, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 8);
-
-    *btnTest = new wxButton(parentPanel, wxID_ANY, buttonLabel, wxDefaultPosition, wxDefaultSize);
-    bSizer1->Add(*btnTest, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 0);
-
-    bSizer->Add(bSizer1, 0, wxALIGN_CENTER_HORIZONTAL |wxALIGN_CENTER_VERTICAL );
-}
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// AudioOptsDialog()
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-AudioOptsDialog::AudioOptsDialog(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style)
-{
-    this->SetSizeHints(wxSize(850, 600), wxDefaultSize);
-
-    Pa_Init();
-
-    wxBoxSizer* mainSizer;
-    mainSizer = new wxBoxSizer(wxVERTICAL);
-    m_panel1 = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
-    wxBoxSizer* bSizer4;
-    bSizer4 = new wxBoxSizer(wxVERTICAL);
-    m_notebook1 = new wxNotebook(m_panel1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxNB_BOTTOM);
-    m_panelRx = new wxPanel(m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
-    wxBoxSizer* bSizer20;
-    bSizer20 = new wxBoxSizer(wxVERTICAL);
-    wxGridSizer* gSizer4;
-    gSizer4 = new wxGridSizer(2, 1, 0, 0);
-
-    // Rx In -----------------------------------------------------------------------
-
-    wxStaticBoxSizer* sbSizer2;
-    sbSizer2 = new wxStaticBoxSizer(new wxStaticBox(m_panelRx, wxID_ANY, _("From Radio")), wxHORIZONTAL);
-
-    wxBoxSizer* bSizer811a = new wxBoxSizer(wxVERTICAL);
-
-    m_listCtrlRxInDevices = new wxListCtrl(m_panelRx, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VRULES);
-    bSizer811a->Add(m_listCtrlRxInDevices, 1, wxALL|wxEXPAND, 1);
-
-    wxBoxSizer* bSizer811;
-    bSizer811 = new wxBoxSizer(wxHORIZONTAL);
-    m_staticText51 = new wxStaticText(m_panelRx, wxID_ANY, _("Device:"), wxDefaultPosition, wxDefaultSize, 0);
-    m_staticText51->Wrap(-1);
-    bSizer811->Add(m_staticText51, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5);
-    m_textCtrlRxIn = new wxTextCtrl(m_panelRx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
-    bSizer811->Add(m_textCtrlRxIn, 1, wxALIGN_CENTER_VERTICAL|wxALL, 1);
-    m_staticText6 = new wxStaticText(m_panelRx, wxID_ANY, _("Sample Rate:"), wxDefaultPosition, wxDefaultSize, 0);
-    m_staticText6->Wrap(-1);
-    bSizer811->Add(m_staticText6, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5);
-    m_cbSampleRateRxIn = new wxComboBox(m_panelRx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(90,-1), 0, NULL, wxCB_DROPDOWN);
-    bSizer811->Add(m_cbSampleRateRxIn, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1);
-
-    bSizer811a->Add(bSizer811, 0, wxEXPAND, 5);
-
-    sbSizer2->Add(bSizer811a, 1, wxEXPAND, 2);
-    buildTestControls(&m_plotScalarRxIn, &m_btnRxInTest, m_panelRx, sbSizer2, _("Rec 2s"));
-
-    gSizer4->Add(sbSizer2, 1, wxEXPAND, 5);
-
-    // Rx Out -----------------------------------------------------------------------
-
-    wxStaticBoxSizer* sbSizer3;
-    sbSizer3 = new wxStaticBoxSizer(new wxStaticBox(m_panelRx, wxID_ANY, _("To Speaker/Headphones")), wxHORIZONTAL);
-
-    wxBoxSizer* bSizer81a = new wxBoxSizer(wxVERTICAL);
-
-    m_listCtrlRxOutDevices = new wxListCtrl(m_panelRx, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VRULES);
-    bSizer81a->Add(m_listCtrlRxOutDevices, 1, wxALL|wxEXPAND, 1);
-
-    wxBoxSizer* bSizer81;
-    bSizer81 = new wxBoxSizer(wxHORIZONTAL);
-    m_staticText9 = new wxStaticText(m_panelRx, wxID_ANY, _("Device:"), wxDefaultPosition, wxDefaultSize, 0);
-    m_staticText9->Wrap(-1);
-    bSizer81->Add(m_staticText9, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
-    m_textCtrlRxOut = new wxTextCtrl(m_panelRx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
-    bSizer81->Add(m_textCtrlRxOut, 1, wxALIGN_CENTER_VERTICAL|wxALL, 1);
-    m_staticText10 = new wxStaticText(m_panelRx, wxID_ANY, _("Sample Rate:"), wxDefaultPosition, wxDefaultSize, 0);
-    m_staticText10->Wrap(-1);
-    bSizer81->Add(m_staticText10, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5);
-    m_cbSampleRateRxOut = new wxComboBox(m_panelRx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(90,-1), 0, NULL, wxCB_DROPDOWN);
-    bSizer81->Add(m_cbSampleRateRxOut, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1);
-
-    bSizer81a->Add(bSizer81, 0, wxEXPAND, 5);
-
-    sbSizer3->Add(bSizer81a, 1, wxEXPAND, 2);
-    buildTestControls(&m_plotScalarRxOut, &m_btnRxOutTest, m_panelRx, sbSizer3, _("Play 2s"));
-    gSizer4->Add(sbSizer3, 1, wxEXPAND, 2);
-    bSizer20->Add(gSizer4, 1, wxEXPAND, 1);
-    m_panelRx->SetSizer(bSizer20);
-    m_panelRx->Layout();
-    bSizer20->Fit(m_panelRx);
-    m_notebook1->AddPage(m_panelRx, _("Receive"), true);
-
-    // Tx Tab -------------------------------------------------------------------------------
-
-    m_panelTx = new wxPanel(m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
-    wxBoxSizer* bSizer18;
-    bSizer18 = new wxBoxSizer(wxVERTICAL);
-    wxGridSizer* gSizer2;
-    gSizer2 = new wxGridSizer(2, 1, 0, 0);
-
-    // Tx In ----------------------------------------------------------------------------------
-
-    wxStaticBoxSizer* sbSizer22;
-    sbSizer22 = new wxStaticBoxSizer(new wxStaticBox(m_panelTx, wxID_ANY, _("From Microphone")), wxHORIZONTAL);
-
-    wxBoxSizer* bSizer83a = new wxBoxSizer(wxVERTICAL);
-
-    m_listCtrlTxInDevices = new wxListCtrl(m_panelTx, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VRULES);
-    bSizer83a->Add(m_listCtrlTxInDevices, 1, wxALL|wxEXPAND, 1);
-    wxBoxSizer* bSizer83;
-    bSizer83 = new wxBoxSizer(wxHORIZONTAL);
-    m_staticText12 = new wxStaticText(m_panelTx, wxID_ANY, _("Device:"), wxDefaultPosition, wxDefaultSize, 0);
-    m_staticText12->Wrap(-1);
-    bSizer83->Add(m_staticText12, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5);
-    m_textCtrlTxIn = new wxTextCtrl(m_panelTx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
-    bSizer83->Add(m_textCtrlTxIn, 1, wxALIGN_CENTER_VERTICAL|wxALL, 1);
-    m_staticText11 = new wxStaticText(m_panelTx, wxID_ANY, _("Sample Rate:"), wxDefaultPosition, wxDefaultSize, 0);
-    m_staticText11->Wrap(-1);
-    bSizer83->Add(m_staticText11, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5);
-    m_cbSampleRateTxIn = new wxComboBox(m_panelTx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(90,-1), 0, NULL, wxCB_DROPDOWN);
-    bSizer83->Add(m_cbSampleRateTxIn, 0, wxALL, 1);
-
-    bSizer83a->Add(bSizer83, 0, wxEXPAND, 5);
-
-    sbSizer22->Add(bSizer83a, 1, wxEXPAND, 2);
-    buildTestControls(&m_plotScalarTxIn, &m_btnTxInTest, m_panelTx, sbSizer22, _("Rec 2s"));
-
-    gSizer2->Add(sbSizer22, 1, wxEXPAND, 5);
-
-    // Tx Out ----------------------------------------------------------------------------------
-
-    wxStaticBoxSizer* sbSizer21;
-    sbSizer21 = new wxStaticBoxSizer(new wxStaticBox(m_panelTx, wxID_ANY, _("To Radio")), wxHORIZONTAL);
-
-    wxBoxSizer* bSizer82a = new wxBoxSizer(wxVERTICAL);
-
-    m_listCtrlTxOutDevices = new wxListCtrl(m_panelTx, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VRULES);
-    bSizer82a->Add(m_listCtrlTxOutDevices, 1, wxALL|wxEXPAND, 2);
-    wxBoxSizer* bSizer82;
-    bSizer82 = new wxBoxSizer(wxHORIZONTAL);
-    m_staticText81 = new wxStaticText(m_panelTx, wxID_ANY, _("Device:"), wxDefaultPosition, wxDefaultSize, 0);
-    m_staticText81->Wrap(-1);
-    bSizer82->Add(m_staticText81, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
-    m_textCtrlTxOut = new wxTextCtrl(m_panelTx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
-    bSizer82->Add(m_textCtrlTxOut, 1, wxALIGN_CENTER_VERTICAL|wxALL, 1);
-    m_staticText71 = new wxStaticText(m_panelTx, wxID_ANY, _("Sample Rate:"), wxDefaultPosition, wxDefaultSize, 0);
-    m_staticText71->Wrap(-1);
-    bSizer82->Add(m_staticText71, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5);
-    m_cbSampleRateTxOut = new wxComboBox(m_panelTx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(90,-1), 0, NULL, wxCB_DROPDOWN);
-    bSizer82->Add(m_cbSampleRateTxOut, 0, wxALL, 1);
-
-    bSizer82a->Add(bSizer82, 0, wxEXPAND, 5);
-
-    sbSizer21->Add(bSizer82a, 1, wxEXPAND, 2);
-    buildTestControls(&m_plotScalarTxOut, &m_btnTxOutTest, m_panelTx, sbSizer21, _("Play 2s"));
-
-    gSizer2->Add(sbSizer21, 1, wxEXPAND, 5);
-    bSizer18->Add(gSizer2, 1, wxEXPAND, 1);
-    m_panelTx->SetSizer(bSizer18);
-    m_panelTx->Layout();
-    bSizer18->Fit(m_panelTx);
-    m_notebook1->AddPage(m_panelTx, _("Transmit"), false);
-
-    // API Tab -------------------------------------------------------------------
-
-    m_panelAPI = new wxPanel(m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
-    wxBoxSizer* bSizer12;
-    bSizer12 = new wxBoxSizer(wxHORIZONTAL);
-    wxGridSizer* gSizer31;
-    gSizer31 = new wxGridSizer(2, 1, 0, 0);
-    wxStaticBoxSizer* sbSizer1;
-    sbSizer1 = new wxStaticBoxSizer(new wxStaticBox(m_panelAPI, wxID_ANY, _("PortAudio")), wxVERTICAL);
-
-    wxGridSizer* gSizer3;
-    gSizer3 = new wxGridSizer(4, 2, 0, 0);
-
-    m_staticText7 = new wxStaticText(m_panelAPI, wxID_ANY, _("PortAudio Version String:"), wxDefaultPosition, wxDefaultSize, 0);
-    m_staticText7->Wrap(-1);
-    gSizer3->Add(m_staticText7, 1, wxALIGN_RIGHT|wxALL|wxALIGN_CENTER_VERTICAL, 10);
-    m_textStringVer = new wxStaticText(m_panelAPI, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
-    gSizer3->Add(m_textStringVer, 1, wxALIGN_LEFT|wxALL|wxALIGN_CENTER_VERTICAL, 10);
-
-    m_staticText8 = new wxStaticText(m_panelAPI, wxID_ANY, _("PortAudio Int Version:"), wxDefaultPosition, wxDefaultSize, 0);
-    m_staticText8->Wrap(-1);
-    gSizer3->Add(m_staticText8, 1, wxALIGN_RIGHT|wxALL|wxALIGN_CENTER_VERTICAL, 10);
-    m_textIntVer = new wxStaticText(m_panelAPI, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(45,-1), 0);
-    gSizer3->Add(m_textIntVer, 1, wxALIGN_LEFT|wxALL|wxALIGN_CENTER_VERTICAL, 10);
-
-    m_staticText5 = new wxStaticText(m_panelAPI, wxID_ANY, _("Device Count:"), wxDefaultPosition, wxDefaultSize, 0);
-    m_staticText5->Wrap(-1);
-    gSizer3->Add(m_staticText5, 1, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 10);
-    m_textCDevCount = new wxStaticText(m_panelAPI, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(45,-1), 0);
-    gSizer3->Add(m_textCDevCount, 1, wxALIGN_LEFT|wxALL|wxALIGN_CENTER_VERTICAL, 10);
-
-    m_staticText4 = new wxStaticText(m_panelAPI, wxID_ANY, _("API Count:"), wxDefaultPosition, wxDefaultSize, 0);
-    m_staticText4->Wrap(-1);
-    gSizer3->Add(m_staticText4, 1, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 10);
-    m_textAPICount = new wxStaticText(m_panelAPI, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(45,-1), 0);
-    m_textAPICount->SetMaxSize(wxSize(45,-1));
-    gSizer3->Add(m_textAPICount, 1, wxALIGN_LEFT|wxALL|wxALIGN_CENTER_VERTICAL, 10);
-
-    sbSizer1->Add(gSizer3, 1, wxEXPAND, 2);
-    gSizer31->Add(sbSizer1, 1, wxEXPAND, 2);
-    wxStaticBoxSizer* sbSizer6;
-    sbSizer6 = new wxStaticBoxSizer(new wxStaticBox(m_panelAPI, wxID_ANY, _("Other")), wxVERTICAL);
-    gSizer31->Add(sbSizer6, 1, wxEXPAND, 5);
-    bSizer12->Add(gSizer31, 1, wxEXPAND, 5);
-    m_panelAPI->SetSizer(bSizer12);
-    m_panelAPI->Layout();
-    bSizer12->Fit(m_panelAPI);
-    m_notebook1->AddPage(m_panelAPI, _("API Info"), false);
-    bSizer4->Add(m_notebook1, 1, wxEXPAND | wxALL, 0);
-    m_panel1->SetSizer(bSizer4);
-    m_panel1->Layout();
-    bSizer4->Fit(m_panel1);
-    mainSizer->Add(m_panel1, 1, wxEXPAND | wxALL, 1);
-
-    wxBoxSizer* bSizer6;
-    bSizer6 = new wxBoxSizer(wxHORIZONTAL);
-    m_btnRefresh = new wxButton(this, wxID_ANY, _("Refresh"), wxDefaultPosition, wxDefaultSize, 0);
-    bSizer6->Add(m_btnRefresh, 0, wxALIGN_CENTER|wxALL, 2);
-
-    m_sdbSizer1 = new wxStdDialogButtonSizer();
-
-    m_sdbSizer1OK = new wxButton(this, wxID_OK);
-    m_sdbSizer1->AddButton(m_sdbSizer1OK);
-
-    m_sdbSizer1Cancel = new wxButton(this, wxID_CANCEL);
-    m_sdbSizer1->AddButton(m_sdbSizer1Cancel);
-
-    m_sdbSizer1Apply = new wxButton(this, wxID_APPLY);
-    m_sdbSizer1->AddButton(m_sdbSizer1Apply);
-
-    m_sdbSizer1->Realize();
-
-    bSizer6->Add(m_sdbSizer1, 1, wxALIGN_CENTER_VERTICAL, 2);
-    mainSizer->Add(bSizer6, 0, wxEXPAND, 2);
-    this->SetSizer(mainSizer);
-    this->Layout();
-    this->Centre(wxBOTH);
-//    this->Centre(wxBOTH);
-
-    m_notebook1->SetSelection(0);
-
-    showAPIInfo();
-    m_RxInDevices.m_listDevices   = m_listCtrlRxInDevices;
-    m_RxInDevices.direction       = AUDIO_IN;
-    m_RxInDevices.m_textDevice    = m_textCtrlRxIn;
-    m_RxInDevices.m_cbSampleRate  = m_cbSampleRateRxIn;
-
-    m_RxOutDevices.m_listDevices  = m_listCtrlRxOutDevices;
-    m_RxOutDevices.direction      = AUDIO_OUT;
-    m_RxOutDevices.m_textDevice   = m_textCtrlRxOut;
-    m_RxOutDevices.m_cbSampleRate = m_cbSampleRateRxOut;
-
-    m_TxInDevices.m_listDevices   = m_listCtrlTxInDevices;
-    m_TxInDevices.direction       = AUDIO_IN;
-    m_TxInDevices.m_textDevice    = m_textCtrlTxIn;
-    m_TxInDevices.m_cbSampleRate  = m_cbSampleRateTxIn;
-
-    m_TxOutDevices.m_listDevices  = m_listCtrlTxOutDevices;
-    m_TxOutDevices.direction      = AUDIO_OUT;
-    m_TxOutDevices.m_textDevice   = m_textCtrlTxOut;
-    m_TxOutDevices.m_cbSampleRate = m_cbSampleRateTxOut;
-
-    populateParams(m_RxInDevices);
-    populateParams(m_RxOutDevices);
-    populateParams(m_TxInDevices);
-    populateParams(m_TxOutDevices);
-
-    m_listCtrlRxInDevices->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( AudioOptsDialog::OnRxInDeviceSelect ), NULL, this );
-    m_listCtrlRxOutDevices->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( AudioOptsDialog::OnRxOutDeviceSelect ), NULL, this );
-    m_listCtrlTxInDevices->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( AudioOptsDialog::OnTxInDeviceSelect ), NULL, this );
-    m_listCtrlTxOutDevices->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( AudioOptsDialog::OnTxOutDeviceSelect ), NULL, this );
-
-    // wire up test buttons
-    m_btnRxInTest->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnRxInTest ), NULL, this );
-    m_btnRxOutTest->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnRxOutTest ), NULL, this );
-    m_btnTxInTest->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnTxInTest ), NULL, this );
-    m_btnTxOutTest->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnTxOutTest ), NULL, this );
-
-    m_btnRefresh->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnRefreshClick ), NULL, this );
-    m_sdbSizer1Apply->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnApplyAudioParameters ), NULL, this );
-    m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnCancelAudioParameters ), NULL, this );
-    m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnOkAudioParameters ), NULL, this );
-/*
-        void OnClose( wxCloseEvent& event ) { event.Skip(); }
-        void OnHibernate( wxActivateEvent& event ) { event.Skip(); }
-        void OnIconize( wxIconizeEvent& event ) { event.Skip(); }
-        void OnInitDialog( wxInitDialogEvent& event ) { event.Skip(); }
-*/
-//    this->Connect(wxEVT_CLOSE_WINDOW, wxCloseEventHandler(AudioOptsDialog::OnClose));
-    this->Connect(wxEVT_HIBERNATE, wxActivateEventHandler(AudioOptsDialog::OnHibernate));
-    this->Connect(wxEVT_ICONIZE, wxIconizeEventHandler(AudioOptsDialog::OnIconize));
-    this->Connect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(AudioOptsDialog::OnInitDialog));
-}
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// ~AudioOptsDialog()
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-AudioOptsDialog::~AudioOptsDialog()
-{
-    Pa_Terminate();
-
-    // Disconnect Events
-    this->Disconnect(wxEVT_HIBERNATE, wxActivateEventHandler(AudioOptsDialog::OnHibernate));
-    this->Disconnect(wxEVT_ICONIZE, wxIconizeEventHandler(AudioOptsDialog::OnIconize));
-    this->Disconnect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(AudioOptsDialog::OnInitDialog));
-
-    m_listCtrlRxInDevices->Disconnect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(AudioOptsDialog::OnRxInDeviceSelect), NULL, this);
-    m_listCtrlRxOutDevices->Disconnect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(AudioOptsDialog::OnRxOutDeviceSelect), NULL, this);
-    m_listCtrlTxInDevices->Disconnect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(AudioOptsDialog::OnTxInDeviceSelect), NULL, this);
-    m_listCtrlTxOutDevices->Disconnect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(AudioOptsDialog::OnTxOutDeviceSelect), NULL, this);
-
-    m_btnRxInTest->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnRxInTest ), NULL, this );
-    m_btnRxOutTest->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnRxOutTest ), NULL, this );
-    m_btnTxInTest->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnTxInTest ), NULL, this );
-    m_btnTxOutTest->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnTxOutTest ), NULL, this );
-
-    m_btnRefresh->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AudioOptsDialog::OnRefreshClick), NULL, this);
-    m_sdbSizer1Apply->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AudioOptsDialog::OnApplyAudioParameters), NULL, this);
-    m_sdbSizer1Cancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AudioOptsDialog::OnCancelAudioParameters), NULL, this);
-    m_sdbSizer1OK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AudioOptsDialog::OnOkAudioParameters), NULL, this);
-
-}
-
-//-------------------------------------------------------------------------
-// OnInitDialog()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnInitDialog( wxInitDialogEvent& event )
-{
-    ExchangeData(EXCHANGE_DATA_IN);
-}
-
-//-------------------------------------------------------------------------
-// OnInitDialog()
-//
-// helper function to look up name of devNum, and if it exists write
-// name to textCtrl.  Used to trap dissapearing devices.
-//-------------------------------------------------------------------------
-int AudioOptsDialog::setTextCtrlIfDevNumValid(wxTextCtrl *textCtrl, wxListCtrl *listCtrl, int devNum)
-{
-    int i, aDevNum, found_devNum;
-
-    // ignore last list entry as it is the "none" entry
-
-    found_devNum = 0;
-    for(i=0; i<listCtrl->GetItemCount()-1; i++) {
-        aDevNum = wxAtoi(listCtrl->GetItemText(i, 1));
-        //printf("aDevNum: %d devNum: %d\n", aDevNum, devNum);
-        if (aDevNum == devNum) {
-            found_devNum = 1;
-            textCtrl->SetValue(listCtrl->GetItemText(i, 0) + " (" + wxString::Format(wxT("%i"),devNum) + ")");
-            printf("setting focus of %d\n", i);
-            listCtrl->SetItemState(i, wxLIST_STATE_FOCUSED, wxLIST_STATE_FOCUSED);
-        }
-    }
-
-    if (found_devNum) 
-        return devNum;
-    else {
-        textCtrl->SetValue("none");
-        return -1;
-    }
-}
-
-//-------------------------------------------------------------------------
-// ExchangeData()
-//-------------------------------------------------------------------------
-int AudioOptsDialog::ExchangeData(int inout)
-{
-    if(inout == EXCHANGE_DATA_IN)
-    {
-        // Map sound card device numbers to tx/rx device numbers depending
-        // on number of sound cards in use
-
-        printf("EXCHANGE_DATA_IN:\n");
-        printf("  g_nSoundCards: %d\n", g_nSoundCards);
-        printf("  g_soundCard1InDeviceNum: %d\n", g_soundCard1InDeviceNum);
-        printf("  g_soundCard1OutDeviceNum: %d\n", g_soundCard1OutDeviceNum);
-        printf("  g_soundCard1SampleRate: %d\n", g_soundCard1SampleRate);
-        printf("  g_soundCard2InDeviceNum: %d\n", g_soundCard2InDeviceNum);
-        printf("  g_soundCard2OutDeviceNum: %d\n", g_soundCard2OutDeviceNum);
-        printf("  g_soundCard2SampleRate: %d\n", g_soundCard2SampleRate);
-
-        if (g_nSoundCards == 0) {
-            m_textCtrlRxIn ->SetValue("none"); rxInAudioDeviceNum  = -1;
-            m_textCtrlRxOut->SetValue("none"); rxOutAudioDeviceNum = -1;
-            m_textCtrlTxIn ->SetValue("none"); txInAudioDeviceNum  = -1;
-            m_textCtrlTxOut->SetValue("none"); txOutAudioDeviceNum = -1;           
-        }
-
-        if (g_nSoundCards == 1) {
-            rxInAudioDeviceNum  = setTextCtrlIfDevNumValid(m_textCtrlRxIn, 
-                                                           m_listCtrlRxInDevices, 
-                                                           g_soundCard1InDeviceNum);
-
-            rxOutAudioDeviceNum = setTextCtrlIfDevNumValid(m_textCtrlRxOut, 
-                                                           m_listCtrlRxOutDevices, 
-                                                           g_soundCard1OutDeviceNum);
-
-            if ((rxInAudioDeviceNum != -1) && (rxInAudioDeviceNum != -1)) {
-                m_cbSampleRateRxIn->SetValue(wxString::Format(wxT("%i"),g_soundCard1SampleRate));
-                m_cbSampleRateRxOut->SetValue(wxString::Format(wxT("%i"),g_soundCard1SampleRate));
-            }
-
-            m_textCtrlTxIn ->SetValue("none"); txInAudioDeviceNum  = -1;
-            m_textCtrlTxOut->SetValue("none"); txOutAudioDeviceNum = -1;           
-        }
-
-        if (g_nSoundCards == 2) {
-            rxInAudioDeviceNum  = setTextCtrlIfDevNumValid(m_textCtrlRxIn, 
-                                                           m_listCtrlRxInDevices, 
-                                                           g_soundCard1InDeviceNum);
-
-            rxOutAudioDeviceNum = setTextCtrlIfDevNumValid(m_textCtrlRxOut, 
-                                                           m_listCtrlRxOutDevices, 
-                                                           g_soundCard2OutDeviceNum);
-
-            txInAudioDeviceNum  = setTextCtrlIfDevNumValid(m_textCtrlTxIn, 
-                                                           m_listCtrlTxInDevices, 
-                                                           g_soundCard2InDeviceNum);
-
-            txOutAudioDeviceNum = setTextCtrlIfDevNumValid(m_textCtrlTxOut, 
-                                                           m_listCtrlTxOutDevices, 
-                                                           g_soundCard1OutDeviceNum);
-
-            if ((rxInAudioDeviceNum != -1) && (txOutAudioDeviceNum != -1)) {
-                m_cbSampleRateRxIn->SetValue(wxString::Format(wxT("%i"),g_soundCard1SampleRate));
-                m_cbSampleRateTxOut->SetValue(wxString::Format(wxT("%i"),g_soundCard1SampleRate));
-            }
-
-            if ((txInAudioDeviceNum != -1) && (rxOutAudioDeviceNum != -1)) {
-                m_cbSampleRateTxIn->SetValue(wxString::Format(wxT("%i"),g_soundCard2SampleRate));
-                m_cbSampleRateRxOut->SetValue(wxString::Format(wxT("%i"),g_soundCard2SampleRate));
-            }
-        }
-        printf("  rxInAudioDeviceNum: %d\n  rxOutAudioDeviceNum: %d\n  txInAudioDeviceNum: %d\n  txOutAudioDeviceNum: %d\n",
-               rxInAudioDeviceNum, rxOutAudioDeviceNum, txInAudioDeviceNum, txOutAudioDeviceNum);
-    }
-
-    if(inout == EXCHANGE_DATA_OUT)
-    {
-        int valid_one_card_config = 0;
-        int valid_two_card_config = 0;
-        wxString sampleRate1, sampleRate2;
-
-        printf("EXCHANGE_DATA_OUT:\n");
-        printf("  rxInAudioDeviceNum: %d\n  rxOutAudioDeviceNum: %d\n  txInAudioDeviceNum: %d\n  txOutAudioDeviceNum: %d\n",
-               rxInAudioDeviceNum, rxOutAudioDeviceNum, txInAudioDeviceNum, txOutAudioDeviceNum);
-
-        // ---------------------------------------------------------------
-        // check we have a valid 1 or 2 sound card configuration
-        // ---------------------------------------------------------------
-
-        // one sound card config, tx device numbers should be set to -1 
-
-        if ((rxInAudioDeviceNum != -1) && (rxOutAudioDeviceNum != -1) &&
-            (txInAudioDeviceNum == -1) && (txOutAudioDeviceNum == -1)) {
-            valid_one_card_config = 1; 
-
-            // in and out sample rate must be the same, as there is one callback
-            
-            sampleRate1 = m_cbSampleRateRxIn->GetValue();
-            if (!sampleRate1.IsSameAs(m_cbSampleRateRxOut->GetValue())) {
-                wxMessageBox(wxT("With a single sound card the Sample Rate of "
-                                 "From Radio and To Speaker/Headphones must be the same."), wxT(""), wxOK);
-                return -1;
-            }
-        }
-
-        // two card configuration
-
-        if ((rxInAudioDeviceNum != -1) && (rxOutAudioDeviceNum != -1) &&
-            (txInAudioDeviceNum != -1) && (txOutAudioDeviceNum != -1)) {
-
-            valid_two_card_config = 1; 
-
-            // Check we haven't doubled up on sound devices
-
-            if (rxInAudioDeviceNum == txInAudioDeviceNum) {
-                wxMessageBox(wxT("You must use different devices for From Radio and From Microphone"), wxT(""), wxOK);
-                return -1;
-            }
-
-            if (rxOutAudioDeviceNum == txOutAudioDeviceNum) {
-                wxMessageBox(wxT("You must use different devices for To Radio and To Speaker/Headphones"), wxT(""), wxOK);
-                return -1;
-            }
-
-            // Check sample rates for callback 1 devices are the same,
-            // as input and output are handled synchronously by one
-            // portaudio callback
-            
-            sampleRate1 = m_cbSampleRateRxIn->GetValue();
-            if (!sampleRate1.IsSameAs(m_cbSampleRateTxOut->GetValue())) {
-                wxMessageBox(wxT("With two sound cards the Sample Rate "
-                                 "of From Radio and To Radio must be the same."), wxT(""), wxOK);
-                return -1;
-            }
-            // check sample rate for callback 2 devices is the same
-
-            sampleRate2 = m_cbSampleRateTxIn->GetValue();
-            if (!sampleRate2.IsSameAs(m_cbSampleRateRxOut->GetValue())) {
-                wxMessageBox(wxT("With two sound cards the Sample Rate of "
-                                 "From Microphone and To Speaker/Headphones must be the same."), wxT(""), wxOK);
-                return -1;
-            }
-        }
-
-        printf("  valid_one_card_config: %d  valid_two_card_config: %d\n", valid_one_card_config, valid_two_card_config);
-
-        if (!valid_one_card_config && !valid_two_card_config) {
-            wxMessageBox(wxT("Invalid one or two sound card configuration"), wxT(""), wxOK);
-            return -1;
-        }
-
-        // ---------------------------------------------------------------
-        // Map Rx/TX device numbers to sound card device numbers used
-        // in callbacks. Portaudio uses one callback per sound card so
-        // we have to be soundcard oriented at run time rather than
-        // Tx/Rx oriented as in this dialog.
-        // ---------------------------------------------------------------
-        g_nSoundCards = 0;
-        g_soundCard1InDeviceNum = g_soundCard1OutDeviceNum = g_soundCard2InDeviceNum = g_soundCard2OutDeviceNum = -1;
-
-        if (valid_one_card_config) {
-
-            // Only callback 1 used
-
-            g_nSoundCards = 1;
-            g_soundCard1InDeviceNum  = rxInAudioDeviceNum;
-            g_soundCard1OutDeviceNum = rxOutAudioDeviceNum;
-            g_soundCard1SampleRate = wxAtoi(sampleRate1);
-        }
-
-        if (valid_two_card_config) {
-            g_nSoundCards = 2;
-            g_soundCard1InDeviceNum  = rxInAudioDeviceNum;
-            g_soundCard1OutDeviceNum = txOutAudioDeviceNum;
-            g_soundCard1SampleRate   = wxAtoi(sampleRate1);
-            g_soundCard2InDeviceNum  = txInAudioDeviceNum;
-            g_soundCard2OutDeviceNum = rxOutAudioDeviceNum;
-            g_soundCard2SampleRate   = wxAtoi(sampleRate2);
-        }
-
-        printf("  g_nSoundCards: %d\n", g_nSoundCards);
-        printf("  g_soundCard1InDeviceNum: %d\n", g_soundCard1InDeviceNum);
-        printf("  g_soundCard1OutDeviceNum: %d\n", g_soundCard1OutDeviceNum);
-        printf("  g_soundCard1SampleRate: %d\n", g_soundCard1SampleRate);
-        printf("  g_soundCard2InDeviceNum: %d\n", g_soundCard2InDeviceNum);
-        printf("  g_soundCard2OutDeviceNum: %d\n", g_soundCard2OutDeviceNum);
-        printf("  g_soundCard2SampleRate: %d\n", g_soundCard2SampleRate);
-
-        wxConfigBase *pConfig = wxConfigBase::Get();
-        pConfig->Write(wxT("/Audio/soundCard1InDeviceNum"),       g_soundCard1InDeviceNum);
-        pConfig->Write(wxT("/Audio/soundCard1OutDeviceNum"),      g_soundCard1OutDeviceNum);
-        pConfig->Write(wxT("/Audio/soundCard1SampleRate"),        g_soundCard1SampleRate );
-
-        pConfig->Write(wxT("/Audio/soundCard2InDeviceNum"),       g_soundCard2InDeviceNum);
-        pConfig->Write(wxT("/Audio/soundCard2OutDeviceNum"),      g_soundCard2OutDeviceNum);
-        pConfig->Write(wxT("/Audio/soundCard2SampleRate"),        g_soundCard2SampleRate );
-
-        pConfig->Flush();
-        delete wxConfigBase::Set((wxConfigBase *) NULL);
-    }
-
-    return 0;
-}
-
-//-------------------------------------------------------------------------
-// buildListOfSupportedSampleRates()
-//-------------------------------------------------------------------------
-int AudioOptsDialog:: buildListOfSupportedSampleRates(wxComboBox *cbSampleRate, int devNum, int in_out)
-{
-    // every sound device has a different list of supported sample rates, so
-    // we work out which ones are supported and populate the list ctrl
-
-    static double standardSampleRates[] =
-    {
-        8000.0,     9600.0,
-        11025.0,    12000.0,
-        16000.0,    22050.0,
-        24000.0,    32000.0,
-        44100.0,    48000.0,
-        88200.0,    96000.0,
-        192000.0,   -1          // negative terminated  list
-    };
-
-    const PaDeviceInfo  *deviceInfo;
-    PaStreamParameters   inputParameters, outputParameters;
-    PaError              err;
-    wxString             str;
-    int                  i, numSampleRates;
-
-    deviceInfo = Pa_GetDeviceInfo(devNum);
-    if (deviceInfo == NULL) {
-        printf("Pa_GetDeviceInfo(%d) failed!\n", devNum);
-        cbSampleRate->Clear();
-        return 0;
-    }
-
-    inputParameters.device = devNum;
-    inputParameters.channelCount = deviceInfo->maxInputChannels;
-    inputParameters.sampleFormat = paInt16;
-    inputParameters.suggestedLatency = 0;
-    inputParameters.hostApiSpecificStreamInfo = NULL;
-        
-    outputParameters.device = devNum;
-    outputParameters.channelCount = deviceInfo->maxOutputChannels;
-    outputParameters.sampleFormat = paInt16;
-    outputParameters.suggestedLatency = 0;
-    outputParameters.hostApiSpecificStreamInfo = NULL;
-    
-    cbSampleRate->Clear();
-    //printf("devNum %d supports: ", devNum);
-    numSampleRates = 0;
-    for(i = 0; standardSampleRates[i] > 0; i++)
-    {      
-        if (in_out == AUDIO_IN)
-            err = Pa_IsFormatSupported(&inputParameters, NULL, standardSampleRates[i]);
-        else
-            err = Pa_IsFormatSupported(NULL, &outputParameters, standardSampleRates[i]);
-
-        if( err == paFormatIsSupported ) {
-            str.Printf("%i", (int)standardSampleRates[i]);
-            cbSampleRate->AppendString(str);
-            printf("%i ", (int)standardSampleRates[i]);
-            numSampleRates++;
-        }
-    }
-    printf("\n");
-
-    return numSampleRates;
-}
-
-//-------------------------------------------------------------------------
-// showAPIInfo()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::showAPIInfo()
-{
-    wxString    strval;
-    int         apiVersion;
-    int         apiCount        = 0;
-    int         numDevices      = 0;
-
-    strval = Pa_GetVersionText();
-    m_textStringVer->SetLabel(strval);
-
-    apiVersion = Pa_GetVersion();
-    strval.Printf(wxT("%d"), apiVersion);
-    m_textIntVer->SetLabel(strval);
-
-    apiCount = Pa_GetHostApiCount();
-    strval.Printf(wxT("%d"), apiCount);
-    m_textAPICount->SetLabel(strval);
-
-    numDevices = Pa_GetDeviceCount();
-    strval.Printf(wxT("%d"), numDevices);
-    m_textCDevCount->SetLabel(strval);
-}
-
-//-------------------------------------------------------------------------
-// populateParams()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::populateParams(AudioInfoDisplay ai)
-{
-    const       PaDeviceInfo *deviceInfo = NULL;
-    wxListCtrl* ctrl    = ai.m_listDevices;
-    int         in_out  = ai.direction;
-    long        idx;
-    int         numDevices;
-    wxListItem  listItem;
-    wxString    buf;
-    int         devn;
-    int         col = 0;
-
-    numDevices = Pa_GetDeviceCount();
-
-    if(ctrl->GetColumnCount() > 0)
-    {
-        ctrl->ClearAll();
-    }
-
-    listItem.SetAlign(wxLIST_FORMAT_LEFT);
-    listItem.SetText(wxT("Device"));
-    idx = ctrl->InsertColumn(col, listItem);
-    ctrl->SetColumnWidth(col++, 300);
-
-    listItem.SetAlign(wxLIST_FORMAT_CENTRE);
-    listItem.SetText(wxT("ID"));
-    idx = ctrl->InsertColumn(col, listItem);
-    ctrl->SetColumnWidth(col++, 45);
-
-    listItem.SetAlign(wxLIST_FORMAT_LEFT);
-    listItem.SetText(wxT("API"));
-    idx = ctrl->InsertColumn(col, listItem);
-    ctrl->SetColumnWidth(col++, 100);
-
-    if(in_out == AUDIO_IN)
-    {
-        listItem.SetAlign(wxLIST_FORMAT_CENTRE);
-        listItem.SetText(wxT("Default Sample Rate"));
-        idx = ctrl->InsertColumn(col, listItem);
-        ctrl->SetColumnWidth(col++, 160);
-    }
-    else if(in_out == AUDIO_OUT)
-    {
-        listItem.SetAlign(wxLIST_FORMAT_CENTRE);
-        listItem.SetText(wxT("Default Sample Rate"));
-        idx = ctrl->InsertColumn(col, listItem);
-        ctrl->SetColumnWidth(col++, 160);
-    }
-
-    #ifdef LATENCY
-    listItem.SetAlign(wxLIST_FORMAT_CENTRE);
-    listItem.SetText(wxT("Min Latency"));
-    ctrl->InsertColumn(col, listItem);
-    ctrl->SetColumnWidth(col++, 100);
-
-    listItem.SetAlign(wxLIST_FORMAT_CENTRE);
-    listItem.SetText(wxT("Max Latency"));
-    ctrl->InsertColumn(col, listItem);
-    ctrl->SetColumnWidth(col++, 100);
-    #endif
-
-    for(devn = 0; devn < numDevices; devn++)
-    {
-        buf.Printf(wxT(""));
-        deviceInfo = Pa_GetDeviceInfo(devn);
-        if( ((in_out == AUDIO_IN) && (deviceInfo->maxInputChannels > 0)) ||
-            ((in_out == AUDIO_OUT) && (deviceInfo->maxOutputChannels > 0)))
-        {
-            col = 0;
-            buf.Printf(wxT("%s"), deviceInfo->name);
-            idx = ctrl->InsertItem(ctrl->GetItemCount(), buf);
-            col++;
-                
-            buf.Printf(wxT("%d"), devn);
-            ctrl->SetItem(idx, col++, buf);
-
-            buf.Printf(wxT("%s"), Pa_GetHostApiInfo(deviceInfo->hostApi)->name);
-            ctrl->SetItem(idx, col++, buf);
-
-            buf.Printf(wxT("%i"), (int)deviceInfo->defaultSampleRate);
-            ctrl->SetItem(idx, col++, buf);
-
-            #ifdef LATENCY
-            if (in_out == AUDIO_IN)
-                buf.Printf(wxT("%8.4f"), deviceInfo->defaultLowInputLatency);
-            else
-                buf.Printf(wxT("%8.4f"), deviceInfo->defaultLowOutputLatency);               
-            ctrl->SetItem(idx, col++, buf);
-
-            if (in_out == AUDIO_IN)
-                buf.Printf(wxT("%8.4f"), deviceInfo->defaultHighInputLatency);
-            else
-                 buf.Printf(wxT("%8.4f"), deviceInfo->defaultHighOutputLatency);             
-            ctrl->SetItem(idx, col++, buf);
-            #endif
-        }        
-    }
-
-    // add "none" option at end
-
-    buf.Printf(wxT("%s"), "none");
-    idx = ctrl->InsertItem(ctrl->GetItemCount(), buf);
-}
-
-//-------------------------------------------------------------------------
-// OnDeviceSelect()
-//
-// helper function to set up "Device:" and "Sample Rate:" fields when
-// we click on a line in the list of devices box
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnDeviceSelect(wxComboBox *cbSampleRate, 
-                                     wxTextCtrl *textCtrl, 
-                                     int        *devNum, 
-                                     wxListCtrl *listCtrlDevices, 
-                                     int         index,
-                                     int         in_out)
-{
-
-    wxString devName = listCtrlDevices->GetItemText(index, 0);
-     if (devName.IsSameAs("none")) {
-        *devNum = -1;
-        textCtrl->SetValue("none");
-    }
-    else {
-        *devNum = wxAtoi(listCtrlDevices->GetItemText(index, 1));
-        textCtrl->SetValue(devName + " (" + wxString::Format(wxT("%i"),*devNum) + ")");
-
-        int numSampleRates = buildListOfSupportedSampleRates(cbSampleRate, *devNum, in_out);
-        if (numSampleRates) {
-            wxString defSampleRate = listCtrlDevices->GetItemText(index, 3);        
-            cbSampleRate->SetValue(defSampleRate);
-        }
-        else {
-             cbSampleRate->SetValue("None");           
-        }
-    }
-}
-
-//-------------------------------------------------------------------------
-// OnRxInDeviceSelect()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnRxInDeviceSelect(wxListEvent& evt)
-{
-    OnDeviceSelect(m_cbSampleRateRxIn, 
-                   m_textCtrlRxIn, 
-                   &rxInAudioDeviceNum, 
-                   m_listCtrlRxInDevices, 
-                   evt.GetIndex(),
-                   AUDIO_IN);
-}
-
-//-------------------------------------------------------------------------
-// OnRxOutDeviceSelect()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnRxOutDeviceSelect(wxListEvent& evt)
-{
-    OnDeviceSelect(m_cbSampleRateRxOut, 
-                   m_textCtrlRxOut, 
-                   &rxOutAudioDeviceNum, 
-                   m_listCtrlRxOutDevices, 
-                   evt.GetIndex(),
-                   AUDIO_OUT);
-}
-
-//-------------------------------------------------------------------------
-// OnTxInDeviceSelect()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnTxInDeviceSelect(wxListEvent& evt)
-{
-    OnDeviceSelect(m_cbSampleRateTxIn, 
-                   m_textCtrlTxIn, 
-                   &txInAudioDeviceNum, 
-                   m_listCtrlTxInDevices, 
-                   evt.GetIndex(),
-                   AUDIO_IN);
-}
-
-//-------------------------------------------------------------------------
-// OnTxOutDeviceSelect()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnTxOutDeviceSelect(wxListEvent& evt)
-{
-    OnDeviceSelect(m_cbSampleRateTxOut, 
-                   m_textCtrlTxOut, 
-                   &txOutAudioDeviceNum, 
-                   m_listCtrlTxOutDevices, 
-                   evt.GetIndex(),
-                   AUDIO_OUT);
-}
-
-//-------------------------------------------------------------------------
-// plotDeviceInputForAFewSecs()
-//
-// opens a record device and plots the input speech for a few seconds.  This is "modal" using
-// synchronous portaudio functions, so the GUI will not respond until after test sample has been
-// taken
-//-------------------------------------------------------------------------
-void AudioOptsDialog::plotDeviceInputForAFewSecs(int devNum, PlotScalar *plotScalar) {
-    PaStreamParameters  inputParameters;
-    const PaDeviceInfo *deviceInfo = NULL;
-    PaStream           *stream = NULL;
-    PaError             err;
-    short               in48k_stereo_short[2*TEST_BUF_SIZE];
-    short               in48k_short[TEST_BUF_SIZE];
-    short               in8k_short[TEST_BUF_SIZE];
-    int                 numDevices, nBufs, i, j, src_error,inputChannels;
-    float               t;
-    SRC_STATE          *src;
-    FIFO               *fifo;
-
-    // a basic sanity check
-    numDevices = Pa_GetDeviceCount();
-    if (devNum >= numDevices)
-        return;
-    if (devNum < 0)
-        return;
-    printf("devNum %d\n", devNum);
-
-    fifo = fifo_create((int)(DT*TEST_WAVEFORM_PLOT_FS*2)); assert(fifo != NULL);
-    src = src_new(SRC_SINC_FASTEST, 1, &src_error); assert(src != NULL);
-
-    // work out how many input channels this device supports.
-
-    deviceInfo = Pa_GetDeviceInfo(devNum);
-    if (deviceInfo == NULL) {
-        wxMessageBox(wxT("Couldn't get device info from Port Audio for Sound Card "), wxT("Error"), wxOK);
-        return;
-    }
-    if (deviceInfo->maxInputChannels == 1)
-        inputChannels = 1;
-    else
-        inputChannels = 2;
-
-    // open device
-
-    inputParameters.device = devNum;
-    inputParameters.channelCount = inputChannels;
-    inputParameters.sampleFormat = paInt16;
-    inputParameters.suggestedLatency = Pa_GetDeviceInfo( inputParameters.device )->defaultHighInputLatency;
-    inputParameters.hostApiSpecificStreamInfo = NULL;
-
-    nBufs = TEST_WAVEFORM_PLOT_TIME*TEST_FS/TEST_BUF_SIZE;
-    printf("inputChannels: %d nBufs %d\n", inputChannels, nBufs);
-
-    err = Pa_OpenStream(
-              &stream,
-              &inputParameters,
-              NULL,
-              TEST_FS,
-              TEST_BUF_SIZE,
-              paClipOff,    
-              NULL,       // no callback, use blocking API
-              NULL ); 
-    if (err != paNoError) {
-        wxMessageBox(wxT("Couldn't initialise sound device."), wxT("Error"), wxOK);       
-        return;
-    }
-
-    err = Pa_StartStream(stream);
-    if (err != paNoError) {
-        wxMessageBox(wxT("Couldn't start sound device."), wxT("Error"), wxOK);       
-        return;
-    }
-
-    for(i=0, t=0.0; i<nBufs; i++, t+=(float)TEST_BUF_SIZE/TEST_FS) {
-        Pa_ReadStream(stream, in48k_stereo_short, TEST_BUF_SIZE);
-        if (inputChannels == 2) {
-            for(j=0; j<TEST_BUF_SIZE; j++)
-                in48k_short[j] = in48k_stereo_short[2*j]; // left channel only
-        }
-        else {
-            for(j=0; j<TEST_BUF_SIZE; j++)
-                in48k_short[j] = in48k_stereo_short[j]; 
-        }
-        int n8k = resample(src, in8k_short, in48k_short, 8000, TEST_FS, TEST_BUF_SIZE, TEST_BUF_SIZE);
-        resample_for_plot(fifo, in8k_short, n8k, FS);
-
-        // every TEST_DT seconds update plot, unfortunately plot
-        // doesnt get updated to end as we are blocking events in this
-        // function
-
-        if (t > TEST_DT) {
-            t -= TEST_DT;
-            short plotSamples[TEST_WAVEFORM_PLOT_BUF];
-            if (fifo_read(fifo, plotSamples, TEST_WAVEFORM_PLOT_BUF))
-                memset(plotSamples, 0, TEST_WAVEFORM_PLOT_BUF*sizeof(short));
-            plotScalar->add_new_short_samples(0, plotSamples, TEST_WAVEFORM_PLOT_BUF, 32767);
-            plotScalar->Refresh();
-       }
-    }
-   
-    err = Pa_StopStream(stream);
-    if (err != paNoError) {
-        wxMessageBox(wxT("Couldn't stop sound device."), wxT("Error"), wxOK);       
-        return;
-    }
-    Pa_CloseStream(stream);
-
-    fifo_destroy(fifo);
-    src_delete(src);
-}
-
-//-------------------------------------------------------------------------
-// plotDeviceOutputForAFewSecs()
-//
-// opens a play device and plays a tone for a few seconds.  This is "modal" using
-// synchronous portaudio functions, so the GUI will not respond until after test sample has been
-// taken.  Also plots a pretty picture like the record versions
-//-------------------------------------------------------------------------
-void AudioOptsDialog::plotDeviceOutputForAFewSecs(int devNum, PlotScalar *plotScalar) {
-    PaStreamParameters  outputParameters;
-    const PaDeviceInfo *deviceInfo = NULL;
-    PaStream           *stream = NULL;
-    PaError             err;
-    short               out48k_stereo_short[2*TEST_BUF_SIZE];
-    short               out48k_short[TEST_BUF_SIZE];
-    short               out8k_short[TEST_BUF_SIZE];
-    int                 numDevices, nBufs, i, j, src_error, n, outputChannels;
-    float               t;
-    SRC_STATE          *src;
-    FIFO               *fifo;
-
-    // a basic sanity check
-    numDevices = Pa_GetDeviceCount();
-    if (devNum >= numDevices)
-        return;
-    if (devNum < 0)
-        return;
-
-    fifo = fifo_create((int)(DT*TEST_WAVEFORM_PLOT_FS*2)); assert(fifo != NULL);
-    src = src_new(SRC_SINC_FASTEST, 1, &src_error); assert(src != NULL);
-
-    // work out how many output channels this device supports.
-
-    deviceInfo = Pa_GetDeviceInfo(devNum);
-    if (deviceInfo == NULL) {
-        wxMessageBox(wxT("Couldn't get device info from Port Audio for Sound Card "), wxT("Error"), wxOK);
-        return;
-    }
-    if (deviceInfo->maxOutputChannels == 1)
-        outputChannels = 1;
-    else
-        outputChannels = 2;
-
-    printf("outputChannels: %d\n", outputChannels);
-
-    outputParameters.device = devNum;
-    outputParameters.channelCount = outputChannels;
-    outputParameters.sampleFormat = paInt16;
-    outputParameters.suggestedLatency = Pa_GetDeviceInfo( outputParameters.device )->defaultHighOutputLatency;
-    outputParameters.hostApiSpecificStreamInfo = NULL;
-
-    nBufs = TEST_WAVEFORM_PLOT_TIME*TEST_FS/TEST_BUF_SIZE;
-
-    err = Pa_OpenStream(
-              &stream,
-              NULL,
-              &outputParameters,
-              TEST_FS,
-              TEST_BUF_SIZE,
-              paClipOff,    
-              NULL,       // no callback, use blocking API
-              NULL ); 
-    if (err != paNoError) {
-        wxMessageBox(wxT("Couldn't initialise sound device."), wxT("Error"), wxOK);       
-        return;
-    }
-
-    err = Pa_StartStream(stream);
-    if (err != paNoError) {
-        wxMessageBox(wxT("Couldn't start sound device."), wxT("Error"), wxOK);       
-        return;
-    }
-
-    for(i=0, t=0.0, n=0; i<nBufs; i++, t+=(float)TEST_BUF_SIZE/TEST_FS) {
-        for(j=0; j<TEST_BUF_SIZE; j++,n++) {
-            out48k_short[j] = 2000.0*cos(6.2832*(n++)*400.0/TEST_FS);
-            if (outputChannels == 2) {
-                out48k_stereo_short[2*j] = out48k_short[j];   // left channel
-                out48k_stereo_short[2*j+1] = out48k_short[j]; // right channel
-            }
-            else {
-                out48k_stereo_short[j] = out48k_short[j];     // mono
-            }
-        }
-        Pa_WriteStream(stream, out48k_stereo_short, TEST_BUF_SIZE);
-
-        // convert back to 8kHz just for plotting
-        int n8k = resample(src, out8k_short, out48k_short, 8000, TEST_FS, TEST_BUF_SIZE, TEST_BUF_SIZE);
-        resample_for_plot(fifo, out8k_short, n8k, FS);
-
-        // every TEST_DT seconds update plot
-
-        if (t > TEST_DT) {
-            t -= TEST_DT;
-            short plotSamples[TEST_WAVEFORM_PLOT_BUF];
-            if (fifo_read(fifo, plotSamples, TEST_WAVEFORM_PLOT_BUF))
-                memset(plotSamples, 0, TEST_WAVEFORM_PLOT_BUF*sizeof(short));
-            plotScalar->add_new_short_samples(0, plotSamples, TEST_WAVEFORM_PLOT_BUF, 32767);
-            plotScalar->Refresh();
-       }
-    }
-   
-    err = Pa_StopStream(stream);
-    if (err != paNoError) {
-        wxMessageBox(wxT("Couldn't stop sound device."), wxT("Error"), wxOK);       
-        return;
-    }
-    Pa_CloseStream(stream);
-
-    fifo_destroy(fifo);
-    src_delete(src);
-}
-
-//-------------------------------------------------------------------------
-// OnRxInTest()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnRxInTest(wxCommandEvent& event)
-{
-    plotDeviceInputForAFewSecs(rxInAudioDeviceNum, m_plotScalarRxIn);
-}
-
-//-------------------------------------------------------------------------
-// OnRxOutTest()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnRxOutTest(wxCommandEvent& event)
-{
-    plotDeviceOutputForAFewSecs(rxOutAudioDeviceNum, m_plotScalarRxOut);
-}
-
-//-------------------------------------------------------------------------
-// OnTxInTest()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnTxInTest(wxCommandEvent& event)
-{
-    plotDeviceInputForAFewSecs(txInAudioDeviceNum, m_plotScalarTxIn);
-}
-
-//-------------------------------------------------------------------------
-// OnTxOutTest()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnTxOutTest(wxCommandEvent& event)
-{
-    plotDeviceOutputForAFewSecs(txOutAudioDeviceNum, m_plotScalarTxOut);
-}
-
-//-------------------------------------------------------------------------
-// OnRefreshClick()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnRefreshClick(wxCommandEvent& event)
-{
-    // restart portaudio, to re-sample available devices
-
-    Pa_Terminate();
-    Pa_Init();
-
-    m_notebook1->SetSelection(0);
-    showAPIInfo();
-    populateParams(m_RxInDevices);
-    populateParams(m_RxOutDevices);
-    populateParams(m_TxInDevices);
-    populateParams(m_TxOutDevices);
-
-    // some devices may have dissapeared, so possibily change sound
-    // card config
-
-    ExchangeData(EXCHANGE_DATA_IN);
-}
-
-//-------------------------------------------------------------------------
-// OnApplyAudioParameters()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnApplyAudioParameters(wxCommandEvent& event)
-{
-    ExchangeData(EXCHANGE_DATA_OUT);
-    if(m_isPaInitialized)
-    {
-        if((pa_err = Pa_Terminate()) == paNoError)
-        {
-            m_isPaInitialized = false;
-        }
-        else
-        {
-            wxMessageBox(wxT("Port Audio failed to Terminate"), wxT("Pa_Terminate"), wxOK);
-        }
-    }
-}
-
-//-------------------------------------------------------------------------
-// OnCancelAudioParameters()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnCancelAudioParameters(wxCommandEvent& event)
-{
-    if(m_isPaInitialized)
-    {
-        if((pa_err = Pa_Terminate()) == paNoError)
-        {
-            m_isPaInitialized = false;
-        }
-        else
-        {
-            wxMessageBox(wxT("Port Audio failed to Terminate"), wxT("Pa_Terminate"), wxOK);
-        }
-    }
-    EndModal(wxCANCEL);
-}
-
-//-------------------------------------------------------------------------
-// OnOkAudioParameters()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnOkAudioParameters(wxCommandEvent& event)
-{
-    int status = ExchangeData(EXCHANGE_DATA_OUT);
-
-    // We only accept OK if config sucessful
-
-    printf("status: %d m_isPaInitialized: %d\n", status, m_isPaInitialized);
-    if (status == 0) {
-        if(m_isPaInitialized)
-        {
-            if((pa_err = Pa_Terminate()) == paNoError)
-            {
-                printf("terminated OK\n");
-                m_isPaInitialized = false;
-            }
-            else
-            {
-                wxMessageBox(wxT("Port Audio failed to Terminate"), wxT("Pa_Terminate"), wxOK);
-            }
-        }
-        EndModal(wxOK);
-    }
-
-}
diff --git a/fdmdv2/tags/0.99-Beta/src/dlg_audiooptions.h b/fdmdv2/tags/0.99-Beta/src/dlg_audiooptions.h
deleted file mode 100644 (file)
index 7a78b59..0000000
+++ /dev/null
@@ -1,176 +0,0 @@
-//=========================================================================
-// Name:          AudioInfoDisplay.h
-// Purpose:       Declares simple wxWidgets application with GUI
-//                created using wxFormBuilder.
-// 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 <http://www.gnu.org/licenses/>.
-//
-//=========================================================================
-#ifndef __AudioOptsDialog__
-#define __AudioOptsDialog__
-
-#include "fdmdv2_main.h"
-
-#define ID_AUDIO_OPTIONS    1000
-#define AUDIO_IN            0
-#define AUDIO_OUT           1
-
-#include "portaudio.h"
-#ifdef WIN32
-#if PA_USE_ASIO
-#include "pa_asio.h"
-#endif
-#endif
-#include "codec2_fifo.h"
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// AudioInfoDisplay
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class AudioInfoDisplay
-{
-    public:
-        wxListCtrl*     m_listDevices;
-        int             direction;
-        wxTextCtrl*     m_textDevice;
-        wxComboBox*     m_cbSampleRate;
-};
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// class AudioOptsDialog
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class AudioOptsDialog : public wxDialog
-{
-    private:
-
-    protected:
-        PaError         pa_err;
-        bool            m_isPaInitialized;
-
-        int             rxInAudioDeviceNum;
-        int             rxOutAudioDeviceNum;
-        int             txInAudioDeviceNum;
-        int             txOutAudioDeviceNum;
-
-        void buildTestControls(PlotScalar **plotScalar, wxButton **btnTest, 
-                               wxPanel *parentPanel, wxBoxSizer *bSizer, wxString buttonLabel);
-        void plotDeviceInputForAFewSecs(int devNum, PlotScalar *plotScalar);
-        void plotDeviceOutputForAFewSecs(int devNum, PlotScalar *plotScalar);
-
-        int buildListOfSupportedSampleRates(wxComboBox *cbSampleRate, int devNum, int in_out);
-        void populateParams(AudioInfoDisplay);
-        void showAPIInfo();
-        int setTextCtrlIfDevNumValid(wxTextCtrl *textCtrl, wxListCtrl *listCtrl, int devNum);
-        void Pa_Init(void);
-        void OnDeviceSelect(wxComboBox *cbSampleRate, 
-                            wxTextCtrl *textCtrl, 
-                            int        *devNum, 
-                            wxListCtrl *listCtrlDevices, 
-                            int         index,
-                            int         in_out);
-
-        AudioInfoDisplay m_RxInDevices;
-        AudioInfoDisplay m_RxOutDevices;
-        AudioInfoDisplay m_TxInDevices;
-        AudioInfoDisplay m_TxOutDevices;
-        wxPanel* m_panel1;
-        wxNotebook* m_notebook1;
-
-        wxPanel* m_panelRx;
-
-        wxListCtrl* m_listCtrlRxInDevices;
-        wxStaticText* m_staticText51;
-        wxTextCtrl* m_textCtrlRxIn;
-        wxStaticText* m_staticText6;
-        wxComboBox* m_cbSampleRateRxIn;
-
-        wxButton* m_btnRxInTest;
-        PlotScalar* m_plotScalarRxIn;
-
-        wxListCtrl* m_listCtrlRxOutDevices;
-        wxStaticText* m_staticText9;
-        wxTextCtrl* m_textCtrlRxOut;
-        wxStaticText* m_staticText10;
-        wxComboBox* m_cbSampleRateRxOut;
-
-        wxButton* m_btnRxOutTest;
-        PlotScalar* m_plotScalarRxOut;
-
-        wxPanel* m_panelTx;
-
-        wxListCtrl* m_listCtrlTxInDevices;
-        wxStaticText* m_staticText12;
-        wxTextCtrl* m_textCtrlTxIn;
-        wxStaticText* m_staticText11;
-        wxComboBox* m_cbSampleRateTxIn;
-
-        wxButton* m_btnTxInTest;
-        PlotScalar* m_plotScalarTxIn;
-
-        wxListCtrl* m_listCtrlTxOutDevices;
-        wxStaticText* m_staticText81;
-        wxTextCtrl* m_textCtrlTxOut;
-        wxStaticText* m_staticText71;
-        wxComboBox* m_cbSampleRateTxOut;
-
-        wxButton* m_btnTxOutTest;
-        PlotScalar* m_plotScalarTxOut;
-
-        wxPanel* m_panelAPI;
-
-        wxStaticText* m_staticText7;
-        wxStaticText* m_textStringVer;
-        wxStaticText* m_staticText8;
-        wxStaticText* m_textIntVer;
-        wxStaticText* m_staticText5;
-        wxStaticText* m_textCDevCount;
-        wxStaticText* m_staticText4;
-        wxStaticText* m_textAPICount;
-        wxButton* m_btnRefresh;
-        wxStdDialogButtonSizer* m_sdbSizer1;
-        wxButton* m_sdbSizer1OK;
-        wxButton* m_sdbSizer1Apply;
-        wxButton* m_sdbSizer1Cancel;
-
-        // Virtual event handlers, overide them in your derived class
-        //virtual void OnActivateApp( wxActivateEvent& event ) { event.Skip(); }
-//        virtual void OnCloseFrame( wxCloseEvent& event ) { event.Skip(); }
-
-        void OnRxInDeviceSelect( wxListEvent& event );
-
-        void OnRxInTest( wxCommandEvent& event );
-        void OnRxOutTest( wxCommandEvent& event );
-        void OnTxInTest( wxCommandEvent& event );
-        void OnTxOutTest( wxCommandEvent& event );
-
-        void OnRxOutDeviceSelect( wxListEvent& event );
-        void OnTxInDeviceSelect( wxListEvent& event );
-        void OnTxOutDeviceSelect( wxListEvent& event );
-        void OnRefreshClick( wxCommandEvent& event );
-        void OnApplyAudioParameters( wxCommandEvent& event );
-        void OnCancelAudioParameters( wxCommandEvent& event );
-        void OnOkAudioParameters( wxCommandEvent& event );
-        // Virtual event handlers, overide them in your derived class
-        void OnClose( wxCloseEvent& event ) { event.Skip(); }
-        void OnHibernate( wxActivateEvent& event ) { event.Skip(); }
-        void OnIconize( wxIconizeEvent& event ) { event.Skip(); }
-        void OnInitDialog( wxInitDialogEvent& event );
-
-    public:
-
-        AudioOptsDialog( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Audio Config"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 300,300 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
-        ~AudioOptsDialog();
-        int ExchangeData(int inout);
-};
-#endif //__AudioOptsDialog__
diff --git a/fdmdv2/tags/0.99-Beta/src/dlg_filter.cpp b/fdmdv2/tags/0.99-Beta/src/dlg_filter.cpp
deleted file mode 100644 (file)
index 0de8e8c..0000000
+++ /dev/null
@@ -1,786 +0,0 @@
-//==========================================================================
-// Name:            dlg_filter.cpp
-// Purpose:         Dialog for controlling Codec audio filtering
-// Date:            Nov 25 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#include "dlg_filter.h"
-
-#define SLIDER_MAX 100
-#define SLIDER_LENGTH 100
-
-#define FILTER_MIN_MAG_DB -20.0
-#define FILTER_MAX_MAG_DB  20.0
-
-#define MAX_FREQ_BASS      600.00
-#define MAX_FREQ_TREBLE   3900.00
-#define MAX_FREQ_DEF      3000.00
-
-#define MIN_GAIN          -20
-#define MAX_GAIN           20
-
-#define MAX_LOG10_Q         1.0
-#define MIN_LOG10_Q        -1.0 
-
-// DFT parameters
-
-#define IMP_AMP           2000.0                     // amplitude of impulse
-#define NIMP              50                         // number of samples in impulse response
-#define F_STEP_DFT        10.0                       // frequency steps to sample spectrum
-#define F_MAG_N           (int)(MAX_F_HZ/F_STEP_DFT) // number of frequency steps
-
-extern struct freedv      *g_pfreedv;
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class FilterDlg
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-FilterDlg::FilterDlg(wxWindow* parent, bool running, bool *newMicInFilter, bool *newSpkOutFilter,
-                     wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style)
-{
-    m_running = running;
-    m_newMicInFilter = newMicInFilter;
-    m_newSpkOutFilter = newSpkOutFilter;
-
-    this->SetSizeHints(wxDefaultSize, wxDefaultSize);
-
-    wxBoxSizer* bSizer30;
-    bSizer30 = new wxBoxSizer(wxVERTICAL);
-
-    // LPC Post Filter --------------------------------------------------------
-
-    wxStaticBoxSizer* lpcpfs = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("LPC Post Filter")), wxHORIZONTAL);
-
-    wxBoxSizer* left = new wxBoxSizer(wxVERTICAL);
-
-    m_codec2LPCPostFilterEnable = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition,wxDefaultSize, wxCHK_2STATE);
-    left->Add(m_codec2LPCPostFilterEnable);
-
-    m_codec2LPCPostFilterBassBoost = new wxCheckBox(this, wxID_ANY, _("0-1 kHz 3dB Boost"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
-    left->Add(m_codec2LPCPostFilterBassBoost);
-    lpcpfs->Add(left, 0, wxALL, 5);
-
-    newLPCPFControl(&m_codec2LPCPostFilterBeta, &m_staticTextBeta, lpcpfs, "Beta");
-    newLPCPFControl(&m_codec2LPCPostFilterGamma, &m_staticTextGamma, lpcpfs, "Gamma");
-
-    m_LPCPostFilterDefault = new wxButton(this, wxID_ANY, wxT("Default"));
-    lpcpfs->Add(m_LPCPostFilterDefault, 0, wxALL|wxALIGN_CENTRE_HORIZONTAL|wxALIGN_CENTRE_VERTICAL, 5);
-
-    bSizer30->Add(lpcpfs, 0, wxALL, 0);
-
-    // Speex pre-processor --------------------------------------------------
-
-    wxStaticBoxSizer* sbSizer_speexpp;
-    wxStaticBox *sb_speexpp = new wxStaticBox(this, wxID_ANY, _("Speex Mic Audio Pre-Processor"));
-    sbSizer_speexpp = new wxStaticBoxSizer(sb_speexpp, wxVERTICAL);
-
-    m_ckboxSpeexpp = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
-    sb_speexpp->SetToolTip(_("Enable noise supression, dereverberation, AGC of mic signal"));
-    sbSizer_speexpp->Add(m_ckboxSpeexpp, wxALIGN_LEFT, 2);
-
-    bSizer30->Add(sbSizer_speexpp, 0, wxALL, 0);   
-
-    // EQ Filters -----------------------------------------------------------
-
-    wxStaticBoxSizer* eqMicInSizer = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Mic In Equaliser")), wxVERTICAL);
-    wxBoxSizer* eqMicInSizer1 = new wxBoxSizer(wxHORIZONTAL);
-    wxBoxSizer* eqMicInSizer2 = new wxBoxSizer(wxHORIZONTAL);
-
-    m_MicInBass   = newEQ(eqMicInSizer1, "Bass"  , MAX_FREQ_BASS, disableQ);
-    m_MicInTreble = newEQ(eqMicInSizer1, "Treble", MAX_FREQ_TREBLE, disableQ);
-    eqMicInSizer->Add(eqMicInSizer1);
-
-    m_MicInEnable = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition,wxDefaultSize, wxCHK_2STATE);
-    eqMicInSizer2->Add(m_MicInEnable,0,wxALIGN_CENTRE_VERTICAL|wxRIGHT,10);
-    m_MicInMid    = newEQ(eqMicInSizer2, "Mid"   , MAX_FREQ_DEF, enableQ);
-    m_MicInDefault = new wxButton(this, wxID_ANY, wxT("Default"));
-    eqMicInSizer2->Add(m_MicInDefault,0,wxALIGN_CENTRE_VERTICAL|wxLEFT,20);
-    eqMicInSizer->Add(eqMicInSizer2);
-
-    wxStaticBoxSizer* eqSpkOutSizer = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Speaker Out Equaliser")), wxVERTICAL);
-    wxBoxSizer* eqSpkOutSizer1 = new wxBoxSizer(wxHORIZONTAL);
-    wxBoxSizer* eqSpkOutSizer2 = new wxBoxSizer(wxHORIZONTAL);
-
-    m_SpkOutBass   = newEQ(eqSpkOutSizer1, "Bass"  , MAX_FREQ_BASS, disableQ);
-    m_SpkOutTreble = newEQ(eqSpkOutSizer1, "Treble", MAX_FREQ_TREBLE, disableQ);
-    eqSpkOutSizer->Add(eqSpkOutSizer1);
-
-    m_SpkOutEnable = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition,wxDefaultSize, wxCHK_2STATE);
-    eqSpkOutSizer2->Add(m_SpkOutEnable,0,wxALIGN_CENTRE_VERTICAL|wxRIGHT,10);
-    m_SpkOutMid    = newEQ(eqSpkOutSizer2, "Mid"   , MAX_FREQ_DEF, enableQ);
-    m_SpkOutDefault = new wxButton(this, wxID_ANY, wxT("Default"));
-    eqSpkOutSizer2->Add(m_SpkOutDefault,0,wxALIGN_CENTRE_VERTICAL|wxLEFT,20);
-    eqSpkOutSizer->Add(eqSpkOutSizer2);
-    
-    bSizer30->Add(eqMicInSizer, 0, wxALL, 0);
-    bSizer30->Add(eqSpkOutSizer, 0, wxALL, 0);
-
-    // Storgage for spectrum magnitude plots ------------------------------------
-
-    m_MicInMagdB = new float[F_MAG_N];
-    for(int i=0; i<F_MAG_N; i++)
-        m_MicInMagdB[i] = 0.0;
-
-    m_SpkOutMagdB = new float[F_MAG_N];
-    for(int i=0; i<F_MAG_N; i++)
-        m_SpkOutMagdB[i] = 0.0;
-
-    // Spectrum Plots -----------------------------------------------------------
-
-    long nb_style = wxAUI_NB_BOTTOM | wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_MOVE | wxAUI_NB_SCROLL_BUTTONS;
-    m_auiNotebook = new wxAuiNotebook(this, wxID_ANY, wxDefaultPosition, wxSize(-1,200), nb_style);
-    m_auiNotebook->SetFont(wxFont(8, 70, 90, 90, false, wxEmptyString));
-
-    bSizer30->Add(m_auiNotebook, 0, wxEXPAND|wxALL, 3);
-    
-    m_MicInFreqRespPlot = new PlotSpectrum((wxFrame*) m_auiNotebook, m_MicInMagdB, F_MAG_N, FILTER_MIN_MAG_DB, FILTER_MAX_MAG_DB);
-    m_auiNotebook->AddPage(m_MicInFreqRespPlot, _("Microphone In Equaliser"));
-
-    m_SpkOutFreqRespPlot = new PlotSpectrum((wxFrame*)m_auiNotebook, m_SpkOutMagdB, F_MAG_N, FILTER_MIN_MAG_DB, FILTER_MAX_MAG_DB);
-    m_auiNotebook->AddPage(m_SpkOutFreqRespPlot, _("Speaker Out Equaliser"));
-
-    //  OK - Cancel buttons at the bottom --------------------------
-
-    wxBoxSizer* bSizer31 = new wxBoxSizer(wxHORIZONTAL);
-
-    m_sdbSizer5OK = new wxButton(this, wxID_OK);
-    bSizer31->Add(m_sdbSizer5OK, 0, wxALL, 2);
-
-    m_sdbSizer5Cancel = new wxButton(this, wxID_CANCEL);
-    bSizer31->Add(m_sdbSizer5Cancel, 0, wxALL, 2);
-
-    bSizer30->Add(bSizer31, 0, wxALIGN_RIGHT|wxALL, 0);
-
-    this->SetSizer(bSizer30);
-    this->Layout();
-
-    this->Centre(wxBOTH);
-    // Connect Events -------------------------------------------------------
-
-    this->Connect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(FilterDlg::OnInitDialog));
-
-    m_codec2LPCPostFilterEnable->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnEnable), NULL, this);
-    m_codec2LPCPostFilterBassBoost->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnBassBoost), NULL, this);
-    m_codec2LPCPostFilterBeta->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnBetaScroll), NULL, this);
-    m_codec2LPCPostFilterGamma->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnGammaScroll), NULL, this);
-    m_LPCPostFilterDefault->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnLPCPostFilterDefault), NULL, this);
-
-    m_ckboxSpeexpp->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnSpeexppEnable), NULL, this);
-
-    m_MicInBass.sliderFreq->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInBassFreqScroll), NULL, this);
-    m_MicInBass.sliderGain->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInBassGainScroll), NULL, this);
-    m_MicInTreble.sliderFreq->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInTrebleFreqScroll), NULL, this);
-    m_MicInTreble.sliderGain->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInTrebleGainScroll), NULL, this);
-    m_MicInMid.sliderFreq->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInMidFreqScroll), NULL, this);
-    m_MicInMid.sliderGain->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInMidGainScroll), NULL, this);
-    m_MicInMid.sliderQ->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInMidQScroll), NULL, this);
-    m_MicInEnable->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnMicInEnable), NULL, this);
-    m_MicInDefault->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnMicInDefault), NULL, this);
-
-    m_SpkOutBass.sliderFreq->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutBassFreqScroll), NULL, this);
-    m_SpkOutBass.sliderGain->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutBassGainScroll), NULL, this);
-    m_SpkOutTreble.sliderFreq->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutTrebleFreqScroll), NULL, this);
-    m_SpkOutTreble.sliderGain->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutTrebleGainScroll), NULL, this);
-    m_SpkOutMid.sliderFreq->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutMidFreqScroll), NULL, this);
-    m_SpkOutMid.sliderGain->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutMidGainScroll), NULL, this);
-    m_SpkOutMid.sliderQ->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutMidQScroll), NULL, this);
-    m_SpkOutEnable->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnSpkOutEnable), NULL, this);
-    m_SpkOutDefault->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnSpkOutDefault), NULL, this);
-
-    m_sdbSizer5Cancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnCancel), NULL, this);
-    m_sdbSizer5OK->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnOK), NULL, this);
-
-}
-
-//-------------------------------------------------------------------------
-// ~FilterDlg()
-//-------------------------------------------------------------------------
-FilterDlg::~FilterDlg()
-{
-    delete m_MicInMagdB;
-    delete m_SpkOutMagdB;
-
-    // Disconnect Events
-
-    this->Disconnect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(FilterDlg::OnInitDialog));
-
-    m_codec2LPCPostFilterEnable->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnEnable), NULL, this);
-    m_codec2LPCPostFilterBassBoost->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnBassBoost), NULL, this);
-    m_codec2LPCPostFilterBeta->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnBetaScroll), NULL, this);
-    m_codec2LPCPostFilterGamma->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnGammaScroll), NULL, this);
-    m_LPCPostFilterDefault->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnLPCPostFilterDefault), NULL, this);
-
-    m_MicInBass.sliderFreq->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInBassFreqScroll), NULL, this);
-    m_MicInBass.sliderGain->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInBassGainScroll), NULL, this);
-    m_MicInTreble.sliderFreq->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInTrebleFreqScroll), NULL, this);
-    m_MicInTreble.sliderGain->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInTrebleGainScroll), NULL, this);
-    m_MicInMid.sliderFreq->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInMidFreqScroll), NULL, this);
-    m_MicInMid.sliderGain->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInMidGainScroll), NULL, this);
-    m_MicInMid.sliderQ->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInMidQScroll), NULL, this);
-    m_MicInEnable->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnMicInEnable), NULL, this);
-    m_MicInDefault->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnMicInDefault), NULL, this);
-
-    m_SpkOutBass.sliderFreq->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutBassFreqScroll), NULL, this);
-    m_SpkOutBass.sliderGain->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutBassGainScroll), NULL, this);
-    m_SpkOutTreble.sliderFreq->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutTrebleFreqScroll), NULL, this);
-    m_SpkOutTreble.sliderGain->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutTrebleGainScroll), NULL, this);
-    m_SpkOutMid.sliderFreq->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutMidFreqScroll), NULL, this);
-    m_SpkOutMid.sliderGain->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutMidGainScroll), NULL, this);
-    m_SpkOutMid.sliderQ->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutMidQScroll), NULL, this);
-    m_SpkOutEnable->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnSpkOutEnable), NULL, this);
-    m_SpkOutDefault->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnSpkOutDefault), NULL, this);
-
-    m_sdbSizer5Cancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnCancel), NULL, this);
-    m_sdbSizer5OK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnOK), NULL, this);
-}
-
-void FilterDlg::newLPCPFControl(wxSlider **slider, wxStaticText **stValue, wxSizer *s, wxString controlName)
-{
-    wxBoxSizer *bs = new wxBoxSizer(wxHORIZONTAL);
-
-    wxStaticText* st = new wxStaticText(this, wxID_ANY, controlName, wxDefaultPosition, wxSize(70,-1), wxALIGN_RIGHT);
-    bs->Add(st, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 2);
-
-    *slider = new wxSlider(this, wxID_ANY, 0, 0, SLIDER_MAX, wxDefaultPosition, wxSize(SLIDER_LENGTH,wxDefaultCoord));
-    bs->Add(*slider, 1, wxALIGN_CENTER_VERTICAL|wxALL, 2);
-
-    *stValue = new wxStaticText(this, wxID_ANY, wxT("0.0"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
-    bs->Add(*stValue, 1, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxALL, 2);
-
-    s->Add(bs, 0);
-}
-
-void FilterDlg::newEQControl(wxSlider** slider, wxStaticText** value, wxStaticBoxSizer *bs, wxString controlName)
-{
-    wxStaticText* label = new wxStaticText(this, wxID_ANY, controlName, wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
-    bs->Add(label, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 0);
-
-    *slider = new wxSlider(this, wxID_ANY, 0, 0, SLIDER_MAX, wxDefaultPosition, wxSize(SLIDER_LENGTH,wxDefaultCoord));
-    bs->Add(*slider, 1, wxALIGN_CENTER_VERTICAL|wxALL, 0);
-
-    *value = new wxStaticText(this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(40,-1), wxALIGN_LEFT);
-    bs->Add(*value, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxRIGHT, 5);
-}
-
-EQ FilterDlg::newEQ(wxSizer *bs, wxString eqName, float maxFreqHz, bool enableQ)
-{
-    EQ eq;
-
-    wxStaticBoxSizer *bsEQ = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, eqName), wxHORIZONTAL);
-
-    newEQControl(&eq.sliderFreq, &eq.valueFreq, bsEQ, "Freq"); 
-    eq.maxFreqHz = maxFreqHz; 
-    eq.sliderFreqId = eq.sliderFreq->GetId();
-
-    newEQControl(&eq.sliderGain, &eq.valueGain, bsEQ, "Gain");
-    if (enableQ)
-        newEQControl(&eq.sliderQ, &eq.valueQ, bsEQ, "Q");
-    else
-        eq.sliderQ = NULL;
-
-    bs->Add(bsEQ);
-
-    return eq;
-}
-
-//-------------------------------------------------------------------------
-// ExchangeData()
-//-------------------------------------------------------------------------
-void FilterDlg::ExchangeData(int inout, bool storePersistent)
-{
-    wxConfigBase *pConfig = wxConfigBase::Get();
-    if(inout == EXCHANGE_DATA_IN)
-    {
-        // LPC Post filter
-
-        m_codec2LPCPostFilterEnable->SetValue(wxGetApp().m_codec2LPCPostFilterEnable);
-        m_codec2LPCPostFilterBassBoost->SetValue(wxGetApp().m_codec2LPCPostFilterBassBoost);
-        m_beta = wxGetApp().m_codec2LPCPostFilterBeta; setBeta();
-        m_gamma = wxGetApp().m_codec2LPCPostFilterGamma; setGamma();
-
-        // Speex Pre-Processor
-
-        m_ckboxSpeexpp->SetValue(wxGetApp().m_speexpp_enable);
-
-        // Mic In Equaliser
-
-        m_MicInBass.freqHz = wxGetApp().m_MicInBassFreqHz; 
-        m_MicInBass.freqHz = limit(m_MicInBass.freqHz, 1.0, MAX_FREQ_BASS);
-        setFreq(&m_MicInBass);
-        m_MicInBass.gaindB = wxGetApp().m_MicInBassGaindB;
-        m_MicInBass.gaindB = limit(m_MicInBass.gaindB, MIN_GAIN, MAX_GAIN);
-        setGain(&m_MicInBass);
-
-        m_MicInTreble.freqHz = wxGetApp().m_MicInTrebleFreqHz;
-        m_MicInTreble.freqHz = limit(m_MicInTreble.freqHz, 1.0, MAX_FREQ_TREBLE);
-        setFreq(&m_MicInTreble);
-        m_MicInTreble.gaindB = wxGetApp().m_MicInTrebleGaindB; 
-        m_MicInTreble.gaindB = limit(m_MicInTreble.gaindB, MIN_GAIN, MAX_GAIN);
-        setGain(&m_MicInTreble);
-
-        m_MicInMid.freqHz = wxGetApp().m_MicInMidFreqHz; 
-        m_MicInMid.freqHz = limit(m_MicInMid.freqHz, 1.0, MAX_FREQ_TREBLE);
-        setFreq(&m_MicInMid);
-        m_MicInMid.gaindB = wxGetApp().m_MicInMidGaindB; 
-        m_MicInMid.gaindB = limit(m_MicInMid.gaindB, MIN_GAIN, MAX_GAIN);
-        setGain(&m_MicInMid);
-        m_MicInMid.Q = wxGetApp().m_MicInMidQ;
-        m_MicInMid.Q = limit(m_MicInMid.Q, pow(10.0,MIN_LOG10_Q), pow(10.0, MAX_LOG10_Q));
-        setQ(&m_MicInMid);
-
-        m_MicInEnable->SetValue(wxGetApp().m_MicInEQEnable);
-
-        plotMicInFilterSpectrum();
-        // Spk Out Equaliser
-
-        m_SpkOutBass.freqHz = wxGetApp().m_SpkOutBassFreqHz;
-        m_SpkOutBass.freqHz = limit(m_SpkOutBass.freqHz, 1.0, MAX_FREQ_BASS);
-        setFreq(&m_SpkOutBass);
-        m_SpkOutBass.gaindB = wxGetApp().m_SpkOutBassGaindB; 
-        m_SpkOutBass.gaindB = limit(m_SpkOutBass.gaindB, MIN_GAIN, MAX_GAIN);
-        setGain(&m_SpkOutBass);
-
-        m_SpkOutTreble.freqHz = wxGetApp().m_SpkOutTrebleFreqHz; 
-        m_SpkOutTreble.freqHz = limit(m_SpkOutTreble.freqHz, 1.0, MAX_FREQ_TREBLE);
-        setFreq(&m_SpkOutTreble);
-        m_SpkOutTreble.gaindB = wxGetApp().m_SpkOutTrebleGaindB; 
-        m_SpkOutTreble.gaindB = limit(m_SpkOutTreble.gaindB, MIN_GAIN, MAX_GAIN);
-        setGain(&m_SpkOutTreble);
-
-        m_SpkOutMid.freqHz = wxGetApp().m_SpkOutMidFreqHz;
-        m_SpkOutMid.freqHz = limit(m_SpkOutMid.freqHz, 1.0, MAX_FREQ_TREBLE);
-        setFreq(&m_SpkOutMid);
-        m_SpkOutMid.gaindB = wxGetApp().m_SpkOutMidGaindB;
-        m_SpkOutMid.gaindB = limit(m_SpkOutMid.gaindB, MIN_GAIN, MAX_GAIN);
-        setGain(&m_SpkOutMid);
-        m_SpkOutMid.Q = wxGetApp().m_SpkOutMidQ;
-        m_SpkOutMid.Q = limit(m_SpkOutMid.Q, pow(10.0,MIN_LOG10_Q), pow(10.0, MAX_LOG10_Q));
-        setQ(&m_SpkOutMid);
-
-        m_SpkOutEnable->SetValue(wxGetApp().m_SpkOutEQEnable);
-
-        plotSpkOutFilterSpectrum();
-    }
-    if(inout == EXCHANGE_DATA_OUT)
-    {
-        // LPC Post filter
-
-        wxGetApp().m_codec2LPCPostFilterEnable     = m_codec2LPCPostFilterEnable->GetValue();
-        wxGetApp().m_codec2LPCPostFilterBassBoost  = m_codec2LPCPostFilterBassBoost->GetValue();
-        wxGetApp().m_codec2LPCPostFilterBeta       = m_beta;
-        wxGetApp().m_codec2LPCPostFilterGamma      = m_gamma;
-
-        // Speex Pre-Processor
-
-        wxGetApp().m_speexpp_enable = m_ckboxSpeexpp->GetValue();
-
-        // Mic In Equaliser
-
-        wxGetApp().m_MicInBassFreqHz = m_MicInBass.freqHz;
-        wxGetApp().m_MicInBassGaindB = m_MicInBass.gaindB;
-
-        wxGetApp().m_MicInTrebleFreqHz = m_MicInTreble.freqHz;
-        wxGetApp().m_MicInTrebleGaindB = m_MicInTreble.gaindB;
-
-        wxGetApp().m_MicInMidFreqHz = m_MicInMid.freqHz;
-        wxGetApp().m_MicInMidGaindB = m_MicInMid.gaindB;
-        wxGetApp().m_MicInMidQ = m_MicInMid.Q;
-
-        // Spk Out Equaliser
-
-        wxGetApp().m_SpkOutBassFreqHz = m_SpkOutBass.freqHz;
-        wxGetApp().m_SpkOutBassGaindB = m_SpkOutBass.gaindB;
-
-        wxGetApp().m_SpkOutTrebleFreqHz = m_SpkOutTreble.freqHz;
-        wxGetApp().m_SpkOutTrebleGaindB = m_SpkOutTreble.gaindB;
-
-        wxGetApp().m_SpkOutMidFreqHz = m_SpkOutMid.freqHz;
-        wxGetApp().m_SpkOutMidGaindB = m_SpkOutMid.gaindB;
-        wxGetApp().m_SpkOutMidQ = m_SpkOutMid.Q;
-
-        if (storePersistent) {
-            pConfig->Write(wxT("/Filter/codec2LPCPostFilterEnable"),     wxGetApp().m_codec2LPCPostFilterEnable);
-            pConfig->Write(wxT("/Filter/codec2LPCPostFilterBassBoost"),  wxGetApp().m_codec2LPCPostFilterBassBoost);
-            pConfig->Write(wxT("/Filter/codec2LPCPostFilterBeta"),       (int)(m_beta*100.0));
-            pConfig->Write(wxT("/Filter/codec2LPCPostFilterGamma"),      (int)(m_gamma*100.0));
-
-            pConfig->Write(wxT("/Filter/speexpp_enable"),                wxGetApp().m_speexpp_enable);
-
-            pConfig->Write(wxT("/Filter/MicInBassFreqHz"), (int)m_MicInBass.freqHz);
-            pConfig->Write(wxT("/Filter/MicInBassGaindB"), (int)(10.0*m_MicInBass.gaindB));
-            pConfig->Write(wxT("/Filter/MicInTrebleFreqHz"), (int)m_MicInTreble.freqHz);
-            pConfig->Write(wxT("/Filter/MicInTrebleGaindB"), (int)(10.0*m_MicInTreble.gaindB));
-            pConfig->Write(wxT("/Filter/MicInMidFreqHz"), (int)m_MicInMid.freqHz);
-            pConfig->Write(wxT("/Filter/MicInMidGaindB"), (int)(10.0*m_MicInMid.gaindB));
-            pConfig->Write(wxT("/Filter/MicInMidQ"), (int)(100.0*m_MicInMid.Q));
-
-            pConfig->Write(wxT("/Filter/SpkOutBassFreqHz"), (int)m_SpkOutBass.freqHz);
-            pConfig->Write(wxT("/Filter/SpkOutBassGaindB"), (int)(10.0*m_SpkOutBass.gaindB));
-            pConfig->Write(wxT("/Filter/SpkOutTrebleFreqHz"), (int)m_SpkOutTreble.freqHz);
-            pConfig->Write(wxT("/Filter/SpkOutTrebleGaindB"), (int)(10.0*m_SpkOutTreble.gaindB));
-            pConfig->Write(wxT("/Filter/SpkOutMidQ"), (int)(100.0*m_SpkOutMid.Q));
-            pConfig->Write(wxT("/Filter/SpkOutMidFreqHz"), (int)m_SpkOutMid.freqHz);
-            pConfig->Write(wxT("/Filter/SpkOutMidGaindB"), (int)(10.0*m_SpkOutMid.gaindB));
-
-            pConfig->Flush();
-        }
-    }
-    delete wxConfigBase::Set((wxConfigBase *) NULL);
-}
-
-float FilterDlg::limit(float value, float min, float max) {
-    if (value < min) return min;
-    if (value > max) return max;
-    return value;
-}
-
-//-------------------------------------------------------------------------
-// OnCancel()
-//-------------------------------------------------------------------------
-void FilterDlg::OnCancel(wxCommandEvent& event)
-{
-    this->EndModal(wxID_CANCEL);
-}
-
-//-------------------------------------------------------------------------
-// OnDefault()
-//-------------------------------------------------------------------------
-
-void FilterDlg::OnLPCPostFilterDefault(wxCommandEvent& event)
-{
-    m_beta = CODEC2_LPC_PF_BETA; setBeta();
-    m_gamma = CODEC2_LPC_PF_GAMMA; setGamma();
-    m_codec2LPCPostFilterEnable->SetValue(true);
-    m_codec2LPCPostFilterBassBoost->SetValue(true);
-}
-
-void FilterDlg::OnMicInDefault(wxCommandEvent& event)
-{
-    m_MicInBass.freqHz = 100.0;
-    m_MicInBass.gaindB = 0.0;
-    setFreq(&m_MicInBass); setGain(&m_MicInBass); 
-
-    m_MicInTreble.freqHz = 3000.0;
-    m_MicInTreble.gaindB = 0.0;
-    setFreq(&m_MicInTreble); setGain(&m_MicInTreble); 
-
-    m_MicInMid.freqHz = 1500.0;
-    m_MicInMid.gaindB = 0.0;
-    m_MicInMid.Q = 1.0;
-    setFreq(&m_MicInMid); setGain(&m_MicInMid); setQ(&m_MicInMid); 
-
-    plotMicInFilterSpectrum();    
-}
-
-void FilterDlg::OnSpkOutDefault(wxCommandEvent& event)
-{
-    m_SpkOutBass.freqHz = 100.0;
-    m_SpkOutBass.gaindB = 0.0;
-    setFreq(&m_SpkOutBass); setGain(&m_SpkOutBass); 
-
-    m_SpkOutTreble.freqHz = 3000.0;
-    m_SpkOutTreble.gaindB = 0.0;
-    setFreq(&m_SpkOutTreble); setGain(&m_SpkOutTreble); 
-
-    m_SpkOutMid.freqHz = 1500.0;
-    m_SpkOutMid.gaindB = 0.0;
-    m_SpkOutMid.Q = 1.0;
-    setFreq(&m_SpkOutMid); setGain(&m_SpkOutMid); setQ(&m_SpkOutMid); 
-
-    plotSpkOutFilterSpectrum();    
-}
-
-//-------------------------------------------------------------------------
-// OnOK()
-//-------------------------------------------------------------------------
-void FilterDlg::OnOK(wxCommandEvent& event)
-{
-    //printf("FilterDlg::OnOK\n");
-    ExchangeData(EXCHANGE_DATA_OUT, true);
-    this->EndModal(wxID_OK);
-}
-
-//-------------------------------------------------------------------------
-// OnClose()
-//-------------------------------------------------------------------------
-void FilterDlg::OnClose(wxCloseEvent& event)
-{
-    this->EndModal(wxID_OK);
-}
-
-//-------------------------------------------------------------------------
-// OnInitDialog()
-//-------------------------------------------------------------------------
-void FilterDlg::OnInitDialog(wxInitDialogEvent& event)
-{
-    //printf("FilterDlg::OnInitDialog\n");
-    ExchangeData(EXCHANGE_DATA_IN, false);
-    //printf("m_beta: %f\n", m_beta);
-}
-
-void FilterDlg::setBeta(void) {
-    wxString buf;
-    buf.Printf(wxT("%3.2f"), m_beta);
-    m_staticTextBeta->SetLabel(buf);
-    int slider = (int)(m_beta*SLIDER_MAX + 0.5);
-    m_codec2LPCPostFilterBeta->SetValue(slider);
-}
-
-void FilterDlg::setCodec2(void) {
-    if (m_running) {
-        assert(g_pfreedv->codec2 != NULL);
-        codec2_set_lpc_post_filter(g_pfreedv->codec2, 
-                               m_codec2LPCPostFilterEnable->GetValue(), 
-                               m_codec2LPCPostFilterBassBoost->GetValue(), 
-                               m_beta, m_gamma);
-    }
-}
-
-void FilterDlg::setGamma(void) {
-    wxString buf;
-    buf.Printf(wxT("%3.2f"), m_gamma);
-    m_staticTextGamma->SetLabel(buf);
-    int slider = (int)(m_gamma*SLIDER_MAX + 0.5);
-    m_codec2LPCPostFilterGamma->SetValue(slider);
-}
-
-void FilterDlg::OnEnable(wxScrollEvent& event) {
-    setCodec2();    
-}
-
-void FilterDlg::OnBassBoost(wxScrollEvent& event) {
-    setCodec2();    
-}
-
-void FilterDlg::OnBetaScroll(wxScrollEvent& event) {
-    m_beta = (float)m_codec2LPCPostFilterBeta->GetValue()/SLIDER_MAX;
-    setBeta();
-    setCodec2();
-}
-
-void FilterDlg::OnGammaScroll(wxScrollEvent& event) {
-    m_gamma = (float)m_codec2LPCPostFilterGamma->GetValue()/SLIDER_MAX;
-    setGamma();
-    setCodec2();
-}
-
-// immediately change enable flags rather using ExchangeData() so we can switch on and off at run time
-
-void FilterDlg::OnSpeexppEnable(wxScrollEvent& event) {
-    wxGetApp().m_speexpp_enable = m_ckboxSpeexpp->GetValue();
-}
-
-void FilterDlg::OnMicInEnable(wxScrollEvent& event) {
-    wxGetApp().m_MicInEQEnable = m_MicInEnable->GetValue();
-}
-
-void FilterDlg::OnSpkOutEnable(wxScrollEvent& event) {
-    wxGetApp().m_SpkOutEQEnable = m_SpkOutEnable->GetValue();
-    //printf("wxGetApp().m_SpkOutEQEnable: %d\n", wxGetApp().m_SpkOutEQEnable);
-}
-
-void FilterDlg::setFreq(EQ *eq)
-{
-    wxString buf;
-    buf.Printf(wxT("%3.0f"), eq->freqHz);
-    eq->valueFreq->SetLabel(buf);
-    int slider = (int)((eq->freqHz/eq->maxFreqHz)*SLIDER_MAX + 0.5);
-    eq->sliderFreq->SetValue(slider);
-}
-
-void FilterDlg::sliderToFreq(EQ *eq, bool micIn)
-{
-    eq->freqHz = ((float)eq->sliderFreq->GetValue()/SLIDER_MAX)*eq->maxFreqHz;
-    if (eq->freqHz < 1.0) eq->freqHz = 1.0; // sox doesn't like 0 Hz;
-    setFreq(eq);
-    if (micIn) {
-        plotMicInFilterSpectrum();
-        adjRunTimeMicInFilter();
-    }
-    else {
-        plotSpkOutFilterSpectrum();
-        adjRunTimeSpkOutFilter();
-    }
-}
-
-void FilterDlg::setGain(EQ *eq)
-{
-    wxString buf;
-    buf.Printf(wxT("%3.1f"), eq->gaindB);
-    eq->valueGain->SetLabel(buf);
-    int slider = (int)(((eq->gaindB-MIN_GAIN)/(MAX_GAIN-MIN_GAIN))*SLIDER_MAX + 0.5);
-    eq->sliderGain->SetValue(slider);
-}
-
-void FilterDlg::sliderToGain(EQ *eq, bool micIn)
-{
-    float range = MAX_GAIN-MIN_GAIN;
-    
-    eq->gaindB = MIN_GAIN + range*((float)eq->sliderGain->GetValue()/SLIDER_MAX);
-    //printf("gaindB: %f\n", eq->gaindB);
-    setGain(eq);
-    if (micIn) {
-        plotMicInFilterSpectrum();
-        adjRunTimeMicInFilter();
-    }
-    else {
-        plotSpkOutFilterSpectrum();
-        adjRunTimeSpkOutFilter();
-    }
-        
-}
-
-void FilterDlg::setQ(EQ *eq)
-{
-    wxString buf;
-    buf.Printf(wxT("%2.1f"), eq->Q);
-    eq->valueQ->SetLabel(buf);
-
-    float log10_range = MAX_LOG10_Q - MIN_LOG10_Q;
-
-    int slider = (int)(((log10(eq->Q+1E-6)-MIN_LOG10_Q)/log10_range)*SLIDER_MAX + 0.5);
-    eq->sliderQ->SetValue(slider);
-}
-
-void FilterDlg::sliderToQ(EQ *eq, bool micIn)
-{
-    float log10_range = MAX_LOG10_Q - MIN_LOG10_Q;
-    
-    float sliderNorm = (float)eq->sliderQ->GetValue()/SLIDER_MAX;
-    float log10Q =  MIN_LOG10_Q + sliderNorm*(log10_range);
-    eq->Q = pow(10.0, log10Q);
-    //printf("log10Q: %f eq->Q: %f\n", log10Q, eq->Q);
-    setQ(eq);
-    if (micIn) {
-        plotMicInFilterSpectrum();
-        adjRunTimeMicInFilter();
-    }
-    else {
-        plotSpkOutFilterSpectrum();
-        adjRunTimeSpkOutFilter();
-    }
-}
-
-void FilterDlg::plotMicInFilterSpectrum(void) {
-    plotFilterSpectrum(&m_MicInBass, &m_MicInMid, &m_MicInTreble, m_MicInFreqRespPlot, m_MicInMagdB);
-}
-
-void FilterDlg::plotSpkOutFilterSpectrum(void) {
-    plotFilterSpectrum(&m_SpkOutBass, &m_SpkOutMid, &m_SpkOutTreble, m_SpkOutFreqRespPlot, m_SpkOutMagdB);
-}
-
-void FilterDlg::adjRunTimeMicInFilter(void) {
-    // signal an adjustment in running filter coeffs
-
-    if (m_running) {
-        ExchangeData(EXCHANGE_DATA_OUT, false);
-        *m_newMicInFilter = true;
-    }
-}
-        
-void FilterDlg::adjRunTimeSpkOutFilter(void) {
-    // signal an adjustment in running filter coeffs
-
-    if (m_running) {
-        ExchangeData(EXCHANGE_DATA_OUT, false);
-        *m_newSpkOutFilter = true;
-    }
-}
-        
-
-void FilterDlg::plotFilterSpectrum(EQ *eqBass, EQ *eqMid, EQ *eqTreble, PlotSpectrum* freqRespPlot, float *magdB) {
-    char  *argBass[10];
-    char  *argTreble[10];
-    char  *argMid[10];
-    char   argstorage[10][80];
-    float magBass[F_MAG_N];
-    float magTreble[F_MAG_N];
-    float magMid[F_MAG_N];
-    int   i;
-
-    for(i=0; i<10; i++) {
-        argBass[i] = &argstorage[i][0];
-        argTreble[i] = &argstorage[i][0];
-        argMid[i] = &argstorage[i][0];
-    }
-    sprintf(argBass[0], "bass");                
-    sprintf(argBass[1], "%f", eqBass->gaindB+1E-6);
-    sprintf(argBass[2], "%f", eqBass->freqHz);      
-
-    calcFilterSpectrum(magBass, 2, argBass);
-
-    sprintf(argTreble[0], "treble");                
-    sprintf(argTreble[1], "%f", eqTreble->gaindB+1E-6);
-    sprintf(argTreble[2], "%f", eqTreble->freqHz);      
-
-    calcFilterSpectrum(magTreble, 2, argTreble);
-
-    sprintf(argTreble[0], "equalizer");                
-    sprintf(argTreble[1], "%f", eqMid->freqHz);      
-    sprintf(argTreble[2], "%f", eqMid->Q);      
-    sprintf(argTreble[3], "%f", eqMid->gaindB+1E-6);
-
-    calcFilterSpectrum(magMid, 3, argMid);
-
-    for(i=0; i<F_MAG_N; i++)
-        magdB[i] = magBass[i] + magMid[i] + magTreble[i];
-    freqRespPlot->m_newdata = true;
-    freqRespPlot->Refresh();
-}
-
-void FilterDlg::calcFilterSpectrum(float magdB[], int argc, char *argv[]) {
-    void       *sbq;
-    short       in[NIMP];
-    short       out[NIMP];
-    COMP        X[F_MAG_N];
-    float       f, w;
-    int         i, k;
-
-    // find impulse response -----------------------------------
-
-    for(i=0; i<NIMP; i++)
-        in[i] = 0;
-    in[0] = IMP_AMP;
-
-    //printf("argv[0]: %s argv[1]: %s\n", argv[0], argv[1]);
-    sbq = sox_biquad_create(argc, (const char **)argv);
-
-    sox_biquad_filter(sbq, out, in, NIMP);
-    //for(i=0; i<NIMP; i++)
-    //    printf("%d\n", out[i]);
-   
-    sox_biquad_destroy(sbq);
-
-    //for(i=0; i<NIMP; i++)
-    //    out[i] = 0.0;
-    //out[0] = IMP_AMP;
-
-    // calculate discrete time continous frequency Fourer transform
-    // doing this from first principles rather than FFT for no good reason
-
-    for(f=0,i=0; f<MAX_F_HZ; f+=F_STEP_DFT,i++) {
-        w = M_PI*f/(FS/2);
-        X[i].real = 0.0; X[i].imag = 0.0;
-        for(k=0; k<NIMP; k++) {
-            X[i].real += ((float)out[k]/IMP_AMP) * cos(w*k);
-            X[i].imag -= ((float)out[k]/IMP_AMP) * sin(w*k);
-        }
-        magdB[i] = 10.0*log10(X[i].real* X[i].real + X[i].imag*X[i].imag + 1E-12);
-        //printf("f: %f X[%d] = %f %f magdB = %f\n", f, i, X[i].real, X[i].imag,  magdB[i]);
-    }
-}
diff --git a/fdmdv2/tags/0.99-Beta/src/dlg_filter.h b/fdmdv2/tags/0.99-Beta/src/dlg_filter.h
deleted file mode 100644 (file)
index 82c43df..0000000
+++ /dev/null
@@ -1,166 +0,0 @@
-//==========================================================================
-// Name:            dlg_filter.h
-// Purpose:         Dialog for controlling Codec audio filtering
-// Created:         Nov 25 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-
-#ifndef __FILTER_DIALOG__
-#define __FILTER_DIALOG__
-
-#include "fdmdv2_main.h"
-
-enum {disableQ = false, enableQ = true};
-
-typedef struct { 
-    wxSlider     *sliderFreq;
-    wxStaticText *valueFreq;
-    wxSlider     *sliderGain;
-    wxStaticText *valueGain;
-    wxSlider     *sliderQ;
-    wxStaticText *valueQ;
-
-    int       sliderFreqId;
-    int       sliderGainId;
-    int       sliderQId;
-    
-    float     freqHz;
-    float     gaindB;
-    float     Q;
-
-    float     maxFreqHz;
-} EQ;
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class FilterDlg
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class FilterDlg : public wxDialog
-{
-    public:
-    FilterDlg( wxWindow* parent, bool running, bool *newMicInFilter, bool *newSpkOutFilter,
-               wxWindowID id = wxID_ANY, const wxString& title = _("Filter"), 
-               const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 800, 630 ), 
-               long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
-        ~FilterDlg();
-
-        void    ExchangeData(int inout, bool storePersistent);
-
-    protected:
-        // Handlers for events.
-        void    OnCancel(wxCommandEvent& event);
-        void    OnOK(wxCommandEvent& event);
-        void    OnClose(wxCloseEvent& event);
-        void    OnInitDialog(wxInitDialogEvent& event);
-        void    OnLPCPostFilterDefault(wxCommandEvent& event);
-
-        void    OnBetaScroll(wxScrollEvent& event);
-        void    OnGammaScroll(wxScrollEvent& event);
-        void    OnEnable(wxScrollEvent& event);
-        void    OnBassBoost(wxScrollEvent& event);
-
-        void    OnSpeexppEnable(wxScrollEvent& event);
-
-        void    OnMicInBassFreqScroll(wxScrollEvent& event) { sliderToFreq(&m_MicInBass, true); }
-        void    OnMicInBassGainScroll(wxScrollEvent& event) { sliderToGain(&m_MicInBass, true); }
-        void    OnMicInTrebleFreqScroll(wxScrollEvent& event) { sliderToFreq(&m_MicInTreble, true); }
-        void    OnMicInTrebleGainScroll(wxScrollEvent& event) { sliderToGain(&m_MicInTreble, true); }
-        void    OnMicInMidFreqScroll(wxScrollEvent& event) { sliderToFreq(&m_MicInMid, true); }
-        void    OnMicInMidGainScroll(wxScrollEvent& event) { sliderToGain(&m_MicInMid, true); }
-        void    OnMicInMidQScroll(wxScrollEvent& event) { sliderToQ(&m_MicInMid, true); }
-        void    OnMicInEnable(wxScrollEvent& event);
-        void    OnMicInDefault(wxCommandEvent& event);
-
-        void    OnSpkOutBassFreqScroll(wxScrollEvent& event) { sliderToFreq(&m_SpkOutBass, false); }
-        void    OnSpkOutBassGainScroll(wxScrollEvent& event) { sliderToGain(&m_SpkOutBass, false); }
-        void    OnSpkOutTrebleFreqScroll(wxScrollEvent& event) { sliderToFreq(&m_SpkOutTreble, false); }
-        void    OnSpkOutTrebleGainScroll(wxScrollEvent& event) { sliderToGain(&m_SpkOutTreble, false); }
-        void    OnSpkOutMidFreqScroll(wxScrollEvent& event) { sliderToFreq(&m_SpkOutMid, false); }
-        void    OnSpkOutMidGainScroll(wxScrollEvent& event) { sliderToGain(&m_SpkOutMid, false); }
-        void    OnSpkOutMidQScroll(wxScrollEvent& event) { sliderToQ(&m_SpkOutMid, false); }
-        void    OnSpkOutEnable(wxScrollEvent& event);
-        void    OnSpkOutDefault(wxCommandEvent& event);
-
-        wxStaticText* m_staticText8;
-        wxCheckBox*   m_codec2LPCPostFilterEnable;
-        wxStaticText* m_staticText9;
-        wxCheckBox*   m_codec2LPCPostFilterBassBoost;
-        wxStaticText* m_staticText91;
-        wxSlider*     m_codec2LPCPostFilterBeta;
-        wxStaticText* m_staticTextBeta;
-        wxStaticText* m_staticText911;
-        wxSlider*     m_codec2LPCPostFilterGamma;
-        wxStaticText* m_staticTextGamma;
-        wxButton*     m_LPCPostFilterDefault;
-
-        wxCheckBox*   m_ckboxSpeexpp;
-
-        wxStdDialogButtonSizer* m_sdbSizer5;
-        wxButton*     m_sdbSizer5OK;
-        wxButton*     m_sdbSizer5Cancel;
-        PlotSpectrum* m_MicInFreqRespPlot;
-        PlotSpectrum* m_SpkOutFreqRespPlot;
-        
-        wxCheckBox*   m_MicInEnable;
-        wxButton*     m_MicInDefault;
-        wxCheckBox*   m_SpkOutEnable;
-        wxButton*     m_SpkOutDefault;
-
-        float        *m_MicInMagdB;
-        float        *m_SpkOutMagdB;
-
-     private:
-        bool          m_running;
-        float         m_beta;
-        float         m_gamma;
-
-        void          setBeta(void);  // sets slider and static text from m_beta
-        void          setGamma(void); // sets slider and static text from m_gamma
-        void          setCodec2(void);
-        void          newEQControl(wxSlider** slider, wxStaticText** value, wxStaticBoxSizer *bs, wxString controlName);
-        EQ            newEQ(wxSizer *bs, wxString eqName, float maxFreqHz, bool enableQ);
-        void          newLPCPFControl(wxSlider **slider, wxStaticText **stValue, wxSizer *sbs, wxString controlName);
-        wxAuiNotebook *m_auiNotebook;
-        void          setFreq(EQ *eq);
-        void          setGain(EQ *eq);
-        void          setQ(EQ *eq);
-        void          sliderToFreq(EQ *eq, bool micIn);
-        void          sliderToGain(EQ *eq, bool micIn);
-        void          sliderToQ(EQ *eq, bool micIn);
-        void          plotFilterSpectrum(EQ *eqBass, EQ *eqMid, EQ* eqTreble, PlotSpectrum* freqRespPlot, float *magdB);
-        void          calcFilterSpectrum(float magdB[], int arc, char *argv[]);
-        void          plotMicInFilterSpectrum(void);
-        void          plotSpkOutFilterSpectrum(void);
-        void          adjRunTimeMicInFilter(void);
-        void          adjRunTimeSpkOutFilter(void);
-
-        EQ            m_MicInBass;
-        EQ            m_MicInMid;
-        EQ            m_MicInTreble;
-
-        EQ            m_SpkOutBass;
-        EQ            m_SpkOutMid;
-        EQ            m_SpkOutTreble;
-
-        float         limit(float value, float min, float max);
-        bool          *m_newMicInFilter;
-        bool          *m_newSpkOutFilter;
-
-};
-
-#endif // __FILTER_DIALOG__
diff --git a/fdmdv2/tags/0.99-Beta/src/dlg_options.cpp b/fdmdv2/tags/0.99-Beta/src/dlg_options.cpp
deleted file mode 100644 (file)
index 9189feb..0000000
+++ /dev/null
@@ -1,363 +0,0 @@
-//==========================================================================
-// Name:            dlg_options.cpp
-// Purpose:         Dialog for controlling misc FreeDV options
-// Date:            May 24 2013
-// 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-
-#include "dlg_options.h"
-extern bool g_modal;
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class OptionsDlg
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-OptionsDlg::OptionsDlg(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* bSizer30;
-    bSizer30 = new wxBoxSizer(wxVERTICAL);
-
-    //------------------------------
-    // Test Frames check box
-    //------------------------------
-
-    wxStaticBoxSizer* sbSizer_testFrames;
-    wxStaticBox *sb_testFrames = new wxStaticBox(this, wxID_ANY, _("Test Frames"));
-    sbSizer_testFrames = new wxStaticBoxSizer(sb_testFrames, wxHORIZONTAL);
-
-    m_ckboxTestFrame = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
-    m_ckboxTestFrame->SetToolTip(_("Send frames of known bits instead of compressed voice"));
-    sbSizer_testFrames->Add(m_ckboxTestFrame, 0, wxALIGN_LEFT, 0);
-
-    m_ckboxChannelNoise = new wxCheckBox(this, wxID_ANY, _("Channel Noise"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
-    m_ckboxChannelNoise->SetToolTip(_("Add simulated AWGN channel noise to received signal"));
-    sbSizer_testFrames->Add(m_ckboxChannelNoise, 0, wxALIGN_LEFT, 0);
-
-    bSizer30->Add(sbSizer_testFrames,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
-
-    //------------------------------
-    // FreeDV 700 Options
-    //------------------------------
-
-    wxStaticBoxSizer* sbSizer_freedv700;
-    wxStaticBox *sb_freedv700 = new wxStaticBox(this, wxID_ANY, _("FreeDV 700 Clipping"));
-    sbSizer_freedv700 = new wxStaticBoxSizer(sb_freedv700, wxHORIZONTAL);
-
-    m_ckboxFreeDV700txClip = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
-    m_ckboxFreeDV700txClip->SetToolTip(_("Clip FreeDv 700 tx waveform to reduce Peak to Average Power Ratio (PAPR)"));
-    sbSizer_freedv700->Add(m_ckboxFreeDV700txClip, 0, wxALIGN_LEFT, 0);
-
-    bSizer30->Add(sbSizer_freedv700,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
-
-    //------------------------------
-    // Txt Msg Text Box
-    //------------------------------
-
-    wxStaticBoxSizer* sbSizer_callSign;
-    wxStaticBox *sb_textMsg = new wxStaticBox(this, wxID_ANY, _("Txt Msg"));
-    sbSizer_callSign = new wxStaticBoxSizer(sb_textMsg, wxVERTICAL);
-
-    m_txtCtrlCallSign = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
-    m_txtCtrlCallSign->SetToolTip(_("Txt Msg you can send along with Voice"));
-    sbSizer_callSign->Add(m_txtCtrlCallSign, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3);
-
-    bSizer30->Add(sbSizer_callSign,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
-    //------------------------------
-    // Txt Encoding 
-    //------------------------------
-
-    wxStaticBoxSizer* sbSizer_encoding = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Text Encoding")), wxHORIZONTAL);
-
-#ifdef SHORT_VARICODE
-    m_rb_textEncoding1 = new wxRadioButton( this, wxID_ANY, wxT("Long varicode"), wxDefaultPosition, wxDefaultSize, 0);
-    m_rb_textEncoding1->SetValue(true);
-    sbSizer_encoding->Add(m_rb_textEncoding1, 0, wxALIGN_LEFT|wxALL, 1);
-    m_rb_textEncoding2 = new wxRadioButton( this, wxID_ANY, wxT("Short Varicode"), wxDefaultPosition, wxDefaultSize, 0);
-    sbSizer_encoding->Add(m_rb_textEncoding2, 0, wxALIGN_LEFT|wxALL, 1);
-#endif
-
-    m_ckboxEnableChecksum = new wxCheckBox(this, wxID_ANY, _("Use Checksum on Rx"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
-    sbSizer_encoding->Add(m_ckboxEnableChecksum, 0, wxALIGN_LEFT, 0);
-
-    bSizer30->Add(sbSizer_encoding,0, wxALL|wxEXPAND, 3);
-    //------------------------------
-    // Event processing
-    //------------------------------
-
-    wxStaticBoxSizer* sbSizer_events;
-    wxStaticBox *sb_events = new wxStaticBox(this, wxID_ANY, _("Event Processing"));
-    sbSizer_events = new wxStaticBoxSizer(sb_events, wxVERTICAL);
-
-    // event processing enable and spam timer
-
-    wxStaticBoxSizer* sbSizer_events_top;
-    wxStaticBox* sb_events1 = new wxStaticBox(this, wxID_ANY, _(""));    
-    sbSizer_events_top = new wxStaticBoxSizer(sb_events1, wxHORIZONTAL);
-
-    m_ckbox_events = new wxCheckBox(this, wxID_ANY, _("Enable System Calls    Syscall Spam Timer"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
-    sb_events->SetToolTip(_("Enable processing of events and generation of system calls"));
-    sbSizer_events_top->Add(m_ckbox_events, 0, 0, 5);
-    m_txt_spam_timer = new wxTextCtrl(this, wxID_ANY,  wxEmptyString, wxDefaultPosition, wxSize(40,-1), 0, wxTextValidator(wxFILTER_DIGITS));
-    m_txt_spam_timer->SetToolTip(_("Many matching events can cause a flood of syscalls. Set minimum time (seconds) between syscalls for each event here"));
-    sbSizer_events_top->Add(m_txt_spam_timer, 0, 0, 5);
-    m_rb_spam_timer = new wxRadioButton( this, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
-    m_rb_spam_timer->SetForegroundColour( wxColour(0, 255, 0 ) );
-    sbSizer_events_top->Add(m_rb_spam_timer, 0, 0, 10);
-    sbSizer_events->Add(sbSizer_events_top, 0, 0, 5);
-
-    // list of regexps
-
-    wxStaticBoxSizer* sbSizer_regexp = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Regular Expressions to Process Events")), wxHORIZONTAL);
-    m_txt_events_regexp_match = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(200,100), wxTE_MULTILINE);
-    m_txt_events_regexp_match->SetToolTip(_("Enter regular expressions to match events"));
-    sbSizer_regexp->Add(m_txt_events_regexp_match, 1, wxEXPAND, 5);
-    m_txt_events_regexp_replace = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(200,100), wxTE_MULTILINE);
-    m_txt_events_regexp_replace->SetToolTip(_("Enter regular expressions to replace events"));
-    sbSizer_regexp->Add(m_txt_events_regexp_replace, 1, wxEXPAND, 5);
-    sbSizer_events->Add(sbSizer_regexp, 1, wxEXPAND, 5);
-
-    // log of events and responses
-
-    wxStaticBoxSizer* sbSizer_event_log = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Log of Events and Responses")), wxVERTICAL);
-    wxBoxSizer* bSizer33 = new wxBoxSizer(wxHORIZONTAL);
-    m_txt_events_in = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(200,50), wxTE_MULTILINE | wxTE_READONLY);
-    bSizer33->Add(m_txt_events_in, 1, wxEXPAND, 5);
-    m_txt_events_out = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(200,50), wxTE_MULTILINE | wxTE_READONLY);
-    bSizer33->Add(m_txt_events_out, 1, wxEXPAND, 5);
-    sbSizer_event_log->Add(bSizer33, 1, wxEXPAND, 5);
-    sbSizer_events->Add(sbSizer_event_log, 1, wxEXPAND, 5);
-
-    bSizer30->Add(sbSizer_events,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
-
-    //------------------------------
-    // UDP control port
-    //------------------------------
-
-    wxStaticBoxSizer* sbSizer_udp;
-    wxStaticBox* sb_udp = new wxStaticBox(this, wxID_ANY, _("UDP Control Port"));
-    sbSizer_udp = new wxStaticBoxSizer(sb_udp, wxHORIZONTAL);
-    m_ckbox_udp_enable = new wxCheckBox(this, wxID_ANY, _("Enable UDP Control Port    UDP Port Number:"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
-    sb_udp->SetToolTip(_("Enable control of FreeDV via UDP port"));
-    sbSizer_udp->Add(m_ckbox_udp_enable, 0,  wxALIGN_CENTER_HORIZONTAL, 5);
-    m_txt_udp_port = new wxTextCtrl(this, wxID_ANY,  wxEmptyString, wxDefaultPosition, wxSize(50,-1), 0, wxTextValidator(wxFILTER_DIGITS));
-    sbSizer_udp->Add(m_txt_udp_port, 0, wxALIGN_CENTER_HORIZONTAL, 5);
-
-    bSizer30->Add(sbSizer_udp,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
-
-    //------------------------------
-    // OK - Cancel - Apply Buttons 
-    //------------------------------
-
-    wxBoxSizer* bSizer31 = new wxBoxSizer(wxHORIZONTAL);
-
-    m_sdbSizer5OK = new wxButton(this, wxID_OK);
-    bSizer31->Add(m_sdbSizer5OK, 0, wxALL, 2);
-
-    m_sdbSizer5Cancel = new wxButton(this, wxID_CANCEL);
-    bSizer31->Add(m_sdbSizer5Cancel, 0, wxALL, 2);
-
-    m_sdbSizer5Apply = new wxButton(this, wxID_APPLY);
-    bSizer31->Add(m_sdbSizer5Apply, 0, wxALL, 2);
-
-    bSizer30->Add(bSizer31, 0, wxALIGN_RIGHT|wxALL, 0);
-
-    this->SetSizer(bSizer30);
-    this->Layout();
-
-    this->Centre(wxBOTH);
-    // Connect Events -------------------------------------------------------
-
-    this->Connect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(OptionsDlg::OnInitDialog));
-
-    m_sdbSizer5OK->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsDlg::OnOK), NULL, this);
-    m_sdbSizer5Cancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsDlg::OnCancel), NULL, this);
-    m_sdbSizer5Apply->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsDlg::OnApply), NULL, this);
-
-    m_ckboxFreeDV700txClip->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(OptionsDlg::OnFreeDV700txClip), NULL, this);
-
-    event_in_serial = 0;
-    event_out_serial = 0;
-}
-
-//-------------------------------------------------------------------------
-// ~OptionsDlg()
-//-------------------------------------------------------------------------
-OptionsDlg::~OptionsDlg()
-{
-
-    // Disconnect Events
-
-    this->Disconnect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(OptionsDlg::OnInitDialog));
-
-    m_sdbSizer5OK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsDlg::OnOK), NULL, this);
-    m_sdbSizer5Cancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsDlg::OnCancel), NULL, this);
-    m_sdbSizer5Apply->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsDlg::OnApply), NULL, this);
-    m_ckboxFreeDV700txClip->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(OptionsDlg::OnFreeDV700txClip), NULL, this);
-}
-
-
-//-------------------------------------------------------------------------
-// ExchangeData()
-//-------------------------------------------------------------------------
-void OptionsDlg::ExchangeData(int inout, bool storePersistent)
-{
-    wxConfigBase *pConfig = wxConfigBase::Get();
-
-    if(inout == EXCHANGE_DATA_IN)
-    {
-        m_txtCtrlCallSign->SetValue(wxGetApp().m_callSign);
-        m_ckboxTestFrame->SetValue(wxGetApp().m_testFrames);
-        m_ckboxChannelNoise->SetValue(wxGetApp().m_channel_noise);
-
-        m_ckbox_events->SetValue(wxGetApp().m_events);
-        m_txt_spam_timer->SetValue(wxString::Format(wxT("%i"),wxGetApp().m_events_spam_timer));
-
-        m_txt_events_regexp_match->SetValue(wxGetApp().m_events_regexp_match);
-        m_txt_events_regexp_replace->SetValue(wxGetApp().m_events_regexp_replace);
-        
-        m_ckbox_udp_enable->SetValue(wxGetApp().m_udp_enable);
-        m_txt_udp_port->SetValue(wxString::Format(wxT("%i"),wxGetApp().m_udp_port));
-
-#ifdef SHORT_VARICODE
-        if (wxGetApp().m_textEncoding == 1)
-            m_rb_textEncoding1->SetValue(true);
-        if (wxGetApp().m_textEncoding == 2)
-            m_rb_textEncoding2->SetValue(true);
-#endif
-        m_ckboxEnableChecksum->SetValue(wxGetApp().m_enable_checksum);
-
-        m_ckboxFreeDV700txClip->SetValue(wxGetApp().m_FreeDV700txClip);
-    }
-
-    if(inout == EXCHANGE_DATA_OUT)
-    {
-        wxGetApp().m_callSign      = m_txtCtrlCallSign->GetValue();
-        wxGetApp().m_testFrames    = m_ckboxTestFrame->GetValue();
-        wxGetApp().m_channel_noise = m_ckboxChannelNoise->GetValue();
-
-        wxGetApp().m_events        = m_ckbox_events->GetValue();
-        long spam_timer;
-        m_txt_spam_timer->GetValue().ToLong(&spam_timer);
-        wxGetApp().m_events_spam_timer = (int)spam_timer;
-
-        // make sure regexp lists are terminated by a \n
-
-        if (m_txt_events_regexp_match->GetValue().Last() != '\n') {
-            m_txt_events_regexp_match->SetValue(m_txt_events_regexp_match->GetValue()+'\n');
-        }
-        if (m_txt_events_regexp_replace->GetValue().Last() != '\n') {
-            m_txt_events_regexp_replace->SetValue(m_txt_events_regexp_replace->GetValue()+'\n');
-        }
-        wxGetApp().m_events_regexp_match = m_txt_events_regexp_match->GetValue();
-        wxGetApp().m_events_regexp_replace = m_txt_events_regexp_replace->GetValue();
-        wxGetApp().m_udp_enable     = m_ckbox_udp_enable->GetValue();
-        long port;
-        m_txt_udp_port->GetValue().ToLong(&port);
-        wxGetApp().m_udp_port       = (int)port;
-
-#ifdef SHORT_VARICODE
-        if (m_rb_textEncoding1->GetValue())
-            wxGetApp().m_textEncoding = 1;
-        if (m_rb_textEncoding2->GetValue())
-            wxGetApp().m_textEncoding = 2;
-#endif
-        wxGetApp().m_enable_checksum = m_ckboxEnableChecksum->GetValue();
-
-        wxGetApp().m_FreeDV700txClip = m_ckboxFreeDV700txClip->GetValue();
-
-        if (storePersistent) {
-            pConfig->Write(wxT("/Data/CallSign"), wxGetApp().m_callSign);
-#ifdef SHORT_VARICODE
-            pConfig->Write(wxT("/Data/TextEncoding"), wxGetApp().m_textEncoding);
-#endif
-            pConfig->Write(wxT("/Data/EnableChecksumOnMsgRx"), wxGetApp().m_enable_checksum);
-
-            pConfig->Write(wxT("/Events/enable"), wxGetApp().m_events);
-            pConfig->Write(wxT("/Events/spam_timer"), wxGetApp().m_events_spam_timer);
-            pConfig->Write(wxT("/Events/regexp_match"), wxGetApp().m_events_regexp_match);
-            pConfig->Write(wxT("/Events/regexp_replace"), wxGetApp().m_events_regexp_replace);
-            
-            pConfig->Write(wxT("/UDP/enable"), wxGetApp().m_udp_enable);
-            pConfig->Write(wxT("/UDP/port"),  wxGetApp().m_udp_port);
-
-            pConfig->Write(wxT("/FreeDV700/txClip"), wxGetApp().m_FreeDV700txClip);
-
-            pConfig->Flush();
-        }
-    }
-    delete wxConfigBase::Set((wxConfigBase *) NULL);
-}
-
-//-------------------------------------------------------------------------
-// OnOK()
-//-------------------------------------------------------------------------
-void OptionsDlg::OnOK(wxCommandEvent& event)
-{
-    ExchangeData(EXCHANGE_DATA_OUT, true);
-    //this->EndModal(wxID_OK);
-    g_modal = false;
-    this->Show(false);
-}
-
-//-------------------------------------------------------------------------
-// OnCancel()
-//-------------------------------------------------------------------------
-void OptionsDlg::OnCancel(wxCommandEvent& event)
-{
-    //this->EndModal(wxID_CANCEL);
-    g_modal = false;
-    this->Show(false);
-}
-
-//-------------------------------------------------------------------------
-// OnApply()
-//-------------------------------------------------------------------------
-void OptionsDlg::OnApply(wxCommandEvent& event)
-{
-    ExchangeData(EXCHANGE_DATA_OUT, true);
-}
-
-//-------------------------------------------------------------------------
-// OnInitDialog()
-//-------------------------------------------------------------------------
-void OptionsDlg::OnInitDialog(wxInitDialogEvent& event)
-{
-    ExchangeData(EXCHANGE_DATA_IN, false);
-}
-
-// immediately change flags rather using ExchangeData() so we can switch on and off at run time
-
-void OptionsDlg::OnFreeDV700txClip(wxScrollEvent& event) {
-    wxGetApp().m_FreeDV700txClip = m_ckboxFreeDV700txClip->GetValue();
-}
-
-
-void OptionsDlg::updateEventLog(wxString event_in, wxString event_out) {
-    wxString event_in_with_serial, event_out_with_serial; 
-    event_in_with_serial.Printf(_T("[%d] %s"), event_in_serial++, event_in);
-    event_out_with_serial.Printf(_T("[%d] %s"), event_out_serial++, event_out);
-
-    m_txt_events_in->AppendText(event_in_with_serial+"\n");
-    m_txt_events_out->AppendText(event_out_with_serial+"\n");
-}
-
diff --git a/fdmdv2/tags/0.99-Beta/src/dlg_options.h b/fdmdv2/tags/0.99-Beta/src/dlg_options.h
deleted file mode 100644 (file)
index fe355ac..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-//==========================================================================
-// Name:            dlg_options.h
-// Purpose:         Dialog for controlling misc FreeDV options
-// Created:         Nov 25 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-
-#ifndef __OPTIONS_DIALOG__
-#define __OPTIONS_DIALOG__
-
-#include "fdmdv2_main.h"
-#include "fdmdv2_defines.h"
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class OptionsDlg
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class OptionsDlg : public wxDialog
-{
-    public:
-    OptionsDlg( wxWindow* parent,
-               wxWindowID id = wxID_ANY, const wxString& title = _("Options"), 
-                const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(600,630), 
-               long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
-        ~OptionsDlg();
-
-        void    ExchangeData(int inout, bool storePersistent);
-        void    updateEventLog(wxString event_in, wxString event_out);
-
-        bool    enableEventsChecked() {return m_ckbox_events->GetValue();}
-
-        void SetSpamTimerLight(bool state) {
-
-            // Colours don't work on Windows
-
-            if (state) {
-                m_rb_spam_timer->SetForegroundColour( wxColour( 255,0 , 0 ) ); // red
-                m_rb_spam_timer->SetValue(true);
-            }
-            else {
-                m_rb_spam_timer->SetForegroundColour( wxColour( 0, 255, 0 ) ); // green
-                m_rb_spam_timer->SetValue(false);
-            }
-        }
-
-
-    protected:
-        // Handlers for events.
-        void    OnOK(wxCommandEvent& event);
-        void    OnCancel(wxCommandEvent& event);
-        void    OnApply(wxCommandEvent& event);
-        void    OnClose(wxCloseEvent& event);
-        void    OnInitDialog(wxInitDialogEvent& event);
-        void    OnFreeDV700txClip(wxScrollEvent& event);
-
-        wxTextCtrl   *m_txtCtrlCallSign; // TODO: this should be renamed to tx_txtmsg, and rename all related incl persis strge
-        wxCheckBox   *m_ckboxTestFrame;
-        wxCheckBox   *m_ckboxChannelNoise;
-        wxCheckBox   *m_ckboxFreeDV700txClip;
-
-        wxRadioButton *m_rb_textEncoding1;
-        wxRadioButton *m_rb_textEncoding2;
-        wxCheckBox    *m_ckboxEnableChecksum;
-
-        wxCheckBox   *m_ckbox_events;
-        wxTextCtrl   *m_txt_events_regexp_match;
-        wxTextCtrl   *m_txt_events_regexp_replace;
-        wxTextCtrl   *m_txt_events_in;
-        wxTextCtrl   *m_txt_events_out;
-        wxTextCtrl   *m_txt_spam_timer;
-        wxRadioButton *m_rb_spam_timer;
-
-        wxCheckBox   *m_ckbox_udp_enable;
-        wxTextCtrl   *m_txt_udp_port;
-
-        wxButton*     m_sdbSizer5OK;
-        wxButton*     m_sdbSizer5Cancel;
-        wxButton*     m_sdbSizer5Apply;
-
-        unsigned int  event_in_serial, event_out_serial;
-
-     private:
-};
-
-#endif // __OPTIONS_DIALOG__
diff --git a/fdmdv2/tags/0.99-Beta/src/dlg_ptt.cpp b/fdmdv2/tags/0.99-Beta/src/dlg_ptt.cpp
deleted file mode 100644 (file)
index 2643c1d..0000000
+++ /dev/null
@@ -1,416 +0,0 @@
-//==========================================================================
-// Name:            dlg_ptt.cpp
-// Purpose:         Subclasses dialog GUI for PTT Config. Creates simple 
-//                  wxWidgets dialog GUI to select real/virtual Comm ports.
-// Date:            May 11 2012
-// Authors:         David Rowe, David Witten, Joel Stanley
-// 
-// 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#include "dlg_ptt.h"
-#include "fdmdv2_main.h"
-
-#ifdef __WIN32__
-#include <wx/msw/registry.h>
-#endif
-#ifdef __FreeBSD__
-#include <glob.h>
-#include <string.h>
-#endif
-
-#include <sstream>
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class ComPortsDlg
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-ComPortsDlg::ComPortsDlg(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style)
-{
-    wxBoxSizer* mainSizer = new wxBoxSizer(wxVERTICAL);
-    this->SetSizer(mainSizer);
-    
-    //----------------------------------------------------------------------
-    // Half Duplex Flag for VOX PTT
-    //----------------------------------------------------------------------
-
-    // DR: should this be on options dialog?
-
-    wxStaticBoxSizer* staticBoxSizer28 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("VOX PTT Settings")), wxHORIZONTAL);
-    m_ckHalfDuplex = new wxCheckBox(this, wxID_ANY, _("Half Duplex"), wxDefaultPosition, wxSize(-1,-1), 0);
-    staticBoxSizer28->Add(m_ckHalfDuplex, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
-    m_ckLeftChannelVoxTone = new wxCheckBox(this, wxID_ANY, _("Left Channel Vox Tone"), wxDefaultPosition, wxSize(-1,-1), 0);
-    staticBoxSizer28->Add(m_ckLeftChannelVoxTone, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
-
-    mainSizer->Add(staticBoxSizer28, 0, wxEXPAND, 5);
-
-    //----------------------------------------------------------------------
-    // Hamlib for CAT PTT
-    //----------------------------------------------------------------------
-
-    wxStaticBoxSizer* staticBoxSizer18 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("Hamlib Settings")), wxVERTICAL);
-
-    wxBoxSizer* gridSizer100 = new wxBoxSizer(wxHORIZONTAL);
-
-    /* Use Hamlib for PTT checkbox. */
-    m_ckUseHamlibPTT = new wxCheckBox(this, wxID_ANY, _("Use Hamlib PTT"), wxDefaultPosition, wxSize(-1, -1), 0);
-    m_ckUseHamlibPTT->SetValue(false);
-    gridSizer100->Add(m_ckUseHamlibPTT, 0, wxALIGN_CENTER_VERTICAL, 0);
-
-    /* Hamlib Rig Type combobox. */
-    gridSizer100->Add(new wxStaticText(this, wxID_ANY, _("Rig Model:"), wxDefaultPosition, wxDefaultSize, 0), 
-                      0, wxALIGN_CENTER_VERTICAL | wxLEFT, 20);
-    m_cbRigName = new wxComboBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(250, -1), 0, NULL, wxCB_DROPDOWN);
-    /* TODO(Joel): this is a hack. At the least, need to gurantee that m_hamLib
-     * exists. */
-    wxGetApp().m_hamlib->populateComboBox(m_cbRigName);
-    m_cbRigName->SetSelection(wxGetApp().m_intHamlibRig);
-    gridSizer100->Add(m_cbRigName, 0, wxALIGN_CENTER_VERTICAL, 0);
-
-    /* Hamlib Serial Port combobox. */
-    gridSizer100->Add(new wxStaticText(this, wxID_ANY, _("Serial Device:"), wxDefaultPosition, wxDefaultSize, 0), 
-                      0, wxALIGN_CENTER_VERTICAL | wxLEFT, 20);
-    m_cbSerialPort = new wxComboBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(140, -1), 0, NULL, wxCB_DROPDOWN);
-    gridSizer100->Add(m_cbSerialPort, 0, wxALIGN_CENTER_VERTICAL, 0);
-
-    staticBoxSizer18->Add(gridSizer100, 1);
-    mainSizer->Add(staticBoxSizer18, 1);
-
-    //----------------------------------------------------------------------
-    // Serial port PTT
-    //----------------------------------------------------------------------
-
-    wxStaticBoxSizer* staticBoxSizer17 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("Serial Port Settings")), wxVERTICAL);
-    mainSizer->Add(staticBoxSizer17, 1, wxEXPAND, 5);
-    wxStaticBoxSizer* staticBoxSizer31 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("PTT Port")), wxVERTICAL);
-    staticBoxSizer17->Add(staticBoxSizer31, 1, wxEXPAND, 5);
-
-#ifdef __WXMSW__
-    m_ckUseSerialPTT = new wxCheckBox(this, wxID_ANY, _("Use Serial Port PTT"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_ckUseSerialPTT->SetValue(false);
-    staticBoxSizer31->Add(m_ckUseSerialPTT, 0, wxALIGN_LEFT, 20);
-
-    wxArrayString m_listCtrlPortsArr;
-    m_listCtrlPorts = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxSize(-1,45), m_listCtrlPortsArr, wxLB_SINGLE | wxLB_SORT);
-    staticBoxSizer31->Add(m_listCtrlPorts, 1, wxALIGN_CENTER, 0);
-#endif
-
-#ifdef __WXGTK__
-    wxBoxSizer* bSizer83;
-    bSizer83 = new wxBoxSizer(wxHORIZONTAL);
-
-    wxGridSizer* gridSizer200 = new wxGridSizer(1, 3, 0, 0);
-    
-    m_ckUseSerialPTT = new wxCheckBox(this, wxID_ANY, _("Use Serial Port PTT"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_ckUseSerialPTT->SetValue(false);
-    gridSizer200->Add(m_ckUseSerialPTT, 1, wxALIGN_CENTER|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 2);
-
-    m_staticText12 = new wxStaticText(this, wxID_ANY, _("Serial Device:  "), wxDefaultPosition, wxDefaultSize, 0);
-    m_staticText12->Wrap(-1);
-    gridSizer200->Add(m_staticText12, 1,wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 2);
-
-    m_cbCtlDevicePath = new wxComboBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(140, -1), 0, NULL, wxCB_DROPDOWN);
-    gridSizer200->Add(m_cbCtlDevicePath, 1, wxEXPAND|wxALIGN_CENTER|wxALIGN_RIGHT, 2);
-    
-    bSizer83->Add(gridSizer200, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT | wxALL, 2);
-    staticBoxSizer31->Add(bSizer83, 1, wxALIGN_CENTER_VERTICAL|wxALL, 1);
-#endif
-
-    wxBoxSizer* boxSizer19 = new wxBoxSizer(wxVERTICAL);
-    staticBoxSizer17->Add(boxSizer19, 1, wxEXPAND, 5);
-    wxStaticBoxSizer* staticBoxSizer16 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("Signal polarity")), wxHORIZONTAL);
-    boxSizer19->Add(staticBoxSizer16, 1, wxEXPAND|wxALIGN_CENTER|wxALIGN_RIGHT, 5);
-
-    wxGridSizer* gridSizer17 = new wxGridSizer(2, 2, 0, 0);
-    staticBoxSizer16->Add(gridSizer17, 1, wxEXPAND|wxALIGN_RIGHT, 5);
-
-    m_rbUseDTR = new wxRadioButton(this, wxID_ANY, _("Use DTR"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_rbUseDTR->SetToolTip(_("Toggle DTR line for PTT"));
-    m_rbUseDTR->SetValue(1);
-    gridSizer17->Add(m_rbUseDTR, 0, wxALIGN_CENTER|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5);
-
-    m_ckDTRPos = new wxCheckBox(this, wxID_ANY, _("DTR = +V"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_ckDTRPos->SetToolTip(_("Set Polarity of the DTR line"));
-    m_ckDTRPos->SetValue(false);
-    gridSizer17->Add(m_ckDTRPos, 0, wxALIGN_CENTER|wxALIGN_RIGHT, 5);
-
-    m_rbUseRTS = new wxRadioButton(this, wxID_ANY, _("Use RTS"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_rbUseRTS->SetToolTip(_("Toggle the RTS pin for PTT"));
-    m_rbUseRTS->SetValue(1);
-    gridSizer17->Add(m_rbUseRTS, 0, wxALIGN_CENTER|wxALIGN_RIGHT, 5);
-
-    m_ckRTSPos = new wxCheckBox(this, wxID_ANY, _("RTS = +V"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_ckRTSPos->SetValue(false);
-    m_ckRTSPos->SetToolTip(_("Set Polarity of the RTS line"));
-    gridSizer17->Add(m_ckRTSPos, 0, wxALIGN_CENTER|wxALIGN_RIGHT, 5);
-
-    //----------------------------------------------------------------------
-    // OK - Cancel - Apply
-    //----------------------------------------------------------------------
-
-    wxBoxSizer* boxSizer12 = new wxBoxSizer(wxHORIZONTAL);
-
-    m_buttonOK = new wxButton(this, wxID_OK, _("OK"), wxDefaultPosition, wxSize(-1,-1), 0);
-    m_buttonOK->SetDefault();
-    boxSizer12->Add(m_buttonOK, 0, wxLEFT|wxRIGHT|wxTOP|wxBOTTOM, 5);
-
-    m_buttonCancel = new wxButton(this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxSize(-1,-1), 0);
-    boxSizer12->Add(m_buttonCancel, 0, wxLEFT|wxRIGHT|wxTOP|wxBOTTOM, 5);
-
-    m_buttonApply = new wxButton(this, wxID_APPLY, _("Apply"), wxDefaultPosition, wxSize(-1,-1), 0);
-    boxSizer12->Add(m_buttonApply, 0, wxLEFT|wxRIGHT|wxTOP|wxBOTTOM, 5);
-
-    mainSizer->Add(boxSizer12, 0, wxLEFT|wxRIGHT|wxTOP|wxBOTTOM|wxALIGN_CENTER_HORIZONTAL, 5);
-
-    if ( GetSizer() ) 
-    {
-         GetSizer()->Fit(this);
-    }
-    Centre(wxBOTH);
-
-    // Connect events
-    this->Connect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(ComPortsDlg::OnInitDialog), NULL, this);
-    m_ckUseHamlibPTT->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(ComPortsDlg::PTTUseHamLibClicked), NULL, this);
-    m_ckUseSerialPTT->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(ComPortsDlg::PTTUseSerialClicked), NULL, this);
-    m_buttonOK->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnOK), NULL, this);
-    m_buttonCancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnCancel), NULL, this);
-    m_buttonApply->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnApply), NULL, this);
-}
-
-//-------------------------------------------------------------------------
-// ~ComPortsDlg()
-//-------------------------------------------------------------------------
-ComPortsDlg::~ComPortsDlg()
-{
-    // Disconnect Events
-    this->Disconnect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(ComPortsDlg::OnInitDialog), NULL, this);
-    m_ckUseHamlibPTT->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(ComPortsDlg::PTTUseHamLibClicked), NULL, this);
-    m_ckUseSerialPTT->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(ComPortsDlg::PTTUseSerialClicked), NULL, this);
-    m_buttonOK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnOK), NULL, this);
-    m_buttonCancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnCancel), NULL, this);
-    m_buttonApply->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnApply), NULL, this);
-}
-
-//-------------------------------------------------------------------------
-// OnInitDialog()
-//-------------------------------------------------------------------------
-void ComPortsDlg::OnInitDialog(wxInitDialogEvent& event)
-{
-    populatePortList();
-    ExchangeData(EXCHANGE_DATA_IN);
-}
-
-//-------------------------------------------------------------------------
-// populatePortList()
-//-------------------------------------------------------------------------
-void ComPortsDlg::populatePortList()
-{
-#ifdef __WXMSW__
-    m_listCtrlPorts->Clear();
-    m_cbSerialPort->Clear();
-    wxArrayString aStr;
-    wxRegKey key(wxRegKey::HKLM, _T("HARDWARE\\DEVICEMAP\\SERIALCOMM"));
-    if(!key.Exists())
-    {
-        return;
-    }
-    else
-    {
-        // Get the number of subkeys and enumerate them.
-        if(!key.Open(wxRegKey::Read))
-        {
-            return;
-        }    
-        size_t subkeys;
-        size_t values;
-        if(!key.GetKeyInfo(&subkeys, NULL, &values, NULL))
-        {
-            return;
-        }
-        if(!key.HasValues())
-        {
-            return;
-        }
-        wxString key_name;
-        long el = 1;
-        key.GetFirstValue(key_name, el);
-        wxString valType;
-        wxString key_data;
-        for(unsigned int i = 0; i < values; i++)
-        {
-            key.QueryValue(key_name, key_data);
-            //wxPrintf("Value:  %s Data: %s\n", key_name, key_data);
-            aStr.Add(key_data, 1);
-            key.GetNextValue(key_name, el);
-        }
-    }
-    m_listCtrlPorts->Append(aStr);
-    m_cbSerialPort->Append(aStr);
-#endif
-#ifdef __WXGTK__
-    m_cbSerialPort->Clear();
-    m_cbCtlDevicePath->Clear();
-#ifdef __FreeBSD__
-       glob_t  gl;
-       if(glob("/dev/tty*", GLOB_MARK, NULL, &gl)==0) {
-               for(unsigned int i=0; i<gl.gl_pathc; i++) {
-                       if(gl.gl_pathv[i][strlen(gl.gl_pathv[i])-1]=='/')
-                               continue;
-                               
-                       /* Exclude pseudo TTYs */
-                       if(gl.gl_pathv[i][8] >= 'l' && gl.gl_pathv[i][8] <= 's')
-                               continue;
-                       if(gl.gl_pathv[i][8] >= 'L' && gl.gl_pathv[i][8] <= 'S')
-                               continue;
-
-                       /* Exclude virtual TTYs */
-                       if(gl.gl_pathv[i][8] == 'v')
-                               continue;
-
-                       /* Exclude initial-state and lock-state devices */
-                       if(strchr(gl.gl_pathv[i], '.') != NULL)
-                               continue;
-
-                       m_cbSerialPort->Append(gl.gl_pathv[i]);
-                       m_cbCtlDevicePath->Append(gl.gl_pathv[i]);
-               }
-               globfree(&gl);
-       }
-#else
-    /* TODO(Joel): http://stackoverflow.com/questions/2530096/how-to-find-all-serial-devices-ttys-ttyusb-on-linux-without-opening-them */
-    m_cbSerialPort->Append("/dev/ttyUSB0");
-    m_cbSerialPort->Append("/dev/ttyUSB1");
-    m_cbSerialPort->Append("/dev/ttyS0");
-    m_cbSerialPort->Append("/dev/ttyS1");
-    m_cbCtlDevicePath->Clear();
-    m_cbCtlDevicePath->Append("/dev/ttyUSB0");
-    m_cbCtlDevicePath->Append("/dev/ttyUSB1");
-    m_cbCtlDevicePath->Append("/dev/ttyS0");
-    m_cbCtlDevicePath->Append("/dev/ttyS1");
-#endif
-#endif
-}
-
-//-------------------------------------------------------------------------
-// ExchangeData()
-//-------------------------------------------------------------------------
-void ComPortsDlg::ExchangeData(int inout)
-{
-    wxConfigBase *pConfig = wxConfigBase::Get();
-    wxString str;
-    
-    if(inout == EXCHANGE_DATA_IN)
-    {
-        m_ckHalfDuplex->SetValue(wxGetApp().m_boolHalfDuplex);
-        m_ckLeftChannelVoxTone->SetValue(wxGetApp().m_leftChannelVoxTone);
-
-        m_ckUseHamlibPTT->SetValue(wxGetApp().m_boolHamlibUseForPTT);
-        m_cbRigName->SetSelection(wxGetApp().m_intHamlibRig);
-        m_cbSerialPort->SetValue(wxGetApp().m_strHamlibSerialPort);
-
-        m_ckUseSerialPTT->SetValue(wxGetApp().m_boolUseSerialPTT);
-        str = wxGetApp().m_strRigCtrlPort;
-#ifdef __WXMSW__
-        m_listCtrlPorts->SetStringSelection(str);
-#endif
-#ifdef __WXGTK__
-        m_cbCtlDevicePath->SetValue(str);
-#endif
-        m_rbUseRTS->SetValue(wxGetApp().m_boolUseRTS);
-        m_ckRTSPos->SetValue(wxGetApp().m_boolRTSPos);
-        m_rbUseDTR->SetValue(wxGetApp().m_boolUseDTR);
-        m_ckDTRPos->SetValue(wxGetApp().m_boolDTRPos);
-    }
-    if(inout == EXCHANGE_DATA_OUT)
-    {
-        wxGetApp().m_boolHalfDuplex = m_ckHalfDuplex->GetValue();
-        pConfig->Write(wxT("/Rig/HalfDuplex"), wxGetApp().m_boolHalfDuplex);
-        wxGetApp().m_leftChannelVoxTone = m_ckLeftChannelVoxTone->GetValue();
-        pConfig->Write(wxT("/Rig/leftChannelVoxTone"), wxGetApp().m_leftChannelVoxTone);
-
-        /* Hamlib settings. */
-
-        wxGetApp().m_boolHamlibUseForPTT = m_ckUseHamlibPTT->GetValue();
-        wxGetApp().m_intHamlibRig = m_cbRigName->GetSelection();
-        wxGetApp().m_strHamlibSerialPort = m_cbSerialPort->GetValue();
-
-        pConfig->Write(wxT("/Hamlib/UseForPTT"), wxGetApp().m_boolHamlibUseForPTT);
-        pConfig->Write(wxT("/Hamlib/RigName"), wxGetApp().m_intHamlibRig);
-        pConfig->Write(wxT("/Hamlib/SerialPort"), wxGetApp().m_strHamlibSerialPort);
-
-        /* Serial settings */
-
-        wxGetApp().m_boolUseSerialPTT           = m_ckUseSerialPTT->IsChecked();
-#ifdef __WXMSW__
-        wxGetApp().m_strRigCtrlPort             = m_listCtrlPorts->GetStringSelection();
-#endif
-#ifdef __WXGTK__
-        wxGetApp().m_strRigCtrlPort             = m_cbCtlDevicePath->GetValue();
-#endif
-        wxGetApp().m_boolUseRTS                 = m_rbUseRTS->GetValue();
-        wxGetApp().m_boolRTSPos                 = m_ckRTSPos->IsChecked();
-        wxGetApp().m_boolUseDTR                 = m_rbUseDTR->GetValue();
-        wxGetApp().m_boolDTRPos                 = m_ckDTRPos->IsChecked();
-        
-        pConfig->Write(wxT("/Rig/UseSerialPTT"),    wxGetApp().m_boolUseSerialPTT);
-        pConfig->Write(wxT("/Rig/Port"),            wxGetApp().m_strRigCtrlPort); 
-        pConfig->Write(wxT("/Rig/UseRTS"),          wxGetApp().m_boolUseRTS);
-        pConfig->Write(wxT("/Rig/RTSPolarity"),     wxGetApp().m_boolRTSPos);
-        pConfig->Write(wxT("/Rig/UseDTR"),          wxGetApp().m_boolUseDTR);
-        pConfig->Write(wxT("/Rig/DTRPolarity"),     wxGetApp().m_boolDTRPos);
-
-        pConfig->Flush();
-    }
-    delete wxConfigBase::Set((wxConfigBase *) NULL);
-}
-
-//-------------------------------------------------------------------------
-// PTTUseHamLibClicked()
-//-------------------------------------------------------------------------
-void ComPortsDlg::PTTUseHamLibClicked(wxCommandEvent& event)
-{
-    m_ckUseSerialPTT->SetValue(false);    
-}
-
-//-------------------------------------------------------------------------
-// PTTUseSerialClicked()
-//-------------------------------------------------------------------------
-void ComPortsDlg::PTTUseSerialClicked(wxCommandEvent& event)
-{
-    m_ckUseHamlibPTT->SetValue(false);
-}
-
-//-------------------------------------------------------------------------
-// OnApply()
-//-------------------------------------------------------------------------
-void ComPortsDlg::OnApply(wxCommandEvent& event)
-{
-    ExchangeData(EXCHANGE_DATA_OUT);
-}
-
-//-------------------------------------------------------------------------
-// OnCancel()
-//-------------------------------------------------------------------------
-void ComPortsDlg::OnCancel(wxCommandEvent& event)
-{
-    this->EndModal(wxID_CANCEL);
-}
-
-//-------------------------------------------------------------------------
-// OnClose()
-//-------------------------------------------------------------------------
-void ComPortsDlg::OnOK(wxCommandEvent& event)
-{
-    ExchangeData(EXCHANGE_DATA_OUT);
-    this->EndModal(wxID_OK);
-}
diff --git a/fdmdv2/tags/0.99-Beta/src/dlg_ptt.h b/fdmdv2/tags/0.99-Beta/src/dlg_ptt.h
deleted file mode 100644 (file)
index 8fa9b9d..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-//==========================================================================
-// Name:            dlg_ptt.h
-// Purpose:         Subclasses dialog GUI for PTT Config.
-//                  
-// Created:         May. 11, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#ifndef __COMPORTS_DIALOG__
-#define __COMPORTS_DIALOG__
-
-#include "fdmdv2_main.h"
-#include "hamlib.h"
-#include <wx/settings.h>
-#include <wx/xrc/xmlres.h>
-#include <wx/xrc/xh_bmp.h>
-#include <wx/dialog.h>
-#include <wx/sizer.h>
-#include <wx/statbox.h>
-#include <wx/checkbox.h>
-#include <wx/listbox.h>
-#include <wx/radiobut.h>
-#include <wx/button.h>
-#include <wx/spinctrl.h>
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class ComPortsDlg
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class ComPortsDlg : public wxDialog
-{
-     public:
-        ComPortsDlg(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("PTT Config"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(450,300), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER);
-        virtual ~ComPortsDlg();
-        void    ExchangeData(int inout);
-
-    protected:
-        wxCheckBox* m_ckHalfDuplex;
-        wxCheckBox* m_ckLeftChannelVoxTone;
-
-        /* Hamlib settings.*/
-
-        wxCheckBox *m_ckUseHamlibPTT;
-        wxComboBox *m_cbRigName;
-        wxComboBox *m_cbSerialPort;
-
-        Hamlib *m_hamlib;
-
-        /* Serial Settings */
-
-        wxListBox     *m_listCtrlPorts;
-        wxCheckBox    *m_ckUseSerialPTT;
-        wxStaticText  *m_staticText12;
-        wxComboBox    *m_cbCtlDevicePath;
-        wxRadioButton *m_rbUseDTR;
-        wxCheckBox    *m_ckRTSPos;
-        wxRadioButton *m_rbUseRTS;
-        wxCheckBox    *m_ckDTRPos;
-
-        /* Ok - Cancel - Apply */
-
-        wxButton* m_buttonOK;
-        wxButton* m_buttonCancel;
-        wxButton* m_buttonApply;
-
-
-protected:
-        void populatePortList();
-
-        void PTTUseHamLibClicked(wxCommandEvent& event);
-        void PTTUseSerialClicked(wxCommandEvent& event);
-
-        void OnOK(wxCommandEvent& event);
-        void OnCancel(wxCommandEvent& event);
-        void OnApply(wxCommandEvent& event);
-        virtual void OnInitDialog(wxInitDialogEvent& event);
-};
-
-#endif // __COMPORTS_DIALOG__
diff --git a/fdmdv2/tags/0.99-Beta/src/fdmdv2_defines.h b/fdmdv2/tags/0.99-Beta/src/fdmdv2_defines.h
deleted file mode 100644 (file)
index 64aa606..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_defines.h
-// Purpose:         Definitions used by plots derived from fdmdv2_plot class.
-// Created:         August 27, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#ifndef __FDMDV2_DEFINES__
-#define __FDMDV2_DEFINES__
-
-#include "wx/wx.h"
-#include "freedv_api.h"
-#include "freedv_api_internal.h"
-
-// Spectrogram and Waterfall
-
-#define MIN_MAG_DB        -40.0     // min of spectrogram/waterfall magnitude axis
-#define MAX_MAG_DB          0.0     // max of spectrogram/waterfall magnitude axis
-#define STEP_MAG_DB         5.0     // magnitude axis step
-#define BETA                0.95    // constant for time averaging spectrum data
-#define MIN_F_HZ            0       // min freq on Waterfall and Spectrum
-#define MAX_F_HZ            3000    // max freq on Waterfall and Spectrum
-#define STEP_F_HZ           500     // major (e.g. text legend) freq step on Waterfall and Spectrum graticule
-#define STEP_MINOR_F_HZ     100     // minor (ticks) freq step on Waterfall and Spectrum graticule
-#define WATERFALL_SECS_Y    30      // number of seconds respresented by y axis of waterfall
-#define WATERFALL_SECS_STEP 5       // graticule y axis steps of waterfall
-#define DT                  0.1     // time between real time graphing updates
-#define FS                  8000    // FDMDV modem sample rate
-
-// Scatter diagram 
-
-#define SCATTER_MEM_SECS    10
-// (symbols/frame)/(graphics update period) = symbols/s sent to scatter memory
-// memory (symbols) = secs of memory * symbols/sec
-#define SCATTER_MEM_SYMS_MAX    ((int)(SCATTER_MEM_SECS*((FDMDV_NC_MAX+1)/DT)))
-
-// Waveform plotting constants
-
-#define WAVEFORM_PLOT_FS    400                            // sample rate (points/s) of waveform plotted to screen
-#define WAVEFORM_PLOT_TIME  5                              // length or entire waveform on screen
-#define WAVEFORM_PLOT_BUF   ((int)(DT*WAVEFORM_PLOT_FS))   // number of new samples we plot per DT
-
-// sample rate I/O & conversion constants
-
-#define MAX_FPB             8096                           // maximum value of portAudio framesPerBuffer
-#define PA_FPB              1024                           // nominal value of portAudio framesPerBuffer
-#define SAMPLE_RATE         48000                          // 48 kHz sampling rate rec. as we can trust accuracy of sound card
-#define N8                  160                            // processing buffer size at 8 kHz
-#define MEM8                (FDMDV_OS_TAPS/FDMDV_OS)
-#define N48                 (N8*SAMPLE_RATE/FS)            // processing buffer size at 48 kHz
-#define NUM_CHANNELS        2                              // I think most sound cards prefer stereo we will convert to mono
-#define VOX_TONE_FREQ       1000.0                         // optional left channel vox tone freq
-#define VOX_TONE_AMP        30000                          // optional left channel vox tone amp
-
-#define MAX_BITS_PER_CODEC_FRAME 64                            // 1600 bit/s mode
-#define MAX_BYTES_PER_CODEC_FRAME (MAX_BITS_PER_CODEC_FRAME/8)
-#define MAX_BITS_PER_FDMDV_FRAME 40                            // 2000 bit/s mode
-
-// Squelch
-#define SQ_DEFAULT_SNR       2.0
-
-// Level Gauge
-#define FROM_RADIO_MAX       0.8
-#define FROM_MIC_MAX         0.8
-#define LEVEL_BETA           0.99
-
-// SNR
-#define SNRSLOW_BETA        0.5                           // time constant for slow SNR for display
-
-// Text messaging Data
-#define MAX_CALLSIGN         80
-#define MAX_EVENT_LOG        10
-#define MAX_EVENT_RULES      100
-   
-enum
-{
-    ID_ROTATE_LEFT = wxID_HIGHEST + 1,
-    ID_ROTATE_RIGHT,
-    ID_RESIZE,
-    ID_PAINT_BG
-};
-
-// Codec 2 LPC Post Filter defaults, from codec-dev/src/quantise.c
-
-#define CODEC2_LPC_PF_GAMMA 0.5
-#define CODEC2_LPC_PF_BETA  0.2
-
-
-#endif  //__FDMDV2_DEFINES__
diff --git a/fdmdv2/tags/0.99-Beta/src/fdmdv2_main.cpp b/fdmdv2/tags/0.99-Beta/src/fdmdv2_main.cpp
deleted file mode 100644 (file)
index 2adec2c..0000000
+++ /dev/null
@@ -1,3686 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_main.cpp
-//
-// Purpose:         FreeDV main()
-// Created:         Apr. 9, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-
-#include "fdmdv2_main.h"
-
-#define wxUSE_FILEDLG   1
-#define wxUSE_LIBPNG    1
-#define wxUSE_LIBJPEG   1
-#define wxUSE_GIF       1
-#define wxUSE_PCX       1
-#define wxUSE_LIBTIFF   1
-
-//-------------------------------------------------------------------
-// Bunch of globals used for communication with sound card call
-// back functions
-// ------------------------------------------------------------------
-
-int g_in, g_out;
-
-// Global Codec2 & modem states - just one reqd for tx & rx
-int                 g_Nc;
-int                 g_mode;
-struct freedv      *g_pfreedv;
-struct MODEM_STATS  g_stats;
-float               g_pwr_scale;
-int                 g_clip;
-
-// test Frames
-int                 g_testFrames;
-int                 g_test_frame_sync_state;
-int                 g_test_frame_count;
-int                 g_total_bits;
-int                 g_total_bit_errors;
-int                 g_channel_noise;
-float               g_sig_pwr_av = 0.0;
-struct FIFO        *g_error_pattern_fifo;
-short              *g_error_hist;
-// time averaged magnitude spectrum used for waterfall and spectrum display
-float               g_avmag[MODEM_STATS_NSPEC];
-
-// GUI controls that affect rx and tx processes
-int   g_SquelchActive;
-float g_SquelchLevel;
-int   g_analog;
-int   g_split;
-int   g_tx;
-float g_snr;
-bool  g_half_duplex;
-bool  g_modal;
-
-// sending and receiving Call Sign data
-struct FIFO         *g_txDataInFifo;
-struct FIFO         *g_rxDataOutFifo;
-
-// tx/rx processing states
-int                 g_State;
-paCallBackData     *g_rxUserdata;
-
-// FIFOs used for plotting waveforms
-struct FIFO        *g_plotDemodInFifo;
-struct FIFO        *g_plotSpeechOutFifo;
-struct FIFO        *g_plotSpeechInFifo;
-
-// Soundcard config
-int                 g_nSoundCards;
-int                 g_soundCard1InDeviceNum;
-int                 g_soundCard1OutDeviceNum;
-int                 g_soundCard1SampleRate;
-int                 g_soundCard2InDeviceNum;
-int                 g_soundCard2OutDeviceNum;
-int                 g_soundCard2SampleRate;
-
-// playing and recording from sound files
-
-SNDFILE            *g_sfPlayFile;
-bool                g_playFileToMicIn;
-bool                g_loopPlayFileToMicIn;
-int                 g_playFileToMicInEventId;
-
-SNDFILE            *g_sfRecFile;
-bool                g_recFileFromRadio;
-unsigned int        g_recFromRadioSamples;
-int                 g_recFileFromRadioEventId;
-
-SNDFILE            *g_sfPlayFileFromRadio;
-bool                g_playFileFromRadio;
-int                 g_sfFs;
-bool                g_loopPlayFileFromRadio;
-int                 g_playFileFromRadioEventId;
-float               g_blink;
-
-wxWindow           *g_parent;
-
-// Click to tune rx and tx frequency offset states
-float               g_RxFreqOffsetHz;
-COMP                g_RxFreqOffsetPhaseRect;
-float               g_TxFreqOffsetHz;
-COMP                g_TxFreqOffsetPhaseRect;
-
-// experimental mutex to make sound card callbacks mutually exclusive
-// TODO: review code and see if we need this any more, as fifos should
-// now be thread safe
-
-wxMutex g_mutexProtectingCallbackData;
-
-// Speex pre-processor states
-
-SpeexPreprocessState *g_speex_st;
-
-// WxWidgets - initialize the application
-IMPLEMENT_APP(MainApp);
-
-//FILE *ft;
-FILE *g_logfile;
-
-//-------------------------------------------------------------------------
-// OnInit()
-//-------------------------------------------------------------------------
-bool MainApp::OnInit()
-{
-    if(!wxApp::OnInit())
-    {
-        return false;
-    }
-    SetVendorName(wxT("CODEC2-Project"));
-    SetAppName(wxT("FreeDV"));      // not needed, it's the default value
-
-    // DR - this is wrong define so won't be used on windows build, should be __WXMSW__
-    // So registry will be used for Win32
-#ifdef _WXMSW_
-    // Force use of file-based configuration persistance on Windows platforma
-    wxConfig *pConfig = new wxConfig();
-    wxFileConfig *pFConfig = new wxFileConfig(wxT("FreeDV"), wxT("CODEC2-Project"), wxT("FreeDV.conf"), wxT("FreeDV.conf"),  wxCONFIG_USE_LOCAL_FILE | wxCONFIG_USE_RELATIVE_PATH);
-    pConfig->Set(pFConfig);
-    pConfig->SetRecordDefaults();
-#else
-    wxConfigBase *pConfig = wxConfigBase::Get();
-    pConfig->SetRecordDefaults();
-#endif
-
-    m_rTopWindow = wxRect(0, 0, 0, 0);
-    m_strRxInAudio.Empty();
-    m_strRxOutAudio.Empty();
-    m_textVoiceInput.Empty();
-    m_textVoiceOutput.Empty();
-    m_strSampleRate.Empty();
-    m_strBitrate.Empty();
-    // Create the main application window
-    frame = new MainFrame(NULL);
-    SetTopWindow(frame);
-    // Should guarantee that the first plot tab defined is the one
-    // displayed. But it doesn't when built from command line.  Why?
-    frame->m_auiNbookCtrl->ChangeSelection(0);
-    frame->Layout();
-    frame->Show();
-    g_parent =frame;
-
-    //ft = fopen("tmp.raw","wb");
-    //assert(ft != NULL);
-
-    return true;
-}
-
-//-------------------------------------------------------------------------
-// OnExit()
-//-------------------------------------------------------------------------
-int MainApp::OnExit()
-{
-    return 0;
-}
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class MainFrame(wxFrame* pa->ent) : TopFrame(parent)
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-MainFrame::MainFrame(wxWindow *parent) : TopFrame(parent)
-{
-    m_zoom              = 1.;
-
-    #ifdef __WXMSW__
-    g_logfile = fopen("log.txt","wt");
-    #else
-    g_logfile = stderr;
-    #endif
-
-    SetMinSize(wxSize(400,400));
-
-    // Init Hamlib library, but we dont start talking to any rigs yet
-
-    wxGetApp().m_hamlib = new Hamlib();
-
-    tools->AppendSeparator();
-    wxMenuItem* m_menuItemToolsConfigDelete;
-    m_menuItemToolsConfigDelete = new wxMenuItem(tools, wxID_ANY, wxString(_("&Restore defaults")) , wxT("Delete config file/keys and restore defaults"), wxITEM_NORMAL);
-    this->Connect(m_menuItemToolsConfigDelete->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::OnDeleteConfig));
-
-    tools->Append(m_menuItemToolsConfigDelete);
-
-    wxConfigBase *pConfig = wxConfigBase::Get();
-
-    // restore frame position and size
-    int x = pConfig->Read(wxT("/MainFrame/left"),       20);
-    int y = pConfig->Read(wxT("/MainFrame/top"),        20);
-    int w = pConfig->Read(wxT("/MainFrame/width"),     800);
-    int h = pConfig->Read(wxT("/MainFrame/height"),    550);
-
-    // sanitise frame position as a first pass at Win32 registry bug
-
-    fprintf(g_logfile, "x = %d y = %d w = %d h = %d\n", x,y,w,h);
-    if (x < 0 || x > 2048) x = 20;
-    if (y < 0 || y > 2048) y = 20;
-    if (w < 0 || w > 2048) w = 800;
-    if (h < 0 || h > 2048) h = 550;
-
-    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_show_speech_in     = pConfig->Read(wxT("/MainFrame/show_speech_in"),    1);
-    wxGetApp().m_show_speech_out    = pConfig->Read(wxT("/MainFrame/show_speech_out"),   1);
-    wxGetApp().m_show_demod_in      = pConfig->Read(wxT("/MainFrame/show_demod_in"),     1);
-    wxGetApp().m_show_test_frame_errors = pConfig->Read(wxT("/MainFrame/show_test_frame_errors"),     1);
-    wxGetApp().m_show_test_frame_errors_hist = pConfig->Read(wxT("/MainFrame/show_test_frame_errors_hist"),     1);
-
-    wxGetApp().m_rxNbookCtrl        = pConfig->Read(wxT("/MainFrame/rxNbookCtrl"),    (long)0);
-
-    g_SquelchActive = pConfig->Read(wxT("/Audio/SquelchActive"), (long)0);
-    g_SquelchLevel = pConfig->Read(wxT("/Audio/SquelchLevel"), (int)(SQ_DEFAULT_SNR*2));
-    g_SquelchLevel /= 2.0;
-
-    Move(x, y);
-    SetClientSize(w, h);
-    
-    if(wxGetApp().m_show_wf)
-    {
-        // Add Waterfall Plot window
-        m_panelWaterfall = new PlotWaterfall((wxFrame*) m_auiNbookCtrl, false, 0);
-        m_panelWaterfall->SetToolTip(_("Left click to tune, Right click to toggle mono/colour"));
-        m_auiNbookCtrl->AddPage(m_panelWaterfall, _("Waterfall"), true, wxNullBitmap);
-    }
-    if(wxGetApp().m_show_spect)
-    {
-        // Add Spectrum Plot window
-        m_panelSpectrum = new PlotSpectrum((wxFrame*) m_auiNbookCtrl, g_avmag,
-                                           MODEM_STATS_NSPEC*((float)MAX_F_HZ/MODEM_STATS_MAX_F_HZ));
-        m_panelSpectrum->SetToolTip(_("Left click to tune"));
-        m_auiNbookCtrl->AddPage(m_panelSpectrum, _("Spectrum"), true, wxNullBitmap);
-    }
-    if(wxGetApp().m_show_scatter)
-    {
-        // Add Scatter Plot window
-        m_panelScatter = new PlotScatter((wxFrame*) m_auiNbookCtrl);
-        m_auiNbookCtrl->AddPage(m_panelScatter, _("Scatter"), true, wxNullBitmap);
-    }
-    if(wxGetApp().m_show_demod_in)
-    {
-        // Add Demod Input window
-        m_panelDemodIn = new PlotScalar((wxFrame*) m_auiNbookCtrl, 1, WAVEFORM_PLOT_TIME, 1.0/WAVEFORM_PLOT_FS, -1, 1, 1, 0.2, "%2.1f", 0);
-        m_auiNbookCtrl->AddPage(m_panelDemodIn, _("Frm Radio"), true, wxNullBitmap);
-        g_plotDemodInFifo = fifo_create(2*WAVEFORM_PLOT_BUF);
-    }
-
-    if(wxGetApp().m_show_speech_in)
-    {
-        // Add Speech Input window
-        m_panelSpeechIn = new PlotScalar((wxFrame*) m_auiNbookCtrl, 1, WAVEFORM_PLOT_TIME, 1.0/WAVEFORM_PLOT_FS, -1, 1, 1, 0.2, "%2.1f", 0);
-        m_auiNbookCtrl->AddPage(m_panelSpeechIn, _("Frm Mic"), true, wxNullBitmap);
-        g_plotSpeechInFifo = fifo_create(4*WAVEFORM_PLOT_BUF);
-    }
-
-    if(wxGetApp().m_show_speech_out)
-    {
-        // Add Speech Output window
-        m_panelSpeechOut = new PlotScalar((wxFrame*) m_auiNbookCtrl, 1, WAVEFORM_PLOT_TIME, 1.0/WAVEFORM_PLOT_FS, -1, 1, 1, 0.2, "%2.1f", 0);
-        m_auiNbookCtrl->AddPage(m_panelSpeechOut, _("To Spkr/Hdphns"), true, wxNullBitmap);
-        g_plotSpeechOutFifo = fifo_create(2*WAVEFORM_PLOT_BUF);
-    }
-
-    if(wxGetApp().m_show_timing)
-    {
-        // Add Timing Offset window
-        m_panelTimeOffset = new PlotScalar((wxFrame*) m_auiNbookCtrl, 1, 5.0, DT, -0.5, 0.5, 1, 0.1, "%2.1f", 0);
-        m_auiNbookCtrl->AddPage(m_panelTimeOffset, L"Timing \u0394", true, wxNullBitmap);
-    }
-    if(wxGetApp().m_show_freq)
-    {
-        // Add Frequency Offset window
-        m_panelFreqOffset = new PlotScalar((wxFrame*) m_auiNbookCtrl, 1, 5.0, DT, -200, 200, 1, 50, "%3.0fHz", 0);
-        m_auiNbookCtrl->AddPage(m_panelFreqOffset, L"Frequency \u0394", true, wxNullBitmap);
-    }
-
-    if(wxGetApp().m_show_test_frame_errors)
-    {
-        // Add Test Frame Errors window
-        m_panelTestFrameErrors = new PlotScalar((wxFrame*) m_auiNbookCtrl, 2*MODEM_STATS_NC_MAX, 30.0, DT, 0, 2*MODEM_STATS_NC_MAX+2, 1, 1, "", 1);
-        m_auiNbookCtrl->AddPage(m_panelTestFrameErrors, L"Test Frame Errors", true, wxNullBitmap);
-    }
-
-    if(wxGetApp().m_show_test_frame_errors_hist)
-    {
-        // Add Test Frame Errors window
-        m_panelTestFrameErrorsHist = new PlotScalar((wxFrame*) m_auiNbookCtrl, 1, 1.0, 1.0/(2*FDMDV_NC_MAX), 0.0, 1.0, 1.0/FDMDV_NC_MAX, 0.1, "%3.2f", 0);
-        m_auiNbookCtrl->AddPage(m_panelTestFrameErrorsHist, L"Test Frame Histogram", true, wxNullBitmap);
-    }
-
-    wxGetApp().m_framesPerBuffer = pConfig->Read(wxT("/Audio/framesPerBuffer"), PA_FPB);
-
-    g_soundCard1InDeviceNum  = pConfig->Read(wxT("/Audio/soundCard1InDeviceNum"),         -1);
-    g_soundCard1OutDeviceNum = pConfig->Read(wxT("/Audio/soundCard1OutDeviceNum"),        -1);
-    g_soundCard1SampleRate   = pConfig->Read(wxT("/Audio/soundCard1SampleRate"),          -1);
-
-    g_soundCard2InDeviceNum  = pConfig->Read(wxT("/Audio/soundCard2InDeviceNum"),         -1);
-    g_soundCard2OutDeviceNum = pConfig->Read(wxT("/Audio/soundCard2OutDeviceNum"),        -1);
-    g_soundCard2SampleRate   = pConfig->Read(wxT("/Audio/soundCard2SampleRate"),          -1);
-
-    g_nSoundCards = 0;
-    if ((g_soundCard1InDeviceNum > -1) && (g_soundCard1OutDeviceNum > -1)) {
-        g_nSoundCards = 1;
-        if ((g_soundCard2InDeviceNum > -1) && (g_soundCard2OutDeviceNum > -1))
-            g_nSoundCards = 2;
-    }
-
-    wxGetApp().m_playFileToMicInPath = pConfig->Read("/File/playFileToMicInPath",   wxT(""));
-    wxGetApp().m_recFileFromRadioPath = pConfig->Read("/File/recFileFromRadioPath", wxT(""));
-    wxGetApp().m_recFileFromRadioSecs = pConfig->Read("/File/recFileFromRadioSecs", 30);
-    wxGetApp().m_playFileFromRadioPath = pConfig->Read("/File/playFileFromRadioPath", wxT(""));
-
-    // PTT -------------------------------------------------------------------
-
-    wxGetApp().m_boolHalfDuplex     = pConfig->ReadBool(wxT("/Rig/HalfDuplex"),     true);
-    wxGetApp().m_leftChannelVoxTone = pConfig->ReadBool("/Rig/leftChannelVoxTone",  false);
-    wxGetApp().m_boolHamlibUseForPTT = pConfig->ReadBool("/Hamlib/UseForPTT", false);
-    wxGetApp().m_intHamlibRig = pConfig->ReadLong("/Hamlib/RigName", 0);
-    wxGetApp().m_strHamlibSerialPort = pConfig->Read("/Hamlib/SerialPort", "");
-    
-    wxGetApp().m_boolUseSerialPTT   = pConfig->ReadBool(wxT("/Rig/UseSerialPTT"),   false);
-    wxGetApp().m_strRigCtrlPort     = pConfig->Read(wxT("/Rig/Port"),               wxT(""));
-    wxGetApp().m_boolUseRTS         = pConfig->ReadBool(wxT("/Rig/UseRTS"),         true);
-    wxGetApp().m_boolRTSPos         = pConfig->ReadBool(wxT("/Rig/RTSPolarity"),    true);
-    wxGetApp().m_boolUseDTR         = pConfig->ReadBool(wxT("/Rig/UseDTR"),         false);
-    wxGetApp().m_boolDTRPos         = pConfig->ReadBool(wxT("/Rig/DTRPolarity"),    false);
-    com_handle = COM_HANDLE_INVALID;
-
-    // -----------------------------------------------------------------------
-
-    bool slow = false; // prevents compile error when using default bool
-    wxGetApp().m_snrSlow = pConfig->Read("/Audio/snrSlow", slow);
-
-    bool t = true;     // prevents compile error when using default bool
-    wxGetApp().m_codec2LPCPostFilterEnable     = pConfig->Read(wxT("/Filter/codec2LPCPostFilterEnable"),    t);
-    wxGetApp().m_codec2LPCPostFilterBassBoost  = pConfig->Read(wxT("/Filter/codec2LPCPostFilterBassBoost"), t);
-    wxGetApp().m_codec2LPCPostFilterGamma      = (float)pConfig->Read(wxT("/Filter/codec2LPCPostFilterGamma"),     CODEC2_LPC_PF_GAMMA*100)/100.0;
-    wxGetApp().m_codec2LPCPostFilterBeta       = (float)pConfig->Read(wxT("/Filter/codec2LPCPostFilterBeta"),      CODEC2_LPC_PF_BETA*100)/100.0;
-    //printf("main(): m_codec2LPCPostFilterBeta: %f\n", wxGetApp().m_codec2LPCPostFilterBeta);
-
-    wxGetApp().m_speexpp_enable     = pConfig->Read(wxT("/Filter/speexpp_enable"),    t);
-
-    wxGetApp().m_MicInBassFreqHz = (float)pConfig->Read(wxT("/Filter/MicInBassFreqHz"),    1);
-    wxGetApp().m_MicInBassGaindB = (float)pConfig->Read(wxT("/Filter/MicInBassGaindB"),    (long)0)/10.0;
-    wxGetApp().m_MicInTrebleFreqHz = (float)pConfig->Read(wxT("/Filter/MicInTrebleFreqHz"),    1);
-    wxGetApp().m_MicInTrebleGaindB = (float)pConfig->Read(wxT("/Filter/MicInTrebleGaindB"),    (long)0)/10.0;
-    wxGetApp().m_MicInMidFreqHz = (float)pConfig->Read(wxT("/Filter/MicInMidFreqHz"),    1);
-    wxGetApp().m_MicInMidGaindB = (float)pConfig->Read(wxT("/Filter/MicInMidGaindB"),    (long)0)/10.0;
-    wxGetApp().m_MicInMidQ = (float)pConfig->Read(wxT("/Filter/MicInMidQ"),              (long)100)/100.0;
-
-    bool f = false;
-    wxGetApp().m_MicInEQEnable = (float)pConfig->Read(wxT("/Filter/MicInEQEnable"), f);
-
-    wxGetApp().m_SpkOutBassFreqHz = (float)pConfig->Read(wxT("/Filter/SpkOutBassFreqHz"),    1);
-    wxGetApp().m_SpkOutBassGaindB = (float)pConfig->Read(wxT("/Filter/SpkOutBassGaindB"),    (long)0)/10.0;
-    wxGetApp().m_SpkOutTrebleFreqHz = (float)pConfig->Read(wxT("/Filter/SpkOutTrebleFreqHz"),    1);
-    wxGetApp().m_SpkOutTrebleGaindB = (float)pConfig->Read(wxT("/Filter/SpkOutTrebleGaindB"),    (long)0)/10.0;
-    wxGetApp().m_SpkOutMidFreqHz = (float)pConfig->Read(wxT("/Filter/SpkOutMidFreqHz"),    1);
-    wxGetApp().m_SpkOutMidGaindB = (float)pConfig->Read(wxT("/Filter/SpkOutMidGaindB"),    (long)0)/10.0;
-    wxGetApp().m_SpkOutMidQ = (float)pConfig->Read(wxT("/Filter/SpkOutMidQ"),                (long)100)/100.0;
-
-    wxGetApp().m_SpkOutEQEnable = (float)pConfig->Read(wxT("/Filter/SpkOutEQEnable"), f);
-
-    wxGetApp().m_callSign = pConfig->Read("/Data/CallSign", wxT(""));
-    wxGetApp().m_textEncoding = pConfig->Read("/Data/TextEncoding", 1);
-    wxGetApp().m_enable_checksum = pConfig->Read("/Data/EnableChecksumOnMsgRx", f);
-
-    wxGetApp().m_events = pConfig->Read("/Events/enable", f);
-    wxGetApp().m_events_spam_timer = (int)pConfig->Read(wxT("/Events/spam_timer"), 10);
-    wxGetApp().m_events_regexp_match = pConfig->Read("/Events/regexp_match", wxT("s=(.*)"));
-    wxGetApp().m_events_regexp_replace = pConfig->Read("/Events/regexp_replace", 
-                                                       wxT("curl http://qso.freedv.org/cgi-bin/onspot.cgi?s=\\1"));
-    // make sure regexp lists are terminated by a \n
-
-    if (wxGetApp().m_events_regexp_match.Last() != '\n') {
-        wxGetApp().m_events_regexp_match = wxGetApp().m_events_regexp_match+'\n';
-    }
-    if (wxGetApp().m_events_regexp_replace.Last() != '\n') {
-        wxGetApp().m_events_regexp_replace = wxGetApp().m_events_regexp_replace+'\n';
-    }
-
-    wxGetApp().m_udp_enable = (float)pConfig->Read(wxT("/UDP/enable"), f);
-    wxGetApp().m_udp_port = (int)pConfig->Read(wxT("/UDP/port"), 3000);
-
-    wxGetApp().m_FreeDV700txClip = (float)pConfig->Read(wxT("/FreeDV700/txClip"), t);
-
-    int mode  = pConfig->Read(wxT("/Audio/mode"), (long)0);
-    if (mode == 0)
-        m_rb1600->SetValue(1);
-    if (mode == 1)
-        m_rb700->SetValue(1);
-        
-    pConfig->SetPath(wxT("/"));
-
-//    this->Connect(m_menuItemHelpUpdates->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnHelpCheckUpdatesUI));
-    //m_togRxID->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnRxIDUI), NULL, this);
-    //m_togTxID->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnTxIDUI), NULL, this);
-    m_togBtnOnOff->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnOnOffUI), NULL, this);
-    m_togBtnSplit->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnSplitClickUI), NULL, this);
-    m_togBtnAnalog->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnAnalogClickUI), NULL, this);
-    //m_togBtnALC->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnALCClickUI), NULL, this);
-   // m_btnTogPTT->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnPTT_UI), NULL, this);
-
-    m_togBtnSplit->Disable();
-    //m_togRxID->Disable();
-    //m_togTxID->Disable();
-    m_togBtnAnalog->Disable();
-    m_btnTogPTT->Disable();
-    //m_togBtnALC->Disable();
-
-    // squelch settings
-    char sqsnr[15];
-    m_sliderSQ->SetValue((int)((g_SquelchLevel+5.0)*2.0));
-    sprintf(sqsnr, "%4.1f", g_SquelchLevel);
-    wxString sqsnr_string(sqsnr);
-    m_textSQ->SetLabel(sqsnr_string);
-    m_ckboxSQ->SetValue(g_SquelchActive);
-
-    // SNR settings
-
-    m_ckboxSNR->SetValue(wxGetApp().m_snrSlow);
-    setsnrBeta(wxGetApp().m_snrSlow);
-
-#ifdef _USE_TIMER
-    Bind(wxEVT_TIMER, &MainFrame::OnTimer, this);       // ID_MY_WINDOW);
-    m_plotTimer.SetOwner(this, ID_TIMER_WATERFALL);
-    //m_panelWaterfall->Refresh();
-#endif
-
-    m_RxRunning = false;
-
-#ifdef _USE_ONIDLE
-    Connect(wxEVT_IDLE, wxIdleEventHandler(MainFrame::OnIdle), NULL, this);
-#endif //_USE_ONIDLE
-
-    g_sfPlayFile = NULL;
-    g_playFileToMicIn = false;
-    g_loopPlayFileToMicIn = false;
-
-    g_sfRecFile = NULL;
-    g_recFileFromRadio = false;
-
-    g_sfPlayFileFromRadio = NULL;
-    g_playFileFromRadio = false;
-    g_loopPlayFileFromRadio = false;
-
-    // init click-tune states
-
-    g_RxFreqOffsetHz = 0.0;
-    g_RxFreqOffsetPhaseRect.real = cos(0.0);
-    g_RxFreqOffsetPhaseRect.imag = sin(0.0);
-    m_panelWaterfall->setRxFreq(FDMDV_FCENTRE - g_RxFreqOffsetHz);
-    m_panelSpectrum->setRxFreq(FDMDV_FCENTRE - g_RxFreqOffsetHz);
-
-    g_TxFreqOffsetHz = 0.0;
-    g_TxFreqOffsetPhaseRect.real = cos(0.0);
-    g_TxFreqOffsetPhaseRect.imag = sin(0.0);
-
-    g_tx = 0;
-    g_split = 0;
-
-    // data states
-    g_txDataInFifo = fifo_create(MAX_CALLSIGN*VARICODE_MAX_BITS);
-    g_rxDataOutFifo = fifo_create(MAX_CALLSIGN*VARICODE_MAX_BITS);
-
-    sox_biquad_start();
-    golay23_init();
-
-    g_testFrames = 0;
-    g_test_frame_sync_state = 0;
-    g_total_bit_errors = 0;
-    g_total_bits = 0;
-    wxGetApp().m_testFrames = false;
-
-    g_modal = false;
-
-    // Start UDP listener thread
-
-    m_UDPThread = NULL;
-    startUDPThread();
-
-    optionsDlg = new OptionsDlg(NULL);
-    m_schedule_restore = false;
-
-}
-
-//-------------------------------------------------------------------------
-// ~MainFrame()
-//-------------------------------------------------------------------------
-MainFrame::~MainFrame()
-{
-    int x;
-    int y;
-    int w;
-    int h;
-
-    //fclose(ft);
-    #ifdef __WXMSW__
-    fclose(g_logfile);
-    #endif
-
-    if (optionsDlg != NULL) {
-        delete optionsDlg;
-        optionsDlg = NULL;
-    }
-
-    stopUDPThread();
-
-    /* TOOD(Joel): the ownership of m_hamlib is probably wrong. */
-    if (wxGetApp().m_hamlib) delete wxGetApp().m_hamlib;
-
-    //MainApp *pApp = wxGetApp();
-    wxConfigBase *pConfig = wxConfigBase::Get();
-    if(pConfig)
-    {
-        if (!IsIconized()) {
-            GetClientSize(&w, &h);
-
-            // big hack - for some reason height shrinks by this much
-            // every time FreeDV runs!  I have no idea why
-
-            h += 23;
-
-            GetPosition(&x, &y);
-            printf("x = %d y = %d w = %d h = %d\n", x,y,w,h);
-            pConfig->Write(wxT("/MainFrame/left"),               (long) x);
-            pConfig->Write(wxT("/MainFrame/top"),                (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("/MainFrame/show_speech_in"),    wxGetApp().m_show_speech_in);
-        pConfig->Write(wxT("/MainFrame/show_speech_out"),   wxGetApp().m_show_speech_out);
-        pConfig->Write(wxT("/MainFrame/show_demod_in"),     wxGetApp().m_show_demod_in);
-        pConfig->Write(wxT("/MainFrame/show_test_frame_errors"), wxGetApp().m_show_test_frame_errors);
-        pConfig->Write(wxT("/MainFrame/show_test_frame_errors_hist"), wxGetApp().m_show_test_frame_errors_hist);
-
-        pConfig->Write(wxT("/MainFrame/rxNbookCtrl"), wxGetApp().m_rxNbookCtrl);
-
-        pConfig->Write(wxT("/Audio/SquelchActive"),         g_SquelchActive);
-        pConfig->Write(wxT("/Audio/SquelchLevel"),          (int)(g_SquelchLevel*2.0));
-
-        pConfig->Write(wxT("/Audio/framesPerBuffer"),       wxGetApp().m_framesPerBuffer);
-
-        pConfig->Write(wxT("/Audio/soundCard1InDeviceNum"),   g_soundCard1InDeviceNum);
-        pConfig->Write(wxT("/Audio/soundCard1OutDeviceNum"),  g_soundCard1OutDeviceNum);
-        pConfig->Write(wxT("/Audio/soundCard1SampleRate"),    g_soundCard1SampleRate );
-
-        pConfig->Write(wxT("/Audio/soundCard2InDeviceNum"),   g_soundCard2InDeviceNum);
-        pConfig->Write(wxT("/Audio/soundCard2OutDeviceNum"),  g_soundCard2OutDeviceNum);
-        pConfig->Write(wxT("/Audio/soundCard2SampleRate"),    g_soundCard2SampleRate );
-
-        pConfig->Write(wxT("/Rig/HalfDuplex"),              wxGetApp().m_boolHalfDuplex);
-        pConfig->Write(wxT("/Rig/leftChannelVoxTone"),      wxGetApp().m_leftChannelVoxTone);
-        pConfig->Write("/Hamlib/UseForPTT", wxGetApp().m_boolHamlibUseForPTT);
-        pConfig->Write("/Hamlib/RigName", wxGetApp().m_intHamlibRig);
-        pConfig->Write("/Hamlib/SerialPort", wxGetApp().m_strHamlibSerialPort);
-
-
-        pConfig->Write(wxT("/File/playFileToMicInPath"),    wxGetApp().m_playFileToMicInPath);
-        pConfig->Write(wxT("/File/recFileFromRadioPath"),   wxGetApp().m_recFileFromRadioPath);
-        pConfig->Write(wxT("/File/recFileFromRadioSecs"),   wxGetApp().m_recFileFromRadioSecs);
-        pConfig->Write(wxT("/File/playFileFromRadioPath"),  wxGetApp().m_playFileFromRadioPath);
-
-        pConfig->Write(wxT("/Audio/snrSlow"), wxGetApp().m_snrSlow);
-
-        pConfig->Write(wxT("/Data/CallSign"), wxGetApp().m_callSign);
-        pConfig->Write(wxT("/Data/TextEncoding"), wxGetApp().m_textEncoding);
-        pConfig->Write(wxT("/Data/EnableChecksumOnMsgRx"), wxGetApp().m_enable_checksum);
-        pConfig->Write(wxT("/Events/enable"), wxGetApp().m_events);
-        pConfig->Write(wxT("/Events/spam_timer"), wxGetApp().m_events_spam_timer);
-        pConfig->Write(wxT("/Events/regexp_match"), wxGetApp().m_events_regexp_match);
-        pConfig->Write(wxT("/Events/regexp_replace"), wxGetApp().m_events_regexp_replace);
-        pConfig->Write(wxT("/UDP/enable"), wxGetApp().m_udp_enable);
-        pConfig->Write(wxT("/UDP/port"),  wxGetApp().m_udp_port);
-
-        pConfig->Write(wxT("/Filter/MicInEQEnable"), wxGetApp().m_MicInEQEnable);
-        pConfig->Write(wxT("/Filter/SpkOutEQEnable"), wxGetApp().m_SpkOutEQEnable);
-
-        pConfig->Write(wxT("/FreeDV700/txClip"), wxGetApp().m_FreeDV700txClip);
-
-        int mode;
-        if (m_rb1600->GetValue())
-            mode = 0;
-        if (m_rb700->GetValue())
-            mode = 1;
-        pConfig->Write(wxT("/Audio/mode"), mode);
-    }
-
-    //m_togRxID->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnRxIDUI), NULL, this);
-    //m_togTxID->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnTxIDUI), NULL, this);
-    m_togBtnOnOff->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnOnOffUI), NULL, this);
-    m_togBtnSplit->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnSplitClickUI), NULL, this);
-    m_togBtnAnalog->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnAnalogClickUI), NULL, this);
-    //m_togBtnALC->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnALCClickUI), NULL, this);
-    //m_btnTogPTT->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnPTT_UI), NULL, this);
-
-    sox_biquad_finish();
-
-    if (m_RxRunning)
-    {
-        stopRxStream();
-    }
-    if (g_sfPlayFile != NULL)
-    {
-        sf_close(g_sfPlayFile);
-        g_sfPlayFile = NULL;
-    }
-    if (g_sfRecFile != NULL)
-    {
-        sf_close(g_sfRecFile);
-        g_sfRecFile = NULL;
-    }
-#ifdef _USE_TIMER
-    if(m_plotTimer.IsRunning())
-    {
-        m_plotTimer.Stop();
-        Unbind(wxEVT_TIMER, &MainFrame::OnTimer, this);
-    }
-#endif //_USE_TIMER
-
-#ifdef _USE_ONIDLE
-    Disconnect(wxEVT_IDLE, wxIdleEventHandler(MainFrame::OnIdle), NULL, this);
-#endif // _USE_ONIDLE
-
-    delete wxConfigBase::Set((wxConfigBase *) NULL);
-}
-
-//----------------------------------------------------------------
-// closeComPort() closes the currently open com port
-//----------------------------------------------------------------
-void MainFrame::closeComPort(void)
-{
-#ifdef _WIN32
-       CloseHandle(com_handle);
-#else
-       close(com_handle);
-#endif
-       com_handle = COM_HANDLE_INVALID;
-}
-
-//----------------------------------------------------------------
-// openComPort() opens the com port specified by the string
-// ie: "COM1" on Windows or "/dev/ttyu0" on FreeBSD
-//----------------------------------------------------------------
-bool MainFrame::openComPort(const char *name)
-{
-       if(com_handle != COM_HANDLE_INVALID)
-               closeComPort();
-#ifdef _WIN32
-       {
-               COMMCONFIG CC;
-               DWORD CCsize=sizeof(CC);
-               COMMTIMEOUTS timeouts;
-               DCB     dcb;
-
-               if(GetDefaultCommConfigA(name, &CC, &CCsize)) {
-                       CC.dcb.fOutxCtsFlow             = FALSE;
-                       CC.dcb.fOutxDsrFlow             = FALSE;
-                       CC.dcb.fDtrControl              = DTR_CONTROL_DISABLE;
-                       CC.dcb.fDsrSensitivity  = FALSE;
-                       CC.dcb.fRtsControl              = RTS_CONTROL_DISABLE;
-                       SetDefaultCommConfigA(name, &CC, CCsize);
-               }
-
-               if((com_handle=CreateFileA(name
-                       ,GENERIC_READ|GENERIC_WRITE     /* Access */
-                       ,0                                                              /* Share mode */
-                       ,NULL                                                   /* Security attributes */
-                       ,OPEN_EXISTING                                  /* Create access */
-                       ,FILE_ATTRIBUTE_NORMAL                  /* File attributes */
-                       ,NULL                                                   /* Template */
-                       ))==INVALID_HANDLE_VALUE)
-                       return false;
-
-               if(GetCommTimeouts(com_handle, &timeouts)) {
-                       timeouts.ReadIntervalTimeout=MAXDWORD;
-                       timeouts.ReadTotalTimeoutMultiplier=0;
-                       timeouts.ReadTotalTimeoutConstant=0;            // No-wait read timeout
-                       timeouts.WriteTotalTimeoutMultiplier=0;
-                       timeouts.WriteTotalTimeoutConstant=5000;        // 5 seconds
-                       SetCommTimeouts(com_handle,&timeouts);
-               }
-
-               /* Force N-8-1 mode: */
-               if(GetCommState(com_handle, &dcb)==TRUE) {
-                       dcb.ByteSize            = 8;
-                       dcb.Parity                      = NOPARITY;
-                       dcb.StopBits            = ONESTOPBIT;
-                       dcb.DCBlength           = sizeof(DCB);
-                       dcb.fBinary                     = TRUE;
-                       dcb.fOutxCtsFlow        = FALSE;
-                       dcb.fOutxDsrFlow        = FALSE;
-                       dcb.fDtrControl         = DTR_CONTROL_DISABLE;
-                       dcb.fDsrSensitivity     = FALSE;
-                       dcb.fTXContinueOnXoff= TRUE;
-                       dcb.fOutX                       = FALSE;
-                       dcb.fInX                        = FALSE;
-                       dcb.fRtsControl         = RTS_CONTROL_DISABLE;
-                       dcb.fAbortOnError       = FALSE;
-                       SetCommState(com_handle, &dcb);
-               }
-       }
-#else
-       {
-               struct termios t;
-
-               if((com_handle=open(name, O_NONBLOCK|O_RDWR))==COM_HANDLE_INVALID)
-                       return false;
-
-               if(tcgetattr(com_handle, &t)==-1) {
-                       close(com_handle);
-                       com_handle = COM_HANDLE_INVALID;
-                       return false;
-               }
-
-               t.c_iflag = (
-                                         IGNBRK   /* ignore BREAK condition */
-                                       | IGNPAR   /* ignore (discard) parity errors */
-                                       );
-               t.c_oflag = 0;  /* No output processing */
-               t.c_cflag = (
-                                         CS8         /* 8 bits */
-                                       | CREAD       /* enable receiver */
-               /*
-               Fun snippet from the FreeBSD manpage:
-
-                        If CREAD is set, the receiver is enabled.  Otherwise, no character is
-                        received.  Not all hardware supports this bit.  In fact, this flag is
-                        pretty silly and if it were not part of the termios specification it
-                        would be omitted.
-               */
-                                       | CLOCAL      /* ignore modem status lines */
-                                       );
-               t.c_lflag = 0;  /* No local modes */
-               if(tcsetattr(com_handle, TCSANOW, &t)==-1) {
-                       close(com_handle);
-                       com_handle = COM_HANDLE_INVALID;
-                       return false;
-               }
-               
-       }
-#endif
-       return true;
-}
-
-#ifdef _USE_ONIDLE
-void MainFrame::OnIdle(wxIdleEvent &evt) {
-}
-#endif
-
-//----------------------------------------------------------------
-// (raise|lower)(RTS|DTR)()
-//
-// Raises/lowers the specified signal
-//----------------------------------------------------------------
-void MainFrame::raiseDTR(void)
-{
-       if(com_handle == COM_HANDLE_INVALID)
-               return;
-#ifdef _WIN32
-       EscapeCommFunction(com_handle, SETDTR);
-#else
-       {       // For C89 happiness
-               int flags = TIOCM_DTR;
-               ioctl(com_handle, TIOCMBIS, &flags);
-       }
-#endif
-}
-void MainFrame::raiseRTS(void)
-{
-       if(com_handle == COM_HANDLE_INVALID)
-               return;
-#ifdef _WIN32
-       EscapeCommFunction(com_handle, SETRTS);
-#else
-       {       // For C89 happiness
-               int flags = TIOCM_RTS;
-               ioctl(com_handle, TIOCMBIS, &flags);
-       }
-#endif
-}
-void MainFrame::lowerDTR(void)
-{
-       if(com_handle == COM_HANDLE_INVALID)
-               return;
-#ifdef _WIN32
-       EscapeCommFunction(com_handle, CLRDTR);
-#else
-       {       // For C89 happiness
-               int flags = TIOCM_DTR;
-               ioctl(com_handle, TIOCMBIC, &flags);
-       }
-#endif
-}
-void MainFrame::lowerRTS(void)
-{
-       if(com_handle == COM_HANDLE_INVALID)
-               return;
-#ifdef _WIN32
-       EscapeCommFunction(com_handle, CLRRTS);
-#else
-       {       // For C89 happiness
-               int flags = TIOCM_RTS;
-               ioctl(com_handle, TIOCMBIC, &flags);
-       }
-#endif
-}
-
-
-#ifdef _USE_TIMER
-//----------------------------------------------------------------
-// OnTimer()
-//
-// when the timer fires every DT seconds we update the GUI displays.
-// the tabs only the plot that is visible actually gets updated, this
-// keeps CPU load reasonable
-//----------------------------------------------------------------
-void MainFrame::OnTimer(wxTimerEvent &evt)
-{
-
-    int r,c;
-
-    if (m_panelWaterfall->checkDT()) {
-        m_panelWaterfall->setRxFreq(FDMDV_FCENTRE - g_RxFreqOffsetHz);
-        m_panelWaterfall->m_newdata = true;
-        m_panelWaterfall->Refresh();
-    }
-
-    m_panelSpectrum->setRxFreq(FDMDV_FCENTRE - g_RxFreqOffsetHz);
-    m_panelSpectrum->m_newdata = true;
-    m_panelSpectrum->Refresh();
-
-    /* update scatter plot -----------------------------------------------------------------*/
-
-    for (r=0; r<g_stats.nr; r++) {
-        
-        if (g_pfreedv->mode == FREEDV_MODE_1600) {
-            m_panelScatter->add_new_samples(&g_stats.rx_symbols[r][0]);
-        }
-
-        if (g_pfreedv->mode == FREEDV_MODE_700) {
-
-            /* 
-               FreeDV 700 uses diversity, so combine symbols for
-               scatter plot, as combined symbols are used for
-               demodulation.  Note we need to use a copy of the
-               symbols, as we are not sure when the stats will be
-               updated.
-            */
-
-            COMP rx_symbols_copy[g_Nc/2];
-
-            for(c=0; c<g_Nc/2; c++)
-                rx_symbols_copy[c] = cadd(g_stats.rx_symbols[r][c], g_stats.rx_symbols[r][c+g_Nc/2]);
-            m_panelScatter->add_new_samples(rx_symbols_copy);
-        }
-       
-    }
-
-    m_panelScatter->Refresh();
-
-    // Oscilliscope type speech plots -------------------------------------------------------
-
-    short speechInPlotSamples[WAVEFORM_PLOT_BUF];
-    if (fifo_read(g_plotSpeechInFifo, speechInPlotSamples, WAVEFORM_PLOT_BUF)) {
-        memset(speechInPlotSamples, 0, WAVEFORM_PLOT_BUF*sizeof(short));
-        //fprintf(stderr, "empty!\n");
-    }
-    m_panelSpeechIn->add_new_short_samples(0, speechInPlotSamples, WAVEFORM_PLOT_BUF, 32767);
-    m_panelSpeechIn->Refresh();
-
-    short speechOutPlotSamples[WAVEFORM_PLOT_BUF];
-    if (fifo_read(g_plotSpeechOutFifo, speechOutPlotSamples, WAVEFORM_PLOT_BUF))
-        memset(speechOutPlotSamples, 0, WAVEFORM_PLOT_BUF*sizeof(short));
-    m_panelSpeechOut->add_new_short_samples(0, speechOutPlotSamples, WAVEFORM_PLOT_BUF, 32767);
-    m_panelSpeechOut->Refresh();
-
-    short demodInPlotSamples[WAVEFORM_PLOT_BUF];
-    if (fifo_read(g_plotDemodInFifo, demodInPlotSamples, WAVEFORM_PLOT_BUF)) {
-        memset(demodInPlotSamples, 0, WAVEFORM_PLOT_BUF*sizeof(short));
-    }
-    m_panelDemodIn->add_new_short_samples(0,demodInPlotSamples, WAVEFORM_PLOT_BUF, 32767);
-    m_panelDemodIn->Refresh();
-
-    // Demod states -----------------------------------------------------------------------
-
-    m_panelTimeOffset->add_new_sample(0, (float)g_stats.rx_timing/FDMDV_NOM_SAMPLES_PER_FRAME);
-    m_panelTimeOffset->Refresh();
-
-    m_panelFreqOffset->add_new_sample(0, g_stats.foff);
-    m_panelFreqOffset->Refresh();
-
-    // SNR text box and gauge ------------------------------------------------------------
-
-    // LP filter g_stats.snr_est some more to stabilise the
-    // display. g_stats.snr_est already has some low pass filtering
-    // but we need it fairly fast to activate squelch.  So we
-    // optionally perform some further filtering for the display
-    // version of SNR.  The "Slow" checkbox controls the amount of
-    // filtering.  The filtered snr also controls the squelch
-
-    g_snr = m_snrBeta*g_snr + (1.0 - m_snrBeta)*g_stats.snr_est;
-    float snr_limited = g_snr;
-    if (snr_limited < -5.0) snr_limited = -5.0;
-    if (snr_limited > 20.0) snr_limited = 20.0;
-
-    char snr[15];
-    sprintf(snr, "%d", (int)(g_snr+0.5)); // round to nearest dB
-
-    //printf("snr_est: %f m_snrBeta: %f g_snr: %f snr_limited: %f\n", g_stats.snr_est,  m_snrBeta, g_snr, snr_limited);
-
-    wxString snr_string(snr);
-    m_textSNR->SetLabel(snr_string);
-    m_gaugeSNR->SetValue((int)(snr_limited+5));
-
-    // Level Gauge -----------------------------------------------------------------------
-
-    float tooHighThresh;
-    if (!g_tx && m_RxRunning)
-    {
-        // receive mode - display From Radio peaks
-        // peak from this DT sampling period
-        int maxDemodIn = 0;
-        for(int i=0; i<WAVEFORM_PLOT_BUF; i++)
-            if (maxDemodIn < abs(demodInPlotSamples[i]))
-                maxDemodIn = abs(demodInPlotSamples[i]);
-
-        // peak from last second
-        if (maxDemodIn > m_maxLevel)
-            m_maxLevel = maxDemodIn;
-
-        tooHighThresh = FROM_RADIO_MAX;
-    }
-    else
-    {
-        // transmit mode - display From Mic peaks
-
-        // peak from this DT sampling period
-        int maxSpeechIn = 0;
-        for(int i=0; i<WAVEFORM_PLOT_BUF; i++)
-            if (maxSpeechIn < abs(speechInPlotSamples[i]))
-                maxSpeechIn = abs(speechInPlotSamples[i]);
-
-        // peak from last second
-        if (maxSpeechIn > m_maxLevel)
-            m_maxLevel = maxSpeechIn;
-
-       tooHighThresh = FROM_MIC_MAX;
-    }
-
-    // Peak Reading meter: updates peaks immediately, then slowly decays
-    int maxScaled = (int)(100.0 * ((float)m_maxLevel/32767.0));
-    m_gaugeLevel->SetValue(maxScaled);
-    //printf("maxScaled: %d\n", maxScaled);
-    if (((float)maxScaled/100) > tooHighThresh)
-        m_textLevel->SetLabel("Too High");
-    else
-        m_textLevel->SetLabel("");
-
-    m_maxLevel *= LEVEL_BETA;
-
-    // sync LED (Colours don't work on Windows) ------------------------
-
-    if (g_State) {
-        m_rbSync->SetForegroundColour( wxColour( 0, 255, 0 ) ); // green
-        m_rbSync->SetValue(true);
-    }
-    else {
-        m_rbSync->SetForegroundColour( wxColour( 255, 0, 0 ) ); // red
-        m_rbSync->SetValue(false);
-    }
-
-    // send Callsign ----------------------------------------------------
-
-    char callsign[MAX_CALLSIGN];
-    strncpy(callsign, (const char*) wxGetApp().m_callSign.mb_str(wxConvUTF8), MAX_CALLSIGN-1);
-
-    // buffer 1 txt message to ensure tx data fifo doesn't "run dry"
-
-    if ((unsigned)fifo_used(g_txDataInFifo) < strlen(callsign)) {
-        unsigned int  i;
-
-        //fprintf(g_logfile, "tx callsign: %s.\n", callsign);
-
-        /* optionally append checksum */
-
-        if (wxGetApp().m_enable_checksum) {
-
-            unsigned char checksum = 0;
-            char callsign_checksum_cr[MAX_CALLSIGN+1];
-
-            for(i=0; i<strlen(callsign); i++)
-                checksum += callsign[i];
-            sprintf(callsign_checksum_cr, "%s%2x", callsign, checksum);
-            callsign_checksum_cr[strlen(callsign)+2] = 13;
-            callsign_checksum_cr[strlen(callsign)+3] = 0;
-            strcpy(callsign, callsign_checksum_cr);
-        }
-        else {
-            callsign[strlen(callsign)] = 13;
-            callsign[strlen(callsign)+1] = 0;
-        }
-
-        //fprintf(g_logfile, "tx callsign: %s.\n", callsign);
-
-        // write chars to tx data fifo
-
-        for(i=0; i<strlen(callsign); i++) {
-            short ashort = (short)callsign[i];
-            fifo_write(g_txDataInFifo, &ashort, 1);
-        }
-    }
-
-    // See if any Callsign info received --------------------------------
-
-    short ashort;
-    while (fifo_read(g_rxDataOutFifo, &ashort, 1) == 0) {
-
-        if ((ashort == 13) || ((m_pcallsign - m_callsign) > MAX_CALLSIGN-1)) {
-            // CR completes line
-            *m_pcallsign = 0;
-            
-            /* Checksums can be disabled, e.g. for compatability with
-               older vesions.  In that case we print msg but don't do
-               any event processing.  If checksums enabled, only print
-               out when checksum is good. */
-
-            if (wxGetApp().m_enable_checksum) {
-                // lets see if checksum is OK
-            
-                unsigned char checksum_rx = 0;
-                if (strlen(m_callsign) > 2) {
-                    for(unsigned int i=0; i<strlen(m_callsign)-2; i++)
-                        checksum_rx += m_callsign[i];
-                }
-                unsigned int checksum_tx;
-                int ret = sscanf(&m_callsign[strlen(m_callsign)-2], "%2x", &checksum_tx);
-                //fprintf(g_logfile, "rx callsign: %s.\n  checksum tx: %02x checksum rx: %02x\n", m_callsign, checksum_tx, checksum_rx);
-
-                wxString s;
-                if (ret && (checksum_tx == checksum_rx)) {
-                    m_callsign[strlen(m_callsign)-2] = 0;
-                    s.Printf("%s", m_callsign);
-                    m_txtCtrlCallSign->SetValue(s);
-
-                    char s1[MAX_CALLSIGN];
-                    sprintf(s1,"rx_txtmsg %s", m_callsign);
-                    processTxtEvent(s1);
-
-                    m_checksumGood++;
-                    s.Printf("%d", m_checksumGood);
-                    m_txtChecksumGood->SetLabel(s);              
-                }
-                else {
-                    m_checksumBad++;
-                    s.Printf("%d", m_checksumBad);
-                    m_txtChecksumBad->SetLabel(s);        
-                }
-            }
-
-            //fprintf(g_logfile,"resetting callsign %s %ld\n", m_callsign, m_pcallsign-m_callsign);
-            // reset ptr to start of string
-            m_pcallsign = m_callsign;
-        }
-        else {
-            //fprintf(g_logfile, "new char %d %c\n", ashort, (char)ashort);
-            *m_pcallsign++ = (char)ashort;
-        }
-
-        /* If checksums disabled, display txt chars as they arrive */
-
-        if (!wxGetApp().m_enable_checksum) {
-            m_txtCtrlCallSign->SetValue(m_callsign);
-        }
-    }
-
-    // Run time update of EQ filters -----------------------------------
-    if (m_newMicInFilter || m_newSpkOutFilter) {
-        g_mutexProtectingCallbackData.Lock();
-        deleteEQFilters(g_rxUserdata);
-        designEQFilters(g_rxUserdata);
-        g_mutexProtectingCallbackData.Unlock();
-        m_newMicInFilter = m_newSpkOutFilter = false;
-    }
-    g_rxUserdata->micInEQEnable = wxGetApp().m_MicInEQEnable;
-    g_rxUserdata->spkOutEQEnable = wxGetApp().m_SpkOutEQEnable;
-
-    // Run time update of FreeDV 700 tx clipper
-
-    g_pfreedv->clip = (int)wxGetApp().m_FreeDV700txClip;
-
-    // Test Frame Bit Error Updates ------------------------------------
-
-    // Toggle test frame mode at run time
-
-    if (!g_pfreedv->test_frames && wxGetApp().m_testFrames) {
-
-        // reset stats on check box off to on transition
-
-        g_pfreedv->test_frames = 1;
-        g_pfreedv->test_frame_sync_state = 0;
-        g_pfreedv->total_bits = 0;
-        g_pfreedv->total_bit_errors = 0;
-    }
-    g_pfreedv->test_frames =  wxGetApp().m_testFrames;
-    g_channel_noise =  wxGetApp().m_channel_noise;
-
-    if (g_State) {
-        char bits[80], errors[80], ber[80];
-
-        // update stats on main page
-
-        sprintf(bits, "Bits: %d", (int)g_pfreedv->total_bits); wxString bits_string(bits); m_textBits->SetLabel(bits_string);
-        sprintf(errors, "Errs: %d", (int)g_pfreedv->total_bit_errors); wxString errors_string(errors); m_textErrors->SetLabel(errors_string);
-        float b = (float)g_pfreedv->total_bit_errors/(1E-6+g_pfreedv->total_bits);
-        sprintf(ber, "BER: %4.3f", b); wxString ber_string(ber); m_textBER->SetLabel(ber_string);
-
-        // update error plots
-
-        int sz_error_pattern = g_pfreedv->sz_error_pattern;
-        short error_pattern[sz_error_pattern];
-
-        if (fifo_read(g_error_pattern_fifo, error_pattern, sz_error_pattern) == 0) {
-            int i,b;
-
-            /* both modes map IQ to alternate bits, but one same carrier */
-
-            if (g_pfreedv->mode == FREEDV_MODE_1600) {
-                /* FreeDV 1600 mapping from error pattern to bit on each carrier */
-
-                for(b=0; b<g_Nc*2; b++) {
-                    for(i=b; i<sz_error_pattern; i+= 2*g_Nc) {
-                        m_panelTestFrameErrors->add_new_sample(b, b + 0.8*error_pattern[i]);
-                        g_error_hist[b] += error_pattern[i];
-                    }
-                    //if (b%2)
-                    //    printf("g_error_hist[%d]: %d\n", b/2, g_error_hist[b/2]);
-                }
-
-                int max_hist = 0;
-                for(b=0; b<g_Nc; b++)
-                    if (g_error_hist[b] > max_hist)
-                        max_hist = g_error_hist[b];
-
-                m_panelTestFrameErrorsHist->add_new_short_samples(0, g_error_hist, 2*FDMDV_NC_MAX, max_hist);
-            }
-       
-            if (g_pfreedv->mode == FREEDV_MODE_700) {
-                int c;
-
-                /* FreeDV 700 mapping from error pattern to bit on each
-                   carrier.  Note we don't have access to carriers before
-                   diversity re-combination, so this won't give us the full
-                   picture, we have to assume Nc/2 carriers. */
-
-                for(i=0; i<sz_error_pattern; i++) {
-                    c = i/4;
-                    m_panelTestFrameErrors->add_new_sample(c, c + 0.8*error_pattern[i]);
-                    g_error_hist[c] += error_pattern[i];
-                    //printf("i: %d c: %d\n", i, c);
-                }
-
-                int max_hist = 0;
-                for(b=0; b<g_Nc; b++)
-                    if (g_error_hist[b] > max_hist)
-                        max_hist = g_error_hist[b];
-                m_panelTestFrameErrorsHist->add_new_short_samples(0, g_error_hist, 2*FDMDV_NC_MAX, max_hist);                
-            }
-            m_panelTestFrameErrors->Refresh();       
-            m_panelTestFrameErrorsHist->Refresh();
-        }
-    }
-
-    // command from UDP thread that is best processed in main thread to avoid seg faults
-
-    if (m_schedule_restore) {
-        if (IsIconized())
-            Restore();
-        m_schedule_restore = false;
-    }
-
-    // Light Spam Timer LED if at least one timer is running
-
-    int i;
-    optionsDlg->SetSpamTimerLight(false);
-    for(i=0; i<MAX_EVENT_RULES; i++)
-        if (spamTimer[i].IsRunning())
-            optionsDlg->SetSpamTimerLight(true);        
-
-    // Blink file playback status line
-
-    if (g_playFileFromRadio) {
-        g_blink += DT;
-        //fprintf(g_logfile, "g_blink: %f\n", g_blink);
-        if ((g_blink >= 1.0) && (g_blink < 2.0))
-            SetStatusText(wxT("Playing into from radio"), 0);
-        if (g_blink >= 2.0) {
-            SetStatusText(wxT(""), 0);
-            g_blink = 0.0;
-        }
-    }
-
-}
-#endif
-
-
-//-------------------------------------------------------------------------
-// OnCloseFrame()
-//-------------------------------------------------------------------------
-void MainFrame::OnCloseFrame(wxCloseEvent& event)
-{
-    Pa_Terminate();
-    Destroy();
-}
-
-//-------------------------------------------------------------------------
-// OnTop()
-//-------------------------------------------------------------------------
-void MainFrame::OnTop(wxCommandEvent& event)
-{
-    int style = GetWindowStyle();
-
-    if (style & wxSTAY_ON_TOP)
-    {
-        style &= ~wxSTAY_ON_TOP;
-    }
-    else
-    {
-        style |= wxSTAY_ON_TOP;
-    }
-    SetWindowStyle(style);
-}
-
-//-------------------------------------------------------------------------
-// OnDeleteConfig()
-//-------------------------------------------------------------------------
-void MainFrame::OnDeleteConfig(wxCommandEvent&)
-{
-    wxConfigBase *pConfig = wxConfigBase::Get();
-    if(pConfig->DeleteAll())
-    {
-        wxLogMessage(wxT("Config file/registry key successfully deleted."));
-
-        delete wxConfigBase::Set(NULL);
-        wxConfigBase::DontCreateOnDemand();
-    }
-    else
-    {
-        wxLogError(wxT("Deleting config file/registry key failed."));
-    }
-}
-
-//-------------------------------------------------------------------------
-// Paint()
-//-------------------------------------------------------------------------
-void MainFrame::OnPaint(wxPaintEvent& WXUNUSED(event))
-{
-    wxPaintDC dc(this);
-
-    if(GetMenuBar()->IsChecked(ID_PAINT_BG))
-    {
-        dc.Clear();
-    }
-    dc.SetUserScale(m_zoom, m_zoom);
-}
-
-//-------------------------------------------------------------------------
-// OnCmdSliderScroll()
-//-------------------------------------------------------------------------
-void MainFrame::OnCmdSliderScroll(wxScrollEvent& event)
-{
-    char sqsnr[15];
-    g_SquelchLevel = (float)m_sliderSQ->GetValue()/2.0 - 5.0;   
-    sprintf(sqsnr, "%4.1f", g_SquelchLevel); // 0.5 dB steps
-    wxString sqsnr_string(sqsnr);
-    m_textSQ->SetLabel(sqsnr_string);
-
-    event.Skip();
-}
-
-//-------------------------------------------------------------------------
-// OnCheckSQClick()
-//-------------------------------------------------------------------------
-void MainFrame::OnCheckSQClick(wxCommandEvent& event)
-{
-    if(!g_SquelchActive)
-    {
-        g_SquelchActive = true;
-    }
-    else
-    {
-        g_SquelchActive = false;
-    }
-}
-
-void MainFrame::setsnrBeta(bool snrSlow)
-{
-    if(snrSlow)
-    {
-        m_snrBeta = 0.95; // make this closer to 1.0 to smooth SNR est further
-    }
-    else
-    {
-        m_snrBeta = 0.0; // no smoothing of SNR estimate from demodulator
-    }
-}
-
-//-------------------------------------------------------------------------
-// OnCheckSQClick()
-//-------------------------------------------------------------------------
-void MainFrame::OnCheckSNRClick(wxCommandEvent& event)
-{
-    wxGetApp().m_snrSlow = m_ckboxSNR->GetValue();
-    setsnrBeta(wxGetApp().m_snrSlow);
-    //printf("m_snrSlow: %d\n", (int)wxGetApp().m_snrSlow);
-}
-
-// check for space bar press (only when running)
-
-int MainApp::FilterEvent(wxEvent& event)
-{
-    if ((event.GetEventType() == wxEVT_KEY_DOWN) && 
-        (((wxKeyEvent&)event).GetKeyCode() == WXK_SPACE))
-        {
-            // only use space to toggle PTT if we are running and no modal dialogs (like options) up
-            //fprintf(stderr,"frame->m_RxRunning: %d g_modal: %d\n",
-            //        frame->m_RxRunning, g_modal);
-            if (frame->m_RxRunning && !g_modal) {
-                if (frame->m_btnTogPTT->GetValue())
-                    frame->m_btnTogPTT->SetValue(false);
-                else
-                    frame->m_btnTogPTT->SetValue(true);
-
-                frame->togglePTT();
-
-                return true; // absorb space so we don't toggle control with focus (e.g. Start)
-
-            }
-        }
-
-    return -1;
-}
-
-//-------------------------------------------------------------------------
-// OnTogBtnPTT ()
-//-------------------------------------------------------------------------
-void MainFrame::OnTogBtnPTT (wxCommandEvent& event)
-{
-    togglePTT();
-    event.Skip();
-}
-
-void MainFrame::togglePTT(void) {
-
-    // Change tabbed page in centre panel depending on PTT state
-
-    if (g_tx)
-    {
-        // tx-> rx transition, swap to the page we were on for last rx
-        m_auiNbookCtrl->ChangeSelection(wxGetApp().m_rxNbookCtrl);
-    }
-    else
-    {
-        // rx-> tx transition, swap to Mic In page to monitor speech
-        wxGetApp().m_rxNbookCtrl = m_auiNbookCtrl->GetSelection();
-        m_auiNbookCtrl->ChangeSelection(m_auiNbookCtrl->GetPageIndex((wxWindow *)m_panelSpeechIn));
-        char e[80]; sprintf(e,"ptt"); processTxtEvent(e);
-    }
-
-    g_tx = m_btnTogPTT->GetValue();
-
-    // Hamlib PTT
-
-    if (wxGetApp().m_boolHamlibUseForPTT) {        
-        Hamlib *hamlib = wxGetApp().m_hamlib; 
-        if (wxGetApp().m_boolHamlibUseForPTT && hamlib != NULL) {
-            hamlib->ptt(g_tx);
-        }
-    }
-
-    // Serial PTT
-
-    /*  Truth table:
-
-          g_tx   RTSPos   RTS
-          -------------------
-          0      1        0
-          1      1        1
-          0      0        1
-          1      0        0
-
-          exclusive NOR
-    */
-
-    if(wxGetApp().m_boolUseSerialPTT && (com_handle != COM_HANDLE_INVALID)) {
-        if (wxGetApp().m_boolUseRTS) {
-            printf("g_tx: %d m_boolRTSPos: %d serialLine: %d\n", g_tx, wxGetApp().m_boolRTSPos, g_tx == wxGetApp().m_boolRTSPos);
-            if (g_tx == wxGetApp().m_boolRTSPos)
-                raiseRTS();
-            else
-                lowerRTS();
-        }
-        if (wxGetApp().m_boolUseDTR) {
-            printf("g_tx: %d m_boolDTRPos: %d serialLine: %d\n", g_tx, wxGetApp().m_boolDTRPos, g_tx == wxGetApp().m_boolDTRPos);
-            if (g_tx == wxGetApp().m_boolDTRPos)
-                raiseDTR();
-            else
-                lowerDTR();
-        }
-    }
-
-    // reset level gauge
-
-    m_maxLevel = 0;
-    m_textLevel->SetLabel(wxT(""));
-    m_gaugeLevel->SetValue(0);
-}
-
-//-------------------------------------------------------------------------
-// OnTogBtnRxID()
-//-------------------------------------------------------------------------
-void MainFrame::OnTogBtnRxID(wxCommandEvent& event)
-{
-    // empty any junk in rx data FIFO
-    short junk;
-    while(fifo_read(g_rxDataOutFifo,&junk,1) == 0);
-    event.Skip();
-}
-
-//-------------------------------------------------------------------------
-// OnTogBtnTxID()
-//-------------------------------------------------------------------------
-void MainFrame::OnTogBtnTxID(wxCommandEvent& event)
-{
-    event.Skip();
-}
-
-void MainFrame::OnTogBtnSplitClick(wxCommandEvent& event) {
-    if (g_split)
-        g_split = 0;
-    else
-        g_split = 1;
-    event.Skip();
-}
-
-//-------------------------------------------------------------------------
-// OnTogBtnAnalogClick()
-//-------------------------------------------------------------------------
-void MainFrame::OnTogBtnAnalogClick (wxCommandEvent& event)
-{
-    if (g_analog == 0) {
-        g_analog = 1;
-        m_panelSpectrum->setFreqScale(MODEM_STATS_NSPEC*((float)MAX_F_HZ/(FS/2)));
-        m_panelWaterfall->setFs(FS);
-    }
-    else {
-        g_analog = 0;
-        m_panelSpectrum->setFreqScale(MODEM_STATS_NSPEC*((float)MAX_F_HZ/(g_pfreedv->modem_sample_rate/2)));
-        m_panelWaterfall->setFs(g_pfreedv->modem_sample_rate);
-    }
-
-    g_State = 0;
-    g_stats.snr_est = 0;
-
-    event.Skip();
-}
-
-void MainFrame::OnCallSignReset(wxCommandEvent& event)
-{
-    m_pcallsign = m_callsign;
-    memset(m_callsign, 0, MAX_CALLSIGN);
-    wxString s;
-    s.Printf("%s", m_callsign);
-    m_txtCtrlCallSign->SetValue(s);
-    m_checksumGood = m_checksumBad = 0;
-    m_txtChecksumGood->SetLabel(_("0"));
-    m_txtChecksumBad->SetLabel(_("0"));
-}
-
-void MainFrame::OnBerReset(wxCommandEvent& event)
-{
-    g_pfreedv->total_bits = 0;
-    g_pfreedv->total_bit_errors = 0;
-    int i;
-    for(i=0; i<2*g_Nc; i++)
-        g_error_hist[i] = 0;
-    
-}
-
-#ifdef ALC
-//-------------------------------------------------------------------------
-// OnTogBtnALCClick()
-//-------------------------------------------------------------------------
-void MainFrame::OnTogBtnALCClick(wxCommandEvent& event)
-{
-    wxMessageBox(wxT("Got Click!"), wxT("OnTogBtnALCClick"), wxOK);
-
-    event.Skip();
-}
-#endif
-
-// extra panel added to file open dialog to add loop checkbox
-MyExtraPlayFilePanel::MyExtraPlayFilePanel(wxWindow *parent): wxPanel(parent)
-{
-    m_cb = new wxCheckBox(this, -1, wxT("Loop"));
-    m_cb->SetToolTip(_("When checked file will repeat forever"));
-    m_cb->SetValue(g_loopPlayFileToMicIn);
-
-    // bug: I can't this to align right.....
-    wxBoxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
-    sizerTop->Add(m_cb, 0, wxALIGN_RIGHT, 0);
-    SetSizerAndFit(sizerTop);
-}
-
-static wxWindow* createMyExtraPlayFilePanel(wxWindow *parent)
-{
-    return new MyExtraPlayFilePanel(parent);
-}
-
-//-------------------------------------------------------------------------
-// OnPlayFileToMicIn()
-//-------------------------------------------------------------------------
-void MainFrame::OnPlayFileToMicIn(wxCommandEvent& event)
-{
-    wxUnusedVar(event);
-
-    if(g_playFileToMicIn)
-    {
-        g_mutexProtectingCallbackData.Lock();
-        g_playFileToMicIn = false;
-        sf_close(g_sfPlayFile);
-        SetStatusText(wxT(""));
-        g_mutexProtectingCallbackData.Unlock();
-    }
-    else
-    {
-        wxString    soundFile;
-        SF_INFO     sfInfo;
-
-        wxFileDialog openFileDialog(
-                                    this,
-                                    wxT("Play File to Mic In"),
-                                    wxGetApp().m_playFileToMicInPath,
-                                    wxEmptyString,
-                                    wxT("WAV and RAW files (*.wav;*.raw)|*.wav;*.raw|")
-                                    wxT("All files (*.*)|*.*"),
-                                    wxFD_OPEN | wxFD_FILE_MUST_EXIST
-                                    );
-
-        // add the loop check box
-        openFileDialog.SetExtraControlCreator(&createMyExtraPlayFilePanel);
-
-        if(openFileDialog.ShowModal() == wxID_CANCEL)
-        {
-            return;     // the user changed their mind...
-        }
-
-        wxString fileName, extension;
-        soundFile = openFileDialog.GetPath();
-        wxFileName::SplitPath(soundFile, &wxGetApp().m_playFileToMicInPath, &fileName, &extension);
-        //wxLogDebug("m_playFileToMicInPath: %s", wxGetApp().m_playFileToMicInPath);
-        sfInfo.format = 0;
-
-        if(!extension.IsEmpty())
-        {
-            extension.LowerCase();
-            if(extension == wxT("raw"))
-            {
-                sfInfo.format     = SF_FORMAT_RAW | SF_FORMAT_PCM_16;
-                sfInfo.channels   = 1;
-                sfInfo.samplerate = FS;
-            }
-        }
-        g_sfPlayFile = sf_open(soundFile, SFM_READ, &sfInfo);
-        if(g_sfPlayFile == NULL)
-        {
-            wxString strErr = sf_strerror(NULL);
-            wxMessageBox(strErr, wxT("Couldn't open sound file"), wxOK);
-            return;
-        }
-
-        wxWindow * const ctrl = openFileDialog.GetExtraControl();
-
-        // Huh?! I just copied wxWidgets-2.9.4/samples/dialogs ....
-        g_loopPlayFileToMicIn = static_cast<MyExtraPlayFilePanel*>(ctrl)->getLoopPlayFileToMicIn();
-
-        SetStatusText(wxT("Playing File: ") + fileName + wxT(" to Mic Input") , 0);
-        g_playFileToMicIn = true;
-    }
-}
-
-//-------------------------------------------------------------------------
-// OnPlayFileFromRadio()
-// This puppy "plays" a recorded file into the demodulator input, allowing us
-// to replay off air signals.
-//-------------------------------------------------------------------------
-void MainFrame::OnPlayFileFromRadio(wxCommandEvent& event)
-{
-    wxUnusedVar(event);
-
-    printf("OnPlayFileFromRadio:: %d\n", (int)g_playFileFromRadio);
-    if (g_playFileFromRadio)
-    {
-        printf("OnPlayFileFromRadio:: Stop\n");
-        g_mutexProtectingCallbackData.Lock();
-        g_playFileFromRadio = false;
-        sf_close(g_sfPlayFileFromRadio);
-        SetStatusText(wxT(""),0);
-        SetStatusText(wxT(""),1);
-        g_mutexProtectingCallbackData.Unlock();
-    }
-    else
-    {
-        wxString    soundFile;
-        SF_INFO     sfInfo;
-
-        wxFileDialog openFileDialog(
-                                    this,
-                                    wxT("Play File - From Radio"),
-                                    wxGetApp().m_playFileFromRadioPath,
-                                    wxEmptyString,
-                                    wxT("WAV and RAW files (*.wav;*.raw)|*.wav;*.raw|")
-                                    wxT("All files (*.*)|*.*"),
-                                    wxFD_OPEN | wxFD_FILE_MUST_EXIST
-                                    );
-
-        // add the loop check box
-        openFileDialog.SetExtraControlCreator(&createMyExtraPlayFilePanel);
-
-        if(openFileDialog.ShowModal() == wxID_CANCEL)
-        {
-            return;     // the user changed their mind...
-        }
-
-        wxString fileName, extension;
-        soundFile = openFileDialog.GetPath();
-        wxFileName::SplitPath(soundFile, &wxGetApp().m_playFileFromRadioPath, &fileName, &extension);
-        //wxLogDebug("m_playFileToFromRadioPath: %s", wxGetApp().m_playFileFromRadioPath);
-        sfInfo.format = 0;
-
-        if(!extension.IsEmpty())
-        {
-            extension.LowerCase();
-            if(extension == wxT("raw"))
-            {
-                sfInfo.format     = SF_FORMAT_RAW | SF_FORMAT_PCM_16;
-                sfInfo.channels   = 1;
-                sfInfo.samplerate = g_pfreedv->modem_sample_rate;
-            }
-        }
-        g_sfPlayFileFromRadio = sf_open(soundFile, SFM_READ, &sfInfo);
-        g_sfFs = sfInfo.samplerate;
-        if(g_sfPlayFileFromRadio == NULL)
-        {
-            wxString strErr = sf_strerror(NULL);
-            wxMessageBox(strErr, wxT("Couldn't open sound file"), wxOK);
-            return;
-        }
-
-        wxWindow * const ctrl = openFileDialog.GetExtraControl();
-
-        // Huh?! I just copied wxWidgets-2.9.4/samples/dialogs ....
-        g_loopPlayFileFromRadio = static_cast<MyExtraPlayFilePanel*>(ctrl)->getLoopPlayFileToMicIn();
-
-        SetStatusText(wxT("Playing into from radio"), 0);
-        if(extension == wxT("raw")) {
-            wxString stringnumber = wxString::Format(wxT("%d"), (int)sfInfo.samplerate);
-            SetStatusText(wxT("raw file assuming Fs=") + stringnumber, 1);          
-        }
-        fprintf(g_logfile, "OnPlayFileFromRadio:: Playing File\n");
-        g_playFileFromRadio = true;
-        g_blink = 0.0;
-    }
-}
-
-// extra panel added to file save dialog to set number of seconds to record for
-
-MyExtraRecFilePanel::MyExtraRecFilePanel(wxWindow *parent): wxPanel(parent)
-{
-    wxBoxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
-
-    wxStaticText* staticText = new wxStaticText(this, wxID_ANY, _("Seconds:"), wxDefaultPosition, wxDefaultSize, 0);
-    sizerTop->Add(staticText, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
-    m_secondsToRecord = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
-    m_secondsToRecord->SetToolTip(_("Number of seconds to record for"));
-    m_secondsToRecord->SetValue(wxString::Format(wxT("%i"), wxGetApp().m_recFileFromRadioSecs));
-    sizerTop->Add(m_secondsToRecord, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
-    SetSizerAndFit(sizerTop);
-}
-
-static wxWindow* createMyExtraRecFilePanel(wxWindow *parent)
-{
-    return new MyExtraRecFilePanel(parent);
-}
-
-//-------------------------------------------------------------------------
-// OnRecFileFromRadio()
-//-------------------------------------------------------------------------
-void MainFrame::OnRecFileFromRadio(wxCommandEvent& event)
-{
-    wxUnusedVar(event);
-
-    if (g_recFileFromRadio) {
-        printf("Stopping Record....\n");
-        g_mutexProtectingCallbackData.Lock();
-        g_recFileFromRadio = false;
-        sf_close(g_sfRecFile);
-        SetStatusText(wxT(""));
-        g_mutexProtectingCallbackData.Unlock();
-    }
-    else {
-
-        wxString    soundFile;
-        SF_INFO     sfInfo;
-
-         wxFileDialog openFileDialog(
-                                    this,
-                                    wxT("Record File From Radio"),
-                                    wxGetApp().m_recFileFromRadioPath,
-                                    wxEmptyString,
-                                    wxT("WAV and RAW files (*.wav;*.raw)|*.wav;*.raw|")
-                                    wxT("All files (*.*)|*.*"),
-                                    wxFD_SAVE
-                                    );
-
-        // add the loop check box
-        openFileDialog.SetExtraControlCreator(&createMyExtraRecFilePanel);
-
-        if(openFileDialog.ShowModal() == wxID_CANCEL)
-        {
-            return;     // the user changed their mind...
-        }
-
-        wxString fileName, extension;
-        soundFile = openFileDialog.GetPath();
-        wxFileName::SplitPath(soundFile, &wxGetApp().m_recFileFromRadioPath, &fileName, &extension);
-        wxLogDebug("m_recFileFromRadioPath: %s", wxGetApp().m_recFileFromRadioPath);
-        wxLogDebug("soundFile: %s", soundFile);
-        sfInfo.format = 0;
-
-        if(!extension.IsEmpty())
-        {
-            extension.LowerCase();
-            if(extension == wxT("raw"))
-            {
-                sfInfo.format     = SF_FORMAT_RAW | SF_FORMAT_PCM_16;
-                sfInfo.channels   = 1;
-                sfInfo.samplerate = g_pfreedv->modem_sample_rate;
-            }
-            else if(extension == wxT("wav"))
-            {
-                sfInfo.format     = SF_FORMAT_WAV | SF_FORMAT_PCM_16;
-                sfInfo.channels   = 1;
-                sfInfo.samplerate = g_pfreedv->modem_sample_rate;
-            } else {
-                wxMessageBox(wxT("Invalid file format"), wxT("Record File From Radio"), wxOK);
-                return;
-            }
-        }
-        else {
-            wxMessageBox(wxT("Invalid file format"), wxT("Record File From Radio"), wxOK);
-            return;
-        }
-
-        // Bug: on Win32 I cant read m_recFileFromRadioSecs, so have hard coded it
-#ifdef __WIN32__
-        long secs = wxGetApp().m_recFileFromRadioSecs;
-        g_recFromRadioSamples = FS*(unsigned int)secs;
-#else
-        // work out number of samples to record
-
-        wxWindow * const ctrl = openFileDialog.GetExtraControl();
-        wxString secsString = static_cast<MyExtraRecFilePanel*>(ctrl)->getSecondsToRecord();
-        wxLogDebug("test: %s secsString: %s\n", wxT("testing 123"), secsString);
-
-        long secs;
-        if (secsString.ToLong(&secs)) {
-            wxGetApp().m_recFileFromRadioSecs = (unsigned int)secs;
-            //printf(" secondsToRecord: %d\n",  (unsigned int)secs);
-            g_recFromRadioSamples = FS*(unsigned int)secs;
-            //printf("g_recFromRadioSamples: %d\n", g_recFromRadioSamples);
-        }
-        else {
-            wxMessageBox(wxT("Invalid number of Seconds"), wxT("Record File From Radio"), wxOK);
-            return;
-        }
-#endif
-
-        g_sfRecFile = sf_open(soundFile, SFM_WRITE, &sfInfo);
-        if(g_sfRecFile == NULL)
-        {
-            wxString strErr = sf_strerror(NULL);
-            wxMessageBox(strErr, wxT("Couldn't open sound file"), wxOK);
-            return;
-        }
-
-        SetStatusText(wxT("Recording File: ") + fileName + wxT(" From Radio") , 0);
-        g_recFileFromRadio = true;
-    }
-
-}
-
-//-------------------------------------------------------------------------
-// OnExit()
-//-------------------------------------------------------------------------
-void MainFrame::OnExit(wxCommandEvent& event)
-{
-    wxUnusedVar(event);
-#ifdef _USE_TIMER
-    m_plotTimer.Stop();
-#endif // _USE_TIMER
-    if(g_sfPlayFile != NULL)
-    {
-        sf_close(g_sfPlayFile);
-        g_sfPlayFile = NULL;
-    }
-    if(g_sfRecFile != NULL)
-    {
-        sf_close(g_sfRecFile);
-        g_sfRecFile = NULL;
-    }
-    if(m_RxRunning)
-    {
-        stopRxStream();
-    }
-    m_togBtnSplit->Disable();
-    //m_togRxID->Disable();
-    //m_togTxID->Disable();
-    m_togBtnAnalog->Disable();
-    //m_togBtnALC->Disable();
-    //m_btnTogPTT->Disable();
-    Pa_Terminate();
-    Destroy();
-}
-
-//-------------------------------------------------------------------------
-// OnExitClick()
-//-------------------------------------------------------------------------
-void MainFrame::OnExitClick(wxCommandEvent& event)
-{
-    OnExit(event);
-}
-
-//-------------------------------------------------------------------------
-// OnToolsAudio()
-//-------------------------------------------------------------------------
-void MainFrame::OnToolsAudio(wxCommandEvent& event)
-{
-    wxUnusedVar(event);
-    int rv = 0;
-    AudioOptsDialog *dlg = new AudioOptsDialog(NULL);
-    rv = dlg->ShowModal();
-    if(rv == wxID_OK)
-    {
-        dlg->ExchangeData(EXCHANGE_DATA_OUT);
-    }
-    delete dlg;
-}
-
-//-------------------------------------------------------------------------
-// OnToolsAudioUI()
-//-------------------------------------------------------------------------
-void MainFrame::OnToolsAudioUI(wxUpdateUIEvent& event)
-{
-    event.Enable(!m_RxRunning);
-}
-
-//-------------------------------------------------------------------------
-// OnToolsFilter()
-//-------------------------------------------------------------------------
-void MainFrame::OnToolsFilter(wxCommandEvent& event)
-{
-    wxUnusedVar(event);
-    FilterDlg *dlg = new FilterDlg(NULL, m_RxRunning, &m_newMicInFilter, &m_newSpkOutFilter);
-    dlg->ShowModal();
-    delete dlg;
-}
-
-//-------------------------------------------------------------------------
-// OnToolsOptions()
-//-------------------------------------------------------------------------
-void MainFrame::OnToolsOptions(wxCommandEvent& event)
-{
-    wxUnusedVar(event);
-    g_modal = true;
-    //fprintf(stderr,"g_modal: %d\n", g_modal);
-    optionsDlg->Show();
-}
-
-//-------------------------------------------------------------------------
-// OnToolsOptionsUI()
-//-------------------------------------------------------------------------
-void MainFrame::OnToolsOptionsUI(wxUpdateUIEvent& event)
-{
-}
-
-//-------------------------------------------------------------------------
-// OnToolsComCfg()
-//-------------------------------------------------------------------------
-void MainFrame::OnToolsComCfg(wxCommandEvent& event)
-{
-    wxUnusedVar(event);
-
-    ComPortsDlg *dlg = new ComPortsDlg(NULL);
-
-    int rv = dlg->ShowModal();
-
-    // test Hamlib/Serial set up
-
-    if(rv == wxID_OK)
-    {
-        if (wxGetApp().m_boolHamlibUseForPTT) {
-            OpenHamlibRig();
-            wxGetApp().m_hamlib->close();
-        }
-        if (wxGetApp().m_boolUseSerialPTT) {
-            SetupSerialPort();
-            CloseSerialPort();
-        }
-    }
-
-    delete dlg;
-}
-
-//-------------------------------------------------------------------------
-// OnToolsComCfgUI()
-//-------------------------------------------------------------------------
-void MainFrame::OnToolsComCfgUI(wxUpdateUIEvent& event)
-{
-    event.Enable(!m_RxRunning);
-}
-
-//-------------------------------------------------------------------------
-// OnHelpCheckUpdates()
-//-------------------------------------------------------------------------
-void MainFrame::OnHelpCheckUpdates(wxCommandEvent& event)
-{
-    wxMessageBox("Got Click!", "OnHelpCheckUpdates", wxOK);
-    event.Skip();
-}
-
-//-------------------------------------------------------------------------
-// OnHelpCheckUpdatesUI()
-//-------------------------------------------------------------------------
-void MainFrame::OnHelpCheckUpdatesUI(wxUpdateUIEvent& event)
-{
-    event.Enable(false);
-}
-
-//-------------------------------------------------------------------------
-//OnHelpAbout()
-//-------------------------------------------------------------------------
-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
-    wxURL url(wxT("http://svn.code.sf.net/p/freetel/code/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("<h2>p/freetel/code - Revision ");
-            int startIndex = htmldata.find(s) + s.Length();
-            int endIndex = htmldata.find(wxT(": /fdmdv2</h2>"));
-            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("How much have you spent on Ham gear this year?  How did it compare to FreeDV? ")
-                wxT("FreeDV repesents an open and free future for digital voice over Ham Radio. ")
-                wxT("Please help by donating just $10 here: 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);
-
-#endif // _USE_ABOUT_DIALOG
-#ifdef USE_SIMPLE_ABOUT_DIALOG
-    wxUnusedVar(event);
-    wxAboutDialogInfo info;
-    info.SetCopyright(_("HAMLib Test"));
-    info.SetLicence(_("GPL v2 or later"));
-    info.SetDescription(_("Short description goes here"));
-    ::wxAboutBox(info);
-#endif // USE_SIMPLE_ABOUT_DIALOG
-
-}
-
-
-// Attempt to talk to rig using Hamlib
-
-bool MainFrame::OpenHamlibRig() {
-    if (wxGetApp().m_boolHamlibUseForPTT != true)
-       return false;
-    if (wxGetApp().m_intHamlibRig == 0)
-        return false;
-    if (wxGetApp().m_hamlib == NULL)
-        return false;
-
-    int rig = wxGetApp().m_intHamlibRig;
-    wxString port = wxGetApp().m_strHamlibSerialPort;
-    bool status = wxGetApp().m_hamlib->connect(rig, port.mb_str(wxConvUTF8));
-    if (status == false)
-        wxMessageBox("Couldn't connect to Radio with hamlib", wxT("About"), wxOK | wxICON_ERROR, this);
-    return status;
-} 
-
-//-------------------------------------------------------------------------
-// OnTogBtnOnOff()
-//-------------------------------------------------------------------------
-void MainFrame::OnTogBtnOnOff(wxCommandEvent& event)
-{
-    wxString startStop = m_togBtnOnOff->GetLabel();
-
-    // we are attempting to start
-
-    if (startStop.IsSameAs("Start"))
-    {
-        //
-        // Start Running -------------------------------------------------
-        //
-
-        // modify some button states when running
-
-        m_togBtnSplit->Enable();
-        m_togBtnAnalog->Enable();
-        m_togBtnOnOff->SetLabel(wxT("Stop"));
-        m_btnTogPTT->Enable();
-
-        m_rb1600->Disable();
-        m_rb700->Disable();
-
-        // determine what mode we are using
-
-        if (m_rb1600->GetValue()) {
-            g_mode = FREEDV_MODE_1600;
-            g_Nc = 16;
-            m_panelScatter->setNc(g_Nc);
-        }
-        if (m_rb700->GetValue()) {
-            g_mode = FREEDV_MODE_700;
-            g_Nc = 14;
-            m_panelScatter->setNc(g_Nc/2-1);  /* due to diversity, -1 due to no pilot like FreeDV 1600 */
-        }
-   
-        // init freedv states
-
-        g_pfreedv = freedv_open(g_mode);
-        g_pfreedv->callback_state = NULL;
-        g_pfreedv->freedv_get_next_tx_char = &my_get_next_tx_char;
-        g_pfreedv->freedv_put_next_rx_char = &my_put_next_rx_char;
-
-        g_pfreedv->error_pattern_callback_state = (void*)m_panelTestFrameErrors;
-        g_pfreedv->freedv_put_error_pattern = &my_freedv_put_error_pattern;
-        g_error_pattern_fifo = fifo_create(2*g_pfreedv->sz_error_pattern);
-        g_error_hist = new short[FDMDV_NC_MAX*2];
-        int i;
-        for(i=0; i<2*FDMDV_NC_MAX; i++)
-            g_error_hist[i] = 0;
-
-        //if (g_mode == FREEDV_MODE_700)
-        //    cohpsk_set_verbose(g_pfreedv->cohpsk, 1);
-
-        //cohpsk_set_verbose(g_pfreedv->cohpsk, 1);
-        assert(g_pfreedv != NULL);
-        modem_stats_open(&g_stats);
-
-        // Init Speex pre-processor states
-        // by inspecting Speex source it seems that only denoiser is on be default
-
-        g_speex_st = speex_preprocess_state_init(g_pfreedv->n_speech_samples, FS); 
-
-        // adjust spectrum and waterfall freq scaling base on mode
-
-        m_panelSpectrum->setFreqScale(MODEM_STATS_NSPEC*((float)MAX_F_HZ/(g_pfreedv->modem_sample_rate/2)));
-        m_panelWaterfall->setFs(g_pfreedv->modem_sample_rate);
-
-        // adjust scatter diagram for Number of FDM carriers
-
-        // init Codec 2 LPC Post Filter
-
-        codec2_set_lpc_post_filter(g_pfreedv->codec2,
-                                   wxGetApp().m_codec2LPCPostFilterEnable,
-                                   wxGetApp().m_codec2LPCPostFilterBassBoost,
-                                   wxGetApp().m_codec2LPCPostFilterBeta,
-                                   wxGetApp().m_codec2LPCPostFilterGamma);
-
-        g_State = 0;
-        g_snr = 0.0;
-        g_half_duplex = wxGetApp().m_boolHalfDuplex;
-
-        m_pcallsign = m_callsign;
-        memset(m_callsign, 0, sizeof(m_callsign));
-        m_checksumGood = m_checksumBad = 0;
-        wxString s;
-        s.Printf("%d", m_checksumGood);
-        m_txtChecksumGood->SetLabel(s);              
-        s.Printf("%d", m_checksumBad);
-        m_txtChecksumBad->SetLabel(s);        
-
-        m_maxLevel = 0;
-        m_textLevel->SetLabel(wxT(""));
-        m_gaugeLevel->SetValue(0);
-
-        // Init text msg decoding
-
-        varicode_set_code_num(&g_pfreedv->varicode_dec_states, wxGetApp().m_textEncoding);
-        //printf("m_textEncoding = %d\n", wxGetApp().m_textEncoding);
-        //printf("g_stats.snr: %f\n", g_stats.snr_est);
-
-        // attempt to start PTT ......
-        
-        if (wxGetApp().m_boolHamlibUseForPTT)
-            OpenHamlibRig();
-        if (wxGetApp().m_boolUseSerialPTT) {
-            SetupSerialPort();
-        }
-
-        // attempt to start sound cards and tx/rx processing
-
-        startRxStream();
-
-        if (m_RxRunning)
-        {
-#ifdef _USE_TIMER
-            m_plotTimer.Start(_REFRESH_TIMER_PERIOD, wxTIMER_CONTINUOUS);
-#endif // _USE_TIMER
-        }
-        char e[80]; sprintf(e,"start"); processTxtEvent(e);
-    }
-
-    // Stop was pressed or start up failed
-
-    if (startStop.IsSameAs("Stop") || !m_RxRunning ) {
-
-        //
-        // Stop Running -------------------------------------------------
-        //
-
-        optionsDlg->SetSpamTimerLight(false);
-
-#ifdef _USE_TIMER
-        m_plotTimer.Stop();
-#endif // _USE_TIMER
-
-        // ensure we are not transmitting and shut down audio processing
-
-        if (wxGetApp().m_boolHamlibUseForPTT) {
-            Hamlib *hamlib = wxGetApp().m_hamlib; 
-            if (wxGetApp().m_boolHamlibUseForPTT && hamlib != NULL) {
-                hamlib->ptt(false);
-                hamlib->close();
-            }
-        }
-
-        if (wxGetApp().m_boolUseSerialPTT)
-            CloseSerialPort();
-
-        m_btnTogPTT->SetValue(false);
-
-        stopRxStream();
-
-        // free up states
-
-        modem_stats_close(&g_stats);
-        delete g_error_hist;
-        fifo_destroy(g_error_pattern_fifo);
-        freedv_close(g_pfreedv);
-        speex_preprocess_state_destroy(g_speex_st);
-        m_newMicInFilter = m_newSpkOutFilter = true;
-
-        m_togBtnSplit->Disable();
-        //m_togRxID->Disable();
-        //m_togTxID->Disable();
-        m_togBtnAnalog->Disable();
-        m_btnTogPTT->Disable();
-        m_togBtnOnOff->SetLabel(wxT("Start"));
-        m_rb1600->Enable();
-        m_rb700->Enable();
-#ifdef DISABLED_FEATURE
-        m_rb1400old->Enable();
-        m_rb1600Wide->Enable();
-        m_rb1400->Enable();
-        m_rb2000->Enable();
-#endif
-        char e[80]; sprintf(e,"stop"); processTxtEvent(e);
-    }
-}
-
-//-------------------------------------------------------------------------
-// stopRxStream()
-//-------------------------------------------------------------------------
-void MainFrame::stopRxStream()
-{
-    if(m_RxRunning)
-    {
-        m_RxRunning = false;
-
-        fprintf(g_logfile, "waiting for thread to stop");
-        m_txRxThread->m_run = 0;
-        m_txRxThread->Wait();
-        fprintf(g_logfile, "thread stopped");
-
-        m_rxInPa->stop();
-        m_rxInPa->streamClose();
-        delete m_rxInPa;
-        if(m_rxOutPa != m_rxInPa) {
-                       m_rxOutPa->stop();
-                       m_rxOutPa->streamClose();
-                       delete m_rxOutPa;
-               }
-
-        if (g_nSoundCards == 2) {
-            m_txInPa->stop();
-            m_txInPa->streamClose();
-            delete m_txInPa;
-            if(m_txInPa != m_txOutPa) {
-                               m_txOutPa->stop();
-                               m_txOutPa->streamClose();
-                               delete m_txOutPa;
-                       }
-        }
-
-        destroy_fifos();
-        destroy_src();
-        deleteEQFilters(g_rxUserdata);
-        delete g_rxUserdata;
-    }
-}
-
-void MainFrame::destroy_fifos(void)
-{
-    fifo_destroy(g_rxUserdata->infifo1);
-    fifo_destroy(g_rxUserdata->outfifo1);
-    fifo_destroy(g_rxUserdata->infifo2);
-    fifo_destroy(g_rxUserdata->outfifo2);
-    fifo_destroy(g_rxUserdata->rxinfifo);
-    fifo_destroy(g_rxUserdata->rxoutfifo);
-}
-
-void MainFrame::destroy_src(void)
-{
-    src_delete(g_rxUserdata->insrc1);
-    src_delete(g_rxUserdata->outsrc1);
-    src_delete(g_rxUserdata->insrc2);
-    src_delete(g_rxUserdata->outsrc2);
-    src_delete(g_rxUserdata->insrcsf);
-}
-
-void  MainFrame::initPortAudioDevice(PortAudioWrap *pa, int inDevice, int outDevice,
-                                     int soundCard, int sampleRate, int inputChannels)
-{
-    // Note all of the wrapper functions below just set values in a
-    // portaudio struct so can't return any errors. So no need to trap
-    // any errors in this function.
-
-    // init input params
-
-    pa->setInputDevice(inDevice);
-    if(inDevice != paNoDevice) {
-        pa->setInputChannelCount(inputChannels);           // stereo input
-        pa->setInputSampleFormat(PA_SAMPLE_TYPE);
-        pa->setInputLatency(pa->getInputDefaultLowLatency());
-        pa->setInputHostApiStreamInfo(NULL);
-    }
-
-    pa->setOutputDevice(paNoDevice);
-    
-    // init output params
-    
-    pa->setOutputDevice(outDevice);
-    if(outDevice != paNoDevice) {
-        pa->setOutputChannelCount(2);                      // stereo output
-        pa->setOutputSampleFormat(PA_SAMPLE_TYPE);
-        pa->setOutputLatency(pa->getOutputDefaultLowLatency());
-        pa->setOutputHostApiStreamInfo(NULL);
-    }
-
-    // init params that affect input and output
-
-    /*
-      On Linux, setting this to wxGetApp().m_framesPerBuffer caused
-      intermittant break up on the audio from my IC7200 on Ubuntu 14.
-      After a day of bug hunting I found that 0, as recommended by the
-      PortAudio docunmentation, fixed the problem.
-    */
-
-    //pa->setFramesPerBuffer(wxGetApp().m_framesPerBuffer);
-    pa->setFramesPerBuffer(0);
-
-    pa->setSampleRate(sampleRate);
-    pa->setStreamFlags(paClipOff);
-}
-
-//-------------------------------------------------------------------------
-// startRxStream()
-//-------------------------------------------------------------------------
-void MainFrame::startRxStream()
-{
-    int   src_error;
-    const PaDeviceInfo *deviceInfo1 = NULL, *deviceInfo2 = NULL;
-    int   inputChannels1, inputChannels2;
-    bool  two_rx=false;
-    bool  two_tx=false;
-
-    if(!m_RxRunning) {
-        m_RxRunning = true;
-
-        if(Pa_Initialize())
-        {
-            wxMessageBox(wxT("Port Audio failed to initialize"), wxT("Pa_Initialize"), wxOK);
-        }
-
-        m_rxInPa = new PortAudioWrap();
-        if(g_soundCard1InDeviceNum != g_soundCard1OutDeviceNum)
-            two_rx=true;
-        if(g_soundCard2InDeviceNum != g_soundCard2OutDeviceNum)
-            two_tx=true;
-        
-        fprintf(g_logfile, "two_rx: %d two_tx: %d\n", two_rx, two_tx);
-        if(two_rx)
-            m_rxOutPa = new PortAudioWrap();
-        else
-            m_rxOutPa = m_rxInPa;
-
-        if (g_nSoundCards == 0) {
-            wxMessageBox(wxT("No Sound Cards configured, use Tools - Audio Config to configure"), wxT("Error"), wxOK);
-            delete m_rxInPa;
-            if(two_rx)
-                delete m_rxOutPa;
-            m_RxRunning = false;
-            return;
-        }
-
-        // Init Sound card 1 ----------------------------------------------
-        // sanity check on sound card device numbers
-
-        if ((m_rxInPa->getDeviceCount() <= g_soundCard1InDeviceNum) ||
-            (m_rxOutPa->getDeviceCount() <= g_soundCard1OutDeviceNum)) {
-            wxMessageBox(wxT("Sound Card 1 not present"), wxT("Error"), wxOK);
-            delete m_rxInPa;
-            if(two_rx)
-                               delete m_rxOutPa;
-            m_RxRunning = false;
-            return;
-        }
-
-        // work out how many input channels this device supports.
-
-        deviceInfo1 = Pa_GetDeviceInfo(g_soundCard1InDeviceNum);
-        if (deviceInfo1 == NULL) {
-            wxMessageBox(wxT("Couldn't get device info from Port Audio for Sound Card 1"), wxT("Error"), wxOK);
-            delete m_rxInPa;
-            if(two_rx)
-                               delete m_rxOutPa;
-            m_RxRunning = false;
-            return;
-        }
-        if (deviceInfo1->maxInputChannels == 1)
-            inputChannels1 = 1;
-        else
-            inputChannels1 = 2;
-
-        if(two_rx) {
-            initPortAudioDevice(m_rxInPa, g_soundCard1InDeviceNum, paNoDevice, 1,
-                            g_soundCard1SampleRate, inputChannels1);
-            initPortAudioDevice(m_rxOutPa, paNoDevice, g_soundCard1OutDeviceNum, 1,
-                            g_soundCard1SampleRate, inputChannels1);
-               }
-        else
-            initPortAudioDevice(m_rxInPa, g_soundCard1InDeviceNum, g_soundCard1OutDeviceNum, 1,
-                            g_soundCard1SampleRate, inputChannels1);
-
-        // Init Sound Card 2 ------------------------------------------------
-
-        if (g_nSoundCards == 2) {
-
-            m_txInPa = new PortAudioWrap();
-            if(two_tx)
-                m_txOutPa = new PortAudioWrap();
-            else
-                m_txOutPa = m_txInPa;
-
-            // sanity check on sound card device numbers
-
-            //printf("m_txInPa->getDeviceCount(): %d\n", m_txInPa->getDeviceCount());
-            //printf("g_soundCard2InDeviceNum: %d\n", g_soundCard2InDeviceNum);
-            //printf("g_soundCard2OutDeviceNum: %d\n", g_soundCard2OutDeviceNum);
-
-            if ((m_txInPa->getDeviceCount() <= g_soundCard2InDeviceNum) ||
-                (m_txOutPa->getDeviceCount() <= g_soundCard2OutDeviceNum)) {
-                wxMessageBox(wxT("Sound Card 2 not present"), wxT("Error"), wxOK);
-                delete m_rxInPa;
-                if(two_rx)
-                    delete m_rxOutPa;
-                delete m_txInPa;
-                if(two_tx)
-                    delete m_txOutPa;
-                m_RxRunning = false;
-                return;
-            }
-
-            deviceInfo2 = Pa_GetDeviceInfo(g_soundCard2InDeviceNum);
-            if (deviceInfo2 == NULL) {
-                wxMessageBox(wxT("Couldn't get device info from Port Audio for Sound Card 1"), wxT("Error"), wxOK);
-                delete m_rxInPa;
-                if(two_rx)
-                                       delete m_rxOutPa;
-                delete m_txInPa;
-                if(two_tx)
-                                       delete m_txOutPa;
-                m_RxRunning = false;
-                return;
-            }
-            if (deviceInfo2->maxInputChannels == 1)
-                inputChannels2 = 1;
-            else
-                inputChannels2 = 2;
-
-            if(two_tx) {
-                               initPortAudioDevice(m_txInPa, g_soundCard2InDeviceNum, paNoDevice, 2,
-                                g_soundCard2SampleRate, inputChannels2);
-                               initPortAudioDevice(m_txOutPa, paNoDevice, g_soundCard2OutDeviceNum, 2,
-                                g_soundCard2SampleRate, inputChannels2);
-                       }
-                       else
-                               initPortAudioDevice(m_txInPa, g_soundCard2InDeviceNum, g_soundCard2OutDeviceNum, 2,
-                                g_soundCard2SampleRate, inputChannels2);
-        }
-
-        // Init call back data structure ----------------------------------------------
-
-        g_rxUserdata = new paCallBackData;
-        g_rxUserdata->inputChannels1 = inputChannels1;
-        if (deviceInfo2 != NULL)
-            g_rxUserdata->inputChannels2 = inputChannels2;
-
-        // init sample rate conversion states
-
-        g_rxUserdata->insrc1 = src_new(SRC_SINC_FASTEST, 1, &src_error);
-        assert(g_rxUserdata->insrc1 != NULL);
-        g_rxUserdata->outsrc1 = src_new(SRC_SINC_FASTEST, 1, &src_error);
-        assert(g_rxUserdata->outsrc1 != NULL);
-        g_rxUserdata->insrc2 = src_new(SRC_SINC_FASTEST, 1, &src_error);
-        assert(g_rxUserdata->insrc2 != NULL);
-        g_rxUserdata->outsrc2 = src_new(SRC_SINC_FASTEST, 1, &src_error);
-        assert(g_rxUserdata->outsrc2 != NULL);
-
-        g_rxUserdata->insrcsf = src_new(SRC_SINC_FASTEST, 1, &src_error);
-        assert(g_rxUserdata->insrcsf != NULL);
-
-        // create FIFOs used to interface between different buffer sizes
-
-        g_rxUserdata->infifo1 = fifo_create(8*N48);
-        g_rxUserdata->outfifo1 = fifo_create(10*N48);
-        g_rxUserdata->outfifo2 = fifo_create(8*N48);
-        g_rxUserdata->infifo2 = fifo_create(8*N48);
-        printf("N48: %d\n", N48);
-
-        g_rxUserdata->rxinfifo = fifo_create(3 * g_pfreedv->n_speech_samples);
-        g_rxUserdata->rxoutfifo = fifo_create(2 * g_pfreedv->n_speech_samples);
-
-        // Init Equaliser Filters ------------------------------------------------------
-
-        m_newMicInFilter = m_newSpkOutFilter = true;
-        designEQFilters(g_rxUserdata);
-        g_rxUserdata->micInEQEnable = wxGetApp().m_MicInEQEnable;
-        g_rxUserdata->spkOutEQEnable = wxGetApp().m_SpkOutEQEnable;
-
-        // optional tone in left channel to reliably trigger vox
-        
-        g_rxUserdata->leftChannelVoxTone = wxGetApp().m_leftChannelVoxTone;
-        g_rxUserdata->voxTonePhase = 0;
-
-        // Start sound card 1 ----------------------------------------------------------
-
-        m_rxInPa->setUserData(g_rxUserdata);
-        m_rxErr = m_rxInPa->setCallback(rxCallback);
-
-        m_rxErr = m_rxInPa->streamOpen();
-
-        if(m_rxErr != paNoError) {
-            wxMessageBox(wxT("Sound Card 1 Open/Setup error."), wxT("Error"), wxOK);
-                       delete m_rxInPa;
-                       if(two_rx)
-                               delete m_rxOutPa;
-                       delete m_txInPa;
-                       if(two_tx)
-                               delete m_txOutPa;
-            destroy_fifos();
-            destroy_src();
-            deleteEQFilters(g_rxUserdata);
-            delete g_rxUserdata;
-            m_RxRunning = false;
-            return;
-        }
-
-        m_rxErr = m_rxInPa->streamStart();
-        if(m_rxErr != paNoError) {
-            wxMessageBox(wxT("Sound Card 1 Stream Start Error."), wxT("Error"), wxOK);
-                       delete m_rxInPa;
-                       if(two_rx)
-                               delete m_rxOutPa;
-                       delete m_txInPa;
-                       if(two_tx)
-                               delete m_txOutPa;
-            destroy_fifos();
-            destroy_src();
-            deleteEQFilters(g_rxUserdata);
-            delete g_rxUserdata;
-            m_RxRunning = false;
-            return;
-        }
-
-        // Start separate output stream if needed
-
-        if(two_rx) {
-            m_rxOutPa->setUserData(g_rxUserdata);
-            m_rxErr = m_rxOutPa->setCallback(rxCallback);
-
-            m_rxErr = m_rxOutPa->streamOpen();
-
-            if(m_rxErr != paNoError) {
-                wxMessageBox(wxT("Sound Card 1 Second Stream Open/Setup error."), wxT("Error"), wxOK);
-                delete m_rxInPa;
-                delete m_rxOutPa;
-                delete m_txOutPa;
-                if(two_tx)
-                    delete m_txOutPa;
-                destroy_fifos();
-                destroy_src();
-                deleteEQFilters(g_rxUserdata);
-                delete g_rxUserdata;
-                m_RxRunning = false;
-                return;
-            }
-
-            m_rxErr = m_rxOutPa->streamStart();
-            if(m_rxErr != paNoError) {
-                wxMessageBox(wxT("Sound Card 1 Second Stream Start Error."), wxT("Error"), wxOK);
-                m_rxInPa->stop();
-                m_rxInPa->streamClose();
-                delete m_rxInPa;
-                delete m_rxOutPa;
-                delete m_txOutPa;
-                if(two_tx)
-                    delete m_txOutPa;
-                destroy_fifos();
-                destroy_src();
-                deleteEQFilters(g_rxUserdata);
-                delete g_rxUserdata;
-                m_RxRunning = false;
-                return;
-            }
-        }
-
-        // Start sound card 2 ----------------------------------------------------------
-
-        if (g_nSoundCards == 2) {
-
-            // question: can we use same callback data
-            // (g_rxUserdata)or both sound card callbacks?  Is there a
-            // chance of them both being called at the same time?  We
-            // could need a mutex ...
-
-            m_txInPa->setUserData(g_rxUserdata);
-            m_txErr = m_txInPa->setCallback(txCallback);
-            m_txErr = m_txInPa->streamOpen();
-
-            if(m_txErr != paNoError) {
-                fprintf(stderr, "Err: %d\n", m_txErr);
-                wxMessageBox(wxT("Sound Card 2 Open/Setup error."), wxT("Error"), wxOK);
-                m_rxInPa->stop();
-                m_rxInPa->streamClose();
-                delete m_rxInPa;
-                if(two_rx) {
-                    m_rxOutPa->stop();
-                    m_rxOutPa->streamClose();
-                    delete m_rxOutPa;
-                }
-                delete m_txInPa;
-                if(two_tx)
-                    delete m_txOutPa;
-                destroy_fifos();
-                destroy_src();
-                deleteEQFilters(g_rxUserdata);
-                delete g_rxUserdata;
-                m_RxRunning = false;
-                return;
-            }
-            m_txErr = m_txInPa->streamStart();
-            if(m_txErr != paNoError) {
-                wxMessageBox(wxT("Sound Card 2 Start Error."), wxT("Error"), wxOK);
-                m_rxInPa->stop();
-                m_rxInPa->streamClose();
-                delete m_rxInPa;
-                if(two_rx) {
-                    m_rxOutPa->stop();
-                    m_rxOutPa->streamClose();
-                    delete m_rxOutPa;
-                }
-                delete m_txInPa;
-                if(two_tx)
-                    delete m_txOutPa;
-                destroy_fifos();
-                destroy_src();
-                deleteEQFilters(g_rxUserdata);
-                delete g_rxUserdata;
-                m_RxRunning = false;
-                return;
-            }
-
-            // Start separate output stream if needed
-
-            if (two_tx) {
-
-                // question: can we use same callback data
-                // (g_rxUserdata)or both sound card callbacks?  Is there a
-                // chance of them both being called at the same time?  We
-                // could need a mutex ...
-
-                m_txOutPa->setUserData(g_rxUserdata);
-                m_txErr = m_txOutPa->setCallback(txCallback);
-                m_txErr = m_txOutPa->streamOpen();
-
-                if(m_txErr != paNoError) {
-                    wxMessageBox(wxT("Sound Card 2 Second Stream Open/Setup error."), wxT("Error"), wxOK);
-                    m_rxInPa->stop();
-                    m_rxInPa->streamClose();
-                    delete m_rxInPa;
-                    if(two_rx) {
-                        m_rxOutPa->stop();
-                        m_rxOutPa->streamClose();
-                        delete m_rxOutPa;
-                    }
-                    m_txInPa->stop();
-                    m_txInPa->streamClose();
-                    delete m_txInPa;
-                    delete m_txOutPa;
-                    destroy_fifos();
-                    destroy_src();
-                    deleteEQFilters(g_rxUserdata);
-                    delete g_rxUserdata;
-                    m_RxRunning = false;
-                    return;
-                }
-                m_txErr = m_txOutPa->streamStart();
-                if(m_txErr != paNoError) {
-                    wxMessageBox(wxT("Sound Card 2 Second Stream Start Error."), wxT("Error"), wxOK);
-                    m_rxInPa->stop();
-                    m_rxInPa->streamClose();
-                    m_txInPa->stop();
-                    m_txInPa->streamClose();
-                    delete m_txInPa;
-                    if(two_rx) {
-                        m_rxOutPa->stop();
-                        m_rxOutPa->streamClose();
-                        delete m_rxOutPa;
-                    }
-                    delete m_txInPa;
-                    delete m_txOutPa;
-                    destroy_fifos();
-                    destroy_src();
-                    deleteEQFilters(g_rxUserdata);
-                    delete g_rxUserdata;
-                    m_RxRunning = false;
-                    return;
-                }
-            }
-        }
-
-        // start tx/rx processing thread
-
-        m_txRxThread = new txRxThread;
-
-        if ( m_txRxThread->Create() != wxTHREAD_NO_ERROR )
-        {
-            wxLogError(wxT("Can't create thread!"));
-        }
-
-        m_txRxThread->SetPriority(WXTHREAD_MAX_PRIORITY);
-
-        if ( m_txRxThread->Run() != wxTHREAD_NO_ERROR )
-        {
-            wxLogError(wxT("Can't start thread!"));
-        }
-
-    }
-}
-
-
-void MainFrame::processTxtEvent(char event[]) {
-    int rule = 0;
-
-    //printf("processTxtEvent:\n");
-    //printf("  event: %s\n", event);
-
-    // process with regexp and issue system command
-
-    // Each regexp in our list is separated by a newline.  We want to try all of them.
-
-    wxString event_str(event);
-    int match_end, replace_end;
-    match_end = replace_end = 0;
-    wxString regexp_match_list = wxGetApp().m_events_regexp_match;
-    wxString regexp_replace_list = wxGetApp().m_events_regexp_replace;
-
-    bool found_match = false;
-
-    while (((match_end = regexp_match_list.Find('\n')) != wxNOT_FOUND) && (rule < MAX_EVENT_RULES)) {
-        //printf("match_end: %d\n", match_end);
-        if ((replace_end = regexp_replace_list.Find('\n')) != wxNOT_FOUND) {
-            //printf("replace_end = %d\n", replace_end);
-
-            // candidate match and replace regexps strings exist, so lets try them
-
-            wxString regexp_match = regexp_match_list.SubString(0, match_end-1);
-            wxString regexp_replace = regexp_replace_list.SubString(0, replace_end-1);
-            //printf("match: %s replace: %s\n", (const char *)regexp_match.c_str(), (const char *)regexp_replace.c_str());
-            wxRegEx re(regexp_match);
-            //printf("  checking for match against: %s\n", (const char *)regexp_match.c_str());
-
-            // if we found a match, lets run the replace regexp and issue the system command
-
-            wxString event_str_rep = event_str;
-
-            if (re.Replace(&event_str_rep, regexp_replace) != 0) {
-                //printf("  found match!\n");
-                found_match = true;
-
-                bool enableSystem = false;
-                if (wxGetApp().m_events)
-                    enableSystem = true;
-
-                // no syscall if spam timer still running
-
-                if (spamTimer[rule].IsRunning()) {
-                    enableSystem = false;
-                    //printf("  spam timer running\n");
-                }
-
-                const char *event_out = event_str_rep.ToUTF8();
-                wxString event_out_with_return_code;
-
-                if (enableSystem) {
-                    int ret = wxExecute(event_str_rep);
-                    event_out_with_return_code.Printf(_T("%s -> returned %d"), event_out, ret);
-                    spamTimer[rule].Start((wxGetApp().m_events_spam_timer)*1000, wxTIMER_ONE_SHOT);
-                }
-                else
-                    event_out_with_return_code.Printf(_T("%s T: %d"), event_out, spamTimer[rule].IsRunning());
-
-                // update event log GUI if currently displayed
-                
-                if (optionsDlg != NULL) {                  
-                    optionsDlg->updateEventLog(wxString(event), event_out_with_return_code);                     
-                }
-            }
-        }
-        regexp_match_list = regexp_match_list.SubString(match_end+1, regexp_match_list.length());
-        regexp_replace_list = regexp_replace_list.SubString(replace_end+1, regexp_replace_list.length());
-
-        rule++;
-    }
-    if ((optionsDlg != NULL) && !found_match) {                  
-        optionsDlg->updateEventLog(wxString(event), _("<no match>"));                     
-    }
-}
-
-
-#define SBQ_MAX_ARGS 4
-
-void *MainFrame::designAnEQFilter(const char filterType[], float freqHz, float gaindB, float Q)
-{
-    char  *arg[SBQ_MAX_ARGS];
-    char   argstorage[SBQ_MAX_ARGS][80];
-    void  *sbq;
-    int    i, argc;
-
-    assert((strcmp(filterType, "bass") == 0)   ||
-           (strcmp(filterType, "treble") == 0) ||
-           (strcmp(filterType, "equalizer") == 0));
-
-    for(i=0; i<SBQ_MAX_ARGS; i++) {
-        arg[i] = &argstorage[i][0];
-        arg[i] = &argstorage[i][0];
-        arg[i] = &argstorage[i][0];
-    }
-
-    argc = 0;
-
-    if ((strcmp(filterType, "bass") == 0) || (strcmp(filterType, "treble") == 0)) {
-        sprintf(arg[argc++], "%s", filterType);
-        sprintf(arg[argc++], "%f", gaindB+1E-6);
-        sprintf(arg[argc++], "%f", freqHz);
-    }
-
-    if (strcmp(filterType, "equalizer") == 0) {
-        sprintf(arg[argc++], "%s", filterType);
-        sprintf(arg[argc++], "%f", freqHz);
-        sprintf(arg[argc++], "%f", Q);
-        sprintf(arg[argc++], "%f", gaindB+1E-6);
-    }
-
-    assert(argc <= SBQ_MAX_ARGS);
-
-    sbq = sox_biquad_create(argc-1, (const char **)arg);
-
-    return sbq;
-}
-
-void  MainFrame::designEQFilters(paCallBackData *cb)
-{
-    // init Mic In Equaliser Filters
-
-    if (m_newMicInFilter) {
-        //printf("designing new Min In filters\n");
-        cb->sbqMicInBass   = designAnEQFilter("bass", wxGetApp().m_MicInBassFreqHz, wxGetApp().m_MicInBassGaindB);
-        cb->sbqMicInTreble = designAnEQFilter("treble", wxGetApp().m_MicInTrebleFreqHz, wxGetApp().m_MicInTrebleGaindB);
-        cb->sbqMicInMid    = designAnEQFilter("equalizer", wxGetApp().m_MicInMidFreqHz, wxGetApp().m_MicInMidGaindB, wxGetApp().m_MicInMidQ);
-    }
-
-    // init Spk Out Equaliser Filters
-
-    if (m_newSpkOutFilter) {
-        //printf("designing new Spk Out filters\n");
-        //printf("designEQFilters: wxGetApp().m_SpkOutBassFreqHz: %f\n",wxGetApp().m_SpkOutBassFreqHz);
-        cb->sbqSpkOutBass   = designAnEQFilter("bass", wxGetApp().m_SpkOutBassFreqHz, wxGetApp().m_SpkOutBassGaindB);
-        cb->sbqSpkOutTreble = designAnEQFilter("treble", wxGetApp().m_SpkOutTrebleFreqHz, wxGetApp().m_SpkOutTrebleGaindB);
-        cb->sbqSpkOutMid    = designAnEQFilter("equalizer", wxGetApp().m_SpkOutMidFreqHz, wxGetApp().m_SpkOutMidGaindB, wxGetApp().m_SpkOutMidQ);
-    }
-}
-
-void  MainFrame::deleteEQFilters(paCallBackData *cb)
-{
-    if (m_newMicInFilter) {
-        sox_biquad_destroy(cb->sbqMicInBass);
-        sox_biquad_destroy(cb->sbqMicInTreble);
-        sox_biquad_destroy(cb->sbqMicInMid);
-    }
-    if (m_newSpkOutFilter) {
-        sox_biquad_destroy(cb->sbqSpkOutBass);
-        sox_biquad_destroy(cb->sbqSpkOutTreble);
-        sox_biquad_destroy(cb->sbqSpkOutMid);
-    }
-}
-
-// returns number of output samples generated by resampling
-int resample(SRC_STATE *src,
-            short      output_short[],
-            short      input_short[],
-            int        output_sample_rate,
-            int        input_sample_rate,
-            int        length_output_short, // maximum output array length in samples
-            int        length_input_short
-            )
-{
-    SRC_DATA src_data;
-    float    input[N48*4];
-    float    output[N48*4];
-    int      ret;
-
-    assert(src != NULL);
-    assert(length_input_short <= N48*4);
-    assert(length_output_short <= N48*4);
-
-    src_short_to_float_array(input_short, input, length_input_short);
-
-    src_data.data_in = input;
-    src_data.data_out = output;
-    src_data.input_frames = length_input_short;
-    src_data.output_frames = length_output_short;
-    src_data.end_of_input = 0;
-    src_data.src_ratio = (float)output_sample_rate/input_sample_rate;
-
-    ret = src_process(src, &src_data);
-    assert(ret == 0);
-
-    assert(src_data.output_frames_gen <= length_output_short);
-    src_float_to_short_array(output, output_short, src_data.output_frames_gen);
-
-    return src_data.output_frames_gen;
-}
-
-
-// Decimates samples using an algorithm that produces nice plots of
-// speech signals at a low sample rate.  We want a low sample rate so
-// we don't hammer the graphics system too hard.  Saves decimated data
-// to a fifo for plotting on screen.
-void resample_for_plot(struct FIFO *plotFifo, short buf[], int length, int fs)
-{
-    int decimation = fs/WAVEFORM_PLOT_FS;
-    int nSamples, sample;
-    int i, st, en, max, min;
-    short dec_samples[length];
-
-    nSamples = length/decimation;
-
-    for(sample = 0; sample < nSamples; sample += 2)
-    {
-        st = decimation*sample;
-        en = decimation*(sample+2);
-        max = min = 0;
-        for(i=st; i<en; i++ )
-        {
-            if (max < buf[i]) max = buf[i];
-            if (min > buf[i]) min = buf[i];
-        }
-        dec_samples[sample] = max;
-        dec_samples[sample+1] = min;
-    }
-    fifo_write(plotFifo, dec_samples, nSamples);
-}
-
-void txRxProcessing()
-{
-
-    paCallBackData  *cbData = g_rxUserdata;
-
-    // Buffers re-used by tx and rx processing
-    // signals in in48k/out48k are at a maximum sample rate of 48k, could be 44.1kHz
-    // depending on sound hardware.
-
-    short           in8k_short[4*N8];
-    short           in48k_short[4*N48];
-    short           out8k_short[4*N8];
-    short           out48k_short[4*N48];
-    int             nout, samplerate, n_samples;
-
-    //fprintf(g_logfile, "start infifo1: %5d outfifo2: %5d\n", fifo_used(cbData->infifo1), fifo_used(cbData->outfifo2));
-
-    // FreeDV 700 uses a modem sample rate of 7500 Hz which requires some special treatment
-
-    if (g_analog) 
-        samplerate = FS;
-    else
-        samplerate = g_pfreedv->modem_sample_rate;
-
-    //
-    //  RX side processing --------------------------------------------
-    //
-
-    // while we have enough input samples available ...
-
-    int nsam = g_soundCard1SampleRate * (float)N8/FS;
-    assert(nsam <= N48);
-    g_mutexProtectingCallbackData.Lock();
-    while ((fifo_read(cbData->infifo1, in48k_short, nsam) == 0) && ((g_half_duplex && !g_tx) || !g_half_duplex)) 
-    {
-        g_mutexProtectingCallbackData.Unlock();
-        unsigned int n8k;
-
-        n8k = resample(cbData->insrc1, in8k_short, in48k_short, samplerate, g_soundCard1SampleRate, N8, nsam);
-        assert(n8k <= N8);
-
-        // optionally save "from radio" signal (write demod input to file)
-        // Really useful for testing and development as it allows us
-        // to repeat tests using off air signals
-
-        g_mutexProtectingCallbackData.Lock();
-        if (g_recFileFromRadio && (g_sfRecFile != NULL)) {
-            //printf("g_recFromRadioSamples: %d  n8k: %d \n", g_recFromRadioSamples);
-            if (g_recFromRadioSamples < n8k) {
-                sf_write_short(g_sfRecFile, in8k_short, g_recFromRadioSamples);
-                wxCommandEvent event( wxEVT_COMMAND_MENU_SELECTED, g_recFileFromRadioEventId );
-                // call stop/start record menu item, should be thread safe
-                g_parent->GetEventHandler()->AddPendingEvent( event );
-                g_recFromRadioSamples = 0;
-                //printf("finished recording g_recFromRadioSamples: %d n8k: %d!\n", g_recFileFromRadio, n8k);
-            }
-            else {
-                sf_write_short(g_sfRecFile, in8k_short, n8k);
-                g_recFromRadioSamples -= n8k;
-            }
-        }
-        g_mutexProtectingCallbackData.Unlock();
-
-        // optionally read "from radio" signal from file (read demod input from file)
-
-        g_mutexProtectingCallbackData.Lock();
-        if (g_playFileFromRadio && (g_sfPlayFileFromRadio != NULL)) {
-            unsigned int nsf = n8k*g_sfFs/samplerate;
-            short        insf_short[nsf];
-            unsigned int n = sf_read_short(g_sfPlayFileFromRadio, insf_short, nsf);
-            n8k = resample(cbData->insrcsf, in8k_short, insf_short, samplerate, g_sfFs, N8, nsf);
-            //fprintf(g_logfile, "n: %d nsnf: %d n8k: %d\n", n, nsf, n8k);
-            assert(n8k <= N8);
-
-            if (n == 0) {
-                if (g_loopPlayFileFromRadio)
-                    sf_seek(g_sfPlayFileFromRadio, 0, SEEK_SET);
-                else {
-                    printf("playFileFromRadio finished, issuing event!\n");
-                    wxCommandEvent event( wxEVT_COMMAND_MENU_SELECTED, g_playFileFromRadioEventId );
-                    // call stop/start play menu item, should be thread safe
-                    g_parent->GetEventHandler()->AddPendingEvent( event );
-                }
-            }
-        }
-        g_mutexProtectingCallbackData.Unlock();
-
-        resample_for_plot(g_plotDemodInFifo, in8k_short, n8k, samplerate);
-
-        // send latest squelch level to FreeDV API, as it handles squelch internally
-
-        g_pfreedv->squelch_en = g_SquelchActive;
-        g_pfreedv->snr_squelch_thresh = g_SquelchLevel;
-        //fprintf(g_logfile, "snr_squelch_thresh: %f\n",  g_pfreedv->snr_squelch_thresh);
-
-        // Get some audio to send to headphones/speaker.  If in analog
-        // mode we pass thru the "from radio" audio to the
-        // headphones/speaker.
-
-        if (g_analog) {
-            memcpy(out8k_short, in8k_short, sizeof(short)*n8k);
-            
-            // compute rx spectrum 
-
-            COMP  rx_fdm[n8k];
-            float rx_spec[MODEM_STATS_NSPEC];
-            unsigned int   i;
-
-            for(i=0; i<n8k; i++) {
-                rx_fdm[i].real = in8k_short[i];
-                rx_fdm[i].imag = 0.0;
-            }            
-            modem_stats_get_rx_spectrum(&g_stats, rx_spec, rx_fdm, n8k);
-
-            // Average rx spectrum data using a simple IIR low pass filter
-
-            for(i = 0; i<MODEM_STATS_NSPEC; i++) {
-                g_avmag[i] = BETA * g_avmag[i] + (1.0 - BETA) * rx_spec[i];
-            }
-        }
-        else {
-            fifo_write(cbData->rxinfifo, in8k_short, n8k);
-            per_frame_rx_processing(cbData->rxoutfifo, cbData->rxinfifo);
-            memset(out8k_short, 0, sizeof(short)*N8);
-            fifo_read(cbData->rxoutfifo, out8k_short, N8);
-        }
-
-
-        // Optional Spk Out EQ Filtering, need mutex as filter can change at run time
-        g_mutexProtectingCallbackData.Lock();
-        if (cbData->spkOutEQEnable) {
-            sox_biquad_filter(cbData->sbqSpkOutBass,   out8k_short, out8k_short, N8);
-            sox_biquad_filter(cbData->sbqSpkOutTreble, out8k_short, out8k_short, N8);
-            sox_biquad_filter(cbData->sbqSpkOutMid,    out8k_short, out8k_short, N8);
-        }
-        g_mutexProtectingCallbackData.Unlock();
-
-        resample_for_plot(g_plotSpeechOutFifo, out8k_short, N8, FS);
-
-        g_mutexProtectingCallbackData.Lock();
-        if (g_nSoundCards == 1) {
-            nout = resample(cbData->outsrc2, out48k_short, out8k_short, g_soundCard1SampleRate, FS, N48, N8);
-            fifo_write(cbData->outfifo1, out48k_short, nout);
-        }
-        else {
-            nout = resample(cbData->outsrc2, out48k_short, out8k_short, g_soundCard2SampleRate, FS, N48, N8);
-            fifo_write(cbData->outfifo2, out48k_short, nout);
-        }
-    }
-    g_mutexProtectingCallbackData.Unlock();
-
-    //
-    //  TX side processing --------------------------------------------
-    //
-
-    if ((g_nSoundCards == 2) && ((g_half_duplex && g_tx) || !g_half_duplex)) {
-        int ret;
-
-        // Make sure we have q few frames of modulator output
-        // samples.  This also locks the modulator to the sample rate
-        // of sound card 1.  We want to make sure that modulator
-        // samples are uninterrupted by differences in sample rate
-        // between this sound card and sound card 2.
-
-        g_mutexProtectingCallbackData.Lock();
-        while((unsigned)fifo_used(cbData->outfifo1) < 6*N48)
-        {
-            g_mutexProtectingCallbackData.Unlock();
-
-            int   nsam = g_soundCard2SampleRate * g_pfreedv->n_speech_samples/FS;
-            assert(nsam <= 4*N48);
-
-            // infifo2 is written to by another sound card so it may
-            // over or underflow, but we don't realy care.  It will
-            // just result in a short interruption in audio being fed
-            // to codec2_enc, possibly making a click every now and
-            // again in the decoded audio at the other end.
-
-            // zero speech input just in case infifo2 underflows
-            memset(in48k_short, 0, nsam*sizeof(short));
-            fifo_read(cbData->infifo2, in48k_short, nsam);
-
-            nout = resample(cbData->insrc2, in8k_short, in48k_short, FS, g_soundCard2SampleRate, 4*N8, nsam);
-
-            // optionally use file for mic input signal
-
-            g_mutexProtectingCallbackData.Lock();
-            if (g_playFileToMicIn && (g_sfPlayFile != NULL)) {
-                int n = sf_read_short(g_sfPlayFile, in8k_short, nout);
-                //fprintf(stderr, "n: %d nout: %d\n", n, nout);
-                if (n != nout) {
-                    if (g_loopPlayFileToMicIn)
-                        sf_seek(g_sfPlayFile, 0, SEEK_SET);
-                    else {
-                        wxCommandEvent event( wxEVT_COMMAND_MENU_SELECTED, g_playFileToMicInEventId );
-                        // call stop/start play menu item, should be thread safe
-                        g_parent->GetEventHandler()->AddPendingEvent( event );
-                    }
-                }
-            }
-            g_mutexProtectingCallbackData.Unlock();
-
-            // Optional Speex pre-processor for acoustic noise reduction
-
-            if (wxGetApp().m_speexpp_enable) {
-                speex_preprocess_run(g_speex_st, in8k_short);
-            }
-
-            // Optional Mic In EQ Filtering, need mutex as filter can change at run time
-
-            g_mutexProtectingCallbackData.Lock();
-            if (cbData->micInEQEnable) {
-                sox_biquad_filter(cbData->sbqMicInBass, in8k_short, in8k_short, nout);
-                sox_biquad_filter(cbData->sbqMicInTreble, in8k_short, in8k_short, nout);
-                sox_biquad_filter(cbData->sbqMicInMid, in8k_short, in8k_short, nout);
-            }
-            g_mutexProtectingCallbackData.Unlock();
-
-            resample_for_plot(g_plotSpeechInFifo, in8k_short, nout, FS);
-
-            n_samples = g_pfreedv->n_nom_modem_samples;
-
-            if (g_analog) {
-                n_samples = g_pfreedv->n_speech_samples;
-
-                // Boost the "from mic" -> "to radio" audio in analog
-                // mode.  The need for the gain was found by
-                // experiment - analog SSB sounded too quiet compared
-                // to digital. With digital voice we generally drive
-                // the "to radio" (SSB radio mic input) at about 25%
-                // of the peak level for normal SSB voice. So we
-                // introduce 6dB gain to make analog SSB sound the
-                // same level as the digital.  Watch out for clipping.
-                for(int i=0; i<n_samples; i++) {
-                    float out = (float)in8k_short[i]*2.0;
-                    if (out > 32767) out = 32767.0;
-                    if (out < -32767) out = -32767.0;
-                    out8k_short[i] = out;
-                }
-            }
-            else {
-                COMP tx_fdm[g_pfreedv->n_nom_modem_samples];
-                COMP tx_fdm_offset[g_pfreedv->n_nom_modem_samples];
-                int  i;
-
-                freedv_comptx(g_pfreedv, tx_fdm, in8k_short);
-  
-                fdmdv_freq_shift_coh(tx_fdm_offset, tx_fdm, g_TxFreqOffsetHz, g_pfreedv->modem_sample_rate, &g_TxFreqOffsetPhaseRect, g_pfreedv->n_nom_modem_samples);
-                for(i=0; i<g_pfreedv->n_nom_modem_samples; i++)
-                    out8k_short[i] = tx_fdm_offset[i].real;
-            }
-
-            // output one frame of modem signal
-            nout = resample(cbData->outsrc1, out48k_short, out8k_short, g_soundCard1SampleRate, samplerate, N48*4, n_samples);
-            g_mutexProtectingCallbackData.Lock();
-            ret = fifo_write(cbData->outfifo1, out48k_short, nout);
-            //fprintf(stderr,"nout: %d ret: %d N48*4: %d\n", nout, ret, N48*4);
-
-            assert(ret != -1);
-        }
-        g_mutexProtectingCallbackData.Unlock();
-    }
-   
-    //fprintf(g_logfile, "  end infifo1: %5d outfifo2: %5d\n", fifo_used(cbData->infifo1), fifo_used(cbData->outfifo2));
-
-}
-
-//----------------------------------------------------------------
-// per_frame_rx_processing()
-//----------------------------------------------------------------
-
-void per_frame_rx_processing(
-                                            FIFO    *output_fifo,   // decoded speech samples
-                                            FIFO    *input_fifo
-                                        )
-{
-    short               input_buf[g_pfreedv->n_max_modem_samples];
-    short               output_buf[g_pfreedv->n_speech_samples];
-    COMP                rx_fdm[g_pfreedv->n_max_modem_samples];
-    COMP                rx_fdm_offset[g_pfreedv->n_max_modem_samples];
-    float               rx_spec[MODEM_STATS_NSPEC];
-    int                 i;
-    int                 nin, nin_prev, nout;
-
-    nin = freedv_nin(g_pfreedv);
-    while (fifo_read(input_fifo, input_buf, nin) == 0)
-    {
-        assert(nin <= g_pfreedv->n_max_modem_samples);
-
-        nin_prev = nin;
-        //fwrite(input_buf, sizeof(short), nin, ft);
-
-        // demod per frame processing
-        for(i=0; i<nin; i++)
-        {
-            rx_fdm[i].real = (float)input_buf[i];
-            rx_fdm[i].imag = 0.0;
-        }
-       
-        if (g_channel_noise) {
-            float snr;
-
-            /* enough noise to get a couple of % errors */
-
-            if (g_pfreedv->mode == FREEDV_MODE_1600)
-                snr = 2.0;
-             if (g_pfreedv->mode == FREEDV_MODE_700)
-                snr = -1.0;           
-            fdmdv_simulate_channel(&g_sig_pwr_av, rx_fdm, nin, snr);
-        }
-        fdmdv_freq_shift_coh(rx_fdm_offset, rx_fdm, g_RxFreqOffsetHz, g_pfreedv->modem_sample_rate, &g_RxFreqOffsetPhaseRect, nin);
-        nout = freedv_comprx(g_pfreedv, output_buf, rx_fdm_offset);
-        
-        fifo_write(output_fifo, output_buf, nout);
-        
-        nin = freedv_nin(g_pfreedv);
-        g_State = g_pfreedv->sync;
-        //fprintf(g_logfile, "g_State: %d g_stats.sync: %d snr: %f \n", g_State, g_stats.sync, f->snr);
-
-        // compute rx spectrum 
-
-        modem_stats_get_rx_spectrum(&g_stats, rx_spec, rx_fdm, nin_prev);
-        // Average rx spectrum data using a simple IIR low pass filter
-
-        for(i = 0; i<MODEM_STATS_NSPEC; i++) {
-            g_avmag[i] = BETA * g_avmag[i] + (1.0 - BETA) * rx_spec[i];
-        }
-
-        if (g_pfreedv->mode == FREEDV_MODE_1600)
-            fdmdv_get_demod_stats(g_pfreedv->fdmdv, &g_stats);
-        if (g_pfreedv->mode == FREEDV_MODE_700)
-            cohpsk_get_demod_stats(g_pfreedv->cohpsk, &g_stats);
-
-    }
-}
-
-
-//-------------------------------------------------------------------------
-// rxCallback()
-//
-// Sound card 1 callback from PortAudio, that is used for processing rx
-// side:
-//
-// + infifo1 is the "from radio" off air modem signal from the SSB rx that we send to the demod.
-// + In single sound card mode outfifo1 is the "to speaker/headphones" decoded speech output.
-// + In dual sound card mode outfifo1 is the "to radio" modulator signal to the SSB tx.
-//
-//-------------------------------------------------------------------------
-int MainFrame::rxCallback(
-                            const void      *inputBuffer,
-                            void            *outputBuffer,
-                            unsigned long   framesPerBuffer,
-                            const PaStreamCallbackTimeInfo* timeInfo,
-                            PaStreamCallbackFlags statusFlags,
-                            void            *userData
-                         )
-{
-    paCallBackData  *cbData = (paCallBackData*)userData;
-    short           *rptr    = (short*)inputBuffer;
-    short           *wptr    = (short*)outputBuffer;
-
-    short           indata[MAX_FPB];
-    short           outdata[MAX_FPB];
-
-    unsigned int    i;
-
-    (void) timeInfo;
-    (void) statusFlags;
-
-    wxMutexLocker lock(g_mutexProtectingCallbackData);
-
-    //fprintf(g_logfile, "cb1 statusFlags: 0x%x framesPerBuffer: %d rptr: 0x%x wptr: 0x%x \n", (int)statusFlags,
-    //        framesPerBuffer, rptr, wptr);
-
-    //
-    //  RX side processing --------------------------------------------
-    //
-
-    // assemble a mono buffer and write to FIFO
-
-    assert(framesPerBuffer < MAX_FPB);
-
-    if(rptr) {
-        //fprintf(g_logfile,"in %ld %d\n",  framesPerBuffer, g_in++);
-        //g_indata += framesPerBuffer;
-        for(i = 0; i < framesPerBuffer; i++, rptr += cbData->inputChannels1)
-            indata[i] = rptr[0];                       
-        if (fifo_write(cbData->infifo1, indata, framesPerBuffer)) {
-            //fprintf(g_logfile, "infifo1 full\n");
-        }
-        //fifo_write(cbData->outfifo1, indata, framesPerBuffer);
-    }
-
-    // OK now set up output samples for this callback
-
-    if(wptr) {
-        //fprintf(g_logfile,"out %ld %d\n",  framesPerBuffer, g_out++);
-        if (fifo_read(cbData->outfifo1, outdata, framesPerBuffer) == 0) {
-
-            // write signal to both channels
-
-            for(i = 0; i < framesPerBuffer; i++, wptr += 2) {
-                if (cbData->leftChannelVoxTone) {
-                    cbData->voxTonePhase += 2.0*M_PI*VOX_TONE_FREQ/g_soundCard1SampleRate;
-                    cbData->voxTonePhase -= 2.0*M_PI*floor(cbData->voxTonePhase/(2.0*M_PI));
-                    wptr[0] = VOX_TONE_AMP*cos(cbData->voxTonePhase);                              
-                    //printf("%f %d\n", cbData->voxTonePhase, wptr[0]);
-                }
-                else
-                    wptr[0] = outdata[i];
-                               
-                wptr[1] = outdata[i];
-            }
-        }
-        else {
-            //fprintf(g_logfile, "outfifo1 empty\n");
-            // zero output if no data available
-            for(i = 0; i < framesPerBuffer; i++, wptr += 2) {
-                wptr[0] = 0;
-                wptr[1] = 0;
-            }
-        }
-    }
-
-    return paContinue;
-}
-
-
-//-------------------------------------------------------------------------
-// txCallback()
-//-------------------------------------------------------------------------
-int MainFrame::txCallback(
-                            const void *inputBuffer,
-                            void *outputBuffer,
-                            unsigned long framesPerBuffer,
-                            const PaStreamCallbackTimeInfo *outTime,
-                            PaStreamCallbackFlags statusFlags,
-                            void *userData
-                        )
-{
-    paCallBackData  *cbData = (paCallBackData*)userData;
-    unsigned int    i;
-    short           *rptr    = (short*)inputBuffer;
-    short           *wptr    = (short*)outputBuffer;
-    short           indata[MAX_FPB];
-    short           outdata[MAX_FPB];
-
-    wxMutexLocker lock(g_mutexProtectingCallbackData);
-
-    //    if (statusFlags)
-    //    printf("cb2 statusFlags: 0x%x\n", (int)statusFlags);
-
-    // assemble a mono buffer and write to FIFO
-
-    assert(framesPerBuffer < MAX_FPB);
-
-    if(rptr) {
-        for(i = 0; i < framesPerBuffer; i++, rptr += cbData->inputChannels2)
-            indata[i] = rptr[0];                        
-    }
-
-    //#define SC2_LOOPBACK
-#ifdef SC2_LOOPBACK
-    //TODO: This doesn't work unless using the same soundcard!
-
-    if(wptr) {
-        for(i = 0; i < framesPerBuffer; i++, wptr += 2) {
-            wptr[0] = indata[i];
-            wptr[1] = indata[i];
-        }
-    }
-
-#else
-    if(rptr) {
-        if (fifo_write(cbData->infifo2, indata, framesPerBuffer)) {
-            //fprintf(g_logfile, "infifo2 full\n");
-        }
-    }
-
-    // OK now set up output samples for this callback
-
-    if(wptr) {
-        if (fifo_read(cbData->outfifo2, outdata, framesPerBuffer) == 0) {
-               
-            // write signal to both channels */
-            for(i = 0; i < framesPerBuffer; i++, wptr += 2) {
-                wptr[0] = outdata[i];
-                wptr[1] = outdata[i];
-            }
-        }
-        else {
-            //fprintf(g_logfile, "outfifo2 empty\n");
-            // zero output if no data available
-            for(i = 0; i < framesPerBuffer; i++, wptr += 2) {
-                wptr[0] = 0;
-                wptr[1] = 0;
-            }
-        }
-    }
-#endif
-    return paContinue;
-}
-
-// Callback from plot_spectrum & plot_waterfall.  would be nice to
-// work out a way to do this without globals.
-
-void fdmdv2_clickTune(float freq) {
-
-    // The demod is hard-wired to expect a centre frequency of
-    // FDMDV_FCENTRE.  So we want to take the signal centered on the
-    // click tune freq and re-centre it on FDMDV_FCENTRE.  For example
-    // if the click tune freq is 1500Hz, and FDMDV_CENTRE is 1200 Hz,
-    // we need to shift the input signal centred on 1500Hz down to
-    // 1200Hz, an offset of -300Hz.
-
-    if (g_split) {
-        g_RxFreqOffsetHz = FDMDV_FCENTRE - freq;
-    }
-    else {
-        g_TxFreqOffsetHz = freq - FDMDV_FCENTRE;
-        g_RxFreqOffsetHz = FDMDV_FCENTRE - freq;
-    }
-}
-
-//----------------------------------------------------------------
-// SetupSerialPort()
-//----------------------------------------------------------------
-void MainFrame::SetupSerialPort(void)
-{
-    if(!wxGetApp().m_strRigCtrlPort.IsEmpty())
-    {
-        if(openComPort(wxGetApp().m_strRigCtrlPort.c_str()))
-        {
-            // always start PTT in Rx state
-            SerialPTTRx();
-        }
-        else
-        {
-            wxMessageBox("Couldn't open Serial Port", wxT("About"), wxOK | wxICON_ERROR, this);
-        }
-    }
-}
-
-void MainFrame::SerialPTTRx(void)
-{
-    printf("m_boolUseRTS: %d m_boolRTSPos: %d m_boolUseDTR: %d m_boolDTRPos: %d\n",
-           wxGetApp().m_boolUseRTS, wxGetApp().m_boolRTSPos, wxGetApp().m_boolUseDTR, wxGetApp().m_boolDTRPos);
-
-        if(wxGetApp().m_boolRTSPos) // RTS cleared LOW
-            lowerRTS();
-        else                        // RTS cleared HIGH
-            raiseRTS();
-
-        if(wxGetApp().m_boolDTRPos) // DTR cleared LOW
-            lowerDTR();
-        else                        // DTR cleared HIGH
-            raiseDTR();
-}
-
-//----------------------------------------------------------------
-// CloseSerialPort()
-//----------------------------------------------------------------
-void MainFrame::CloseSerialPort(void)
-{
-    if (com_handle != COM_HANDLE_INVALID) {
-        // always end with PTT in rx state
-
-        SerialPTTRx();
-
-               closeComPort();
-    }
-}
-
-
-//----------------------------------------------------------------
-// PollUDP() - see if any commands on UDP port
-//----------------------------------------------------------------
-
-// test this puppy with netcat: 
-//   $ echo "hello" | nc -u -q1 localhost 3000
-
-int MainFrame::PollUDP(void)
-{
-    // this will block until message received, so we put it in it's own thread
-
-    char buf[1024];
-    char reply[80];
-    size_t n = m_udp_sock->RecvFrom(m_udp_addr, buf, sizeof(buf)).LastCount();
-
-    if (n) {
-        wxString bufstr = wxString::From8BitData(buf, n);
-        bufstr.Trim();
-        wxString ipaddr = m_udp_addr.IPAddress();
-        printf("Received: \"%s\" from %s:%u\n",
-               (const char *)bufstr.c_str(),
-               (const char *)ipaddr.c_str(), m_udp_addr.Service());
-
-        // for security only accept commands from local host
-
-        sprintf(reply,"nope\n");
-        if (ipaddr.Cmp(_("127.0.0.1")) == 0) {
-
-            // process commands
-
-            if (bufstr.Cmp(_("restore")) == 0) {
-                m_schedule_restore = true;  // Make Restore happen in main thread to avoid crashing
-                sprintf(reply,"ok\n");
-            }
-                
-            wxString itemToSet, val;
-            if (bufstr.StartsWith(_("set "), &itemToSet)) {
-                if (itemToSet.StartsWith("txtmsg ", &val)) {
-                    // note: if options dialog is open this will get overwritten
-                    wxGetApp().m_callSign = val;
-                }  
-                sprintf(reply,"ok\n");
-            }
-                
-        }
-        else {
-            printf("We only accept messages from locahost!\n");
-        }
-
-       if ( m_udp_sock->SendTo(m_udp_addr, reply, strlen(reply)).LastCount() != strlen(reply)) {
-           printf("ERROR: failed to send data\n");
-        }
-    }
-
-    return n;
-}
-
-void MainFrame::startUDPThread(void) {
-    printf("starting UDP thread!\n");
-    m_UDPThread = new UDPThread;
-    m_UDPThread->mf = this;
-    if (m_UDPThread->Create() != wxTHREAD_NO_ERROR ) {
-        wxLogError(wxT("Can't create thread!"));
-    }
-    if (m_UDPThread->Run() != wxTHREAD_NO_ERROR ) {
-        wxLogError(wxT("Can't start thread!"));
-        delete m_UDPThread;
-    }
-}
-
-void MainFrame::stopUDPThread(void) {
-    printf("stopping UDP thread!\n");
-    if ((m_UDPThread != NULL) && m_UDPThread->m_run) {
-        m_UDPThread->m_run = 0;
-        m_UDPThread->Wait();
-        m_UDPThread = NULL;
-    }
-}
-
-void *UDPThread::Entry() {
-    printf("UDP thread started!\n");
-    while (m_run) {
-        if (wxGetApp().m_udp_enable) {
-            printf("m_udp_enable\n");
-            mf->m_udp_addr.Service(wxGetApp().m_udp_port);
-            mf->m_udp_sock = new wxDatagramSocket(mf->m_udp_addr, wxSOCKET_NOWAIT);
-
-            while (m_run && wxGetApp().m_udp_enable) {
-                if (mf->PollUDP() == 0) {
-                    wxThread::Sleep(20);
-                }
-            }
-
-            delete mf->m_udp_sock;
-        }
-        wxThread::Sleep(20);
-    }
-    return NULL;
-}
-
-
-char my_get_next_tx_char(void *callback_state) {
-    short ch = 0;
-    
-    fifo_read(g_txDataInFifo, &ch, 1);
-    //fprintf(stderr, "get_next_tx_char: %c\n", (char)ch);
-    return (char)ch;
-}
-
-void my_put_next_rx_char(void *callback_state, char c) {
-    short ch = (short)c;
-    //fprintf(stderr, "put_next_rx_char: %c\n", (char)c);
-    fifo_write(g_rxDataOutFifo, &ch, 1);
-}
-
-// Callback from FreeDv API to update error plots
-
-void my_freedv_put_error_pattern(void *state, short error_pattern[], int sz_error_pattern) {
-    fifo_write(g_error_pattern_fifo, error_pattern, sz_error_pattern);
-}
diff --git a/fdmdv2/tags/0.99-Beta/src/fdmdv2_main.h b/fdmdv2/tags/0.99-Beta/src/fdmdv2_main.h
deleted file mode 100644 (file)
index 25a1e70..0000000
+++ /dev/null
@@ -1,614 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_main.h
-//
-// Purpose:         Declares simple wxWidgets application with GUI.
-// Created:         Apr. 9, 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 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 License
-//  along with this program; if not, see <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#ifndef __FDMDV2_MAIN__
-#define __FDMDV2_MAIN__
-
-#include "version.h"
-#ifndef _NO_AUTOTOOLS_
-#include "../config.h"
-#endif
-#include <wx/wx.h>
-
-#include <wx/tglbtn.h>
-#include <wx/app.h>
-//#include <wx/aboutdlg.h>
-#include "wx/rawbmp.h"
-#include "wx/file.h"
-#include "wx/filename.h"
-#include "wx/config.h"
-#include <wx/fileconf.h>
-#include "wx/graphics.h"
-#include "wx/mstream.h"
-#include "wx/wfstream.h"
-#include "wx/quantize.h"
-#include "wx/scopedptr.h"
-#include "wx/stopwatch.h"
-#include "wx/versioninfo.h"
-#include <wx/sound.h>
-#include <wx/url.h>
-#include <wx/sstream.h>
-#include <wx/listbox.h>
-#include <wx/textdlg.h>
-#include <wx/regex.h>
-#include <wx/socket.h>
-
-#include <samplerate.h>
-
-#include <hamlib.h> 
-#include <stdint.h>
-#include <speex/speex_preprocess.h>
-
-#ifdef _WIN32
-#include <windows.h>
-#else
-#include <termios.h>
-#include <sys/ioctl.h>
-#endif
-
-#include "codec2.h"
-#include "codec2_fdmdv.h"
-#include "codec2_fifo.h"
-#include "golay23.h"
-#include "modem_stats.h"
-
-#include "topFrame.h"
-#include "dlg_ptt.h"
-#include "dlg_options.h"
-#include "fdmdv2_plot.h"
-#include "fdmdv2_plot_scalar.h"
-#include "fdmdv2_plot_scatter.h"
-#include "fdmdv2_plot_waterfall.h"
-#include "fdmdv2_plot_spectrum.h"
-#include "fdmdv2_pa_wrapper.h"
-#include "sndfile.h"
-#include "portaudio.h"
-#include "dlg_audiooptions.h"
-#include "dlg_filter.h"
-#include "dlg_options.h"
-#include "varicode.h"
-#include "sox_biquad.h"
-#include "comp_prim.h"
-
-#define _USE_TIMER              1
-#define _USE_ONIDLE             1
-#define _DUMMY_DATA             1
-//#define _AUDIO_PASSTHROUGH    1
-#define _REFRESH_TIMER_PERIOD   (DT*1000)
-//#define _USE_ABOUT_DIALOG       1
-
-enum {
-        ID_START = wxID_HIGHEST,
-        ID_TIMER_WATERFALL,
-        ID_TIMER_SPECTRUM,
-        ID_TIMER_SCATTER,
-        ID_TIMER_SCALAR
-     };
-
-#define EXCHANGE_DATA_IN    0
-#define EXCHANGE_DATA_OUT   1
-
-#ifdef _WIN32
-#define COM_HANDLE_INVALID                     INVALID_HANDLE_VALUE
-typedef HANDLE      com_handle_t;
-#else
-#define COM_HANDLE_INVALID                     -1
-typedef int         com_handle_t;
-#endif
-
-extern int                 g_nSoundCards;
-extern int                 g_soundCard1InDeviceNum;
-extern int                 g_soundCard1OutDeviceNum;
-extern int                 g_soundCard1SampleRate;
-extern int                 g_soundCard2InDeviceNum;
-extern int                 g_soundCard2OutDeviceNum;
-extern int                 g_soundCard2SampleRate;
-
-class MainFrame;
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class MainApp
-//
-// @class $(Name)
-// @author $(User)
-// @date $(Date)
-// @file $(CurrentFileName).$(CurrentFileExt)
-// @brief
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class MainApp : public wxApp
-{
-    public:
-        virtual bool        OnInit();
-        virtual int         OnExit();
-
-        wxString            m_strVendName;
-        wxString            m_StrAppName;
-
-        wxString            m_textNumChOut;
-        wxString            m_textNumChIn;
-
-        wxString            m_strRxInAudio;
-        wxString            m_strRxOutAudio;
-        wxString            m_textVoiceInput;
-        wxString            m_textVoiceOutput;
-        wxString            m_strSampleRate;
-        wxString            m_strBitrate;
-
-        // PTT -----------------------------------
-
-        bool                m_boolHalfDuplex;
-
-        bool                m_boolHamlibUseForPTT;
-        unsigned int        m_intHamlibRig;
-        wxString            m_strHamlibSerialPort;
-        Hamlib              *m_hamlib;
-
-        bool                m_boolUseSerialPTT;
-        wxString            m_strRigCtrlPort;
-        bool                m_boolUseRTS;
-        bool                m_boolRTSPos;
-        bool                m_boolUseDTR;
-        bool                m_boolDTRPos;
-
-        // Play/Rec files
-
-        wxString            m_playFileToMicInPath;
-        wxString            m_recFileFromRadioPath;
-        unsigned int        m_recFileFromRadioSecs;
-        wxString            m_playFileFromRadioPath;
-
-        // Options dialog
-
-        wxString            m_callSign;
-        bool                m_events;
-        int                 m_events_spam_timer;
-        unsigned int        m_textEncoding;
-        bool                m_enable_checksum;
-        wxString            m_events_regexp_match;
-        wxString            m_events_regexp_replace;
-
-        bool                m_snrSlow;
-
-        // LPC Post Filter
-        bool                m_codec2LPCPostFilterEnable;
-        bool                m_codec2LPCPostFilterBassBoost;
-        float               m_codec2LPCPostFilterGamma;
-        float               m_codec2LPCPostFilterBeta;
-        
-        // Speex Pre-Processor
-        bool                m_speexpp_enable;
-
-        // Mic In Equaliser
-        float               m_MicInBassFreqHz;
-        float               m_MicInBassGaindB;
-        float               m_MicInTrebleFreqHz;
-        float               m_MicInTrebleGaindB;
-        float               m_MicInMidFreqHz;
-        float               m_MicInMidGaindB;
-        float               m_MicInMidQ;
-        bool                m_MicInEQEnable;
-
-        // Spk Out Equaliser
-        float               m_SpkOutBassFreqHz;
-        float               m_SpkOutBassGaindB;
-        float               m_SpkOutTrebleFreqHz;
-        float               m_SpkOutTrebleGaindB;
-        float               m_SpkOutMidFreqHz;
-        float               m_SpkOutMidGaindB;
-        float               m_SpkOutMidQ;
-        bool                m_SpkOutEQEnable;
-
-        // Flags for displaying windows
-        int                 m_show_wf;
-        int                 m_show_spect;
-        int                 m_show_scatter;
-        int                 m_show_timing;
-        int                 m_show_freq;
-        int                 m_show_speech_in;
-        int                 m_show_speech_out;
-        int                 m_show_demod_in;
-        int                 m_show_test_frame_errors;
-        int                 m_show_test_frame_errors_hist;
-
-        // optional vox trigger tone
-        bool                m_leftChannelVoxTone;
-
-        // UDP control port
-        bool                m_udp_enable;
-        int                 m_udp_port;
-
-        // notebook display after tx->rxtransition
-        int                 m_rxNbookCtrl;
-
-        wxRect              m_rTopWindow;
-
-        int                 m_framesPerBuffer;
-
-        bool                loadConfig();
-        bool                saveConfig();
-
-        // misc
-
-        bool       m_testFrames;
-        bool       m_channel_noise;
-        float      m_channel_snr_dB;
-
-        int        FilterEvent(wxEvent& event);
-        MainFrame *frame;
-
-        bool       m_FreeDV700txClip;
-    protected:
-};
-
-// declare global static function wxGetApp()
-DECLARE_APP(MainApp)
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// paCallBackData
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-typedef struct
-{
-    // libresample states for 48 to 8 kHz conversions
-
-    SRC_STATE      *insrc1;
-    SRC_STATE      *outsrc1;
-    SRC_STATE      *insrc2;
-    SRC_STATE      *outsrc2;
-    SRC_STATE      *insrcsf;
-
-    // FIFOs attached to first sound card
-
-    struct FIFO    *infifo1;
-    struct FIFO    *outfifo1;
-
-    // FIFOs attached to second sound card
-    struct FIFO    *infifo2;
-    struct FIFO    *outfifo2;
-
-    // FIFOs for rx process
-    struct FIFO    *rxinfifo;
-    struct FIFO    *rxoutfifo;
-
-    int             inputChannels1, inputChannels2;
-
-    // EQ filter states
-    void           *sbqMicInBass;
-    void           *sbqMicInTreble;
-    void           *sbqMicInMid;
-    void           *sbqSpkOutBass;
-    void           *sbqSpkOutTreble;
-    void           *sbqSpkOutMid;
-
-    bool            micInEQEnable;
-    bool            spkOutEQEnable;
-
-    // optional loud tone on left channel to reliably trigger vox
-    bool            leftChannelVoxTone;
-    float           voxTonePhase;
-
-} paCallBackData;
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// panel with custom loop checkbox for play file dialog
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class MyExtraPlayFilePanel : public wxPanel
-{
-public:
-    MyExtraPlayFilePanel(wxWindow *parent);
-    void setLoopPlayFileToMicIn(bool checked) { m_cb->SetValue(checked); }
-    bool getLoopPlayFileToMicIn(void) { return m_cb->GetValue(); }
-private:
-    wxCheckBox *m_cb;
-};
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// panel with custom Seconds-to-record control for record file dialog
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class MyExtraRecFilePanel : public wxPanel
-{
-public:
-    MyExtraRecFilePanel(wxWindow *parent);
-    ~MyExtraRecFilePanel() 
-    {
-        wxLogDebug("Destructor\n");
-    }
-    void setSecondsToRecord(wxString value) { m_secondsToRecord->SetValue(value); }
-    wxString getSecondsToRecord(void) 
-    { 
-        wxLogDebug("getSecondsToRecord: %s\n",m_secondsToRecord->GetValue());
-        return m_secondsToRecord->GetValue(); 
-    }
-private:
-    wxTextCtrl *m_secondsToRecord;
-};
-
-class txRxThread;
-class UDPThread;
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class MainFrame
-//
-// @class $(Name)
-// @author $(User)
-// @date $(Date)
-// @file $(CurrentFileName).$(CurrentFileExt)
-// @brief
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class MainFrame : public TopFrame
-{
-    public:
-        MainFrame(wxWindow *parent);
-        virtual ~MainFrame();
-
-        PlotSpectrum*           m_panelSpectrum;
-        PlotWaterfall*          m_panelWaterfall;
-        PlotScatter*            m_panelScatter;
-        PlotScalar*             m_panelTimeOffset;
-        PlotScalar*             m_panelFreqOffset;
-        PlotScalar*             m_panelSpeechIn;
-        PlotScalar*             m_panelSpeechOut;
-        PlotScalar*             m_panelDemodIn;
-        PlotScalar*             m_panelTestFrameErrors;
-        PlotScalar*             m_panelTestFrameErrorsHist;
-
-        bool                    m_RxRunning;
-
-        PortAudioWrap           *m_rxInPa;
-        PortAudioWrap           *m_rxOutPa;
-        PortAudioWrap           *m_txInPa;
-        PortAudioWrap           *m_txOutPa;
-
-        PaError                 m_rxErr;
-        PaError                 m_txErr;
-        
-        txRxThread*             m_txRxThread;
-
-        bool                    OpenHamlibRig();
-        void                    SetupSerialPort(void);
-        void                    CloseSerialPort(void);
-        void                    SerialPTTRx(void);
-
-        bool                    m_modal;
-
-#ifdef _USE_TIMER
-        wxTimer                 m_plotTimer;
-#endif
-
-    void destroy_fifos(void);
-    void destroy_src(void);
-    void autoDetectSoundCards(PortAudioWrap *pa);
-
-        static int rxCallback(
-                                const void *inBuffer,
-                                void *outBuffer,
-                                unsigned long framesPerBuffer,
-                                const PaStreamCallbackTimeInfo *outTime,
-                                PaStreamCallbackFlags statusFlags,
-                                void *userData
-                             );
-        static int txCallback(
-                                const void *inBuffer,
-                                void *outBuffer,
-                                unsigned long framesPerBuffer,
-                                const PaStreamCallbackTimeInfo *outTime,
-                                PaStreamCallbackFlags statusFlags,
-                                void *userData
-                             );
-
-
-    void initPortAudioDevice(PortAudioWrap *pa, int inDevice, int outDevice, 
-                             int soundCard, int sampleRate, int inputChannels);
-
-    void togglePTT(void);
-
-    wxIPV4address           m_udp_addr;
-    wxDatagramSocket       *m_udp_sock;
-    UDPThread              *m_UDPThread;
-    void                    startUDPThread(void);
-    void                    stopUDPThread(void);
-    int                     PollUDP();
-    bool                    m_schedule_restore;
-
-    protected:
-
-#ifdef _WIN32
-#define COM_HANDLE_INVALID                     INVALID_HANDLE_VALUE
-        com_handle_t  com_handle;
-#else
-#define COM_HANDLE_INVALID                     -1
-        com_handle_t  com_handle;
-#endif
-        void raiseDTR(void);
-        void lowerDTR(void);
-        void raiseRTS(void);
-        void lowerRTS(void);
-        bool openComPort(const char *port);
-        void closeComPort(void);
-
-        void setsnrBeta(bool snrSlow);
-
-        // protected event handlers
-        virtual void OnCloseFrame(wxCloseEvent& event);
-        void OnExitClick(wxCommandEvent& event);
-
-        void startTxStream();
-        void startRxStream();
-        void stopTxStream();
-        void stopRxStream();
-        void abortTxStream();
-        void abortRxStream();
-        
-        void OnTop(wxCommandEvent& event);
-        void OnExit( wxCommandEvent& event );
-
-        void OnToolsAudio( wxCommandEvent& event );
-        void OnToolsAudioUI( wxUpdateUIEvent& event );
-        void OnToolsComCfg( wxCommandEvent& event );
-        void OnToolsComCfgUI( wxUpdateUIEvent& event );
-        void OnToolsFilter( wxCommandEvent& event );
-        void OnToolsOptions(wxCommandEvent& event);
-        void OnToolsOptionsUI(wxUpdateUIEvent& event);
-
-        void OnPlayFileToMicIn( wxCommandEvent& event );
-        void OnRecFileFromRadio( wxCommandEvent& event );
-        void OnPlayFileFromRadio( wxCommandEvent& event );
-
-        void OnHelpCheckUpdates( wxCommandEvent& event );
-        void OnHelpCheckUpdatesUI( wxUpdateUIEvent& event );
-        void OnHelpAbout( wxCommandEvent& event );
-        void OnCmdSliderScroll( wxScrollEvent& event );
-//        void OnSliderScrollBottom( wxScrollEvent& event );
-//        void OnCmdSliderScrollChanged( wxScrollEvent& event );
-//        void OnSliderScrollTop( wxScrollEvent& event );
-        void OnCheckSQClick( wxCommandEvent& event );
-        void OnCheckSNRClick( wxCommandEvent& event );
-
-        // Toggle Buttons
-        void OnTogBtnSplitClick(wxCommandEvent& event);
-        void OnTogBtnAnalogClick(wxCommandEvent& event);
-        void OnTogBtnRxID( wxCommandEvent& event );
-        void OnTogBtnTxID( wxCommandEvent& event );
-        void OnTogBtnPTT( wxCommandEvent& event );
-        void OnTogBtnOnOff( wxCommandEvent& event );
-
-        void OnCallSignReset( wxCommandEvent& event );
-        void OnBerReset( wxCommandEvent& event );
-
-        //System Events
-        void OnPaint(wxPaintEvent& event);
-        void OnSize( wxSizeEvent& event );
-        void OnUpdateUI( wxUpdateUIEvent& event );
-        void OnDeleteConfig(wxCommandEvent&);
-#ifdef _USE_TIMER
-        void OnTimer(wxTimerEvent &evt);
-#endif
-#ifdef _USE_ONIDLE
-        void OnIdle(wxIdleEvent &evt);
-#endif
-
-    private:
-        bool        m_useMemory;
-        wxTextCtrl* m_tc;
-        int         m_zoom;
-        float       m_snrBeta;
-        
-        // Callsign/text messaging
-        char        m_callsign[MAX_CALLSIGN];
-        char       *m_pcallsign;
-        unsigned int m_checksumGood;
-        unsigned int m_checksumBad;
-        
-        // Events
-        void        processTxtEvent(char event[]);
-        class OptionsDlg *optionsDlg;
-        wxTimer     spamTimer[MAX_EVENT_RULES];
-
-        // level Gauge
-        float       m_maxLevel;
-        // flags to indicate when new EQ filters need to be designed
-
-        bool        m_newMicInFilter;
-        bool        m_newSpkOutFilter;
-
-        void*       designAnEQFilter(const char filterType[], float freqHz, float gaindB, float Q = 0.0);
-        void        designEQFilters(paCallBackData *cb);
-        void        deleteEQFilters(paCallBackData *cb);
-};
-
-void txRxProcessing();
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// class txRxThread - experimental tx/rx processing thread
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class txRxThread : public wxThread
-{
-public:
-    txRxThread(void) : wxThread(wxTHREAD_JOINABLE) { m_run = 1; }
-
-    // thread execution starts here
-    void *Entry() 
-    {
-        while (m_run) 
-        {
-            txRxProcessing();        
-            wxThread::Sleep(20);
-        }
-        return NULL;
-    }
-
-    // called when the thread exits - whether it terminates normally or is
-    // stopped with Delete() (but not when it is Kill()ed!)
-    void OnExit() { }
-
-public:
-    bool  m_run;
-};
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// class UDPThread - waits for UDP messages
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class UDPThread : public wxThread
-{
-public:
-    UDPThread(void) : wxThread(wxTHREAD_JOINABLE) { m_run = 1; }
-
-    // thread execution starts here
-    void *Entry();
-
-    // called when the thread exits - whether it terminates normally or is
-    // stopped with Delete() (but not when it is Kill()ed!)
-    void OnExit() { }
-
-public:
-    MainFrame              *mf;
-    bool                    m_run;
-};
-
-void resample_for_plot(struct FIFO *plotFifo, short buf[], int length, int fs);
-
-int resample(SRC_STATE *src,
-             short      output_short[],
-             short      input_short[],
-             int        output_sample_rate,
-             int        input_sample_rate,
-             int        length_output_short, // maximum output array length in samples
-             int        length_input_short
-             );
-void txRxProcessing();
-void per_frame_rx_processing(
-                                        FIFO    *output_fifo,   // decoded speech samples
-                                        FIFO    *input_fifo     // modem samples input to demod
-                                    );
-
-// FreeDv API calls this when there is a test frame that needs a-plottin'
-
-void my_freedv_put_error_pattern(void *state, short error_pattern[], int sz_error_pattern);
-
-// FreeDv API calls these puppies when it needs/receives a text char 
-
-char my_get_next_tx_char(void *callback_state);
-void my_put_next_rx_char(void *callback_state, char c);
-
-#endif //__FDMDV2_MAIN__
diff --git a/fdmdv2/tags/0.99-Beta/src/fdmdv2_pa_wrapper.cpp b/fdmdv2/tags/0.99-Beta/src/fdmdv2_pa_wrapper.cpp
deleted file mode 100644 (file)
index 2f67ca2..0000000
+++ /dev/null
@@ -1,324 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_pa_wrapper.cpp
-// Purpose:         Implements a wrapper class around the PortAudio library.
-// Created:         August 12, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#include "fdmdv2_pa_wrapper.h"
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// PortAudioWrap()
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-PortAudioWrap::PortAudioWrap()
-{
-    m_pStream                   = NULL;
-    m_pUserData                 = NULL;
-    m_samplerate                = 0;
-    m_framesPerBuffer           = 0;
-    m_statusFlags               = 0;
-    m_pStreamCallback           = NULL;
-    m_pStreamFinishedCallback   = NULL;
-    m_pTimeInfo                 = 0;
-    m_newdata                   = false;
-
-//    loadData();
-}
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// ~PortAudioWrap()
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-PortAudioWrap::~PortAudioWrap()
-{
-}
-
-//----------------------------------------------------------------
-// streamOpen()
-//----------------------------------------------------------------
-PaError PortAudioWrap::streamOpen()
-{
-    return Pa_OpenStream(
-                            &m_pStream,
-                            m_inputBuffer.device == paNoDevice ? NULL : &m_inputBuffer,
-                            m_outputBuffer.device == paNoDevice ? NULL : &m_outputBuffer,
-                            m_samplerate,
-                            m_framesPerBuffer,
-                            m_statusFlags,
-                            *m_pStreamCallback,
-                            m_pUserData
-                        );
-}
-
-//----------------------------------------------------------------
-// streamStart()
-//----------------------------------------------------------------
-PaError PortAudioWrap::streamStart()
-{
-    return Pa_StartStream(m_pStream);
-}
-
-//----------------------------------------------------------------
-// streamClose()
-//----------------------------------------------------------------
-PaError PortAudioWrap::streamClose()
-{
-    if(isOpen())
-    {
-        PaError rv = Pa_CloseStream(m_pStream);
-        return rv;
-    }
-    else
-    {
-        return paNoError;
-    }
-}
-
-//----------------------------------------------------------------
-// terminate()
-//----------------------------------------------------------------
-void PortAudioWrap::terminate()
-{
-    if(Pa_IsStreamStopped(m_pStream) != paNoError)
-    {
-        Pa_StopStream(m_pStream);
-    }
-    Pa_Terminate();
-}
-
-//----------------------------------------------------------------
-// stop()
-//----------------------------------------------------------------
-void PortAudioWrap::stop()
-{
-    Pa_StopStream(m_pStream);
-}
-
-//----------------------------------------------------------------
-// abort()
-//----------------------------------------------------------------
-void PortAudioWrap::abort()
-{
-    Pa_AbortStream(m_pStream);
-}
-
-//----------------------------------------------------------------
-// isStopped()
-//----------------------------------------------------------------
-bool PortAudioWrap::isStopped() const
-{
-    PaError ret = Pa_IsStreamStopped(m_pStream);
-    return ret;
-}
-
-//----------------------------------------------------------------
-// isActive()
-//----------------------------------------------------------------
-bool PortAudioWrap::isActive() const
-{
-    PaError ret = Pa_IsStreamActive(m_pStream);
-    return ret;
-}
-
-//----------------------------------------------------------------
-// isOpen()
-//----------------------------------------------------------------
-bool PortAudioWrap::isOpen() const
-{
-    return (m_pStream != NULL);
-}
-
-//----------------------------------------------------------------
-// getDefaultInputDevice()
-//----------------------------------------------------------------
-PaDeviceIndex PortAudioWrap::getDefaultInputDevice()
-{
-    return Pa_GetDefaultInputDevice();
-}
-
-//----------------------------------------------------------------
-// getDefaultOutputDevice()
-//----------------------------------------------------------------
-PaDeviceIndex PortAudioWrap::getDefaultOutputDevice()
-{
-    return Pa_GetDefaultOutputDevice();
-}
-
-//----------------------------------------------------------------
-// setInputChannelCount()
-//----------------------------------------------------------------
-PaError PortAudioWrap::setInputChannelCount(int count)
-{
-    m_inputBuffer.channelCount = count;
-    return paNoError;
-}
-
-//----------------------------------------------------------------
-// getInputChannelCount()
-//----------------------------------------------------------------
-PaError PortAudioWrap::getInputChannelCount()
-{
-    return m_inputBuffer.channelCount;
-}
-
-//----------------------------------------------------------------
-// setInputSampleFormat()
-//----------------------------------------------------------------
-PaError PortAudioWrap::setInputSampleFormat(PaSampleFormat format)
-{
-    m_inputBuffer.sampleFormat = format;
-    return paNoError;
-}
-
-//----------------------------------------------------------------
-// setInputLatency()
-//----------------------------------------------------------------
-PaError PortAudioWrap::setInputLatency(PaTime latency)
-{
-    m_inputBuffer.suggestedLatency = latency;
-    return paNoError;
-}
-
-//----------------------------------------------------------------
-// setInputHostApiStreamInfo()
-//----------------------------------------------------------------
-void PortAudioWrap::setInputHostApiStreamInfo(void *info)
-{
-    m_inputBuffer.hostApiSpecificStreamInfo = info;
-}
-
-//----------------------------------------------------------------
-// getInputDefaultLowLatency()
-//----------------------------------------------------------------
-PaTime  PortAudioWrap::getInputDefaultLowLatency()
-{
-    return Pa_GetDeviceInfo(m_inputBuffer.device)->defaultLowInputLatency;
-}
-
-//----------------------------------------------------------------
-// setOutputChannelCount()
-//----------------------------------------------------------------
-PaError PortAudioWrap::setOutputChannelCount(int count)
-{
-    m_outputBuffer.channelCount = count;
-    return paNoError;
-}
-
-//----------------------------------------------------------------
-// getOutputChannelCount()
-//----------------------------------------------------------------
-const int PortAudioWrap::getOutputChannelCount()
-{
-    return m_outputBuffer.channelCount;
-}
-
-//----------------------------------------------------------------
-// getDeviceName()
-//----------------------------------------------------------------
-const char *PortAudioWrap::getDeviceName(PaDeviceIndex dev)
-{
-    const PaDeviceInfo *info;
-    info = Pa_GetDeviceInfo(dev);
-    return info->name;
-}
-
-//----------------------------------------------------------------
-// setOutputSampleFormat()
-//----------------------------------------------------------------
-PaError PortAudioWrap::setOutputSampleFormat(PaSampleFormat format)
-{
-    m_outputBuffer.sampleFormat = format;
-    return paNoError;
-}
-
-//----------------------------------------------------------------
-// setOutputLatency()
-//----------------------------------------------------------------
-PaError PortAudioWrap::setOutputLatency(PaTime latency)
-{
-    m_outputBuffer.suggestedLatency = latency;
-    return paNoError;
-}
-
-//----------------------------------------------------------------
-// setOutputHostApiStreamInfo()
-//----------------------------------------------------------------
-void PortAudioWrap::setOutputHostApiStreamInfo(void *info)
-{
-    m_outputBuffer.hostApiSpecificStreamInfo = info;
-}
-
-//----------------------------------------------------------------
-// getOutputDefaultLowLatency()
-//----------------------------------------------------------------
-PaTime  PortAudioWrap::getOutputDefaultLowLatency()
-{
-    return Pa_GetDeviceInfo(m_outputBuffer.device)->defaultLowOutputLatency;
-}
-
-//----------------------------------------------------------------
-// setFramesPerBuffer()
-//----------------------------------------------------------------
-PaError PortAudioWrap::setFramesPerBuffer(unsigned long size)
-{
-    m_framesPerBuffer = size;
-    return paNoError;
-}
-
-//----------------------------------------------------------------
-// setSampleRate()
-//----------------------------------------------------------------
-PaError PortAudioWrap::setSampleRate(unsigned long rate)
-{
-    m_samplerate = rate;
-    return paNoError;
-}
-
-//----------------------------------------------------------------
-// setStreamFlags()
-//----------------------------------------------------------------
-PaError PortAudioWrap::setStreamFlags(PaStreamFlags flags)
-{
-    m_statusFlags = flags;
-    return paNoError;
-}
-
-//----------------------------------------------------------------
-// setInputDevice()
-//----------------------------------------------------------------
-PaError PortAudioWrap::setInputDevice(PaDeviceIndex index)
-{
-    m_inputBuffer.device = index;
-    return paNoError;
-}
-
-//----------------------------------------------------------------
-// setOutputDevice()
-//----------------------------------------------------------------
-PaError PortAudioWrap::setOutputDevice(PaDeviceIndex index)
-{
-    m_outputBuffer.device = index;
-    return paNoError;
-}
-
-//----------------------------------------------------------------
-// setCallback()
-//----------------------------------------------------------------
-PaError PortAudioWrap::setCallback(PaStreamCallback *callback)
-{
-    m_pStreamCallback = callback;
-    return paNoError;
-}
-
diff --git a/fdmdv2/tags/0.99-Beta/src/fdmdv2_pa_wrapper.h b/fdmdv2/tags/0.99-Beta/src/fdmdv2_pa_wrapper.h
deleted file mode 100644 (file)
index 3d216c0..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_pa_wrapper.h
-// Purpose:         Defines a wrapper class around PortAudio
-// Created:         August 12, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#include <stdio.h>
-#include <math.h>
-#include "fdmdv2_defines.h"
-#include "codec2_fdmdv.h"
-#include "codec2.h"
-#include "portaudio.h"
-
-#define PA_SAMPLE_TYPE      paInt16         //paFloat32
-#define FRAMES_PER_BUFFER   (64)
-
-typedef float SAMPLE;
-
-class PortAudioWrap
-{
-    public:
-        PortAudioWrap();
-        ~PortAudioWrap();
-
-//        float                           m_av_mag[FDMDV_NSPEC];
-
-    private:
-        PaStream                        *m_pStream;
-        void                            *m_pUserData;
-        PaStreamCallback                *m_pStreamCallback;
-        PaStreamFinishedCallback        *m_pStreamFinishedCallback;
-        const PaStreamCallbackTimeInfo  *m_pTimeInfo;
-        struct FDMDV                    *m_pFDMDV_state;
-        PaStreamParameters              m_inputBuffer;
-        PaStreamParameters              m_outputBuffer;
-        int                             m_samplerate;
-        unsigned long                   m_framesPerBuffer;
-        PaStreamCallbackFlags           m_statusFlags;
-        bool                            m_newdata;
-
-    public:
-
-        void                averageData(float mag_dB[]);
-
-        int                 getDeviceCount() { return Pa_GetDeviceCount(); }
-        PaDeviceIndex       getDefaultInputDevice();
-        PaDeviceIndex       getDefaultOutputDevice();
-        PaStreamParameters  *getDeviceInfo(PaDeviceIndex idx);
-
-        PaError             setFramesPerBuffer(unsigned long size);
-        PaError             setSampleRate(unsigned long size);
-
-        PaError             setStreamFlags(PaStreamFlags flags);
-        PaError             setCallback(PaStreamCallback *m_pStreamCallback);
-        PaError             setStreamCallback(PaStream *stream, PaStreamCallback* callback) { m_pStreamCallback = callback; return 0;}
-        PaError             setStreamFinishedCallback(PaStream *stream, PaStreamFinishedCallback* m_pStreamFinishedCallback);
-
-        void                setInputBuffer(const PaStreamParameters& inputBuffer)   {this->m_inputBuffer = inputBuffer;}
-        PaError             setInputDevice(PaDeviceIndex dev);
-        PaError             setInputChannelCount(int count);
-        int                 getInputChannelCount();
-        PaError             setInputSampleFormat(PaSampleFormat format);
-        PaError             setInputSampleRate(PaSampleFormat format);
-        PaError             setInputLatency(PaTime latency);
-        void                setInputHostApiStreamInfo(void *info = NULL);
-        PaTime              getInputDefaultLowLatency();
-        const char          *getDeviceName(PaDeviceIndex dev);
-
-        PaError             setOutputDevice(PaDeviceIndex dev);
-        PaError             setOutputChannelCount(int count);
-        const int           getOutputChannelCount();
-        PaError             setOutputSampleFormat(PaSampleFormat format);
-        PaError             setOutputLatency(PaTime latency);
-        void                setOutputHostApiStreamInfo(void *info = NULL);
-        PaTime              getOutputDefaultLowLatency();
-
-        void                setFdmdvState(FDMDV* fdmdv_state)                       {this->m_pFDMDV_state = fdmdv_state;}
-        void                setOutputBuffer(const PaStreamParameters& outputBuffer) {this->m_outputBuffer = outputBuffer;}
-        void                setTimeInfo(PaStreamCallbackTimeInfo* timeInfo)         {this->m_pTimeInfo = timeInfo;}
-        void                setUserData(void* userData)                             {this->m_pUserData = userData;}
-        unsigned long       getFramesPerBuffer() const                              {return m_framesPerBuffer;}
-        const               PaStreamParameters& getInputBuffer() const              {return m_inputBuffer;}
-        const               PaStreamParameters& getOutputBuffer() const             {return m_outputBuffer;}
-        const               PaStreamCallbackFlags& getStatusFlags() const           {return m_statusFlags;}
-
-        FDMDV*              getFdmdvState()                                         {return m_pFDMDV_state;}
-        int                 getSamplerate() const                                   {return m_samplerate;}
-        PaStream*           getStream()                                             {return m_pStream;}
-        void                *getUserData()                                          {return m_pUserData;}
-        bool                getDataAvail()                                          {return m_newdata;}
-        PaError             streamStart();
-        PaError             streamClose();
-        PaError             streamOpen();
-        void                terminate();
-        void                stop();
-        void                abort();
-        bool                isOpen() const;
-        bool                isStopped() const;
-        bool                isActive() const;
-//        void                loadData();
-};
diff --git a/fdmdv2/tags/0.99-Beta/src/fdmdv2_plot.cpp b/fdmdv2/tags/0.99-Beta/src/fdmdv2_plot.cpp
deleted file mode 100644 (file)
index 1b85cd9..0000000
+++ /dev/null
@@ -1,283 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_plot.cpp
-// Purpose:         Implements simple wxWidgets application with GUI.
-// Created:         Apr. 9, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#include <string.h>
-#include "fdmdv2_plot.h"
-
-BEGIN_EVENT_TABLE(PlotPanel, wxPanel)
-    EVT_PAINT           (PlotPanel::OnPaint)
-    EVT_MOTION          (PlotPanel::OnMouseMove)
-    EVT_LEFT_DOWN       (PlotPanel::OnMouseLeftDown)
-    EVT_LEFT_UP         (PlotPanel::OnMouseLeftUp)
-    EVT_RIGHT_DOWN      (PlotPanel::OnMouseRightDown)
-    EVT_MOUSEWHEEL      (PlotPanel::OnMouseWheelMoved)
-    EVT_SIZE            (PlotPanel::OnSize)
-    EVT_SHOW            (PlotPanel::OnShow)
-END_EVENT_TABLE()
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class PlotPanel(wxFrame* parent) : wxPanel(parent)
-//
-// @class $(Name)
-// @author $(User)
-// @date $(Date)
-// @file $(CurrentFileName).$(CurrentFileExt)
-// @brief
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-PlotPanel::PlotPanel(wxFrame* parent) : wxPanel(parent)
-{
-    m_pNoteBook         = (wxAuiNotebook *) parent;
-    m_pTopFrame         = (MainFrame *)m_pNoteBook->GetParent();
-    m_zoomFactor        = 1.0;
-    m_pBmp              = NULL;
-    m_pPix              = NULL;
-    m_firstPass         = true;
-    m_line_color        = 0;
-    m_newdata           = false;
-    m_clip              = false;
-    m_use_bitmap        = true;
-    m_rubberBand        = false;
-    m_mouseDown         = false;
-    m_penShortDash      = wxPen(wxColor(0xA0, 0xA0, 0xA0), 1, wxPENSTYLE_SHORT_DASH);
-    m_penDotDash        = wxPen(wxColor(0xD0, 0xD0, 0xD0), 1, wxPENSTYLE_DOT_DASH);
-    m_penSolid          = wxPen(wxColor(0x00, 0x00, 0x00), 1, wxPENSTYLE_SOLID);
-    SetBackgroundStyle(wxBG_STYLE_PAINT);
-    SetLabelSize(10.0);
-}
-
-//-------------------------------------------------------------------------
-// ~PlotPanel()
-//-------------------------------------------------------------------------
-PlotPanel::~PlotPanel()
-{
-    if(m_pBmp != NULL)
-    {
-        delete m_pBmp;
-    }
-}
-
-//-------------------------------------------------------------------------
-// GetLabelSize()
-//-------------------------------------------------------------------------
-double PlotPanel::GetLabelSize()
-{
-    return m_label_size;
-}
-
-//-------------------------------------------------------------------------
-// SetLabelSize()
-//-------------------------------------------------------------------------
-void PlotPanel::SetLabelSize(double size)
-{
-    m_label_size = size;
-}
-
-//-------------------------------------------------------------------------
-// OnShow()
-//-------------------------------------------------------------------------
-void PlotPanel::OnShow(wxShowEvent& event)
-{
-    this->Refresh();
-}
-
-//-------------------------------------------------------------------------
-// OnErase()
-//-------------------------------------------------------------------------
-void PlotPanel::OnErase(wxEraseEvent& event)
-{
-    event.Skip();
-}
-
-//-------------------------------------------------------------------------
-// OnSize()
-//-------------------------------------------------------------------------
-void PlotPanel::OnSize(wxSizeEvent& event)
-{
-    m_rCtrlPrev = m_rCtrl;
-    m_rCtrl     = GetClientRect();
-    if(m_use_bitmap)
-    {
-        if(!m_oImage.IsOk())
-        {
-            m_oImage.Create(m_rCtrl.GetWidth(), m_rCtrl.GetHeight(), true);
-        }
-        else
-        {
-            m_oImage.Rescale(m_rCtrl.GetWidth(), m_rCtrl.GetHeight());
-        }
-        m_pBmp = new wxBitmap(m_oImage, wxBITMAP_SCREEN_DEPTH);
-        m_firstPass = true;
-    }
-    this->Refresh();
-}
-
-//-------------------------------------------------------------------------
-// OnMouseMove()
-//-------------------------------------------------------------------------
-void PlotPanel::OnMouseMove(wxMouseEvent& event)
-{
-//    if(m_mouseDown)
-//    {
-//        paintNow();
-//    }
-}
-
-//-------------------------------------------------------------------------
-// OnMouseLeftDown()
-//-------------------------------------------------------------------------
-void PlotPanel::OnMouseLeftDown(wxMouseEvent& event)
-{
-}
-
-//-------------------------------------------------------------------------
-// OnMouseRightDown()
-//-------------------------------------------------------------------------
-void PlotPanel::OnMouseRightDown(wxMouseEvent& event)
-{
-}
-
-//-------------------------------------------------------------------------
-// OnMouseWheelMoved()
-//-------------------------------------------------------------------------
-void PlotPanel::OnMouseWheelMoved(wxMouseEvent& event)
-{
-}
-
-//-------------------------------------------------------------------------
-// OnMouseLeftUp()
-//-------------------------------------------------------------------------
-void PlotPanel::OnMouseLeftUp(wxMouseEvent& event)
-{
-    m_mouseDown = false;
-}
-
-//-------------------------------------------------------------------------
-// SetZoomFactor()
-//-------------------------------------------------------------------------
-double PlotPanel::SetZoomFactor(double zf)
-{
-    if((zf > 0) && (zf < 5.0))
-    {
-        m_zoomFactor = zf;
-    }
-    return zf;
-}
-
-//-------------------------------------------------------------------------
-// GetZoomFactor()
-//-------------------------------------------------------------------------
-double PlotPanel::GetZoomFactor(double zf)
-{
-    return m_zoomFactor;
-}
-
-//-------------------------------------------------------------------------
-// draw()
-//-------------------------------------------------------------------------
-void PlotPanel::draw(wxAutoBufferedPaintDC& pDC)
-{
-    printf("PlotPanel::draw()");
-    wxMemoryDC m_mDC;
-    m_mDC.SelectObject(*m_pBmp);
-    m_rCtrl  = GetClientRect();
-    m_rGrid  = m_rCtrl;
-
-    m_rGrid = m_rGrid.Deflate(PLOT_BORDER + (XLEFT_OFFSET/2), (PLOT_BORDER + (YBOTTOM_OFFSET/2)));
-    m_rGrid.Offset(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER);
-
-    pDC.Clear();
-    m_rPlot = wxRect(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER, m_rGrid.GetWidth(), m_rGrid.GetHeight());
-    if(m_firstPass)
-    {
-        m_firstPass = false;
-        m_mDC.FloodFill(0, 0, VERY_LTGREY_COLOR);
-
-        // Draw a filled rectangle with aborder
-        wxBrush ltGraphBkgBrush = wxBrush(DARK_BLUE_COLOR);
-        m_mDC.SetBrush(ltGraphBkgBrush);
-        m_mDC.SetPen(wxPen(BLACK_COLOR, 0));
-        m_mDC.DrawRectangle(m_rPlot);
-    }
-    if(m_newdata)
-    {
-        m_newdata = false;
-        int t = m_rPlot.GetTop();
-        int l = m_rPlot.GetLeft();
-//        int r = m_rPlot.GetRight();
-        int h = m_rPlot.GetHeight();
-        int w = m_rPlot.GetWidth();
-        pDC.Blit(l, t, w, h, &m_mDC, l, t);
-    }
-    drawGraticule(pDC);
-    m_mDC.SetBrush(wxNullBrush);
-    m_mDC.SelectObject(wxNullBitmap);
-}
-
-//-------------------------------------------------------------------------
-// drawGraticule()
-//-------------------------------------------------------------------------
-void PlotPanel::drawGraticule(wxAutoBufferedPaintDC& pDC)
-{
-    int p;
-    char buf[15];
-    wxString s;
-
-    // Vertical gridlines
-    pDC.SetPen(m_penShortDash);
-    for(p = (PLOT_BORDER + XLEFT_OFFSET + GRID_INCREMENT); p < ((m_rGrid.GetWidth() - XLEFT_OFFSET) + GRID_INCREMENT); p += GRID_INCREMENT)
-    {
-        pDC.DrawLine(p, (m_rGrid.GetHeight() + PLOT_BORDER), p, PLOT_BORDER);
-    }
-    // Horizontal gridlines
-    pDC.SetPen(m_penDotDash);
-    for(p = (m_rGrid.GetHeight() - GRID_INCREMENT); p > PLOT_BORDER; p -= GRID_INCREMENT)
-    {
-        pDC.DrawLine(PLOT_BORDER + XLEFT_OFFSET, (p + PLOT_BORDER), (m_rGrid.GetWidth() + PLOT_BORDER + XLEFT_OFFSET), (p + PLOT_BORDER));
-    }
-    // Label the X-Axis
-    pDC.SetPen(wxPen(GREY_COLOR, 1));
-    for(p = GRID_INCREMENT; p < (m_rGrid.GetWidth() - YBOTTOM_OFFSET); p += GRID_INCREMENT)
-    {
-        sprintf(buf, "%1.1f Hz",(double)(p / 10));
-        pDC.DrawText(buf, p - PLOT_BORDER + XLEFT_OFFSET, m_rGrid.GetHeight() + YBOTTOM_OFFSET/2);
-    }
-    // Label the Y-Axis
-    //for(p = GRID_INCREMENT; p < (h - YBOTTOM_OFFSET); p += GRID_INCREMENT)
-    for(p = (m_rGrid.GetHeight() - GRID_INCREMENT); p > PLOT_BORDER; p -= GRID_INCREMENT)
-    {
-        sprintf(buf, "%1.0f", (double)((m_rGrid.GetHeight() - p) * -10));
-        pDC.DrawText(buf, XLEFT_TEXT_OFFSET, p);
-    }
-}
-
-//-------------------------------------------------------------------------
-// paintEvent()
-//
-// Called by the system of by wxWidgets when the panel needs
-// to be redrawn. You can also trigger this call by calling
-// Refresh()/Update().
-//-------------------------------------------------------------------------
-void PlotPanel::OnPaint(wxPaintEvent & evt)
-{
-    wxAutoBufferedPaintDC pdc(this);
-    draw(pdc);
-}
-
diff --git a/fdmdv2/tags/0.99-Beta/src/fdmdv2_plot.h b/fdmdv2/tags/0.99-Beta/src/fdmdv2_plot.h
deleted file mode 100644 (file)
index 25309d3..0000000
+++ /dev/null
@@ -1,150 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_plot.h
-// Purpose:         Declares simple wxWidgets application with GUI
-// Created:         Apr. 10, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-//#include "fdmdv2_main.h"
-#ifndef __FDMDV2_PLOT__
-#define __FDMDV2_PLOT__
-#include <wx/wx.h>
-#include <wx/aui/auibook.h>
-#include <wx/rawbmp.h>
-#include <wx/image.h>
-#include <wx/dcbuffer.h>
-
-#define MAX_ZOOM            7
-#define MAX_BMP_X           (400 * MAX_ZOOM)
-#define MAX_BMP_Y           (400 * MAX_ZOOM)
-#define DATA_LINE_HEIGHT    10
-#define TEXT_BASELINE_OFFSET_Y  -5
-
-
-#define wxUSE_FILEDLG       1
-#define wxUSE_LIBPNG        1
-#define wxUSE_LIBJPEG       1
-#define wxUSE_GIF           1
-#define wxUSE_PCX           1
-#define wxUSE_LIBTIFF       1
-
-#define PLOT_BORDER         12
-#define XLEFT_OFFSET        40
-#define XLEFT_TEXT_OFFSET   6
-#define YBOTTOM_OFFSET      20
-#define YBOTTOM_TEXT_OFFSET 15
-#define GRID_INCREMENT      50
-
-#define BLACK_COLOR         wxColor(0x00, 0x00, 0x00)
-#define GREY_COLOR          wxColor(0x80, 0x80, 0x80)
-#define DARK_GREY_COLOR     wxColor(0x40, 0x40, 0x40)
-#define MEDIUM_GREY_COLOR   wxColor(0xC0, 0xC0, 0xC0)
-#define LIGHT_GREY_COLOR    wxColor(0xE0, 0xE0, 0xE0)
-#define VERY_LTGREY_COLOR   wxColor(0xF8, 0xF8, 0xF8)
-#define WHITE_COLOR         wxColor(0xFF, 0xFF, 0xFF)
-
-#define DARK_BLUE_COLOR     wxColor(0x00, 0x00, 0x60)
-#define BLUE_COLOR          wxColor(0x00, 0x00, 0xFF)
-#define LIGHT_BLUE_COLOR    wxColor(0x80, 0x80, 0xFF)
-
-#define RED_COLOR           wxColor(0xFF, 0x5E, 0x5E)
-#define LIGHT_RED_COLOR     wxColor(0xFF, 0xE0, 0xE0)
-#define DARK_RED_COLOR      wxColor(0xFF, 0x00, 0x00)
-#define PINK_COLOR          wxColor(0xFF, 0x80, 0xFF)
-
-#define LIGHT_GREEN_COLOR   wxColor(0xE3, 0xFF, 0xE0)
-#define GREEN_COLOR         wxColor(0x95, 0xFF, 0x8A)
-#define DARK_GREEN_COLOR    wxColor(0x20, 0xFF, 0x08)
-#define VERY_GREEN_COLOR    wxColor(0x00, 0xFF, 0x00)
-
-#define YELLOW_COLOR        wxColor(0xFF, 0xFF, 0x5E)
-#define LIGHT_YELLOW_COLOR  wxColor(0xFF, 0xFF, 0xB5)
-#define DARK_YELLOW_COLOR   wxColor(0xFF, 0xFF, 0x08)
-
-class MainFrame;
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class PlotPanel
-//
-// @class $(Name)
-// @author $(User)
-// @date $(Date)
-// @file $(CurrentFileName).$(CurrentFileExt)
-// @brief
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class PlotPanel : public wxPanel
-{
-    public:
-        PlotPanel(wxFrame* parent);
-        ~PlotPanel();
-        wxPen               m_penShortDash;
-        wxPen               m_penDotDash;
-        wxPen               m_penSolid;
-        wxRect              m_rCtrlPrev;
-        wxRect              m_rCtrl;
-        wxRect              m_rGrid;
-        wxRect              m_rPlot;
-        MainFrame           *m_pTopFrame;
-        wxAuiNotebook       *m_pNoteBook;
-        double              m_label_size;
-        wxSize              m_Bufsz;
-        bool                m_newdata;
-        wxImage             m_oImage;
-        wxBitmap            *m_pBmp;
-        wxNativePixelData   *m_pPix;
-
-        // some useful events
-        void            OnMouseMove(wxMouseEvent& event);
-        virtual void    OnMouseLeftDown(wxMouseEvent& event);
-        void            OnMouseLeftUp(wxMouseEvent& event);
-        virtual void    OnMouseRightDown(wxMouseEvent& event);
-        void            OnMouseWheelMoved(wxMouseEvent& event);
-        void            OnClose(wxCloseEvent& event ){ event.Skip(); }
-        void            OnSize( wxSizeEvent& event );
-        void            OnErase(wxEraseEvent& event);
-        void            OnPaint(wxPaintEvent& event);
-        //void OnUpdateUI( wxUpdateUIEvent& event ){ event.Skip(); }
-
-        void            paintEvent(wxPaintEvent & evt);
-        virtual void    draw(wxAutoBufferedPaintDC&  pdc);
-        virtual void    drawGraticule(wxAutoBufferedPaintDC&  pdc);
-        virtual double  SetZoomFactor(double zf);
-        virtual double  GetZoomFactor(double zf);
-        virtual void    OnShow(wxShowEvent& event);
-        virtual double  GetLabelSize();
-        virtual void    SetLabelSize(double size);
-
-    protected:
-        int             m_x;
-        int             m_y;
-        int             m_left;
-        int             m_top;
-        int             m_prev_w;
-        int             m_prev_h;
-        int             m_prev_x;
-        int             m_prev_y;
-        bool            m_use_bitmap;
-        bool            m_clip;
-        bool            m_rubberBand;
-        bool            m_mouseDown;
-        bool            m_firstPass;
-        double          m_zoomFactor;
-        int             m_greyscale;
-        int             m_line_color;
-    DECLARE_EVENT_TABLE()
-};
-#endif //__FDMDV2_PLOT__
diff --git a/fdmdv2/tags/0.99-Beta/src/fdmdv2_plot_scalar.cpp b/fdmdv2/tags/0.99-Beta/src/fdmdv2_plot_scalar.cpp
deleted file mode 100644 (file)
index 7a07f46..0000000
+++ /dev/null
@@ -1,281 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_plot_scalar.cpp
-// Purpose:         Plots scalar amplitude against time
-// Created:         June 22, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#include <string.h>
-#include "wx/wx.h"
-#include "fdmdv2_main.h"
-#include "fdmdv2_plot_scalar.h"
-
-BEGIN_EVENT_TABLE(PlotScalar, PlotPanel)
-    EVT_PAINT           (PlotScalar::OnPaint)
-    EVT_MOTION          (PlotScalar::OnMouseMove)
-    EVT_MOUSEWHEEL      (PlotScalar::OnMouseWheelMoved)
-    EVT_SIZE            (PlotScalar::OnSize)
-    EVT_SHOW            (PlotScalar::OnShow)
-//    EVT_ERASE_BACKGROUND(PlotScalar::OnErase)
-END_EVENT_TABLE()
-
-//----------------------------------------------------------------
-// PlotScalar()
-//----------------------------------------------------------------
-PlotScalar::PlotScalar(wxFrame* parent, 
-                       int    channels,           // number on channels to plot
-                      float  t_secs,             // time covered by entire x axis in seconds
-                      float  sample_period_secs, // time between each sample in seconds
-                      float  a_min,              // min ampltude of samples being plotted
-                      float  a_max,              // max ampltude of samples being plotted
-                      float  graticule_t_step,   // time step of x (time) axis graticule in seconds
-                      float  graticule_a_step,   // step of amplitude axis graticule
-                      const char a_fmt[],        // printf format string for amplitude axis labels
-                       int    mini                // true for mini-plot - don't draw graticule
-                      ): PlotPanel(parent)
-{
-    int i;
-
-    m_rCtrl = GetClientRect();
-
-    m_channels = channels;
-    m_t_secs = t_secs;
-    m_sample_period_secs = sample_period_secs;
-    m_a_min = a_min;
-    m_a_max = a_max;
-    m_graticule_t_step = graticule_t_step;
-    m_graticule_a_step = graticule_a_step;
-    assert(strlen(a_fmt) < 15);
-    strcpy(m_a_fmt, a_fmt);
-    m_mini = mini;
-
-    // work out number of samples we will store and allocate storage
-
-    m_samples = m_t_secs/m_sample_period_secs;
-    m_mem = new float[m_samples*m_channels];
-
-    for(i = 0; i < m_samples*m_channels; i++)
-    {
-        m_mem[i] = 0.0;
-    }
-}
-
-//----------------------------------------------------------------
-// ~PlotScalar()
-//----------------------------------------------------------------
-PlotScalar::~PlotScalar()
-{
-    delete m_mem;
-}
-
-//----------------------------------------------------------------
-// add_new_sample()
-//----------------------------------------------------------------
-void PlotScalar::add_new_sample(int channel, float sample)
-{
-    int i;
-    int offset = channel*m_samples;
-
-    assert(channel < m_channels);
-
-    for(i = 0; i < m_samples-1; i++)
-    {
-        m_mem[offset+i] = m_mem[offset+i+1];
-    }
-    m_mem[offset+m_samples-1] = sample;
-}
-
-//----------------------------------------------------------------
-// add_new_samples()
-//----------------------------------------------------------------
-void  PlotScalar::add_new_short_samples(int channel, short samples[], int length, float scale_factor)
-{
-    int i;
-    int offset = channel*m_samples;
-
-    assert(channel < m_channels);
-
-    for(i = 0; i < m_samples-length; i++)
-        m_mem[offset+i] = m_mem[offset+i+length];
-    for(; i < m_samples; i++)
-       m_mem[offset+i] = (float)*samples++/scale_factor;
-}
-
-//----------------------------------------------------------------
-// draw()
-//----------------------------------------------------------------
-void PlotScalar::draw(wxAutoBufferedPaintDC&  dc)
-{
-    float index_to_px;
-    float a_to_py;
-    int   i;
-    int   x, y;
-    int   prev_x, prev_y;
-    float a;
-
-    m_rCtrl = GetClientRect();
-    m_rGrid = m_rCtrl;
-    if (!m_mini)
-        m_rGrid = m_rGrid.Deflate(PLOT_BORDER + (XLEFT_OFFSET/2), (PLOT_BORDER + (YBOTTOM_OFFSET/2)));
-
-    //printf("h %d w %d\n", m_rCtrl.GetWidth(), m_rCtrl.GetHeight());
-    //printf("h %d w %d\n", m_rGrid.GetWidth(), m_rGrid.GetHeight());
-
-    // black background
-
-    dc.Clear();
-    if (m_mini)
-        m_rPlot = wxRect(0, 0, m_rGrid.GetWidth(), m_rGrid.GetHeight());        
-    else
-        m_rPlot = wxRect(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER, m_rGrid.GetWidth(), m_rGrid.GetHeight());
-   
-    wxBrush ltGraphBkgBrush = wxBrush(BLACK_COLOR);
-    dc.SetBrush(ltGraphBkgBrush);
-    dc.SetPen(wxPen(BLACK_COLOR, 0));
-    dc.DrawRectangle(m_rPlot);
-
-    index_to_px = (float)m_rGrid.GetWidth()/m_samples;
-    a_to_py = (float)m_rGrid.GetHeight()/(m_a_max - m_a_min);
-
-    wxPen pen;
-    pen.SetColour(DARK_GREEN_COLOR);
-    pen.SetWidth(1);
-    dc.SetPen(pen);
-
-    // draw all samples
-
-    prev_x = prev_y = 0; // stop warning
-
-    // plot each channel 
-
-    int offset;
-    for(offset=0; offset<m_channels*m_samples; offset+=m_samples) {
-
-        for(i = 0; i < m_samples; i++) {
-            x = index_to_px * i;
-            a = m_mem[offset+i];
-            if (a < m_a_min) a = m_a_min;
-            if (a > m_a_max) a = m_a_max;
-
-            // invert y axis and offset by minimum
-
-            y = m_rGrid.GetHeight() - a_to_py * a + m_a_min*a_to_py;
-
-            // put inside plot window
-
-            if (!m_mini) {
-                x += PLOT_BORDER + XLEFT_OFFSET;
-                y += PLOT_BORDER;
-            }
-
-            if (i)
-                dc.DrawLine(x, y, prev_x, prev_y);
-            prev_x = x; prev_y = y;
-        }
-    }
-
-    drawGraticule(dc);
-}
-
-//-------------------------------------------------------------------------
-// drawGraticule()
-//-------------------------------------------------------------------------
-void PlotScalar::drawGraticule(wxAutoBufferedPaintDC&  dc)
-{
-    float    t, a;
-    int      x, y, text_w, text_h;
-    char     buf[15];
-    wxString s;
-    float    sec_to_px;
-    float    a_to_py;
-
-    wxBrush ltGraphBkgBrush;
-    ltGraphBkgBrush.SetStyle(wxBRUSHSTYLE_TRANSPARENT);
-    ltGraphBkgBrush.SetColour(*wxBLACK);
-    dc.SetBrush(ltGraphBkgBrush);
-    dc.SetPen(wxPen(BLACK_COLOR, 1));
-
-    sec_to_px = (float)m_rGrid.GetWidth()/m_t_secs;
-    a_to_py = (float)m_rGrid.GetHeight()/(m_a_max - m_a_min);
-
-    // upper LH coords of plot area are (PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER)
-    // lower RH coords of plot area are (PLOT_BORDER + XLEFT_OFFSET + m_rGrid.GetWidth(), 
-    //                                   PLOT_BORDER + m_rGrid.GetHeight())
-
-    // Vertical gridlines
-
-    dc.SetPen(m_penShortDash);
-    for(t=0; t<=m_t_secs; t+=m_graticule_t_step) {
-       x = t*sec_to_px;
-       if (m_mini) {
-            dc.DrawLine(x, m_rGrid.GetHeight(), x, 0);
-        }
-        else {
-            x += PLOT_BORDER + XLEFT_OFFSET;
-            dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, PLOT_BORDER);
-        }
-        if (!m_mini) {
-            sprintf(buf, "%2.1fs", t);
-            GetTextExtent(buf, &text_w, &text_h);
-            dc.DrawText(buf, x - text_w/2, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET);
-        }
-    }
-
-    // Horizontal gridlines
-
-    dc.SetPen(m_penDotDash);
-    for(a=m_a_min; a<m_a_max; a+=m_graticule_a_step) {
-       y = m_rGrid.GetHeight() - a*a_to_py + m_a_min*a_to_py;
-       if (m_mini) {
-            dc.DrawLine(0, y, m_rGrid.GetWidth(), y);
-        }
-        else {
-            y += PLOT_BORDER;
-            dc.DrawLine(PLOT_BORDER + XLEFT_OFFSET, y, 
-                        (m_rGrid.GetWidth() + PLOT_BORDER + XLEFT_OFFSET), y);
-        }
-        if (!m_mini) {
-            sprintf(buf, m_a_fmt, a);
-            GetTextExtent(buf, &text_w, &text_h);
-            dc.DrawText(buf, PLOT_BORDER + XLEFT_OFFSET - text_w - XLEFT_TEXT_OFFSET, y-text_h/2);
-        }
-   }
-
-
-}
-
-//----------------------------------------------------------------
-// OnPaint()
-//----------------------------------------------------------------
-void PlotScalar::OnPaint(wxPaintEvent& event)
-{
-    wxAutoBufferedPaintDC dc(this);
-    draw(dc);
-}
-
-//----------------------------------------------------------------
-// OnSize()
-//----------------------------------------------------------------
-void PlotScalar::OnSize(wxSizeEvent& event)
-{
-}
-
-//----------------------------------------------------------------
-// OnShow()
-//----------------------------------------------------------------
-void PlotScalar::OnShow(wxShowEvent& event)
-{
-}
diff --git a/fdmdv2/tags/0.99-Beta/src/fdmdv2_plot_scalar.h b/fdmdv2/tags/0.99-Beta/src/fdmdv2_plot_scalar.h
deleted file mode 100644 (file)
index 7043987..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_plot_scalar.h
-// Purpose:         Defines a scalar plot derivative of fdmdv2_plot.
-// Created:         June 22, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#ifndef __FDMDV2_PLOT_SCALAR__
-#define __FDMDV2_PLOT_SCALAR__
-
-#include "fdmdv2_plot.h"
-#include "fdmdv2_defines.h"
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class PlotScalar
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class PlotScalar: public PlotPanel
-{
-    public:
-
-    PlotScalar(wxFrame* parent,
-               int   channels,
-              float t_secs, 
-              float sample_period_secs,
-              float a_min,
-              float a_max,
-              float graticule_t_step,   
-              float graticule_a_step,
-              const char  a_fmt[],
-               int   mini
-              );
-        ~PlotScalar();
-         void add_new_sample(int channel, float sample);
-         void add_new_short_samples(int channel, short samples[], int length, float scale_factor);
-
-    protected:
-
-         int      m_channels;
-        float    m_t_secs;
-        float    m_sample_period_secs;
-        float    m_a_min;
-        float    m_a_max;
-        float    m_graticule_t_step;   
-        float    m_graticule_a_step;
-        char     m_a_fmt[15];
-         int      m_mini;
-        int      m_samples;
-        float   *m_mem;              
-
-        void draw(wxAutoBufferedPaintDC&  dc);
-       void drawGraticule(wxAutoBufferedPaintDC&  dc);
-        void OnPaint(wxPaintEvent& event);
-        void OnSize(wxSizeEvent& event);
-        void OnShow(wxShowEvent& event);
-
-        DECLARE_EVENT_TABLE()
-};
-
-#endif // __FDMDV2_PLOT_SCALAR__
-
diff --git a/fdmdv2/tags/0.99-Beta/src/fdmdv2_plot_scatter.cpp b/fdmdv2/tags/0.99-Beta/src/fdmdv2_plot_scatter.cpp
deleted file mode 100644 (file)
index 3c0b155..0000000
+++ /dev/null
@@ -1,199 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_plot_scatter.cpp
-// Purpose:         A scatter plot derivative of fdmdv2_plot.
-// Created:         June 24, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#include <string.h>
-#include "wx/wx.h"
-#include "fdmdv2_plot_scatter.h"
-
-BEGIN_EVENT_TABLE(PlotScatter, PlotPanel)
-    EVT_PAINT           (PlotScatter::OnPaint)
-    EVT_MOTION          (PlotScatter::OnMouseMove)
-    EVT_MOUSEWHEEL      (PlotScatter::OnMouseWheelMoved)
-    EVT_SIZE            (PlotScatter::OnSize)
-    EVT_SHOW            (PlotScatter::OnShow)
-//    EVT_ERASE_BACKGROUND(PlotScatter::OnErase)
-END_EVENT_TABLE()
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// PlotScatter
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-PlotScatter::PlotScatter(wxFrame* parent) : PlotPanel(parent)
-{
-    int i;
-
-    for(i=0; i < SCATTER_MEM_SYMS_MAX; i++)
-    {
-        m_mem[i].real = 0.0;
-        m_mem[i].imag = 0.0;
-    }
-
-    m_filter_max_xy = 0.1;
-
-    // defaults so we start off with something sensible
-
-    Nsym = 14+1;
-    scatterMemSyms = ((int)(SCATTER_MEM_SECS*(Nsym/DT)));
-    assert(scatterMemSyms <= SCATTER_MEM_SYMS_MAX);
-        
-}
-
-// changing number of carriers changes number of symbols to plot
-void PlotScatter::setNc(int Nc) {
-    Nsym = Nc+1;
-    assert(Nsym <= (FDMDV_NC_MAX+1));
-    scatterMemSyms = ((int)(SCATTER_MEM_SECS*(Nsym/DT)));
-    assert(scatterMemSyms <= SCATTER_MEM_SYMS_MAX);
-}
-
-//----------------------------------------------------------------
-// draw()
-//----------------------------------------------------------------
-void PlotScatter::draw(wxAutoBufferedPaintDC& dc)
-{
-    float x_scale;
-    float y_scale;
-    int   i;
-    int   x;
-    int   y;
-    wxColour sym_to_colour[] = {wxColor(0,0,255), 
-                                wxColor(0,255,0),
-                                wxColor(0,255,255),
-                                wxColor(255,0,0),
-                                wxColor(255,0,255), 
-                                wxColor(255,255,0),
-                                wxColor(255,255,255),
-                                wxColor(0,0,255), 
-                                wxColor(0,255,0),
-                                wxColor(0,255,255),
-                                wxColor(255,0,0),
-                                wxColor(255,0,255), 
-                                wxColor(255,255,0),
-                                wxColor(255,255,255),
-                                wxColor(0,0,255), 
-                                wxColor(0,255,0),
-                                wxColor(0,255,255),
-                                wxColor(255,0,0),
-                                wxColor(255,0,255)
-    };
-
-    m_rCtrl = GetClientRect();
-    m_rGrid = m_rCtrl;
-    m_rGrid = m_rGrid.Deflate(PLOT_BORDER + (XLEFT_OFFSET/2), (PLOT_BORDER + (YBOTTOM_OFFSET/2)));
-
-    // black background
-
-    dc.Clear();
-    m_rPlot = wxRect(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER, m_rGrid.GetWidth(), m_rGrid.GetHeight());
-    wxBrush ltGraphBkgBrush = wxBrush(BLACK_COLOR);
-    dc.SetBrush(ltGraphBkgBrush);
-    dc.SetPen(wxPen(BLACK_COLOR, 0));
-    dc.DrawRectangle(m_rPlot);
-    wxPen pen;
-    pen.SetWidth(1); // note this is ignored by DrawPoint
-
-    // automatically scale, first measure the maximum value
-
-    float max_xy = 1E-12;
-    float real,imag;
-    for(i=0; i< scatterMemSyms; i++) {
-        real = fabs(m_mem[i].real);
-        imag = fabs(m_mem[i].imag);
-        if (real > max_xy)
-            max_xy = real;
-        if (imag > max_xy)
-            max_xy = imag;
-    }
-
-    // smooth it out and set a lower limit to prevent didev by 0 issues
-
-    m_filter_max_xy = BETA*m_filter_max_xy + (1 - BETA)*2.5*max_xy;
-    if (m_filter_max_xy < 0.001)
-        m_filter_max_xy = 0.001;
-
-    // quantise to log steps to prevent scatter scaling bobbing about too
-    // much as scaling varies
-
-    float quant_m_filter_max_xy = exp(floor(0.5+log(m_filter_max_xy)));
-    //printf("max_xy: %f m_filter_max_xy: %f quant_m_filter_max_xy: %f\n", max_xy, m_filter_max_xy, quant_m_filter_max_xy);
-
-    x_scale = (float)m_rGrid.GetWidth()/quant_m_filter_max_xy;
-    y_scale = (float)m_rGrid.GetHeight()/quant_m_filter_max_xy;
-
-    // draw all samples
-
-    for(i = 0; i < scatterMemSyms; i++)
-    {
-        x = x_scale * m_mem[i].real + m_rGrid.GetWidth()/2;
-        y = y_scale * m_mem[i].imag + m_rGrid.GetHeight()/2;
-       x += PLOT_BORDER + XLEFT_OFFSET;
-       y += PLOT_BORDER;
-        pen.SetColour(sym_to_colour[i%Nsym]);
-        dc.SetPen(pen);
-       dc.DrawPoint(x, y);
-    }
-}
-
-//----------------------------------------------------------------
-// add_new_samples()
-//----------------------------------------------------------------
-void PlotScatter::add_new_samples(COMP samples[])
-{
-    int i,j;
-
-    // shift memory
-
-    for(i = 0; i < scatterMemSyms - Nsym; i++)
-    {
-        m_mem[i] = m_mem[i+Nsym];
-    }
-
-    // new samples
-
-    for(j=0; i < scatterMemSyms; i++,j++)
-    {
-        m_mem[i] = samples[j];
-    }
-}
-
-//----------------------------------------------------------------
-// OnPaint()
-//----------------------------------------------------------------
-void PlotScatter::OnPaint(wxPaintEvent& event)
-{
-    wxAutoBufferedPaintDC dc(this);
-    draw(dc);
-}
-
-//----------------------------------------------------------------
-// OnSize()
-//----------------------------------------------------------------
-void PlotScatter::OnSize(wxSizeEvent& event)
-{
-    // todo: clear screen
-}
-
-//----------------------------------------------------------------
-// OnShow()
-//----------------------------------------------------------------
-void PlotScatter::OnShow(wxShowEvent& event)
-{
-}
-
diff --git a/fdmdv2/tags/0.99-Beta/src/fdmdv2_plot_scatter.h b/fdmdv2/tags/0.99-Beta/src/fdmdv2_plot_scatter.h
deleted file mode 100644 (file)
index 702f633..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_plot_scatter.h
-// Purpose:         A scatter plot derivative of fdmdv2_plot.
-// Created:         June 24, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#ifndef __FDMDV2_PLOT_SCATTER__
-#define __FDMDV2_PLOT_SCATTER__
-
-#include "comp.h"
-#include "fdmdv2_plot.h"
-#include "fdmdv2_defines.h"
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class PlotScatter
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class PlotScatter : public PlotPanel
-{
-    public:
-        PlotScatter(wxFrame* parent);
-        ~PlotScatter(){};
-       void add_new_samples(COMP samples[]);
-       void setNc(int Nc);
-
-    protected:
-        COMP m_mem[SCATTER_MEM_SYMS_MAX];
-        COMP m_new_samples[FDMDV_NC_MAX+1];
-
-        void draw(wxAutoBufferedPaintDC&  dc);
-        void OnPaint(wxPaintEvent& event);
-        void OnSize(wxSizeEvent& event);
-        void OnShow(wxShowEvent& event);
-
-        DECLARE_EVENT_TABLE()
-
-    private:
-        int   Nsym;
-        int   scatterMemSyms;
-        float m_filter_max_xy;
-};
-
-#endif //__FDMDV2_PLOT_SCATTER__
diff --git a/fdmdv2/tags/0.99-Beta/src/fdmdv2_plot_spectrum.cpp b/fdmdv2/tags/0.99-Beta/src/fdmdv2_plot_spectrum.cpp
deleted file mode 100644 (file)
index d9c72d0..0000000
+++ /dev/null
@@ -1,266 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_plot_waterfall.cpp
-// Purpose:         Implements a waterfall plot derivative of fdmdv2_plot.
-// Created:         June 23, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#include <string.h>
-#include "wx/wx.h"
-
-#include "fdmdv2_main.h"
-
-extern float g_avmag[];                 // average mag data passed to draw() 
-void fdmdv2_clickTune(float frequency); // callback to pass new click freq
-
-BEGIN_EVENT_TABLE(PlotSpectrum, PlotPanel)
-    EVT_MOTION          (PlotSpectrum::OnMouseMove)
-    EVT_LEFT_DOWN       (PlotSpectrum::OnMouseLeftDown)
-    EVT_LEFT_UP         (PlotSpectrum::OnMouseLeftUp)
-    EVT_MOUSEWHEEL      (PlotSpectrum::OnMouseWheelMoved)
-    EVT_PAINT           (PlotSpectrum::OnPaint)
-    EVT_SHOW            (PlotSpectrum::OnShow)
-END_EVENT_TABLE()
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class PlotSpectrum
-//
-// @class $(Name)
-// @author $(User)
-// @date $(Date)
-// @file $(CurrentFileName).$(CurrentFileExt)
-// @brief
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-PlotSpectrum::PlotSpectrum(wxFrame* parent, float *magdB, int n_magdB, 
-                           float min_mag_db, float max_mag_db, bool clickTune): PlotPanel(parent)
-{
-    m_greyscale     = 0;
-    m_Bufsz         = GetMaxClientSize();
-    m_newdata       = false;
-    m_firstPass     = true;
-    m_line_color    = 0;
-    SetLabelSize(10.0);
-
-    m_magdB         = magdB;
-    m_n_magdB       = n_magdB;     // number of points in magdB that covers 0 ... MAX_F_HZ of spectrum
-    m_max_mag_db    = max_mag_db;
-    m_min_mag_db    = min_mag_db;
-    m_rxFreq        = 0.0;
-    m_clickTune     = clickTune;
-}
-
-//----------------------------------------------------------------
-// ~PlotSpectrum()
-//----------------------------------------------------------------
-PlotSpectrum::~PlotSpectrum()
-{
-}
-
-//----------------------------------------------------------------
-// OnSize()
-//----------------------------------------------------------------
-void PlotSpectrum::OnSize(wxSizeEvent& event) {
-}
-
-//----------------------------------------------------------------
-// OnPaint()
-//----------------------------------------------------------------
-void PlotSpectrum::OnPaint(wxPaintEvent& event)
-{
-    wxAutoBufferedPaintDC dc(this);
-    draw(dc);
-}
-
-//----------------------------------------------------------------
-// OnShow()
-//----------------------------------------------------------------
-void PlotSpectrum::OnShow(wxShowEvent& event)
-{
-}
-
-//----------------------------------------------------------------
-// draw()
-//----------------------------------------------------------------
-void PlotSpectrum::draw(wxAutoBufferedPaintDC& dc)
-{
-    m_rCtrl  = GetClientRect();
-
-    // m_rGrid is coords of inner window we actually plot to.  We deflate it a bit
-    // to leave room for axis labels.  We need to work this out every time we draw
-    // as OnSize() may not be called before OnPaint(), for example when a new tab
-    // is selected
-
-    m_rGrid  = m_rCtrl;
-    m_rGrid = m_rGrid.Deflate(PLOT_BORDER + (XLEFT_OFFSET/2), (PLOT_BORDER + (YBOTTOM_OFFSET/2)));
-
-    dc.Clear();
-
-    // black background
-
-    m_rPlot = wxRect(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER, m_rGrid.GetWidth(), m_rGrid.GetHeight());
-    wxBrush ltGraphBkgBrush = wxBrush(BLACK_COLOR);
-    dc.SetBrush(ltGraphBkgBrush);
-    dc.SetPen(wxPen(BLACK_COLOR, 0));
-    dc.DrawRectangle(m_rPlot);
-
-    // draw spectrum
-
-    int   x, y, prev_x, prev_y, index;
-    float index_to_px, mag_dB_to_py, mag;
-
-    m_newdata = false;
-
-    wxPen pen;
-    pen.SetColour(DARK_GREEN_COLOR);
-    pen.SetWidth(1);
-    dc.SetPen(pen);
-
-    index_to_px = (float)m_rGrid.GetWidth()/m_n_magdB;
-    mag_dB_to_py = (float)m_rGrid.GetHeight()/(m_max_mag_db - m_min_mag_db);
-
-    prev_x = PLOT_BORDER + XLEFT_OFFSET;
-    prev_y = PLOT_BORDER;
-    for(index = 0; index < m_n_magdB; index++)
-    {
-        x = index*index_to_px;
-        mag = m_magdB[index];
-        if (mag > m_max_mag_db) mag = m_max_mag_db;
-        if (mag < m_min_mag_db) mag = m_min_mag_db;
-        y = -(mag - m_max_mag_db) * mag_dB_to_py;
-
-        x += PLOT_BORDER + XLEFT_OFFSET;
-        y += PLOT_BORDER;
-
-        if (index)
-            dc.DrawLine(x, y, prev_x, prev_y);
-        prev_x = x; prev_y = y;
-    }
-
-    // and finally draw Graticule
-
-    drawGraticule(dc);
-
-}
-
-//-------------------------------------------------------------------------
-// drawGraticule()
-//-------------------------------------------------------------------------
-void PlotSpectrum::drawGraticule(wxAutoBufferedPaintDC&  dc)
-{
-    int      x, y, text_w, text_h;
-    char     buf[15];
-    wxString s;
-    float    f, mag, freq_hz_to_px, mag_dB_to_py;
-
-    wxBrush ltGraphBkgBrush;
-    ltGraphBkgBrush.SetStyle(wxBRUSHSTYLE_TRANSPARENT);
-    ltGraphBkgBrush.SetColour(*wxBLACK);
-    dc.SetBrush(ltGraphBkgBrush);
-    dc.SetPen(wxPen(BLACK_COLOR, 1));
-
-    freq_hz_to_px = (float)m_rGrid.GetWidth()/(MAX_F_HZ-MIN_F_HZ);
-    mag_dB_to_py = (float)m_rGrid.GetHeight()/(m_max_mag_db - m_min_mag_db);
-
-    // upper LH coords of plot area are (PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER)
-    // lower RH coords of plot area are (PLOT_BORDER + XLEFT_OFFSET + m_rGrid.GetWidth(), 
-    //                                   PLOT_BORDER + m_rGrid.GetHeight())
-
-    // Check if small screen size means text will overlap
-
-    int textXStep = STEP_F_HZ*freq_hz_to_px;
-    int textYStep = STEP_MAG_DB*mag_dB_to_py;
-    sprintf(buf, "%4.0fHz", (float)MAX_F_HZ - STEP_F_HZ);
-    GetTextExtent(buf, &text_w, &text_h);
-    int overlappedText = (text_w > textXStep) || (text_h > textYStep);
-    //printf("text_w: %d textXStep: %d text_h: %d textYStep: %d  overlappedText: %d\n", text_w, textXStep, 
-    //      text_h, textYStep, overlappedText);
-
-    // Vertical gridlines
-
-    for(f=STEP_F_HZ; f<MAX_F_HZ; f+=STEP_F_HZ) {
-       x = f*freq_hz_to_px;
-       x += PLOT_BORDER + XLEFT_OFFSET;
-
-        dc.SetPen(m_penShortDash);
-        dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, PLOT_BORDER);
-        dc.SetPen(wxPen(BLACK_COLOR, 1));
-        dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET);
-
-        sprintf(buf, "%4.0fHz", f);
-       GetTextExtent(buf, &text_w, &text_h);
-        if (!overlappedText)
-            dc.DrawText(buf, x - text_w/2, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET);
-    }
-
-    dc.SetPen(wxPen(BLACK_COLOR, 1));
-    for(f=STEP_MINOR_F_HZ; f<MAX_F_HZ; f+=STEP_MINOR_F_HZ) 
-    {
-        x = f*freq_hz_to_px;
-        x += PLOT_BORDER + XLEFT_OFFSET;
-        dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET-5);
-    }
-    
-    // Horizontal gridlines
-
-    dc.SetPen(m_penDotDash);
-    for(mag=m_min_mag_db; mag<=m_max_mag_db; mag+=STEP_MAG_DB) {
-       y = -(mag - m_max_mag_db) * mag_dB_to_py;
-       y += PLOT_BORDER;
-       dc.DrawLine(PLOT_BORDER + XLEFT_OFFSET, y, 
-                   (m_rGrid.GetWidth() + PLOT_BORDER + XLEFT_OFFSET), y);
-        sprintf(buf, "%3.0fdB", mag);
-       GetTextExtent(buf, &text_w, &text_h);
-        if (!overlappedText)
-            dc.DrawText(buf, PLOT_BORDER + XLEFT_OFFSET - text_w - XLEFT_TEXT_OFFSET, y-text_h/2);
-    }
-
-    // red rx tuning line
-    
-    if (m_rxFreq != 0.0) {
-        dc.SetPen(wxPen(RED_COLOR, 2));
-        x = m_rxFreq*freq_hz_to_px;
-        x += PLOT_BORDER + XLEFT_OFFSET;
-        //printf("m_rxFreq %f x %d\n", m_rxFreq, x);
-        dc.DrawLine(x, m_rGrid.GetHeight()+ PLOT_BORDER, x, m_rCtrl.GetHeight());
-    }
-
-}
-
-//-------------------------------------------------------------------------
-// OnMouseDown()
-//-------------------------------------------------------------------------
-void PlotSpectrum::OnMouseLeftDown(wxMouseEvent& event)
-{
-    m_mouseDown = true;
-    wxClientDC dc(this);
-
-    wxPoint pt(event.GetLogicalPosition(dc));
-
-    // map x coord to edges of actual plot
-    pt.x -= PLOT_BORDER + XLEFT_OFFSET;
-    pt.y -= PLOT_BORDER;
-
-    // valid click if inside of plot
-    if ((pt.x >= 0) && (pt.x <= m_rGrid.GetWidth()) && (pt.y >=0) && m_clickTune) {
-        float freq_hz_to_px = (float)m_rGrid.GetWidth()/(MAX_F_HZ-MIN_F_HZ);
-        float clickFreq = (float)pt.x/freq_hz_to_px;
-
-        // see PlotWaterfall::OnMouseDown()
-
-        fdmdv2_clickTune(clickFreq);
-    }
-}
diff --git a/fdmdv2/tags/0.99-Beta/src/fdmdv2_plot_spectrum.h b/fdmdv2/tags/0.99-Beta/src/fdmdv2_plot_spectrum.h
deleted file mode 100644 (file)
index 353f312..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_plot_spectrum.h
-// Purpose:         Defines a spectrum plot derived from fdmdv2_plot class.
-// Created:         June 22, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#ifndef __FDMDV2_PLOT_SPECTRUM__
-#define __FDMDV2_PLOT_SPECTRUM__
-
-#include "fdmdv2_plot.h"
-#include "fdmdv2_defines.h"
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class Waterfall
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class PlotSpectrum : public PlotPanel
-{
-    public:
-    PlotSpectrum(wxFrame* parent, float *magdB, int n_magdB, 
-                 float min_mag_db=MIN_MAG_DB, float max_mag_db=MAX_MAG_DB, bool clickTune=true);
-        ~PlotSpectrum();
-        void setRxFreq(float rxFreq) { m_rxFreq = rxFreq; }
-        void setFreqScale(int n_magdB) { m_n_magdB = n_magdB; }
-
-    protected:
-        void        OnPaint(wxPaintEvent& event);
-        void        OnSize(wxSizeEvent& event);
-        void        OnShow(wxShowEvent& event);
-        void        drawGraticule(wxAutoBufferedPaintDC& dc);
-        void        draw(wxAutoBufferedPaintDC& dc);
-        void        OnMouseLeftDown(wxMouseEvent& event);
-
-   private:
-        float       m_rxFreq;
-        float       m_max_mag_db;
-        float       m_min_mag_db;
-        float      *m_magdB;
-        int         m_n_magdB;  
-        bool        m_clickTune;
-
-        DECLARE_EVENT_TABLE()
-};
-
-#endif //__FDMDV2_PLOT_SPECTRUM__
diff --git a/fdmdv2/tags/0.99-Beta/src/fdmdv2_plot_waterfall.cpp b/fdmdv2/tags/0.99-Beta/src/fdmdv2_plot_waterfall.cpp
deleted file mode 100644 (file)
index 4a8b447..0000000
+++ /dev/null
@@ -1,483 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_plot_waterfall.cpp
-// Purpose:         Implements a waterfall plot derivative of fdmdv2_plot.
-// Created:         June 22, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#include <string.h>
-#include "wx/wx.h"
-#include "fdmdv2_main.h"
-
-extern float g_avmag[];                 // av mag spec passed in to draw() 
-void fdmdv2_clickTune(float frequency); // callback to pass new click freq
-
-BEGIN_EVENT_TABLE(PlotWaterfall, PlotPanel)
-    EVT_PAINT           (PlotWaterfall::OnPaint)
-    EVT_MOTION          (PlotWaterfall::OnMouseMove)
-    EVT_LEFT_DOWN       (PlotWaterfall::OnMouseLeftDown)
-    EVT_RIGHT_DOWN      (PlotWaterfall::OnMouseRightDown)
-    EVT_LEFT_UP         (PlotWaterfall::OnMouseLeftUp)
-    EVT_MOUSEWHEEL      (PlotWaterfall::OnMouseWheelMoved)
-    EVT_SIZE            (PlotWaterfall::OnSize)
-    EVT_SHOW            (PlotWaterfall::OnShow)
-END_EVENT_TABLE()
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class WaterfallPlot
-//
-// @class   WaterfallPlot
-// @author  David Witten
-// @date    $(Date)
-// @file    $(CurrentFileName).$(CurrentFileExt)
-// @brief
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-PlotWaterfall::PlotWaterfall(wxFrame* parent, bool graticule, int colour): PlotPanel(parent)
-{
-
-    for(int i = 0; i < 255; i++)
-    {
-        m_heatmap_lut[i] = heatmap((float)i, 0.0, 255.0);
-    }
-    m_graticule     = graticule;
-    m_colour        = colour;
-    m_Bufsz         = GetMaxClientSize();
-    m_newdata       = false;
-    m_firstPass     = true;
-    m_line_color    = 0;
-    m_modem_stats_max_f_hz = MODEM_STATS_MAX_F_HZ;
-
-    SetLabelSize(10.0);
-
-    m_pBmp = NULL;
-    m_max_mag = MAX_MAG_DB;
-    m_min_mag = MIN_MAG_DB;
-}
-
-// When the window size gets set we can work outthe size of the window
-// we plot in and allocate a bit map of the correct size
-void PlotWaterfall::OnSize(wxSizeEvent& event) 
-{
-    // resize bit map
-
-    delete m_pBmp;
-    
-    m_rCtrl  = GetClientRect();
-
-    // m_rGrid is coords of inner window we actually plot to.  We deflate it a bit
-    // to leave room for axis labels.
-
-    m_rGrid  = m_rCtrl;
-    m_rGrid = m_rGrid.Deflate(PLOT_BORDER + (XLEFT_OFFSET/2), (PLOT_BORDER + (YBOTTOM_OFFSET/2)));
-
-    // we want a bit map the size of m_rGrid
-
-    m_pBmp = new wxBitmap(m_rGrid.GetWidth(), m_rGrid.GetHeight(), 24);
-
-    m_dT = DT;
-}
-
-//----------------------------------------------------------------
-// paintEvent()
-//
-// @class $(Name)
-// @author $(User)
-// @date $(Date)
-// @file $(CurrentFileName).$(CurrentFileExt)
-// @brief
-//
-// Called by the system of by wxWidgets when the panel needs
-// to be redrawn. You can also trigger this call by calling
-// Refresh()/Update().
-//----------------------------------------------------------------
-void PlotWaterfall::OnPaint(wxPaintEvent & evt)
-{
-    wxAutoBufferedPaintDC dc(this);
-    draw(dc);
-}
-
-//----------------------------------------------------------------
-// OnShow()
-//----------------------------------------------------------------
-void PlotWaterfall::OnShow(wxShowEvent& event)
-{
-}
-
-//----------------------------------------------------------------
-// ~PlotWaterfall()
-//----------------------------------------------------------------
-PlotWaterfall::~PlotWaterfall()
-{
-}
-
-//----------------------------------------------------------------
-// heatmap()
-// map val to a rgb colour
-// from http://eddiema.ca/2011/01/21/c-sharp-heatmaps/
-//----------------------------------------------------------------
-unsigned PlotWaterfall::heatmap(float val, float min, float max)
-{
-    unsigned r = 0;
-    unsigned g = 0;
-    unsigned b = 0;
-
-    val = (val - min) / (max - min);
-    if(val <= 0.2)
-    {
-        b = (unsigned)((val / 0.2) * 255);
-    }
-    else if(val >  0.2 &&  val <= 0.7)
-    {
-        b = (unsigned)((1.0 - ((val - 0.2) / 0.5)) * 255);
-    }
-    if(val >= 0.2 &&  val <= 0.6)
-    {
-        g = (unsigned)(((val - 0.2) / 0.4) * 255);
-    }
-    else if(val >  0.6 &&  val <= 0.9)
-    {
-        g = (unsigned)((1.0 - ((val - 0.6) / 0.3)) * 255);
-    }
-    if(val >= 0.5)
-    {
-        r = (unsigned)(((val - 0.5) / 0.5) * 255);
-    }
-    //printf("%f %x %x %x\n", val, r, g, b);
-    return  (b << 16) + (g << 8) + r;
-}
-
-bool PlotWaterfall::checkDT(void)
-{
-    // Check dY is > 1 pixel before proceeding. For small screens
-    // and large WATERFALL_SECS_Y we might have less than one
-    // block per pixel.  In this case increase m_dT and perform draw
-    // less often
-
-    float px_per_sec = (float)m_rGrid.GetHeight() / WATERFALL_SECS_Y;
-    float dy = m_dT * px_per_sec;
-    
-    if (dy < 1.0) {
-        m_dT += DT;
-        return false;
-    }
-    else
-        return true;
-}
-
-//----------------------------------------------------------------
-// draw()
-//----------------------------------------------------------------
-void PlotWaterfall::draw(wxAutoBufferedPaintDC& dc)
-{
-
-    m_rCtrl  = GetClientRect();
-
-    // m_rGrid is coords of inner window we actually plot to.  We deflate it a bit
-    // to leave room for axis labels.
-
-    m_rGrid = m_rCtrl;
-    m_rGrid = m_rGrid.Deflate(PLOT_BORDER + (XLEFT_OFFSET/2), (PLOT_BORDER + (YBOTTOM_OFFSET/2)));
-
-    if (m_pBmp == NULL) 
-    {
-        // we want a bit map the size of m_rGrid
-        m_pBmp = new wxBitmap(m_rGrid.GetWidth(), m_rGrid.GetHeight(), 24);
-    }
-
-    dc.Clear();
-
-    if(m_newdata)
-    {
-        m_newdata = false;
-        plotPixelData();
-        dc.DrawBitmap(*m_pBmp, PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER);
-        m_dT = DT;
-    }
-    else 
-    {
-
-        // no data to plot so just erase to black.  Blue looks nicer
-        // but is same colour as low amplitude signal
-
-        // Bug on Linux: When Stop is pressed this code doesn't erase
-        // the lower 25% of the Waterfall Window
-
-        m_rPlot = wxRect(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER, m_rGrid.GetWidth(), m_rGrid.GetHeight());
-        wxBrush ltGraphBkgBrush = wxBrush(BLACK_COLOR);
-        dc.SetBrush(ltGraphBkgBrush);
-        dc.SetPen(wxPen(BLACK_COLOR, 0));
-        dc.DrawRectangle(m_rPlot);
-    }
-    drawGraticule(dc);
-}
-
-//-------------------------------------------------------------------------
-// drawGraticule()
-//-------------------------------------------------------------------------
-void PlotWaterfall::drawGraticule(wxAutoBufferedPaintDC& dc)
-{
-    int      x, y, text_w, text_h;
-    char     buf[15];
-    wxString s;
-    float    f, time, freq_hz_to_px, time_s_to_py;
-
-    wxBrush ltGraphBkgBrush;
-    ltGraphBkgBrush.SetStyle(wxBRUSHSTYLE_TRANSPARENT);
-    ltGraphBkgBrush.SetColour(*wxBLACK);
-    dc.SetBrush(ltGraphBkgBrush);
-    dc.SetPen(wxPen(BLACK_COLOR, 1));
-
-    freq_hz_to_px = (float)m_rGrid.GetWidth()/(MAX_F_HZ-MIN_F_HZ);
-    time_s_to_py = (float)m_rGrid.GetHeight()/WATERFALL_SECS_Y;
-
-    // upper LH coords of plot area are (PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER)
-    // lower RH coords of plot area are (PLOT_BORDER + XLEFT_OFFSET + m_rGrid.GetWidth(), 
-    //                                   PLOT_BORDER + m_rGrid.GetHeight())
-
-    // Check if small screen size means text will overlap
-
-    int textXStep = STEP_F_HZ*freq_hz_to_px;
-    int textYStep = WATERFALL_SECS_STEP*time_s_to_py;
-    sprintf(buf, "%4.0fHz", (float)MAX_F_HZ - STEP_F_HZ);
-    GetTextExtent(buf, &text_w, &text_h);
-    int overlappedText = (text_w > textXStep) || (text_h > textYStep);
-
-    // Major Vertical gridlines and legend
-    //dc.SetPen(m_penShortDash);
-    for(f=STEP_F_HZ; f<MAX_F_HZ; f+=STEP_F_HZ) 
-    {
-        x = f*freq_hz_to_px;
-        x += PLOT_BORDER + XLEFT_OFFSET;
-
-        if (m_graticule)
-            dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, PLOT_BORDER);
-        else
-            dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET);
-            
-        sprintf(buf, "%4.0fHz", f);
-        GetTextExtent(buf, &text_w, &text_h);
-        if (!overlappedText)
-            dc.DrawText(buf, x - text_w/2, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET);
-    }
-
-    for(f=STEP_MINOR_F_HZ; f<MAX_F_HZ; f+=STEP_MINOR_F_HZ) 
-    {
-        x = f*freq_hz_to_px;
-        x += PLOT_BORDER + XLEFT_OFFSET;
-        dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET-5);
-    }
-    
-    // Horizontal gridlines
-    dc.SetPen(m_penDotDash);
-    for(time=0; time<=WATERFALL_SECS_Y; time+=WATERFALL_SECS_STEP) {
-       y = m_rGrid.GetHeight() - time*time_s_to_py;
-       y += PLOT_BORDER;
-
-        if (m_graticule)
-            dc.DrawLine(PLOT_BORDER + XLEFT_OFFSET, y, 
-                        (m_rGrid.GetWidth() + PLOT_BORDER + XLEFT_OFFSET), y);
-        sprintf(buf, "%3.0fs", time);
-       GetTextExtent(buf, &text_w, &text_h);
-        if (!overlappedText)
-            dc.DrawText(buf, PLOT_BORDER + XLEFT_OFFSET - text_w - XLEFT_TEXT_OFFSET, y-text_h/2);
-   }
-
-    // red rx tuning line
-    dc.SetPen(wxPen(RED_COLOR, 2));
-    x = m_rxFreq*freq_hz_to_px;
-    x += PLOT_BORDER + XLEFT_OFFSET;
-    //printf("m_rxFreq %f x %d\n", m_rxFreq, x);
-    dc.DrawLine(x, m_rGrid.GetHeight()+ PLOT_BORDER, x, m_rCtrl.GetHeight());
-    
-}
-
-//-------------------------------------------------------------------------
-// plotPixelData()
-//-------------------------------------------------------------------------
-void PlotWaterfall::plotPixelData()
-{
-    float       spec_index_per_px;
-    float       intensity_per_dB;
-    float       px_per_sec;
-    int         index;
-    float       dy;
-    int         dy_blocks;
-    int         b;
-    int         px;
-    int         py;
-    int         intensity;
-
-    /*
-      Design Notes:
-
-      The height in pixels represents WATERFALL_SECS_Y of data.  Every DT
-      seconds we get a vector of MODEM_STATS_NSPEC spectrum samples which we use
-      to update the last row.  The height of each row is dy pixels, which
-      maps to DT seconds.  We call each dy high rectangle of pixels a
-      block.
-
-    */
-
-    // determine dy, the height of one "block"
-    px_per_sec = (float)m_rGrid.GetHeight() / WATERFALL_SECS_Y;
-    dy = m_dT * px_per_sec;
-
-    // number of dy high blocks in spectrogram
-    dy_blocks = m_rGrid.GetHeight()/ dy;
-
-    // update min and max amplitude estimates
-    float max_mag = MIN_MAG_DB;
-
-    int min_fft_bin=((float)200/m_modem_stats_max_f_hz)*MODEM_STATS_NSPEC;
-    int max_fft_bin=((float)2800/m_modem_stats_max_f_hz)*MODEM_STATS_NSPEC;
-
-    for(int i=min_fft_bin; i<max_fft_bin; i++) 
-    {
-        if (g_avmag[i] > max_mag)
-        {
-            max_mag = g_avmag[i];
-        }
-    }
-
-    m_max_mag = BETA*m_max_mag + (1 - BETA)*max_mag;
-    m_min_mag = max_mag - 20.0;
-    //printf("max_mag: %f m_max_mag: %f\n", max_mag, m_max_mag);
-    intensity_per_dB  = (float)256 /(MAX_MAG_DB - MIN_MAG_DB);
-    //intensity_per_dB  = (float)256 /(m_max_mag - m_min_mag);
-    spec_index_per_px = ((float)(MAX_F_HZ)/(float)m_modem_stats_max_f_hz)*(float)MODEM_STATS_NSPEC / (float) m_rGrid.GetWidth();
-
-    /*
-    printf("h %d w %d px_per_sec %d dy %d dy_blocks %d spec_index_per_px: %f\n", 
-       m_rGrid.GetHeight(), m_rGrid.GetWidth(), px_per_sec, 
-       dy, dy_blocks, spec_index_per_px);
-    */
-
-    // Shift previous bit map up one row of blocks ----------------------------
-    wxNativePixelData data(*m_pBmp);
-    wxNativePixelData::Iterator bitMapStart(data);
-    wxNativePixelData::Iterator p = bitMapStart;
-
-    for(b = 0; b < dy_blocks - 1; b++) 
-    {
-        wxNativePixelData::Iterator psrc = bitMapStart;
-        wxNativePixelData::Iterator pdest = bitMapStart;
-        pdest.OffsetY(data, dy * b);
-        psrc.OffsetY(data, dy * (b+1));
-
-        // copy one line of blocks
-
-        for(py = 0; py < dy; py++) 
-        {
-            wxNativePixelData::Iterator pdestRowStart = pdest;
-            wxNativePixelData::Iterator psrcRowStart = psrc;
-
-            for(px = 0; px < m_rGrid.GetWidth(); px++) 
-            {
-                pdest.Red() = psrc.Red();
-                pdest.Green() = psrc.Green();
-                pdest.Blue() = psrc.Blue();
-                pdest++;
-                psrc++;
-            }
-            pdest = pdestRowStart;
-            pdest.OffsetY(data, 1);
-            psrc = psrcRowStart;
-            psrc.OffsetY(data, 1);         
-        }
-    }
-
-    // Draw last line of blocks using latest amplitude data ------------------
-    p = bitMapStart;
-    p.OffsetY(data, dy *(dy_blocks - 1));
-    for(py = 0; py < dy; py++)
-    {
-        wxNativePixelData::Iterator rowStart = p;
-
-        for(px = 0; px < m_rGrid.GetWidth(); px++)
-        {
-            index = px * spec_index_per_px;
-            assert(index < MODEM_STATS_NSPEC);
-
-            intensity = intensity_per_dB * (g_avmag[index] - m_min_mag);
-            if(intensity > 255) intensity = 255;
-            if (intensity < 0) intensity = 0;
-            //printf("%d %f %d \n", index, g_avmag[index], intensity);
-
-            switch (m_colour) {
-            case 0:
-                p.Red() = m_heatmap_lut[intensity] & 0xff;
-                p.Green() = (m_heatmap_lut[intensity] >> 8) & 0xff;
-                p.Blue() = (m_heatmap_lut[intensity] >> 16) & 0xff;
-                break;
-            case 1:
-                p.Red() = intensity;
-                p.Green() = intensity;
-                p.Blue() = intensity;       
-                break;
-            case 2:
-                p.Red() = intensity;
-                p.Green() = intensity;
-                if (intensity < 127)
-                    p.Blue() = intensity*2;
-                else
-                    p.Blue() = 255;
-                        
-                break;
-            }
-            ++p;
-        }
-        p = rowStart;
-        p.OffsetY(data, 1);
-    }
-
-}
-
-//-------------------------------------------------------------------------
-// OnMouseLeftDown()
-//-------------------------------------------------------------------------
-void PlotWaterfall::OnMouseLeftDown(wxMouseEvent& event)
-{
-    m_mouseDown = true;
-    wxClientDC dc(this);
-
-    wxPoint pt(event.GetLogicalPosition(dc));
-
-    // map x coord to edges of actual plot
-    pt.x -= PLOT_BORDER + XLEFT_OFFSET;
-    pt.y -= PLOT_BORDER;
-
-    // valid click if inside of plot
-    if ((pt.x >= 0) && (pt.x <= m_rGrid.GetWidth()) && (pt.y >=0)) 
-    {
-        float freq_hz_to_px = (float)m_rGrid.GetWidth()/(MAX_F_HZ-MIN_F_HZ);
-        float clickFreq = (float)pt.x/freq_hz_to_px;
-
-        // communicate back to other threads
-        fdmdv2_clickTune(clickFreq);
-    }
-}
-
-//-------------------------------------------------------------------------
-// OnMouseRightDown()
-//-------------------------------------------------------------------------
-void PlotWaterfall::OnMouseRightDown(wxMouseEvent& event)
-{
-    m_colour++;
-    if (m_colour == 3)
-        m_colour = 0;
-}
-
diff --git a/fdmdv2/tags/0.99-Beta/src/fdmdv2_plot_waterfall.h b/fdmdv2/tags/0.99-Beta/src/fdmdv2_plot_waterfall.h
deleted file mode 100644 (file)
index 77058fd..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-//==========================================================================
-// Name:            fdmdv2_plot_waterfall.h
-// Purpose:         Defines a waterfall plot derivative of fdmdv2_plot.
-// Created:         June 22, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#ifndef __FDMDV2_PLOT_WATERFALL__
-#define __FDMDV2_PLOT_WATERFALL__
-
-#include "fdmdv2_plot.h"
-#include "fdmdv2_defines.h"
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class PlotWaterfall
-//
-// @class $(Name)
-// @author $(User)
-// @date $(Date)
-// @file $(CurrentFileName).$(CurrentFileExt)
-// @brief
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class PlotWaterfall : public PlotPanel
-{
-    public:
-    PlotWaterfall(wxFrame* parent, bool graticule, int colour);
-        ~PlotWaterfall();
-        bool checkDT(void);
-        void setGreyscale(bool greyscale) { m_greyscale = greyscale; }
-        void setRxFreq(float rxFreq) { m_rxFreq = rxFreq; }
-        void setFs(int fs) { m_modem_stats_max_f_hz = fs/2; }
-
-    protected:
-        unsigned    m_heatmap_lut[256];
-
-        unsigned    heatmap(float val, float min, float max);
-
-        void        OnPaint(wxPaintEvent & evt);
-        void        OnSize(wxSizeEvent& event);
-        void        OnShow(wxShowEvent& event);
-        void        drawGraticule(wxAutoBufferedPaintDC&  dc);
-        void        draw(wxAutoBufferedPaintDC& dc);
-        void        plotPixelData();
-        void        OnMouseLeftDown(wxMouseEvent& event);
-        void        OnMouseRightDown(wxMouseEvent& event);
-
-    private:
-        float       m_dT;
-        float       m_rxFreq;
-        bool        m_graticule;
-        float       m_min_mag;
-        float       m_max_mag;
-        int         m_colour;
-        int         m_modem_stats_max_f_hz;
-
-        DECLARE_EVENT_TABLE()
-};
-
-#endif //__FDMDV2_PLOT_WATERFALL__
diff --git a/fdmdv2/tags/0.99-Beta/src/hamlib.cpp b/fdmdv2/tags/0.99-Beta/src/hamlib.cpp
deleted file mode 100644 (file)
index 575f36a..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-//==========================================================================
-// Name:            hamlib.cpp
-//
-// Purpose:         Hamlib integration for FreeDV
-// Created:         May 2013
-// Authors:         Joel Stanley
-//
-// 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#include <hamlib.h>
-
-#include <vector>
-#include <algorithm>
-
-using namespace std;
-
-typedef std::vector<const struct rig_caps *> riglist_t;
-
-static bool rig_cmp(const struct rig_caps *rig1, const struct rig_caps *rig2);
-static int build_list(const struct rig_caps *rig, rig_ptr_t);
-
-Hamlib::Hamlib() : m_rig(NULL) {
-    /* Stop hamlib from spewing info to stderr. */
-    rig_set_debug(RIG_DEBUG_NONE);
-
-    /* Create sorted list of rigs. */
-    rig_load_all_backends();
-    rig_list_foreach(build_list, &m_rigList);
-    sort(m_rigList.begin(), m_rigList.end(), rig_cmp);
-
-    /* Reset debug output. */
-    rig_set_debug(RIG_DEBUG_VERBOSE);
-
-       m_rig = NULL;
-}
-
-Hamlib::~Hamlib() {
-       if(m_rig)
-               close();
-}
-
-static int build_list(const struct rig_caps *rig, rig_ptr_t rigList) {
-    ((riglist_t *)rigList)->push_back(rig); 
-    return 1;
-}
-
-static bool rig_cmp(const struct rig_caps *rig1, const struct rig_caps *rig2) {
-    /* Compare manufacturer. */
-    int r = strcasecmp(rig1->mfg_name, rig2->mfg_name);
-    if (r != 0)
-        return r < 0;
-
-    /* Compare model. */
-    r = strcasecmp(rig1->model_name, rig2->model_name);
-    if (r != 0)
-        return r < 0;
-
-    /* Compare rig ID. */
-    return rig1->rig_model < rig2->rig_model;
-}
-
-void Hamlib::populateComboBox(wxComboBox *cb) {
-
-    riglist_t::const_iterator rig = m_rigList.begin();
-    for (; rig !=m_rigList.end(); rig++) {
-        char name[128];
-        snprintf(name, 128, "%s %s", (*rig)->mfg_name, (*rig)->model_name); 
-        cb->Append(name);
-    }
-}
-
-bool Hamlib::connect(unsigned int rig_index, const char *serial_port) {
-    /* Look up model from index. */
-    if (rig_index >= m_rigList.size()) {
-        return false;
-    }
-    printf("rig: %s %s (%d)\n", m_rigList[rig_index]->mfg_name,
-            m_rigList[rig_index]->model_name, m_rigList[rig_index]->rig_model);
-
-       if(m_rig) {
-               printf("Closing old hamlib instance!\n");
-               close();
-       }
-
-    /* Initialise, configure and open. */
-    m_rig = rig_init(m_rigList[rig_index]->rig_model);
-    /* TODO: Also use baud rate from the screen. */
-    if (!m_rig)
-        return false;
-    token_t token = rig_token_lookup(m_rig, "rig_pathname");
-    if (rig_set_conf(m_rig, token, serial_port) != RIG_OK) {
-        return false;
-    }
-    if (rig_open(m_rig) == RIG_OK) {
-        return true;
-    }
-    return false;
-}
-
-bool Hamlib::ptt(bool press) {
-       if(!m_rig)
-               return false;
-    /* TODO(Joel): make ON_DATA and ON configurable. */
-    ptt_t on = press ? RIG_PTT_ON : RIG_PTT_OFF;
-    /* TODO(Joel): what should the VFO option be? */
-    return rig_set_ptt(m_rig, RIG_VFO_CURR, on) == RIG_OK;
-}
-
-void Hamlib::close(void) {
-       if(m_rig) {
-               rig_close(m_rig);
-               rig_cleanup(m_rig);
-               m_rig = NULL;
-       }
-}
diff --git a/fdmdv2/tags/0.99-Beta/src/hamlib.h b/fdmdv2/tags/0.99-Beta/src/hamlib.h
deleted file mode 100644 (file)
index fe3496f..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-#ifndef HAMLIB_H
-#define HAMLIB_H
-
-extern "C" {
-#include <hamlib/rig.h>
-}
-#include <wx/combobox.h>
-#include <vector>
-
-class Hamlib {
-
-    public:
-        Hamlib();
-        ~Hamlib();
-        void populateComboBox(wxComboBox *cb);
-        bool connect(unsigned int rig_index, const char *serial_port);
-        bool ptt(bool press);
-        void close(void);
-
-        typedef std::vector<const struct rig_caps *> riglist_t;
-
-    private:
-        RIG *m_rig;
-        /* Sorted list of rigs. */
-        riglist_t m_rigList;
-};
-
-#endif /*HAMLIB_H*/
diff --git a/fdmdv2/tags/0.99-Beta/src/sox.h b/fdmdv2/tags/0.99-Beta/src/sox.h
deleted file mode 100644 (file)
index 07aedeb..0000000
+++ /dev/null
@@ -1,2608 +0,0 @@
-/* libSoX Library Public Interface
- *
- * Copyright 1999-2011 Chris Bagwell and SoX Contributors.
- *
- * This source code is freely redistributable and may be used for
- * any purpose.  This copyright notice must be maintained.
- * Chris Bagwell And SoX Contributors are not responsible for
- * the consequences of using this software.
- */
-
-/** @file
-Contains the interface exposed to clients of the libSoX library.
-Symbols starting with "sox_" or "SOX_" are part of the public interface for
-libSoX clients (applications that consume libSoX). Symbols starting with
-"lsx_" or "LSX_" are internal use by libSoX and plugins.
-LSX_ and lsx_ symbols should not be used by libSoX-based applications.
-*/
-
-#ifndef SOX_H
-#define SOX_H /**< Client API: This macro is defined if sox.h has been included. */
-
-#include <limits.h>
-#include <stdarg.h>
-#include <stddef.h>
-
-#if defined(__cplusplus)
-extern "C" {
-#endif
-
-/* Suppress warnings from use of type long long. */
-#if defined __GNUC__
-#pragma GCC system_header
-#endif
-
-/*****************************************************************************
-API decoration macros:
-Mostly for documentation purposes. For some compilers, decorations also affect
-code generation, influence compiler warnings or activate compiler
-optimizations.
-*****************************************************************************/
-
-/**
-Plugins API:
-Attribute required on all functions exported by libSoX and on all function
-pointer types used by the libSoX API.
-*/
-#ifdef __GNUC__
-#define LSX_API  __attribute__ ((cdecl)) /* libSoX function */
-#elif _MSC_VER
-#define LSX_API  __cdecl /* libSoX function */
-#else
-#define LSX_API /* libSoX function */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter or local variable to suppress warnings about
-the variable being unused (especially in macro-generated code).
-*/
-#ifdef __GNUC__
-#define LSX_UNUSED  __attribute__ ((unused)) /* Parameter or local variable is intentionally unused. */
-#else
-#define LSX_UNUSED /* Parameter or local variable is intentionally unused. */
-#endif
-
-/**
-Plugins API:
-LSX_PRINTF12: Attribute applied to a function to indicate that it requires
-a printf-style format string for arg1 and that printf parameters start at
-arg2.
-*/
-#ifdef __GNUC__
-#define LSX_PRINTF12  __attribute__ ((format (printf, 1, 2))) /* Function has printf-style arguments. */
-#else
-#define LSX_PRINTF12 /* Function has printf-style arguments. */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a function to indicate that it has no side effects and
-depends only its input parameters and global memory. If called repeatedly, it
-returns the same result each time.
-*/
-#ifdef __GNUC__
-#define LSX_RETURN_PURE __attribute__ ((pure)) /* Function is pure. */
-#else
-#define LSX_RETURN_PURE /* Function is pure. */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a function to indicate that the
-return value is always a pointer to a valid object (never NULL).
-*/
-#ifdef _Ret_
-#define LSX_RETURN_VALID _Ret_ /* Function always returns a valid object (never NULL). */
-#else
-#define LSX_RETURN_VALID /* Function always returns a valid object (never NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a function to indicate that the return value is always a
-pointer to a valid array (never NULL).
-*/
-#ifdef _Ret_valid_
-#define LSX_RETURN_ARRAY _Ret_valid_ /* Function always returns a valid array (never NULL). */
-#else
-#define LSX_RETURN_ARRAY /* Function always returns a valid array (never NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a function to indicate that the return value is always a
-pointer to a valid 0-terminated array (never NULL).
-*/
-#ifdef _Ret_z_
-#define LSX_RETURN_VALID_Z _Ret_z_ /* Function always returns a 0-terminated array (never NULL). */
-#else
-#define LSX_RETURN_VALID_Z /* Function always returns a 0-terminated array (never NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a function to indicate that the returned pointer may be
-null.
-*/
-#ifdef _Ret_opt_
-#define LSX_RETURN_OPT _Ret_opt_ /* Function may return NULL. */
-#else
-#define LSX_RETURN_OPT /* Function may return NULL. */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a valid
-pointer to one const element of the pointed-to type (never NULL).
-*/
-#ifdef _In_
-#define LSX_PARAM_IN _In_ /* Required const pointer to a valid object (never NULL). */
-#else
-#define LSX_PARAM_IN /* Required const pointer to a valid object (never NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a valid
-pointer to a const 0-terminated string (never NULL).
-*/
-#ifdef _In_z_
-#define LSX_PARAM_IN_Z _In_z_ /* Required const pointer to 0-terminated string (never NULL). */
-#else
-#define LSX_PARAM_IN_Z /* Required const pointer to 0-terminated string (never NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a const
-pointer to a 0-terminated printf format string.
-*/
-#ifdef _Printf_format_string_
-#define LSX_PARAM_IN_PRINTF _Printf_format_string_ /* Required const pointer to 0-terminated printf format string (never NULL). */
-#else
-#define LSX_PARAM_IN_PRINTF /* Required const pointer to 0-terminated printf format string (never NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a valid
-pointer to (len) const initialized elements of the pointed-to type, where
-(len) is the name of another parameter.
-@param len The parameter that contains the number of elements in the array.
-*/
-#ifdef _In_count_
-#define LSX_PARAM_IN_COUNT(len) _In_count_(len) /* Required const pointer to (len) valid objects (never NULL). */
-#else
-#define LSX_PARAM_IN_COUNT(len) /* Required const pointer to (len) valid objects (never NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a valid
-pointer to (len) const bytes of initialized data, where (len) is the name of
-another parameter.
-@param len The parameter that contains the number of bytes in the array.
-*/
-#ifdef _In_bytecount_
-#define LSX_PARAM_IN_BYTECOUNT(len) _In_bytecount_(len) /* Required const pointer to (len) bytes of data (never NULL). */
-#else
-#define LSX_PARAM_IN_BYTECOUNT(len) /* Required const pointer to (len) bytes of data (never NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is either NULL
-or a valid pointer to one const element of the pointed-to type.
-*/
-#ifdef _In_opt_
-#define LSX_PARAM_IN_OPT _In_opt_ /* Optional const pointer to a valid object (may be NULL). */
-#else
-#define LSX_PARAM_IN_OPT /* Optional const pointer to a valid object (may be NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is either NULL
-or a valid pointer to a const 0-terminated string.
-*/
-#ifdef _In_opt_z_
-#define LSX_PARAM_IN_OPT_Z _In_opt_z_ /* Optional const pointer to 0-terminated string (may be NULL). */
-#else
-#define LSX_PARAM_IN_OPT_Z /* Optional const pointer to 0-terminated string (may be NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a valid
-pointer to one initialized element of the pointed-to type (never NULL). The
-function may modify the element.
-*/
-#ifdef _Inout_
-#define LSX_PARAM_INOUT _Inout_ /* Required pointer to a valid object (never NULL). */
-#else
-#define LSX_PARAM_INOUT /* Required pointer to a valid object (never NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a valid
-pointer to (len) initialized elements of the pointed-to type (never NULL). The
-function may modify the elements.
-@param len The parameter that contains the number of elements in the array.
-*/
-#ifdef _Inout_count_x_
-#define LSX_PARAM_INOUT_COUNT(len) _Inout_count_x_(len) /* Required pointer to (len) valid objects (never NULL). */
-#else
-#define LSX_PARAM_INOUT_COUNT(len) /* Required pointer to (len) valid objects (never NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a valid
-pointer to memory sufficient for one element of the pointed-to type (never
-NULL). The function will initialize the element.
-*/
-#ifdef _Out_
-#define LSX_PARAM_OUT _Out_ /* Required pointer to an object to be initialized (never NULL). */
-#else
-#define LSX_PARAM_OUT /* Required pointer to an object to be initialized (never NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a valid
-pointer to memory sufficient for (len) bytes of data (never NULL), where (len)
-is the name of another parameter. The function may write up to len bytes of
-data to this memory.
-@param len The parameter that contains the number of bytes in the array.
-*/
-#ifdef _Out_bytecap_
-#define LSX_PARAM_OUT_BYTECAP(len) _Out_bytecap_(len) /* Required pointer to writable buffer with room for len bytes. */
-#else
-#define LSX_PARAM_OUT_BYTECAP(len) /* Required pointer to writable buffer with room for len bytes. */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a valid
-pointer to memory sufficient for (len) elements of the pointed-to type (never
-NULL), where (len) is the name of another parameter. On return, (filled)
-elements will have been initialized, where (filled) is either the dereference
-of another pointer parameter (for example "*written") or the "return"
-parameter (indicating that the function returns the number of elements
-written).
-@param len The parameter that contains the number of elements in the array.
-@param filled The dereference of the parameter that receives the number of elements written to the array, or "return" if the value is returned.
-*/
-#ifdef _Out_cap_post_count_
-#define LSX_PARAM_OUT_CAP_POST_COUNT(len,filled) _Out_cap_post_count_(len,filled) /* Required pointer to buffer for (len) elements (never NULL); on return, (filled) elements will have been initialized. */
-#else
-#define LSX_PARAM_OUT_CAP_POST_COUNT(len,filled) /* Required pointer to buffer for (len) elements (never NULL); on return, (filled) elements will have been initialized. */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a valid
-pointer to memory sufficient for (len) elements of the pointed-to type (never
-NULL), where (len) is the name of another parameter. On return, (filled+1)
-elements will have been initialized, with the last element having been
-initialized to 0, where (filled) is either the dereference of another pointer
-parameter (for example, "*written") or the "return" parameter (indicating that
-the function returns the number of elements written).
-@param len The parameter that contains the number of elements in the array.
-@param filled The dereference of the parameter that receives the number of elements written to the array (not counting the terminating null), or "return" if the value is returned.
-*/
-#ifdef _Out_z_cap_post_count_
-#define LSX_PARAM_OUT_Z_CAP_POST_COUNT(len,filled) _Out_z_cap_post_count_(len,filled) /* Required pointer to buffer for (len) elements (never NULL); on return, (filled+1) elements will have been initialized, and the array will be 0-terminated. */
-#else
-#define LSX_PARAM_OUT_Z_CAP_POST_COUNT(len,filled) /* Required pointer to buffer for (len) elements (never NULL); on return, (filled+1) elements will have been initialized, and the array will be 0-terminated. */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is either NULL
-or a valid pointer to memory sufficient for one element of the pointed-to
-type. The function will initialize the element.
-*/
-#ifdef _Out_opt_
-#define LSX_PARAM_OUT_OPT _Out_opt_ /* Optional pointer to an object to be initialized (may be NULL). */
-#else
-#define LSX_PARAM_OUT_OPT /* Optional pointer to an object to be initialized (may be NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a valid
-pointer (never NULL) to another pointer which may be NULL when the function is
-invoked.
-*/
-#ifdef _Deref_pre_maybenull_
-#define LSX_PARAM_DEREF_PRE_MAYBENULL _Deref_pre_maybenull_ /* Required pointer (never NULL) to another pointer (may be NULL). */
-#else
-#define LSX_PARAM_DEREF_PRE_MAYBENULL /* Required pointer (never NULL) to another pointer (may be NULL). */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a valid
-pointer (never NULL) to another pointer which will be NULL when the function
-returns.
-*/
-#ifdef _Deref_post_null_
-#define LSX_PARAM_DEREF_POST_NULL _Deref_post_null_ /* Required pointer (never NULL) to another pointer, which will be NULL on exit. */
-#else
-#define LSX_PARAM_DEREF_POST_NULL /* Required pointer (never NULL) to another pointer, which will be NULL on exit. */
-#endif
-
-/**
-Plugins API:
-Attribute applied to a parameter to indicate that the parameter is a valid
-pointer (never NULL) to another pointer which will be non-NULL when the
-function returns.
-*/
-#ifdef _Deref_post_notnull_
-#define LSX_PARAM_DEREF_POST_NOTNULL _Deref_post_notnull_ /* Required pointer (never NULL) to another pointer, which will be valid (not NULL) on exit. */
-#else
-#define LSX_PARAM_DEREF_POST_NOTNULL /* Required pointer (never NULL) to another pointer, which will be valid (not NULL) on exit. */
-#endif
-
-/**
-Plugins API:
-Expression that "uses" a potentially-unused variable to avoid compiler
-warnings (especially in macro-generated code).
-*/
-#ifdef _PREFAST_
-#define LSX_USE_VAR(x)  ((void)(x=0)) /* During static analysis, initialize unused variables to 0. */
-#else
-#define LSX_USE_VAR(x)  ((void)(x)) /* Parameter or variable is intentionally unused. */
-#endif
-
-/**
-Plugins API:
-Compile-time assertion. Causes a compile error if the expression is false.
-@param e  The expression to test. If expression is false, compilation will fail.
-@param f  A unique identifier for the test, for example foo_must_not_be_zero.
-*/
-#define lsx_static_assert(e,f) enum {lsx_static_assert_##f = 1/((e) ? 1 : 0)}
-
-/*****************************************************************************
-Basic typedefs:
-*****************************************************************************/
-
-/**
-Client API:
-Signed twos-complement 8-bit type. Typically defined as signed char.
-*/
-#if SCHAR_MAX==127 && SCHAR_MIN==(-128)
-typedef signed char sox_int8_t;
-#elif CHAR_MAX==127 && CHAR_MIN==(-128)
-typedef char sox_int8_t;
-#else
-#error Unable to determine an appropriate definition for sox_int8_t.
-#endif
-
-/**
-Client API:
-Unsigned 8-bit type. Typically defined as unsigned char.
-*/
-#if UCHAR_MAX==0xff
-typedef unsigned char sox_uint8_t;
-#elif CHAR_MAX==0xff && CHAR_MIN==0
-typedef char sox_uint8_t;
-#else
-#error Unable to determine an appropriate definition for sox_uint8_t.
-#endif
-
-/**
-Client API:
-Signed twos-complement 16-bit type. Typically defined as short.
-*/
-#if SHRT_MAX==32767 && SHRT_MIN==(-32768)
-typedef short sox_int16_t;
-#elif INT_MAX==32767 && INT_MIN==(-32768)
-typedef int sox_int16_t;
-#else
-#error Unable to determine an appropriate definition for sox_int16_t.
-#endif
-
-/**
-Client API:
-Unsigned 16-bit type. Typically defined as unsigned short.
-*/
-#if USHRT_MAX==0xffff
-typedef unsigned short sox_uint16_t;
-#elif UINT_MAX==0xffff
-typedef unsigned int sox_uint16_t;
-#else
-#error Unable to determine an appropriate definition for sox_uint16_t.
-#endif
-
-/**
-Client API:
-Signed twos-complement 32-bit type. Typically defined as int.
-*/
-#if INT_MAX==2147483647 && INT_MIN==(-2147483647-1)
-typedef int sox_int32_t;
-#elif LONG_MAX==2147483647 && LONG_MIN==(-2147483647-1)
-typedef long sox_int32_t;
-#else
-#error Unable to determine an appropriate definition for sox_int32_t.
-#endif
-
-/**
-Client API:
-Unsigned 32-bit type. Typically defined as unsigned int.
-*/
-#if UINT_MAX==0xffffffff
-typedef unsigned int sox_uint32_t;
-#elif ULONG_MAX==0xffffffff
-typedef unsigned long sox_uint32_t;
-#else
-#error Unable to determine an appropriate definition for sox_uint32_t.
-#endif
-
-/**
-Client API:
-Signed twos-complement 64-bit type. Typically defined as long or long long.
-*/
-#if LONG_MAX==9223372036854775807 && LONG_MIN==(-9223372036854775807-1)
-typedef long sox_int64_t;
-#elif defined(_MSC_VER)
-typedef __int64 sox_int64_t;
-#else
-typedef long long sox_int64_t;
-#endif
-
-/**
-Client API:
-Unsigned 64-bit type. Typically defined as unsigned long or unsigned long long.
-*/
-#if ULONG_MAX==0xffffffffffffffff
-typedef unsigned long sox_uint64_t;
-#elif defined(_MSC_VER)
-typedef unsigned __int64 sox_uint64_t;
-#else
-typedef unsigned long long sox_uint64_t;
-#endif
-
-#ifndef _DOXYGEN_
-lsx_static_assert(sizeof(sox_int8_t)==1,   sox_int8_size);
-lsx_static_assert(sizeof(sox_uint8_t)==1,  sox_uint8_size);
-lsx_static_assert(sizeof(sox_int16_t)==2,  sox_int16_size);
-lsx_static_assert(sizeof(sox_uint16_t)==2, sox_uint16_size);
-lsx_static_assert(sizeof(sox_int32_t)==4,  sox_int32_size);
-lsx_static_assert(sizeof(sox_uint32_t)==4, sox_uint32_size);
-lsx_static_assert(sizeof(sox_int64_t)==8,  sox_int64_size);
-lsx_static_assert(sizeof(sox_uint64_t)==8, sox_uint64_size);
-#endif
-
-/**
-Client API:
-Alias for sox_int32_t (beware of the extra byte).
-*/
-typedef sox_int32_t sox_int24_t;
-
-/**
-Client API:
-Alias for sox_uint32_t (beware of the extra byte).
-*/
-typedef sox_uint32_t sox_uint24_t;
-
-/**
-Client API:
-Native SoX audio sample type (alias for sox_int32_t).
-*/
-typedef sox_int32_t sox_sample_t;
-
-/**
-Client API:
-Samples per second is stored as a double.
-*/
-typedef double sox_rate_t;
-
-/**
-Client API:
-File's metadata, access via sox_*_comments functions.
-*/
-typedef char * * sox_comments_t;
-
-/*****************************************************************************
-Enumerations:
-*****************************************************************************/
-
-/**
-Client API:
-Boolean type, assignment (but not necessarily binary) compatible with C++ bool.
-*/
-typedef enum sox_bool {
-    sox_false, /**< False = 0. */
-    sox_true   /**< True = 1. */
-} sox_bool;
-
-/**
-Client API:
-no, yes, or default (default usually implies some kind of auto-detect logic).
-*/
-typedef enum sox_option_t {
-    sox_option_no,      /**< Option specified as no = 0. */
-    sox_option_yes,     /**< Option specified as yes = 1. */
-    sox_option_default  /**< Option unspecified = 2. */
-} sox_option_t;
-
-/**
-Client API:
-The libSoX-specific error codes.
-libSoX functions may return these codes or others that map from errno codes.
-*/
-enum sox_error_t {
-  SOX_SUCCESS = 0,     /**< Function succeeded = 0 */
-  SOX_EOF = -1,        /**< End Of File or other error = -1 */
-  SOX_EHDR = 2000,     /**< Invalid Audio Header = 2000 */
-  SOX_EFMT,            /**< Unsupported data format = 2001 */
-  SOX_ENOMEM,          /**< Can't alloc memory = 2002 */
-  SOX_EPERM,           /**< Operation not permitted = 2003 */
-  SOX_ENOTSUP,         /**< Operation not supported = 2004 */
-  SOX_EINVAL           /**< Invalid argument = 2005 */
-};
-
-/**
-Client API:
-Flags indicating whether optional features are present in this build of libSoX.
-*/
-typedef enum sox_version_flags_t {
-    sox_version_none = 0,         /**< No special features = 0. */
-    sox_version_have_popen = 1,   /**< popen = 1. */
-    sox_version_have_magic = 2,   /**< magic = 2. */
-    sox_version_have_threads = 4, /**< threads = 4. */
-    sox_version_have_memopen = 8  /**< memopen = 8. */
-} sox_version_flags_t;
-
-/**
-Client API:
-Format of sample data.
-*/
-typedef enum sox_encoding_t {
-  SOX_ENCODING_UNKNOWN   , /**< encoding has not yet been determined */
-
-  SOX_ENCODING_SIGN2     , /**< signed linear 2's comp: Mac */
-  SOX_ENCODING_UNSIGNED  , /**< unsigned linear: Sound Blaster */
-  SOX_ENCODING_FLOAT     , /**< floating point (binary format) */
-  SOX_ENCODING_FLOAT_TEXT, /**< floating point (text format) */
-  SOX_ENCODING_FLAC      , /**< FLAC compression */
-  SOX_ENCODING_HCOM      , /**< Mac FSSD files with Huffman compression */
-  SOX_ENCODING_WAVPACK   , /**< WavPack with integer samples */
-  SOX_ENCODING_WAVPACKF  , /**< WavPack with float samples */
-  SOX_ENCODING_ULAW      , /**< u-law signed logs: US telephony, SPARC */
-  SOX_ENCODING_ALAW      , /**< A-law signed logs: non-US telephony, Psion */
-  SOX_ENCODING_G721      , /**< G.721 4-bit ADPCM */
-  SOX_ENCODING_G723      , /**< G.723 3 or 5 bit ADPCM */
-  SOX_ENCODING_CL_ADPCM  , /**< Creative Labs 8 --> 2,3,4 bit Compressed PCM */
-  SOX_ENCODING_CL_ADPCM16, /**< Creative Labs 16 --> 4 bit Compressed PCM */
-  SOX_ENCODING_MS_ADPCM  , /**< Microsoft Compressed PCM */
-  SOX_ENCODING_IMA_ADPCM , /**< IMA Compressed PCM */
-  SOX_ENCODING_OKI_ADPCM , /**< Dialogic/OKI Compressed PCM */
-  SOX_ENCODING_DPCM      , /**< Differential PCM: Fasttracker 2 (xi) */
-  SOX_ENCODING_DWVW      , /**< Delta Width Variable Word */
-  SOX_ENCODING_DWVWN     , /**< Delta Width Variable Word N-bit */
-  SOX_ENCODING_GSM       , /**< GSM 6.10 33byte frame lossy compression */
-  SOX_ENCODING_MP3       , /**< MP3 compression */
-  SOX_ENCODING_VORBIS    , /**< Vorbis compression */
-  SOX_ENCODING_AMR_WB    , /**< AMR-WB compression */
-  SOX_ENCODING_AMR_NB    , /**< AMR-NB compression */
-  SOX_ENCODING_CVSD      , /**< Continuously Variable Slope Delta modulation */
-  SOX_ENCODING_LPC10     , /**< Linear Predictive Coding */
-
-  SOX_ENCODINGS            /**< End of list marker */
-} sox_encoding_t;
-
-/**
-Client API:
-Flags for sox_encodings_info_t: lossless/lossy1/lossy2.
-*/
-typedef enum sox_encodings_flags_t {
-  sox_encodings_none   = 0, /**< no flags specified (implies lossless encoding) = 0. */
-  sox_encodings_lossy1 = 1, /**< encode, decode: lossy once = 1. */
-  sox_encodings_lossy2 = 2  /**< encode, decode, encode, decode: lossy twice = 2. */
-} sox_encodings_flags_t;
-
-/**
-Client API:
-Type of plot.
-*/
-typedef enum sox_plot_t {
-    sox_plot_off,     /**< No plot = 0. */
-    sox_plot_octave,  /**< Octave plot = 1. */
-    sox_plot_gnuplot, /**< Gnuplot plot = 2. */
-    sox_plot_data     /**< Plot data = 3. */
-} sox_plot_t;
-
-/**
-Client API:
-Loop modes: upper 4 bits mask the loop blass, lower 4 bits describe
-the loop behaviour, for example single shot, bidirectional etc.
-*/
-enum sox_loop_flags_t {
-  sox_loop_none = 0,          /**< single-shot = 0 */
-  sox_loop_forward = 1,       /**< forward loop = 1 */
-  sox_loop_forward_back = 2,  /**< forward/back loop = 2 */
-  sox_loop_8 = 32,            /**< 8 loops (??) = 32 */
-  sox_loop_sustain_decay = 64 /**< AIFF style, one sustain & one decay loop = 64 */
-};
-
-/**
-Plugins API:
-Is file a real file, a pipe, or a url?
-*/
-typedef enum lsx_io_type
-{
-    lsx_io_file, /**< File is a real file = 0. */
-    lsx_io_pipe, /**< File is a pipe (no seeking) = 1. */
-    lsx_io_url   /**< File is a URL (no seeking) = 2. */
-} lsx_io_type;
-
-/*****************************************************************************
-Macros:
-*****************************************************************************/
-
-/**
-Client API:
-Compute a 32-bit integer API version from three 8-bit parts.
-@param a Major version.
-@param b Minor version.
-@param c Revision or build number.
-@returns 32-bit integer API version 0x000a0b0c.
-*/
-#define SOX_LIB_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
-
-/**
-Client API:
-The API version of the sox.h file. It is not meant to follow the version
-number of SoX but it has historically. Please do not count on
-SOX_LIB_VERSION_CODE staying in sync with the libSoX version.
-*/
-#define SOX_LIB_VERSION_CODE   SOX_LIB_VERSION(14, 4, 0)
-
-/**
-Client API:
-Returns the smallest (negative) value storable in a twos-complement signed
-integer with the specified number of bits, cast to an unsigned integer;
-for example, SOX_INT_MIN(8) = 0x80, SOX_INT_MIN(16) = 0x8000, etc.
-@param bits Size of value for which to calculate minimum.
-@returns the smallest (negative) value storable in a twos-complement signed
-integer with the specified number of bits, cast to an unsigned integer.
-*/
-#define SOX_INT_MIN(bits) (1 <<((bits)-1))
-
-/**
-Client API:
-Returns the largest (positive) value storable in a twos-complement signed
-integer with the specified number of bits, cast to an unsigned integer;
-for example, SOX_INT_MAX(8) = 0x7F, SOX_INT_MAX(16) = 0x7FFF, etc.
-@param bits Size of value for which to calculate maximum.
-@returns the largest (positive) value storable in a twos-complement signed
-integer with the specified number of bits, cast to an unsigned integer.
-*/
-#define SOX_INT_MAX(bits) (((unsigned)-1)>>(33-(bits)))
-
-/**
-Client API:
-Returns the largest value storable in an unsigned integer with the specified
-number of bits; for example, SOX_UINT_MAX(8) = 0xFF,
-SOX_UINT_MAX(16) = 0xFFFF, etc.
-@param bits Size of value for which to calculate maximum.
-@returns the largest value storable in an unsigned integer with the specified
-number of bits.
-*/
-#define SOX_UINT_MAX(bits) (SOX_INT_MIN(bits)|SOX_INT_MAX(bits))
-
-/**
-Client API:
-Returns 0x7F.
-*/
-#define SOX_INT8_MAX  SOX_INT_MAX(8)
-
-/**
-Client API:
-Returns 0x7FFF.
-*/
-#define SOX_INT16_MAX SOX_INT_MAX(16)
-
-/**
-Client API:
-Returns 0x7FFFFF.
-*/
-#define SOX_INT24_MAX SOX_INT_MAX(24)
-
-/**
-Client API:
-Returns 0x7FFFFFFF.
-*/
-#define SOX_INT32_MAX SOX_INT_MAX(32)
-
-/**
-Client API:
-Bits in a sox_sample_t = 32.
-*/
-#define SOX_SAMPLE_PRECISION 32
-
-/**
-Client API:
-Max value for sox_sample_t = 0x7FFFFFFF.
-*/
-#define SOX_SAMPLE_MAX (sox_sample_t)SOX_INT_MAX(32)
-
-/**
-Client API:
-Min value for sox_sample_t = 0x80000000.
-*/
-#define SOX_SAMPLE_MIN (sox_sample_t)SOX_INT_MIN(32)
-
-
-/*                Conversions: Linear PCM <--> sox_sample_t
- *
- *   I/O      Input    sox_sample_t Clips?   Input    sox_sample_t Clips?
- *  Format   Minimum     Minimum     I O    Maximum     Maximum     I O
- *  ------  ---------  ------------ -- --   --------  ------------ -- --
- *  Float     -inf         -1        y n      inf      1 - 5e-10    y n
- *  Int8      -128        -128       n n      127     127.9999999   n y
- *  Int16    -32768      -32768      n n     32767    32767.99998   n y
- *  Int24   -8388608    -8388608     n n    8388607   8388607.996   n y
- *  Int32  -2147483648 -2147483648   n n   2147483647 2147483647    n n
- *
- * Conversions are as accurate as possible (with rounding).
- *
- * Rounding: halves toward +inf, all others to nearest integer.
- *
- * Clips? shows whether on not there is the possibility of a conversion
- * clipping to the minimum or maximum value when inputing from or outputing
- * to a given type.
- *
- * Unsigned integers are converted to and from signed integers by flipping
- * the upper-most bit then treating them as signed integers.
- */
-
-/**
-Client API:
-Declares the temporary local variables that are required when using SOX
-conversion macros.
-*/
-#define SOX_SAMPLE_LOCALS sox_sample_t sox_macro_temp_sample LSX_UNUSED; \
-  double sox_macro_temp_double LSX_UNUSED
-
-/**
-Client API:
-Sign bit for sox_sample_t = 0x80000000.
-*/
-#define SOX_SAMPLE_NEG SOX_INT_MIN(32)
-
-/**
-Client API:
-Converts sox_sample_t to an unsigned integer of width (bits).
-@param bits  Width of resulting sample (1 through 32).
-@param d     Input sample to be converted.
-@param clips Variable that is incremented if the result is too big.
-@returns Unsigned integer of width (bits).
-*/
-#define SOX_SAMPLE_TO_UNSIGNED(bits,d,clips) \
-  (sox_uint##bits##_t)(SOX_SAMPLE_TO_SIGNED(bits,d,clips)^SOX_INT_MIN(bits))
-
-/**
-Client API:
-Converts sox_sample_t to a signed integer of width (bits).
-@param bits  Width of resulting sample (1 through 32).
-@param d     Input sample to be converted.
-@param clips Variable that is incremented if the result is too big.
-@returns Signed integer of width (bits).
-*/
-#define SOX_SAMPLE_TO_SIGNED(bits,d,clips) \
-  (sox_int##bits##_t)(LSX_USE_VAR(sox_macro_temp_double),sox_macro_temp_sample=(d),sox_macro_temp_sample>SOX_SAMPLE_MAX-(1<<(31-bits))?++(clips),SOX_INT_MAX(bits):((sox_uint32_t)(sox_macro_temp_sample+(1<<(31-bits))))>>(32-bits))
-
-/**
-Client API:
-Converts signed integer of width (bits) to sox_sample_t.
-@param bits Width of input sample (1 through 32).
-@param d    Input sample to be converted.
-@returns SoX native sample value.
-*/
-#define SOX_SIGNED_TO_SAMPLE(bits,d)((sox_sample_t)(d)<<(32-bits))
-
-/**
-Client API:
-Converts unsigned integer of width (bits) to sox_sample_t.
-@param bits Width of input sample (1 through 32).
-@param d    Input sample to be converted.
-@returns SoX native sample value.
-*/
-#define SOX_UNSIGNED_TO_SAMPLE(bits,d)(SOX_SIGNED_TO_SAMPLE(bits,d)^SOX_SAMPLE_NEG)
-
-/**
-Client API:
-Converts unsigned 8-bit integer to sox_sample_t.
-@param d     Input sample to be converted.
-@param clips The parameter is not used.
-@returns SoX native sample value.
-*/
-#define SOX_UNSIGNED_8BIT_TO_SAMPLE(d,clips) SOX_UNSIGNED_TO_SAMPLE(8,d)
-
-/**
-Client API:
-Converts signed 8-bit integer to sox_sample_t.
-@param d    Input sample to be converted.
-@param clips The parameter is not used.
-@returns SoX native sample value.
-*/
-#define SOX_SIGNED_8BIT_TO_SAMPLE(d,clips) SOX_SIGNED_TO_SAMPLE(8,d)
-
-/**
-Client API:
-Converts unsigned 16-bit integer to sox_sample_t.
-@param d     Input sample to be converted.
-@param clips The parameter is not used.
-@returns SoX native sample value.
-*/
-#define SOX_UNSIGNED_16BIT_TO_SAMPLE(d,clips) SOX_UNSIGNED_TO_SAMPLE(16,d)
-
-/**
-Client API:
-Converts signed 16-bit integer to sox_sample_t.
-@param d    Input sample to be converted.
-@param clips The parameter is not used.
-@returns SoX native sample value.
-*/
-#define SOX_SIGNED_16BIT_TO_SAMPLE(d,clips) SOX_SIGNED_TO_SAMPLE(16,d)
-
-/**
-Client API:
-Converts unsigned 24-bit integer to sox_sample_t.
-@param d     Input sample to be converted.
-@param clips The parameter is not used.
-@returns SoX native sample value.
-*/
-#define SOX_UNSIGNED_24BIT_TO_SAMPLE(d,clips) SOX_UNSIGNED_TO_SAMPLE(24,d)
-
-/**
-Client API:
-Converts signed 24-bit integer to sox_sample_t.
-@param d    Input sample to be converted.
-@param clips The parameter is not used.
-@returns SoX native sample value.
-*/
-#define SOX_SIGNED_24BIT_TO_SAMPLE(d,clips) SOX_SIGNED_TO_SAMPLE(24,d)
-
-/**
-Client API:
-Converts unsigned 32-bit integer to sox_sample_t.
-@param d     Input sample to be converted.
-@param clips The parameter is not used.
-@returns SoX native sample value.
-*/
-#define SOX_UNSIGNED_32BIT_TO_SAMPLE(d,clips) ((sox_sample_t)(d)^SOX_SAMPLE_NEG)
-
-/**
-Client API:
-Converts signed 32-bit integer to sox_sample_t.
-@param d    Input sample to be converted.
-@param clips The parameter is not used.
-@returns SoX native sample value.
-*/
-#define SOX_SIGNED_32BIT_TO_SAMPLE(d,clips) (sox_sample_t)(d)
-
-/**
-Client API:
-Converts 32-bit float to sox_sample_t.
-@param d     Input sample to be converted, range [-1, 1).
-@param clips Variable to increment if the input sample is too large or too small.
-@returns SoX native sample value.
-*/
-#define SOX_FLOAT_32BIT_TO_SAMPLE(d,clips) (sox_sample_t)(LSX_USE_VAR(sox_macro_temp_sample),sox_macro_temp_double=(d)*(SOX_SAMPLE_MAX+1.),sox_macro_temp_double<SOX_SAMPLE_MIN?++(clips),SOX_SAMPLE_MIN:sox_macro_temp_double>=SOX_SAMPLE_MAX+1.?sox_macro_temp_double>SOX_SAMPLE_MAX+1.?++(clips),SOX_SAMPLE_MAX:SOX_SAMPLE_MAX:sox_macro_temp_double)
-
-/**
-Client API:
-Converts 64-bit float to sox_sample_t.
-@param d     Input sample to be converted, range [-1, 1).
-@param clips Variable to increment if the input sample is too large or too small.
-@returns SoX native sample value.
-*/
-#define SOX_FLOAT_64BIT_TO_SAMPLE(d,clips) (sox_sample_t)(LSX_USE_VAR(sox_macro_temp_sample),sox_macro_temp_double=(d)*(SOX_SAMPLE_MAX+1.),sox_macro_temp_double<0?sox_macro_temp_double<=SOX_SAMPLE_MIN-.5?++(clips),SOX_SAMPLE_MIN:sox_macro_temp_double-.5:sox_macro_temp_double>=SOX_SAMPLE_MAX+.5?sox_macro_temp_double>SOX_SAMPLE_MAX+1.?++(clips),SOX_SAMPLE_MAX:SOX_SAMPLE_MAX:sox_macro_temp_double+.5)
-
-/**
-Client API:
-Converts SoX native sample to an unsigned 8-bit integer.
-@param d Input sample to be converted.
-@param clips Variable to increment if input sample is too large.
-*/
-#define SOX_SAMPLE_TO_UNSIGNED_8BIT(d,clips) SOX_SAMPLE_TO_UNSIGNED(8,d,clips)
-
-/**
-Client API:
-Converts SoX native sample to an signed 8-bit integer.
-@param d Input sample to be converted.
-@param clips Variable to increment if input sample is too large.
-*/
-#define SOX_SAMPLE_TO_SIGNED_8BIT(d,clips) SOX_SAMPLE_TO_SIGNED(8,d,clips)
-
-/**
-Client API:
-Converts SoX native sample to an unsigned 16-bit integer.
-@param d Input sample to be converted.
-@param clips Variable to increment if input sample is too large.
-*/
-#define SOX_SAMPLE_TO_UNSIGNED_16BIT(d,clips) SOX_SAMPLE_TO_UNSIGNED(16,d,clips)
-
-/**
-Client API:
-Converts SoX native sample to a signed 16-bit integer.
-@param d Input sample to be converted.
-@param clips Variable to increment if input sample is too large.
-*/
-#define SOX_SAMPLE_TO_SIGNED_16BIT(d,clips) SOX_SAMPLE_TO_SIGNED(16,d,clips)
-
-/**
-Client API:
-Converts SoX native sample to an unsigned 24-bit integer.
-@param d Input sample to be converted.
-@param clips Variable to increment if input sample is too large.
-*/
-#define SOX_SAMPLE_TO_UNSIGNED_24BIT(d,clips) SOX_SAMPLE_TO_UNSIGNED(24,d,clips)
-
-/**
-Client API:
-Converts SoX native sample to a signed 24-bit integer.
-@param d Input sample to be converted.
-@param clips Variable to increment if input sample is too large.
-*/
-#define SOX_SAMPLE_TO_SIGNED_24BIT(d,clips) SOX_SAMPLE_TO_SIGNED(24,d,clips)
-
-/**
-Client API:
-Converts SoX native sample to an unsigned 32-bit integer.
-@param d Input sample to be converted.
-@param clips The parameter is not used.
-*/
-#define SOX_SAMPLE_TO_UNSIGNED_32BIT(d,clips) (sox_uint32_t)((d)^SOX_SAMPLE_NEG)
-
-/**
-Client API:
-Converts SoX native sample to a signed 32-bit integer.
-@param d Input sample to be converted.
-@param clips The parameter is not used.
-*/
-#define SOX_SAMPLE_TO_SIGNED_32BIT(d,clips) (sox_int32_t)(d)
-
-/**
-Client API:
-Converts SoX native sample to a 32-bit float.
-@param d Input sample to be converted.
-@param clips Variable to increment if input sample is too large.
-*/
-#define SOX_SAMPLE_TO_FLOAT_32BIT(d,clips) (LSX_USE_VAR(sox_macro_temp_double),sox_macro_temp_sample=(d),sox_macro_temp_sample>SOX_SAMPLE_MAX-128?++(clips),1:(((sox_macro_temp_sample+128)&~255)*(1./(SOX_SAMPLE_MAX+1.))))
-
-/**
-Client API:
-Converts SoX native sample to a 64-bit float.
-@param d Input sample to be converted.
-@param clips The parameter is not used.
-*/
-#define SOX_SAMPLE_TO_FLOAT_64BIT(d,clips) ((d)*(1./(SOX_SAMPLE_MAX+1.)))
-
-/**
-Client API:
-Clips a value of a type that is larger then sox_sample_t (for example, int64)
-to sox_sample_t's limits and increment a counter if clipping occurs.
-@param samp Value (lvalue) to be clipped, updated as necessary.
-@param clips Value (lvalue) that is incremented if clipping is needed.
-*/
-#define SOX_SAMPLE_CLIP_COUNT(samp, clips) \
-  do { \
-    if (samp > SOX_SAMPLE_MAX) \
-      { samp = SOX_SAMPLE_MAX; clips++; } \
-    else if (samp < SOX_SAMPLE_MIN) \
-      { samp = SOX_SAMPLE_MIN; clips++; } \
-  } while (0)
-
-/**
-Client API:
-Clips a value of a type that is larger then sox_sample_t (for example, int64)
-to sox_sample_t's limits and increment a counter if clipping occurs.
-@param d Value (rvalue) to be clipped.
-@param clips Value (lvalue) that is incremented if clipping is needed.
-@returns Clipped value.
-*/
-#define SOX_ROUND_CLIP_COUNT(d, clips) \
-  ((d) < 0? (d) <= SOX_SAMPLE_MIN - 0.5? ++(clips), SOX_SAMPLE_MIN: (d) - 0.5 \
-        : (d) >= SOX_SAMPLE_MAX + 0.5? ++(clips), SOX_SAMPLE_MAX: (d) + 0.5)
-
-/**
-Client API:
-Clips a value to the limits of a signed integer of the specified width
-and increment a counter if clipping occurs.
-@param bits Width (in bits) of target integer type.
-@param i Value (rvalue) to be clipped.
-@param clips Value (lvalue) that is incremented if clipping is needed.
-@returns Clipped value.
-*/
-#define SOX_INTEGER_CLIP_COUNT(bits,i,clips) ( \
-  (i) >(1 << ((bits)-1))- 1? ++(clips),(1 << ((bits)-1))- 1 : \
-  (i) <-1 << ((bits)-1)    ? ++(clips),-1 << ((bits)-1) : (i))
-
-/**
-Client API:
-Clips a value to the limits of a 16-bit signed integer and increment a counter
-if clipping occurs.
-@param i Value (rvalue) to be clipped.
-@param clips Value (lvalue) that is incremented if clipping is needed.
-@returns Clipped value.
-*/
-#define SOX_16BIT_CLIP_COUNT(i,clips) SOX_INTEGER_CLIP_COUNT(16,i,clips)
-
-/**
-Client API:
-Clips a value to the limits of a 24-bit signed integer and increment a counter
-if clipping occurs.
-@param i Value (rvalue) to be clipped.
-@param clips Value (lvalue) that is incremented if clipping is needed.
-@returns Clipped value.
-*/
-#define SOX_24BIT_CLIP_COUNT(i,clips) SOX_INTEGER_CLIP_COUNT(24,i,clips)
-
-#define SOX_SIZE_MAX ((size_t)(-1)) /**< Client API: Maximum value of size_t. */
-
-#define SOX_UNSPEC 0                         /**< Client API: Members of sox_signalinfo_t are set to SOX_UNSPEC (= 0) if the actual value is not yet known. */
-#define SOX_UNKNOWN_LEN (sox_uint64_t)(-1) /**< Client API: sox_signalinfo_t.length is set to SOX_UNKNOWN_LEN (= -1) within the effects chain if the actual length is not known. Format handlers currently use SOX_UNSPEC instead. */
-#define SOX_IGNORE_LENGTH (sox_uint64_t)(-2) /**< Client API: sox_signalinfo_t.length is set to SOX_IGNORE_LENGTH (= -2) to indicate that a format handler should ignore length information in file headers. */
-
-#define SOX_DEFAULT_CHANNELS  2     /**< Client API: Default channel count is 2 (stereo). */
-#define SOX_DEFAULT_RATE      48000 /**< Client API: Default rate is 48000Hz. */
-#define SOX_DEFAULT_PRECISION 16    /**< Client API: Default precision is 16 bits per sample. */
-#define SOX_DEFAULT_ENCODING  SOX_ENCODING_SIGN2 /**< Client API: Default encoding is SIGN2 (linear 2's complement PCM). */
-
-#define SOX_LOOP_NONE          ((unsigned char)sox_loop_none)          /**< Client API: single-shot = 0 */
-#define SOX_LOOP_8             ((unsigned char)sox_loop_8)             /**< Client API: 8 loops = 32 */
-#define SOX_LOOP_SUSTAIN_DECAY ((unsigned char)sox_loop_sustain_decay) /**< Client API: AIFF style, one sustain & one decay loop = 64 */
-
-#define SOX_MAX_NLOOPS         8 /**< Client API: Maximum number of loops supported by sox_oob_t = 8. */
-
-#define SOX_FILE_NOSTDIO 0x0001 /**< Client API: Does not use stdio routines */
-#define SOX_FILE_DEVICE  0x0002 /**< Client API: File is an audio device */
-#define SOX_FILE_PHONY   0x0004 /**< Client API: Phony file/device (for example /dev/null) */
-#define SOX_FILE_REWIND  0x0008 /**< Client API: File should be rewound to write header */
-#define SOX_FILE_BIT_REV 0x0010 /**< Client API: Is file bit-reversed? */
-#define SOX_FILE_NIB_REV 0x0020 /**< Client API: Is file nibble-reversed? */
-#define SOX_FILE_ENDIAN  0x0040 /**< Client API: Is file format endian? */
-#define SOX_FILE_ENDBIG  0x0080 /**< Client API: For endian file format, is it big endian? */
-#define SOX_FILE_MONO    0x0100 /**< Client API: Do channel restrictions allow mono? */
-#define SOX_FILE_STEREO  0x0200 /**< Client API: Do channel restrictions allow stereo? */
-#define SOX_FILE_QUAD    0x0400 /**< Client API: Do channel restrictions allow quad? */
-
-#define SOX_FILE_CHANS   (SOX_FILE_MONO | SOX_FILE_STEREO | SOX_FILE_QUAD) /**< Client API: No channel restrictions */
-#define SOX_FILE_LIT_END (SOX_FILE_ENDIAN | 0)                             /**< Client API: File is little-endian */
-#define SOX_FILE_BIG_END (SOX_FILE_ENDIAN | SOX_FILE_ENDBIG)               /**< Client API: File is big-endian */
-
-#define SOX_EFF_CHAN     1           /**< Client API: Effect might alter the number of channels */
-#define SOX_EFF_RATE     2           /**< Client API: Effect might alter sample rate */
-#define SOX_EFF_PREC     4           /**< Client API: Effect does its own calculation of output sample precision (otherwise a default value is taken, depending on the presence of SOX_EFF_MODIFY) */
-#define SOX_EFF_LENGTH   8           /**< Client API: Effect might alter audio length (as measured in time units, not necessarily in samples) */
-#define SOX_EFF_MCHAN    16          /**< Client API: Effect handles multiple channels internally */
-#define SOX_EFF_NULL     32          /**< Client API: Effect does nothing (can be optimized out of chain) */
-#define SOX_EFF_DEPRECATED 64        /**< Client API: Effect will soon be removed from SoX */
-#define SOX_EFF_GAIN     128         /**< Client API: Effect does not support gain -r */
-#define SOX_EFF_MODIFY   256         /**< Client API: Effect does not modify sample values (but might remove or duplicate samples or insert zeros) */
-#define SOX_EFF_ALPHA    512         /**< Client API: Effect is experimental/incomplete */
-#define SOX_EFF_INTERNAL 1024        /**< Client API: Effect present in libSoX but not valid for use by SoX command-line tools */
-
-/**
-Client API:
-When used as the "whence" parameter of sox_seek, indicates that the specified
-offset is relative to the beginning of the file.
-*/
-#define SOX_SEEK_SET 0
-
-/*****************************************************************************
-Forward declarations:
-*****************************************************************************/
-
-typedef struct sox_format_t sox_format_t;
-typedef struct sox_effect_t sox_effect_t;
-typedef struct sox_effect_handler_t sox_effect_handler_t;
-typedef struct sox_format_handler_t sox_format_handler_t;
-
-/*****************************************************************************
-Function pointers:
-*****************************************************************************/
-
-/**
-Client API:
-Callback to write a message to an output device (console or log file),
-used by sox_globals_t.output_message_handler.
-*/
-typedef void (LSX_API * sox_output_message_handler_t)(
-    unsigned level,                       /* 1 = FAIL, 2 = WARN, 3 = INFO, 4 = DEBUG, 5 = DEBUG_MORE, 6 = DEBUG_MOST. */
-    LSX_PARAM_IN_Z char const * filename, /* Source code __FILENAME__ from which message originates. */
-    LSX_PARAM_IN_PRINTF char const * fmt, /* Message format string. */
-    LSX_PARAM_IN va_list ap               /* Message format parameters. */
-    );
-
-/**
-Client API:
-Callback to retrieve information about a format handler,
-used by sox_format_tab_t.fn.
-@returns format handler information.
-*/
-typedef sox_format_handler_t const * (LSX_API * sox_format_fn_t)(void);
-
-/**
-Client API:
-Callback to get information about an effect handler,
-used by the table returned from sox_get_effect_fns(void).
-@returns Pointer to information about an effect handler.
-*/
-typedef sox_effect_handler_t const * (LSX_API *sox_effect_fn_t)(void);
-
-/**
-Client API:
-Callback to initialize reader (decoder), used by
-sox_format_handler.startread.
-@returns SOX_SUCCESS if successful.
-*/
-typedef int (LSX_API * sox_format_handler_startread)(
-    LSX_PARAM_INOUT sox_format_t * ft /**< Format pointer. */
-    );
-
-/**
-Client API:
-Callback to read (decode) a block of samples,
-used by sox_format_handler.read.
-@returns number of samples read, or 0 if unsuccessful.
-*/
-typedef size_t (LSX_API * sox_format_handler_read)(
-    LSX_PARAM_INOUT sox_format_t * ft, /**< Format pointer. */
-    LSX_PARAM_OUT_CAP_POST_COUNT(len,return) sox_sample_t *buf, /**< Buffer from which to read samples. */
-    size_t len /**< Number of samples available in buf. */
-    );
-
-/**
-Client API:
-Callback to close reader (decoder),
-used by sox_format_handler.stopread.
-@returns SOX_SUCCESS if successful.
-*/
-typedef int (LSX_API * sox_format_handler_stopread)(
-    LSX_PARAM_INOUT sox_format_t * ft /**< Format pointer. */
-    );
-
-/**
-Client API:
-Callback to initialize writer (encoder),
-used by sox_format_handler.startwrite.
-@returns SOX_SUCCESS if successful.
-*/
-typedef int (LSX_API * sox_format_handler_startwrite)(
-    LSX_PARAM_INOUT sox_format_t * ft /**< Format pointer. */
-    );
-
-/**
-Client API:
-Callback to write (encode) a block of samples,
-used by sox_format_handler.write.
-@returns number of samples written, or 0 if unsuccessful.
-*/
-typedef size_t (LSX_API * sox_format_handler_write)(
-    LSX_PARAM_INOUT sox_format_t * ft, /**< Format pointer. */
-    LSX_PARAM_IN_COUNT(len) sox_sample_t const * buf, /**< Buffer to which samples are written. */
-    size_t len /**< Capacity of buf, measured in samples. */
-    );
-
-/**
-Client API:
-Callback to close writer (decoder),
-used by sox_format_handler.stopwrite.
-@returns SOX_SUCCESS if successful.
-*/
-typedef int (LSX_API * sox_format_handler_stopwrite)(
-    LSX_PARAM_INOUT sox_format_t * ft /**< Format pointer. */
-    );
-
-/**
-Client API:
-Callback to reposition reader,
-used by sox_format_handler.seek.
-@returns SOX_SUCCESS if successful.
-*/
-typedef int (LSX_API * sox_format_handler_seek)(
-    LSX_PARAM_INOUT sox_format_t * ft, /**< Format pointer. */
-    sox_uint64_t offset /**< Sample offset to which reader should be positioned. */
-    );
-
-/**
-Client API:
-Callback to parse command-line arguments (called once per effect),
-used by sox_effect_handler.getopts.
-@returns SOX_SUCCESS if successful.
-*/
-typedef int (LSX_API * sox_effect_handler_getopts)(
-    LSX_PARAM_INOUT sox_effect_t * effp, /**< Effect pointer. */
-    int argc, /**< Number of arguments in argv. */
-    LSX_PARAM_IN_COUNT(argc) char *argv[] /**< Array of command-line arguments. */
-    );
-
-/**
-Client API:
-Callback to initialize effect (called once per flow),
-used by sox_effect_handler.start.
-@returns SOX_SUCCESS if successful.
-*/
-typedef int (LSX_API * sox_effect_handler_start)(
-    LSX_PARAM_INOUT sox_effect_t * effp /**< Effect pointer. */
-    );
-
-/**
-Client API:
-Callback to process samples,
-used by sox_effect_handler.flow.
-@returns SOX_SUCCESS if successful.
-*/
-typedef int (LSX_API * sox_effect_handler_flow)(
-    LSX_PARAM_INOUT sox_effect_t * effp, /**< Effect pointer. */
-    LSX_PARAM_IN_COUNT(*isamp) sox_sample_t const * ibuf, /**< Buffer from which to read samples. */
-    LSX_PARAM_OUT_CAP_POST_COUNT(*osamp,*osamp) sox_sample_t * obuf, /**< Buffer to which samples are written. */
-    LSX_PARAM_INOUT size_t *isamp, /**< On entry, contains capacity of ibuf; on exit, contains number of samples consumed. */
-    LSX_PARAM_INOUT size_t *osamp /**< On entry, contains capacity of obuf; on exit, contains number of samples written. */
-    );
-
-/**
-Client API:
-Callback to finish getting output after input is complete,
-used by sox_effect_handler.drain.
-@returns SOX_SUCCESS if successful.
-*/
-typedef int (LSX_API * sox_effect_handler_drain)(
-    LSX_PARAM_INOUT sox_effect_t * effp, /**< Effect pointer. */
-    LSX_PARAM_OUT_CAP_POST_COUNT(*osamp,*osamp) sox_sample_t *obuf, /**< Buffer to which samples are written. */
-    LSX_PARAM_INOUT size_t *osamp /**< On entry, contains capacity of obuf; on exit, contains number of samples written. */
-    );
-
-/**
-Client API:
-Callback to shut down effect (called once per flow),
-used by sox_effect_handler.stop.
-@returns SOX_SUCCESS if successful.
-*/
-typedef int (LSX_API * sox_effect_handler_stop)(
-    LSX_PARAM_INOUT sox_effect_t * effp /**< Effect pointer. */
-    );
-
-/**
-Client API:
-Callback to shut down effect (called once per effect),
-used by sox_effect_handler.kill.
-@returns SOX_SUCCESS if successful.
-*/
-typedef int (LSX_API * sox_effect_handler_kill)(
-    LSX_PARAM_INOUT sox_effect_t * effp /**< Effect pointer. */
-    );
-
-/**
-Client API:
-Callback called while flow is running (called once per buffer),
-used by sox_flow_effects.callback.
-@returns SOX_SUCCESS to continue, other value to abort flow.
-*/
-typedef int (LSX_API * sox_flow_effects_callback)(
-    sox_bool all_done,
-    void * client_data
-    );
-
-/**
-Client API:
-Callback for enumerating the contents of a playlist,
-used by the sox_parse_playlist function.
-@returns SOX_SUCCESS if successful, any other value to abort playlist enumeration.
-*/
-typedef int (LSX_API * sox_playlist_callback_t)(
-    void * callback_data,
-    LSX_PARAM_IN_Z char const * filename
-    );
-
-/*****************************************************************************
-Structures:
-*****************************************************************************/
-
-/**
-Client API:
-Information about a build of libSoX, returned from the sox_version_info
-function.
-*/
-typedef struct sox_version_info_t {
-    size_t       size;         /**< structure size = sizeof(sox_version_info_t) */
-    sox_version_flags_t flags; /**< feature flags = popen | magic | threads | memopen */
-    sox_uint32_t version_code; /**< version number = 0x140400 */
-    char const * version;      /**< version string = sox_version(), for example, "14.4.0" */
-    char const * version_extra;/**< version extra info or null = "PACKAGE_EXTRA", for example, "beta" */
-    char const * time;         /**< build time = "__DATE__ __TIME__", for example, "Jan  7 2010 03:31:50" */
-    char const * distro;       /**< distro or null = "DISTRO", for example, "Debian" */
-    char const * compiler;     /**< compiler info or null, for example, "msvc 160040219" */
-    char const * arch;         /**< arch, for example, "1248 48 44 L OMP" */
-    /* new info should be added at the end for version backwards-compatibility. */
-} sox_version_info_t;
-
-/**
-Client API:
-Global parameters (for effects & formats), returned from the sox_get_globals
-function.
-*/
-typedef struct sox_globals_t {
-/* public: */
-  unsigned     verbosity; /**< messages are only written if globals.verbosity >= message.level */
-  sox_output_message_handler_t output_message_handler; /**< client-specified message output callback */
-  sox_bool     repeatable; /**< true to use pre-determined timestamps and PRNG seed */
-
-  /**
-  Default size (in bytes) used by libSoX for blocks of sample data.
-  Plugins should use similarly-sized buffers to get best performance.
-  */
-  size_t       bufsiz;
-
-  /**
-  Default size (in bytes) used by libSoX for blocks of input sample data.
-  Plugins should use similarly-sized buffers to get best performance.
-  */
-  size_t       input_bufsiz;
-
-  sox_int32_t  ranqd1; /**< Can be used to re-seed libSoX's PRNG */
-
-  char const * stdin_in_use_by;  /**< Private: tracks the name of the handler currently using stdin */
-  char const * stdout_in_use_by; /**< Private: tracks the name of the handler currently using stdout */
-  char const * subsystem;        /**< Private: tracks the name of the handler currently writing an output message */
-  char       * tmp_path;         /**< Private: client-configured path to use for temporary files */
-  sox_bool     use_magic;        /**< Private: true if client has requested use of 'magic' file-type detection */
-  sox_bool     use_threads;      /**< Private: true if client has requested parallel effects processing */
-} sox_globals_t;
-
-/**
-Client API:
-Signal parameters; members should be set to SOX_UNSPEC (= 0) if unknown.
-*/
-typedef struct sox_signalinfo_t {
-  sox_rate_t       rate;         /**< samples per second, 0 if unknown */
-  unsigned         channels;     /**< number of sound channels, 0 if unknown */
-  unsigned         precision;    /**< bits per sample, 0 if unknown */
-  sox_uint64_t     length;       /**< samples * chans in file, 0 if unknown, -1 if unspecified */
-  double           * mult;       /**< Effects headroom multiplier; may be null */
-} sox_signalinfo_t;
-
-/**
-Client API:
-Basic information about an encoding.
-*/
-typedef struct sox_encodings_info_t {
-  sox_encodings_flags_t flags; /**< lossy once (lossy1), lossy twice (lossy2), or lossless (none). */
-  char const * name;           /**< encoding name. */
-  char const * desc;           /**< encoding description. */
-} sox_encodings_info_t;
-
-/**
-Client API:
-Encoding parameters.
-*/
-typedef struct sox_encodinginfo_t {
-  sox_encoding_t encoding; /**< format of sample numbers */
-  unsigned bits_per_sample;/**< 0 if unknown or variable; uncompressed value if lossless; compressed value if lossy */
-  double compression;      /**< compression factor (where applicable) */
-
-  /**
-  Should bytes be reversed? If this is default during sox_open_read or
-  sox_open_write, libSoX will set them to either no or yes according to the
-  machine or format default.
-  */
-  sox_option_t reverse_bytes;
-
-  /**
-  Should nibbles be reversed? If this is default during sox_open_read or
-  sox_open_write, libSoX will set them to either no or yes according to the
-  machine or format default.
-  */
-  sox_option_t reverse_nibbles;
-
-  /**
-  Should bits be reversed? If this is default during sox_open_read or
-  sox_open_write, libSoX will set them to either no or yes according to the
-  machine or format default.
-  */
-  sox_option_t reverse_bits;
-
-  /**
-  If set to true, the format should reverse its default endianness.
-  */
-  sox_bool opposite_endian;
-} sox_encodinginfo_t;
-
-/**
-Client API:
-Looping parameters (out-of-band data).
-*/
-typedef struct sox_loopinfo_t {
-  sox_uint64_t  start;  /**< first sample */
-  sox_uint64_t  length; /**< length */
-  unsigned      count;  /**< number of repeats, 0=forever */
-  unsigned char type;   /**< 0=no, 1=forward, 2=forward/back (see sox_loop_* for valid values). */
-} sox_loopinfo_t;
-
-/**
-Client API:
-Instrument information.
-*/
-typedef struct sox_instrinfo_t{
-  signed char MIDInote;   /**< for unity pitch playback */
-  signed char MIDIlow;    /**< MIDI pitch-bend low range */
-  signed char MIDIhi;     /**< MIDI pitch-bend high range */
-  unsigned char loopmode; /**< 0=no, 1=forward, 2=forward/back (see sox_loop_* values) */
-  unsigned nloops;  /**< number of active loops (max SOX_MAX_NLOOPS). */
-} sox_instrinfo_t;
-
-/**
-Client API:
-File buffer info.  Holds info so that data can be read in blocks.
-*/
-typedef struct sox_fileinfo_t {
-  char          *buf;                 /**< Pointer to data buffer */
-  size_t        size;                 /**< Size of buffer in bytes */
-  size_t        count;                /**< Count read into buffer */
-  size_t        pos;                  /**< Position in buffer */
-} sox_fileinfo_t;
-
-/**
-Client API:
-Handler structure defined by each format.
-*/
-struct sox_format_handler_t {
-  unsigned     sox_lib_version_code;  /**< Checked on load; must be 1st in struct*/
-  char         const * description;   /**< short description of format */
-  char         const * const * names; /**< null-terminated array of filename extensions that are handled by this format */
-  unsigned int flags;                 /**< File flags (SOX_FILE_* values). */
-  sox_format_handler_startread startread; /**< called to initialize reader (decoder) */
-  sox_format_handler_read read;       /**< called to read (decode) a block of samples */
-  sox_format_handler_stopread stopread; /**< called to close reader (decoder); may be null if no closing necessary */
-  sox_format_handler_startwrite startwrite; /**< called to initialize writer (encoder) */
-  sox_format_handler_write write;     /**< called to write (encode) a block of samples */
-  sox_format_handler_stopwrite stopwrite; /**< called to close writer (decoder); may be null if no closing necessary */
-  sox_format_handler_seek seek;       /**< called to reposition reader; may be null if not supported */
-
-  /**
-  Array of values indicating the encodings and precisions supported for
-  writing (encoding). Precisions specified with default precision first.
-  Encoding, precision, precision, ..., 0, repeat. End with one more 0.
-  Example:
-  unsigned const * formats = {
-    SOX_ENCODING_SIGN2, 16, 24, 0, // Support SIGN2 at 16 and 24 bits, default to 16 bits.
-    SOX_ENCODING_UNSIGNED, 8, 0,   // Support UNSIGNED at 8 bits, default to 8 bits.
-    0 // No more supported encodings.
-  };
-  */
-  unsigned     const * write_formats;
-
-  /**
-  Array of sample rates (samples per second) supported for writing (encoding).
-  NULL if all (or almost all) rates are supported. End with 0.
-  */
-  sox_rate_t   const * write_rates;
-
-  /**
-  SoX will automatically allocate a buffer in which the handler can store data.
-  Specify the size of the buffer needed here. Usually this will be sizeof(your_struct).
-  The buffer will be allocated and zeroed before the call to startread/startwrite.
-  The buffer will be freed after the call to stopread/stopwrite.
-  The buffer will be provided via format.priv in each call to the handler.
-  */
-  size_t       priv_size;
-};
-
-/**
-Client API:
-Comments, instrument info, loop info (out-of-band data).
-*/
-typedef struct sox_oob_t{
-  /* Decoded: */
-  sox_comments_t   comments;              /**< Comment strings in id=value format. */
-  sox_instrinfo_t  instr;                 /**< Instrument specification */
-  sox_loopinfo_t   loops[SOX_MAX_NLOOPS]; /**< Looping specification */
-
-  /* TBD: Non-decoded chunks, etc: */
-} sox_oob_t;
-
-/**
-Client API:
-Data passed to/from the format handler
-*/
-struct sox_format_t {
-  char             * filename;      /**< File name */
-
-  /**
-  Signal specifications for reader (decoder) or writer (encoder):
-  sample rate, number of channels, precision, length, headroom multiplier.
-  Any info specified by the user is here on entry to startread or
-  startwrite. Info will be SOX_UNSPEC if the user provided no info.
-  At exit from startread, should be completely filled in, using
-  either data from the file's headers (if available) or whatever
-  the format is guessing/assuming (if header data is not available).
-  At exit from startwrite, should be completely filled in, using
-  either the data that was specified, or values chosen by the format
-  based on the format's defaults or capabilities.
-  */
-  sox_signalinfo_t signal;
-
-  /**
-  Encoding specifications for reader (decoder) or writer (encoder):
-  encoding (sample format), bits per sample, compression rate, endianness.
-  Should be filled in by startread. Values specified should be used
-  by startwrite when it is configuring the encoding parameters.
-  */
-  sox_encodinginfo_t encoding;
-
-  char             * filetype;      /**< Type of file, as determined by header inspection or libmagic. */
-  sox_oob_t        oob;             /**< comments, instrument info, loop info (out-of-band data) */
-  sox_bool         seekable;        /**< Can seek on this file */
-  char             mode;            /**< Read or write mode ('r' or 'w') */
-  sox_uint64_t     olength;         /**< Samples * chans written to file */
-  sox_uint64_t     clips;           /**< Incremented if clipping occurs */
-  int              sox_errno;       /**< Failure error code */
-  char             sox_errstr[256]; /**< Failure error text */
-  void             * fp;            /**< File stream pointer */
-  lsx_io_type      io_type;         /**< Stores whether this is a file, pipe or URL */
-  sox_uint64_t     tell_off;        /**< Current offset within file */
-  sox_uint64_t     data_start;      /**< Offset at which headers end and sound data begins (set by lsx_check_read_params) */
-  sox_format_handler_t handler;     /**< Format handler for this file */
-  void             * priv;          /**< Format handler's private data area */
-};
-
-/**
-Client API:
-Information about a loaded format handler, including the format name and a
-function pointer that can be invoked to get additional information about the
-format.
-*/
-typedef struct sox_format_tab_t {
-  char *name;         /**< Name of format handler */
-  sox_format_fn_t fn; /**< Function to call to get format handler's information */
-} sox_format_tab_t;
-
-/**
-Client API:
-Global parameters for effects.
-*/
-typedef struct sox_effects_globals_t {
-  sox_plot_t plot;         /**< To help the user choose effect & options */
-  sox_globals_t * global_info; /**< Pointer to associated SoX globals */
-} sox_effects_globals_t;
-
-/**
-Client API:
-Effect handler information.
-*/
-struct sox_effect_handler_t {
-  char const * name;  /**< Effect name */
-  char const * usage; /**< Short explanation of parameters accepted by effect */
-  unsigned int flags; /**< Combination of SOX_EFF_* flags */
-  sox_effect_handler_getopts getopts; /**< Called to parse command-line arguments (called once per effect). */
-  sox_effect_handler_start start;     /**< Called to initialize effect (called once per flow). */
-  sox_effect_handler_flow flow;       /**< Called to process samples. */
-  sox_effect_handler_drain drain;     /**< Called to finish getting output after input is complete. */
-  sox_effect_handler_stop stop;       /**< Called to shut down effect (called once per flow). */
-  sox_effect_handler_kill kill;       /**< Called to shut down effect (called once per effect). */
-  size_t       priv_size;             /**< Size of private data SoX should pre-allocate for effect */
-};
-
-/**
-Client API:
-Effect information.
-*/
-struct sox_effect_t {
-  sox_effects_globals_t    * global_info; /**< global effect parameters */
-  sox_signalinfo_t         in_signal;     /**< Information about the incoming data stream */
-  sox_signalinfo_t         out_signal;    /**< Information about the outgoing data stream */
-  sox_encodinginfo_t       const * in_encoding;  /**< Information about the incoming data encoding */
-  sox_encodinginfo_t       const * out_encoding; /**< Information about the outgoing data encoding */
-  sox_effect_handler_t     handler;   /**< The handler for this effect */
-  sox_sample_t             * obuf;    /**< output buffer */
-  size_t                   obeg;      /**< output buffer: start of valid data section */
-  size_t                   oend;      /**< output buffer: one past valid data section (oend-obeg is length of current content) */
-  size_t               imin;          /**< minimum input buffer content required for calling this effect's flow function; set via lsx_effect_set_imin() */
-  sox_uint64_t         clips;         /**< increment if clipping occurs */
-  size_t               flows;         /**< 1 if MCHAN, number of chans otherwise */
-  size_t               flow;          /**< flow number */
-  void                 * priv;        /**< Effect's private data area (each flow has a separate copy) */
-};
-
-/**
-Client API:
-Chain of effects to be applied to a stream.
-*/
-typedef struct sox_effects_chain_t {
-  sox_effect_t **effects;                  /**< Table of effects to be applied to a stream */
-  unsigned table_size;                     /**< Number of entries in effects table */
-  unsigned length;                         /**< Number of effects to be applied */
-  sox_sample_t **ibufc;                    /**< Channel interleave buffer */
-  sox_sample_t **obufc;                    /**< Channel interleave buffer */
-  sox_effects_globals_t global_info;       /**< Copy of global effects settings */
-  sox_encodinginfo_t const * in_enc;       /**< Input encoding */
-  sox_encodinginfo_t const * out_enc;      /**< Output encoding */
-} sox_effects_chain_t;
-
-/*****************************************************************************
-Functions:
-*****************************************************************************/
-
-/**
-Client API:
-Returns version number string of libSoX, for example, "14.4.0".
-@returns The version number string of libSoX, for example, "14.4.0".
-*/
-LSX_RETURN_VALID_Z LSX_RETURN_PURE
-char const *
-LSX_API
-sox_version(void);
-
-/**
-Client API:
-Returns information about this build of libsox.
-@returns Pointer to a version information structure.
-*/
-LSX_RETURN_VALID LSX_RETURN_PURE
-sox_version_info_t const *
-LSX_API
-sox_version_info(void);
-
-/**
-Client API:
-Returns a pointer to the structure with libSoX's global settings.
-@returns a pointer to the structure with libSoX's global settings.
-*/
-LSX_RETURN_VALID LSX_RETURN_PURE
-sox_globals_t *
-LSX_API
-sox_get_globals(void);
-
-/**
-Client API:
-Deprecated macro that returns the structure with libSoX's global settings
-as an lvalue.
-*/
-#define sox_globals (*sox_get_globals())
-
-/**
-Client API:
-Returns a pointer to the list of available encodings.
-End of list indicated by name == NULL.
-@returns pointer to the list of available encodings.
-*/
-LSX_RETURN_ARRAY LSX_RETURN_PURE
-sox_encodings_info_t const *
-LSX_API
-sox_get_encodings_info(void);
-
-/**
-Client API:
-Deprecated macro that returns the list of available encodings.
-End of list indicated by name == NULL.
-*/
-#define sox_encodings_info (sox_get_encodings_info())
-
-/**
-Client API:
-Fills in an encodinginfo with default values.
-*/
-void
-LSX_API
-sox_init_encodinginfo(
-    LSX_PARAM_OUT sox_encodinginfo_t * e /**< Pointer to uninitialized encoding info structure to be initialized. */
-    );
-
-/**
-Client API:
-Given an encoding (for example, SIGN2) and the encoded bits_per_sample (for
-example, 16), returns the number of useful bits per sample in the decoded data
-(for example, 16), or returns 0 to indicate that the value returned by the
-format handler should be used instead of a pre-determined precision.
-@returns the number of useful bits per sample in the decoded data (for example
-16), or returns 0 to indicate that the value returned by the format handler
-should be used instead of a pre-determined precision.
-*/
-LSX_RETURN_PURE
-unsigned
-LSX_API
-sox_precision(
-    sox_encoding_t encoding,   /**< Encoding for which to lookup precision information. */
-    unsigned bits_per_sample   /**< The number of encoded bits per sample. */
-    );
-
-/**
-Client API:
-Returns the number of items in the metadata block.
-@returns the number of items in the metadata block.
-*/
-size_t
-LSX_API
-sox_num_comments(
-    LSX_PARAM_IN_OPT sox_comments_t comments /**< Metadata block. */
-    );
-
-/**
-Client API:
-Adds an "id=value" item to the metadata block.
-*/
-void
-LSX_API
-sox_append_comment(
-    LSX_PARAM_DEREF_PRE_MAYBENULL LSX_PARAM_DEREF_POST_NOTNULL sox_comments_t * comments, /**< Metadata block. */
-    LSX_PARAM_IN_Z char const * item /**< Item to be added in "id=value" format. */
-    );
-
-/**
-Client API:
-Adds a newline-delimited list of "id=value" items to the metadata block.
-*/
-void
-LSX_API
-sox_append_comments(
-    LSX_PARAM_DEREF_PRE_MAYBENULL LSX_PARAM_DEREF_POST_NOTNULL sox_comments_t * comments, /**< Metadata block. */
-    LSX_PARAM_IN_Z char const * items /**< Newline-separated list of items to be added, for example "id1=value1\\nid2=value2". */
-    );
-
-/**
-Client API:
-Duplicates the metadata block.
-@returns the copied metadata block.
-*/
-LSX_RETURN_OPT
-sox_comments_t
-LSX_API
-sox_copy_comments(
-    LSX_PARAM_IN_OPT sox_comments_t comments /**< Metadata block to copy. */
-    );
-
-/**
-Client API:
-Frees the metadata block.
-*/
-void
-LSX_API
-sox_delete_comments(
-    LSX_PARAM_DEREF_PRE_MAYBENULL LSX_PARAM_DEREF_POST_NULL sox_comments_t * comments /**< Metadata block. */
-    );
-
-/**
-Client API:
-If "id=value" is found, return value, else return null.
-@returns value, or null if value not found.
-*/
-LSX_RETURN_OPT
-char const *
-LSX_API
-sox_find_comment(
-    LSX_PARAM_IN_OPT sox_comments_t comments, /**< Metadata block in which to search. */
-    LSX_PARAM_IN_Z char const * id /**< Id for which to search */
-    );
-
-/**
-Client API:
-Find and load format handler plugins.
-@returns SOX_SUCCESS if successful.
-*/
-int
-LSX_API
-sox_format_init(void);
-
-/**
-Client API:
-Unload format handler plugins.
-*/
-void
-LSX_API
-sox_format_quit(void);
-
-/**
-Client API:
-Initialize effects library.
-@returns SOX_SUCCESS if successful.
-*/
-int
-LSX_API
-sox_init(void);
-
-/**
-Client API:
-Close effects library and unload format handler plugins.
-@returns SOX_SUCCESS if successful.
-*/
-int
-LSX_API
-sox_quit(void);
-
-/**
-Client API:
-Returns the table of format handler names and functions.
-@returns the table of format handler names and functions.
-*/
-LSX_RETURN_ARRAY LSX_RETURN_PURE
-sox_format_tab_t const *
-LSX_API
-sox_get_format_fns(void);
-
-/**
-Client API:
-Deprecated macro that returns the table of format handler names and functions.
-*/
-#define sox_format_fns (sox_get_format_fns())
-
-/**
-Client API:
-Opens a decoding session for a file. Returned handle must be closed with sox_close().
-@returns The handle for the new session, or null on failure.
-*/
-LSX_RETURN_OPT
-sox_format_t *
-LSX_API
-sox_open_read(
-    LSX_PARAM_IN_Z   char               const * path,      /**< Path to file to be opened (required). */
-    LSX_PARAM_IN_OPT sox_signalinfo_t   const * signal,    /**< Information already known about audio stream, or NULL if none. */
-    LSX_PARAM_IN_OPT sox_encodinginfo_t const * encoding,  /**< Information already known about sample encoding, or NULL if none. */
-    LSX_PARAM_IN_OPT_Z char             const * filetype   /**< Previously-determined file type, or NULL to auto-detect. */
-    );
-
-/**
-Client API:
-Opens a decoding session for a memory buffer. Returned handle must be closed with sox_close().
-@returns The handle for the new session, or null on failure.
-*/
-LSX_RETURN_OPT
-sox_format_t *
-LSX_API
-sox_open_mem_read(
-    LSX_PARAM_IN_BYTECOUNT(buffer_size) void  * buffer,     /**< Pointer to audio data buffer (required). */
-    size_t                                      buffer_size,/**< Number of bytes to read from audio data buffer. */
-    LSX_PARAM_IN_OPT sox_signalinfo_t   const * signal,     /**< Information already known about audio stream, or NULL if none. */
-    LSX_PARAM_IN_OPT sox_encodinginfo_t const * encoding,   /**< Information already known about sample encoding, or NULL if none. */
-    LSX_PARAM_IN_OPT_Z char             const * filetype    /**< Previously-determined file type, or NULL to auto-detect. */
-    );
-
-/**
-Client API:
-Returns true if the format handler for the specified file type supports the specified encoding.
-@returns true if the format handler for the specified file type supports the specified encoding.
-*/
-sox_bool
-LSX_API
-sox_format_supports_encoding(
-    LSX_PARAM_IN_OPT_Z char               const * path,       /**< Path to file to be examined (required if filetype is NULL). */
-    LSX_PARAM_IN_OPT_Z char               const * filetype,   /**< Previously-determined file type, or NULL to use extension from path. */
-    LSX_PARAM_IN       sox_encodinginfo_t const * encoding    /**< Encoding for which format handler should be queried. */
-    );
-
-/**
-Client API:
-Gets the format handler for a specified file type.
-@returns The found format handler, or null if not found.
-*/
-LSX_RETURN_OPT
-sox_format_handler_t const *
-LSX_API
-sox_write_handler(
-    LSX_PARAM_IN_OPT_Z char               const * path,         /**< Path to file (required if filetype is NULL). */
-    LSX_PARAM_IN_OPT_Z char               const * filetype,     /**< Filetype for which handler is needed, or NULL to use extension from path. */
-    LSX_PARAM_OUT_OPT  char               const * * filetype1   /**< Receives the filetype that was detected. Pass NULL if not needed. */
-    );
-
-/**
-Client API:
-Opens an encoding session for a file. Returned handle must be closed with sox_close().
-@returns The new session handle, or null on failure.
-*/
-LSX_RETURN_OPT
-sox_format_t *
-LSX_API
-sox_open_write(
-    LSX_PARAM_IN_Z     char               const * path,     /**< Path to file to be written (required). */
-    LSX_PARAM_IN       sox_signalinfo_t   const * signal,   /**< Information about desired audio stream (required). */
-    LSX_PARAM_IN_OPT   sox_encodinginfo_t const * encoding, /**< Information about desired sample encoding, or NULL to use defaults. */
-    LSX_PARAM_IN_OPT_Z char               const * filetype, /**< Previously-determined file type, or NULL to auto-detect. */
-    LSX_PARAM_IN_OPT   sox_oob_t          const * oob,      /**< Out-of-band data to add to file, or NULL if none. */
-    LSX_PARAM_IN_OPT   sox_bool           (LSX_API * overwrite_permitted)(LSX_PARAM_IN_Z char const * filename) /**< Called if file exists to determine whether overwrite is ok. */
-    );
-
-/**
-Client API:
-Opens an encoding session for a memory buffer. Returned handle must be closed with sox_close().
-@returns The new session handle, or null on failure.
-*/
-LSX_RETURN_OPT
-sox_format_t *
-LSX_API
-sox_open_mem_write(
-    LSX_PARAM_OUT_BYTECAP(buffer_size) void                     * buffer,      /**< Pointer to audio data buffer that receives data (required). */
-    LSX_PARAM_IN                       size_t                     buffer_size, /**< Maximum number of bytes to write to audio data buffer. */
-    LSX_PARAM_IN                       sox_signalinfo_t   const * signal,      /**< Information about desired audio stream (required). */
-    LSX_PARAM_IN_OPT                   sox_encodinginfo_t const * encoding,    /**< Information about desired sample encoding, or NULL to use defaults. */
-    LSX_PARAM_IN_OPT_Z                 char               const * filetype,    /**< Previously-determined file type, or NULL to auto-detect. */
-    LSX_PARAM_IN_OPT                   sox_oob_t          const * oob          /**< Out-of-band data to add to file, or NULL if none. */
-    );
-
-/**
-Client API:
-Opens an encoding session for a memstream buffer. Returned handle must be closed with sox_close().
-@returns The new session handle, or null on failure.
-*/
-LSX_RETURN_OPT
-sox_format_t *
-LSX_API
-sox_open_memstream_write(
-    LSX_PARAM_OUT      char                     * * buffer_ptr,    /**< Receives pointer to audio data buffer that receives data (required). */
-    LSX_PARAM_OUT      size_t                   * buffer_size_ptr, /**< Receives size of data written to audio data buffer (required). */
-    LSX_PARAM_IN       sox_signalinfo_t   const * signal,          /**< Information about desired audio stream (required). */
-    LSX_PARAM_IN_OPT   sox_encodinginfo_t const * encoding,        /**< Information about desired sample encoding, or NULL to use defaults. */
-    LSX_PARAM_IN_OPT_Z char               const * filetype,        /**< Previously-determined file type, or NULL to auto-detect. */
-    LSX_PARAM_IN_OPT   sox_oob_t          const * oob              /**< Out-of-band data to add to file, or NULL if none. */
-    );
-
-/**
-Client API:
-Reads samples from a decoding session into a sample buffer.
-@returns Number of samples decoded, or 0 for EOF.
-*/
-size_t
-LSX_API
-sox_read(
-    LSX_PARAM_INOUT sox_format_t * ft, /**< Format pointer. */
-    LSX_PARAM_OUT_CAP_POST_COUNT(len,return) sox_sample_t *buf, /**< Buffer from which to read samples. */
-    size_t len /**< Number of samples available in buf. */
-    );
-
-/**
-Client API:
-Writes samples to an encoding session from a sample buffer.
-@returns Number of samples encoded.
-*/
-size_t
-LSX_API
-sox_write(
-    LSX_PARAM_INOUT sox_format_t * ft, /**< Format pointer. */
-    LSX_PARAM_IN_COUNT(len) sox_sample_t const * buf, /**< Buffer from which to read samples. */
-    size_t len /**< Number of samples available in buf. */
-    );
-
-/**
-Client API:
-Closes an encoding or decoding session.
-@returns SOX_SUCCESS if successful.
-*/
-int
-LSX_API
-sox_close(
-    LSX_PARAM_INOUT sox_format_t * ft /**< Format pointer. */
-    );
-
-/**
-Client API:
-Sets the location at which next samples will be decoded. Returns SOX_SUCCESS if successful.
-@returns SOX_SUCCESS if successful.
-*/
-int
-LSX_API
-sox_seek(
-    LSX_PARAM_INOUT sox_format_t * ft, /**< Format pointer. */
-    sox_uint64_t offset, /**< Sample offset at which to position reader. */
-    int whence /**< Set to SOX_SEEK_SET. */
-    );
-
-/**
-Client API:
-Finds a format handler by name.
-@returns Format handler data, or null if not found.
-*/
-LSX_RETURN_OPT
-sox_format_handler_t const *
-LSX_API
-sox_find_format(
-    LSX_PARAM_IN_Z char const * name, /**< Name of format handler to find. */
-    sox_bool ignore_devices /**< Set to true to ignore device names. */
-    );
-
-/**
-Client API:
-Returns global parameters for effects
-@returns global parameters for effects.
-*/
-LSX_RETURN_VALID LSX_RETURN_PURE
-sox_effects_globals_t *
-LSX_API
-sox_get_effects_globals(void);
-
-/**
-Client API:
-Deprecated macro that returns global parameters for effects.
-*/
-#define sox_effects_globals (*sox_get_effects_globals())
-
-/**
-Client API:
-Finds the effect handler with the given name.
-@returns Effect pointer, or null if not found.
-*/
-LSX_RETURN_OPT LSX_RETURN_PURE
-sox_effect_handler_t const *
-LSX_API
-sox_find_effect(
-    LSX_PARAM_IN_Z char const * name /**< Name of effect to find. */
-    );
-
-/**
-Client API:
-Creates an effect using the given handler.
-@returns The new effect, or null if not found.
-*/
-LSX_RETURN_OPT
-sox_effect_t *
-LSX_API
-sox_create_effect(
-    LSX_PARAM_IN sox_effect_handler_t const * eh /**< Handler to use for effect. */
-    );
-
-/**
-Client API:
-Applies the command-line options to the effect.
-@returns the number of arguments consumed.
-*/
-int
-LSX_API
-sox_effect_options(
-    LSX_PARAM_IN sox_effect_t *effp, /**< Effect pointer on which to set options. */
-    int argc, /**< Number of arguments in argv. */
-    LSX_PARAM_IN_COUNT(argc) char * const argv[] /**< Array of command-line options. */
-    );
-
-/**
-Client API:
-Returns an array containing the known effect handlers.
-@returns An array containing the known effect handlers.
-*/
-LSX_RETURN_VALID_Z LSX_RETURN_PURE
-sox_effect_fn_t const *
-LSX_API
-sox_get_effect_fns(void);
-
-/**
-Client API:
-Deprecated macro that returns an array containing the known effect handlers.
-*/
-#define sox_effect_fns (sox_get_effect_fns())
-
-/**
-Client API:
-Initializes an effects chain. Returned handle must be closed with sox_delete_effects_chain().
-@returns Handle, or null on failure.
-*/
-LSX_RETURN_OPT
-sox_effects_chain_t *
-LSX_API
-sox_create_effects_chain(
-    LSX_PARAM_IN sox_encodinginfo_t const * in_enc, /**< Input encoding. */
-    LSX_PARAM_IN sox_encodinginfo_t const * out_enc /**< Output encoding. */
-    );
-
-/**
-Client API:
-Closes an effects chain.
-*/
-void
-LSX_API
-sox_delete_effects_chain(
-    LSX_PARAM_INOUT sox_effects_chain_t *ecp /**< Effects chain pointer. */
-    );
-
-/**
-Client API:
-Adds an effect to the effects chain, returns SOX_SUCCESS if successful.
-@returns SOX_SUCCESS if successful.
-*/
-int
-LSX_API
-sox_add_effect(
-    LSX_PARAM_INOUT sox_effects_chain_t * chain, /**< Effects chain to which effect should be added . */
-    LSX_PARAM_INOUT sox_effect_t * effp, /**< Effect to be added. */
-    LSX_PARAM_INOUT sox_signalinfo_t * in, /**< Input format. */
-    LSX_PARAM_IN    sox_signalinfo_t const * out /**< Output format. */
-    );
-
-/**
-Client API:
-Runs the effects chain, returns SOX_SUCCESS if successful.
-@returns SOX_SUCCESS if successful.
-*/
-int
-LSX_API
-sox_flow_effects(
-    LSX_PARAM_INOUT  sox_effects_chain_t * chain, /**< Effects chain to run. */
-    LSX_PARAM_IN_OPT sox_flow_effects_callback callback, /**< Callback for monitoring flow progress. */
-    LSX_PARAM_IN_OPT void * client_data /**< Data to pass into callback. */
-    );
-
-/**
-Client API:
-Gets the number of clips that occurred while running an effects chain.
-@returns the number of clips that occurred while running an effects chain.
-*/
-sox_uint64_t
-LSX_API
-sox_effects_clips(
-    LSX_PARAM_IN sox_effects_chain_t * chain /**< Effects chain from which to read clip information. */
-    );
-
-/**
-Client API:
-Shuts down an effect (calls stop on each of its flows).
-@returns the number of clips from all flows.
-*/
-sox_uint64_t
-LSX_API
-sox_stop_effect(
-    LSX_PARAM_INOUT_COUNT(effp->flows) sox_effect_t * effp /**< Effect to stop. */
-    );
-
-/**
-Client API:
-Adds an already-initialized effect to the end of the chain.
-*/
-void
-LSX_API
-sox_push_effect_last(
-    LSX_PARAM_INOUT sox_effects_chain_t * chain, /**< Effects chain to which effect should be added. */
-    LSX_PARAM_INOUT sox_effect_t * effp /**< Effect to be added. */
-    );
-
-/**
-Client API:
-Removes and returns an effect from the end of the chain.
-@returns the removed effect, or null if no effects.
-*/
-LSX_RETURN_OPT
-sox_effect_t *
-LSX_API
-sox_pop_effect_last(
-    LSX_PARAM_INOUT sox_effects_chain_t *chain /**< Effects chain from which to remove an effect. */
-    );
-
-/**
-Client API:
-Shut down and delete an effect.
-*/
-void
-LSX_API
-sox_delete_effect(
-    LSX_PARAM_INOUT_COUNT(effp->flows) sox_effect_t *effp /**< Effect to be deleted. */
-    );
-
-/**
-Client API:
-Shut down and delete the last effect in the chain.
-*/
-void
-LSX_API
-sox_delete_effect_last(
-    LSX_PARAM_INOUT sox_effects_chain_t *chain /**< Effects chain from which to remove the last effect. */
-    );
-
-/**
-Client API:
-Shut down and delete all effects in the chain.
-*/
-void
-LSX_API
-sox_delete_effects(
-    LSX_PARAM_INOUT sox_effects_chain_t *chain /**< Effects chain from which to delete effects. */
-    );
-
-/**
-Client API:
-Gets the sample offset of the start of the trim, useful for efficiently
-skipping the part that will be trimmed anyway (get trim start, seek, then
-clear trim start).
-@returns the sample offset of the start of the trim.
-*/
-sox_uint64_t
-LSX_API
-sox_trim_get_start(
-    LSX_PARAM_IN sox_effect_t * effp /**< Trim effect. */
-    );
-
-/**
-Client API:
-Clears the start of the trim to 0.
-*/
-void
-LSX_API
-sox_trim_clear_start(
-    LSX_PARAM_INOUT sox_effect_t * effp /**< Trim effect. */
-    );
-
-/**
-Client API:
-Returns true if the specified file is a known playlist file type.
-@returns true if the specified file is a known playlist file type.
-*/
-sox_bool
-LSX_API
-sox_is_playlist(
-    LSX_PARAM_IN_Z char const * filename /**< Name of file to examine. */
-    );
-
-/**
-Client API:
-Parses the specified playlist file.
-@returns SOX_SUCCESS if successful.
-*/
-int
-LSX_API
-sox_parse_playlist(
-    LSX_PARAM_IN sox_playlist_callback_t callback, /**< Callback to call for each item in the playlist. */
-    void * p, /**< Data to pass to callback. */
-    LSX_PARAM_IN char const * const listname /**< Filename of playlist file. */
-    );
-
-/**
-Client API:
-Converts a SoX error code into an error string.
-@returns error string corresponding to the specified error code,
-or a generic message if the error code is not recognized.
-*/
-LSX_RETURN_VALID_Z LSX_RETURN_PURE
-char const *
-LSX_API
-sox_strerror(
-    int sox_errno /**< Error code to look up. */
-    );
-
-/**
-Client API:
-Gets the basename of the specified file; for example, the basename of
-"/a/b/c.d" would be "c".
-@returns the number of characters written to base_buffer, excluding the null,
-or 0 on failure.
-*/
-size_t
-LSX_API
-sox_basename(
-    LSX_PARAM_OUT_Z_CAP_POST_COUNT(base_buffer_len,return) char * base_buffer, /**< Buffer into which basename should be written. */
-    size_t base_buffer_len, /**< Size of base_buffer, in bytes. */
-    LSX_PARAM_IN_Z char const * filename /**< Filename from which to extract basename. */
-    );
-
-/*****************************************************************************
-Internal API:
-WARNING - The items in this section are subject to instability. They only
-exist in the public header because sox (the application) currently uses them.
-These may be changed or removed in future versions of libSoX.
-*****************************************************************************/
-
-/**
-Plugins API:
-Print a fatal error in libSoX.
-*/
-void
-LSX_API
-lsx_fail_impl(
-    LSX_PARAM_IN_PRINTF char const * fmt, /**< printf-style format string. */
-    ...)
-    LSX_PRINTF12;
-
-/**
-Plugins API:
-Print a warning in libSoX.
-*/
-void
-LSX_API
-lsx_warn_impl(
-    LSX_PARAM_IN_PRINTF char const * fmt, /**< printf-style format string. */
-    ...)
-    LSX_PRINTF12;
-
-/**
-Plugins API:
-Print an informational message in libSoX.
-*/
-void
-LSX_API
-lsx_report_impl(
-    LSX_PARAM_IN_PRINTF char const * fmt, /**< printf-style format string. */
-    ...)
-    LSX_PRINTF12;
-
-/**
-Plugins API:
-Print a debug message in libSoX.
-*/
-void
-LSX_API
-lsx_debug_impl(
-    LSX_PARAM_IN_PRINTF char const * fmt, /**< printf-style format string. */
-    ...)
-    LSX_PRINTF12;
-
-/**
-Plugins API:
-Report a fatal error in libSoX; printf-style arguments must follow.
-*/
-#define lsx_fail       sox_get_globals()->subsystem=__FILE__,lsx_fail_impl
-
-/**
-Plugins API:
-Report a warning in libSoX; printf-style arguments must follow.
-*/
-#define lsx_warn       sox_get_globals()->subsystem=__FILE__,lsx_warn_impl
-
-/**
-Plugins API:
-Report an informational message in libSoX; printf-style arguments must follow.
-*/
-#define lsx_report     sox_get_globals()->subsystem=__FILE__,lsx_report_impl
-
-/**
-Plugins API:
-Report a debug message in libSoX; printf-style arguments must follow.
-*/
-#define lsx_debug      sox_get_globals()->subsystem=__FILE__,lsx_debug_impl
-
-/**
-Plugins API:
-String name and integer values for enumerated types (type metadata), for use
-with LSX_ENUM_ITEM, lsx_find_enum_text, and lsx_find_enum_value.
-*/
-typedef struct lsx_enum_item {
-    char const *text; /**< String name of enumeration. */
-    unsigned value;   /**< Integer value of enumeration. */
-} lsx_enum_item;
-
-/**
-Plugins API:
-Declares a static instance of an lsx_enum_item structure in format
-{ "item", prefixitem }, for use in declaring lsx_enum_item[] arrays.
-@param prefix The prefix to prepend to the item in the enumeration symbolic name.
-@param item   The user-visible text name of the item (must also be a valid C symbol name).
-*/
-#define LSX_ENUM_ITEM(prefix, item) {#item, prefix##item},
-
-/**
-Plugins API:
-Flags for use with lsx_find_enum_item.
-*/
-enum
-{
-    lsx_find_enum_item_none = 0, /**< Default parameters (case-insensitive). */
-    lsx_find_enum_item_case_sensitive = 1 /**< Enable case-sensitive search. */
-};
-
-/**
-Plugins API:
-Looks up an enumeration by name in an array of lsx_enum_items.
-@returns the corresponding item, or null if not found.
-*/
-LSX_RETURN_OPT LSX_RETURN_PURE
-lsx_enum_item const *
-LSX_API
-lsx_find_enum_text(
-    LSX_PARAM_IN_Z char const * text, /**< Name of enumeration to find. */
-    LSX_PARAM_IN lsx_enum_item const * lsx_enum_items, /**< Array of items to search, with text == NULL for last item. */
-    int flags /**< Search flags: 0 (case-insensitive) or lsx_find_enum_item_case_sensitive (case-sensitive). */
-    );
-
-/**
-Plugins API:
-Looks up an enumeration by value in an array of lsx_enum_items.
-@returns the corresponding item, or null if not found.
-*/
-LSX_RETURN_OPT LSX_RETURN_PURE
-lsx_enum_item const *
-LSX_API
-lsx_find_enum_value(
-    unsigned value, /**< Enumeration value to find. */
-    LSX_PARAM_IN lsx_enum_item const * lsx_enum_items /**< Array of items to search, with text == NULL for last item. */
-    );
-
-/**
-Plugins API:
-Looks up a command-line argument in a set of enumeration names, showing an
-error message if the argument is not found in the set of names.
-@returns The enumeration value corresponding to the matching enumeration, or
-INT_MAX if the argument does not match any enumeration name.
-*/
-LSX_RETURN_PURE
-int
-LSX_API
-lsx_enum_option(
-    int c, /**< Option character to which arg is associated, for example with -a, c would be 'a'. */
-    LSX_PARAM_IN_Z char const * arg, /**< Argument to find in enumeration list. */
-    LSX_PARAM_IN lsx_enum_item const * items /**< Array of items to search, with text == NULL for last item. */
-    );
-
-/**
-Plugins API:
-Determines whether the specified string ends with the specified suffix (case-sensitive).
-@returns true if the specified string ends with the specified suffix.
-*/
-LSX_RETURN_PURE
-sox_bool
-LSX_API
-lsx_strends(
-    LSX_PARAM_IN_Z char const * str, /**< String to search. */
-    LSX_PARAM_IN_Z char const * end  /**< Suffix to search for. */
-    );
-
-/**
-Plugins API:
-Finds the file extension for a filename.
-@returns the file extension, not including the '.', or null if filename does
-not have an extension.
-*/
-LSX_RETURN_VALID_Z LSX_RETURN_PURE
-char const *
-LSX_API
-lsx_find_file_extension(
-    LSX_PARAM_IN_Z char const * pathname /**< Filename to search for extension. */
-    );
-
-/**
-Plugins API:
-Formats the specified number with up to three significant figures and adds a
-metric suffix in place of the exponent, such as 1.23G.
-@returns A static buffer with the formatted number, valid until the next time
-this function is called (note: not thread safe).
-*/
-LSX_RETURN_VALID_Z
-char const *
-LSX_API
-lsx_sigfigs3(
-    double number /**< Number to be formatted. */
-    );
-
-/**
-Plugins API:
-Formats the specified number as a percentage, showing up to three significant
-figures.
-@returns A static buffer with the formatted number, valid until the next time
-this function is called (note: not thread safe).
-*/
-LSX_RETURN_VALID_Z
-char const *
-LSX_API
-lsx_sigfigs3p(
-    double percentage /**< Number to be formatted. */
-    );
-
-/**
-Plugins API:
-Allocates, deallocates, or resizes; like C's realloc, except that this version
-terminates the running application if unable to allocate the requested memory.
-@returns New buffer, or null if buffer was freed.
-*/
-LSX_RETURN_OPT
-void *
-LSX_API
-lsx_realloc(
-    LSX_PARAM_IN_OPT void *ptr, /**< Pointer to be freed or resized, or null if allocating a new buffer. */
-    size_t newsize /**< New size for buffer, or 0 to free the buffer. */
-    );
-
-/**
-Plugins API:
-Like strcmp, except that the characters are compared without regard to case.
-@returns 0 (s1 == s2), negative (s1 < s2), or positive (s1 > s2).
-*/
-LSX_RETURN_PURE
-int
-LSX_API
-lsx_strcasecmp(
-    LSX_PARAM_IN_Z char const * s1, /**< First string. */
-    LSX_PARAM_IN_Z char const * s2  /**< Second string. */
-    );
-
-
-/**
-Plugins API:
-Like strncmp, except that the characters are compared without regard to case.
-@returns 0 (s1 == s2), negative (s1 < s2), or positive (s1 > s2).
-*/
-LSX_RETURN_PURE
-int
-LSX_API
-lsx_strncasecmp(
-    LSX_PARAM_IN_Z char const * s1, /**< First string. */
-    LSX_PARAM_IN_Z char const * s2, /**< Second string. */
-    size_t n /**< Maximum number of characters to examine. */
-    );
-
-/**
-Plugins API:
-Is option argument unsupported, required, or optional.
-*/
-typedef enum lsx_option_arg_t {
-    lsx_option_arg_none, /**< Option does not have an argument. */
-    lsx_option_arg_required, /**< Option requires an argument. */
-    lsx_option_arg_optional /**< Option can optionally be followed by an argument. */
-} lsx_option_arg_t;
-
-/**
-Plugins API:
-lsx_getopt_init options.
-*/
-typedef enum lsx_getopt_flags_t {
-    lsx_getopt_flag_none = 0,      /**< no flags (no output, not long-only) */
-    lsx_getopt_flag_opterr = 1,    /**< if set, invalid options trigger lsx_warn output */
-    lsx_getopt_flag_longonly = 2   /**< if set, recognize -option as a long option */
-} lsx_getopt_flags_t;
-
-/**
-Plugins API:
-lsx_getopt long option descriptor.
-*/
-typedef struct lsx_option_t {
-    char const *     name;    /**< Name of the long option. */
-    lsx_option_arg_t has_arg; /**< Whether the long option supports an argument and, if so, whether the argument is required or optional. */
-    int *            flag;    /**< Flag to set if argument is present. */
-    int              val;     /**< Value to put in flag if argument is present. */
-} lsx_option_t;
-
-/**
-Plugins API:
-lsx_getopt session information (initialization data and state).
-*/
-typedef struct lsx_getopt_t {
-    int                  argc;     /**< IN    argc:      Number of arguments in argv */
-    char * const *       argv;     /**< IN    argv:      Array of arguments */
-    char const *         shortopts;/**< IN    shortopts: Short option characters */
-    lsx_option_t const * longopts; /**< IN    longopts:  Array of long option descriptors */
-    lsx_getopt_flags_t   flags;    /**< IN    flags:     Flags for longonly and opterr */
-    char const *         curpos;   /**< INOUT curpos:    Maintains state between calls to lsx_getopt */
-    int                  ind;      /**< INOUT optind:    Maintains the index of next element to be processed */
-    int                  opt;      /**< OUT   optopt:    Receives the option character that caused error */
-    char const *         arg;      /**< OUT   optarg:    Receives the value of the option's argument */
-    int                  lngind;   /**< OUT   lngind:    Receives the index of the matched long option or -1 if not a long option */
-} lsx_getopt_t;
-
-/**
-Plugins API:
-Initializes an lsx_getopt_t structure for use with lsx_getopt.
-*/
-void
-LSX_API
-lsx_getopt_init(
-    LSX_PARAM_IN             int argc,                      /**< Number of arguments in argv */
-    LSX_PARAM_IN_COUNT(argc) char * const * argv,           /**< Array of arguments */
-    LSX_PARAM_IN_Z           char const * shortopts,        /**< Short options, for example ":abc:def::ghi" (+/- not supported) */
-    LSX_PARAM_IN_OPT         lsx_option_t const * longopts, /**< Array of long option descriptors */
-    LSX_PARAM_IN             lsx_getopt_flags_t flags,      /**< Flags for longonly and opterr */
-    LSX_PARAM_IN             int first,                     /**< First argv to check (usually 1) */
-    LSX_PARAM_OUT            lsx_getopt_t * state           /**< State object to be initialized */
-    );
-
-/**
-Plugins API:
-Gets the next option. Options are parameters that start with "-" or "--".
-If no more options, returns -1. If unrecognized short option, returns '?'.
-If a recognized short option is missing a required argument,
-return (shortopts[0]==':' ? ':' : '?'). If successfully recognized short
-option, return the recognized character. If successfully recognized long
-option, returns (option.flag ? 0 : option.val).
-Note: lsx_getopt does not permute the non-option arguments.
-@returns option character (short), val or 0 (long), or -1 (no more).
-*/
-int
-LSX_API
-lsx_getopt(
-    LSX_PARAM_INOUT lsx_getopt_t * state /**< The getopt state pointer. */
-    );
-
-/* WARNING END */
-
-#if defined(__cplusplus)
-}
-#endif
-
-#endif /* SOX_H */
diff --git a/fdmdv2/tags/0.99-Beta/src/sox_biquad.c b/fdmdv2/tags/0.99-Beta/src/sox_biquad.c
deleted file mode 100644 (file)
index f5a0913..0000000
+++ /dev/null
@@ -1,129 +0,0 @@
-//==========================================================================
-// Name:            sox_biquad.h
-// Purpose:         Interface into Sox Biquad filters 
-// Created:         Dec 1, 2012
-// Authors:         David Rowe
-// 
-// To test:
-//          $ gcc sox_biquad.c -o sox_biquad -DSOX_BIQUAD_UNITTEST -Wall \
-//            /path/to/sox-14.4.0/src/.libs/libsox.a -lm -lsndfile
-//          $ ./sox_biquad
-//
-// 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-
-#include <assert.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include "sox.h"
-
-#include "sox_biquad.h"
-
-
-#define N_MAX 1024
-
-int lsx_biquad_flow(sox_effect_t * effp, const sox_sample_t *ibuf,
-                    sox_sample_t *obuf, size_t *isamp, size_t *osamp);
-
-void sox_biquad_start(void)
-{
-    int r = sox_init();
-    assert(r == SOX_SUCCESS);
-}
-
-void sox_biquad_finish(void)
-{
-    sox_quit();
-}
-
-/*
-  Effect must be implemented by biquads.c in sox, arguments are just
-  like sox command line, for example:
-
-  char *argv[10];
-  argv[0] = "highpass"; argv[1]="1000"; argc=1;
-*/
-
-void *sox_biquad_create(int argc, const char *argv[])
-{
-    int ret;
-    sox_effect_t *e;
-    int (*start)(sox_effect_t *); /* function pointer to effect start func */
-    
-    e = sox_create_effect(sox_find_effect(argv[0])); assert(e != NULL);
-    ret = sox_effect_options(e, argc, (char * const*)&argv[1]);
-    assert(ret == SOX_SUCCESS);
-
-    start = e->handler.start;
-    e->in_signal.rate = 8000;     /* locked at FS=8000 Hz */
-    ret = start(e); assert(ret == SOX_SUCCESS);
-    
-    return (void *)e;
-}
-
-void sox_biquad_destroy(void *sbq) {
-    sox_effect_t *e = (sox_effect_t *)sbq;
-    free(e);
-}
-
-void sox_biquad_filter(void *sbq, short out[], short in[], int n)
-{
-    sox_effect_t *e = (sox_effect_t *)sbq;
-    sox_sample_t ibuf[N_MAX];
-    sox_sample_t obuf[N_MAX];
-    size_t isamp, osamp;
-    unsigned int clips;
-    SOX_SAMPLE_LOCALS; 
-    int i;
-
-    assert(n <= N_MAX);
-
-    clips = 0;
-    for(i=0; i<n; i++)
-        ibuf[i] = SOX_SIGNED_16BIT_TO_SAMPLE(in[i], clips);
-    isamp = osamp = (unsigned int)n;
-    lsx_biquad_flow(e, ibuf, obuf, &isamp, &osamp);
-    for(i=0; i<n; i++)
-        out[i] = SOX_SAMPLE_TO_SIGNED_16BIT(obuf[i], clips); 
-}
-
-
-#ifdef SOX_BIQUAD_UNITTEST
-#define N 20
-int main(void) {
-    void *sbq;
-    char *argv[10];
-    short in[N];
-    short out[N];
-    int   i, argc;;
-
-    for(i=0; i<N; i++)
-        in[i] = 0;
-    in[0] = 8000;
-
-    sox_biquad_start();
-    argv[0] = "highpass"; argv[1]="1000"; argc=1;
-    sbq = sox_biquad_create(argc, argv);
-
-    sox_biquad_filter(sbq, out, in, N);
-    for(i=0; i<N; i++)
-        printf("%d\n", out[i]);
-   
-    sox_biquad_destroy(sbq);
-    sox_biquad_finish();
-
-    return 0;
-}
-#endif
diff --git a/fdmdv2/tags/0.99-Beta/src/sox_biquad.h b/fdmdv2/tags/0.99-Beta/src/sox_biquad.h
deleted file mode 100644 (file)
index f38de64..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-//==========================================================================
-// Name:            sox_biquad.h
-// Purpose:         Interface into Sox Biquad filters 
-// Created:         Dec 1, 2012
-// Authors:         David Rowe
-// 
-// 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-
-#ifndef __SOX_BIQUAD__
-#define __SOX_BIQUAD__
-
-#ifdef __cplusplus
-extern "C" {
-
-#endif
-
-void sox_biquad_start(void);
-void sox_biquad_finish(void);
-void *sox_biquad_create(int argc, const char *argv[]);
-void sox_biquad_destroy(void *sbq);
-void sox_biquad_filter(void *sbq, short out[], short in[], int n);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/fdmdv2/tags/0.99-Beta/src/topFrame.cpp b/fdmdv2/tags/0.99-Beta/src/topFrame.cpp
deleted file mode 100644 (file)
index 54ea80a..0000000
+++ /dev/null
@@ -1,551 +0,0 @@
-//==========================================================================
-// Name:            topFrame.cpp
-//
-// Purpose:         Implements simple wxWidgets application with GUI.
-// Created:         Apr. 9, 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 <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#include "topFrame.h"
-
-extern int g_playFileToMicInEventId;
-extern int g_recFileFromRadioEventId;
-extern int g_playFileFromRadioEventId;
-
-//=========================================================================
-// Code that lays out the main application window
-//=========================================================================
-TopFrame::TopFrame(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxFrame(parent, id, title, pos, size, style)
-{
-    this->SetSizeHints(wxDefaultSize, wxDefaultSize);
-    this->SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
-    this->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DLIGHT));
-    this->SetSizeHints(wxDefaultSize, wxDefaultSize);
-    this->SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
-    this->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DLIGHT));
-    //=====================================================
-    // Menubar Setup
-    m_menubarMain = new wxMenuBar(wxMB_DOCKABLE);
-    file = new wxMenu();
-
-    wxMenuItem* m_menuItemOnTop;
-    m_menuItemOnTop = new wxMenuItem(file, wxID_ANY, wxString(_("On Top")) , _("Always Top Window"), wxITEM_NORMAL);
-    file->Append(m_menuItemOnTop);
-
-    wxMenuItem* m_menuItemExit;
-    m_menuItemExit = new wxMenuItem(file, ID_EXIT, wxString(_("E&xit")) , _("Exit Program"), wxITEM_NORMAL);
-    file->Append(m_menuItemExit);
-
-    m_menubarMain->Append(file, _("&File"));
-
-    tools = new wxMenu();
-    wxMenuItem* m_menuItemAudio;
-    m_menuItemAudio = new wxMenuItem(tools, wxID_ANY, wxString(_("&Audio Config")) , wxEmptyString, wxITEM_NORMAL);
-    tools->Append(m_menuItemAudio);
-
-    wxMenuItem* m_menuItemRigCtrlCfg;
-    m_menuItemRigCtrlCfg = new wxMenuItem(tools, wxID_ANY, wxString(_("&PTT Config")) , wxEmptyString, wxITEM_NORMAL);
-    tools->Append(m_menuItemRigCtrlCfg);
-
-    wxMenuItem* m_menuItemOptions;
-    m_menuItemOptions = new wxMenuItem(tools, wxID_ANY, wxString(_("Options")) , wxEmptyString, wxITEM_NORMAL);
-    tools->Append(m_menuItemOptions);
-
-    wxMenuItem* m_menuItemFilter;
-    m_menuItemFilter = new wxMenuItem(tools, wxID_ANY, wxString(_("&Filter")) , wxEmptyString, wxITEM_NORMAL);
-    tools->Append(m_menuItemFilter);
-
-    wxMenuItem* m_menuItemPlayFileToMicIn;
-    m_menuItemPlayFileToMicIn = new wxMenuItem(tools, wxID_ANY, wxString(_("Start/Stop Play File - Mic In")) , wxEmptyString, wxITEM_NORMAL);
-    g_playFileToMicInEventId = m_menuItemPlayFileToMicIn->GetId();
-    tools->Append(m_menuItemPlayFileToMicIn);
-
-    wxMenuItem* m_menuItemRecFileFromRadio;
-    m_menuItemRecFileFromRadio = new wxMenuItem(tools, wxID_ANY, wxString(_("Start/Stop Record File - From Radio")) , wxEmptyString, wxITEM_NORMAL);
-    g_recFileFromRadioEventId = m_menuItemRecFileFromRadio->GetId();
-    tools->Append(m_menuItemRecFileFromRadio);
-
-    wxMenuItem* m_menuItemPlayFileFromRadio;
-    m_menuItemPlayFileFromRadio = new wxMenuItem(tools, wxID_ANY, wxString(_("Start/Stop Play File - From Radio")) , wxEmptyString, wxITEM_NORMAL);
-    g_playFileFromRadioEventId = m_menuItemPlayFileFromRadio->GetId();
-    tools->Append(m_menuItemPlayFileFromRadio);
-    m_menubarMain->Append(tools, _("&Tools"));
-
-    help = new wxMenu();
-    wxMenuItem* m_menuItemHelpUpdates;
-    m_menuItemHelpUpdates = new wxMenuItem(help, wxID_ANY, wxString(_("Check for Updates")) , wxEmptyString, wxITEM_NORMAL);
-    help->Append(m_menuItemHelpUpdates);
-    m_menuItemHelpUpdates->Enable(false);
-
-    wxMenuItem* m_menuItemAbout;
-    m_menuItemAbout = new wxMenuItem(help, ID_ABOUT, wxString(_("&About")) , _("About this program"), wxITEM_NORMAL);
-    help->Append(m_menuItemAbout);
-
-    m_menubarMain->Append(help, _("&Help"));
-
-    this->SetMenuBar(m_menubarMain);
-
-    wxBoxSizer* bSizer1;
-    bSizer1 = new wxBoxSizer(wxHORIZONTAL);
-
-    //=====================================================
-    // Left side
-    //=====================================================
-    wxBoxSizer* leftSizer;
-    leftSizer = new wxBoxSizer(wxVERTICAL);
-
-    wxStaticBoxSizer* snrSizer;
-    snrSizer = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("SNR")), wxVERTICAL);
-
-    //------------------------------
-    // S/N ratio Guage (vert. bargraph)
-    //------------------------------
-    m_gaugeSNR = new wxGauge(this, wxID_ANY, 25, wxDefaultPosition, wxSize(15,135), wxGA_SMOOTH|wxGA_VERTICAL);
-    m_gaugeSNR->SetToolTip(_("Displays signal to noise ratio in dB."));
-    snrSizer->Add(m_gaugeSNR, 1, wxALIGN_CENTER_HORIZONTAL|wxALL, 10);
-
-    //------------------------------
-    // Box for S/N ratio (Numeric)
-    //------------------------------
-    m_textSNR = new wxStaticText(this, wxID_ANY, wxT(" 0.0"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE);
-    snrSizer->Add(m_textSNR, 0, wxALIGN_CENTER_HORIZONTAL, 1);
-
-    //------------------------------
-    // S/N ratio slow Checkbox
-    //------------------------------
-    m_ckboxSNR = new wxCheckBox(this, wxID_ANY, _("Slow"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
-    m_ckboxSNR->SetToolTip(_("Smooth but slow SNR estimation"));
-    snrSizer->Add(m_ckboxSNR, 0, wxALIGN_CENTER_HORIZONTAL, 5);
-
-    leftSizer->Add(snrSizer, 2, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxALL, 1);
-
-    //------------------------------
-    // Sync  Indicator box
-    //------------------------------
-    wxStaticBoxSizer* sbSizer3_33;
-    sbSizer3_33 = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Sync")), wxVERTICAL);
-
-    m_rbSync = new wxRadioButton( this, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
-    m_rbSync->SetForegroundColour( wxColour( 255, 0, 0 ) );
-    sbSizer3_33->Add(m_rbSync, 0, wxALIGN_CENTER|wxALL, 1);
-    leftSizer->Add(sbSizer3_33,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
-
-    //------------------------------
-    // BER Frames box
-    //------------------------------
-
-    wxStaticBoxSizer* sbSizer_ber;
-    sbSizer_ber = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Bit Error Rate")), wxVERTICAL);
-
-    m_BtnBerReset = new wxButton(this, wxID_ANY, _("Reset"), wxDefaultPosition, wxDefaultSize, 0);
-    sbSizer_ber->Add(m_BtnBerReset, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
-
-    m_textBits = new wxStaticText(this, wxID_ANY, wxT("Bits: 0"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
-    sbSizer_ber->Add(m_textBits, 0, wxALIGN_LEFT, 1);
-    m_textErrors = new wxStaticText(this, wxID_ANY, wxT("Errs: 0"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
-    sbSizer_ber->Add(m_textErrors, 0, wxALIGN_LEFT, 1);
-    m_textBER = new wxStaticText(this, wxID_ANY, wxT("BER: 0.0"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
-    sbSizer_ber->Add(m_textBER, 0, wxALIGN_LEFT, 1);
-
-    leftSizer->Add(sbSizer_ber,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
-
-    //------------------------------
-    // Signal Level(vert. bargraph)
-    //------------------------------
-    wxStaticBoxSizer* levelSizer;
-    levelSizer = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Level")), wxVERTICAL);
-
-    m_textLevel = new wxStaticText(this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(60,-1), wxALIGN_CENTRE);
-    m_textLevel->SetForegroundColour(wxColour(255,0,0));
-    levelSizer->Add(m_textLevel, 0, wxALIGN_LEFT, 1);
-
-    m_gaugeLevel = new wxGauge(this, wxID_ANY, 100, wxDefaultPosition, wxSize(15,135), wxGA_SMOOTH|wxGA_VERTICAL);
-    m_gaugeLevel->SetToolTip(_("Peak of From Radio in Rx, or peak of From Mic in Tx mode.  If Red you should reduce your levels"));
-    levelSizer->Add(m_gaugeLevel, 1, wxALIGN_CENTER_HORIZONTAL|wxALL, 10);
-
-    leftSizer->Add(levelSizer, 2, wxALIGN_CENTER|wxALL|wxEXPAND, 1);
-
-    bSizer1->Add(leftSizer, 0, wxALL|wxEXPAND, 5);
-
-    //=====================================================
-    // Center Section
-    //=====================================================
-    wxBoxSizer* centerSizer;
-    centerSizer = new wxBoxSizer(wxVERTICAL);
-    wxBoxSizer* upperSizer;
-    upperSizer = new wxBoxSizer(wxVERTICAL);
-
-    //=====================================================
-    // Tabbed Notebook control containing display graphs
-    //=====================================================
-    //m_auiNbookCtrl = new wxAuiNotebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_NB_BOTTOM|wxAUI_NB_DEFAULT_STYLE);
-    //long style = wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_MOVE | wxAUI_NB_SCROLL_BUTTONS | wxAUI_NB_CLOSE_ON_ACTIVE_TAB | wxAUI_NB_MIDDLE_CLICK_CLOSE;
-    long nb_style = wxAUI_NB_BOTTOM | wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_MOVE | wxAUI_NB_SCROLL_BUTTONS;
-    m_auiNbookCtrl = new wxAuiNotebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, nb_style);
-    // This line sets the fontsize for the tabs on the notebook control
-    m_auiNbookCtrl->SetFont(wxFont(8, 70, 90, 90, false, wxEmptyString));
-
-    upperSizer->Add(m_auiNbookCtrl, 1, wxALIGN_TOP|wxEXPAND, 1);
-    centerSizer->Add(upperSizer, 1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALIGN_TOP|wxEXPAND, 0);
-
-    // lower middle used for user ID
-
-    wxBoxSizer* lowerSizer;
-    lowerSizer = new wxBoxSizer(wxHORIZONTAL);
-
-    m_BtnCallSignReset = new wxButton(this, wxID_ANY, _("Clear"), wxDefaultPosition, wxDefaultSize, 0);
-    lowerSizer->Add(m_BtnCallSignReset, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
-
-    wxBoxSizer* bSizer15;
-    bSizer15 = new wxBoxSizer(wxVERTICAL);
-    m_txtCtrlCallSign = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
-    m_txtCtrlCallSign->SetToolTip(_("Call Sign of transmitting station will appear here"));
-    bSizer15->Add(m_txtCtrlCallSign, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 5);
-    lowerSizer->Add(bSizer15, 1, wxEXPAND, 5);
-
-    wxStaticBoxSizer* sbSizer_Checksum = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Checksums")), wxHORIZONTAL);
-
-    wxStaticText *goodLabel = new wxStaticText(this, wxID_ANY, wxT("Good: "), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE);
-    sbSizer_Checksum->Add(goodLabel, 0, 0, 2);
-    m_txtChecksumGood = new wxStaticText(this, wxID_ANY, wxT("0"), wxDefaultPosition, wxSize(30,-1), wxALIGN_CENTRE);
-    sbSizer_Checksum->Add(m_txtChecksumGood, 0, 0, 2);
-
-    wxStaticText *badLabel = new wxStaticText(this, wxID_ANY, wxT("Bad: "), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE);
-    sbSizer_Checksum->Add(badLabel, 0, 0, 1);
-    m_txtChecksumBad = new wxStaticText(this, wxID_ANY, wxT("0"), wxDefaultPosition, wxSize(30,-1), wxALIGN_CENTRE);
-    sbSizer_Checksum->Add(m_txtChecksumBad, 0, 0, 1);
-
-    lowerSizer->Add(sbSizer_Checksum, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
-
-    //=====================================================
-    // These are the buttons that autosend the userid (?)
-    //=====================================================
-
-    // DR 4 Dec - taken off for screen for Beta release to avoid questions on their use until
-    // we implement this feature
- #ifdef UNIMPLEMENTED
-    wxBoxSizer* bSizer141;
-    bSizer141 = new wxBoxSizer(wxHORIZONTAL);
-
-    // TxID
-    //---------
-    m_togTxID = new wxToggleButton(this, wxID_ANY, _("TxID"), wxDefaultPosition, wxDefaultSize, 0);
-    m_togTxID->SetToolTip(_("Send Tx ID information"));
-    bSizer141->Add(m_togTxID, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
-
-    // RxID
-    //---------
-    m_togRxID = new wxToggleButton(this, wxID_ANY, _("RxID"), wxDefaultPosition, wxDefaultSize, 0);
-    m_togRxID->SetToolTip(_("Enable reception of ID information"));
-    bSizer141->Add(m_togRxID, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_LEFT|wxALL|wxFIXED_MINSIZE, 5);
-
-    lowerSizer->Add(bSizer141, 0, wxALIGN_RIGHT, 5);
-#endif
-
-    centerSizer->Add(lowerSizer, 0, wxALIGN_BOTTOM|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 2);
-    bSizer1->Add(centerSizer, 4, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 1);
-
-    //=====================================================
-    // Right side
-    //=====================================================
-    wxBoxSizer* rightSizer;
-    rightSizer = new wxBoxSizer(wxVERTICAL);
-
-    //=====================================================
-    // Squelch Slider Control
-    //=====================================================
-    wxStaticBoxSizer* sbSizer3;
-    sbSizer3 = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Squelch")), wxVERTICAL);
-
-    m_sliderSQ = new wxSlider(this, wxID_ANY, 0, 0, 40, wxDefaultPosition, wxSize(-1,80), wxSL_AUTOTICKS|wxSL_INVERSE|wxSL_VERTICAL);
-    m_sliderSQ->SetToolTip(_("Set Squelch level in dB."));
-
-    sbSizer3->Add(m_sliderSQ, 1, wxALIGN_CENTER_HORIZONTAL, 0);
-
-    //------------------------------
-    // Squelch Level static text box
-    //------------------------------
-    m_textSQ = new wxStaticText(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE);
-
-    sbSizer3->Add(m_textSQ, 0, wxALIGN_CENTER_HORIZONTAL, 0);
-
-    //------------------------------
-    // Squelch Toggle Checkbox
-    //------------------------------
-    m_ckboxSQ = new wxCheckBox(this, wxID_ANY, _(""), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
-
-    sbSizer3->Add(m_ckboxSQ, 0, wxALIGN_CENTER_HORIZONTAL, 0);
-    rightSizer->Add(sbSizer3, 2, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 0);
-
-    //rightSizer->Add(sbSizer3_33,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
-
-    /* new --- */
-
-    //------------------------------
-    // Mode box
-    //------------------------------
-    wxStaticBoxSizer* sbSizer_mode;
-    sbSizer_mode = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Mode")), wxVERTICAL);
-
-#ifdef DISABLED_FEATURE
-    m_rb1400old = new wxRadioButton( this, wxID_ANY, wxT("1400 V0.91"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
-    sbSizer_mode->Add(m_rb1400old, 0, wxALIGN_LEFT|wxALL, 1);
-    m_rb1400 = new wxRadioButton( this, wxID_ANY, wxT("1400"), wxDefaultPosition, wxDefaultSize, 0);
-    sbSizer_mode->Add(m_rb1400, 0, wxALIGN_LEFT|wxALL, 1);
-#endif
-    m_rb700 = new wxRadioButton( this, wxID_ANY, wxT("700"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
-    sbSizer_mode->Add(m_rb700, 0, wxALIGN_LEFT|wxALL, 1);
-    m_rb1600 = new wxRadioButton( this, wxID_ANY, wxT("1600"), wxDefaultPosition, wxDefaultSize, 0);
-    sbSizer_mode->Add(m_rb1600, 0, wxALIGN_LEFT|wxALL, 1);
-    m_rb1600->SetValue(true);
-#ifdef DISABLED_FEATURE
-    m_rb1600Wide = new wxRadioButton( this, wxID_ANY, wxT("1600 Wide"), wxDefaultPosition, wxDefaultSize, 0);
-    sbSizer_mode->Add(m_rb1600Wide, 0, wxALIGN_LEFT|wxALL, 1);
-    m_rb2000 = new wxRadioButton( this, wxID_ANY, wxT("2000"), wxDefaultPosition, wxDefaultSize, 0);
-    sbSizer_mode->Add(m_rb2000, 0, wxALIGN_LEFT|wxALL, 1);
-#endif
-
-    rightSizer->Add(sbSizer_mode,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
-
-    #ifdef MOVED_TO_OPTIONS_DIALOG
-    /* new --- */
-
-    //------------------------------
-    // Test Frames box
-    //------------------------------
-
-    wxStaticBoxSizer* sbSizer_testFrames;
-    sbSizer_testFrames = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Test Frames")), wxVERTICAL);
-
-    m_ckboxTestFrame = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
-    sbSizer_testFrames->Add(m_ckboxTestFrame, 0, wxALIGN_LEFT, 0);
-
-    rightSizer->Add(sbSizer_testFrames,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
-    #endif
-
-    //=====================================================
-    // Control Toggles box
-    //=====================================================
-    wxStaticBoxSizer* sbSizer5;
-    sbSizer5 = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Control")), wxVERTICAL);
-    wxBoxSizer* bSizer1511;
-    bSizer1511 = new wxBoxSizer(wxVERTICAL);
-
-    //-------------------------------
-    // Stop/Stop signal processing (rx and tx)
-    //-------------------------------
-    m_togBtnOnOff = new wxToggleButton(this, wxID_ANY, _("Start"), wxDefaultPosition, wxDefaultSize, 0);
-    m_togBtnOnOff->SetToolTip(_("Begin/End receiving data."));
-    bSizer1511->Add(m_togBtnOnOff, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
-    sbSizer5->Add(bSizer1511, 0, wxEXPAND, 1);
-
-#ifdef UNIMPLEMENTED
-    //------------------------------
-    // Toggle Loopback button for RX
-    //------------------------------
-    wxBoxSizer* bSizer15113;
-    bSizer15113 = new wxBoxSizer(wxHORIZONTAL);
-    wxBoxSizer* bSizer15111;
-    bSizer15111 = new wxBoxSizer(wxVERTICAL);
-    wxSize wxSz = wxSize(44, 30);
-    m_togBtnLoopRx = new wxToggleButton(this, wxID_ANY, _("Loop\nRX"), wxDefaultPosition, wxSz, 0);
-    m_togBtnLoopRx->SetFont(wxFont(6, 70, 90, 90, false, wxEmptyString));
-    m_togBtnLoopRx->SetToolTip(_("Loopback Receive audio data."));
-
-    bSizer15111->Add(m_togBtnLoopRx, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 0);
-
-    //sbSizer5->Add(bSizer15111, 0, wxEXPAND, 1);
-    bSizer15113->Add(bSizer15111, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 0);
-
-    //------------------------------
-    // Toggle Loopback button for Tx
-    //------------------------------
-    wxBoxSizer* bSizer15112;
-    bSizer15112 = new wxBoxSizer(wxVERTICAL);
-    m_togBtnLoopTx = new wxToggleButton(this, wxID_ANY, _("Loop\nTX"), wxDefaultPosition, wxSz, 0);
-    m_togBtnLoopTx->SetFont(wxFont(6, 70, 90, 90, false, wxEmptyString));
-    m_togBtnLoopTx->SetToolTip(_("Loopback Transmit audio data."));
-
-    bSizer15112->Add(m_togBtnLoopTx, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 0);
-    bSizer15113->Add(bSizer15112, 0,  wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 0);
-
-    sbSizer5->Add(bSizer15113, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
-#endif
-
-    //------------------------------
-    // Split Frequency Mode Toggle
-    //------------------------------
-    wxBoxSizer* bSizer151;
-    bSizer151 = new wxBoxSizer(wxVERTICAL);
-
-    m_togBtnSplit = new wxToggleButton(this, wxID_ANY, _("Split"), wxDefaultPosition, wxDefaultSize, 0);
-    m_togBtnSplit->SetToolTip(_("Toggle split frequency mode."));
-
-    bSizer151->Add(m_togBtnSplit, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
-    sbSizer5->Add(bSizer151, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 1);
-    wxBoxSizer* bSizer13;
-    bSizer13 = new wxBoxSizer(wxVERTICAL);
-
-    //------------------------------
-    // Analog Passthrough Toggle
-    //------------------------------
-    m_togBtnAnalog = new wxToggleButton(this, wxID_ANY, _("Analog"), wxDefaultPosition, wxDefaultSize, 0);
-    m_togBtnAnalog->SetToolTip(_("Toggle analog/digital operation."));
-    bSizer13->Add(m_togBtnAnalog, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
-    sbSizer5->Add(bSizer13, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
-
-    // not implemented on fdmdv2
-#ifdef ALC
-    //------------------------------
-    // Toggle for ALC
-    //------------------------------
-    wxBoxSizer* bSizer14;
-    bSizer14 = new wxBoxSizer(wxVERTICAL);
-    m_togBtnALC = new wxToggleButton(this, wxID_ANY, _("ALC"), wxDefaultPosition, wxDefaultSize, 0);
-    m_togBtnALC->SetToolTip(_("Toggle automatic level control mode."));
-
-    bSizer14->Add(m_togBtnALC, 0, wxALL, 1);
-    sbSizer5->Add(bSizer14, 0, wxALIGN_CENTER|wxALIGN_CENTER_HORIZONTAL|wxALL, 1);
-#endif
-
-    //------------------------------
-    // Toggle Transmit/Receive relays
-    //------------------------------
-    wxBoxSizer* bSizer11;
-    bSizer11 = new wxBoxSizer(wxVERTICAL);
-    m_btnTogPTT = new wxToggleButton(this, wxID_ANY, _("PTT"), wxDefaultPosition, wxDefaultSize, 0);
-    m_btnTogPTT->SetToolTip(_("Push to Talk - Switch between Receive and Transmit - you can also use the space bar "));
-    bSizer11->Add(m_btnTogPTT, 1, wxALIGN_CENTER|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
-    sbSizer5->Add(bSizer11, 2, wxEXPAND, 1);
-    rightSizer->Add(sbSizer5, 2, wxALIGN_CENTER|wxALL|wxEXPAND, 3);
-    bSizer1->Add(rightSizer, 0, wxALL|wxEXPAND, 3);
-    this->SetSizer(bSizer1);
-    this->Layout();
-    m_statusBar1 = this->CreateStatusBar(3, wxST_SIZEGRIP, wxID_ANY);
-
-    //=====================================================
-    // End of layout
-    //=====================================================
-
-    //-------------------
-    // Connect Events
-    //-------------------
-    this->Connect(wxEVT_CLOSE_WINDOW, wxCloseEventHandler(TopFrame::topFrame_OnClose));
-    this->Connect(wxEVT_PAINT, wxPaintEventHandler(TopFrame::topFrame_OnPaint));
-    this->Connect(wxEVT_SIZE, wxSizeEventHandler(TopFrame::topFrame_OnSize));
-    this->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::topFrame_OnUpdateUI));
-
-    this->Connect(m_menuItemExit->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnExit));
-    this->Connect(m_menuItemOnTop->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnTop));
-
-    this->Connect(m_menuItemAudio->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsAudio));
-    this->Connect(m_menuItemAudio->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsAudioUI));
-    this->Connect(m_menuItemFilter->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsFilter));
-    this->Connect(m_menuItemFilter->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsFilterUI));
-    this->Connect(m_menuItemRigCtrlCfg->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsComCfg));
-    this->Connect(m_menuItemRigCtrlCfg->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsComCfgUI));
-    this->Connect(m_menuItemOptions->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsOptions));
-    this->Connect(m_menuItemOptions->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsOptionsUI));
-
-    this->Connect(m_menuItemPlayFileToMicIn->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnPlayFileToMicIn));
-    this->Connect(m_menuItemRecFileFromRadio->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnRecFileFromRadio));
-    this->Connect(m_menuItemPlayFileFromRadio->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnPlayFileFromRadio));
-
-    this->Connect(m_menuItemHelpUpdates->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnHelpCheckUpdates));
-    this->Connect(m_menuItemHelpUpdates->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnHelpCheckUpdatesUI));
-    this->Connect(m_menuItemAbout->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnHelpAbout));
-    //m_togRxID->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnRxID), NULL, this);
-    //m_togTxID->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnTxID), NULL, this);
-    m_sliderSQ->Connect(wxEVT_SCROLL_TOP, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Connect(wxEVT_SCROLL_BOTTOM, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Connect(wxEVT_SCROLL_LINEUP, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Connect(wxEVT_SCROLL_LINEDOWN, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Connect(wxEVT_SCROLL_PAGEUP, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Connect(wxEVT_SCROLL_PAGEDOWN, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Connect(wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Connect(wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Connect(wxEVT_SCROLL_BOTTOM, wxScrollEventHandler(TopFrame::OnSliderScrollBottom), NULL, this);
-    m_sliderSQ->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(TopFrame::OnCmdSliderScrollChanged), NULL, this);
-    m_sliderSQ->Connect(wxEVT_SCROLL_TOP, wxScrollEventHandler(TopFrame::OnSliderScrollTop), NULL, this);
-    m_ckboxSQ->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(TopFrame::OnCheckSQClick), NULL, this);
-
-    m_ckboxSNR->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(TopFrame::OnCheckSNRClick), NULL, this);
-
-    m_togBtnOnOff->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnOnOff), NULL, this);
-    m_togBtnSplit->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnSplitClick), NULL, this);
-    m_togBtnAnalog->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnAnalogClick), NULL, this);
-#ifdef ALC
-    m_togBtnALC->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnALCClick), NULL, this);
-#endif
-    m_btnTogPTT->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnPTT), NULL, this);
-
-    m_BtnCallSignReset->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnCallSignReset), NULL, this);
-    m_BtnBerReset->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnBerReset), NULL, this);
-}
-
-TopFrame::~TopFrame()
-{
-    //-------------------
-    // Disconnect Events
-    //-------------------
-    this->Disconnect(wxEVT_CLOSE_WINDOW, wxCloseEventHandler(TopFrame::topFrame_OnClose));
-    this->Disconnect(wxEVT_PAINT, wxPaintEventHandler(TopFrame::topFrame_OnPaint));
-    this->Disconnect(wxEVT_SIZE, wxSizeEventHandler(TopFrame::topFrame_OnSize));
-    this->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::topFrame_OnUpdateUI));
-    this->Disconnect(ID_EXIT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnExit));
-    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsAudio));
-    this->Disconnect(wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsAudioUI));
-    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsFilter));
-    this->Disconnect(wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsFilterUI));
-    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsComCfg));
-    this->Disconnect(wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsComCfgUI));
-    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsOptions));
-    this->Disconnect(wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsOptionsUI));
-
-    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnPlayFileToMicIn));
-    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnRecFileFromRadio));
-    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnPlayFileFromRadio));
-
-    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnHelpCheckUpdates));
-    this->Disconnect(wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnHelpCheckUpdatesUI));
-    this->Disconnect(ID_ABOUT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnHelpAbout));
-    //m_togRxID->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnRxID), NULL, this);
-    //m_togTxID->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnTxID), NULL, this);
-    m_sliderSQ->Disconnect(wxEVT_SCROLL_TOP, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Disconnect(wxEVT_SCROLL_BOTTOM, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Disconnect(wxEVT_SCROLL_LINEUP, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Disconnect(wxEVT_SCROLL_LINEDOWN, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Disconnect(wxEVT_SCROLL_PAGEUP, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Disconnect(wxEVT_SCROLL_PAGEDOWN, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Disconnect(wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Disconnect(wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
-    m_sliderSQ->Disconnect(wxEVT_SCROLL_BOTTOM, wxScrollEventHandler(TopFrame::OnSliderScrollBottom), NULL, this);
-    m_sliderSQ->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(TopFrame::OnCmdSliderScrollChanged), NULL, this);
-    m_sliderSQ->Disconnect(wxEVT_SCROLL_TOP, wxScrollEventHandler(TopFrame::OnSliderScrollTop), NULL, this);
-    m_ckboxSQ->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(TopFrame::OnCheckSQClick), NULL, this);
-
-    m_togBtnOnOff->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnOnOff), NULL, this);
-    m_togBtnSplit->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnSplitClick), NULL, this);
-    m_togBtnAnalog->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnAnalogClick), NULL, this);
-#ifdef ALC
-    m_togBtnALC->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnALCClick), NULL, this);
-#endif
-    m_btnTogPTT->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnPTT), NULL, this);
-
-}
-
diff --git a/fdmdv2/tags/0.99-Beta/src/topFrame.h b/fdmdv2/tags/0.99-Beta/src/topFrame.h
deleted file mode 100644 (file)
index 4341315..0000000
+++ /dev/null
@@ -1,183 +0,0 @@
-//==========================================================================
-// Name:            topFrame.h
-//
-// Purpose:         Implements simple wxWidgets application with GUI.
-// Created:         Apr. 9, 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 Lesser 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 Lesser General Public License
-//  along with this program; if not, see <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#ifndef __TOPFRAME_H__
-#define __TOPFRAME_H__
-
-#include "version.h"
-#include <wx/artprov.h>
-#include <wx/xrc/xmlres.h>
-#include <wx/intl.h>
-#include <wx/string.h>
-#include <wx/bitmap.h>
-#include <wx/image.h>
-#include <wx/icon.h>
-#include <wx/menu.h>
-#include <wx/gdicmn.h>
-#include <wx/font.h>
-#include <wx/colour.h>
-#include <wx/settings.h>
-#include <wx/gauge.h>
-#include <wx/textctrl.h>
-#include <wx/sizer.h>
-#include <wx/statbox.h>
-#include <wx/aui/auibook.h>
-#include <wx/tglbtn.h>
-#include <wx/slider.h>
-#include <wx/checkbox.h>
-#include <wx/statusbr.h>
-#include <wx/frame.h>
-#include <wx/statbmp.h>
-#include <wx/stattext.h>
-#include <wx/button.h>
-#include <wx/dialog.h>
-#include <wx/radiobut.h>
-#include <wx/combobox.h>
-#include <wx/panel.h>
-#include <wx/listbox.h>
-#include <wx/notebook.h>
-#include <wx/listctrl.h>
-
-
-///////////////////////////////////////////////////////////////////////////
-
-#define ID_OPEN 1000
-#define ID_SAVE 1001
-#define ID_CLOSE 1002
-#define ID_EXIT 1003
-#define ID_COPY 1004
-#define ID_CUT 1005
-#define ID_PASTE 1006
-#define ID_OPTIONS 1007
-#define ID_ABOUT 1008
-
-///////////////////////////////////////////////////////////////////////////////
-/// Class TopFrame
-///////////////////////////////////////////////////////////////////////////////
-class TopFrame : public wxFrame
-{
-    private:
-
-    protected:
-        wxMenuBar* m_menubarMain;
-        wxMenu* file;
-        wxMenu* edit;
-        wxMenu* tools;
-        wxMenu* help;
-        wxGauge* m_gaugeSNR;
-        wxStaticText* m_textSNR;
-        wxCheckBox* m_ckboxSNR;
-        wxGauge* m_gaugeLevel;
-        wxStaticText* m_textLevel;
-
-        wxButton*     m_BtnCallSignReset;
-        wxTextCtrl*   m_txtCtrlCallSign;
-        wxStaticText* m_txtChecksumGood;
-        wxStaticText* m_txtChecksumBad;
-
-        wxSlider* m_sliderSQ;
-        wxCheckBox* m_ckboxSQ;
-        wxStaticText* m_textSQ;
-        wxStatusBar* m_statusBar1;
-
-        wxButton*     m_BtnBerReset;
-        wxStaticText  *m_textBits;
-        wxStaticText  *m_textErrors;
-        wxStaticText  *m_textBER;
-
-        wxRadioButton *m_rbSync;
-        wxRadioButton *m_rb1400old;
-        wxRadioButton *m_rb1400;
-        wxRadioButton *m_rb700;
-        wxRadioButton *m_rb1600;
-        wxRadioButton *m_rb2000;
-        wxRadioButton *m_rb1600Wide;
-
-        // Virtual event handlers, overide them in your derived class
-        virtual void topFrame_OnClose( wxCloseEvent& event ) { event.Skip(); }
-        virtual void topFrame_OnPaint( wxPaintEvent& event ) { event.Skip(); }
-        virtual void topFrame_OnSize( wxSizeEvent& event ) { event.Skip(); }
-        virtual void topFrame_OnUpdateUI( wxUpdateUIEvent& event ) { event.Skip(); }
-
-        virtual void OnExit( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnTop( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnToolsAudio( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnToolsAudioUI( wxUpdateUIEvent& event ) { event.Skip(); }
-        virtual void OnToolsFilter( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnToolsFilterUI( wxUpdateUIEvent& event ) { event.Skip(); }
-        virtual void OnToolsOptions( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnToolsUDP( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnToolsOptionsUI( wxUpdateUIEvent& event ) { event.Skip(); }
-        virtual void OnToolsComCfg( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnToolsComCfgUI( wxUpdateUIEvent& event ) { event.Skip(); }
-        virtual void OnPlayFileToMicIn( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnRecFileFromRadio( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnPlayFileFromRadio( wxCommandEvent& event ) { event.Skip(); }
-
-        virtual void OnHelpCheckUpdates( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnHelpCheckUpdatesUI( wxUpdateUIEvent& event ) { event.Skip(); }
-        virtual void OnHelpAbout( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnTogBtnRxID( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnTogBtnTxID( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnCmdSliderScroll( wxScrollEvent& event ) { event.Skip(); }
-        virtual void OnSliderScrollBottom( wxScrollEvent& event ) { event.Skip(); }
-        virtual void OnCmdSliderScrollChanged( wxScrollEvent& event ) { event.Skip(); }
-        virtual void OnSliderScrollTop( wxScrollEvent& event ) { event.Skip(); }
-        virtual void OnCheckSQClick( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnCheckSNRClick( wxCommandEvent& event ) { event.Skip(); }
-
-        virtual void OnTogBtnLoopRx( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnTogBtnLoopTx( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnTogBtnOnOff( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnTogBtnSplitClick( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnTogBtnAnalogClick( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnTogBtnALCClick( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnTogBtnPTT( wxCommandEvent& event ) { event.Skip(); }
-
-        virtual void OnTogBtnSplitClickUI(wxUpdateUIEvent& event) { event.Skip(); }
-        virtual void OnTogBtnAnalogClickUI(wxUpdateUIEvent& event) { event.Skip(); }
-        virtual void OnTogBtnALCClickUI(wxUpdateUIEvent& event) { event.Skip(); }
-        virtual void OnTogBtnRxIDUI(wxUpdateUIEvent& event ) { event.Skip(); }
-        virtual void OnTogBtnTxIDUI(wxUpdateUIEvent& event ) { event.Skip(); }
-        virtual void OnTogBtnPTT_UI(wxUpdateUIEvent& event ) { event.Skip(); }
-        virtual void OnTogBtnOnOffUI(wxUpdateUIEvent& event ) { event.Skip(); }
-
-        virtual void OnCallSignReset( wxCommandEvent& event ) { event.Skip(); }
-        virtual void OnBerReset( wxCommandEvent& event ) { event.Skip(); }
-
-    public:
-        wxToggleButton* m_togRxID;
-        wxToggleButton* m_togTxID;
-        wxToggleButton* m_togBtnOnOff;
-        wxToggleButton* m_togBtnSplit;
-        wxToggleButton* m_togBtnAnalog;
-        wxToggleButton* m_togBtnALC;
-        wxToggleButton* m_btnTogPTT;
-        wxToggleButton* m_togBtnLoopRx;
-        wxToggleButton* m_togBtnLoopTx;
-        wxAuiNotebook* m_auiNbookCtrl;
-
-        TopFrame( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("FreeDV ") + _(FREEDV_VERSION), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(561,300 ), long style = wxDEFAULT_FRAME_STYLE|wxRESIZE_BORDER|wxTAB_TRAVERSAL );
-
-        ~TopFrame();
-};
-
-#endif //__TOPFRAME_H__
diff --git a/freedv-dev/.clang/.gitignore b/freedv-dev/.clang/.gitignore
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/freedv-dev/CMakeLists.txt b/freedv-dev/CMakeLists.txt
new file mode 100644 (file)
index 0000000..afdd8a3
--- /dev/null
@@ -0,0 +1,487 @@
+#
+# FreeDV - HF Digital Voice for Radio Amateurs
+#
+# CMake configuration contributed by Richard Shaw (KF5OIM)
+# Please report questions, comments, problems, or patches to the freetel
+# mailing list: https://lists.sourceforge.net/lists/listinfo/freetel-codec2
+#
+
+cmake_minimum_required(VERSION 2.8)
+
+# Prevent in-source builds to protect automake/autoconf config.
+# If an in-source build is attempted, you will still need to clean up a few
+# files manually.
+set(CMAKE_DISABLE_SOURCE_CHANGES ON)
+set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
+if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
+  message(FATAL_ERROR "In-source builds in ${CMAKE_BINARY_DIR} are not "   
+   "allowed, please remove ./CMakeCache.txt and ./CMakeFiles/, create a "
+   "separate build directory and run cmake from there.")
+endif("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
+
+# Set local module path.
+list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
+
+project(FreeDV)
+
+#
+# Set FreeDV version and generate src/version.h
+#
+set(FREEDV_VERSION_MAJOR 0)
+set(FREEDV_VERSION_MINOR 99)
+set(FREEDV_VERSION_PATCH FALSE)
+set(FREEDV_VERSION ${FREEDV_VERSION_MAJOR}.${FREEDV_VERSION_MINOR})
+if(FREEDV_VERSION_PATCH)
+    set(FREEDV_VERSION ${FREEDV_VERSION}.${FREEDV_VERSION_PATCH})
+endif()
+set(FREEDV_VERSION_SUFFIX "Beta")
+if(FREEDV_VERSION_SUFFIX)
+    set(FREEDV_VERSION_STRING "${FREEDV_VERSION} ${FREEDV_VERSION_SUFFIX}")
+endif()
+message(STATUS "FreeDV version: ${FREEDV_VERSION_STRING}")
+configure_file(cmake/version.h.in src/version.h @ONLY)
+
+# Set default build type
+if(NOT CMAKE_BUILD_TYPE)
+    set(CMAKE_BUILD_TYPE "Release")
+    message(STATUS "Build type not specified, defaulting to ${CMAKE_BUILD_TYPE}")
+endif(NOT CMAKE_BUILD_TYPE)
+
+
+# Work around for not using a svn working copy.
+add_definitions(-D_NO_AUTOTOOLS_)
+find_program(SVNVERSION_PATH svnversion)
+if(SVNVERSION_PATH)
+    execute_process(COMMAND ${SVNVERSION_PATH} .
+        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+        RESULT_VARIABLE SVN_REVISION_RESULT
+        OUTPUT_VARIABLE SVN_CURRENT_REVISION
+        ERROR_QUIET
+    )
+else()
+    set(SVN_REVISION_RESULT 1)
+endif()
+if(SVN_REVISION_RESULT EQUAL 0)
+string(STRIP ${SVN_CURRENT_REVISION} SVN_REVISION)
+add_definitions(-DSVN_REVISION="${SVN_REVISION}")
+else()
+add_definitions(-DSVN_REVISION="Unversioned directory")
+endif()
+
+
+# Set default build flags.
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
+
+#
+# Setup cmake options
+#
+set(CMAKE_VERBOSE_MAKEFILE TRUE CACHE BOOL "Verbose makefile.")
+set(USE_STATIC_DEPS FALSE CACHE BOOL 
+    "Download and build static libraries instead of system libraries.")
+set(USE_STATIC_PORTAUDIO FALSE CACHE BOOL 
+    "Download and build static portaudio instead of the system library.")
+set(USE_STATIC_SNDFILE FALSE CACHE BOOL
+    "Download and build static sndfile instead of the system library.")
+set(USE_STATIC_SAMPLERATE FALSE CACHE BOOL
+    "Download and build static samplerate instead of the system library.")
+set(USE_STATIC_SOX FALSE CACHE BOOL
+    "Download and build static sox instead of the system library.")
+set(USE_STATIC_CODEC2 TRUE CACHE BOOL
+    "Download and build static codec2 instead of the system library.")
+set(USE_STATIC_SPEEXDSP TRUE CACHE BOOL
+    "Download and build static speex instead of the system library.")
+set(BOOTSTRAP_WXWIDGETS FALSE CACHE BOOL
+    "Download and build static wxWidgets instead of the system library.")
+
+if(USE_STATIC_DEPS)
+    set(USE_STATIC_PORTAUDIO TRUE FORCE)
+    set(USE_STATIC_SNDFILE TRUE FORCE)
+    set(USE_STATIC_SAMPLERATE TRUE FORCE)
+    set(USE_STATIC_SOX TRUE FORCE)
+    set(USE_STATIC_CODEC2 TRUE FORCE)
+endif(USE_STATIC_DEPS)
+
+#
+# Pull in external wxWidgets target if performing static build.
+#
+if(BOOTSTRAP_WXWIDGETS)
+    message(STATUS "Adding wxWidgets build target...")
+    include(cmake/BuildWxWidgets.cmake)
+endif(BOOTSTRAP_WXWIDGETS)
+
+#
+# Perform bootstrap build of wxWidgets
+#
+if(BOOTSTRAP_WXWIDGETS AND NOT EXISTS ${WXCONFIG})
+    message(STATUS "Will perform bootstrap build of wxWidgets.
+   After make step completes, re-run cmake and make again to perform FreeDV build.")
+#
+# Continue normal build if not bootstrapping wxWidgets or is already built.
+#
+else(BOOTSTRAP_WXWIDGETS AND NOT EXISTS ${WXCONFIG})
+
+
+#
+# Various hacks and work arounds for building under MinGW.
+#
+if(MINGW)
+    message(STATUS "System is MinGW.")
+    # Setup HOST variable.
+    include(cmake/MinGW.cmake)
+    # This sets up the exe icon for windows under mingw.
+    set(RES_FILES "")
+    set(RES_FILES "${CMAKE_SOURCE_DIR}/contrib/freedv.rc")
+    set(CMAKE_RC_COMPILER_INIT windres)
+    enable_language(RC)
+    set(CMAKE_RC_COMPILE_OBJECT
+        "<CMAKE_RC_COMPILER> <FLAGS> -O coff <DEFINES> -i <SOURCE> -o <OBJECT>")
+    # These are DLOPEN'ed and can't be automatically pulled in by dependency.
+    foreach(RUNTIME
+        hamlib-adat.dll
+        hamlib-alinco.dll
+        hamlib-amsat.dll
+        hamlib-aor.dll
+        hamlib-ars.dll
+        hamlib-celestron.dll
+        hamlib-drake.dll
+        hamlib-dummy.dll
+        hamlib-easycomm.dll
+        hamlib-flexradio.dll
+        hamlib-fodtrack.dll
+        hamlib-gs232a.dll
+        hamlib-heathkit.dll
+        hamlib-icom.dll
+        hamlib-jrc.dll
+        hamlib-kachina.dll
+        hamlib-kenwood.dll
+        hamlib-kit.dll
+        hamlib-lowe.dll
+        hamlib-m2.dll
+        hamlib-pcr.dll
+        hamlib-prm80.dll
+        hamlib-racal.dll
+        hamlib-rft.dll
+        hamlib-rotorez.dll
+        hamlib-rs.dll
+        hamlib-sartek.dll
+        hamlib-skanti.dll
+        hamlib-spid.dll
+        hamlib-tapr.dll
+        hamlib-tentec.dll
+        hamlib-ts7400.dll
+        hamlib-tuner.dll
+        hamlib-uniden.dll
+        hamlib-winradio.dll
+        hamlib-wj.dll
+        hamlib-yaesu.dll)
+        message(STATUS "Checking for ${RUNTIME}")
+        find_library(${RUNTIME}_LIB ${RUNTIME}
+            PATH_SUFFIXES hamlib)
+        message(STATUS "runtime found: ${${RUNTIME}_LIB}")
+        list(APPEND CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS ${${RUNTIME}_LIB})
+    endforeach()
+    include(InstallRequiredSystemLibraries)
+endif(MINGW)
+
+# Math library is automatic on MinGW
+if(UNIX)
+    set(CMAKE_REQUIRED_INCLUDES math.h)
+    set(CMAKE_REQUIRED_LIBRARIES m)
+endif(UNIX)
+
+# Find some standard headers and functions.
+include(CheckIncludeFiles)
+check_include_files("limits.h" HAVE_LIMITS_H)
+check_include_files("stddef.h" HAVE_STDDEF_H)
+check_include_files("stdlib.h" HAVE_STDLIB_H)
+check_include_files("string.h" HAVE_STRING_H)
+
+include(CheckTypeSize)
+check_type_size("int" SIZEOF_INT)
+
+include(CheckFunctionExists)
+check_function_exists(floor HAVE_FLOOR)
+check_function_exists(memset HAVE_MEMSET)
+check_function_exists(pow HAVE_POW)
+check_function_exists(sqrt HAVE_SQRT)
+
+# fdmdv2_main.h requires patching to find config.h as it current looks in the
+# source directory and the generated file goes in the binary directory.
+configure_file ("${PROJECT_SOURCE_DIR}/cmake/config.h.in"
+                "${PROJECT_BINARY_DIR}/config.h" )
+include_directories(${PROJECT_BINARY_DIR})
+add_definitions(-DHAVE_CONFIG_H)
+
+# Pthread Library
+find_package(Threads REQUIRED)
+message(STATUS "Threads library flags: ${CMAKE_THREAD_LIBS_INIT}")
+
+#
+# Find codec2
+#
+if(NOT USE_STATIC_CODEC2)
+    message(STATUS "Looking for codec2...")
+    find_package(codec2 CONFIG QUIET)
+    if(codec2_FOUND)
+        get_target_property(CODEC2_LIBRARY codec2 LOCATION)
+        message(STATUS "  codec2 library: ${CODEC2_LIBRARY}")
+        message(STATUS "  codec2 headers: ${codec2_INCLUDE_DIRS}")
+    else()
+        # Try to find manually
+        find_path(CODEC2_INCLUDE_DIRS codec2.h
+                  PATH_SUFFIXES codec2)
+        find_library(CODEC2_LIBRARY NAMES codec2)
+        if(CODEC2_LIBRARY AND CODEC2_INCLUDE_DIRS)
+            message(STATUS "  codec2 library: ${CODEC2_LIBRARY}")
+            message(STATUS "  codec2 headers: ${CODEC2_INCLUDE_DIRS}")
+            list(APPEND FREEDV_LINK_LIBS ${CODEC2_LIBRARY})
+            include_directories(${CODEC2_INCLUDE_DIRS})
+        else()
+            message(FATAL_ERROR "codec2 library not found.
+Linux: 
+Codec2 may not be in your distribution so build yourself or use the cmake option to build statically into FreeDV.
+Windws:
+It's easiest to use the cmake option: USE_STATIC_CODEC2"
+        )
+        endif()
+    endif()
+else(NOT USE_STATIC_CODEC2)
+    message(STATUS "Will attempt static build of codec2.")
+    include(cmake/BuildCodec2.cmake)
+endif(NOT USE_STATIC_CODEC2)
+
+#
+# Find or build portaudio Library
+#
+if(NOT USE_STATIC_PORTAUDIO)
+    message(STATUS "Looking for portaudio...")
+    find_package(Portaudio REQUIRED)
+    if(PORTAUDIO_FOUND)
+        message(STATUS "  portaudio library: ${PORTAUDIO_LIBRARIES}")
+        message(STATUS "  portaudio headers: ${PORTAUDIO_INCLUDE_DIRS}")
+        list(APPEND FREEDV_LINK_LIBS ${PORTAUDIO_LIBRARIES})
+        include_directories(${PORTAUDIO_INCLUDE_DIRS})
+    else()
+        message(FATAL_ERROR "portaudio library not found.
+On Linux systems try installing:
+    portaudio-devel  (RPM based systems)
+    libportaudio-dev (DEB based systems)
+On Windows it's easiest to use the cmake option: USE_STATIC_PORTAUDIO"
+        )
+    endif()
+    if(NOT ${PORTAUDIO_VERSION} EQUAL 19)
+        message(WARNING "Portaudio versions other than 19 are known to have issues. You have been warned!")
+    endif()
+else(NOT USE_STATIC_PORTAUDIO)
+    message(STATUS "Will attempt static build of portaudio.")
+    include(cmake/BuildPortaudio.cmake)
+endif(NOT USE_STATIC_PORTAUDIO)
+
+#
+# Hamlib library
+#
+message(STATUS "Looking for hamlib...")
+find_path(HAMLIB_INCLUDE_DIR hamlib/rig.h)
+find_library(HAMLIB_LIBRARY hamlib)
+message(STATUS "Hamlib library: ${HAMLIB_LIBRARY}")
+message(STATUS "Hamlib headers: ${HAMLIB_INCLUDE_DIR}")
+if(HAMLIB_LIBRARY AND HAMLIB_INCLUDE_DIR)
+    message(STATUS "Hamlib library found.")
+    include_directories(${HAMLIB_INCLUDE_DIR})
+    list(APPEND FREEDV_LINK_LIBS ${HAMLIB_LIBRARY})
+else(HAMLIB_LIBRARY AND HAMLIB_INCLUDE_DIR)
+    message(FATAL_ERROR "hamlib not found.
+On Linux systems try installing:
+    hamlib-devel  (RPM based systems)
+    libhamlib-dev (DEB based systems)"
+    )
+endif(HAMLIB_LIBRARY AND HAMLIB_INCLUDE_DIR)
+
+
+#
+# Samplerate Library
+#
+if(NOT USE_STATIC_SAMPLERATE)
+    message(STATUS "Looking for samplerate...")
+    find_library(LIBSAMPLERATE samplerate)
+    find_path(LIBSAMPLERATE_INCLUDE_DIR samplerate.h)
+    message(STATUS "  samplerate library: ${LIBSAMPLERATE}")
+    message(STATUS "  samplerate headers: ${LIBSAMPLERATE_INCLUDE_DIR}")
+    if(LIBSAMPLERATE AND LIBSAMPLERATE_INCLUDE_DIR)
+        list(APPEND FREEDV_LINK_LIBS ${LIBSAMPLERATE})
+        include_directories(${LIBSAMPLERATE_INCLUDE_DIR})
+    else(LIBSTAMPLERATE AND LIBSAMPLERATE_INCLUDE_DIR)
+        message(FATAL_ERROR "samplerate library not found.
+On Linux systems try installing:
+    samplerate-devel  (RPM based systems)
+    libsamplerate-dev (DEB based systems)
+On Windows it's easiest to use the cmake option: USE_STATIC_SAMPLERATE"
+        )
+    endif(LIBSAMPLERATE AND LIBSAMPLERATE_INCLUDE_DIR)
+else(NOT USE_STATIC_SAMPLERATE)
+    message(STATUS "Will attempt static build of samplerate.")
+    include(cmake/BuildSamplerate.cmake)
+endif(NOT USE_STATIC_SAMPLERATE)
+
+#
+# Find sox library
+#
+if(NOT USE_STATIC_SOX)
+    message(STATUS "Looking for sox...")
+    find_library(LIBSOX_LIBRARY sox)
+    find_path(LIBSOX_INCLUDE_DIR NAMES sox/sox.h sox.h)
+    message(STATUS "  sox library: ${LIBSOX_LIBRARY}")
+    message(STATUS "  sox headers: ${LIBSOX_INCLUDE_DIR}")
+    if(LIBSOX_LIBRARY AND LIBSOX_INCLUDE_DIR)
+        list(APPEND FREEDV_LINK_LIBS ${LIBSOX_LIBRARY})
+        include_directories(${LIBSOX_INCLUDE_DIR})
+    else(LIBSOX_LIBRARY AND LIBSOX_INCLUDE_DIR)
+        message(FATAL_ERROR "sox library not found.
+On Linux systems try installing:
+    sox-devel (RPM based systems)
+    libsox-dev (DEB based systems)
+On Windows it's easiest to use the cmake option: USE_STATIC_SOX"
+        )
+    endif(LIBSOX_LIBRARY AND LIBSOX_INCLUDE_DIR)
+else(NOT USE_STATIC_SOX)
+    message(STATUS "Will attempt static build of sox.")
+    include(cmake/BuildSox.cmake)
+endif(NOT USE_STATIC_SOX)
+
+#    
+# sndfile Library
+#
+if(NOT USE_STATIC_SNDFILE)
+    message(STATUS "Looking for sndfile...")
+    find_library(LIBSNDFILE sndfile)
+    find_path(LIBSNDFILE_INCLUDE_DIR sndfile.h)
+    message(STATUS "  sndfile library: ${LIBSNDFILE}")
+    message(STATUS "  sndfile headers: ${LIBSNDFILE_INCLUDE_DIR}")
+    if(LIBSNDFILE AND LIBSNDFILE_INCLUDE_DIR)
+        list(APPEND FREEDV_LINK_LIBS ${LIBSNDFILE})
+    else(LIBSNDFILE AND LIBSNDFILE_INCLUDE_DIR)
+        message(FATAL_ERROR "sndfile library not found.
+On Linux systems try installing:
+    libsndfile-devel (RPM based systems)
+    libsndfile-dev   (DEB based systems)
+On Windows it's easiest to use the cmake option: USE_STATIC_SNDFILE"
+        )
+    endif(LIBSNDFILE AND LIBSNDFILE_INCLUDE_DIR)
+else(NOT USE_STATIC_SNDFILE)
+    message(STATUS "Will attempt static build of sndfile.")
+    include(cmake/BuildSndfile.cmake)
+endif(NOT USE_STATIC_SNDFILE)
+
+#
+# Find wxWidgets
+#
+if(NOT BOOTSTRAP_WXWIDGETS)
+    set(WXCONFIG "" CACHE FILEPATH "Location of wx-config binary.")
+    set(WXRC "" CACHE FILEPATH "Location of wxrc binary.")
+endif(NOT BOOTSTRAP_WXWIDGETS)
+#if(BOOTSTRAP_WXWIDGETS)
+#    set(WXCONFIG "${CMAKE_BINARY_DIR}/external/dist/bin/wx-config")
+#    set(WXRC "${CMAKE_BINARY_DIR}/external/dist/bin/wxrc")
+#    list(APPEND FREEDV_STATIC_DEPS wxWidgets)
+#endif(BOOTSTRAP_WXWIDGETS)
+message(STATUS "Looking for wxWidgets...")
+if(WXCONFIG)
+    message(STATUS "wx-config: ${WXCONFIG}")
+    set(wxWidgets_CONFIG_EXECUTABLE ${WXCONFIG})
+endif(WXCONFIG)
+if(WXRC)
+    message(STATUS "wxrc: ${WXRC}")
+    set(wxWidgets_wxrc_EXECUTABLE ${WXRC})
+endif(WXRC)
+set(WX_VERSION_MIN 3.0.0)
+find_package(wxWidgets REQUIRED core base aui html net adv)
+execute_process(COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}" --version
+    OUTPUT_VARIABLE WX_VERSION)
+string(STRIP ${WX_VERSION} WX_VERSION)
+if(WX_VERSION VERSION_EQUAL ${WX_VERSION_MIN}
+    OR WX_VERSION VERSION_GREATER ${WX_VERSION_MIN})
+   message(STATUS "wxWidgets version: ${WX_VERSION}")
+else()
+    message(FATAL_ERROR "wxWidgets must be installed on your system.
+Please check that wx-config is in path, the directory
+where wxWidgets libraries are installed (returned by
+'wx-config --libs' or 'wx-config --static --libs' command)
+is in LD_LIBRARY_PATH or equivalent variable and
+wxWidgets version is ${WX_VERSION_MIN} or above.")
+endif()
+if(wxWidgets_FOUND)
+    include("${wxWidgets_USE_FILE}")
+    list(APPEND FREEDV_LINK_LIBS ${wxWidgets_LIBRARIES})
+endif(wxWidgets_FOUND)
+
+#
+# Find speex library
+#
+if(NOT USE_STATIC_SPEEXDSP)
+    message(STATUS "Looking for Speex DSP library.")
+    find_path(SPEEXDSP_INCLUDE_DIR speex/speex.h)
+    find_library(SPEEXDSP_LIBRARY speexdsp)
+    message(STATUS "  Speex DSP headers: ${SPEEXDSP_INCLUDE_DIR}")
+    message(STATUS "  Speex DSP library: ${SPEEXDSP_LIBRARY}")
+    if(SPEEXDSP_INCLUDE_DIR AND SPEEXDSP_LIBRARY)
+        include_directories(${SPEEXDSP_INCLUDE_DIR})
+        list(APPEND FREEDV_LINK_LIBS ${SPEEXDSP_LIBRARY})
+    else(SPEEXDSP_INCLUDE_DIR AND SPEEXDSP_LIBRARY)
+        message(FATAL_ERROR "Speex DSP library not found!")
+    endif(SPEEXDSP_INCLUDE_DIR AND SPEEXDSP_LIBRARY)
+else()
+    message(STATUS "Will attempt static build of speex.")
+    include(cmake/BuildSpeex.cmake)
+endif()
+    
+#Freedv 
+add_subdirectory(src)
+
+# Icons and desktop file
+add_subdirectory(contrib)
+
+message(STATUS "Build type will be: ${CMAKE_BUILD_TYPE}")
+
+#
+# Cpack NSIS configuration for Windows.
+#
+if(WIN32)
+    # Detect if we're doing a 32-bit or 64-bit windows build.
+    if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
+        set(CMAKE_CL_64 TRUE)
+    endif()
+    if(NOT ${CMAKE_BUILD_TYPE} STREQUAL "Debug")
+        set(CPACK_STRIP_FILES TRUE)
+    endif()
+    configure_file(cmake/GetDependencies.cmake.in cmake/GetDependencies.cmake
+        @ONLY
+    )
+    install(SCRIPT ${CMAKE_BINARY_DIR}/cmake/GetDependencies.cmake)
+    set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "HF Digital Voice for Radio Amateurs")
+    set(CPACK_PACKAGE_VENDOR "CMake")
+    #set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
+    set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
+    set(CPACK_PACKAGE_VERSION_MAJOR ${FREEDV_VERSION_MAJOR})
+    set(CPACK_PACKAGE_VERSION_MINOR ${FREEDV_VERSION_MINOR})
+    # CPack expects a patch level version so set it here and override if we
+    # are actually setting one.
+    set(CPACK_PACKAGE_VERSION_PATCH 0)
+    if(FREEDV_VERSION_PATCH)
+        set(CPACK_PACKAGE_VERSION_PATCH ${FREEDV_VERSION_PATCH})
+    endif()
+    if(FREEDV_VERSION_SUFFIX)
+        set(CPACK_PACKAGE_VERSION_PATCH "${CPACK_PACKAGE_VERSION_PATCH}-${FREEDV_VERSION_SUFFIX}")
+    endif()
+    # There is a bug in NSI that does not handle full unix paths properly. Make
+    # sure there is at least one set of four (4) backlasshes.
+    #set(CPACK_PACKAGE_ICON "${CMake_SOURCE_DIR}/Utilities/Release\\\\InstallIcon.bmp")
+    set(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\freedv.exe")
+    set(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}")
+    set(CPACK_NSIS_PACKAGE_NAME "FreeDV")
+    set(CPACK_NSIS_URL_INFO_ABOUT "http://freedv.org")
+    set(CPACK_NSIS_MODIFY_PATH OFF)
+    set(CPACK_NSIS_MENU_LINKS "http://freedv.org" "FreeDV Homepage")
+    include(CPack)
+endif(WIN32)
+
+endif(BOOTSTRAP_WXWIDGETS AND NOT EXISTS ${WXCONFIG})
diff --git a/freedv-dev/COPYING b/freedv-dev/COPYING
new file mode 100644 (file)
index 0000000..cfd4e99
--- /dev/null
@@ -0,0 +1,502 @@
+                  GNU LESSER GENERAL PUBLIC LICENSE
+                       Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+                            Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+  When we speak of free software, we are referring to freedom of use,
+not price.  Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+\f
+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard.  To achieve this, non-free programs must be
+allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+\f
+                  GNU LESSER GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+\f
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+\f
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+\f
+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+\f
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+\f
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+\f
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+                            NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+                     END OF TERMS AND CONDITIONS
+\f
+           How to Apply These Terms to Your New Libraries
+
+  If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change.  You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+  To apply these terms, attach the following notices to the library.  It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the library's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, see
+    <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+  <signature of Ty Coon>, 1 April 1990
+  Ty Coon, President of Vice
+
+That's all there is to it!
diff --git a/freedv-dev/README.txt b/freedv-dev/README.txt
new file mode 100644 (file)
index 0000000..c844400
--- /dev/null
@@ -0,0 +1,275 @@
+==================================
+ Building and installing on Linux
+==================================
+
+Quickstart 1
+-----------
+
+Builds static versions of wxWidgets, portaudio, codec2-dev, which are commonly
+missing on many Linux systems, or of the wrong (older) version.
+
+1/ Assuming the fdmdv2-dev source is checked out into ~/fdmdv2-dev:
+
+  $ sudo apt-get install libgtk2.0-dev libhamlib-dev libsamplerate-dev libasound2-dev libao-dev libgsm1-dev
+  $ cd fdmdv2-dev
+  $ mkdir build_linux
+  $ cd build_linux
+  $ cmake -DBOOTSTRAP_WXWIDGETS=TRUE ~/fdmdv2-dev
+  $ make
+
+2/ Then you can configure FreeDV using your local codec-dev, something like:
+
+  $ cmake -DCMAKE_BUILD_TYPE=Debug -DBOOTSTRAP_WXWIDGETS=TRUE -DCODEC2_INCLUDE_DIRS=/path/to/codec2-dev/src -DCODEC2_LIBRARY=/path/to/codec2-dev/build_linux/src/libcodec2.so -DUSE_STATIC_CODEC2=FALSE -DUSE_STATIC_PORTAUDIO=TRUE -DUSE_STATIC_SOX=TRUE ../
+
+3/ OR build a local copy of codec2-dev:
+
+  $ cmake -DBOOTSTRAP_WXWIDGETS=TRUE -DUSE_STATIC_CODEC2=TRUE -DUSE_STATIC_PORTAUDIO=TRUE -DUSE_STATIC_SOX=TRUE ../
+  
+4/ Build and run FreeDV:
+
+   $ make
+   $ ./src/freedv
+
+Quickstart 2
+------------
+
+1/ Assuming you have all the dependant libraries:
+
+  $ cd /path/to/fdmdv2
+  $ mkdir build_linux
+  $ cd build_linux
+  $ cmake ../ (defaults to /usr/local, use CMAKE_INSTALL_PREFIX to override)
+  (if no errors)
+  $ make
+  (as root)
+  $ make install
+
+
+=======================================================
+ Building for Windows on Ubuntu Linux (Cross compiling)
+=======================================================
+
+1/ Install the cross compiling toolchain:
+
+  $ sudo apt-get install mingw-w64
+
+2/ Patch cmake using: http://www.cmake.org/gitweb?p=stage/cmake.git;a=patch;h=33286235048495ceafb636d549d9a4e8891967ae
+
+3/ Checkout a fresh copy of codec2-dev and build for Windows, pointing to the generate_codebook built by a linux build of generate_codebook, using this cmake line
+
+  $ cmake .. -DCMAKE_TOOLCHAIN_FILE=../fdmdv2-dev/cmake/Toolchain-Ubuntu-mingw32.cmake -DUNITTEST=FALSE -DGENERATE_CODEBOOK=/home/david/codec2-dev/build_linux/src/generate_codebook 
+
+4/ Build WxWidgets
+
+  $ cd /path/to/fdmdv2-dev
+  $ mkdir build_windows
+  $ cd build_windows
+  $ cmake -DBOOTSTRAP_WXWIDGETS=TRUE .. -DCMAKE_TOOLCHAIN_FILE=cmake/Toolchain-Ubuntu-mingw32.cmake -DCMAKE_BUILD_TYPE=Debug
+  $ make
+
+5/ Download and install the Windows version of Hamlib:
+
+  $ wget http://internode.dl.sourceforge.net/project/hamlib/hamlib/1.2.15.3/hamlib-win32-1.2.15.3.zip
+  $ unzip hamlib-win32-1.2.15.3.zip
+
+6/ Build All the libraries and FreeDV:
+
+  $ cmake -DBOOTSTRAP_WXWIDGETS=TRUE -DCMAKE_TOOLCHAIN_FILE=cmake/Toolchain-Ubuntu-mingw32.cmake -DUSE_STATIC_PORTAUDIO=TRUE -DUSE_STATIC_SNDFILE=TRUE -DUSE_STATIC_SAMPLERATE=TRUE -DUSE_STATIC_SOX=TRUE -DUSE_STATIC_CODEC2=FALSE -DCODEC2_INCLUDE_DIRS=/home/david/tmp/codec2-dev/src -DCODEC2_LIBRARY=/home/david/tmp/codec2-dev/build_windows/src/libcodec2.dll.a -DHAMLIB_INCLUDE_DIR=hamlib-win32-1.2.15.3/include -DHAMLIB_LIBRARY=hamlib-win32-1.2.15.3/lib/gcc/libhamlib.dll.a -DCMAKE_BUILD_TYPE=Debug ..
+  $ make
+
+====================================
+ Building and installing on Windows
+====================================
+
+The windows build is similar to linux and follows the same basic workflow,
+however, while codec2 and FreeDV (fdmdv2) build well on windows, some of the
+dependencies do not. For that reson current windows releases are cross-compiled
+from linux.
+
+Only MinGW is supported. While it is likely possible to perform a pure MinGW
+build, installing MSYS2 will make your life easier.
+
+CMake may not automatically detect that you're in the MSYS environment. If this
+occurs you need to pass cmake the proper generator:
+
+cmake -G"MSYS Makefiles" [other options] </path/to/source>
+
+===============================
+ Bootstrapping wxWidgets build
+===============================
+
+If wxWidgets (>= 3.0) is not available then one option is to have CMake boot-
+strap the build for FreeDV.
+
+This is required because the tool wx-config is used to get the correct compiler
+and linker flags of the wxWidgets components needed by FreeDV. Since this is
+normally done at configure time, not during "make", it is not possible for CMake
+or have this information prior to building wxWidgets.
+
+In order to work around this issue you can "bootstrap" the wxWidgets build using
+the CMake option, "BOOTSTRAP_WXWIDGETS". wxWidgets will be built using static
+libraries.
+
+NOTE: This forces "USE_STATIC_WXWIDGETS" to be true internally regarless of the
+value set manually.
+
+(from any directory, but empty directory outside of the source is prefered.)
+$ cmake -DBOOTSTRAP_WXWIDGETS=TRUE /path/to/fdmdv2
+$ make
+(wxWidgets is downloaded and built)
+$ cmake .
+(wxWidgets build should be detected)
+$ make
+(if all goes well, as root)
+$ make install
+
+====================================
+ Building and installing on OSX
+====================================
+
+====================================
+ Building and installing on FreeBSD
+====================================
+
+As per "Quickstart 2" above but change build_linux to build_freebsd
+
+=======
+Editing
+=======
+
+Please make sure your text editor does not insert tabs, and
+used indents of 4 spaces.  The following .emacs code was used to
+configure emacs:
+
+(setq-default indent-tabs-mode nil)
+
+(add-hook 'c-mode-common-hook
+          (function (lambda ()
+                      (setq c-basic-offset 4)
+                      )))
+
+====
+TODO
+====
+
+[ ] Open R&D questions
+    + Goal is to develop an open source DV mode that performs comparably to SSB
+    [ ] Does 700 perform OK next to SSB?
+        + approx same tx pk level (hard to measure exactly)
+        + try some low SNR channels
+        + try some fast fading/nasty channels
+    [ ] Is 700 speech quality acceptable?
+
+[X] test frames 
+    [X] freedv API support
+    [X] BER displayed on GUI for 700 and 1600
+    [X] plot error patterns for 700 and 1600
+        + callback for error patterns, or poll via stats interface
+    [X] plot error histograms for 700 and 1600
+        + map bit error to carrier, have done this in tcohpsk?
+        + how to reset histogram?  On error reset?
+        + histogram screen ... new code?
+        + test with filter
+
+[X] Bugs
+    [X] resync issue
+    [X] equalise power on 700 and 1600
+    [X] research real and complex PAPR
+    [X] waterfall and spectrum in analog mode
+    [X] The waterfall in analog mode appears to quit working sometimes?
+
+    [X] On TX, intermittently PTT will cause signal to be heard in speakers.  Toggle PTT or 
+        Stop/Start toggle and then starts working.
+    [X] Squelch control on 1600 mode will not open up squelch to 0 (appears to be around 2 dB)
+    [X] space bar keys PTT when entering text info box
+    [X] checksum based txt reception
+        + only print if valid
+    [X] IC7200 audio breakup
+    [ ] short varicode doesn't work
+        + #ifdef-ed out for now
+        + cld be broken in freedv_api
+    [X] On 700 audio sounds tinny and clicky when out of sync compared to 1600 why?
+        + clue: only when analog not pressed
+        + this was 7.5 to 8kHz interpolator bug
+    [X] spectrum and waterfall scale changes when analog pressed
+    [X] ocassional test frames error counter goes crazy
+    [ ] old Waterfall AGC
+    [ ] 700 syncs up to 1000Hz sine waves
+        + shouldn't trigger sync logic, will be a problem with carriers
+    [ ] "clip" led, encourage people to adjust gain to hit that occ when speaking
+    [ ] Win32 record from radio time
+
+[ ] FreeDV 700 improvements
+    [ ] bpf filter after clipping to remove clicks
+        [ ] tcohpsk first, measure PAPR, impl loss
+    [ ] error masking
+        [ ] C version
+        [ ] training off air?  Switchable?
+        [ ] excitation params
+        [ ] training
+    [ ] plotting other demod stats like ch ampl and phase ests
+    [ ] profile with perf, different libresample routine
+    [ ] check for occassional freedv 700 loss of sync
+        + scatter seems to jump
+    [ ] switchable diversity (narrowband) option
+        + measure difference on a few channels
+        + blog
+
+[X] win32
+    [X] X-compile works
+    [X] basic installer
+    [X] Win32 installer
+        + Richard has taken care of this
+
+[ ] Small fixes
+    [X] Playfile bug
+    [X] running again
+    [X] bump ver number
+    [X] long varicode default
+    [X] option to _not_ require checksum, on by default
+    [X] default squelch 2dB
+    [X] scatter diagram tweaks
+        + e.g. meaningful plots on fading channels in real time 
+        [X] agc with hysteresis
+            + changed to log steps
+        [X] longer persistance
+            + changed to 6 seconds
+        [X] diversity addtions on 700
+            + still not real obvious on plot
+            + might be useful to make this switchable
+    [X] scatter diagram different colours/carrier
+    [X] remember what mode you were in
+    [ ] cmd line file decode
+    [ ] Waterfall direction
+    [ ] documentation or use, walk through, you tube, blog posts
+
+[ ] Web support for Presence/spotting hooks
+
+=================
+USER GUIDE NOTES
+=================
+
+TODO: Put this in a more usable form, video tutorials etc
+
+1/ Error Histogram.  Displays BER of each carrier when in "test frame"
+ mode.  As each QPSK carrier has 2 bits there are 2*Nc histogram
+ points.
+
+ Ideally all carriers will have about the same BER (+/- 20% after 5000
+ total bit errors).  However problems can occur with filtering in the
+ tx path.  If one carrier has less power, then it will have a higher
+ BER.  The errors in this carrier will tend to dominate overall
+ BER. For example if one carrier is attenuated due to SSB filter
+ ripple in the tx path then the BER on that carrier will be higher.
+ This is bad news for DV.
+
+ Suggested usage: Transmit FreeDV in test frame mode.  Use a 2nd rx
+ (or get a friend) to monitor your rx signal with FreeDV in test frame
+ mode.  Adjust your rx SNR to get a BER of a few % (e.g. reduce tx power,
+ use a short antenna for the rx, point your beam away, adjust rx RF
+ gain).  Monitor the error histogram for a few minutes, until you have
+ say 5000 total bit errors.  You have a problem if the BER of any
+ carrier is more than 20% different from the rest.
+
+  A typical issue will be one carrier at 1.0, the others at 0.5,
+  indicating the poorer carrier BER is twice the larger.
diff --git a/freedv-dev/cmake/BuildCodec2.cmake b/freedv-dev/cmake/BuildCodec2.cmake
new file mode 100644 (file)
index 0000000..471eef8
--- /dev/null
@@ -0,0 +1,23 @@
+set(SPEEXDSP_CMAKE_ARGS -DBUILD_SHARED_LIBS=FALSE -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/external/dist)
+
+if(USE_STATIC_SPEEXDSP)
+    list(APPEND SPEEXDSP_CMAKE_ARGS 
+        -DSPEEXDSP_LIBRARIES=${CMAKE_BINARY_DIR}/external/dist/lib/libspeexdsp.a
+        -DSPEEXDSP_INCLUDE_DIR=${CMAKE_BINARY_DIR}/external/dist/include)
+endif()
+
+if(CMAKE_CROSSCOMPILING)
+    set(CODEC2_CMAKE_ARGS "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
+endif()
+
+include(ExternalProject)
+ExternalProject_Add(codec2
+   SVN_REPOSITORY https://svn.code.sf.net/p/freetel/code/codec2-dev
+   CMAKE_ARGS ${CODEC2_CMAKE_ARGS} ${SPEEXDSP_CMAKE_ARGS}
+   INSTALL_COMMAND ""
+)
+set(CODEC2_LIBRARIES
+    ${CMAKE_BINARY_DIR}/codec2-prefix/src/codec2-build/src/libcodec2.a)
+include_directories(${CMAKE_BINARY_DIR}/codec2-prefix/src/codec2/src)
+list(APPEND FREEDV_LINK_LIBS ${CODEC2_LIBRARIES})
+list(APPEND FREEDV_STATIC_DEPS codec2)
diff --git a/freedv-dev/cmake/BuildPortaudio.cmake b/freedv-dev/cmake/BuildPortaudio.cmake
new file mode 100644 (file)
index 0000000..cc33d06
--- /dev/null
@@ -0,0 +1,52 @@
+set(PORTAUDIO_TARBALL "pa_stable_v19_20111121")
+
+# required linking libraries on linux. Not sure about windows.
+find_library(ALSA_LIBRARIES asound)
+
+if(UNIX AND NOT ALSA_LIBRARIES)
+    message(ERROR "Could not find alsa library which is required for portaudio.
+On Linux systems try installing:
+    alsa-lib-devel  (RPM based systems)
+    libasound2-dev  (DEB based systems)"
+    )
+endif()
+
+# Make sure that configure knows what system we're using when cross-compiling.
+if(MINGW AND CMAKE_CROSSCOMPILING)
+    include(cmake/MinGW.cmake)
+    set(CONFIGURE_COMMAND ./configure --build=${HOST} --host=${HOST} --target=${HOST} --enable-cxx --without-jack --disable-shared --prefix=${CMAKE_BINARY_DIR}/external/dist)
+else()
+    set(CONFIGURE_COMMAND ./configure --enable-cxx --without-jack --disable-shared --prefix=${CMAKE_BINARY_DIR}/external/dist)
+endif()
+
+include(ExternalProject)
+ExternalProject_Add(portaudio
+    URL http://www.portaudio.com/archives/${PORTAUDIO_TARBALL}.tgz
+    BUILD_IN_SOURCE 1
+    INSTALL_DIR external/dist
+    CONFIGURE_COMMAND ${CONFIGURE_COMMAND}
+    BUILD_COMMAND $(MAKE)
+    INSTALL_COMMAND $(MAKE) install
+)
+if(WIN32)
+    set(PORTAUDIO_LIBRARIES 
+        ${CMAKE_BINARY_DIR}/external/dist/lib/libportaudio.a
+        ${CMAKE_BINARY_DIR}/external/dist/lib/libportaudiocpp.a
+)
+else(WIN32)
+    find_library(RT rt)
+    find_library(ASOUND asound)
+    set(PORTAUDIO_LIBRARIES
+        ${CMAKE_BINARY_DIR}/external/dist/lib/libportaudio.a
+        ${CMAKE_BINARY_DIR}/external/dist/lib/libportaudiocpp.a
+        ${RT}
+        ${ASOUND}
+    )
+endif(WIN32)
+include_directories(${CMAKE_BINARY_DIR}/external/dist/include)
+
+# Add the portaudio library to the list of libraries that must be linked.
+list(APPEND FREEDV_LINK_LIBS ${PORTAUDIO_LIBRARIES})
+
+# Setup a dependency so that this gets built before linking to freedv.
+list(APPEND FREEDV_STATIC_DEPS portaudio)
diff --git a/freedv-dev/cmake/BuildSamplerate.cmake b/freedv-dev/cmake/BuildSamplerate.cmake
new file mode 100644 (file)
index 0000000..aa09f85
--- /dev/null
@@ -0,0 +1,27 @@
+set(SAMPLERATE_TARBALL "libsamplerate-0.1.8")
+
+if(MINGW AND CMAKE_CROSSCOMPILING)
+    set(CONFIGURE_COMMAND ./configure --build=${HOST} --host=${HOST} --target=${HOST} --prefix=${CMAKE_BINARY_DIR}/external/dist --disable-sndfile)
+else()
+    set(CONFIGURE_COMMAND ./configure --prefix=${CMAKE_BINARY_DIR}/external/dist)
+endif()
+
+include(ExternalProject)
+ExternalProject_Add(samplerate
+    URL http://www.mega-nerd.com/SRC/${SAMPLERATE_TARBALL}.tar.gz 
+    BUILD_IN_SOURCE 1
+    INSTALL_DIR external/dist
+    CONFIGURE_COMMAND ${CONFIGURE_COMMAND}
+    BUILD_COMMAND $(MAKE)
+    INSTALL_COMMAND $(MAKE) install
+)
+if(WIN32)
+    set(SAMPLERATE_LIBRARIES
+        ${CMAKE_BINARY_DIR}/external/dist/lib/libsamplerate.a)
+else(WIN32)
+    set(SAMPLERATE_LIBRARIES
+        ${CMAKE_BINARY_DIR}/external/dist/lib/libsamplerate.a)
+endif(WIN32)
+include_directories(${CMAKE_BINARY_DIR}/external/dist/include)
+list(APPEND FREEDV_LINK_LIBS ${SAMPLERATE_LIBRARIES})
+list(APPEND FREEDV_STATIC_DEPS samplerate)
diff --git a/freedv-dev/cmake/BuildSndfile.cmake b/freedv-dev/cmake/BuildSndfile.cmake
new file mode 100644 (file)
index 0000000..43233fb
--- /dev/null
@@ -0,0 +1,26 @@
+set(SNDFILE_TARBALL "libsndfile-1.0.25")
+
+if(MINGW AND CMAKE_CROSSCOMPILING)
+    set(CONFIGURE_COMMAND ./configure --host=${HOST}  --prefix=${CMAKE_BINARY_DIR}/external/dist --disable-external-libs --disable-shared)
+else()
+    set(CONFIGURE_COMMAND ./configure --prefix=${CMAKE_BINARY_DIR}/external/dist --disable-external-libs --disable-shared --disable-external-libs)
+endif()
+
+include(ExternalProject)
+ExternalProject_Add(sndfile
+    URL http://www.mega-nerd.com/libsndfile/files/${SNDFILE_TARBALL}.tar.gz
+    BUILD_IN_SOURCE 1
+    INSTALL_DIR external/dist
+    CONFIGURE_COMMAND ${CONFIGURE_COMMAND}
+    BUILD_COMMAND $(MAKE) V=1
+    INSTALL_COMMAND $(MAKE) install
+)
+if(MINGW)
+    set(SNDFILE_LIBRARIES ${CMAKE_BINARY_DIR}/external/dist/lib/libsndfile.a)
+else()
+    set(SNDFILE_LIBRARIES ${CMAKE_BINARY_DIR}/external/dist/lib/libsndfile.a)
+endif()
+
+include_directories(${CMAKE_BINARY_DIR}/external/dist/include)
+list(APPEND FREEDV_LINK_LIBS ${SNDFILE_LIBRARIES})
+list(APPEND FREEDV_STATIC_DEPS sndfile)
diff --git a/freedv-dev/cmake/BuildSox.cmake b/freedv-dev/cmake/BuildSox.cmake
new file mode 100644 (file)
index 0000000..d54488b
--- /dev/null
@@ -0,0 +1,48 @@
+set(SOX_TARBALL "sox-14.4.1")
+
+# required linking libraries on linux. Not sure about windows.
+find_library(ALSA_LIBRARIES asound)
+find_library(AO_LIBRARIES ao)
+find_library(GSM_LIBRARIES gsm)
+
+if(UNIX AND NOT ALSA_LIBRARIES)
+    message(ERROR "Could not find alsa library.
+On Linux systems try installing:
+    alsa-lib-devel  (RPM based systems)
+    libasound2-dev  (DEB based systems)"
+    )
+endif(UNIX AND NOT ALSA_LIBRARIES)
+
+if(UNIX AND NOT AO_LIBRARIES)
+    message(ERROR "Could not find libao.
+On Linux systems try installing:
+    libao-devel  (RPM based systems)
+    libao-dev    (DEB based systems)"
+    )
+endif(UNIX AND NOT AO_LIBRARIES)
+
+if(MINGW AND CMAKE_CROSSCOMPILING)
+    set(CONFIGURE_COMMAND ./configure --host=${HOST} --enable-shared=no --without-id3tag --without-png --disable-gomp --with-oggvorbis=no --with-oss=no --with-flac=no --with-amrnb=no --with-amrwb=no --with-mp3=no --with-wavpack=no --disable-dl-sndfile --with-pulseaudio=no --without-magic --with-gsm --prefix=${CMAKE_BINARY_DIR}/external/dist)
+else()
+    set(CONFIGURE_COMMAND ./configure --enable-shared=no --without-id3tag --without-png --disable-gomp --with-oggvorbis=no --with-oss=no --with-flac=no --with-amrnb=no --with-amrwb=no --with-mp3=no --with-wavpack=no --disable-dl-sndfile --with-pulseaudio=no --without-magic --with-gsm --prefix=${CMAKE_BINARY_DIR}/external/dist)
+endif()
+
+include(ExternalProject)
+ExternalProject_Add(sox
+    URL http://downloads.sourceforge.net/sox/${SOX_TARBALL}.tar.gz
+    BUILD_IN_SOURCE 1
+    INSTALL_DIR external/dist
+    CONFIGURE_COMMAND ${CONFIGURE_COMMAND}
+    BUILD_COMMAND $(MAKE) V=1
+    INSTALL_COMMAND $(MAKE) install
+)
+set(SOX_LIBRARIES ${CMAKE_BINARY_DIR}/external/dist/lib/libsox.a)
+if(UNIX)
+    list(APPEND SOX_LIBRARIES ${ALSA_LIBRARIES} ${AO_LIBRARIES} ${GSM_LIBRARIES})
+endif()
+if(MINGW)
+    list(APPEND SOX_LIBRARIES winmm)
+endif()
+include_directories(${CMAKE_BINARY_DIR}/external/dist/include)
+list(APPEND FREEDV_LINK_LIBS ${SOX_LIBRARIES})
+list(APPEND FREEDV_STATIC_DEPS sox)
diff --git a/freedv-dev/cmake/BuildSpeex.cmake b/freedv-dev/cmake/BuildSpeex.cmake
new file mode 100644 (file)
index 0000000..262d558
--- /dev/null
@@ -0,0 +1,26 @@
+set(SPEEXDSP_TARBALL "speexdsp-1.2rc3.tar.gz")
+
+if(MINGW AND CMAKE_CROSSCOMPILING)
+    include(cmake/MinGW.cmake)
+    set(CONFIGURE_COMMAND ./configure --host=${HOST} --prefix=${CMAKE_BINARY_DIR}/external/dist --disable-examples)
+else()
+    set(CONFIGURE_COMMAND ./configure --prefix=${CMAKE_BINARY_DIR}/external/dist --disable-examples)
+endif()
+
+include(ExternalProject)
+ExternalProject_Add(speex
+   URL http://downloads.xiph.org/releases/speex/${SPEEXDSP_TARBALL}
+   BUILD_IN_SOURCE 1
+   INSTALL_DIR external/dist
+   CONFIGURE_COMMAND ${CONFIGURE_COMMAND}
+   BUILD_COMMAND $(MAKE)
+   INSTALL_COMMAND $(MAKE) install
+)
+
+set(SPEEXDSP_LIBRARIES ${CMAKE_BINARY_DIR}/external/dist/lib/libspeexdsp.a)
+include_directories(${CMAKE_BINARY_DIR}/external/dist/include)
+list(APPEND FREEDV_LINK_LIBS ${SPEEXDSP_LIBRARIES})
+list(APPEND FREEDV_STATIC_DEPS speex)
+if(USE_STATIC_CODEC2)
+    add_dependencies(codec2 speex)
+endif()
diff --git a/freedv-dev/cmake/BuildWxWidgets.cmake b/freedv-dev/cmake/BuildWxWidgets.cmake
new file mode 100644 (file)
index 0000000..901d806
--- /dev/null
@@ -0,0 +1,43 @@
+set(WXWIDGETS_TARBALL "wxWidgets-3.0.2")
+
+# If we're cross-compiling then we need to set the target host manually.
+if(MINGW AND CMAKE_CROSSCOMPILING)
+    include(cmake/MinGW.cmake)
+endif()
+
+# If not cross-compiling then use the built-in makefile, otherwise use standard configure.
+if(MINGW AND NOT CMAKE_CROSSCOMPILING)
+#    set(CONFIGURE_COMMAND "true")
+#    set(MAKE_COMMAND $(MAKE) -C build/msw -f makefile.gcc SHARED=0 UNICODE=1 BUILD=release PREFIX=${CMAKE_BINARY_DIR}/external/dist)
+    set(CONFIGURE_COMMAND ./configure --disable-shared --prefix=${CMAKE_BINARY_DIR}/external/dist)
+       set(MAKE_COMMAND $(MAKE))
+endif()
+
+if(MINGW AND CMAKE_CROSSCOMPILING)
+    set(CONFIGURE_COMMAND ./configure --build=${HOST} --host=${HOST} --target=${HOST} --disable-shared --prefix=${CMAKE_BINARY_DIR}/external/dist)
+       set(MAKE_COMMAND $(MAKE))
+endif()
+
+if(NOT MINGW)
+    set(CONFIGURE_COMMAND ./configure --host=${HOST} --target=${HOST} --disable-shared --prefix=${CMAKE_BINARY_DIR}/external/dist)
+       set(MAKE_COMMAND $(MAKE))
+endif()
+
+include(ExternalProject)
+ExternalProject_Add(wxWidgets
+    URL http://downloads.sourceforge.net/wxwindows/${WXWIDGETS_TARBALL}.tar.bz2
+    BUILD_IN_SOURCE 1
+    INSTALL_DIR external/dist
+    CONFIGURE_COMMAND ${CONFIGURE_COMMAND}
+    BUILD_COMMAND ${MAKE_COMMAND}
+    INSTALL_COMMAND $(MAKE) install
+)
+
+ExternalProject_Get_Property(wxWidgets install_dir)
+message(STATUS "wxWidgets install dir: ${install_dir}")
+if(NOT WXCONFIG)
+    set(WXCONFIG "${install_dir}/bin/wx-config")
+endif()
+if(EXISTS ${WXCONFIG})
+    set(BS_WX_DONE TRUE)
+endif()
diff --git a/freedv-dev/cmake/FindPortaudio.cmake b/freedv-dev/cmake/FindPortaudio.cmake
new file mode 100644 (file)
index 0000000..158e20e
--- /dev/null
@@ -0,0 +1,107 @@
+# - Try to find Portaudio
+# Once done this will define
+#
+#  PORTAUDIO_FOUND - system has Portaudio
+#  PORTAUDIO_INCLUDE_DIRS - the Portaudio include directory
+#  PORTAUDIO_LIBRARIES - Link these to use Portaudio
+#  PORTAUDIO_DEFINITIONS - Compiler switches required for using Portaudio
+#  PORTAUDIO_VERSION - Portaudio version
+#
+#  Copyright (c) 2006 Andreas Schneider <mail@cynapses.org>
+#
+# Redistribution and use is allowed according to the terms of the New BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+#
+
+
+if (PORTAUDIO_LIBRARIES AND PORTAUDIO_INCLUDE_DIRS)
+  # in cache already
+  set(PORTAUDIO_FOUND TRUE)
+else (PORTAUDIO_LIBRARIES AND PORTAUDIO_INCLUDE_DIRS)
+  if (NOT WIN32)
+   include(FindPkgConfig)
+   pkg_check_modules(PORTAUDIO2 portaudio-2.0)
+  endif (NOT WIN32)
+
+  if (PORTAUDIO2_FOUND)
+    set(PORTAUDIO_INCLUDE_DIRS
+      ${PORTAUDIO2_INCLUDE_DIRS}
+    )
+    if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+      set(PORTAUDIO_LIBRARIES "${PORTAUDIO2_LIBRARY_DIRS}/lib${PORTAUDIO2_LIBRARIES}.dylib")
+    else (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+      set(PORTAUDIO_LIBRARIES
+        ${PORTAUDIO2_LIBRARIES}
+      )
+    endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+    set(PORTAUDIO_VERSION
+      19
+    )
+    set(PORTAUDIO_FOUND TRUE)
+  else (PORTAUDIO2_FOUND)
+    find_path(PORTAUDIO_INCLUDE_DIR
+      NAMES
+        portaudio.h
+      PATHS
+        /usr/include
+        /usr/local/include
+        /opt/local/include
+        /sw/include
+    )
+   
+    find_library(PORTAUDIO_LIBRARY
+      NAMES
+        portaudio
+      PATHS
+        /usr/lib
+        /usr/local/lib
+        /opt/local/lib
+        /sw/lib
+    )
+   
+    find_path(PORTAUDIO_LIBRARY_DIR
+      NAMES
+        portaudio
+      PATHS
+        /usr/lib
+        /usr/local/lib
+        /opt/local/lib
+        /sw/lib
+    )
+   
+    set(PORTAUDIO_INCLUDE_DIRS
+      ${PORTAUDIO_INCLUDE_DIR}
+    )
+    set(PORTAUDIO_LIBRARIES
+      ${PORTAUDIO_LIBRARY}
+    )
+   
+    set(PORTAUDIO_LIBRARY_DIRS
+      ${PORTAUDIO_LIBRARY_DIR}
+    )
+   
+    set(PORTAUDIO_VERSION
+      18
+    )
+   
+    if (PORTAUDIO_INCLUDE_DIRS AND PORTAUDIO_LIBRARIES)
+       set(PORTAUDIO_FOUND TRUE)
+    endif (PORTAUDIO_INCLUDE_DIRS AND PORTAUDIO_LIBRARIES)
+   
+    if (PORTAUDIO_FOUND)
+      if (NOT Portaudio_FIND_QUIETLY)
+        message(STATUS "Found Portaudio: ${PORTAUDIO_LIBRARIES}")
+      endif (NOT Portaudio_FIND_QUIETLY)
+    else (PORTAUDIO_FOUND)
+      if (Portaudio_FIND_REQUIRED)
+        message(FATAL_ERROR "Could not find Portaudio")
+      endif (Portaudio_FIND_REQUIRED)
+    endif (PORTAUDIO_FOUND)
+  endif (PORTAUDIO2_FOUND)
+
+
+  # show the PORTAUDIO_INCLUDE_DIRS and PORTAUDIO_LIBRARIES variables only in the advanced view
+  mark_as_advanced(PORTAUDIO_INCLUDE_DIRS PORTAUDIO_LIBRARIES)
+
+endif (PORTAUDIO_LIBRARIES AND PORTAUDIO_INCLUDE_DIRS)
+
diff --git a/freedv-dev/cmake/GetDependencies.cmake.in b/freedv-dev/cmake/GetDependencies.cmake.in
new file mode 100644 (file)
index 0000000..93204dd
--- /dev/null
@@ -0,0 +1,25 @@
+# As this script is run in a new cmake instance, it does not have access to
+# the existing cache variables. Pass them in via the configure_file command.
+set(CMAKE_BINARY_DIR @CMAKE_BINARY_DIR@)
+set(CMAKE_SOURCE_DIR @CMAKE_SOURCE_DIR@)
+set(UNIX @UNIX@)
+set(WIN32 @WIN32@)
+set(CMAKE_CROSSCOMPILING @CMAKE_CROSSCOMPILING@)
+set(CMAKE_FIND_LIBRARY_SUFFIXES @CMAKE_FIND_LIBRARY_SUFFIXES@)
+set(CMAKE_FIND_LIBRARY_PREFIXES @CMAKE_FIND_LIBRARY_PREFIXES@)
+set(CMAKE_SYSTEM_LIBRARY_PATH @CMAKE_SYSTEM_LIBRARY_PATH@)
+set(CMAKE_FIND_ROOT_PATH @CMAKE_FIND_ROOT_PATH@)
+
+set(FREEDV_EXE ${CMAKE_BINARY_DIR}/src/freedv.exe)
+
+include(GetPrerequisites)
+get_prerequisites("${FREEDV_EXE}" _deps 1 1 "" "${CMAKE_SYSTEM_LIBRARY_PATH}")
+foreach(_runtime ${_deps})
+    message("Looking for ${_runtime}")
+    find_library(RUNTIME_${_runtime} ${_runtime})
+    message("${RUNTIME_${_runtime}}")
+    if(RUNTIME_${_runtime})
+        file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/bin"
+        TYPE EXECUTABLE FILES "${RUNTIME_${_runtime}}")
+    endif()
+endforeach()
diff --git a/freedv-dev/cmake/MinGW.cmake b/freedv-dev/cmake/MinGW.cmake
new file mode 100644 (file)
index 0000000..333c1dc
--- /dev/null
@@ -0,0 +1,8 @@
+# If we're cross-compiling then we need to set the target host manually.
+if(MINGW AND CMAKE_CROSSCOMPILING)
+    if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
+        set(HOST x86_64-w64-mingw32)
+    else()
+        set(HOST i686-w64-mingw32)
+    endif()
+endif()
diff --git a/freedv-dev/cmake/Toolchain-Ubuntu-mingw32.cmake b/freedv-dev/cmake/Toolchain-Ubuntu-mingw32.cmake
new file mode 100644 (file)
index 0000000..3507d72
--- /dev/null
@@ -0,0 +1,25 @@
+# Sample toolchain file for building for Windows from an Ubuntu Linux system.
+#
+# Typical usage:
+#    *) install cross compiler: `sudo apt-get install mingw-w64 g++-mingw-w64`
+#    *) cd build
+#    *) cmake -DCMAKE_TOOLCHAIN_FILE=~/Toolchain-Ubuntu-mingw32.cmake ..
+
+set(CMAKE_SYSTEM_NAME Windows)
+set(TOOLCHAIN_PREFIX i686-w64-mingw32)
+
+# cross compilers to use for C and C++
+set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc)
+set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
+set(CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres)
+
+# target environment on the build host system
+#   set 1st to dir with the cross compiler's C/C++ headers/libs
+set(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX})
+
+# modify default behavior of FIND_XXX() commands to
+# search for headers/libs in the target environment and
+# search for programs in the build host environment
+set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
diff --git a/freedv-dev/cmake/config.h.in b/freedv-dev/cmake/config.h.in
new file mode 100644 (file)
index 0000000..8e3ab76
--- /dev/null
@@ -0,0 +1,19 @@
+/*--------------------------------------------------------------------------
+ ** This file is autogenerated from config.h.in 
+ ** during the cmake configuration of your project. If you need to make changes
+ ** edit the original file NOT THIS FILE.
+ ** --------------------------------------------------------------------------*/
+#ifndef _CONFIGURATION_HEADER_GUARD_H_
+#define _CONFIGURATION_HEADER_GUARD_H_
+
+#define SIZEOF_INT @SIZEOF_INT@
+#cmakedefine HAVE_LIMITS_H @HAVE_LIMITS_H@
+#cmakedefine HAVE_STDINT_H @HAVE_STDINT_H@
+#cmakedefine HAVE_STDDEF_H @HAVE_STDDEF_H@
+#cmakedefine HAVE_STDLIB_H @HAVE_STDLIB_H@
+#cmakedefine HAVE_STRING_H @HAVE_STRING_H@
+#cmakedefine HAVE_FLOOR @HAVE_FLOOR@
+#cmakedefine HAVE_MEMSET @HAVE_MEMSET@
+#cmakedefine HAVE_POW @HAVE_POW@
+#cmakedefine HAVE_SQRT @HAVE_SQRT@
+#endif
diff --git a/freedv-dev/cmake/version.h.in b/freedv-dev/cmake/version.h.in
new file mode 100644 (file)
index 0000000..43b3b7a
--- /dev/null
@@ -0,0 +1,11 @@
+#ifndef FREEDV_VER_DOT_H
+#define FREEDV_VER_DOT_H 1
+
+#define FREEDV_VERSION_MAJOR @FREEDV_VERSION_MAJOR@
+#define FREEDV_VERSION_MINOR @FREEDV_VERSION_MINOR@
+#define FREEDV_VERSION_PATCH @FREEDV_VERSION_PATCH@
+#define FREEDV_VERSION_SUFFIX "@FREEDV_VERSION_SUFFIX@"
+
+#define FREEDV_VERSION "@FREEDV_VERSION_STRING@"
+
+#endif //FREEDV_VER_DOT_H
diff --git a/freedv-dev/contrib/CMakeLists.txt b/freedv-dev/contrib/CMakeLists.txt
new file mode 100644 (file)
index 0000000..3f4b7e0
--- /dev/null
@@ -0,0 +1,22 @@
+# Install icons if we're on most *nix systems.
+if(UNIX AND NOT APPLE)
+    set(ICON_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor
+        CACHE PATH "Prefix to use for installing icons.")
+    install(FILES freedv48x48.png
+        DESTINATION ${ICON_INSTALL_PREFIX}/48x48/apps
+        RENAME freedv.png)
+    install(FILES freedv64x64.png
+        DESTINATION ${ICON_INSTALL_PREFIX}/64x64/apps
+        RENAME freedv.png)
+    install(FILES freedv128x128.png
+        DESTINATION ${ICON_INSTALL_PREFIX}/128x128/apps
+        RENAME freedv.png)
+    install(FILES freedv256x256.png
+        DESTINATION ${ICON_INSTALL_PREFIX}/256x256/apps
+        RENAME freedv.png)
+
+    set(DESKTOP_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/applications
+        CACHE PATH "Location to install desktop files.")
+    install(FILES freedv.desktop
+        DESTINATION ${DESKTOP_INSTALL_DIR})
+endif(UNIX AND NOT APPLE)
diff --git a/freedv-dev/contrib/LICENSE b/freedv-dev/contrib/LICENSE
new file mode 100644 (file)
index 0000000..dc8853a
--- /dev/null
@@ -0,0 +1,393 @@
+Attribution 4.0 International
+
+=======================================================================
+
+Creative Commons Corporation ("Creative Commons") is not a law firm and
+does not provide legal services or legal advice. Distribution of
+Creative Commons public licenses does not create a lawyer-client or
+other relationship. Creative Commons makes its licenses and related
+information available on an "as-is" basis. Creative Commons gives no
+warranties regarding its licenses, any material licensed under their
+terms and conditions, or any related information. Creative Commons
+disclaims all liability for damages resulting from their use to the
+fullest extent possible.
+
+Using Creative Commons Public Licenses
+
+Creative Commons public licenses provide a standard set of terms and
+conditions that creators and other rights holders may use to share
+original works of authorship and other material subject to copyright
+and certain other rights specified in the public license below. The
+following considerations are for informational purposes only, are not
+exhaustive, and do not form part of our licenses.
+
+     Considerations for licensors: Our public licenses are
+     intended for use by those authorized to give the public
+     permission to use material in ways otherwise restricted by
+     copyright and certain other rights. Our licenses are
+     irrevocable. Licensors should read and understand the terms
+     and conditions of the license they choose before applying it.
+     Licensors should also secure all rights necessary before
+     applying our licenses so that the public can reuse the
+     material as expected. Licensors should clearly mark any
+     material not subject to the license. This includes other CC-
+     licensed material, or material used under an exception or
+     limitation to copyright. More considerations for licensors:
+       wiki.creativecommons.org/Considerations_for_licensors
+
+     Considerations for the public: By using one of our public
+     licenses, a licensor grants the public permission to use the
+     licensed material under specified terms and conditions. If
+     the licensor's permission is not necessary for any reason--for
+     example, because of any applicable exception or limitation to
+     copyright--then that use is not regulated by the license. Our
+     licenses grant only permissions under copyright and certain
+     other rights that a licensor has authority to grant. Use of
+     the licensed material may still be restricted for other
+     reasons, including because others have copyright or other
+     rights in the material. A licensor may make special requests,
+     such as asking that all changes be marked or described.
+     Although not required by our licenses, you are encouraged to
+     respect those requests where reasonable. More_considerations
+     for the public: 
+       wiki.creativecommons.org/Considerations_for_licensees
+
+=======================================================================
+
+Creative Commons Attribution 4.0 International Public License
+
+By exercising the Licensed Rights (defined below), You accept and agree
+to be bound by the terms and conditions of this Creative Commons
+Attribution 4.0 International Public License ("Public License"). To the
+extent this Public License may be interpreted as a contract, You are
+granted the Licensed Rights in consideration of Your acceptance of
+these terms and conditions, and the Licensor grants You such rights in
+consideration of benefits the Licensor receives from making the
+Licensed Material available under these terms and conditions.
+
+
+Section 1 -- Definitions.
+
+  a. Adapted Material means material subject to Copyright and Similar
+     Rights that is derived from or based upon the Licensed Material
+     and in which the Licensed Material is translated, altered,
+     arranged, transformed, or otherwise modified in a manner requiring
+     permission under the Copyright and Similar Rights held by the
+     Licensor. For purposes of this Public License, where the Licensed
+     Material is a musical work, performance, or sound recording,
+     Adapted Material is always produced where the Licensed Material is
+     synched in timed relation with a moving image.
+
+  b. Adapter's License means the license You apply to Your Copyright
+     and Similar Rights in Your contributions to Adapted Material in
+     accordance with the terms and conditions of this Public License.
+
+  c. Copyright and Similar Rights means copyright and/or similar rights
+     closely related to copyright including, without limitation,
+     performance, broadcast, sound recording, and Sui Generis Database
+     Rights, without regard to how the rights are labeled or
+     categorized. For purposes of this Public License, the rights
+     specified in Section 2(b)(1)-(2) are not Copyright and Similar
+     Rights.
+
+  d. Effective Technological Measures means those measures that, in the
+     absence of proper authority, may not be circumvented under laws
+     fulfilling obligations under Article 11 of the WIPO Copyright
+     Treaty adopted on December 20, 1996, and/or similar international
+     agreements.
+
+  e. Exceptions and Limitations means fair use, fair dealing, and/or
+     any other exception or limitation to Copyright and Similar Rights
+     that applies to Your use of the Licensed Material.
+
+  f. Licensed Material means the artistic or literary work, database,
+     or other material to which the Licensor applied this Public
+     License.
+
+  g. Licensed Rights means the rights granted to You subject to the
+     terms and conditions of this Public License, which are limited to
+     all Copyright and Similar Rights that apply to Your use of the
+     Licensed Material and that the Licensor has authority to license.
+
+  h. Licensor means the individual(s) or entity(ies) granting rights
+     under this Public License.
+
+  i. Share means to provide material to the public by any means or
+     process that requires permission under the Licensed Rights, such
+     as reproduction, public display, public performance, distribution,
+     dissemination, communication, or importation, and to make material
+     available to the public including in ways that members of the
+     public may access the material from a place and at a time
+     individually chosen by them.
+
+  j. Sui Generis Database Rights means rights other than copyright
+     resulting from Directive 96/9/EC of the European Parliament and of
+     the Council of 11 March 1996 on the legal protection of databases,
+     as amended and/or succeeded, as well as other essentially
+     equivalent rights anywhere in the world.
+
+  k. You means the individual or entity exercising the Licensed Rights
+     under this Public License. Your has a corresponding meaning.
+
+
+Section 2 -- Scope.
+
+  a. License grant.
+
+       1. Subject to the terms and conditions of this Public License,
+          the Licensor hereby grants You a worldwide, royalty-free,
+          non-sublicensable, non-exclusive, irrevocable license to
+          exercise the Licensed Rights in the Licensed Material to:
+
+            a. reproduce and Share the Licensed Material, in whole or
+               in part; and
+
+            b. produce, reproduce, and Share Adapted Material.
+
+       2. Exceptions and Limitations. For the avoidance of doubt, where
+          Exceptions and Limitations apply to Your use, this Public
+          License does not apply, and You do not need to comply with
+          its terms and conditions.
+
+       3. Term. The term of this Public License is specified in Section
+          6(a).
+
+       4. Media and formats; technical modifications allowed. The
+          Licensor authorizes You to exercise the Licensed Rights in
+          all media and formats whether now known or hereafter created,
+          and to make technical modifications necessary to do so. The
+          Licensor waives and/or agrees not to assert any right or
+          authority to forbid You from making technical modifications
+          necessary to exercise the Licensed Rights, including
+          technical modifications necessary to circumvent Effective
+          Technological Measures. For purposes of this Public License,
+          simply making modifications authorized by this Section 2(a)
+          (4) never produces Adapted Material.
+
+       5. Downstream recipients.
+
+            a. Offer from the Licensor -- Licensed Material. Every
+               recipient of the Licensed Material automatically
+               receives an offer from the Licensor to exercise the
+               Licensed Rights under the terms and conditions of this
+               Public License.
+
+            b. No downstream restrictions. You may not offer or impose
+               any additional or different terms or conditions on, or
+               apply any Effective Technological Measures to, the
+               Licensed Material if doing so restricts exercise of the
+               Licensed Rights by any recipient of the Licensed
+               Material.
+
+       6. No endorsement. Nothing in this Public License constitutes or
+          may be construed as permission to assert or imply that You
+          are, or that Your use of the Licensed Material is, connected
+          with, or sponsored, endorsed, or granted official status by,
+          the Licensor or others designated to receive attribution as
+          provided in Section 3(a)(1)(A)(i).
+
+  b. Other rights.
+
+       1. Moral rights, such as the right of integrity, are not
+          licensed under this Public License, nor are publicity,
+          privacy, and/or other similar personality rights; however, to
+          the extent possible, the Licensor waives and/or agrees not to
+          assert any such rights held by the Licensor to the limited
+          extent necessary to allow You to exercise the Licensed
+          Rights, but not otherwise.
+
+       2. Patent and trademark rights are not licensed under this
+          Public License.
+
+       3. To the extent possible, the Licensor waives any right to
+          collect royalties from You for the exercise of the Licensed
+          Rights, whether directly or through a collecting society
+          under any voluntary or waivable statutory or compulsory
+          licensing scheme. In all other cases the Licensor expressly
+          reserves any right to collect such royalties.
+
+
+Section 3 -- License Conditions.
+
+Your exercise of the Licensed Rights is expressly made subject to the
+following conditions.
+
+  a. Attribution.
+
+       1. If You Share the Licensed Material (including in modified
+          form), You must:
+
+            a. retain the following if it is supplied by the Licensor
+               with the Licensed Material:
+
+                 i. identification of the creator(s) of the Licensed
+                    Material and any others designated to receive
+                    attribution, in any reasonable manner requested by
+                    the Licensor (including by pseudonym if
+                    designated);
+
+                ii. a copyright notice;
+
+               iii. a notice that refers to this Public License;
+
+                iv. a notice that refers to the disclaimer of
+                    warranties;
+
+                 v. a URI or hyperlink to the Licensed Material to the
+                    extent reasonably practicable;
+
+            b. indicate if You modified the Licensed Material and
+               retain an indication of any previous modifications; and
+
+            c. indicate the Licensed Material is licensed under this
+               Public License, and include the text of, or the URI or
+               hyperlink to, this Public License.
+
+       2. You may satisfy the conditions in Section 3(a)(1) in any
+          reasonable manner based on the medium, means, and context in
+          which You Share the Licensed Material. For example, it may be
+          reasonable to satisfy the conditions by providing a URI or
+          hyperlink to a resource that includes the required
+          information.
+
+       3. If requested by the Licensor, You must remove any of the
+          information required by Section 3(a)(1)(A) to the extent
+          reasonably practicable.
+
+       4. If You Share Adapted Material You produce, the Adapter's
+          License You apply must not prevent recipients of the Adapted
+          Material from complying with this Public License.
+
+
+Section 4 -- Sui Generis Database Rights.
+
+Where the Licensed Rights include Sui Generis Database Rights that
+apply to Your use of the Licensed Material:
+
+  a. for the avoidance of doubt, Section 2(a)(1) grants You the right
+     to extract, reuse, reproduce, and Share all or a substantial
+     portion of the contents of the database;
+
+  b. if You include all or a substantial portion of the database
+     contents in a database in which You have Sui Generis Database
+     Rights, then the database in which You have Sui Generis Database
+     Rights (but not its individual contents) is Adapted Material; and
+
+  c. You must comply with the conditions in Section 3(a) if You Share
+     all or a substantial portion of the contents of the database.
+
+For the avoidance of doubt, this Section 4 supplements and does not
+replace Your obligations under this Public License where the Licensed
+Rights include other Copyright and Similar Rights.
+
+
+Section 5 -- Disclaimer of Warranties and Limitation of Liability.
+
+  a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
+     EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
+     AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
+     ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
+     IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
+     WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
+     PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
+     ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
+     KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
+     ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
+
+  b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
+     TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
+     NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
+     INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
+     COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
+     USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
+     ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
+     DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
+     IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
+
+  c. The disclaimer of warranties and limitation of liability provided
+     above shall be interpreted in a manner that, to the extent
+     possible, most closely approximates an absolute disclaimer and
+     waiver of all liability.
+
+
+Section 6 -- Term and Termination.
+
+  a. This Public License applies for the term of the Copyright and
+     Similar Rights licensed here. However, if You fail to comply with
+     this Public License, then Your rights under this Public License
+     terminate automatically.
+
+  b. Where Your right to use the Licensed Material has terminated under
+     Section 6(a), it reinstates:
+
+       1. automatically as of the date the violation is cured, provided
+          it is cured within 30 days of Your discovery of the
+          violation; or
+
+       2. upon express reinstatement by the Licensor.
+
+     For the avoidance of doubt, this Section 6(b) does not affect any
+     right the Licensor may have to seek remedies for Your violations
+     of this Public License.
+
+  c. For the avoidance of doubt, the Licensor may also offer the
+     Licensed Material under separate terms or conditions or stop
+     distributing the Licensed Material at any time; however, doing so
+     will not terminate this Public License.
+
+  d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
+     License.
+
+
+Section 7 -- Other Terms and Conditions.
+
+  a. The Licensor shall not be bound by any additional or different
+     terms or conditions communicated by You unless expressly agreed.
+
+  b. Any arrangements, understandings, or agreements regarding the
+     Licensed Material not stated herein are separate from and
+     independent of the terms and conditions of this Public License.
+
+
+Section 8 -- Interpretation.
+
+  a. For the avoidance of doubt, this Public License does not, and
+     shall not be interpreted to, reduce, limit, restrict, or impose
+     conditions on any use of the Licensed Material that could lawfully
+     be made without permission under this Public License.
+
+  b. To the extent possible, if any provision of this Public License is
+     deemed unenforceable, it shall be automatically reformed to the
+     minimum extent necessary to make it enforceable. If the provision
+     cannot be reformed, it shall be severed from this Public License
+     without affecting the enforceability of the remaining terms and
+     conditions.
+
+  c. No term or condition of this Public License will be waived and no
+     failure to comply consented to unless expressly agreed to by the
+     Licensor.
+
+  d. Nothing in this Public License constitutes or may be interpreted
+     as a limitation upon, or waiver of, any privileges and immunities
+     that apply to the Licensor or You, including from the legal
+     processes of any jurisdiction or authority.
+
+
+=======================================================================
+
+Creative Commons is not a party to its public licenses.
+Notwithstanding, Creative Commons may elect to apply one of its public
+licenses to material it publishes and in those instances will be
+considered the "Licensor." Except for the limited purpose of indicating
+that material is shared under a Creative Commons public license or as
+otherwise permitted by the Creative Commons policies published at
+creativecommons.org/policies, Creative Commons does not authorize the
+use of the trademark "Creative Commons" or any other trademark or logo
+of Creative Commons without its prior written consent including,
+without limitation, in connection with any unauthorized modifications
+to any of its public licenses or any other arrangements,
+understandings, or agreements concerning use of licensed material. For
+the avoidance of doubt, this paragraph does not form part of the public
+licenses.
+
+Creative Commons may be contacted at creativecommons.org.
diff --git a/freedv-dev/contrib/freedv.desktop b/freedv-dev/contrib/freedv.desktop
new file mode 100644 (file)
index 0000000..96e8293
--- /dev/null
@@ -0,0 +1,8 @@
+[Desktop Entry]
+Version=1.0
+Name=FreeDV
+Exec=freedv
+Icon=freedv
+Type=Application
+Terminal=false
+Categories=GTK;GNOME;AudioVideo;Audio;HamRadio;
diff --git a/freedv-dev/contrib/freedv.ico b/freedv-dev/contrib/freedv.ico
new file mode 100644 (file)
index 0000000..e6b9a20
Binary files /dev/null and b/freedv-dev/contrib/freedv.ico differ
diff --git a/freedv-dev/contrib/freedv.rc b/freedv-dev/contrib/freedv.rc
new file mode 100644 (file)
index 0000000..2e6655d
--- /dev/null
@@ -0,0 +1 @@
+id ICON "./freedv.ico"
diff --git a/freedv-dev/contrib/freedv128x128.png b/freedv-dev/contrib/freedv128x128.png
new file mode 100644 (file)
index 0000000..5190a77
Binary files /dev/null and b/freedv-dev/contrib/freedv128x128.png differ
diff --git a/freedv-dev/contrib/freedv256x256.png b/freedv-dev/contrib/freedv256x256.png
new file mode 100644 (file)
index 0000000..b3eb5d7
Binary files /dev/null and b/freedv-dev/contrib/freedv256x256.png differ
diff --git a/freedv-dev/contrib/freedv48x48.png b/freedv-dev/contrib/freedv48x48.png
new file mode 100644 (file)
index 0000000..bd5efc6
Binary files /dev/null and b/freedv-dev/contrib/freedv48x48.png differ
diff --git a/freedv-dev/contrib/freedv64x64.png b/freedv-dev/contrib/freedv64x64.png
new file mode 100644 (file)
index 0000000..eb89773
Binary files /dev/null and b/freedv-dev/contrib/freedv64x64.png differ
diff --git a/freedv-dev/credits.txt b/freedv-dev/credits.txt
new file mode 100644 (file)
index 0000000..431e399
--- /dev/null
@@ -0,0 +1,13 @@
+Credits (code or ideas borrowed from):
+==============================================
+Dave Witten and David Rowe (obviously)
+Mel Whitten K0PFX (material and moral support)
+Bruce Perens (cheerleader, promotion and publicity)
+Mooneer Salem KG6AOV(Mac OSX Patch)
+Soeren Straarup OZ2DAK (FreeBSD Port)
+Don Mak
+Steve Nance (K5FR)
+Joel Stanley (Hamlib prototyping) and Mark Jessop (Mac OSX) 
+James Ahlstrom (Quisk)
+FLDIGI
+All the folks on the digital voice google group...
diff --git a/freedv-dev/db/current b/freedv-dev/db/current
new file mode 100644 (file)
index 0000000..d00491f
--- /dev/null
@@ -0,0 +1 @@
+1
diff --git a/freedv-dev/db/format b/freedv-dev/db/format
new file mode 100644 (file)
index 0000000..db06890
--- /dev/null
@@ -0,0 +1,2 @@
+4
+layout sharded 1000
diff --git a/freedv-dev/db/fs-type b/freedv-dev/db/fs-type
new file mode 100644 (file)
index 0000000..4fdd953
--- /dev/null
@@ -0,0 +1 @@
+fsfs
diff --git a/freedv-dev/db/fsfs.conf b/freedv-dev/db/fsfs.conf
new file mode 100644 (file)
index 0000000..cc08ceb
--- /dev/null
@@ -0,0 +1,38 @@
+### This file controls the configuration of the FSFS filesystem.\r
+\r
+[memcached-servers]\r
+### These options name memcached servers used to cache internal FSFS\r
+### data.  See http://www.danga.com/memcached/ for more information on\r
+### memcached.  To use memcached with FSFS, run one or more memcached\r
+### servers, and specify each of them as an option like so:\r
+# first-server = 127.0.0.1:11211\r
+# remote-memcached = mymemcached.corp.example.com:11212\r
+### The option name is ignored; the value is of the form HOST:PORT.\r
+### memcached servers can be shared between multiple repositories;\r
+### however, if you do this, you *must* ensure that repositories have\r
+### distinct UUIDs and paths, or else cached data from one repository\r
+### might be used by another accidentally.  Note also that memcached has\r
+### no authentication for reads or writes, so you must ensure that your\r
+### memcached servers are only accessible by trusted users.\r
+\r
+[caches]\r
+### When a cache-related error occurs, normally Subversion ignores it\r
+### and continues, logging an error if the server is appropriately\r
+### configured (and ignoring it with file:// access).  To make\r
+### Subversion never ignore cache errors, uncomment this line.\r
+# fail-stop = true\r
+\r
+[rep-sharing]\r
+### To conserve space, the filesystem can optionally avoid storing\r
+### duplicate representations.  This comes at a slight cost in\r
+### performance, as maintaining a database of shared representations can\r
+### increase commit times.  The space savings are dependent upon the size\r
+### of the repository, the number of objects it contains and the amount of\r
+### duplication between them, usually a function of the branching and\r
+### merging process.\r
+###\r
+### The following parameter enables rep-sharing in the repository.  It can\r
+### be switched on and off at will, but for best space-saving results\r
+### should be enabled consistently over the life of the repository.\r
+### rep-sharing is enabled by default.\r
+# enable-rep-sharing = true\r
diff --git a/freedv-dev/db/min-unpacked-rev b/freedv-dev/db/min-unpacked-rev
new file mode 100644 (file)
index 0000000..573541a
--- /dev/null
@@ -0,0 +1 @@
+0
diff --git a/freedv-dev/db/rep-cache.db b/freedv-dev/db/rep-cache.db
new file mode 100644 (file)
index 0000000..63c6f0b
Binary files /dev/null and b/freedv-dev/db/rep-cache.db differ
diff --git a/freedv-dev/db/revprops/0/0 b/freedv-dev/db/revprops/0/0
new file mode 100644 (file)
index 0000000..d0b90de
--- /dev/null
@@ -0,0 +1,5 @@
+K 8
+svn:date
+V 27
+2012-08-21T18:27:59.389906Z
+END
diff --git a/freedv-dev/db/revprops/0/1 b/freedv-dev/db/revprops/0/1
new file mode 100644 (file)
index 0000000..0af71a2
--- /dev/null
@@ -0,0 +1,13 @@
+K 10
+svn:author
+V 9
+OFA-Staff
+K 8
+svn:date
+V 27
+2012-08-21T18:28:08.741468Z
+K 7
+svn:log
+V 25
+Imported folder structure
+END
diff --git a/freedv-dev/db/revs/0/0 b/freedv-dev/db/revs/0/0
new file mode 100644 (file)
index 0000000..10f5c45
--- /dev/null
@@ -0,0 +1,11 @@
+PLAIN
+END
+ENDREP
+id: 0.0.r0/17
+type: dir
+count: 0
+text: 0 0 4 4 2d2977d1c96f487abe4a1e202dd03b4e
+cpath: /
+
+
+17 107
diff --git a/freedv-dev/db/revs/0/1 b/freedv-dev/db/revs/0/1
new file mode 100644 (file)
index 0000000..fd802a9
--- /dev/null
@@ -0,0 +1,49 @@
+id: 3-1.0.r1/0
+type: dir
+count: 0
+cpath: /tags
+copyroot: 0 /
+
+id: 0-1.0.r1/62
+type: dir
+count: 0
+cpath: /trunk
+copyroot: 0 /
+
+id: 2-1.0.r1/126
+type: dir
+count: 0
+cpath: /branches
+copyroot: 0 /
+
+PLAIN
+K 8
+branches
+V 16
+dir 2-1.0.r1/126
+K 4
+tags
+V 14
+dir 3-1.0.r1/0
+K 5
+trunk
+V 15
+dir 0-1.0.r1/62
+END
+ENDREP
+id: 0.0.r1/306
+type: dir
+pred: 0.0.r0/17
+count: 1
+text: 1 194 99 99 7b6cc14dddba4e09be5255b475d1a0a8
+cpath: /
+copyroot: 0 /
+
+_0.0.t0-0 add-dir false false /trunk
+
+_2.0.t0-0 add-dir false false /branches
+
+_3.0.t0-0 add-dir false false /tags
+
+
+306 431
diff --git a/freedv-dev/db/transactions/.gitignore b/freedv-dev/db/transactions/.gitignore
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/freedv-dev/db/txn-current b/freedv-dev/db/txn-current
new file mode 100644 (file)
index 0000000..d00491f
--- /dev/null
@@ -0,0 +1 @@
+1
diff --git a/freedv-dev/db/txn-current-lock b/freedv-dev/db/txn-current-lock
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/freedv-dev/db/txn-protorevs/.gitignore b/freedv-dev/db/txn-protorevs/.gitignore
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/freedv-dev/db/uuid b/freedv-dev/db/uuid
new file mode 100644 (file)
index 0000000..0f36297
--- /dev/null
@@ -0,0 +1 @@
+a56d66ce-6468-4744-9be7-52ce95ca47a4
diff --git a/freedv-dev/db/write-lock b/freedv-dev/db/write-lock
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/freedv-dev/src/CMakeLists.txt b/freedv-dev/src/CMakeLists.txt
new file mode 100644 (file)
index 0000000..44ccfe7
--- /dev/null
@@ -0,0 +1,44 @@
+set(FREEDV_SOURCES
+    dlg_audiooptions.cpp
+    dlg_filter.cpp
+    dlg_options.cpp
+    dlg_ptt.cpp
+    fdmdv2_main.cpp
+    fdmdv2_pa_wrapper.cpp
+    fdmdv2_plot.cpp
+    fdmdv2_plot_scalar.cpp
+    fdmdv2_plot_scatter.cpp
+    fdmdv2_plot_spectrum.cpp
+    fdmdv2_plot_waterfall.cpp
+    hamlib.cpp
+    topFrame.cpp
+    sox_biquad.c
+    comp.h
+    dlg_audiooptions.h
+    dlg_filter.h
+    dlg_options.h
+    dlg_ptt.h
+    fdmdv2_defines.h
+    fdmdv2_main.h
+    fdmdv2_pa_wrapper.h
+    fdmdv2_plot.h
+    fdmdv2_plot_scalar.h
+    fdmdv2_plot_scatter.h
+    fdmdv2_plot_spectrum.h
+    fdmdv2_plot_waterfall.h
+    hamlib.h
+    sox_biquad.h
+    sox.h
+    topFrame.h
+    version.h
+)
+
+# WIN32 is needed for Windows GUI apps and is ignored for UNIX like systems.
+add_executable(freedv WIN32 ${FREEDV_SOURCES} ${RES_FILES})
+target_link_libraries(freedv ${FREEDV_LINK_LIBS})
+include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
+if(FREEDV_STATIC_DEPS)
+    add_dependencies(freedv ${FREEDV_STATIC_DEPS})
+endif(FREEDV_STATIC_DEPS)
+install(TARGETS freedv
+    RUNTIME DESTINATION bin)
diff --git a/freedv-dev/src/Makefile.win32 b/freedv-dev/src/Makefile.win32
new file mode 100644 (file)
index 0000000..932e851
--- /dev/null
@@ -0,0 +1,52 @@
+# src/Makefile.win32
+# David Rowe 26 Oct 2012
+#
+# Makefile for Win32 on msys/Mingw to help David R get up to speed
+#
+# $ make -f Makefile.Win32
+
+CODEC2_PATH=$(HOME)/codec2-dev
+INCLUDE_PATH=/usr/local/include
+
+WX_CONFIG=wx-config
+WX_CPPFLAGS = $(shell $(WX_CONFIG) --cxxflags) -D__WXDEBUG__
+WX_LIBS = $(shell $(WX_CONFIG) --libs core, base, aui, adv, net)
+SVN_REVISION=$(shell svnversion)
+CODEC2_INC=$(CODEC2_PATH)/src 
+CODEC2_LIB=$(CODEC2_PATH)/build_win32/src/
+
+CPP_FLAGS = -D_NO_AUTOTOOLS_ -I$(INCLUDE_PATH) $(WX_CPPFLAGS) -I$(CODEC2_INC) -I../extern/include -I. -g -Wall -DSVN_REVISION=\"$(SVN_REVISION)\"
+LIBS = $(WX_LIBS) -L$(CODEC2_LIB) -lcodec2 -lm -lportaudiocpp -lportaudio -lpthread -lsndfile -lsamplerate -lhamlib -lsox -lspeexdsp
+
+OBJS = topFrame.o \
+fdmdv2_main.o \
+fdmdv2_plot.o \
+fdmdv2_plot_scalar.o \
+fdmdv2_plot_scatter.o \
+fdmdv2_plot_spectrum.o \
+fdmdv2_plot_waterfall.o \
+fdmdv2_pa_wrapper.o \
+dlg_audiooptions.o \
+dlg_ptt.o \
+dlg_options.o \
+dlg_filter.o \
+sox_biquad.o \
+hamlib.o \
+../../codec2-dev/src/golay23.o
+
+HDRS = version.h dlg_audiooptions.h dlg_ptt.h dlg_filter.h fdmdv2_main.h fdmdv2_defines.h fdmdv2_plot.h fdmdv2_plot_scalar.h fdmdv2_plot_waterfall.h fdmdv2_plot_scatter.h fdmdv2_plot_spectrum.h fdmdv2_pa_wrapper.h topFrame.h dlg_audiooptions.h topFrame.h varicode.h ../../codec2-dev/src/golay23.h hamlib.h
+
+all: freedv
+
+freedv: $(OBJS) 
+       g++ -o freedv $(OBJS) $(CPP_FLAGS) $(LIBS)
+
+%.o: %.cpp $(HDRS) Makefile.win32
+       g++ $(CPP_FLAGS) -c $< -o $@
+
+%.o: %.c $(HDRS) Makefile.win32
+       gcc $(CPP_FLAGS) -c $< -o $@
+
+clean:
+       rm -f *.o fdmdv2
+
diff --git a/freedv-dev/src/comp.h b/freedv-dev/src/comp.h
new file mode 100644 (file)
index 0000000..a3a1bd9
--- /dev/null
@@ -0,0 +1,39 @@
+/*---------------------------------------------------------------------------*\
+
+  FILE........: comp.h
+  AUTHOR......: David Rowe
+  DATE CREATED: 24/08/09
+
+  Complex number definition.
+
+\*---------------------------------------------------------------------------*/
+
+/*
+  Copyright (C) 2009 David Rowe
+
+  All rights reserved.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU Lesser 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 Lesser General Public License
+  along with this program; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef __COMP__
+#define __COMP__
+
+/* Complex number */
+
+typedef struct
+{
+    float real;
+    float imag;
+} COMP;
+
+#endif
diff --git a/freedv-dev/src/dlg_audiooptions.cpp b/freedv-dev/src/dlg_audiooptions.cpp
new file mode 100644 (file)
index 0000000..7d23a08
--- /dev/null
@@ -0,0 +1,1264 @@
+//=========================================================================
+// Name:            AudioOptsDialog.cpp
+// Purpose:         Implements an Audio options selection dialog.
+//
+// Authors:         David Rowe, David Witten
+// License:
+//
+//  All rights reserved.
+//
+//  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 <http://www.gnu.org/licenses/>.
+//
+//=========================================================================
+#include "fdmdv2_main.h"
+#include "dlg_audiooptions.h"
+
+// constants for test waveform plots
+
+#define TEST_WAVEFORM_X          180
+#define TEST_WAVEFORM_Y          180
+#define TEST_WAVEFORM_PLOT_TIME  2.0
+#define TEST_WAVEFORM_PLOT_FS    400
+#define TEST_BUF_SIZE           1024
+#define TEST_FS                 48000.0
+#define TEST_DT                 0.1      // time between plot updates in seconds
+#define TEST_WAVEFORM_PLOT_BUF  ((int)(DT*400))
+
+void AudioOptsDialog::Pa_Init(void)
+{
+    m_isPaInitialized = false;
+
+    if((pa_err = Pa_Initialize()) == paNoError)
+    {
+        m_isPaInitialized = true;
+    }
+    else
+    {
+        wxMessageBox(wxT("Port Audio failed to initialize"), wxT("Pa_Initialize"), wxOK);
+        return;
+    }
+}
+
+
+void AudioOptsDialog::buildTestControls(PlotScalar **plotScalar, wxButton **btnTest, 
+                                        wxPanel *parentPanel, wxBoxSizer *bSizer, wxString buttonLabel)
+{
+    wxBoxSizer* bSizer1 = new wxBoxSizer(wxVERTICAL);
+
+    wxPanel *panel = new wxPanel(parentPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0);
+    *plotScalar = new PlotScalar((wxFrame*) panel, 1, TEST_WAVEFORM_PLOT_TIME, 1.0/TEST_WAVEFORM_PLOT_FS, -1, 1, 1, 0.2, "", 1);
+    (*plotScalar)->SetClientSize(wxSize(TEST_WAVEFORM_X,TEST_WAVEFORM_Y));
+    bSizer1->Add(panel, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 8);
+
+    *btnTest = new wxButton(parentPanel, wxID_ANY, buttonLabel, wxDefaultPosition, wxDefaultSize);
+    bSizer1->Add(*btnTest, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 0);
+
+    bSizer->Add(bSizer1, 0, wxALIGN_CENTER_HORIZONTAL |wxALIGN_CENTER_VERTICAL );
+}
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// AudioOptsDialog()
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+AudioOptsDialog::AudioOptsDialog(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style)
+{
+    this->SetSizeHints(wxSize(850, 600), wxDefaultSize);
+
+    Pa_Init();
+
+    wxBoxSizer* mainSizer;
+    mainSizer = new wxBoxSizer(wxVERTICAL);
+    m_panel1 = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
+    wxBoxSizer* bSizer4;
+    bSizer4 = new wxBoxSizer(wxVERTICAL);
+    m_notebook1 = new wxNotebook(m_panel1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxNB_BOTTOM);
+    m_panelRx = new wxPanel(m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
+    wxBoxSizer* bSizer20;
+    bSizer20 = new wxBoxSizer(wxVERTICAL);
+    wxGridSizer* gSizer4;
+    gSizer4 = new wxGridSizer(2, 1, 0, 0);
+
+    // Rx In -----------------------------------------------------------------------
+
+    wxStaticBoxSizer* sbSizer2;
+    sbSizer2 = new wxStaticBoxSizer(new wxStaticBox(m_panelRx, wxID_ANY, _("From Radio")), wxHORIZONTAL);
+
+    wxBoxSizer* bSizer811a = new wxBoxSizer(wxVERTICAL);
+
+    m_listCtrlRxInDevices = new wxListCtrl(m_panelRx, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VRULES);
+    bSizer811a->Add(m_listCtrlRxInDevices, 1, wxALL|wxEXPAND, 1);
+
+    wxBoxSizer* bSizer811;
+    bSizer811 = new wxBoxSizer(wxHORIZONTAL);
+    m_staticText51 = new wxStaticText(m_panelRx, wxID_ANY, _("Device:"), wxDefaultPosition, wxDefaultSize, 0);
+    m_staticText51->Wrap(-1);
+    bSizer811->Add(m_staticText51, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5);
+    m_textCtrlRxIn = new wxTextCtrl(m_panelRx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
+    bSizer811->Add(m_textCtrlRxIn, 1, wxALIGN_CENTER_VERTICAL|wxALL, 1);
+    m_staticText6 = new wxStaticText(m_panelRx, wxID_ANY, _("Sample Rate:"), wxDefaultPosition, wxDefaultSize, 0);
+    m_staticText6->Wrap(-1);
+    bSizer811->Add(m_staticText6, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5);
+    m_cbSampleRateRxIn = new wxComboBox(m_panelRx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(90,-1), 0, NULL, wxCB_DROPDOWN);
+    bSizer811->Add(m_cbSampleRateRxIn, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1);
+
+    bSizer811a->Add(bSizer811, 0, wxEXPAND, 5);
+
+    sbSizer2->Add(bSizer811a, 1, wxEXPAND, 2);
+    buildTestControls(&m_plotScalarRxIn, &m_btnRxInTest, m_panelRx, sbSizer2, _("Rec 2s"));
+
+    gSizer4->Add(sbSizer2, 1, wxEXPAND, 5);
+
+    // Rx Out -----------------------------------------------------------------------
+
+    wxStaticBoxSizer* sbSizer3;
+    sbSizer3 = new wxStaticBoxSizer(new wxStaticBox(m_panelRx, wxID_ANY, _("To Speaker/Headphones")), wxHORIZONTAL);
+
+    wxBoxSizer* bSizer81a = new wxBoxSizer(wxVERTICAL);
+
+    m_listCtrlRxOutDevices = new wxListCtrl(m_panelRx, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VRULES);
+    bSizer81a->Add(m_listCtrlRxOutDevices, 1, wxALL|wxEXPAND, 1);
+
+    wxBoxSizer* bSizer81;
+    bSizer81 = new wxBoxSizer(wxHORIZONTAL);
+    m_staticText9 = new wxStaticText(m_panelRx, wxID_ANY, _("Device:"), wxDefaultPosition, wxDefaultSize, 0);
+    m_staticText9->Wrap(-1);
+    bSizer81->Add(m_staticText9, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
+    m_textCtrlRxOut = new wxTextCtrl(m_panelRx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
+    bSizer81->Add(m_textCtrlRxOut, 1, wxALIGN_CENTER_VERTICAL|wxALL, 1);
+    m_staticText10 = new wxStaticText(m_panelRx, wxID_ANY, _("Sample Rate:"), wxDefaultPosition, wxDefaultSize, 0);
+    m_staticText10->Wrap(-1);
+    bSizer81->Add(m_staticText10, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5);
+    m_cbSampleRateRxOut = new wxComboBox(m_panelRx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(90,-1), 0, NULL, wxCB_DROPDOWN);
+    bSizer81->Add(m_cbSampleRateRxOut, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1);
+
+    bSizer81a->Add(bSizer81, 0, wxEXPAND, 5);
+
+    sbSizer3->Add(bSizer81a, 1, wxEXPAND, 2);
+    buildTestControls(&m_plotScalarRxOut, &m_btnRxOutTest, m_panelRx, sbSizer3, _("Play 2s"));
+    gSizer4->Add(sbSizer3, 1, wxEXPAND, 2);
+    bSizer20->Add(gSizer4, 1, wxEXPAND, 1);
+    m_panelRx->SetSizer(bSizer20);
+    m_panelRx->Layout();
+    bSizer20->Fit(m_panelRx);
+    m_notebook1->AddPage(m_panelRx, _("Receive"), true);
+
+    // Tx Tab -------------------------------------------------------------------------------
+
+    m_panelTx = new wxPanel(m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
+    wxBoxSizer* bSizer18;
+    bSizer18 = new wxBoxSizer(wxVERTICAL);
+    wxGridSizer* gSizer2;
+    gSizer2 = new wxGridSizer(2, 1, 0, 0);
+
+    // Tx In ----------------------------------------------------------------------------------
+
+    wxStaticBoxSizer* sbSizer22;
+    sbSizer22 = new wxStaticBoxSizer(new wxStaticBox(m_panelTx, wxID_ANY, _("From Microphone")), wxHORIZONTAL);
+
+    wxBoxSizer* bSizer83a = new wxBoxSizer(wxVERTICAL);
+
+    m_listCtrlTxInDevices = new wxListCtrl(m_panelTx, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VRULES);
+    bSizer83a->Add(m_listCtrlTxInDevices, 1, wxALL|wxEXPAND, 1);
+    wxBoxSizer* bSizer83;
+    bSizer83 = new wxBoxSizer(wxHORIZONTAL);
+    m_staticText12 = new wxStaticText(m_panelTx, wxID_ANY, _("Device:"), wxDefaultPosition, wxDefaultSize, 0);
+    m_staticText12->Wrap(-1);
+    bSizer83->Add(m_staticText12, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5);
+    m_textCtrlTxIn = new wxTextCtrl(m_panelTx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
+    bSizer83->Add(m_textCtrlTxIn, 1, wxALIGN_CENTER_VERTICAL|wxALL, 1);
+    m_staticText11 = new wxStaticText(m_panelTx, wxID_ANY, _("Sample Rate:"), wxDefaultPosition, wxDefaultSize, 0);
+    m_staticText11->Wrap(-1);
+    bSizer83->Add(m_staticText11, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5);
+    m_cbSampleRateTxIn = new wxComboBox(m_panelTx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(90,-1), 0, NULL, wxCB_DROPDOWN);
+    bSizer83->Add(m_cbSampleRateTxIn, 0, wxALL, 1);
+
+    bSizer83a->Add(bSizer83, 0, wxEXPAND, 5);
+
+    sbSizer22->Add(bSizer83a, 1, wxEXPAND, 2);
+    buildTestControls(&m_plotScalarTxIn, &m_btnTxInTest, m_panelTx, sbSizer22, _("Rec 2s"));
+
+    gSizer2->Add(sbSizer22, 1, wxEXPAND, 5);
+
+    // Tx Out ----------------------------------------------------------------------------------
+
+    wxStaticBoxSizer* sbSizer21;
+    sbSizer21 = new wxStaticBoxSizer(new wxStaticBox(m_panelTx, wxID_ANY, _("To Radio")), wxHORIZONTAL);
+
+    wxBoxSizer* bSizer82a = new wxBoxSizer(wxVERTICAL);
+
+    m_listCtrlTxOutDevices = new wxListCtrl(m_panelTx, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VRULES);
+    bSizer82a->Add(m_listCtrlTxOutDevices, 1, wxALL|wxEXPAND, 2);
+    wxBoxSizer* bSizer82;
+    bSizer82 = new wxBoxSizer(wxHORIZONTAL);
+    m_staticText81 = new wxStaticText(m_panelTx, wxID_ANY, _("Device:"), wxDefaultPosition, wxDefaultSize, 0);
+    m_staticText81->Wrap(-1);
+    bSizer82->Add(m_staticText81, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
+    m_textCtrlTxOut = new wxTextCtrl(m_panelTx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
+    bSizer82->Add(m_textCtrlTxOut, 1, wxALIGN_CENTER_VERTICAL|wxALL, 1);
+    m_staticText71 = new wxStaticText(m_panelTx, wxID_ANY, _("Sample Rate:"), wxDefaultPosition, wxDefaultSize, 0);
+    m_staticText71->Wrap(-1);
+    bSizer82->Add(m_staticText71, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5);
+    m_cbSampleRateTxOut = new wxComboBox(m_panelTx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(90,-1), 0, NULL, wxCB_DROPDOWN);
+    bSizer82->Add(m_cbSampleRateTxOut, 0, wxALL, 1);
+
+    bSizer82a->Add(bSizer82, 0, wxEXPAND, 5);
+
+    sbSizer21->Add(bSizer82a, 1, wxEXPAND, 2);
+    buildTestControls(&m_plotScalarTxOut, &m_btnTxOutTest, m_panelTx, sbSizer21, _("Play 2s"));
+
+    gSizer2->Add(sbSizer21, 1, wxEXPAND, 5);
+    bSizer18->Add(gSizer2, 1, wxEXPAND, 1);
+    m_panelTx->SetSizer(bSizer18);
+    m_panelTx->Layout();
+    bSizer18->Fit(m_panelTx);
+    m_notebook1->AddPage(m_panelTx, _("Transmit"), false);
+
+    // API Tab -------------------------------------------------------------------
+
+    m_panelAPI = new wxPanel(m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
+    wxBoxSizer* bSizer12;
+    bSizer12 = new wxBoxSizer(wxHORIZONTAL);
+    wxGridSizer* gSizer31;
+    gSizer31 = new wxGridSizer(2, 1, 0, 0);
+    wxStaticBoxSizer* sbSizer1;
+    sbSizer1 = new wxStaticBoxSizer(new wxStaticBox(m_panelAPI, wxID_ANY, _("PortAudio")), wxVERTICAL);
+
+    wxGridSizer* gSizer3;
+    gSizer3 = new wxGridSizer(4, 2, 0, 0);
+
+    m_staticText7 = new wxStaticText(m_panelAPI, wxID_ANY, _("PortAudio Version String:"), wxDefaultPosition, wxDefaultSize, 0);
+    m_staticText7->Wrap(-1);
+    gSizer3->Add(m_staticText7, 1, wxALIGN_RIGHT|wxALL|wxALIGN_CENTER_VERTICAL, 10);
+    m_textStringVer = new wxStaticText(m_panelAPI, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
+    gSizer3->Add(m_textStringVer, 1, wxALIGN_LEFT|wxALL|wxALIGN_CENTER_VERTICAL, 10);
+
+    m_staticText8 = new wxStaticText(m_panelAPI, wxID_ANY, _("PortAudio Int Version:"), wxDefaultPosition, wxDefaultSize, 0);
+    m_staticText8->Wrap(-1);
+    gSizer3->Add(m_staticText8, 1, wxALIGN_RIGHT|wxALL|wxALIGN_CENTER_VERTICAL, 10);
+    m_textIntVer = new wxStaticText(m_panelAPI, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(45,-1), 0);
+    gSizer3->Add(m_textIntVer, 1, wxALIGN_LEFT|wxALL|wxALIGN_CENTER_VERTICAL, 10);
+
+    m_staticText5 = new wxStaticText(m_panelAPI, wxID_ANY, _("Device Count:"), wxDefaultPosition, wxDefaultSize, 0);
+    m_staticText5->Wrap(-1);
+    gSizer3->Add(m_staticText5, 1, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 10);
+    m_textCDevCount = new wxStaticText(m_panelAPI, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(45,-1), 0);
+    gSizer3->Add(m_textCDevCount, 1, wxALIGN_LEFT|wxALL|wxALIGN_CENTER_VERTICAL, 10);
+
+    m_staticText4 = new wxStaticText(m_panelAPI, wxID_ANY, _("API Count:"), wxDefaultPosition, wxDefaultSize, 0);
+    m_staticText4->Wrap(-1);
+    gSizer3->Add(m_staticText4, 1, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 10);
+    m_textAPICount = new wxStaticText(m_panelAPI, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(45,-1), 0);
+    m_textAPICount->SetMaxSize(wxSize(45,-1));
+    gSizer3->Add(m_textAPICount, 1, wxALIGN_LEFT|wxALL|wxALIGN_CENTER_VERTICAL, 10);
+
+    sbSizer1->Add(gSizer3, 1, wxEXPAND, 2);
+    gSizer31->Add(sbSizer1, 1, wxEXPAND, 2);
+    wxStaticBoxSizer* sbSizer6;
+    sbSizer6 = new wxStaticBoxSizer(new wxStaticBox(m_panelAPI, wxID_ANY, _("Other")), wxVERTICAL);
+    gSizer31->Add(sbSizer6, 1, wxEXPAND, 5);
+    bSizer12->Add(gSizer31, 1, wxEXPAND, 5);
+    m_panelAPI->SetSizer(bSizer12);
+    m_panelAPI->Layout();
+    bSizer12->Fit(m_panelAPI);
+    m_notebook1->AddPage(m_panelAPI, _("API Info"), false);
+    bSizer4->Add(m_notebook1, 1, wxEXPAND | wxALL, 0);
+    m_panel1->SetSizer(bSizer4);
+    m_panel1->Layout();
+    bSizer4->Fit(m_panel1);
+    mainSizer->Add(m_panel1, 1, wxEXPAND | wxALL, 1);
+
+    wxBoxSizer* bSizer6;
+    bSizer6 = new wxBoxSizer(wxHORIZONTAL);
+    m_btnRefresh = new wxButton(this, wxID_ANY, _("Refresh"), wxDefaultPosition, wxDefaultSize, 0);
+    bSizer6->Add(m_btnRefresh, 0, wxALIGN_CENTER|wxALL, 2);
+
+    m_sdbSizer1 = new wxStdDialogButtonSizer();
+
+    m_sdbSizer1OK = new wxButton(this, wxID_OK);
+    m_sdbSizer1->AddButton(m_sdbSizer1OK);
+
+    m_sdbSizer1Cancel = new wxButton(this, wxID_CANCEL);
+    m_sdbSizer1->AddButton(m_sdbSizer1Cancel);
+
+    m_sdbSizer1Apply = new wxButton(this, wxID_APPLY);
+    m_sdbSizer1->AddButton(m_sdbSizer1Apply);
+
+    m_sdbSizer1->Realize();
+
+    bSizer6->Add(m_sdbSizer1, 1, wxALIGN_CENTER_VERTICAL, 2);
+    mainSizer->Add(bSizer6, 0, wxEXPAND, 2);
+    this->SetSizer(mainSizer);
+    this->Layout();
+    this->Centre(wxBOTH);
+//    this->Centre(wxBOTH);
+
+    m_notebook1->SetSelection(0);
+
+    showAPIInfo();
+    m_RxInDevices.m_listDevices   = m_listCtrlRxInDevices;
+    m_RxInDevices.direction       = AUDIO_IN;
+    m_RxInDevices.m_textDevice    = m_textCtrlRxIn;
+    m_RxInDevices.m_cbSampleRate  = m_cbSampleRateRxIn;
+
+    m_RxOutDevices.m_listDevices  = m_listCtrlRxOutDevices;
+    m_RxOutDevices.direction      = AUDIO_OUT;
+    m_RxOutDevices.m_textDevice   = m_textCtrlRxOut;
+    m_RxOutDevices.m_cbSampleRate = m_cbSampleRateRxOut;
+
+    m_TxInDevices.m_listDevices   = m_listCtrlTxInDevices;
+    m_TxInDevices.direction       = AUDIO_IN;
+    m_TxInDevices.m_textDevice    = m_textCtrlTxIn;
+    m_TxInDevices.m_cbSampleRate  = m_cbSampleRateTxIn;
+
+    m_TxOutDevices.m_listDevices  = m_listCtrlTxOutDevices;
+    m_TxOutDevices.direction      = AUDIO_OUT;
+    m_TxOutDevices.m_textDevice   = m_textCtrlTxOut;
+    m_TxOutDevices.m_cbSampleRate = m_cbSampleRateTxOut;
+
+    populateParams(m_RxInDevices);
+    populateParams(m_RxOutDevices);
+    populateParams(m_TxInDevices);
+    populateParams(m_TxOutDevices);
+
+    m_listCtrlRxInDevices->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( AudioOptsDialog::OnRxInDeviceSelect ), NULL, this );
+    m_listCtrlRxOutDevices->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( AudioOptsDialog::OnRxOutDeviceSelect ), NULL, this );
+    m_listCtrlTxInDevices->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( AudioOptsDialog::OnTxInDeviceSelect ), NULL, this );
+    m_listCtrlTxOutDevices->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( AudioOptsDialog::OnTxOutDeviceSelect ), NULL, this );
+
+    // wire up test buttons
+    m_btnRxInTest->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnRxInTest ), NULL, this );
+    m_btnRxOutTest->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnRxOutTest ), NULL, this );
+    m_btnTxInTest->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnTxInTest ), NULL, this );
+    m_btnTxOutTest->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnTxOutTest ), NULL, this );
+
+    m_btnRefresh->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnRefreshClick ), NULL, this );
+    m_sdbSizer1Apply->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnApplyAudioParameters ), NULL, this );
+    m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnCancelAudioParameters ), NULL, this );
+    m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnOkAudioParameters ), NULL, this );
+/*
+        void OnClose( wxCloseEvent& event ) { event.Skip(); }
+        void OnHibernate( wxActivateEvent& event ) { event.Skip(); }
+        void OnIconize( wxIconizeEvent& event ) { event.Skip(); }
+        void OnInitDialog( wxInitDialogEvent& event ) { event.Skip(); }
+*/
+//    this->Connect(wxEVT_CLOSE_WINDOW, wxCloseEventHandler(AudioOptsDialog::OnClose));
+    this->Connect(wxEVT_HIBERNATE, wxActivateEventHandler(AudioOptsDialog::OnHibernate));
+    this->Connect(wxEVT_ICONIZE, wxIconizeEventHandler(AudioOptsDialog::OnIconize));
+    this->Connect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(AudioOptsDialog::OnInitDialog));
+}
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// ~AudioOptsDialog()
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+AudioOptsDialog::~AudioOptsDialog()
+{
+    Pa_Terminate();
+
+    // Disconnect Events
+    this->Disconnect(wxEVT_HIBERNATE, wxActivateEventHandler(AudioOptsDialog::OnHibernate));
+    this->Disconnect(wxEVT_ICONIZE, wxIconizeEventHandler(AudioOptsDialog::OnIconize));
+    this->Disconnect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(AudioOptsDialog::OnInitDialog));
+
+    m_listCtrlRxInDevices->Disconnect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(AudioOptsDialog::OnRxInDeviceSelect), NULL, this);
+    m_listCtrlRxOutDevices->Disconnect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(AudioOptsDialog::OnRxOutDeviceSelect), NULL, this);
+    m_listCtrlTxInDevices->Disconnect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(AudioOptsDialog::OnTxInDeviceSelect), NULL, this);
+    m_listCtrlTxOutDevices->Disconnect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(AudioOptsDialog::OnTxOutDeviceSelect), NULL, this);
+
+    m_btnRxInTest->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnRxInTest ), NULL, this );
+    m_btnRxOutTest->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnRxOutTest ), NULL, this );
+    m_btnTxInTest->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnTxInTest ), NULL, this );
+    m_btnTxOutTest->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnTxOutTest ), NULL, this );
+
+    m_btnRefresh->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AudioOptsDialog::OnRefreshClick), NULL, this);
+    m_sdbSizer1Apply->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AudioOptsDialog::OnApplyAudioParameters), NULL, this);
+    m_sdbSizer1Cancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AudioOptsDialog::OnCancelAudioParameters), NULL, this);
+    m_sdbSizer1OK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AudioOptsDialog::OnOkAudioParameters), NULL, this);
+
+}
+
+//-------------------------------------------------------------------------
+// OnInitDialog()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnInitDialog( wxInitDialogEvent& event )
+{
+    ExchangeData(EXCHANGE_DATA_IN);
+}
+
+//-------------------------------------------------------------------------
+// OnInitDialog()
+//
+// helper function to look up name of devNum, and if it exists write
+// name to textCtrl.  Used to trap dissapearing devices.
+//-------------------------------------------------------------------------
+int AudioOptsDialog::setTextCtrlIfDevNumValid(wxTextCtrl *textCtrl, wxListCtrl *listCtrl, int devNum)
+{
+    int i, aDevNum, found_devNum;
+
+    // ignore last list entry as it is the "none" entry
+
+    found_devNum = 0;
+    for(i=0; i<listCtrl->GetItemCount()-1; i++) {
+        aDevNum = wxAtoi(listCtrl->GetItemText(i, 1));
+        //printf("aDevNum: %d devNum: %d\n", aDevNum, devNum);
+        if (aDevNum == devNum) {
+            found_devNum = 1;
+            textCtrl->SetValue(listCtrl->GetItemText(i, 0) + " (" + wxString::Format(wxT("%i"),devNum) + ")");
+            printf("setting focus of %d\n", i);
+            listCtrl->SetItemState(i, wxLIST_STATE_FOCUSED, wxLIST_STATE_FOCUSED);
+        }
+    }
+
+    if (found_devNum) 
+        return devNum;
+    else {
+        textCtrl->SetValue("none");
+        return -1;
+    }
+}
+
+//-------------------------------------------------------------------------
+// ExchangeData()
+//-------------------------------------------------------------------------
+int AudioOptsDialog::ExchangeData(int inout)
+{
+    if(inout == EXCHANGE_DATA_IN)
+    {
+        // Map sound card device numbers to tx/rx device numbers depending
+        // on number of sound cards in use
+
+        printf("EXCHANGE_DATA_IN:\n");
+        printf("  g_nSoundCards: %d\n", g_nSoundCards);
+        printf("  g_soundCard1InDeviceNum: %d\n", g_soundCard1InDeviceNum);
+        printf("  g_soundCard1OutDeviceNum: %d\n", g_soundCard1OutDeviceNum);
+        printf("  g_soundCard1SampleRate: %d\n", g_soundCard1SampleRate);
+        printf("  g_soundCard2InDeviceNum: %d\n", g_soundCard2InDeviceNum);
+        printf("  g_soundCard2OutDeviceNum: %d\n", g_soundCard2OutDeviceNum);
+        printf("  g_soundCard2SampleRate: %d\n", g_soundCard2SampleRate);
+
+        if (g_nSoundCards == 0) {
+            m_textCtrlRxIn ->SetValue("none"); rxInAudioDeviceNum  = -1;
+            m_textCtrlRxOut->SetValue("none"); rxOutAudioDeviceNum = -1;
+            m_textCtrlTxIn ->SetValue("none"); txInAudioDeviceNum  = -1;
+            m_textCtrlTxOut->SetValue("none"); txOutAudioDeviceNum = -1;           
+        }
+
+        if (g_nSoundCards == 1) {
+            rxInAudioDeviceNum  = setTextCtrlIfDevNumValid(m_textCtrlRxIn, 
+                                                           m_listCtrlRxInDevices, 
+                                                           g_soundCard1InDeviceNum);
+
+            rxOutAudioDeviceNum = setTextCtrlIfDevNumValid(m_textCtrlRxOut, 
+                                                           m_listCtrlRxOutDevices, 
+                                                           g_soundCard1OutDeviceNum);
+
+            if ((rxInAudioDeviceNum != -1) && (rxInAudioDeviceNum != -1)) {
+                m_cbSampleRateRxIn->SetValue(wxString::Format(wxT("%i"),g_soundCard1SampleRate));
+                m_cbSampleRateRxOut->SetValue(wxString::Format(wxT("%i"),g_soundCard1SampleRate));
+            }
+
+            m_textCtrlTxIn ->SetValue("none"); txInAudioDeviceNum  = -1;
+            m_textCtrlTxOut->SetValue("none"); txOutAudioDeviceNum = -1;           
+        }
+
+        if (g_nSoundCards == 2) {
+            rxInAudioDeviceNum  = setTextCtrlIfDevNumValid(m_textCtrlRxIn, 
+                                                           m_listCtrlRxInDevices, 
+                                                           g_soundCard1InDeviceNum);
+
+            rxOutAudioDeviceNum = setTextCtrlIfDevNumValid(m_textCtrlRxOut, 
+                                                           m_listCtrlRxOutDevices, 
+                                                           g_soundCard2OutDeviceNum);
+
+            txInAudioDeviceNum  = setTextCtrlIfDevNumValid(m_textCtrlTxIn, 
+                                                           m_listCtrlTxInDevices, 
+                                                           g_soundCard2InDeviceNum);
+
+            txOutAudioDeviceNum = setTextCtrlIfDevNumValid(m_textCtrlTxOut, 
+                                                           m_listCtrlTxOutDevices, 
+                                                           g_soundCard1OutDeviceNum);
+
+            if ((rxInAudioDeviceNum != -1) && (txOutAudioDeviceNum != -1)) {
+                m_cbSampleRateRxIn->SetValue(wxString::Format(wxT("%i"),g_soundCard1SampleRate));
+                m_cbSampleRateTxOut->SetValue(wxString::Format(wxT("%i"),g_soundCard1SampleRate));
+            }
+
+            if ((txInAudioDeviceNum != -1) && (rxOutAudioDeviceNum != -1)) {
+                m_cbSampleRateTxIn->SetValue(wxString::Format(wxT("%i"),g_soundCard2SampleRate));
+                m_cbSampleRateRxOut->SetValue(wxString::Format(wxT("%i"),g_soundCard2SampleRate));
+            }
+        }
+        printf("  rxInAudioDeviceNum: %d\n  rxOutAudioDeviceNum: %d\n  txInAudioDeviceNum: %d\n  txOutAudioDeviceNum: %d\n",
+               rxInAudioDeviceNum, rxOutAudioDeviceNum, txInAudioDeviceNum, txOutAudioDeviceNum);
+    }
+
+    if(inout == EXCHANGE_DATA_OUT)
+    {
+        int valid_one_card_config = 0;
+        int valid_two_card_config = 0;
+        wxString sampleRate1, sampleRate2;
+
+        printf("EXCHANGE_DATA_OUT:\n");
+        printf("  rxInAudioDeviceNum: %d\n  rxOutAudioDeviceNum: %d\n  txInAudioDeviceNum: %d\n  txOutAudioDeviceNum: %d\n",
+               rxInAudioDeviceNum, rxOutAudioDeviceNum, txInAudioDeviceNum, txOutAudioDeviceNum);
+
+        // ---------------------------------------------------------------
+        // check we have a valid 1 or 2 sound card configuration
+        // ---------------------------------------------------------------
+
+        // one sound card config, tx device numbers should be set to -1 
+
+        if ((rxInAudioDeviceNum != -1) && (rxOutAudioDeviceNum != -1) &&
+            (txInAudioDeviceNum == -1) && (txOutAudioDeviceNum == -1)) {
+            valid_one_card_config = 1; 
+
+            // in and out sample rate must be the same, as there is one callback
+            
+            sampleRate1 = m_cbSampleRateRxIn->GetValue();
+            if (!sampleRate1.IsSameAs(m_cbSampleRateRxOut->GetValue())) {
+                wxMessageBox(wxT("With a single sound card the Sample Rate of "
+                                 "From Radio and To Speaker/Headphones must be the same."), wxT(""), wxOK);
+                return -1;
+            }
+        }
+
+        // two card configuration
+
+        if ((rxInAudioDeviceNum != -1) && (rxOutAudioDeviceNum != -1) &&
+            (txInAudioDeviceNum != -1) && (txOutAudioDeviceNum != -1)) {
+
+            valid_two_card_config = 1; 
+
+            // Check we haven't doubled up on sound devices
+
+            if (rxInAudioDeviceNum == txInAudioDeviceNum) {
+                wxMessageBox(wxT("You must use different devices for From Radio and From Microphone"), wxT(""), wxOK);
+                return -1;
+            }
+
+            if (rxOutAudioDeviceNum == txOutAudioDeviceNum) {
+                wxMessageBox(wxT("You must use different devices for To Radio and To Speaker/Headphones"), wxT(""), wxOK);
+                return -1;
+            }
+
+            // Check sample rates for callback 1 devices are the same,
+            // as input and output are handled synchronously by one
+            // portaudio callback
+            
+            sampleRate1 = m_cbSampleRateRxIn->GetValue();
+            if (!sampleRate1.IsSameAs(m_cbSampleRateTxOut->GetValue())) {
+                wxMessageBox(wxT("With two sound cards the Sample Rate "
+                                 "of From Radio and To Radio must be the same."), wxT(""), wxOK);
+                return -1;
+            }
+            // check sample rate for callback 2 devices is the same
+
+            sampleRate2 = m_cbSampleRateTxIn->GetValue();
+            if (!sampleRate2.IsSameAs(m_cbSampleRateRxOut->GetValue())) {
+                wxMessageBox(wxT("With two sound cards the Sample Rate of "
+                                 "From Microphone and To Speaker/Headphones must be the same."), wxT(""), wxOK);
+                return -1;
+            }
+        }
+
+        printf("  valid_one_card_config: %d  valid_two_card_config: %d\n", valid_one_card_config, valid_two_card_config);
+
+        if (!valid_one_card_config && !valid_two_card_config) {
+            wxMessageBox(wxT("Invalid one or two sound card configuration"), wxT(""), wxOK);
+            return -1;
+        }
+
+        // ---------------------------------------------------------------
+        // Map Rx/TX device numbers to sound card device numbers used
+        // in callbacks. Portaudio uses one callback per sound card so
+        // we have to be soundcard oriented at run time rather than
+        // Tx/Rx oriented as in this dialog.
+        // ---------------------------------------------------------------
+        g_nSoundCards = 0;
+        g_soundCard1InDeviceNum = g_soundCard1OutDeviceNum = g_soundCard2InDeviceNum = g_soundCard2OutDeviceNum = -1;
+
+        if (valid_one_card_config) {
+
+            // Only callback 1 used
+
+            g_nSoundCards = 1;
+            g_soundCard1InDeviceNum  = rxInAudioDeviceNum;
+            g_soundCard1OutDeviceNum = rxOutAudioDeviceNum;
+            g_soundCard1SampleRate = wxAtoi(sampleRate1);
+        }
+
+        if (valid_two_card_config) {
+            g_nSoundCards = 2;
+            g_soundCard1InDeviceNum  = rxInAudioDeviceNum;
+            g_soundCard1OutDeviceNum = txOutAudioDeviceNum;
+            g_soundCard1SampleRate   = wxAtoi(sampleRate1);
+            g_soundCard2InDeviceNum  = txInAudioDeviceNum;
+            g_soundCard2OutDeviceNum = rxOutAudioDeviceNum;
+            g_soundCard2SampleRate   = wxAtoi(sampleRate2);
+        }
+
+        printf("  g_nSoundCards: %d\n", g_nSoundCards);
+        printf("  g_soundCard1InDeviceNum: %d\n", g_soundCard1InDeviceNum);
+        printf("  g_soundCard1OutDeviceNum: %d\n", g_soundCard1OutDeviceNum);
+        printf("  g_soundCard1SampleRate: %d\n", g_soundCard1SampleRate);
+        printf("  g_soundCard2InDeviceNum: %d\n", g_soundCard2InDeviceNum);
+        printf("  g_soundCard2OutDeviceNum: %d\n", g_soundCard2OutDeviceNum);
+        printf("  g_soundCard2SampleRate: %d\n", g_soundCard2SampleRate);
+
+        wxConfigBase *pConfig = wxConfigBase::Get();
+        pConfig->Write(wxT("/Audio/soundCard1InDeviceNum"),       g_soundCard1InDeviceNum);
+        pConfig->Write(wxT("/Audio/soundCard1OutDeviceNum"),      g_soundCard1OutDeviceNum);
+        pConfig->Write(wxT("/Audio/soundCard1SampleRate"),        g_soundCard1SampleRate );
+
+        pConfig->Write(wxT("/Audio/soundCard2InDeviceNum"),       g_soundCard2InDeviceNum);
+        pConfig->Write(wxT("/Audio/soundCard2OutDeviceNum"),      g_soundCard2OutDeviceNum);
+        pConfig->Write(wxT("/Audio/soundCard2SampleRate"),        g_soundCard2SampleRate );
+
+        pConfig->Flush();
+        delete wxConfigBase::Set((wxConfigBase *) NULL);
+    }
+
+    return 0;
+}
+
+//-------------------------------------------------------------------------
+// buildListOfSupportedSampleRates()
+//-------------------------------------------------------------------------
+int AudioOptsDialog:: buildListOfSupportedSampleRates(wxComboBox *cbSampleRate, int devNum, int in_out)
+{
+    // every sound device has a different list of supported sample rates, so
+    // we work out which ones are supported and populate the list ctrl
+
+    static double standardSampleRates[] =
+    {
+        8000.0,     9600.0,
+        11025.0,    12000.0,
+        16000.0,    22050.0,
+        24000.0,    32000.0,
+        44100.0,    48000.0,
+        88200.0,    96000.0,
+        192000.0,   -1          // negative terminated  list
+    };
+
+    const PaDeviceInfo  *deviceInfo;
+    PaStreamParameters   inputParameters, outputParameters;
+    PaError              err;
+    wxString             str;
+    int                  i, numSampleRates;
+
+    deviceInfo = Pa_GetDeviceInfo(devNum);
+    if (deviceInfo == NULL) {
+        printf("Pa_GetDeviceInfo(%d) failed!\n", devNum);
+        cbSampleRate->Clear();
+        return 0;
+    }
+
+    inputParameters.device = devNum;
+    inputParameters.channelCount = deviceInfo->maxInputChannels;
+    inputParameters.sampleFormat = paInt16;
+    inputParameters.suggestedLatency = 0;
+    inputParameters.hostApiSpecificStreamInfo = NULL;
+        
+    outputParameters.device = devNum;
+    outputParameters.channelCount = deviceInfo->maxOutputChannels;
+    outputParameters.sampleFormat = paInt16;
+    outputParameters.suggestedLatency = 0;
+    outputParameters.hostApiSpecificStreamInfo = NULL;
+    
+    cbSampleRate->Clear();
+    //printf("devNum %d supports: ", devNum);
+    numSampleRates = 0;
+    for(i = 0; standardSampleRates[i] > 0; i++)
+    {      
+        if (in_out == AUDIO_IN)
+            err = Pa_IsFormatSupported(&inputParameters, NULL, standardSampleRates[i]);
+        else
+            err = Pa_IsFormatSupported(NULL, &outputParameters, standardSampleRates[i]);
+
+        if( err == paFormatIsSupported ) {
+            str.Printf("%i", (int)standardSampleRates[i]);
+            cbSampleRate->AppendString(str);
+            printf("%i ", (int)standardSampleRates[i]);
+            numSampleRates++;
+        }
+    }
+    printf("\n");
+
+    return numSampleRates;
+}
+
+//-------------------------------------------------------------------------
+// showAPIInfo()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::showAPIInfo()
+{
+    wxString    strval;
+    int         apiVersion;
+    int         apiCount        = 0;
+    int         numDevices      = 0;
+
+    strval = Pa_GetVersionText();
+    m_textStringVer->SetLabel(strval);
+
+    apiVersion = Pa_GetVersion();
+    strval.Printf(wxT("%d"), apiVersion);
+    m_textIntVer->SetLabel(strval);
+
+    apiCount = Pa_GetHostApiCount();
+    strval.Printf(wxT("%d"), apiCount);
+    m_textAPICount->SetLabel(strval);
+
+    numDevices = Pa_GetDeviceCount();
+    strval.Printf(wxT("%d"), numDevices);
+    m_textCDevCount->SetLabel(strval);
+}
+
+//-------------------------------------------------------------------------
+// populateParams()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::populateParams(AudioInfoDisplay ai)
+{
+    const       PaDeviceInfo *deviceInfo = NULL;
+    wxListCtrl* ctrl    = ai.m_listDevices;
+    int         in_out  = ai.direction;
+    long        idx;
+    int         numDevices;
+    wxListItem  listItem;
+    wxString    buf;
+    int         devn;
+    int         col = 0;
+
+    numDevices = Pa_GetDeviceCount();
+
+    if(ctrl->GetColumnCount() > 0)
+    {
+        ctrl->ClearAll();
+    }
+
+    listItem.SetAlign(wxLIST_FORMAT_LEFT);
+    listItem.SetText(wxT("Device"));
+    idx = ctrl->InsertColumn(col, listItem);
+    ctrl->SetColumnWidth(col++, 300);
+
+    listItem.SetAlign(wxLIST_FORMAT_CENTRE);
+    listItem.SetText(wxT("ID"));
+    idx = ctrl->InsertColumn(col, listItem);
+    ctrl->SetColumnWidth(col++, 45);
+
+    listItem.SetAlign(wxLIST_FORMAT_LEFT);
+    listItem.SetText(wxT("API"));
+    idx = ctrl->InsertColumn(col, listItem);
+    ctrl->SetColumnWidth(col++, 100);
+
+    if(in_out == AUDIO_IN)
+    {
+        listItem.SetAlign(wxLIST_FORMAT_CENTRE);
+        listItem.SetText(wxT("Default Sample Rate"));
+        idx = ctrl->InsertColumn(col, listItem);
+        ctrl->SetColumnWidth(col++, 160);
+    }
+    else if(in_out == AUDIO_OUT)
+    {
+        listItem.SetAlign(wxLIST_FORMAT_CENTRE);
+        listItem.SetText(wxT("Default Sample Rate"));
+        idx = ctrl->InsertColumn(col, listItem);
+        ctrl->SetColumnWidth(col++, 160);
+    }
+
+    #ifdef LATENCY
+    listItem.SetAlign(wxLIST_FORMAT_CENTRE);
+    listItem.SetText(wxT("Min Latency"));
+    ctrl->InsertColumn(col, listItem);
+    ctrl->SetColumnWidth(col++, 100);
+
+    listItem.SetAlign(wxLIST_FORMAT_CENTRE);
+    listItem.SetText(wxT("Max Latency"));
+    ctrl->InsertColumn(col, listItem);
+    ctrl->SetColumnWidth(col++, 100);
+    #endif
+
+    for(devn = 0; devn < numDevices; devn++)
+    {
+        buf.Printf(wxT(""));
+        deviceInfo = Pa_GetDeviceInfo(devn);
+        if( ((in_out == AUDIO_IN) && (deviceInfo->maxInputChannels > 0)) ||
+            ((in_out == AUDIO_OUT) && (deviceInfo->maxOutputChannels > 0)))
+        {
+            col = 0;
+            buf.Printf(wxT("%s"), deviceInfo->name);
+            idx = ctrl->InsertItem(ctrl->GetItemCount(), buf);
+            col++;
+                
+            buf.Printf(wxT("%d"), devn);
+            ctrl->SetItem(idx, col++, buf);
+
+            buf.Printf(wxT("%s"), Pa_GetHostApiInfo(deviceInfo->hostApi)->name);
+            ctrl->SetItem(idx, col++, buf);
+
+            buf.Printf(wxT("%i"), (int)deviceInfo->defaultSampleRate);
+            ctrl->SetItem(idx, col++, buf);
+
+            #ifdef LATENCY
+            if (in_out == AUDIO_IN)
+                buf.Printf(wxT("%8.4f"), deviceInfo->defaultLowInputLatency);
+            else
+                buf.Printf(wxT("%8.4f"), deviceInfo->defaultLowOutputLatency);               
+            ctrl->SetItem(idx, col++, buf);
+
+            if (in_out == AUDIO_IN)
+                buf.Printf(wxT("%8.4f"), deviceInfo->defaultHighInputLatency);
+            else
+                 buf.Printf(wxT("%8.4f"), deviceInfo->defaultHighOutputLatency);             
+            ctrl->SetItem(idx, col++, buf);
+            #endif
+        }        
+    }
+
+    // add "none" option at end
+
+    buf.Printf(wxT("%s"), "none");
+    idx = ctrl->InsertItem(ctrl->GetItemCount(), buf);
+}
+
+//-------------------------------------------------------------------------
+// OnDeviceSelect()
+//
+// helper function to set up "Device:" and "Sample Rate:" fields when
+// we click on a line in the list of devices box
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnDeviceSelect(wxComboBox *cbSampleRate, 
+                                     wxTextCtrl *textCtrl, 
+                                     int        *devNum, 
+                                     wxListCtrl *listCtrlDevices, 
+                                     int         index,
+                                     int         in_out)
+{
+
+    wxString devName = listCtrlDevices->GetItemText(index, 0);
+     if (devName.IsSameAs("none")) {
+        *devNum = -1;
+        textCtrl->SetValue("none");
+    }
+    else {
+        *devNum = wxAtoi(listCtrlDevices->GetItemText(index, 1));
+        textCtrl->SetValue(devName + " (" + wxString::Format(wxT("%i"),*devNum) + ")");
+
+        int numSampleRates = buildListOfSupportedSampleRates(cbSampleRate, *devNum, in_out);
+        if (numSampleRates) {
+            wxString defSampleRate = listCtrlDevices->GetItemText(index, 3);        
+            cbSampleRate->SetValue(defSampleRate);
+        }
+        else {
+             cbSampleRate->SetValue("None");           
+        }
+    }
+}
+
+//-------------------------------------------------------------------------
+// OnRxInDeviceSelect()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnRxInDeviceSelect(wxListEvent& evt)
+{
+    OnDeviceSelect(m_cbSampleRateRxIn, 
+                   m_textCtrlRxIn, 
+                   &rxInAudioDeviceNum, 
+                   m_listCtrlRxInDevices, 
+                   evt.GetIndex(),
+                   AUDIO_IN);
+}
+
+//-------------------------------------------------------------------------
+// OnRxOutDeviceSelect()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnRxOutDeviceSelect(wxListEvent& evt)
+{
+    OnDeviceSelect(m_cbSampleRateRxOut, 
+                   m_textCtrlRxOut, 
+                   &rxOutAudioDeviceNum, 
+                   m_listCtrlRxOutDevices, 
+                   evt.GetIndex(),
+                   AUDIO_OUT);
+}
+
+//-------------------------------------------------------------------------
+// OnTxInDeviceSelect()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnTxInDeviceSelect(wxListEvent& evt)
+{
+    OnDeviceSelect(m_cbSampleRateTxIn, 
+                   m_textCtrlTxIn, 
+                   &txInAudioDeviceNum, 
+                   m_listCtrlTxInDevices, 
+                   evt.GetIndex(),
+                   AUDIO_IN);
+}
+
+//-------------------------------------------------------------------------
+// OnTxOutDeviceSelect()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnTxOutDeviceSelect(wxListEvent& evt)
+{
+    OnDeviceSelect(m_cbSampleRateTxOut, 
+                   m_textCtrlTxOut, 
+                   &txOutAudioDeviceNum, 
+                   m_listCtrlTxOutDevices, 
+                   evt.GetIndex(),
+                   AUDIO_OUT);
+}
+
+//-------------------------------------------------------------------------
+// plotDeviceInputForAFewSecs()
+//
+// opens a record device and plots the input speech for a few seconds.  This is "modal" using
+// synchronous portaudio functions, so the GUI will not respond until after test sample has been
+// taken
+//-------------------------------------------------------------------------
+void AudioOptsDialog::plotDeviceInputForAFewSecs(int devNum, PlotScalar *plotScalar) {
+    PaStreamParameters  inputParameters;
+    const PaDeviceInfo *deviceInfo = NULL;
+    PaStream           *stream = NULL;
+    PaError             err;
+    short               in48k_stereo_short[2*TEST_BUF_SIZE];
+    short               in48k_short[TEST_BUF_SIZE];
+    short               in8k_short[TEST_BUF_SIZE];
+    int                 numDevices, nBufs, i, j, src_error,inputChannels;
+    float               t;
+    SRC_STATE          *src;
+    FIFO               *fifo;
+
+    // a basic sanity check
+    numDevices = Pa_GetDeviceCount();
+    if (devNum >= numDevices)
+        return;
+    if (devNum < 0)
+        return;
+    printf("devNum %d\n", devNum);
+
+    fifo = fifo_create((int)(DT*TEST_WAVEFORM_PLOT_FS*2)); assert(fifo != NULL);
+    src = src_new(SRC_SINC_FASTEST, 1, &src_error); assert(src != NULL);
+
+    // work out how many input channels this device supports.
+
+    deviceInfo = Pa_GetDeviceInfo(devNum);
+    if (deviceInfo == NULL) {
+        wxMessageBox(wxT("Couldn't get device info from Port Audio for Sound Card "), wxT("Error"), wxOK);
+        return;
+    }
+    if (deviceInfo->maxInputChannels == 1)
+        inputChannels = 1;
+    else
+        inputChannels = 2;
+
+    // open device
+
+    inputParameters.device = devNum;
+    inputParameters.channelCount = inputChannels;
+    inputParameters.sampleFormat = paInt16;
+    inputParameters.suggestedLatency = Pa_GetDeviceInfo( inputParameters.device )->defaultHighInputLatency;
+    inputParameters.hostApiSpecificStreamInfo = NULL;
+
+    nBufs = TEST_WAVEFORM_PLOT_TIME*TEST_FS/TEST_BUF_SIZE;
+    printf("inputChannels: %d nBufs %d\n", inputChannels, nBufs);
+
+    err = Pa_OpenStream(
+              &stream,
+              &inputParameters,
+              NULL,
+              TEST_FS,
+              TEST_BUF_SIZE,
+              paClipOff,    
+              NULL,       // no callback, use blocking API
+              NULL ); 
+    if (err != paNoError) {
+        wxMessageBox(wxT("Couldn't initialise sound device."), wxT("Error"), wxOK);       
+        return;
+    }
+
+    err = Pa_StartStream(stream);
+    if (err != paNoError) {
+        wxMessageBox(wxT("Couldn't start sound device."), wxT("Error"), wxOK);       
+        return;
+    }
+
+    for(i=0, t=0.0; i<nBufs; i++, t+=(float)TEST_BUF_SIZE/TEST_FS) {
+        Pa_ReadStream(stream, in48k_stereo_short, TEST_BUF_SIZE);
+        if (inputChannels == 2) {
+            for(j=0; j<TEST_BUF_SIZE; j++)
+                in48k_short[j] = in48k_stereo_short[2*j]; // left channel only
+        }
+        else {
+            for(j=0; j<TEST_BUF_SIZE; j++)
+                in48k_short[j] = in48k_stereo_short[j]; 
+        }
+        int n8k = resample(src, in8k_short, in48k_short, 8000, TEST_FS, TEST_BUF_SIZE, TEST_BUF_SIZE);
+        resample_for_plot(fifo, in8k_short, n8k, FS);
+
+        // every TEST_DT seconds update plot, unfortunately plot
+        // doesnt get updated to end as we are blocking events in this
+        // function
+
+        if (t > TEST_DT) {
+            t -= TEST_DT;
+            short plotSamples[TEST_WAVEFORM_PLOT_BUF];
+            if (fifo_read(fifo, plotSamples, TEST_WAVEFORM_PLOT_BUF))
+                memset(plotSamples, 0, TEST_WAVEFORM_PLOT_BUF*sizeof(short));
+            plotScalar->add_new_short_samples(0, plotSamples, TEST_WAVEFORM_PLOT_BUF, 32767);
+            plotScalar->Refresh();
+       }
+    }
+   
+    err = Pa_StopStream(stream);
+    if (err != paNoError) {
+        wxMessageBox(wxT("Couldn't stop sound device."), wxT("Error"), wxOK);       
+        return;
+    }
+    Pa_CloseStream(stream);
+
+    fifo_destroy(fifo);
+    src_delete(src);
+}
+
+//-------------------------------------------------------------------------
+// plotDeviceOutputForAFewSecs()
+//
+// opens a play device and plays a tone for a few seconds.  This is "modal" using
+// synchronous portaudio functions, so the GUI will not respond until after test sample has been
+// taken.  Also plots a pretty picture like the record versions
+//-------------------------------------------------------------------------
+void AudioOptsDialog::plotDeviceOutputForAFewSecs(int devNum, PlotScalar *plotScalar) {
+    PaStreamParameters  outputParameters;
+    const PaDeviceInfo *deviceInfo = NULL;
+    PaStream           *stream = NULL;
+    PaError             err;
+    short               out48k_stereo_short[2*TEST_BUF_SIZE];
+    short               out48k_short[TEST_BUF_SIZE];
+    short               out8k_short[TEST_BUF_SIZE];
+    int                 numDevices, nBufs, i, j, src_error, n, outputChannels;
+    float               t;
+    SRC_STATE          *src;
+    FIFO               *fifo;
+
+    // a basic sanity check
+    numDevices = Pa_GetDeviceCount();
+    if (devNum >= numDevices)
+        return;
+    if (devNum < 0)
+        return;
+
+    fifo = fifo_create((int)(DT*TEST_WAVEFORM_PLOT_FS*2)); assert(fifo != NULL);
+    src = src_new(SRC_SINC_FASTEST, 1, &src_error); assert(src != NULL);
+
+    // work out how many output channels this device supports.
+
+    deviceInfo = Pa_GetDeviceInfo(devNum);
+    if (deviceInfo == NULL) {
+        wxMessageBox(wxT("Couldn't get device info from Port Audio for Sound Card "), wxT("Error"), wxOK);
+        return;
+    }
+    if (deviceInfo->maxOutputChannels == 1)
+        outputChannels = 1;
+    else
+        outputChannels = 2;
+
+    printf("outputChannels: %d\n", outputChannels);
+
+    outputParameters.device = devNum;
+    outputParameters.channelCount = outputChannels;
+    outputParameters.sampleFormat = paInt16;
+    outputParameters.suggestedLatency = Pa_GetDeviceInfo( outputParameters.device )->defaultHighOutputLatency;
+    outputParameters.hostApiSpecificStreamInfo = NULL;
+
+    nBufs = TEST_WAVEFORM_PLOT_TIME*TEST_FS/TEST_BUF_SIZE;
+
+    err = Pa_OpenStream(
+              &stream,
+              NULL,
+              &outputParameters,
+              TEST_FS,
+              TEST_BUF_SIZE,
+              paClipOff,    
+              NULL,       // no callback, use blocking API
+              NULL ); 
+    if (err != paNoError) {
+        wxMessageBox(wxT("Couldn't initialise sound device."), wxT("Error"), wxOK);       
+        return;
+    }
+
+    err = Pa_StartStream(stream);
+    if (err != paNoError) {
+        wxMessageBox(wxT("Couldn't start sound device."), wxT("Error"), wxOK);       
+        return;
+    }
+
+    for(i=0, t=0.0, n=0; i<nBufs; i++, t+=(float)TEST_BUF_SIZE/TEST_FS) {
+        for(j=0; j<TEST_BUF_SIZE; j++,n++) {
+            out48k_short[j] = 2000.0*cos(6.2832*(n++)*400.0/TEST_FS);
+            if (outputChannels == 2) {
+                out48k_stereo_short[2*j] = out48k_short[j];   // left channel
+                out48k_stereo_short[2*j+1] = out48k_short[j]; // right channel
+            }
+            else {
+                out48k_stereo_short[j] = out48k_short[j];     // mono
+            }
+        }
+        Pa_WriteStream(stream, out48k_stereo_short, TEST_BUF_SIZE);
+
+        // convert back to 8kHz just for plotting
+        int n8k = resample(src, out8k_short, out48k_short, 8000, TEST_FS, TEST_BUF_SIZE, TEST_BUF_SIZE);
+        resample_for_plot(fifo, out8k_short, n8k, FS);
+
+        // every TEST_DT seconds update plot
+
+        if (t > TEST_DT) {
+            t -= TEST_DT;
+            short plotSamples[TEST_WAVEFORM_PLOT_BUF];
+            if (fifo_read(fifo, plotSamples, TEST_WAVEFORM_PLOT_BUF))
+                memset(plotSamples, 0, TEST_WAVEFORM_PLOT_BUF*sizeof(short));
+            plotScalar->add_new_short_samples(0, plotSamples, TEST_WAVEFORM_PLOT_BUF, 32767);
+            plotScalar->Refresh();
+       }
+    }
+   
+    err = Pa_StopStream(stream);
+    if (err != paNoError) {
+        wxMessageBox(wxT("Couldn't stop sound device."), wxT("Error"), wxOK);       
+        return;
+    }
+    Pa_CloseStream(stream);
+
+    fifo_destroy(fifo);
+    src_delete(src);
+}
+
+//-------------------------------------------------------------------------
+// OnRxInTest()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnRxInTest(wxCommandEvent& event)
+{
+    plotDeviceInputForAFewSecs(rxInAudioDeviceNum, m_plotScalarRxIn);
+}
+
+//-------------------------------------------------------------------------
+// OnRxOutTest()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnRxOutTest(wxCommandEvent& event)
+{
+    plotDeviceOutputForAFewSecs(rxOutAudioDeviceNum, m_plotScalarRxOut);
+}
+
+//-------------------------------------------------------------------------
+// OnTxInTest()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnTxInTest(wxCommandEvent& event)
+{
+    plotDeviceInputForAFewSecs(txInAudioDeviceNum, m_plotScalarTxIn);
+}
+
+//-------------------------------------------------------------------------
+// OnTxOutTest()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnTxOutTest(wxCommandEvent& event)
+{
+    plotDeviceOutputForAFewSecs(txOutAudioDeviceNum, m_plotScalarTxOut);
+}
+
+//-------------------------------------------------------------------------
+// OnRefreshClick()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnRefreshClick(wxCommandEvent& event)
+{
+    // restart portaudio, to re-sample available devices
+
+    Pa_Terminate();
+    Pa_Init();
+
+    m_notebook1->SetSelection(0);
+    showAPIInfo();
+    populateParams(m_RxInDevices);
+    populateParams(m_RxOutDevices);
+    populateParams(m_TxInDevices);
+    populateParams(m_TxOutDevices);
+
+    // some devices may have dissapeared, so possibily change sound
+    // card config
+
+    ExchangeData(EXCHANGE_DATA_IN);
+}
+
+//-------------------------------------------------------------------------
+// OnApplyAudioParameters()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnApplyAudioParameters(wxCommandEvent& event)
+{
+    ExchangeData(EXCHANGE_DATA_OUT);
+    if(m_isPaInitialized)
+    {
+        if((pa_err = Pa_Terminate()) == paNoError)
+        {
+            m_isPaInitialized = false;
+        }
+        else
+        {
+            wxMessageBox(wxT("Port Audio failed to Terminate"), wxT("Pa_Terminate"), wxOK);
+        }
+    }
+}
+
+//-------------------------------------------------------------------------
+// OnCancelAudioParameters()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnCancelAudioParameters(wxCommandEvent& event)
+{
+    if(m_isPaInitialized)
+    {
+        if((pa_err = Pa_Terminate()) == paNoError)
+        {
+            m_isPaInitialized = false;
+        }
+        else
+        {
+            wxMessageBox(wxT("Port Audio failed to Terminate"), wxT("Pa_Terminate"), wxOK);
+        }
+    }
+    EndModal(wxCANCEL);
+}
+
+//-------------------------------------------------------------------------
+// OnOkAudioParameters()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnOkAudioParameters(wxCommandEvent& event)
+{
+    int status = ExchangeData(EXCHANGE_DATA_OUT);
+
+    // We only accept OK if config sucessful
+
+    printf("status: %d m_isPaInitialized: %d\n", status, m_isPaInitialized);
+    if (status == 0) {
+        if(m_isPaInitialized)
+        {
+            if((pa_err = Pa_Terminate()) == paNoError)
+            {
+                printf("terminated OK\n");
+                m_isPaInitialized = false;
+            }
+            else
+            {
+                wxMessageBox(wxT("Port Audio failed to Terminate"), wxT("Pa_Terminate"), wxOK);
+            }
+        }
+        EndModal(wxOK);
+    }
+
+}
diff --git a/freedv-dev/src/dlg_audiooptions.h b/freedv-dev/src/dlg_audiooptions.h
new file mode 100644 (file)
index 0000000..7a78b59
--- /dev/null
@@ -0,0 +1,176 @@
+//=========================================================================
+// Name:          AudioInfoDisplay.h
+// Purpose:       Declares simple wxWidgets application with GUI
+//                created using wxFormBuilder.
+// 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 <http://www.gnu.org/licenses/>.
+//
+//=========================================================================
+#ifndef __AudioOptsDialog__
+#define __AudioOptsDialog__
+
+#include "fdmdv2_main.h"
+
+#define ID_AUDIO_OPTIONS    1000
+#define AUDIO_IN            0
+#define AUDIO_OUT           1
+
+#include "portaudio.h"
+#ifdef WIN32
+#if PA_USE_ASIO
+#include "pa_asio.h"
+#endif
+#endif
+#include "codec2_fifo.h"
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// AudioInfoDisplay
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class AudioInfoDisplay
+{
+    public:
+        wxListCtrl*     m_listDevices;
+        int             direction;
+        wxTextCtrl*     m_textDevice;
+        wxComboBox*     m_cbSampleRate;
+};
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// class AudioOptsDialog
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class AudioOptsDialog : public wxDialog
+{
+    private:
+
+    protected:
+        PaError         pa_err;
+        bool            m_isPaInitialized;
+
+        int             rxInAudioDeviceNum;
+        int             rxOutAudioDeviceNum;
+        int             txInAudioDeviceNum;
+        int             txOutAudioDeviceNum;
+
+        void buildTestControls(PlotScalar **plotScalar, wxButton **btnTest, 
+                               wxPanel *parentPanel, wxBoxSizer *bSizer, wxString buttonLabel);
+        void plotDeviceInputForAFewSecs(int devNum, PlotScalar *plotScalar);
+        void plotDeviceOutputForAFewSecs(int devNum, PlotScalar *plotScalar);
+
+        int buildListOfSupportedSampleRates(wxComboBox *cbSampleRate, int devNum, int in_out);
+        void populateParams(AudioInfoDisplay);
+        void showAPIInfo();
+        int setTextCtrlIfDevNumValid(wxTextCtrl *textCtrl, wxListCtrl *listCtrl, int devNum);
+        void Pa_Init(void);
+        void OnDeviceSelect(wxComboBox *cbSampleRate, 
+                            wxTextCtrl *textCtrl, 
+                            int        *devNum, 
+                            wxListCtrl *listCtrlDevices, 
+                            int         index,
+                            int         in_out);
+
+        AudioInfoDisplay m_RxInDevices;
+        AudioInfoDisplay m_RxOutDevices;
+        AudioInfoDisplay m_TxInDevices;
+        AudioInfoDisplay m_TxOutDevices;
+        wxPanel* m_panel1;
+        wxNotebook* m_notebook1;
+
+        wxPanel* m_panelRx;
+
+        wxListCtrl* m_listCtrlRxInDevices;
+        wxStaticText* m_staticText51;
+        wxTextCtrl* m_textCtrlRxIn;
+        wxStaticText* m_staticText6;
+        wxComboBox* m_cbSampleRateRxIn;
+
+        wxButton* m_btnRxInTest;
+        PlotScalar* m_plotScalarRxIn;
+
+        wxListCtrl* m_listCtrlRxOutDevices;
+        wxStaticText* m_staticText9;
+        wxTextCtrl* m_textCtrlRxOut;
+        wxStaticText* m_staticText10;
+        wxComboBox* m_cbSampleRateRxOut;
+
+        wxButton* m_btnRxOutTest;
+        PlotScalar* m_plotScalarRxOut;
+
+        wxPanel* m_panelTx;
+
+        wxListCtrl* m_listCtrlTxInDevices;
+        wxStaticText* m_staticText12;
+        wxTextCtrl* m_textCtrlTxIn;
+        wxStaticText* m_staticText11;
+        wxComboBox* m_cbSampleRateTxIn;
+
+        wxButton* m_btnTxInTest;
+        PlotScalar* m_plotScalarTxIn;
+
+        wxListCtrl* m_listCtrlTxOutDevices;
+        wxStaticText* m_staticText81;
+        wxTextCtrl* m_textCtrlTxOut;
+        wxStaticText* m_staticText71;
+        wxComboBox* m_cbSampleRateTxOut;
+
+        wxButton* m_btnTxOutTest;
+        PlotScalar* m_plotScalarTxOut;
+
+        wxPanel* m_panelAPI;
+
+        wxStaticText* m_staticText7;
+        wxStaticText* m_textStringVer;
+        wxStaticText* m_staticText8;
+        wxStaticText* m_textIntVer;
+        wxStaticText* m_staticText5;
+        wxStaticText* m_textCDevCount;
+        wxStaticText* m_staticText4;
+        wxStaticText* m_textAPICount;
+        wxButton* m_btnRefresh;
+        wxStdDialogButtonSizer* m_sdbSizer1;
+        wxButton* m_sdbSizer1OK;
+        wxButton* m_sdbSizer1Apply;
+        wxButton* m_sdbSizer1Cancel;
+
+        // Virtual event handlers, overide them in your derived class
+        //virtual void OnActivateApp( wxActivateEvent& event ) { event.Skip(); }
+//        virtual void OnCloseFrame( wxCloseEvent& event ) { event.Skip(); }
+
+        void OnRxInDeviceSelect( wxListEvent& event );
+
+        void OnRxInTest( wxCommandEvent& event );
+        void OnRxOutTest( wxCommandEvent& event );
+        void OnTxInTest( wxCommandEvent& event );
+        void OnTxOutTest( wxCommandEvent& event );
+
+        void OnRxOutDeviceSelect( wxListEvent& event );
+        void OnTxInDeviceSelect( wxListEvent& event );
+        void OnTxOutDeviceSelect( wxListEvent& event );
+        void OnRefreshClick( wxCommandEvent& event );
+        void OnApplyAudioParameters( wxCommandEvent& event );
+        void OnCancelAudioParameters( wxCommandEvent& event );
+        void OnOkAudioParameters( wxCommandEvent& event );
+        // Virtual event handlers, overide them in your derived class
+        void OnClose( wxCloseEvent& event ) { event.Skip(); }
+        void OnHibernate( wxActivateEvent& event ) { event.Skip(); }
+        void OnIconize( wxIconizeEvent& event ) { event.Skip(); }
+        void OnInitDialog( wxInitDialogEvent& event );
+
+    public:
+
+        AudioOptsDialog( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Audio Config"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 300,300 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
+        ~AudioOptsDialog();
+        int ExchangeData(int inout);
+};
+#endif //__AudioOptsDialog__
diff --git a/freedv-dev/src/dlg_filter.cpp b/freedv-dev/src/dlg_filter.cpp
new file mode 100644 (file)
index 0000000..0de8e8c
--- /dev/null
@@ -0,0 +1,786 @@
+//==========================================================================
+// Name:            dlg_filter.cpp
+// Purpose:         Dialog for controlling Codec audio filtering
+// Date:            Nov 25 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#include "dlg_filter.h"
+
+#define SLIDER_MAX 100
+#define SLIDER_LENGTH 100
+
+#define FILTER_MIN_MAG_DB -20.0
+#define FILTER_MAX_MAG_DB  20.0
+
+#define MAX_FREQ_BASS      600.00
+#define MAX_FREQ_TREBLE   3900.00
+#define MAX_FREQ_DEF      3000.00
+
+#define MIN_GAIN          -20
+#define MAX_GAIN           20
+
+#define MAX_LOG10_Q         1.0
+#define MIN_LOG10_Q        -1.0 
+
+// DFT parameters
+
+#define IMP_AMP           2000.0                     // amplitude of impulse
+#define NIMP              50                         // number of samples in impulse response
+#define F_STEP_DFT        10.0                       // frequency steps to sample spectrum
+#define F_MAG_N           (int)(MAX_F_HZ/F_STEP_DFT) // number of frequency steps
+
+extern struct freedv      *g_pfreedv;
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class FilterDlg
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+FilterDlg::FilterDlg(wxWindow* parent, bool running, bool *newMicInFilter, bool *newSpkOutFilter,
+                     wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style)
+{
+    m_running = running;
+    m_newMicInFilter = newMicInFilter;
+    m_newSpkOutFilter = newSpkOutFilter;
+
+    this->SetSizeHints(wxDefaultSize, wxDefaultSize);
+
+    wxBoxSizer* bSizer30;
+    bSizer30 = new wxBoxSizer(wxVERTICAL);
+
+    // LPC Post Filter --------------------------------------------------------
+
+    wxStaticBoxSizer* lpcpfs = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("LPC Post Filter")), wxHORIZONTAL);
+
+    wxBoxSizer* left = new wxBoxSizer(wxVERTICAL);
+
+    m_codec2LPCPostFilterEnable = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition,wxDefaultSize, wxCHK_2STATE);
+    left->Add(m_codec2LPCPostFilterEnable);
+
+    m_codec2LPCPostFilterBassBoost = new wxCheckBox(this, wxID_ANY, _("0-1 kHz 3dB Boost"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
+    left->Add(m_codec2LPCPostFilterBassBoost);
+    lpcpfs->Add(left, 0, wxALL, 5);
+
+    newLPCPFControl(&m_codec2LPCPostFilterBeta, &m_staticTextBeta, lpcpfs, "Beta");
+    newLPCPFControl(&m_codec2LPCPostFilterGamma, &m_staticTextGamma, lpcpfs, "Gamma");
+
+    m_LPCPostFilterDefault = new wxButton(this, wxID_ANY, wxT("Default"));
+    lpcpfs->Add(m_LPCPostFilterDefault, 0, wxALL|wxALIGN_CENTRE_HORIZONTAL|wxALIGN_CENTRE_VERTICAL, 5);
+
+    bSizer30->Add(lpcpfs, 0, wxALL, 0);
+
+    // Speex pre-processor --------------------------------------------------
+
+    wxStaticBoxSizer* sbSizer_speexpp;
+    wxStaticBox *sb_speexpp = new wxStaticBox(this, wxID_ANY, _("Speex Mic Audio Pre-Processor"));
+    sbSizer_speexpp = new wxStaticBoxSizer(sb_speexpp, wxVERTICAL);
+
+    m_ckboxSpeexpp = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
+    sb_speexpp->SetToolTip(_("Enable noise supression, dereverberation, AGC of mic signal"));
+    sbSizer_speexpp->Add(m_ckboxSpeexpp, wxALIGN_LEFT, 2);
+
+    bSizer30->Add(sbSizer_speexpp, 0, wxALL, 0);   
+
+    // EQ Filters -----------------------------------------------------------
+
+    wxStaticBoxSizer* eqMicInSizer = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Mic In Equaliser")), wxVERTICAL);
+    wxBoxSizer* eqMicInSizer1 = new wxBoxSizer(wxHORIZONTAL);
+    wxBoxSizer* eqMicInSizer2 = new wxBoxSizer(wxHORIZONTAL);
+
+    m_MicInBass   = newEQ(eqMicInSizer1, "Bass"  , MAX_FREQ_BASS, disableQ);
+    m_MicInTreble = newEQ(eqMicInSizer1, "Treble", MAX_FREQ_TREBLE, disableQ);
+    eqMicInSizer->Add(eqMicInSizer1);
+
+    m_MicInEnable = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition,wxDefaultSize, wxCHK_2STATE);
+    eqMicInSizer2->Add(m_MicInEnable,0,wxALIGN_CENTRE_VERTICAL|wxRIGHT,10);
+    m_MicInMid    = newEQ(eqMicInSizer2, "Mid"   , MAX_FREQ_DEF, enableQ);
+    m_MicInDefault = new wxButton(this, wxID_ANY, wxT("Default"));
+    eqMicInSizer2->Add(m_MicInDefault,0,wxALIGN_CENTRE_VERTICAL|wxLEFT,20);
+    eqMicInSizer->Add(eqMicInSizer2);
+
+    wxStaticBoxSizer* eqSpkOutSizer = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Speaker Out Equaliser")), wxVERTICAL);
+    wxBoxSizer* eqSpkOutSizer1 = new wxBoxSizer(wxHORIZONTAL);
+    wxBoxSizer* eqSpkOutSizer2 = new wxBoxSizer(wxHORIZONTAL);
+
+    m_SpkOutBass   = newEQ(eqSpkOutSizer1, "Bass"  , MAX_FREQ_BASS, disableQ);
+    m_SpkOutTreble = newEQ(eqSpkOutSizer1, "Treble", MAX_FREQ_TREBLE, disableQ);
+    eqSpkOutSizer->Add(eqSpkOutSizer1);
+
+    m_SpkOutEnable = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition,wxDefaultSize, wxCHK_2STATE);
+    eqSpkOutSizer2->Add(m_SpkOutEnable,0,wxALIGN_CENTRE_VERTICAL|wxRIGHT,10);
+    m_SpkOutMid    = newEQ(eqSpkOutSizer2, "Mid"   , MAX_FREQ_DEF, enableQ);
+    m_SpkOutDefault = new wxButton(this, wxID_ANY, wxT("Default"));
+    eqSpkOutSizer2->Add(m_SpkOutDefault,0,wxALIGN_CENTRE_VERTICAL|wxLEFT,20);
+    eqSpkOutSizer->Add(eqSpkOutSizer2);
+    
+    bSizer30->Add(eqMicInSizer, 0, wxALL, 0);
+    bSizer30->Add(eqSpkOutSizer, 0, wxALL, 0);
+
+    // Storgage for spectrum magnitude plots ------------------------------------
+
+    m_MicInMagdB = new float[F_MAG_N];
+    for(int i=0; i<F_MAG_N; i++)
+        m_MicInMagdB[i] = 0.0;
+
+    m_SpkOutMagdB = new float[F_MAG_N];
+    for(int i=0; i<F_MAG_N; i++)
+        m_SpkOutMagdB[i] = 0.0;
+
+    // Spectrum Plots -----------------------------------------------------------
+
+    long nb_style = wxAUI_NB_BOTTOM | wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_MOVE | wxAUI_NB_SCROLL_BUTTONS;
+    m_auiNotebook = new wxAuiNotebook(this, wxID_ANY, wxDefaultPosition, wxSize(-1,200), nb_style);
+    m_auiNotebook->SetFont(wxFont(8, 70, 90, 90, false, wxEmptyString));
+
+    bSizer30->Add(m_auiNotebook, 0, wxEXPAND|wxALL, 3);
+    
+    m_MicInFreqRespPlot = new PlotSpectrum((wxFrame*) m_auiNotebook, m_MicInMagdB, F_MAG_N, FILTER_MIN_MAG_DB, FILTER_MAX_MAG_DB);
+    m_auiNotebook->AddPage(m_MicInFreqRespPlot, _("Microphone In Equaliser"));
+
+    m_SpkOutFreqRespPlot = new PlotSpectrum((wxFrame*)m_auiNotebook, m_SpkOutMagdB, F_MAG_N, FILTER_MIN_MAG_DB, FILTER_MAX_MAG_DB);
+    m_auiNotebook->AddPage(m_SpkOutFreqRespPlot, _("Speaker Out Equaliser"));
+
+    //  OK - Cancel buttons at the bottom --------------------------
+
+    wxBoxSizer* bSizer31 = new wxBoxSizer(wxHORIZONTAL);
+
+    m_sdbSizer5OK = new wxButton(this, wxID_OK);
+    bSizer31->Add(m_sdbSizer5OK, 0, wxALL, 2);
+
+    m_sdbSizer5Cancel = new wxButton(this, wxID_CANCEL);
+    bSizer31->Add(m_sdbSizer5Cancel, 0, wxALL, 2);
+
+    bSizer30->Add(bSizer31, 0, wxALIGN_RIGHT|wxALL, 0);
+
+    this->SetSizer(bSizer30);
+    this->Layout();
+
+    this->Centre(wxBOTH);
+    // Connect Events -------------------------------------------------------
+
+    this->Connect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(FilterDlg::OnInitDialog));
+
+    m_codec2LPCPostFilterEnable->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnEnable), NULL, this);
+    m_codec2LPCPostFilterBassBoost->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnBassBoost), NULL, this);
+    m_codec2LPCPostFilterBeta->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnBetaScroll), NULL, this);
+    m_codec2LPCPostFilterGamma->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnGammaScroll), NULL, this);
+    m_LPCPostFilterDefault->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnLPCPostFilterDefault), NULL, this);
+
+    m_ckboxSpeexpp->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnSpeexppEnable), NULL, this);
+
+    m_MicInBass.sliderFreq->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInBassFreqScroll), NULL, this);
+    m_MicInBass.sliderGain->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInBassGainScroll), NULL, this);
+    m_MicInTreble.sliderFreq->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInTrebleFreqScroll), NULL, this);
+    m_MicInTreble.sliderGain->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInTrebleGainScroll), NULL, this);
+    m_MicInMid.sliderFreq->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInMidFreqScroll), NULL, this);
+    m_MicInMid.sliderGain->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInMidGainScroll), NULL, this);
+    m_MicInMid.sliderQ->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInMidQScroll), NULL, this);
+    m_MicInEnable->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnMicInEnable), NULL, this);
+    m_MicInDefault->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnMicInDefault), NULL, this);
+
+    m_SpkOutBass.sliderFreq->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutBassFreqScroll), NULL, this);
+    m_SpkOutBass.sliderGain->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutBassGainScroll), NULL, this);
+    m_SpkOutTreble.sliderFreq->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutTrebleFreqScroll), NULL, this);
+    m_SpkOutTreble.sliderGain->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutTrebleGainScroll), NULL, this);
+    m_SpkOutMid.sliderFreq->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutMidFreqScroll), NULL, this);
+    m_SpkOutMid.sliderGain->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutMidGainScroll), NULL, this);
+    m_SpkOutMid.sliderQ->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutMidQScroll), NULL, this);
+    m_SpkOutEnable->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnSpkOutEnable), NULL, this);
+    m_SpkOutDefault->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnSpkOutDefault), NULL, this);
+
+    m_sdbSizer5Cancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnCancel), NULL, this);
+    m_sdbSizer5OK->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnOK), NULL, this);
+
+}
+
+//-------------------------------------------------------------------------
+// ~FilterDlg()
+//-------------------------------------------------------------------------
+FilterDlg::~FilterDlg()
+{
+    delete m_MicInMagdB;
+    delete m_SpkOutMagdB;
+
+    // Disconnect Events
+
+    this->Disconnect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(FilterDlg::OnInitDialog));
+
+    m_codec2LPCPostFilterEnable->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnEnable), NULL, this);
+    m_codec2LPCPostFilterBassBoost->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnBassBoost), NULL, this);
+    m_codec2LPCPostFilterBeta->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnBetaScroll), NULL, this);
+    m_codec2LPCPostFilterGamma->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnGammaScroll), NULL, this);
+    m_LPCPostFilterDefault->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnLPCPostFilterDefault), NULL, this);
+
+    m_MicInBass.sliderFreq->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInBassFreqScroll), NULL, this);
+    m_MicInBass.sliderGain->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInBassGainScroll), NULL, this);
+    m_MicInTreble.sliderFreq->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInTrebleFreqScroll), NULL, this);
+    m_MicInTreble.sliderGain->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInTrebleGainScroll), NULL, this);
+    m_MicInMid.sliderFreq->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInMidFreqScroll), NULL, this);
+    m_MicInMid.sliderGain->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInMidGainScroll), NULL, this);
+    m_MicInMid.sliderQ->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInMidQScroll), NULL, this);
+    m_MicInEnable->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnMicInEnable), NULL, this);
+    m_MicInDefault->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnMicInDefault), NULL, this);
+
+    m_SpkOutBass.sliderFreq->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutBassFreqScroll), NULL, this);
+    m_SpkOutBass.sliderGain->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutBassGainScroll), NULL, this);
+    m_SpkOutTreble.sliderFreq->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutTrebleFreqScroll), NULL, this);
+    m_SpkOutTreble.sliderGain->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutTrebleGainScroll), NULL, this);
+    m_SpkOutMid.sliderFreq->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutMidFreqScroll), NULL, this);
+    m_SpkOutMid.sliderGain->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutMidGainScroll), NULL, this);
+    m_SpkOutMid.sliderQ->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutMidQScroll), NULL, this);
+    m_SpkOutEnable->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnSpkOutEnable), NULL, this);
+    m_SpkOutDefault->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnSpkOutDefault), NULL, this);
+
+    m_sdbSizer5Cancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnCancel), NULL, this);
+    m_sdbSizer5OK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnOK), NULL, this);
+}
+
+void FilterDlg::newLPCPFControl(wxSlider **slider, wxStaticText **stValue, wxSizer *s, wxString controlName)
+{
+    wxBoxSizer *bs = new wxBoxSizer(wxHORIZONTAL);
+
+    wxStaticText* st = new wxStaticText(this, wxID_ANY, controlName, wxDefaultPosition, wxSize(70,-1), wxALIGN_RIGHT);
+    bs->Add(st, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 2);
+
+    *slider = new wxSlider(this, wxID_ANY, 0, 0, SLIDER_MAX, wxDefaultPosition, wxSize(SLIDER_LENGTH,wxDefaultCoord));
+    bs->Add(*slider, 1, wxALIGN_CENTER_VERTICAL|wxALL, 2);
+
+    *stValue = new wxStaticText(this, wxID_ANY, wxT("0.0"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
+    bs->Add(*stValue, 1, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxALL, 2);
+
+    s->Add(bs, 0);
+}
+
+void FilterDlg::newEQControl(wxSlider** slider, wxStaticText** value, wxStaticBoxSizer *bs, wxString controlName)
+{
+    wxStaticText* label = new wxStaticText(this, wxID_ANY, controlName, wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
+    bs->Add(label, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 0);
+
+    *slider = new wxSlider(this, wxID_ANY, 0, 0, SLIDER_MAX, wxDefaultPosition, wxSize(SLIDER_LENGTH,wxDefaultCoord));
+    bs->Add(*slider, 1, wxALIGN_CENTER_VERTICAL|wxALL, 0);
+
+    *value = new wxStaticText(this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(40,-1), wxALIGN_LEFT);
+    bs->Add(*value, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxRIGHT, 5);
+}
+
+EQ FilterDlg::newEQ(wxSizer *bs, wxString eqName, float maxFreqHz, bool enableQ)
+{
+    EQ eq;
+
+    wxStaticBoxSizer *bsEQ = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, eqName), wxHORIZONTAL);
+
+    newEQControl(&eq.sliderFreq, &eq.valueFreq, bsEQ, "Freq"); 
+    eq.maxFreqHz = maxFreqHz; 
+    eq.sliderFreqId = eq.sliderFreq->GetId();
+
+    newEQControl(&eq.sliderGain, &eq.valueGain, bsEQ, "Gain");
+    if (enableQ)
+        newEQControl(&eq.sliderQ, &eq.valueQ, bsEQ, "Q");
+    else
+        eq.sliderQ = NULL;
+
+    bs->Add(bsEQ);
+
+    return eq;
+}
+
+//-------------------------------------------------------------------------
+// ExchangeData()
+//-------------------------------------------------------------------------
+void FilterDlg::ExchangeData(int inout, bool storePersistent)
+{
+    wxConfigBase *pConfig = wxConfigBase::Get();
+    if(inout == EXCHANGE_DATA_IN)
+    {
+        // LPC Post filter
+
+        m_codec2LPCPostFilterEnable->SetValue(wxGetApp().m_codec2LPCPostFilterEnable);
+        m_codec2LPCPostFilterBassBoost->SetValue(wxGetApp().m_codec2LPCPostFilterBassBoost);
+        m_beta = wxGetApp().m_codec2LPCPostFilterBeta; setBeta();
+        m_gamma = wxGetApp().m_codec2LPCPostFilterGamma; setGamma();
+
+        // Speex Pre-Processor
+
+        m_ckboxSpeexpp->SetValue(wxGetApp().m_speexpp_enable);
+
+        // Mic In Equaliser
+
+        m_MicInBass.freqHz = wxGetApp().m_MicInBassFreqHz; 
+        m_MicInBass.freqHz = limit(m_MicInBass.freqHz, 1.0, MAX_FREQ_BASS);
+        setFreq(&m_MicInBass);
+        m_MicInBass.gaindB = wxGetApp().m_MicInBassGaindB;
+        m_MicInBass.gaindB = limit(m_MicInBass.gaindB, MIN_GAIN, MAX_GAIN);
+        setGain(&m_MicInBass);
+
+        m_MicInTreble.freqHz = wxGetApp().m_MicInTrebleFreqHz;
+        m_MicInTreble.freqHz = limit(m_MicInTreble.freqHz, 1.0, MAX_FREQ_TREBLE);
+        setFreq(&m_MicInTreble);
+        m_MicInTreble.gaindB = wxGetApp().m_MicInTrebleGaindB; 
+        m_MicInTreble.gaindB = limit(m_MicInTreble.gaindB, MIN_GAIN, MAX_GAIN);
+        setGain(&m_MicInTreble);
+
+        m_MicInMid.freqHz = wxGetApp().m_MicInMidFreqHz; 
+        m_MicInMid.freqHz = limit(m_MicInMid.freqHz, 1.0, MAX_FREQ_TREBLE);
+        setFreq(&m_MicInMid);
+        m_MicInMid.gaindB = wxGetApp().m_MicInMidGaindB; 
+        m_MicInMid.gaindB = limit(m_MicInMid.gaindB, MIN_GAIN, MAX_GAIN);
+        setGain(&m_MicInMid);
+        m_MicInMid.Q = wxGetApp().m_MicInMidQ;
+        m_MicInMid.Q = limit(m_MicInMid.Q, pow(10.0,MIN_LOG10_Q), pow(10.0, MAX_LOG10_Q));
+        setQ(&m_MicInMid);
+
+        m_MicInEnable->SetValue(wxGetApp().m_MicInEQEnable);
+
+        plotMicInFilterSpectrum();
+        // Spk Out Equaliser
+
+        m_SpkOutBass.freqHz = wxGetApp().m_SpkOutBassFreqHz;
+        m_SpkOutBass.freqHz = limit(m_SpkOutBass.freqHz, 1.0, MAX_FREQ_BASS);
+        setFreq(&m_SpkOutBass);
+        m_SpkOutBass.gaindB = wxGetApp().m_SpkOutBassGaindB; 
+        m_SpkOutBass.gaindB = limit(m_SpkOutBass.gaindB, MIN_GAIN, MAX_GAIN);
+        setGain(&m_SpkOutBass);
+
+        m_SpkOutTreble.freqHz = wxGetApp().m_SpkOutTrebleFreqHz; 
+        m_SpkOutTreble.freqHz = limit(m_SpkOutTreble.freqHz, 1.0, MAX_FREQ_TREBLE);
+        setFreq(&m_SpkOutTreble);
+        m_SpkOutTreble.gaindB = wxGetApp().m_SpkOutTrebleGaindB; 
+        m_SpkOutTreble.gaindB = limit(m_SpkOutTreble.gaindB, MIN_GAIN, MAX_GAIN);
+        setGain(&m_SpkOutTreble);
+
+        m_SpkOutMid.freqHz = wxGetApp().m_SpkOutMidFreqHz;
+        m_SpkOutMid.freqHz = limit(m_SpkOutMid.freqHz, 1.0, MAX_FREQ_TREBLE);
+        setFreq(&m_SpkOutMid);
+        m_SpkOutMid.gaindB = wxGetApp().m_SpkOutMidGaindB;
+        m_SpkOutMid.gaindB = limit(m_SpkOutMid.gaindB, MIN_GAIN, MAX_GAIN);
+        setGain(&m_SpkOutMid);
+        m_SpkOutMid.Q = wxGetApp().m_SpkOutMidQ;
+        m_SpkOutMid.Q = limit(m_SpkOutMid.Q, pow(10.0,MIN_LOG10_Q), pow(10.0, MAX_LOG10_Q));
+        setQ(&m_SpkOutMid);
+
+        m_SpkOutEnable->SetValue(wxGetApp().m_SpkOutEQEnable);
+
+        plotSpkOutFilterSpectrum();
+    }
+    if(inout == EXCHANGE_DATA_OUT)
+    {
+        // LPC Post filter
+
+        wxGetApp().m_codec2LPCPostFilterEnable     = m_codec2LPCPostFilterEnable->GetValue();
+        wxGetApp().m_codec2LPCPostFilterBassBoost  = m_codec2LPCPostFilterBassBoost->GetValue();
+        wxGetApp().m_codec2LPCPostFilterBeta       = m_beta;
+        wxGetApp().m_codec2LPCPostFilterGamma      = m_gamma;
+
+        // Speex Pre-Processor
+
+        wxGetApp().m_speexpp_enable = m_ckboxSpeexpp->GetValue();
+
+        // Mic In Equaliser
+
+        wxGetApp().m_MicInBassFreqHz = m_MicInBass.freqHz;
+        wxGetApp().m_MicInBassGaindB = m_MicInBass.gaindB;
+
+        wxGetApp().m_MicInTrebleFreqHz = m_MicInTreble.freqHz;
+        wxGetApp().m_MicInTrebleGaindB = m_MicInTreble.gaindB;
+
+        wxGetApp().m_MicInMidFreqHz = m_MicInMid.freqHz;
+        wxGetApp().m_MicInMidGaindB = m_MicInMid.gaindB;
+        wxGetApp().m_MicInMidQ = m_MicInMid.Q;
+
+        // Spk Out Equaliser
+
+        wxGetApp().m_SpkOutBassFreqHz = m_SpkOutBass.freqHz;
+        wxGetApp().m_SpkOutBassGaindB = m_SpkOutBass.gaindB;
+
+        wxGetApp().m_SpkOutTrebleFreqHz = m_SpkOutTreble.freqHz;
+        wxGetApp().m_SpkOutTrebleGaindB = m_SpkOutTreble.gaindB;
+
+        wxGetApp().m_SpkOutMidFreqHz = m_SpkOutMid.freqHz;
+        wxGetApp().m_SpkOutMidGaindB = m_SpkOutMid.gaindB;
+        wxGetApp().m_SpkOutMidQ = m_SpkOutMid.Q;
+
+        if (storePersistent) {
+            pConfig->Write(wxT("/Filter/codec2LPCPostFilterEnable"),     wxGetApp().m_codec2LPCPostFilterEnable);
+            pConfig->Write(wxT("/Filter/codec2LPCPostFilterBassBoost"),  wxGetApp().m_codec2LPCPostFilterBassBoost);
+            pConfig->Write(wxT("/Filter/codec2LPCPostFilterBeta"),       (int)(m_beta*100.0));
+            pConfig->Write(wxT("/Filter/codec2LPCPostFilterGamma"),      (int)(m_gamma*100.0));
+
+            pConfig->Write(wxT("/Filter/speexpp_enable"),                wxGetApp().m_speexpp_enable);
+
+            pConfig->Write(wxT("/Filter/MicInBassFreqHz"), (int)m_MicInBass.freqHz);
+            pConfig->Write(wxT("/Filter/MicInBassGaindB"), (int)(10.0*m_MicInBass.gaindB));
+            pConfig->Write(wxT("/Filter/MicInTrebleFreqHz"), (int)m_MicInTreble.freqHz);
+            pConfig->Write(wxT("/Filter/MicInTrebleGaindB"), (int)(10.0*m_MicInTreble.gaindB));
+            pConfig->Write(wxT("/Filter/MicInMidFreqHz"), (int)m_MicInMid.freqHz);
+            pConfig->Write(wxT("/Filter/MicInMidGaindB"), (int)(10.0*m_MicInMid.gaindB));
+            pConfig->Write(wxT("/Filter/MicInMidQ"), (int)(100.0*m_MicInMid.Q));
+
+            pConfig->Write(wxT("/Filter/SpkOutBassFreqHz"), (int)m_SpkOutBass.freqHz);
+            pConfig->Write(wxT("/Filter/SpkOutBassGaindB"), (int)(10.0*m_SpkOutBass.gaindB));
+            pConfig->Write(wxT("/Filter/SpkOutTrebleFreqHz"), (int)m_SpkOutTreble.freqHz);
+            pConfig->Write(wxT("/Filter/SpkOutTrebleGaindB"), (int)(10.0*m_SpkOutTreble.gaindB));
+            pConfig->Write(wxT("/Filter/SpkOutMidQ"), (int)(100.0*m_SpkOutMid.Q));
+            pConfig->Write(wxT("/Filter/SpkOutMidFreqHz"), (int)m_SpkOutMid.freqHz);
+            pConfig->Write(wxT("/Filter/SpkOutMidGaindB"), (int)(10.0*m_SpkOutMid.gaindB));
+
+            pConfig->Flush();
+        }
+    }
+    delete wxConfigBase::Set((wxConfigBase *) NULL);
+}
+
+float FilterDlg::limit(float value, float min, float max) {
+    if (value < min) return min;
+    if (value > max) return max;
+    return value;
+}
+
+//-------------------------------------------------------------------------
+// OnCancel()
+//-------------------------------------------------------------------------
+void FilterDlg::OnCancel(wxCommandEvent& event)
+{
+    this->EndModal(wxID_CANCEL);
+}
+
+//-------------------------------------------------------------------------
+// OnDefault()
+//-------------------------------------------------------------------------
+
+void FilterDlg::OnLPCPostFilterDefault(wxCommandEvent& event)
+{
+    m_beta = CODEC2_LPC_PF_BETA; setBeta();
+    m_gamma = CODEC2_LPC_PF_GAMMA; setGamma();
+    m_codec2LPCPostFilterEnable->SetValue(true);
+    m_codec2LPCPostFilterBassBoost->SetValue(true);
+}
+
+void FilterDlg::OnMicInDefault(wxCommandEvent& event)
+{
+    m_MicInBass.freqHz = 100.0;
+    m_MicInBass.gaindB = 0.0;
+    setFreq(&m_MicInBass); setGain(&m_MicInBass); 
+
+    m_MicInTreble.freqHz = 3000.0;
+    m_MicInTreble.gaindB = 0.0;
+    setFreq(&m_MicInTreble); setGain(&m_MicInTreble); 
+
+    m_MicInMid.freqHz = 1500.0;
+    m_MicInMid.gaindB = 0.0;
+    m_MicInMid.Q = 1.0;
+    setFreq(&m_MicInMid); setGain(&m_MicInMid); setQ(&m_MicInMid); 
+
+    plotMicInFilterSpectrum();    
+}
+
+void FilterDlg::OnSpkOutDefault(wxCommandEvent& event)
+{
+    m_SpkOutBass.freqHz = 100.0;
+    m_SpkOutBass.gaindB = 0.0;
+    setFreq(&m_SpkOutBass); setGain(&m_SpkOutBass); 
+
+    m_SpkOutTreble.freqHz = 3000.0;
+    m_SpkOutTreble.gaindB = 0.0;
+    setFreq(&m_SpkOutTreble); setGain(&m_SpkOutTreble); 
+
+    m_SpkOutMid.freqHz = 1500.0;
+    m_SpkOutMid.gaindB = 0.0;
+    m_SpkOutMid.Q = 1.0;
+    setFreq(&m_SpkOutMid); setGain(&m_SpkOutMid); setQ(&m_SpkOutMid); 
+
+    plotSpkOutFilterSpectrum();    
+}
+
+//-------------------------------------------------------------------------
+// OnOK()
+//-------------------------------------------------------------------------
+void FilterDlg::OnOK(wxCommandEvent& event)
+{
+    //printf("FilterDlg::OnOK\n");
+    ExchangeData(EXCHANGE_DATA_OUT, true);
+    this->EndModal(wxID_OK);
+}
+
+//-------------------------------------------------------------------------
+// OnClose()
+//-------------------------------------------------------------------------
+void FilterDlg::OnClose(wxCloseEvent& event)
+{
+    this->EndModal(wxID_OK);
+}
+
+//-------------------------------------------------------------------------
+// OnInitDialog()
+//-------------------------------------------------------------------------
+void FilterDlg::OnInitDialog(wxInitDialogEvent& event)
+{
+    //printf("FilterDlg::OnInitDialog\n");
+    ExchangeData(EXCHANGE_DATA_IN, false);
+    //printf("m_beta: %f\n", m_beta);
+}
+
+void FilterDlg::setBeta(void) {
+    wxString buf;
+    buf.Printf(wxT("%3.2f"), m_beta);
+    m_staticTextBeta->SetLabel(buf);
+    int slider = (int)(m_beta*SLIDER_MAX + 0.5);
+    m_codec2LPCPostFilterBeta->SetValue(slider);
+}
+
+void FilterDlg::setCodec2(void) {
+    if (m_running) {
+        assert(g_pfreedv->codec2 != NULL);
+        codec2_set_lpc_post_filter(g_pfreedv->codec2, 
+                               m_codec2LPCPostFilterEnable->GetValue(), 
+                               m_codec2LPCPostFilterBassBoost->GetValue(), 
+                               m_beta, m_gamma);
+    }
+}
+
+void FilterDlg::setGamma(void) {
+    wxString buf;
+    buf.Printf(wxT("%3.2f"), m_gamma);
+    m_staticTextGamma->SetLabel(buf);
+    int slider = (int)(m_gamma*SLIDER_MAX + 0.5);
+    m_codec2LPCPostFilterGamma->SetValue(slider);
+}
+
+void FilterDlg::OnEnable(wxScrollEvent& event) {
+    setCodec2();    
+}
+
+void FilterDlg::OnBassBoost(wxScrollEvent& event) {
+    setCodec2();    
+}
+
+void FilterDlg::OnBetaScroll(wxScrollEvent& event) {
+    m_beta = (float)m_codec2LPCPostFilterBeta->GetValue()/SLIDER_MAX;
+    setBeta();
+    setCodec2();
+}
+
+void FilterDlg::OnGammaScroll(wxScrollEvent& event) {
+    m_gamma = (float)m_codec2LPCPostFilterGamma->GetValue()/SLIDER_MAX;
+    setGamma();
+    setCodec2();
+}
+
+// immediately change enable flags rather using ExchangeData() so we can switch on and off at run time
+
+void FilterDlg::OnSpeexppEnable(wxScrollEvent& event) {
+    wxGetApp().m_speexpp_enable = m_ckboxSpeexpp->GetValue();
+}
+
+void FilterDlg::OnMicInEnable(wxScrollEvent& event) {
+    wxGetApp().m_MicInEQEnable = m_MicInEnable->GetValue();
+}
+
+void FilterDlg::OnSpkOutEnable(wxScrollEvent& event) {
+    wxGetApp().m_SpkOutEQEnable = m_SpkOutEnable->GetValue();
+    //printf("wxGetApp().m_SpkOutEQEnable: %d\n", wxGetApp().m_SpkOutEQEnable);
+}
+
+void FilterDlg::setFreq(EQ *eq)
+{
+    wxString buf;
+    buf.Printf(wxT("%3.0f"), eq->freqHz);
+    eq->valueFreq->SetLabel(buf);
+    int slider = (int)((eq->freqHz/eq->maxFreqHz)*SLIDER_MAX + 0.5);
+    eq->sliderFreq->SetValue(slider);
+}
+
+void FilterDlg::sliderToFreq(EQ *eq, bool micIn)
+{
+    eq->freqHz = ((float)eq->sliderFreq->GetValue()/SLIDER_MAX)*eq->maxFreqHz;
+    if (eq->freqHz < 1.0) eq->freqHz = 1.0; // sox doesn't like 0 Hz;
+    setFreq(eq);
+    if (micIn) {
+        plotMicInFilterSpectrum();
+        adjRunTimeMicInFilter();
+    }
+    else {
+        plotSpkOutFilterSpectrum();
+        adjRunTimeSpkOutFilter();
+    }
+}
+
+void FilterDlg::setGain(EQ *eq)
+{
+    wxString buf;
+    buf.Printf(wxT("%3.1f"), eq->gaindB);
+    eq->valueGain->SetLabel(buf);
+    int slider = (int)(((eq->gaindB-MIN_GAIN)/(MAX_GAIN-MIN_GAIN))*SLIDER_MAX + 0.5);
+    eq->sliderGain->SetValue(slider);
+}
+
+void FilterDlg::sliderToGain(EQ *eq, bool micIn)
+{
+    float range = MAX_GAIN-MIN_GAIN;
+    
+    eq->gaindB = MIN_GAIN + range*((float)eq->sliderGain->GetValue()/SLIDER_MAX);
+    //printf("gaindB: %f\n", eq->gaindB);
+    setGain(eq);
+    if (micIn) {
+        plotMicInFilterSpectrum();
+        adjRunTimeMicInFilter();
+    }
+    else {
+        plotSpkOutFilterSpectrum();
+        adjRunTimeSpkOutFilter();
+    }
+        
+}
+
+void FilterDlg::setQ(EQ *eq)
+{
+    wxString buf;
+    buf.Printf(wxT("%2.1f"), eq->Q);
+    eq->valueQ->SetLabel(buf);
+
+    float log10_range = MAX_LOG10_Q - MIN_LOG10_Q;
+
+    int slider = (int)(((log10(eq->Q+1E-6)-MIN_LOG10_Q)/log10_range)*SLIDER_MAX + 0.5);
+    eq->sliderQ->SetValue(slider);
+}
+
+void FilterDlg::sliderToQ(EQ *eq, bool micIn)
+{
+    float log10_range = MAX_LOG10_Q - MIN_LOG10_Q;
+    
+    float sliderNorm = (float)eq->sliderQ->GetValue()/SLIDER_MAX;
+    float log10Q =  MIN_LOG10_Q + sliderNorm*(log10_range);
+    eq->Q = pow(10.0, log10Q);
+    //printf("log10Q: %f eq->Q: %f\n", log10Q, eq->Q);
+    setQ(eq);
+    if (micIn) {
+        plotMicInFilterSpectrum();
+        adjRunTimeMicInFilter();
+    }
+    else {
+        plotSpkOutFilterSpectrum();
+        adjRunTimeSpkOutFilter();
+    }
+}
+
+void FilterDlg::plotMicInFilterSpectrum(void) {
+    plotFilterSpectrum(&m_MicInBass, &m_MicInMid, &m_MicInTreble, m_MicInFreqRespPlot, m_MicInMagdB);
+}
+
+void FilterDlg::plotSpkOutFilterSpectrum(void) {
+    plotFilterSpectrum(&m_SpkOutBass, &m_SpkOutMid, &m_SpkOutTreble, m_SpkOutFreqRespPlot, m_SpkOutMagdB);
+}
+
+void FilterDlg::adjRunTimeMicInFilter(void) {
+    // signal an adjustment in running filter coeffs
+
+    if (m_running) {
+        ExchangeData(EXCHANGE_DATA_OUT, false);
+        *m_newMicInFilter = true;
+    }
+}
+        
+void FilterDlg::adjRunTimeSpkOutFilter(void) {
+    // signal an adjustment in running filter coeffs
+
+    if (m_running) {
+        ExchangeData(EXCHANGE_DATA_OUT, false);
+        *m_newSpkOutFilter = true;
+    }
+}
+        
+
+void FilterDlg::plotFilterSpectrum(EQ *eqBass, EQ *eqMid, EQ *eqTreble, PlotSpectrum* freqRespPlot, float *magdB) {
+    char  *argBass[10];
+    char  *argTreble[10];
+    char  *argMid[10];
+    char   argstorage[10][80];
+    float magBass[F_MAG_N];
+    float magTreble[F_MAG_N];
+    float magMid[F_MAG_N];
+    int   i;
+
+    for(i=0; i<10; i++) {
+        argBass[i] = &argstorage[i][0];
+        argTreble[i] = &argstorage[i][0];
+        argMid[i] = &argstorage[i][0];
+    }
+    sprintf(argBass[0], "bass");                
+    sprintf(argBass[1], "%f", eqBass->gaindB+1E-6);
+    sprintf(argBass[2], "%f", eqBass->freqHz);      
+
+    calcFilterSpectrum(magBass, 2, argBass);
+
+    sprintf(argTreble[0], "treble");                
+    sprintf(argTreble[1], "%f", eqTreble->gaindB+1E-6);
+    sprintf(argTreble[2], "%f", eqTreble->freqHz);      
+
+    calcFilterSpectrum(magTreble, 2, argTreble);
+
+    sprintf(argTreble[0], "equalizer");                
+    sprintf(argTreble[1], "%f", eqMid->freqHz);      
+    sprintf(argTreble[2], "%f", eqMid->Q);      
+    sprintf(argTreble[3], "%f", eqMid->gaindB+1E-6);
+
+    calcFilterSpectrum(magMid, 3, argMid);
+
+    for(i=0; i<F_MAG_N; i++)
+        magdB[i] = magBass[i] + magMid[i] + magTreble[i];
+    freqRespPlot->m_newdata = true;
+    freqRespPlot->Refresh();
+}
+
+void FilterDlg::calcFilterSpectrum(float magdB[], int argc, char *argv[]) {
+    void       *sbq;
+    short       in[NIMP];
+    short       out[NIMP];
+    COMP        X[F_MAG_N];
+    float       f, w;
+    int         i, k;
+
+    // find impulse response -----------------------------------
+
+    for(i=0; i<NIMP; i++)
+        in[i] = 0;
+    in[0] = IMP_AMP;
+
+    //printf("argv[0]: %s argv[1]: %s\n", argv[0], argv[1]);
+    sbq = sox_biquad_create(argc, (const char **)argv);
+
+    sox_biquad_filter(sbq, out, in, NIMP);
+    //for(i=0; i<NIMP; i++)
+    //    printf("%d\n", out[i]);
+   
+    sox_biquad_destroy(sbq);
+
+    //for(i=0; i<NIMP; i++)
+    //    out[i] = 0.0;
+    //out[0] = IMP_AMP;
+
+    // calculate discrete time continous frequency Fourer transform
+    // doing this from first principles rather than FFT for no good reason
+
+    for(f=0,i=0; f<MAX_F_HZ; f+=F_STEP_DFT,i++) {
+        w = M_PI*f/(FS/2);
+        X[i].real = 0.0; X[i].imag = 0.0;
+        for(k=0; k<NIMP; k++) {
+            X[i].real += ((float)out[k]/IMP_AMP) * cos(w*k);
+            X[i].imag -= ((float)out[k]/IMP_AMP) * sin(w*k);
+        }
+        magdB[i] = 10.0*log10(X[i].real* X[i].real + X[i].imag*X[i].imag + 1E-12);
+        //printf("f: %f X[%d] = %f %f magdB = %f\n", f, i, X[i].real, X[i].imag,  magdB[i]);
+    }
+}
diff --git a/freedv-dev/src/dlg_filter.h b/freedv-dev/src/dlg_filter.h
new file mode 100644 (file)
index 0000000..82c43df
--- /dev/null
@@ -0,0 +1,166 @@
+//==========================================================================
+// Name:            dlg_filter.h
+// Purpose:         Dialog for controlling Codec audio filtering
+// Created:         Nov 25 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+
+#ifndef __FILTER_DIALOG__
+#define __FILTER_DIALOG__
+
+#include "fdmdv2_main.h"
+
+enum {disableQ = false, enableQ = true};
+
+typedef struct { 
+    wxSlider     *sliderFreq;
+    wxStaticText *valueFreq;
+    wxSlider     *sliderGain;
+    wxStaticText *valueGain;
+    wxSlider     *sliderQ;
+    wxStaticText *valueQ;
+
+    int       sliderFreqId;
+    int       sliderGainId;
+    int       sliderQId;
+    
+    float     freqHz;
+    float     gaindB;
+    float     Q;
+
+    float     maxFreqHz;
+} EQ;
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class FilterDlg
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class FilterDlg : public wxDialog
+{
+    public:
+    FilterDlg( wxWindow* parent, bool running, bool *newMicInFilter, bool *newSpkOutFilter,
+               wxWindowID id = wxID_ANY, const wxString& title = _("Filter"), 
+               const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 800, 630 ), 
+               long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
+        ~FilterDlg();
+
+        void    ExchangeData(int inout, bool storePersistent);
+
+    protected:
+        // Handlers for events.
+        void    OnCancel(wxCommandEvent& event);
+        void    OnOK(wxCommandEvent& event);
+        void    OnClose(wxCloseEvent& event);
+        void    OnInitDialog(wxInitDialogEvent& event);
+        void    OnLPCPostFilterDefault(wxCommandEvent& event);
+
+        void    OnBetaScroll(wxScrollEvent& event);
+        void    OnGammaScroll(wxScrollEvent& event);
+        void    OnEnable(wxScrollEvent& event);
+        void    OnBassBoost(wxScrollEvent& event);
+
+        void    OnSpeexppEnable(wxScrollEvent& event);
+
+        void    OnMicInBassFreqScroll(wxScrollEvent& event) { sliderToFreq(&m_MicInBass, true); }
+        void    OnMicInBassGainScroll(wxScrollEvent& event) { sliderToGain(&m_MicInBass, true); }
+        void    OnMicInTrebleFreqScroll(wxScrollEvent& event) { sliderToFreq(&m_MicInTreble, true); }
+        void    OnMicInTrebleGainScroll(wxScrollEvent& event) { sliderToGain(&m_MicInTreble, true); }
+        void    OnMicInMidFreqScroll(wxScrollEvent& event) { sliderToFreq(&m_MicInMid, true); }
+        void    OnMicInMidGainScroll(wxScrollEvent& event) { sliderToGain(&m_MicInMid, true); }
+        void    OnMicInMidQScroll(wxScrollEvent& event) { sliderToQ(&m_MicInMid, true); }
+        void    OnMicInEnable(wxScrollEvent& event);
+        void    OnMicInDefault(wxCommandEvent& event);
+
+        void    OnSpkOutBassFreqScroll(wxScrollEvent& event) { sliderToFreq(&m_SpkOutBass, false); }
+        void    OnSpkOutBassGainScroll(wxScrollEvent& event) { sliderToGain(&m_SpkOutBass, false); }
+        void    OnSpkOutTrebleFreqScroll(wxScrollEvent& event) { sliderToFreq(&m_SpkOutTreble, false); }
+        void    OnSpkOutTrebleGainScroll(wxScrollEvent& event) { sliderToGain(&m_SpkOutTreble, false); }
+        void    OnSpkOutMidFreqScroll(wxScrollEvent& event) { sliderToFreq(&m_SpkOutMid, false); }
+        void    OnSpkOutMidGainScroll(wxScrollEvent& event) { sliderToGain(&m_SpkOutMid, false); }
+        void    OnSpkOutMidQScroll(wxScrollEvent& event) { sliderToQ(&m_SpkOutMid, false); }
+        void    OnSpkOutEnable(wxScrollEvent& event);
+        void    OnSpkOutDefault(wxCommandEvent& event);
+
+        wxStaticText* m_staticText8;
+        wxCheckBox*   m_codec2LPCPostFilterEnable;
+        wxStaticText* m_staticText9;
+        wxCheckBox*   m_codec2LPCPostFilterBassBoost;
+        wxStaticText* m_staticText91;
+        wxSlider*     m_codec2LPCPostFilterBeta;
+        wxStaticText* m_staticTextBeta;
+        wxStaticText* m_staticText911;
+        wxSlider*     m_codec2LPCPostFilterGamma;
+        wxStaticText* m_staticTextGamma;
+        wxButton*     m_LPCPostFilterDefault;
+
+        wxCheckBox*   m_ckboxSpeexpp;
+
+        wxStdDialogButtonSizer* m_sdbSizer5;
+        wxButton*     m_sdbSizer5OK;
+        wxButton*     m_sdbSizer5Cancel;
+        PlotSpectrum* m_MicInFreqRespPlot;
+        PlotSpectrum* m_SpkOutFreqRespPlot;
+        
+        wxCheckBox*   m_MicInEnable;
+        wxButton*     m_MicInDefault;
+        wxCheckBox*   m_SpkOutEnable;
+        wxButton*     m_SpkOutDefault;
+
+        float        *m_MicInMagdB;
+        float        *m_SpkOutMagdB;
+
+     private:
+        bool          m_running;
+        float         m_beta;
+        float         m_gamma;
+
+        void          setBeta(void);  // sets slider and static text from m_beta
+        void          setGamma(void); // sets slider and static text from m_gamma
+        void          setCodec2(void);
+        void          newEQControl(wxSlider** slider, wxStaticText** value, wxStaticBoxSizer *bs, wxString controlName);
+        EQ            newEQ(wxSizer *bs, wxString eqName, float maxFreqHz, bool enableQ);
+        void          newLPCPFControl(wxSlider **slider, wxStaticText **stValue, wxSizer *sbs, wxString controlName);
+        wxAuiNotebook *m_auiNotebook;
+        void          setFreq(EQ *eq);
+        void          setGain(EQ *eq);
+        void          setQ(EQ *eq);
+        void          sliderToFreq(EQ *eq, bool micIn);
+        void          sliderToGain(EQ *eq, bool micIn);
+        void          sliderToQ(EQ *eq, bool micIn);
+        void          plotFilterSpectrum(EQ *eqBass, EQ *eqMid, EQ* eqTreble, PlotSpectrum* freqRespPlot, float *magdB);
+        void          calcFilterSpectrum(float magdB[], int arc, char *argv[]);
+        void          plotMicInFilterSpectrum(void);
+        void          plotSpkOutFilterSpectrum(void);
+        void          adjRunTimeMicInFilter(void);
+        void          adjRunTimeSpkOutFilter(void);
+
+        EQ            m_MicInBass;
+        EQ            m_MicInMid;
+        EQ            m_MicInTreble;
+
+        EQ            m_SpkOutBass;
+        EQ            m_SpkOutMid;
+        EQ            m_SpkOutTreble;
+
+        float         limit(float value, float min, float max);
+        bool          *m_newMicInFilter;
+        bool          *m_newSpkOutFilter;
+
+};
+
+#endif // __FILTER_DIALOG__
diff --git a/freedv-dev/src/dlg_options.cpp b/freedv-dev/src/dlg_options.cpp
new file mode 100644 (file)
index 0000000..9189feb
--- /dev/null
@@ -0,0 +1,363 @@
+//==========================================================================
+// Name:            dlg_options.cpp
+// Purpose:         Dialog for controlling misc FreeDV options
+// Date:            May 24 2013
+// 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+
+#include "dlg_options.h"
+extern bool g_modal;
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class OptionsDlg
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+OptionsDlg::OptionsDlg(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* bSizer30;
+    bSizer30 = new wxBoxSizer(wxVERTICAL);
+
+    //------------------------------
+    // Test Frames check box
+    //------------------------------
+
+    wxStaticBoxSizer* sbSizer_testFrames;
+    wxStaticBox *sb_testFrames = new wxStaticBox(this, wxID_ANY, _("Test Frames"));
+    sbSizer_testFrames = new wxStaticBoxSizer(sb_testFrames, wxHORIZONTAL);
+
+    m_ckboxTestFrame = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
+    m_ckboxTestFrame->SetToolTip(_("Send frames of known bits instead of compressed voice"));
+    sbSizer_testFrames->Add(m_ckboxTestFrame, 0, wxALIGN_LEFT, 0);
+
+    m_ckboxChannelNoise = new wxCheckBox(this, wxID_ANY, _("Channel Noise"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
+    m_ckboxChannelNoise->SetToolTip(_("Add simulated AWGN channel noise to received signal"));
+    sbSizer_testFrames->Add(m_ckboxChannelNoise, 0, wxALIGN_LEFT, 0);
+
+    bSizer30->Add(sbSizer_testFrames,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
+
+    //------------------------------
+    // FreeDV 700 Options
+    //------------------------------
+
+    wxStaticBoxSizer* sbSizer_freedv700;
+    wxStaticBox *sb_freedv700 = new wxStaticBox(this, wxID_ANY, _("FreeDV 700 Clipping"));
+    sbSizer_freedv700 = new wxStaticBoxSizer(sb_freedv700, wxHORIZONTAL);
+
+    m_ckboxFreeDV700txClip = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
+    m_ckboxFreeDV700txClip->SetToolTip(_("Clip FreeDv 700 tx waveform to reduce Peak to Average Power Ratio (PAPR)"));
+    sbSizer_freedv700->Add(m_ckboxFreeDV700txClip, 0, wxALIGN_LEFT, 0);
+
+    bSizer30->Add(sbSizer_freedv700,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
+
+    //------------------------------
+    // Txt Msg Text Box
+    //------------------------------
+
+    wxStaticBoxSizer* sbSizer_callSign;
+    wxStaticBox *sb_textMsg = new wxStaticBox(this, wxID_ANY, _("Txt Msg"));
+    sbSizer_callSign = new wxStaticBoxSizer(sb_textMsg, wxVERTICAL);
+
+    m_txtCtrlCallSign = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
+    m_txtCtrlCallSign->SetToolTip(_("Txt Msg you can send along with Voice"));
+    sbSizer_callSign->Add(m_txtCtrlCallSign, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3);
+
+    bSizer30->Add(sbSizer_callSign,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
+    //------------------------------
+    // Txt Encoding 
+    //------------------------------
+
+    wxStaticBoxSizer* sbSizer_encoding = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Text Encoding")), wxHORIZONTAL);
+
+#ifdef SHORT_VARICODE
+    m_rb_textEncoding1 = new wxRadioButton( this, wxID_ANY, wxT("Long varicode"), wxDefaultPosition, wxDefaultSize, 0);
+    m_rb_textEncoding1->SetValue(true);
+    sbSizer_encoding->Add(m_rb_textEncoding1, 0, wxALIGN_LEFT|wxALL, 1);
+    m_rb_textEncoding2 = new wxRadioButton( this, wxID_ANY, wxT("Short Varicode"), wxDefaultPosition, wxDefaultSize, 0);
+    sbSizer_encoding->Add(m_rb_textEncoding2, 0, wxALIGN_LEFT|wxALL, 1);
+#endif
+
+    m_ckboxEnableChecksum = new wxCheckBox(this, wxID_ANY, _("Use Checksum on Rx"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
+    sbSizer_encoding->Add(m_ckboxEnableChecksum, 0, wxALIGN_LEFT, 0);
+
+    bSizer30->Add(sbSizer_encoding,0, wxALL|wxEXPAND, 3);
+    //------------------------------
+    // Event processing
+    //------------------------------
+
+    wxStaticBoxSizer* sbSizer_events;
+    wxStaticBox *sb_events = new wxStaticBox(this, wxID_ANY, _("Event Processing"));
+    sbSizer_events = new wxStaticBoxSizer(sb_events, wxVERTICAL);
+
+    // event processing enable and spam timer
+
+    wxStaticBoxSizer* sbSizer_events_top;
+    wxStaticBox* sb_events1 = new wxStaticBox(this, wxID_ANY, _(""));    
+    sbSizer_events_top = new wxStaticBoxSizer(sb_events1, wxHORIZONTAL);
+
+    m_ckbox_events = new wxCheckBox(this, wxID_ANY, _("Enable System Calls    Syscall Spam Timer"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
+    sb_events->SetToolTip(_("Enable processing of events and generation of system calls"));
+    sbSizer_events_top->Add(m_ckbox_events, 0, 0, 5);
+    m_txt_spam_timer = new wxTextCtrl(this, wxID_ANY,  wxEmptyString, wxDefaultPosition, wxSize(40,-1), 0, wxTextValidator(wxFILTER_DIGITS));
+    m_txt_spam_timer->SetToolTip(_("Many matching events can cause a flood of syscalls. Set minimum time (seconds) between syscalls for each event here"));
+    sbSizer_events_top->Add(m_txt_spam_timer, 0, 0, 5);
+    m_rb_spam_timer = new wxRadioButton( this, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
+    m_rb_spam_timer->SetForegroundColour( wxColour(0, 255, 0 ) );
+    sbSizer_events_top->Add(m_rb_spam_timer, 0, 0, 10);
+    sbSizer_events->Add(sbSizer_events_top, 0, 0, 5);
+
+    // list of regexps
+
+    wxStaticBoxSizer* sbSizer_regexp = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Regular Expressions to Process Events")), wxHORIZONTAL);
+    m_txt_events_regexp_match = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(200,100), wxTE_MULTILINE);
+    m_txt_events_regexp_match->SetToolTip(_("Enter regular expressions to match events"));
+    sbSizer_regexp->Add(m_txt_events_regexp_match, 1, wxEXPAND, 5);
+    m_txt_events_regexp_replace = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(200,100), wxTE_MULTILINE);
+    m_txt_events_regexp_replace->SetToolTip(_("Enter regular expressions to replace events"));
+    sbSizer_regexp->Add(m_txt_events_regexp_replace, 1, wxEXPAND, 5);
+    sbSizer_events->Add(sbSizer_regexp, 1, wxEXPAND, 5);
+
+    // log of events and responses
+
+    wxStaticBoxSizer* sbSizer_event_log = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Log of Events and Responses")), wxVERTICAL);
+    wxBoxSizer* bSizer33 = new wxBoxSizer(wxHORIZONTAL);
+    m_txt_events_in = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(200,50), wxTE_MULTILINE | wxTE_READONLY);
+    bSizer33->Add(m_txt_events_in, 1, wxEXPAND, 5);
+    m_txt_events_out = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(200,50), wxTE_MULTILINE | wxTE_READONLY);
+    bSizer33->Add(m_txt_events_out, 1, wxEXPAND, 5);
+    sbSizer_event_log->Add(bSizer33, 1, wxEXPAND, 5);
+    sbSizer_events->Add(sbSizer_event_log, 1, wxEXPAND, 5);
+
+    bSizer30->Add(sbSizer_events,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
+
+    //------------------------------
+    // UDP control port
+    //------------------------------
+
+    wxStaticBoxSizer* sbSizer_udp;
+    wxStaticBox* sb_udp = new wxStaticBox(this, wxID_ANY, _("UDP Control Port"));
+    sbSizer_udp = new wxStaticBoxSizer(sb_udp, wxHORIZONTAL);
+    m_ckbox_udp_enable = new wxCheckBox(this, wxID_ANY, _("Enable UDP Control Port    UDP Port Number:"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
+    sb_udp->SetToolTip(_("Enable control of FreeDV via UDP port"));
+    sbSizer_udp->Add(m_ckbox_udp_enable, 0,  wxALIGN_CENTER_HORIZONTAL, 5);
+    m_txt_udp_port = new wxTextCtrl(this, wxID_ANY,  wxEmptyString, wxDefaultPosition, wxSize(50,-1), 0, wxTextValidator(wxFILTER_DIGITS));
+    sbSizer_udp->Add(m_txt_udp_port, 0, wxALIGN_CENTER_HORIZONTAL, 5);
+
+    bSizer30->Add(sbSizer_udp,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
+
+    //------------------------------
+    // OK - Cancel - Apply Buttons 
+    //------------------------------
+
+    wxBoxSizer* bSizer31 = new wxBoxSizer(wxHORIZONTAL);
+
+    m_sdbSizer5OK = new wxButton(this, wxID_OK);
+    bSizer31->Add(m_sdbSizer5OK, 0, wxALL, 2);
+
+    m_sdbSizer5Cancel = new wxButton(this, wxID_CANCEL);
+    bSizer31->Add(m_sdbSizer5Cancel, 0, wxALL, 2);
+
+    m_sdbSizer5Apply = new wxButton(this, wxID_APPLY);
+    bSizer31->Add(m_sdbSizer5Apply, 0, wxALL, 2);
+
+    bSizer30->Add(bSizer31, 0, wxALIGN_RIGHT|wxALL, 0);
+
+    this->SetSizer(bSizer30);
+    this->Layout();
+
+    this->Centre(wxBOTH);
+    // Connect Events -------------------------------------------------------
+
+    this->Connect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(OptionsDlg::OnInitDialog));
+
+    m_sdbSizer5OK->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsDlg::OnOK), NULL, this);
+    m_sdbSizer5Cancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsDlg::OnCancel), NULL, this);
+    m_sdbSizer5Apply->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsDlg::OnApply), NULL, this);
+
+    m_ckboxFreeDV700txClip->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(OptionsDlg::OnFreeDV700txClip), NULL, this);
+
+    event_in_serial = 0;
+    event_out_serial = 0;
+}
+
+//-------------------------------------------------------------------------
+// ~OptionsDlg()
+//-------------------------------------------------------------------------
+OptionsDlg::~OptionsDlg()
+{
+
+    // Disconnect Events
+
+    this->Disconnect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(OptionsDlg::OnInitDialog));
+
+    m_sdbSizer5OK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsDlg::OnOK), NULL, this);
+    m_sdbSizer5Cancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsDlg::OnCancel), NULL, this);
+    m_sdbSizer5Apply->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsDlg::OnApply), NULL, this);
+    m_ckboxFreeDV700txClip->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(OptionsDlg::OnFreeDV700txClip), NULL, this);
+}
+
+
+//-------------------------------------------------------------------------
+// ExchangeData()
+//-------------------------------------------------------------------------
+void OptionsDlg::ExchangeData(int inout, bool storePersistent)
+{
+    wxConfigBase *pConfig = wxConfigBase::Get();
+
+    if(inout == EXCHANGE_DATA_IN)
+    {
+        m_txtCtrlCallSign->SetValue(wxGetApp().m_callSign);
+        m_ckboxTestFrame->SetValue(wxGetApp().m_testFrames);
+        m_ckboxChannelNoise->SetValue(wxGetApp().m_channel_noise);
+
+        m_ckbox_events->SetValue(wxGetApp().m_events);
+        m_txt_spam_timer->SetValue(wxString::Format(wxT("%i"),wxGetApp().m_events_spam_timer));
+
+        m_txt_events_regexp_match->SetValue(wxGetApp().m_events_regexp_match);
+        m_txt_events_regexp_replace->SetValue(wxGetApp().m_events_regexp_replace);
+        
+        m_ckbox_udp_enable->SetValue(wxGetApp().m_udp_enable);
+        m_txt_udp_port->SetValue(wxString::Format(wxT("%i"),wxGetApp().m_udp_port));
+
+#ifdef SHORT_VARICODE
+        if (wxGetApp().m_textEncoding == 1)
+            m_rb_textEncoding1->SetValue(true);
+        if (wxGetApp().m_textEncoding == 2)
+            m_rb_textEncoding2->SetValue(true);
+#endif
+        m_ckboxEnableChecksum->SetValue(wxGetApp().m_enable_checksum);
+
+        m_ckboxFreeDV700txClip->SetValue(wxGetApp().m_FreeDV700txClip);
+    }
+
+    if(inout == EXCHANGE_DATA_OUT)
+    {
+        wxGetApp().m_callSign      = m_txtCtrlCallSign->GetValue();
+        wxGetApp().m_testFrames    = m_ckboxTestFrame->GetValue();
+        wxGetApp().m_channel_noise = m_ckboxChannelNoise->GetValue();
+
+        wxGetApp().m_events        = m_ckbox_events->GetValue();
+        long spam_timer;
+        m_txt_spam_timer->GetValue().ToLong(&spam_timer);
+        wxGetApp().m_events_spam_timer = (int)spam_timer;
+
+        // make sure regexp lists are terminated by a \n
+
+        if (m_txt_events_regexp_match->GetValue().Last() != '\n') {
+            m_txt_events_regexp_match->SetValue(m_txt_events_regexp_match->GetValue()+'\n');
+        }
+        if (m_txt_events_regexp_replace->GetValue().Last() != '\n') {
+            m_txt_events_regexp_replace->SetValue(m_txt_events_regexp_replace->GetValue()+'\n');
+        }
+        wxGetApp().m_events_regexp_match = m_txt_events_regexp_match->GetValue();
+        wxGetApp().m_events_regexp_replace = m_txt_events_regexp_replace->GetValue();
+        wxGetApp().m_udp_enable     = m_ckbox_udp_enable->GetValue();
+        long port;
+        m_txt_udp_port->GetValue().ToLong(&port);
+        wxGetApp().m_udp_port       = (int)port;
+
+#ifdef SHORT_VARICODE
+        if (m_rb_textEncoding1->GetValue())
+            wxGetApp().m_textEncoding = 1;
+        if (m_rb_textEncoding2->GetValue())
+            wxGetApp().m_textEncoding = 2;
+#endif
+        wxGetApp().m_enable_checksum = m_ckboxEnableChecksum->GetValue();
+
+        wxGetApp().m_FreeDV700txClip = m_ckboxFreeDV700txClip->GetValue();
+
+        if (storePersistent) {
+            pConfig->Write(wxT("/Data/CallSign"), wxGetApp().m_callSign);
+#ifdef SHORT_VARICODE
+            pConfig->Write(wxT("/Data/TextEncoding"), wxGetApp().m_textEncoding);
+#endif
+            pConfig->Write(wxT("/Data/EnableChecksumOnMsgRx"), wxGetApp().m_enable_checksum);
+
+            pConfig->Write(wxT("/Events/enable"), wxGetApp().m_events);
+            pConfig->Write(wxT("/Events/spam_timer"), wxGetApp().m_events_spam_timer);
+            pConfig->Write(wxT("/Events/regexp_match"), wxGetApp().m_events_regexp_match);
+            pConfig->Write(wxT("/Events/regexp_replace"), wxGetApp().m_events_regexp_replace);
+            
+            pConfig->Write(wxT("/UDP/enable"), wxGetApp().m_udp_enable);
+            pConfig->Write(wxT("/UDP/port"),  wxGetApp().m_udp_port);
+
+            pConfig->Write(wxT("/FreeDV700/txClip"), wxGetApp().m_FreeDV700txClip);
+
+            pConfig->Flush();
+        }
+    }
+    delete wxConfigBase::Set((wxConfigBase *) NULL);
+}
+
+//-------------------------------------------------------------------------
+// OnOK()
+//-------------------------------------------------------------------------
+void OptionsDlg::OnOK(wxCommandEvent& event)
+{
+    ExchangeData(EXCHANGE_DATA_OUT, true);
+    //this->EndModal(wxID_OK);
+    g_modal = false;
+    this->Show(false);
+}
+
+//-------------------------------------------------------------------------
+// OnCancel()
+//-------------------------------------------------------------------------
+void OptionsDlg::OnCancel(wxCommandEvent& event)
+{
+    //this->EndModal(wxID_CANCEL);
+    g_modal = false;
+    this->Show(false);
+}
+
+//-------------------------------------------------------------------------
+// OnApply()
+//-------------------------------------------------------------------------
+void OptionsDlg::OnApply(wxCommandEvent& event)
+{
+    ExchangeData(EXCHANGE_DATA_OUT, true);
+}
+
+//-------------------------------------------------------------------------
+// OnInitDialog()
+//-------------------------------------------------------------------------
+void OptionsDlg::OnInitDialog(wxInitDialogEvent& event)
+{
+    ExchangeData(EXCHANGE_DATA_IN, false);
+}
+
+// immediately change flags rather using ExchangeData() so we can switch on and off at run time
+
+void OptionsDlg::OnFreeDV700txClip(wxScrollEvent& event) {
+    wxGetApp().m_FreeDV700txClip = m_ckboxFreeDV700txClip->GetValue();
+}
+
+
+void OptionsDlg::updateEventLog(wxString event_in, wxString event_out) {
+    wxString event_in_with_serial, event_out_with_serial; 
+    event_in_with_serial.Printf(_T("[%d] %s"), event_in_serial++, event_in);
+    event_out_with_serial.Printf(_T("[%d] %s"), event_out_serial++, event_out);
+
+    m_txt_events_in->AppendText(event_in_with_serial+"\n");
+    m_txt_events_out->AppendText(event_out_with_serial+"\n");
+}
+
diff --git a/freedv-dev/src/dlg_options.h b/freedv-dev/src/dlg_options.h
new file mode 100644 (file)
index 0000000..fe355ac
--- /dev/null
@@ -0,0 +1,99 @@
+//==========================================================================
+// Name:            dlg_options.h
+// Purpose:         Dialog for controlling misc FreeDV options
+// Created:         Nov 25 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+
+#ifndef __OPTIONS_DIALOG__
+#define __OPTIONS_DIALOG__
+
+#include "fdmdv2_main.h"
+#include "fdmdv2_defines.h"
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class OptionsDlg
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class OptionsDlg : public wxDialog
+{
+    public:
+    OptionsDlg( wxWindow* parent,
+               wxWindowID id = wxID_ANY, const wxString& title = _("Options"), 
+                const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(600,630), 
+               long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
+        ~OptionsDlg();
+
+        void    ExchangeData(int inout, bool storePersistent);
+        void    updateEventLog(wxString event_in, wxString event_out);
+
+        bool    enableEventsChecked() {return m_ckbox_events->GetValue();}
+
+        void SetSpamTimerLight(bool state) {
+
+            // Colours don't work on Windows
+
+            if (state) {
+                m_rb_spam_timer->SetForegroundColour( wxColour( 255,0 , 0 ) ); // red
+                m_rb_spam_timer->SetValue(true);
+            }
+            else {
+                m_rb_spam_timer->SetForegroundColour( wxColour( 0, 255, 0 ) ); // green
+                m_rb_spam_timer->SetValue(false);
+            }
+        }
+
+
+    protected:
+        // Handlers for events.
+        void    OnOK(wxCommandEvent& event);
+        void    OnCancel(wxCommandEvent& event);
+        void    OnApply(wxCommandEvent& event);
+        void    OnClose(wxCloseEvent& event);
+        void    OnInitDialog(wxInitDialogEvent& event);
+        void    OnFreeDV700txClip(wxScrollEvent& event);
+
+        wxTextCtrl   *m_txtCtrlCallSign; // TODO: this should be renamed to tx_txtmsg, and rename all related incl persis strge
+        wxCheckBox   *m_ckboxTestFrame;
+        wxCheckBox   *m_ckboxChannelNoise;
+        wxCheckBox   *m_ckboxFreeDV700txClip;
+
+        wxRadioButton *m_rb_textEncoding1;
+        wxRadioButton *m_rb_textEncoding2;
+        wxCheckBox    *m_ckboxEnableChecksum;
+
+        wxCheckBox   *m_ckbox_events;
+        wxTextCtrl   *m_txt_events_regexp_match;
+        wxTextCtrl   *m_txt_events_regexp_replace;
+        wxTextCtrl   *m_txt_events_in;
+        wxTextCtrl   *m_txt_events_out;
+        wxTextCtrl   *m_txt_spam_timer;
+        wxRadioButton *m_rb_spam_timer;
+
+        wxCheckBox   *m_ckbox_udp_enable;
+        wxTextCtrl   *m_txt_udp_port;
+
+        wxButton*     m_sdbSizer5OK;
+        wxButton*     m_sdbSizer5Cancel;
+        wxButton*     m_sdbSizer5Apply;
+
+        unsigned int  event_in_serial, event_out_serial;
+
+     private:
+};
+
+#endif // __OPTIONS_DIALOG__
diff --git a/freedv-dev/src/dlg_ptt.cpp b/freedv-dev/src/dlg_ptt.cpp
new file mode 100644 (file)
index 0000000..2643c1d
--- /dev/null
@@ -0,0 +1,416 @@
+//==========================================================================
+// Name:            dlg_ptt.cpp
+// Purpose:         Subclasses dialog GUI for PTT Config. Creates simple 
+//                  wxWidgets dialog GUI to select real/virtual Comm ports.
+// Date:            May 11 2012
+// Authors:         David Rowe, David Witten, Joel Stanley
+// 
+// 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#include "dlg_ptt.h"
+#include "fdmdv2_main.h"
+
+#ifdef __WIN32__
+#include <wx/msw/registry.h>
+#endif
+#ifdef __FreeBSD__
+#include <glob.h>
+#include <string.h>
+#endif
+
+#include <sstream>
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class ComPortsDlg
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+ComPortsDlg::ComPortsDlg(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style)
+{
+    wxBoxSizer* mainSizer = new wxBoxSizer(wxVERTICAL);
+    this->SetSizer(mainSizer);
+    
+    //----------------------------------------------------------------------
+    // Half Duplex Flag for VOX PTT
+    //----------------------------------------------------------------------
+
+    // DR: should this be on options dialog?
+
+    wxStaticBoxSizer* staticBoxSizer28 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("VOX PTT Settings")), wxHORIZONTAL);
+    m_ckHalfDuplex = new wxCheckBox(this, wxID_ANY, _("Half Duplex"), wxDefaultPosition, wxSize(-1,-1), 0);
+    staticBoxSizer28->Add(m_ckHalfDuplex, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
+    m_ckLeftChannelVoxTone = new wxCheckBox(this, wxID_ANY, _("Left Channel Vox Tone"), wxDefaultPosition, wxSize(-1,-1), 0);
+    staticBoxSizer28->Add(m_ckLeftChannelVoxTone, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
+
+    mainSizer->Add(staticBoxSizer28, 0, wxEXPAND, 5);
+
+    //----------------------------------------------------------------------
+    // Hamlib for CAT PTT
+    //----------------------------------------------------------------------
+
+    wxStaticBoxSizer* staticBoxSizer18 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("Hamlib Settings")), wxVERTICAL);
+
+    wxBoxSizer* gridSizer100 = new wxBoxSizer(wxHORIZONTAL);
+
+    /* Use Hamlib for PTT checkbox. */
+    m_ckUseHamlibPTT = new wxCheckBox(this, wxID_ANY, _("Use Hamlib PTT"), wxDefaultPosition, wxSize(-1, -1), 0);
+    m_ckUseHamlibPTT->SetValue(false);
+    gridSizer100->Add(m_ckUseHamlibPTT, 0, wxALIGN_CENTER_VERTICAL, 0);
+
+    /* Hamlib Rig Type combobox. */
+    gridSizer100->Add(new wxStaticText(this, wxID_ANY, _("Rig Model:"), wxDefaultPosition, wxDefaultSize, 0), 
+                      0, wxALIGN_CENTER_VERTICAL | wxLEFT, 20);
+    m_cbRigName = new wxComboBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(250, -1), 0, NULL, wxCB_DROPDOWN);
+    /* TODO(Joel): this is a hack. At the least, need to gurantee that m_hamLib
+     * exists. */
+    wxGetApp().m_hamlib->populateComboBox(m_cbRigName);
+    m_cbRigName->SetSelection(wxGetApp().m_intHamlibRig);
+    gridSizer100->Add(m_cbRigName, 0, wxALIGN_CENTER_VERTICAL, 0);
+
+    /* Hamlib Serial Port combobox. */
+    gridSizer100->Add(new wxStaticText(this, wxID_ANY, _("Serial Device:"), wxDefaultPosition, wxDefaultSize, 0), 
+                      0, wxALIGN_CENTER_VERTICAL | wxLEFT, 20);
+    m_cbSerialPort = new wxComboBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(140, -1), 0, NULL, wxCB_DROPDOWN);
+    gridSizer100->Add(m_cbSerialPort, 0, wxALIGN_CENTER_VERTICAL, 0);
+
+    staticBoxSizer18->Add(gridSizer100, 1);
+    mainSizer->Add(staticBoxSizer18, 1);
+
+    //----------------------------------------------------------------------
+    // Serial port PTT
+    //----------------------------------------------------------------------
+
+    wxStaticBoxSizer* staticBoxSizer17 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("Serial Port Settings")), wxVERTICAL);
+    mainSizer->Add(staticBoxSizer17, 1, wxEXPAND, 5);
+    wxStaticBoxSizer* staticBoxSizer31 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("PTT Port")), wxVERTICAL);
+    staticBoxSizer17->Add(staticBoxSizer31, 1, wxEXPAND, 5);
+
+#ifdef __WXMSW__
+    m_ckUseSerialPTT = new wxCheckBox(this, wxID_ANY, _("Use Serial Port PTT"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_ckUseSerialPTT->SetValue(false);
+    staticBoxSizer31->Add(m_ckUseSerialPTT, 0, wxALIGN_LEFT, 20);
+
+    wxArrayString m_listCtrlPortsArr;
+    m_listCtrlPorts = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxSize(-1,45), m_listCtrlPortsArr, wxLB_SINGLE | wxLB_SORT);
+    staticBoxSizer31->Add(m_listCtrlPorts, 1, wxALIGN_CENTER, 0);
+#endif
+
+#ifdef __WXGTK__
+    wxBoxSizer* bSizer83;
+    bSizer83 = new wxBoxSizer(wxHORIZONTAL);
+
+    wxGridSizer* gridSizer200 = new wxGridSizer(1, 3, 0, 0);
+    
+    m_ckUseSerialPTT = new wxCheckBox(this, wxID_ANY, _("Use Serial Port PTT"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_ckUseSerialPTT->SetValue(false);
+    gridSizer200->Add(m_ckUseSerialPTT, 1, wxALIGN_CENTER|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 2);
+
+    m_staticText12 = new wxStaticText(this, wxID_ANY, _("Serial Device:  "), wxDefaultPosition, wxDefaultSize, 0);
+    m_staticText12->Wrap(-1);
+    gridSizer200->Add(m_staticText12, 1,wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 2);
+
+    m_cbCtlDevicePath = new wxComboBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(140, -1), 0, NULL, wxCB_DROPDOWN);
+    gridSizer200->Add(m_cbCtlDevicePath, 1, wxEXPAND|wxALIGN_CENTER|wxALIGN_RIGHT, 2);
+    
+    bSizer83->Add(gridSizer200, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT | wxALL, 2);
+    staticBoxSizer31->Add(bSizer83, 1, wxALIGN_CENTER_VERTICAL|wxALL, 1);
+#endif
+
+    wxBoxSizer* boxSizer19 = new wxBoxSizer(wxVERTICAL);
+    staticBoxSizer17->Add(boxSizer19, 1, wxEXPAND, 5);
+    wxStaticBoxSizer* staticBoxSizer16 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("Signal polarity")), wxHORIZONTAL);
+    boxSizer19->Add(staticBoxSizer16, 1, wxEXPAND|wxALIGN_CENTER|wxALIGN_RIGHT, 5);
+
+    wxGridSizer* gridSizer17 = new wxGridSizer(2, 2, 0, 0);
+    staticBoxSizer16->Add(gridSizer17, 1, wxEXPAND|wxALIGN_RIGHT, 5);
+
+    m_rbUseDTR = new wxRadioButton(this, wxID_ANY, _("Use DTR"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_rbUseDTR->SetToolTip(_("Toggle DTR line for PTT"));
+    m_rbUseDTR->SetValue(1);
+    gridSizer17->Add(m_rbUseDTR, 0, wxALIGN_CENTER|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5);
+
+    m_ckDTRPos = new wxCheckBox(this, wxID_ANY, _("DTR = +V"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_ckDTRPos->SetToolTip(_("Set Polarity of the DTR line"));
+    m_ckDTRPos->SetValue(false);
+    gridSizer17->Add(m_ckDTRPos, 0, wxALIGN_CENTER|wxALIGN_RIGHT, 5);
+
+    m_rbUseRTS = new wxRadioButton(this, wxID_ANY, _("Use RTS"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_rbUseRTS->SetToolTip(_("Toggle the RTS pin for PTT"));
+    m_rbUseRTS->SetValue(1);
+    gridSizer17->Add(m_rbUseRTS, 0, wxALIGN_CENTER|wxALIGN_RIGHT, 5);
+
+    m_ckRTSPos = new wxCheckBox(this, wxID_ANY, _("RTS = +V"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_ckRTSPos->SetValue(false);
+    m_ckRTSPos->SetToolTip(_("Set Polarity of the RTS line"));
+    gridSizer17->Add(m_ckRTSPos, 0, wxALIGN_CENTER|wxALIGN_RIGHT, 5);
+
+    //----------------------------------------------------------------------
+    // OK - Cancel - Apply
+    //----------------------------------------------------------------------
+
+    wxBoxSizer* boxSizer12 = new wxBoxSizer(wxHORIZONTAL);
+
+    m_buttonOK = new wxButton(this, wxID_OK, _("OK"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_buttonOK->SetDefault();
+    boxSizer12->Add(m_buttonOK, 0, wxLEFT|wxRIGHT|wxTOP|wxBOTTOM, 5);
+
+    m_buttonCancel = new wxButton(this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxSize(-1,-1), 0);
+    boxSizer12->Add(m_buttonCancel, 0, wxLEFT|wxRIGHT|wxTOP|wxBOTTOM, 5);
+
+    m_buttonApply = new wxButton(this, wxID_APPLY, _("Apply"), wxDefaultPosition, wxSize(-1,-1), 0);
+    boxSizer12->Add(m_buttonApply, 0, wxLEFT|wxRIGHT|wxTOP|wxBOTTOM, 5);
+
+    mainSizer->Add(boxSizer12, 0, wxLEFT|wxRIGHT|wxTOP|wxBOTTOM|wxALIGN_CENTER_HORIZONTAL, 5);
+
+    if ( GetSizer() ) 
+    {
+         GetSizer()->Fit(this);
+    }
+    Centre(wxBOTH);
+
+    // Connect events
+    this->Connect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(ComPortsDlg::OnInitDialog), NULL, this);
+    m_ckUseHamlibPTT->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(ComPortsDlg::PTTUseHamLibClicked), NULL, this);
+    m_ckUseSerialPTT->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(ComPortsDlg::PTTUseSerialClicked), NULL, this);
+    m_buttonOK->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnOK), NULL, this);
+    m_buttonCancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnCancel), NULL, this);
+    m_buttonApply->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnApply), NULL, this);
+}
+
+//-------------------------------------------------------------------------
+// ~ComPortsDlg()
+//-------------------------------------------------------------------------
+ComPortsDlg::~ComPortsDlg()
+{
+    // Disconnect Events
+    this->Disconnect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(ComPortsDlg::OnInitDialog), NULL, this);
+    m_ckUseHamlibPTT->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(ComPortsDlg::PTTUseHamLibClicked), NULL, this);
+    m_ckUseSerialPTT->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(ComPortsDlg::PTTUseSerialClicked), NULL, this);
+    m_buttonOK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnOK), NULL, this);
+    m_buttonCancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnCancel), NULL, this);
+    m_buttonApply->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnApply), NULL, this);
+}
+
+//-------------------------------------------------------------------------
+// OnInitDialog()
+//-------------------------------------------------------------------------
+void ComPortsDlg::OnInitDialog(wxInitDialogEvent& event)
+{
+    populatePortList();
+    ExchangeData(EXCHANGE_DATA_IN);
+}
+
+//-------------------------------------------------------------------------
+// populatePortList()
+//-------------------------------------------------------------------------
+void ComPortsDlg::populatePortList()
+{
+#ifdef __WXMSW__
+    m_listCtrlPorts->Clear();
+    m_cbSerialPort->Clear();
+    wxArrayString aStr;
+    wxRegKey key(wxRegKey::HKLM, _T("HARDWARE\\DEVICEMAP\\SERIALCOMM"));
+    if(!key.Exists())
+    {
+        return;
+    }
+    else
+    {
+        // Get the number of subkeys and enumerate them.
+        if(!key.Open(wxRegKey::Read))
+        {
+            return;
+        }    
+        size_t subkeys;
+        size_t values;
+        if(!key.GetKeyInfo(&subkeys, NULL, &values, NULL))
+        {
+            return;
+        }
+        if(!key.HasValues())
+        {
+            return;
+        }
+        wxString key_name;
+        long el = 1;
+        key.GetFirstValue(key_name, el);
+        wxString valType;
+        wxString key_data;
+        for(unsigned int i = 0; i < values; i++)
+        {
+            key.QueryValue(key_name, key_data);
+            //wxPrintf("Value:  %s Data: %s\n", key_name, key_data);
+            aStr.Add(key_data, 1);
+            key.GetNextValue(key_name, el);
+        }
+    }
+    m_listCtrlPorts->Append(aStr);
+    m_cbSerialPort->Append(aStr);
+#endif
+#ifdef __WXGTK__
+    m_cbSerialPort->Clear();
+    m_cbCtlDevicePath->Clear();
+#ifdef __FreeBSD__
+       glob_t  gl;
+       if(glob("/dev/tty*", GLOB_MARK, NULL, &gl)==0) {
+               for(unsigned int i=0; i<gl.gl_pathc; i++) {
+                       if(gl.gl_pathv[i][strlen(gl.gl_pathv[i])-1]=='/')
+                               continue;
+                               
+                       /* Exclude pseudo TTYs */
+                       if(gl.gl_pathv[i][8] >= 'l' && gl.gl_pathv[i][8] <= 's')
+                               continue;
+                       if(gl.gl_pathv[i][8] >= 'L' && gl.gl_pathv[i][8] <= 'S')
+                               continue;
+
+                       /* Exclude virtual TTYs */
+                       if(gl.gl_pathv[i][8] == 'v')
+                               continue;
+
+                       /* Exclude initial-state and lock-state devices */
+                       if(strchr(gl.gl_pathv[i], '.') != NULL)
+                               continue;
+
+                       m_cbSerialPort->Append(gl.gl_pathv[i]);
+                       m_cbCtlDevicePath->Append(gl.gl_pathv[i]);
+               }
+               globfree(&gl);
+       }
+#else
+    /* TODO(Joel): http://stackoverflow.com/questions/2530096/how-to-find-all-serial-devices-ttys-ttyusb-on-linux-without-opening-them */
+    m_cbSerialPort->Append("/dev/ttyUSB0");
+    m_cbSerialPort->Append("/dev/ttyUSB1");
+    m_cbSerialPort->Append("/dev/ttyS0");
+    m_cbSerialPort->Append("/dev/ttyS1");
+    m_cbCtlDevicePath->Clear();
+    m_cbCtlDevicePath->Append("/dev/ttyUSB0");
+    m_cbCtlDevicePath->Append("/dev/ttyUSB1");
+    m_cbCtlDevicePath->Append("/dev/ttyS0");
+    m_cbCtlDevicePath->Append("/dev/ttyS1");
+#endif
+#endif
+}
+
+//-------------------------------------------------------------------------
+// ExchangeData()
+//-------------------------------------------------------------------------
+void ComPortsDlg::ExchangeData(int inout)
+{
+    wxConfigBase *pConfig = wxConfigBase::Get();
+    wxString str;
+    
+    if(inout == EXCHANGE_DATA_IN)
+    {
+        m_ckHalfDuplex->SetValue(wxGetApp().m_boolHalfDuplex);
+        m_ckLeftChannelVoxTone->SetValue(wxGetApp().m_leftChannelVoxTone);
+
+        m_ckUseHamlibPTT->SetValue(wxGetApp().m_boolHamlibUseForPTT);
+        m_cbRigName->SetSelection(wxGetApp().m_intHamlibRig);
+        m_cbSerialPort->SetValue(wxGetApp().m_strHamlibSerialPort);
+
+        m_ckUseSerialPTT->SetValue(wxGetApp().m_boolUseSerialPTT);
+        str = wxGetApp().m_strRigCtrlPort;
+#ifdef __WXMSW__
+        m_listCtrlPorts->SetStringSelection(str);
+#endif
+#ifdef __WXGTK__
+        m_cbCtlDevicePath->SetValue(str);
+#endif
+        m_rbUseRTS->SetValue(wxGetApp().m_boolUseRTS);
+        m_ckRTSPos->SetValue(wxGetApp().m_boolRTSPos);
+        m_rbUseDTR->SetValue(wxGetApp().m_boolUseDTR);
+        m_ckDTRPos->SetValue(wxGetApp().m_boolDTRPos);
+    }
+    if(inout == EXCHANGE_DATA_OUT)
+    {
+        wxGetApp().m_boolHalfDuplex = m_ckHalfDuplex->GetValue();
+        pConfig->Write(wxT("/Rig/HalfDuplex"), wxGetApp().m_boolHalfDuplex);
+        wxGetApp().m_leftChannelVoxTone = m_ckLeftChannelVoxTone->GetValue();
+        pConfig->Write(wxT("/Rig/leftChannelVoxTone"), wxGetApp().m_leftChannelVoxTone);
+
+        /* Hamlib settings. */
+
+        wxGetApp().m_boolHamlibUseForPTT = m_ckUseHamlibPTT->GetValue();
+        wxGetApp().m_intHamlibRig = m_cbRigName->GetSelection();
+        wxGetApp().m_strHamlibSerialPort = m_cbSerialPort->GetValue();
+
+        pConfig->Write(wxT("/Hamlib/UseForPTT"), wxGetApp().m_boolHamlibUseForPTT);
+        pConfig->Write(wxT("/Hamlib/RigName"), wxGetApp().m_intHamlibRig);
+        pConfig->Write(wxT("/Hamlib/SerialPort"), wxGetApp().m_strHamlibSerialPort);
+
+        /* Serial settings */
+
+        wxGetApp().m_boolUseSerialPTT           = m_ckUseSerialPTT->IsChecked();
+#ifdef __WXMSW__
+        wxGetApp().m_strRigCtrlPort             = m_listCtrlPorts->GetStringSelection();
+#endif
+#ifdef __WXGTK__
+        wxGetApp().m_strRigCtrlPort             = m_cbCtlDevicePath->GetValue();
+#endif
+        wxGetApp().m_boolUseRTS                 = m_rbUseRTS->GetValue();
+        wxGetApp().m_boolRTSPos                 = m_ckRTSPos->IsChecked();
+        wxGetApp().m_boolUseDTR                 = m_rbUseDTR->GetValue();
+        wxGetApp().m_boolDTRPos                 = m_ckDTRPos->IsChecked();
+        
+        pConfig->Write(wxT("/Rig/UseSerialPTT"),    wxGetApp().m_boolUseSerialPTT);
+        pConfig->Write(wxT("/Rig/Port"),            wxGetApp().m_strRigCtrlPort); 
+        pConfig->Write(wxT("/Rig/UseRTS"),          wxGetApp().m_boolUseRTS);
+        pConfig->Write(wxT("/Rig/RTSPolarity"),     wxGetApp().m_boolRTSPos);
+        pConfig->Write(wxT("/Rig/UseDTR"),          wxGetApp().m_boolUseDTR);
+        pConfig->Write(wxT("/Rig/DTRPolarity"),     wxGetApp().m_boolDTRPos);
+
+        pConfig->Flush();
+    }
+    delete wxConfigBase::Set((wxConfigBase *) NULL);
+}
+
+//-------------------------------------------------------------------------
+// PTTUseHamLibClicked()
+//-------------------------------------------------------------------------
+void ComPortsDlg::PTTUseHamLibClicked(wxCommandEvent& event)
+{
+    m_ckUseSerialPTT->SetValue(false);    
+}
+
+//-------------------------------------------------------------------------
+// PTTUseSerialClicked()
+//-------------------------------------------------------------------------
+void ComPortsDlg::PTTUseSerialClicked(wxCommandEvent& event)
+{
+    m_ckUseHamlibPTT->SetValue(false);
+}
+
+//-------------------------------------------------------------------------
+// OnApply()
+//-------------------------------------------------------------------------
+void ComPortsDlg::OnApply(wxCommandEvent& event)
+{
+    ExchangeData(EXCHANGE_DATA_OUT);
+}
+
+//-------------------------------------------------------------------------
+// OnCancel()
+//-------------------------------------------------------------------------
+void ComPortsDlg::OnCancel(wxCommandEvent& event)
+{
+    this->EndModal(wxID_CANCEL);
+}
+
+//-------------------------------------------------------------------------
+// OnClose()
+//-------------------------------------------------------------------------
+void ComPortsDlg::OnOK(wxCommandEvent& event)
+{
+    ExchangeData(EXCHANGE_DATA_OUT);
+    this->EndModal(wxID_OK);
+}
diff --git a/freedv-dev/src/dlg_ptt.h b/freedv-dev/src/dlg_ptt.h
new file mode 100644 (file)
index 0000000..8fa9b9d
--- /dev/null
@@ -0,0 +1,91 @@
+//==========================================================================
+// Name:            dlg_ptt.h
+// Purpose:         Subclasses dialog GUI for PTT Config.
+//                  
+// Created:         May. 11, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#ifndef __COMPORTS_DIALOG__
+#define __COMPORTS_DIALOG__
+
+#include "fdmdv2_main.h"
+#include "hamlib.h"
+#include <wx/settings.h>
+#include <wx/xrc/xmlres.h>
+#include <wx/xrc/xh_bmp.h>
+#include <wx/dialog.h>
+#include <wx/sizer.h>
+#include <wx/statbox.h>
+#include <wx/checkbox.h>
+#include <wx/listbox.h>
+#include <wx/radiobut.h>
+#include <wx/button.h>
+#include <wx/spinctrl.h>
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class ComPortsDlg
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class ComPortsDlg : public wxDialog
+{
+     public:
+        ComPortsDlg(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("PTT Config"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(450,300), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER);
+        virtual ~ComPortsDlg();
+        void    ExchangeData(int inout);
+
+    protected:
+        wxCheckBox* m_ckHalfDuplex;
+        wxCheckBox* m_ckLeftChannelVoxTone;
+
+        /* Hamlib settings.*/
+
+        wxCheckBox *m_ckUseHamlibPTT;
+        wxComboBox *m_cbRigName;
+        wxComboBox *m_cbSerialPort;
+
+        Hamlib *m_hamlib;
+
+        /* Serial Settings */
+
+        wxListBox     *m_listCtrlPorts;
+        wxCheckBox    *m_ckUseSerialPTT;
+        wxStaticText  *m_staticText12;
+        wxComboBox    *m_cbCtlDevicePath;
+        wxRadioButton *m_rbUseDTR;
+        wxCheckBox    *m_ckRTSPos;
+        wxRadioButton *m_rbUseRTS;
+        wxCheckBox    *m_ckDTRPos;
+
+        /* Ok - Cancel - Apply */
+
+        wxButton* m_buttonOK;
+        wxButton* m_buttonCancel;
+        wxButton* m_buttonApply;
+
+
+protected:
+        void populatePortList();
+
+        void PTTUseHamLibClicked(wxCommandEvent& event);
+        void PTTUseSerialClicked(wxCommandEvent& event);
+
+        void OnOK(wxCommandEvent& event);
+        void OnCancel(wxCommandEvent& event);
+        void OnApply(wxCommandEvent& event);
+        virtual void OnInitDialog(wxInitDialogEvent& event);
+};
+
+#endif // __COMPORTS_DIALOG__
diff --git a/freedv-dev/src/fdmdv2_defines.h b/freedv-dev/src/fdmdv2_defines.h
new file mode 100644 (file)
index 0000000..64aa606
--- /dev/null
@@ -0,0 +1,102 @@
+//==========================================================================
+// Name:            fdmdv2_defines.h
+// Purpose:         Definitions used by plots derived from fdmdv2_plot class.
+// Created:         August 27, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#ifndef __FDMDV2_DEFINES__
+#define __FDMDV2_DEFINES__
+
+#include "wx/wx.h"
+#include "freedv_api.h"
+#include "freedv_api_internal.h"
+
+// Spectrogram and Waterfall
+
+#define MIN_MAG_DB        -40.0     // min of spectrogram/waterfall magnitude axis
+#define MAX_MAG_DB          0.0     // max of spectrogram/waterfall magnitude axis
+#define STEP_MAG_DB         5.0     // magnitude axis step
+#define BETA                0.95    // constant for time averaging spectrum data
+#define MIN_F_HZ            0       // min freq on Waterfall and Spectrum
+#define MAX_F_HZ            3000    // max freq on Waterfall and Spectrum
+#define STEP_F_HZ           500     // major (e.g. text legend) freq step on Waterfall and Spectrum graticule
+#define STEP_MINOR_F_HZ     100     // minor (ticks) freq step on Waterfall and Spectrum graticule
+#define WATERFALL_SECS_Y    30      // number of seconds respresented by y axis of waterfall
+#define WATERFALL_SECS_STEP 5       // graticule y axis steps of waterfall
+#define DT                  0.1     // time between real time graphing updates
+#define FS                  8000    // FDMDV modem sample rate
+
+// Scatter diagram 
+
+#define SCATTER_MEM_SECS    10
+// (symbols/frame)/(graphics update period) = symbols/s sent to scatter memory
+// memory (symbols) = secs of memory * symbols/sec
+#define SCATTER_MEM_SYMS_MAX    ((int)(SCATTER_MEM_SECS*((FDMDV_NC_MAX+1)/DT)))
+
+// Waveform plotting constants
+
+#define WAVEFORM_PLOT_FS    400                            // sample rate (points/s) of waveform plotted to screen
+#define WAVEFORM_PLOT_TIME  5                              // length or entire waveform on screen
+#define WAVEFORM_PLOT_BUF   ((int)(DT*WAVEFORM_PLOT_FS))   // number of new samples we plot per DT
+
+// sample rate I/O & conversion constants
+
+#define MAX_FPB             8096                           // maximum value of portAudio framesPerBuffer
+#define PA_FPB              1024                           // nominal value of portAudio framesPerBuffer
+#define SAMPLE_RATE         48000                          // 48 kHz sampling rate rec. as we can trust accuracy of sound card
+#define N8                  160                            // processing buffer size at 8 kHz
+#define MEM8                (FDMDV_OS_TAPS/FDMDV_OS)
+#define N48                 (N8*SAMPLE_RATE/FS)            // processing buffer size at 48 kHz
+#define NUM_CHANNELS        2                              // I think most sound cards prefer stereo we will convert to mono
+#define VOX_TONE_FREQ       1000.0                         // optional left channel vox tone freq
+#define VOX_TONE_AMP        30000                          // optional left channel vox tone amp
+
+#define MAX_BITS_PER_CODEC_FRAME 64                            // 1600 bit/s mode
+#define MAX_BYTES_PER_CODEC_FRAME (MAX_BITS_PER_CODEC_FRAME/8)
+#define MAX_BITS_PER_FDMDV_FRAME 40                            // 2000 bit/s mode
+
+// Squelch
+#define SQ_DEFAULT_SNR       2.0
+
+// Level Gauge
+#define FROM_RADIO_MAX       0.8
+#define FROM_MIC_MAX         0.8
+#define LEVEL_BETA           0.99
+
+// SNR
+#define SNRSLOW_BETA        0.5                           // time constant for slow SNR for display
+
+// Text messaging Data
+#define MAX_CALLSIGN         80
+#define MAX_EVENT_LOG        10
+#define MAX_EVENT_RULES      100
+   
+enum
+{
+    ID_ROTATE_LEFT = wxID_HIGHEST + 1,
+    ID_ROTATE_RIGHT,
+    ID_RESIZE,
+    ID_PAINT_BG
+};
+
+// Codec 2 LPC Post Filter defaults, from codec-dev/src/quantise.c
+
+#define CODEC2_LPC_PF_GAMMA 0.5
+#define CODEC2_LPC_PF_BETA  0.2
+
+
+#endif  //__FDMDV2_DEFINES__
diff --git a/freedv-dev/src/fdmdv2_main.cpp b/freedv-dev/src/fdmdv2_main.cpp
new file mode 100644 (file)
index 0000000..37bf6a4
--- /dev/null
@@ -0,0 +1,3697 @@
+//==========================================================================
+// Name:            fdmdv2_main.cpp
+//
+// Purpose:         FreeDV main()
+// Created:         Apr. 9, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+
+#include "fdmdv2_main.h"
+
+#define wxUSE_FILEDLG   1
+#define wxUSE_LIBPNG    1
+#define wxUSE_LIBJPEG   1
+#define wxUSE_GIF       1
+#define wxUSE_PCX       1
+#define wxUSE_LIBTIFF   1
+
+//-------------------------------------------------------------------
+// Bunch of globals used for communication with sound card call
+// back functions
+// ------------------------------------------------------------------
+
+int g_in, g_out;
+
+// Global Codec2 & modem states - just one reqd for tx & rx
+int                 g_Nc;
+int                 g_mode;
+struct freedv      *g_pfreedv;
+struct MODEM_STATS  g_stats;
+float               g_pwr_scale;
+int                 g_clip;
+
+// test Frames
+int                 g_testFrames;
+int                 g_test_frame_sync_state;
+int                 g_test_frame_count;
+int                 g_total_bits;
+int                 g_total_bit_errors;
+int                 g_channel_noise;
+float               g_sig_pwr_av = 0.0;
+struct FIFO        *g_error_pattern_fifo;
+short              *g_error_hist;
+// time averaged magnitude spectrum used for waterfall and spectrum display
+float               g_avmag[MODEM_STATS_NSPEC];
+
+// GUI controls that affect rx and tx processes
+int   g_SquelchActive;
+float g_SquelchLevel;
+int   g_analog;
+int   g_split;
+int   g_tx;
+float g_snr;
+bool  g_half_duplex;
+bool  g_modal;
+
+// sending and receiving Call Sign data
+struct FIFO         *g_txDataInFifo;
+struct FIFO         *g_rxDataOutFifo;
+
+// tx/rx processing states
+int                 g_State;
+paCallBackData     *g_rxUserdata;
+
+// FIFOs used for plotting waveforms
+struct FIFO        *g_plotDemodInFifo;
+struct FIFO        *g_plotSpeechOutFifo;
+struct FIFO        *g_plotSpeechInFifo;
+
+// Soundcard config
+int                 g_nSoundCards;
+int                 g_soundCard1InDeviceNum;
+int                 g_soundCard1OutDeviceNum;
+int                 g_soundCard1SampleRate;
+int                 g_soundCard2InDeviceNum;
+int                 g_soundCard2OutDeviceNum;
+int                 g_soundCard2SampleRate;
+
+// playing and recording from sound files
+
+SNDFILE            *g_sfPlayFile;
+bool                g_playFileToMicIn;
+bool                g_loopPlayFileToMicIn;
+int                 g_playFileToMicInEventId;
+
+SNDFILE            *g_sfRecFile;
+bool                g_recFileFromRadio;
+unsigned int        g_recFromRadioSamples;
+int                 g_recFileFromRadioEventId;
+
+SNDFILE            *g_sfPlayFileFromRadio;
+bool                g_playFileFromRadio;
+int                 g_sfFs;
+bool                g_loopPlayFileFromRadio;
+int                 g_playFileFromRadioEventId;
+float               g_blink;
+
+wxWindow           *g_parent;
+
+// Click to tune rx and tx frequency offset states
+float               g_RxFreqOffsetHz;
+COMP                g_RxFreqOffsetPhaseRect;
+float               g_TxFreqOffsetHz;
+COMP                g_TxFreqOffsetPhaseRect;
+
+// experimental mutex to make sound card callbacks mutually exclusive
+// TODO: review code and see if we need this any more, as fifos should
+// now be thread safe
+
+wxMutex g_mutexProtectingCallbackData;
+
+// Speex pre-processor states
+
+SpeexPreprocessState *g_speex_st;
+
+// WxWidgets - initialize the application
+IMPLEMENT_APP(MainApp);
+
+//FILE *ft;
+FILE *g_logfile;
+
+//-------------------------------------------------------------------------
+// OnInit()
+//-------------------------------------------------------------------------
+bool MainApp::OnInit()
+{
+    if(!wxApp::OnInit())
+    {
+        return false;
+    }
+    SetVendorName(wxT("CODEC2-Project"));
+    SetAppName(wxT("FreeDV"));      // not needed, it's the default value
+
+    // DR - this is wrong define so won't be used on windows build, should be __WXMSW__
+    // So registry will be used for Win32
+#ifdef _WXMSW_
+    // Force use of file-based configuration persistance on Windows platforma
+    wxConfig *pConfig = new wxConfig();
+    wxFileConfig *pFConfig = new wxFileConfig(wxT("FreeDV"), wxT("CODEC2-Project"), wxT("FreeDV.conf"), wxT("FreeDV.conf"),  wxCONFIG_USE_LOCAL_FILE | wxCONFIG_USE_RELATIVE_PATH);
+    pConfig->Set(pFConfig);
+    pConfig->SetRecordDefaults();
+#else
+    wxConfigBase *pConfig = wxConfigBase::Get();
+    pConfig->SetRecordDefaults();
+#endif
+
+    m_rTopWindow = wxRect(0, 0, 0, 0);
+    m_strRxInAudio.Empty();
+    m_strRxOutAudio.Empty();
+    m_textVoiceInput.Empty();
+    m_textVoiceOutput.Empty();
+    m_strSampleRate.Empty();
+    m_strBitrate.Empty();
+    // Create the main application window
+    frame = new MainFrame(NULL);
+    SetTopWindow(frame);
+    // Should guarantee that the first plot tab defined is the one
+    // displayed. But it doesn't when built from command line.  Why?
+    frame->m_auiNbookCtrl->ChangeSelection(0);
+    frame->Layout();
+    frame->Show();
+    g_parent =frame;
+
+    //ft = fopen("tmp.raw","wb");
+    //assert(ft != NULL);
+
+    return true;
+}
+
+//-------------------------------------------------------------------------
+// OnExit()
+//-------------------------------------------------------------------------
+int MainApp::OnExit()
+{
+    return 0;
+}
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class MainFrame(wxFrame* pa->ent) : TopFrame(parent)
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+MainFrame::MainFrame(wxWindow *parent) : TopFrame(parent)
+{
+    m_zoom              = 1.;
+
+    #ifdef __WXMSW__
+    g_logfile = fopen("log.txt","wt");
+    #else
+    g_logfile = stderr;
+    #endif
+
+    SetMinSize(wxSize(400,400));
+
+    // Init Hamlib library, but we dont start talking to any rigs yet
+
+    wxGetApp().m_hamlib = new Hamlib();
+
+    tools->AppendSeparator();
+    wxMenuItem* m_menuItemToolsConfigDelete;
+    m_menuItemToolsConfigDelete = new wxMenuItem(tools, wxID_ANY, wxString(_("&Restore defaults")) , wxT("Delete config file/keys and restore defaults"), wxITEM_NORMAL);
+    this->Connect(m_menuItemToolsConfigDelete->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::OnDeleteConfig));
+
+    tools->Append(m_menuItemToolsConfigDelete);
+
+    wxConfigBase *pConfig = wxConfigBase::Get();
+
+    // restore frame position and size
+    int x = pConfig->Read(wxT("/MainFrame/left"),       20);
+    int y = pConfig->Read(wxT("/MainFrame/top"),        20);
+    int w = pConfig->Read(wxT("/MainFrame/width"),     800);
+    int h = pConfig->Read(wxT("/MainFrame/height"),    550);
+
+    // sanitise frame position as a first pass at Win32 registry bug
+
+    fprintf(g_logfile, "x = %d y = %d w = %d h = %d\n", x,y,w,h);
+    if (x < 0 || x > 2048) x = 20;
+    if (y < 0 || y > 2048) y = 20;
+    if (w < 0 || w > 2048) w = 800;
+    if (h < 0 || h > 2048) h = 550;
+
+    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_show_speech_in     = pConfig->Read(wxT("/MainFrame/show_speech_in"),    1);
+    wxGetApp().m_show_speech_out    = pConfig->Read(wxT("/MainFrame/show_speech_out"),   1);
+    wxGetApp().m_show_demod_in      = pConfig->Read(wxT("/MainFrame/show_demod_in"),     1);
+    wxGetApp().m_show_test_frame_errors = pConfig->Read(wxT("/MainFrame/show_test_frame_errors"),     1);
+    wxGetApp().m_show_test_frame_errors_hist = pConfig->Read(wxT("/MainFrame/show_test_frame_errors_hist"),     1);
+
+    wxGetApp().m_rxNbookCtrl        = pConfig->Read(wxT("/MainFrame/rxNbookCtrl"),    (long)0);
+
+    g_SquelchActive = pConfig->Read(wxT("/Audio/SquelchActive"), (long)0);
+    g_SquelchLevel = pConfig->Read(wxT("/Audio/SquelchLevel"), (int)(SQ_DEFAULT_SNR*2));
+    g_SquelchLevel /= 2.0;
+
+    Move(x, y);
+    SetClientSize(w, h);
+    
+    if(wxGetApp().m_show_wf)
+    {
+        // Add Waterfall Plot window
+        m_panelWaterfall = new PlotWaterfall((wxFrame*) m_auiNbookCtrl, false, 0);
+        m_panelWaterfall->SetToolTip(_("Left click to tune, Right click to toggle mono/colour"));
+        m_auiNbookCtrl->AddPage(m_panelWaterfall, _("Waterfall"), true, wxNullBitmap);
+    }
+    if(wxGetApp().m_show_spect)
+    {
+        // Add Spectrum Plot window
+        m_panelSpectrum = new PlotSpectrum((wxFrame*) m_auiNbookCtrl, g_avmag,
+                                           MODEM_STATS_NSPEC*((float)MAX_F_HZ/MODEM_STATS_MAX_F_HZ));
+        m_panelSpectrum->SetToolTip(_("Left click to tune"));
+        m_auiNbookCtrl->AddPage(m_panelSpectrum, _("Spectrum"), true, wxNullBitmap);
+    }
+    if(wxGetApp().m_show_scatter)
+    {
+        // Add Scatter Plot window
+        m_panelScatter = new PlotScatter((wxFrame*) m_auiNbookCtrl);
+        m_auiNbookCtrl->AddPage(m_panelScatter, _("Scatter"), true, wxNullBitmap);
+    }
+    if(wxGetApp().m_show_demod_in)
+    {
+        // Add Demod Input window
+        m_panelDemodIn = new PlotScalar((wxFrame*) m_auiNbookCtrl, 1, WAVEFORM_PLOT_TIME, 1.0/WAVEFORM_PLOT_FS, -1, 1, 1, 0.2, "%2.1f", 0);
+        m_auiNbookCtrl->AddPage(m_panelDemodIn, _("Frm Radio"), true, wxNullBitmap);
+        g_plotDemodInFifo = fifo_create(2*WAVEFORM_PLOT_BUF);
+    }
+
+    if(wxGetApp().m_show_speech_in)
+    {
+        // Add Speech Input window
+        m_panelSpeechIn = new PlotScalar((wxFrame*) m_auiNbookCtrl, 1, WAVEFORM_PLOT_TIME, 1.0/WAVEFORM_PLOT_FS, -1, 1, 1, 0.2, "%2.1f", 0);
+        m_auiNbookCtrl->AddPage(m_panelSpeechIn, _("Frm Mic"), true, wxNullBitmap);
+        g_plotSpeechInFifo = fifo_create(4*WAVEFORM_PLOT_BUF);
+    }
+
+    if(wxGetApp().m_show_speech_out)
+    {
+        // Add Speech Output window
+        m_panelSpeechOut = new PlotScalar((wxFrame*) m_auiNbookCtrl, 1, WAVEFORM_PLOT_TIME, 1.0/WAVEFORM_PLOT_FS, -1, 1, 1, 0.2, "%2.1f", 0);
+        m_auiNbookCtrl->AddPage(m_panelSpeechOut, _("To Spkr/Hdphns"), true, wxNullBitmap);
+        g_plotSpeechOutFifo = fifo_create(2*WAVEFORM_PLOT_BUF);
+    }
+
+    if(wxGetApp().m_show_timing)
+    {
+        // Add Timing Offset window
+        m_panelTimeOffset = new PlotScalar((wxFrame*) m_auiNbookCtrl, 1, 5.0, DT, -0.5, 0.5, 1, 0.1, "%2.1f", 0);
+        m_auiNbookCtrl->AddPage(m_panelTimeOffset, L"Timing \u0394", true, wxNullBitmap);
+    }
+    if(wxGetApp().m_show_freq)
+    {
+        // Add Frequency Offset window
+        m_panelFreqOffset = new PlotScalar((wxFrame*) m_auiNbookCtrl, 1, 5.0, DT, -200, 200, 1, 50, "%3.0fHz", 0);
+        m_auiNbookCtrl->AddPage(m_panelFreqOffset, L"Frequency \u0394", true, wxNullBitmap);
+    }
+
+    if(wxGetApp().m_show_test_frame_errors)
+    {
+        // Add Test Frame Errors window
+        m_panelTestFrameErrors = new PlotScalar((wxFrame*) m_auiNbookCtrl, 2*MODEM_STATS_NC_MAX, 30.0, DT, 0, 2*MODEM_STATS_NC_MAX+2, 1, 1, "", 1);
+        m_auiNbookCtrl->AddPage(m_panelTestFrameErrors, L"Test Frame Errors", true, wxNullBitmap);
+    }
+
+    if(wxGetApp().m_show_test_frame_errors_hist)
+    {
+        // Add Test Frame Errors window
+        m_panelTestFrameErrorsHist = new PlotScalar((wxFrame*) m_auiNbookCtrl, 1, 1.0, 1.0/(2*FDMDV_NC_MAX), 0.0, 1.0, 1.0/FDMDV_NC_MAX, 0.1, "%3.2f", 0);
+        m_auiNbookCtrl->AddPage(m_panelTestFrameErrorsHist, L"Test Frame Histogram", true, wxNullBitmap);
+    }
+
+    wxGetApp().m_framesPerBuffer = pConfig->Read(wxT("/Audio/framesPerBuffer"), PA_FPB);
+
+    g_soundCard1InDeviceNum  = pConfig->Read(wxT("/Audio/soundCard1InDeviceNum"),         -1);
+    g_soundCard1OutDeviceNum = pConfig->Read(wxT("/Audio/soundCard1OutDeviceNum"),        -1);
+    g_soundCard1SampleRate   = pConfig->Read(wxT("/Audio/soundCard1SampleRate"),          -1);
+
+    g_soundCard2InDeviceNum  = pConfig->Read(wxT("/Audio/soundCard2InDeviceNum"),         -1);
+    g_soundCard2OutDeviceNum = pConfig->Read(wxT("/Audio/soundCard2OutDeviceNum"),        -1);
+    g_soundCard2SampleRate   = pConfig->Read(wxT("/Audio/soundCard2SampleRate"),          -1);
+
+    g_nSoundCards = 0;
+    if ((g_soundCard1InDeviceNum > -1) && (g_soundCard1OutDeviceNum > -1)) {
+        g_nSoundCards = 1;
+        if ((g_soundCard2InDeviceNum > -1) && (g_soundCard2OutDeviceNum > -1))
+            g_nSoundCards = 2;
+    }
+
+    wxGetApp().m_playFileToMicInPath = pConfig->Read("/File/playFileToMicInPath",   wxT(""));
+    wxGetApp().m_recFileFromRadioPath = pConfig->Read("/File/recFileFromRadioPath", wxT(""));
+    wxGetApp().m_recFileFromRadioSecs = pConfig->Read("/File/recFileFromRadioSecs", 30);
+    wxGetApp().m_playFileFromRadioPath = pConfig->Read("/File/playFileFromRadioPath", wxT(""));
+
+    // PTT -------------------------------------------------------------------
+
+    wxGetApp().m_boolHalfDuplex     = pConfig->ReadBool(wxT("/Rig/HalfDuplex"),     true);
+    wxGetApp().m_leftChannelVoxTone = pConfig->ReadBool("/Rig/leftChannelVoxTone",  false);
+    wxGetApp().m_boolHamlibUseForPTT = pConfig->ReadBool("/Hamlib/UseForPTT", false);
+    wxGetApp().m_intHamlibRig = pConfig->ReadLong("/Hamlib/RigName", 0);
+    wxGetApp().m_strHamlibSerialPort = pConfig->Read("/Hamlib/SerialPort", "");
+    
+    wxGetApp().m_boolUseSerialPTT   = pConfig->ReadBool(wxT("/Rig/UseSerialPTT"),   false);
+    wxGetApp().m_strRigCtrlPort     = pConfig->Read(wxT("/Rig/Port"),               wxT(""));
+    wxGetApp().m_boolUseRTS         = pConfig->ReadBool(wxT("/Rig/UseRTS"),         true);
+    wxGetApp().m_boolRTSPos         = pConfig->ReadBool(wxT("/Rig/RTSPolarity"),    true);
+    wxGetApp().m_boolUseDTR         = pConfig->ReadBool(wxT("/Rig/UseDTR"),         false);
+    wxGetApp().m_boolDTRPos         = pConfig->ReadBool(wxT("/Rig/DTRPolarity"),    false);
+    com_handle = COM_HANDLE_INVALID;
+
+    // -----------------------------------------------------------------------
+
+    bool slow = false; // prevents compile error when using default bool
+    wxGetApp().m_snrSlow = pConfig->Read("/Audio/snrSlow", slow);
+
+    bool t = true;     // prevents compile error when using default bool
+    wxGetApp().m_codec2LPCPostFilterEnable     = pConfig->Read(wxT("/Filter/codec2LPCPostFilterEnable"),    t);
+    wxGetApp().m_codec2LPCPostFilterBassBoost  = pConfig->Read(wxT("/Filter/codec2LPCPostFilterBassBoost"), t);
+    wxGetApp().m_codec2LPCPostFilterGamma      = (float)pConfig->Read(wxT("/Filter/codec2LPCPostFilterGamma"),     CODEC2_LPC_PF_GAMMA*100)/100.0;
+    wxGetApp().m_codec2LPCPostFilterBeta       = (float)pConfig->Read(wxT("/Filter/codec2LPCPostFilterBeta"),      CODEC2_LPC_PF_BETA*100)/100.0;
+    //printf("main(): m_codec2LPCPostFilterBeta: %f\n", wxGetApp().m_codec2LPCPostFilterBeta);
+
+    wxGetApp().m_speexpp_enable     = pConfig->Read(wxT("/Filter/speexpp_enable"),    t);
+
+    wxGetApp().m_MicInBassFreqHz = (float)pConfig->Read(wxT("/Filter/MicInBassFreqHz"),    1);
+    wxGetApp().m_MicInBassGaindB = (float)pConfig->Read(wxT("/Filter/MicInBassGaindB"),    (long)0)/10.0;
+    wxGetApp().m_MicInTrebleFreqHz = (float)pConfig->Read(wxT("/Filter/MicInTrebleFreqHz"),    1);
+    wxGetApp().m_MicInTrebleGaindB = (float)pConfig->Read(wxT("/Filter/MicInTrebleGaindB"),    (long)0)/10.0;
+    wxGetApp().m_MicInMidFreqHz = (float)pConfig->Read(wxT("/Filter/MicInMidFreqHz"),    1);
+    wxGetApp().m_MicInMidGaindB = (float)pConfig->Read(wxT("/Filter/MicInMidGaindB"),    (long)0)/10.0;
+    wxGetApp().m_MicInMidQ = (float)pConfig->Read(wxT("/Filter/MicInMidQ"),              (long)100)/100.0;
+
+    bool f = false;
+    wxGetApp().m_MicInEQEnable = (float)pConfig->Read(wxT("/Filter/MicInEQEnable"), f);
+
+    wxGetApp().m_SpkOutBassFreqHz = (float)pConfig->Read(wxT("/Filter/SpkOutBassFreqHz"),    1);
+    wxGetApp().m_SpkOutBassGaindB = (float)pConfig->Read(wxT("/Filter/SpkOutBassGaindB"),    (long)0)/10.0;
+    wxGetApp().m_SpkOutTrebleFreqHz = (float)pConfig->Read(wxT("/Filter/SpkOutTrebleFreqHz"),    1);
+    wxGetApp().m_SpkOutTrebleGaindB = (float)pConfig->Read(wxT("/Filter/SpkOutTrebleGaindB"),    (long)0)/10.0;
+    wxGetApp().m_SpkOutMidFreqHz = (float)pConfig->Read(wxT("/Filter/SpkOutMidFreqHz"),    1);
+    wxGetApp().m_SpkOutMidGaindB = (float)pConfig->Read(wxT("/Filter/SpkOutMidGaindB"),    (long)0)/10.0;
+    wxGetApp().m_SpkOutMidQ = (float)pConfig->Read(wxT("/Filter/SpkOutMidQ"),                (long)100)/100.0;
+
+    wxGetApp().m_SpkOutEQEnable = (float)pConfig->Read(wxT("/Filter/SpkOutEQEnable"), f);
+
+    wxGetApp().m_callSign = pConfig->Read("/Data/CallSign", wxT(""));
+    wxGetApp().m_textEncoding = pConfig->Read("/Data/TextEncoding", 1);
+    wxGetApp().m_enable_checksum = pConfig->Read("/Data/EnableChecksumOnMsgRx", f);
+
+    wxGetApp().m_events = pConfig->Read("/Events/enable", f);
+    wxGetApp().m_events_spam_timer = (int)pConfig->Read(wxT("/Events/spam_timer"), 10);
+    wxGetApp().m_events_regexp_match = pConfig->Read("/Events/regexp_match", wxT("s=(.*)"));
+    wxGetApp().m_events_regexp_replace = pConfig->Read("/Events/regexp_replace", 
+                                                       wxT("curl http://qso.freedv.org/cgi-bin/onspot.cgi?s=\\1"));
+    // make sure regexp lists are terminated by a \n
+
+    if (wxGetApp().m_events_regexp_match.Last() != '\n') {
+        wxGetApp().m_events_regexp_match = wxGetApp().m_events_regexp_match+'\n';
+    }
+    if (wxGetApp().m_events_regexp_replace.Last() != '\n') {
+        wxGetApp().m_events_regexp_replace = wxGetApp().m_events_regexp_replace+'\n';
+    }
+
+    wxGetApp().m_udp_enable = (float)pConfig->Read(wxT("/UDP/enable"), f);
+    wxGetApp().m_udp_port = (int)pConfig->Read(wxT("/UDP/port"), 3000);
+
+    wxGetApp().m_FreeDV700txClip = (float)pConfig->Read(wxT("/FreeDV700/txClip"), t);
+
+    int mode  = pConfig->Read(wxT("/Audio/mode"), (long)0);
+    if (mode == 0)
+        m_rb1600->SetValue(1);
+    if (mode == 1)
+        m_rb700->SetValue(1);
+    if (mode == 2)
+        m_rb700b->SetValue(1);
+        
+    pConfig->SetPath(wxT("/"));
+
+//    this->Connect(m_menuItemHelpUpdates->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnHelpCheckUpdatesUI));
+    //m_togRxID->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnRxIDUI), NULL, this);
+    //m_togTxID->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnTxIDUI), NULL, this);
+    m_togBtnOnOff->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnOnOffUI), NULL, this);
+    m_togBtnSplit->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnSplitClickUI), NULL, this);
+    m_togBtnAnalog->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnAnalogClickUI), NULL, this);
+    //m_togBtnALC->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnALCClickUI), NULL, this);
+   // m_btnTogPTT->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnPTT_UI), NULL, this);
+
+    m_togBtnSplit->Disable();
+    //m_togRxID->Disable();
+    //m_togTxID->Disable();
+    m_togBtnAnalog->Disable();
+    m_btnTogPTT->Disable();
+    //m_togBtnALC->Disable();
+
+    // squelch settings
+    char sqsnr[15];
+    m_sliderSQ->SetValue((int)((g_SquelchLevel+5.0)*2.0));
+    sprintf(sqsnr, "%4.1f", g_SquelchLevel);
+    wxString sqsnr_string(sqsnr);
+    m_textSQ->SetLabel(sqsnr_string);
+    m_ckboxSQ->SetValue(g_SquelchActive);
+
+    // SNR settings
+
+    m_ckboxSNR->SetValue(wxGetApp().m_snrSlow);
+    setsnrBeta(wxGetApp().m_snrSlow);
+
+#ifdef _USE_TIMER
+    Bind(wxEVT_TIMER, &MainFrame::OnTimer, this);       // ID_MY_WINDOW);
+    m_plotTimer.SetOwner(this, ID_TIMER_WATERFALL);
+    //m_panelWaterfall->Refresh();
+#endif
+
+    m_RxRunning = false;
+
+#ifdef _USE_ONIDLE
+    Connect(wxEVT_IDLE, wxIdleEventHandler(MainFrame::OnIdle), NULL, this);
+#endif //_USE_ONIDLE
+
+    g_sfPlayFile = NULL;
+    g_playFileToMicIn = false;
+    g_loopPlayFileToMicIn = false;
+
+    g_sfRecFile = NULL;
+    g_recFileFromRadio = false;
+
+    g_sfPlayFileFromRadio = NULL;
+    g_playFileFromRadio = false;
+    g_loopPlayFileFromRadio = false;
+
+    // init click-tune states
+
+    g_RxFreqOffsetHz = 0.0;
+    g_RxFreqOffsetPhaseRect.real = cos(0.0);
+    g_RxFreqOffsetPhaseRect.imag = sin(0.0);
+    m_panelWaterfall->setRxFreq(FDMDV_FCENTRE - g_RxFreqOffsetHz);
+    m_panelSpectrum->setRxFreq(FDMDV_FCENTRE - g_RxFreqOffsetHz);
+
+    g_TxFreqOffsetHz = 0.0;
+    g_TxFreqOffsetPhaseRect.real = cos(0.0);
+    g_TxFreqOffsetPhaseRect.imag = sin(0.0);
+
+    g_tx = 0;
+    g_split = 0;
+
+    // data states
+    g_txDataInFifo = fifo_create(MAX_CALLSIGN*VARICODE_MAX_BITS);
+    g_rxDataOutFifo = fifo_create(MAX_CALLSIGN*VARICODE_MAX_BITS);
+
+    sox_biquad_start();
+    golay23_init();
+
+    g_testFrames = 0;
+    g_test_frame_sync_state = 0;
+    g_total_bit_errors = 0;
+    g_total_bits = 0;
+    wxGetApp().m_testFrames = false;
+
+    g_modal = false;
+
+    // Start UDP listener thread
+
+    m_UDPThread = NULL;
+    startUDPThread();
+
+    optionsDlg = new OptionsDlg(NULL);
+    m_schedule_restore = false;
+
+}
+
+//-------------------------------------------------------------------------
+// ~MainFrame()
+//-------------------------------------------------------------------------
+MainFrame::~MainFrame()
+{
+    int x;
+    int y;
+    int w;
+    int h;
+
+    //fclose(ft);
+    #ifdef __WXMSW__
+    fclose(g_logfile);
+    #endif
+
+    if (optionsDlg != NULL) {
+        delete optionsDlg;
+        optionsDlg = NULL;
+    }
+
+    stopUDPThread();
+
+    /* TOOD(Joel): the ownership of m_hamlib is probably wrong. */
+    if (wxGetApp().m_hamlib) delete wxGetApp().m_hamlib;
+
+    //MainApp *pApp = wxGetApp();
+    wxConfigBase *pConfig = wxConfigBase::Get();
+    if(pConfig)
+    {
+        if (!IsIconized()) {
+            GetClientSize(&w, &h);
+
+            // big hack - for some reason height shrinks by this much
+            // every time FreeDV runs!  I have no idea why
+
+            h += 23;
+
+            GetPosition(&x, &y);
+            printf("x = %d y = %d w = %d h = %d\n", x,y,w,h);
+            pConfig->Write(wxT("/MainFrame/left"),               (long) x);
+            pConfig->Write(wxT("/MainFrame/top"),                (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("/MainFrame/show_speech_in"),    wxGetApp().m_show_speech_in);
+        pConfig->Write(wxT("/MainFrame/show_speech_out"),   wxGetApp().m_show_speech_out);
+        pConfig->Write(wxT("/MainFrame/show_demod_in"),     wxGetApp().m_show_demod_in);
+        pConfig->Write(wxT("/MainFrame/show_test_frame_errors"), wxGetApp().m_show_test_frame_errors);
+        pConfig->Write(wxT("/MainFrame/show_test_frame_errors_hist"), wxGetApp().m_show_test_frame_errors_hist);
+
+        pConfig->Write(wxT("/MainFrame/rxNbookCtrl"), wxGetApp().m_rxNbookCtrl);
+
+        pConfig->Write(wxT("/Audio/SquelchActive"),         g_SquelchActive);
+        pConfig->Write(wxT("/Audio/SquelchLevel"),          (int)(g_SquelchLevel*2.0));
+
+        pConfig->Write(wxT("/Audio/framesPerBuffer"),       wxGetApp().m_framesPerBuffer);
+
+        pConfig->Write(wxT("/Audio/soundCard1InDeviceNum"),   g_soundCard1InDeviceNum);
+        pConfig->Write(wxT("/Audio/soundCard1OutDeviceNum"),  g_soundCard1OutDeviceNum);
+        pConfig->Write(wxT("/Audio/soundCard1SampleRate"),    g_soundCard1SampleRate );
+
+        pConfig->Write(wxT("/Audio/soundCard2InDeviceNum"),   g_soundCard2InDeviceNum);
+        pConfig->Write(wxT("/Audio/soundCard2OutDeviceNum"),  g_soundCard2OutDeviceNum);
+        pConfig->Write(wxT("/Audio/soundCard2SampleRate"),    g_soundCard2SampleRate );
+
+        pConfig->Write(wxT("/Rig/HalfDuplex"),              wxGetApp().m_boolHalfDuplex);
+        pConfig->Write(wxT("/Rig/leftChannelVoxTone"),      wxGetApp().m_leftChannelVoxTone);
+        pConfig->Write("/Hamlib/UseForPTT", wxGetApp().m_boolHamlibUseForPTT);
+        pConfig->Write("/Hamlib/RigName", wxGetApp().m_intHamlibRig);
+        pConfig->Write("/Hamlib/SerialPort", wxGetApp().m_strHamlibSerialPort);
+
+
+        pConfig->Write(wxT("/File/playFileToMicInPath"),    wxGetApp().m_playFileToMicInPath);
+        pConfig->Write(wxT("/File/recFileFromRadioPath"),   wxGetApp().m_recFileFromRadioPath);
+        pConfig->Write(wxT("/File/recFileFromRadioSecs"),   wxGetApp().m_recFileFromRadioSecs);
+        pConfig->Write(wxT("/File/playFileFromRadioPath"),  wxGetApp().m_playFileFromRadioPath);
+
+        pConfig->Write(wxT("/Audio/snrSlow"), wxGetApp().m_snrSlow);
+
+        pConfig->Write(wxT("/Data/CallSign"), wxGetApp().m_callSign);
+        pConfig->Write(wxT("/Data/TextEncoding"), wxGetApp().m_textEncoding);
+        pConfig->Write(wxT("/Data/EnableChecksumOnMsgRx"), wxGetApp().m_enable_checksum);
+        pConfig->Write(wxT("/Events/enable"), wxGetApp().m_events);
+        pConfig->Write(wxT("/Events/spam_timer"), wxGetApp().m_events_spam_timer);
+        pConfig->Write(wxT("/Events/regexp_match"), wxGetApp().m_events_regexp_match);
+        pConfig->Write(wxT("/Events/regexp_replace"), wxGetApp().m_events_regexp_replace);
+        pConfig->Write(wxT("/UDP/enable"), wxGetApp().m_udp_enable);
+        pConfig->Write(wxT("/UDP/port"),  wxGetApp().m_udp_port);
+
+        pConfig->Write(wxT("/Filter/MicInEQEnable"), wxGetApp().m_MicInEQEnable);
+        pConfig->Write(wxT("/Filter/SpkOutEQEnable"), wxGetApp().m_SpkOutEQEnable);
+
+        pConfig->Write(wxT("/FreeDV700/txClip"), wxGetApp().m_FreeDV700txClip);
+
+        int mode;
+        if (m_rb1600->GetValue())
+            mode = 0;
+        if (m_rb700->GetValue())
+            mode = 1;
+        if (m_rb700b->GetValue())
+            mode = 2;
+        pConfig->Write(wxT("/Audio/mode"), mode);
+    }
+
+    //m_togRxID->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnRxIDUI), NULL, this);
+    //m_togTxID->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnTxIDUI), NULL, this);
+    m_togBtnOnOff->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnOnOffUI), NULL, this);
+    m_togBtnSplit->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnSplitClickUI), NULL, this);
+    m_togBtnAnalog->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnAnalogClickUI), NULL, this);
+    //m_togBtnALC->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnALCClickUI), NULL, this);
+    //m_btnTogPTT->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnPTT_UI), NULL, this);
+
+    sox_biquad_finish();
+
+    if (m_RxRunning)
+    {
+        stopRxStream();
+    }
+    if (g_sfPlayFile != NULL)
+    {
+        sf_close(g_sfPlayFile);
+        g_sfPlayFile = NULL;
+    }
+    if (g_sfRecFile != NULL)
+    {
+        sf_close(g_sfRecFile);
+        g_sfRecFile = NULL;
+    }
+#ifdef _USE_TIMER
+    if(m_plotTimer.IsRunning())
+    {
+        m_plotTimer.Stop();
+        Unbind(wxEVT_TIMER, &MainFrame::OnTimer, this);
+    }
+#endif //_USE_TIMER
+
+#ifdef _USE_ONIDLE
+    Disconnect(wxEVT_IDLE, wxIdleEventHandler(MainFrame::OnIdle), NULL, this);
+#endif // _USE_ONIDLE
+
+    delete wxConfigBase::Set((wxConfigBase *) NULL);
+}
+
+//----------------------------------------------------------------
+// closeComPort() closes the currently open com port
+//----------------------------------------------------------------
+void MainFrame::closeComPort(void)
+{
+#ifdef _WIN32
+       CloseHandle(com_handle);
+#else
+       close(com_handle);
+#endif
+       com_handle = COM_HANDLE_INVALID;
+}
+
+//----------------------------------------------------------------
+// openComPort() opens the com port specified by the string
+// ie: "COM1" on Windows or "/dev/ttyu0" on FreeBSD
+//----------------------------------------------------------------
+bool MainFrame::openComPort(const char *name)
+{
+       if(com_handle != COM_HANDLE_INVALID)
+               closeComPort();
+#ifdef _WIN32
+       {
+               COMMCONFIG CC;
+               DWORD CCsize=sizeof(CC);
+               COMMTIMEOUTS timeouts;
+               DCB     dcb;
+
+               if(GetDefaultCommConfigA(name, &CC, &CCsize)) {
+                       CC.dcb.fOutxCtsFlow             = FALSE;
+                       CC.dcb.fOutxDsrFlow             = FALSE;
+                       CC.dcb.fDtrControl              = DTR_CONTROL_DISABLE;
+                       CC.dcb.fDsrSensitivity  = FALSE;
+                       CC.dcb.fRtsControl              = RTS_CONTROL_DISABLE;
+                       SetDefaultCommConfigA(name, &CC, CCsize);
+               }
+
+               if((com_handle=CreateFileA(name
+                       ,GENERIC_READ|GENERIC_WRITE     /* Access */
+                       ,0                                                              /* Share mode */
+                       ,NULL                                                   /* Security attributes */
+                       ,OPEN_EXISTING                                  /* Create access */
+                       ,FILE_ATTRIBUTE_NORMAL                  /* File attributes */
+                       ,NULL                                                   /* Template */
+                       ))==INVALID_HANDLE_VALUE)
+                       return false;
+
+               if(GetCommTimeouts(com_handle, &timeouts)) {
+                       timeouts.ReadIntervalTimeout=MAXDWORD;
+                       timeouts.ReadTotalTimeoutMultiplier=0;
+                       timeouts.ReadTotalTimeoutConstant=0;            // No-wait read timeout
+                       timeouts.WriteTotalTimeoutMultiplier=0;
+                       timeouts.WriteTotalTimeoutConstant=5000;        // 5 seconds
+                       SetCommTimeouts(com_handle,&timeouts);
+               }
+
+               /* Force N-8-1 mode: */
+               if(GetCommState(com_handle, &dcb)==TRUE) {
+                       dcb.ByteSize            = 8;
+                       dcb.Parity                      = NOPARITY;
+                       dcb.StopBits            = ONESTOPBIT;
+                       dcb.DCBlength           = sizeof(DCB);
+                       dcb.fBinary                     = TRUE;
+                       dcb.fOutxCtsFlow        = FALSE;
+                       dcb.fOutxDsrFlow        = FALSE;
+                       dcb.fDtrControl         = DTR_CONTROL_DISABLE;
+                       dcb.fDsrSensitivity     = FALSE;
+                       dcb.fTXContinueOnXoff= TRUE;
+                       dcb.fOutX                       = FALSE;
+                       dcb.fInX                        = FALSE;
+                       dcb.fRtsControl         = RTS_CONTROL_DISABLE;
+                       dcb.fAbortOnError       = FALSE;
+                       SetCommState(com_handle, &dcb);
+               }
+       }
+#else
+       {
+               struct termios t;
+
+               if((com_handle=open(name, O_NONBLOCK|O_RDWR))==COM_HANDLE_INVALID)
+                       return false;
+
+               if(tcgetattr(com_handle, &t)==-1) {
+                       close(com_handle);
+                       com_handle = COM_HANDLE_INVALID;
+                       return false;
+               }
+
+               t.c_iflag = (
+                                         IGNBRK   /* ignore BREAK condition */
+                                       | IGNPAR   /* ignore (discard) parity errors */
+                                       );
+               t.c_oflag = 0;  /* No output processing */
+               t.c_cflag = (
+                                         CS8         /* 8 bits */
+                                       | CREAD       /* enable receiver */
+               /*
+               Fun snippet from the FreeBSD manpage:
+
+                        If CREAD is set, the receiver is enabled.  Otherwise, no character is
+                        received.  Not all hardware supports this bit.  In fact, this flag is
+                        pretty silly and if it were not part of the termios specification it
+                        would be omitted.
+               */
+                                       | CLOCAL      /* ignore modem status lines */
+                                       );
+               t.c_lflag = 0;  /* No local modes */
+               if(tcsetattr(com_handle, TCSANOW, &t)==-1) {
+                       close(com_handle);
+                       com_handle = COM_HANDLE_INVALID;
+                       return false;
+               }
+               
+       }
+#endif
+       return true;
+}
+
+#ifdef _USE_ONIDLE
+void MainFrame::OnIdle(wxIdleEvent &evt) {
+}
+#endif
+
+//----------------------------------------------------------------
+// (raise|lower)(RTS|DTR)()
+//
+// Raises/lowers the specified signal
+//----------------------------------------------------------------
+void MainFrame::raiseDTR(void)
+{
+       if(com_handle == COM_HANDLE_INVALID)
+               return;
+#ifdef _WIN32
+       EscapeCommFunction(com_handle, SETDTR);
+#else
+       {       // For C89 happiness
+               int flags = TIOCM_DTR;
+               ioctl(com_handle, TIOCMBIS, &flags);
+       }
+#endif
+}
+void MainFrame::raiseRTS(void)
+{
+       if(com_handle == COM_HANDLE_INVALID)
+               return;
+#ifdef _WIN32
+       EscapeCommFunction(com_handle, SETRTS);
+#else
+       {       // For C89 happiness
+               int flags = TIOCM_RTS;
+               ioctl(com_handle, TIOCMBIS, &flags);
+       }
+#endif
+}
+void MainFrame::lowerDTR(void)
+{
+       if(com_handle == COM_HANDLE_INVALID)
+               return;
+#ifdef _WIN32
+       EscapeCommFunction(com_handle, CLRDTR);
+#else
+       {       // For C89 happiness
+               int flags = TIOCM_DTR;
+               ioctl(com_handle, TIOCMBIC, &flags);
+       }
+#endif
+}
+void MainFrame::lowerRTS(void)
+{
+       if(com_handle == COM_HANDLE_INVALID)
+               return;
+#ifdef _WIN32
+       EscapeCommFunction(com_handle, CLRRTS);
+#else
+       {       // For C89 happiness
+               int flags = TIOCM_RTS;
+               ioctl(com_handle, TIOCMBIC, &flags);
+       }
+#endif
+}
+
+
+#ifdef _USE_TIMER
+//----------------------------------------------------------------
+// OnTimer()
+//
+// when the timer fires every DT seconds we update the GUI displays.
+// the tabs only the plot that is visible actually gets updated, this
+// keeps CPU load reasonable
+//----------------------------------------------------------------
+void MainFrame::OnTimer(wxTimerEvent &evt)
+{
+
+    int r,c;
+
+    if (m_panelWaterfall->checkDT()) {
+        m_panelWaterfall->setRxFreq(FDMDV_FCENTRE - g_RxFreqOffsetHz);
+        m_panelWaterfall->m_newdata = true;
+        m_panelWaterfall->Refresh();
+    }
+
+    m_panelSpectrum->setRxFreq(FDMDV_FCENTRE - g_RxFreqOffsetHz);
+    m_panelSpectrum->m_newdata = true;
+    m_panelSpectrum->Refresh();
+
+    /* update scatter plot -----------------------------------------------------------------*/
+
+    for (r=0; r<g_stats.nr; r++) {
+        
+        if (g_pfreedv->mode == FREEDV_MODE_1600) {
+            m_panelScatter->add_new_samples(&g_stats.rx_symbols[r][0]);
+        }
+
+        if ((g_pfreedv->mode == FREEDV_MODE_700) || (g_pfreedv->mode == FREEDV_MODE_700B)) {
+
+            /* 
+               FreeDV 700 uses diversity, so combine symbols for
+               scatter plot, as combined symbols are used for
+               demodulation.  Note we need to use a copy of the
+               symbols, as we are not sure when the stats will be
+               updated.
+            */
+
+            COMP rx_symbols_copy[g_Nc/2];
+
+            for(c=0; c<g_Nc/2; c++)
+                rx_symbols_copy[c] = cadd(g_stats.rx_symbols[r][c], g_stats.rx_symbols[r][c+g_Nc/2]);
+            m_panelScatter->add_new_samples(rx_symbols_copy);
+        }
+       
+    }
+
+    m_panelScatter->Refresh();
+
+    // Oscilliscope type speech plots -------------------------------------------------------
+
+    short speechInPlotSamples[WAVEFORM_PLOT_BUF];
+    if (fifo_read(g_plotSpeechInFifo, speechInPlotSamples, WAVEFORM_PLOT_BUF)) {
+        memset(speechInPlotSamples, 0, WAVEFORM_PLOT_BUF*sizeof(short));
+        //fprintf(stderr, "empty!\n");
+    }
+    m_panelSpeechIn->add_new_short_samples(0, speechInPlotSamples, WAVEFORM_PLOT_BUF, 32767);
+    m_panelSpeechIn->Refresh();
+
+    short speechOutPlotSamples[WAVEFORM_PLOT_BUF];
+    if (fifo_read(g_plotSpeechOutFifo, speechOutPlotSamples, WAVEFORM_PLOT_BUF))
+        memset(speechOutPlotSamples, 0, WAVEFORM_PLOT_BUF*sizeof(short));
+    m_panelSpeechOut->add_new_short_samples(0, speechOutPlotSamples, WAVEFORM_PLOT_BUF, 32767);
+    m_panelSpeechOut->Refresh();
+
+    short demodInPlotSamples[WAVEFORM_PLOT_BUF];
+    if (fifo_read(g_plotDemodInFifo, demodInPlotSamples, WAVEFORM_PLOT_BUF)) {
+        memset(demodInPlotSamples, 0, WAVEFORM_PLOT_BUF*sizeof(short));
+    }
+    m_panelDemodIn->add_new_short_samples(0,demodInPlotSamples, WAVEFORM_PLOT_BUF, 32767);
+    m_panelDemodIn->Refresh();
+
+    // Demod states -----------------------------------------------------------------------
+
+    m_panelTimeOffset->add_new_sample(0, (float)g_stats.rx_timing/FDMDV_NOM_SAMPLES_PER_FRAME);
+    m_panelTimeOffset->Refresh();
+
+    m_panelFreqOffset->add_new_sample(0, g_stats.foff);
+    m_panelFreqOffset->Refresh();
+
+    // SNR text box and gauge ------------------------------------------------------------
+
+    // LP filter g_stats.snr_est some more to stabilise the
+    // display. g_stats.snr_est already has some low pass filtering
+    // but we need it fairly fast to activate squelch.  So we
+    // optionally perform some further filtering for the display
+    // version of SNR.  The "Slow" checkbox controls the amount of
+    // filtering.  The filtered snr also controls the squelch
+
+    g_snr = m_snrBeta*g_snr + (1.0 - m_snrBeta)*g_stats.snr_est;
+    float snr_limited = g_snr;
+    if (snr_limited < -5.0) snr_limited = -5.0;
+    if (snr_limited > 20.0) snr_limited = 20.0;
+
+    char snr[15];
+    sprintf(snr, "%d", (int)(g_snr+0.5)); // round to nearest dB
+
+    //printf("snr_est: %f m_snrBeta: %f g_snr: %f snr_limited: %f\n", g_stats.snr_est,  m_snrBeta, g_snr, snr_limited);
+
+    wxString snr_string(snr);
+    m_textSNR->SetLabel(snr_string);
+    m_gaugeSNR->SetValue((int)(snr_limited+5));
+
+    // Level Gauge -----------------------------------------------------------------------
+
+    float tooHighThresh;
+    if (!g_tx && m_RxRunning)
+    {
+        // receive mode - display From Radio peaks
+        // peak from this DT sampling period
+        int maxDemodIn = 0;
+        for(int i=0; i<WAVEFORM_PLOT_BUF; i++)
+            if (maxDemodIn < abs(demodInPlotSamples[i]))
+                maxDemodIn = abs(demodInPlotSamples[i]);
+
+        // peak from last second
+        if (maxDemodIn > m_maxLevel)
+            m_maxLevel = maxDemodIn;
+
+        tooHighThresh = FROM_RADIO_MAX;
+    }
+    else
+    {
+        // transmit mode - display From Mic peaks
+
+        // peak from this DT sampling period
+        int maxSpeechIn = 0;
+        for(int i=0; i<WAVEFORM_PLOT_BUF; i++)
+            if (maxSpeechIn < abs(speechInPlotSamples[i]))
+                maxSpeechIn = abs(speechInPlotSamples[i]);
+
+        // peak from last second
+        if (maxSpeechIn > m_maxLevel)
+            m_maxLevel = maxSpeechIn;
+
+       tooHighThresh = FROM_MIC_MAX;
+    }
+
+    // Peak Reading meter: updates peaks immediately, then slowly decays
+    int maxScaled = (int)(100.0 * ((float)m_maxLevel/32767.0));
+    m_gaugeLevel->SetValue(maxScaled);
+    //printf("maxScaled: %d\n", maxScaled);
+    if (((float)maxScaled/100) > tooHighThresh)
+        m_textLevel->SetLabel("Too High");
+    else
+        m_textLevel->SetLabel("");
+
+    m_maxLevel *= LEVEL_BETA;
+
+    // sync LED (Colours don't work on Windows) ------------------------
+
+    if (g_State) {
+        m_rbSync->SetForegroundColour( wxColour( 0, 255, 0 ) ); // green
+        m_rbSync->SetValue(true);
+    }
+    else {
+        m_rbSync->SetForegroundColour( wxColour( 255, 0, 0 ) ); // red
+        m_rbSync->SetValue(false);
+    }
+
+    // send Callsign ----------------------------------------------------
+
+    char callsign[MAX_CALLSIGN];
+    strncpy(callsign, (const char*) wxGetApp().m_callSign.mb_str(wxConvUTF8), MAX_CALLSIGN-1);
+
+    // buffer 1 txt message to ensure tx data fifo doesn't "run dry"
+
+    if ((unsigned)fifo_used(g_txDataInFifo) < strlen(callsign)) {
+        unsigned int  i;
+
+        //fprintf(g_logfile, "tx callsign: %s.\n", callsign);
+
+        /* optionally append checksum */
+
+        if (wxGetApp().m_enable_checksum) {
+
+            unsigned char checksum = 0;
+            char callsign_checksum_cr[MAX_CALLSIGN+1];
+
+            for(i=0; i<strlen(callsign); i++)
+                checksum += callsign[i];
+            sprintf(callsign_checksum_cr, "%s%2x", callsign, checksum);
+            callsign_checksum_cr[strlen(callsign)+2] = 13;
+            callsign_checksum_cr[strlen(callsign)+3] = 0;
+            strcpy(callsign, callsign_checksum_cr);
+        }
+        else {
+            callsign[strlen(callsign)] = 13;
+            callsign[strlen(callsign)+1] = 0;
+        }
+
+        //fprintf(g_logfile, "tx callsign: %s.\n", callsign);
+
+        // write chars to tx data fifo
+
+        for(i=0; i<strlen(callsign); i++) {
+            short ashort = (short)callsign[i];
+            fifo_write(g_txDataInFifo, &ashort, 1);
+        }
+    }
+
+    // See if any Callsign info received --------------------------------
+
+    short ashort;
+    while (fifo_read(g_rxDataOutFifo, &ashort, 1) == 0) {
+
+        if ((ashort == 13) || ((m_pcallsign - m_callsign) > MAX_CALLSIGN-1)) {
+            // CR completes line
+            *m_pcallsign = 0;
+            
+            /* Checksums can be disabled, e.g. for compatability with
+               older vesions.  In that case we print msg but don't do
+               any event processing.  If checksums enabled, only print
+               out when checksum is good. */
+
+            if (wxGetApp().m_enable_checksum) {
+                // lets see if checksum is OK
+            
+                unsigned char checksum_rx = 0;
+                if (strlen(m_callsign) > 2) {
+                    for(unsigned int i=0; i<strlen(m_callsign)-2; i++)
+                        checksum_rx += m_callsign[i];
+                }
+                unsigned int checksum_tx;
+                int ret = sscanf(&m_callsign[strlen(m_callsign)-2], "%2x", &checksum_tx);
+                //fprintf(g_logfile, "rx callsign: %s.\n  checksum tx: %02x checksum rx: %02x\n", m_callsign, checksum_tx, checksum_rx);
+
+                wxString s;
+                if (ret && (checksum_tx == checksum_rx)) {
+                    m_callsign[strlen(m_callsign)-2] = 0;
+                    s.Printf("%s", m_callsign);
+                    m_txtCtrlCallSign->SetValue(s);
+
+                    char s1[MAX_CALLSIGN];
+                    sprintf(s1,"rx_txtmsg %s", m_callsign);
+                    processTxtEvent(s1);
+
+                    m_checksumGood++;
+                    s.Printf("%d", m_checksumGood);
+                    m_txtChecksumGood->SetLabel(s);              
+                }
+                else {
+                    m_checksumBad++;
+                    s.Printf("%d", m_checksumBad);
+                    m_txtChecksumBad->SetLabel(s);        
+                }
+            }
+
+            //fprintf(g_logfile,"resetting callsign %s %ld\n", m_callsign, m_pcallsign-m_callsign);
+            // reset ptr to start of string
+            m_pcallsign = m_callsign;
+        }
+        else {
+            //fprintf(g_logfile, "new char %d %c\n", ashort, (char)ashort);
+            *m_pcallsign++ = (char)ashort;
+        }
+
+        /* If checksums disabled, display txt chars as they arrive */
+
+        if (!wxGetApp().m_enable_checksum) {
+            m_txtCtrlCallSign->SetValue(m_callsign);
+        }
+    }
+
+    // Run time update of EQ filters -----------------------------------
+    if (m_newMicInFilter || m_newSpkOutFilter) {
+        g_mutexProtectingCallbackData.Lock();
+        deleteEQFilters(g_rxUserdata);
+        designEQFilters(g_rxUserdata);
+        g_mutexProtectingCallbackData.Unlock();
+        m_newMicInFilter = m_newSpkOutFilter = false;
+    }
+    g_rxUserdata->micInEQEnable = wxGetApp().m_MicInEQEnable;
+    g_rxUserdata->spkOutEQEnable = wxGetApp().m_SpkOutEQEnable;
+
+    // Run time update of FreeDV 700 tx clipper
+
+    g_pfreedv->clip = (int)wxGetApp().m_FreeDV700txClip;
+
+    // Test Frame Bit Error Updates ------------------------------------
+
+    // Toggle test frame mode at run time
+
+    if (!g_pfreedv->test_frames && wxGetApp().m_testFrames) {
+
+        // reset stats on check box off to on transition
+
+        g_pfreedv->test_frames = 1;
+        g_pfreedv->test_frame_sync_state = 0;
+        g_pfreedv->total_bits = 0;
+        g_pfreedv->total_bit_errors = 0;
+    }
+    g_pfreedv->test_frames =  wxGetApp().m_testFrames;
+    g_channel_noise =  wxGetApp().m_channel_noise;
+
+    if (g_State) {
+        char bits[80], errors[80], ber[80];
+
+        // update stats on main page
+
+        sprintf(bits, "Bits: %d", (int)g_pfreedv->total_bits); wxString bits_string(bits); m_textBits->SetLabel(bits_string);
+        sprintf(errors, "Errs: %d", (int)g_pfreedv->total_bit_errors); wxString errors_string(errors); m_textErrors->SetLabel(errors_string);
+        float b = (float)g_pfreedv->total_bit_errors/(1E-6+g_pfreedv->total_bits);
+        sprintf(ber, "BER: %4.3f", b); wxString ber_string(ber); m_textBER->SetLabel(ber_string);
+
+        // update error plots
+
+        int sz_error_pattern = g_pfreedv->sz_error_pattern;
+        short error_pattern[sz_error_pattern];
+
+        if (fifo_read(g_error_pattern_fifo, error_pattern, sz_error_pattern) == 0) {
+            int i,b;
+
+            /* both modes map IQ to alternate bits, but one same carrier */
+
+            if (g_pfreedv->mode == FREEDV_MODE_1600) {
+                /* FreeDV 1600 mapping from error pattern to bit on each carrier */
+
+                for(b=0; b<g_Nc*2; b++) {
+                    for(i=b; i<sz_error_pattern; i+= 2*g_Nc) {
+                        m_panelTestFrameErrors->add_new_sample(b, b + 0.8*error_pattern[i]);
+                        g_error_hist[b] += error_pattern[i];
+                    }
+                    //if (b%2)
+                    //    printf("g_error_hist[%d]: %d\n", b/2, g_error_hist[b/2]);
+                }
+
+                int max_hist = 0;
+                for(b=0; b<g_Nc; b++)
+                    if (g_error_hist[b] > max_hist)
+                        max_hist = g_error_hist[b];
+
+                m_panelTestFrameErrorsHist->add_new_short_samples(0, g_error_hist, 2*FDMDV_NC_MAX, max_hist);
+            }
+       
+            if ((g_pfreedv->mode == FREEDV_MODE_700) || (g_pfreedv->mode == FREEDV_MODE_700B)) {
+                int c;
+
+                /* FreeDV 700 mapping from error pattern to bit on each
+                   carrier.  Note we don't have access to carriers before
+                   diversity re-combination, so this won't give us the full
+                   picture, we have to assume Nc/2 carriers. */
+
+                for(i=0; i<sz_error_pattern; i++) {
+                    c = i/4;
+                    m_panelTestFrameErrors->add_new_sample(c, c + 0.8*error_pattern[i]);
+                    g_error_hist[c] += error_pattern[i];
+                    //printf("i: %d c: %d\n", i, c);
+                }
+
+                int max_hist = 0;
+                for(b=0; b<g_Nc; b++)
+                    if (g_error_hist[b] > max_hist)
+                        max_hist = g_error_hist[b];
+                m_panelTestFrameErrorsHist->add_new_short_samples(0, g_error_hist, 2*FDMDV_NC_MAX, max_hist);                
+            }
+            m_panelTestFrameErrors->Refresh();       
+            m_panelTestFrameErrorsHist->Refresh();
+        }
+    }
+
+    // command from UDP thread that is best processed in main thread to avoid seg faults
+
+    if (m_schedule_restore) {
+        if (IsIconized())
+            Restore();
+        m_schedule_restore = false;
+    }
+
+    // Light Spam Timer LED if at least one timer is running
+
+    int i;
+    optionsDlg->SetSpamTimerLight(false);
+    for(i=0; i<MAX_EVENT_RULES; i++)
+        if (spamTimer[i].IsRunning())
+            optionsDlg->SetSpamTimerLight(true);        
+
+    // Blink file playback status line
+
+    if (g_playFileFromRadio) {
+        g_blink += DT;
+        //fprintf(g_logfile, "g_blink: %f\n", g_blink);
+        if ((g_blink >= 1.0) && (g_blink < 2.0))
+            SetStatusText(wxT("Playing into from radio"), 0);
+        if (g_blink >= 2.0) {
+            SetStatusText(wxT(""), 0);
+            g_blink = 0.0;
+        }
+    }
+
+}
+#endif
+
+
+//-------------------------------------------------------------------------
+// OnCloseFrame()
+//-------------------------------------------------------------------------
+void MainFrame::OnCloseFrame(wxCloseEvent& event)
+{
+    Pa_Terminate();
+    Destroy();
+}
+
+//-------------------------------------------------------------------------
+// OnTop()
+//-------------------------------------------------------------------------
+void MainFrame::OnTop(wxCommandEvent& event)
+{
+    int style = GetWindowStyle();
+
+    if (style & wxSTAY_ON_TOP)
+    {
+        style &= ~wxSTAY_ON_TOP;
+    }
+    else
+    {
+        style |= wxSTAY_ON_TOP;
+    }
+    SetWindowStyle(style);
+}
+
+//-------------------------------------------------------------------------
+// OnDeleteConfig()
+//-------------------------------------------------------------------------
+void MainFrame::OnDeleteConfig(wxCommandEvent&)
+{
+    wxConfigBase *pConfig = wxConfigBase::Get();
+    if(pConfig->DeleteAll())
+    {
+        wxLogMessage(wxT("Config file/registry key successfully deleted."));
+
+        delete wxConfigBase::Set(NULL);
+        wxConfigBase::DontCreateOnDemand();
+    }
+    else
+    {
+        wxLogError(wxT("Deleting config file/registry key failed."));
+    }
+}
+
+//-------------------------------------------------------------------------
+// Paint()
+//-------------------------------------------------------------------------
+void MainFrame::OnPaint(wxPaintEvent& WXUNUSED(event))
+{
+    wxPaintDC dc(this);
+
+    if(GetMenuBar()->IsChecked(ID_PAINT_BG))
+    {
+        dc.Clear();
+    }
+    dc.SetUserScale(m_zoom, m_zoom);
+}
+
+//-------------------------------------------------------------------------
+// OnCmdSliderScroll()
+//-------------------------------------------------------------------------
+void MainFrame::OnCmdSliderScroll(wxScrollEvent& event)
+{
+    char sqsnr[15];
+    g_SquelchLevel = (float)m_sliderSQ->GetValue()/2.0 - 5.0;   
+    sprintf(sqsnr, "%4.1f", g_SquelchLevel); // 0.5 dB steps
+    wxString sqsnr_string(sqsnr);
+    m_textSQ->SetLabel(sqsnr_string);
+
+    event.Skip();
+}
+
+//-------------------------------------------------------------------------
+// OnCheckSQClick()
+//-------------------------------------------------------------------------
+void MainFrame::OnCheckSQClick(wxCommandEvent& event)
+{
+    if(!g_SquelchActive)
+    {
+        g_SquelchActive = true;
+    }
+    else
+    {
+        g_SquelchActive = false;
+    }
+}
+
+void MainFrame::setsnrBeta(bool snrSlow)
+{
+    if(snrSlow)
+    {
+        m_snrBeta = 0.95; // make this closer to 1.0 to smooth SNR est further
+    }
+    else
+    {
+        m_snrBeta = 0.0; // no smoothing of SNR estimate from demodulator
+    }
+}
+
+//-------------------------------------------------------------------------
+// OnCheckSQClick()
+//-------------------------------------------------------------------------
+void MainFrame::OnCheckSNRClick(wxCommandEvent& event)
+{
+    wxGetApp().m_snrSlow = m_ckboxSNR->GetValue();
+    setsnrBeta(wxGetApp().m_snrSlow);
+    //printf("m_snrSlow: %d\n", (int)wxGetApp().m_snrSlow);
+}
+
+// check for space bar press (only when running)
+
+int MainApp::FilterEvent(wxEvent& event)
+{
+    if ((event.GetEventType() == wxEVT_KEY_DOWN) && 
+        (((wxKeyEvent&)event).GetKeyCode() == WXK_SPACE))
+        {
+            // only use space to toggle PTT if we are running and no modal dialogs (like options) up
+            //fprintf(stderr,"frame->m_RxRunning: %d g_modal: %d\n",
+            //        frame->m_RxRunning, g_modal);
+            if (frame->m_RxRunning && !g_modal) {
+                if (frame->m_btnTogPTT->GetValue())
+                    frame->m_btnTogPTT->SetValue(false);
+                else
+                    frame->m_btnTogPTT->SetValue(true);
+
+                frame->togglePTT();
+
+                return true; // absorb space so we don't toggle control with focus (e.g. Start)
+
+            }
+        }
+
+    return -1;
+}
+
+//-------------------------------------------------------------------------
+// OnTogBtnPTT ()
+//-------------------------------------------------------------------------
+void MainFrame::OnTogBtnPTT (wxCommandEvent& event)
+{
+    togglePTT();
+    event.Skip();
+}
+
+void MainFrame::togglePTT(void) {
+
+    // Change tabbed page in centre panel depending on PTT state
+
+    if (g_tx)
+    {
+        // tx-> rx transition, swap to the page we were on for last rx
+        m_auiNbookCtrl->ChangeSelection(wxGetApp().m_rxNbookCtrl);
+    }
+    else
+    {
+        // rx-> tx transition, swap to Mic In page to monitor speech
+        wxGetApp().m_rxNbookCtrl = m_auiNbookCtrl->GetSelection();
+        m_auiNbookCtrl->ChangeSelection(m_auiNbookCtrl->GetPageIndex((wxWindow *)m_panelSpeechIn));
+        char e[80]; sprintf(e,"ptt"); processTxtEvent(e);
+    }
+
+    g_tx = m_btnTogPTT->GetValue();
+
+    // Hamlib PTT
+
+    if (wxGetApp().m_boolHamlibUseForPTT) {        
+        Hamlib *hamlib = wxGetApp().m_hamlib; 
+        if (wxGetApp().m_boolHamlibUseForPTT && hamlib != NULL) {
+            hamlib->ptt(g_tx);
+        }
+    }
+
+    // Serial PTT
+
+    /*  Truth table:
+
+          g_tx   RTSPos   RTS
+          -------------------
+          0      1        0
+          1      1        1
+          0      0        1
+          1      0        0
+
+          exclusive NOR
+    */
+
+    if(wxGetApp().m_boolUseSerialPTT && (com_handle != COM_HANDLE_INVALID)) {
+        if (wxGetApp().m_boolUseRTS) {
+            printf("g_tx: %d m_boolRTSPos: %d serialLine: %d\n", g_tx, wxGetApp().m_boolRTSPos, g_tx == wxGetApp().m_boolRTSPos);
+            if (g_tx == wxGetApp().m_boolRTSPos)
+                raiseRTS();
+            else
+                lowerRTS();
+        }
+        if (wxGetApp().m_boolUseDTR) {
+            printf("g_tx: %d m_boolDTRPos: %d serialLine: %d\n", g_tx, wxGetApp().m_boolDTRPos, g_tx == wxGetApp().m_boolDTRPos);
+            if (g_tx == wxGetApp().m_boolDTRPos)
+                raiseDTR();
+            else
+                lowerDTR();
+        }
+    }
+
+    // reset level gauge
+
+    m_maxLevel = 0;
+    m_textLevel->SetLabel(wxT(""));
+    m_gaugeLevel->SetValue(0);
+}
+
+//-------------------------------------------------------------------------
+// OnTogBtnRxID()
+//-------------------------------------------------------------------------
+void MainFrame::OnTogBtnRxID(wxCommandEvent& event)
+{
+    // empty any junk in rx data FIFO
+    short junk;
+    while(fifo_read(g_rxDataOutFifo,&junk,1) == 0);
+    event.Skip();
+}
+
+//-------------------------------------------------------------------------
+// OnTogBtnTxID()
+//-------------------------------------------------------------------------
+void MainFrame::OnTogBtnTxID(wxCommandEvent& event)
+{
+    event.Skip();
+}
+
+void MainFrame::OnTogBtnSplitClick(wxCommandEvent& event) {
+    if (g_split)
+        g_split = 0;
+    else
+        g_split = 1;
+    event.Skip();
+}
+
+//-------------------------------------------------------------------------
+// OnTogBtnAnalogClick()
+//-------------------------------------------------------------------------
+void MainFrame::OnTogBtnAnalogClick (wxCommandEvent& event)
+{
+    if (g_analog == 0) {
+        g_analog = 1;
+        m_panelSpectrum->setFreqScale(MODEM_STATS_NSPEC*((float)MAX_F_HZ/(FS/2)));
+        m_panelWaterfall->setFs(FS);
+    }
+    else {
+        g_analog = 0;
+        m_panelSpectrum->setFreqScale(MODEM_STATS_NSPEC*((float)MAX_F_HZ/(g_pfreedv->modem_sample_rate/2)));
+        m_panelWaterfall->setFs(g_pfreedv->modem_sample_rate);
+    }
+
+    g_State = 0;
+    g_stats.snr_est = 0;
+
+    event.Skip();
+}
+
+void MainFrame::OnCallSignReset(wxCommandEvent& event)
+{
+    m_pcallsign = m_callsign;
+    memset(m_callsign, 0, MAX_CALLSIGN);
+    wxString s;
+    s.Printf("%s", m_callsign);
+    m_txtCtrlCallSign->SetValue(s);
+    m_checksumGood = m_checksumBad = 0;
+    m_txtChecksumGood->SetLabel(_("0"));
+    m_txtChecksumBad->SetLabel(_("0"));
+}
+
+void MainFrame::OnBerReset(wxCommandEvent& event)
+{
+    g_pfreedv->total_bits = 0;
+    g_pfreedv->total_bit_errors = 0;
+    int i;
+    for(i=0; i<2*g_Nc; i++)
+        g_error_hist[i] = 0;
+    
+}
+
+#ifdef ALC
+//-------------------------------------------------------------------------
+// OnTogBtnALCClick()
+//-------------------------------------------------------------------------
+void MainFrame::OnTogBtnALCClick(wxCommandEvent& event)
+{
+    wxMessageBox(wxT("Got Click!"), wxT("OnTogBtnALCClick"), wxOK);
+
+    event.Skip();
+}
+#endif
+
+// extra panel added to file open dialog to add loop checkbox
+MyExtraPlayFilePanel::MyExtraPlayFilePanel(wxWindow *parent): wxPanel(parent)
+{
+    m_cb = new wxCheckBox(this, -1, wxT("Loop"));
+    m_cb->SetToolTip(_("When checked file will repeat forever"));
+    m_cb->SetValue(g_loopPlayFileToMicIn);
+
+    // bug: I can't this to align right.....
+    wxBoxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
+    sizerTop->Add(m_cb, 0, wxALIGN_RIGHT, 0);
+    SetSizerAndFit(sizerTop);
+}
+
+static wxWindow* createMyExtraPlayFilePanel(wxWindow *parent)
+{
+    return new MyExtraPlayFilePanel(parent);
+}
+
+//-------------------------------------------------------------------------
+// OnPlayFileToMicIn()
+//-------------------------------------------------------------------------
+void MainFrame::OnPlayFileToMicIn(wxCommandEvent& event)
+{
+    wxUnusedVar(event);
+
+    if(g_playFileToMicIn)
+    {
+        g_mutexProtectingCallbackData.Lock();
+        g_playFileToMicIn = false;
+        sf_close(g_sfPlayFile);
+        SetStatusText(wxT(""));
+        g_mutexProtectingCallbackData.Unlock();
+    }
+    else
+    {
+        wxString    soundFile;
+        SF_INFO     sfInfo;
+
+        wxFileDialog openFileDialog(
+                                    this,
+                                    wxT("Play File to Mic In"),
+                                    wxGetApp().m_playFileToMicInPath,
+                                    wxEmptyString,
+                                    wxT("WAV and RAW files (*.wav;*.raw)|*.wav;*.raw|")
+                                    wxT("All files (*.*)|*.*"),
+                                    wxFD_OPEN | wxFD_FILE_MUST_EXIST
+                                    );
+
+        // add the loop check box
+        openFileDialog.SetExtraControlCreator(&createMyExtraPlayFilePanel);
+
+        if(openFileDialog.ShowModal() == wxID_CANCEL)
+        {
+            return;     // the user changed their mind...
+        }
+
+        wxString fileName, extension;
+        soundFile = openFileDialog.GetPath();
+        wxFileName::SplitPath(soundFile, &wxGetApp().m_playFileToMicInPath, &fileName, &extension);
+        //wxLogDebug("m_playFileToMicInPath: %s", wxGetApp().m_playFileToMicInPath);
+        sfInfo.format = 0;
+
+        if(!extension.IsEmpty())
+        {
+            extension.LowerCase();
+            if(extension == wxT("raw"))
+            {
+                sfInfo.format     = SF_FORMAT_RAW | SF_FORMAT_PCM_16;
+                sfInfo.channels   = 1;
+                sfInfo.samplerate = FS;
+            }
+        }
+        g_sfPlayFile = sf_open(soundFile, SFM_READ, &sfInfo);
+        if(g_sfPlayFile == NULL)
+        {
+            wxString strErr = sf_strerror(NULL);
+            wxMessageBox(strErr, wxT("Couldn't open sound file"), wxOK);
+            return;
+        }
+
+        wxWindow * const ctrl = openFileDialog.GetExtraControl();
+
+        // Huh?! I just copied wxWidgets-2.9.4/samples/dialogs ....
+        g_loopPlayFileToMicIn = static_cast<MyExtraPlayFilePanel*>(ctrl)->getLoopPlayFileToMicIn();
+
+        SetStatusText(wxT("Playing File: ") + fileName + wxT(" to Mic Input") , 0);
+        g_playFileToMicIn = true;
+    }
+}
+
+//-------------------------------------------------------------------------
+// OnPlayFileFromRadio()
+// This puppy "plays" a recorded file into the demodulator input, allowing us
+// to replay off air signals.
+//-------------------------------------------------------------------------
+void MainFrame::OnPlayFileFromRadio(wxCommandEvent& event)
+{
+    wxUnusedVar(event);
+
+    printf("OnPlayFileFromRadio:: %d\n", (int)g_playFileFromRadio);
+    if (g_playFileFromRadio)
+    {
+        printf("OnPlayFileFromRadio:: Stop\n");
+        g_mutexProtectingCallbackData.Lock();
+        g_playFileFromRadio = false;
+        sf_close(g_sfPlayFileFromRadio);
+        SetStatusText(wxT(""),0);
+        SetStatusText(wxT(""),1);
+        g_mutexProtectingCallbackData.Unlock();
+    }
+    else
+    {
+        wxString    soundFile;
+        SF_INFO     sfInfo;
+
+        wxFileDialog openFileDialog(
+                                    this,
+                                    wxT("Play File - From Radio"),
+                                    wxGetApp().m_playFileFromRadioPath,
+                                    wxEmptyString,
+                                    wxT("WAV and RAW files (*.wav;*.raw)|*.wav;*.raw|")
+                                    wxT("All files (*.*)|*.*"),
+                                    wxFD_OPEN | wxFD_FILE_MUST_EXIST
+                                    );
+
+        // add the loop check box
+        openFileDialog.SetExtraControlCreator(&createMyExtraPlayFilePanel);
+
+        if(openFileDialog.ShowModal() == wxID_CANCEL)
+        {
+            return;     // the user changed their mind...
+        }
+
+        wxString fileName, extension;
+        soundFile = openFileDialog.GetPath();
+        wxFileName::SplitPath(soundFile, &wxGetApp().m_playFileFromRadioPath, &fileName, &extension);
+        //wxLogDebug("m_playFileToFromRadioPath: %s", wxGetApp().m_playFileFromRadioPath);
+        sfInfo.format = 0;
+
+        if(!extension.IsEmpty())
+        {
+            extension.LowerCase();
+            if(extension == wxT("raw"))
+            {
+                sfInfo.format     = SF_FORMAT_RAW | SF_FORMAT_PCM_16;
+                sfInfo.channels   = 1;
+                sfInfo.samplerate = g_pfreedv->modem_sample_rate;
+            }
+        }
+        g_sfPlayFileFromRadio = sf_open(soundFile, SFM_READ, &sfInfo);
+        g_sfFs = sfInfo.samplerate;
+        if(g_sfPlayFileFromRadio == NULL)
+        {
+            wxString strErr = sf_strerror(NULL);
+            wxMessageBox(strErr, wxT("Couldn't open sound file"), wxOK);
+            return;
+        }
+
+        wxWindow * const ctrl = openFileDialog.GetExtraControl();
+
+        // Huh?! I just copied wxWidgets-2.9.4/samples/dialogs ....
+        g_loopPlayFileFromRadio = static_cast<MyExtraPlayFilePanel*>(ctrl)->getLoopPlayFileToMicIn();
+
+        SetStatusText(wxT("Playing into from radio"), 0);
+        if(extension == wxT("raw")) {
+            wxString stringnumber = wxString::Format(wxT("%d"), (int)sfInfo.samplerate);
+            SetStatusText(wxT("raw file assuming Fs=") + stringnumber, 1);          
+        }
+        fprintf(g_logfile, "OnPlayFileFromRadio:: Playing File\n");
+        g_playFileFromRadio = true;
+        g_blink = 0.0;
+    }
+}
+
+// extra panel added to file save dialog to set number of seconds to record for
+
+MyExtraRecFilePanel::MyExtraRecFilePanel(wxWindow *parent): wxPanel(parent)
+{
+    wxBoxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
+
+    wxStaticText* staticText = new wxStaticText(this, wxID_ANY, _("Seconds:"), wxDefaultPosition, wxDefaultSize, 0);
+    sizerTop->Add(staticText, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
+    m_secondsToRecord = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
+    m_secondsToRecord->SetToolTip(_("Number of seconds to record for"));
+    m_secondsToRecord->SetValue(wxString::Format(wxT("%i"), wxGetApp().m_recFileFromRadioSecs));
+    sizerTop->Add(m_secondsToRecord, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
+    SetSizerAndFit(sizerTop);
+}
+
+static wxWindow* createMyExtraRecFilePanel(wxWindow *parent)
+{
+    return new MyExtraRecFilePanel(parent);
+}
+
+//-------------------------------------------------------------------------
+// OnRecFileFromRadio()
+//-------------------------------------------------------------------------
+void MainFrame::OnRecFileFromRadio(wxCommandEvent& event)
+{
+    wxUnusedVar(event);
+
+    if (g_recFileFromRadio) {
+        printf("Stopping Record....\n");
+        g_mutexProtectingCallbackData.Lock();
+        g_recFileFromRadio = false;
+        sf_close(g_sfRecFile);
+        SetStatusText(wxT(""));
+        g_mutexProtectingCallbackData.Unlock();
+    }
+    else {
+
+        wxString    soundFile;
+        SF_INFO     sfInfo;
+
+         wxFileDialog openFileDialog(
+                                    this,
+                                    wxT("Record File From Radio"),
+                                    wxGetApp().m_recFileFromRadioPath,
+                                    wxEmptyString,
+                                    wxT("WAV and RAW files (*.wav;*.raw)|*.wav;*.raw|")
+                                    wxT("All files (*.*)|*.*"),
+                                    wxFD_SAVE
+                                    );
+
+        // add the loop check box
+        openFileDialog.SetExtraControlCreator(&createMyExtraRecFilePanel);
+
+        if(openFileDialog.ShowModal() == wxID_CANCEL)
+        {
+            return;     // the user changed their mind...
+        }
+
+        wxString fileName, extension;
+        soundFile = openFileDialog.GetPath();
+        wxFileName::SplitPath(soundFile, &wxGetApp().m_recFileFromRadioPath, &fileName, &extension);
+        wxLogDebug("m_recFileFromRadioPath: %s", wxGetApp().m_recFileFromRadioPath);
+        wxLogDebug("soundFile: %s", soundFile);
+        sfInfo.format = 0;
+
+        if(!extension.IsEmpty())
+        {
+            extension.LowerCase();
+            if(extension == wxT("raw"))
+            {
+                sfInfo.format     = SF_FORMAT_RAW | SF_FORMAT_PCM_16;
+                sfInfo.channels   = 1;
+                sfInfo.samplerate = g_pfreedv->modem_sample_rate;
+            }
+            else if(extension == wxT("wav"))
+            {
+                sfInfo.format     = SF_FORMAT_WAV | SF_FORMAT_PCM_16;
+                sfInfo.channels   = 1;
+                sfInfo.samplerate = g_pfreedv->modem_sample_rate;
+            } else {
+                wxMessageBox(wxT("Invalid file format"), wxT("Record File From Radio"), wxOK);
+                return;
+            }
+        }
+        else {
+            wxMessageBox(wxT("Invalid file format"), wxT("Record File From Radio"), wxOK);
+            return;
+        }
+
+        // Bug: on Win32 I cant read m_recFileFromRadioSecs, so have hard coded it
+#ifdef __WIN32__
+        long secs = wxGetApp().m_recFileFromRadioSecs;
+        g_recFromRadioSamples = FS*(unsigned int)secs;
+#else
+        // work out number of samples to record
+
+        wxWindow * const ctrl = openFileDialog.GetExtraControl();
+        wxString secsString = static_cast<MyExtraRecFilePanel*>(ctrl)->getSecondsToRecord();
+        wxLogDebug("test: %s secsString: %s\n", wxT("testing 123"), secsString);
+
+        long secs;
+        if (secsString.ToLong(&secs)) {
+            wxGetApp().m_recFileFromRadioSecs = (unsigned int)secs;
+            //printf(" secondsToRecord: %d\n",  (unsigned int)secs);
+            g_recFromRadioSamples = FS*(unsigned int)secs;
+            //printf("g_recFromRadioSamples: %d\n", g_recFromRadioSamples);
+        }
+        else {
+            wxMessageBox(wxT("Invalid number of Seconds"), wxT("Record File From Radio"), wxOK);
+            return;
+        }
+#endif
+
+        g_sfRecFile = sf_open(soundFile, SFM_WRITE, &sfInfo);
+        if(g_sfRecFile == NULL)
+        {
+            wxString strErr = sf_strerror(NULL);
+            wxMessageBox(strErr, wxT("Couldn't open sound file"), wxOK);
+            return;
+        }
+
+        SetStatusText(wxT("Recording File: ") + fileName + wxT(" From Radio") , 0);
+        g_recFileFromRadio = true;
+    }
+
+}
+
+//-------------------------------------------------------------------------
+// OnExit()
+//-------------------------------------------------------------------------
+void MainFrame::OnExit(wxCommandEvent& event)
+{
+    wxUnusedVar(event);
+#ifdef _USE_TIMER
+    m_plotTimer.Stop();
+#endif // _USE_TIMER
+    if(g_sfPlayFile != NULL)
+    {
+        sf_close(g_sfPlayFile);
+        g_sfPlayFile = NULL;
+    }
+    if(g_sfRecFile != NULL)
+    {
+        sf_close(g_sfRecFile);
+        g_sfRecFile = NULL;
+    }
+    if(m_RxRunning)
+    {
+        stopRxStream();
+    }
+    m_togBtnSplit->Disable();
+    //m_togRxID->Disable();
+    //m_togTxID->Disable();
+    m_togBtnAnalog->Disable();
+    //m_togBtnALC->Disable();
+    //m_btnTogPTT->Disable();
+    Pa_Terminate();
+    Destroy();
+}
+
+//-------------------------------------------------------------------------
+// OnExitClick()
+//-------------------------------------------------------------------------
+void MainFrame::OnExitClick(wxCommandEvent& event)
+{
+    OnExit(event);
+}
+
+//-------------------------------------------------------------------------
+// OnToolsAudio()
+//-------------------------------------------------------------------------
+void MainFrame::OnToolsAudio(wxCommandEvent& event)
+{
+    wxUnusedVar(event);
+    int rv = 0;
+    AudioOptsDialog *dlg = new AudioOptsDialog(NULL);
+    rv = dlg->ShowModal();
+    if(rv == wxID_OK)
+    {
+        dlg->ExchangeData(EXCHANGE_DATA_OUT);
+    }
+    delete dlg;
+}
+
+//-------------------------------------------------------------------------
+// OnToolsAudioUI()
+//-------------------------------------------------------------------------
+void MainFrame::OnToolsAudioUI(wxUpdateUIEvent& event)
+{
+    event.Enable(!m_RxRunning);
+}
+
+//-------------------------------------------------------------------------
+// OnToolsFilter()
+//-------------------------------------------------------------------------
+void MainFrame::OnToolsFilter(wxCommandEvent& event)
+{
+    wxUnusedVar(event);
+    FilterDlg *dlg = new FilterDlg(NULL, m_RxRunning, &m_newMicInFilter, &m_newSpkOutFilter);
+    dlg->ShowModal();
+    delete dlg;
+}
+
+//-------------------------------------------------------------------------
+// OnToolsOptions()
+//-------------------------------------------------------------------------
+void MainFrame::OnToolsOptions(wxCommandEvent& event)
+{
+    wxUnusedVar(event);
+    g_modal = true;
+    //fprintf(stderr,"g_modal: %d\n", g_modal);
+    optionsDlg->Show();
+}
+
+//-------------------------------------------------------------------------
+// OnToolsOptionsUI()
+//-------------------------------------------------------------------------
+void MainFrame::OnToolsOptionsUI(wxUpdateUIEvent& event)
+{
+}
+
+//-------------------------------------------------------------------------
+// OnToolsComCfg()
+//-------------------------------------------------------------------------
+void MainFrame::OnToolsComCfg(wxCommandEvent& event)
+{
+    wxUnusedVar(event);
+
+    ComPortsDlg *dlg = new ComPortsDlg(NULL);
+
+    int rv = dlg->ShowModal();
+
+    // test Hamlib/Serial set up
+
+    if(rv == wxID_OK)
+    {
+        if (wxGetApp().m_boolHamlibUseForPTT) {
+            OpenHamlibRig();
+            wxGetApp().m_hamlib->close();
+        }
+        if (wxGetApp().m_boolUseSerialPTT) {
+            SetupSerialPort();
+            CloseSerialPort();
+        }
+    }
+
+    delete dlg;
+}
+
+//-------------------------------------------------------------------------
+// OnToolsComCfgUI()
+//-------------------------------------------------------------------------
+void MainFrame::OnToolsComCfgUI(wxUpdateUIEvent& event)
+{
+    event.Enable(!m_RxRunning);
+}
+
+//-------------------------------------------------------------------------
+// OnHelpCheckUpdates()
+//-------------------------------------------------------------------------
+void MainFrame::OnHelpCheckUpdates(wxCommandEvent& event)
+{
+    wxMessageBox("Got Click!", "OnHelpCheckUpdates", wxOK);
+    event.Skip();
+}
+
+//-------------------------------------------------------------------------
+// OnHelpCheckUpdatesUI()
+//-------------------------------------------------------------------------
+void MainFrame::OnHelpCheckUpdatesUI(wxUpdateUIEvent& event)
+{
+    event.Enable(false);
+}
+
+//-------------------------------------------------------------------------
+//OnHelpAbout()
+//-------------------------------------------------------------------------
+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
+    wxURL url(wxT("http://svn.code.sf.net/p/freetel/code/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("<h2>p/freetel/code - Revision ");
+            int startIndex = htmldata.find(s) + s.Length();
+            int endIndex = htmldata.find(wxT(": /fdmdv2</h2>"));
+            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("How much have you spent on Ham gear this year?  How did it compare to FreeDV? ")
+                wxT("FreeDV repesents an open and free future for digital voice over Ham Radio. ")
+                wxT("Please help by donating just $10 here: 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);
+
+#endif // _USE_ABOUT_DIALOG
+#ifdef USE_SIMPLE_ABOUT_DIALOG
+    wxUnusedVar(event);
+    wxAboutDialogInfo info;
+    info.SetCopyright(_("HAMLib Test"));
+    info.SetLicence(_("GPL v2 or later"));
+    info.SetDescription(_("Short description goes here"));
+    ::wxAboutBox(info);
+#endif // USE_SIMPLE_ABOUT_DIALOG
+
+}
+
+
+// Attempt to talk to rig using Hamlib
+
+bool MainFrame::OpenHamlibRig() {
+    if (wxGetApp().m_boolHamlibUseForPTT != true)
+       return false;
+    if (wxGetApp().m_intHamlibRig == 0)
+        return false;
+    if (wxGetApp().m_hamlib == NULL)
+        return false;
+
+    int rig = wxGetApp().m_intHamlibRig;
+    wxString port = wxGetApp().m_strHamlibSerialPort;
+    bool status = wxGetApp().m_hamlib->connect(rig, port.mb_str(wxConvUTF8));
+    if (status == false)
+        wxMessageBox("Couldn't connect to Radio with hamlib", wxT("About"), wxOK | wxICON_ERROR, this);
+    return status;
+} 
+
+//-------------------------------------------------------------------------
+// OnTogBtnOnOff()
+//-------------------------------------------------------------------------
+void MainFrame::OnTogBtnOnOff(wxCommandEvent& event)
+{
+    wxString startStop = m_togBtnOnOff->GetLabel();
+
+    // we are attempting to start
+
+    if (startStop.IsSameAs("Start"))
+    {
+        //
+        // Start Running -------------------------------------------------
+        //
+
+        // modify some button states when running
+
+        m_togBtnSplit->Enable();
+        m_togBtnAnalog->Enable();
+        m_togBtnOnOff->SetLabel(wxT("Stop"));
+        m_btnTogPTT->Enable();
+
+        m_rb1600->Disable();
+        m_rb700->Disable();
+        m_rb700b->Disable();
+
+        // determine what mode we are using
+
+        if (m_rb1600->GetValue()) {
+            g_mode = FREEDV_MODE_1600;
+            g_Nc = 16;
+            m_panelScatter->setNc(g_Nc);
+        }
+        if (m_rb700->GetValue()) {
+            g_mode = FREEDV_MODE_700;
+            g_Nc = 14;
+            m_panelScatter->setNc(g_Nc/2-1);  /* due to diversity, -1 due to no pilot like FreeDV 1600 */
+        }
+        if (m_rb700b->GetValue()) {
+            g_mode = FREEDV_MODE_700B;
+            g_Nc = 14;
+            m_panelScatter->setNc(g_Nc/2-1);  /* due to diversity, -1 due to no pilot like FreeDV 1600 */
+        }
+   
+        // init freedv states
+
+        g_pfreedv = freedv_open(g_mode);
+        g_pfreedv->callback_state = NULL;
+        g_pfreedv->freedv_get_next_tx_char = &my_get_next_tx_char;
+        g_pfreedv->freedv_put_next_rx_char = &my_put_next_rx_char;
+
+        g_pfreedv->error_pattern_callback_state = (void*)m_panelTestFrameErrors;
+        g_pfreedv->freedv_put_error_pattern = &my_freedv_put_error_pattern;
+        g_error_pattern_fifo = fifo_create(2*g_pfreedv->sz_error_pattern);
+        g_error_hist = new short[FDMDV_NC_MAX*2];
+        int i;
+        for(i=0; i<2*FDMDV_NC_MAX; i++)
+            g_error_hist[i] = 0;
+
+        //if (g_mode == FREEDV_MODE_700)
+        //    cohpsk_set_verbose(g_pfreedv->cohpsk, 1);
+
+        //cohpsk_set_verbose(g_pfreedv->cohpsk, 1);
+        assert(g_pfreedv != NULL);
+        modem_stats_open(&g_stats);
+
+        // Init Speex pre-processor states
+        // by inspecting Speex source it seems that only denoiser is on be default
+
+        g_speex_st = speex_preprocess_state_init(g_pfreedv->n_speech_samples, FS); 
+
+        // adjust spectrum and waterfall freq scaling base on mode
+
+        m_panelSpectrum->setFreqScale(MODEM_STATS_NSPEC*((float)MAX_F_HZ/(g_pfreedv->modem_sample_rate/2)));
+        m_panelWaterfall->setFs(g_pfreedv->modem_sample_rate);
+
+        // adjust scatter diagram for Number of FDM carriers
+
+        // init Codec 2 LPC Post Filter
+
+        codec2_set_lpc_post_filter(g_pfreedv->codec2,
+                                   wxGetApp().m_codec2LPCPostFilterEnable,
+                                   wxGetApp().m_codec2LPCPostFilterBassBoost,
+                                   wxGetApp().m_codec2LPCPostFilterBeta,
+                                   wxGetApp().m_codec2LPCPostFilterGamma);
+
+        g_State = 0;
+        g_snr = 0.0;
+        g_half_duplex = wxGetApp().m_boolHalfDuplex;
+
+        m_pcallsign = m_callsign;
+        memset(m_callsign, 0, sizeof(m_callsign));
+        m_checksumGood = m_checksumBad = 0;
+        wxString s;
+        s.Printf("%d", m_checksumGood);
+        m_txtChecksumGood->SetLabel(s);              
+        s.Printf("%d", m_checksumBad);
+        m_txtChecksumBad->SetLabel(s);        
+
+        m_maxLevel = 0;
+        m_textLevel->SetLabel(wxT(""));
+        m_gaugeLevel->SetValue(0);
+
+        // Init text msg decoding
+
+        varicode_set_code_num(&g_pfreedv->varicode_dec_states, wxGetApp().m_textEncoding);
+        //printf("m_textEncoding = %d\n", wxGetApp().m_textEncoding);
+        //printf("g_stats.snr: %f\n", g_stats.snr_est);
+
+        // attempt to start PTT ......
+        
+        if (wxGetApp().m_boolHamlibUseForPTT)
+            OpenHamlibRig();
+        if (wxGetApp().m_boolUseSerialPTT) {
+            SetupSerialPort();
+        }
+
+        // attempt to start sound cards and tx/rx processing
+
+        startRxStream();
+
+        if (m_RxRunning)
+        {
+#ifdef _USE_TIMER
+            m_plotTimer.Start(_REFRESH_TIMER_PERIOD, wxTIMER_CONTINUOUS);
+#endif // _USE_TIMER
+        }
+        char e[80]; sprintf(e,"start"); processTxtEvent(e);
+    }
+
+    // Stop was pressed or start up failed
+
+    if (startStop.IsSameAs("Stop") || !m_RxRunning ) {
+
+        //
+        // Stop Running -------------------------------------------------
+        //
+
+        optionsDlg->SetSpamTimerLight(false);
+
+#ifdef _USE_TIMER
+        m_plotTimer.Stop();
+#endif // _USE_TIMER
+
+        // ensure we are not transmitting and shut down audio processing
+
+        if (wxGetApp().m_boolHamlibUseForPTT) {
+            Hamlib *hamlib = wxGetApp().m_hamlib; 
+            if (wxGetApp().m_boolHamlibUseForPTT && hamlib != NULL) {
+                hamlib->ptt(false);
+                hamlib->close();
+            }
+        }
+
+        if (wxGetApp().m_boolUseSerialPTT)
+            CloseSerialPort();
+
+        m_btnTogPTT->SetValue(false);
+
+        stopRxStream();
+
+        // free up states
+
+        modem_stats_close(&g_stats);
+        delete g_error_hist;
+        fifo_destroy(g_error_pattern_fifo);
+        freedv_close(g_pfreedv);
+        speex_preprocess_state_destroy(g_speex_st);
+        m_newMicInFilter = m_newSpkOutFilter = true;
+
+        m_togBtnSplit->Disable();
+        //m_togRxID->Disable();
+        //m_togTxID->Disable();
+        m_togBtnAnalog->Disable();
+        m_btnTogPTT->Disable();
+        m_togBtnOnOff->SetLabel(wxT("Start"));
+        m_rb1600->Enable();
+        m_rb700->Enable();
+        m_rb700b->Enable();
+#ifdef DISABLED_FEATURE
+        m_rb1400old->Enable();
+        m_rb1600Wide->Enable();
+        m_rb1400->Enable();
+        m_rb2000->Enable();
+#endif
+        char e[80]; sprintf(e,"stop"); processTxtEvent(e);
+    }
+}
+
+//-------------------------------------------------------------------------
+// stopRxStream()
+//-------------------------------------------------------------------------
+void MainFrame::stopRxStream()
+{
+    if(m_RxRunning)
+    {
+        m_RxRunning = false;
+
+        fprintf(g_logfile, "waiting for thread to stop");
+        m_txRxThread->m_run = 0;
+        m_txRxThread->Wait();
+        fprintf(g_logfile, "thread stopped");
+
+        m_rxInPa->stop();
+        m_rxInPa->streamClose();
+        delete m_rxInPa;
+        if(m_rxOutPa != m_rxInPa) {
+                       m_rxOutPa->stop();
+                       m_rxOutPa->streamClose();
+                       delete m_rxOutPa;
+               }
+
+        if (g_nSoundCards == 2) {
+            m_txInPa->stop();
+            m_txInPa->streamClose();
+            delete m_txInPa;
+            if(m_txInPa != m_txOutPa) {
+                               m_txOutPa->stop();
+                               m_txOutPa->streamClose();
+                               delete m_txOutPa;
+                       }
+        }
+
+        destroy_fifos();
+        destroy_src();
+        deleteEQFilters(g_rxUserdata);
+        delete g_rxUserdata;
+    }
+}
+
+void MainFrame::destroy_fifos(void)
+{
+    fifo_destroy(g_rxUserdata->infifo1);
+    fifo_destroy(g_rxUserdata->outfifo1);
+    fifo_destroy(g_rxUserdata->infifo2);
+    fifo_destroy(g_rxUserdata->outfifo2);
+    fifo_destroy(g_rxUserdata->rxinfifo);
+    fifo_destroy(g_rxUserdata->rxoutfifo);
+}
+
+void MainFrame::destroy_src(void)
+{
+    src_delete(g_rxUserdata->insrc1);
+    src_delete(g_rxUserdata->outsrc1);
+    src_delete(g_rxUserdata->insrc2);
+    src_delete(g_rxUserdata->outsrc2);
+    src_delete(g_rxUserdata->insrcsf);
+}
+
+void  MainFrame::initPortAudioDevice(PortAudioWrap *pa, int inDevice, int outDevice,
+                                     int soundCard, int sampleRate, int inputChannels)
+{
+    // Note all of the wrapper functions below just set values in a
+    // portaudio struct so can't return any errors. So no need to trap
+    // any errors in this function.
+
+    // init input params
+
+    pa->setInputDevice(inDevice);
+    if(inDevice != paNoDevice) {
+        pa->setInputChannelCount(inputChannels);           // stereo input
+        pa->setInputSampleFormat(PA_SAMPLE_TYPE);
+        pa->setInputLatency(pa->getInputDefaultLowLatency());
+        pa->setInputHostApiStreamInfo(NULL);
+    }
+
+    pa->setOutputDevice(paNoDevice);
+    
+    // init output params
+    
+    pa->setOutputDevice(outDevice);
+    if(outDevice != paNoDevice) {
+        pa->setOutputChannelCount(2);                      // stereo output
+        pa->setOutputSampleFormat(PA_SAMPLE_TYPE);
+        pa->setOutputLatency(pa->getOutputDefaultLowLatency());
+        pa->setOutputHostApiStreamInfo(NULL);
+    }
+
+    // init params that affect input and output
+
+    /*
+      On Linux, setting this to wxGetApp().m_framesPerBuffer caused
+      intermittant break up on the audio from my IC7200 on Ubuntu 14.
+      After a day of bug hunting I found that 0, as recommended by the
+      PortAudio docunmentation, fixed the problem.
+    */
+
+    //pa->setFramesPerBuffer(wxGetApp().m_framesPerBuffer);
+    pa->setFramesPerBuffer(0);
+
+    pa->setSampleRate(sampleRate);
+    pa->setStreamFlags(paClipOff);
+}
+
+//-------------------------------------------------------------------------
+// startRxStream()
+//-------------------------------------------------------------------------
+void MainFrame::startRxStream()
+{
+    int   src_error;
+    const PaDeviceInfo *deviceInfo1 = NULL, *deviceInfo2 = NULL;
+    int   inputChannels1, inputChannels2;
+    bool  two_rx=false;
+    bool  two_tx=false;
+
+    if(!m_RxRunning) {
+        m_RxRunning = true;
+
+        if(Pa_Initialize())
+        {
+            wxMessageBox(wxT("Port Audio failed to initialize"), wxT("Pa_Initialize"), wxOK);
+        }
+
+        m_rxInPa = new PortAudioWrap();
+        if(g_soundCard1InDeviceNum != g_soundCard1OutDeviceNum)
+            two_rx=true;
+        if(g_soundCard2InDeviceNum != g_soundCard2OutDeviceNum)
+            two_tx=true;
+        
+        fprintf(g_logfile, "two_rx: %d two_tx: %d\n", two_rx, two_tx);
+        if(two_rx)
+            m_rxOutPa = new PortAudioWrap();
+        else
+            m_rxOutPa = m_rxInPa;
+
+        if (g_nSoundCards == 0) {
+            wxMessageBox(wxT("No Sound Cards configured, use Tools - Audio Config to configure"), wxT("Error"), wxOK);
+            delete m_rxInPa;
+            if(two_rx)
+                delete m_rxOutPa;
+            m_RxRunning = false;
+            return;
+        }
+
+        // Init Sound card 1 ----------------------------------------------
+        // sanity check on sound card device numbers
+
+        if ((m_rxInPa->getDeviceCount() <= g_soundCard1InDeviceNum) ||
+            (m_rxOutPa->getDeviceCount() <= g_soundCard1OutDeviceNum)) {
+            wxMessageBox(wxT("Sound Card 1 not present"), wxT("Error"), wxOK);
+            delete m_rxInPa;
+            if(two_rx)
+                               delete m_rxOutPa;
+            m_RxRunning = false;
+            return;
+        }
+
+        // work out how many input channels this device supports.
+
+        deviceInfo1 = Pa_GetDeviceInfo(g_soundCard1InDeviceNum);
+        if (deviceInfo1 == NULL) {
+            wxMessageBox(wxT("Couldn't get device info from Port Audio for Sound Card 1"), wxT("Error"), wxOK);
+            delete m_rxInPa;
+            if(two_rx)
+                               delete m_rxOutPa;
+            m_RxRunning = false;
+            return;
+        }
+        if (deviceInfo1->maxInputChannels == 1)
+            inputChannels1 = 1;
+        else
+            inputChannels1 = 2;
+
+        if(two_rx) {
+            initPortAudioDevice(m_rxInPa, g_soundCard1InDeviceNum, paNoDevice, 1,
+                            g_soundCard1SampleRate, inputChannels1);
+            initPortAudioDevice(m_rxOutPa, paNoDevice, g_soundCard1OutDeviceNum, 1,
+                            g_soundCard1SampleRate, inputChannels1);
+               }
+        else
+            initPortAudioDevice(m_rxInPa, g_soundCard1InDeviceNum, g_soundCard1OutDeviceNum, 1,
+                            g_soundCard1SampleRate, inputChannels1);
+
+        // Init Sound Card 2 ------------------------------------------------
+
+        if (g_nSoundCards == 2) {
+
+            m_txInPa = new PortAudioWrap();
+            if(two_tx)
+                m_txOutPa = new PortAudioWrap();
+            else
+                m_txOutPa = m_txInPa;
+
+            // sanity check on sound card device numbers
+
+            //printf("m_txInPa->getDeviceCount(): %d\n", m_txInPa->getDeviceCount());
+            //printf("g_soundCard2InDeviceNum: %d\n", g_soundCard2InDeviceNum);
+            //printf("g_soundCard2OutDeviceNum: %d\n", g_soundCard2OutDeviceNum);
+
+            if ((m_txInPa->getDeviceCount() <= g_soundCard2InDeviceNum) ||
+                (m_txOutPa->getDeviceCount() <= g_soundCard2OutDeviceNum)) {
+                wxMessageBox(wxT("Sound Card 2 not present"), wxT("Error"), wxOK);
+                delete m_rxInPa;
+                if(two_rx)
+                    delete m_rxOutPa;
+                delete m_txInPa;
+                if(two_tx)
+                    delete m_txOutPa;
+                m_RxRunning = false;
+                return;
+            }
+
+            deviceInfo2 = Pa_GetDeviceInfo(g_soundCard2InDeviceNum);
+            if (deviceInfo2 == NULL) {
+                wxMessageBox(wxT("Couldn't get device info from Port Audio for Sound Card 1"), wxT("Error"), wxOK);
+                delete m_rxInPa;
+                if(two_rx)
+                                       delete m_rxOutPa;
+                delete m_txInPa;
+                if(two_tx)
+                                       delete m_txOutPa;
+                m_RxRunning = false;
+                return;
+            }
+            if (deviceInfo2->maxInputChannels == 1)
+                inputChannels2 = 1;
+            else
+                inputChannels2 = 2;
+
+            if(two_tx) {
+                               initPortAudioDevice(m_txInPa, g_soundCard2InDeviceNum, paNoDevice, 2,
+                                g_soundCard2SampleRate, inputChannels2);
+                               initPortAudioDevice(m_txOutPa, paNoDevice, g_soundCard2OutDeviceNum, 2,
+                                g_soundCard2SampleRate, inputChannels2);
+                       }
+                       else
+                               initPortAudioDevice(m_txInPa, g_soundCard2InDeviceNum, g_soundCard2OutDeviceNum, 2,
+                                g_soundCard2SampleRate, inputChannels2);
+        }
+
+        // Init call back data structure ----------------------------------------------
+
+        g_rxUserdata = new paCallBackData;
+        g_rxUserdata->inputChannels1 = inputChannels1;
+        if (deviceInfo2 != NULL)
+            g_rxUserdata->inputChannels2 = inputChannels2;
+
+        // init sample rate conversion states
+
+        g_rxUserdata->insrc1 = src_new(SRC_SINC_FASTEST, 1, &src_error);
+        assert(g_rxUserdata->insrc1 != NULL);
+        g_rxUserdata->outsrc1 = src_new(SRC_SINC_FASTEST, 1, &src_error);
+        assert(g_rxUserdata->outsrc1 != NULL);
+        g_rxUserdata->insrc2 = src_new(SRC_SINC_FASTEST, 1, &src_error);
+        assert(g_rxUserdata->insrc2 != NULL);
+        g_rxUserdata->outsrc2 = src_new(SRC_SINC_FASTEST, 1, &src_error);
+        assert(g_rxUserdata->outsrc2 != NULL);
+
+        g_rxUserdata->insrcsf = src_new(SRC_SINC_FASTEST, 1, &src_error);
+        assert(g_rxUserdata->insrcsf != NULL);
+
+        // create FIFOs used to interface between different buffer sizes
+
+        g_rxUserdata->infifo1 = fifo_create(8*N48);
+        g_rxUserdata->outfifo1 = fifo_create(10*N48);
+        g_rxUserdata->outfifo2 = fifo_create(8*N48);
+        g_rxUserdata->infifo2 = fifo_create(8*N48);
+        printf("N48: %d\n", N48);
+
+        g_rxUserdata->rxinfifo = fifo_create(3 * g_pfreedv->n_speech_samples);
+        g_rxUserdata->rxoutfifo = fifo_create(2 * g_pfreedv->n_speech_samples);
+
+        // Init Equaliser Filters ------------------------------------------------------
+
+        m_newMicInFilter = m_newSpkOutFilter = true;
+        designEQFilters(g_rxUserdata);
+        g_rxUserdata->micInEQEnable = wxGetApp().m_MicInEQEnable;
+        g_rxUserdata->spkOutEQEnable = wxGetApp().m_SpkOutEQEnable;
+
+        // optional tone in left channel to reliably trigger vox
+        
+        g_rxUserdata->leftChannelVoxTone = wxGetApp().m_leftChannelVoxTone;
+        g_rxUserdata->voxTonePhase = 0;
+
+        // Start sound card 1 ----------------------------------------------------------
+
+        m_rxInPa->setUserData(g_rxUserdata);
+        m_rxErr = m_rxInPa->setCallback(rxCallback);
+
+        m_rxErr = m_rxInPa->streamOpen();
+
+        if(m_rxErr != paNoError) {
+            wxMessageBox(wxT("Sound Card 1 Open/Setup error."), wxT("Error"), wxOK);
+                       delete m_rxInPa;
+                       if(two_rx)
+                               delete m_rxOutPa;
+                       delete m_txInPa;
+                       if(two_tx)
+                               delete m_txOutPa;
+            destroy_fifos();
+            destroy_src();
+            deleteEQFilters(g_rxUserdata);
+            delete g_rxUserdata;
+            m_RxRunning = false;
+            return;
+        }
+
+        m_rxErr = m_rxInPa->streamStart();
+        if(m_rxErr != paNoError) {
+            wxMessageBox(wxT("Sound Card 1 Stream Start Error."), wxT("Error"), wxOK);
+                       delete m_rxInPa;
+                       if(two_rx)
+                               delete m_rxOutPa;
+                       delete m_txInPa;
+                       if(two_tx)
+                               delete m_txOutPa;
+            destroy_fifos();
+            destroy_src();
+            deleteEQFilters(g_rxUserdata);
+            delete g_rxUserdata;
+            m_RxRunning = false;
+            return;
+        }
+
+        // Start separate output stream if needed
+
+        if(two_rx) {
+            m_rxOutPa->setUserData(g_rxUserdata);
+            m_rxErr = m_rxOutPa->setCallback(rxCallback);
+
+            m_rxErr = m_rxOutPa->streamOpen();
+
+            if(m_rxErr != paNoError) {
+                wxMessageBox(wxT("Sound Card 1 Second Stream Open/Setup error."), wxT("Error"), wxOK);
+                delete m_rxInPa;
+                delete m_rxOutPa;
+                delete m_txOutPa;
+                if(two_tx)
+                    delete m_txOutPa;
+                destroy_fifos();
+                destroy_src();
+                deleteEQFilters(g_rxUserdata);
+                delete g_rxUserdata;
+                m_RxRunning = false;
+                return;
+            }
+
+            m_rxErr = m_rxOutPa->streamStart();
+            if(m_rxErr != paNoError) {
+                wxMessageBox(wxT("Sound Card 1 Second Stream Start Error."), wxT("Error"), wxOK);
+                m_rxInPa->stop();
+                m_rxInPa->streamClose();
+                delete m_rxInPa;
+                delete m_rxOutPa;
+                delete m_txOutPa;
+                if(two_tx)
+                    delete m_txOutPa;
+                destroy_fifos();
+                destroy_src();
+                deleteEQFilters(g_rxUserdata);
+                delete g_rxUserdata;
+                m_RxRunning = false;
+                return;
+            }
+        }
+
+        // Start sound card 2 ----------------------------------------------------------
+
+        if (g_nSoundCards == 2) {
+
+            // question: can we use same callback data
+            // (g_rxUserdata)or both sound card callbacks?  Is there a
+            // chance of them both being called at the same time?  We
+            // could need a mutex ...
+
+            m_txInPa->setUserData(g_rxUserdata);
+            m_txErr = m_txInPa->setCallback(txCallback);
+            m_txErr = m_txInPa->streamOpen();
+
+            if(m_txErr != paNoError) {
+                fprintf(stderr, "Err: %d\n", m_txErr);
+                wxMessageBox(wxT("Sound Card 2 Open/Setup error."), wxT("Error"), wxOK);
+                m_rxInPa->stop();
+                m_rxInPa->streamClose();
+                delete m_rxInPa;
+                if(two_rx) {
+                    m_rxOutPa->stop();
+                    m_rxOutPa->streamClose();
+                    delete m_rxOutPa;
+                }
+                delete m_txInPa;
+                if(two_tx)
+                    delete m_txOutPa;
+                destroy_fifos();
+                destroy_src();
+                deleteEQFilters(g_rxUserdata);
+                delete g_rxUserdata;
+                m_RxRunning = false;
+                return;
+            }
+            m_txErr = m_txInPa->streamStart();
+            if(m_txErr != paNoError) {
+                wxMessageBox(wxT("Sound Card 2 Start Error."), wxT("Error"), wxOK);
+                m_rxInPa->stop();
+                m_rxInPa->streamClose();
+                delete m_rxInPa;
+                if(two_rx) {
+                    m_rxOutPa->stop();
+                    m_rxOutPa->streamClose();
+                    delete m_rxOutPa;
+                }
+                delete m_txInPa;
+                if(two_tx)
+                    delete m_txOutPa;
+                destroy_fifos();
+                destroy_src();
+                deleteEQFilters(g_rxUserdata);
+                delete g_rxUserdata;
+                m_RxRunning = false;
+                return;
+            }
+
+            // Start separate output stream if needed
+
+            if (two_tx) {
+
+                // question: can we use same callback data
+                // (g_rxUserdata)or both sound card callbacks?  Is there a
+                // chance of them both being called at the same time?  We
+                // could need a mutex ...
+
+                m_txOutPa->setUserData(g_rxUserdata);
+                m_txErr = m_txOutPa->setCallback(txCallback);
+                m_txErr = m_txOutPa->streamOpen();
+
+                if(m_txErr != paNoError) {
+                    wxMessageBox(wxT("Sound Card 2 Second Stream Open/Setup error."), wxT("Error"), wxOK);
+                    m_rxInPa->stop();
+                    m_rxInPa->streamClose();
+                    delete m_rxInPa;
+                    if(two_rx) {
+                        m_rxOutPa->stop();
+                        m_rxOutPa->streamClose();
+                        delete m_rxOutPa;
+                    }
+                    m_txInPa->stop();
+                    m_txInPa->streamClose();
+                    delete m_txInPa;
+                    delete m_txOutPa;
+                    destroy_fifos();
+                    destroy_src();
+                    deleteEQFilters(g_rxUserdata);
+                    delete g_rxUserdata;
+                    m_RxRunning = false;
+                    return;
+                }
+                m_txErr = m_txOutPa->streamStart();
+                if(m_txErr != paNoError) {
+                    wxMessageBox(wxT("Sound Card 2 Second Stream Start Error."), wxT("Error"), wxOK);
+                    m_rxInPa->stop();
+                    m_rxInPa->streamClose();
+                    m_txInPa->stop();
+                    m_txInPa->streamClose();
+                    delete m_txInPa;
+                    if(two_rx) {
+                        m_rxOutPa->stop();
+                        m_rxOutPa->streamClose();
+                        delete m_rxOutPa;
+                    }
+                    delete m_txInPa;
+                    delete m_txOutPa;
+                    destroy_fifos();
+                    destroy_src();
+                    deleteEQFilters(g_rxUserdata);
+                    delete g_rxUserdata;
+                    m_RxRunning = false;
+                    return;
+                }
+            }
+        }
+
+        // start tx/rx processing thread
+
+        m_txRxThread = new txRxThread;
+
+        if ( m_txRxThread->Create() != wxTHREAD_NO_ERROR )
+        {
+            wxLogError(wxT("Can't create thread!"));
+        }
+
+        m_txRxThread->SetPriority(WXTHREAD_MAX_PRIORITY);
+
+        if ( m_txRxThread->Run() != wxTHREAD_NO_ERROR )
+        {
+            wxLogError(wxT("Can't start thread!"));
+        }
+
+    }
+}
+
+
+void MainFrame::processTxtEvent(char event[]) {
+    int rule = 0;
+
+    //printf("processTxtEvent:\n");
+    //printf("  event: %s\n", event);
+
+    // process with regexp and issue system command
+
+    // Each regexp in our list is separated by a newline.  We want to try all of them.
+
+    wxString event_str(event);
+    int match_end, replace_end;
+    match_end = replace_end = 0;
+    wxString regexp_match_list = wxGetApp().m_events_regexp_match;
+    wxString regexp_replace_list = wxGetApp().m_events_regexp_replace;
+
+    bool found_match = false;
+
+    while (((match_end = regexp_match_list.Find('\n')) != wxNOT_FOUND) && (rule < MAX_EVENT_RULES)) {
+        //printf("match_end: %d\n", match_end);
+        if ((replace_end = regexp_replace_list.Find('\n')) != wxNOT_FOUND) {
+            //printf("replace_end = %d\n", replace_end);
+
+            // candidate match and replace regexps strings exist, so lets try them
+
+            wxString regexp_match = regexp_match_list.SubString(0, match_end-1);
+            wxString regexp_replace = regexp_replace_list.SubString(0, replace_end-1);
+            //printf("match: %s replace: %s\n", (const char *)regexp_match.c_str(), (const char *)regexp_replace.c_str());
+            wxRegEx re(regexp_match);
+            //printf("  checking for match against: %s\n", (const char *)regexp_match.c_str());
+
+            // if we found a match, lets run the replace regexp and issue the system command
+
+            wxString event_str_rep = event_str;
+
+            if (re.Replace(&event_str_rep, regexp_replace) != 0) {
+                //printf("  found match!\n");
+                found_match = true;
+
+                bool enableSystem = false;
+                if (wxGetApp().m_events)
+                    enableSystem = true;
+
+                // no syscall if spam timer still running
+
+                if (spamTimer[rule].IsRunning()) {
+                    enableSystem = false;
+                    //printf("  spam timer running\n");
+                }
+
+                const char *event_out = event_str_rep.ToUTF8();
+                wxString event_out_with_return_code;
+
+                if (enableSystem) {
+                    int ret = wxExecute(event_str_rep);
+                    event_out_with_return_code.Printf(_T("%s -> returned %d"), event_out, ret);
+                    spamTimer[rule].Start((wxGetApp().m_events_spam_timer)*1000, wxTIMER_ONE_SHOT);
+                }
+                else
+                    event_out_with_return_code.Printf(_T("%s T: %d"), event_out, spamTimer[rule].IsRunning());
+
+                // update event log GUI if currently displayed
+                
+                if (optionsDlg != NULL) {                  
+                    optionsDlg->updateEventLog(wxString(event), event_out_with_return_code);                     
+                }
+            }
+        }
+        regexp_match_list = regexp_match_list.SubString(match_end+1, regexp_match_list.length());
+        regexp_replace_list = regexp_replace_list.SubString(replace_end+1, regexp_replace_list.length());
+
+        rule++;
+    }
+    if ((optionsDlg != NULL) && !found_match) {                  
+        optionsDlg->updateEventLog(wxString(event), _("<no match>"));                     
+    }
+}
+
+
+#define SBQ_MAX_ARGS 4
+
+void *MainFrame::designAnEQFilter(const char filterType[], float freqHz, float gaindB, float Q)
+{
+    char  *arg[SBQ_MAX_ARGS];
+    char   argstorage[SBQ_MAX_ARGS][80];
+    void  *sbq;
+    int    i, argc;
+
+    assert((strcmp(filterType, "bass") == 0)   ||
+           (strcmp(filterType, "treble") == 0) ||
+           (strcmp(filterType, "equalizer") == 0));
+
+    for(i=0; i<SBQ_MAX_ARGS; i++) {
+        arg[i] = &argstorage[i][0];
+        arg[i] = &argstorage[i][0];
+        arg[i] = &argstorage[i][0];
+    }
+
+    argc = 0;
+
+    if ((strcmp(filterType, "bass") == 0) || (strcmp(filterType, "treble") == 0)) {
+        sprintf(arg[argc++], "%s", filterType);
+        sprintf(arg[argc++], "%f", gaindB+1E-6);
+        sprintf(arg[argc++], "%f", freqHz);
+    }
+
+    if (strcmp(filterType, "equalizer") == 0) {
+        sprintf(arg[argc++], "%s", filterType);
+        sprintf(arg[argc++], "%f", freqHz);
+        sprintf(arg[argc++], "%f", Q);
+        sprintf(arg[argc++], "%f", gaindB+1E-6);
+    }
+
+    assert(argc <= SBQ_MAX_ARGS);
+
+    sbq = sox_biquad_create(argc-1, (const char **)arg);
+
+    return sbq;
+}
+
+void  MainFrame::designEQFilters(paCallBackData *cb)
+{
+    // init Mic In Equaliser Filters
+
+    if (m_newMicInFilter) {
+        //printf("designing new Min In filters\n");
+        cb->sbqMicInBass   = designAnEQFilter("bass", wxGetApp().m_MicInBassFreqHz, wxGetApp().m_MicInBassGaindB);
+        cb->sbqMicInTreble = designAnEQFilter("treble", wxGetApp().m_MicInTrebleFreqHz, wxGetApp().m_MicInTrebleGaindB);
+        cb->sbqMicInMid    = designAnEQFilter("equalizer", wxGetApp().m_MicInMidFreqHz, wxGetApp().m_MicInMidGaindB, wxGetApp().m_MicInMidQ);
+    }
+
+    // init Spk Out Equaliser Filters
+
+    if (m_newSpkOutFilter) {
+        //printf("designing new Spk Out filters\n");
+        //printf("designEQFilters: wxGetApp().m_SpkOutBassFreqHz: %f\n",wxGetApp().m_SpkOutBassFreqHz);
+        cb->sbqSpkOutBass   = designAnEQFilter("bass", wxGetApp().m_SpkOutBassFreqHz, wxGetApp().m_SpkOutBassGaindB);
+        cb->sbqSpkOutTreble = designAnEQFilter("treble", wxGetApp().m_SpkOutTrebleFreqHz, wxGetApp().m_SpkOutTrebleGaindB);
+        cb->sbqSpkOutMid    = designAnEQFilter("equalizer", wxGetApp().m_SpkOutMidFreqHz, wxGetApp().m_SpkOutMidGaindB, wxGetApp().m_SpkOutMidQ);
+    }
+}
+
+void  MainFrame::deleteEQFilters(paCallBackData *cb)
+{
+    if (m_newMicInFilter) {
+        sox_biquad_destroy(cb->sbqMicInBass);
+        sox_biquad_destroy(cb->sbqMicInTreble);
+        sox_biquad_destroy(cb->sbqMicInMid);
+    }
+    if (m_newSpkOutFilter) {
+        sox_biquad_destroy(cb->sbqSpkOutBass);
+        sox_biquad_destroy(cb->sbqSpkOutTreble);
+        sox_biquad_destroy(cb->sbqSpkOutMid);
+    }
+}
+
+// returns number of output samples generated by resampling
+int resample(SRC_STATE *src,
+            short      output_short[],
+            short      input_short[],
+            int        output_sample_rate,
+            int        input_sample_rate,
+            int        length_output_short, // maximum output array length in samples
+            int        length_input_short
+            )
+{
+    SRC_DATA src_data;
+    float    input[N48*4];
+    float    output[N48*4];
+    int      ret;
+
+    assert(src != NULL);
+    assert(length_input_short <= N48*4);
+    assert(length_output_short <= N48*4);
+
+    src_short_to_float_array(input_short, input, length_input_short);
+
+    src_data.data_in = input;
+    src_data.data_out = output;
+    src_data.input_frames = length_input_short;
+    src_data.output_frames = length_output_short;
+    src_data.end_of_input = 0;
+    src_data.src_ratio = (float)output_sample_rate/input_sample_rate;
+
+    ret = src_process(src, &src_data);
+    assert(ret == 0);
+
+    assert(src_data.output_frames_gen <= length_output_short);
+    src_float_to_short_array(output, output_short, src_data.output_frames_gen);
+
+    return src_data.output_frames_gen;
+}
+
+
+// Decimates samples using an algorithm that produces nice plots of
+// speech signals at a low sample rate.  We want a low sample rate so
+// we don't hammer the graphics system too hard.  Saves decimated data
+// to a fifo for plotting on screen.
+void resample_for_plot(struct FIFO *plotFifo, short buf[], int length, int fs)
+{
+    int decimation = fs/WAVEFORM_PLOT_FS;
+    int nSamples, sample;
+    int i, st, en, max, min;
+    short dec_samples[length];
+
+    nSamples = length/decimation;
+
+    for(sample = 0; sample < nSamples; sample += 2)
+    {
+        st = decimation*sample;
+        en = decimation*(sample+2);
+        max = min = 0;
+        for(i=st; i<en; i++ )
+        {
+            if (max < buf[i]) max = buf[i];
+            if (min > buf[i]) min = buf[i];
+        }
+        dec_samples[sample] = max;
+        dec_samples[sample+1] = min;
+    }
+    fifo_write(plotFifo, dec_samples, nSamples);
+}
+
+void txRxProcessing()
+{
+
+    paCallBackData  *cbData = g_rxUserdata;
+
+    // Buffers re-used by tx and rx processing
+    // signals in in48k/out48k are at a maximum sample rate of 48k, could be 44.1kHz
+    // depending on sound hardware.
+
+    short           in8k_short[4*N8];
+    short           in48k_short[4*N48];
+    short           out8k_short[4*N8];
+    short           out48k_short[4*N48];
+    int             nout, samplerate, n_samples;
+
+    //fprintf(g_logfile, "start infifo1: %5d outfifo2: %5d\n", fifo_used(cbData->infifo1), fifo_used(cbData->outfifo2));
+
+    // FreeDV 700 uses a modem sample rate of 7500 Hz which requires some special treatment
+
+    if (g_analog) 
+        samplerate = FS;
+    else
+        samplerate = g_pfreedv->modem_sample_rate;
+
+    //
+    //  RX side processing --------------------------------------------
+    //
+
+    // while we have enough input samples available ...
+
+    int nsam = g_soundCard1SampleRate * (float)N8/FS;
+    assert(nsam <= N48);
+    g_mutexProtectingCallbackData.Lock();
+    while ((fifo_read(cbData->infifo1, in48k_short, nsam) == 0) && ((g_half_duplex && !g_tx) || !g_half_duplex)) 
+    {
+        g_mutexProtectingCallbackData.Unlock();
+        unsigned int n8k;
+
+        n8k = resample(cbData->insrc1, in8k_short, in48k_short, samplerate, g_soundCard1SampleRate, N8, nsam);
+        assert(n8k <= N8);
+
+        // optionally save "from radio" signal (write demod input to file)
+        // Really useful for testing and development as it allows us
+        // to repeat tests using off air signals
+
+        g_mutexProtectingCallbackData.Lock();
+        if (g_recFileFromRadio && (g_sfRecFile != NULL)) {
+            //printf("g_recFromRadioSamples: %d  n8k: %d \n", g_recFromRadioSamples);
+            if (g_recFromRadioSamples < n8k) {
+                sf_write_short(g_sfRecFile, in8k_short, g_recFromRadioSamples);
+                wxCommandEvent event( wxEVT_COMMAND_MENU_SELECTED, g_recFileFromRadioEventId );
+                // call stop/start record menu item, should be thread safe
+                g_parent->GetEventHandler()->AddPendingEvent( event );
+                g_recFromRadioSamples = 0;
+                //printf("finished recording g_recFromRadioSamples: %d n8k: %d!\n", g_recFileFromRadio, n8k);
+            }
+            else {
+                sf_write_short(g_sfRecFile, in8k_short, n8k);
+                g_recFromRadioSamples -= n8k;
+            }
+        }
+        g_mutexProtectingCallbackData.Unlock();
+
+        // optionally read "from radio" signal from file (read demod input from file)
+
+        g_mutexProtectingCallbackData.Lock();
+        if (g_playFileFromRadio && (g_sfPlayFileFromRadio != NULL)) {
+            unsigned int nsf = n8k*g_sfFs/samplerate;
+            short        insf_short[nsf];
+            unsigned int n = sf_read_short(g_sfPlayFileFromRadio, insf_short, nsf);
+            n8k = resample(cbData->insrcsf, in8k_short, insf_short, samplerate, g_sfFs, N8, nsf);
+            //fprintf(g_logfile, "n: %d nsnf: %d n8k: %d\n", n, nsf, n8k);
+            assert(n8k <= N8);
+
+            if (n == 0) {
+                if (g_loopPlayFileFromRadio)
+                    sf_seek(g_sfPlayFileFromRadio, 0, SEEK_SET);
+                else {
+                    printf("playFileFromRadio finished, issuing event!\n");
+                    wxCommandEvent event( wxEVT_COMMAND_MENU_SELECTED, g_playFileFromRadioEventId );
+                    // call stop/start play menu item, should be thread safe
+                    g_parent->GetEventHandler()->AddPendingEvent( event );
+                }
+            }
+        }
+        g_mutexProtectingCallbackData.Unlock();
+
+        resample_for_plot(g_plotDemodInFifo, in8k_short, n8k, samplerate);
+
+        // send latest squelch level to FreeDV API, as it handles squelch internally
+
+        g_pfreedv->squelch_en = g_SquelchActive;
+        g_pfreedv->snr_squelch_thresh = g_SquelchLevel;
+        //fprintf(g_logfile, "snr_squelch_thresh: %f\n",  g_pfreedv->snr_squelch_thresh);
+
+        // Get some audio to send to headphones/speaker.  If in analog
+        // mode we pass thru the "from radio" audio to the
+        // headphones/speaker.
+
+        if (g_analog) {
+            memcpy(out8k_short, in8k_short, sizeof(short)*n8k);
+            
+            // compute rx spectrum 
+
+            COMP  rx_fdm[n8k];
+            float rx_spec[MODEM_STATS_NSPEC];
+            unsigned int   i;
+
+            for(i=0; i<n8k; i++) {
+                rx_fdm[i].real = in8k_short[i];
+                rx_fdm[i].imag = 0.0;
+            }            
+            modem_stats_get_rx_spectrum(&g_stats, rx_spec, rx_fdm, n8k);
+
+            // Average rx spectrum data using a simple IIR low pass filter
+
+            for(i = 0; i<MODEM_STATS_NSPEC; i++) {
+                g_avmag[i] = BETA * g_avmag[i] + (1.0 - BETA) * rx_spec[i];
+            }
+        }
+        else {
+            fifo_write(cbData->rxinfifo, in8k_short, n8k);
+            per_frame_rx_processing(cbData->rxoutfifo, cbData->rxinfifo);
+            memset(out8k_short, 0, sizeof(short)*N8);
+            fifo_read(cbData->rxoutfifo, out8k_short, N8);
+        }
+
+
+        // Optional Spk Out EQ Filtering, need mutex as filter can change at run time
+        g_mutexProtectingCallbackData.Lock();
+        if (cbData->spkOutEQEnable) {
+            sox_biquad_filter(cbData->sbqSpkOutBass,   out8k_short, out8k_short, N8);
+            sox_biquad_filter(cbData->sbqSpkOutTreble, out8k_short, out8k_short, N8);
+            sox_biquad_filter(cbData->sbqSpkOutMid,    out8k_short, out8k_short, N8);
+        }
+        g_mutexProtectingCallbackData.Unlock();
+
+        resample_for_plot(g_plotSpeechOutFifo, out8k_short, N8, FS);
+
+        g_mutexProtectingCallbackData.Lock();
+        if (g_nSoundCards == 1) {
+            nout = resample(cbData->outsrc2, out48k_short, out8k_short, g_soundCard1SampleRate, FS, N48, N8);
+            fifo_write(cbData->outfifo1, out48k_short, nout);
+        }
+        else {
+            nout = resample(cbData->outsrc2, out48k_short, out8k_short, g_soundCard2SampleRate, FS, N48, N8);
+            fifo_write(cbData->outfifo2, out48k_short, nout);
+        }
+    }
+    g_mutexProtectingCallbackData.Unlock();
+
+    //
+    //  TX side processing --------------------------------------------
+    //
+
+    if ((g_nSoundCards == 2) && ((g_half_duplex && g_tx) || !g_half_duplex)) {
+        int ret;
+
+        // Make sure we have q few frames of modulator output
+        // samples.  This also locks the modulator to the sample rate
+        // of sound card 1.  We want to make sure that modulator
+        // samples are uninterrupted by differences in sample rate
+        // between this sound card and sound card 2.
+
+        g_mutexProtectingCallbackData.Lock();
+        while((unsigned)fifo_used(cbData->outfifo1) < 6*N48)
+        {
+            g_mutexProtectingCallbackData.Unlock();
+
+            int   nsam = g_soundCard2SampleRate * g_pfreedv->n_speech_samples/FS;
+            assert(nsam <= 4*N48);
+
+            // infifo2 is written to by another sound card so it may
+            // over or underflow, but we don't realy care.  It will
+            // just result in a short interruption in audio being fed
+            // to codec2_enc, possibly making a click every now and
+            // again in the decoded audio at the other end.
+
+            // zero speech input just in case infifo2 underflows
+            memset(in48k_short, 0, nsam*sizeof(short));
+            fifo_read(cbData->infifo2, in48k_short, nsam);
+
+            nout = resample(cbData->insrc2, in8k_short, in48k_short, FS, g_soundCard2SampleRate, 4*N8, nsam);
+
+            // optionally use file for mic input signal
+
+            g_mutexProtectingCallbackData.Lock();
+            if (g_playFileToMicIn && (g_sfPlayFile != NULL)) {
+                int n = sf_read_short(g_sfPlayFile, in8k_short, nout);
+                //fprintf(stderr, "n: %d nout: %d\n", n, nout);
+                if (n != nout) {
+                    if (g_loopPlayFileToMicIn)
+                        sf_seek(g_sfPlayFile, 0, SEEK_SET);
+                    else {
+                        wxCommandEvent event( wxEVT_COMMAND_MENU_SELECTED, g_playFileToMicInEventId );
+                        // call stop/start play menu item, should be thread safe
+                        g_parent->GetEventHandler()->AddPendingEvent( event );
+                    }
+                }
+            }
+            g_mutexProtectingCallbackData.Unlock();
+
+            // Optional Speex pre-processor for acoustic noise reduction
+
+            if (wxGetApp().m_speexpp_enable) {
+                speex_preprocess_run(g_speex_st, in8k_short);
+            }
+
+            // Optional Mic In EQ Filtering, need mutex as filter can change at run time
+
+            g_mutexProtectingCallbackData.Lock();
+            if (cbData->micInEQEnable) {
+                sox_biquad_filter(cbData->sbqMicInBass, in8k_short, in8k_short, nout);
+                sox_biquad_filter(cbData->sbqMicInTreble, in8k_short, in8k_short, nout);
+                sox_biquad_filter(cbData->sbqMicInMid, in8k_short, in8k_short, nout);
+            }
+            g_mutexProtectingCallbackData.Unlock();
+
+            resample_for_plot(g_plotSpeechInFifo, in8k_short, nout, FS);
+
+            n_samples = g_pfreedv->n_nom_modem_samples;
+
+            if (g_analog) {
+                n_samples = g_pfreedv->n_speech_samples;
+
+                // Boost the "from mic" -> "to radio" audio in analog
+                // mode.  The need for the gain was found by
+                // experiment - analog SSB sounded too quiet compared
+                // to digital. With digital voice we generally drive
+                // the "to radio" (SSB radio mic input) at about 25%
+                // of the peak level for normal SSB voice. So we
+                // introduce 6dB gain to make analog SSB sound the
+                // same level as the digital.  Watch out for clipping.
+                for(int i=0; i<n_samples; i++) {
+                    float out = (float)in8k_short[i]*2.0;
+                    if (out > 32767) out = 32767.0;
+                    if (out < -32767) out = -32767.0;
+                    out8k_short[i] = out;
+                }
+            }
+            else {
+                COMP tx_fdm[g_pfreedv->n_nom_modem_samples];
+                COMP tx_fdm_offset[g_pfreedv->n_nom_modem_samples];
+                int  i;
+
+                freedv_comptx(g_pfreedv, tx_fdm, in8k_short);
+  
+                fdmdv_freq_shift_coh(tx_fdm_offset, tx_fdm, g_TxFreqOffsetHz, g_pfreedv->modem_sample_rate, &g_TxFreqOffsetPhaseRect, g_pfreedv->n_nom_modem_samples);
+                for(i=0; i<g_pfreedv->n_nom_modem_samples; i++)
+                    out8k_short[i] = tx_fdm_offset[i].real;
+            }
+
+            // output one frame of modem signal
+            nout = resample(cbData->outsrc1, out48k_short, out8k_short, g_soundCard1SampleRate, samplerate, N48*4, n_samples);
+            g_mutexProtectingCallbackData.Lock();
+            ret = fifo_write(cbData->outfifo1, out48k_short, nout);
+            //fprintf(stderr,"nout: %d ret: %d N48*4: %d\n", nout, ret, N48*4);
+
+            assert(ret != -1);
+        }
+        g_mutexProtectingCallbackData.Unlock();
+    }
+   
+    //fprintf(g_logfile, "  end infifo1: %5d outfifo2: %5d\n", fifo_used(cbData->infifo1), fifo_used(cbData->outfifo2));
+
+}
+
+//----------------------------------------------------------------
+// per_frame_rx_processing()
+//----------------------------------------------------------------
+
+void per_frame_rx_processing(
+                                            FIFO    *output_fifo,   // decoded speech samples
+                                            FIFO    *input_fifo
+                                        )
+{
+    short               input_buf[g_pfreedv->n_max_modem_samples];
+    short               output_buf[g_pfreedv->n_speech_samples];
+    COMP                rx_fdm[g_pfreedv->n_max_modem_samples];
+    COMP                rx_fdm_offset[g_pfreedv->n_max_modem_samples];
+    float               rx_spec[MODEM_STATS_NSPEC];
+    int                 i;
+    int                 nin, nin_prev, nout;
+
+    nin = freedv_nin(g_pfreedv);
+    while (fifo_read(input_fifo, input_buf, nin) == 0)
+    {
+        assert(nin <= g_pfreedv->n_max_modem_samples);
+
+        nin_prev = nin;
+        //fwrite(input_buf, sizeof(short), nin, ft);
+
+        // demod per frame processing
+        for(i=0; i<nin; i++)
+        {
+            rx_fdm[i].real = (float)input_buf[i];
+            rx_fdm[i].imag = 0.0;
+        }
+       
+        if (g_channel_noise) {
+            float snr;
+
+            /* enough noise to get a couple of % errors */
+
+            if (g_pfreedv->mode == FREEDV_MODE_1600)
+                snr = 2.0;
+            if ((g_pfreedv->mode == FREEDV_MODE_700) || (g_pfreedv->mode == FREEDV_MODE_700))
+                snr = -1.0;           
+            fdmdv_simulate_channel(&g_sig_pwr_av, rx_fdm, nin, snr);
+        }
+        fdmdv_freq_shift_coh(rx_fdm_offset, rx_fdm, g_RxFreqOffsetHz, g_pfreedv->modem_sample_rate, &g_RxFreqOffsetPhaseRect, nin);
+        nout = freedv_comprx(g_pfreedv, output_buf, rx_fdm_offset);
+        
+        fifo_write(output_fifo, output_buf, nout);
+        
+        nin = freedv_nin(g_pfreedv);
+        g_State = g_pfreedv->sync;
+        //fprintf(g_logfile, "g_State: %d g_stats.sync: %d snr: %f \n", g_State, g_stats.sync, f->snr);
+
+        // compute rx spectrum 
+
+        modem_stats_get_rx_spectrum(&g_stats, rx_spec, rx_fdm, nin_prev);
+        // Average rx spectrum data using a simple IIR low pass filter
+
+        for(i = 0; i<MODEM_STATS_NSPEC; i++) {
+            g_avmag[i] = BETA * g_avmag[i] + (1.0 - BETA) * rx_spec[i];
+        }
+
+        if (g_pfreedv->mode == FREEDV_MODE_1600)
+            fdmdv_get_demod_stats(g_pfreedv->fdmdv, &g_stats);
+        if ((g_pfreedv->mode == FREEDV_MODE_700) || (g_pfreedv->mode == FREEDV_MODE_700B))
+            cohpsk_get_demod_stats(g_pfreedv->cohpsk, &g_stats);
+
+    }
+}
+
+
+//-------------------------------------------------------------------------
+// rxCallback()
+//
+// Sound card 1 callback from PortAudio, that is used for processing rx
+// side:
+//
+// + infifo1 is the "from radio" off air modem signal from the SSB rx that we send to the demod.
+// + In single sound card mode outfifo1 is the "to speaker/headphones" decoded speech output.
+// + In dual sound card mode outfifo1 is the "to radio" modulator signal to the SSB tx.
+//
+//-------------------------------------------------------------------------
+int MainFrame::rxCallback(
+                            const void      *inputBuffer,
+                            void            *outputBuffer,
+                            unsigned long   framesPerBuffer,
+                            const PaStreamCallbackTimeInfo* timeInfo,
+                            PaStreamCallbackFlags statusFlags,
+                            void            *userData
+                         )
+{
+    paCallBackData  *cbData = (paCallBackData*)userData;
+    short           *rptr    = (short*)inputBuffer;
+    short           *wptr    = (short*)outputBuffer;
+
+    short           indata[MAX_FPB];
+    short           outdata[MAX_FPB];
+
+    unsigned int    i;
+
+    (void) timeInfo;
+    (void) statusFlags;
+
+    wxMutexLocker lock(g_mutexProtectingCallbackData);
+
+    //fprintf(g_logfile, "cb1 statusFlags: 0x%x framesPerBuffer: %d rptr: 0x%x wptr: 0x%x \n", (int)statusFlags,
+    //        framesPerBuffer, rptr, wptr);
+
+    //
+    //  RX side processing --------------------------------------------
+    //
+
+    // assemble a mono buffer and write to FIFO
+
+    assert(framesPerBuffer < MAX_FPB);
+
+    if(rptr) {
+        //fprintf(g_logfile,"in %ld %d\n",  framesPerBuffer, g_in++);
+        //g_indata += framesPerBuffer;
+        for(i = 0; i < framesPerBuffer; i++, rptr += cbData->inputChannels1)
+            indata[i] = rptr[0];                       
+        if (fifo_write(cbData->infifo1, indata, framesPerBuffer)) {
+            //fprintf(g_logfile, "infifo1 full\n");
+        }
+        //fifo_write(cbData->outfifo1, indata, framesPerBuffer);
+    }
+
+    // OK now set up output samples for this callback
+
+    if(wptr) {
+        //fprintf(g_logfile,"out %ld %d\n",  framesPerBuffer, g_out++);
+        if (fifo_read(cbData->outfifo1, outdata, framesPerBuffer) == 0) {
+
+            // write signal to both channels
+
+            for(i = 0; i < framesPerBuffer; i++, wptr += 2) {
+                if (cbData->leftChannelVoxTone) {
+                    cbData->voxTonePhase += 2.0*M_PI*VOX_TONE_FREQ/g_soundCard1SampleRate;
+                    cbData->voxTonePhase -= 2.0*M_PI*floor(cbData->voxTonePhase/(2.0*M_PI));
+                    wptr[0] = VOX_TONE_AMP*cos(cbData->voxTonePhase);                              
+                    //printf("%f %d\n", cbData->voxTonePhase, wptr[0]);
+                }
+                else
+                    wptr[0] = outdata[i];
+                               
+                wptr[1] = outdata[i];
+            }
+        }
+        else {
+            //fprintf(g_logfile, "outfifo1 empty\n");
+            // zero output if no data available
+            for(i = 0; i < framesPerBuffer; i++, wptr += 2) {
+                wptr[0] = 0;
+                wptr[1] = 0;
+            }
+        }
+    }
+
+    return paContinue;
+}
+
+
+//-------------------------------------------------------------------------
+// txCallback()
+//-------------------------------------------------------------------------
+int MainFrame::txCallback(
+                            const void *inputBuffer,
+                            void *outputBuffer,
+                            unsigned long framesPerBuffer,
+                            const PaStreamCallbackTimeInfo *outTime,
+                            PaStreamCallbackFlags statusFlags,
+                            void *userData
+                        )
+{
+    paCallBackData  *cbData = (paCallBackData*)userData;
+    unsigned int    i;
+    short           *rptr    = (short*)inputBuffer;
+    short           *wptr    = (short*)outputBuffer;
+    short           indata[MAX_FPB];
+    short           outdata[MAX_FPB];
+
+    wxMutexLocker lock(g_mutexProtectingCallbackData);
+
+    //    if (statusFlags)
+    //    printf("cb2 statusFlags: 0x%x\n", (int)statusFlags);
+
+    // assemble a mono buffer and write to FIFO
+
+    assert(framesPerBuffer < MAX_FPB);
+
+    if(rptr) {
+        for(i = 0; i < framesPerBuffer; i++, rptr += cbData->inputChannels2)
+            indata[i] = rptr[0];                        
+    }
+
+    //#define SC2_LOOPBACK
+#ifdef SC2_LOOPBACK
+    //TODO: This doesn't work unless using the same soundcard!
+
+    if(wptr) {
+        for(i = 0; i < framesPerBuffer; i++, wptr += 2) {
+            wptr[0] = indata[i];
+            wptr[1] = indata[i];
+        }
+    }
+
+#else
+    if(rptr) {
+        if (fifo_write(cbData->infifo2, indata, framesPerBuffer)) {
+            //fprintf(g_logfile, "infifo2 full\n");
+        }
+    }
+
+    // OK now set up output samples for this callback
+
+    if(wptr) {
+        if (fifo_read(cbData->outfifo2, outdata, framesPerBuffer) == 0) {
+               
+            // write signal to both channels */
+            for(i = 0; i < framesPerBuffer; i++, wptr += 2) {
+                wptr[0] = outdata[i];
+                wptr[1] = outdata[i];
+            }
+        }
+        else {
+            //fprintf(g_logfile, "outfifo2 empty\n");
+            // zero output if no data available
+            for(i = 0; i < framesPerBuffer; i++, wptr += 2) {
+                wptr[0] = 0;
+                wptr[1] = 0;
+            }
+        }
+    }
+#endif
+    return paContinue;
+}
+
+// Callback from plot_spectrum & plot_waterfall.  would be nice to
+// work out a way to do this without globals.
+
+void fdmdv2_clickTune(float freq) {
+
+    // The demod is hard-wired to expect a centre frequency of
+    // FDMDV_FCENTRE.  So we want to take the signal centered on the
+    // click tune freq and re-centre it on FDMDV_FCENTRE.  For example
+    // if the click tune freq is 1500Hz, and FDMDV_CENTRE is 1200 Hz,
+    // we need to shift the input signal centred on 1500Hz down to
+    // 1200Hz, an offset of -300Hz.
+
+    if (g_split) {
+        g_RxFreqOffsetHz = FDMDV_FCENTRE - freq;
+    }
+    else {
+        g_TxFreqOffsetHz = freq - FDMDV_FCENTRE;
+        g_RxFreqOffsetHz = FDMDV_FCENTRE - freq;
+    }
+}
+
+//----------------------------------------------------------------
+// SetupSerialPort()
+//----------------------------------------------------------------
+void MainFrame::SetupSerialPort(void)
+{
+    if(!wxGetApp().m_strRigCtrlPort.IsEmpty())
+    {
+        if(openComPort(wxGetApp().m_strRigCtrlPort.c_str()))
+        {
+            // always start PTT in Rx state
+            SerialPTTRx();
+        }
+        else
+        {
+            wxMessageBox("Couldn't open Serial Port", wxT("About"), wxOK | wxICON_ERROR, this);
+        }
+    }
+}
+
+void MainFrame::SerialPTTRx(void)
+{
+    printf("m_boolUseRTS: %d m_boolRTSPos: %d m_boolUseDTR: %d m_boolDTRPos: %d\n",
+           wxGetApp().m_boolUseRTS, wxGetApp().m_boolRTSPos, wxGetApp().m_boolUseDTR, wxGetApp().m_boolDTRPos);
+
+        if(wxGetApp().m_boolRTSPos) // RTS cleared LOW
+            lowerRTS();
+        else                        // RTS cleared HIGH
+            raiseRTS();
+
+        if(wxGetApp().m_boolDTRPos) // DTR cleared LOW
+            lowerDTR();
+        else                        // DTR cleared HIGH
+            raiseDTR();
+}
+
+//----------------------------------------------------------------
+// CloseSerialPort()
+//----------------------------------------------------------------
+void MainFrame::CloseSerialPort(void)
+{
+    if (com_handle != COM_HANDLE_INVALID) {
+        // always end with PTT in rx state
+
+        SerialPTTRx();
+
+               closeComPort();
+    }
+}
+
+
+//----------------------------------------------------------------
+// PollUDP() - see if any commands on UDP port
+//----------------------------------------------------------------
+
+// test this puppy with netcat: 
+//   $ echo "hello" | nc -u -q1 localhost 3000
+
+int MainFrame::PollUDP(void)
+{
+    // this will block until message received, so we put it in it's own thread
+
+    char buf[1024];
+    char reply[80];
+    size_t n = m_udp_sock->RecvFrom(m_udp_addr, buf, sizeof(buf)).LastCount();
+
+    if (n) {
+        wxString bufstr = wxString::From8BitData(buf, n);
+        bufstr.Trim();
+        wxString ipaddr = m_udp_addr.IPAddress();
+        printf("Received: \"%s\" from %s:%u\n",
+               (const char *)bufstr.c_str(),
+               (const char *)ipaddr.c_str(), m_udp_addr.Service());
+
+        // for security only accept commands from local host
+
+        sprintf(reply,"nope\n");
+        if (ipaddr.Cmp(_("127.0.0.1")) == 0) {
+
+            // process commands
+
+            if (bufstr.Cmp(_("restore")) == 0) {
+                m_schedule_restore = true;  // Make Restore happen in main thread to avoid crashing
+                sprintf(reply,"ok\n");
+            }
+                
+            wxString itemToSet, val;
+            if (bufstr.StartsWith(_("set "), &itemToSet)) {
+                if (itemToSet.StartsWith("txtmsg ", &val)) {
+                    // note: if options dialog is open this will get overwritten
+                    wxGetApp().m_callSign = val;
+                }  
+                sprintf(reply,"ok\n");
+            }
+                
+        }
+        else {
+            printf("We only accept messages from locahost!\n");
+        }
+
+       if ( m_udp_sock->SendTo(m_udp_addr, reply, strlen(reply)).LastCount() != strlen(reply)) {
+           printf("ERROR: failed to send data\n");
+        }
+    }
+
+    return n;
+}
+
+void MainFrame::startUDPThread(void) {
+    printf("starting UDP thread!\n");
+    m_UDPThread = new UDPThread;
+    m_UDPThread->mf = this;
+    if (m_UDPThread->Create() != wxTHREAD_NO_ERROR ) {
+        wxLogError(wxT("Can't create thread!"));
+    }
+    if (m_UDPThread->Run() != wxTHREAD_NO_ERROR ) {
+        wxLogError(wxT("Can't start thread!"));
+        delete m_UDPThread;
+    }
+}
+
+void MainFrame::stopUDPThread(void) {
+    printf("stopping UDP thread!\n");
+    if ((m_UDPThread != NULL) && m_UDPThread->m_run) {
+        m_UDPThread->m_run = 0;
+        m_UDPThread->Wait();
+        m_UDPThread = NULL;
+    }
+}
+
+void *UDPThread::Entry() {
+    printf("UDP thread started!\n");
+    while (m_run) {
+        if (wxGetApp().m_udp_enable) {
+            printf("m_udp_enable\n");
+            mf->m_udp_addr.Service(wxGetApp().m_udp_port);
+            mf->m_udp_sock = new wxDatagramSocket(mf->m_udp_addr, wxSOCKET_NOWAIT);
+
+            while (m_run && wxGetApp().m_udp_enable) {
+                if (mf->PollUDP() == 0) {
+                    wxThread::Sleep(20);
+                }
+            }
+
+            delete mf->m_udp_sock;
+        }
+        wxThread::Sleep(20);
+    }
+    return NULL;
+}
+
+
+char my_get_next_tx_char(void *callback_state) {
+    short ch = 0;
+    
+    fifo_read(g_txDataInFifo, &ch, 1);
+    //fprintf(stderr, "get_next_tx_char: %c\n", (char)ch);
+    return (char)ch;
+}
+
+void my_put_next_rx_char(void *callback_state, char c) {
+    short ch = (short)c;
+    //fprintf(stderr, "put_next_rx_char: %c\n", (char)c);
+    fifo_write(g_rxDataOutFifo, &ch, 1);
+}
+
+// Callback from FreeDv API to update error plots
+
+void my_freedv_put_error_pattern(void *state, short error_pattern[], int sz_error_pattern) {
+    fifo_write(g_error_pattern_fifo, error_pattern, sz_error_pattern);
+}
diff --git a/freedv-dev/src/fdmdv2_main.h b/freedv-dev/src/fdmdv2_main.h
new file mode 100644 (file)
index 0000000..25a1e70
--- /dev/null
@@ -0,0 +1,614 @@
+//==========================================================================
+// Name:            fdmdv2_main.h
+//
+// Purpose:         Declares simple wxWidgets application with GUI.
+// Created:         Apr. 9, 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 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 License
+//  along with this program; if not, see <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#ifndef __FDMDV2_MAIN__
+#define __FDMDV2_MAIN__
+
+#include "version.h"
+#ifndef _NO_AUTOTOOLS_
+#include "../config.h"
+#endif
+#include <wx/wx.h>
+
+#include <wx/tglbtn.h>
+#include <wx/app.h>
+//#include <wx/aboutdlg.h>
+#include "wx/rawbmp.h"
+#include "wx/file.h"
+#include "wx/filename.h"
+#include "wx/config.h"
+#include <wx/fileconf.h>
+#include "wx/graphics.h"
+#include "wx/mstream.h"
+#include "wx/wfstream.h"
+#include "wx/quantize.h"
+#include "wx/scopedptr.h"
+#include "wx/stopwatch.h"
+#include "wx/versioninfo.h"
+#include <wx/sound.h>
+#include <wx/url.h>
+#include <wx/sstream.h>
+#include <wx/listbox.h>
+#include <wx/textdlg.h>
+#include <wx/regex.h>
+#include <wx/socket.h>
+
+#include <samplerate.h>
+
+#include <hamlib.h> 
+#include <stdint.h>
+#include <speex/speex_preprocess.h>
+
+#ifdef _WIN32
+#include <windows.h>
+#else
+#include <termios.h>
+#include <sys/ioctl.h>
+#endif
+
+#include "codec2.h"
+#include "codec2_fdmdv.h"
+#include "codec2_fifo.h"
+#include "golay23.h"
+#include "modem_stats.h"
+
+#include "topFrame.h"
+#include "dlg_ptt.h"
+#include "dlg_options.h"
+#include "fdmdv2_plot.h"
+#include "fdmdv2_plot_scalar.h"
+#include "fdmdv2_plot_scatter.h"
+#include "fdmdv2_plot_waterfall.h"
+#include "fdmdv2_plot_spectrum.h"
+#include "fdmdv2_pa_wrapper.h"
+#include "sndfile.h"
+#include "portaudio.h"
+#include "dlg_audiooptions.h"
+#include "dlg_filter.h"
+#include "dlg_options.h"
+#include "varicode.h"
+#include "sox_biquad.h"
+#include "comp_prim.h"
+
+#define _USE_TIMER              1
+#define _USE_ONIDLE             1
+#define _DUMMY_DATA             1
+//#define _AUDIO_PASSTHROUGH    1
+#define _REFRESH_TIMER_PERIOD   (DT*1000)
+//#define _USE_ABOUT_DIALOG       1
+
+enum {
+        ID_START = wxID_HIGHEST,
+        ID_TIMER_WATERFALL,
+        ID_TIMER_SPECTRUM,
+        ID_TIMER_SCATTER,
+        ID_TIMER_SCALAR
+     };
+
+#define EXCHANGE_DATA_IN    0
+#define EXCHANGE_DATA_OUT   1
+
+#ifdef _WIN32
+#define COM_HANDLE_INVALID                     INVALID_HANDLE_VALUE
+typedef HANDLE      com_handle_t;
+#else
+#define COM_HANDLE_INVALID                     -1
+typedef int         com_handle_t;
+#endif
+
+extern int                 g_nSoundCards;
+extern int                 g_soundCard1InDeviceNum;
+extern int                 g_soundCard1OutDeviceNum;
+extern int                 g_soundCard1SampleRate;
+extern int                 g_soundCard2InDeviceNum;
+extern int                 g_soundCard2OutDeviceNum;
+extern int                 g_soundCard2SampleRate;
+
+class MainFrame;
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class MainApp
+//
+// @class $(Name)
+// @author $(User)
+// @date $(Date)
+// @file $(CurrentFileName).$(CurrentFileExt)
+// @brief
+//
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class MainApp : public wxApp
+{
+    public:
+        virtual bool        OnInit();
+        virtual int         OnExit();
+
+        wxString            m_strVendName;
+        wxString            m_StrAppName;
+
+        wxString            m_textNumChOut;
+        wxString            m_textNumChIn;
+
+        wxString            m_strRxInAudio;
+        wxString            m_strRxOutAudio;
+        wxString            m_textVoiceInput;
+        wxString            m_textVoiceOutput;
+        wxString            m_strSampleRate;
+        wxString            m_strBitrate;
+
+        // PTT -----------------------------------
+
+        bool                m_boolHalfDuplex;
+
+        bool                m_boolHamlibUseForPTT;
+        unsigned int        m_intHamlibRig;
+        wxString            m_strHamlibSerialPort;
+        Hamlib              *m_hamlib;
+
+        bool                m_boolUseSerialPTT;
+        wxString            m_strRigCtrlPort;
+        bool                m_boolUseRTS;
+        bool                m_boolRTSPos;
+        bool                m_boolUseDTR;
+        bool                m_boolDTRPos;
+
+        // Play/Rec files
+
+        wxString            m_playFileToMicInPath;
+        wxString            m_recFileFromRadioPath;
+        unsigned int        m_recFileFromRadioSecs;
+        wxString            m_playFileFromRadioPath;
+
+        // Options dialog
+
+        wxString            m_callSign;
+        bool                m_events;
+        int                 m_events_spam_timer;
+        unsigned int        m_textEncoding;
+        bool                m_enable_checksum;
+        wxString            m_events_regexp_match;
+        wxString            m_events_regexp_replace;
+
+        bool                m_snrSlow;
+
+        // LPC Post Filter
+        bool                m_codec2LPCPostFilterEnable;
+        bool                m_codec2LPCPostFilterBassBoost;
+        float               m_codec2LPCPostFilterGamma;
+        float               m_codec2LPCPostFilterBeta;
+        
+        // Speex Pre-Processor
+        bool                m_speexpp_enable;
+
+        // Mic In Equaliser
+        float               m_MicInBassFreqHz;
+        float               m_MicInBassGaindB;
+        float               m_MicInTrebleFreqHz;
+        float               m_MicInTrebleGaindB;
+        float               m_MicInMidFreqHz;
+        float               m_MicInMidGaindB;
+        float               m_MicInMidQ;
+        bool                m_MicInEQEnable;
+
+        // Spk Out Equaliser
+        float               m_SpkOutBassFreqHz;
+        float               m_SpkOutBassGaindB;
+        float               m_SpkOutTrebleFreqHz;
+        float               m_SpkOutTrebleGaindB;
+        float               m_SpkOutMidFreqHz;
+        float               m_SpkOutMidGaindB;
+        float               m_SpkOutMidQ;
+        bool                m_SpkOutEQEnable;
+
+        // Flags for displaying windows
+        int                 m_show_wf;
+        int                 m_show_spect;
+        int                 m_show_scatter;
+        int                 m_show_timing;
+        int                 m_show_freq;
+        int                 m_show_speech_in;
+        int                 m_show_speech_out;
+        int                 m_show_demod_in;
+        int                 m_show_test_frame_errors;
+        int                 m_show_test_frame_errors_hist;
+
+        // optional vox trigger tone
+        bool                m_leftChannelVoxTone;
+
+        // UDP control port
+        bool                m_udp_enable;
+        int                 m_udp_port;
+
+        // notebook display after tx->rxtransition
+        int                 m_rxNbookCtrl;
+
+        wxRect              m_rTopWindow;
+
+        int                 m_framesPerBuffer;
+
+        bool                loadConfig();
+        bool                saveConfig();
+
+        // misc
+
+        bool       m_testFrames;
+        bool       m_channel_noise;
+        float      m_channel_snr_dB;
+
+        int        FilterEvent(wxEvent& event);
+        MainFrame *frame;
+
+        bool       m_FreeDV700txClip;
+    protected:
+};
+
+// declare global static function wxGetApp()
+DECLARE_APP(MainApp)
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// paCallBackData
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+typedef struct
+{
+    // libresample states for 48 to 8 kHz conversions
+
+    SRC_STATE      *insrc1;
+    SRC_STATE      *outsrc1;
+    SRC_STATE      *insrc2;
+    SRC_STATE      *outsrc2;
+    SRC_STATE      *insrcsf;
+
+    // FIFOs attached to first sound card
+
+    struct FIFO    *infifo1;
+    struct FIFO    *outfifo1;
+
+    // FIFOs attached to second sound card
+    struct FIFO    *infifo2;
+    struct FIFO    *outfifo2;
+
+    // FIFOs for rx process
+    struct FIFO    *rxinfifo;
+    struct FIFO    *rxoutfifo;
+
+    int             inputChannels1, inputChannels2;
+
+    // EQ filter states
+    void           *sbqMicInBass;
+    void           *sbqMicInTreble;
+    void           *sbqMicInMid;
+    void           *sbqSpkOutBass;
+    void           *sbqSpkOutTreble;
+    void           *sbqSpkOutMid;
+
+    bool            micInEQEnable;
+    bool            spkOutEQEnable;
+
+    // optional loud tone on left channel to reliably trigger vox
+    bool            leftChannelVoxTone;
+    float           voxTonePhase;
+
+} paCallBackData;
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// panel with custom loop checkbox for play file dialog
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class MyExtraPlayFilePanel : public wxPanel
+{
+public:
+    MyExtraPlayFilePanel(wxWindow *parent);
+    void setLoopPlayFileToMicIn(bool checked) { m_cb->SetValue(checked); }
+    bool getLoopPlayFileToMicIn(void) { return m_cb->GetValue(); }
+private:
+    wxCheckBox *m_cb;
+};
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// panel with custom Seconds-to-record control for record file dialog
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class MyExtraRecFilePanel : public wxPanel
+{
+public:
+    MyExtraRecFilePanel(wxWindow *parent);
+    ~MyExtraRecFilePanel() 
+    {
+        wxLogDebug("Destructor\n");
+    }
+    void setSecondsToRecord(wxString value) { m_secondsToRecord->SetValue(value); }
+    wxString getSecondsToRecord(void) 
+    { 
+        wxLogDebug("getSecondsToRecord: %s\n",m_secondsToRecord->GetValue());
+        return m_secondsToRecord->GetValue(); 
+    }
+private:
+    wxTextCtrl *m_secondsToRecord;
+};
+
+class txRxThread;
+class UDPThread;
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class MainFrame
+//
+// @class $(Name)
+// @author $(User)
+// @date $(Date)
+// @file $(CurrentFileName).$(CurrentFileExt)
+// @brief
+//
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class MainFrame : public TopFrame
+{
+    public:
+        MainFrame(wxWindow *parent);
+        virtual ~MainFrame();
+
+        PlotSpectrum*           m_panelSpectrum;
+        PlotWaterfall*          m_panelWaterfall;
+        PlotScatter*            m_panelScatter;
+        PlotScalar*             m_panelTimeOffset;
+        PlotScalar*             m_panelFreqOffset;
+        PlotScalar*             m_panelSpeechIn;
+        PlotScalar*             m_panelSpeechOut;
+        PlotScalar*             m_panelDemodIn;
+        PlotScalar*             m_panelTestFrameErrors;
+        PlotScalar*             m_panelTestFrameErrorsHist;
+
+        bool                    m_RxRunning;
+
+        PortAudioWrap           *m_rxInPa;
+        PortAudioWrap           *m_rxOutPa;
+        PortAudioWrap           *m_txInPa;
+        PortAudioWrap           *m_txOutPa;
+
+        PaError                 m_rxErr;
+        PaError                 m_txErr;
+        
+        txRxThread*             m_txRxThread;
+
+        bool                    OpenHamlibRig();
+        void                    SetupSerialPort(void);
+        void                    CloseSerialPort(void);
+        void                    SerialPTTRx(void);
+
+        bool                    m_modal;
+
+#ifdef _USE_TIMER
+        wxTimer                 m_plotTimer;
+#endif
+
+    void destroy_fifos(void);
+    void destroy_src(void);
+    void autoDetectSoundCards(PortAudioWrap *pa);
+
+        static int rxCallback(
+                                const void *inBuffer,
+                                void *outBuffer,
+                                unsigned long framesPerBuffer,
+                                const PaStreamCallbackTimeInfo *outTime,
+                                PaStreamCallbackFlags statusFlags,
+                                void *userData
+                             );
+        static int txCallback(
+                                const void *inBuffer,
+                                void *outBuffer,
+                                unsigned long framesPerBuffer,
+                                const PaStreamCallbackTimeInfo *outTime,
+                                PaStreamCallbackFlags statusFlags,
+                                void *userData
+                             );
+
+
+    void initPortAudioDevice(PortAudioWrap *pa, int inDevice, int outDevice, 
+                             int soundCard, int sampleRate, int inputChannels);
+
+    void togglePTT(void);
+
+    wxIPV4address           m_udp_addr;
+    wxDatagramSocket       *m_udp_sock;
+    UDPThread              *m_UDPThread;
+    void                    startUDPThread(void);
+    void                    stopUDPThread(void);
+    int                     PollUDP();
+    bool                    m_schedule_restore;
+
+    protected:
+
+#ifdef _WIN32
+#define COM_HANDLE_INVALID                     INVALID_HANDLE_VALUE
+        com_handle_t  com_handle;
+#else
+#define COM_HANDLE_INVALID                     -1
+        com_handle_t  com_handle;
+#endif
+        void raiseDTR(void);
+        void lowerDTR(void);
+        void raiseRTS(void);
+        void lowerRTS(void);
+        bool openComPort(const char *port);
+        void closeComPort(void);
+
+        void setsnrBeta(bool snrSlow);
+
+        // protected event handlers
+        virtual void OnCloseFrame(wxCloseEvent& event);
+        void OnExitClick(wxCommandEvent& event);
+
+        void startTxStream();
+        void startRxStream();
+        void stopTxStream();
+        void stopRxStream();
+        void abortTxStream();
+        void abortRxStream();
+        
+        void OnTop(wxCommandEvent& event);
+        void OnExit( wxCommandEvent& event );
+
+        void OnToolsAudio( wxCommandEvent& event );
+        void OnToolsAudioUI( wxUpdateUIEvent& event );
+        void OnToolsComCfg( wxCommandEvent& event );
+        void OnToolsComCfgUI( wxUpdateUIEvent& event );
+        void OnToolsFilter( wxCommandEvent& event );
+        void OnToolsOptions(wxCommandEvent& event);
+        void OnToolsOptionsUI(wxUpdateUIEvent& event);
+
+        void OnPlayFileToMicIn( wxCommandEvent& event );
+        void OnRecFileFromRadio( wxCommandEvent& event );
+        void OnPlayFileFromRadio( wxCommandEvent& event );
+
+        void OnHelpCheckUpdates( wxCommandEvent& event );
+        void OnHelpCheckUpdatesUI( wxUpdateUIEvent& event );
+        void OnHelpAbout( wxCommandEvent& event );
+        void OnCmdSliderScroll( wxScrollEvent& event );
+//        void OnSliderScrollBottom( wxScrollEvent& event );
+//        void OnCmdSliderScrollChanged( wxScrollEvent& event );
+//        void OnSliderScrollTop( wxScrollEvent& event );
+        void OnCheckSQClick( wxCommandEvent& event );
+        void OnCheckSNRClick( wxCommandEvent& event );
+
+        // Toggle Buttons
+        void OnTogBtnSplitClick(wxCommandEvent& event);
+        void OnTogBtnAnalogClick(wxCommandEvent& event);
+        void OnTogBtnRxID( wxCommandEvent& event );
+        void OnTogBtnTxID( wxCommandEvent& event );
+        void OnTogBtnPTT( wxCommandEvent& event );
+        void OnTogBtnOnOff( wxCommandEvent& event );
+
+        void OnCallSignReset( wxCommandEvent& event );
+        void OnBerReset( wxCommandEvent& event );
+
+        //System Events
+        void OnPaint(wxPaintEvent& event);
+        void OnSize( wxSizeEvent& event );
+        void OnUpdateUI( wxUpdateUIEvent& event );
+        void OnDeleteConfig(wxCommandEvent&);
+#ifdef _USE_TIMER
+        void OnTimer(wxTimerEvent &evt);
+#endif
+#ifdef _USE_ONIDLE
+        void OnIdle(wxIdleEvent &evt);
+#endif
+
+    private:
+        bool        m_useMemory;
+        wxTextCtrl* m_tc;
+        int         m_zoom;
+        float       m_snrBeta;
+        
+        // Callsign/text messaging
+        char        m_callsign[MAX_CALLSIGN];
+        char       *m_pcallsign;
+        unsigned int m_checksumGood;
+        unsigned int m_checksumBad;
+        
+        // Events
+        void        processTxtEvent(char event[]);
+        class OptionsDlg *optionsDlg;
+        wxTimer     spamTimer[MAX_EVENT_RULES];
+
+        // level Gauge
+        float       m_maxLevel;
+        // flags to indicate when new EQ filters need to be designed
+
+        bool        m_newMicInFilter;
+        bool        m_newSpkOutFilter;
+
+        void*       designAnEQFilter(const char filterType[], float freqHz, float gaindB, float Q = 0.0);
+        void        designEQFilters(paCallBackData *cb);
+        void        deleteEQFilters(paCallBackData *cb);
+};
+
+void txRxProcessing();
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// class txRxThread - experimental tx/rx processing thread
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class txRxThread : public wxThread
+{
+public:
+    txRxThread(void) : wxThread(wxTHREAD_JOINABLE) { m_run = 1; }
+
+    // thread execution starts here
+    void *Entry() 
+    {
+        while (m_run) 
+        {
+            txRxProcessing();        
+            wxThread::Sleep(20);
+        }
+        return NULL;
+    }
+
+    // called when the thread exits - whether it terminates normally or is
+    // stopped with Delete() (but not when it is Kill()ed!)
+    void OnExit() { }
+
+public:
+    bool  m_run;
+};
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// class UDPThread - waits for UDP messages
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class UDPThread : public wxThread
+{
+public:
+    UDPThread(void) : wxThread(wxTHREAD_JOINABLE) { m_run = 1; }
+
+    // thread execution starts here
+    void *Entry();
+
+    // called when the thread exits - whether it terminates normally or is
+    // stopped with Delete() (but not when it is Kill()ed!)
+    void OnExit() { }
+
+public:
+    MainFrame              *mf;
+    bool                    m_run;
+};
+
+void resample_for_plot(struct FIFO *plotFifo, short buf[], int length, int fs);
+
+int resample(SRC_STATE *src,
+             short      output_short[],
+             short      input_short[],
+             int        output_sample_rate,
+             int        input_sample_rate,
+             int        length_output_short, // maximum output array length in samples
+             int        length_input_short
+             );
+void txRxProcessing();
+void per_frame_rx_processing(
+                                        FIFO    *output_fifo,   // decoded speech samples
+                                        FIFO    *input_fifo     // modem samples input to demod
+                                    );
+
+// FreeDv API calls this when there is a test frame that needs a-plottin'
+
+void my_freedv_put_error_pattern(void *state, short error_pattern[], int sz_error_pattern);
+
+// FreeDv API calls these puppies when it needs/receives a text char 
+
+char my_get_next_tx_char(void *callback_state);
+void my_put_next_rx_char(void *callback_state, char c);
+
+#endif //__FDMDV2_MAIN__
diff --git a/freedv-dev/src/fdmdv2_pa_wrapper.cpp b/freedv-dev/src/fdmdv2_pa_wrapper.cpp
new file mode 100644 (file)
index 0000000..2f67ca2
--- /dev/null
@@ -0,0 +1,324 @@
+//==========================================================================
+// Name:            fdmdv2_pa_wrapper.cpp
+// Purpose:         Implements a wrapper class around the PortAudio library.
+// Created:         August 12, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#include "fdmdv2_pa_wrapper.h"
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// PortAudioWrap()
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+PortAudioWrap::PortAudioWrap()
+{
+    m_pStream                   = NULL;
+    m_pUserData                 = NULL;
+    m_samplerate                = 0;
+    m_framesPerBuffer           = 0;
+    m_statusFlags               = 0;
+    m_pStreamCallback           = NULL;
+    m_pStreamFinishedCallback   = NULL;
+    m_pTimeInfo                 = 0;
+    m_newdata                   = false;
+
+//    loadData();
+}
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// ~PortAudioWrap()
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+PortAudioWrap::~PortAudioWrap()
+{
+}
+
+//----------------------------------------------------------------
+// streamOpen()
+//----------------------------------------------------------------
+PaError PortAudioWrap::streamOpen()
+{
+    return Pa_OpenStream(
+                            &m_pStream,
+                            m_inputBuffer.device == paNoDevice ? NULL : &m_inputBuffer,
+                            m_outputBuffer.device == paNoDevice ? NULL : &m_outputBuffer,
+                            m_samplerate,
+                            m_framesPerBuffer,
+                            m_statusFlags,
+                            *m_pStreamCallback,
+                            m_pUserData
+                        );
+}
+
+//----------------------------------------------------------------
+// streamStart()
+//----------------------------------------------------------------
+PaError PortAudioWrap::streamStart()
+{
+    return Pa_StartStream(m_pStream);
+}
+
+//----------------------------------------------------------------
+// streamClose()
+//----------------------------------------------------------------
+PaError PortAudioWrap::streamClose()
+{
+    if(isOpen())
+    {
+        PaError rv = Pa_CloseStream(m_pStream);
+        return rv;
+    }
+    else
+    {
+        return paNoError;
+    }
+}
+
+//----------------------------------------------------------------
+// terminate()
+//----------------------------------------------------------------
+void PortAudioWrap::terminate()
+{
+    if(Pa_IsStreamStopped(m_pStream) != paNoError)
+    {
+        Pa_StopStream(m_pStream);
+    }
+    Pa_Terminate();
+}
+
+//----------------------------------------------------------------
+// stop()
+//----------------------------------------------------------------
+void PortAudioWrap::stop()
+{
+    Pa_StopStream(m_pStream);
+}
+
+//----------------------------------------------------------------
+// abort()
+//----------------------------------------------------------------
+void PortAudioWrap::abort()
+{
+    Pa_AbortStream(m_pStream);
+}
+
+//----------------------------------------------------------------
+// isStopped()
+//----------------------------------------------------------------
+bool PortAudioWrap::isStopped() const
+{
+    PaError ret = Pa_IsStreamStopped(m_pStream);
+    return ret;
+}
+
+//----------------------------------------------------------------
+// isActive()
+//----------------------------------------------------------------
+bool PortAudioWrap::isActive() const
+{
+    PaError ret = Pa_IsStreamActive(m_pStream);
+    return ret;
+}
+
+//----------------------------------------------------------------
+// isOpen()
+//----------------------------------------------------------------
+bool PortAudioWrap::isOpen() const
+{
+    return (m_pStream != NULL);
+}
+
+//----------------------------------------------------------------
+// getDefaultInputDevice()
+//----------------------------------------------------------------
+PaDeviceIndex PortAudioWrap::getDefaultInputDevice()
+{
+    return Pa_GetDefaultInputDevice();
+}
+
+//----------------------------------------------------------------
+// getDefaultOutputDevice()
+//----------------------------------------------------------------
+PaDeviceIndex PortAudioWrap::getDefaultOutputDevice()
+{
+    return Pa_GetDefaultOutputDevice();
+}
+
+//----------------------------------------------------------------
+// setInputChannelCount()
+//----------------------------------------------------------------
+PaError PortAudioWrap::setInputChannelCount(int count)
+{
+    m_inputBuffer.channelCount = count;
+    return paNoError;
+}
+
+//----------------------------------------------------------------
+// getInputChannelCount()
+//----------------------------------------------------------------
+PaError PortAudioWrap::getInputChannelCount()
+{
+    return m_inputBuffer.channelCount;
+}
+
+//----------------------------------------------------------------
+// setInputSampleFormat()
+//----------------------------------------------------------------
+PaError PortAudioWrap::setInputSampleFormat(PaSampleFormat format)
+{
+    m_inputBuffer.sampleFormat = format;
+    return paNoError;
+}
+
+//----------------------------------------------------------------
+// setInputLatency()
+//----------------------------------------------------------------
+PaError PortAudioWrap::setInputLatency(PaTime latency)
+{
+    m_inputBuffer.suggestedLatency = latency;
+    return paNoError;
+}
+
+//----------------------------------------------------------------
+// setInputHostApiStreamInfo()
+//----------------------------------------------------------------
+void PortAudioWrap::setInputHostApiStreamInfo(void *info)
+{
+    m_inputBuffer.hostApiSpecificStreamInfo = info;
+}
+
+//----------------------------------------------------------------
+// getInputDefaultLowLatency()
+//----------------------------------------------------------------
+PaTime  PortAudioWrap::getInputDefaultLowLatency()
+{
+    return Pa_GetDeviceInfo(m_inputBuffer.device)->defaultLowInputLatency;
+}
+
+//----------------------------------------------------------------
+// setOutputChannelCount()
+//----------------------------------------------------------------
+PaError PortAudioWrap::setOutputChannelCount(int count)
+{
+    m_outputBuffer.channelCount = count;
+    return paNoError;
+}
+
+//----------------------------------------------------------------
+// getOutputChannelCount()
+//----------------------------------------------------------------
+const int PortAudioWrap::getOutputChannelCount()
+{
+    return m_outputBuffer.channelCount;
+}
+
+//----------------------------------------------------------------
+// getDeviceName()
+//----------------------------------------------------------------
+const char *PortAudioWrap::getDeviceName(PaDeviceIndex dev)
+{
+    const PaDeviceInfo *info;
+    info = Pa_GetDeviceInfo(dev);
+    return info->name;
+}
+
+//----------------------------------------------------------------
+// setOutputSampleFormat()
+//----------------------------------------------------------------
+PaError PortAudioWrap::setOutputSampleFormat(PaSampleFormat format)
+{
+    m_outputBuffer.sampleFormat = format;
+    return paNoError;
+}
+
+//----------------------------------------------------------------
+// setOutputLatency()
+//----------------------------------------------------------------
+PaError PortAudioWrap::setOutputLatency(PaTime latency)
+{
+    m_outputBuffer.suggestedLatency = latency;
+    return paNoError;
+}
+
+//----------------------------------------------------------------
+// setOutputHostApiStreamInfo()
+//----------------------------------------------------------------
+void PortAudioWrap::setOutputHostApiStreamInfo(void *info)
+{
+    m_outputBuffer.hostApiSpecificStreamInfo = info;
+}
+
+//----------------------------------------------------------------
+// getOutputDefaultLowLatency()
+//----------------------------------------------------------------
+PaTime  PortAudioWrap::getOutputDefaultLowLatency()
+{
+    return Pa_GetDeviceInfo(m_outputBuffer.device)->defaultLowOutputLatency;
+}
+
+//----------------------------------------------------------------
+// setFramesPerBuffer()
+//----------------------------------------------------------------
+PaError PortAudioWrap::setFramesPerBuffer(unsigned long size)
+{
+    m_framesPerBuffer = size;
+    return paNoError;
+}
+
+//----------------------------------------------------------------
+// setSampleRate()
+//----------------------------------------------------------------
+PaError PortAudioWrap::setSampleRate(unsigned long rate)
+{
+    m_samplerate = rate;
+    return paNoError;
+}
+
+//----------------------------------------------------------------
+// setStreamFlags()
+//----------------------------------------------------------------
+PaError PortAudioWrap::setStreamFlags(PaStreamFlags flags)
+{
+    m_statusFlags = flags;
+    return paNoError;
+}
+
+//----------------------------------------------------------------
+// setInputDevice()
+//----------------------------------------------------------------
+PaError PortAudioWrap::setInputDevice(PaDeviceIndex index)
+{
+    m_inputBuffer.device = index;
+    return paNoError;
+}
+
+//----------------------------------------------------------------
+// setOutputDevice()
+//----------------------------------------------------------------
+PaError PortAudioWrap::setOutputDevice(PaDeviceIndex index)
+{
+    m_outputBuffer.device = index;
+    return paNoError;
+}
+
+//----------------------------------------------------------------
+// setCallback()
+//----------------------------------------------------------------
+PaError PortAudioWrap::setCallback(PaStreamCallback *callback)
+{
+    m_pStreamCallback = callback;
+    return paNoError;
+}
+
diff --git a/freedv-dev/src/fdmdv2_pa_wrapper.h b/freedv-dev/src/fdmdv2_pa_wrapper.h
new file mode 100644 (file)
index 0000000..3d216c0
--- /dev/null
@@ -0,0 +1,115 @@
+//==========================================================================
+// Name:            fdmdv2_pa_wrapper.h
+// Purpose:         Defines a wrapper class around PortAudio
+// Created:         August 12, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#include <stdio.h>
+#include <math.h>
+#include "fdmdv2_defines.h"
+#include "codec2_fdmdv.h"
+#include "codec2.h"
+#include "portaudio.h"
+
+#define PA_SAMPLE_TYPE      paInt16         //paFloat32
+#define FRAMES_PER_BUFFER   (64)
+
+typedef float SAMPLE;
+
+class PortAudioWrap
+{
+    public:
+        PortAudioWrap();
+        ~PortAudioWrap();
+
+//        float                           m_av_mag[FDMDV_NSPEC];
+
+    private:
+        PaStream                        *m_pStream;
+        void                            *m_pUserData;
+        PaStreamCallback                *m_pStreamCallback;
+        PaStreamFinishedCallback        *m_pStreamFinishedCallback;
+        const PaStreamCallbackTimeInfo  *m_pTimeInfo;
+        struct FDMDV                    *m_pFDMDV_state;
+        PaStreamParameters              m_inputBuffer;
+        PaStreamParameters              m_outputBuffer;
+        int                             m_samplerate;
+        unsigned long                   m_framesPerBuffer;
+        PaStreamCallbackFlags           m_statusFlags;
+        bool                            m_newdata;
+
+    public:
+
+        void                averageData(float mag_dB[]);
+
+        int                 getDeviceCount() { return Pa_GetDeviceCount(); }
+        PaDeviceIndex       getDefaultInputDevice();
+        PaDeviceIndex       getDefaultOutputDevice();
+        PaStreamParameters  *getDeviceInfo(PaDeviceIndex idx);
+
+        PaError             setFramesPerBuffer(unsigned long size);
+        PaError             setSampleRate(unsigned long size);
+
+        PaError             setStreamFlags(PaStreamFlags flags);
+        PaError             setCallback(PaStreamCallback *m_pStreamCallback);
+        PaError             setStreamCallback(PaStream *stream, PaStreamCallback* callback) { m_pStreamCallback = callback; return 0;}
+        PaError             setStreamFinishedCallback(PaStream *stream, PaStreamFinishedCallback* m_pStreamFinishedCallback);
+
+        void                setInputBuffer(const PaStreamParameters& inputBuffer)   {this->m_inputBuffer = inputBuffer;}
+        PaError             setInputDevice(PaDeviceIndex dev);
+        PaError             setInputChannelCount(int count);
+        int                 getInputChannelCount();
+        PaError             setInputSampleFormat(PaSampleFormat format);
+        PaError             setInputSampleRate(PaSampleFormat format);
+        PaError             setInputLatency(PaTime latency);
+        void                setInputHostApiStreamInfo(void *info = NULL);
+        PaTime              getInputDefaultLowLatency();
+        const char          *getDeviceName(PaDeviceIndex dev);
+
+        PaError             setOutputDevice(PaDeviceIndex dev);
+        PaError             setOutputChannelCount(int count);
+        const int           getOutputChannelCount();
+        PaError             setOutputSampleFormat(PaSampleFormat format);
+        PaError             setOutputLatency(PaTime latency);
+        void                setOutputHostApiStreamInfo(void *info = NULL);
+        PaTime              getOutputDefaultLowLatency();
+
+        void                setFdmdvState(FDMDV* fdmdv_state)                       {this->m_pFDMDV_state = fdmdv_state;}
+        void                setOutputBuffer(const PaStreamParameters& outputBuffer) {this->m_outputBuffer = outputBuffer;}
+        void                setTimeInfo(PaStreamCallbackTimeInfo* timeInfo)         {this->m_pTimeInfo = timeInfo;}
+        void                setUserData(void* userData)                             {this->m_pUserData = userData;}
+        unsigned long       getFramesPerBuffer() const                              {return m_framesPerBuffer;}
+        const               PaStreamParameters& getInputBuffer() const              {return m_inputBuffer;}
+        const               PaStreamParameters& getOutputBuffer() const             {return m_outputBuffer;}
+        const               PaStreamCallbackFlags& getStatusFlags() const           {return m_statusFlags;}
+
+        FDMDV*              getFdmdvState()                                         {return m_pFDMDV_state;}
+        int                 getSamplerate() const                                   {return m_samplerate;}
+        PaStream*           getStream()                                             {return m_pStream;}
+        void                *getUserData()                                          {return m_pUserData;}
+        bool                getDataAvail()                                          {return m_newdata;}
+        PaError             streamStart();
+        PaError             streamClose();
+        PaError             streamOpen();
+        void                terminate();
+        void                stop();
+        void                abort();
+        bool                isOpen() const;
+        bool                isStopped() const;
+        bool                isActive() const;
+//        void                loadData();
+};
diff --git a/freedv-dev/src/fdmdv2_plot.cpp b/freedv-dev/src/fdmdv2_plot.cpp
new file mode 100644 (file)
index 0000000..1b85cd9
--- /dev/null
@@ -0,0 +1,283 @@
+//==========================================================================
+// Name:            fdmdv2_plot.cpp
+// Purpose:         Implements simple wxWidgets application with GUI.
+// Created:         Apr. 9, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#include <string.h>
+#include "fdmdv2_plot.h"
+
+BEGIN_EVENT_TABLE(PlotPanel, wxPanel)
+    EVT_PAINT           (PlotPanel::OnPaint)
+    EVT_MOTION          (PlotPanel::OnMouseMove)
+    EVT_LEFT_DOWN       (PlotPanel::OnMouseLeftDown)
+    EVT_LEFT_UP         (PlotPanel::OnMouseLeftUp)
+    EVT_RIGHT_DOWN      (PlotPanel::OnMouseRightDown)
+    EVT_MOUSEWHEEL      (PlotPanel::OnMouseWheelMoved)
+    EVT_SIZE            (PlotPanel::OnSize)
+    EVT_SHOW            (PlotPanel::OnShow)
+END_EVENT_TABLE()
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class PlotPanel(wxFrame* parent) : wxPanel(parent)
+//
+// @class $(Name)
+// @author $(User)
+// @date $(Date)
+// @file $(CurrentFileName).$(CurrentFileExt)
+// @brief
+//
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+PlotPanel::PlotPanel(wxFrame* parent) : wxPanel(parent)
+{
+    m_pNoteBook         = (wxAuiNotebook *) parent;
+    m_pTopFrame         = (MainFrame *)m_pNoteBook->GetParent();
+    m_zoomFactor        = 1.0;
+    m_pBmp              = NULL;
+    m_pPix              = NULL;
+    m_firstPass         = true;
+    m_line_color        = 0;
+    m_newdata           = false;
+    m_clip              = false;
+    m_use_bitmap        = true;
+    m_rubberBand        = false;
+    m_mouseDown         = false;
+    m_penShortDash      = wxPen(wxColor(0xA0, 0xA0, 0xA0), 1, wxPENSTYLE_SHORT_DASH);
+    m_penDotDash        = wxPen(wxColor(0xD0, 0xD0, 0xD0), 1, wxPENSTYLE_DOT_DASH);
+    m_penSolid          = wxPen(wxColor(0x00, 0x00, 0x00), 1, wxPENSTYLE_SOLID);
+    SetBackgroundStyle(wxBG_STYLE_PAINT);
+    SetLabelSize(10.0);
+}
+
+//-------------------------------------------------------------------------
+// ~PlotPanel()
+//-------------------------------------------------------------------------
+PlotPanel::~PlotPanel()
+{
+    if(m_pBmp != NULL)
+    {
+        delete m_pBmp;
+    }
+}
+
+//-------------------------------------------------------------------------
+// GetLabelSize()
+//-------------------------------------------------------------------------
+double PlotPanel::GetLabelSize()
+{
+    return m_label_size;
+}
+
+//-------------------------------------------------------------------------
+// SetLabelSize()
+//-------------------------------------------------------------------------
+void PlotPanel::SetLabelSize(double size)
+{
+    m_label_size = size;
+}
+
+//-------------------------------------------------------------------------
+// OnShow()
+//-------------------------------------------------------------------------
+void PlotPanel::OnShow(wxShowEvent& event)
+{
+    this->Refresh();
+}
+
+//-------------------------------------------------------------------------
+// OnErase()
+//-------------------------------------------------------------------------
+void PlotPanel::OnErase(wxEraseEvent& event)
+{
+    event.Skip();
+}
+
+//-------------------------------------------------------------------------
+// OnSize()
+//-------------------------------------------------------------------------
+void PlotPanel::OnSize(wxSizeEvent& event)
+{
+    m_rCtrlPrev = m_rCtrl;
+    m_rCtrl     = GetClientRect();
+    if(m_use_bitmap)
+    {
+        if(!m_oImage.IsOk())
+        {
+            m_oImage.Create(m_rCtrl.GetWidth(), m_rCtrl.GetHeight(), true);
+        }
+        else
+        {
+            m_oImage.Rescale(m_rCtrl.GetWidth(), m_rCtrl.GetHeight());
+        }
+        m_pBmp = new wxBitmap(m_oImage, wxBITMAP_SCREEN_DEPTH);
+        m_firstPass = true;
+    }
+    this->Refresh();
+}
+
+//-------------------------------------------------------------------------
+// OnMouseMove()
+//-------------------------------------------------------------------------
+void PlotPanel::OnMouseMove(wxMouseEvent& event)
+{
+//    if(m_mouseDown)
+//    {
+//        paintNow();
+//    }
+}
+
+//-------------------------------------------------------------------------
+// OnMouseLeftDown()
+//-------------------------------------------------------------------------
+void PlotPanel::OnMouseLeftDown(wxMouseEvent& event)
+{
+}
+
+//-------------------------------------------------------------------------
+// OnMouseRightDown()
+//-------------------------------------------------------------------------
+void PlotPanel::OnMouseRightDown(wxMouseEvent& event)
+{
+}
+
+//-------------------------------------------------------------------------
+// OnMouseWheelMoved()
+//-------------------------------------------------------------------------
+void PlotPanel::OnMouseWheelMoved(wxMouseEvent& event)
+{
+}
+
+//-------------------------------------------------------------------------
+// OnMouseLeftUp()
+//-------------------------------------------------------------------------
+void PlotPanel::OnMouseLeftUp(wxMouseEvent& event)
+{
+    m_mouseDown = false;
+}
+
+//-------------------------------------------------------------------------
+// SetZoomFactor()
+//-------------------------------------------------------------------------
+double PlotPanel::SetZoomFactor(double zf)
+{
+    if((zf > 0) && (zf < 5.0))
+    {
+        m_zoomFactor = zf;
+    }
+    return zf;
+}
+
+//-------------------------------------------------------------------------
+// GetZoomFactor()
+//-------------------------------------------------------------------------
+double PlotPanel::GetZoomFactor(double zf)
+{
+    return m_zoomFactor;
+}
+
+//-------------------------------------------------------------------------
+// draw()
+//-------------------------------------------------------------------------
+void PlotPanel::draw(wxAutoBufferedPaintDC& pDC)
+{
+    printf("PlotPanel::draw()");
+    wxMemoryDC m_mDC;
+    m_mDC.SelectObject(*m_pBmp);
+    m_rCtrl  = GetClientRect();
+    m_rGrid  = m_rCtrl;
+
+    m_rGrid = m_rGrid.Deflate(PLOT_BORDER + (XLEFT_OFFSET/2), (PLOT_BORDER + (YBOTTOM_OFFSET/2)));
+    m_rGrid.Offset(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER);
+
+    pDC.Clear();
+    m_rPlot = wxRect(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER, m_rGrid.GetWidth(), m_rGrid.GetHeight());
+    if(m_firstPass)
+    {
+        m_firstPass = false;
+        m_mDC.FloodFill(0, 0, VERY_LTGREY_COLOR);
+
+        // Draw a filled rectangle with aborder
+        wxBrush ltGraphBkgBrush = wxBrush(DARK_BLUE_COLOR);
+        m_mDC.SetBrush(ltGraphBkgBrush);
+        m_mDC.SetPen(wxPen(BLACK_COLOR, 0));
+        m_mDC.DrawRectangle(m_rPlot);
+    }
+    if(m_newdata)
+    {
+        m_newdata = false;
+        int t = m_rPlot.GetTop();
+        int l = m_rPlot.GetLeft();
+//        int r = m_rPlot.GetRight();
+        int h = m_rPlot.GetHeight();
+        int w = m_rPlot.GetWidth();
+        pDC.Blit(l, t, w, h, &m_mDC, l, t);
+    }
+    drawGraticule(pDC);
+    m_mDC.SetBrush(wxNullBrush);
+    m_mDC.SelectObject(wxNullBitmap);
+}
+
+//-------------------------------------------------------------------------
+// drawGraticule()
+//-------------------------------------------------------------------------
+void PlotPanel::drawGraticule(wxAutoBufferedPaintDC& pDC)
+{
+    int p;
+    char buf[15];
+    wxString s;
+
+    // Vertical gridlines
+    pDC.SetPen(m_penShortDash);
+    for(p = (PLOT_BORDER + XLEFT_OFFSET + GRID_INCREMENT); p < ((m_rGrid.GetWidth() - XLEFT_OFFSET) + GRID_INCREMENT); p += GRID_INCREMENT)
+    {
+        pDC.DrawLine(p, (m_rGrid.GetHeight() + PLOT_BORDER), p, PLOT_BORDER);
+    }
+    // Horizontal gridlines
+    pDC.SetPen(m_penDotDash);
+    for(p = (m_rGrid.GetHeight() - GRID_INCREMENT); p > PLOT_BORDER; p -= GRID_INCREMENT)
+    {
+        pDC.DrawLine(PLOT_BORDER + XLEFT_OFFSET, (p + PLOT_BORDER), (m_rGrid.GetWidth() + PLOT_BORDER + XLEFT_OFFSET), (p + PLOT_BORDER));
+    }
+    // Label the X-Axis
+    pDC.SetPen(wxPen(GREY_COLOR, 1));
+    for(p = GRID_INCREMENT; p < (m_rGrid.GetWidth() - YBOTTOM_OFFSET); p += GRID_INCREMENT)
+    {
+        sprintf(buf, "%1.1f Hz",(double)(p / 10));
+        pDC.DrawText(buf, p - PLOT_BORDER + XLEFT_OFFSET, m_rGrid.GetHeight() + YBOTTOM_OFFSET/2);
+    }
+    // Label the Y-Axis
+    //for(p = GRID_INCREMENT; p < (h - YBOTTOM_OFFSET); p += GRID_INCREMENT)
+    for(p = (m_rGrid.GetHeight() - GRID_INCREMENT); p > PLOT_BORDER; p -= GRID_INCREMENT)
+    {
+        sprintf(buf, "%1.0f", (double)((m_rGrid.GetHeight() - p) * -10));
+        pDC.DrawText(buf, XLEFT_TEXT_OFFSET, p);
+    }
+}
+
+//-------------------------------------------------------------------------
+// paintEvent()
+//
+// Called by the system of by wxWidgets when the panel needs
+// to be redrawn. You can also trigger this call by calling
+// Refresh()/Update().
+//-------------------------------------------------------------------------
+void PlotPanel::OnPaint(wxPaintEvent & evt)
+{
+    wxAutoBufferedPaintDC pdc(this);
+    draw(pdc);
+}
+
diff --git a/freedv-dev/src/fdmdv2_plot.h b/freedv-dev/src/fdmdv2_plot.h
new file mode 100644 (file)
index 0000000..25309d3
--- /dev/null
@@ -0,0 +1,150 @@
+//==========================================================================
+// Name:            fdmdv2_plot.h
+// Purpose:         Declares simple wxWidgets application with GUI
+// Created:         Apr. 10, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+//#include "fdmdv2_main.h"
+#ifndef __FDMDV2_PLOT__
+#define __FDMDV2_PLOT__
+#include <wx/wx.h>
+#include <wx/aui/auibook.h>
+#include <wx/rawbmp.h>
+#include <wx/image.h>
+#include <wx/dcbuffer.h>
+
+#define MAX_ZOOM            7
+#define MAX_BMP_X           (400 * MAX_ZOOM)
+#define MAX_BMP_Y           (400 * MAX_ZOOM)
+#define DATA_LINE_HEIGHT    10
+#define TEXT_BASELINE_OFFSET_Y  -5
+
+
+#define wxUSE_FILEDLG       1
+#define wxUSE_LIBPNG        1
+#define wxUSE_LIBJPEG       1
+#define wxUSE_GIF           1
+#define wxUSE_PCX           1
+#define wxUSE_LIBTIFF       1
+
+#define PLOT_BORDER         12
+#define XLEFT_OFFSET        40
+#define XLEFT_TEXT_OFFSET   6
+#define YBOTTOM_OFFSET      20
+#define YBOTTOM_TEXT_OFFSET 15
+#define GRID_INCREMENT      50
+
+#define BLACK_COLOR         wxColor(0x00, 0x00, 0x00)
+#define GREY_COLOR          wxColor(0x80, 0x80, 0x80)
+#define DARK_GREY_COLOR     wxColor(0x40, 0x40, 0x40)
+#define MEDIUM_GREY_COLOR   wxColor(0xC0, 0xC0, 0xC0)
+#define LIGHT_GREY_COLOR    wxColor(0xE0, 0xE0, 0xE0)
+#define VERY_LTGREY_COLOR   wxColor(0xF8, 0xF8, 0xF8)
+#define WHITE_COLOR         wxColor(0xFF, 0xFF, 0xFF)
+
+#define DARK_BLUE_COLOR     wxColor(0x00, 0x00, 0x60)
+#define BLUE_COLOR          wxColor(0x00, 0x00, 0xFF)
+#define LIGHT_BLUE_COLOR    wxColor(0x80, 0x80, 0xFF)
+
+#define RED_COLOR           wxColor(0xFF, 0x5E, 0x5E)
+#define LIGHT_RED_COLOR     wxColor(0xFF, 0xE0, 0xE0)
+#define DARK_RED_COLOR      wxColor(0xFF, 0x00, 0x00)
+#define PINK_COLOR          wxColor(0xFF, 0x80, 0xFF)
+
+#define LIGHT_GREEN_COLOR   wxColor(0xE3, 0xFF, 0xE0)
+#define GREEN_COLOR         wxColor(0x95, 0xFF, 0x8A)
+#define DARK_GREEN_COLOR    wxColor(0x20, 0xFF, 0x08)
+#define VERY_GREEN_COLOR    wxColor(0x00, 0xFF, 0x00)
+
+#define YELLOW_COLOR        wxColor(0xFF, 0xFF, 0x5E)
+#define LIGHT_YELLOW_COLOR  wxColor(0xFF, 0xFF, 0xB5)
+#define DARK_YELLOW_COLOR   wxColor(0xFF, 0xFF, 0x08)
+
+class MainFrame;
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class PlotPanel
+//
+// @class $(Name)
+// @author $(User)
+// @date $(Date)
+// @file $(CurrentFileName).$(CurrentFileExt)
+// @brief
+//
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class PlotPanel : public wxPanel
+{
+    public:
+        PlotPanel(wxFrame* parent);
+        ~PlotPanel();
+        wxPen               m_penShortDash;
+        wxPen               m_penDotDash;
+        wxPen               m_penSolid;
+        wxRect              m_rCtrlPrev;
+        wxRect              m_rCtrl;
+        wxRect              m_rGrid;
+        wxRect              m_rPlot;
+        MainFrame           *m_pTopFrame;
+        wxAuiNotebook       *m_pNoteBook;
+        double              m_label_size;
+        wxSize              m_Bufsz;
+        bool                m_newdata;
+        wxImage             m_oImage;
+        wxBitmap            *m_pBmp;
+        wxNativePixelData   *m_pPix;
+
+        // some useful events
+        void            OnMouseMove(wxMouseEvent& event);
+        virtual void    OnMouseLeftDown(wxMouseEvent& event);
+        void            OnMouseLeftUp(wxMouseEvent& event);
+        virtual void    OnMouseRightDown(wxMouseEvent& event);
+        void            OnMouseWheelMoved(wxMouseEvent& event);
+        void            OnClose(wxCloseEvent& event ){ event.Skip(); }
+        void            OnSize( wxSizeEvent& event );
+        void            OnErase(wxEraseEvent& event);
+        void            OnPaint(wxPaintEvent& event);
+        //void OnUpdateUI( wxUpdateUIEvent& event ){ event.Skip(); }
+
+        void            paintEvent(wxPaintEvent & evt);
+        virtual void    draw(wxAutoBufferedPaintDC&  pdc);
+        virtual void    drawGraticule(wxAutoBufferedPaintDC&  pdc);
+        virtual double  SetZoomFactor(double zf);
+        virtual double  GetZoomFactor(double zf);
+        virtual void    OnShow(wxShowEvent& event);
+        virtual double  GetLabelSize();
+        virtual void    SetLabelSize(double size);
+
+    protected:
+        int             m_x;
+        int             m_y;
+        int             m_left;
+        int             m_top;
+        int             m_prev_w;
+        int             m_prev_h;
+        int             m_prev_x;
+        int             m_prev_y;
+        bool            m_use_bitmap;
+        bool            m_clip;
+        bool            m_rubberBand;
+        bool            m_mouseDown;
+        bool            m_firstPass;
+        double          m_zoomFactor;
+        int             m_greyscale;
+        int             m_line_color;
+    DECLARE_EVENT_TABLE()
+};
+#endif //__FDMDV2_PLOT__
diff --git a/freedv-dev/src/fdmdv2_plot_scalar.cpp b/freedv-dev/src/fdmdv2_plot_scalar.cpp
new file mode 100644 (file)
index 0000000..7a07f46
--- /dev/null
@@ -0,0 +1,281 @@
+//==========================================================================
+// Name:            fdmdv2_plot_scalar.cpp
+// Purpose:         Plots scalar amplitude against time
+// Created:         June 22, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#include <string.h>
+#include "wx/wx.h"
+#include "fdmdv2_main.h"
+#include "fdmdv2_plot_scalar.h"
+
+BEGIN_EVENT_TABLE(PlotScalar, PlotPanel)
+    EVT_PAINT           (PlotScalar::OnPaint)
+    EVT_MOTION          (PlotScalar::OnMouseMove)
+    EVT_MOUSEWHEEL      (PlotScalar::OnMouseWheelMoved)
+    EVT_SIZE            (PlotScalar::OnSize)
+    EVT_SHOW            (PlotScalar::OnShow)
+//    EVT_ERASE_BACKGROUND(PlotScalar::OnErase)
+END_EVENT_TABLE()
+
+//----------------------------------------------------------------
+// PlotScalar()
+//----------------------------------------------------------------
+PlotScalar::PlotScalar(wxFrame* parent, 
+                       int    channels,           // number on channels to plot
+                      float  t_secs,             // time covered by entire x axis in seconds
+                      float  sample_period_secs, // time between each sample in seconds
+                      float  a_min,              // min ampltude of samples being plotted
+                      float  a_max,              // max ampltude of samples being plotted
+                      float  graticule_t_step,   // time step of x (time) axis graticule in seconds
+                      float  graticule_a_step,   // step of amplitude axis graticule
+                      const char a_fmt[],        // printf format string for amplitude axis labels
+                       int    mini                // true for mini-plot - don't draw graticule
+                      ): PlotPanel(parent)
+{
+    int i;
+
+    m_rCtrl = GetClientRect();
+
+    m_channels = channels;
+    m_t_secs = t_secs;
+    m_sample_period_secs = sample_period_secs;
+    m_a_min = a_min;
+    m_a_max = a_max;
+    m_graticule_t_step = graticule_t_step;
+    m_graticule_a_step = graticule_a_step;
+    assert(strlen(a_fmt) < 15);
+    strcpy(m_a_fmt, a_fmt);
+    m_mini = mini;
+
+    // work out number of samples we will store and allocate storage
+
+    m_samples = m_t_secs/m_sample_period_secs;
+    m_mem = new float[m_samples*m_channels];
+
+    for(i = 0; i < m_samples*m_channels; i++)
+    {
+        m_mem[i] = 0.0;
+    }
+}
+
+//----------------------------------------------------------------
+// ~PlotScalar()
+//----------------------------------------------------------------
+PlotScalar::~PlotScalar()
+{
+    delete m_mem;
+}
+
+//----------------------------------------------------------------
+// add_new_sample()
+//----------------------------------------------------------------
+void PlotScalar::add_new_sample(int channel, float sample)
+{
+    int i;
+    int offset = channel*m_samples;
+
+    assert(channel < m_channels);
+
+    for(i = 0; i < m_samples-1; i++)
+    {
+        m_mem[offset+i] = m_mem[offset+i+1];
+    }
+    m_mem[offset+m_samples-1] = sample;
+}
+
+//----------------------------------------------------------------
+// add_new_samples()
+//----------------------------------------------------------------
+void  PlotScalar::add_new_short_samples(int channel, short samples[], int length, float scale_factor)
+{
+    int i;
+    int offset = channel*m_samples;
+
+    assert(channel < m_channels);
+
+    for(i = 0; i < m_samples-length; i++)
+        m_mem[offset+i] = m_mem[offset+i+length];
+    for(; i < m_samples; i++)
+       m_mem[offset+i] = (float)*samples++/scale_factor;
+}
+
+//----------------------------------------------------------------
+// draw()
+//----------------------------------------------------------------
+void PlotScalar::draw(wxAutoBufferedPaintDC&  dc)
+{
+    float index_to_px;
+    float a_to_py;
+    int   i;
+    int   x, y;
+    int   prev_x, prev_y;
+    float a;
+
+    m_rCtrl = GetClientRect();
+    m_rGrid = m_rCtrl;
+    if (!m_mini)
+        m_rGrid = m_rGrid.Deflate(PLOT_BORDER + (XLEFT_OFFSET/2), (PLOT_BORDER + (YBOTTOM_OFFSET/2)));
+
+    //printf("h %d w %d\n", m_rCtrl.GetWidth(), m_rCtrl.GetHeight());
+    //printf("h %d w %d\n", m_rGrid.GetWidth(), m_rGrid.GetHeight());
+
+    // black background
+
+    dc.Clear();
+    if (m_mini)
+        m_rPlot = wxRect(0, 0, m_rGrid.GetWidth(), m_rGrid.GetHeight());        
+    else
+        m_rPlot = wxRect(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER, m_rGrid.GetWidth(), m_rGrid.GetHeight());
+   
+    wxBrush ltGraphBkgBrush = wxBrush(BLACK_COLOR);
+    dc.SetBrush(ltGraphBkgBrush);
+    dc.SetPen(wxPen(BLACK_COLOR, 0));
+    dc.DrawRectangle(m_rPlot);
+
+    index_to_px = (float)m_rGrid.GetWidth()/m_samples;
+    a_to_py = (float)m_rGrid.GetHeight()/(m_a_max - m_a_min);
+
+    wxPen pen;
+    pen.SetColour(DARK_GREEN_COLOR);
+    pen.SetWidth(1);
+    dc.SetPen(pen);
+
+    // draw all samples
+
+    prev_x = prev_y = 0; // stop warning
+
+    // plot each channel 
+
+    int offset;
+    for(offset=0; offset<m_channels*m_samples; offset+=m_samples) {
+
+        for(i = 0; i < m_samples; i++) {
+            x = index_to_px * i;
+            a = m_mem[offset+i];
+            if (a < m_a_min) a = m_a_min;
+            if (a > m_a_max) a = m_a_max;
+
+            // invert y axis and offset by minimum
+
+            y = m_rGrid.GetHeight() - a_to_py * a + m_a_min*a_to_py;
+
+            // put inside plot window
+
+            if (!m_mini) {
+                x += PLOT_BORDER + XLEFT_OFFSET;
+                y += PLOT_BORDER;
+            }
+
+            if (i)
+                dc.DrawLine(x, y, prev_x, prev_y);
+            prev_x = x; prev_y = y;
+        }
+    }
+
+    drawGraticule(dc);
+}
+
+//-------------------------------------------------------------------------
+// drawGraticule()
+//-------------------------------------------------------------------------
+void PlotScalar::drawGraticule(wxAutoBufferedPaintDC&  dc)
+{
+    float    t, a;
+    int      x, y, text_w, text_h;
+    char     buf[15];
+    wxString s;
+    float    sec_to_px;
+    float    a_to_py;
+
+    wxBrush ltGraphBkgBrush;
+    ltGraphBkgBrush.SetStyle(wxBRUSHSTYLE_TRANSPARENT);
+    ltGraphBkgBrush.SetColour(*wxBLACK);
+    dc.SetBrush(ltGraphBkgBrush);
+    dc.SetPen(wxPen(BLACK_COLOR, 1));
+
+    sec_to_px = (float)m_rGrid.GetWidth()/m_t_secs;
+    a_to_py = (float)m_rGrid.GetHeight()/(m_a_max - m_a_min);
+
+    // upper LH coords of plot area are (PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER)
+    // lower RH coords of plot area are (PLOT_BORDER + XLEFT_OFFSET + m_rGrid.GetWidth(), 
+    //                                   PLOT_BORDER + m_rGrid.GetHeight())
+
+    // Vertical gridlines
+
+    dc.SetPen(m_penShortDash);
+    for(t=0; t<=m_t_secs; t+=m_graticule_t_step) {
+       x = t*sec_to_px;
+       if (m_mini) {
+            dc.DrawLine(x, m_rGrid.GetHeight(), x, 0);
+        }
+        else {
+            x += PLOT_BORDER + XLEFT_OFFSET;
+            dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, PLOT_BORDER);
+        }
+        if (!m_mini) {
+            sprintf(buf, "%2.1fs", t);
+            GetTextExtent(buf, &text_w, &text_h);
+            dc.DrawText(buf, x - text_w/2, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET);
+        }
+    }
+
+    // Horizontal gridlines
+
+    dc.SetPen(m_penDotDash);
+    for(a=m_a_min; a<m_a_max; a+=m_graticule_a_step) {
+       y = m_rGrid.GetHeight() - a*a_to_py + m_a_min*a_to_py;
+       if (m_mini) {
+            dc.DrawLine(0, y, m_rGrid.GetWidth(), y);
+        }
+        else {
+            y += PLOT_BORDER;
+            dc.DrawLine(PLOT_BORDER + XLEFT_OFFSET, y, 
+                        (m_rGrid.GetWidth() + PLOT_BORDER + XLEFT_OFFSET), y);
+        }
+        if (!m_mini) {
+            sprintf(buf, m_a_fmt, a);
+            GetTextExtent(buf, &text_w, &text_h);
+            dc.DrawText(buf, PLOT_BORDER + XLEFT_OFFSET - text_w - XLEFT_TEXT_OFFSET, y-text_h/2);
+        }
+   }
+
+
+}
+
+//----------------------------------------------------------------
+// OnPaint()
+//----------------------------------------------------------------
+void PlotScalar::OnPaint(wxPaintEvent& event)
+{
+    wxAutoBufferedPaintDC dc(this);
+    draw(dc);
+}
+
+//----------------------------------------------------------------
+// OnSize()
+//----------------------------------------------------------------
+void PlotScalar::OnSize(wxSizeEvent& event)
+{
+}
+
+//----------------------------------------------------------------
+// OnShow()
+//----------------------------------------------------------------
+void PlotScalar::OnShow(wxShowEvent& event)
+{
+}
diff --git a/freedv-dev/src/fdmdv2_plot_scalar.h b/freedv-dev/src/fdmdv2_plot_scalar.h
new file mode 100644 (file)
index 0000000..7043987
--- /dev/null
@@ -0,0 +1,73 @@
+//==========================================================================
+// Name:            fdmdv2_plot_scalar.h
+// Purpose:         Defines a scalar plot derivative of fdmdv2_plot.
+// Created:         June 22, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#ifndef __FDMDV2_PLOT_SCALAR__
+#define __FDMDV2_PLOT_SCALAR__
+
+#include "fdmdv2_plot.h"
+#include "fdmdv2_defines.h"
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class PlotScalar
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class PlotScalar: public PlotPanel
+{
+    public:
+
+    PlotScalar(wxFrame* parent,
+               int   channels,
+              float t_secs, 
+              float sample_period_secs,
+              float a_min,
+              float a_max,
+              float graticule_t_step,   
+              float graticule_a_step,
+              const char  a_fmt[],
+               int   mini
+              );
+        ~PlotScalar();
+         void add_new_sample(int channel, float sample);
+         void add_new_short_samples(int channel, short samples[], int length, float scale_factor);
+
+    protected:
+
+         int      m_channels;
+        float    m_t_secs;
+        float    m_sample_period_secs;
+        float    m_a_min;
+        float    m_a_max;
+        float    m_graticule_t_step;   
+        float    m_graticule_a_step;
+        char     m_a_fmt[15];
+         int      m_mini;
+        int      m_samples;
+        float   *m_mem;              
+
+        void draw(wxAutoBufferedPaintDC&  dc);
+       void drawGraticule(wxAutoBufferedPaintDC&  dc);
+        void OnPaint(wxPaintEvent& event);
+        void OnSize(wxSizeEvent& event);
+        void OnShow(wxShowEvent& event);
+
+        DECLARE_EVENT_TABLE()
+};
+
+#endif // __FDMDV2_PLOT_SCALAR__
+
diff --git a/freedv-dev/src/fdmdv2_plot_scatter.cpp b/freedv-dev/src/fdmdv2_plot_scatter.cpp
new file mode 100644 (file)
index 0000000..3c0b155
--- /dev/null
@@ -0,0 +1,199 @@
+//==========================================================================
+// Name:            fdmdv2_plot_scatter.cpp
+// Purpose:         A scatter plot derivative of fdmdv2_plot.
+// Created:         June 24, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#include <string.h>
+#include "wx/wx.h"
+#include "fdmdv2_plot_scatter.h"
+
+BEGIN_EVENT_TABLE(PlotScatter, PlotPanel)
+    EVT_PAINT           (PlotScatter::OnPaint)
+    EVT_MOTION          (PlotScatter::OnMouseMove)
+    EVT_MOUSEWHEEL      (PlotScatter::OnMouseWheelMoved)
+    EVT_SIZE            (PlotScatter::OnSize)
+    EVT_SHOW            (PlotScatter::OnShow)
+//    EVT_ERASE_BACKGROUND(PlotScatter::OnErase)
+END_EVENT_TABLE()
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// PlotScatter
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+PlotScatter::PlotScatter(wxFrame* parent) : PlotPanel(parent)
+{
+    int i;
+
+    for(i=0; i < SCATTER_MEM_SYMS_MAX; i++)
+    {
+        m_mem[i].real = 0.0;
+        m_mem[i].imag = 0.0;
+    }
+
+    m_filter_max_xy = 0.1;
+
+    // defaults so we start off with something sensible
+
+    Nsym = 14+1;
+    scatterMemSyms = ((int)(SCATTER_MEM_SECS*(Nsym/DT)));
+    assert(scatterMemSyms <= SCATTER_MEM_SYMS_MAX);
+        
+}
+
+// changing number of carriers changes number of symbols to plot
+void PlotScatter::setNc(int Nc) {
+    Nsym = Nc+1;
+    assert(Nsym <= (FDMDV_NC_MAX+1));
+    scatterMemSyms = ((int)(SCATTER_MEM_SECS*(Nsym/DT)));
+    assert(scatterMemSyms <= SCATTER_MEM_SYMS_MAX);
+}
+
+//----------------------------------------------------------------
+// draw()
+//----------------------------------------------------------------
+void PlotScatter::draw(wxAutoBufferedPaintDC& dc)
+{
+    float x_scale;
+    float y_scale;
+    int   i;
+    int   x;
+    int   y;
+    wxColour sym_to_colour[] = {wxColor(0,0,255), 
+                                wxColor(0,255,0),
+                                wxColor(0,255,255),
+                                wxColor(255,0,0),
+                                wxColor(255,0,255), 
+                                wxColor(255,255,0),
+                                wxColor(255,255,255),
+                                wxColor(0,0,255), 
+                                wxColor(0,255,0),
+                                wxColor(0,255,255),
+                                wxColor(255,0,0),
+                                wxColor(255,0,255), 
+                                wxColor(255,255,0),
+                                wxColor(255,255,255),
+                                wxColor(0,0,255), 
+                                wxColor(0,255,0),
+                                wxColor(0,255,255),
+                                wxColor(255,0,0),
+                                wxColor(255,0,255)
+    };
+
+    m_rCtrl = GetClientRect();
+    m_rGrid = m_rCtrl;
+    m_rGrid = m_rGrid.Deflate(PLOT_BORDER + (XLEFT_OFFSET/2), (PLOT_BORDER + (YBOTTOM_OFFSET/2)));
+
+    // black background
+
+    dc.Clear();
+    m_rPlot = wxRect(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER, m_rGrid.GetWidth(), m_rGrid.GetHeight());
+    wxBrush ltGraphBkgBrush = wxBrush(BLACK_COLOR);
+    dc.SetBrush(ltGraphBkgBrush);
+    dc.SetPen(wxPen(BLACK_COLOR, 0));
+    dc.DrawRectangle(m_rPlot);
+    wxPen pen;
+    pen.SetWidth(1); // note this is ignored by DrawPoint
+
+    // automatically scale, first measure the maximum value
+
+    float max_xy = 1E-12;
+    float real,imag;
+    for(i=0; i< scatterMemSyms; i++) {
+        real = fabs(m_mem[i].real);
+        imag = fabs(m_mem[i].imag);
+        if (real > max_xy)
+            max_xy = real;
+        if (imag > max_xy)
+            max_xy = imag;
+    }
+
+    // smooth it out and set a lower limit to prevent didev by 0 issues
+
+    m_filter_max_xy = BETA*m_filter_max_xy + (1 - BETA)*2.5*max_xy;
+    if (m_filter_max_xy < 0.001)
+        m_filter_max_xy = 0.001;
+
+    // quantise to log steps to prevent scatter scaling bobbing about too
+    // much as scaling varies
+
+    float quant_m_filter_max_xy = exp(floor(0.5+log(m_filter_max_xy)));
+    //printf("max_xy: %f m_filter_max_xy: %f quant_m_filter_max_xy: %f\n", max_xy, m_filter_max_xy, quant_m_filter_max_xy);
+
+    x_scale = (float)m_rGrid.GetWidth()/quant_m_filter_max_xy;
+    y_scale = (float)m_rGrid.GetHeight()/quant_m_filter_max_xy;
+
+    // draw all samples
+
+    for(i = 0; i < scatterMemSyms; i++)
+    {
+        x = x_scale * m_mem[i].real + m_rGrid.GetWidth()/2;
+        y = y_scale * m_mem[i].imag + m_rGrid.GetHeight()/2;
+       x += PLOT_BORDER + XLEFT_OFFSET;
+       y += PLOT_BORDER;
+        pen.SetColour(sym_to_colour[i%Nsym]);
+        dc.SetPen(pen);
+       dc.DrawPoint(x, y);
+    }
+}
+
+//----------------------------------------------------------------
+// add_new_samples()
+//----------------------------------------------------------------
+void PlotScatter::add_new_samples(COMP samples[])
+{
+    int i,j;
+
+    // shift memory
+
+    for(i = 0; i < scatterMemSyms - Nsym; i++)
+    {
+        m_mem[i] = m_mem[i+Nsym];
+    }
+
+    // new samples
+
+    for(j=0; i < scatterMemSyms; i++,j++)
+    {
+        m_mem[i] = samples[j];
+    }
+}
+
+//----------------------------------------------------------------
+// OnPaint()
+//----------------------------------------------------------------
+void PlotScatter::OnPaint(wxPaintEvent& event)
+{
+    wxAutoBufferedPaintDC dc(this);
+    draw(dc);
+}
+
+//----------------------------------------------------------------
+// OnSize()
+//----------------------------------------------------------------
+void PlotScatter::OnSize(wxSizeEvent& event)
+{
+    // todo: clear screen
+}
+
+//----------------------------------------------------------------
+// OnShow()
+//----------------------------------------------------------------
+void PlotScatter::OnShow(wxShowEvent& event)
+{
+}
+
diff --git a/freedv-dev/src/fdmdv2_plot_scatter.h b/freedv-dev/src/fdmdv2_plot_scatter.h
new file mode 100644 (file)
index 0000000..702f633
--- /dev/null
@@ -0,0 +1,56 @@
+//==========================================================================
+// Name:            fdmdv2_plot_scatter.h
+// Purpose:         A scatter plot derivative of fdmdv2_plot.
+// Created:         June 24, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#ifndef __FDMDV2_PLOT_SCATTER__
+#define __FDMDV2_PLOT_SCATTER__
+
+#include "comp.h"
+#include "fdmdv2_plot.h"
+#include "fdmdv2_defines.h"
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class PlotScatter
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class PlotScatter : public PlotPanel
+{
+    public:
+        PlotScatter(wxFrame* parent);
+        ~PlotScatter(){};
+       void add_new_samples(COMP samples[]);
+       void setNc(int Nc);
+
+    protected:
+        COMP m_mem[SCATTER_MEM_SYMS_MAX];
+        COMP m_new_samples[FDMDV_NC_MAX+1];
+
+        void draw(wxAutoBufferedPaintDC&  dc);
+        void OnPaint(wxPaintEvent& event);
+        void OnSize(wxSizeEvent& event);
+        void OnShow(wxShowEvent& event);
+
+        DECLARE_EVENT_TABLE()
+
+    private:
+        int   Nsym;
+        int   scatterMemSyms;
+        float m_filter_max_xy;
+};
+
+#endif //__FDMDV2_PLOT_SCATTER__
diff --git a/freedv-dev/src/fdmdv2_plot_spectrum.cpp b/freedv-dev/src/fdmdv2_plot_spectrum.cpp
new file mode 100644 (file)
index 0000000..d9c72d0
--- /dev/null
@@ -0,0 +1,266 @@
+//==========================================================================
+// Name:            fdmdv2_plot_waterfall.cpp
+// Purpose:         Implements a waterfall plot derivative of fdmdv2_plot.
+// Created:         June 23, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#include <string.h>
+#include "wx/wx.h"
+
+#include "fdmdv2_main.h"
+
+extern float g_avmag[];                 // average mag data passed to draw() 
+void fdmdv2_clickTune(float frequency); // callback to pass new click freq
+
+BEGIN_EVENT_TABLE(PlotSpectrum, PlotPanel)
+    EVT_MOTION          (PlotSpectrum::OnMouseMove)
+    EVT_LEFT_DOWN       (PlotSpectrum::OnMouseLeftDown)
+    EVT_LEFT_UP         (PlotSpectrum::OnMouseLeftUp)
+    EVT_MOUSEWHEEL      (PlotSpectrum::OnMouseWheelMoved)
+    EVT_PAINT           (PlotSpectrum::OnPaint)
+    EVT_SHOW            (PlotSpectrum::OnShow)
+END_EVENT_TABLE()
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class PlotSpectrum
+//
+// @class $(Name)
+// @author $(User)
+// @date $(Date)
+// @file $(CurrentFileName).$(CurrentFileExt)
+// @brief
+//
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+PlotSpectrum::PlotSpectrum(wxFrame* parent, float *magdB, int n_magdB, 
+                           float min_mag_db, float max_mag_db, bool clickTune): PlotPanel(parent)
+{
+    m_greyscale     = 0;
+    m_Bufsz         = GetMaxClientSize();
+    m_newdata       = false;
+    m_firstPass     = true;
+    m_line_color    = 0;
+    SetLabelSize(10.0);
+
+    m_magdB         = magdB;
+    m_n_magdB       = n_magdB;     // number of points in magdB that covers 0 ... MAX_F_HZ of spectrum
+    m_max_mag_db    = max_mag_db;
+    m_min_mag_db    = min_mag_db;
+    m_rxFreq        = 0.0;
+    m_clickTune     = clickTune;
+}
+
+//----------------------------------------------------------------
+// ~PlotSpectrum()
+//----------------------------------------------------------------
+PlotSpectrum::~PlotSpectrum()
+{
+}
+
+//----------------------------------------------------------------
+// OnSize()
+//----------------------------------------------------------------
+void PlotSpectrum::OnSize(wxSizeEvent& event) {
+}
+
+//----------------------------------------------------------------
+// OnPaint()
+//----------------------------------------------------------------
+void PlotSpectrum::OnPaint(wxPaintEvent& event)
+{
+    wxAutoBufferedPaintDC dc(this);
+    draw(dc);
+}
+
+//----------------------------------------------------------------
+// OnShow()
+//----------------------------------------------------------------
+void PlotSpectrum::OnShow(wxShowEvent& event)
+{
+}
+
+//----------------------------------------------------------------
+// draw()
+//----------------------------------------------------------------
+void PlotSpectrum::draw(wxAutoBufferedPaintDC& dc)
+{
+    m_rCtrl  = GetClientRect();
+
+    // m_rGrid is coords of inner window we actually plot to.  We deflate it a bit
+    // to leave room for axis labels.  We need to work this out every time we draw
+    // as OnSize() may not be called before OnPaint(), for example when a new tab
+    // is selected
+
+    m_rGrid  = m_rCtrl;
+    m_rGrid = m_rGrid.Deflate(PLOT_BORDER + (XLEFT_OFFSET/2), (PLOT_BORDER + (YBOTTOM_OFFSET/2)));
+
+    dc.Clear();
+
+    // black background
+
+    m_rPlot = wxRect(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER, m_rGrid.GetWidth(), m_rGrid.GetHeight());
+    wxBrush ltGraphBkgBrush = wxBrush(BLACK_COLOR);
+    dc.SetBrush(ltGraphBkgBrush);
+    dc.SetPen(wxPen(BLACK_COLOR, 0));
+    dc.DrawRectangle(m_rPlot);
+
+    // draw spectrum
+
+    int   x, y, prev_x, prev_y, index;
+    float index_to_px, mag_dB_to_py, mag;
+
+    m_newdata = false;
+
+    wxPen pen;
+    pen.SetColour(DARK_GREEN_COLOR);
+    pen.SetWidth(1);
+    dc.SetPen(pen);
+
+    index_to_px = (float)m_rGrid.GetWidth()/m_n_magdB;
+    mag_dB_to_py = (float)m_rGrid.GetHeight()/(m_max_mag_db - m_min_mag_db);
+
+    prev_x = PLOT_BORDER + XLEFT_OFFSET;
+    prev_y = PLOT_BORDER;
+    for(index = 0; index < m_n_magdB; index++)
+    {
+        x = index*index_to_px;
+        mag = m_magdB[index];
+        if (mag > m_max_mag_db) mag = m_max_mag_db;
+        if (mag < m_min_mag_db) mag = m_min_mag_db;
+        y = -(mag - m_max_mag_db) * mag_dB_to_py;
+
+        x += PLOT_BORDER + XLEFT_OFFSET;
+        y += PLOT_BORDER;
+
+        if (index)
+            dc.DrawLine(x, y, prev_x, prev_y);
+        prev_x = x; prev_y = y;
+    }
+
+    // and finally draw Graticule
+
+    drawGraticule(dc);
+
+}
+
+//-------------------------------------------------------------------------
+// drawGraticule()
+//-------------------------------------------------------------------------
+void PlotSpectrum::drawGraticule(wxAutoBufferedPaintDC&  dc)
+{
+    int      x, y, text_w, text_h;
+    char     buf[15];
+    wxString s;
+    float    f, mag, freq_hz_to_px, mag_dB_to_py;
+
+    wxBrush ltGraphBkgBrush;
+    ltGraphBkgBrush.SetStyle(wxBRUSHSTYLE_TRANSPARENT);
+    ltGraphBkgBrush.SetColour(*wxBLACK);
+    dc.SetBrush(ltGraphBkgBrush);
+    dc.SetPen(wxPen(BLACK_COLOR, 1));
+
+    freq_hz_to_px = (float)m_rGrid.GetWidth()/(MAX_F_HZ-MIN_F_HZ);
+    mag_dB_to_py = (float)m_rGrid.GetHeight()/(m_max_mag_db - m_min_mag_db);
+
+    // upper LH coords of plot area are (PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER)
+    // lower RH coords of plot area are (PLOT_BORDER + XLEFT_OFFSET + m_rGrid.GetWidth(), 
+    //                                   PLOT_BORDER + m_rGrid.GetHeight())
+
+    // Check if small screen size means text will overlap
+
+    int textXStep = STEP_F_HZ*freq_hz_to_px;
+    int textYStep = STEP_MAG_DB*mag_dB_to_py;
+    sprintf(buf, "%4.0fHz", (float)MAX_F_HZ - STEP_F_HZ);
+    GetTextExtent(buf, &text_w, &text_h);
+    int overlappedText = (text_w > textXStep) || (text_h > textYStep);
+    //printf("text_w: %d textXStep: %d text_h: %d textYStep: %d  overlappedText: %d\n", text_w, textXStep, 
+    //      text_h, textYStep, overlappedText);
+
+    // Vertical gridlines
+
+    for(f=STEP_F_HZ; f<MAX_F_HZ; f+=STEP_F_HZ) {
+       x = f*freq_hz_to_px;
+       x += PLOT_BORDER + XLEFT_OFFSET;
+
+        dc.SetPen(m_penShortDash);
+        dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, PLOT_BORDER);
+        dc.SetPen(wxPen(BLACK_COLOR, 1));
+        dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET);
+
+        sprintf(buf, "%4.0fHz", f);
+       GetTextExtent(buf, &text_w, &text_h);
+        if (!overlappedText)
+            dc.DrawText(buf, x - text_w/2, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET);
+    }
+
+    dc.SetPen(wxPen(BLACK_COLOR, 1));
+    for(f=STEP_MINOR_F_HZ; f<MAX_F_HZ; f+=STEP_MINOR_F_HZ) 
+    {
+        x = f*freq_hz_to_px;
+        x += PLOT_BORDER + XLEFT_OFFSET;
+        dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET-5);
+    }
+    
+    // Horizontal gridlines
+
+    dc.SetPen(m_penDotDash);
+    for(mag=m_min_mag_db; mag<=m_max_mag_db; mag+=STEP_MAG_DB) {
+       y = -(mag - m_max_mag_db) * mag_dB_to_py;
+       y += PLOT_BORDER;
+       dc.DrawLine(PLOT_BORDER + XLEFT_OFFSET, y, 
+                   (m_rGrid.GetWidth() + PLOT_BORDER + XLEFT_OFFSET), y);
+        sprintf(buf, "%3.0fdB", mag);
+       GetTextExtent(buf, &text_w, &text_h);
+        if (!overlappedText)
+            dc.DrawText(buf, PLOT_BORDER + XLEFT_OFFSET - text_w - XLEFT_TEXT_OFFSET, y-text_h/2);
+    }
+
+    // red rx tuning line
+    
+    if (m_rxFreq != 0.0) {
+        dc.SetPen(wxPen(RED_COLOR, 2));
+        x = m_rxFreq*freq_hz_to_px;
+        x += PLOT_BORDER + XLEFT_OFFSET;
+        //printf("m_rxFreq %f x %d\n", m_rxFreq, x);
+        dc.DrawLine(x, m_rGrid.GetHeight()+ PLOT_BORDER, x, m_rCtrl.GetHeight());
+    }
+
+}
+
+//-------------------------------------------------------------------------
+// OnMouseDown()
+//-------------------------------------------------------------------------
+void PlotSpectrum::OnMouseLeftDown(wxMouseEvent& event)
+{
+    m_mouseDown = true;
+    wxClientDC dc(this);
+
+    wxPoint pt(event.GetLogicalPosition(dc));
+
+    // map x coord to edges of actual plot
+    pt.x -= PLOT_BORDER + XLEFT_OFFSET;
+    pt.y -= PLOT_BORDER;
+
+    // valid click if inside of plot
+    if ((pt.x >= 0) && (pt.x <= m_rGrid.GetWidth()) && (pt.y >=0) && m_clickTune) {
+        float freq_hz_to_px = (float)m_rGrid.GetWidth()/(MAX_F_HZ-MIN_F_HZ);
+        float clickFreq = (float)pt.x/freq_hz_to_px;
+
+        // see PlotWaterfall::OnMouseDown()
+
+        fdmdv2_clickTune(clickFreq);
+    }
+}
diff --git a/freedv-dev/src/fdmdv2_plot_spectrum.h b/freedv-dev/src/fdmdv2_plot_spectrum.h
new file mode 100644 (file)
index 0000000..353f312
--- /dev/null
@@ -0,0 +1,58 @@
+//==========================================================================
+// Name:            fdmdv2_plot_spectrum.h
+// Purpose:         Defines a spectrum plot derived from fdmdv2_plot class.
+// Created:         June 22, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#ifndef __FDMDV2_PLOT_SPECTRUM__
+#define __FDMDV2_PLOT_SPECTRUM__
+
+#include "fdmdv2_plot.h"
+#include "fdmdv2_defines.h"
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class Waterfall
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class PlotSpectrum : public PlotPanel
+{
+    public:
+    PlotSpectrum(wxFrame* parent, float *magdB, int n_magdB, 
+                 float min_mag_db=MIN_MAG_DB, float max_mag_db=MAX_MAG_DB, bool clickTune=true);
+        ~PlotSpectrum();
+        void setRxFreq(float rxFreq) { m_rxFreq = rxFreq; }
+        void setFreqScale(int n_magdB) { m_n_magdB = n_magdB; }
+
+    protected:
+        void        OnPaint(wxPaintEvent& event);
+        void        OnSize(wxSizeEvent& event);
+        void        OnShow(wxShowEvent& event);
+        void        drawGraticule(wxAutoBufferedPaintDC& dc);
+        void        draw(wxAutoBufferedPaintDC& dc);
+        void        OnMouseLeftDown(wxMouseEvent& event);
+
+   private:
+        float       m_rxFreq;
+        float       m_max_mag_db;
+        float       m_min_mag_db;
+        float      *m_magdB;
+        int         m_n_magdB;  
+        bool        m_clickTune;
+
+        DECLARE_EVENT_TABLE()
+};
+
+#endif //__FDMDV2_PLOT_SPECTRUM__
diff --git a/freedv-dev/src/fdmdv2_plot_waterfall.cpp b/freedv-dev/src/fdmdv2_plot_waterfall.cpp
new file mode 100644 (file)
index 0000000..d3a29ab
--- /dev/null
@@ -0,0 +1,483 @@
+//==========================================================================
+// Name:            fdmdv2_plot_waterfall.cpp
+// Purpose:         Implements a waterfall plot derivative of fdmdv2_plot.
+// Created:         June 22, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#include <string.h>
+#include "wx/wx.h"
+#include "fdmdv2_main.h"
+
+extern float g_avmag[];                 // av mag spec passed in to draw() 
+void fdmdv2_clickTune(float frequency); // callback to pass new click freq
+
+BEGIN_EVENT_TABLE(PlotWaterfall, PlotPanel)
+    EVT_PAINT           (PlotWaterfall::OnPaint)
+    EVT_MOTION          (PlotWaterfall::OnMouseMove)
+    EVT_LEFT_DOWN       (PlotWaterfall::OnMouseLeftDown)
+    EVT_RIGHT_DOWN      (PlotWaterfall::OnMouseRightDown)
+    EVT_LEFT_UP         (PlotWaterfall::OnMouseLeftUp)
+    EVT_MOUSEWHEEL      (PlotWaterfall::OnMouseWheelMoved)
+    EVT_SIZE            (PlotWaterfall::OnSize)
+    EVT_SHOW            (PlotWaterfall::OnShow)
+END_EVENT_TABLE()
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class WaterfallPlot
+//
+// @class   WaterfallPlot
+// @author  David Witten
+// @date    $(Date)
+// @file    $(CurrentFileName).$(CurrentFileExt)
+// @brief
+//
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+PlotWaterfall::PlotWaterfall(wxFrame* parent, bool graticule, int colour): PlotPanel(parent)
+{
+
+    for(int i = 0; i < 255; i++)
+    {
+        m_heatmap_lut[i] = heatmap((float)i, 0.0, 255.0);
+    }
+    m_graticule     = graticule;
+    m_colour        = colour;
+    m_Bufsz         = GetMaxClientSize();
+    m_newdata       = false;
+    m_firstPass     = true;
+    m_line_color    = 0;
+    m_modem_stats_max_f_hz = MODEM_STATS_MAX_F_HZ;
+
+    SetLabelSize(10.0);
+
+    m_pBmp = NULL;
+    m_max_mag = MAX_MAG_DB;
+    m_min_mag = MIN_MAG_DB;
+}
+
+// When the window size gets set we can work outthe size of the window
+// we plot in and allocate a bit map of the correct size
+void PlotWaterfall::OnSize(wxSizeEvent& event) 
+{
+    // resize bit map
+
+    delete m_pBmp;
+    
+    m_rCtrl  = GetClientRect();
+
+    // m_rGrid is coords of inner window we actually plot to.  We deflate it a bit
+    // to leave room for axis labels.
+
+    m_rGrid  = m_rCtrl;
+    m_rGrid = m_rGrid.Deflate(PLOT_BORDER + (XLEFT_OFFSET/2), (PLOT_BORDER + (YBOTTOM_OFFSET/2)));
+
+    // we want a bit map the size of m_rGrid
+
+    m_pBmp = new wxBitmap(m_rGrid.GetWidth(), m_rGrid.GetHeight(), 24);
+
+    m_dT = DT;
+}
+
+//----------------------------------------------------------------
+// paintEvent()
+//
+// @class $(Name)
+// @author $(User)
+// @date $(Date)
+// @file $(CurrentFileName).$(CurrentFileExt)
+// @brief
+//
+// Called by the system of by wxWidgets when the panel needs
+// to be redrawn. You can also trigger this call by calling
+// Refresh()/Update().
+//----------------------------------------------------------------
+void PlotWaterfall::OnPaint(wxPaintEvent & evt)
+{
+    wxAutoBufferedPaintDC dc(this);
+    draw(dc);
+}
+
+//----------------------------------------------------------------
+// OnShow()
+//----------------------------------------------------------------
+void PlotWaterfall::OnShow(wxShowEvent& event)
+{
+}
+
+//----------------------------------------------------------------
+// ~PlotWaterfall()
+//----------------------------------------------------------------
+PlotWaterfall::~PlotWaterfall()
+{
+}
+
+//----------------------------------------------------------------
+// heatmap()
+// map val to a rgb colour
+// from http://eddiema.ca/2011/01/21/c-sharp-heatmaps/
+//----------------------------------------------------------------
+unsigned PlotWaterfall::heatmap(float val, float min, float max)
+{
+    unsigned r = 0;
+    unsigned g = 0;
+    unsigned b = 0;
+
+    val = (val - min) / (max - min);
+    if(val <= 0.2)
+    {
+        b = (unsigned)((val / 0.2) * 255);
+    }
+    else if(val >  0.2 &&  val <= 0.7)
+    {
+        b = (unsigned)((1.0 - ((val - 0.2) / 0.5)) * 255);
+    }
+    if(val >= 0.2 &&  val <= 0.6)
+    {
+        g = (unsigned)(((val - 0.2) / 0.4) * 255);
+    }
+    else if(val >  0.6 &&  val <= 0.9)
+    {
+        g = (unsigned)((1.0 - ((val - 0.6) / 0.3)) * 255);
+    }
+    if(val >= 0.5)
+    {
+        r = (unsigned)(((val - 0.5) / 0.5) * 255);
+    }
+    //printf("%f %x %x %x\n", val, r, g, b);
+    return  (b << 16) + (g << 8) + r;
+}
+
+bool PlotWaterfall::checkDT(void)
+{
+    // Check dY is > 1 pixel before proceeding. For small screens
+    // and large WATERFALL_SECS_Y we might have less than one
+    // block per pixel.  In this case increase m_dT and perform draw
+    // less often
+
+    float px_per_sec = (float)m_rGrid.GetHeight() / WATERFALL_SECS_Y;
+    float dy = m_dT * px_per_sec;
+    
+    if (dy < 1.0) {
+        m_dT += DT;
+        return false;
+    }
+    else
+        return true;
+}
+
+//----------------------------------------------------------------
+// draw()
+//----------------------------------------------------------------
+void PlotWaterfall::draw(wxAutoBufferedPaintDC& dc)
+{
+
+    m_rCtrl  = GetClientRect();
+
+    // m_rGrid is coords of inner window we actually plot to.  We deflate it a bit
+    // to leave room for axis labels.
+
+    m_rGrid = m_rCtrl;
+    m_rGrid = m_rGrid.Deflate(PLOT_BORDER + (XLEFT_OFFSET/2), (PLOT_BORDER + (YBOTTOM_OFFSET/2)));
+
+    if (m_pBmp == NULL) 
+    {
+        // we want a bit map the size of m_rGrid
+        m_pBmp = new wxBitmap(m_rGrid.GetWidth(), m_rGrid.GetHeight(), 24);
+    }
+
+    dc.Clear();
+
+    if(m_newdata)
+    {
+        m_newdata = false;
+        plotPixelData();
+        dc.DrawBitmap(*m_pBmp, PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER);
+        m_dT = DT;
+    }
+    else 
+    {
+
+        // no data to plot so just erase to black.  Blue looks nicer
+        // but is same colour as low amplitude signal
+
+        // Bug on Linux: When Stop is pressed this code doesn't erase
+        // the lower 25% of the Waterfall Window
+
+        m_rPlot = wxRect(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER, m_rGrid.GetWidth(), m_rGrid.GetHeight());
+        wxBrush ltGraphBkgBrush = wxBrush(BLACK_COLOR);
+        dc.SetBrush(ltGraphBkgBrush);
+        dc.SetPen(wxPen(BLACK_COLOR, 0));
+        dc.DrawRectangle(m_rPlot);
+    }
+    drawGraticule(dc);
+}
+
+//-------------------------------------------------------------------------
+// drawGraticule()
+//-------------------------------------------------------------------------
+void PlotWaterfall::drawGraticule(wxAutoBufferedPaintDC& dc)
+{
+    int      x, y, text_w, text_h;
+    char     buf[15];
+    wxString s;
+    float    f, time, freq_hz_to_px, time_s_to_py;
+
+    wxBrush ltGraphBkgBrush;
+    ltGraphBkgBrush.SetStyle(wxBRUSHSTYLE_TRANSPARENT);
+    ltGraphBkgBrush.SetColour(*wxBLACK);
+    dc.SetBrush(ltGraphBkgBrush);
+    dc.SetPen(wxPen(BLACK_COLOR, 1));
+
+    freq_hz_to_px = (float)m_rGrid.GetWidth()/(MAX_F_HZ-MIN_F_HZ);
+    time_s_to_py = (float)m_rGrid.GetHeight()/WATERFALL_SECS_Y;
+
+    // upper LH coords of plot area are (PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER)
+    // lower RH coords of plot area are (PLOT_BORDER + XLEFT_OFFSET + m_rGrid.GetWidth(), 
+    //                                   PLOT_BORDER + m_rGrid.GetHeight())
+
+    // Check if small screen size means text will overlap
+
+    int textXStep = STEP_F_HZ*freq_hz_to_px;
+    int textYStep = WATERFALL_SECS_STEP*time_s_to_py;
+    sprintf(buf, "%4.0fHz", (float)MAX_F_HZ - STEP_F_HZ);
+    GetTextExtent(buf, &text_w, &text_h);
+    int overlappedText = (text_w > textXStep) || (text_h > textYStep);
+
+    // Major Vertical gridlines and legend
+    //dc.SetPen(m_penShortDash);
+    for(f=STEP_F_HZ; f<MAX_F_HZ; f+=STEP_F_HZ) 
+    {
+        x = f*freq_hz_to_px;
+        x += PLOT_BORDER + XLEFT_OFFSET;
+
+        if (m_graticule)
+            dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, PLOT_BORDER);
+        else
+            dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET);
+            
+        sprintf(buf, "%4.0fHz", f);
+        GetTextExtent(buf, &text_w, &text_h);
+        if (!overlappedText)
+            dc.DrawText(buf, x - text_w/2, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET);
+    }
+
+    for(f=STEP_MINOR_F_HZ; f<MAX_F_HZ; f+=STEP_MINOR_F_HZ) 
+    {
+        x = f*freq_hz_to_px;
+        x += PLOT_BORDER + XLEFT_OFFSET;
+        dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET-5);
+    }
+    
+    // Horizontal gridlines
+    dc.SetPen(m_penDotDash);
+    for(time=0; time<=WATERFALL_SECS_Y; time+=WATERFALL_SECS_STEP) {
+       y = m_rGrid.GetHeight() - time*time_s_to_py;
+       y += PLOT_BORDER;
+
+        if (m_graticule)
+            dc.DrawLine(PLOT_BORDER + XLEFT_OFFSET, y, 
+                        (m_rGrid.GetWidth() + PLOT_BORDER + XLEFT_OFFSET), y);
+        sprintf(buf, "%3.0fs", time);
+       GetTextExtent(buf, &text_w, &text_h);
+        if (!overlappedText)
+            dc.DrawText(buf, PLOT_BORDER + XLEFT_OFFSET - text_w - XLEFT_TEXT_OFFSET, y-text_h/2);
+   }
+
+    // red rx tuning line
+    dc.SetPen(wxPen(RED_COLOR, 2));
+    x = m_rxFreq*freq_hz_to_px;
+    x += PLOT_BORDER + XLEFT_OFFSET;
+    //printf("m_rxFreq %f x %d\n", m_rxFreq, x);
+    dc.DrawLine(x, m_rGrid.GetHeight()+ PLOT_BORDER, x, m_rCtrl.GetHeight());
+    
+}
+
+//-------------------------------------------------------------------------
+// plotPixelData()
+//-------------------------------------------------------------------------
+void PlotWaterfall::plotPixelData()
+{
+    float       spec_index_per_px;
+    float       intensity_per_dB;
+    float       px_per_sec;
+    int         index;
+    float       dy;
+    int         dy_blocks;
+    int         b;
+    int         px;
+    int         py;
+    int         intensity;
+
+    /*
+      Design Notes:
+
+      The height in pixels represents WATERFALL_SECS_Y of data.  Every DT
+      seconds we get a vector of MODEM_STATS_NSPEC spectrum samples which we use
+      to update the last row.  The height of each row is dy pixels, which
+      maps to DT seconds.  We call each dy high rectangle of pixels a
+      block.
+
+    */
+
+    // determine dy, the height of one "block"
+    px_per_sec = (float)m_rGrid.GetHeight() / WATERFALL_SECS_Y;
+    dy = m_dT * px_per_sec;
+
+    // number of dy high blocks in spectrogram
+    dy_blocks = m_rGrid.GetHeight()/ dy;
+
+    // update min and max amplitude estimates
+    float max_mag = MIN_MAG_DB;
+
+    int min_fft_bin=((float)200/m_modem_stats_max_f_hz)*MODEM_STATS_NSPEC;
+    int max_fft_bin=((float)2800/m_modem_stats_max_f_hz)*MODEM_STATS_NSPEC;
+
+    for(int i=min_fft_bin; i<max_fft_bin; i++) 
+    {
+        if (g_avmag[i] > max_mag)
+        {
+            max_mag = g_avmag[i];
+        }
+    }
+
+    m_max_mag = BETA*m_max_mag + (1 - BETA)*max_mag;
+    m_min_mag = max_mag - 20.0;
+    //printf("max_mag: %f m_max_mag: %f\n", max_mag, m_max_mag);
+    //intensity_per_dB  = (float)256 /(MAX_MAG_DB - MIN_MAG_DB);
+    intensity_per_dB  = (float)256 /(m_max_mag - m_min_mag);
+    spec_index_per_px = ((float)(MAX_F_HZ)/(float)m_modem_stats_max_f_hz)*(float)MODEM_STATS_NSPEC / (float) m_rGrid.GetWidth();
+
+    /*
+    printf("h %d w %d px_per_sec %d dy %d dy_blocks %d spec_index_per_px: %f\n", 
+       m_rGrid.GetHeight(), m_rGrid.GetWidth(), px_per_sec, 
+       dy, dy_blocks, spec_index_per_px);
+    */
+
+    // Shift previous bit map up one row of blocks ----------------------------
+    wxNativePixelData data(*m_pBmp);
+    wxNativePixelData::Iterator bitMapStart(data);
+    wxNativePixelData::Iterator p = bitMapStart;
+
+    for(b = 0; b < dy_blocks - 1; b++) 
+    {
+        wxNativePixelData::Iterator psrc = bitMapStart;
+        wxNativePixelData::Iterator pdest = bitMapStart;
+        pdest.OffsetY(data, dy * b);
+        psrc.OffsetY(data, dy * (b+1));
+
+        // copy one line of blocks
+
+        for(py = 0; py < dy; py++) 
+        {
+            wxNativePixelData::Iterator pdestRowStart = pdest;
+            wxNativePixelData::Iterator psrcRowStart = psrc;
+
+            for(px = 0; px < m_rGrid.GetWidth(); px++) 
+            {
+                pdest.Red() = psrc.Red();
+                pdest.Green() = psrc.Green();
+                pdest.Blue() = psrc.Blue();
+                pdest++;
+                psrc++;
+            }
+            pdest = pdestRowStart;
+            pdest.OffsetY(data, 1);
+            psrc = psrcRowStart;
+            psrc.OffsetY(data, 1);         
+        }
+    }
+
+    // Draw last line of blocks using latest amplitude data ------------------
+    p = bitMapStart;
+    p.OffsetY(data, dy *(dy_blocks - 1));
+    for(py = 0; py < dy; py++)
+    {
+        wxNativePixelData::Iterator rowStart = p;
+
+        for(px = 0; px < m_rGrid.GetWidth(); px++)
+        {
+            index = px * spec_index_per_px;
+            assert(index < MODEM_STATS_NSPEC);
+
+            intensity = intensity_per_dB * (g_avmag[index] - m_min_mag);
+            if(intensity > 255) intensity = 255;
+            if (intensity < 0) intensity = 0;
+            //printf("%d %f %d \n", index, g_avmag[index], intensity);
+
+            switch (m_colour) {
+            case 0:
+                p.Red() = m_heatmap_lut[intensity] & 0xff;
+                p.Green() = (m_heatmap_lut[intensity] >> 8) & 0xff;
+                p.Blue() = (m_heatmap_lut[intensity] >> 16) & 0xff;
+                break;
+            case 1:
+                p.Red() = intensity;
+                p.Green() = intensity;
+                p.Blue() = intensity;       
+                break;
+            case 2:
+                p.Red() = intensity;
+                p.Green() = intensity;
+                if (intensity < 127)
+                    p.Blue() = intensity*2;
+                else
+                    p.Blue() = 255;
+                        
+                break;
+            }
+            ++p;
+        }
+        p = rowStart;
+        p.OffsetY(data, 1);
+    }
+
+}
+
+//-------------------------------------------------------------------------
+// OnMouseLeftDown()
+//-------------------------------------------------------------------------
+void PlotWaterfall::OnMouseLeftDown(wxMouseEvent& event)
+{
+    m_mouseDown = true;
+    wxClientDC dc(this);
+
+    wxPoint pt(event.GetLogicalPosition(dc));
+
+    // map x coord to edges of actual plot
+    pt.x -= PLOT_BORDER + XLEFT_OFFSET;
+    pt.y -= PLOT_BORDER;
+
+    // valid click if inside of plot
+    if ((pt.x >= 0) && (pt.x <= m_rGrid.GetWidth()) && (pt.y >=0)) 
+    {
+        float freq_hz_to_px = (float)m_rGrid.GetWidth()/(MAX_F_HZ-MIN_F_HZ);
+        float clickFreq = (float)pt.x/freq_hz_to_px;
+
+        // communicate back to other threads
+        fdmdv2_clickTune(clickFreq);
+    }
+}
+
+//-------------------------------------------------------------------------
+// OnMouseRightDown()
+//-------------------------------------------------------------------------
+void PlotWaterfall::OnMouseRightDown(wxMouseEvent& event)
+{
+    m_colour++;
+    if (m_colour == 3)
+        m_colour = 0;
+}
+
diff --git a/freedv-dev/src/fdmdv2_plot_waterfall.h b/freedv-dev/src/fdmdv2_plot_waterfall.h
new file mode 100644 (file)
index 0000000..77058fd
--- /dev/null
@@ -0,0 +1,73 @@
+//==========================================================================
+// Name:            fdmdv2_plot_waterfall.h
+// Purpose:         Defines a waterfall plot derivative of fdmdv2_plot.
+// Created:         June 22, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#ifndef __FDMDV2_PLOT_WATERFALL__
+#define __FDMDV2_PLOT_WATERFALL__
+
+#include "fdmdv2_plot.h"
+#include "fdmdv2_defines.h"
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class PlotWaterfall
+//
+// @class $(Name)
+// @author $(User)
+// @date $(Date)
+// @file $(CurrentFileName).$(CurrentFileExt)
+// @brief
+//
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class PlotWaterfall : public PlotPanel
+{
+    public:
+    PlotWaterfall(wxFrame* parent, bool graticule, int colour);
+        ~PlotWaterfall();
+        bool checkDT(void);
+        void setGreyscale(bool greyscale) { m_greyscale = greyscale; }
+        void setRxFreq(float rxFreq) { m_rxFreq = rxFreq; }
+        void setFs(int fs) { m_modem_stats_max_f_hz = fs/2; }
+
+    protected:
+        unsigned    m_heatmap_lut[256];
+
+        unsigned    heatmap(float val, float min, float max);
+
+        void        OnPaint(wxPaintEvent & evt);
+        void        OnSize(wxSizeEvent& event);
+        void        OnShow(wxShowEvent& event);
+        void        drawGraticule(wxAutoBufferedPaintDC&  dc);
+        void        draw(wxAutoBufferedPaintDC& dc);
+        void        plotPixelData();
+        void        OnMouseLeftDown(wxMouseEvent& event);
+        void        OnMouseRightDown(wxMouseEvent& event);
+
+    private:
+        float       m_dT;
+        float       m_rxFreq;
+        bool        m_graticule;
+        float       m_min_mag;
+        float       m_max_mag;
+        int         m_colour;
+        int         m_modem_stats_max_f_hz;
+
+        DECLARE_EVENT_TABLE()
+};
+
+#endif //__FDMDV2_PLOT_WATERFALL__
diff --git a/freedv-dev/src/hamlib.cpp b/freedv-dev/src/hamlib.cpp
new file mode 100644 (file)
index 0000000..575f36a
--- /dev/null
@@ -0,0 +1,127 @@
+//==========================================================================
+// Name:            hamlib.cpp
+//
+// Purpose:         Hamlib integration for FreeDV
+// Created:         May 2013
+// Authors:         Joel Stanley
+//
+// 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#include <hamlib.h>
+
+#include <vector>
+#include <algorithm>
+
+using namespace std;
+
+typedef std::vector<const struct rig_caps *> riglist_t;
+
+static bool rig_cmp(const struct rig_caps *rig1, const struct rig_caps *rig2);
+static int build_list(const struct rig_caps *rig, rig_ptr_t);
+
+Hamlib::Hamlib() : m_rig(NULL) {
+    /* Stop hamlib from spewing info to stderr. */
+    rig_set_debug(RIG_DEBUG_NONE);
+
+    /* Create sorted list of rigs. */
+    rig_load_all_backends();
+    rig_list_foreach(build_list, &m_rigList);
+    sort(m_rigList.begin(), m_rigList.end(), rig_cmp);
+
+    /* Reset debug output. */
+    rig_set_debug(RIG_DEBUG_VERBOSE);
+
+       m_rig = NULL;
+}
+
+Hamlib::~Hamlib() {
+       if(m_rig)
+               close();
+}
+
+static int build_list(const struct rig_caps *rig, rig_ptr_t rigList) {
+    ((riglist_t *)rigList)->push_back(rig); 
+    return 1;
+}
+
+static bool rig_cmp(const struct rig_caps *rig1, const struct rig_caps *rig2) {
+    /* Compare manufacturer. */
+    int r = strcasecmp(rig1->mfg_name, rig2->mfg_name);
+    if (r != 0)
+        return r < 0;
+
+    /* Compare model. */
+    r = strcasecmp(rig1->model_name, rig2->model_name);
+    if (r != 0)
+        return r < 0;
+
+    /* Compare rig ID. */
+    return rig1->rig_model < rig2->rig_model;
+}
+
+void Hamlib::populateComboBox(wxComboBox *cb) {
+
+    riglist_t::const_iterator rig = m_rigList.begin();
+    for (; rig !=m_rigList.end(); rig++) {
+        char name[128];
+        snprintf(name, 128, "%s %s", (*rig)->mfg_name, (*rig)->model_name); 
+        cb->Append(name);
+    }
+}
+
+bool Hamlib::connect(unsigned int rig_index, const char *serial_port) {
+    /* Look up model from index. */
+    if (rig_index >= m_rigList.size()) {
+        return false;
+    }
+    printf("rig: %s %s (%d)\n", m_rigList[rig_index]->mfg_name,
+            m_rigList[rig_index]->model_name, m_rigList[rig_index]->rig_model);
+
+       if(m_rig) {
+               printf("Closing old hamlib instance!\n");
+               close();
+       }
+
+    /* Initialise, configure and open. */
+    m_rig = rig_init(m_rigList[rig_index]->rig_model);
+    /* TODO: Also use baud rate from the screen. */
+    if (!m_rig)
+        return false;
+    token_t token = rig_token_lookup(m_rig, "rig_pathname");
+    if (rig_set_conf(m_rig, token, serial_port) != RIG_OK) {
+        return false;
+    }
+    if (rig_open(m_rig) == RIG_OK) {
+        return true;
+    }
+    return false;
+}
+
+bool Hamlib::ptt(bool press) {
+       if(!m_rig)
+               return false;
+    /* TODO(Joel): make ON_DATA and ON configurable. */
+    ptt_t on = press ? RIG_PTT_ON : RIG_PTT_OFF;
+    /* TODO(Joel): what should the VFO option be? */
+    return rig_set_ptt(m_rig, RIG_VFO_CURR, on) == RIG_OK;
+}
+
+void Hamlib::close(void) {
+       if(m_rig) {
+               rig_close(m_rig);
+               rig_cleanup(m_rig);
+               m_rig = NULL;
+       }
+}
diff --git a/freedv-dev/src/hamlib.h b/freedv-dev/src/hamlib.h
new file mode 100644 (file)
index 0000000..fe3496f
--- /dev/null
@@ -0,0 +1,28 @@
+#ifndef HAMLIB_H
+#define HAMLIB_H
+
+extern "C" {
+#include <hamlib/rig.h>
+}
+#include <wx/combobox.h>
+#include <vector>
+
+class Hamlib {
+
+    public:
+        Hamlib();
+        ~Hamlib();
+        void populateComboBox(wxComboBox *cb);
+        bool connect(unsigned int rig_index, const char *serial_port);
+        bool ptt(bool press);
+        void close(void);
+
+        typedef std::vector<const struct rig_caps *> riglist_t;
+
+    private:
+        RIG *m_rig;
+        /* Sorted list of rigs. */
+        riglist_t m_rigList;
+};
+
+#endif /*HAMLIB_H*/
diff --git a/freedv-dev/src/sox.h b/freedv-dev/src/sox.h
new file mode 100644 (file)
index 0000000..07aedeb
--- /dev/null
@@ -0,0 +1,2608 @@
+/* libSoX Library Public Interface
+ *
+ * Copyright 1999-2011 Chris Bagwell and SoX Contributors.
+ *
+ * This source code is freely redistributable and may be used for
+ * any purpose.  This copyright notice must be maintained.
+ * Chris Bagwell And SoX Contributors are not responsible for
+ * the consequences of using this software.
+ */
+
+/** @file
+Contains the interface exposed to clients of the libSoX library.
+Symbols starting with "sox_" or "SOX_" are part of the public interface for
+libSoX clients (applications that consume libSoX). Symbols starting with
+"lsx_" or "LSX_" are internal use by libSoX and plugins.
+LSX_ and lsx_ symbols should not be used by libSoX-based applications.
+*/
+
+#ifndef SOX_H
+#define SOX_H /**< Client API: This macro is defined if sox.h has been included. */
+
+#include <limits.h>
+#include <stdarg.h>
+#include <stddef.h>
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+/* Suppress warnings from use of type long long. */
+#if defined __GNUC__
+#pragma GCC system_header
+#endif
+
+/*****************************************************************************
+API decoration macros:
+Mostly for documentation purposes. For some compilers, decorations also affect
+code generation, influence compiler warnings or activate compiler
+optimizations.
+*****************************************************************************/
+
+/**
+Plugins API:
+Attribute required on all functions exported by libSoX and on all function
+pointer types used by the libSoX API.
+*/
+#ifdef __GNUC__
+#define LSX_API  __attribute__ ((cdecl)) /* libSoX function */
+#elif _MSC_VER
+#define LSX_API  __cdecl /* libSoX function */
+#else
+#define LSX_API /* libSoX function */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter or local variable to suppress warnings about
+the variable being unused (especially in macro-generated code).
+*/
+#ifdef __GNUC__
+#define LSX_UNUSED  __attribute__ ((unused)) /* Parameter or local variable is intentionally unused. */
+#else
+#define LSX_UNUSED /* Parameter or local variable is intentionally unused. */
+#endif
+
+/**
+Plugins API:
+LSX_PRINTF12: Attribute applied to a function to indicate that it requires
+a printf-style format string for arg1 and that printf parameters start at
+arg2.
+*/
+#ifdef __GNUC__
+#define LSX_PRINTF12  __attribute__ ((format (printf, 1, 2))) /* Function has printf-style arguments. */
+#else
+#define LSX_PRINTF12 /* Function has printf-style arguments. */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a function to indicate that it has no side effects and
+depends only its input parameters and global memory. If called repeatedly, it
+returns the same result each time.
+*/
+#ifdef __GNUC__
+#define LSX_RETURN_PURE __attribute__ ((pure)) /* Function is pure. */
+#else
+#define LSX_RETURN_PURE /* Function is pure. */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a function to indicate that the
+return value is always a pointer to a valid object (never NULL).
+*/
+#ifdef _Ret_
+#define LSX_RETURN_VALID _Ret_ /* Function always returns a valid object (never NULL). */
+#else
+#define LSX_RETURN_VALID /* Function always returns a valid object (never NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a function to indicate that the return value is always a
+pointer to a valid array (never NULL).
+*/
+#ifdef _Ret_valid_
+#define LSX_RETURN_ARRAY _Ret_valid_ /* Function always returns a valid array (never NULL). */
+#else
+#define LSX_RETURN_ARRAY /* Function always returns a valid array (never NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a function to indicate that the return value is always a
+pointer to a valid 0-terminated array (never NULL).
+*/
+#ifdef _Ret_z_
+#define LSX_RETURN_VALID_Z _Ret_z_ /* Function always returns a 0-terminated array (never NULL). */
+#else
+#define LSX_RETURN_VALID_Z /* Function always returns a 0-terminated array (never NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a function to indicate that the returned pointer may be
+null.
+*/
+#ifdef _Ret_opt_
+#define LSX_RETURN_OPT _Ret_opt_ /* Function may return NULL. */
+#else
+#define LSX_RETURN_OPT /* Function may return NULL. */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a valid
+pointer to one const element of the pointed-to type (never NULL).
+*/
+#ifdef _In_
+#define LSX_PARAM_IN _In_ /* Required const pointer to a valid object (never NULL). */
+#else
+#define LSX_PARAM_IN /* Required const pointer to a valid object (never NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a valid
+pointer to a const 0-terminated string (never NULL).
+*/
+#ifdef _In_z_
+#define LSX_PARAM_IN_Z _In_z_ /* Required const pointer to 0-terminated string (never NULL). */
+#else
+#define LSX_PARAM_IN_Z /* Required const pointer to 0-terminated string (never NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a const
+pointer to a 0-terminated printf format string.
+*/
+#ifdef _Printf_format_string_
+#define LSX_PARAM_IN_PRINTF _Printf_format_string_ /* Required const pointer to 0-terminated printf format string (never NULL). */
+#else
+#define LSX_PARAM_IN_PRINTF /* Required const pointer to 0-terminated printf format string (never NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a valid
+pointer to (len) const initialized elements of the pointed-to type, where
+(len) is the name of another parameter.
+@param len The parameter that contains the number of elements in the array.
+*/
+#ifdef _In_count_
+#define LSX_PARAM_IN_COUNT(len) _In_count_(len) /* Required const pointer to (len) valid objects (never NULL). */
+#else
+#define LSX_PARAM_IN_COUNT(len) /* Required const pointer to (len) valid objects (never NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a valid
+pointer to (len) const bytes of initialized data, where (len) is the name of
+another parameter.
+@param len The parameter that contains the number of bytes in the array.
+*/
+#ifdef _In_bytecount_
+#define LSX_PARAM_IN_BYTECOUNT(len) _In_bytecount_(len) /* Required const pointer to (len) bytes of data (never NULL). */
+#else
+#define LSX_PARAM_IN_BYTECOUNT(len) /* Required const pointer to (len) bytes of data (never NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is either NULL
+or a valid pointer to one const element of the pointed-to type.
+*/
+#ifdef _In_opt_
+#define LSX_PARAM_IN_OPT _In_opt_ /* Optional const pointer to a valid object (may be NULL). */
+#else
+#define LSX_PARAM_IN_OPT /* Optional const pointer to a valid object (may be NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is either NULL
+or a valid pointer to a const 0-terminated string.
+*/
+#ifdef _In_opt_z_
+#define LSX_PARAM_IN_OPT_Z _In_opt_z_ /* Optional const pointer to 0-terminated string (may be NULL). */
+#else
+#define LSX_PARAM_IN_OPT_Z /* Optional const pointer to 0-terminated string (may be NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a valid
+pointer to one initialized element of the pointed-to type (never NULL). The
+function may modify the element.
+*/
+#ifdef _Inout_
+#define LSX_PARAM_INOUT _Inout_ /* Required pointer to a valid object (never NULL). */
+#else
+#define LSX_PARAM_INOUT /* Required pointer to a valid object (never NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a valid
+pointer to (len) initialized elements of the pointed-to type (never NULL). The
+function may modify the elements.
+@param len The parameter that contains the number of elements in the array.
+*/
+#ifdef _Inout_count_x_
+#define LSX_PARAM_INOUT_COUNT(len) _Inout_count_x_(len) /* Required pointer to (len) valid objects (never NULL). */
+#else
+#define LSX_PARAM_INOUT_COUNT(len) /* Required pointer to (len) valid objects (never NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a valid
+pointer to memory sufficient for one element of the pointed-to type (never
+NULL). The function will initialize the element.
+*/
+#ifdef _Out_
+#define LSX_PARAM_OUT _Out_ /* Required pointer to an object to be initialized (never NULL). */
+#else
+#define LSX_PARAM_OUT /* Required pointer to an object to be initialized (never NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a valid
+pointer to memory sufficient for (len) bytes of data (never NULL), where (len)
+is the name of another parameter. The function may write up to len bytes of
+data to this memory.
+@param len The parameter that contains the number of bytes in the array.
+*/
+#ifdef _Out_bytecap_
+#define LSX_PARAM_OUT_BYTECAP(len) _Out_bytecap_(len) /* Required pointer to writable buffer with room for len bytes. */
+#else
+#define LSX_PARAM_OUT_BYTECAP(len) /* Required pointer to writable buffer with room for len bytes. */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a valid
+pointer to memory sufficient for (len) elements of the pointed-to type (never
+NULL), where (len) is the name of another parameter. On return, (filled)
+elements will have been initialized, where (filled) is either the dereference
+of another pointer parameter (for example "*written") or the "return"
+parameter (indicating that the function returns the number of elements
+written).
+@param len The parameter that contains the number of elements in the array.
+@param filled The dereference of the parameter that receives the number of elements written to the array, or "return" if the value is returned.
+*/
+#ifdef _Out_cap_post_count_
+#define LSX_PARAM_OUT_CAP_POST_COUNT(len,filled) _Out_cap_post_count_(len,filled) /* Required pointer to buffer for (len) elements (never NULL); on return, (filled) elements will have been initialized. */
+#else
+#define LSX_PARAM_OUT_CAP_POST_COUNT(len,filled) /* Required pointer to buffer for (len) elements (never NULL); on return, (filled) elements will have been initialized. */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a valid
+pointer to memory sufficient for (len) elements of the pointed-to type (never
+NULL), where (len) is the name of another parameter. On return, (filled+1)
+elements will have been initialized, with the last element having been
+initialized to 0, where (filled) is either the dereference of another pointer
+parameter (for example, "*written") or the "return" parameter (indicating that
+the function returns the number of elements written).
+@param len The parameter that contains the number of elements in the array.
+@param filled The dereference of the parameter that receives the number of elements written to the array (not counting the terminating null), or "return" if the value is returned.
+*/
+#ifdef _Out_z_cap_post_count_
+#define LSX_PARAM_OUT_Z_CAP_POST_COUNT(len,filled) _Out_z_cap_post_count_(len,filled) /* Required pointer to buffer for (len) elements (never NULL); on return, (filled+1) elements will have been initialized, and the array will be 0-terminated. */
+#else
+#define LSX_PARAM_OUT_Z_CAP_POST_COUNT(len,filled) /* Required pointer to buffer for (len) elements (never NULL); on return, (filled+1) elements will have been initialized, and the array will be 0-terminated. */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is either NULL
+or a valid pointer to memory sufficient for one element of the pointed-to
+type. The function will initialize the element.
+*/
+#ifdef _Out_opt_
+#define LSX_PARAM_OUT_OPT _Out_opt_ /* Optional pointer to an object to be initialized (may be NULL). */
+#else
+#define LSX_PARAM_OUT_OPT /* Optional pointer to an object to be initialized (may be NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a valid
+pointer (never NULL) to another pointer which may be NULL when the function is
+invoked.
+*/
+#ifdef _Deref_pre_maybenull_
+#define LSX_PARAM_DEREF_PRE_MAYBENULL _Deref_pre_maybenull_ /* Required pointer (never NULL) to another pointer (may be NULL). */
+#else
+#define LSX_PARAM_DEREF_PRE_MAYBENULL /* Required pointer (never NULL) to another pointer (may be NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a valid
+pointer (never NULL) to another pointer which will be NULL when the function
+returns.
+*/
+#ifdef _Deref_post_null_
+#define LSX_PARAM_DEREF_POST_NULL _Deref_post_null_ /* Required pointer (never NULL) to another pointer, which will be NULL on exit. */
+#else
+#define LSX_PARAM_DEREF_POST_NULL /* Required pointer (never NULL) to another pointer, which will be NULL on exit. */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a valid
+pointer (never NULL) to another pointer which will be non-NULL when the
+function returns.
+*/
+#ifdef _Deref_post_notnull_
+#define LSX_PARAM_DEREF_POST_NOTNULL _Deref_post_notnull_ /* Required pointer (never NULL) to another pointer, which will be valid (not NULL) on exit. */
+#else
+#define LSX_PARAM_DEREF_POST_NOTNULL /* Required pointer (never NULL) to another pointer, which will be valid (not NULL) on exit. */
+#endif
+
+/**
+Plugins API:
+Expression that "uses" a potentially-unused variable to avoid compiler
+warnings (especially in macro-generated code).
+*/
+#ifdef _PREFAST_
+#define LSX_USE_VAR(x)  ((void)(x=0)) /* During static analysis, initialize unused variables to 0. */
+#else
+#define LSX_USE_VAR(x)  ((void)(x)) /* Parameter or variable is intentionally unused. */
+#endif
+
+/**
+Plugins API:
+Compile-time assertion. Causes a compile error if the expression is false.
+@param e  The expression to test. If expression is false, compilation will fail.
+@param f  A unique identifier for the test, for example foo_must_not_be_zero.
+*/
+#define lsx_static_assert(e,f) enum {lsx_static_assert_##f = 1/((e) ? 1 : 0)}
+
+/*****************************************************************************
+Basic typedefs:
+*****************************************************************************/
+
+/**
+Client API:
+Signed twos-complement 8-bit type. Typically defined as signed char.
+*/
+#if SCHAR_MAX==127 && SCHAR_MIN==(-128)
+typedef signed char sox_int8_t;
+#elif CHAR_MAX==127 && CHAR_MIN==(-128)
+typedef char sox_int8_t;
+#else
+#error Unable to determine an appropriate definition for sox_int8_t.
+#endif
+
+/**
+Client API:
+Unsigned 8-bit type. Typically defined as unsigned char.
+*/
+#if UCHAR_MAX==0xff
+typedef unsigned char sox_uint8_t;
+#elif CHAR_MAX==0xff && CHAR_MIN==0
+typedef char sox_uint8_t;
+#else
+#error Unable to determine an appropriate definition for sox_uint8_t.
+#endif
+
+/**
+Client API:
+Signed twos-complement 16-bit type. Typically defined as short.
+*/
+#if SHRT_MAX==32767 && SHRT_MIN==(-32768)
+typedef short sox_int16_t;
+#elif INT_MAX==32767 && INT_MIN==(-32768)
+typedef int sox_int16_t;
+#else
+#error Unable to determine an appropriate definition for sox_int16_t.
+#endif
+
+/**
+Client API:
+Unsigned 16-bit type. Typically defined as unsigned short.
+*/
+#if USHRT_MAX==0xffff
+typedef unsigned short sox_uint16_t;
+#elif UINT_MAX==0xffff
+typedef unsigned int sox_uint16_t;
+#else
+#error Unable to determine an appropriate definition for sox_uint16_t.
+#endif
+
+/**
+Client API:
+Signed twos-complement 32-bit type. Typically defined as int.
+*/
+#if INT_MAX==2147483647 && INT_MIN==(-2147483647-1)
+typedef int sox_int32_t;
+#elif LONG_MAX==2147483647 && LONG_MIN==(-2147483647-1)
+typedef long sox_int32_t;
+#else
+#error Unable to determine an appropriate definition for sox_int32_t.
+#endif
+
+/**
+Client API:
+Unsigned 32-bit type. Typically defined as unsigned int.
+*/
+#if UINT_MAX==0xffffffff
+typedef unsigned int sox_uint32_t;
+#elif ULONG_MAX==0xffffffff
+typedef unsigned long sox_uint32_t;
+#else
+#error Unable to determine an appropriate definition for sox_uint32_t.
+#endif
+
+/**
+Client API:
+Signed twos-complement 64-bit type. Typically defined as long or long long.
+*/
+#if LONG_MAX==9223372036854775807 && LONG_MIN==(-9223372036854775807-1)
+typedef long sox_int64_t;
+#elif defined(_MSC_VER)
+typedef __int64 sox_int64_t;
+#else
+typedef long long sox_int64_t;
+#endif
+
+/**
+Client API:
+Unsigned 64-bit type. Typically defined as unsigned long or unsigned long long.
+*/
+#if ULONG_MAX==0xffffffffffffffff
+typedef unsigned long sox_uint64_t;
+#elif defined(_MSC_VER)
+typedef unsigned __int64 sox_uint64_t;
+#else
+typedef unsigned long long sox_uint64_t;
+#endif
+
+#ifndef _DOXYGEN_
+lsx_static_assert(sizeof(sox_int8_t)==1,   sox_int8_size);
+lsx_static_assert(sizeof(sox_uint8_t)==1,  sox_uint8_size);
+lsx_static_assert(sizeof(sox_int16_t)==2,  sox_int16_size);
+lsx_static_assert(sizeof(sox_uint16_t)==2, sox_uint16_size);
+lsx_static_assert(sizeof(sox_int32_t)==4,  sox_int32_size);
+lsx_static_assert(sizeof(sox_uint32_t)==4, sox_uint32_size);
+lsx_static_assert(sizeof(sox_int64_t)==8,  sox_int64_size);
+lsx_static_assert(sizeof(sox_uint64_t)==8, sox_uint64_size);
+#endif
+
+/**
+Client API:
+Alias for sox_int32_t (beware of the extra byte).
+*/
+typedef sox_int32_t sox_int24_t;
+
+/**
+Client API:
+Alias for sox_uint32_t (beware of the extra byte).
+*/
+typedef sox_uint32_t sox_uint24_t;
+
+/**
+Client API:
+Native SoX audio sample type (alias for sox_int32_t).
+*/
+typedef sox_int32_t sox_sample_t;
+
+/**
+Client API:
+Samples per second is stored as a double.
+*/
+typedef double sox_rate_t;
+
+/**
+Client API:
+File's metadata, access via sox_*_comments functions.
+*/
+typedef char * * sox_comments_t;
+
+/*****************************************************************************
+Enumerations:
+*****************************************************************************/
+
+/**
+Client API:
+Boolean type, assignment (but not necessarily binary) compatible with C++ bool.
+*/
+typedef enum sox_bool {
+    sox_false, /**< False = 0. */
+    sox_true   /**< True = 1. */
+} sox_bool;
+
+/**
+Client API:
+no, yes, or default (default usually implies some kind of auto-detect logic).
+*/
+typedef enum sox_option_t {
+    sox_option_no,      /**< Option specified as no = 0. */
+    sox_option_yes,     /**< Option specified as yes = 1. */
+    sox_option_default  /**< Option unspecified = 2. */
+} sox_option_t;
+
+/**
+Client API:
+The libSoX-specific error codes.
+libSoX functions may return these codes or others that map from errno codes.
+*/
+enum sox_error_t {
+  SOX_SUCCESS = 0,     /**< Function succeeded = 0 */
+  SOX_EOF = -1,        /**< End Of File or other error = -1 */
+  SOX_EHDR = 2000,     /**< Invalid Audio Header = 2000 */
+  SOX_EFMT,            /**< Unsupported data format = 2001 */
+  SOX_ENOMEM,          /**< Can't alloc memory = 2002 */
+  SOX_EPERM,           /**< Operation not permitted = 2003 */
+  SOX_ENOTSUP,         /**< Operation not supported = 2004 */
+  SOX_EINVAL           /**< Invalid argument = 2005 */
+};
+
+/**
+Client API:
+Flags indicating whether optional features are present in this build of libSoX.
+*/
+typedef enum sox_version_flags_t {
+    sox_version_none = 0,         /**< No special features = 0. */
+    sox_version_have_popen = 1,   /**< popen = 1. */
+    sox_version_have_magic = 2,   /**< magic = 2. */
+    sox_version_have_threads = 4, /**< threads = 4. */
+    sox_version_have_memopen = 8  /**< memopen = 8. */
+} sox_version_flags_t;
+
+/**
+Client API:
+Format of sample data.
+*/
+typedef enum sox_encoding_t {
+  SOX_ENCODING_UNKNOWN   , /**< encoding has not yet been determined */
+
+  SOX_ENCODING_SIGN2     , /**< signed linear 2's comp: Mac */
+  SOX_ENCODING_UNSIGNED  , /**< unsigned linear: Sound Blaster */
+  SOX_ENCODING_FLOAT     , /**< floating point (binary format) */
+  SOX_ENCODING_FLOAT_TEXT, /**< floating point (text format) */
+  SOX_ENCODING_FLAC      , /**< FLAC compression */
+  SOX_ENCODING_HCOM      , /**< Mac FSSD files with Huffman compression */
+  SOX_ENCODING_WAVPACK   , /**< WavPack with integer samples */
+  SOX_ENCODING_WAVPACKF  , /**< WavPack with float samples */
+  SOX_ENCODING_ULAW      , /**< u-law signed logs: US telephony, SPARC */
+  SOX_ENCODING_ALAW      , /**< A-law signed logs: non-US telephony, Psion */
+  SOX_ENCODING_G721      , /**< G.721 4-bit ADPCM */
+  SOX_ENCODING_G723      , /**< G.723 3 or 5 bit ADPCM */
+  SOX_ENCODING_CL_ADPCM  , /**< Creative Labs 8 --> 2,3,4 bit Compressed PCM */
+  SOX_ENCODING_CL_ADPCM16, /**< Creative Labs 16 --> 4 bit Compressed PCM */
+  SOX_ENCODING_MS_ADPCM  , /**< Microsoft Compressed PCM */
+  SOX_ENCODING_IMA_ADPCM , /**< IMA Compressed PCM */
+  SOX_ENCODING_OKI_ADPCM , /**< Dialogic/OKI Compressed PCM */
+  SOX_ENCODING_DPCM      , /**< Differential PCM: Fasttracker 2 (xi) */
+  SOX_ENCODING_DWVW      , /**< Delta Width Variable Word */
+  SOX_ENCODING_DWVWN     , /**< Delta Width Variable Word N-bit */
+  SOX_ENCODING_GSM       , /**< GSM 6.10 33byte frame lossy compression */
+  SOX_ENCODING_MP3       , /**< MP3 compression */
+  SOX_ENCODING_VORBIS    , /**< Vorbis compression */
+  SOX_ENCODING_AMR_WB    , /**< AMR-WB compression */
+  SOX_ENCODING_AMR_NB    , /**< AMR-NB compression */
+  SOX_ENCODING_CVSD      , /**< Continuously Variable Slope Delta modulation */
+  SOX_ENCODING_LPC10     , /**< Linear Predictive Coding */
+
+  SOX_ENCODINGS            /**< End of list marker */
+} sox_encoding_t;
+
+/**
+Client API:
+Flags for sox_encodings_info_t: lossless/lossy1/lossy2.
+*/
+typedef enum sox_encodings_flags_t {
+  sox_encodings_none   = 0, /**< no flags specified (implies lossless encoding) = 0. */
+  sox_encodings_lossy1 = 1, /**< encode, decode: lossy once = 1. */
+  sox_encodings_lossy2 = 2  /**< encode, decode, encode, decode: lossy twice = 2. */
+} sox_encodings_flags_t;
+
+/**
+Client API:
+Type of plot.
+*/
+typedef enum sox_plot_t {
+    sox_plot_off,     /**< No plot = 0. */
+    sox_plot_octave,  /**< Octave plot = 1. */
+    sox_plot_gnuplot, /**< Gnuplot plot = 2. */
+    sox_plot_data     /**< Plot data = 3. */
+} sox_plot_t;
+
+/**
+Client API:
+Loop modes: upper 4 bits mask the loop blass, lower 4 bits describe
+the loop behaviour, for example single shot, bidirectional etc.
+*/
+enum sox_loop_flags_t {
+  sox_loop_none = 0,          /**< single-shot = 0 */
+  sox_loop_forward = 1,       /**< forward loop = 1 */
+  sox_loop_forward_back = 2,  /**< forward/back loop = 2 */
+  sox_loop_8 = 32,            /**< 8 loops (??) = 32 */
+  sox_loop_sustain_decay = 64 /**< AIFF style, one sustain & one decay loop = 64 */
+};
+
+/**
+Plugins API:
+Is file a real file, a pipe, or a url?
+*/
+typedef enum lsx_io_type
+{
+    lsx_io_file, /**< File is a real file = 0. */
+    lsx_io_pipe, /**< File is a pipe (no seeking) = 1. */
+    lsx_io_url   /**< File is a URL (no seeking) = 2. */
+} lsx_io_type;
+
+/*****************************************************************************
+Macros:
+*****************************************************************************/
+
+/**
+Client API:
+Compute a 32-bit integer API version from three 8-bit parts.
+@param a Major version.
+@param b Minor version.
+@param c Revision or build number.
+@returns 32-bit integer API version 0x000a0b0c.
+*/
+#define SOX_LIB_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
+
+/**
+Client API:
+The API version of the sox.h file. It is not meant to follow the version
+number of SoX but it has historically. Please do not count on
+SOX_LIB_VERSION_CODE staying in sync with the libSoX version.
+*/
+#define SOX_LIB_VERSION_CODE   SOX_LIB_VERSION(14, 4, 0)
+
+/**
+Client API:
+Returns the smallest (negative) value storable in a twos-complement signed
+integer with the specified number of bits, cast to an unsigned integer;
+for example, SOX_INT_MIN(8) = 0x80, SOX_INT_MIN(16) = 0x8000, etc.
+@param bits Size of value for which to calculate minimum.
+@returns the smallest (negative) value storable in a twos-complement signed
+integer with the specified number of bits, cast to an unsigned integer.
+*/
+#define SOX_INT_MIN(bits) (1 <<((bits)-1))
+
+/**
+Client API:
+Returns the largest (positive) value storable in a twos-complement signed
+integer with the specified number of bits, cast to an unsigned integer;
+for example, SOX_INT_MAX(8) = 0x7F, SOX_INT_MAX(16) = 0x7FFF, etc.
+@param bits Size of value for which to calculate maximum.
+@returns the largest (positive) value storable in a twos-complement signed
+integer with the specified number of bits, cast to an unsigned integer.
+*/
+#define SOX_INT_MAX(bits) (((unsigned)-1)>>(33-(bits)))
+
+/**
+Client API:
+Returns the largest value storable in an unsigned integer with the specified
+number of bits; for example, SOX_UINT_MAX(8) = 0xFF,
+SOX_UINT_MAX(16) = 0xFFFF, etc.
+@param bits Size of value for which to calculate maximum.
+@returns the largest value storable in an unsigned integer with the specified
+number of bits.
+*/
+#define SOX_UINT_MAX(bits) (SOX_INT_MIN(bits)|SOX_INT_MAX(bits))
+
+/**
+Client API:
+Returns 0x7F.
+*/
+#define SOX_INT8_MAX  SOX_INT_MAX(8)
+
+/**
+Client API:
+Returns 0x7FFF.
+*/
+#define SOX_INT16_MAX SOX_INT_MAX(16)
+
+/**
+Client API:
+Returns 0x7FFFFF.
+*/
+#define SOX_INT24_MAX SOX_INT_MAX(24)
+
+/**
+Client API:
+Returns 0x7FFFFFFF.
+*/
+#define SOX_INT32_MAX SOX_INT_MAX(32)
+
+/**
+Client API:
+Bits in a sox_sample_t = 32.
+*/
+#define SOX_SAMPLE_PRECISION 32
+
+/**
+Client API:
+Max value for sox_sample_t = 0x7FFFFFFF.
+*/
+#define SOX_SAMPLE_MAX (sox_sample_t)SOX_INT_MAX(32)
+
+/**
+Client API:
+Min value for sox_sample_t = 0x80000000.
+*/
+#define SOX_SAMPLE_MIN (sox_sample_t)SOX_INT_MIN(32)
+
+
+/*                Conversions: Linear PCM <--> sox_sample_t
+ *
+ *   I/O      Input    sox_sample_t Clips?   Input    sox_sample_t Clips?
+ *  Format   Minimum     Minimum     I O    Maximum     Maximum     I O
+ *  ------  ---------  ------------ -- --   --------  ------------ -- --
+ *  Float     -inf         -1        y n      inf      1 - 5e-10    y n
+ *  Int8      -128        -128       n n      127     127.9999999   n y
+ *  Int16    -32768      -32768      n n     32767    32767.99998   n y
+ *  Int24   -8388608    -8388608     n n    8388607   8388607.996   n y
+ *  Int32  -2147483648 -2147483648   n n   2147483647 2147483647    n n
+ *
+ * Conversions are as accurate as possible (with rounding).
+ *
+ * Rounding: halves toward +inf, all others to nearest integer.
+ *
+ * Clips? shows whether on not there is the possibility of a conversion
+ * clipping to the minimum or maximum value when inputing from or outputing
+ * to a given type.
+ *
+ * Unsigned integers are converted to and from signed integers by flipping
+ * the upper-most bit then treating them as signed integers.
+ */
+
+/**
+Client API:
+Declares the temporary local variables that are required when using SOX
+conversion macros.
+*/
+#define SOX_SAMPLE_LOCALS sox_sample_t sox_macro_temp_sample LSX_UNUSED; \
+  double sox_macro_temp_double LSX_UNUSED
+
+/**
+Client API:
+Sign bit for sox_sample_t = 0x80000000.
+*/
+#define SOX_SAMPLE_NEG SOX_INT_MIN(32)
+
+/**
+Client API:
+Converts sox_sample_t to an unsigned integer of width (bits).
+@param bits  Width of resulting sample (1 through 32).
+@param d     Input sample to be converted.
+@param clips Variable that is incremented if the result is too big.
+@returns Unsigned integer of width (bits).
+*/
+#define SOX_SAMPLE_TO_UNSIGNED(bits,d,clips) \
+  (sox_uint##bits##_t)(SOX_SAMPLE_TO_SIGNED(bits,d,clips)^SOX_INT_MIN(bits))
+
+/**
+Client API:
+Converts sox_sample_t to a signed integer of width (bits).
+@param bits  Width of resulting sample (1 through 32).
+@param d     Input sample to be converted.
+@param clips Variable that is incremented if the result is too big.
+@returns Signed integer of width (bits).
+*/
+#define SOX_SAMPLE_TO_SIGNED(bits,d,clips) \
+  (sox_int##bits##_t)(LSX_USE_VAR(sox_macro_temp_double),sox_macro_temp_sample=(d),sox_macro_temp_sample>SOX_SAMPLE_MAX-(1<<(31-bits))?++(clips),SOX_INT_MAX(bits):((sox_uint32_t)(sox_macro_temp_sample+(1<<(31-bits))))>>(32-bits))
+
+/**
+Client API:
+Converts signed integer of width (bits) to sox_sample_t.
+@param bits Width of input sample (1 through 32).
+@param d    Input sample to be converted.
+@returns SoX native sample value.
+*/
+#define SOX_SIGNED_TO_SAMPLE(bits,d)((sox_sample_t)(d)<<(32-bits))
+
+/**
+Client API:
+Converts unsigned integer of width (bits) to sox_sample_t.
+@param bits Width of input sample (1 through 32).
+@param d    Input sample to be converted.
+@returns SoX native sample value.
+*/
+#define SOX_UNSIGNED_TO_SAMPLE(bits,d)(SOX_SIGNED_TO_SAMPLE(bits,d)^SOX_SAMPLE_NEG)
+
+/**
+Client API:
+Converts unsigned 8-bit integer to sox_sample_t.
+@param d     Input sample to be converted.
+@param clips The parameter is not used.
+@returns SoX native sample value.
+*/
+#define SOX_UNSIGNED_8BIT_TO_SAMPLE(d,clips) SOX_UNSIGNED_TO_SAMPLE(8,d)
+
+/**
+Client API:
+Converts signed 8-bit integer to sox_sample_t.
+@param d    Input sample to be converted.
+@param clips The parameter is not used.
+@returns SoX native sample value.
+*/
+#define SOX_SIGNED_8BIT_TO_SAMPLE(d,clips) SOX_SIGNED_TO_SAMPLE(8,d)
+
+/**
+Client API:
+Converts unsigned 16-bit integer to sox_sample_t.
+@param d     Input sample to be converted.
+@param clips The parameter is not used.
+@returns SoX native sample value.
+*/
+#define SOX_UNSIGNED_16BIT_TO_SAMPLE(d,clips) SOX_UNSIGNED_TO_SAMPLE(16,d)
+
+/**
+Client API:
+Converts signed 16-bit integer to sox_sample_t.
+@param d    Input sample to be converted.
+@param clips The parameter is not used.
+@returns SoX native sample value.
+*/
+#define SOX_SIGNED_16BIT_TO_SAMPLE(d,clips) SOX_SIGNED_TO_SAMPLE(16,d)
+
+/**
+Client API:
+Converts unsigned 24-bit integer to sox_sample_t.
+@param d     Input sample to be converted.
+@param clips The parameter is not used.
+@returns SoX native sample value.
+*/
+#define SOX_UNSIGNED_24BIT_TO_SAMPLE(d,clips) SOX_UNSIGNED_TO_SAMPLE(24,d)
+
+/**
+Client API:
+Converts signed 24-bit integer to sox_sample_t.
+@param d    Input sample to be converted.
+@param clips The parameter is not used.
+@returns SoX native sample value.
+*/
+#define SOX_SIGNED_24BIT_TO_SAMPLE(d,clips) SOX_SIGNED_TO_SAMPLE(24,d)
+
+/**
+Client API:
+Converts unsigned 32-bit integer to sox_sample_t.
+@param d     Input sample to be converted.
+@param clips The parameter is not used.
+@returns SoX native sample value.
+*/
+#define SOX_UNSIGNED_32BIT_TO_SAMPLE(d,clips) ((sox_sample_t)(d)^SOX_SAMPLE_NEG)
+
+/**
+Client API:
+Converts signed 32-bit integer to sox_sample_t.
+@param d    Input sample to be converted.
+@param clips The parameter is not used.
+@returns SoX native sample value.
+*/
+#define SOX_SIGNED_32BIT_TO_SAMPLE(d,clips) (sox_sample_t)(d)
+
+/**
+Client API:
+Converts 32-bit float to sox_sample_t.
+@param d     Input sample to be converted, range [-1, 1).
+@param clips Variable to increment if the input sample is too large or too small.
+@returns SoX native sample value.
+*/
+#define SOX_FLOAT_32BIT_TO_SAMPLE(d,clips) (sox_sample_t)(LSX_USE_VAR(sox_macro_temp_sample),sox_macro_temp_double=(d)*(SOX_SAMPLE_MAX+1.),sox_macro_temp_double<SOX_SAMPLE_MIN?++(clips),SOX_SAMPLE_MIN:sox_macro_temp_double>=SOX_SAMPLE_MAX+1.?sox_macro_temp_double>SOX_SAMPLE_MAX+1.?++(clips),SOX_SAMPLE_MAX:SOX_SAMPLE_MAX:sox_macro_temp_double)
+
+/**
+Client API:
+Converts 64-bit float to sox_sample_t.
+@param d     Input sample to be converted, range [-1, 1).
+@param clips Variable to increment if the input sample is too large or too small.
+@returns SoX native sample value.
+*/
+#define SOX_FLOAT_64BIT_TO_SAMPLE(d,clips) (sox_sample_t)(LSX_USE_VAR(sox_macro_temp_sample),sox_macro_temp_double=(d)*(SOX_SAMPLE_MAX+1.),sox_macro_temp_double<0?sox_macro_temp_double<=SOX_SAMPLE_MIN-.5?++(clips),SOX_SAMPLE_MIN:sox_macro_temp_double-.5:sox_macro_temp_double>=SOX_SAMPLE_MAX+.5?sox_macro_temp_double>SOX_SAMPLE_MAX+1.?++(clips),SOX_SAMPLE_MAX:SOX_SAMPLE_MAX:sox_macro_temp_double+.5)
+
+/**
+Client API:
+Converts SoX native sample to an unsigned 8-bit integer.
+@param d Input sample to be converted.
+@param clips Variable to increment if input sample is too large.
+*/
+#define SOX_SAMPLE_TO_UNSIGNED_8BIT(d,clips) SOX_SAMPLE_TO_UNSIGNED(8,d,clips)
+
+/**
+Client API:
+Converts SoX native sample to an signed 8-bit integer.
+@param d Input sample to be converted.
+@param clips Variable to increment if input sample is too large.
+*/
+#define SOX_SAMPLE_TO_SIGNED_8BIT(d,clips) SOX_SAMPLE_TO_SIGNED(8,d,clips)
+
+/**
+Client API:
+Converts SoX native sample to an unsigned 16-bit integer.
+@param d Input sample to be converted.
+@param clips Variable to increment if input sample is too large.
+*/
+#define SOX_SAMPLE_TO_UNSIGNED_16BIT(d,clips) SOX_SAMPLE_TO_UNSIGNED(16,d,clips)
+
+/**
+Client API:
+Converts SoX native sample to a signed 16-bit integer.
+@param d Input sample to be converted.
+@param clips Variable to increment if input sample is too large.
+*/
+#define SOX_SAMPLE_TO_SIGNED_16BIT(d,clips) SOX_SAMPLE_TO_SIGNED(16,d,clips)
+
+/**
+Client API:
+Converts SoX native sample to an unsigned 24-bit integer.
+@param d Input sample to be converted.
+@param clips Variable to increment if input sample is too large.
+*/
+#define SOX_SAMPLE_TO_UNSIGNED_24BIT(d,clips) SOX_SAMPLE_TO_UNSIGNED(24,d,clips)
+
+/**
+Client API:
+Converts SoX native sample to a signed 24-bit integer.
+@param d Input sample to be converted.
+@param clips Variable to increment if input sample is too large.
+*/
+#define SOX_SAMPLE_TO_SIGNED_24BIT(d,clips) SOX_SAMPLE_TO_SIGNED(24,d,clips)
+
+/**
+Client API:
+Converts SoX native sample to an unsigned 32-bit integer.
+@param d Input sample to be converted.
+@param clips The parameter is not used.
+*/
+#define SOX_SAMPLE_TO_UNSIGNED_32BIT(d,clips) (sox_uint32_t)((d)^SOX_SAMPLE_NEG)
+
+/**
+Client API:
+Converts SoX native sample to a signed 32-bit integer.
+@param d Input sample to be converted.
+@param clips The parameter is not used.
+*/
+#define SOX_SAMPLE_TO_SIGNED_32BIT(d,clips) (sox_int32_t)(d)
+
+/**
+Client API:
+Converts SoX native sample to a 32-bit float.
+@param d Input sample to be converted.
+@param clips Variable to increment if input sample is too large.
+*/
+#define SOX_SAMPLE_TO_FLOAT_32BIT(d,clips) (LSX_USE_VAR(sox_macro_temp_double),sox_macro_temp_sample=(d),sox_macro_temp_sample>SOX_SAMPLE_MAX-128?++(clips),1:(((sox_macro_temp_sample+128)&~255)*(1./(SOX_SAMPLE_MAX+1.))))
+
+/**
+Client API:
+Converts SoX native sample to a 64-bit float.
+@param d Input sample to be converted.
+@param clips The parameter is not used.
+*/
+#define SOX_SAMPLE_TO_FLOAT_64BIT(d,clips) ((d)*(1./(SOX_SAMPLE_MAX+1.)))
+
+/**
+Client API:
+Clips a value of a type that is larger then sox_sample_t (for example, int64)
+to sox_sample_t's limits and increment a counter if clipping occurs.
+@param samp Value (lvalue) to be clipped, updated as necessary.
+@param clips Value (lvalue) that is incremented if clipping is needed.
+*/
+#define SOX_SAMPLE_CLIP_COUNT(samp, clips) \
+  do { \
+    if (samp > SOX_SAMPLE_MAX) \
+      { samp = SOX_SAMPLE_MAX; clips++; } \
+    else if (samp < SOX_SAMPLE_MIN) \
+      { samp = SOX_SAMPLE_MIN; clips++; } \
+  } while (0)
+
+/**
+Client API:
+Clips a value of a type that is larger then sox_sample_t (for example, int64)
+to sox_sample_t's limits and increment a counter if clipping occurs.
+@param d Value (rvalue) to be clipped.
+@param clips Value (lvalue) that is incremented if clipping is needed.
+@returns Clipped value.
+*/
+#define SOX_ROUND_CLIP_COUNT(d, clips) \
+  ((d) < 0? (d) <= SOX_SAMPLE_MIN - 0.5? ++(clips), SOX_SAMPLE_MIN: (d) - 0.5 \
+        : (d) >= SOX_SAMPLE_MAX + 0.5? ++(clips), SOX_SAMPLE_MAX: (d) + 0.5)
+
+/**
+Client API:
+Clips a value to the limits of a signed integer of the specified width
+and increment a counter if clipping occurs.
+@param bits Width (in bits) of target integer type.
+@param i Value (rvalue) to be clipped.
+@param clips Value (lvalue) that is incremented if clipping is needed.
+@returns Clipped value.
+*/
+#define SOX_INTEGER_CLIP_COUNT(bits,i,clips) ( \
+  (i) >(1 << ((bits)-1))- 1? ++(clips),(1 << ((bits)-1))- 1 : \
+  (i) <-1 << ((bits)-1)    ? ++(clips),-1 << ((bits)-1) : (i))
+
+/**
+Client API:
+Clips a value to the limits of a 16-bit signed integer and increment a counter
+if clipping occurs.
+@param i Value (rvalue) to be clipped.
+@param clips Value (lvalue) that is incremented if clipping is needed.
+@returns Clipped value.
+*/
+#define SOX_16BIT_CLIP_COUNT(i,clips) SOX_INTEGER_CLIP_COUNT(16,i,clips)
+
+/**
+Client API:
+Clips a value to the limits of a 24-bit signed integer and increment a counter
+if clipping occurs.
+@param i Value (rvalue) to be clipped.
+@param clips Value (lvalue) that is incremented if clipping is needed.
+@returns Clipped value.
+*/
+#define SOX_24BIT_CLIP_COUNT(i,clips) SOX_INTEGER_CLIP_COUNT(24,i,clips)
+
+#define SOX_SIZE_MAX ((size_t)(-1)) /**< Client API: Maximum value of size_t. */
+
+#define SOX_UNSPEC 0                         /**< Client API: Members of sox_signalinfo_t are set to SOX_UNSPEC (= 0) if the actual value is not yet known. */
+#define SOX_UNKNOWN_LEN (sox_uint64_t)(-1) /**< Client API: sox_signalinfo_t.length is set to SOX_UNKNOWN_LEN (= -1) within the effects chain if the actual length is not known. Format handlers currently use SOX_UNSPEC instead. */
+#define SOX_IGNORE_LENGTH (sox_uint64_t)(-2) /**< Client API: sox_signalinfo_t.length is set to SOX_IGNORE_LENGTH (= -2) to indicate that a format handler should ignore length information in file headers. */
+
+#define SOX_DEFAULT_CHANNELS  2     /**< Client API: Default channel count is 2 (stereo). */
+#define SOX_DEFAULT_RATE      48000 /**< Client API: Default rate is 48000Hz. */
+#define SOX_DEFAULT_PRECISION 16    /**< Client API: Default precision is 16 bits per sample. */
+#define SOX_DEFAULT_ENCODING  SOX_ENCODING_SIGN2 /**< Client API: Default encoding is SIGN2 (linear 2's complement PCM). */
+
+#define SOX_LOOP_NONE          ((unsigned char)sox_loop_none)          /**< Client API: single-shot = 0 */
+#define SOX_LOOP_8             ((unsigned char)sox_loop_8)             /**< Client API: 8 loops = 32 */
+#define SOX_LOOP_SUSTAIN_DECAY ((unsigned char)sox_loop_sustain_decay) /**< Client API: AIFF style, one sustain & one decay loop = 64 */
+
+#define SOX_MAX_NLOOPS         8 /**< Client API: Maximum number of loops supported by sox_oob_t = 8. */
+
+#define SOX_FILE_NOSTDIO 0x0001 /**< Client API: Does not use stdio routines */
+#define SOX_FILE_DEVICE  0x0002 /**< Client API: File is an audio device */
+#define SOX_FILE_PHONY   0x0004 /**< Client API: Phony file/device (for example /dev/null) */
+#define SOX_FILE_REWIND  0x0008 /**< Client API: File should be rewound to write header */
+#define SOX_FILE_BIT_REV 0x0010 /**< Client API: Is file bit-reversed? */
+#define SOX_FILE_NIB_REV 0x0020 /**< Client API: Is file nibble-reversed? */
+#define SOX_FILE_ENDIAN  0x0040 /**< Client API: Is file format endian? */
+#define SOX_FILE_ENDBIG  0x0080 /**< Client API: For endian file format, is it big endian? */
+#define SOX_FILE_MONO    0x0100 /**< Client API: Do channel restrictions allow mono? */
+#define SOX_FILE_STEREO  0x0200 /**< Client API: Do channel restrictions allow stereo? */
+#define SOX_FILE_QUAD    0x0400 /**< Client API: Do channel restrictions allow quad? */
+
+#define SOX_FILE_CHANS   (SOX_FILE_MONO | SOX_FILE_STEREO | SOX_FILE_QUAD) /**< Client API: No channel restrictions */
+#define SOX_FILE_LIT_END (SOX_FILE_ENDIAN | 0)                             /**< Client API: File is little-endian */
+#define SOX_FILE_BIG_END (SOX_FILE_ENDIAN | SOX_FILE_ENDBIG)               /**< Client API: File is big-endian */
+
+#define SOX_EFF_CHAN     1           /**< Client API: Effect might alter the number of channels */
+#define SOX_EFF_RATE     2           /**< Client API: Effect might alter sample rate */
+#define SOX_EFF_PREC     4           /**< Client API: Effect does its own calculation of output sample precision (otherwise a default value is taken, depending on the presence of SOX_EFF_MODIFY) */
+#define SOX_EFF_LENGTH   8           /**< Client API: Effect might alter audio length (as measured in time units, not necessarily in samples) */
+#define SOX_EFF_MCHAN    16          /**< Client API: Effect handles multiple channels internally */
+#define SOX_EFF_NULL     32          /**< Client API: Effect does nothing (can be optimized out of chain) */
+#define SOX_EFF_DEPRECATED 64        /**< Client API: Effect will soon be removed from SoX */
+#define SOX_EFF_GAIN     128         /**< Client API: Effect does not support gain -r */
+#define SOX_EFF_MODIFY   256         /**< Client API: Effect does not modify sample values (but might remove or duplicate samples or insert zeros) */
+#define SOX_EFF_ALPHA    512         /**< Client API: Effect is experimental/incomplete */
+#define SOX_EFF_INTERNAL 1024        /**< Client API: Effect present in libSoX but not valid for use by SoX command-line tools */
+
+/**
+Client API:
+When used as the "whence" parameter of sox_seek, indicates that the specified
+offset is relative to the beginning of the file.
+*/
+#define SOX_SEEK_SET 0
+
+/*****************************************************************************
+Forward declarations:
+*****************************************************************************/
+
+typedef struct sox_format_t sox_format_t;
+typedef struct sox_effect_t sox_effect_t;
+typedef struct sox_effect_handler_t sox_effect_handler_t;
+typedef struct sox_format_handler_t sox_format_handler_t;
+
+/*****************************************************************************
+Function pointers:
+*****************************************************************************/
+
+/**
+Client API:
+Callback to write a message to an output device (console or log file),
+used by sox_globals_t.output_message_handler.
+*/
+typedef void (LSX_API * sox_output_message_handler_t)(
+    unsigned level,                       /* 1 = FAIL, 2 = WARN, 3 = INFO, 4 = DEBUG, 5 = DEBUG_MORE, 6 = DEBUG_MOST. */
+    LSX_PARAM_IN_Z char const * filename, /* Source code __FILENAME__ from which message originates. */
+    LSX_PARAM_IN_PRINTF char const * fmt, /* Message format string. */
+    LSX_PARAM_IN va_list ap               /* Message format parameters. */
+    );
+
+/**
+Client API:
+Callback to retrieve information about a format handler,
+used by sox_format_tab_t.fn.
+@returns format handler information.
+*/
+typedef sox_format_handler_t const * (LSX_API * sox_format_fn_t)(void);
+
+/**
+Client API:
+Callback to get information about an effect handler,
+used by the table returned from sox_get_effect_fns(void).
+@returns Pointer to information about an effect handler.
+*/
+typedef sox_effect_handler_t const * (LSX_API *sox_effect_fn_t)(void);
+
+/**
+Client API:
+Callback to initialize reader (decoder), used by
+sox_format_handler.startread.
+@returns SOX_SUCCESS if successful.
+*/
+typedef int (LSX_API * sox_format_handler_startread)(
+    LSX_PARAM_INOUT sox_format_t * ft /**< Format pointer. */
+    );
+
+/**
+Client API:
+Callback to read (decode) a block of samples,
+used by sox_format_handler.read.
+@returns number of samples read, or 0 if unsuccessful.
+*/
+typedef size_t (LSX_API * sox_format_handler_read)(
+    LSX_PARAM_INOUT sox_format_t * ft, /**< Format pointer. */
+    LSX_PARAM_OUT_CAP_POST_COUNT(len,return) sox_sample_t *buf, /**< Buffer from which to read samples. */
+    size_t len /**< Number of samples available in buf. */
+    );
+
+/**
+Client API:
+Callback to close reader (decoder),
+used by sox_format_handler.stopread.
+@returns SOX_SUCCESS if successful.
+*/
+typedef int (LSX_API * sox_format_handler_stopread)(
+    LSX_PARAM_INOUT sox_format_t * ft /**< Format pointer. */
+    );
+
+/**
+Client API:
+Callback to initialize writer (encoder),
+used by sox_format_handler.startwrite.
+@returns SOX_SUCCESS if successful.
+*/
+typedef int (LSX_API * sox_format_handler_startwrite)(
+    LSX_PARAM_INOUT sox_format_t * ft /**< Format pointer. */
+    );
+
+/**
+Client API:
+Callback to write (encode) a block of samples,
+used by sox_format_handler.write.
+@returns number of samples written, or 0 if unsuccessful.
+*/
+typedef size_t (LSX_API * sox_format_handler_write)(
+    LSX_PARAM_INOUT sox_format_t * ft, /**< Format pointer. */
+    LSX_PARAM_IN_COUNT(len) sox_sample_t const * buf, /**< Buffer to which samples are written. */
+    size_t len /**< Capacity of buf, measured in samples. */
+    );
+
+/**
+Client API:
+Callback to close writer (decoder),
+used by sox_format_handler.stopwrite.
+@returns SOX_SUCCESS if successful.
+*/
+typedef int (LSX_API * sox_format_handler_stopwrite)(
+    LSX_PARAM_INOUT sox_format_t * ft /**< Format pointer. */
+    );
+
+/**
+Client API:
+Callback to reposition reader,
+used by sox_format_handler.seek.
+@returns SOX_SUCCESS if successful.
+*/
+typedef int (LSX_API * sox_format_handler_seek)(
+    LSX_PARAM_INOUT sox_format_t * ft, /**< Format pointer. */
+    sox_uint64_t offset /**< Sample offset to which reader should be positioned. */
+    );
+
+/**
+Client API:
+Callback to parse command-line arguments (called once per effect),
+used by sox_effect_handler.getopts.
+@returns SOX_SUCCESS if successful.
+*/
+typedef int (LSX_API * sox_effect_handler_getopts)(
+    LSX_PARAM_INOUT sox_effect_t * effp, /**< Effect pointer. */
+    int argc, /**< Number of arguments in argv. */
+    LSX_PARAM_IN_COUNT(argc) char *argv[] /**< Array of command-line arguments. */
+    );
+
+/**
+Client API:
+Callback to initialize effect (called once per flow),
+used by sox_effect_handler.start.
+@returns SOX_SUCCESS if successful.
+*/
+typedef int (LSX_API * sox_effect_handler_start)(
+    LSX_PARAM_INOUT sox_effect_t * effp /**< Effect pointer. */
+    );
+
+/**
+Client API:
+Callback to process samples,
+used by sox_effect_handler.flow.
+@returns SOX_SUCCESS if successful.
+*/
+typedef int (LSX_API * sox_effect_handler_flow)(
+    LSX_PARAM_INOUT sox_effect_t * effp, /**< Effect pointer. */
+    LSX_PARAM_IN_COUNT(*isamp) sox_sample_t const * ibuf, /**< Buffer from which to read samples. */
+    LSX_PARAM_OUT_CAP_POST_COUNT(*osamp,*osamp) sox_sample_t * obuf, /**< Buffer to which samples are written. */
+    LSX_PARAM_INOUT size_t *isamp, /**< On entry, contains capacity of ibuf; on exit, contains number of samples consumed. */
+    LSX_PARAM_INOUT size_t *osamp /**< On entry, contains capacity of obuf; on exit, contains number of samples written. */
+    );
+
+/**
+Client API:
+Callback to finish getting output after input is complete,
+used by sox_effect_handler.drain.
+@returns SOX_SUCCESS if successful.
+*/
+typedef int (LSX_API * sox_effect_handler_drain)(
+    LSX_PARAM_INOUT sox_effect_t * effp, /**< Effect pointer. */
+    LSX_PARAM_OUT_CAP_POST_COUNT(*osamp,*osamp) sox_sample_t *obuf, /**< Buffer to which samples are written. */
+    LSX_PARAM_INOUT size_t *osamp /**< On entry, contains capacity of obuf; on exit, contains number of samples written. */
+    );
+
+/**
+Client API:
+Callback to shut down effect (called once per flow),
+used by sox_effect_handler.stop.
+@returns SOX_SUCCESS if successful.
+*/
+typedef int (LSX_API * sox_effect_handler_stop)(
+    LSX_PARAM_INOUT sox_effect_t * effp /**< Effect pointer. */
+    );
+
+/**
+Client API:
+Callback to shut down effect (called once per effect),
+used by sox_effect_handler.kill.
+@returns SOX_SUCCESS if successful.
+*/
+typedef int (LSX_API * sox_effect_handler_kill)(
+    LSX_PARAM_INOUT sox_effect_t * effp /**< Effect pointer. */
+    );
+
+/**
+Client API:
+Callback called while flow is running (called once per buffer),
+used by sox_flow_effects.callback.
+@returns SOX_SUCCESS to continue, other value to abort flow.
+*/
+typedef int (LSX_API * sox_flow_effects_callback)(
+    sox_bool all_done,
+    void * client_data
+    );
+
+/**
+Client API:
+Callback for enumerating the contents of a playlist,
+used by the sox_parse_playlist function.
+@returns SOX_SUCCESS if successful, any other value to abort playlist enumeration.
+*/
+typedef int (LSX_API * sox_playlist_callback_t)(
+    void * callback_data,
+    LSX_PARAM_IN_Z char const * filename
+    );
+
+/*****************************************************************************
+Structures:
+*****************************************************************************/
+
+/**
+Client API:
+Information about a build of libSoX, returned from the sox_version_info
+function.
+*/
+typedef struct sox_version_info_t {
+    size_t       size;         /**< structure size = sizeof(sox_version_info_t) */
+    sox_version_flags_t flags; /**< feature flags = popen | magic | threads | memopen */
+    sox_uint32_t version_code; /**< version number = 0x140400 */
+    char const * version;      /**< version string = sox_version(), for example, "14.4.0" */
+    char const * version_extra;/**< version extra info or null = "PACKAGE_EXTRA", for example, "beta" */
+    char const * time;         /**< build time = "__DATE__ __TIME__", for example, "Jan  7 2010 03:31:50" */
+    char const * distro;       /**< distro or null = "DISTRO", for example, "Debian" */
+    char const * compiler;     /**< compiler info or null, for example, "msvc 160040219" */
+    char const * arch;         /**< arch, for example, "1248 48 44 L OMP" */
+    /* new info should be added at the end for version backwards-compatibility. */
+} sox_version_info_t;
+
+/**
+Client API:
+Global parameters (for effects & formats), returned from the sox_get_globals
+function.
+*/
+typedef struct sox_globals_t {
+/* public: */
+  unsigned     verbosity; /**< messages are only written if globals.verbosity >= message.level */
+  sox_output_message_handler_t output_message_handler; /**< client-specified message output callback */
+  sox_bool     repeatable; /**< true to use pre-determined timestamps and PRNG seed */
+
+  /**
+  Default size (in bytes) used by libSoX for blocks of sample data.
+  Plugins should use similarly-sized buffers to get best performance.
+  */
+  size_t       bufsiz;
+
+  /**
+  Default size (in bytes) used by libSoX for blocks of input sample data.
+  Plugins should use similarly-sized buffers to get best performance.
+  */
+  size_t       input_bufsiz;
+
+  sox_int32_t  ranqd1; /**< Can be used to re-seed libSoX's PRNG */
+
+  char const * stdin_in_use_by;  /**< Private: tracks the name of the handler currently using stdin */
+  char const * stdout_in_use_by; /**< Private: tracks the name of the handler currently using stdout */
+  char const * subsystem;        /**< Private: tracks the name of the handler currently writing an output message */
+  char       * tmp_path;         /**< Private: client-configured path to use for temporary files */
+  sox_bool     use_magic;        /**< Private: true if client has requested use of 'magic' file-type detection */
+  sox_bool     use_threads;      /**< Private: true if client has requested parallel effects processing */
+} sox_globals_t;
+
+/**
+Client API:
+Signal parameters; members should be set to SOX_UNSPEC (= 0) if unknown.
+*/
+typedef struct sox_signalinfo_t {
+  sox_rate_t       rate;         /**< samples per second, 0 if unknown */
+  unsigned         channels;     /**< number of sound channels, 0 if unknown */
+  unsigned         precision;    /**< bits per sample, 0 if unknown */
+  sox_uint64_t     length;       /**< samples * chans in file, 0 if unknown, -1 if unspecified */
+  double           * mult;       /**< Effects headroom multiplier; may be null */
+} sox_signalinfo_t;
+
+/**
+Client API:
+Basic information about an encoding.
+*/
+typedef struct sox_encodings_info_t {
+  sox_encodings_flags_t flags; /**< lossy once (lossy1), lossy twice (lossy2), or lossless (none). */
+  char const * name;           /**< encoding name. */
+  char const * desc;           /**< encoding description. */
+} sox_encodings_info_t;
+
+/**
+Client API:
+Encoding parameters.
+*/
+typedef struct sox_encodinginfo_t {
+  sox_encoding_t encoding; /**< format of sample numbers */
+  unsigned bits_per_sample;/**< 0 if unknown or variable; uncompressed value if lossless; compressed value if lossy */
+  double compression;      /**< compression factor (where applicable) */
+
+  /**
+  Should bytes be reversed? If this is default during sox_open_read or
+  sox_open_write, libSoX will set them to either no or yes according to the
+  machine or format default.
+  */
+  sox_option_t reverse_bytes;
+
+  /**
+  Should nibbles be reversed? If this is default during sox_open_read or
+  sox_open_write, libSoX will set them to either no or yes according to the
+  machine or format default.
+  */
+  sox_option_t reverse_nibbles;
+
+  /**
+  Should bits be reversed? If this is default during sox_open_read or
+  sox_open_write, libSoX will set them to either no or yes according to the
+  machine or format default.
+  */
+  sox_option_t reverse_bits;
+
+  /**
+  If set to true, the format should reverse its default endianness.
+  */
+  sox_bool opposite_endian;
+} sox_encodinginfo_t;
+
+/**
+Client API:
+Looping parameters (out-of-band data).
+*/
+typedef struct sox_loopinfo_t {
+  sox_uint64_t  start;  /**< first sample */
+  sox_uint64_t  length; /**< length */
+  unsigned      count;  /**< number of repeats, 0=forever */
+  unsigned char type;   /**< 0=no, 1=forward, 2=forward/back (see sox_loop_* for valid values). */
+} sox_loopinfo_t;
+
+/**
+Client API:
+Instrument information.
+*/
+typedef struct sox_instrinfo_t{
+  signed char MIDInote;   /**< for unity pitch playback */
+  signed char MIDIlow;    /**< MIDI pitch-bend low range */
+  signed char MIDIhi;     /**< MIDI pitch-bend high range */
+  unsigned char loopmode; /**< 0=no, 1=forward, 2=forward/back (see sox_loop_* values) */
+  unsigned nloops;  /**< number of active loops (max SOX_MAX_NLOOPS). */
+} sox_instrinfo_t;
+
+/**
+Client API:
+File buffer info.  Holds info so that data can be read in blocks.
+*/
+typedef struct sox_fileinfo_t {
+  char          *buf;                 /**< Pointer to data buffer */
+  size_t        size;                 /**< Size of buffer in bytes */
+  size_t        count;                /**< Count read into buffer */
+  size_t        pos;                  /**< Position in buffer */
+} sox_fileinfo_t;
+
+/**
+Client API:
+Handler structure defined by each format.
+*/
+struct sox_format_handler_t {
+  unsigned     sox_lib_version_code;  /**< Checked on load; must be 1st in struct*/
+  char         const * description;   /**< short description of format */
+  char         const * const * names; /**< null-terminated array of filename extensions that are handled by this format */
+  unsigned int flags;                 /**< File flags (SOX_FILE_* values). */
+  sox_format_handler_startread startread; /**< called to initialize reader (decoder) */
+  sox_format_handler_read read;       /**< called to read (decode) a block of samples */
+  sox_format_handler_stopread stopread; /**< called to close reader (decoder); may be null if no closing necessary */
+  sox_format_handler_startwrite startwrite; /**< called to initialize writer (encoder) */
+  sox_format_handler_write write;     /**< called to write (encode) a block of samples */
+  sox_format_handler_stopwrite stopwrite; /**< called to close writer (decoder); may be null if no closing necessary */
+  sox_format_handler_seek seek;       /**< called to reposition reader; may be null if not supported */
+
+  /**
+  Array of values indicating the encodings and precisions supported for
+  writing (encoding). Precisions specified with default precision first.
+  Encoding, precision, precision, ..., 0, repeat. End with one more 0.
+  Example:
+  unsigned const * formats = {
+    SOX_ENCODING_SIGN2, 16, 24, 0, // Support SIGN2 at 16 and 24 bits, default to 16 bits.
+    SOX_ENCODING_UNSIGNED, 8, 0,   // Support UNSIGNED at 8 bits, default to 8 bits.
+    0 // No more supported encodings.
+  };
+  */
+  unsigned     const * write_formats;
+
+  /**
+  Array of sample rates (samples per second) supported for writing (encoding).
+  NULL if all (or almost all) rates are supported. End with 0.
+  */
+  sox_rate_t   const * write_rates;
+
+  /**
+  SoX will automatically allocate a buffer in which the handler can store data.
+  Specify the size of the buffer needed here. Usually this will be sizeof(your_struct).
+  The buffer will be allocated and zeroed before the call to startread/startwrite.
+  The buffer will be freed after the call to stopread/stopwrite.
+  The buffer will be provided via format.priv in each call to the handler.
+  */
+  size_t       priv_size;
+};
+
+/**
+Client API:
+Comments, instrument info, loop info (out-of-band data).
+*/
+typedef struct sox_oob_t{
+  /* Decoded: */
+  sox_comments_t   comments;              /**< Comment strings in id=value format. */
+  sox_instrinfo_t  instr;                 /**< Instrument specification */
+  sox_loopinfo_t   loops[SOX_MAX_NLOOPS]; /**< Looping specification */
+
+  /* TBD: Non-decoded chunks, etc: */
+} sox_oob_t;
+
+/**
+Client API:
+Data passed to/from the format handler
+*/
+struct sox_format_t {
+  char             * filename;      /**< File name */
+
+  /**
+  Signal specifications for reader (decoder) or writer (encoder):
+  sample rate, number of channels, precision, length, headroom multiplier.
+  Any info specified by the user is here on entry to startread or
+  startwrite. Info will be SOX_UNSPEC if the user provided no info.
+  At exit from startread, should be completely filled in, using
+  either data from the file's headers (if available) or whatever
+  the format is guessing/assuming (if header data is not available).
+  At exit from startwrite, should be completely filled in, using
+  either the data that was specified, or values chosen by the format
+  based on the format's defaults or capabilities.
+  */
+  sox_signalinfo_t signal;
+
+  /**
+  Encoding specifications for reader (decoder) or writer (encoder):
+  encoding (sample format), bits per sample, compression rate, endianness.
+  Should be filled in by startread. Values specified should be used
+  by startwrite when it is configuring the encoding parameters.
+  */
+  sox_encodinginfo_t encoding;
+
+  char             * filetype;      /**< Type of file, as determined by header inspection or libmagic. */
+  sox_oob_t        oob;             /**< comments, instrument info, loop info (out-of-band data) */
+  sox_bool         seekable;        /**< Can seek on this file */
+  char             mode;            /**< Read or write mode ('r' or 'w') */
+  sox_uint64_t     olength;         /**< Samples * chans written to file */
+  sox_uint64_t     clips;           /**< Incremented if clipping occurs */
+  int              sox_errno;       /**< Failure error code */
+  char             sox_errstr[256]; /**< Failure error text */
+  void             * fp;            /**< File stream pointer */
+  lsx_io_type      io_type;         /**< Stores whether this is a file, pipe or URL */
+  sox_uint64_t     tell_off;        /**< Current offset within file */
+  sox_uint64_t     data_start;      /**< Offset at which headers end and sound data begins (set by lsx_check_read_params) */
+  sox_format_handler_t handler;     /**< Format handler for this file */
+  void             * priv;          /**< Format handler's private data area */
+};
+
+/**
+Client API:
+Information about a loaded format handler, including the format name and a
+function pointer that can be invoked to get additional information about the
+format.
+*/
+typedef struct sox_format_tab_t {
+  char *name;         /**< Name of format handler */
+  sox_format_fn_t fn; /**< Function to call to get format handler's information */
+} sox_format_tab_t;
+
+/**
+Client API:
+Global parameters for effects.
+*/
+typedef struct sox_effects_globals_t {
+  sox_plot_t plot;         /**< To help the user choose effect & options */
+  sox_globals_t * global_info; /**< Pointer to associated SoX globals */
+} sox_effects_globals_t;
+
+/**
+Client API:
+Effect handler information.
+*/
+struct sox_effect_handler_t {
+  char const * name;  /**< Effect name */
+  char const * usage; /**< Short explanation of parameters accepted by effect */
+  unsigned int flags; /**< Combination of SOX_EFF_* flags */
+  sox_effect_handler_getopts getopts; /**< Called to parse command-line arguments (called once per effect). */
+  sox_effect_handler_start start;     /**< Called to initialize effect (called once per flow). */
+  sox_effect_handler_flow flow;       /**< Called to process samples. */
+  sox_effect_handler_drain drain;     /**< Called to finish getting output after input is complete. */
+  sox_effect_handler_stop stop;       /**< Called to shut down effect (called once per flow). */
+  sox_effect_handler_kill kill;       /**< Called to shut down effect (called once per effect). */
+  size_t       priv_size;             /**< Size of private data SoX should pre-allocate for effect */
+};
+
+/**
+Client API:
+Effect information.
+*/
+struct sox_effect_t {
+  sox_effects_globals_t    * global_info; /**< global effect parameters */
+  sox_signalinfo_t         in_signal;     /**< Information about the incoming data stream */
+  sox_signalinfo_t         out_signal;    /**< Information about the outgoing data stream */
+  sox_encodinginfo_t       const * in_encoding;  /**< Information about the incoming data encoding */
+  sox_encodinginfo_t       const * out_encoding; /**< Information about the outgoing data encoding */
+  sox_effect_handler_t     handler;   /**< The handler for this effect */
+  sox_sample_t             * obuf;    /**< output buffer */
+  size_t                   obeg;      /**< output buffer: start of valid data section */
+  size_t                   oend;      /**< output buffer: one past valid data section (oend-obeg is length of current content) */
+  size_t               imin;          /**< minimum input buffer content required for calling this effect's flow function; set via lsx_effect_set_imin() */
+  sox_uint64_t         clips;         /**< increment if clipping occurs */
+  size_t               flows;         /**< 1 if MCHAN, number of chans otherwise */
+  size_t               flow;          /**< flow number */
+  void                 * priv;        /**< Effect's private data area (each flow has a separate copy) */
+};
+
+/**
+Client API:
+Chain of effects to be applied to a stream.
+*/
+typedef struct sox_effects_chain_t {
+  sox_effect_t **effects;                  /**< Table of effects to be applied to a stream */
+  unsigned table_size;                     /**< Number of entries in effects table */
+  unsigned length;                         /**< Number of effects to be applied */
+  sox_sample_t **ibufc;                    /**< Channel interleave buffer */
+  sox_sample_t **obufc;                    /**< Channel interleave buffer */
+  sox_effects_globals_t global_info;       /**< Copy of global effects settings */
+  sox_encodinginfo_t const * in_enc;       /**< Input encoding */
+  sox_encodinginfo_t const * out_enc;      /**< Output encoding */
+} sox_effects_chain_t;
+
+/*****************************************************************************
+Functions:
+*****************************************************************************/
+
+/**
+Client API:
+Returns version number string of libSoX, for example, "14.4.0".
+@returns The version number string of libSoX, for example, "14.4.0".
+*/
+LSX_RETURN_VALID_Z LSX_RETURN_PURE
+char const *
+LSX_API
+sox_version(void);
+
+/**
+Client API:
+Returns information about this build of libsox.
+@returns Pointer to a version information structure.
+*/
+LSX_RETURN_VALID LSX_RETURN_PURE
+sox_version_info_t const *
+LSX_API
+sox_version_info(void);
+
+/**
+Client API:
+Returns a pointer to the structure with libSoX's global settings.
+@returns a pointer to the structure with libSoX's global settings.
+*/
+LSX_RETURN_VALID LSX_RETURN_PURE
+sox_globals_t *
+LSX_API
+sox_get_globals(void);
+
+/**
+Client API:
+Deprecated macro that returns the structure with libSoX's global settings
+as an lvalue.
+*/
+#define sox_globals (*sox_get_globals())
+
+/**
+Client API:
+Returns a pointer to the list of available encodings.
+End of list indicated by name == NULL.
+@returns pointer to the list of available encodings.
+*/
+LSX_RETURN_ARRAY LSX_RETURN_PURE
+sox_encodings_info_t const *
+LSX_API
+sox_get_encodings_info(void);
+
+/**
+Client API:
+Deprecated macro that returns the list of available encodings.
+End of list indicated by name == NULL.
+*/
+#define sox_encodings_info (sox_get_encodings_info())
+
+/**
+Client API:
+Fills in an encodinginfo with default values.
+*/
+void
+LSX_API
+sox_init_encodinginfo(
+    LSX_PARAM_OUT sox_encodinginfo_t * e /**< Pointer to uninitialized encoding info structure to be initialized. */
+    );
+
+/**
+Client API:
+Given an encoding (for example, SIGN2) and the encoded bits_per_sample (for
+example, 16), returns the number of useful bits per sample in the decoded data
+(for example, 16), or returns 0 to indicate that the value returned by the
+format handler should be used instead of a pre-determined precision.
+@returns the number of useful bits per sample in the decoded data (for example
+16), or returns 0 to indicate that the value returned by the format handler
+should be used instead of a pre-determined precision.
+*/
+LSX_RETURN_PURE
+unsigned
+LSX_API
+sox_precision(
+    sox_encoding_t encoding,   /**< Encoding for which to lookup precision information. */
+    unsigned bits_per_sample   /**< The number of encoded bits per sample. */
+    );
+
+/**
+Client API:
+Returns the number of items in the metadata block.
+@returns the number of items in the metadata block.
+*/
+size_t
+LSX_API
+sox_num_comments(
+    LSX_PARAM_IN_OPT sox_comments_t comments /**< Metadata block. */
+    );
+
+/**
+Client API:
+Adds an "id=value" item to the metadata block.
+*/
+void
+LSX_API
+sox_append_comment(
+    LSX_PARAM_DEREF_PRE_MAYBENULL LSX_PARAM_DEREF_POST_NOTNULL sox_comments_t * comments, /**< Metadata block. */
+    LSX_PARAM_IN_Z char const * item /**< Item to be added in "id=value" format. */
+    );
+
+/**
+Client API:
+Adds a newline-delimited list of "id=value" items to the metadata block.
+*/
+void
+LSX_API
+sox_append_comments(
+    LSX_PARAM_DEREF_PRE_MAYBENULL LSX_PARAM_DEREF_POST_NOTNULL sox_comments_t * comments, /**< Metadata block. */
+    LSX_PARAM_IN_Z char const * items /**< Newline-separated list of items to be added, for example "id1=value1\\nid2=value2". */
+    );
+
+/**
+Client API:
+Duplicates the metadata block.
+@returns the copied metadata block.
+*/
+LSX_RETURN_OPT
+sox_comments_t
+LSX_API
+sox_copy_comments(
+    LSX_PARAM_IN_OPT sox_comments_t comments /**< Metadata block to copy. */
+    );
+
+/**
+Client API:
+Frees the metadata block.
+*/
+void
+LSX_API
+sox_delete_comments(
+    LSX_PARAM_DEREF_PRE_MAYBENULL LSX_PARAM_DEREF_POST_NULL sox_comments_t * comments /**< Metadata block. */
+    );
+
+/**
+Client API:
+If "id=value" is found, return value, else return null.
+@returns value, or null if value not found.
+*/
+LSX_RETURN_OPT
+char const *
+LSX_API
+sox_find_comment(
+    LSX_PARAM_IN_OPT sox_comments_t comments, /**< Metadata block in which to search. */
+    LSX_PARAM_IN_Z char const * id /**< Id for which to search */
+    );
+
+/**
+Client API:
+Find and load format handler plugins.
+@returns SOX_SUCCESS if successful.
+*/
+int
+LSX_API
+sox_format_init(void);
+
+/**
+Client API:
+Unload format handler plugins.
+*/
+void
+LSX_API
+sox_format_quit(void);
+
+/**
+Client API:
+Initialize effects library.
+@returns SOX_SUCCESS if successful.
+*/
+int
+LSX_API
+sox_init(void);
+
+/**
+Client API:
+Close effects library and unload format handler plugins.
+@returns SOX_SUCCESS if successful.
+*/
+int
+LSX_API
+sox_quit(void);
+
+/**
+Client API:
+Returns the table of format handler names and functions.
+@returns the table of format handler names and functions.
+*/
+LSX_RETURN_ARRAY LSX_RETURN_PURE
+sox_format_tab_t const *
+LSX_API
+sox_get_format_fns(void);
+
+/**
+Client API:
+Deprecated macro that returns the table of format handler names and functions.
+*/
+#define sox_format_fns (sox_get_format_fns())
+
+/**
+Client API:
+Opens a decoding session for a file. Returned handle must be closed with sox_close().
+@returns The handle for the new session, or null on failure.
+*/
+LSX_RETURN_OPT
+sox_format_t *
+LSX_API
+sox_open_read(
+    LSX_PARAM_IN_Z   char               const * path,      /**< Path to file to be opened (required). */
+    LSX_PARAM_IN_OPT sox_signalinfo_t   const * signal,    /**< Information already known about audio stream, or NULL if none. */
+    LSX_PARAM_IN_OPT sox_encodinginfo_t const * encoding,  /**< Information already known about sample encoding, or NULL if none. */
+    LSX_PARAM_IN_OPT_Z char             const * filetype   /**< Previously-determined file type, or NULL to auto-detect. */
+    );
+
+/**
+Client API:
+Opens a decoding session for a memory buffer. Returned handle must be closed with sox_close().
+@returns The handle for the new session, or null on failure.
+*/
+LSX_RETURN_OPT
+sox_format_t *
+LSX_API
+sox_open_mem_read(
+    LSX_PARAM_IN_BYTECOUNT(buffer_size) void  * buffer,     /**< Pointer to audio data buffer (required). */
+    size_t                                      buffer_size,/**< Number of bytes to read from audio data buffer. */
+    LSX_PARAM_IN_OPT sox_signalinfo_t   const * signal,     /**< Information already known about audio stream, or NULL if none. */
+    LSX_PARAM_IN_OPT sox_encodinginfo_t const * encoding,   /**< Information already known about sample encoding, or NULL if none. */
+    LSX_PARAM_IN_OPT_Z char             const * filetype    /**< Previously-determined file type, or NULL to auto-detect. */
+    );
+
+/**
+Client API:
+Returns true if the format handler for the specified file type supports the specified encoding.
+@returns true if the format handler for the specified file type supports the specified encoding.
+*/
+sox_bool
+LSX_API
+sox_format_supports_encoding(
+    LSX_PARAM_IN_OPT_Z char               const * path,       /**< Path to file to be examined (required if filetype is NULL). */
+    LSX_PARAM_IN_OPT_Z char               const * filetype,   /**< Previously-determined file type, or NULL to use extension from path. */
+    LSX_PARAM_IN       sox_encodinginfo_t const * encoding    /**< Encoding for which format handler should be queried. */
+    );
+
+/**
+Client API:
+Gets the format handler for a specified file type.
+@returns The found format handler, or null if not found.
+*/
+LSX_RETURN_OPT
+sox_format_handler_t const *
+LSX_API
+sox_write_handler(
+    LSX_PARAM_IN_OPT_Z char               const * path,         /**< Path to file (required if filetype is NULL). */
+    LSX_PARAM_IN_OPT_Z char               const * filetype,     /**< Filetype for which handler is needed, or NULL to use extension from path. */
+    LSX_PARAM_OUT_OPT  char               const * * filetype1   /**< Receives the filetype that was detected. Pass NULL if not needed. */
+    );
+
+/**
+Client API:
+Opens an encoding session for a file. Returned handle must be closed with sox_close().
+@returns The new session handle, or null on failure.
+*/
+LSX_RETURN_OPT
+sox_format_t *
+LSX_API
+sox_open_write(
+    LSX_PARAM_IN_Z     char               const * path,     /**< Path to file to be written (required). */
+    LSX_PARAM_IN       sox_signalinfo_t   const * signal,   /**< Information about desired audio stream (required). */
+    LSX_PARAM_IN_OPT   sox_encodinginfo_t const * encoding, /**< Information about desired sample encoding, or NULL to use defaults. */
+    LSX_PARAM_IN_OPT_Z char               const * filetype, /**< Previously-determined file type, or NULL to auto-detect. */
+    LSX_PARAM_IN_OPT   sox_oob_t          const * oob,      /**< Out-of-band data to add to file, or NULL if none. */
+    LSX_PARAM_IN_OPT   sox_bool           (LSX_API * overwrite_permitted)(LSX_PARAM_IN_Z char const * filename) /**< Called if file exists to determine whether overwrite is ok. */
+    );
+
+/**
+Client API:
+Opens an encoding session for a memory buffer. Returned handle must be closed with sox_close().
+@returns The new session handle, or null on failure.
+*/
+LSX_RETURN_OPT
+sox_format_t *
+LSX_API
+sox_open_mem_write(
+    LSX_PARAM_OUT_BYTECAP(buffer_size) void                     * buffer,      /**< Pointer to audio data buffer that receives data (required). */
+    LSX_PARAM_IN                       size_t                     buffer_size, /**< Maximum number of bytes to write to audio data buffer. */
+    LSX_PARAM_IN                       sox_signalinfo_t   const * signal,      /**< Information about desired audio stream (required). */
+    LSX_PARAM_IN_OPT                   sox_encodinginfo_t const * encoding,    /**< Information about desired sample encoding, or NULL to use defaults. */
+    LSX_PARAM_IN_OPT_Z                 char               const * filetype,    /**< Previously-determined file type, or NULL to auto-detect. */
+    LSX_PARAM_IN_OPT                   sox_oob_t          const * oob          /**< Out-of-band data to add to file, or NULL if none. */
+    );
+
+/**
+Client API:
+Opens an encoding session for a memstream buffer. Returned handle must be closed with sox_close().
+@returns The new session handle, or null on failure.
+*/
+LSX_RETURN_OPT
+sox_format_t *
+LSX_API
+sox_open_memstream_write(
+    LSX_PARAM_OUT      char                     * * buffer_ptr,    /**< Receives pointer to audio data buffer that receives data (required). */
+    LSX_PARAM_OUT      size_t                   * buffer_size_ptr, /**< Receives size of data written to audio data buffer (required). */
+    LSX_PARAM_IN       sox_signalinfo_t   const * signal,          /**< Information about desired audio stream (required). */
+    LSX_PARAM_IN_OPT   sox_encodinginfo_t const * encoding,        /**< Information about desired sample encoding, or NULL to use defaults. */
+    LSX_PARAM_IN_OPT_Z char               const * filetype,        /**< Previously-determined file type, or NULL to auto-detect. */
+    LSX_PARAM_IN_OPT   sox_oob_t          const * oob              /**< Out-of-band data to add to file, or NULL if none. */
+    );
+
+/**
+Client API:
+Reads samples from a decoding session into a sample buffer.
+@returns Number of samples decoded, or 0 for EOF.
+*/
+size_t
+LSX_API
+sox_read(
+    LSX_PARAM_INOUT sox_format_t * ft, /**< Format pointer. */
+    LSX_PARAM_OUT_CAP_POST_COUNT(len,return) sox_sample_t *buf, /**< Buffer from which to read samples. */
+    size_t len /**< Number of samples available in buf. */
+    );
+
+/**
+Client API:
+Writes samples to an encoding session from a sample buffer.
+@returns Number of samples encoded.
+*/
+size_t
+LSX_API
+sox_write(
+    LSX_PARAM_INOUT sox_format_t * ft, /**< Format pointer. */
+    LSX_PARAM_IN_COUNT(len) sox_sample_t const * buf, /**< Buffer from which to read samples. */
+    size_t len /**< Number of samples available in buf. */
+    );
+
+/**
+Client API:
+Closes an encoding or decoding session.
+@returns SOX_SUCCESS if successful.
+*/
+int
+LSX_API
+sox_close(
+    LSX_PARAM_INOUT sox_format_t * ft /**< Format pointer. */
+    );
+
+/**
+Client API:
+Sets the location at which next samples will be decoded. Returns SOX_SUCCESS if successful.
+@returns SOX_SUCCESS if successful.
+*/
+int
+LSX_API
+sox_seek(
+    LSX_PARAM_INOUT sox_format_t * ft, /**< Format pointer. */
+    sox_uint64_t offset, /**< Sample offset at which to position reader. */
+    int whence /**< Set to SOX_SEEK_SET. */
+    );
+
+/**
+Client API:
+Finds a format handler by name.
+@returns Format handler data, or null if not found.
+*/
+LSX_RETURN_OPT
+sox_format_handler_t const *
+LSX_API
+sox_find_format(
+    LSX_PARAM_IN_Z char const * name, /**< Name of format handler to find. */
+    sox_bool ignore_devices /**< Set to true to ignore device names. */
+    );
+
+/**
+Client API:
+Returns global parameters for effects
+@returns global parameters for effects.
+*/
+LSX_RETURN_VALID LSX_RETURN_PURE
+sox_effects_globals_t *
+LSX_API
+sox_get_effects_globals(void);
+
+/**
+Client API:
+Deprecated macro that returns global parameters for effects.
+*/
+#define sox_effects_globals (*sox_get_effects_globals())
+
+/**
+Client API:
+Finds the effect handler with the given name.
+@returns Effect pointer, or null if not found.
+*/
+LSX_RETURN_OPT LSX_RETURN_PURE
+sox_effect_handler_t const *
+LSX_API
+sox_find_effect(
+    LSX_PARAM_IN_Z char const * name /**< Name of effect to find. */
+    );
+
+/**
+Client API:
+Creates an effect using the given handler.
+@returns The new effect, or null if not found.
+*/
+LSX_RETURN_OPT
+sox_effect_t *
+LSX_API
+sox_create_effect(
+    LSX_PARAM_IN sox_effect_handler_t const * eh /**< Handler to use for effect. */
+    );
+
+/**
+Client API:
+Applies the command-line options to the effect.
+@returns the number of arguments consumed.
+*/
+int
+LSX_API
+sox_effect_options(
+    LSX_PARAM_IN sox_effect_t *effp, /**< Effect pointer on which to set options. */
+    int argc, /**< Number of arguments in argv. */
+    LSX_PARAM_IN_COUNT(argc) char * const argv[] /**< Array of command-line options. */
+    );
+
+/**
+Client API:
+Returns an array containing the known effect handlers.
+@returns An array containing the known effect handlers.
+*/
+LSX_RETURN_VALID_Z LSX_RETURN_PURE
+sox_effect_fn_t const *
+LSX_API
+sox_get_effect_fns(void);
+
+/**
+Client API:
+Deprecated macro that returns an array containing the known effect handlers.
+*/
+#define sox_effect_fns (sox_get_effect_fns())
+
+/**
+Client API:
+Initializes an effects chain. Returned handle must be closed with sox_delete_effects_chain().
+@returns Handle, or null on failure.
+*/
+LSX_RETURN_OPT
+sox_effects_chain_t *
+LSX_API
+sox_create_effects_chain(
+    LSX_PARAM_IN sox_encodinginfo_t const * in_enc, /**< Input encoding. */
+    LSX_PARAM_IN sox_encodinginfo_t const * out_enc /**< Output encoding. */
+    );
+
+/**
+Client API:
+Closes an effects chain.
+*/
+void
+LSX_API
+sox_delete_effects_chain(
+    LSX_PARAM_INOUT sox_effects_chain_t *ecp /**< Effects chain pointer. */
+    );
+
+/**
+Client API:
+Adds an effect to the effects chain, returns SOX_SUCCESS if successful.
+@returns SOX_SUCCESS if successful.
+*/
+int
+LSX_API
+sox_add_effect(
+    LSX_PARAM_INOUT sox_effects_chain_t * chain, /**< Effects chain to which effect should be added . */
+    LSX_PARAM_INOUT sox_effect_t * effp, /**< Effect to be added. */
+    LSX_PARAM_INOUT sox_signalinfo_t * in, /**< Input format. */
+    LSX_PARAM_IN    sox_signalinfo_t const * out /**< Output format. */
+    );
+
+/**
+Client API:
+Runs the effects chain, returns SOX_SUCCESS if successful.
+@returns SOX_SUCCESS if successful.
+*/
+int
+LSX_API
+sox_flow_effects(
+    LSX_PARAM_INOUT  sox_effects_chain_t * chain, /**< Effects chain to run. */
+    LSX_PARAM_IN_OPT sox_flow_effects_callback callback, /**< Callback for monitoring flow progress. */
+    LSX_PARAM_IN_OPT void * client_data /**< Data to pass into callback. */
+    );
+
+/**
+Client API:
+Gets the number of clips that occurred while running an effects chain.
+@returns the number of clips that occurred while running an effects chain.
+*/
+sox_uint64_t
+LSX_API
+sox_effects_clips(
+    LSX_PARAM_IN sox_effects_chain_t * chain /**< Effects chain from which to read clip information. */
+    );
+
+/**
+Client API:
+Shuts down an effect (calls stop on each of its flows).
+@returns the number of clips from all flows.
+*/
+sox_uint64_t
+LSX_API
+sox_stop_effect(
+    LSX_PARAM_INOUT_COUNT(effp->flows) sox_effect_t * effp /**< Effect to stop. */
+    );
+
+/**
+Client API:
+Adds an already-initialized effect to the end of the chain.
+*/
+void
+LSX_API
+sox_push_effect_last(
+    LSX_PARAM_INOUT sox_effects_chain_t * chain, /**< Effects chain to which effect should be added. */
+    LSX_PARAM_INOUT sox_effect_t * effp /**< Effect to be added. */
+    );
+
+/**
+Client API:
+Removes and returns an effect from the end of the chain.
+@returns the removed effect, or null if no effects.
+*/
+LSX_RETURN_OPT
+sox_effect_t *
+LSX_API
+sox_pop_effect_last(
+    LSX_PARAM_INOUT sox_effects_chain_t *chain /**< Effects chain from which to remove an effect. */
+    );
+
+/**
+Client API:
+Shut down and delete an effect.
+*/
+void
+LSX_API
+sox_delete_effect(
+    LSX_PARAM_INOUT_COUNT(effp->flows) sox_effect_t *effp /**< Effect to be deleted. */
+    );
+
+/**
+Client API:
+Shut down and delete the last effect in the chain.
+*/
+void
+LSX_API
+sox_delete_effect_last(
+    LSX_PARAM_INOUT sox_effects_chain_t *chain /**< Effects chain from which to remove the last effect. */
+    );
+
+/**
+Client API:
+Shut down and delete all effects in the chain.
+*/
+void
+LSX_API
+sox_delete_effects(
+    LSX_PARAM_INOUT sox_effects_chain_t *chain /**< Effects chain from which to delete effects. */
+    );
+
+/**
+Client API:
+Gets the sample offset of the start of the trim, useful for efficiently
+skipping the part that will be trimmed anyway (get trim start, seek, then
+clear trim start).
+@returns the sample offset of the start of the trim.
+*/
+sox_uint64_t
+LSX_API
+sox_trim_get_start(
+    LSX_PARAM_IN sox_effect_t * effp /**< Trim effect. */
+    );
+
+/**
+Client API:
+Clears the start of the trim to 0.
+*/
+void
+LSX_API
+sox_trim_clear_start(
+    LSX_PARAM_INOUT sox_effect_t * effp /**< Trim effect. */
+    );
+
+/**
+Client API:
+Returns true if the specified file is a known playlist file type.
+@returns true if the specified file is a known playlist file type.
+*/
+sox_bool
+LSX_API
+sox_is_playlist(
+    LSX_PARAM_IN_Z char const * filename /**< Name of file to examine. */
+    );
+
+/**
+Client API:
+Parses the specified playlist file.
+@returns SOX_SUCCESS if successful.
+*/
+int
+LSX_API
+sox_parse_playlist(
+    LSX_PARAM_IN sox_playlist_callback_t callback, /**< Callback to call for each item in the playlist. */
+    void * p, /**< Data to pass to callback. */
+    LSX_PARAM_IN char const * const listname /**< Filename of playlist file. */
+    );
+
+/**
+Client API:
+Converts a SoX error code into an error string.
+@returns error string corresponding to the specified error code,
+or a generic message if the error code is not recognized.
+*/
+LSX_RETURN_VALID_Z LSX_RETURN_PURE
+char const *
+LSX_API
+sox_strerror(
+    int sox_errno /**< Error code to look up. */
+    );
+
+/**
+Client API:
+Gets the basename of the specified file; for example, the basename of
+"/a/b/c.d" would be "c".
+@returns the number of characters written to base_buffer, excluding the null,
+or 0 on failure.
+*/
+size_t
+LSX_API
+sox_basename(
+    LSX_PARAM_OUT_Z_CAP_POST_COUNT(base_buffer_len,return) char * base_buffer, /**< Buffer into which basename should be written. */
+    size_t base_buffer_len, /**< Size of base_buffer, in bytes. */
+    LSX_PARAM_IN_Z char const * filename /**< Filename from which to extract basename. */
+    );
+
+/*****************************************************************************
+Internal API:
+WARNING - The items in this section are subject to instability. They only
+exist in the public header because sox (the application) currently uses them.
+These may be changed or removed in future versions of libSoX.
+*****************************************************************************/
+
+/**
+Plugins API:
+Print a fatal error in libSoX.
+*/
+void
+LSX_API
+lsx_fail_impl(
+    LSX_PARAM_IN_PRINTF char const * fmt, /**< printf-style format string. */
+    ...)
+    LSX_PRINTF12;
+
+/**
+Plugins API:
+Print a warning in libSoX.
+*/
+void
+LSX_API
+lsx_warn_impl(
+    LSX_PARAM_IN_PRINTF char const * fmt, /**< printf-style format string. */
+    ...)
+    LSX_PRINTF12;
+
+/**
+Plugins API:
+Print an informational message in libSoX.
+*/
+void
+LSX_API
+lsx_report_impl(
+    LSX_PARAM_IN_PRINTF char const * fmt, /**< printf-style format string. */
+    ...)
+    LSX_PRINTF12;
+
+/**
+Plugins API:
+Print a debug message in libSoX.
+*/
+void
+LSX_API
+lsx_debug_impl(
+    LSX_PARAM_IN_PRINTF char const * fmt, /**< printf-style format string. */
+    ...)
+    LSX_PRINTF12;
+
+/**
+Plugins API:
+Report a fatal error in libSoX; printf-style arguments must follow.
+*/
+#define lsx_fail       sox_get_globals()->subsystem=__FILE__,lsx_fail_impl
+
+/**
+Plugins API:
+Report a warning in libSoX; printf-style arguments must follow.
+*/
+#define lsx_warn       sox_get_globals()->subsystem=__FILE__,lsx_warn_impl
+
+/**
+Plugins API:
+Report an informational message in libSoX; printf-style arguments must follow.
+*/
+#define lsx_report     sox_get_globals()->subsystem=__FILE__,lsx_report_impl
+
+/**
+Plugins API:
+Report a debug message in libSoX; printf-style arguments must follow.
+*/
+#define lsx_debug      sox_get_globals()->subsystem=__FILE__,lsx_debug_impl
+
+/**
+Plugins API:
+String name and integer values for enumerated types (type metadata), for use
+with LSX_ENUM_ITEM, lsx_find_enum_text, and lsx_find_enum_value.
+*/
+typedef struct lsx_enum_item {
+    char const *text; /**< String name of enumeration. */
+    unsigned value;   /**< Integer value of enumeration. */
+} lsx_enum_item;
+
+/**
+Plugins API:
+Declares a static instance of an lsx_enum_item structure in format
+{ "item", prefixitem }, for use in declaring lsx_enum_item[] arrays.
+@param prefix The prefix to prepend to the item in the enumeration symbolic name.
+@param item   The user-visible text name of the item (must also be a valid C symbol name).
+*/
+#define LSX_ENUM_ITEM(prefix, item) {#item, prefix##item},
+
+/**
+Plugins API:
+Flags for use with lsx_find_enum_item.
+*/
+enum
+{
+    lsx_find_enum_item_none = 0, /**< Default parameters (case-insensitive). */
+    lsx_find_enum_item_case_sensitive = 1 /**< Enable case-sensitive search. */
+};
+
+/**
+Plugins API:
+Looks up an enumeration by name in an array of lsx_enum_items.
+@returns the corresponding item, or null if not found.
+*/
+LSX_RETURN_OPT LSX_RETURN_PURE
+lsx_enum_item const *
+LSX_API
+lsx_find_enum_text(
+    LSX_PARAM_IN_Z char const * text, /**< Name of enumeration to find. */
+    LSX_PARAM_IN lsx_enum_item const * lsx_enum_items, /**< Array of items to search, with text == NULL for last item. */
+    int flags /**< Search flags: 0 (case-insensitive) or lsx_find_enum_item_case_sensitive (case-sensitive). */
+    );
+
+/**
+Plugins API:
+Looks up an enumeration by value in an array of lsx_enum_items.
+@returns the corresponding item, or null if not found.
+*/
+LSX_RETURN_OPT LSX_RETURN_PURE
+lsx_enum_item const *
+LSX_API
+lsx_find_enum_value(
+    unsigned value, /**< Enumeration value to find. */
+    LSX_PARAM_IN lsx_enum_item const * lsx_enum_items /**< Array of items to search, with text == NULL for last item. */
+    );
+
+/**
+Plugins API:
+Looks up a command-line argument in a set of enumeration names, showing an
+error message if the argument is not found in the set of names.
+@returns The enumeration value corresponding to the matching enumeration, or
+INT_MAX if the argument does not match any enumeration name.
+*/
+LSX_RETURN_PURE
+int
+LSX_API
+lsx_enum_option(
+    int c, /**< Option character to which arg is associated, for example with -a, c would be 'a'. */
+    LSX_PARAM_IN_Z char const * arg, /**< Argument to find in enumeration list. */
+    LSX_PARAM_IN lsx_enum_item const * items /**< Array of items to search, with text == NULL for last item. */
+    );
+
+/**
+Plugins API:
+Determines whether the specified string ends with the specified suffix (case-sensitive).
+@returns true if the specified string ends with the specified suffix.
+*/
+LSX_RETURN_PURE
+sox_bool
+LSX_API
+lsx_strends(
+    LSX_PARAM_IN_Z char const * str, /**< String to search. */
+    LSX_PARAM_IN_Z char const * end  /**< Suffix to search for. */
+    );
+
+/**
+Plugins API:
+Finds the file extension for a filename.
+@returns the file extension, not including the '.', or null if filename does
+not have an extension.
+*/
+LSX_RETURN_VALID_Z LSX_RETURN_PURE
+char const *
+LSX_API
+lsx_find_file_extension(
+    LSX_PARAM_IN_Z char const * pathname /**< Filename to search for extension. */
+    );
+
+/**
+Plugins API:
+Formats the specified number with up to three significant figures and adds a
+metric suffix in place of the exponent, such as 1.23G.
+@returns A static buffer with the formatted number, valid until the next time
+this function is called (note: not thread safe).
+*/
+LSX_RETURN_VALID_Z
+char const *
+LSX_API
+lsx_sigfigs3(
+    double number /**< Number to be formatted. */
+    );
+
+/**
+Plugins API:
+Formats the specified number as a percentage, showing up to three significant
+figures.
+@returns A static buffer with the formatted number, valid until the next time
+this function is called (note: not thread safe).
+*/
+LSX_RETURN_VALID_Z
+char const *
+LSX_API
+lsx_sigfigs3p(
+    double percentage /**< Number to be formatted. */
+    );
+
+/**
+Plugins API:
+Allocates, deallocates, or resizes; like C's realloc, except that this version
+terminates the running application if unable to allocate the requested memory.
+@returns New buffer, or null if buffer was freed.
+*/
+LSX_RETURN_OPT
+void *
+LSX_API
+lsx_realloc(
+    LSX_PARAM_IN_OPT void *ptr, /**< Pointer to be freed or resized, or null if allocating a new buffer. */
+    size_t newsize /**< New size for buffer, or 0 to free the buffer. */
+    );
+
+/**
+Plugins API:
+Like strcmp, except that the characters are compared without regard to case.
+@returns 0 (s1 == s2), negative (s1 < s2), or positive (s1 > s2).
+*/
+LSX_RETURN_PURE
+int
+LSX_API
+lsx_strcasecmp(
+    LSX_PARAM_IN_Z char const * s1, /**< First string. */
+    LSX_PARAM_IN_Z char const * s2  /**< Second string. */
+    );
+
+
+/**
+Plugins API:
+Like strncmp, except that the characters are compared without regard to case.
+@returns 0 (s1 == s2), negative (s1 < s2), or positive (s1 > s2).
+*/
+LSX_RETURN_PURE
+int
+LSX_API
+lsx_strncasecmp(
+    LSX_PARAM_IN_Z char const * s1, /**< First string. */
+    LSX_PARAM_IN_Z char const * s2, /**< Second string. */
+    size_t n /**< Maximum number of characters to examine. */
+    );
+
+/**
+Plugins API:
+Is option argument unsupported, required, or optional.
+*/
+typedef enum lsx_option_arg_t {
+    lsx_option_arg_none, /**< Option does not have an argument. */
+    lsx_option_arg_required, /**< Option requires an argument. */
+    lsx_option_arg_optional /**< Option can optionally be followed by an argument. */
+} lsx_option_arg_t;
+
+/**
+Plugins API:
+lsx_getopt_init options.
+*/
+typedef enum lsx_getopt_flags_t {
+    lsx_getopt_flag_none = 0,      /**< no flags (no output, not long-only) */
+    lsx_getopt_flag_opterr = 1,    /**< if set, invalid options trigger lsx_warn output */
+    lsx_getopt_flag_longonly = 2   /**< if set, recognize -option as a long option */
+} lsx_getopt_flags_t;
+
+/**
+Plugins API:
+lsx_getopt long option descriptor.
+*/
+typedef struct lsx_option_t {
+    char const *     name;    /**< Name of the long option. */
+    lsx_option_arg_t has_arg; /**< Whether the long option supports an argument and, if so, whether the argument is required or optional. */
+    int *            flag;    /**< Flag to set if argument is present. */
+    int              val;     /**< Value to put in flag if argument is present. */
+} lsx_option_t;
+
+/**
+Plugins API:
+lsx_getopt session information (initialization data and state).
+*/
+typedef struct lsx_getopt_t {
+    int                  argc;     /**< IN    argc:      Number of arguments in argv */
+    char * const *       argv;     /**< IN    argv:      Array of arguments */
+    char const *         shortopts;/**< IN    shortopts: Short option characters */
+    lsx_option_t const * longopts; /**< IN    longopts:  Array of long option descriptors */
+    lsx_getopt_flags_t   flags;    /**< IN    flags:     Flags for longonly and opterr */
+    char const *         curpos;   /**< INOUT curpos:    Maintains state between calls to lsx_getopt */
+    int                  ind;      /**< INOUT optind:    Maintains the index of next element to be processed */
+    int                  opt;      /**< OUT   optopt:    Receives the option character that caused error */
+    char const *         arg;      /**< OUT   optarg:    Receives the value of the option's argument */
+    int                  lngind;   /**< OUT   lngind:    Receives the index of the matched long option or -1 if not a long option */
+} lsx_getopt_t;
+
+/**
+Plugins API:
+Initializes an lsx_getopt_t structure for use with lsx_getopt.
+*/
+void
+LSX_API
+lsx_getopt_init(
+    LSX_PARAM_IN             int argc,                      /**< Number of arguments in argv */
+    LSX_PARAM_IN_COUNT(argc) char * const * argv,           /**< Array of arguments */
+    LSX_PARAM_IN_Z           char const * shortopts,        /**< Short options, for example ":abc:def::ghi" (+/- not supported) */
+    LSX_PARAM_IN_OPT         lsx_option_t const * longopts, /**< Array of long option descriptors */
+    LSX_PARAM_IN             lsx_getopt_flags_t flags,      /**< Flags for longonly and opterr */
+    LSX_PARAM_IN             int first,                     /**< First argv to check (usually 1) */
+    LSX_PARAM_OUT            lsx_getopt_t * state           /**< State object to be initialized */
+    );
+
+/**
+Plugins API:
+Gets the next option. Options are parameters that start with "-" or "--".
+If no more options, returns -1. If unrecognized short option, returns '?'.
+If a recognized short option is missing a required argument,
+return (shortopts[0]==':' ? ':' : '?'). If successfully recognized short
+option, return the recognized character. If successfully recognized long
+option, returns (option.flag ? 0 : option.val).
+Note: lsx_getopt does not permute the non-option arguments.
+@returns option character (short), val or 0 (long), or -1 (no more).
+*/
+int
+LSX_API
+lsx_getopt(
+    LSX_PARAM_INOUT lsx_getopt_t * state /**< The getopt state pointer. */
+    );
+
+/* WARNING END */
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif /* SOX_H */
diff --git a/freedv-dev/src/sox_biquad.c b/freedv-dev/src/sox_biquad.c
new file mode 100644 (file)
index 0000000..f5a0913
--- /dev/null
@@ -0,0 +1,129 @@
+//==========================================================================
+// Name:            sox_biquad.h
+// Purpose:         Interface into Sox Biquad filters 
+// Created:         Dec 1, 2012
+// Authors:         David Rowe
+// 
+// To test:
+//          $ gcc sox_biquad.c -o sox_biquad -DSOX_BIQUAD_UNITTEST -Wall \
+//            /path/to/sox-14.4.0/src/.libs/libsox.a -lm -lsndfile
+//          $ ./sox_biquad
+//
+// 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+
+#include <assert.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include "sox.h"
+
+#include "sox_biquad.h"
+
+
+#define N_MAX 1024
+
+int lsx_biquad_flow(sox_effect_t * effp, const sox_sample_t *ibuf,
+                    sox_sample_t *obuf, size_t *isamp, size_t *osamp);
+
+void sox_biquad_start(void)
+{
+    int r = sox_init();
+    assert(r == SOX_SUCCESS);
+}
+
+void sox_biquad_finish(void)
+{
+    sox_quit();
+}
+
+/*
+  Effect must be implemented by biquads.c in sox, arguments are just
+  like sox command line, for example:
+
+  char *argv[10];
+  argv[0] = "highpass"; argv[1]="1000"; argc=1;
+*/
+
+void *sox_biquad_create(int argc, const char *argv[])
+{
+    int ret;
+    sox_effect_t *e;
+    int (*start)(sox_effect_t *); /* function pointer to effect start func */
+    
+    e = sox_create_effect(sox_find_effect(argv[0])); assert(e != NULL);
+    ret = sox_effect_options(e, argc, (char * const*)&argv[1]);
+    assert(ret == SOX_SUCCESS);
+
+    start = e->handler.start;
+    e->in_signal.rate = 8000;     /* locked at FS=8000 Hz */
+    ret = start(e); assert(ret == SOX_SUCCESS);
+    
+    return (void *)e;
+}
+
+void sox_biquad_destroy(void *sbq) {
+    sox_effect_t *e = (sox_effect_t *)sbq;
+    free(e);
+}
+
+void sox_biquad_filter(void *sbq, short out[], short in[], int n)
+{
+    sox_effect_t *e = (sox_effect_t *)sbq;
+    sox_sample_t ibuf[N_MAX];
+    sox_sample_t obuf[N_MAX];
+    size_t isamp, osamp;
+    unsigned int clips;
+    SOX_SAMPLE_LOCALS; 
+    int i;
+
+    assert(n <= N_MAX);
+
+    clips = 0;
+    for(i=0; i<n; i++)
+        ibuf[i] = SOX_SIGNED_16BIT_TO_SAMPLE(in[i], clips);
+    isamp = osamp = (unsigned int)n;
+    lsx_biquad_flow(e, ibuf, obuf, &isamp, &osamp);
+    for(i=0; i<n; i++)
+        out[i] = SOX_SAMPLE_TO_SIGNED_16BIT(obuf[i], clips); 
+}
+
+
+#ifdef SOX_BIQUAD_UNITTEST
+#define N 20
+int main(void) {
+    void *sbq;
+    char *argv[10];
+    short in[N];
+    short out[N];
+    int   i, argc;;
+
+    for(i=0; i<N; i++)
+        in[i] = 0;
+    in[0] = 8000;
+
+    sox_biquad_start();
+    argv[0] = "highpass"; argv[1]="1000"; argc=1;
+    sbq = sox_biquad_create(argc, argv);
+
+    sox_biquad_filter(sbq, out, in, N);
+    for(i=0; i<N; i++)
+        printf("%d\n", out[i]);
+   
+    sox_biquad_destroy(sbq);
+    sox_biquad_finish();
+
+    return 0;
+}
+#endif
diff --git a/freedv-dev/src/sox_biquad.h b/freedv-dev/src/sox_biquad.h
new file mode 100644 (file)
index 0000000..f38de64
--- /dev/null
@@ -0,0 +1,40 @@
+//==========================================================================
+// Name:            sox_biquad.h
+// Purpose:         Interface into Sox Biquad filters 
+// Created:         Dec 1, 2012
+// Authors:         David Rowe
+// 
+// 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+
+#ifndef __SOX_BIQUAD__
+#define __SOX_BIQUAD__
+
+#ifdef __cplusplus
+extern "C" {
+
+#endif
+
+void sox_biquad_start(void);
+void sox_biquad_finish(void);
+void *sox_biquad_create(int argc, const char *argv[]);
+void sox_biquad_destroy(void *sbq);
+void sox_biquad_filter(void *sbq, short out[], short in[], int n);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/freedv-dev/src/topFrame.cpp b/freedv-dev/src/topFrame.cpp
new file mode 100644 (file)
index 0000000..e9ca34f
--- /dev/null
@@ -0,0 +1,553 @@
+//==========================================================================
+// Name:            topFrame.cpp
+//
+// Purpose:         Implements simple wxWidgets application with GUI.
+// Created:         Apr. 9, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#include "topFrame.h"
+
+extern int g_playFileToMicInEventId;
+extern int g_recFileFromRadioEventId;
+extern int g_playFileFromRadioEventId;
+
+//=========================================================================
+// Code that lays out the main application window
+//=========================================================================
+TopFrame::TopFrame(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxFrame(parent, id, title, pos, size, style)
+{
+    this->SetSizeHints(wxDefaultSize, wxDefaultSize);
+    this->SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
+    this->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DLIGHT));
+    this->SetSizeHints(wxDefaultSize, wxDefaultSize);
+    this->SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
+    this->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DLIGHT));
+    //=====================================================
+    // Menubar Setup
+    m_menubarMain = new wxMenuBar(wxMB_DOCKABLE);
+    file = new wxMenu();
+
+    wxMenuItem* m_menuItemOnTop;
+    m_menuItemOnTop = new wxMenuItem(file, wxID_ANY, wxString(_("On Top")) , _("Always Top Window"), wxITEM_NORMAL);
+    file->Append(m_menuItemOnTop);
+
+    wxMenuItem* m_menuItemExit;
+    m_menuItemExit = new wxMenuItem(file, ID_EXIT, wxString(_("E&xit")) , _("Exit Program"), wxITEM_NORMAL);
+    file->Append(m_menuItemExit);
+
+    m_menubarMain->Append(file, _("&File"));
+
+    tools = new wxMenu();
+    wxMenuItem* m_menuItemAudio;
+    m_menuItemAudio = new wxMenuItem(tools, wxID_ANY, wxString(_("&Audio Config")) , wxEmptyString, wxITEM_NORMAL);
+    tools->Append(m_menuItemAudio);
+
+    wxMenuItem* m_menuItemRigCtrlCfg;
+    m_menuItemRigCtrlCfg = new wxMenuItem(tools, wxID_ANY, wxString(_("&PTT Config")) , wxEmptyString, wxITEM_NORMAL);
+    tools->Append(m_menuItemRigCtrlCfg);
+
+    wxMenuItem* m_menuItemOptions;
+    m_menuItemOptions = new wxMenuItem(tools, wxID_ANY, wxString(_("Options")) , wxEmptyString, wxITEM_NORMAL);
+    tools->Append(m_menuItemOptions);
+
+    wxMenuItem* m_menuItemFilter;
+    m_menuItemFilter = new wxMenuItem(tools, wxID_ANY, wxString(_("&Filter")) , wxEmptyString, wxITEM_NORMAL);
+    tools->Append(m_menuItemFilter);
+
+    wxMenuItem* m_menuItemPlayFileToMicIn;
+    m_menuItemPlayFileToMicIn = new wxMenuItem(tools, wxID_ANY, wxString(_("Start/Stop Play File - Mic In")) , wxEmptyString, wxITEM_NORMAL);
+    g_playFileToMicInEventId = m_menuItemPlayFileToMicIn->GetId();
+    tools->Append(m_menuItemPlayFileToMicIn);
+
+    wxMenuItem* m_menuItemRecFileFromRadio;
+    m_menuItemRecFileFromRadio = new wxMenuItem(tools, wxID_ANY, wxString(_("Start/Stop Record File - From Radio")) , wxEmptyString, wxITEM_NORMAL);
+    g_recFileFromRadioEventId = m_menuItemRecFileFromRadio->GetId();
+    tools->Append(m_menuItemRecFileFromRadio);
+
+    wxMenuItem* m_menuItemPlayFileFromRadio;
+    m_menuItemPlayFileFromRadio = new wxMenuItem(tools, wxID_ANY, wxString(_("Start/Stop Play File - From Radio")) , wxEmptyString, wxITEM_NORMAL);
+    g_playFileFromRadioEventId = m_menuItemPlayFileFromRadio->GetId();
+    tools->Append(m_menuItemPlayFileFromRadio);
+    m_menubarMain->Append(tools, _("&Tools"));
+
+    help = new wxMenu();
+    wxMenuItem* m_menuItemHelpUpdates;
+    m_menuItemHelpUpdates = new wxMenuItem(help, wxID_ANY, wxString(_("Check for Updates")) , wxEmptyString, wxITEM_NORMAL);
+    help->Append(m_menuItemHelpUpdates);
+    m_menuItemHelpUpdates->Enable(false);
+
+    wxMenuItem* m_menuItemAbout;
+    m_menuItemAbout = new wxMenuItem(help, ID_ABOUT, wxString(_("&About")) , _("About this program"), wxITEM_NORMAL);
+    help->Append(m_menuItemAbout);
+
+    m_menubarMain->Append(help, _("&Help"));
+
+    this->SetMenuBar(m_menubarMain);
+
+    wxBoxSizer* bSizer1;
+    bSizer1 = new wxBoxSizer(wxHORIZONTAL);
+
+    //=====================================================
+    // Left side
+    //=====================================================
+    wxBoxSizer* leftSizer;
+    leftSizer = new wxBoxSizer(wxVERTICAL);
+
+    wxStaticBoxSizer* snrSizer;
+    snrSizer = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("SNR")), wxVERTICAL);
+
+    //------------------------------
+    // S/N ratio Guage (vert. bargraph)
+    //------------------------------
+    m_gaugeSNR = new wxGauge(this, wxID_ANY, 25, wxDefaultPosition, wxSize(15,135), wxGA_SMOOTH|wxGA_VERTICAL);
+    m_gaugeSNR->SetToolTip(_("Displays signal to noise ratio in dB."));
+    snrSizer->Add(m_gaugeSNR, 1, wxALIGN_CENTER_HORIZONTAL|wxALL, 10);
+
+    //------------------------------
+    // Box for S/N ratio (Numeric)
+    //------------------------------
+    m_textSNR = new wxStaticText(this, wxID_ANY, wxT(" 0.0"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE);
+    snrSizer->Add(m_textSNR, 0, wxALIGN_CENTER_HORIZONTAL, 1);
+
+    //------------------------------
+    // S/N ratio slow Checkbox
+    //------------------------------
+    m_ckboxSNR = new wxCheckBox(this, wxID_ANY, _("Slow"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
+    m_ckboxSNR->SetToolTip(_("Smooth but slow SNR estimation"));
+    snrSizer->Add(m_ckboxSNR, 0, wxALIGN_CENTER_HORIZONTAL, 5);
+
+    leftSizer->Add(snrSizer, 2, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxALL, 1);
+
+    //------------------------------
+    // Sync  Indicator box
+    //------------------------------
+    wxStaticBoxSizer* sbSizer3_33;
+    sbSizer3_33 = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Sync")), wxVERTICAL);
+
+    m_rbSync = new wxRadioButton( this, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
+    m_rbSync->SetForegroundColour( wxColour( 255, 0, 0 ) );
+    sbSizer3_33->Add(m_rbSync, 0, wxALIGN_CENTER|wxALL, 1);
+    leftSizer->Add(sbSizer3_33,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
+
+    //------------------------------
+    // BER Frames box
+    //------------------------------
+
+    wxStaticBoxSizer* sbSizer_ber;
+    sbSizer_ber = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Bit Error Rate")), wxVERTICAL);
+
+    m_BtnBerReset = new wxButton(this, wxID_ANY, _("Reset"), wxDefaultPosition, wxDefaultSize, 0);
+    sbSizer_ber->Add(m_BtnBerReset, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
+
+    m_textBits = new wxStaticText(this, wxID_ANY, wxT("Bits: 0"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
+    sbSizer_ber->Add(m_textBits, 0, wxALIGN_LEFT, 1);
+    m_textErrors = new wxStaticText(this, wxID_ANY, wxT("Errs: 0"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
+    sbSizer_ber->Add(m_textErrors, 0, wxALIGN_LEFT, 1);
+    m_textBER = new wxStaticText(this, wxID_ANY, wxT("BER: 0.0"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
+    sbSizer_ber->Add(m_textBER, 0, wxALIGN_LEFT, 1);
+
+    leftSizer->Add(sbSizer_ber,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
+
+    //------------------------------
+    // Signal Level(vert. bargraph)
+    //------------------------------
+    wxStaticBoxSizer* levelSizer;
+    levelSizer = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Level")), wxVERTICAL);
+
+    m_textLevel = new wxStaticText(this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(60,-1), wxALIGN_CENTRE);
+    m_textLevel->SetForegroundColour(wxColour(255,0,0));
+    levelSizer->Add(m_textLevel, 0, wxALIGN_LEFT, 1);
+
+    m_gaugeLevel = new wxGauge(this, wxID_ANY, 100, wxDefaultPosition, wxSize(15,135), wxGA_SMOOTH|wxGA_VERTICAL);
+    m_gaugeLevel->SetToolTip(_("Peak of From Radio in Rx, or peak of From Mic in Tx mode.  If Red you should reduce your levels"));
+    levelSizer->Add(m_gaugeLevel, 1, wxALIGN_CENTER_HORIZONTAL|wxALL, 10);
+
+    leftSizer->Add(levelSizer, 2, wxALIGN_CENTER|wxALL|wxEXPAND, 1);
+
+    bSizer1->Add(leftSizer, 0, wxALL|wxEXPAND, 5);
+
+    //=====================================================
+    // Center Section
+    //=====================================================
+    wxBoxSizer* centerSizer;
+    centerSizer = new wxBoxSizer(wxVERTICAL);
+    wxBoxSizer* upperSizer;
+    upperSizer = new wxBoxSizer(wxVERTICAL);
+
+    //=====================================================
+    // Tabbed Notebook control containing display graphs
+    //=====================================================
+    //m_auiNbookCtrl = new wxAuiNotebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_NB_BOTTOM|wxAUI_NB_DEFAULT_STYLE);
+    //long style = wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_MOVE | wxAUI_NB_SCROLL_BUTTONS | wxAUI_NB_CLOSE_ON_ACTIVE_TAB | wxAUI_NB_MIDDLE_CLICK_CLOSE;
+    long nb_style = wxAUI_NB_BOTTOM | wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_MOVE | wxAUI_NB_SCROLL_BUTTONS;
+    m_auiNbookCtrl = new wxAuiNotebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, nb_style);
+    // This line sets the fontsize for the tabs on the notebook control
+    m_auiNbookCtrl->SetFont(wxFont(8, 70, 90, 90, false, wxEmptyString));
+
+    upperSizer->Add(m_auiNbookCtrl, 1, wxALIGN_TOP|wxEXPAND, 1);
+    centerSizer->Add(upperSizer, 1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALIGN_TOP|wxEXPAND, 0);
+
+    // lower middle used for user ID
+
+    wxBoxSizer* lowerSizer;
+    lowerSizer = new wxBoxSizer(wxHORIZONTAL);
+
+    m_BtnCallSignReset = new wxButton(this, wxID_ANY, _("Clear"), wxDefaultPosition, wxDefaultSize, 0);
+    lowerSizer->Add(m_BtnCallSignReset, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
+
+    wxBoxSizer* bSizer15;
+    bSizer15 = new wxBoxSizer(wxVERTICAL);
+    m_txtCtrlCallSign = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
+    m_txtCtrlCallSign->SetToolTip(_("Call Sign of transmitting station will appear here"));
+    bSizer15->Add(m_txtCtrlCallSign, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 5);
+    lowerSizer->Add(bSizer15, 1, wxEXPAND, 5);
+
+    wxStaticBoxSizer* sbSizer_Checksum = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Checksums")), wxHORIZONTAL);
+
+    wxStaticText *goodLabel = new wxStaticText(this, wxID_ANY, wxT("Good: "), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE);
+    sbSizer_Checksum->Add(goodLabel, 0, 0, 2);
+    m_txtChecksumGood = new wxStaticText(this, wxID_ANY, wxT("0"), wxDefaultPosition, wxSize(30,-1), wxALIGN_CENTRE);
+    sbSizer_Checksum->Add(m_txtChecksumGood, 0, 0, 2);
+
+    wxStaticText *badLabel = new wxStaticText(this, wxID_ANY, wxT("Bad: "), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE);
+    sbSizer_Checksum->Add(badLabel, 0, 0, 1);
+    m_txtChecksumBad = new wxStaticText(this, wxID_ANY, wxT("0"), wxDefaultPosition, wxSize(30,-1), wxALIGN_CENTRE);
+    sbSizer_Checksum->Add(m_txtChecksumBad, 0, 0, 1);
+
+    lowerSizer->Add(sbSizer_Checksum, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
+
+    //=====================================================
+    // These are the buttons that autosend the userid (?)
+    //=====================================================
+
+    // DR 4 Dec - taken off for screen for Beta release to avoid questions on their use until
+    // we implement this feature
+ #ifdef UNIMPLEMENTED
+    wxBoxSizer* bSizer141;
+    bSizer141 = new wxBoxSizer(wxHORIZONTAL);
+
+    // TxID
+    //---------
+    m_togTxID = new wxToggleButton(this, wxID_ANY, _("TxID"), wxDefaultPosition, wxDefaultSize, 0);
+    m_togTxID->SetToolTip(_("Send Tx ID information"));
+    bSizer141->Add(m_togTxID, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
+
+    // RxID
+    //---------
+    m_togRxID = new wxToggleButton(this, wxID_ANY, _("RxID"), wxDefaultPosition, wxDefaultSize, 0);
+    m_togRxID->SetToolTip(_("Enable reception of ID information"));
+    bSizer141->Add(m_togRxID, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_LEFT|wxALL|wxFIXED_MINSIZE, 5);
+
+    lowerSizer->Add(bSizer141, 0, wxALIGN_RIGHT, 5);
+#endif
+
+    centerSizer->Add(lowerSizer, 0, wxALIGN_BOTTOM|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 2);
+    bSizer1->Add(centerSizer, 4, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 1);
+
+    //=====================================================
+    // Right side
+    //=====================================================
+    wxBoxSizer* rightSizer;
+    rightSizer = new wxBoxSizer(wxVERTICAL);
+
+    //=====================================================
+    // Squelch Slider Control
+    //=====================================================
+    wxStaticBoxSizer* sbSizer3;
+    sbSizer3 = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Squelch")), wxVERTICAL);
+
+    m_sliderSQ = new wxSlider(this, wxID_ANY, 0, 0, 40, wxDefaultPosition, wxSize(-1,80), wxSL_AUTOTICKS|wxSL_INVERSE|wxSL_VERTICAL);
+    m_sliderSQ->SetToolTip(_("Set Squelch level in dB."));
+
+    sbSizer3->Add(m_sliderSQ, 1, wxALIGN_CENTER_HORIZONTAL, 0);
+
+    //------------------------------
+    // Squelch Level static text box
+    //------------------------------
+    m_textSQ = new wxStaticText(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE);
+
+    sbSizer3->Add(m_textSQ, 0, wxALIGN_CENTER_HORIZONTAL, 0);
+
+    //------------------------------
+    // Squelch Toggle Checkbox
+    //------------------------------
+    m_ckboxSQ = new wxCheckBox(this, wxID_ANY, _(""), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
+
+    sbSizer3->Add(m_ckboxSQ, 0, wxALIGN_CENTER_HORIZONTAL, 0);
+    rightSizer->Add(sbSizer3, 2, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 0);
+
+    //rightSizer->Add(sbSizer3_33,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
+
+    /* new --- */
+
+    //------------------------------
+    // Mode box
+    //------------------------------
+    wxStaticBoxSizer* sbSizer_mode;
+    sbSizer_mode = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Mode")), wxVERTICAL);
+
+#ifdef DISABLED_FEATURE
+    m_rb1400old = new wxRadioButton( this, wxID_ANY, wxT("1400 V0.91"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
+    sbSizer_mode->Add(m_rb1400old, 0, wxALIGN_LEFT|wxALL, 1);
+    m_rb1400 = new wxRadioButton( this, wxID_ANY, wxT("1400"), wxDefaultPosition, wxDefaultSize, 0);
+    sbSizer_mode->Add(m_rb1400, 0, wxALIGN_LEFT|wxALL, 1);
+#endif
+    m_rb700 = new wxRadioButton( this, wxID_ANY, wxT("700"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
+    sbSizer_mode->Add(m_rb700, 0, wxALIGN_LEFT|wxALL, 1);
+    m_rb700b = new wxRadioButton( this, wxID_ANY, wxT("700B"), wxDefaultPosition, wxDefaultSize, 0);
+    sbSizer_mode->Add(m_rb700b, 0, wxALIGN_LEFT|wxALL, 1);
+    m_rb1600 = new wxRadioButton( this, wxID_ANY, wxT("1600"), wxDefaultPosition, wxDefaultSize, 0);
+    sbSizer_mode->Add(m_rb1600, 0, wxALIGN_LEFT|wxALL, 1);
+    m_rb1600->SetValue(true);
+#ifdef DISABLED_FEATURE
+    m_rb1600Wide = new wxRadioButton( this, wxID_ANY, wxT("1600 Wide"), wxDefaultPosition, wxDefaultSize, 0);
+    sbSizer_mode->Add(m_rb1600Wide, 0, wxALIGN_LEFT|wxALL, 1);
+    m_rb2000 = new wxRadioButton( this, wxID_ANY, wxT("2000"), wxDefaultPosition, wxDefaultSize, 0);
+    sbSizer_mode->Add(m_rb2000, 0, wxALIGN_LEFT|wxALL, 1);
+#endif
+
+    rightSizer->Add(sbSizer_mode,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
+
+    #ifdef MOVED_TO_OPTIONS_DIALOG
+    /* new --- */
+
+    //------------------------------
+    // Test Frames box
+    //------------------------------
+
+    wxStaticBoxSizer* sbSizer_testFrames;
+    sbSizer_testFrames = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Test Frames")), wxVERTICAL);
+
+    m_ckboxTestFrame = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
+    sbSizer_testFrames->Add(m_ckboxTestFrame, 0, wxALIGN_LEFT, 0);
+
+    rightSizer->Add(sbSizer_testFrames,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
+    #endif
+
+    //=====================================================
+    // Control Toggles box
+    //=====================================================
+    wxStaticBoxSizer* sbSizer5;
+    sbSizer5 = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Control")), wxVERTICAL);
+    wxBoxSizer* bSizer1511;
+    bSizer1511 = new wxBoxSizer(wxVERTICAL);
+
+    //-------------------------------
+    // Stop/Stop signal processing (rx and tx)
+    //-------------------------------
+    m_togBtnOnOff = new wxToggleButton(this, wxID_ANY, _("Start"), wxDefaultPosition, wxDefaultSize, 0);
+    m_togBtnOnOff->SetToolTip(_("Begin/End receiving data."));
+    bSizer1511->Add(m_togBtnOnOff, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
+    sbSizer5->Add(bSizer1511, 0, wxEXPAND, 1);
+
+#ifdef UNIMPLEMENTED
+    //------------------------------
+    // Toggle Loopback button for RX
+    //------------------------------
+    wxBoxSizer* bSizer15113;
+    bSizer15113 = new wxBoxSizer(wxHORIZONTAL);
+    wxBoxSizer* bSizer15111;
+    bSizer15111 = new wxBoxSizer(wxVERTICAL);
+    wxSize wxSz = wxSize(44, 30);
+    m_togBtnLoopRx = new wxToggleButton(this, wxID_ANY, _("Loop\nRX"), wxDefaultPosition, wxSz, 0);
+    m_togBtnLoopRx->SetFont(wxFont(6, 70, 90, 90, false, wxEmptyString));
+    m_togBtnLoopRx->SetToolTip(_("Loopback Receive audio data."));
+
+    bSizer15111->Add(m_togBtnLoopRx, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 0);
+
+    //sbSizer5->Add(bSizer15111, 0, wxEXPAND, 1);
+    bSizer15113->Add(bSizer15111, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 0);
+
+    //------------------------------
+    // Toggle Loopback button for Tx
+    //------------------------------
+    wxBoxSizer* bSizer15112;
+    bSizer15112 = new wxBoxSizer(wxVERTICAL);
+    m_togBtnLoopTx = new wxToggleButton(this, wxID_ANY, _("Loop\nTX"), wxDefaultPosition, wxSz, 0);
+    m_togBtnLoopTx->SetFont(wxFont(6, 70, 90, 90, false, wxEmptyString));
+    m_togBtnLoopTx->SetToolTip(_("Loopback Transmit audio data."));
+
+    bSizer15112->Add(m_togBtnLoopTx, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 0);
+    bSizer15113->Add(bSizer15112, 0,  wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 0);
+
+    sbSizer5->Add(bSizer15113, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
+#endif
+
+    //------------------------------
+    // Split Frequency Mode Toggle
+    //------------------------------
+    wxBoxSizer* bSizer151;
+    bSizer151 = new wxBoxSizer(wxVERTICAL);
+
+    m_togBtnSplit = new wxToggleButton(this, wxID_ANY, _("Split"), wxDefaultPosition, wxDefaultSize, 0);
+    m_togBtnSplit->SetToolTip(_("Toggle split frequency mode."));
+
+    bSizer151->Add(m_togBtnSplit, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
+    sbSizer5->Add(bSizer151, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 1);
+    wxBoxSizer* bSizer13;
+    bSizer13 = new wxBoxSizer(wxVERTICAL);
+
+    //------------------------------
+    // Analog Passthrough Toggle
+    //------------------------------
+    m_togBtnAnalog = new wxToggleButton(this, wxID_ANY, _("Analog"), wxDefaultPosition, wxDefaultSize, 0);
+    m_togBtnAnalog->SetToolTip(_("Toggle analog/digital operation."));
+    bSizer13->Add(m_togBtnAnalog, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
+    sbSizer5->Add(bSizer13, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
+
+    // not implemented on fdmdv2
+#ifdef ALC
+    //------------------------------
+    // Toggle for ALC
+    //------------------------------
+    wxBoxSizer* bSizer14;
+    bSizer14 = new wxBoxSizer(wxVERTICAL);
+    m_togBtnALC = new wxToggleButton(this, wxID_ANY, _("ALC"), wxDefaultPosition, wxDefaultSize, 0);
+    m_togBtnALC->SetToolTip(_("Toggle automatic level control mode."));
+
+    bSizer14->Add(m_togBtnALC, 0, wxALL, 1);
+    sbSizer5->Add(bSizer14, 0, wxALIGN_CENTER|wxALIGN_CENTER_HORIZONTAL|wxALL, 1);
+#endif
+
+    //------------------------------
+    // Toggle Transmit/Receive relays
+    //------------------------------
+    wxBoxSizer* bSizer11;
+    bSizer11 = new wxBoxSizer(wxVERTICAL);
+    m_btnTogPTT = new wxToggleButton(this, wxID_ANY, _("PTT"), wxDefaultPosition, wxDefaultSize, 0);
+    m_btnTogPTT->SetToolTip(_("Push to Talk - Switch between Receive and Transmit - you can also use the space bar "));
+    bSizer11->Add(m_btnTogPTT, 1, wxALIGN_CENTER|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
+    sbSizer5->Add(bSizer11, 2, wxEXPAND, 1);
+    rightSizer->Add(sbSizer5, 2, wxALIGN_CENTER|wxALL|wxEXPAND, 3);
+    bSizer1->Add(rightSizer, 0, wxALL|wxEXPAND, 3);
+    this->SetSizer(bSizer1);
+    this->Layout();
+    m_statusBar1 = this->CreateStatusBar(3, wxST_SIZEGRIP, wxID_ANY);
+
+    //=====================================================
+    // End of layout
+    //=====================================================
+
+    //-------------------
+    // Connect Events
+    //-------------------
+    this->Connect(wxEVT_CLOSE_WINDOW, wxCloseEventHandler(TopFrame::topFrame_OnClose));
+    this->Connect(wxEVT_PAINT, wxPaintEventHandler(TopFrame::topFrame_OnPaint));
+    this->Connect(wxEVT_SIZE, wxSizeEventHandler(TopFrame::topFrame_OnSize));
+    this->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::topFrame_OnUpdateUI));
+
+    this->Connect(m_menuItemExit->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnExit));
+    this->Connect(m_menuItemOnTop->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnTop));
+
+    this->Connect(m_menuItemAudio->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsAudio));
+    this->Connect(m_menuItemAudio->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsAudioUI));
+    this->Connect(m_menuItemFilter->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsFilter));
+    this->Connect(m_menuItemFilter->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsFilterUI));
+    this->Connect(m_menuItemRigCtrlCfg->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsComCfg));
+    this->Connect(m_menuItemRigCtrlCfg->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsComCfgUI));
+    this->Connect(m_menuItemOptions->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsOptions));
+    this->Connect(m_menuItemOptions->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsOptionsUI));
+
+    this->Connect(m_menuItemPlayFileToMicIn->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnPlayFileToMicIn));
+    this->Connect(m_menuItemRecFileFromRadio->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnRecFileFromRadio));
+    this->Connect(m_menuItemPlayFileFromRadio->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnPlayFileFromRadio));
+
+    this->Connect(m_menuItemHelpUpdates->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnHelpCheckUpdates));
+    this->Connect(m_menuItemHelpUpdates->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnHelpCheckUpdatesUI));
+    this->Connect(m_menuItemAbout->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnHelpAbout));
+    //m_togRxID->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnRxID), NULL, this);
+    //m_togTxID->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnTxID), NULL, this);
+    m_sliderSQ->Connect(wxEVT_SCROLL_TOP, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Connect(wxEVT_SCROLL_BOTTOM, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Connect(wxEVT_SCROLL_LINEUP, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Connect(wxEVT_SCROLL_LINEDOWN, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Connect(wxEVT_SCROLL_PAGEUP, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Connect(wxEVT_SCROLL_PAGEDOWN, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Connect(wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Connect(wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Connect(wxEVT_SCROLL_BOTTOM, wxScrollEventHandler(TopFrame::OnSliderScrollBottom), NULL, this);
+    m_sliderSQ->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(TopFrame::OnCmdSliderScrollChanged), NULL, this);
+    m_sliderSQ->Connect(wxEVT_SCROLL_TOP, wxScrollEventHandler(TopFrame::OnSliderScrollTop), NULL, this);
+    m_ckboxSQ->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(TopFrame::OnCheckSQClick), NULL, this);
+
+    m_ckboxSNR->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(TopFrame::OnCheckSNRClick), NULL, this);
+
+    m_togBtnOnOff->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnOnOff), NULL, this);
+    m_togBtnSplit->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnSplitClick), NULL, this);
+    m_togBtnAnalog->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnAnalogClick), NULL, this);
+#ifdef ALC
+    m_togBtnALC->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnALCClick), NULL, this);
+#endif
+    m_btnTogPTT->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnPTT), NULL, this);
+
+    m_BtnCallSignReset->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnCallSignReset), NULL, this);
+    m_BtnBerReset->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnBerReset), NULL, this);
+}
+
+TopFrame::~TopFrame()
+{
+    //-------------------
+    // Disconnect Events
+    //-------------------
+    this->Disconnect(wxEVT_CLOSE_WINDOW, wxCloseEventHandler(TopFrame::topFrame_OnClose));
+    this->Disconnect(wxEVT_PAINT, wxPaintEventHandler(TopFrame::topFrame_OnPaint));
+    this->Disconnect(wxEVT_SIZE, wxSizeEventHandler(TopFrame::topFrame_OnSize));
+    this->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::topFrame_OnUpdateUI));
+    this->Disconnect(ID_EXIT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnExit));
+    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsAudio));
+    this->Disconnect(wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsAudioUI));
+    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsFilter));
+    this->Disconnect(wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsFilterUI));
+    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsComCfg));
+    this->Disconnect(wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsComCfgUI));
+    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsOptions));
+    this->Disconnect(wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsOptionsUI));
+
+    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnPlayFileToMicIn));
+    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnRecFileFromRadio));
+    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnPlayFileFromRadio));
+
+    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnHelpCheckUpdates));
+    this->Disconnect(wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnHelpCheckUpdatesUI));
+    this->Disconnect(ID_ABOUT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnHelpAbout));
+    //m_togRxID->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnRxID), NULL, this);
+    //m_togTxID->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnTxID), NULL, this);
+    m_sliderSQ->Disconnect(wxEVT_SCROLL_TOP, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Disconnect(wxEVT_SCROLL_BOTTOM, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Disconnect(wxEVT_SCROLL_LINEUP, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Disconnect(wxEVT_SCROLL_LINEDOWN, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Disconnect(wxEVT_SCROLL_PAGEUP, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Disconnect(wxEVT_SCROLL_PAGEDOWN, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Disconnect(wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Disconnect(wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Disconnect(wxEVT_SCROLL_BOTTOM, wxScrollEventHandler(TopFrame::OnSliderScrollBottom), NULL, this);
+    m_sliderSQ->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(TopFrame::OnCmdSliderScrollChanged), NULL, this);
+    m_sliderSQ->Disconnect(wxEVT_SCROLL_TOP, wxScrollEventHandler(TopFrame::OnSliderScrollTop), NULL, this);
+    m_ckboxSQ->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(TopFrame::OnCheckSQClick), NULL, this);
+
+    m_togBtnOnOff->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnOnOff), NULL, this);
+    m_togBtnSplit->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnSplitClick), NULL, this);
+    m_togBtnAnalog->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnAnalogClick), NULL, this);
+#ifdef ALC
+    m_togBtnALC->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnALCClick), NULL, this);
+#endif
+    m_btnTogPTT->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnPTT), NULL, this);
+
+}
+
diff --git a/freedv-dev/src/topFrame.h b/freedv-dev/src/topFrame.h
new file mode 100644 (file)
index 0000000..54ec408
--- /dev/null
@@ -0,0 +1,184 @@
+//==========================================================================
+// Name:            topFrame.h
+//
+// Purpose:         Implements simple wxWidgets application with GUI.
+// Created:         Apr. 9, 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 Lesser 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 Lesser General Public License
+//  along with this program; if not, see <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#ifndef __TOPFRAME_H__
+#define __TOPFRAME_H__
+
+#include "version.h"
+#include <wx/artprov.h>
+#include <wx/xrc/xmlres.h>
+#include <wx/intl.h>
+#include <wx/string.h>
+#include <wx/bitmap.h>
+#include <wx/image.h>
+#include <wx/icon.h>
+#include <wx/menu.h>
+#include <wx/gdicmn.h>
+#include <wx/font.h>
+#include <wx/colour.h>
+#include <wx/settings.h>
+#include <wx/gauge.h>
+#include <wx/textctrl.h>
+#include <wx/sizer.h>
+#include <wx/statbox.h>
+#include <wx/aui/auibook.h>
+#include <wx/tglbtn.h>
+#include <wx/slider.h>
+#include <wx/checkbox.h>
+#include <wx/statusbr.h>
+#include <wx/frame.h>
+#include <wx/statbmp.h>
+#include <wx/stattext.h>
+#include <wx/button.h>
+#include <wx/dialog.h>
+#include <wx/radiobut.h>
+#include <wx/combobox.h>
+#include <wx/panel.h>
+#include <wx/listbox.h>
+#include <wx/notebook.h>
+#include <wx/listctrl.h>
+
+
+///////////////////////////////////////////////////////////////////////////
+
+#define ID_OPEN 1000
+#define ID_SAVE 1001
+#define ID_CLOSE 1002
+#define ID_EXIT 1003
+#define ID_COPY 1004
+#define ID_CUT 1005
+#define ID_PASTE 1006
+#define ID_OPTIONS 1007
+#define ID_ABOUT 1008
+
+///////////////////////////////////////////////////////////////////////////////
+/// Class TopFrame
+///////////////////////////////////////////////////////////////////////////////
+class TopFrame : public wxFrame
+{
+    private:
+
+    protected:
+        wxMenuBar* m_menubarMain;
+        wxMenu* file;
+        wxMenu* edit;
+        wxMenu* tools;
+        wxMenu* help;
+        wxGauge* m_gaugeSNR;
+        wxStaticText* m_textSNR;
+        wxCheckBox* m_ckboxSNR;
+        wxGauge* m_gaugeLevel;
+        wxStaticText* m_textLevel;
+
+        wxButton*     m_BtnCallSignReset;
+        wxTextCtrl*   m_txtCtrlCallSign;
+        wxStaticText* m_txtChecksumGood;
+        wxStaticText* m_txtChecksumBad;
+
+        wxSlider* m_sliderSQ;
+        wxCheckBox* m_ckboxSQ;
+        wxStaticText* m_textSQ;
+        wxStatusBar* m_statusBar1;
+
+        wxButton*     m_BtnBerReset;
+        wxStaticText  *m_textBits;
+        wxStaticText  *m_textErrors;
+        wxStaticText  *m_textBER;
+
+        wxRadioButton *m_rbSync;
+        wxRadioButton *m_rb1400old;
+        wxRadioButton *m_rb1400;
+        wxRadioButton *m_rb700;
+        wxRadioButton *m_rb700b;
+        wxRadioButton *m_rb1600;
+        wxRadioButton *m_rb2000;
+        wxRadioButton *m_rb1600Wide;
+
+        // Virtual event handlers, overide them in your derived class
+        virtual void topFrame_OnClose( wxCloseEvent& event ) { event.Skip(); }
+        virtual void topFrame_OnPaint( wxPaintEvent& event ) { event.Skip(); }
+        virtual void topFrame_OnSize( wxSizeEvent& event ) { event.Skip(); }
+        virtual void topFrame_OnUpdateUI( wxUpdateUIEvent& event ) { event.Skip(); }
+
+        virtual void OnExit( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnTop( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnToolsAudio( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnToolsAudioUI( wxUpdateUIEvent& event ) { event.Skip(); }
+        virtual void OnToolsFilter( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnToolsFilterUI( wxUpdateUIEvent& event ) { event.Skip(); }
+        virtual void OnToolsOptions( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnToolsUDP( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnToolsOptionsUI( wxUpdateUIEvent& event ) { event.Skip(); }
+        virtual void OnToolsComCfg( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnToolsComCfgUI( wxUpdateUIEvent& event ) { event.Skip(); }
+        virtual void OnPlayFileToMicIn( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnRecFileFromRadio( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnPlayFileFromRadio( wxCommandEvent& event ) { event.Skip(); }
+
+        virtual void OnHelpCheckUpdates( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnHelpCheckUpdatesUI( wxUpdateUIEvent& event ) { event.Skip(); }
+        virtual void OnHelpAbout( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnTogBtnRxID( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnTogBtnTxID( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnCmdSliderScroll( wxScrollEvent& event ) { event.Skip(); }
+        virtual void OnSliderScrollBottom( wxScrollEvent& event ) { event.Skip(); }
+        virtual void OnCmdSliderScrollChanged( wxScrollEvent& event ) { event.Skip(); }
+        virtual void OnSliderScrollTop( wxScrollEvent& event ) { event.Skip(); }
+        virtual void OnCheckSQClick( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnCheckSNRClick( wxCommandEvent& event ) { event.Skip(); }
+
+        virtual void OnTogBtnLoopRx( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnTogBtnLoopTx( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnTogBtnOnOff( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnTogBtnSplitClick( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnTogBtnAnalogClick( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnTogBtnALCClick( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnTogBtnPTT( wxCommandEvent& event ) { event.Skip(); }
+
+        virtual void OnTogBtnSplitClickUI(wxUpdateUIEvent& event) { event.Skip(); }
+        virtual void OnTogBtnAnalogClickUI(wxUpdateUIEvent& event) { event.Skip(); }
+        virtual void OnTogBtnALCClickUI(wxUpdateUIEvent& event) { event.Skip(); }
+        virtual void OnTogBtnRxIDUI(wxUpdateUIEvent& event ) { event.Skip(); }
+        virtual void OnTogBtnTxIDUI(wxUpdateUIEvent& event ) { event.Skip(); }
+        virtual void OnTogBtnPTT_UI(wxUpdateUIEvent& event ) { event.Skip(); }
+        virtual void OnTogBtnOnOffUI(wxUpdateUIEvent& event ) { event.Skip(); }
+
+        virtual void OnCallSignReset( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnBerReset( wxCommandEvent& event ) { event.Skip(); }
+
+    public:
+        wxToggleButton* m_togRxID;
+        wxToggleButton* m_togTxID;
+        wxToggleButton* m_togBtnOnOff;
+        wxToggleButton* m_togBtnSplit;
+        wxToggleButton* m_togBtnAnalog;
+        wxToggleButton* m_togBtnALC;
+        wxToggleButton* m_btnTogPTT;
+        wxToggleButton* m_togBtnLoopRx;
+        wxToggleButton* m_togBtnLoopTx;
+        wxAuiNotebook* m_auiNbookCtrl;
+
+        TopFrame( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("FreeDV ") + _(FREEDV_VERSION), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(561,300 ), long style = wxDEFAULT_FRAME_STYLE|wxRESIZE_BORDER|wxTAB_TRAVERSAL );
+
+        ~TopFrame();
+};
+
+#endif //__TOPFRAME_H__
diff --git a/freedv/branches/0.97/.clang/.gitignore b/freedv/branches/0.97/.clang/.gitignore
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/freedv/branches/0.97/AUTHORS b/freedv/branches/0.97/AUTHORS
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/freedv/branches/0.97/CMakeLists.txt b/freedv/branches/0.97/CMakeLists.txt
new file mode 100644 (file)
index 0000000..fd61d52
--- /dev/null
@@ -0,0 +1,461 @@
+#
+# FreeDV - HF Digital Voice for Radio Amateurs
+#
+# CMake configuration contributed by Richard Shaw (KF5OIM)
+# Please report questions, comments, problems, or patches to the freetel
+# mailing list: https://lists.sourceforge.net/lists/listinfo/freetel-codec2
+#
+
+cmake_minimum_required(VERSION 2.8)
+
+# Prevent in-source builds to protect automake/autoconf config.
+# If an in-source build is attempted, you will still need to clean up a few
+# files manually.
+set(CMAKE_DISABLE_SOURCE_CHANGES ON)
+set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
+if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
+  message(FATAL_ERROR "In-source builds in ${CMAKE_BINARY_DIR} are not "   
+   "allowed, please remove ./CMakeCache.txt and ./CMakeFiles/, create a "
+   "separate build directory and run cmake from there.")
+endif("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
+
+# Set local module path.
+list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
+
+project(FreeDV)
+
+#
+# Parse FreeDV version from src/version.h
+#
+file(READ "${CMAKE_SOURCE_DIR}/src/version.h" _VERSION_H)
+string(REGEX REPLACE ".*FREEDV_VERSION_MAJOR ([0-9]+).*" "\\1"
+    FREEDV_VERSION_MAJOR "${_VERSION_H}")
+string(REGEX REPLACE ".*FREEDV_VERSION_MINOR ([0-9]+).*" "\\1"
+    FREEDV_VERSION_MINOR "${_VERSION_H}")
+string(REGEX REPLACE ".*FREEDV_VERSION_PATCH ([0-9]+).*" "\\1"
+    FREEDV_VERSION_PATCH "${_VERSION_H}")
+set(FREEDV_VERSION "${FREEDV_VERSION_MAJOR}.${FREEDV_VERSION_MINOR}")
+if(FREEDV_VERSION_PATCH)
+    set(FREEDV_VERSION ${FREEDV_VERSION}.${FREEDV_VERSION_PATCH})
+endif(FREEDV_VERSION_PATCH)
+
+message(STATUS "FreeDV version: ${FREEDV_VERSION}")
+
+# Set default build type
+if(NOT CMAKE_BUILD_TYPE)
+    set(CMAKE_BUILD_TYPE "Release")
+    message(STATUS "Build type not specified, defaulting to ${CMAKE_BUILD_TYPE}")
+endif(NOT CMAKE_BUILD_TYPE)
+
+
+# Work around for not using a svn working copy.
+add_definitions(-D_NO_AUTOTOOLS_)
+find_program(SVNVERSION_PATH svnversion)
+if(SVNVERSION_PATH)
+    execute_process(COMMAND ${SVNVERSION_PATH} .
+        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+        RESULT_VARIABLE SVN_REVISION_RESULT
+        OUTPUT_VARIABLE SVN_CURRENT_REVISION
+        ERROR_QUIET
+    )
+else()
+    set(SVN_REVISION_RESULT 1)
+endif()
+if(SVN_REVISION_RESULT EQUAL 0)
+string(STRIP ${SVN_CURRENT_REVISION} SVN_REVISION)
+add_definitions(-DSVN_REVISION="${SVN_REVISION}")
+else()
+add_definitions(-DSVN_REVISION="Unversioned directory")
+endif()
+
+
+# Set default build flags.
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
+
+#
+# Setup cmake options
+#
+set(USE_STATIC_DEPS FALSE CACHE BOOL 
+    "Download and build static libraries instead of system libraries.")
+set(USE_STATIC_PORTAUDIO FALSE CACHE BOOL 
+    "Download and build static portaudio instead of the system library.")
+set(USE_STATIC_SNDFILE FALSE CACHE BOOL
+    "Download and build static sndfile instead of the system library.")
+set(USE_STATIC_SAMPLERATE FALSE CACHE BOOL
+    "Download and build static samplerate instead of the system library.")
+set(USE_STATIC_SOX FALSE CACHE BOOL
+    "Download and build static sox instead of the system library.")
+set(USE_STATIC_CODEC2 FALSE CACHE BOOL
+    "Download and build static codec2 instead of the system library.")
+set(BOOTSTRAP_WXWIDGETS FALSE CACHE BOOL
+    "Download and build static wxWidgets instead of the system library.")
+
+if(USE_STATIC_DEPS)
+    set(USE_STATIC_PORTAUDIO TRUE FORCE)
+    set(USE_STATIC_SNDFILE TRUE FORCE)
+    set(USE_STATIC_SAMPLERATE TRUE FORCE)
+    set(USE_STATIC_SOX TRUE FORCE)
+    set(USE_STATIC_CODEC2 TRUE FORCE)
+endif(USE_STATIC_DEPS)
+
+#
+# Pull in external wxWidgets target if performing static build.
+#
+if(BOOTSTRAP_WXWIDGETS)
+    message(STATUS "Adding wxWidgets build target...")
+    include(cmake/BuildWxWidgets.cmake)
+endif(BOOTSTRAP_WXWIDGETS)
+
+#
+# Perform bootstrap build of wxWidgets
+#
+if(BOOTSTRAP_WXWIDGETS AND NOT EXISTS ${WXCONFIG})
+    message(STATUS "Will perform bootstrap build of wxWidgets.
+   After make step completes, re-run cmake and make again to perform FreeDV build.")
+#
+# Continue normal build if not bootstrapping wxWidgets or is already built.
+#
+else(BOOTSTRAP_WXWIDGETS AND NOT EXISTS ${WXCONFIG})
+
+
+#
+# Various hacks and work arounds for building under MinGW.
+#
+if(MINGW)
+    message(STATUS "System is MinGW.")
+    # This sets up the exe icon for windows under mingw.
+    set(RES_FILES "")
+    set(RES_FILES "${CMAKE_SOURCE_DIR}/contrib/freedv.rc")
+    set(CMAKE_RC_COMPILER_INIT windres)
+    enable_language(RC)
+    set(CMAKE_RC_COMPILE_OBJECT
+        "<CMAKE_RC_COMPILER> <FLAGS> -O coff <DEFINES> -i <SOURCE> -o <OBJECT>")
+    # These are DLOPEN'ed and can't be automatically pulled in by dependency.
+    foreach(RUNTIME
+        hamlib-adat.dll
+        hamlib-alinco.dll
+        hamlib-amsat.dll
+        hamlib-aor.dll
+        hamlib-ars.dll
+        hamlib-celestron.dll
+        hamlib-drake.dll
+        hamlib-dummy.dll
+        hamlib-easycomm.dll
+        hamlib-flexradio.dll
+        hamlib-fodtrack.dll
+        hamlib-gs232a.dll
+        hamlib-heathkit.dll
+        hamlib-icom.dll
+        hamlib-jrc.dll
+        hamlib-kachina.dll
+        hamlib-kenwood.dll
+        hamlib-kit.dll
+        hamlib-lowe.dll
+        hamlib-m2.dll
+        hamlib-pcr.dll
+        hamlib-prm80.dll
+        hamlib-racal.dll
+        hamlib-rft.dll
+        hamlib-rotorez.dll
+        hamlib-rs.dll
+        hamlib-sartek.dll
+        hamlib-skanti.dll
+        hamlib-spid.dll
+        hamlib-tapr.dll
+        hamlib-tentec.dll
+        hamlib-ts7400.dll
+        hamlib-tuner.dll
+        hamlib-uniden.dll
+        hamlib-winradio.dll
+        hamlib-wj.dll
+        hamlib-yaesu.dll)
+        message(STATUS "Checking for ${RUNTIME}")
+        find_library(${RUNTIME}_LIB ${RUNTIME}
+            PATH_SUFFIXES hamlib)
+        message(STATUS "runtime found: ${${RUNTIME}_LIB}")
+        list(APPEND CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS ${${RUNTIME}_LIB})
+    endforeach()
+    include(InstallRequiredSystemLibraries)
+endif(MINGW)
+
+# Math library is automatic on MinGW
+if(UNIX)
+    set(CMAKE_REQUIRED_INCLUDES math.h)
+    set(CMAKE_REQUIRED_LIBRARIES m)
+endif(UNIX)
+
+# Find some standard headers and functions.
+include(CheckIncludeFiles)
+check_include_files("limits.h" HAVE_LIMITS_H)
+check_include_files("stddef.h" HAVE_STDDEF_H)
+check_include_files("stdlib.h" HAVE_STDLIB_H)
+check_include_files("string.h" HAVE_STRING_H)
+
+include(CheckTypeSize)
+check_type_size("int" SIZEOF_INT)
+
+include(CheckFunctionExists)
+check_function_exists(floor HAVE_FLOOR)
+check_function_exists(memset HAVE_MEMSET)
+check_function_exists(pow HAVE_POW)
+check_function_exists(sqrt HAVE_SQRT)
+
+# fdmdv2_main.h requires patching to find config.h as it current looks in the
+# source directory and the generated file goes in the binary directory.
+configure_file ("${PROJECT_SOURCE_DIR}/cmake/config.h.in"
+                "${PROJECT_BINARY_DIR}/config.h" )
+include_directories(${PROJECT_BINARY_DIR})
+add_definitions(-DHAVE_CONFIG_H)
+
+# Pthread Library
+find_package(Threads REQUIRED)
+message(STATUS "Threads library flags: ${CMAKE_THREAD_LIBS_INIT}")
+
+#
+# Find codec2
+#
+if(NOT USE_STATIC_CODEC2)
+    message(STATUS "Looking for codec2...")
+    find_package(codec2 CONFIG QUIET)
+    if(codec2_FOUND)
+        get_target_property(CODEC2_BRARY codec2 LOCATION)
+        message(STATUS "  codec2 library: ${CODEC2_LIBRARY}")
+        message(STATUS "  codec2 headers: ${codec2_INCLUDE_DIRS}")
+    else()
+        # Try to find manually
+        find_path(CODEC2_INCLUDE_DIRS codec2.h
+                  PATH_SUFFIXES codec2)
+        find_library(CODEC2_LIBRARY NAMES codec2)
+        if(CODEC2_LIBRARY AND CODEC2_INCLUDE_DIRS)
+            message(STATUS "  codec2 library: ${CODEC2_LIBRARY}")
+            message(STATUS "  codec2 headers: ${CODEC2_INCLUDE_DIRS}")
+            list(APPEND FREEDV_LINK_LIBS ${CODEC2_LIBRARY})
+            include_directories(${CODEC2_INCLUDE_DIRS})
+        else()
+            message(FATAL_ERROR "codec2 library not found.
+Linux: 
+Codec2 may not be in your distribution so build yourself or use the cmake option to build statically into FreeDV.
+Windws:
+It's easiest to use the cmake option: USE_STATIC_CODEC2"
+        )
+        endif()
+    endif()
+else(NOT USE_STATIC_CODEC2)
+    message(STATUS "Will attempt static build of codec2.")
+    include(cmake/BuildCodec2.cmake)
+endif(NOT USE_STATIC_CODEC2)
+
+#
+# Find or build portaudio Library
+#
+if(NOT USE_STATIC_PORTAUDIO)
+    message(STATUS "Looking for portaudio...")
+    find_package(Portaudio REQUIRED)
+    if(PORTAUDIO_FOUND)
+        message(STATUS "  portaudio library: ${PORTAUDIO_LIBRARIES}")
+        message(STATUS "  portaudio headers: ${PORTAUDIO_INCLUDE_DIRS}")
+        list(APPEND FREEDV_LINK_LIBS ${PORTAUDIO_LIBRARIES})
+        include_directories(${PORTAUDIO_INCLUDE_DIRS})
+    else()
+        message(FATAL_ERROR "portaudio library not found.
+On Linux systems try installing:
+    portaudio-devel  (RPM based systems)
+    libportaudio-dev (DEB based systems)
+On Windows it's easiest to use the cmake option: USE_STATIC_PORTAUDIO"
+        )
+    endif()
+    if(NOT ${PORTAUDIO_VERSION} EQUAL 19)
+        message(WARNING "Portaudio versions other than 19 are known to have issues. You have been warned!")
+    endif()
+else(NOT USE_STATIC_PORTAUDIO)
+    message(STATUS "Will attempt static build of portaudio.")
+    include(cmake/BuildPortaudio.cmake)
+endif(NOT USE_STATIC_PORTAUDIO)
+
+#
+# Hamlib library
+#
+message(STATUS "Looking for hamlib...")
+find_path(HAMLIB_INCLUDE_DIR hamlib/rig.h)
+find_library(HAMLIB_LIBRARY hamlib)
+message(STATUS "Hamlib library: ${HAMLIB_LIBRARY}")
+message(STATUS "Hamlib headers: ${HAMLIB_INCLUDE_DIR}")
+if(HAMLIB_LIBRARY AND HAMLIB_INCLUDE_DIR)
+    message(STATUS "Hamlib library found.")
+    include_directories(${HAMLIB_INCLUDE_DIR})
+    list(APPEND FREEDV_LINK_LIBS ${HAMLIB_LIBRARY})
+else(HAMLIB_LIBRARY AND HAMLIB_INCLUDE_DIR)
+    message(FATAL_ERROR "hamlib not found.
+On Linux systems try installing:
+    hamlib-devel  (RPM based systems)
+    libhamlib-dev (DEB based systems)"
+    )
+endif(HAMLIB_LIBRARY AND HAMLIB_INCLUDE_DIR)
+
+
+#
+# Samplerate Library
+#
+if(NOT USE_STATIC_SAMPLERATE)
+    message(STATUS "Looking for samplerate...")
+    find_library(LIBSAMPLERATE samplerate)
+    find_path(LIBSAMPLERATE_INCLUDE_DIR samplerate.h)
+    message(STATUS "  samplerate library: ${LIBSAMPLERATE}")
+    message(STATUS "  samplerate headers: ${LIBSAMPLERATE_INCLUDE_DIR}")
+    if(LIBSAMPLERATE AND LIBSAMPLERATE_INCLUDE_DIR)
+        list(APPEND FREEDV_LINK_LIBS ${LIBSAMPLERATE})
+        include_directories(${LIBSAMPLERATE_INCLUDE_DIR})
+    else(LIBSTAMPLERATE AND LIBSAMPLERATE_INCLUDE_DIR)
+        message(FATAL_ERROR "samplerate library not found.
+On Linux systems try installing:
+    samplerate-devel  (RPM based systems)
+    libsamplerate-dev (DEB based systems)
+On Windows it's easiest to use the cmake option: USE_STATIC_SAMPLERATE"
+        )
+    endif(LIBSAMPLERATE AND LIBSAMPLERATE_INCLUDE_DIR)
+else(NOT USE_STATIC_SAMPLERATE)
+    message(STATUS "Will attempt static build of samplerate.")
+    include(cmake/BuildSamplerate.cmake)
+endif(NOT USE_STATIC_SAMPLERATE)
+
+#
+# Find sox library
+#
+if(NOT USE_STATIC_SOX)
+    message(STATUS "Looking for sox...")
+    find_library(LIBSOX_LIBRARY sox)
+    find_path(LIBSOX_INCLUDE_DIR NAMES sox/sox.h sox.h)
+    message(STATUS "  sox library: ${LIBSOX_LIBRARY}")
+    message(STATUS "  sox headers: ${LIBSOX_INCLUDE_DIR}")
+    if(LIBSOX_LIBRARY AND LIBSOX_INCLUDE_DIR)
+        list(APPEND FREEDV_LINK_LIBS ${LIBSOX_LIBRARY})
+        include_directories(${LIBSOX_INCLUDE_DIR})
+    else(LIBSOX_LIBRARY AND LIBSOX_INCLUDE_DIR)
+        message(FATAL_ERROR "sox library not found.
+On Linux systems try installing:
+    sox-devel (RPM based systems)
+    libsox-dev (DEB based systems)
+On Windows it's easiest to use the cmake option: USE_STATIC_SOX"
+        )
+    endif(LIBSOX_LIBRARY AND LIBSOX_INCLUDE_DIR)
+else(NOT USE_STATIC_SOX)
+    message(STATUS "Will attempt static build of sox.")
+    include(cmake/BuildSox.cmake)
+endif(NOT USE_STATIC_SOX)
+
+#    
+# sndfile Library
+#
+if(NOT USE_STATIC_SNDFILE)
+    message(STATUS "Looking for sndfile...")
+    find_library(LIBSNDFILE sndfile)
+    find_path(LIBSNDFILE_INCLUDE_DIR sndfile.h)
+    message(STATUS "  sndfile library: ${LIBSNDFILE}")
+    message(STATUS "  sndfile headers: ${LIBSNDFILE_INCLUDE_DIR}")
+    if(LIBSNDFILE AND LIBSNDFILE_INCLUDE_DIR)
+        list(APPEND FREEDV_LINK_LIBS ${LIBSNDFILE})
+    else(LIBSNDFILE AND LIBSNDFILE_INCLUDE_DIR)
+        message(FATAL_ERROR "sndfile library not found.
+On Linux systems try installing:
+    libsndfile-devel (RPM based systems)
+    libsndfile-dev   (DEB based systems)
+On Windows it's easiest to use the cmake option: USE_STATIC_SNDFILE"
+        )
+    endif(LIBSNDFILE AND LIBSNDFILE_INCLUDE_DIR)
+else(NOT USE_STATIC_SNDFILE)
+    message(STATUS "Will attempt static build of sndfile.")
+    include(cmake/BuildSndfile.cmake)
+endif(NOT USE_STATIC_SNDFILE)
+
+#
+# Find wxWidgets
+#
+if(NOT BOOTSTRAP_WXWIDGETS)
+    set(WXCONFIG "" CACHE FILEPATH "Location of wx-config binary.")
+    set(WXRC "" CACHE FILEPATH "Location of wxrc binary.")
+endif(NOT BOOTSTRAP_WXWIDGETS)
+#if(BOOTSTRAP_WXWIDGETS)
+#    set(WXCONFIG "${CMAKE_BINARY_DIR}/external/dist/bin/wx-config")
+#    set(WXRC "${CMAKE_BINARY_DIR}/external/dist/bin/wxrc")
+#    list(APPEND FREEDV_STATIC_DEPS wxWidgets)
+#endif(BOOTSTRAP_WXWIDGETS)
+message(STATUS "Looking for wxWidgets...")
+if(WXCONFIG)
+    message(STATUS "wx-config: ${WXCONFIG}")
+    set(wxWidgets_CONFIG_EXECUTABLE ${WXCONFIG})
+endif(WXCONFIG)
+if(WXRC)
+    message(STATUS "wxrc: ${WXRC}")
+    set(wxWidgets_wxrc_EXECUTABLE ${WXRC})
+endif(WXRC)
+set(WX_VERSION_MIN 3.0.0)
+find_package(wxWidgets REQUIRED core base aui html net adv)
+execute_process(COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}" --version
+    OUTPUT_VARIABLE WX_VERSION)
+string(STRIP ${WX_VERSION} WX_VERSION)
+if(WX_VERSION VERSION_EQUAL ${WX_VERSION_MIN}
+    OR WX_VERSION VERSION_GREATER ${WX_VERSION_MIN})
+   message(STATUS "wxWidgets version: ${WX_VERSION}")
+else()
+    message(FATAL_ERROR "wxWidgets must be installed on your system.
+Please check that wx-config is in path, the directory
+where wxWidgets libraries are installed (returned by
+'wx-config --libs' or 'wx-config --static --libs' command)
+is in LD_LIBRARY_PATH or equivalent variable and
+wxWidgets version is ${WX_VERSION_MIN} or above.")
+endif()
+if(wxWidgets_FOUND)
+    include("${wxWidgets_USE_FILE}")
+    list(APPEND FREEDV_LINK_LIBS ${wxWidgets_LIBRARIES})
+endif(wxWidgets_FOUND)
+
+
+# Freedv 
+add_subdirectory(src)
+
+# Icons and desktop file
+add_subdirectory(contrib)
+
+message(STATUS "Build type will be: ${CMAKE_BUILD_TYPE}")
+
+#
+# Cpack NSIS configuration for Windows.
+#
+if(WIN32)
+    # Detect if we're doing a 32-bit or 64-bit windows build.
+    if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
+        set(CMAKE_CL_64 TRUE)
+    endif()
+    if(NOT ${CMAKE_BUILD_TYPE} STREQUAL "Debug")
+        set(CPACK_STRIP_FILES TRUE)
+    endif()
+
+    configure_file(cmake/GetDependencies.cmake.in cmake/GetDependencies.cmake
+        @ONLY
+    )
+    install(SCRIPT ${CMAKE_BINARY_DIR}/cmake/GetDependencies.cmake)
+    set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "HF Digital Voice for Radio Amateurs")
+    set(CPACK_PACKAGE_VENDOR "CMake")
+    set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
+    set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
+    set(CPACK_PACKAGE_VERSION_MAJOR ${FREEDV_VERSION_MAJOR})
+    set(CPACK_PACKAGE_VERSION_MINOR ${FREEDV_VERSION_MINOR})
+    if(FREEDV_VERSION_PATCH)
+        set(CPACK_PACKAGE_VERSION_PATCH ${FREEDV_VERSION_PATCH})
+    else()
+        set(CPACK_PACKAGE_VERSION_PATCH "0")
+    endif()
+    set(CPACK_PACKAGE_INSTALL_DIRECTORY "FreeDV")
+    set(CPACK_PACKAGE_EXECUTABLES freedv;FreeDV)
+    set(CPACK_STRIP_FILES TRUE)
+    # NSIS specific settings
+    set(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\freedv.exe")
+    set(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}")
+    set(CPACK_NSIS_PACKAGE_NAME "FreeDV")
+    set(CPACK_NSIS_URL_INFO_ABOUT "http://freedv.org")
+    set(CPACK_NSIS_MODIFY_PATH OFF)
+    set(CPACK_NSIS_MENU_LINKS "http://freedv.org" "FreeDV Homepage")
+    include(CPack)
+endif(WIN32)
+
+endif(BOOTSTRAP_WXWIDGETS AND NOT EXISTS ${WXCONFIG})
diff --git a/freedv/branches/0.97/COPYING b/freedv/branches/0.97/COPYING
new file mode 100644 (file)
index 0000000..cfd4e99
--- /dev/null
@@ -0,0 +1,502 @@
+                  GNU LESSER GENERAL PUBLIC LICENSE
+                       Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+                            Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+  When we speak of free software, we are referring to freedom of use,
+not price.  Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+\f
+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard.  To achieve this, non-free programs must be
+allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+\f
+                  GNU LESSER GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+\f
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+\f
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+\f
+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+\f
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+\f
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+\f
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+                            NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+                     END OF TERMS AND CONDITIONS
+\f
+           How to Apply These Terms to Your New Libraries
+
+  If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change.  You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+  To apply these terms, attach the following notices to the library.  It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the library's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, see
+    <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+  <signature of Ty Coon>, 1 April 1990
+  Ty Coon, President of Vice
+
+That's all there is to it!
diff --git a/freedv/branches/0.97/ChangeLog b/freedv/branches/0.97/ChangeLog
new file mode 100644 (file)
index 0000000..6cc9eb6
--- /dev/null
@@ -0,0 +1,1819 @@
+------------------------------------------------------------------------
+r1317 | hobbes1069 | 2013-06-13 10:40:39 -0500 (Thu, 13 Jun 2013) | 1 line
+
+Update wxWidgets bootstrap process to be more simple and other tweaks to USE_STATIC_... options.
+------------------------------------------------------------------------
+r1312 | hobbes1069 | 2013-06-07 13:17:05 -0500 (Fri, 07 Jun 2013) | 1 line
+
+Use version.h for settign version info.
+------------------------------------------------------------------------
+r1311 | shenki | 2013-06-06 19:55:20 -0500 (Thu, 06 Jun 2013) | 5 lines
+
+Add libctb to the list of libraries to build
+
+It will not be downloaded nor built with the current configuration.
+Thanks to Curt, WE7U on the codec2 mailing list for discovering this one.
+
+------------------------------------------------------------------------
+r1310 | shenki | 2013-06-06 04:00:35 -0500 (Thu, 06 Jun 2013) | 2 lines
+
+Move init of sox outside of assert calls
+
+------------------------------------------------------------------------
+r1306 | hobbes1069 | 2013-06-02 11:50:41 -0500 (Sun, 02 Jun 2013) | 1 line
+
+Update version in cmake config.
+------------------------------------------------------------------------
+r1305 | hobbes1069 | 2013-06-02 08:01:51 -0500 (Sun, 02 Jun 2013) | 1 line
+
+Put the file in the right place...
+------------------------------------------------------------------------
+r1304 | hobbes1069 | 2013-06-02 07:59:53 -0500 (Sun, 02 Jun 2013) | 1 line
+
+Add freedv.rc which allows embedding the freedv icon in the windows executable.
+------------------------------------------------------------------------
+r1303 | drowe67 | 2013-06-01 19:19:57 -0500 (Sat, 01 Jun 2013) | 1 line
+
+serial & Hamlib PTT tested OK on Linux
+------------------------------------------------------------------------
+r1300 | drowe67 | 2013-05-31 17:20:06 -0500 (Fri, 31 May 2013) | 1 line
+
+hooked up serial port logic, still to test and debug
+------------------------------------------------------------------------
+r1297 | drowe67 | 2013-05-30 19:50:52 -0500 (Thu, 30 May 2013) | 1 line
+
+restored serial PTT dilaog, yet to hook up actual logic to use it
+------------------------------------------------------------------------
+r1296 | drowe67 | 2013-05-29 21:11:07 -0500 (Wed, 29 May 2013) | 1 line
+
+made filter dialog a little larger as ok/cancel wasbing cropped
+------------------------------------------------------------------------
+r1295 | hobbes1069 | 2013-05-29 20:36:45 -0500 (Wed, 29 May 2013) | 1 line
+
+Move golay23 into codec2 library.
+------------------------------------------------------------------------
+r1294 | hobbes1069 | 2013-05-29 15:06:55 -0500 (Wed, 29 May 2013) | 1 line
+
+Additional hamlib cmake config cleanup.
+------------------------------------------------------------------------
+r1293 | hobbes1069 | 2013-05-28 19:55:57 -0500 (Tue, 28 May 2013) | 1 line
+
+Add cmake checks for hamlib and more fixes for updated source names.
+------------------------------------------------------------------------
+r1292 | hobbes1069 | 2013-05-28 19:15:28 -0500 (Tue, 28 May 2013) | 1 line
+
+Update cmake config for renamed source files.
+------------------------------------------------------------------------
+r1291 | drowe67 | 2013-05-28 01:45:26 -0500 (Tue, 28 May 2013) | 1 line
+
+cleaned up some unused files
+------------------------------------------------------------------------
+r1289 | drowe67 | 2013-05-27 19:37:30 -0500 (Mon, 27 May 2013) | 1 line
+
+minor tweaks to README, remove dunused automake stuff, and tweaked help-about for donations
+------------------------------------------------------------------------
+r1288 | drowe67 | 2013-05-27 18:35:32 -0500 (Mon, 27 May 2013) | 1 line
+
+managedto get Win32 building with hamlib win32 binaries instead of building hamlib myself
+------------------------------------------------------------------------
+r1287 | drowe67 | 2013-05-27 17:33:38 -0500 (Mon, 27 May 2013) | 1 line
+
+first pass at building with hamlib, but cantget hamlib to build
+------------------------------------------------------------------------
+r1286 | drowe67 | 2013-05-27 15:50:41 -0500 (Mon, 27 May 2013) | 1 line
+
+filer dialog now fits on 800x600 without clipping 
+------------------------------------------------------------------------
+r1285 | drowe67 | 2013-05-27 15:46:49 -0500 (Mon, 27 May 2013) | 1 line
+
+after some sizer frustration with ptt dlg, rename commport to ptt
+------------------------------------------------------------------------
+r1284 | shenki | 2013-05-27 05:41:58 -0500 (Mon, 27 May 2013) | 4 lines
+
+Add hamlib related files
+
+These were missing from the previous commit. Oops!
+
+------------------------------------------------------------------------
+r1283 | shenki | 2013-05-27 05:17:32 -0500 (Mon, 27 May 2013) | 13 lines
+
+Add hamlib support for push to talk
+
+This removes libctb in favour of hamlib. It has been tested with 1.2.15.3 of
+hamlib with a IC-7200.
+
+The rig is configured using it's own dialog Tools -> PTT Config.  The only
+options available are the rig model and serial port, the rest of the options
+are obtained from the rig definition in hamlib.
+
+FreeDV will open the configured serial port on startup. When it cannot find
+the radio, an error dialog will be displayed. Spacebar can be used to toggle
+TX/RX.
+
+------------------------------------------------------------------------
+r1268 | drowe67 | 2013-05-23 18:00:55 -0500 (Thu, 23 May 2013) | 1 line
+
+added options dialog, bumped version
+------------------------------------------------------------------------
+r1267 | drowe67 | 2013-05-23 09:24:58 -0500 (Thu, 23 May 2013) | 1 line
+
+make 1600 default and re-arranged to fit 800x600 netbook layout
+------------------------------------------------------------------------
+r1253 | wittend99 | 2013-05-20 16:23:52 -0500 (Mon, 20 May 2013) | 1 line
+
+Personal test project 
+------------------------------------------------------------------------
+r1252 | wittend99 | 2013-05-20 16:22:44 -0500 (Mon, 20 May 2013) | 1 line
+
+Personal test stuff
+------------------------------------------------------------------------
+r1251 | wittend99 | 2013-05-20 16:21:24 -0500 (Mon, 20 May 2013) | 1 line
+
+
+------------------------------------------------------------------------
+r1250 | shenki | 2013-05-18 23:08:22 -0500 (Sat, 18 May 2013) | 7 lines
+
+Allow building against the system sox library
+
+Provide SYSTEM_SOX=y to build against the system libsox instead
+of downloading, building and linking staticly.
+
+The default of linking staticly remains the same.
+
+------------------------------------------------------------------------
+r1249 | hobbes1069 | 2013-05-17 09:53:07 -0500 (Fri, 17 May 2013) | 1 line
+
+Forgot to svn add the readme.
+------------------------------------------------------------------------
+r1248 | hobbes1069 | 2013-05-17 09:51:38 -0500 (Fri, 17 May 2013) | 2 lines
+
+Major cmake config overhall for freedv mingw build. Add freedv icon to installer and start menu entry. Add README.cmake for codec2-dev.
+
+------------------------------------------------------------------------
+r1246 | hobbes1069 | 2013-05-10 18:54:16 -0500 (Fri, 10 May 2013) | 1 line
+
+Workaround for location of config.h
+------------------------------------------------------------------------
+r1245 | hobbes1069 | 2013-05-09 15:44:20 -0500 (Thu, 09 May 2013) | 1 line
+
+Fix internal building of Codec2. Fix finding libraries under MinGW.
+------------------------------------------------------------------------
+r1244 | hobbes1069 | 2013-05-08 14:38:44 -0500 (Wed, 08 May 2013) | 1 line
+
+CMake configuration tweaks for wxWidgets bootstrap build option and update of README.cmake.
+------------------------------------------------------------------------
+r1243 | hobbes1069 | 2013-05-07 09:13:02 -0500 (Tue, 07 May 2013) | 1 line
+
+Fix typo in cmake config, add README.cmake.
+------------------------------------------------------------------------
+r1242 | hobbes1069 | 2013-05-07 09:07:47 -0500 (Tue, 07 May 2013) | 1 line
+
+Add missing BuildCodec2.cmake
+------------------------------------------------------------------------
+r1241 | wittend99 | 2013-05-06 12:17:19 -0500 (Mon, 06 May 2013) | 1 line
+
+Pushing changes to force windows builds to use a configuration file rather than the registry. 
+------------------------------------------------------------------------
+r1240 | wittend99 | 2013-05-06 12:14:34 -0500 (Mon, 06 May 2013) | 1 line
+
+Just changes to my personal IDE workspace.  Irrelevant to everyone but me -DMW
+------------------------------------------------------------------------
+r1239 | hobbes1069 | 2013-05-06 10:49:31 -0500 (Mon, 06 May 2013) | 1 line
+
+Add cmake configuration for contrib dir.
+------------------------------------------------------------------------
+r1238 | hobbes1069 | 2013-05-06 10:48:37 -0500 (Mon, 06 May 2013) | 1 line
+
+CMake configuration updates. More detailed error messages. Icon and desktop installation for Linux. WIN32 CPack tweaks.
+------------------------------------------------------------------------
+r1237 | wittend99 | 2013-04-26 08:13:11 -0500 (Fri, 26 Apr 2013) | 1 line
+
+Reversing commits made in error...
+------------------------------------------------------------------------
+r1236 | wittend99 | 2013-04-26 08:09:05 -0500 (Fri, 26 Apr 2013) | 1 line
+
+
+------------------------------------------------------------------------
+r1235 | hobbes1069 | 2013-04-24 14:34:37 -0500 (Wed, 24 Apr 2013) | 1 line
+
+Update cmake configuration including building static builds of most dependencies. Update codec2 build to include basic cpack configuration.
+------------------------------------------------------------------------
+r1234 | hobbes1069 | 2013-04-19 14:26:53 -0500 (Fri, 19 Apr 2013) | 1 line
+
+Major updates to cmake configuration for both codec2-dev and fdmdv2. Preliminary cpack NSIS configuration for codec2 windows installer.
+------------------------------------------------------------------------
+r1232 | hobbes1069 | 2013-04-15 09:35:41 -0500 (Mon, 15 Apr 2013) | 1 line
+
+Commit inital cmake configuration, *nix and windows icon, and *nix desktop file.
+------------------------------------------------------------------------
+r1231 | wittend99 | 2013-03-26 10:53:46 -0500 (Tue, 26 Mar 2013) | 1 line
+
+
+------------------------------------------------------------------------
+r1230 | wittend99 | 2013-03-26 10:31:07 -0500 (Tue, 26 Mar 2013) | 1 line
+
+Updating my personal resting configuration.
+------------------------------------------------------------------------
+r1229 | wittend99 | 2013-03-26 10:22:42 -0500 (Tue, 26 Mar 2013) | 1 line
+
+Reduce minimum size of the top level frame to let it be used on 1024 x 600 displays.
+------------------------------------------------------------------------
+r1228 | wittend99 | 2013-03-26 10:22:07 -0500 (Tue, 26 Mar 2013) | 1 line
+
+Reduce minimum size of the top level frame to let it be used on 1024 x 600 displays.
+------------------------------------------------------------------------
+r1227 | drowe67 | 2013-03-25 15:33:49 -0500 (Mon, 25 Mar 2013) | 1 line
+
+checked in Stuarts patches 1 thru 4
+------------------------------------------------------------------------
+r1226 | wittend99 | 2013-03-24 17:21:11 -0500 (Sun, 24 Mar 2013) | 1 line
+
+Removed comment
+------------------------------------------------------------------------
+r1224 | drowe67 | 2013-03-24 00:47:15 -0500 (Sun, 24 Mar 2013) | 1 line
+
+prototype 1600 wide mode
+------------------------------------------------------------------------
+r1223 | drowe67 | 2013-03-22 17:51:40 -0500 (Fri, 22 Mar 2013) | 1 line
+
+disabled a few extraneous test modes for v0.96 release
+------------------------------------------------------------------------
+r1221 | drowe67 | 2013-03-19 22:51:21 -0500 (Tue, 19 Mar 2013) | 1 line
+
+bump version
+------------------------------------------------------------------------
+r1219 | drowe67 | 2013-03-19 20:35:29 -0500 (Tue, 19 Mar 2013) | 1 line
+
+made test frames count high error rate frames to get a more accurate result
+------------------------------------------------------------------------
+r1218 | drowe67 | 2013-03-19 20:21:35 -0500 (Tue, 19 Mar 2013) | 1 line
+
+integrated and tested more reliable odd/even frame sync, I think it's an improvement on 4dB poor channel
+------------------------------------------------------------------------
+r1213 | drowe67 | 2013-03-18 02:30:28 -0500 (Mon, 18 Mar 2013) | 1 line
+
+removed clip, added new 1600 bit/s mode (1300+FEC)
+------------------------------------------------------------------------
+r1205 | drowe67 | 2013-03-08 22:00:48 -0600 (Fri, 08 Mar 2013) | 1 line
+
+support for clipping of tx waveform
+------------------------------------------------------------------------
+r1204 | drowe67 | 2013-03-08 17:59:51 -0600 (Fri, 08 Mar 2013) | 1 line
+
+normalised tx power across modes
+------------------------------------------------------------------------
+r1203 | drowe67 | 2013-03-08 14:49:30 -0600 (Fri, 08 Mar 2013) | 1 line
+
+Support in Windows Makefile for golay module
+------------------------------------------------------------------------
+r1202 | drowe67 | 2013-03-08 01:45:10 -0600 (Fri, 08 Mar 2013) | 1 line
+
+changed version number
+------------------------------------------------------------------------
+r1201 | drowe67 | 2013-03-08 01:24:29 -0600 (Fri, 08 Mar 2013) | 1 line
+
+first pass at bit error patterns being plotted
+------------------------------------------------------------------------
+r1199 | drowe67 | 2013-03-07 21:15:29 -0600 (Thu, 07 Mar 2013) | 1 line
+
+added multi-channel support to plot scalar, tested OK with 1 channel
+------------------------------------------------------------------------
+r1198 | drowe67 | 2013-03-07 20:40:11 -0600 (Thu, 07 Mar 2013) | 1 line
+
+BER tx and tx working OK, tested with some simulated AWGN and CCIR files
+------------------------------------------------------------------------
+r1197 | drowe67 | 2013-03-07 01:37:11 -0600 (Thu, 07 Mar 2013) | 1 line
+
+FEC on 2000 mode implemented but not tested with errors (yet)
+------------------------------------------------------------------------
+r1196 | drowe67 | 2013-03-07 01:23:02 -0600 (Thu, 07 Mar 2013) | 1 line
+
+2000 bit/s mode seems to be transmitting OK
+------------------------------------------------------------------------
+r1194 | drowe67 | 2013-03-07 00:49:11 -0600 (Thu, 07 Mar 2013) | 1 line
+
+both 1400 and 1600 modes working in loopback, needed to test 1400V0.91 against a V0.91 release
+------------------------------------------------------------------------
+r1189 | drowe67 | 2013-03-06 22:18:54 -0600 (Wed, 06 Mar 2013) | 1 line
+
+added mode radio-buttons to front page of GUI
+------------------------------------------------------------------------
+r1155 | wittend99 | 2012-12-30 16:41:15 -0600 (Sun, 30 Dec 2012) | 1 line
+
+Trivial updates, looking for uninitialized variables and other loose ends.
+------------------------------------------------------------------------
+r1154 | wittend99 | 2012-12-29 17:28:53 -0600 (Sat, 29 Dec 2012) | 1 line
+
+Add files README.osx and freedv_osx_port.patch.gz, update credits.txt file.  Not much else.
+------------------------------------------------------------------------
+r1153 | wittend99 | 2012-12-29 13:10:49 -0600 (Sat, 29 Dec 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r1152 | drowe67 | 2012-12-23 18:14:07 -0600 (Sun, 23 Dec 2012) | 1 line
+
+first pass at autotools build system, thanks Patrick, not tested at this stage, Makefile.linux still works
+------------------------------------------------------------------------
+r1151 | drowe67 | 2012-12-22 01:29:28 -0600 (Sat, 22 Dec 2012) | 1 line
+
+changed changed fifo.h and fdmdv.h to more unique names codec2_fifo.h & codec2_fdmdv.h
+------------------------------------------------------------------------
+r1145 | wittend99 | 2012-12-16 20:43:05 -0600 (Sun, 16 Dec 2012) | 1 line
+
+Unversion some pieces unintentionally added by restructuring.
+------------------------------------------------------------------------
+r1144 | wittend99 | 2012-12-16 20:40:23 -0600 (Sun, 16 Dec 2012) | 1 line
+
+Added a msvc folder to build for a future MS C++ build.
+------------------------------------------------------------------------
+r1143 | wittend99 | 2012-12-16 20:33:05 -0600 (Sun, 16 Dec 2012) | 1 line
+
+Move all Codelite-Mingw build environment from ./build to ./build/codelite
+------------------------------------------------------------------------
+r1142 | wittend99 | 2012-12-16 20:04:21 -0600 (Sun, 16 Dec 2012) | 1 line
+
+Add codelite subfolder.
+------------------------------------------------------------------------
+r1141 | wittend99 | 2012-12-16 19:56:46 -0600 (Sun, 16 Dec 2012) | 1 line
+
+Work on moving multiple unrelated classes out of fdmdv_main.cpp, cleanup dead code.
+------------------------------------------------------------------------
+r1140 | drowe67 | 2012-12-16 16:57:25 -0600 (Sun, 16 Dec 2012) | 1 line
+
+disabled jack with portaudio based on mailing list feedback, thanks guys
+------------------------------------------------------------------------
+r1139 | drowe67 | 2012-12-16 00:24:46 -0600 (Sun, 16 Dec 2012) | 1 line
+
+typo in README.linux
+------------------------------------------------------------------------
+r1138 | drowe67 | 2012-12-16 00:22:52 -0600 (Sun, 16 Dec 2012) | 1 line
+
+2nd pass at generic Makefile.linux
+------------------------------------------------------------------------
+r1137 | drowe67 | 2012-12-15 17:28:45 -0600 (Sat, 15 Dec 2012) | 1 line
+
+experimental new makefile for Linux that downloads and builds most of the libraries we need, tested on Ubuntu 9.1 and 10.04
+------------------------------------------------------------------------
+r1136 | drowe67 | 2012-12-15 06:14:13 -0600 (Sat, 15 Dec 2012) | 1 line
+
+makefile modified for Ubuntu 10.04
+------------------------------------------------------------------------
+r1135 | drowe67 | 2012-12-15 05:41:44 -0600 (Sat, 15 Dec 2012) | 1 line
+
+experimental Linux makefile, about to test on Ubuntu 10.04
+------------------------------------------------------------------------
+r1134 | wittend99 | 2012-12-14 15:36:21 -0600 (Fri, 14 Dec 2012) | 1 line
+
+Comment out the event handlers which were connected to the wrong check boxes in the PTT dialog. This _should_ have no effect on behavior because the event handlers in question were unused in the current code.
+------------------------------------------------------------------------
+r1133 | wittend99 | 2012-12-12 19:11:14 -0600 (Wed, 12 Dec 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r1132 | wittend99 | 2012-12-11 08:43:05 -0600 (Tue, 11 Dec 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r1131 | drowe67 | 2012-12-10 18:31:12 -0600 (Mon, 10 Dec 2012) | 1 line
+
+added some debug code to trap reported sox lib errors
+------------------------------------------------------------------------
+r1130 | wittend99 | 2012-12-10 18:05:18 -0600 (Mon, 10 Dec 2012) | 2 lines
+
+Moved version.h from /fdmdv2 to /fdmdv2/src. 
+Removed four orphaned lib files from /fdmdv2
+------------------------------------------------------------------------
+r1129 | wittend99 | 2012-12-10 17:37:17 -0600 (Mon, 10 Dec 2012) | 2 lines
+
+Renamed (finally) OnTogBtnTXClick to OnTogBtnPTT globally.  
+Removed fdmdv2-doc/* for now - to reduce traffic for first time users. Probably to be replaced with freedv-doc when useful content stabilizes.
+------------------------------------------------------------------------
+r1128 | drowe67 | 2012-12-09 23:36:38 -0600 (Sun, 09 Dec 2012) | 1 line
+
+small edits to README.Linux
+------------------------------------------------------------------------
+r1127 | drowe67 | 2012-12-09 23:33:18 -0600 (Sun, 09 Dec 2012) | 1 line
+
+after testing half duplex on Windows
+------------------------------------------------------------------------
+r1126 | drowe67 | 2012-12-09 23:09:11 -0600 (Sun, 09 Dec 2012) | 1 line
+
+first pass at half duplex, still testing
+------------------------------------------------------------------------
+r1125 | wittend99 | 2012-12-09 19:55:45 -0600 (Sun, 09 Dec 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r1124 | drowe67 | 2012-12-06 18:14:53 -0600 (Thu, 06 Dec 2012) | 1 line
+
+analog 6dB boost on mic, some experiments with waterfall blue colors, using 200-2800Hz for waterfall max AGC level, and updated Linux compile notes
+------------------------------------------------------------------------
+r1123 | drowe67 | 2012-12-05 21:04:43 -0600 (Wed, 05 Dec 2012) | 1 line
+
+added V0.9 Beta version code and support for future versioning via version.txt
+------------------------------------------------------------------------
+r1122 | drowe67 | 2012-12-05 15:06:24 -0600 (Wed, 05 Dec 2012) | 1 line
+
+added Codec 2 build instructions to README.Win32
+------------------------------------------------------------------------
+r1121 | wittend99 | 2012-12-05 09:22:25 -0600 (Wed, 05 Dec 2012) | 1 line
+
+More work on PTT button.
+------------------------------------------------------------------------
+r1120 | drowe67 | 2012-12-04 18:37:25 -0600 (Tue, 04 Dec 2012) | 1 line
+
+fix for File-Exit, works under Linux
+------------------------------------------------------------------------
+r1119 | wittend99 | 2012-12-04 15:27:23 -0600 (Tue, 04 Dec 2012) | 1 line
+
+Improve layout of PTT dialog layout under Linux
+------------------------------------------------------------------------
+r1118 | drowe67 | 2012-12-04 00:52:27 -0600 (Tue, 04 Dec 2012) | 1 line
+
+removed a few prints and #ifdefed out the display of txid/rxid buttons for now as feature wont be implemented for the beta
+------------------------------------------------------------------------
+r1117 | wittend99 | 2012-12-03 22:27:26 -0600 (Mon, 03 Dec 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r1116 | wittend99 | 2012-12-03 21:41:59 -0600 (Mon, 03 Dec 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r1115 | wittend99 | 2012-12-03 21:39:40 -0600 (Mon, 03 Dec 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r1114 | drowe67 | 2012-12-02 23:42:18 -0600 (Sun, 02 Dec 2012) | 1 line
+
+better shut down of EQ states to prevent bombing with sound card error
+------------------------------------------------------------------------
+r1113 | drowe67 | 2012-12-02 23:31:12 -0600 (Sun, 02 Dec 2012) | 1 line
+
+speaker eq states now being preserved and can take eqs in and out at run time
+------------------------------------------------------------------------
+r1112 | drowe67 | 2012-12-02 19:41:38 -0600 (Sun, 02 Dec 2012) | 1 line
+
+real time EQ adjustment working, designing filters on the fly, but still a few GUI and context save/restore bugs
+------------------------------------------------------------------------
+r1111 | drowe67 | 2012-12-02 04:39:21 -0600 (Sun, 02 Dec 2012) | 1 line
+
+EQ enable and separate default buttons, ready to wire up real time code
+------------------------------------------------------------------------
+r1110 | drowe67 | 2012-12-02 03:18:22 -0600 (Sun, 02 Dec 2012) | 1 line
+
+make axis labels dissapear if windows small enough to make text overlap
+------------------------------------------------------------------------
+r1109 | drowe67 | 2012-12-01 20:48:07 -0600 (Sat, 01 Dec 2012) | 1 line
+
+first pass at speaker eq controls
+------------------------------------------------------------------------
+r1108 | drowe67 | 2012-12-01 20:26:13 -0600 (Sat, 01 Dec 2012) | 1 line
+
+some tweaks to mic in filter
+------------------------------------------------------------------------
+r1107 | drowe67 | 2012-12-01 18:01:07 -0600 (Sat, 01 Dec 2012) | 1 line
+
+3 band equaliser for Mic In working on dialog, not connected to actual real time speech yet
+------------------------------------------------------------------------
+r1106 | drowe67 | 2012-12-01 02:38:43 -0600 (Sat, 01 Dec 2012) | 1 line
+
+fixed some registry probs on Win32, read & write formats were different.  Think its OK now
+------------------------------------------------------------------------
+r1105 | drowe67 | 2012-12-01 01:46:36 -0600 (Sat, 01 Dec 2012) | 1 line
+
+reduced filter dialog size
+------------------------------------------------------------------------
+r1104 | drowe67 | 2012-12-01 00:07:39 -0600 (Sat, 01 Dec 2012) | 1 line
+
+instructions for building sox on Win32 and modified win32 makefile for sox
+------------------------------------------------------------------------
+r1103 | wittend99 | 2012-11-30 22:20:24 -0600 (Fri, 30 Nov 2012) | 1 line
+
+Fix some things about PTT.
+------------------------------------------------------------------------
+r1102 | drowe67 | 2012-11-30 22:06:23 -0600 (Fri, 30 Nov 2012) | 1 line
+
+first pass at real time update of MicIn spectrum in response to slider
+------------------------------------------------------------------------
+r1095 | drowe67 | 2012-11-30 19:56:34 -0600 (Fri, 30 Nov 2012) | 1 line
+
+reduced size of filter dialog so it fits on 800 high screens...
+------------------------------------------------------------------------
+r1094 | drowe67 | 2012-11-30 19:09:11 -0600 (Fri, 30 Nov 2012) | 1 line
+
+equaliser: one slider partially connected
+------------------------------------------------------------------------
+r1093 | wittend99 | 2012-11-30 18:52:49 -0600 (Fri, 30 Nov 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r1092 | drowe67 | 2012-11-30 18:02:09 -0600 (Fri, 30 Nov 2012) | 1 line
+
+wrote and unit tested library to use sox biqaud filter
+------------------------------------------------------------------------
+r1091 | wittend99 | 2012-11-30 14:29:40 -0600 (Fri, 30 Nov 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r1090 | wittend99 | 2012-11-29 20:39:08 -0600 (Thu, 29 Nov 2012) | 1 line
+
+No more segfault, problem was not in this code.  Fixes to the PTT signal polarity, should work now, but not properly tested.
+------------------------------------------------------------------------
+r1088 | drowe67 | 2012-11-29 18:36:46 -0600 (Thu, 29 Nov 2012) | 1 line
+
+Win32 makefile and install notes for libctb
+------------------------------------------------------------------------
+r1086 | drowe67 | 2012-11-29 17:30:25 -0600 (Thu, 29 Nov 2012) | 1 line
+
+modified Linux makefile for libctb, added build instructions for libctb
+------------------------------------------------------------------------
+r1085 | wittend99 | 2012-11-29 16:22:25 -0600 (Thu, 29 Nov 2012) | 1 line
+
+I should have noted - this and the previous commit give me a segfault when the audio processing runs.
+------------------------------------------------------------------------
+r1084 | wittend99 | 2012-11-29 16:18:52 -0600 (Thu, 29 Nov 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r1083 | drowe67 | 2012-11-26 23:03:09 -0600 (Mon, 26 Nov 2012) | 1 line
+
+rewrote callsign system along fdmdv1 lines
+------------------------------------------------------------------------
+r1082 | drowe67 | 2012-11-26 21:39:17 -0600 (Mon, 26 Nov 2012) | 1 line
+
+rescaled waterfall and spectrum to be 300Hz wide, as per fdmdv1
+------------------------------------------------------------------------
+r1080 | drowe67 | 2012-11-26 20:41:12 -0600 (Mon, 26 Nov 2012) | 1 line
+
+added play file to From Radio option
+------------------------------------------------------------------------
+r1079 | drowe67 | 2012-11-26 19:24:40 -0600 (Mon, 26 Nov 2012) | 1 line
+
+automatic scaling of spectrogram, and toggling color mapping.  Think it works better but need to try on real signals
+------------------------------------------------------------------------
+r1078 | drowe67 | 2012-11-26 16:48:17 -0600 (Mon, 26 Nov 2012) | 1 line
+
+implemented level guage on tx & rx inclduing too high warning
+------------------------------------------------------------------------
+r1077 | drowe67 | 2012-11-26 14:43:08 -0600 (Mon, 26 Nov 2012) | 1 line
+
+number of secords to record from radio hard coded for Win32 as I cant read number of secs from dialog ctrl
+------------------------------------------------------------------------
+r1073 | drowe67 | 2012-11-26 00:03:20 -0600 (Mon, 26 Nov 2012) | 1 line
+
+receive data now doing something sensible, but I think rxid window is too big
+------------------------------------------------------------------------
+r1070 | wittend99 | 2012-11-25 20:37:41 -0600 (Sun, 25 Nov 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r1069 | drowe67 | 2012-11-25 18:23:24 -0600 (Sun, 25 Nov 2012) | 1 line
+
+first pass with data, can send messages and printf to screen.  Need to think about silence thresholds/time outs
+------------------------------------------------------------------------
+r1066 | drowe67 | 2012-11-25 03:34:47 -0600 (Sun, 25 Nov 2012) | 1 line
+
+tx id callback working on Linux
+------------------------------------------------------------------------
+r1065 | drowe67 | 2012-11-25 03:28:31 -0600 (Sun, 25 Nov 2012) | 1 line
+
+started hooking up controls for tx and rx data experiments
+------------------------------------------------------------------------
+r1064 | drowe67 | 2012-11-25 03:27:04 -0600 (Sun, 25 Nov 2012) | 1 line
+
+modified varicode decoder to retain state between calls so it can be interrupted half way thru decoding one character
+------------------------------------------------------------------------
+r1063 | drowe67 | 2012-11-25 00:01:27 -0600 (Sun, 25 Nov 2012) | 1 line
+
+Filter dialog all hooked up to Codec, still requires testing
+------------------------------------------------------------------------
+r1062 | wittend99 | 2012-11-24 20:38:37 -0600 (Sat, 24 Nov 2012) | 1 line
+
+Work on PTT control dialog. Not finished...
+------------------------------------------------------------------------
+r1060 | drowe67 | 2012-11-24 18:00:28 -0600 (Sat, 24 Nov 2012) | 1 line
+
+basic filter dialog screen working, after usual pain with sizers
+------------------------------------------------------------------------
+r1059 | drowe67 | 2012-11-24 16:03:07 -0600 (Sat, 24 Nov 2012) | 1 line
+
+added filter dialog, it displays OK but doesn't do anything yet.  test OK under Linux
+------------------------------------------------------------------------
+r1058 | drowe67 | 2012-11-24 05:02:48 -0600 (Sat, 24 Nov 2012) | 1 line
+
+varicode encoding and decoding, passes unittest
+------------------------------------------------------------------------
+r1056 | drowe67 | 2012-11-23 17:27:07 -0600 (Fri, 23 Nov 2012) | 1 line
+
+minor tweaks to scatter scaling
+------------------------------------------------------------------------
+r1055 | drowe67 | 2012-11-23 17:04:43 -0600 (Fri, 23 Nov 2012) | 1 line
+
+automatic scaling of scatter diagram, quite nice to watch
+------------------------------------------------------------------------
+r1054 | drowe67 | 2012-11-23 16:39:17 -0600 (Fri, 23 Nov 2012) | 1 line
+
+higher resn FFT, red tuning line, automatic page switching on tx/rx, works OK on Linux
+------------------------------------------------------------------------
+r1052 | drowe67 | 2012-11-23 13:51:46 -0600 (Fri, 23 Nov 2012) | 1 line
+
+modified Makefiles for DW cleanup, modified waterfall to handle slow waterfall updates where DT nmaps to less than one vertical pixel.  Waterfall now covers 30 seconds. Works OK on Linux
+------------------------------------------------------------------------
+r1051 | wittend99 | 2012-11-23 10:24:35 -0600 (Fri, 23 Nov 2012) | 1 line
+
+Removed unnecessary or distracting Files, C++ Classes, members, and unimplemented code.
+------------------------------------------------------------------------
+r1050 | wittend99 | 2012-11-23 10:01:05 -0600 (Fri, 23 Nov 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r1049 | wittend99 | 2012-11-23 09:59:26 -0600 (Fri, 23 Nov 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r1048 | drowe67 | 2012-11-23 04:41:31 -0600 (Fri, 23 Nov 2012) | 1 line
+
+wired up squelch, added slow SNR option, works OK on Linux, need to test on Win32
+------------------------------------------------------------------------
+r1046 | drowe67 | 2012-11-22 13:39:05 -0600 (Thu, 22 Nov 2012) | 1 line
+
+modified split so tx doesn't change, version number in program title on main window, edited to-do
+------------------------------------------------------------------------
+r1045 | drowe67 | 2012-11-21 17:28:54 -0600 (Wed, 21 Nov 2012) | 1 line
+
+click tune with split and tx logic, works OK on Linux
+------------------------------------------------------------------------
+r1043 | drowe67 | 2012-11-20 23:31:22 -0600 (Tue, 20 Nov 2012) | 1 line
+
+tx and rx click tune, tied together (non split)
+------------------------------------------------------------------------
+r1042 | drowe67 | 2012-11-20 22:57:41 -0600 (Tue, 20 Nov 2012) | 1 line
+
+rx click tune using globals resulted in a cleaner design although I would prefer not to have used globals.  Maybe passing the address of the freq offset in the waterfall/spectrum constructor would have ben cleaner
+------------------------------------------------------------------------
+r1041 | drowe67 | 2012-11-20 22:32:21 -0600 (Tue, 20 Nov 2012) | 1 line
+
+first pass at click to tune for rx.  It works OK, but the communication of the click freq sucks so I might try re-writing that bit
+------------------------------------------------------------------------
+r1040 | drowe67 | 2012-11-20 04:07:13 -0600 (Tue, 20 Nov 2012) | 1 line
+
+looks up svn revision from the Internet
+------------------------------------------------------------------------
+r1039 | drowe67 | 2012-11-20 02:58:55 -0600 (Tue, 20 Nov 2012) | 1 line
+
+attemp at support for svn revsion under windows 
+------------------------------------------------------------------------
+r1038 | drowe67 | 2012-11-20 02:53:47 -0600 (Tue, 20 Nov 2012) | 1 line
+
+testing adding svn revision to about (yet again)
+------------------------------------------------------------------------
+r1037 | drowe67 | 2012-11-20 02:52:51 -0600 (Tue, 20 Nov 2012) | 1 line
+
+testing adding svn revision to about (and again)
+------------------------------------------------------------------------
+r1036 | drowe67 | 2012-11-20 02:45:28 -0600 (Tue, 20 Nov 2012) | 1 line
+
+testing adding svn revision to about (again)
+------------------------------------------------------------------------
+r1035 | drowe67 | 2012-11-20 02:44:30 -0600 (Tue, 20 Nov 2012) | 1 line
+
+testing adding svn revision to about
+------------------------------------------------------------------------
+r1034 | wittend99 | 2012-11-19 21:55:22 -0600 (Mon, 19 Nov 2012) | 1 line
+
+Modified the header comment block of all files to indicate GPL license.
+------------------------------------------------------------------------
+r1033 | drowe67 | 2012-11-19 20:49:53 -0600 (Mon, 19 Nov 2012) | 1 line
+
+removed tx & rx loopback, as they no longer necc
+------------------------------------------------------------------------
+r1032 | drowe67 | 2012-11-19 20:37:44 -0600 (Mon, 19 Nov 2012) | 1 line
+
+added record from radio feature, works OK on wave and raw files, can demod/decode aved files using command line tools
+------------------------------------------------------------------------
+r1031 | drowe67 | 2012-11-19 04:14:34 -0600 (Mon, 19 Nov 2012) | 1 line
+
+wav and raw at the same time, can't position loop checkbox correctly...
+------------------------------------------------------------------------
+r1030 | drowe67 | 2012-11-19 03:56:56 -0600 (Mon, 19 Nov 2012) | 1 line
+
+added some todos to readme.linux, added play file to mic in feature
+------------------------------------------------------------------------
+r1024 | drowe67 | 2012-11-18 21:49:16 -0600 (Sun, 18 Nov 2012) | 1 line
+
+changed labels on audo config test, fifo header file change
+------------------------------------------------------------------------
+r1023 | wittend99 | 2012-11-18 21:20:58 -0600 (Sun, 18 Nov 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r1016 | drowe67 | 2012-11-17 22:26:06 -0600 (Sat, 17 Nov 2012) | 1 line
+
+tried static text fields for API tab of audio config dlg
+------------------------------------------------------------------------
+r1015 | drowe67 | 2012-11-17 17:03:02 -0600 (Sat, 17 Nov 2012) | 1 line
+
+was a bit unstable under ubuntu/alsa so added some mutex protection around fifo access that is shared by callsbacks and tx/rx processing threads.  Alsa now seems more stable.
+------------------------------------------------------------------------
+r1014 | drowe67 | 2012-11-17 16:07:23 -0600 (Sat, 17 Nov 2012) | 1 line
+
+experimental thread based tx/rx processing.  Seems more stable on Windows and works better with Rig Blaster despite dirfting tx/rx sample clock.  Still some start up transients, i.e. loss of sync in first few seconds and occasionally thereafter
+------------------------------------------------------------------------
+r1001 | drowe67 | 2012-11-16 20:11:54 -0600 (Fri, 16 Nov 2012) | 1 line
+
+moved tx and rx processing to OnIdle, using device-defined buffer sizes for portaudio callbacks.  Still testing.
+------------------------------------------------------------------------
+r978 | drowe67 | 2012-11-15 22:08:38 -0600 (Thu, 15 Nov 2012) | 1 line
+
+experimental support for mono record devices such as the rig blaster, still testing
+------------------------------------------------------------------------
+r970 | drowe67 | 2012-11-14 05:12:26 -0600 (Wed, 14 Nov 2012) | 1 line
+
+made sample rate combo box wider
+------------------------------------------------------------------------
+r969 | drowe67 | 2012-11-14 02:17:13 -0600 (Wed, 14 Nov 2012) | 1 line
+
+nicer layout with test feature
+------------------------------------------------------------------------
+r968 | drowe67 | 2012-11-13 16:34:42 -0600 (Tue, 13 Nov 2012) | 1 line
+
+test feature for all 4 audio devices, tested OK on Ubuntu 9.10, needs work on the layout
+------------------------------------------------------------------------
+r967 | drowe67 | 2012-11-13 02:18:53 -0600 (Tue, 13 Nov 2012) | 1 line
+
+first pass at a test tool for audio config dialog that plots input to a little screen.  Just rx in at this stage.  Some indication that it is occasionally unstable.  Might need to convert to async/callback model
+------------------------------------------------------------------------
+r966 | drowe67 | 2012-11-12 17:03:04 -0600 (Mon, 12 Nov 2012) | 1 line
+
+Sync indicator now works for Windows, but isn't multicolour like on Linux. As it is implemented with a radio button, unfortunately the user can press it.
+------------------------------------------------------------------------
+r965 | drowe67 | 2012-11-12 16:23:18 -0600 (Mon, 12 Nov 2012) | 1 line
+
+minor tweaks to SNR positioning
+------------------------------------------------------------------------
+r964 | drowe67 | 2012-11-12 15:43:36 -0600 (Mon, 12 Nov 2012) | 1 line
+
+Testing wxlogdebug and added device number to device name in config dialog to help ID devices with the same name under Windows
+------------------------------------------------------------------------
+r963 | drowe67 | 2012-11-12 14:22:51 -0600 (Mon, 12 Nov 2012) | 1 line
+
+added some notes to Linux README
+------------------------------------------------------------------------
+r962 | wittend99 | 2012-11-12 13:53:33 -0600 (Mon, 12 Nov 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r961 | drowe67 | 2012-11-11 22:40:02 -0600 (Sun, 11 Nov 2012) | 1 line
+
+small sample rate selection bug
+------------------------------------------------------------------------
+r960 | drowe67 | 2012-11-11 22:30:48 -0600 (Sun, 11 Nov 2012) | 1 line
+
+fixed bug, can now run soudn card1 at 44kHz
+------------------------------------------------------------------------
+r959 | drowe67 | 2012-11-11 19:34:32 -0600 (Sun, 11 Nov 2012) | 1 line
+
+After testing on an Alsa based Ubuntu 10 machine: tweaked layout, added dynamic sample rate list generation to dlg_audioconfig, refactored a few routines that got messy, and separated portaudio device number from list box index to support non-duplex devices
+------------------------------------------------------------------------
+r958 | drowe67 | 2012-11-11 15:58:29 -0600 (Sun, 11 Nov 2012) | 1 line
+
+improved detection of erros due to removed sound card
+------------------------------------------------------------------------
+r957 | drowe67 | 2012-11-11 04:05:21 -0600 (Sun, 11 Nov 2012) | 1 line
+
+disable Audio Config dialog when running
+------------------------------------------------------------------------
+r956 | drowe67 | 2012-11-10 19:22:01 -0600 (Sat, 10 Nov 2012) | 1 line
+
+first pass at connecting audio config dialog to rest of system.  Can configure single and dual card systems on Unbuntu 9.10.  Still a few situations that can crash system
+------------------------------------------------------------------------
+r955 | drowe67 | 2012-11-08 22:38:02 -0600 (Thu, 08 Nov 2012) | 1 line
+
+removed some accel key debug warnings on start up
+------------------------------------------------------------------------
+r954 | drowe67 | 2012-11-08 21:16:52 -0600 (Thu, 08 Nov 2012) | 1 line
+
+peristent storing of squelch levels to config file
+------------------------------------------------------------------------
+r953 | drowe67 | 2012-11-08 20:43:55 -0600 (Thu, 08 Nov 2012) | 1 line
+
+wired up analog mode
+------------------------------------------------------------------------
+r952 | drowe67 | 2012-11-08 20:29:35 -0600 (Thu, 08 Nov 2012) | 1 line
+
+removed ALC
+------------------------------------------------------------------------
+r951 | drowe67 | 2012-11-08 19:56:45 -0600 (Thu, 08 Nov 2012) | 1 line
+
+positioned squelch and snr static text correctly and stays centred
+------------------------------------------------------------------------
+r950 | drowe67 | 2012-11-07 22:19:29 -0600 (Wed, 07 Nov 2012) | 1 line
+
+playing with squelch slider, but not happy with layout
+------------------------------------------------------------------------
+r949 | drowe67 | 2012-11-07 19:35:43 -0600 (Wed, 07 Nov 2012) | 1 line
+
+hooked up sync LED, changed SNR text box to static text to prevent it getting focus
+------------------------------------------------------------------------
+r948 | drowe67 | 2012-11-07 17:14:42 -0600 (Wed, 07 Nov 2012) | 1 line
+
+formatting, and added freq shifter in front of demod to suport click tune feature
+------------------------------------------------------------------------
+r944 | wittend99 | 2012-11-07 13:09:14 -0600 (Wed, 07 Nov 2012) | 1 line
+
+Remove dependencies in Icon files in dlg_audiooptions.*.  Eliminated use of icons for now.  They were ugly anyway.  Dialog returns the string form of the chosen interface, and not the if # for now.  This can be trivially changed.
+------------------------------------------------------------------------
+r939 | wittend99 | 2012-11-06 20:09:35 -0600 (Tue, 06 Nov 2012) | 1 line
+
+Changed dlg_audio.* to dlg_audiooptions.*, changed other dlg code, altered makefiles.
+------------------------------------------------------------------------
+r938 | wittend99 | 2012-11-06 08:18:21 -0600 (Tue, 06 Nov 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r937 | drowe67 | 2012-11-05 18:47:29 -0600 (Mon, 05 Nov 2012) | 1 line
+
+Added editor set up instructions to avoid problems with tabs
+------------------------------------------------------------------------
+r936 | drowe67 | 2012-11-05 17:58:54 -0600 (Mon, 05 Nov 2012) | 1 line
+
+changed Davids emacs to use spaces rather than tabs
+------------------------------------------------------------------------
+r935 | wittend99 | 2012-11-05 13:22:16 -0600 (Mon, 05 Nov 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r934 | drowe67 | 2012-11-05 02:20:38 -0600 (Mon, 05 Nov 2012) | 1 line
+
+Added libresample
+------------------------------------------------------------------------
+r933 | drowe67 | 2012-11-05 02:18:35 -0600 (Mon, 05 Nov 2012) | 1 line
+
+added libsamplerate
+------------------------------------------------------------------------
+r932 | drowe67 | 2012-11-05 01:46:54 -0600 (Mon, 05 Nov 2012) | 1 line
+
+SNR text box and bar graph hooked up
+------------------------------------------------------------------------
+r931 | drowe67 | 2012-11-04 23:25:34 -0600 (Sun, 04 Nov 2012) | 1 line
+
+building up soundcard auto detect code
+------------------------------------------------------------------------
+r930 | drowe67 | 2012-11-04 23:04:49 -0600 (Sun, 04 Nov 2012) | 1 line
+
+improved speech plots with a better decimation algorithm
+------------------------------------------------------------------------
+r928 | drowe67 | 2012-11-04 18:23:51 -0600 (Sun, 04 Nov 2012) | 1 line
+
+added experimental waveform plots, the idea is to usethm as a tool to adjust levels. Not sure if they are useful yet...
+------------------------------------------------------------------------
+r927 | drowe67 | 2012-11-04 17:11:29 -0600 (Sun, 04 Nov 2012) | 1 line
+
+first pass at plot-scalar working to produce timing and frequency offset plots
+------------------------------------------------------------------------
+r926 | drowe67 | 2012-11-03 17:15:48 -0500 (Sat, 03 Nov 2012) | 1 line
+
+cleaned up some code after adjusting demod sample rate slip 
+------------------------------------------------------------------------
+r924 | drowe67 | 2012-11-03 16:30:41 -0500 (Sat, 03 Nov 2012) | 1 line
+
+refactored sample rate conversion code to clean up sound card 1 call back, works OK
+------------------------------------------------------------------------
+r923 | wittend99 | 2012-11-03 10:57:11 -0500 (Sat, 03 Nov 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r922 | drowe67 | 2012-11-03 02:53:32 -0500 (Sat, 03 Nov 2012) | 1 line
+
+shutdown codec for libresample states
+------------------------------------------------------------------------
+r921 | drowe67 | 2012-11-03 01:32:20 -0500 (Sat, 03 Nov 2012) | 1 line
+
+libresample used for all 4 sample rate conversions, but needs clean up into functions.
+------------------------------------------------------------------------
+r920 | drowe67 | 2012-11-03 01:13:21 -0500 (Sat, 03 Nov 2012) | 1 line
+
+partial port to libresample, using 48kHz for one sound card and 44.1kHz for another
+------------------------------------------------------------------------
+r918 | drowe67 | 2012-11-02 01:26:16 -0500 (Fri, 02 Nov 2012) | 1 line
+
+debug version while testing different headphones
+------------------------------------------------------------------------
+r917 | drowe67 | 2012-11-01 21:56:57 -0500 (Thu, 01 Nov 2012) | 1 line
+
+working better with new headphones - about to remove some debug printfs
+------------------------------------------------------------------------
+r916 | drowe67 | 2012-11-01 19:02:56 -0500 (Thu, 01 Nov 2012) | 1 line
+
+debug version, looking for reason mic audio is getting corrupted
+------------------------------------------------------------------------
+r915 | wittend99 | 2012-11-01 17:31:35 -0500 (Thu, 01 Nov 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r902 | drowe67 | 2012-10-30 20:58:52 -0500 (Tue, 30 Oct 2012) | 1 line
+
+modified for independant in and output portaudio devices to suit Win32.
+------------------------------------------------------------------------
+r901 | drowe67 | 2012-10-30 19:18:00 -0500 (Tue, 30 Oct 2012) | 1 line
+
+first pass at full duplex working ... two sound card, tx looped back to rx audio, can hear what I am saying in headset.  Still some stability issues
+------------------------------------------------------------------------
+r900 | drowe67 | 2012-10-30 18:40:11 -0500 (Tue, 30 Oct 2012) | 1 line
+
+have tx process doing something with one sound card - it sends a signal that I can loop back to rx with good quality scatter diagram.  Next stage is to enable the 2nd sound card
+------------------------------------------------------------------------
+r899 | drowe67 | 2012-10-30 01:18:02 -0500 (Tue, 30 Oct 2012) | 1 line
+
+first attempt at support for two sound cardsand tx processing.  Debugging tx side
+------------------------------------------------------------------------
+r888 | drowe67 | 2012-10-28 22:29:37 -0500 (Sun, 28 Oct 2012) | 1 line
+
+replaced buffers in rx callback with fifos to ease porting to two sound cards
+------------------------------------------------------------------------
+r873 | wittend99 | 2012-10-28 18:14:06 -0500 (Sun, 28 Oct 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r855 | drowe67 | 2012-10-28 03:31:55 -0500 (Sun, 28 Oct 2012) | 1 line
+
+changed portaudio buffer size to make OSS work a little better on Ububtu 9.10 - but still cant adjust mic gain
+------------------------------------------------------------------------
+r831 | drowe67 | 2012-10-27 00:36:22 -0500 (Sat, 27 Oct 2012) | 1 line
+
+Fixed Waterfall/Spectrum axis labels on windows.  Rx loop also decodes modem signals OK, sounds good, no clicks or pops!
+------------------------------------------------------------------------
+r829 | drowe67 | 2012-10-26 18:47:18 -0500 (Fri, 26 Oct 2012) | 1 line
+
+Davids R's first version building on Win32
+------------------------------------------------------------------------
+r825 | wittend99 | 2012-10-25 17:05:20 -0500 (Thu, 25 Oct 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r816 | wittend99 | 2012-10-25 14:34:02 -0500 (Thu, 25 Oct 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r815 | wittend99 | 2012-10-25 14:27:38 -0500 (Thu, 25 Oct 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r814 | wittend99 | 2012-10-25 14:23:10 -0500 (Thu, 25 Oct 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r813 | wittend99 | 2012-10-25 13:45:14 -0500 (Thu, 25 Oct 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r812 | wittend99 | 2012-10-25 13:39:14 -0500 (Thu, 25 Oct 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r811 | wittend99 | 2012-10-25 08:50:56 -0500 (Thu, 25 Oct 2012) | 1 line
+
+Just update my IDE configuration probably of no interest to anyone but me. DMW  
+------------------------------------------------------------------------
+r804 | wittend99 | 2012-10-24 10:30:04 -0500 (Wed, 24 Oct 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r803 | drowe67 | 2012-10-24 03:14:35 -0500 (Wed, 24 Oct 2012) | 1 line
+
+first pass at a working scatter plot - haven't tested on real modem signals yet
+------------------------------------------------------------------------
+r802 | drowe67 | 2012-10-23 19:50:22 -0500 (Tue, 23 Oct 2012) | 1 line
+
+renamed a few variables for consistency, spectrum now working
+------------------------------------------------------------------------
+r801 | drowe67 | 2012-10-23 19:20:06 -0500 (Tue, 23 Oct 2012) | 1 line
+
+fixed axis labels on waterfall and tweaked those on spectrum
+------------------------------------------------------------------------
+r800 | wittend99 | 2012-10-23 17:12:37 -0500 (Tue, 23 Oct 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r799 | wittend99 | 2012-10-23 17:07:13 -0500 (Tue, 23 Oct 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r798 | drowe67 | 2012-10-23 16:03:44 -0500 (Tue, 23 Oct 2012) | 1 line
+
+spectrum plot drawGraticule() working OK with nice labels
+------------------------------------------------------------------------
+r797 | drowe67 | 2012-10-23 05:05:13 -0500 (Tue, 23 Oct 2012) | 1 line
+
+added some code to handle resizing better, and fact OnSize can't be relied upon to be called for bit map allocation
+------------------------------------------------------------------------
+r796 | drowe67 | 2012-10-23 04:37:49 -0500 (Tue, 23 Oct 2012) | 1 line
+
+cleaned up a little, made var names consistent with plot spectrum
+------------------------------------------------------------------------
+r795 | drowe67 | 2012-10-23 04:26:30 -0500 (Tue, 23 Oct 2012) | 1 line
+
+fixed wrong window dimensions, was reading past endof array and writing past end of bit map
+------------------------------------------------------------------------
+r794 | wittend99 | 2012-10-22 10:46:47 -0500 (Mon, 22 Oct 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r793 | wittend99 | 2012-10-22 10:31:13 -0500 (Mon, 22 Oct 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r792 | wittend99 | 2012-10-22 10:21:49 -0500 (Mon, 22 Oct 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r791 | wittend99 | 2012-10-22 10:20:43 -0500 (Mon, 22 Oct 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r790 | wittend99 | 2012-10-22 10:11:26 -0500 (Mon, 22 Oct 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r789 | wittend99 | 2012-10-22 10:10:00 -0500 (Mon, 22 Oct 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r788 | wittend99 | 2012-10-22 10:09:37 -0500 (Mon, 22 Oct 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r787 | drowe67 | 2012-10-21 20:35:43 -0500 (Sun, 21 Oct 2012) | 1 line
+
+spent a few hours trying to debug Stop not erasing bottom 25% of Waterfall, but haven't fixed bug.  Leaving for now
+------------------------------------------------------------------------
+r786 | drowe67 | 2012-10-20 18:59:33 -0500 (Sat, 20 Oct 2012) | 1 line
+
+waterfall working at slow update rate on Linux, some visual bugs on stop & restart
+------------------------------------------------------------------------
+r785 | drowe67 | 2012-10-20 17:58:04 -0500 (Sat, 20 Oct 2012) | 1 line
+
+related timer period to update interval of Waterfall
+------------------------------------------------------------------------
+r784 | drowe67 | 2012-10-20 17:56:42 -0500 (Sat, 20 Oct 2012) | 1 line
+
+removed debug printfs
+------------------------------------------------------------------------
+r783 | drowe67 | 2012-10-20 17:50:34 -0500 (Sat, 20 Oct 2012) | 1 line
+
+free g_RxInBuf on Stop
+------------------------------------------------------------------------
+r782 | drowe67 | 2012-10-19 21:29:23 -0500 (Fri, 19 Oct 2012) | 1 line
+
+bottom line of spectrogram working at 500ms period
+------------------------------------------------------------------------
+r781 | drowe67 | 2012-10-19 18:22:35 -0500 (Fri, 19 Oct 2012) | 1 line
+
+bitmap test pattern working
+------------------------------------------------------------------------
+r780 | drowe67 | 2012-10-19 16:43:56 -0500 (Fri, 19 Oct 2012) | 1 line
+
+libsndfile support
+------------------------------------------------------------------------
+r779 | wittend99 | 2012-10-19 16:28:59 -0500 (Fri, 19 Oct 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r778 | wittend99 | 2012-10-19 07:54:57 -0500 (Fri, 19 Oct 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r777 | drowe67 | 2012-10-18 23:50:43 -0500 (Thu, 18 Oct 2012) | 1 line
+
+initial cjeck in of wxWdigets image test dir
+------------------------------------------------------------------------
+r766 | wittend99 | 2012-10-17 07:53:44 -0500 (Wed, 17 Oct 2012) | 2 lines
+
+minimal changes.
+
+------------------------------------------------------------------------
+r765 | wittend99 | 2012-10-16 12:25:48 -0500 (Tue, 16 Oct 2012) | 1 line
+
+Updating doxygen documentation and removing some unnecessary junk that has accumulated. 
+------------------------------------------------------------------------
+r764 | wittend99 | 2012-10-16 10:32:32 -0500 (Tue, 16 Oct 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r763 | wittend99 | 2012-10-16 10:17:09 -0500 (Tue, 16 Oct 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r762 | wittend99 | 2012-10-16 10:16:45 -0500 (Tue, 16 Oct 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r761 | wittend99 | 2012-10-15 21:01:27 -0500 (Mon, 15 Oct 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r760 | wittend99 | 2012-10-15 20:29:25 -0500 (Mon, 15 Oct 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r759 | wittend99 | 2012-10-15 20:28:47 -0500 (Mon, 15 Oct 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r757 | drowe67 | 2012-10-15 16:19:49 -0500 (Mon, 15 Oct 2012) | 1 line
+
+main demod processing loop runs without crashing
+------------------------------------------------------------------------
+r752 | drowe67 | 2012-10-14 22:59:03 -0500 (Sun, 14 Oct 2012) | 1 line
+
+added a fifo buffer to interface between framesPerBufferof portaudio and the buffer size we need for modem processing. Basic audio loopback working now
+------------------------------------------------------------------------
+r748 | drowe67 | 2012-10-13 16:50:57 -0500 (Sat, 13 Oct 2012) | 1 line
+
+build instructions for Linux
+------------------------------------------------------------------------
+r747 | drowe67 | 2012-10-13 02:25:50 -0500 (Sat, 13 Oct 2012) | 1 line
+
+temp. disabled timer and rx callback to stabilise, can start/stop without crashing now
+------------------------------------------------------------------------
+r746 | drowe67 | 2012-10-13 01:32:03 -0500 (Sat, 13 Oct 2012) | 1 line
+
+re-orged linux Makefile a little
+------------------------------------------------------------------------
+r745 | wittend99 | 2012-10-12 16:49:51 -0500 (Fri, 12 Oct 2012) | 1 line
+
+Convert line endings to UNIX style for readability. 
+------------------------------------------------------------------------
+r744 | drowe67 | 2012-10-11 19:53:06 -0500 (Thu, 11 Oct 2012) | 1 line
+
+changed syntax of extern g_avmag to fix segfault
+------------------------------------------------------------------------
+r743 | drowe67 | 2012-10-11 18:29:14 -0500 (Thu, 11 Oct 2012) | 1 line
+
+added setColour to prevent bombing on Linux
+------------------------------------------------------------------------
+r742 | drowe67 | 2012-10-11 00:16:50 -0500 (Thu, 11 Oct 2012) | 1 line
+
+first pass at Makefile for Linux
+------------------------------------------------------------------------
+r740 | wittend99 | 2012-10-09 22:31:50 -0500 (Tue, 09 Oct 2012) | 1 line
+
+Killer bug.  Data point array not initialized?
+------------------------------------------------------------------------
+r739 | wittend99 | 2012-10-08 08:29:38 -0500 (Mon, 08 Oct 2012) | 1 line
+
+Receive side connected, segfault still to be tracked down. 
+------------------------------------------------------------------------
+r738 | wittend99 | 2012-10-06 14:16:25 -0500 (Sat, 06 Oct 2012) | 1 line
+
+Various incremental advances.  Not 'there' yet.
+------------------------------------------------------------------------
+r731 | wittend99 | 2012-09-19 12:21:32 -0500 (Wed, 19 Sep 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r730 | wittend99 | 2012-09-19 12:11:30 -0500 (Wed, 19 Sep 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r716 | wittend99 | 2012-09-17 13:16:46 -0500 (Mon, 17 Sep 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r712 | wittend99 | 2012-09-14 18:26:51 -0500 (Fri, 14 Sep 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r676 | wittend99 | 2012-09-11 15:10:16 -0500 (Tue, 11 Sep 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r675 | wittend99 | 2012-09-11 14:58:36 -0500 (Tue, 11 Sep 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r674 | wittend99 | 2012-09-11 14:51:11 -0500 (Tue, 11 Sep 2012) | 1 line
+
+no longer needed.
+------------------------------------------------------------------------
+r673 | wittend99 | 2012-09-11 14:49:55 -0500 (Tue, 11 Sep 2012) | 1 line
+
+no longer needed.
+------------------------------------------------------------------------
+r672 | wittend99 | 2012-09-11 14:44:56 -0500 (Tue, 11 Sep 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r671 | wittend99 | 2012-09-11 14:36:45 -0500 (Tue, 11 Sep 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r670 | wittend99 | 2012-09-11 12:13:28 -0500 (Tue, 11 Sep 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r667 | wittend99 | 2012-09-10 11:45:37 -0500 (Mon, 10 Sep 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r666 | wittend99 | 2012-09-10 11:25:14 -0500 (Mon, 10 Sep 2012) | 1 line
+
+Beginning to add some code documentation using Doxygen.
+------------------------------------------------------------------------
+r663 | wittend99 | 2012-09-04 21:54:00 -0500 (Tue, 04 Sep 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r662 | wittend99 | 2012-09-04 21:47:34 -0500 (Tue, 04 Sep 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r660 | wittend99 | 2012-09-04 15:44:29 -0500 (Tue, 04 Sep 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r659 | wittend99 | 2012-09-04 15:43:00 -0500 (Tue, 04 Sep 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r658 | wittend99 | 2012-09-04 15:40:24 -0500 (Tue, 04 Sep 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r647 | wittend99 | 2012-08-28 23:03:56 -0500 (Tue, 28 Aug 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r646 | wittend99 | 2012-08-28 22:54:54 -0500 (Tue, 28 Aug 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r645 | wittend99 | 2012-08-28 22:50:53 -0500 (Tue, 28 Aug 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r643 | wittend99 | 2012-08-27 12:01:45 -0500 (Mon, 27 Aug 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r639 | wittend99 | 2012-08-24 14:01:17 -0500 (Fri, 24 Aug 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r638 | wittend99 | 2012-08-24 14:00:49 -0500 (Fri, 24 Aug 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r637 | wittend99 | 2012-08-24 13:56:48 -0500 (Fri, 24 Aug 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r636 | wittend99 | 2012-08-22 12:33:04 -0500 (Wed, 22 Aug 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r634 | wittend99 | 2012-08-21 16:29:09 -0500 (Tue, 21 Aug 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r633 | wittend99 | 2012-08-21 13:26:23 -0500 (Tue, 21 Aug 2012) | 1 line
+
+Working to get an Autotools build in place.
+------------------------------------------------------------------------
+r632 | wittend99 | 2012-08-20 15:09:21 -0500 (Mon, 20 Aug 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r631 | wittend99 | 2012-08-20 14:54:14 -0500 (Mon, 20 Aug 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r630 | wittend99 | 2012-08-20 14:53:49 -0500 (Mon, 20 Aug 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r629 | wittend99 | 2012-08-20 14:52:31 -0500 (Mon, 20 Aug 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r628 | wittend99 | 2012-08-20 14:43:10 -0500 (Mon, 20 Aug 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r627 | wittend99 | 2012-08-17 15:57:31 -0500 (Fri, 17 Aug 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r626 | wittend99 | 2012-08-17 15:50:27 -0500 (Fri, 17 Aug 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r625 | wittend99 | 2012-08-17 15:50:00 -0500 (Fri, 17 Aug 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r624 | wittend99 | 2012-08-17 15:48:58 -0500 (Fri, 17 Aug 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r623 | wittend99 | 2012-08-17 15:43:19 -0500 (Fri, 17 Aug 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r622 | wittend99 | 2012-08-17 15:42:13 -0500 (Fri, 17 Aug 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r621 | wittend99 | 2012-08-17 15:20:38 -0500 (Fri, 17 Aug 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r620 | wittend99 | 2012-08-17 15:18:55 -0500 (Fri, 17 Aug 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r619 | wittend99 | 2012-08-17 15:18:39 -0500 (Fri, 17 Aug 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r618 | wittend99 | 2012-08-17 15:18:24 -0500 (Fri, 17 Aug 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r617 | wittend99 | 2012-08-17 15:10:20 -0500 (Fri, 17 Aug 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r616 | wittend99 | 2012-08-17 15:07:18 -0500 (Fri, 17 Aug 2012) | 1 line
+
+For variant versions
+------------------------------------------------------------------------
+r615 | wittend99 | 2012-08-17 15:05:10 -0500 (Fri, 17 Aug 2012) | 1 line
+
+Moved to ./3rdparty
+------------------------------------------------------------------------
+r614 | wittend99 | 2012-08-17 15:03:59 -0500 (Fri, 17 Aug 2012) | 1 line
+
+Moved to ./3rdparty
+------------------------------------------------------------------------
+r613 | wittend99 | 2012-08-17 15:02:47 -0500 (Fri, 17 Aug 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r612 | wittend99 | 2012-08-14 21:31:28 -0500 (Tue, 14 Aug 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r589 | wittend99 | 2012-07-15 15:45:52 -0500 (Sun, 15 Jul 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r588 | wittend99 | 2012-07-15 15:44:30 -0500 (Sun, 15 Jul 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r571 | wittend99 | 2012-06-18 10:10:40 -0500 (Mon, 18 Jun 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r570 | wittend99 | 2012-06-18 10:07:01 -0500 (Mon, 18 Jun 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r569 | wittend99 | 2012-06-18 10:06:26 -0500 (Mon, 18 Jun 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r568 | wittend99 | 2012-06-18 10:04:56 -0500 (Mon, 18 Jun 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r567 | wittend99 | 2012-06-18 10:04:10 -0500 (Mon, 18 Jun 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r566 | wittend99 | 2012-06-18 09:16:14 -0500 (Mon, 18 Jun 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r565 | wittend99 | 2012-06-18 09:13:02 -0500 (Mon, 18 Jun 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r564 | wittend99 | 2012-06-18 09:10:53 -0500 (Mon, 18 Jun 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r563 | wittend99 | 2012-06-18 09:08:49 -0500 (Mon, 18 Jun 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r562 | wittend99 | 2012-06-18 08:54:08 -0500 (Mon, 18 Jun 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r561 | wittend99 | 2012-06-18 08:52:45 -0500 (Mon, 18 Jun 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r560 | wittend99 | 2012-06-18 08:52:08 -0500 (Mon, 18 Jun 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r559 | wittend99 | 2012-06-18 08:51:00 -0500 (Mon, 18 Jun 2012) | 1 line
+
+Update svn:ignore
+------------------------------------------------------------------------
+r558 | wittend99 | 2012-06-18 08:45:24 -0500 (Mon, 18 Jun 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r557 | wittend99 | 2012-06-18 08:44:06 -0500 (Mon, 18 Jun 2012) | 1 line
+
+Some cleanup
+------------------------------------------------------------------------
+r556 | wittend99 | 2012-06-17 10:05:25 -0500 (Sun, 17 Jun 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r555 | wittend99 | 2012-06-17 10:03:12 -0500 (Sun, 17 Jun 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r554 | wittend99 | 2012-06-17 10:02:44 -0500 (Sun, 17 Jun 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r553 | wittend99 | 2012-06-17 10:00:29 -0500 (Sun, 17 Jun 2012) | 1 line
+
+Bunches of work on portaudio, still not done. Added fdmdvBasic tor testing, it is the same as the main app without the graphic spectrum display.  It may not be useful for without the waterfall display for tuning. 
+------------------------------------------------------------------------
+r551 | wittend99 | 2012-06-15 09:26:24 -0500 (Fri, 15 Jun 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r550 | wittend99 | 2012-06-15 09:25:06 -0500 (Fri, 15 Jun 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r549 | wittend99 | 2012-06-15 09:20:30 -0500 (Fri, 15 Jun 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r548 | wittend99 | 2012-06-15 09:19:41 -0500 (Fri, 15 Jun 2012) | 1 line
+
+experiments
+------------------------------------------------------------------------
+r547 | wittend99 | 2012-06-15 09:18:07 -0500 (Fri, 15 Jun 2012) | 1 line
+
+update build from codec2-dev 545
+------------------------------------------------------------------------
+r546 | wittend99 | 2012-06-12 07:30:44 -0500 (Tue, 12 Jun 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r521 | wittend99 | 2012-05-30 21:53:15 -0500 (Wed, 30 May 2012) | 1 line
+
+Still working on the audio dialog, mostly.
+------------------------------------------------------------------------
+r520 | wittend99 | 2012-05-29 22:43:11 -0500 (Tue, 29 May 2012) | 1 line
+
+Work on portaudio dialog, misc. cleanup.
+------------------------------------------------------------------------
+r518 | wittend99 | 2012-05-29 18:27:43 -0500 (Tue, 29 May 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r517 | wittend99 | 2012-05-29 18:26:27 -0500 (Tue, 29 May 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r516 | wittend99 | 2012-05-29 18:07:56 -0500 (Tue, 29 May 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r515 | wittend99 | 2012-05-29 17:53:59 -0500 (Tue, 29 May 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r514 | wittend99 | 2012-05-29 17:53:42 -0500 (Tue, 29 May 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r513 | wittend99 | 2012-05-29 17:53:00 -0500 (Tue, 29 May 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r512 | wittend99 | 2012-05-29 17:50:22 -0500 (Tue, 29 May 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r511 | wittend99 | 2012-05-29 17:49:51 -0500 (Tue, 29 May 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r510 | wittend99 | 2012-05-29 17:49:13 -0500 (Tue, 29 May 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r509 | wittend99 | 2012-05-29 17:48:28 -0500 (Tue, 29 May 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r508 | wittend99 | 2012-05-29 17:47:54 -0500 (Tue, 29 May 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r507 | wittend99 | 2012-05-29 17:35:24 -0500 (Tue, 29 May 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r505 | wittend99 | 2012-05-27 12:34:55 -0500 (Sun, 27 May 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r504 | wittend99 | 2012-05-27 10:44:30 -0500 (Sun, 27 May 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r503 | wittend99 | 2012-05-27 10:41:44 -0500 (Sun, 27 May 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r502 | wittend99 | 2012-05-26 22:10:12 -0500 (Sat, 26 May 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r501 | wittend99 | 2012-05-26 21:53:08 -0500 (Sat, 26 May 2012) | 1 line
+
+fdmdv2dll builds, as yet untested though.
+------------------------------------------------------------------------
+r500 | wittend99 | 2012-05-26 09:05:50 -0500 (Sat, 26 May 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r499 | wittend99 | 2012-05-26 08:31:29 -0500 (Sat, 26 May 2012) | 1 line
+
+changed this to fdmdv2dll
+------------------------------------------------------------------------
+r498 | wittend99 | 2012-05-26 08:30:03 -0500 (Sat, 26 May 2012) | 1 line
+
+Attempting to clean up the project.
+------------------------------------------------------------------------
+r497 | wittend99 | 2012-05-26 08:26:01 -0500 (Sat, 26 May 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r495 | wittend99 | 2012-05-26 07:59:29 -0500 (Sat, 26 May 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r494 | wittend99 | 2012-05-26 07:17:59 -0500 (Sat, 26 May 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r493 | wittend99 | 2012-05-26 07:17:28 -0500 (Sat, 26 May 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r491 | wittend99 | 2012-05-24 18:46:43 -0500 (Thu, 24 May 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r486 | wittend99 | 2012-05-21 21:23:11 -0500 (Mon, 21 May 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r485 | wittend99 | 2012-05-19 20:58:55 -0500 (Sat, 19 May 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r480 | wittend99 | 2012-05-17 21:16:32 -0500 (Thu, 17 May 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r479 | wittend99 | 2012-05-17 21:10:59 -0500 (Thu, 17 May 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r478 | wittend99 | 2012-05-17 21:09:48 -0500 (Thu, 17 May 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r477 | wittend99 | 2012-05-17 21:08:19 -0500 (Thu, 17 May 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r476 | wittend99 | 2012-05-17 21:07:58 -0500 (Thu, 17 May 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r475 | wittend99 | 2012-05-17 21:06:15 -0500 (Thu, 17 May 2012) | 1 line
+
+Catching up before things get into a snarl.
+------------------------------------------------------------------------
+r474 | wittend99 | 2012-05-17 13:06:55 -0500 (Thu, 17 May 2012) | 1 line
+
+More basic required library files.
+------------------------------------------------------------------------
+r473 | wittend99 | 2012-05-17 12:54:14 -0500 (Thu, 17 May 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r472 | wittend99 | 2012-05-17 10:08:08 -0500 (Thu, 17 May 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r471 | wittend99 | 2012-05-17 10:03:24 -0500 (Thu, 17 May 2012) | 1 line
+
+More work with portaudiocpp
+------------------------------------------------------------------------
+r470 | wittend99 | 2012-05-15 21:31:30 -0500 (Tue, 15 May 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r469 | wittend99 | 2012-05-15 14:11:26 -0500 (Tue, 15 May 2012) | 1 line
+
+synching things up...
+------------------------------------------------------------------------
+r468 | wittend99 | 2012-05-15 14:07:29 -0500 (Tue, 15 May 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r467 | wittend99 | 2012-05-15 08:47:57 -0500 (Tue, 15 May 2012) | 1 line
+
+Fun with portaudio!
+------------------------------------------------------------------------
+r466 | wittend99 | 2012-05-15 08:44:43 -0500 (Tue, 15 May 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r465 | wittend99 | 2012-05-15 08:44:23 -0500 (Tue, 15 May 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r464 | wittend99 | 2012-05-15 08:44:02 -0500 (Tue, 15 May 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r463 | wittend99 | 2012-05-15 08:42:49 -0500 (Tue, 15 May 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r462 | wittend99 | 2012-05-14 20:25:56 -0500 (Mon, 14 May 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r460 | wittend99 | 2012-05-13 20:04:35 -0500 (Sun, 13 May 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r459 | wittend99 | 2012-05-13 19:55:29 -0500 (Sun, 13 May 2012) | 1 line
+
+built libs and headers for linking
+------------------------------------------------------------------------
+r458 | wittend99 | 2012-05-13 19:51:07 -0500 (Sun, 13 May 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r456 | wittend99 | 2012-05-13 19:25:07 -0500 (Sun, 13 May 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r455 | wittend99 | 2012-05-13 19:13:32 -0500 (Sun, 13 May 2012) | 1 line
+
+Notes about building portaudio for fdmdv2.
+------------------------------------------------------------------------
+r453 | wittend99 | 2012-05-13 16:19:57 -0500 (Sun, 13 May 2012) | 1 line
+
+portaudio portable audio framework
+------------------------------------------------------------------------
+r452 | wittend99 | 2012-05-13 16:10:42 -0500 (Sun, 13 May 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r451 | wittend99 | 2012-05-13 15:49:44 -0500 (Sun, 13 May 2012) | 1 line
+
+remove incorrect paths
+------------------------------------------------------------------------
+r450 | wittend99 | 2012-05-13 15:49:03 -0500 (Sun, 13 May 2012) | 1 line
+
+Workspace for the Codelite IDE
+------------------------------------------------------------------------
+r449 | wittend99 | 2012-05-13 15:48:16 -0500 (Sun, 13 May 2012) | 1 line
+
+fixup some paths
+------------------------------------------------------------------------
+r448 | wittend99 | 2012-05-13 15:44:49 -0500 (Sun, 13 May 2012) | 1 line
+
+project file for Codelite
+------------------------------------------------------------------------
+r447 | wittend99 | 2012-05-13 14:43:58 -0500 (Sun, 13 May 2012) | 1 line
+
+Potentially for use for rig control
+------------------------------------------------------------------------
+r446 | wittend99 | 2012-05-13 14:32:29 -0500 (Sun, 13 May 2012) | 1 line
+
+Possible rs-232 Comm library for use if needed. Born of frustration with existing options. After all these years isn't there a decent, usable, documented cross-platform library somewhere?
+------------------------------------------------------------------------
+r445 | wittend99 | 2012-05-13 14:20:14 -0500 (Sun, 13 May 2012) | 1 line
+
+A copy of libsndfile.dll built for Win32 using MinGW + MSYS on Win7 
+------------------------------------------------------------------------
+r444 | wittend99 | 2012-05-13 14:17:16 -0500 (Sun, 13 May 2012) | 1 line
+
+Just running notes about where ideas and code have come from.
+------------------------------------------------------------------------
+r443 | wittend99 | 2012-05-13 14:10:56 -0500 (Sun, 13 May 2012) | 1 line
+
+Class declarations for the spectrum and waterfall classes.
+------------------------------------------------------------------------
+r442 | wittend99 | 2012-05-13 14:08:16 -0500 (Sun, 13 May 2012) | 1 line
+
+Intended to be a superclass to the waterfall and spectrum plot classes.  Currently the UI just instantiates one directly derived for each window in the wxNotebook display.
+------------------------------------------------------------------------
+r441 | wittend99 | 2012-05-13 14:03:07 -0500 (Sun, 13 May 2012) | 1 line
+
+
+------------------------------------------------------------------------
+r440 | wittend99 | 2012-05-13 11:30:57 -0500 (Sun, 13 May 2012) | 1 line
+
+UI Project 'main' header
+------------------------------------------------------------------------
+r439 | wittend99 | 2012-05-13 11:30:12 -0500 (Sun, 13 May 2012) | 1 line
+
+UI project 'main' module
+------------------------------------------------------------------------
+r438 | wittend99 | 2012-05-13 11:28:34 -0500 (Sun, 13 May 2012) | 1 line
+
+Workspace for CodeLite
+------------------------------------------------------------------------
+r437 | wittend99 | 2012-05-13 11:03:53 -0500 (Sun, 13 May 2012) | 1 line
+
+An XRC definition of the UI window classes.  Can be used by wxWidgets, but is just for reference in this project.
+------------------------------------------------------------------------
+r436 | wittend99 | 2012-05-13 11:01:37 -0500 (Sun, 13 May 2012) | 1 line
+
+wxFormbuilder generated Python version of the UI classes, included just for grins (for now)
+------------------------------------------------------------------------
+r435 | wittend99 | 2012-05-13 10:59:09 -0500 (Sun, 13 May 2012) | 1 line
+
+wxFormbuilder generated UI class declarations. (topframe.* are all generated classes. Don' Edit!)
+------------------------------------------------------------------------
+r434 | wittend99 | 2012-05-13 10:56:34 -0500 (Sun, 13 May 2012) | 1 line
+
+Defines the top level frame window for the UI as well as the dialogs.  the MainFrame classs and all of the dialog classes inherit from this.
+------------------------------------------------------------------------
+r433 | wittend99 | 2012-05-13 10:53:43 -0500 (Sun, 13 May 2012) | 1 line
+
+wxFormbuilder Project File used to create the top-level UI and the dialogs.  Probably requires wxFormbuilder v. 3.3.2-beta or above. This generates topframe.h, topframe.cpp, (and topframe.py, topframe.xrc for experimentation).  Use this with care.
+------------------------------------------------------------------------
+r432 | wittend99 | 2012-05-13 10:45:54 -0500 (Sun, 13 May 2012) | 1 line
+
+Sound file Read/Write library
+------------------------------------------------------------------------
+r431 | wittend99 | 2012-05-13 10:39:42 -0500 (Sun, 13 May 2012) | 1 line
+
+sample rate conversion library aka "Secret Rabbit Code"
+------------------------------------------------------------------------
+r430 | wittend99 | 2012-05-13 10:31:45 -0500 (Sun, 13 May 2012) | 1 line
+
+General Program Options Dialog Header
+------------------------------------------------------------------------
+r429 | wittend99 | 2012-05-13 10:30:39 -0500 (Sun, 13 May 2012) | 1 line
+
+General Program Options Dialog
+------------------------------------------------------------------------
+r428 | wittend99 | 2012-05-13 10:29:55 -0500 (Sun, 13 May 2012) | 1 line
+
+Comm Ports Dialog Header
+------------------------------------------------------------------------
+r427 | wittend99 | 2012-05-13 10:29:07 -0500 (Sun, 13 May 2012) | 1 line
+
+Comm Ports Dialog
+------------------------------------------------------------------------
+r426 | wittend99 | 2012-05-13 10:27:58 -0500 (Sun, 13 May 2012) | 1 line
+
+Audio Dialog Header
+------------------------------------------------------------------------
+r425 | wittend99 | 2012-05-13 10:27:22 -0500 (Sun, 13 May 2012) | 1 line
+
+Audio Dialog
+------------------------------------------------------------------------
+r424 | wittend99 | 2012-05-13 10:26:11 -0500 (Sun, 13 May 2012) | 1 line
+
+help>About Header
+------------------------------------------------------------------------
+r423 | wittend99 | 2012-05-13 10:25:24 -0500 (Sun, 13 May 2012) | 1 line
+
+help>About Dialog.
+------------------------------------------------------------------------
+r422 | wittend99 | 2012-05-13 10:23:55 -0500 (Sun, 13 May 2012) | 1 line
+
+wxWidgets DLL file used for Win32 build.
+------------------------------------------------------------------------
+r421 | wittend99 | 2012-05-13 10:08:46 -0500 (Sun, 13 May 2012) | 1 line
+
+A folder for fdmdv-2 UI work.
+------------------------------------------------------------------------
diff --git a/freedv/branches/0.97/DEBIAN_DEVEL.sh b/freedv/branches/0.97/DEBIAN_DEVEL.sh
new file mode 100644 (file)
index 0000000..71cf970
--- /dev/null
@@ -0,0 +1 @@
+apt-get install cmake gcc g++ libportaudio-dev libhamlib-dev libsamplerate-dev libsndfile-dev libsox-dev libgtk-3-dev libasound-dev
diff --git a/freedv/branches/0.97/DEBIAN_RUNTIME.sh b/freedv/branches/0.97/DEBIAN_RUNTIME.sh
new file mode 100644 (file)
index 0000000..239945f
--- /dev/null
@@ -0,0 +1 @@
+apt-get install libportaudio2 libhamlib2 libsamplerate0 libsndfile1 libsox2 libgtk-3-0 libasound2
diff --git a/freedv/branches/0.97/Desktop.ini b/freedv/branches/0.97/Desktop.ini
new file mode 100644 (file)
index 0000000..ae60713
Binary files /dev/null and b/freedv/branches/0.97/Desktop.ini differ
diff --git a/freedv/branches/0.97/INSTALL b/freedv/branches/0.97/INSTALL
new file mode 100644 (file)
index 0000000..2d82cd6
--- /dev/null
@@ -0,0 +1,74 @@
+The CMake configuration for FDMDV2 (FreeDV) is the primary build method at
+this time and has been thouroughly tested on Fedora Linux and will likely work
+well on most *nix systems and has many advanages over the autotools config.
+
+It should also work on Windows environments but only the mingw-w64 is tested
+to work using the MSYS2 environment. Others may work but you're on your own.
+
+- Builds against system libraries (by default).
+- Or optionally download, build, and statically link with required libraries on
+  an individual basis. See USE_STATIC_??? options. 
+  NOTE: We need test reports on mingw/Windows, not all dependencies will build.
+- Has experimental NSIS packaing support for Windows (WIN32) targets. *nix
+  systems should rely on 'make install' or tradional packaing methods as the
+  packages (RPM & DEB) created by CPack are questionable.
+
+==================================
+ Building and installing on Linux
+==================================
+
+To perform a cmake build create a directory anywhere underneath (or outside of)
+the source directory.
+
+Linux command line example:
+
+$ cd /path/to/fdmdv2
+$ mkdir build_linux
+$ cd build_linux
+$ cmake ../ (defaults to /usr/local, use CMAKE_INSTALL_PREFIX to override)
+(if no errors)
+$ make
+(as root)
+$ make install
+
+====================================
+ Building and installing on Windows
+====================================
+
+The windows build is similar to linux and follows the same basic workflow.
+
+Only MinGW is supported. While it is likely possible to perform a pure MinGW
+build, installing MSYS will make your life easier.
+
+CMake may not automatically detect that you're in the MSYS environment. If this
+occurs you need to pass cmake the proper generator:
+
+cmake -G"MSYS Makefiles" [other options] </path/to/source>
+
+===============================
+ Bootstrapping wxWidgets build
+===============================
+
+If wxWidgets (>= 3.0) is not available then one option is to have CMake boot-
+strap the build for FreeDV.
+
+This is required because the tool wx-config is used to get the correct compiler
+and linker flags of the wxWidgets components needed by FreeDV. Since this is
+normally done at configure time, not during "make", it is not possible for CMake
+to have this information prior to building wxWidgets.
+
+In order to work around this issue you can "bootstrap" the wxWidgets build using
+the CMake option, "BOOTSTRAP_WXWIDGETS". wxWidgets will be built using static 
+libraries.
+
+NOTE: This forces "USE_STATIC_WXWIDGETS" to be true internally regarless of the
+value set manually.
+
+(from any prefered directory outside of the source)
+$ cmake -DBOOTSTRAP_WXWIDGETS=TRUE <path to fdmdv2 source>
+$ make
+(wxWidgets is downloaded and built)
+$ cmake .
+$ make
+(if all goes well, as root)
+$ make install
diff --git a/freedv/branches/0.97/NEWS b/freedv/branches/0.97/NEWS
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/freedv/branches/0.97/README b/freedv/branches/0.97/README
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/freedv/branches/0.97/README.txt b/freedv/branches/0.97/README.txt
new file mode 100644 (file)
index 0000000..f54ff34
--- /dev/null
@@ -0,0 +1,114 @@
+==================================
+ Building and installing on Linux
+==================================
+
+Quickstart 1
+-----------
+
+Builds static versions of wxWidgets, portaudio, codec2-dev, which are commonly
+missing on many Linux systems, or of the wrong (older) version.
+
+Assuming the freedv-dev sources is checked out into ~/fdmdv2-dev:
+
+$ cd fdmdv2-dev
+$ mkdir build_linux
+$ cd build_linux
+$ cmake -DBOOTSTRAP_WXWIDGETS=TRUE ~/fdmdv2-dev
+$ make
+[wxWidgets builds]
+
+Then you can use your local codec-dev, something like:
+
+$ cmake cmake -DBOOTSTRAP_WXWIDGETS=TRUE -DCODEC2_INCLUDE_DIR=/home/david/codec2-dev/src -DCODEC2_LIBRARY=/home/david/codec2-dev/build_linux/src/libcodec2.so -DUSE_STATIC_CODEC2=FALSE -DUSE_STATIC_PORTAUDIO=TRUE -DUSE_STATIC_SOX=TRUE ../
+
+OR build a local copy of codec2-dev:
+
+$ cmake cmake -DBOOTSTRAP_WXWIDGETS=TRUE -DUSE_STATIC_CODEC2=TRUE -DUSE_STATIC_PORTAUDIO=TRUE -DUSE_STATIC_SOX=TRUE ../
+
+$ make
+[FreeDV builds]
+$ ./src/freedv
+
+Note: add "-DCMAKE_BUILD_TYPE=Debug" the list above for debug (gcc -g) buildthat include source line numbers.
+
+Quickstart 2
+------------
+
+Assuming you have all the dependant libraries:
+
+$ cd /path/to/fdmdv2
+$ mkdir build_linux
+$ cd build_linux
+$ cmake ../ (defaults to /usr/local, use CMAKE_INSTALL_PREFIX to override)
+(if no errors)
+$ make
+(as root)
+$ make install
+
+====================================
+ Building and installing on Windows
+====================================
+
+The windows build is similar to linux and follows the same basic workflow.
+
+Only MinGW is supported. While it is likely possible to perform a pure MinGW
+build, installing MSYS will make your life easier.
+
+CMake may not automatically detect that you're in the MSYS environment. If this
+occurs you need to pass cmake the proper generator:
+
+cmake -G"MSYS Makefiles" [other options] </path/to/source>
+
+===============================
+ Bootstrapping wxWidgets build
+===============================
+
+If wxWidgets (>= 3.0) is not available then one option is to have CMake boot-
+strap the build for FreeDV.
+
+This is required because the tool wx-config is used to get the correct compiler
+and linker flags of the wxWidgets components needed by FreeDV. Since this is
+normally done at configure time, not during "make", it is not possible for CMake
+or have this information prior to building wxWidgets.
+
+In order to work around this issue you can "bootstrap" the wxWidgets build using
+the CMake option, "BOOTSTRAP_WXWIDGETS". wxWidgets will be built using static
+libraries.
+
+NOTE: This forces "USE_STATIC_WXWIDGETS" to be true internally regarless of the
+value set manually.
+
+(from any prefered, but empty directory outside of the source)
+$ cmake -DBOOTSTRAP_WXWIDGETS=TRUE /path/to/fdmdv2
+$ make
+(wxWidgets is downloaded and built)
+$ cmake .
+$ make
+(if all goes well, as root)
+$ make install
+
+====================================
+ Building and installing on OSX
+====================================
+
+====================================
+ Building and installing on FreeBSD
+====================================
+
+As per "Quickstart 2" above but change build_linux to build_freebsd
+
+=======
+Editing
+=======
+
+Please make sure your text editor does not insert tabs, and
+used indents of 4 spaces.  The following .emacs code was used to
+configure emacs:
+
+(setq-default indent-tabs-mode nil)
+
+(add-hook 'c-mode-common-hook
+          (function (lambda ()
+                      (setq c-basic-offset 4)
+                      )))
+
diff --git a/freedv/branches/0.97/build/codelite/.clang/.gitignore b/freedv/branches/0.97/build/codelite/.clang/.gitignore
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/freedv/branches/0.97/build/codelite/dbfiles/fdmdv2config.sqlite.sql b/freedv/branches/0.97/build/codelite/dbfiles/fdmdv2config.sqlite.sql
new file mode 100644 (file)
index 0000000..fd66b5c
--- /dev/null
@@ -0,0 +1 @@
+CREATE TABLE "configuration" ("prikey" DATETIME PRIMARY KEY  NOT NULL  UNIQUE  DEFAULT CURRENT_TIMESTAMP, "datecreate" DATETIME DEFAULT CURRENT_DATE, "timecreate" DATETIME DEFAULT CURRENT_TIME, "rx_driver_in_idx" INTEGER check(typeof("rx_driver_in_idx") = 'integer') , "rx_driver_in_string" TEXT check(typeof("rx_driver_in_string") = 'text') , "rx_driver_out_idx" INTEGER check(typeof("rx_driver_out_idx") = 'integer') , "rx_driver_out_str" TEXT check(typeof("rx_driver_out_str") = 'text') , "tx_driver_in_idx" INTEGER check(typeof("tx_driver_in_idx") = 'integer') , "tx_driver_in_str" TEXT check(typeof("tx_driver_in_str") = 'text') , "tx_driver_out_idx" INTEGER check(typeof("tx_driver_out_idx") = 'integer') , "tx_driver_out_str" TEXT check(typeof("tx_driver_out_str") = 'text') );
diff --git a/freedv/branches/0.97/build/codelite/dbfiles/fdmdv2config.sqlite.sqlite b/freedv/branches/0.97/build/codelite/dbfiles/fdmdv2config.sqlite.sqlite
new file mode 100644 (file)
index 0000000..eace5f3
Binary files /dev/null and b/freedv/branches/0.97/build/codelite/dbfiles/fdmdv2config.sqlite.sqlite differ
diff --git a/freedv/branches/0.97/build/codelite/dialogtest/MainDialog.cpp b/freedv/branches/0.97/build/codelite/dialogtest/MainDialog.cpp
new file mode 100644 (file)
index 0000000..ce5168e
--- /dev/null
@@ -0,0 +1,62 @@
+#include "MainDialog.h"
+
+PTTDialog::PTTDialog(wxWindow* parent): PTTDialogBaseClass(parent)
+{
+}
+
+PTTDialog::~PTTDialog()
+{
+}
+
+void PTTDialog::DTRVPlusClicked(wxCommandEvent& event)
+{
+    wxMessageBox(wxT("DTRVPlusClicked"));
+}
+
+void PTTDialog::PTTAudioClick(wxCommandEvent& event)
+{
+    wxMessageBox(wxT("PTTAudioClick"));
+}
+
+void PTTDialog::PTTPortSlelcted(wxCommandEvent& event)
+{
+    wxMessageBox(wxT("PTTPortSlelcted"));
+}
+
+void PTTDialog::PTTUseSerialClicked(wxCommandEvent& event)
+{
+    wxMessageBox(wxT("PTTUseSerialClicked"));
+}
+
+void PTTDialog::RTSVPlusClicked(wxCommandEvent& event)
+{
+    wxMessageBox(wxT("RTSVPlusClicked"));
+}
+
+void PTTDialog::UseDTRCliched(wxCommandEvent& event)
+{
+    wxMessageBox(wxT("UseDTRCliched"));
+}
+
+void PTTDialog::UseRTSClicked(wxCommandEvent& event)
+{
+    wxMessageBox(wxT("UseRTSClicked"));
+}
+
+void PTTDialog::OnApply(wxCommandEvent& event)
+{
+    wxMessageBox(wxT("OnApply"));
+}
+
+void PTTDialog::OnCancel(wxCommandEvent& event)
+{
+    wxMessageBox(wxT("OnCancel"));
+}
+
+void PTTDialog::OnOK(wxCommandEvent& event)
+{
+    wxMessageBox(wxT("OnOK"));
+}
+void PTTDialog::OnInitDialog(wxInitDialogEvent& event)
+{
+}
diff --git a/freedv/branches/0.97/build/codelite/dialogtest/MainDialog.h b/freedv/branches/0.97/build/codelite/dialogtest/MainDialog.h
new file mode 100644 (file)
index 0000000..2553079
--- /dev/null
@@ -0,0 +1,39 @@
+#ifndef PTTDialog_H
+#define PTTDialog_H
+#include <wx/wx.h>
+#include "wxcrafter.h"
+
+class PTTDialog : public PTTDialogBaseClass
+{
+public:
+    PTTDialog(wxWindow* parent);
+    virtual ~PTTDialog();
+protected:
+    virtual void OnInitDialog(wxInitDialogEvent& event);
+    wxCheckBox* m_ckPTTRtChan;
+    wxListBox* m_listCtrlPorts;
+    wxCheckBox* m_ckUseSerialPTT;
+    wxRadioButton* m_rbUseDTR;
+    wxCheckBox* m_ckRTSPos;
+    wxRadioButton* m_rbUseRTS;
+    wxCheckBox* m_ckDTRPos;
+    wxButton* m_buttonOK;
+    wxButton* m_buttonCancel;
+    wxButton* m_buttonApply;
+
+    void PTTAudioClick(wxCommandEvent& event);
+    void PTTPortSlelcted(wxCommandEvent& event);
+    void PTTUseSerialClicked(wxCommandEvent& event);
+    void UseDTRCliched(wxCommandEvent& event);
+    void DTRVPlusClicked(wxCommandEvent& event);
+    void UseRTSClicked(wxCommandEvent& event);
+    void RTSVPlusClicked(wxCommandEvent& event);
+
+    virtual void OnApply(wxCommandEvent& event);
+    virtual void OnCancel(wxCommandEvent& event);
+    virtual void OnOK(wxCommandEvent& event);
+
+    void ExchangeData(int inout);
+    void populatePortList(void);
+};
+#endif // PTTDialog_H
diff --git a/freedv/branches/0.97/build/codelite/dialogtest/dialogTest.mk b/freedv/branches/0.97/build/codelite/dialogtest/dialogTest.mk
new file mode 100644 (file)
index 0000000..6d76a82
--- /dev/null
@@ -0,0 +1,147 @@
+##\r
+## Auto Generated makefile by CodeLite IDE\r
+## any manual changes will be erased      \r
+##\r
+## Release\r
+ProjectName            :=dialogTest\r
+ConfigurationName      :=Release\r
+WorkspacePath          := "D:\Projects\Radio\fdmdv2\build"\r
+ProjectPath            := "D:\Projects\Radio\fdmdv2\build"\r
+IntermediateDirectory  :=./Release\r
+OutDir                 := $(IntermediateDirectory)\r
+CurrentFileName        :=\r
+CurrentFilePath        :=\r
+CurrentFileFullPath    :=\r
+User                   :=wittend\r
+Date                   :=12/10/2012\r
+CodeLitePath           :="D:\bin\CodeLite"\r
+LinkerName             :=g++\r
+SharedObjectLinkerName :=g++ -shared -fPIC\r
+ObjectSuffix           :=.o\r
+DependSuffix           :=.o.d\r
+PreprocessSuffix       :=.o.i\r
+DebugSwitch            :=-gstab\r
+IncludeSwitch          :=-I\r
+LibrarySwitch          :=-l\r
+OutputSwitch           :=-o \r
+LibraryPathSwitch      :=-L\r
+PreprocessorSwitch     :=-D\r
+SourceSwitch           :=-c \r
+OutputFile             :=$(IntermediateDirectory)/$(ProjectName)\r
+Preprocessors          :=\r
+ObjectSwitch           :=-o \r
+ArchiveOutputSwitch    := \r
+PreprocessOnlySwitch   :=-E \r
+ObjectsFileList        :="D:\Projects\Radio\fdmdv2\build\dialogTest.txt"\r
+PCHCompileFlags        :=\r
+MakeDirCommand         :=makedir\r
+RcCmpOptions           := $(shell wx-config --rcflags)\r
+RcCompilerName         :=windres\r
+LinkOptions            :=  $(shell wx-config --libs) -mwindows\r
+IncludePath            :=  $(IncludeSwitch). $(IncludeSwitch). \r
+IncludePCH             := \r
+RcIncludePath          := \r
+Libs                   := \r
+ArLibs                 :=  \r
+LibPath                := $(LibraryPathSwitch). \r
+\r
+##\r
+## Common variables\r
+## AR, CXX, CC, CXXFLAGS and CFLAGS can be overriden using an environment variables\r
+##\r
+AR       := ar rcus\r
+CXX      := g++\r
+CC       := gcc\r
+CXXFLAGS :=  -O2 -Wall $(shell wx-config --cflags)  -DSVN_REVISION=\"1128\"  $(Preprocessors)\r
+CFLAGS   :=  -O2 -Wall  -DSVN_REVISION=\"1128\"  $(Preprocessors)\r
+\r
+\r
+##\r
+## User defined environment variables\r
+##\r
+CodeLiteDir:=D:\bin\CodeLite\r
+WXWIN:=D:\bin\wxWidgets-2.9.4\r
+PATH:=$(WXWIN)\lib\gcc_dll;$(PATH)\r
+WXCFG:=gcc_dll\mswu\r
+UNIT_TEST_PP_SRC_DIR:=D:\bin\UnitTest++-1.3\r
+Objects=$(IntermediateDirectory)/main$(ObjectSuffix) $(IntermediateDirectory)/wxcrafter$(ObjectSuffix) $(IntermediateDirectory)/wxcrafter_bitmaps$(ObjectSuffix) $(IntermediateDirectory)/MainDialog$(ObjectSuffix) $(IntermediateDirectory)/win_resources.rc$(ObjectSuffix) \r
+\r
+##\r
+## Main Build Targets \r
+##\r
+.PHONY: all clean PreBuild PrePreBuild PostBuild\r
+all: $(OutputFile)\r
+\r
+$(OutputFile): $(IntermediateDirectory)/.d $(Objects) \r
+       @$(MakeDirCommand) $(@D)\r
+       @echo "" > $(IntermediateDirectory)/.d\r
+       @echo $(Objects) > $(ObjectsFileList)\r
+       $(LinkerName) $(OutputSwitch)$(OutputFile) @$(ObjectsFileList) $(LibPath) $(Libs) $(LinkOptions)\r
+\r
+$(IntermediateDirectory)/.d:\r
+       @$(MakeDirCommand) "./Release"\r
+\r
+PreBuild:\r
+\r
+\r
+##\r
+## Objects\r
+##\r
+$(IntermediateDirectory)/main$(ObjectSuffix): main.cpp $(IntermediateDirectory)/main$(DependSuffix)\r
+       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/build/main.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/main$(ObjectSuffix) $(IncludePath)\r
+$(IntermediateDirectory)/main$(DependSuffix): main.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/main$(ObjectSuffix) -MF$(IntermediateDirectory)/main$(DependSuffix) -MM "D:/Projects/Radio/fdmdv2/build/main.cpp"\r
+\r
+$(IntermediateDirectory)/main$(PreprocessSuffix): main.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/main$(PreprocessSuffix) "D:/Projects/Radio/fdmdv2/build/main.cpp"\r
+\r
+$(IntermediateDirectory)/wxcrafter$(ObjectSuffix): wxcrafter.cpp $(IntermediateDirectory)/wxcrafter$(DependSuffix)\r
+       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/build/wxcrafter.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/wxcrafter$(ObjectSuffix) $(IncludePath)\r
+$(IntermediateDirectory)/wxcrafter$(DependSuffix): wxcrafter.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/wxcrafter$(ObjectSuffix) -MF$(IntermediateDirectory)/wxcrafter$(DependSuffix) -MM "D:/Projects/Radio/fdmdv2/build/wxcrafter.cpp"\r
+\r
+$(IntermediateDirectory)/wxcrafter$(PreprocessSuffix): wxcrafter.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/wxcrafter$(PreprocessSuffix) "D:/Projects/Radio/fdmdv2/build/wxcrafter.cpp"\r
+\r
+$(IntermediateDirectory)/wxcrafter_bitmaps$(ObjectSuffix): wxcrafter_bitmaps.cpp $(IntermediateDirectory)/wxcrafter_bitmaps$(DependSuffix)\r
+       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/build/wxcrafter_bitmaps.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/wxcrafter_bitmaps$(ObjectSuffix) $(IncludePath)\r
+$(IntermediateDirectory)/wxcrafter_bitmaps$(DependSuffix): wxcrafter_bitmaps.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/wxcrafter_bitmaps$(ObjectSuffix) -MF$(IntermediateDirectory)/wxcrafter_bitmaps$(DependSuffix) -MM "D:/Projects/Radio/fdmdv2/build/wxcrafter_bitmaps.cpp"\r
+\r
+$(IntermediateDirectory)/wxcrafter_bitmaps$(PreprocessSuffix): wxcrafter_bitmaps.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/wxcrafter_bitmaps$(PreprocessSuffix) "D:/Projects/Radio/fdmdv2/build/wxcrafter_bitmaps.cpp"\r
+\r
+$(IntermediateDirectory)/MainDialog$(ObjectSuffix): MainDialog.cpp $(IntermediateDirectory)/MainDialog$(DependSuffix)\r
+       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/build/MainDialog.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/MainDialog$(ObjectSuffix) $(IncludePath)\r
+$(IntermediateDirectory)/MainDialog$(DependSuffix): MainDialog.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/MainDialog$(ObjectSuffix) -MF$(IntermediateDirectory)/MainDialog$(DependSuffix) -MM "D:/Projects/Radio/fdmdv2/build/MainDialog.cpp"\r
+\r
+$(IntermediateDirectory)/MainDialog$(PreprocessSuffix): MainDialog.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/MainDialog$(PreprocessSuffix) "D:/Projects/Radio/fdmdv2/build/MainDialog.cpp"\r
+\r
+$(IntermediateDirectory)/win_resources.rc$(ObjectSuffix): win_resources.rc\r
+       $(RcCompilerName) -i "D:/Projects/Radio/fdmdv2/build/win_resources.rc" $(RcCmpOptions)   $(ObjectSwitch)$(IntermediateDirectory)/win_resources.rc$(ObjectSuffix) $(RcIncludePath)\r
+\r
+-include $(IntermediateDirectory)/*$(DependSuffix)\r
+##\r
+## Clean\r
+##\r
+clean:\r
+       $(RM) $(IntermediateDirectory)/main$(ObjectSuffix)\r
+       $(RM) $(IntermediateDirectory)/main$(DependSuffix)\r
+       $(RM) $(IntermediateDirectory)/main$(PreprocessSuffix)\r
+       $(RM) $(IntermediateDirectory)/wxcrafter$(ObjectSuffix)\r
+       $(RM) $(IntermediateDirectory)/wxcrafter$(DependSuffix)\r
+       $(RM) $(IntermediateDirectory)/wxcrafter$(PreprocessSuffix)\r
+       $(RM) $(IntermediateDirectory)/wxcrafter_bitmaps$(ObjectSuffix)\r
+       $(RM) $(IntermediateDirectory)/wxcrafter_bitmaps$(DependSuffix)\r
+       $(RM) $(IntermediateDirectory)/wxcrafter_bitmaps$(PreprocessSuffix)\r
+       $(RM) $(IntermediateDirectory)/MainDialog$(ObjectSuffix)\r
+       $(RM) $(IntermediateDirectory)/MainDialog$(DependSuffix)\r
+       $(RM) $(IntermediateDirectory)/MainDialog$(PreprocessSuffix)\r
+       $(RM) $(IntermediateDirectory)/win_resources.rc$(ObjectSuffix)\r
+       $(RM) $(OutputFile)\r
+       $(RM) $(OutputFile).exe\r
+       $(RM) "D:\Projects\Radio\fdmdv2\build\.build-release\dialogTest"\r
+\r
+\r
diff --git a/freedv/branches/0.97/build/codelite/dialogtest/dialogTest.project b/freedv/branches/0.97/build/codelite/dialogtest/dialogTest.project
new file mode 100644 (file)
index 0000000..b9719ad
--- /dev/null
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CodeLite_Project Name="dialogTest" InternalType="GUI">
+  <Description/>
+  <Dependencies/>
+  <Settings Type="Executable">
+    <GlobalSettings>
+      <Compiler Options="" C_Options="">
+        <IncludePath Value="."/>
+      </Compiler>
+      <Linker Options="">
+        <LibraryPath Value="."/>
+      </Linker>
+      <ResourceCompiler Options=""/>
+    </GlobalSettings>
+    <Configuration Name="Debug" CompilerType="gnu g++" DebuggerType="GNU gdb debugger" Type="Executable" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append">
+      <Compiler Options="-g;-O0;-Wall;$(shell wx-config --cflags --debug)" C_Options="-g;-O0;-Wall" Required="yes" PreCompiledHeader="" PCHInCommandLine="no" UseDifferentPCHFlags="no" PCHFlags="">
+        <IncludePath Value="."/>
+      </Compiler>
+      <Linker Options="$(shell wx-config --libs --debug);-mwindows" Required="yes"/>
+      <ResourceCompiler Options="$(shell wx-config --rcflags)" Required="no"/>
+      <General OutputFile="$(IntermediateDirectory)/$(ProjectName)" IntermediateDirectory="./Debug" Command="./$(ProjectName)" CommandArguments="" UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="no"/>
+      <Environment EnvVarSetName="&lt;Use Defaults&gt;" DbgSetName="&lt;Use Defaults&gt;">
+        <![CDATA[]]>
+      </Environment>
+      <Debugger IsRemote="no" RemoteHostName="" RemoteHostPort="" DebuggerPath="">
+        <PostConnectCommands/>
+        <StartupCommands/>
+      </Debugger>
+      <PreBuild/>
+      <PostBuild/>
+      <CustomBuild Enabled="no">
+        <RebuildCommand/>
+        <CleanCommand/>
+        <BuildCommand/>
+        <PreprocessFileCommand/>
+        <SingleFileCommand/>
+        <MakefileGenerationCommand/>
+        <ThirdPartyToolName>None</ThirdPartyToolName>
+        <WorkingDirectory/>
+      </CustomBuild>
+      <AdditionalRules>
+        <CustomPostBuild/>
+        <CustomPreBuild/>
+      </AdditionalRules>
+      <Completion EnableCpp11="no">
+        <ClangCmpFlagsC/>
+        <ClangCmpFlags/>
+        <ClangPP/>
+        <SearchPaths/>
+      </Completion>
+    </Configuration>
+    <Configuration Name="Release" CompilerType="gnu g++" DebuggerType="GNU gdb debugger" Type="Executable" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append">
+      <Compiler Options="-O2;-Wall;$(shell wx-config --cflags)" C_Options="-O2;-Wall" Required="yes" PreCompiledHeader="" PCHInCommandLine="no" UseDifferentPCHFlags="no" PCHFlags="">
+        <IncludePath Value="."/>
+      </Compiler>
+      <Linker Options="$(shell wx-config --libs);-mwindows" Required="yes"/>
+      <ResourceCompiler Options="$(shell wx-config --rcflags)" Required="no"/>
+      <General OutputFile="$(IntermediateDirectory)/$(ProjectName)" IntermediateDirectory="./Release" Command="./$(ProjectName)" CommandArguments="" UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="no"/>
+      <Environment EnvVarSetName="&lt;Use Defaults&gt;" DbgSetName="&lt;Use Defaults&gt;">
+        <![CDATA[]]>
+      </Environment>
+      <Debugger IsRemote="no" RemoteHostName="" RemoteHostPort="" DebuggerPath="">
+        <PostConnectCommands/>
+        <StartupCommands/>
+      </Debugger>
+      <PreBuild/>
+      <PostBuild/>
+      <CustomBuild Enabled="no">
+        <RebuildCommand/>
+        <CleanCommand/>
+        <BuildCommand/>
+        <PreprocessFileCommand/>
+        <SingleFileCommand/>
+        <MakefileGenerationCommand/>
+        <ThirdPartyToolName>None</ThirdPartyToolName>
+        <WorkingDirectory/>
+      </CustomBuild>
+      <AdditionalRules>
+        <CustomPostBuild/>
+        <CustomPreBuild/>
+      </AdditionalRules>
+      <Completion EnableCpp11="no">
+        <ClangCmpFlagsC/>
+        <ClangCmpFlags/>
+        <ClangPP/>
+        <SearchPaths/>
+      </Completion>
+    </Configuration>
+  </Settings>
+  <VirtualDirectory Name="src">
+    <File Name="main.cpp"/>
+    <File Name="wxcrafter.cpp"/>
+    <File Name="wxcrafter_bitmaps.cpp"/>
+    <File Name="MainDialog.cpp"/>
+  </VirtualDirectory>
+  <VirtualDirectory Name="include">
+    <File Name="MainDialog.h"/>
+    <File Name="wxcrafter.h"/>
+  </VirtualDirectory>
+  <VirtualDirectory Name="resources">
+    <File Name="wxcrafter.wxcp"/>
+    <File Name="win_resources.rc"/>
+  </VirtualDirectory>
+  <VirtualDirectory Name="wxcrafter">
+    <VirtualDirectory Name="XRC">
+      <File Name="wxcrafter.xrc"/>
+    </VirtualDirectory>
+  </VirtualDirectory>
+</CodeLite_Project>
diff --git a/freedv/branches/0.97/build/codelite/dialogtest/dialogTest.txt b/freedv/branches/0.97/build/codelite/dialogtest/dialogTest.txt
new file mode 100644 (file)
index 0000000..869f461
--- /dev/null
@@ -0,0 +1 @@
+./Debug/main.o ./Debug/wxcrafter.o ./Debug/wxcrafter_bitmaps.o ./Debug/MainDialog.o ./Debug/win_resources.rc.o  \r
diff --git a/freedv/branches/0.97/build/codelite/dialogtest/main.cpp b/freedv/branches/0.97/build/codelite/dialogtest/main.cpp
new file mode 100644 (file)
index 0000000..d1b49ab
--- /dev/null
@@ -0,0 +1,26 @@
+#include <wx/app.h>
+#include <wx/event.h>
+#include "MainDialog.h"
+#include <wx/image.h>
+
+// Define the MainApp
+class MainApp : public wxApp
+{
+public:
+    MainApp() {}
+    virtual ~MainApp() {}
+    
+    virtual bool OnInit() 
+    {
+        // Add the common image handlers
+        wxImage::AddHandler( new wxPNGHandler );
+        wxImage::AddHandler( new wxJPEGHandler );
+        
+        PTTDialog mainDialog(NULL);
+        mainDialog.ShowModal();
+        return false;
+    }
+};
+
+DECLARE_APP(MainApp)
+IMPLEMENT_APP(MainApp)
diff --git a/freedv/branches/0.97/build/codelite/dialogtest/win_resources.rc b/freedv/branches/0.97/build/codelite/dialogtest/win_resources.rc
new file mode 100644 (file)
index 0000000..fa70c15
--- /dev/null
@@ -0,0 +1,2 @@
+#include "wx/msw/wx.rc"\r
+1 24 "wx/msw/wx.manifest"\r
diff --git a/freedv/branches/0.97/build/codelite/dialogtest/wxcrafter.cpp b/freedv/branches/0.97/build/codelite/dialogtest/wxcrafter.cpp
new file mode 100644 (file)
index 0000000..4bf7dc5
--- /dev/null
@@ -0,0 +1,143 @@
+//////////////////////////////////////////////////////////////////////
+// This file was auto-generated by codelite's wxCrafter Plugin
+// Do not modify this file by hand!
+//////////////////////////////////////////////////////////////////////
+
+#include "wxcrafter.h"
+
+
+// Declare the bitmap loading function
+extern void wxC9ED9InitBitmapResources();
+
+static bool bBitmapLoaded = false;
+
+
+PTTDialogBaseClass::PTTDialogBaseClass(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style)
+    : wxDialog(parent, id, title, pos, size, style)
+{
+    if ( !bBitmapLoaded ) {
+        // We need to initialise the default bitmap handler
+        wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler);
+        wxC9ED9InitBitmapResources();
+        bBitmapLoaded = true;
+    }
+    
+    wxBoxSizer* mainSizer = new wxBoxSizer(wxVERTICAL);
+    this->SetSizer(mainSizer);
+    
+    wxStaticBoxSizer* staticBoxSizer28 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("Audio Tone")), wxVERTICAL);
+    
+    mainSizer->Add(staticBoxSizer28, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5);
+    
+    m_ckPTTRtChan = new wxCheckBox(this, wxID_ANY, _("PTT tone on right audio channel"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_ckPTTRtChan->SetValue(false);
+    
+    staticBoxSizer28->Add(m_ckPTTRtChan, 0, wxALIGN_CENTER|wxALIGN_CENTER_VERTICAL, 5);
+    
+    wxStaticBoxSizer* staticBoxSizer17 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("Hardware PTT Settings")), wxVERTICAL);
+    
+    mainSizer->Add(staticBoxSizer17, 1, wxEXPAND, 5);
+    
+    wxStaticBoxSizer* staticBoxSizer31 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("PTT Port")), wxVERTICAL);
+    
+    staticBoxSizer17->Add(staticBoxSizer31, 0, wxEXPAND, 5);
+    
+    wxArrayString m_listCtrlPortsArr;
+    m_listCtrlPorts = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), m_listCtrlPortsArr, wxLB_SINGLE);
+    
+    staticBoxSizer31->Add(m_listCtrlPorts, 1, wxALIGN_CENTER, 0);
+    
+    wxBoxSizer* boxSizer19 = new wxBoxSizer(wxVERTICAL);
+    
+    staticBoxSizer17->Add(boxSizer19, 1, wxEXPAND, 5);
+    
+    wxStaticBoxSizer* staticBoxSizer16 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("Signal polarity")), wxHORIZONTAL);
+    
+    boxSizer19->Add(staticBoxSizer16, 1, wxEXPAND|wxALIGN_CENTER|wxALIGN_RIGHT, 5);
+    
+    wxGridSizer* gridSizer17 = new wxGridSizer(  3, 2, 0, 0);
+    
+    staticBoxSizer16->Add(gridSizer17, 1, wxEXPAND|wxALIGN_RIGHT, 5);
+    
+    m_ckUseSerialPTT = new wxCheckBox(this, wxID_ANY, _("Use Serial Port PTT"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_ckUseSerialPTT->SetValue(false);
+    
+    gridSizer17->Add(m_ckUseSerialPTT, 0, wxALIGN_CENTER, 10);
+    
+    gridSizer17->Add(0, 0, 0, 0, 5);
+    
+    m_rbUseDTR = new wxRadioButton(this, wxID_ANY, _("Use DTR"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_rbUseDTR->SetValue(1);
+    
+    gridSizer17->Add(m_rbUseDTR, 0, wxALIGN_CENTER|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5);
+    
+    m_ckRTSPos = new wxCheckBox(this, wxID_ANY, _("DTR = +V"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_ckRTSPos->SetValue(false);
+    
+    gridSizer17->Add(m_ckRTSPos, 0, wxALIGN_CENTER|wxALIGN_RIGHT, 5);
+    
+    m_rbUseRTS = new wxRadioButton(this, wxID_ANY, _("Use RTS"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_rbUseRTS->SetToolTip(_("Toggle the RTS pin for PTT"));
+    m_rbUseRTS->SetValue(1);
+    
+    gridSizer17->Add(m_rbUseRTS, 0, wxALIGN_CENTER|wxALIGN_RIGHT, 5);
+    
+    m_ckDTRPos = new wxCheckBox(this, wxID_ANY, _("RTS = +V"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_ckDTRPos->SetValue(false);
+    m_ckDTRPos->SetToolTip(_("Set Polarity of the RTS line"));
+    
+    gridSizer17->Add(m_ckDTRPos, 0, wxALIGN_CENTER|wxALIGN_RIGHT, 5);
+    
+    wxBoxSizer* boxSizer12 = new wxBoxSizer(wxHORIZONTAL);
+    
+    mainSizer->Add(boxSizer12, 0, wxLEFT|wxRIGHT|wxTOP|wxBOTTOM|wxALIGN_CENTER_HORIZONTAL, 5);
+    
+    m_buttonOK = new wxButton(this, wxID_OK, _("OK"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_buttonOK->SetDefault();
+    
+    boxSizer12->Add(m_buttonOK, 0, wxLEFT|wxRIGHT|wxTOP|wxBOTTOM, 5);
+    
+    m_buttonCancel = new wxButton(this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxSize(-1,-1), 0);
+    
+    boxSizer12->Add(m_buttonCancel, 0, wxLEFT|wxRIGHT|wxTOP|wxBOTTOM, 5);
+    
+    m_buttonApply = new wxButton(this, wxID_APPLY, _("Apply"), wxDefaultPosition, wxSize(-1,-1), 0);
+    
+    boxSizer12->Add(m_buttonApply, 0, wxLEFT|wxRIGHT|wxTOP|wxBOTTOM, 5);
+    
+    
+    SetSizeHints(450,300);
+    if ( GetSizer() ) {
+         GetSizer()->Fit(this);
+    }
+    Centre(wxBOTH);
+    // Connect events
+    this->Connect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(PTTDialogBaseClass::OnInitDialog), NULL, this);
+    m_ckPTTRtChan->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(PTTDialogBaseClass::PTTAudioClick), NULL, this);
+    m_listCtrlPorts->Connect(wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler(PTTDialogBaseClass::PTTPortSlelcted), NULL, this);
+    m_ckUseSerialPTT->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(PTTDialogBaseClass::PTTUseSerialClicked), NULL, this);
+    m_rbUseDTR->Connect(wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler(PTTDialogBaseClass::UseDTRCliched), NULL, this);
+    m_ckRTSPos->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(PTTDialogBaseClass::DTRVPlusClicked), NULL, this);
+    m_rbUseRTS->Connect(wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler(PTTDialogBaseClass::UseRTSClicked), NULL, this);
+    m_ckDTRPos->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(PTTDialogBaseClass::RTSVPlusClicked), NULL, this);
+    m_buttonOK->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(PTTDialogBaseClass::OnOK), NULL, this);
+    m_buttonCancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(PTTDialogBaseClass::OnCancel), NULL, this);
+    m_buttonApply->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(PTTDialogBaseClass::OnApply), NULL, this);
+    
+}
+
+PTTDialogBaseClass::~PTTDialogBaseClass()
+{
+    this->Disconnect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(PTTDialogBaseClass::OnInitDialog), NULL, this);
+    m_ckPTTRtChan->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(PTTDialogBaseClass::PTTAudioClick), NULL, this);
+    m_listCtrlPorts->Disconnect(wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler(PTTDialogBaseClass::PTTPortSlelcted), NULL, this);
+    m_ckUseSerialPTT->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(PTTDialogBaseClass::PTTUseSerialClicked), NULL, this);
+    m_rbUseDTR->Disconnect(wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler(PTTDialogBaseClass::UseDTRCliched), NULL, this);
+    m_ckRTSPos->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(PTTDialogBaseClass::DTRVPlusClicked), NULL, this);
+    m_rbUseRTS->Disconnect(wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler(PTTDialogBaseClass::UseRTSClicked), NULL, this);
+    m_ckDTRPos->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(PTTDialogBaseClass::RTSVPlusClicked), NULL, this);
+    m_buttonOK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(PTTDialogBaseClass::OnOK), NULL, this);
+    m_buttonCancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(PTTDialogBaseClass::OnCancel), NULL, this);
+    m_buttonApply->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(PTTDialogBaseClass::OnApply), NULL, this);
+    
+}
diff --git a/freedv/branches/0.97/build/codelite/dialogtest/wxcrafter.h b/freedv/branches/0.97/build/codelite/dialogtest/wxcrafter.h
new file mode 100644 (file)
index 0000000..fb0f63a
--- /dev/null
@@ -0,0 +1,52 @@
+//////////////////////////////////////////////////////////////////////
+// This file was auto-generated by codelite's wxCrafter Plugin
+// Do not modify this file by hand!
+//////////////////////////////////////////////////////////////////////
+
+#ifndef WXCRAFTER_BASE_CLASSES_H
+#define WXCRAFTER_BASE_CLASSES_H
+
+#include <wx/settings.h>
+#include <wx/xrc/xmlres.h>
+#include <wx/xrc/xh_bmp.h>
+#include <wx/dialog.h>
+#include <wx/sizer.h>
+#include <wx/statbox.h>
+#include <wx/checkbox.h>
+#include <wx/listbox.h>
+#include <wx/radiobut.h>
+#include <wx/button.h>
+
+class PTTDialogBaseClass : public wxDialog
+{
+protected:
+    wxCheckBox* m_ckPTTRtChan;
+    wxListBox* m_listCtrlPorts;
+    wxCheckBox* m_ckUseSerialPTT;
+    wxRadioButton* m_rbUseDTR;
+    wxCheckBox* m_ckRTSPos;
+    wxRadioButton* m_rbUseRTS;
+    wxCheckBox* m_ckDTRPos;
+    wxButton* m_buttonOK;
+    wxButton* m_buttonCancel;
+    wxButton* m_buttonApply;
+
+protected:
+    virtual void OnInitDialog(wxInitDialogEvent& event) { event.Skip(); }
+    virtual void PTTAudioClick(wxCommandEvent& event) { event.Skip(); }
+    virtual void PTTPortSlelcted(wxCommandEvent& event) { event.Skip(); }
+    virtual void PTTUseSerialClicked(wxCommandEvent& event) { event.Skip(); }
+    virtual void UseDTRCliched(wxCommandEvent& event) { event.Skip(); }
+    virtual void DTRVPlusClicked(wxCommandEvent& event) { event.Skip(); }
+    virtual void UseRTSClicked(wxCommandEvent& event) { event.Skip(); }
+    virtual void RTSVPlusClicked(wxCommandEvent& event) { event.Skip(); }
+    virtual void OnOK(wxCommandEvent& event) { event.Skip(); }
+    virtual void OnCancel(wxCommandEvent& event) { event.Skip(); }
+    virtual void OnApply(wxCommandEvent& event) { event.Skip(); }
+
+public:
+    PTTDialogBaseClass(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Hardware PTT"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(450,300), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER);
+    virtual ~PTTDialogBaseClass();
+};
+
+#endif
diff --git a/freedv/branches/0.97/build/codelite/dialogtest/wxcrafter.wxcp b/freedv/branches/0.97/build/codelite/dialogtest/wxcrafter.wxcp
new file mode 100644 (file)
index 0000000..b79705a
--- /dev/null
@@ -0,0 +1,965 @@
+{
+       "metadata":     {
+               "m_generatedFilesDir":  "",
+               "m_objCounter": 32,
+               "m_includeFiles":       [],
+               "m_bitmapFunction":     "wxC9ED9InitBitmapResources",
+               "m_bitmapsFile":        "wxcrafter_bitmaps.cpp",
+               "m_GenerateCodeTypes":  3
+       },
+       "windows":      [{
+                       "m_type":       4421,
+                       "proportion":   0,
+                       "border":       5,
+                       "gbSpan":       "1,1",
+                       "gbPosition":   "0,0",
+                       "m_styles":     ["wxDEFAULT_DIALOG_STYLE", "wxRESIZE_BORDER"],
+                       "m_sizerFlags": ["wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                       "m_properties": [{
+                                       "type": "winid",
+                                       "m_label":      "ID:",
+                                       "m_winid":      "wxID_ANY"
+                               }, {
+                                       "type": "string",
+                                       "m_label":      "Size:",
+                                       "m_value":      "450,300"
+                               }, {
+                                       "type": "string",
+                                       "m_label":      "Minimum Size:",
+                                       "m_value":      "-1,-1"
+                               }, {
+                                       "type": "string",
+                                       "m_label":      "Name:",
+                                       "m_value":      "PTTDialog"
+                               }, {
+                                       "type": "multi-string",
+                                       "m_label":      "Tooltip:",
+                                       "m_value":      ""
+                               }, {
+                                       "type": "colour",
+                                       "m_label":      "Bg Colour:",
+                                       "colour":       "<Default>"
+                               }, {
+                                       "type": "colour",
+                                       "m_label":      "Fg Colour:",
+                                       "colour":       "<Default>"
+                               }, {
+                                       "type": "font",
+                                       "m_label":      "Font:",
+                                       "m_value":      ""
+                               }, {
+                                       "type": "string",
+                                       "m_label":      "Class Name:",
+                                       "m_value":      ""
+                               }, {
+                                       "type": "string",
+                                       "m_label":      "Include File:",
+                                       "m_value":      ""
+                               }, {
+                                       "type": "string",
+                                       "m_label":      "Title:",
+                                       "m_value":      "Hardware PTT"
+                               }, {
+                                       "type": "string",
+                                       "m_label":      "File:",
+                                       "m_value":      "MainDialog"
+                               }, {
+                                       "type": "virtualFolderPicker",
+                                       "m_label":      "Virtual Folder:",
+                                       "m_path":       ""
+                               }, {
+                                       "type": "choice",
+                                       "m_label":      "Centre:",
+                                       "m_selection":  1,
+                                       "m_options":    ["", "wxBOTH", "wxVERTICAL", "wxHORIZONTAL"]
+                               }],
+                       "m_events":     [{
+                                       "m_eventName":  "wxEVT_INIT_DIALOG",
+                                       "m_eventClass": "wxInitDialogEvent",
+                                       "m_eventHandler":       "wxInitDialogEventHandler",
+                                       "m_functionNameAndSignature":   "OnInitDialog(wxInitDialogEvent& event)",
+                                       "m_description":        "A wxInitDialogEvent is sent as a dialog or panel is being initialised. Handlers for this event can transfer data to the window.\nThe default handler calls wxWindow::TransferDataToWindow"
+                               }],
+                       "m_children":   [{
+                                       "m_type":       4401,
+                                       "proportion":   0,
+                                       "border":       5,
+                                       "gbSpan":       "1,1",
+                                       "gbPosition":   "0,0",
+                                       "m_styles":     [],
+                                       "m_sizerFlags": ["wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                       "m_properties": [{
+                                                       "type": "string",
+                                                       "m_label":      "Name:",
+                                                       "m_value":      "mainSizer"
+                                               }, {
+                                                       "type": "choice",
+                                                       "m_label":      "Orientation:",
+                                                       "m_selection":  0,
+                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
+                                               }],
+                                       "m_events":     [],
+                                       "m_children":   [{
+                                                       "m_type":       4449,
+                                                       "proportion":   0,
+                                                       "border":       5,
+                                                       "gbSpan":       "1,1",
+                                                       "gbPosition":   "0,0",
+                                                       "m_styles":     [],
+                                                       "m_sizerFlags": ["wxEXPAND", "wxALIGN_CENTER_VERTICAL"],
+                                                       "m_properties": [{
+                                                                       "type": "string",
+                                                                       "m_label":      "Name:",
+                                                                       "m_value":      "staticBoxSizer28"
+                                                               }, {
+                                                                       "type": "choice",
+                                                                       "m_label":      "Orientation:",
+                                                                       "m_selection":  0,
+                                                                       "m_options":    ["Vertical", "Horizontal"]
+                                                               }, {
+                                                                       "type": "string",
+                                                                       "m_label":      "Label:",
+                                                                       "m_value":      "Audio Tone"
+                                                               }],
+                                                       "m_events":     [],
+                                                       "m_children":   [{
+                                                                       "m_type":       4415,
+                                                                       "proportion":   0,
+                                                                       "border":       5,
+                                                                       "gbSpan":       "1,1",
+                                                                       "gbPosition":   "0,0",
+                                                                       "m_styles":     [],
+                                                                       "m_sizerFlags": ["wxALIGN_CENTER", "wxALIGN_CENTER_VERTICAL"],
+                                                                       "m_properties": [{
+                                                                                       "type": "winid",
+                                                                                       "m_label":      "ID:",
+                                                                                       "m_winid":      "wxID_ANY"
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Size:",
+                                                                                       "m_value":      "-1,-1"
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Minimum Size:",
+                                                                                       "m_value":      "-1,-1"
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Name:",
+                                                                                       "m_value":      "m_ckPTTRtChan"
+                                                                               }, {
+                                                                                       "type": "multi-string",
+                                                                                       "m_label":      "Tooltip:",
+                                                                                       "m_value":      ""
+                                                                               }, {
+                                                                                       "type": "colour",
+                                                                                       "m_label":      "Bg Colour:",
+                                                                                       "colour":       "<Default>"
+                                                                               }, {
+                                                                                       "type": "colour",
+                                                                                       "m_label":      "Fg Colour:",
+                                                                                       "colour":       "<Default>"
+                                                                               }, {
+                                                                                       "type": "font",
+                                                                                       "m_label":      "Font:",
+                                                                                       "m_value":      ""
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Class Name:",
+                                                                                       "m_value":      ""
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Include File:",
+                                                                                       "m_value":      ""
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Label:",
+                                                                                       "m_value":      "PTT tone on right audio channel"
+                                                                               }, {
+                                                                                       "type": "bool",
+                                                                                       "m_label":      "Value:",
+                                                                                       "m_value":      false
+                                                                               }],
+                                                                       "m_events":     [{
+                                                                                       "m_eventName":  "wxEVT_COMMAND_CHECKBOX_CLICKED",
+                                                                                       "m_eventClass": "wxCommandEvent",
+                                                                                       "m_eventHandler":       "wxCommandEventHandler",
+                                                                                       "m_functionNameAndSignature":   "PTTAudioClick(wxCommandEvent& event)",
+                                                                                       "m_description":        "Process a wxEVT_COMMAND_CHECKBOX_CLICKED event, when the checkbox is clicked."
+                                                                               }],
+                                                                       "m_children":   []
+                                                               }]
+                                               }, {
+                                                       "m_type":       4449,
+                                                       "proportion":   1,
+                                                       "border":       5,
+                                                       "gbSpan":       "1,1",
+                                                       "gbPosition":   "0,0",
+                                                       "m_styles":     [],
+                                                       "m_sizerFlags": ["wxEXPAND"],
+                                                       "m_properties": [{
+                                                                       "type": "string",
+                                                                       "m_label":      "Name:",
+                                                                       "m_value":      "staticBoxSizer17"
+                                                               }, {
+                                                                       "type": "choice",
+                                                                       "m_label":      "Orientation:",
+                                                                       "m_selection":  0,
+                                                                       "m_options":    ["Vertical", "Horizontal"]
+                                                               }, {
+                                                                       "type": "string",
+                                                                       "m_label":      "Label:",
+                                                                       "m_value":      "Hardware PTT Settings"
+                                                               }],
+                                                       "m_events":     [],
+                                                       "m_children":   [{
+                                                                       "m_type":       4449,
+                                                                       "proportion":   0,
+                                                                       "border":       5,
+                                                                       "gbSpan":       "1,1",
+                                                                       "gbPosition":   "0,0",
+                                                                       "m_styles":     [],
+                                                                       "m_sizerFlags": ["wxEXPAND"],
+                                                                       "m_properties": [{
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Name:",
+                                                                                       "m_value":      "staticBoxSizer31"
+                                                                               }, {
+                                                                                       "type": "choice",
+                                                                                       "m_label":      "Orientation:",
+                                                                                       "m_selection":  0,
+                                                                                       "m_options":    ["Vertical", "Horizontal"]
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Label:",
+                                                                                       "m_value":      "PTT Port"
+                                                                               }],
+                                                                       "m_events":     [],
+                                                                       "m_children":   [{
+                                                                                       "m_type":       4412,
+                                                                                       "proportion":   1,
+                                                                                       "border":       0,
+                                                                                       "gbSpan":       "1,1",
+                                                                                       "gbPosition":   "0,0",
+                                                                                       "m_styles":     ["wxLB_SINGLE"],
+                                                                                       "m_sizerFlags": ["wxALIGN_CENTER"],
+                                                                                       "m_properties": [{
+                                                                                                       "type": "winid",
+                                                                                                       "m_label":      "ID:",
+                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                               }, {
+                                                                                                       "type": "string",
+                                                                                                       "m_label":      "Size:",
+                                                                                                       "m_value":      "-1,-1"
+                                                                                               }, {
+                                                                                                       "type": "string",
+                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                       "m_value":      "-1,-1"
+                                                                                               }, {
+                                                                                                       "type": "string",
+                                                                                                       "m_label":      "Name:",
+                                                                                                       "m_value":      "m_listCtrlPorts"
+                                                                                               }, {
+                                                                                                       "type": "multi-string",
+                                                                                                       "m_label":      "Tooltip:",
+                                                                                                       "m_value":      ""
+                                                                                               }, {
+                                                                                                       "type": "colour",
+                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                       "colour":       "<Default>"
+                                                                                               }, {
+                                                                                                       "type": "colour",
+                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                       "colour":       "<Default>"
+                                                                                               }, {
+                                                                                                       "type": "font",
+                                                                                                       "m_label":      "Font:",
+                                                                                                       "m_value":      ""
+                                                                                               }, {
+                                                                                                       "type": "string",
+                                                                                                       "m_label":      "Class Name:",
+                                                                                                       "m_value":      ""
+                                                                                               }, {
+                                                                                                       "type": "string",
+                                                                                                       "m_label":      "Include File:",
+                                                                                                       "m_value":      ""
+                                                                                               }, {
+                                                                                                       "type": "multi-string",
+                                                                                                       "m_label":      "Choices:",
+                                                                                                       "m_value":      ""
+                                                                                               }, {
+                                                                                                       "type": "string",
+                                                                                                       "m_label":      "Selection:",
+                                                                                                       "m_value":      "-1"
+                                                                                               }],
+                                                                                       "m_events":     [{
+                                                                                                       "m_eventName":  "wxEVT_COMMAND_LISTBOX_SELECTED",
+                                                                                                       "m_eventClass": "wxCommandEvent",
+                                                                                                       "m_eventHandler":       "wxCommandEventHandler",
+                                                                                                       "m_functionNameAndSignature":   "PTTPortSlelcted(wxCommandEvent& event)",
+                                                                                                       "m_description":        "Process a wxEVT_COMMAND_LISTBOX_SELECTED event, when an item on the list is selected or the selection changes."
+                                                                                               }],
+                                                                                       "m_children":   []
+                                                                               }]
+                                                               }, {
+                                                                       "m_type":       4401,
+                                                                       "proportion":   1,
+                                                                       "border":       5,
+                                                                       "gbSpan":       "1,1",
+                                                                       "gbPosition":   "0,0",
+                                                                       "m_styles":     [],
+                                                                       "m_sizerFlags": ["wxEXPAND"],
+                                                                       "m_properties": [{
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Name:",
+                                                                                       "m_value":      "boxSizer19"
+                                                                               }, {
+                                                                                       "type": "choice",
+                                                                                       "m_label":      "Orientation:",
+                                                                                       "m_selection":  0,
+                                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
+                                                                               }],
+                                                                       "m_events":     [],
+                                                                       "m_children":   [{
+                                                                                       "m_type":       4449,
+                                                                                       "proportion":   1,
+                                                                                       "border":       5,
+                                                                                       "gbSpan":       "1,1",
+                                                                                       "gbPosition":   "0,0",
+                                                                                       "m_styles":     [],
+                                                                                       "m_sizerFlags": ["wxEXPAND", "wxALIGN_CENTER", "wxALIGN_RIGHT"],
+                                                                                       "m_properties": [{
+                                                                                                       "type": "string",
+                                                                                                       "m_label":      "Name:",
+                                                                                                       "m_value":      "staticBoxSizer16"
+                                                                                               }, {
+                                                                                                       "type": "choice",
+                                                                                                       "m_label":      "Orientation:",
+                                                                                                       "m_selection":  1,
+                                                                                                       "m_options":    ["Vertical", "Horizontal"]
+                                                                                               }, {
+                                                                                                       "type": "string",
+                                                                                                       "m_label":      "Label:",
+                                                                                                       "m_value":      "Signal polarity"
+                                                                                               }],
+                                                                                       "m_events":     [],
+                                                                                       "m_children":   [{
+                                                                                                       "m_type":       4452,
+                                                                                                       "proportion":   1,
+                                                                                                       "border":       5,
+                                                                                                       "gbSpan":       "1,1",
+                                                                                                       "gbPosition":   "0,0",
+                                                                                                       "m_styles":     [],
+                                                                                                       "m_sizerFlags": ["wxEXPAND", "wxALIGN_RIGHT"],
+                                                                                                       "m_properties": [{
+                                                                                                                       "type": "string",
+                                                                                                                       "m_label":      "Name:",
+                                                                                                                       "m_value":      "gridSizer17"
+                                                                                                               }, {
+                                                                                                                       "type": "string",
+                                                                                                                       "m_label":      "# Columns:",
+                                                                                                                       "m_value":      "2"
+                                                                                                               }, {
+                                                                                                                       "type": "string",
+                                                                                                                       "m_label":      "# Rows:",
+                                                                                                                       "m_value":      "3"
+                                                                                                               }, {
+                                                                                                                       "type": "string",
+                                                                                                                       "m_label":      "Horizontal gap:",
+                                                                                                                       "m_value":      "0"
+                                                                                                               }, {
+                                                                                                                       "type": "string",
+                                                                                                                       "m_label":      "Vertical gap:",
+                                                                                                                       "m_value":      "0"
+                                                                                                               }],
+                                                                                                       "m_events":     [],
+                                                                                                       "m_children":   [{
+                                                                                                                       "m_type":       4415,
+                                                                                                                       "proportion":   0,
+                                                                                                                       "border":       10,
+                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                       "m_styles":     [],
+                                                                                                                       "m_sizerFlags": ["wxALIGN_CENTER"],
+                                                                                                                       "m_properties": [{
+                                                                                                                                       "type": "winid",
+                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                       "m_value":      "m_ckUseSerialPTT"
+                                                                                                                               }, {
+                                                                                                                                       "type": "multi-string",
+                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "colour",
+                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                       "colour":       "<Default>"
+                                                                                                                               }, {
+                                                                                                                                       "type": "colour",
+                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                       "colour":       "<Default>"
+                                                                                                                               }, {
+                                                                                                                                       "type": "font",
+                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                       "m_value":      "Use Serial Port PTT"
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Value:",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }],
+                                                                                                                       "m_events":     [{
+                                                                                                                                       "m_eventName":  "wxEVT_COMMAND_CHECKBOX_CLICKED",
+                                                                                                                                       "m_eventClass": "wxCommandEvent",
+                                                                                                                                       "m_eventHandler":       "wxCommandEventHandler",
+                                                                                                                                       "m_functionNameAndSignature":   "PTTUseSerialClicked(wxCommandEvent& event)",
+                                                                                                                                       "m_description":        "Process a wxEVT_COMMAND_CHECKBOX_CLICKED event, when the checkbox is clicked."
+                                                                                                                               }],
+                                                                                                                       "m_children":   []
+                                                                                                               }, {
+                                                                                                                       "m_type":       4454,
+                                                                                                                       "proportion":   0,
+                                                                                                                       "border":       5,
+                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                       "m_styles":     [],
+                                                                                                                       "m_sizerFlags": [],
+                                                                                                                       "m_properties": [{
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                       "m_value":      "Spacer"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                       "m_value":      "0,0"
+                                                                                                                               }],
+                                                                                                                       "m_events":     [],
+                                                                                                                       "m_children":   []
+                                                                                                               }, {
+                                                                                                                       "m_type":       4417,
+                                                                                                                       "proportion":   0,
+                                                                                                                       "border":       5,
+                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                       "m_styles":     [],
+                                                                                                                       "m_sizerFlags": ["wxALIGN_CENTER", "wxALIGN_RIGHT", "wxALIGN_CENTER_VERTICAL"],
+                                                                                                                       "m_properties": [{
+                                                                                                                                       "type": "winid",
+                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                       "m_value":      "m_rbUseDTR"
+                                                                                                                               }, {
+                                                                                                                                       "type": "multi-string",
+                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "colour",
+                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                       "colour":       "<Default>"
+                                                                                                                               }, {
+                                                                                                                                       "type": "colour",
+                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                       "colour":       "<Default>"
+                                                                                                                               }, {
+                                                                                                                                       "type": "font",
+                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                       "m_value":      "Use DTR"
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Value:",
+                                                                                                                                       "m_value":      true
+                                                                                                                               }],
+                                                                                                                       "m_events":     [{
+                                                                                                                                       "m_eventName":  "wxEVT_COMMAND_RADIOBUTTON_SELECTED",
+                                                                                                                                       "m_eventClass": "wxCommandEvent",
+                                                                                                                                       "m_eventHandler":       "wxCommandEventHandler",
+                                                                                                                                       "m_functionNameAndSignature":   "UseDTRCliched(wxCommandEvent& event)",
+                                                                                                                                       "m_description":        "Process a wxEVT_COMMAND_RADIOBUTTON_SELECTED event, when the radiobutton is clicked."
+                                                                                                                               }],
+                                                                                                                       "m_children":   []
+                                                                                                               }, {
+                                                                                                                       "m_type":       4415,
+                                                                                                                       "proportion":   0,
+                                                                                                                       "border":       5,
+                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                       "m_styles":     [],
+                                                                                                                       "m_sizerFlags": ["wxALIGN_CENTER", "wxALIGN_RIGHT"],
+                                                                                                                       "m_properties": [{
+                                                                                                                                       "type": "winid",
+                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                       "m_value":      "m_ckRTSPos"
+                                                                                                                               }, {
+                                                                                                                                       "type": "multi-string",
+                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "colour",
+                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                       "colour":       "<Default>"
+                                                                                                                               }, {
+                                                                                                                                       "type": "colour",
+                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                       "colour":       "<Default>"
+                                                                                                                               }, {
+                                                                                                                                       "type": "font",
+                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                       "m_value":      "DTR = +V"
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Value:",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }],
+                                                                                                                       "m_events":     [{
+                                                                                                                                       "m_eventName":  "wxEVT_COMMAND_CHECKBOX_CLICKED",
+                                                                                                                                       "m_eventClass": "wxCommandEvent",
+                                                                                                                                       "m_eventHandler":       "wxCommandEventHandler",
+                                                                                                                                       "m_functionNameAndSignature":   "DTRVPlusClicked(wxCommandEvent& event)",
+                                                                                                                                       "m_description":        "Process a wxEVT_COMMAND_CHECKBOX_CLICKED event, when the checkbox is clicked."
+                                                                                                                               }],
+                                                                                                                       "m_children":   []
+                                                                                                               }, {
+                                                                                                                       "m_type":       4417,
+                                                                                                                       "proportion":   0,
+                                                                                                                       "border":       5,
+                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                       "m_styles":     [],
+                                                                                                                       "m_sizerFlags": ["wxALIGN_CENTER", "wxALIGN_RIGHT"],
+                                                                                                                       "m_properties": [{
+                                                                                                                                       "type": "winid",
+                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                       "m_value":      "m_rbUseRTS"
+                                                                                                                               }, {
+                                                                                                                                       "type": "multi-string",
+                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                       "m_value":      "Toggle the RTS pin for PTT"
+                                                                                                                               }, {
+                                                                                                                                       "type": "colour",
+                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                       "colour":       "<Default>"
+                                                                                                                               }, {
+                                                                                                                                       "type": "colour",
+                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                       "colour":       "<Default>"
+                                                                                                                               }, {
+                                                                                                                                       "type": "font",
+                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                       "m_value":      "Use RTS"
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Value:",
+                                                                                                                                       "m_value":      true
+                                                                                                                               }],
+                                                                                                                       "m_events":     [{
+                                                                                                                                       "m_eventName":  "wxEVT_COMMAND_RADIOBUTTON_SELECTED",
+                                                                                                                                       "m_eventClass": "wxCommandEvent",
+                                                                                                                                       "m_eventHandler":       "wxCommandEventHandler",
+                                                                                                                                       "m_functionNameAndSignature":   "UseRTSClicked(wxCommandEvent& event)",
+                                                                                                                                       "m_description":        "Process a wxEVT_COMMAND_RADIOBUTTON_SELECTED event, when the radiobutton is clicked."
+                                                                                                                               }],
+                                                                                                                       "m_children":   []
+                                                                                                               }, {
+                                                                                                                       "m_type":       4415,
+                                                                                                                       "proportion":   0,
+                                                                                                                       "border":       5,
+                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                       "m_styles":     [],
+                                                                                                                       "m_sizerFlags": ["wxALIGN_CENTER", "wxALIGN_RIGHT"],
+                                                                                                                       "m_properties": [{
+                                                                                                                                       "type": "winid",
+                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                       "m_value":      "m_ckDTRPos"
+                                                                                                                               }, {
+                                                                                                                                       "type": "multi-string",
+                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                       "m_value":      "Set Polarity of the RTS line"
+                                                                                                                               }, {
+                                                                                                                                       "type": "colour",
+                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                       "colour":       "<Default>"
+                                                                                                                               }, {
+                                                                                                                                       "type": "colour",
+                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                       "colour":       "<Default>"
+                                                                                                                               }, {
+                                                                                                                                       "type": "font",
+                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                       "m_value":      "RTS = +V"
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Value:",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }],
+                                                                                                                       "m_events":     [{
+                                                                                                                                       "m_eventName":  "wxEVT_COMMAND_CHECKBOX_CLICKED",
+                                                                                                                                       "m_eventClass": "wxCommandEvent",
+                                                                                                                                       "m_eventHandler":       "wxCommandEventHandler",
+                                                                                                                                       "m_functionNameAndSignature":   "RTSVPlusClicked(wxCommandEvent& event)",
+                                                                                                                                       "m_description":        "Process a wxEVT_COMMAND_CHECKBOX_CLICKED event, when the checkbox is clicked."
+                                                                                                                               }],
+                                                                                                                       "m_children":   []
+                                                                                                               }]
+                                                                                               }]
+                                                                               }]
+                                                               }]
+                                               }, {
+                                                       "m_type":       4401,
+                                                       "proportion":   0,
+                                                       "border":       5,
+                                                       "gbSpan":       "1,1",
+                                                       "gbPosition":   "0,0",
+                                                       "m_styles":     [],
+                                                       "m_sizerFlags": ["wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_HORIZONTAL"],
+                                                       "m_properties": [{
+                                                                       "type": "string",
+                                                                       "m_label":      "Name:",
+                                                                       "m_value":      "boxSizer12"
+                                                               }, {
+                                                                       "type": "choice",
+                                                                       "m_label":      "Orientation:",
+                                                                       "m_selection":  1,
+                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
+                                                               }],
+                                                       "m_events":     [],
+                                                       "m_children":   [{
+                                                                       "m_type":       4400,
+                                                                       "proportion":   0,
+                                                                       "border":       5,
+                                                                       "gbSpan":       "1,1",
+                                                                       "gbPosition":   "0,0",
+                                                                       "m_styles":     [],
+                                                                       "m_sizerFlags": ["wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                                                       "m_properties": [{
+                                                                                       "type": "winid",
+                                                                                       "m_label":      "ID:",
+                                                                                       "m_winid":      "wxID_OK"
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Size:",
+                                                                                       "m_value":      "-1,-1"
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Minimum Size:",
+                                                                                       "m_value":      "-1,-1"
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Name:",
+                                                                                       "m_value":      "m_buttonOK"
+                                                                               }, {
+                                                                                       "type": "multi-string",
+                                                                                       "m_label":      "Tooltip:",
+                                                                                       "m_value":      ""
+                                                                               }, {
+                                                                                       "type": "colour",
+                                                                                       "m_label":      "Bg Colour:",
+                                                                                       "colour":       "<Default>"
+                                                                               }, {
+                                                                                       "type": "colour",
+                                                                                       "m_label":      "Fg Colour:",
+                                                                                       "colour":       "<Default>"
+                                                                               }, {
+                                                                                       "type": "font",
+                                                                                       "m_label":      "Font:",
+                                                                                       "m_value":      ""
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Class Name:",
+                                                                                       "m_value":      ""
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Include File:",
+                                                                                       "m_value":      ""
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Label:",
+                                                                                       "m_value":      "OK"
+                                                                               }, {
+                                                                                       "type": "bool",
+                                                                                       "m_label":      "Default Button",
+                                                                                       "m_value":      true
+                                                                               }, {
+                                                                                       "type": "filePicker",
+                                                                                       "m_label":      "Bitmap File:",
+                                                                                       "m_path":       ""
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Margins:",
+                                                                                       "m_value":      "2,2"
+                                                                               }],
+                                                                       "m_events":     [{
+                                                                                       "m_eventName":  "wxEVT_COMMAND_BUTTON_CLICKED",
+                                                                                       "m_eventClass": "wxCommandEvent",
+                                                                                       "m_eventHandler":       "wxCommandEventHandler",
+                                                                                       "m_functionNameAndSignature":   "OnOK(wxCommandEvent& event)",
+                                                                                       "m_description":        "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked."
+                                                                               }],
+                                                                       "m_children":   []
+                                                               }, {
+                                                                       "m_type":       4400,
+                                                                       "proportion":   0,
+                                                                       "border":       5,
+                                                                       "gbSpan":       "1,1",
+                                                                       "gbPosition":   "0,0",
+                                                                       "m_styles":     [],
+                                                                       "m_sizerFlags": ["wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                                                       "m_properties": [{
+                                                                                       "type": "winid",
+                                                                                       "m_label":      "ID:",
+                                                                                       "m_winid":      "wxID_CANCEL"
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Size:",
+                                                                                       "m_value":      "-1,-1"
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Minimum Size:",
+                                                                                       "m_value":      "-1,-1"
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Name:",
+                                                                                       "m_value":      "m_buttonCancel"
+                                                                               }, {
+                                                                                       "type": "multi-string",
+                                                                                       "m_label":      "Tooltip:",
+                                                                                       "m_value":      ""
+                                                                               }, {
+                                                                                       "type": "colour",
+                                                                                       "m_label":      "Bg Colour:",
+                                                                                       "colour":       "<Default>"
+                                                                               }, {
+                                                                                       "type": "colour",
+                                                                                       "m_label":      "Fg Colour:",
+                                                                                       "colour":       "<Default>"
+                                                                               }, {
+                                                                                       "type": "font",
+                                                                                       "m_label":      "Font:",
+                                                                                       "m_value":      ""
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Class Name:",
+                                                                                       "m_value":      ""
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Include File:",
+                                                                                       "m_value":      ""
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Label:",
+                                                                                       "m_value":      "Cancel"
+                                                                               }, {
+                                                                                       "type": "bool",
+                                                                                       "m_label":      "Default Button",
+                                                                                       "m_value":      false
+                                                                               }, {
+                                                                                       "type": "filePicker",
+                                                                                       "m_label":      "Bitmap File:",
+                                                                                       "m_path":       ""
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Margins:",
+                                                                                       "m_value":      "2,2"
+                                                                               }],
+                                                                       "m_events":     [{
+                                                                                       "m_eventName":  "wxEVT_COMMAND_BUTTON_CLICKED",
+                                                                                       "m_eventClass": "wxCommandEvent",
+                                                                                       "m_eventHandler":       "wxCommandEventHandler",
+                                                                                       "m_functionNameAndSignature":   "OnCancel(wxCommandEvent& event)",
+                                                                                       "m_description":        "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked."
+                                                                               }],
+                                                                       "m_children":   []
+                                                               }, {
+                                                                       "m_type":       4400,
+                                                                       "proportion":   0,
+                                                                       "border":       5,
+                                                                       "gbSpan":       "1,1",
+                                                                       "gbPosition":   "0,0",
+                                                                       "m_styles":     [],
+                                                                       "m_sizerFlags": ["wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                                                       "m_properties": [{
+                                                                                       "type": "winid",
+                                                                                       "m_label":      "ID:",
+                                                                                       "m_winid":      "wxID_APPLY"
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Size:",
+                                                                                       "m_value":      "-1,-1"
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Minimum Size:",
+                                                                                       "m_value":      "-1,-1"
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Name:",
+                                                                                       "m_value":      "m_buttonApply"
+                                                                               }, {
+                                                                                       "type": "multi-string",
+                                                                                       "m_label":      "Tooltip:",
+                                                                                       "m_value":      ""
+                                                                               }, {
+                                                                                       "type": "colour",
+                                                                                       "m_label":      "Bg Colour:",
+                                                                                       "colour":       "<Default>"
+                                                                               }, {
+                                                                                       "type": "colour",
+                                                                                       "m_label":      "Fg Colour:",
+                                                                                       "colour":       "<Default>"
+                                                                               }, {
+                                                                                       "type": "font",
+                                                                                       "m_label":      "Font:",
+                                                                                       "m_value":      ""
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Class Name:",
+                                                                                       "m_value":      ""
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Include File:",
+                                                                                       "m_value":      ""
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Label:",
+                                                                                       "m_value":      "Apply"
+                                                                               }, {
+                                                                                       "type": "bool",
+                                                                                       "m_label":      "Default Button",
+                                                                                       "m_value":      false
+                                                                               }, {
+                                                                                       "type": "filePicker",
+                                                                                       "m_label":      "Bitmap File:",
+                                                                                       "m_path":       ""
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Margins:",
+                                                                                       "m_value":      "2,2"
+                                                                               }],
+                                                                       "m_events":     [{
+                                                                                       "m_eventName":  "wxEVT_COMMAND_BUTTON_CLICKED",
+                                                                                       "m_eventClass": "wxCommandEvent",
+                                                                                       "m_eventHandler":       "wxCommandEventHandler",
+                                                                                       "m_functionNameAndSignature":   "OnApply(wxCommandEvent& event)",
+                                                                                       "m_description":        "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked."
+                                                                               }],
+                                                                       "m_children":   []
+                                                               }]
+                                               }]
+                               }]
+               }]
+}
\ No newline at end of file
diff --git a/freedv/branches/0.97/build/codelite/dialogtest/wxcrafter_bitmaps.cpp b/freedv/branches/0.97/build/codelite/dialogtest/wxcrafter_bitmaps.cpp
new file mode 100644 (file)
index 0000000..b78c0b9
--- /dev/null
@@ -0,0 +1,48 @@
+//\r
+// This file was automatically generated by wxrc, do not edit by hand.\r
+//\r
+\r
+#include <wx/wxprec.h>\r
+\r
+#ifdef __BORLANDC__\r
+    #pragma hdrstop\r
+#endif\r
+\r
+#include <wx/filesys.h>\r
+#include <wx/fs_mem.h>\r
+#include <wx/xrc/xmlres.h>\r
+#include <wx/xrc/xh_all.h>\r
+\r
+#if wxCHECK_VERSION(2,8,5) && wxABI_VERSION >= 20805\r
+    #define XRC_ADD_FILE(name, data, size, mime) \\r
+        wxMemoryFSHandler::AddFileWithMimeType(name, data, size, mime)\r
+#else\r
+    #define XRC_ADD_FILE(name, data, size, mime) \\r
+        wxMemoryFSHandler::AddFile(name, data, size)\r
+#endif\r
+\r
+static size_t xml_res_size_0 = 108;\r
+static unsigned char xml_res_file_0[] = {\r
+60,63,120,109,108,32,118,101,114,115,105,111,110,61,34,49,46,48,34,32,101,\r
+110,99,111,100,105,110,103,61,34,85,84,70,45,56,34,63,62,10,60,114,101,\r
+115,111,117,114,99,101,32,120,109,108,110,115,61,34,104,116,116,112,58,\r
+47,47,119,119,119,46,119,120,119,105,110,100,111,119,115,46,111,114,103,\r
+47,119,120,120,114,99,34,32,118,101,114,115,105,111,110,61,34,50,46,51,\r
+46,48,46,49,34,47,62,10};\r
+\r
+void wxC9ED9InitBitmapResources()\r
+{\r
+\r
+    // Check for memory FS. If not present, load the handler:\r
+    {\r
+        wxMemoryFSHandler::AddFile(wxT("XRC_resource/dummy_file"), wxT("dummy one"));\r
+        wxFileSystem fsys;\r
+        wxFSFile *f = fsys.OpenFile(wxT("memory:XRC_resource/dummy_file"));\r
+        wxMemoryFSHandler::RemoveFile(wxT("XRC_resource/dummy_file"));\r
+        if (f) delete f;\r
+        else wxFileSystem::AddHandler(new wxMemoryFSHandlerBase);\r
+    }\r
+\r
+    XRC_ADD_FILE(wxT("XRC_resource/wxcrafter_bitmaps.cpp$._wxcrafter_bitmaps.xrc"), xml_res_file_0, xml_res_size_0, wxT("text/xml"));\r
+    wxXmlResource::Get()->Load(wxT("memory:XRC_resource/wxcrafter_bitmaps.cpp$._wxcrafter_bitmaps.xrc"));\r
+}\r
diff --git a/freedv/branches/0.97/build/codelite/dialogtest/wxcrafter_bitmaps.xrc b/freedv/branches/0.97/build/codelite/dialogtest/wxcrafter_bitmaps.xrc
new file mode 100644 (file)
index 0000000..8a0ee50
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<resource xmlns="http://www.wxwindows.org/wxxrc" version="2.3.0.1"/>
diff --git a/freedv/branches/0.97/build/codelite/fdmdv2.mk b/freedv/branches/0.97/build/codelite/fdmdv2.mk
new file mode 100644 (file)
index 0000000..1864ae1
--- /dev/null
@@ -0,0 +1,270 @@
+##\r
+## Auto Generated makefile by CodeLite IDE\r
+## any manual changes will be erased      \r
+##\r
+## Debug\r
+ProjectName            :=fdmdv2\r
+ConfigurationName      :=Debug\r
+WorkspacePath          := "D:\Projects\Radio\fdmdv2\build\codelite"\r
+ProjectPath            := "D:\Projects\Radio\fdmdv2\build\codelite"\r
+IntermediateDirectory  :=./Debug\r
+OutDir                 := $(IntermediateDirectory)\r
+CurrentFileName        :=\r
+CurrentFilePath        :=\r
+CurrentFileFullPath    :=\r
+User                   :=wittend\r
+Date                   :=5/6/2013\r
+CodeLitePath           :="D:\bin\CodeLite"\r
+LinkerName             :=g++\r
+SharedObjectLinkerName :=g++ -shared -fPIC\r
+ObjectSuffix           :=.o\r
+DependSuffix           :=.o.d\r
+PreprocessSuffix       :=.o.i\r
+DebugSwitch            :=-gstab\r
+IncludeSwitch          :=-I\r
+LibrarySwitch          :=-l\r
+OutputSwitch           :=-o \r
+LibraryPathSwitch      :=-L\r
+PreprocessorSwitch     :=-D\r
+SourceSwitch           :=-c \r
+OutputFile             :=$(IntermediateDirectory)/freeDV\r
+Preprocessors          :=$(PreprocessorSwitch)__WX__ $(PreprocessorSwitch)_NO_AUTOTOOLS_=1 $(PreprocessorSwitch)DMW=1 \r
+ObjectSwitch           :=-o \r
+ArchiveOutputSwitch    := \r
+PreprocessOnlySwitch   :=-E \r
+ObjectsFileList        :="fdmdv2.txt"\r
+PCHCompileFlags        :=\r
+MakeDirCommand         :=makedir\r
+RcCmpOptions           := $(shell wx-config --rcflags)\r
+RcCompilerName         :=windres\r
+LinkOptions            :=  -mwindows $(shell wx-config --debug=yes --libs --unicode=yes)\r
+IncludePath            :=  $(IncludeSwitch). $(IncludeSwitch)/bin/MinGW-4.7.1/msys/1.0/local/include $(IncludeSwitch)../../../codec2/src $(IncludeSwitch)/bin/Projects/Audio/libsndfile/include \r
+IncludePCH             := \r
+RcIncludePath          := \r
+Libs                   := $(LibrarySwitch)sndfile-1 $(LibrarySwitch)codec2 $(LibrarySwitch)portaudio $(LibrarySwitch)portaudiocpp $(LibrarySwitch)samplerate.dll $(LibrarySwitch)ctb-0.16 $(LibrarySwitch)sox \r
+ArLibs                 :=  "libsndfile-1.dll" "codec2" "libportaudio.a" "libportaudiocpp.a" "libsamplerate.dll.a" "libctb-0.16.a" "libsox" \r
+LibPath                := $(LibraryPathSwitch). $(LibraryPathSwitch)d:/Projects/Radio/codec2/src/.libs $(LibraryPathSwitch)d:/bin/MinGW-4.7.1/msys/1.0/local/lib \r
+\r
+##\r
+## Common variables\r
+## AR, CXX, CC, CXXFLAGS and CFLAGS can be overriden using an environment variables\r
+##\r
+AR       := ar rcus\r
+CXX      := g++\r
+CC       := gcc\r
+CXXFLAGS :=  -g -O0 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=yes)  -DSVN_REVISION=\"1237\"  $(Preprocessors)\r
+CFLAGS   :=  -g -O0 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=yes)  -DSVN_REVISION=\"1237\"  $(Preprocessors)\r
+\r
+\r
+##\r
+## User defined environment variables\r
+##\r
+CodeLiteDir:=D:\bin\CodeLite\r
+WXWIN:=D:\bin\wxWidgets-2.9.4\r
+PATH:=$(WXWIN)\lib\gcc_dll;$(PATH)\r
+WXCFG:=gcc_dll\mswu\r
+UNIT_TEST_PP_SRC_DIR:=D:\bin\UnitTest++1.3\r
+Objects0=$(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) \\r
+       $(IntermediateDirectory)/src_dlg_filter$(ObjectSuffix) $(IntermediateDirectory)/src_varicode$(ObjectSuffix) $(IntermediateDirectory)/src_sox_biquad$(ObjectSuffix) $(IntermediateDirectory)/src_dlg_about$(ObjectSuffix) $(IntermediateDirectory)/src_golay23$(ObjectSuffix) \r
+\r
+\r
+\r
+Objects=$(Objects0) \r
+\r
+##\r
+## Main Build Targets \r
+##\r
+.PHONY: all clean PreBuild PrePreBuild PostBuild\r
+all: $(OutputFile)\r
+\r
+$(OutputFile): $(IntermediateDirectory)/.d $(Objects) \r
+       @$(MakeDirCommand) $(@D)\r
+       @echo "" > $(IntermediateDirectory)/.d\r
+       @echo $(Objects0)  > $(ObjectsFileList)\r
+       $(LinkerName) $(OutputSwitch)$(OutputFile) @$(ObjectsFileList) $(LibPath) $(Libs) $(LinkOptions)\r
+\r
+$(IntermediateDirectory)/.d:\r
+       @$(MakeDirCommand) "./Debug"\r
+\r
+PreBuild:\r
+\r
+\r
+##\r
+## Objects\r
+##\r
+$(IntermediateDirectory)/src_dlg_comports$(ObjectSuffix): ../../src/dlg_comports.cpp $(IntermediateDirectory)/src_dlg_comports$(DependSuffix)\r
+       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/src/dlg_comports.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/src_dlg_comports$(ObjectSuffix) $(IncludePath)\r
+$(IntermediateDirectory)/src_dlg_comports$(DependSuffix): ../../src/dlg_comports.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/src_dlg_comports$(ObjectSuffix) -MF$(IntermediateDirectory)/src_dlg_comports$(DependSuffix) -MM "../../src/dlg_comports.cpp"\r
+\r
+$(IntermediateDirectory)/src_dlg_comports$(PreprocessSuffix): ../../src/dlg_comports.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_dlg_comports$(PreprocessSuffix) "../../src/dlg_comports.cpp"\r
+\r
+$(IntermediateDirectory)/src_fdmdv2_main$(ObjectSuffix): ../../src/fdmdv2_main.cpp $(IntermediateDirectory)/src_fdmdv2_main$(DependSuffix)\r
+       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/src/fdmdv2_main.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/src_fdmdv2_main$(ObjectSuffix) $(IncludePath)\r
+$(IntermediateDirectory)/src_fdmdv2_main$(DependSuffix): ../../src/fdmdv2_main.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/src_fdmdv2_main$(ObjectSuffix) -MF$(IntermediateDirectory)/src_fdmdv2_main$(DependSuffix) -MM "../../src/fdmdv2_main.cpp"\r
+\r
+$(IntermediateDirectory)/src_fdmdv2_main$(PreprocessSuffix): ../../src/fdmdv2_main.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_fdmdv2_main$(PreprocessSuffix) "../../src/fdmdv2_main.cpp"\r
+\r
+$(IntermediateDirectory)/src_fdmdv2_plot$(ObjectSuffix): ../../src/fdmdv2_plot.cpp $(IntermediateDirectory)/src_fdmdv2_plot$(DependSuffix)\r
+       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/src/fdmdv2_plot.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/src_fdmdv2_plot$(ObjectSuffix) $(IncludePath)\r
+$(IntermediateDirectory)/src_fdmdv2_plot$(DependSuffix): ../../src/fdmdv2_plot.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/src_fdmdv2_plot$(ObjectSuffix) -MF$(IntermediateDirectory)/src_fdmdv2_plot$(DependSuffix) -MM "../../src/fdmdv2_plot.cpp"\r
+\r
+$(IntermediateDirectory)/src_fdmdv2_plot$(PreprocessSuffix): ../../src/fdmdv2_plot.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_fdmdv2_plot$(PreprocessSuffix) "../../src/fdmdv2_plot.cpp"\r
+\r
+$(IntermediateDirectory)/src_topFrame$(ObjectSuffix): ../../src/topFrame.cpp $(IntermediateDirectory)/src_topFrame$(DependSuffix)\r
+       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/src/topFrame.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/src_topFrame$(ObjectSuffix) $(IncludePath)\r
+$(IntermediateDirectory)/src_topFrame$(DependSuffix): ../../src/topFrame.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/src_topFrame$(ObjectSuffix) -MF$(IntermediateDirectory)/src_topFrame$(DependSuffix) -MM "../../src/topFrame.cpp"\r
+\r
+$(IntermediateDirectory)/src_topFrame$(PreprocessSuffix): ../../src/topFrame.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_topFrame$(PreprocessSuffix) "../../src/topFrame.cpp"\r
+\r
+$(IntermediateDirectory)/src_fdmdv2_plot_scatter$(ObjectSuffix): ../../src/fdmdv2_plot_scatter.cpp $(IntermediateDirectory)/src_fdmdv2_plot_scatter$(DependSuffix)\r
+       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/src/fdmdv2_plot_scatter.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/src_fdmdv2_plot_scatter$(ObjectSuffix) $(IncludePath)\r
+$(IntermediateDirectory)/src_fdmdv2_plot_scatter$(DependSuffix): ../../src/fdmdv2_plot_scatter.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/src_fdmdv2_plot_scatter$(ObjectSuffix) -MF$(IntermediateDirectory)/src_fdmdv2_plot_scatter$(DependSuffix) -MM "../../src/fdmdv2_plot_scatter.cpp"\r
+\r
+$(IntermediateDirectory)/src_fdmdv2_plot_scatter$(PreprocessSuffix): ../../src/fdmdv2_plot_scatter.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_fdmdv2_plot_scatter$(PreprocessSuffix) "../../src/fdmdv2_plot_scatter.cpp"\r
+\r
+$(IntermediateDirectory)/src_fdmdv2_plot_spectrum$(ObjectSuffix): ../../src/fdmdv2_plot_spectrum.cpp $(IntermediateDirectory)/src_fdmdv2_plot_spectrum$(DependSuffix)\r
+       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/src/fdmdv2_plot_spectrum.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/src_fdmdv2_plot_spectrum$(ObjectSuffix) $(IncludePath)\r
+$(IntermediateDirectory)/src_fdmdv2_plot_spectrum$(DependSuffix): ../../src/fdmdv2_plot_spectrum.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/src_fdmdv2_plot_spectrum$(ObjectSuffix) -MF$(IntermediateDirectory)/src_fdmdv2_plot_spectrum$(DependSuffix) -MM "../../src/fdmdv2_plot_spectrum.cpp"\r
+\r
+$(IntermediateDirectory)/src_fdmdv2_plot_spectrum$(PreprocessSuffix): ../../src/fdmdv2_plot_spectrum.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_fdmdv2_plot_spectrum$(PreprocessSuffix) "../../src/fdmdv2_plot_spectrum.cpp"\r
+\r
+$(IntermediateDirectory)/src_fdmdv2_pa_wrapper$(ObjectSuffix): ../../src/fdmdv2_pa_wrapper.cpp $(IntermediateDirectory)/src_fdmdv2_pa_wrapper$(DependSuffix)\r
+       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/src/fdmdv2_pa_wrapper.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/src_fdmdv2_pa_wrapper$(ObjectSuffix) $(IncludePath)\r
+$(IntermediateDirectory)/src_fdmdv2_pa_wrapper$(DependSuffix): ../../src/fdmdv2_pa_wrapper.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/src_fdmdv2_pa_wrapper$(ObjectSuffix) -MF$(IntermediateDirectory)/src_fdmdv2_pa_wrapper$(DependSuffix) -MM "../../src/fdmdv2_pa_wrapper.cpp"\r
+\r
+$(IntermediateDirectory)/src_fdmdv2_pa_wrapper$(PreprocessSuffix): ../../src/fdmdv2_pa_wrapper.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_fdmdv2_pa_wrapper$(PreprocessSuffix) "../../src/fdmdv2_pa_wrapper.cpp"\r
+\r
+$(IntermediateDirectory)/src_fdmdv2_plot_scalar$(ObjectSuffix): ../../src/fdmdv2_plot_scalar.cpp $(IntermediateDirectory)/src_fdmdv2_plot_scalar$(DependSuffix)\r
+       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/src/fdmdv2_plot_scalar.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/src_fdmdv2_plot_scalar$(ObjectSuffix) $(IncludePath)\r
+$(IntermediateDirectory)/src_fdmdv2_plot_scalar$(DependSuffix): ../../src/fdmdv2_plot_scalar.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/src_fdmdv2_plot_scalar$(ObjectSuffix) -MF$(IntermediateDirectory)/src_fdmdv2_plot_scalar$(DependSuffix) -MM "../../src/fdmdv2_plot_scalar.cpp"\r
+\r
+$(IntermediateDirectory)/src_fdmdv2_plot_scalar$(PreprocessSuffix): ../../src/fdmdv2_plot_scalar.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_fdmdv2_plot_scalar$(PreprocessSuffix) "../../src/fdmdv2_plot_scalar.cpp"\r
+\r
+$(IntermediateDirectory)/src_fdmdv2_plot_waterfall_linux$(ObjectSuffix): ../../src/fdmdv2_plot_waterfall_linux.cpp $(IntermediateDirectory)/src_fdmdv2_plot_waterfall_linux$(DependSuffix)\r
+       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/src/fdmdv2_plot_waterfall_linux.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/src_fdmdv2_plot_waterfall_linux$(ObjectSuffix) $(IncludePath)\r
+$(IntermediateDirectory)/src_fdmdv2_plot_waterfall_linux$(DependSuffix): ../../src/fdmdv2_plot_waterfall_linux.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/src_fdmdv2_plot_waterfall_linux$(ObjectSuffix) -MF$(IntermediateDirectory)/src_fdmdv2_plot_waterfall_linux$(DependSuffix) -MM "../../src/fdmdv2_plot_waterfall_linux.cpp"\r
+\r
+$(IntermediateDirectory)/src_fdmdv2_plot_waterfall_linux$(PreprocessSuffix): ../../src/fdmdv2_plot_waterfall_linux.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_fdmdv2_plot_waterfall_linux$(PreprocessSuffix) "../../src/fdmdv2_plot_waterfall_linux.cpp"\r
+\r
+$(IntermediateDirectory)/src_dlg_audiooptions$(ObjectSuffix): ../../src/dlg_audiooptions.cpp $(IntermediateDirectory)/src_dlg_audiooptions$(DependSuffix)\r
+       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/src/dlg_audiooptions.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/src_dlg_audiooptions$(ObjectSuffix) $(IncludePath)\r
+$(IntermediateDirectory)/src_dlg_audiooptions$(DependSuffix): ../../src/dlg_audiooptions.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/src_dlg_audiooptions$(ObjectSuffix) -MF$(IntermediateDirectory)/src_dlg_audiooptions$(DependSuffix) -MM "../../src/dlg_audiooptions.cpp"\r
+\r
+$(IntermediateDirectory)/src_dlg_audiooptions$(PreprocessSuffix): ../../src/dlg_audiooptions.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_dlg_audiooptions$(PreprocessSuffix) "../../src/dlg_audiooptions.cpp"\r
+\r
+$(IntermediateDirectory)/src_dlg_filter$(ObjectSuffix): ../../src/dlg_filter.cpp $(IntermediateDirectory)/src_dlg_filter$(DependSuffix)\r
+       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/src/dlg_filter.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/src_dlg_filter$(ObjectSuffix) $(IncludePath)\r
+$(IntermediateDirectory)/src_dlg_filter$(DependSuffix): ../../src/dlg_filter.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/src_dlg_filter$(ObjectSuffix) -MF$(IntermediateDirectory)/src_dlg_filter$(DependSuffix) -MM "../../src/dlg_filter.cpp"\r
+\r
+$(IntermediateDirectory)/src_dlg_filter$(PreprocessSuffix): ../../src/dlg_filter.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_dlg_filter$(PreprocessSuffix) "../../src/dlg_filter.cpp"\r
+\r
+$(IntermediateDirectory)/src_varicode$(ObjectSuffix): ../../src/varicode.c $(IntermediateDirectory)/src_varicode$(DependSuffix)\r
+       $(CC) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/src/varicode.c" $(CFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/src_varicode$(ObjectSuffix) $(IncludePath)\r
+$(IntermediateDirectory)/src_varicode$(DependSuffix): ../../src/varicode.c\r
+       @$(CC) $(CFLAGS) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/src_varicode$(ObjectSuffix) -MF$(IntermediateDirectory)/src_varicode$(DependSuffix) -MM "../../src/varicode.c"\r
+\r
+$(IntermediateDirectory)/src_varicode$(PreprocessSuffix): ../../src/varicode.c\r
+       @$(CC) $(CFLAGS) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_varicode$(PreprocessSuffix) "../../src/varicode.c"\r
+\r
+$(IntermediateDirectory)/src_sox_biquad$(ObjectSuffix): ../../src/sox_biquad.c $(IntermediateDirectory)/src_sox_biquad$(DependSuffix)\r
+       $(CC) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/src/sox_biquad.c" $(CFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/src_sox_biquad$(ObjectSuffix) $(IncludePath)\r
+$(IntermediateDirectory)/src_sox_biquad$(DependSuffix): ../../src/sox_biquad.c\r
+       @$(CC) $(CFLAGS) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/src_sox_biquad$(ObjectSuffix) -MF$(IntermediateDirectory)/src_sox_biquad$(DependSuffix) -MM "../../src/sox_biquad.c"\r
+\r
+$(IntermediateDirectory)/src_sox_biquad$(PreprocessSuffix): ../../src/sox_biquad.c\r
+       @$(CC) $(CFLAGS) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_sox_biquad$(PreprocessSuffix) "../../src/sox_biquad.c"\r
+\r
+$(IntermediateDirectory)/src_dlg_about$(ObjectSuffix): ../../src/dlg_about.cpp $(IntermediateDirectory)/src_dlg_about$(DependSuffix)\r
+       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/src/dlg_about.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/src_dlg_about$(ObjectSuffix) $(IncludePath)\r
+$(IntermediateDirectory)/src_dlg_about$(DependSuffix): ../../src/dlg_about.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/src_dlg_about$(ObjectSuffix) -MF$(IntermediateDirectory)/src_dlg_about$(DependSuffix) -MM "../../src/dlg_about.cpp"\r
+\r
+$(IntermediateDirectory)/src_dlg_about$(PreprocessSuffix): ../../src/dlg_about.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_dlg_about$(PreprocessSuffix) "../../src/dlg_about.cpp"\r
+\r
+$(IntermediateDirectory)/src_golay23$(ObjectSuffix): ../../../codec2/src/golay23.c $(IntermediateDirectory)/src_golay23$(DependSuffix)\r
+       $(CC) $(SourceSwitch) "D:/Projects/Radio/codec2/src/golay23.c" $(CFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/src_golay23$(ObjectSuffix) $(IncludePath)\r
+$(IntermediateDirectory)/src_golay23$(DependSuffix): ../../../codec2/src/golay23.c\r
+       @$(CC) $(CFLAGS) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/src_golay23$(ObjectSuffix) -MF$(IntermediateDirectory)/src_golay23$(DependSuffix) -MM "../../../codec2/src/golay23.c"\r
+\r
+$(IntermediateDirectory)/src_golay23$(PreprocessSuffix): ../../../codec2/src/golay23.c\r
+       @$(CC) $(CFLAGS) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_golay23$(PreprocessSuffix) "../../../codec2/src/golay23.c"\r
+\r
+\r
+-include $(IntermediateDirectory)/*$(DependSuffix)\r
+##\r
+## Clean\r
+##\r
+clean:\r
+       $(RM) $(IntermediateDirectory)/src_dlg_comports$(ObjectSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_dlg_comports$(DependSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_dlg_comports$(PreprocessSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_fdmdv2_main$(ObjectSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_fdmdv2_main$(DependSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_fdmdv2_main$(PreprocessSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_fdmdv2_plot$(ObjectSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_fdmdv2_plot$(DependSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_fdmdv2_plot$(PreprocessSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_topFrame$(ObjectSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_topFrame$(DependSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_topFrame$(PreprocessSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_fdmdv2_plot_scatter$(ObjectSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_fdmdv2_plot_scatter$(DependSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_fdmdv2_plot_scatter$(PreprocessSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_fdmdv2_plot_spectrum$(ObjectSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_fdmdv2_plot_spectrum$(DependSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_fdmdv2_plot_spectrum$(PreprocessSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_fdmdv2_pa_wrapper$(ObjectSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_fdmdv2_pa_wrapper$(DependSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_fdmdv2_pa_wrapper$(PreprocessSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_fdmdv2_plot_scalar$(ObjectSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_fdmdv2_plot_scalar$(DependSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_fdmdv2_plot_scalar$(PreprocessSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_fdmdv2_plot_waterfall_linux$(ObjectSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_fdmdv2_plot_waterfall_linux$(DependSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_fdmdv2_plot_waterfall_linux$(PreprocessSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_dlg_audiooptions$(ObjectSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_dlg_audiooptions$(DependSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_dlg_audiooptions$(PreprocessSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_dlg_filter$(ObjectSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_dlg_filter$(DependSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_dlg_filter$(PreprocessSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_varicode$(ObjectSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_varicode$(DependSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_varicode$(PreprocessSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_sox_biquad$(ObjectSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_sox_biquad$(DependSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_sox_biquad$(PreprocessSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_dlg_about$(ObjectSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_dlg_about$(DependSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_dlg_about$(PreprocessSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_golay23$(ObjectSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_golay23$(DependSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_golay23$(PreprocessSuffix)\r
+       $(RM) $(OutputFile)\r
+       $(RM) $(OutputFile).exe\r
+       $(RM) ".build-debug/fdmdv2"\r
+\r
+\r
diff --git a/freedv/branches/0.97/build/codelite/fdmdv2.project b/freedv/branches/0.97/build/codelite/fdmdv2.project
new file mode 100644 (file)
index 0000000..acef6ef
--- /dev/null
@@ -0,0 +1,175 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CodeLite_Project Name="fdmdv2" InternalType="GUI">
+  <Plugins>
+    <Plugin Name="qmake">
+      <![CDATA[00020001N0005Debug0000000000000001N0007Release000000000000]]>
+    </Plugin>
+  </Plugins>
+  <Description/>
+  <Dependencies/>
+  <VirtualDirectory Name="src">
+    <File Name="../../src/dlg_comports.cpp"/>
+    <File Name="../../src/fdmdv2_main.cpp"/>
+    <File Name="../../src/fdmdv2_plot.cpp"/>
+    <File Name="../../src/topFrame.cpp"/>
+    <File Name="../../src/fdmdv2_plot_scatter.cpp"/>
+    <File Name="../../src/fdmdv2_plot_spectrum.cpp"/>
+    <File Name="../../src/fdmdv2_pa_wrapper.cpp"/>
+    <File Name="../../src/fdmdv2_plot_scalar.cpp"/>
+    <File Name="../../src/fdmdv2_plot_waterfall_linux.cpp"/>
+    <File Name="../../src/dlg_audiooptions.cpp"/>
+    <File Name="../../src/dlg_filter.cpp"/>
+    <File Name="../../src/varicode.c"/>
+    <File Name="../../src/sox_biquad.c"/>
+    <File Name="../../src/dlg_about.cpp"/>
+    <File Name="../../../codec2/src/golay23.c"/>
+  </VirtualDirectory>
+  <VirtualDirectory Name="include">
+    <File Name="../../src/dlg_comports.h"/>
+    <File Name="../../src/fdmdv2_main.h"/>
+    <File Name="../../src/fdmdv2_plot.h"/>
+    <File Name="../../src/topFrame.h"/>
+    <File Name="../../src/fdmdv2_plot_scatter.h"/>
+    <File Name="../../src/fdmdv2_plot_spectrum.h"/>
+    <File Name="../../src/fdmdv2_pa_wrapper.h"/>
+    <File Name="../../src/comp.h"/>
+    <File Name="../../src/fdmdv2_plot_scalar.h"/>
+    <File Name="../../../codec2/src/codec2.h"/>
+    <File Name="../../src/fdmdv2_defines.h"/>
+    <File Name="../../../Audio/libsndfile/include/sndfile.h"/>
+    <File Name="../../src/fdmdv2_plot_waterfall_linux.h"/>
+    <File Name="../../src/dlg_audiooptions.h"/>
+    <File Name="../../src/varicode.h"/>
+    <File Name="../../src/varicode_table.h"/>
+    <File Name="../../src/sox_biquad.h"/>
+    <File Name="../../src/dlg_about.h"/>
+    <File Name="../../../../code/libCTB-0.16/include/ctb-0.16/ctb.h"/>
+    <File Name="../../../../Audio/portaudio/include/portaudio.h"/>
+    <File Name="../../src/dlg_filter.h"/>
+    <File Name="../../src/version.h"/>
+    <File Name="../../../codec2/src/golay23.h"/>
+  </VirtualDirectory>
+  <VirtualDirectory Name="resources">
+    <File Name="../../src/FDMDV2.fbp"/>
+  </VirtualDirectory>
+  <Dependencies Name="Debug"/>
+  <Dependencies Name="Release"/>
+  <Settings Type="Executable">
+    <GlobalSettings>
+      <Compiler Options="" C_Options="">
+        <IncludePath Value="."/>
+      </Compiler>
+      <Linker Options="">
+        <LibraryPath Value="."/>
+      </Linker>
+      <ResourceCompiler Options=""/>
+    </GlobalSettings>
+    <Configuration Name="Debug" CompilerType="gnu g++" DebuggerType="GNU gdb debugger" Type="Executable" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append">
+      <Compiler Options="-g;-O0;-Wall;$(shell wx-config --cxxflags --unicode=yes --debug=yes)" C_Options="-g;-O0;-Wall;$(shell wx-config --cxxflags --unicode=yes --debug=yes)" Required="yes" PreCompiledHeader="" PCHInCommandLine="no" UseDifferentPCHFlags="no" PCHFlags="">
+        <IncludePath Value="/bin/MinGW-4.7.1/msys/1.0/local/include"/>
+        <IncludePath Value="../../../codec2/src"/>
+        <IncludePath Value="/bin/Projects/Audio/libsndfile/include"/>
+        <Preprocessor Value="__WX__"/>
+        <Preprocessor Value="_NO_AUTOTOOLS_=1"/>
+        <Preprocessor Value="DMW=1"/>
+      </Compiler>
+      <Linker Options="-mwindows;$(shell wx-config --debug=yes --libs --unicode=yes)" Required="yes">
+        <LibraryPath Value="d:/Projects/Radio/codec2/src/.libs"/>
+        <LibraryPath Value="d:/bin/MinGW-4.7.1/msys/1.0/local/lib"/>
+        <Library Value="libsndfile-1.dll"/>
+        <Library Value="codec2"/>
+        <Library Value="libportaudio.a"/>
+        <Library Value="libportaudiocpp.a"/>
+        <Library Value="libsamplerate.dll.a"/>
+        <Library Value="libctb-0.16.a"/>
+        <Library Value="libsox"/>
+      </Linker>
+      <ResourceCompiler Options="$(shell wx-config --rcflags)" Required="no"/>
+      <General OutputFile="$(IntermediateDirectory)/freeDV" IntermediateDirectory="./Debug" Command="./freeDV.exe" CommandArguments="" UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="no"/>
+      <Environment EnvVarSetName="&lt;Use Defaults&gt;" DbgSetName="&lt;Use Defaults&gt;">
+        <![CDATA[]]>
+      </Environment>
+      <Debugger IsRemote="no" RemoteHostName="" RemoteHostPort="" DebuggerPath="">
+        <PostConnectCommands/>
+        <StartupCommands/>
+      </Debugger>
+      <PreBuild/>
+      <PostBuild/>
+      <CustomBuild Enabled="no">
+        <RebuildCommand/>
+        <CleanCommand/>
+        <BuildCommand/>
+        <PreprocessFileCommand/>
+        <SingleFileCommand/>
+        <MakefileGenerationCommand/>
+        <ThirdPartyToolName>None</ThirdPartyToolName>
+        <WorkingDirectory/>
+      </CustomBuild>
+      <AdditionalRules>
+        <CustomPostBuild/>
+        <CustomPreBuild/>
+      </AdditionalRules>
+      <Completion EnableCpp11="no">
+        <ClangCmpFlagsC/>
+        <ClangCmpFlags/>
+        <ClangPP/>
+        <SearchPaths/>
+      </Completion>
+    </Configuration>
+    <Configuration Name="Release" CompilerType="gnu g++" DebuggerType="GNU gdb debugger" Type="Executable" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append">
+      <Compiler Options="-O2;-Wall;$(shell wx-config --cxxflags --unicode=yes --debug=no)" C_Options="-O2;-Wall;$(shell wx-config --cxxflags --unicode=yes --debug=no)" Required="yes" PreCompiledHeader="" PCHInCommandLine="no" UseDifferentPCHFlags="no" PCHFlags="">
+        <IncludePath Value="/bin/MinGW-4.7.1/msys/1.0/local/include"/>
+        <IncludePath Value="../../../codec2/src"/>
+        <IncludePath Value="../../../Audio/portaudio/include"/>
+        <IncludePath Value="../../../Audio/libsndfile/include"/>
+        <IncludePath Value="../../../Audio/libsamplerate-0.1.8/src"/>
+        <Preprocessor Value="__WX__"/>
+        <Preprocessor Value="DMW=1"/>
+        <Preprocessor Value="_NO_AUTOTOOLS_=1"/>
+      </Compiler>
+      <Linker Options="-mwindows;-s;$(shell wx-config --debug=no --libs --unicode=yes)" Required="yes">
+        <LibraryPath Value="d:/Projects/Radio/codec2/src/.libs"/>
+        <LibraryPath Value="d:/bin/MinGW-4.7.1/msys/1.0/local/lib"/>
+        <LibraryPath Value="d:/Projects/Audio/libsndfile/lib"/>
+        <Library Value="libsndfile-1.dll"/>
+        <Library Value="codec2"/>
+        <Library Value="libportaudio.a"/>
+        <Library Value="libportaudiocpp.a"/>
+        <Library Value="libsamplerate.dll.a"/>
+        <Library Value="libctb-0.16.a"/>
+        <Library Value="libsox.dll.a"/>
+      </Linker>
+      <ResourceCompiler Options="$(shell wx-config --rcflags)" Required="no"/>
+      <General OutputFile="$(IntermediateDirectory)/freeDV" IntermediateDirectory="./Release" Command="./freeDV.exe" CommandArguments="" UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="no"/>
+      <Environment EnvVarSetName="&lt;Use Defaults&gt;" DbgSetName="&lt;Use Defaults&gt;">
+        <![CDATA[]]>
+      </Environment>
+      <Debugger IsRemote="no" RemoteHostName="" RemoteHostPort="" DebuggerPath="">
+        <PostConnectCommands/>
+        <StartupCommands/>
+      </Debugger>
+      <PreBuild/>
+      <PostBuild/>
+      <CustomBuild Enabled="no">
+        <RebuildCommand/>
+        <CleanCommand/>
+        <BuildCommand/>
+        <PreprocessFileCommand/>
+        <SingleFileCommand/>
+        <MakefileGenerationCommand/>
+        <ThirdPartyToolName>None</ThirdPartyToolName>
+        <WorkingDirectory/>
+      </CustomBuild>
+      <AdditionalRules>
+        <CustomPostBuild/>
+        <CustomPreBuild/>
+      </AdditionalRules>
+      <Completion EnableCpp11="no">
+        <ClangCmpFlagsC/>
+        <ClangCmpFlags/>
+        <ClangPP/>
+        <SearchPaths/>
+      </Completion>
+    </Configuration>
+  </Settings>
+</CodeLite_Project>
diff --git a/freedv/branches/0.97/build/codelite/fdmdv2.txt b/freedv/branches/0.97/build/codelite/fdmdv2.txt
new file mode 100644 (file)
index 0000000..7b08125
--- /dev/null
@@ -0,0 +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 ./Debug/src_dlg_about.o ./Debug/src_golay23.o   \r
diff --git a/freedv/branches/0.97/build/codelite/fdmdv2.workspace b/freedv/branches/0.97/build/codelite/fdmdv2.workspace
new file mode 100644 (file)
index 0000000..9a56dfc
--- /dev/null
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CodeLite_Workspace Name="fdmdv2" Database="./fdmdv2.tags">
+  <Project Name="fdmdv2" Path="fdmdv2.project" Active="Yes"/>
+  <Environment>
+    <![CDATA[]]>
+  </Environment>
+  <Project Name="hamlib_trial" Path="hamlib_trial/hamlib_trial.project" Active="No"/>
+  <BuildMatrix>
+    <WorkspaceConfiguration Name="Debug" Selected="yes">
+      <Project Name="fdmdv2" ConfigName="Debug"/>
+      <Project Name="rawbits" ConfigName="Debug"/>
+      <Project Name="pa_enum" ConfigName="Debug"/>
+      <Project Name="appWithDlg" ConfigName="Debug"/>
+      <Project Name="dialogTest" ConfigName="Debug"/>
+      <Project Name="bigButtonRig" ConfigName="Debug"/>
+      <Project Name="enumSerial" ConfigName="Debug"/>
+      <Project Name="hamlib_trial" ConfigName="Debug"/>
+    </WorkspaceConfiguration>
+    <WorkspaceConfiguration Name="Release" Selected="no">
+      <Project Name="fdmdv2" ConfigName="Release"/>
+      <Project Name="rawbits" ConfigName="Release"/>
+      <Project Name="pa_enum" ConfigName="Release"/>
+      <Project Name="appWithDlg" ConfigName="Release"/>
+      <Project Name="dialogTest" ConfigName="Release"/>
+      <Project Name="bigButtonRig" ConfigName="Release"/>
+      <Project Name="enumSerial" ConfigName="Release"/>
+      <Project Name="hamlib_trial" ConfigName="Release"/>
+    </WorkspaceConfiguration>
+  </BuildMatrix>
+</CodeLite_Workspace>
diff --git a/freedv/branches/0.97/build/codelite/fdmdv2_copyright_block.txt b/freedv/branches/0.97/build/codelite/fdmdv2_copyright_block.txt
new file mode 100644 (file)
index 0000000..785ec41
--- /dev/null
@@ -0,0 +1,24 @@
+//==========================================================================\r
+// Name:\r
+// Purpose:\r
+// Created:         June 22, 2012
+// Initial author:  David Witten\r
+// Derived from:\r
+// License:\r
+//\r
+//  Copyright (C) 2012 David Witten
+//
+//  All rights reserved.
+//
+//  This program is free software; you can redistribute it and/or modify
+//  it under the terms of the GNU Lesser 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 Lesser General Public License
+//  along with this program; if not, see <http://www.gnu.org/licenses/>.
+//
+//==========================================================================\r
diff --git a/freedv/branches/0.97/build/codelite/fdmdv2_wsp.mk b/freedv/branches/0.97/build/codelite/fdmdv2_wsp.mk
new file mode 100644 (file)
index 0000000..4226245
--- /dev/null
@@ -0,0 +1,8 @@
+.PHONY: clean All
+
+All:
+       @echo "----------Building project:[ fdmdv2 - Debug ]----------"
+       @$(MAKE) -f  "fdmdv2.mk"
+clean:
+       @echo "----------Cleaning project:[ fdmdv2 - Debug ]----------"
+       @$(MAKE) -f  "fdmdv2.mk" clean
diff --git a/freedv/branches/0.97/build/codelite/hamlib_trial/MainFrame.cpp b/freedv/branches/0.97/build/codelite/hamlib_trial/MainFrame.cpp
new file mode 100644 (file)
index 0000000..c0fae92
--- /dev/null
@@ -0,0 +1,80 @@
+#include "main.h"
+#include "MainFrame.h"
+#include <wx/aboutdlg.h>
+#include "dlg_rig_ctrl.h"
+
+MainFrame::MainFrame(wxWindow* parent): MainFrameBaseClass(parent)
+{
+    wxConfigBase *pConfig = wxConfigBase::Get();
+    if(pConfig)
+    {
+        pConfig->SetRecordDefaults();
+
+        // 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);
+
+        Move(x, y);
+        SetClientSize(w, h);
+    }
+}
+
+MainFrame::~MainFrame()
+{
+    int x;
+    int y;
+    int w;
+    int h;
+
+    wxConfigBase *pConfig = wxConfigBase::Get();
+    if(pConfig)
+    {
+        GetClientSize(&w, &h);
+        GetPosition(&x, &y);
+        //wxLogDebug("x = %d y = %d w = %d h = %d\n", x,y,w,h);
+        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);
+    }
+    delete wxConfigBase::Set((wxConfigBase *) NULL);
+}
+
+void MainFrame::OnExit(wxCommandEvent& event)
+{
+    wxUnusedVar(event);
+    Close();
+}
+
+void MainFrame::OnAbout(wxCommandEvent& event)
+{
+    wxUnusedVar(event);
+    wxAboutDialogInfo info;
+    info.SetCopyright(_("HAMLib Test"));
+    info.SetLicence(_("GPL v2 or later"));
+    info.SetDescription(_("Short description goes here"));
+    ::wxAboutBox(info);
+}
+
+void MainFrame::OnNew(wxCommandEvent& event)
+{
+}
+
+void MainFrame::OnOpen(wxCommandEvent& event)
+{
+}
+
+void MainFrame::OnSize(wxSizeEvent& event)
+{
+}
+
+void MainFrame::OnToolsPrefs(wxCommandEvent& event)
+{
+    wxUnusedVar(event);
+    DlgRigCtrlBase *dlg = new DlgRigCtrlBase(NULL);
+    //int rVal = dlg
+    dlg->ShowModal();
+    delete dlg;
+}
diff --git a/freedv/branches/0.97/build/codelite/hamlib_trial/MainFrame.h b/freedv/branches/0.97/build/codelite/hamlib_trial/MainFrame.h
new file mode 100644 (file)
index 0000000..2797db0
--- /dev/null
@@ -0,0 +1,19 @@
+#ifndef MAINFRAME_H
+#define MAINFRAME_H
+#include "wxcrafter.h"
+
+class MainFrame : public MainFrameBaseClass
+{
+public:
+    MainFrame(wxWindow* parent);
+    virtual ~MainFrame();
+
+    void OnExit(wxCommandEvent& event);
+    void OnAbout(wxCommandEvent& event);
+protected:
+    virtual void OnToolsPrefs(wxCommandEvent& event);
+    virtual void OnNew(wxCommandEvent& event);
+    virtual void OnOpen(wxCommandEvent& event);
+    virtual void OnSize(wxSizeEvent& event);
+};
+#endif // MAINFRAME_H
diff --git a/freedv/branches/0.97/build/codelite/hamlib_trial/dlg_rig_ctrl.cpp b/freedv/branches/0.97/build/codelite/hamlib_trial/dlg_rig_ctrl.cpp
new file mode 100644 (file)
index 0000000..82ba665
--- /dev/null
@@ -0,0 +1,10 @@
+#include "dlg_rig_ctrl.h"
+
+DialogRigCtrl::DialogRigCtrl(wxWindow* parent) : DlgRigCtrlBase(parent)
+{
+}
+
+DialogRigCtrl::~DialogRigCtrl()
+{
+}
+
diff --git a/freedv/branches/0.97/build/codelite/hamlib_trial/dlg_rig_ctrl.h b/freedv/branches/0.97/build/codelite/hamlib_trial/dlg_rig_ctrl.h
new file mode 100644 (file)
index 0000000..88f2f88
--- /dev/null
@@ -0,0 +1,11 @@
+#ifndef DIALOGRIGCTRL_H
+#define DIALOGRIGCTRL_H
+#include "wxcrafter.h"
+
+class DialogRigCtrl : public DlgRigCtrlBase
+{
+public:
+    DialogRigCtrl(wxWindow* parent);
+    virtual ~DialogRigCtrl();
+};
+#endif // DIALOGRIGCTRL_H
diff --git a/freedv/branches/0.97/build/codelite/hamlib_trial/hamlib_trial.mk b/freedv/branches/0.97/build/codelite/hamlib_trial/hamlib_trial.mk
new file mode 100644 (file)
index 0000000..c5ffaba
--- /dev/null
@@ -0,0 +1,162 @@
+##\r
+## Auto Generated makefile by CodeLite IDE\r
+## any manual changes will be erased      \r
+##\r
+## Debug\r
+ProjectName            :=hamlib_trial\r
+ConfigurationName      :=Debug\r
+WorkspacePath          := "D:\Projects\Radio\fdmdv2\build\codelite"\r
+ProjectPath            := "D:\Projects\Radio\fdmdv2\build\codelite\hamlib_trial"\r
+IntermediateDirectory  :=./Debug\r
+OutDir                 := $(IntermediateDirectory)\r
+CurrentFileName        :=\r
+CurrentFilePath        :=\r
+CurrentFileFullPath    :=\r
+User                   :=wittend\r
+Date                   :=5/6/2013\r
+CodeLitePath           :="D:\bin\CodeLite"\r
+LinkerName             :=g++\r
+SharedObjectLinkerName :=g++ -shared -fPIC\r
+ObjectSuffix           :=.o\r
+DependSuffix           :=.o.d\r
+PreprocessSuffix       :=.o.i\r
+DebugSwitch            :=-gstab\r
+IncludeSwitch          :=-I\r
+LibrarySwitch          :=-l\r
+OutputSwitch           :=-o \r
+LibraryPathSwitch      :=-L\r
+PreprocessorSwitch     :=-D\r
+SourceSwitch           :=-c \r
+OutputFile             :=$(IntermediateDirectory)/$(ProjectName)\r
+Preprocessors          :=\r
+ObjectSwitch           :=-o \r
+ArchiveOutputSwitch    := \r
+PreprocessOnlySwitch   :=-E \r
+ObjectsFileList        :="hamlib_trial.txt"\r
+PCHCompileFlags        :=\r
+MakeDirCommand         :=makedir\r
+RcCmpOptions           := $(shell wx-config --rcflags)\r
+RcCompilerName         :=windres\r
+LinkOptions            :=  $(shell wx-config --libs --debug) -mwindows\r
+IncludePath            :=  $(IncludeSwitch). $(IncludeSwitch). \r
+IncludePCH             := \r
+RcIncludePath          := \r
+Libs                   := \r
+ArLibs                 :=  \r
+LibPath                := $(LibraryPathSwitch). \r
+\r
+##\r
+## Common variables\r
+## AR, CXX, CC, CXXFLAGS and CFLAGS can be overriden using an environment variables\r
+##\r
+AR       := ar rcus\r
+CXX      := g++\r
+CC       := gcc\r
+CXXFLAGS :=  -g -O0 -Wall $(shell wx-config --cflags --debug)  -DSVN_REVISION=\"1237\"  $(Preprocessors)\r
+CFLAGS   :=  -g -O0 -Wall  -DSVN_REVISION=\"1237\"  $(Preprocessors)\r
+\r
+\r
+##\r
+## User defined environment variables\r
+##\r
+CodeLiteDir:=D:\bin\CodeLite\r
+WXWIN:=D:\bin\wxWidgets-2.9.4\r
+PATH:=$(WXWIN)\lib\gcc_dll;$(PATH)\r
+WXCFG:=gcc_dll\mswu\r
+UNIT_TEST_PP_SRC_DIR:=D:\bin\UnitTest++1.3\r
+Objects0=$(IntermediateDirectory)/main$(ObjectSuffix) $(IntermediateDirectory)/MainFrame$(ObjectSuffix) $(IntermediateDirectory)/wxcrafter$(ObjectSuffix) $(IntermediateDirectory)/wxcrafter_bitmaps$(ObjectSuffix) $(IntermediateDirectory)/win_resources.rc$(ObjectSuffix) $(IntermediateDirectory)/dlg_rig_ctrl$(ObjectSuffix) \r
+\r
+\r
+\r
+Objects=$(Objects0) \r
+\r
+##\r
+## Main Build Targets \r
+##\r
+.PHONY: all clean PreBuild PrePreBuild PostBuild\r
+all: $(OutputFile)\r
+\r
+$(OutputFile): $(IntermediateDirectory)/.d $(Objects) \r
+       @$(MakeDirCommand) $(@D)\r
+       @echo "" > $(IntermediateDirectory)/.d\r
+       @echo $(Objects0)  > $(ObjectsFileList)\r
+       $(LinkerName) $(OutputSwitch)$(OutputFile) @$(ObjectsFileList) $(LibPath) $(Libs) $(LinkOptions)\r
+\r
+$(IntermediateDirectory)/.d:\r
+       @$(MakeDirCommand) "./Debug"\r
+\r
+PreBuild:\r
+\r
+\r
+##\r
+## Objects\r
+##\r
+$(IntermediateDirectory)/main$(ObjectSuffix): main.cpp $(IntermediateDirectory)/main$(DependSuffix)\r
+       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/build/codelite/hamlib_trial/main.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/main$(ObjectSuffix) $(IncludePath)\r
+$(IntermediateDirectory)/main$(DependSuffix): main.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/main$(ObjectSuffix) -MF$(IntermediateDirectory)/main$(DependSuffix) -MM "main.cpp"\r
+\r
+$(IntermediateDirectory)/main$(PreprocessSuffix): main.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/main$(PreprocessSuffix) "main.cpp"\r
+\r
+$(IntermediateDirectory)/MainFrame$(ObjectSuffix): MainFrame.cpp $(IntermediateDirectory)/MainFrame$(DependSuffix)\r
+       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/build/codelite/hamlib_trial/MainFrame.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/MainFrame$(ObjectSuffix) $(IncludePath)\r
+$(IntermediateDirectory)/MainFrame$(DependSuffix): MainFrame.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/MainFrame$(ObjectSuffix) -MF$(IntermediateDirectory)/MainFrame$(DependSuffix) -MM "MainFrame.cpp"\r
+\r
+$(IntermediateDirectory)/MainFrame$(PreprocessSuffix): MainFrame.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/MainFrame$(PreprocessSuffix) "MainFrame.cpp"\r
+\r
+$(IntermediateDirectory)/wxcrafter$(ObjectSuffix): wxcrafter.cpp $(IntermediateDirectory)/wxcrafter$(DependSuffix)\r
+       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/build/codelite/hamlib_trial/wxcrafter.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/wxcrafter$(ObjectSuffix) $(IncludePath)\r
+$(IntermediateDirectory)/wxcrafter$(DependSuffix): wxcrafter.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/wxcrafter$(ObjectSuffix) -MF$(IntermediateDirectory)/wxcrafter$(DependSuffix) -MM "wxcrafter.cpp"\r
+\r
+$(IntermediateDirectory)/wxcrafter$(PreprocessSuffix): wxcrafter.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/wxcrafter$(PreprocessSuffix) "wxcrafter.cpp"\r
+\r
+$(IntermediateDirectory)/wxcrafter_bitmaps$(ObjectSuffix): wxcrafter_bitmaps.cpp $(IntermediateDirectory)/wxcrafter_bitmaps$(DependSuffix)\r
+       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/build/codelite/hamlib_trial/wxcrafter_bitmaps.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/wxcrafter_bitmaps$(ObjectSuffix) $(IncludePath)\r
+$(IntermediateDirectory)/wxcrafter_bitmaps$(DependSuffix): wxcrafter_bitmaps.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/wxcrafter_bitmaps$(ObjectSuffix) -MF$(IntermediateDirectory)/wxcrafter_bitmaps$(DependSuffix) -MM "wxcrafter_bitmaps.cpp"\r
+\r
+$(IntermediateDirectory)/wxcrafter_bitmaps$(PreprocessSuffix): wxcrafter_bitmaps.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/wxcrafter_bitmaps$(PreprocessSuffix) "wxcrafter_bitmaps.cpp"\r
+\r
+$(IntermediateDirectory)/win_resources.rc$(ObjectSuffix): win_resources.rc\r
+       $(RcCompilerName) -i "D:/Projects/Radio/fdmdv2/build/codelite/hamlib_trial/win_resources.rc" $(RcCmpOptions)   $(ObjectSwitch)$(IntermediateDirectory)/win_resources.rc$(ObjectSuffix) $(RcIncludePath)\r
+$(IntermediateDirectory)/dlg_rig_ctrl$(ObjectSuffix): dlg_rig_ctrl.cpp $(IntermediateDirectory)/dlg_rig_ctrl$(DependSuffix)\r
+       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/build/codelite/hamlib_trial/dlg_rig_ctrl.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/dlg_rig_ctrl$(ObjectSuffix) $(IncludePath)\r
+$(IntermediateDirectory)/dlg_rig_ctrl$(DependSuffix): dlg_rig_ctrl.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/dlg_rig_ctrl$(ObjectSuffix) -MF$(IntermediateDirectory)/dlg_rig_ctrl$(DependSuffix) -MM "dlg_rig_ctrl.cpp"\r
+\r
+$(IntermediateDirectory)/dlg_rig_ctrl$(PreprocessSuffix): dlg_rig_ctrl.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/dlg_rig_ctrl$(PreprocessSuffix) "dlg_rig_ctrl.cpp"\r
+\r
+\r
+-include $(IntermediateDirectory)/*$(DependSuffix)\r
+##\r
+## Clean\r
+##\r
+clean:\r
+       $(RM) $(IntermediateDirectory)/main$(ObjectSuffix)\r
+       $(RM) $(IntermediateDirectory)/main$(DependSuffix)\r
+       $(RM) $(IntermediateDirectory)/main$(PreprocessSuffix)\r
+       $(RM) $(IntermediateDirectory)/MainFrame$(ObjectSuffix)\r
+       $(RM) $(IntermediateDirectory)/MainFrame$(DependSuffix)\r
+       $(RM) $(IntermediateDirectory)/MainFrame$(PreprocessSuffix)\r
+       $(RM) $(IntermediateDirectory)/wxcrafter$(ObjectSuffix)\r
+       $(RM) $(IntermediateDirectory)/wxcrafter$(DependSuffix)\r
+       $(RM) $(IntermediateDirectory)/wxcrafter$(PreprocessSuffix)\r
+       $(RM) $(IntermediateDirectory)/wxcrafter_bitmaps$(ObjectSuffix)\r
+       $(RM) $(IntermediateDirectory)/wxcrafter_bitmaps$(DependSuffix)\r
+       $(RM) $(IntermediateDirectory)/wxcrafter_bitmaps$(PreprocessSuffix)\r
+       $(RM) $(IntermediateDirectory)/win_resources.rc$(ObjectSuffix)\r
+       $(RM) $(IntermediateDirectory)/dlg_rig_ctrl$(ObjectSuffix)\r
+       $(RM) $(IntermediateDirectory)/dlg_rig_ctrl$(DependSuffix)\r
+       $(RM) $(IntermediateDirectory)/dlg_rig_ctrl$(PreprocessSuffix)\r
+       $(RM) $(OutputFile)\r
+       $(RM) $(OutputFile).exe\r
+       $(RM) "../.build-debug/hamlib_trial"\r
+\r
+\r
diff --git a/freedv/branches/0.97/build/codelite/hamlib_trial/hamlib_trial.project b/freedv/branches/0.97/build/codelite/hamlib_trial/hamlib_trial.project
new file mode 100644 (file)
index 0000000..1217de4
--- /dev/null
@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CodeLite_Project Name="hamlib_trial" InternalType="GUI">
+  <Plugins>
+    <Plugin Name="qmake">
+      <![CDATA[00010001N0007Release000000000000]]>
+    </Plugin>
+  </Plugins>
+  <Description/>
+  <Dependencies/>
+  <VirtualDirectory Name="src">
+    <File Name="main.cpp"/>
+    <File Name="MainFrame.cpp"/>
+    <File Name="wxcrafter.cpp"/>
+    <File Name="wxcrafter_bitmaps.cpp"/>
+  </VirtualDirectory>
+  <VirtualDirectory Name="include">
+    <File Name="MainFrame.h"/>
+    <File Name="wxcrafter.h"/>
+    <File Name="main.h"/>
+  </VirtualDirectory>
+  <VirtualDirectory Name="resources">
+    <File Name="wxcrafter.wxcp"/>
+    <File Name="win_resources.rc"/>
+  </VirtualDirectory>
+  <Dependencies Name="Debug"/>
+  <Dependencies Name="Release"/>
+  <Settings Type="Executable">
+    <GlobalSettings>
+      <Compiler Options="" C_Options="">
+        <IncludePath Value="."/>
+      </Compiler>
+      <Linker Options="">
+        <LibraryPath Value="."/>
+      </Linker>
+      <ResourceCompiler Options=""/>
+    </GlobalSettings>
+    <Configuration Name="Debug" CompilerType="gnu g++" DebuggerType="GNU gdb debugger" Type="Executable" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append">
+      <Compiler Options="-g;-O0;-Wall;$(shell wx-config --cflags --debug)" C_Options="-g;-O0;-Wall" Required="yes" PreCompiledHeader="" PCHInCommandLine="no" UseDifferentPCHFlags="no" PCHFlags="">
+        <IncludePath Value="."/>
+      </Compiler>
+      <Linker Options="$(shell wx-config --libs --debug);-mwindows" Required="yes"/>
+      <ResourceCompiler Options="$(shell wx-config --rcflags)" Required="no"/>
+      <General OutputFile="$(IntermediateDirectory)/$(ProjectName)" IntermediateDirectory="./Debug" Command="./$(ProjectName)" CommandArguments="" UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="no"/>
+      <Environment EnvVarSetName="&lt;Use Defaults&gt;" DbgSetName="&lt;Use Defaults&gt;">
+        <![CDATA[]]>
+      </Environment>
+      <Debugger IsRemote="no" RemoteHostName="" RemoteHostPort="" DebuggerPath="">
+        <PostConnectCommands/>
+        <StartupCommands/>
+      </Debugger>
+      <PreBuild/>
+      <PostBuild/>
+      <CustomBuild Enabled="no">
+        <RebuildCommand/>
+        <CleanCommand/>
+        <BuildCommand/>
+        <PreprocessFileCommand/>
+        <SingleFileCommand/>
+        <MakefileGenerationCommand/>
+        <ThirdPartyToolName>None</ThirdPartyToolName>
+        <WorkingDirectory/>
+      </CustomBuild>
+      <AdditionalRules>
+        <CustomPostBuild/>
+        <CustomPreBuild/>
+      </AdditionalRules>
+      <Completion EnableCpp11="no">
+        <ClangCmpFlagsC/>
+        <ClangCmpFlags/>
+        <ClangPP/>
+        <SearchPaths/>
+      </Completion>
+    </Configuration>
+    <Configuration Name="Release" CompilerType="gnu g++" DebuggerType="GNU gdb debugger" Type="Executable" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append">
+      <Compiler Options="-O2;-Wall;$(shell wx-config --cflags)" C_Options="-O2;-Wall" Required="yes" PreCompiledHeader="" PCHInCommandLine="no" UseDifferentPCHFlags="no" PCHFlags="">
+        <IncludePath Value="."/>
+        <IncludePath Value="D:/Projects/Radio/fdmdv2/build/codelite/hamlib-win32-1.2.15.3/include/hamlib"/>
+        <IncludePath Value="D:\Projects\Radio\fdmdv2\build\codelite\hamlib-win32-1.2.15.3\include"/>
+      </Compiler>
+      <Linker Options="$(shell wx-config --libs);-mwindows" Required="yes"/>
+      <ResourceCompiler Options="$(shell wx-config --rcflags)" Required="no"/>
+      <General OutputFile="$(IntermediateDirectory)/$(ProjectName)" IntermediateDirectory="./Release" Command="./$(ProjectName)" CommandArguments="" UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="no"/>
+      <Environment EnvVarSetName="&lt;Use Defaults&gt;" DbgSetName="&lt;Use Defaults&gt;">
+        <![CDATA[]]>
+      </Environment>
+      <Debugger IsRemote="no" RemoteHostName="" RemoteHostPort="" DebuggerPath="">
+        <PostConnectCommands/>
+        <StartupCommands/>
+      </Debugger>
+      <PreBuild/>
+      <PostBuild/>
+      <CustomBuild Enabled="no">
+        <RebuildCommand/>
+        <CleanCommand/>
+        <BuildCommand/>
+        <PreprocessFileCommand/>
+        <SingleFileCommand/>
+        <MakefileGenerationCommand/>
+        <ThirdPartyToolName>None</ThirdPartyToolName>
+        <WorkingDirectory/>
+      </CustomBuild>
+      <AdditionalRules>
+        <CustomPostBuild/>
+        <CustomPreBuild/>
+      </AdditionalRules>
+      <Completion EnableCpp11="no">
+        <ClangCmpFlagsC/>
+        <ClangCmpFlags/>
+        <ClangPP/>
+        <SearchPaths/>
+      </Completion>
+    </Configuration>
+  </Settings>
+  <VirtualDirectory Name="rig_ctrl">
+    <File Name="dlg_rig_ctrl.h"/>
+    <File Name="dlg_rig_ctrl.cpp"/>
+  </VirtualDirectory>
+  <VirtualDirectory Name="wxcrafter">
+    <VirtualDirectory Name="XRC">
+      <File Name="wxcrafter.xrc"/>
+    </VirtualDirectory>
+  </VirtualDirectory>
+</CodeLite_Project>
diff --git a/freedv/branches/0.97/build/codelite/hamlib_trial/hamlib_trial.txt b/freedv/branches/0.97/build/codelite/hamlib_trial/hamlib_trial.txt
new file mode 100644 (file)
index 0000000..2ade1a7
--- /dev/null
@@ -0,0 +1 @@
+./Release/main.o ./Release/MainFrame.o ./Release/wxcrafter.o ./Release/wxcrafter_bitmaps.o ./Release/win_resources.rc.o ./Release/dlg_rig_ctrl.o   \r
diff --git a/freedv/branches/0.97/build/codelite/hamlib_trial/main.cpp b/freedv/branches/0.97/build/codelite/hamlib_trial/main.cpp
new file mode 100644 (file)
index 0000000..56eb165
--- /dev/null
@@ -0,0 +1,24 @@
+#include "main.h"
+#include "MainFrame.h"
+
+IMPLEMENT_APP(MainApp)
+
+bool MainApp::OnInit()
+{
+    // Add the common image handlers
+    wxImage::AddHandler( new wxPNGHandler );
+    wxImage::AddHandler( new wxJPEGHandler );
+
+    SetVendorName(wxT("CODEC2-Project"));
+    SetAppName(wxT("Hamlib test"));
+
+    wxConfig *pConfig = new wxConfig();
+    wxFileConfig *pFConfig = new wxFileConfig(wxT("visiWidgits"), wxT("WWR Development"), wxT("visiWidgits.conf"), wxT("visiWidgits.conf"),  wxCONFIG_USE_LOCAL_FILE | wxCONFIG_USE_RELATIVE_PATH);
+    pConfig->Set(pFConfig);
+    pConfig->SetRecordDefaults();
+
+
+    MainFrame *mainFrame = new MainFrame(NULL);
+    SetTopWindow(mainFrame);
+    return GetTopWindow()->Show();
+}
diff --git a/freedv/branches/0.97/build/codelite/hamlib_trial/main.h b/freedv/branches/0.97/build/codelite/hamlib_trial/main.h
new file mode 100644 (file)
index 0000000..424bde9
--- /dev/null
@@ -0,0 +1,62 @@
+//==========================================================================
+// Name:            main.h
+//
+// Purpose:         Inclusions and constants for the entire visiWidgets program.
+// Created:         Mar. 01, 2013
+// Authors:         David Witten
+//
+// License:
+//
+//  You should have received a copy of the GNU General Public License
+//  along with this program; if not, see <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#ifndef __HAMLIBTRIAL_MAIN__
+#define __HAMLIBTRIAL_MAIN__
+
+#include <wx/wx.h>
+#include <wx/aui/framemanager.h>
+#include <wx/app.h>
+#include <wx/event.h>
+#include "wx/file.h"
+#include "wx/filename.h"
+#include "wx/config.h"
+#include <wx/fileconf.h>
+#include <wx/image.h>
+
+#include "MainFrame.h"
+
+#include "rig.h"
+#include "rig_dll.h"
+#include "riglist.h"
+#include "rotator.h"
+#include "rotlist.h"
+
+#if defined(__WINDOWS__)
+#undef wxUSE_CONFIG_NATIVE
+#endif
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class MainApp
+//
+// @class $(Name)
+// @author $(User)
+// @date $(Date)
+// @file $(CurrentFileName).$(CurrentFileExt)
+// @brief
+//
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Define the MainApp
+class MainApp : public wxApp
+{
+public:
+    MainApp() {}
+    virtual ~MainApp() {}
+
+    virtual bool OnInit();
+};
+
+DECLARE_APP(MainApp)
+//IMPLEMENT_APP(MainApp)
+
+#endif //__HAMLIBTRIAL_MAIN__
diff --git a/freedv/branches/0.97/build/codelite/hamlib_trial/win_resources.rc b/freedv/branches/0.97/build/codelite/hamlib_trial/win_resources.rc
new file mode 100644 (file)
index 0000000..fa70c15
--- /dev/null
@@ -0,0 +1,2 @@
+#include "wx/msw/wx.rc"\r
+1 24 "wx/msw/wx.manifest"\r
diff --git a/freedv/branches/0.97/build/codelite/hamlib_trial/wxcrafter.cpp b/freedv/branches/0.97/build/codelite/hamlib_trial/wxcrafter.cpp
new file mode 100644 (file)
index 0000000..4195f37
--- /dev/null
@@ -0,0 +1,754 @@
+//////////////////////////////////////////////////////////////////////
+// This file was auto-generated by codelite's wxCrafter Plugin
+// Do not modify this file by hand!
+//////////////////////////////////////////////////////////////////////
+
+#include "wxcrafter.h"
+
+
+// Declare the bitmap loading function
+extern void wxC9ED9InitBitmapResources();
+
+static bool bBitmapLoaded = false;
+
+
+MainFrameBaseClass::MainFrameBaseClass(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style)
+    : wxFrame(parent, id, title, pos, size, style)
+{
+    if ( !bBitmapLoaded ) {
+        // We need to initialise the default bitmap handler
+        wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler);
+        wxC9ED9InitBitmapResources();
+        bBitmapLoaded = true;
+    }
+    
+    wxBoxSizer* boxSizer1 = new wxBoxSizer(wxVERTICAL);
+    this->SetSizer(boxSizer1);
+    
+    m_mainPanel = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), wxTAB_TRAVERSAL);
+    
+    boxSizer1->Add(m_mainPanel, 1, wxEXPAND, 5);
+    
+    wxBoxSizer* boxSizer33 = new wxBoxSizer(wxVERTICAL);
+    m_mainPanel->SetSizer(boxSizer33);
+    
+    m_menuBar = new wxMenuBar(0);
+    this->SetMenuBar(m_menuBar);
+    
+    m_mbFile = new wxMenu();
+    m_menuBar->Append(m_mbFile, _("File"));
+    
+    m_mbiNew = new wxMenuItem(m_mbFile, wxID_NEW, _("New"), wxT(""), wxITEM_NORMAL);
+    m_mbFile->Append(m_mbiNew);
+    
+    m_mbiOpen = new wxMenuItem(m_mbFile, wxID_OPEN, _("Open"), wxT(""), wxITEM_NORMAL);
+    m_mbFile->Append(m_mbiOpen);
+    
+    m_mbiSave = new wxMenuItem(m_mbFile, wxID_SAVE, _("Save"), wxT(""), wxITEM_NORMAL);
+    m_mbFile->Append(m_mbiSave);
+    
+    m_mbiSaveAs = new wxMenuItem(m_mbFile, wxID_SAVEAS, _("Save As"), wxT(""), wxITEM_NORMAL);
+    m_mbFile->Append(m_mbiSaveAs);
+    
+    m_mbFile->AppendSeparator();
+    
+    m_mbiExit = new wxMenuItem(m_mbFile, wxID_EXIT, _("Exit    Alt-X"), _("Quit"), wxITEM_NORMAL);
+    m_mbFile->Append(m_mbiExit);
+    
+    m_mbTools = new wxMenu();
+    m_menuBar->Append(m_mbTools, _("Tools"));
+    
+    m_mbiPrefs = new wxMenuItem(m_mbTools, wxID_PREFERENCES, _("Preferences"), wxT(""), wxITEM_NORMAL);
+    m_mbTools->Append(m_mbiPrefs);
+    
+    m_mbHelp = new wxMenu();
+    m_menuBar->Append(m_mbHelp, _("Help"));
+    
+    m_menuItem9 = new wxMenuItem(m_mbHelp, wxID_ABOUT, _("About..."), wxT(""), wxITEM_NORMAL);
+    m_mbHelp->Append(m_menuItem9);
+    
+    m_mainToolbar = this->CreateToolBar(wxTB_FLAT, wxID_ANY);
+    m_mainToolbar->SetToolBitmapSize(wxSize(16,16));
+    
+    m_mainToolbar->AddTool(wxID_NEW, _("New"), wxXmlResource::Get()->LoadBitmap(wxT("placeholder16")), wxNullBitmap, wxITEM_NORMAL, _("New"), _("New"), NULL);
+    
+    m_mainToolbar->AddTool(wxID_OPEN, _("Tool Label"), wxXmlResource::Get()->LoadBitmap(wxT("placeholder16")), wxNullBitmap, wxITEM_NORMAL, _("Open"), _("Open"), NULL);
+    m_mainToolbar->Realize();
+    
+    
+    SetSizeHints(500,300);
+    if ( GetSizer() ) {
+         GetSizer()->Fit(this);
+    }
+    Centre(wxBOTH);
+    // Connect events
+    m_mainPanel->Connect(wxEVT_SIZE, wxSizeEventHandler(MainFrameBaseClass::OnSize), NULL, this);
+    this->Connect(m_mbiExit->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrameBaseClass::OnExit), NULL, this);
+    this->Connect(m_mbiPrefs->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrameBaseClass::OnToolsPrefs), NULL, this);
+    this->Connect(m_menuItem9->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrameBaseClass::OnAbout), NULL, this);
+    this->Connect(wxID_NEW, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(MainFrameBaseClass::OnNew), NULL, this);
+    this->Connect(wxID_OPEN, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(MainFrameBaseClass::OnOpen), NULL, this);
+    
+}
+
+MainFrameBaseClass::~MainFrameBaseClass()
+{
+    m_mainPanel->Disconnect(wxEVT_SIZE, wxSizeEventHandler(MainFrameBaseClass::OnSize), NULL, this);
+    this->Disconnect(m_mbiExit->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrameBaseClass::OnExit), NULL, this);
+    this->Disconnect(m_mbiPrefs->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrameBaseClass::OnToolsPrefs), NULL, this);
+    this->Disconnect(m_menuItem9->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrameBaseClass::OnAbout), NULL, this);
+    this->Disconnect(wxID_NEW, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(MainFrameBaseClass::OnNew), NULL, this);
+    this->Disconnect(wxID_OPEN, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(MainFrameBaseClass::OnOpen), NULL, this);
+    
+}
+
+DlgRigCtrlBase::DlgRigCtrlBase(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style)
+    : wxDialog(parent, id, title, pos, size, style)
+{
+    if ( !bBitmapLoaded ) {
+        // We need to initialise the default bitmap handler
+        wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler);
+        wxC9ED9InitBitmapResources();
+        bBitmapLoaded = true;
+    }
+    
+    wxBoxSizer* boxSizer51 = new wxBoxSizer(wxVERTICAL);
+    this->SetSizer(boxSizer51);
+    
+    m_notebook53 = new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxSize(-1, -1), wxBK_DEFAULT);
+    
+    boxSizer51->Add(m_notebook53, 1, wxALL|wxEXPAND, 2);
+    
+    m_panelHDWPTT = new wxPanel(m_notebook53, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), wxTAB_TRAVERSAL);
+    m_panelHDWPTT->SetToolTip(_("Hardware Push-to-Talk"));
+    m_notebook53->AddPage(m_panelHDWPTT, _("Hardware PTT"), true);
+    
+    wxFlexGridSizer* flexGridSizer135 = new wxFlexGridSizer(  3, 1, 0, 0);
+    flexGridSizer135->SetFlexibleDirection( wxBOTH );
+    flexGridSizer135->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
+    flexGridSizer135->AddGrowableCol(1);
+    flexGridSizer135->AddGrowableRow(3);
+    m_panelHDWPTT->SetSizer(flexGridSizer135);
+    
+    wxStaticBoxSizer* staticBoxSizer169 = new wxStaticBoxSizer( new wxStaticBox(m_panelHDWPTT, wxID_ANY, wxT("")), wxVERTICAL);
+    
+    flexGridSizer135->Add(staticBoxSizer169, 0, wxALL|wxEXPAND, 2);
+    
+    m_checkBox7537 = new wxCheckBox(m_panelHDWPTT, wxID_ANY, _("PTT tone on right audio channel"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_checkBox7537->SetValue(false);
+    
+    staticBoxSizer169->Add(m_checkBox7537, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 2);
+    
+    wxGridSizer* gridSizer159 = new wxGridSizer(  1, 1, 0, 0);
+    
+    flexGridSizer135->Add(gridSizer159, 0, wxALL|wxALIGN_LEFT|wxALIGN_TOP, 2);
+    
+    wxStaticBoxSizer* staticBoxSizer157 = new wxStaticBoxSizer( new wxStaticBox(m_panelHDWPTT, wxID_ANY, _("h/w ptt device pin")), wxHORIZONTAL);
+    
+    gridSizer159->Add(staticBoxSizer157, 0, wxALL|wxEXPAND|wxALIGN_TOP, 2);
+    
+    wxBoxSizer* boxSizer175 = new wxBoxSizer(wxVERTICAL);
+    
+    staticBoxSizer157->Add(boxSizer175, 1, wxALL, 2);
+    
+    m_checkBox9112 = new wxCheckBox(m_panelHDWPTT, wxID_ANY, _("Use separate PTT device pin"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_checkBox9112->SetValue(false);
+    
+    boxSizer175->Add(m_checkBox9112, 0, wxALL|wxALIGN_TOP, 2);
+    
+    m_staticText173 = new wxStaticText(m_panelHDWPTT, wxID_ANY, _("Device:"), wxDefaultPosition, wxSize(-1,-1), 0);
+    
+    boxSizer175->Add(m_staticText173, 0, wxALL, 5);
+    
+    wxArrayString m_comboBox9313Arr;
+    m_comboBox9313 = new wxComboBox(m_panelHDWPTT, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1,-1), m_comboBox9313Arr, 0);
+    
+    boxSizer175->Add(m_comboBox9313, 0, wxALL, 2);
+    
+    wxBoxSizer* boxSizer171 = new wxBoxSizer(wxHORIZONTAL);
+    
+    staticBoxSizer157->Add(boxSizer171, 1, wxALL, 2);
+    
+    wxBoxSizer* boxSizer12714 = new wxBoxSizer(wxVERTICAL);
+    
+    boxSizer171->Add(boxSizer12714, 1, wxALL|wxALIGN_CENTER_HORIZONTAL, 2);
+    
+    wxArrayString m_radioBox10115Arr;
+    m_radioBox10115Arr.Add(wxT("Normal (V-)"));
+    m_radioBox10115Arr.Add(wxT("Inverted (V+)"));
+    m_radioBox10115 = new wxRadioBox(m_panelHDWPTT, wxID_ANY, _("Use RTS"), wxDefaultPosition, wxSize(-1,-1), m_radioBox10115Arr, 2, wxRA_SPECIFY_COLS);
+    m_radioBox10115->SetSelection(0);
+    
+    boxSizer12714->Add(m_radioBox10115, 1, wxALL|wxALIGN_CENTER_HORIZONTAL, 2);
+    
+    wxArrayString m_radioBox10316Arr;
+    m_radioBox10316Arr.Add(wxT("Normal (V-)"));
+    m_radioBox10316Arr.Add(wxT("Inverted (V+)"));
+    m_radioBox10316 = new wxRadioBox(m_panelHDWPTT, wxID_ANY, _("Use DTR"), wxDefaultPosition, wxSize(-1,-1), m_radioBox10316Arr, 2, wxRA_SPECIFY_COLS);
+    m_radioBox10316->SetSelection(0);
+    
+    boxSizer12714->Add(m_radioBox10316, 1, wxALL|wxALIGN_CENTER_HORIZONTAL, 2);
+    
+    wxBoxSizer* boxSizer13118 = new wxBoxSizer(wxHORIZONTAL);
+    
+    boxSizer12714->Add(boxSizer13118, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 2);
+    
+    m_button11319 = new wxButton(m_panelHDWPTT, wxID_ANY, _("Initialize"), wxDefaultPosition, wxSize(-1,-1), 0);
+    
+    boxSizer13118->Add(m_button11319, 1, wxALL, 2);
+    
+    wxStaticBoxSizer* staticBoxSizer79420 = new wxStaticBoxSizer( new wxStaticBox(m_panelHDWPTT, wxID_ANY, _("PTT delay for all CAT/PTT types")), wxHORIZONTAL);
+    
+    flexGridSizer135->Add(staticBoxSizer79420, 0, wxALL|wxEXPAND|wxALIGN_LEFT, 2);
+    
+    m_staticText177 = new wxStaticText(m_panelHDWPTT, wxID_ANY, _("Start of xmit delay"), wxDefaultPosition, wxSize(-1,-1), 0);
+    
+    staticBoxSizer79420->Add(m_staticText177, 0, wxALL|wxALIGN_CENTER_VERTICAL, 2);
+    
+    m_slider10721 = new wxSlider(m_panelHDWPTT, wxID_ANY, 50, 0, 100, wxDefaultPosition, wxSize(-1,-1), wxSL_HORIZONTAL);
+    
+    staticBoxSizer79420->Add(m_slider10721, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 2);
+    
+    m_staticText179 = new wxStaticText(m_panelHDWPTT, wxID_ANY, _("End of xmit delay:"), wxDefaultPosition, wxSize(-1,-1), 0);
+    
+    staticBoxSizer79420->Add(m_staticText179, 0, wxALL|wxALIGN_CENTER_VERTICAL, 2);
+    
+    m_slider10922 = new wxSlider(m_panelHDWPTT, wxID_ANY, 50, 0, 100, wxDefaultPosition, wxSize(-1,-1), wxSL_HORIZONTAL);
+    
+    staticBoxSizer79420->Add(m_slider10922, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 2);
+    
+    m_panelRIGCat = new wxPanel(m_notebook53, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), wxTAB_TRAVERSAL);
+    m_panelRIGCat->SetToolTip(_("RigCat"));
+    m_notebook53->AddPage(m_panelRIGCat, _("RigCAT"), false);
+    
+    wxBoxSizer* boxSizer67 = new wxBoxSizer(wxVERTICAL);
+    m_panelRIGCat->SetSizer(boxSizer67);
+    
+    m_radioButton185 = new wxRadioButton(m_panelRIGCat, wxID_ANY, _("Use RigCAT"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_radioButton185->SetValue(1);
+    
+    boxSizer67->Add(m_radioButton185, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 2);
+    
+    wxStaticBoxSizer* staticBoxSizer183 = new wxStaticBoxSizer( new wxStaticBox(m_panelRIGCat, wxID_ANY, wxT("")), wxVERTICAL);
+    
+    boxSizer67->Add(staticBoxSizer183, 1, wxALL|wxEXPAND|wxALIGN_TOP, 2);
+    
+    wxFlexGridSizer* flexGridSizer187 = new wxFlexGridSizer(  1, 1, 0, 0);
+    flexGridSizer187->SetFlexibleDirection( wxBOTH );
+    flexGridSizer187->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
+    flexGridSizer187->AddGrowableCol(1);
+    flexGridSizer187->AddGrowableRow(1);
+    
+    staticBoxSizer183->Add(flexGridSizer187, 0, wxALL, 2);
+    
+    wxFlexGridSizer* flexGridSizer204 = new wxFlexGridSizer(  3, 4, 0, 0);
+    flexGridSizer204->SetFlexibleDirection( wxBOTH );
+    flexGridSizer204->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
+    
+    flexGridSizer187->Add(flexGridSizer204, 1, wxALL|wxEXPAND, 2);
+    
+    wxBoxSizer* boxSizer193 = new wxBoxSizer(wxHORIZONTAL);
+    
+    flexGridSizer204->Add(boxSizer193, 1, wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL, 2);
+    
+    m_staticText189 = new wxStaticText(m_panelRIGCat, wxID_ANY, _("File:"), wxDefaultPosition, wxSize(-1,-1), 0);
+    
+    boxSizer193->Add(m_staticText189, 0, wxALL|wxALIGN_CENTER_VERTICAL, 2);
+    
+    m_textCtrl191 = new wxTextCtrl(m_panelRIGCat, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1,-1), 0);
+    
+    boxSizer193->Add(m_textCtrl191, 0, wxALL|wxALIGN_CENTER_VERTICAL, 2);
+    
+    wxBoxSizer* boxSizer206 = new wxBoxSizer(wxVERTICAL);
+    
+    flexGridSizer204->Add(boxSizer206, 1, wxALL|wxEXPAND, 5);
+    
+    m_button208 = new wxButton(m_panelRIGCat, wxID_ANY, _("Open"), wxDefaultPosition, wxSize(-1,-1), 0);
+    
+    boxSizer206->Add(m_button208, 0, wxALL|wxALIGN_CENTER_VERTICAL, 2);
+    
+    wxBoxSizer* boxSizer19329 = new wxBoxSizer(wxHORIZONTAL);
+    
+    flexGridSizer204->Add(boxSizer19329, 1, wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL, 2);
+    
+    m_staticText18930 = new wxStaticText(m_panelRIGCat, wxID_ANY, _("Device:"), wxDefaultPosition, wxSize(-1,-1), 0);
+    
+    boxSizer19329->Add(m_staticText18930, 0, wxALL|wxALIGN_CENTER_VERTICAL, 2);
+    
+    wxArrayString m_comboBox218Arr;
+    m_comboBox218 = new wxComboBox(m_panelRIGCat, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1,-1), m_comboBox218Arr, 0);
+    
+    boxSizer19329->Add(m_comboBox218, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5);
+    
+    wxFlexGridSizer* flexGridSizer222 = new wxFlexGridSizer(  1, 3, 0, 0);
+    flexGridSizer222->SetFlexibleDirection( wxBOTH );
+    flexGridSizer222->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
+    flexGridSizer222->AddGrowableCol(2);
+    
+    staticBoxSizer183->Add(flexGridSizer222, 0, wxALL, 2);
+    
+    wxBoxSizer* boxSizer19326 = new wxBoxSizer(wxHORIZONTAL);
+    
+    flexGridSizer222->Add(boxSizer19326, 1, wxALL|wxEXPAND, 2);
+    
+    m_staticText18927 = new wxStaticText(m_panelRIGCat, wxID_ANY, _("Retries:"), wxDefaultPosition, wxSize(-1,-1), 0);
+    
+    boxSizer19326->Add(m_staticText18927, 0, wxALL|wxALIGN_CENTER_VERTICAL, 2);
+    
+    m_textCtrl19128 = new wxTextCtrl(m_panelRIGCat, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1,-1), 0);
+    
+    boxSizer19326->Add(m_textCtrl19128, 1, wxALL|wxALIGN_CENTER_VERTICAL, 2);
+    
+    wxBoxSizer* boxSizer19323 = new wxBoxSizer(wxHORIZONTAL);
+    
+    flexGridSizer222->Add(boxSizer19323, 1, wxALL|wxEXPAND, 2);
+    
+    m_staticText18924 = new wxStaticText(m_panelRIGCat, wxID_ANY, _("Retry Interval:"), wxDefaultPosition, wxSize(-1,-1), 0);
+    
+    boxSizer19323->Add(m_staticText18924, 0, wxALL|wxALIGN_CENTER_VERTICAL, 2);
+    
+    m_textCtrl19125 = new wxTextCtrl(m_panelRIGCat, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1,-1), 0);
+    
+    boxSizer19323->Add(m_textCtrl19125, 1, wxALL|wxALIGN_CENTER_VERTICAL, 2);
+    
+    wxBoxSizer* boxSizer1932954 = new wxBoxSizer(wxHORIZONTAL);
+    
+    flexGridSizer222->Add(boxSizer1932954, 1, wxALL|wxEXPAND, 2);
+    
+    m_staticText1893055 = new wxStaticText(m_panelRIGCat, wxID_ANY, _("Baud Rate:"), wxDefaultPosition, wxSize(-1,-1), 0);
+    
+    boxSizer1932954->Add(m_staticText1893055, 0, wxALL|wxALIGN_CENTER_VERTICAL, 2);
+    
+    wxArrayString m_comboBaudArr;
+    m_comboBaudArr.Add(wxT("300"));
+    m_comboBaudArr.Add(wxT("600"));
+    m_comboBaudArr.Add(wxT("1200"));
+    m_comboBaudArr.Add(wxT("2400"));
+    m_comboBaudArr.Add(wxT("9600"));
+    m_comboBaudArr.Add(wxT("19200"));
+    m_comboBaudArr.Add(wxT("38400"));
+    m_comboBaudArr.Add(wxT("56800"));
+    m_comboBaud = new wxComboBox(m_panelRIGCat, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1,-1), m_comboBaudArr, 0);
+    
+    boxSizer1932954->Add(m_comboBaud, 1, wxALL|wxALIGN_CENTER_VERTICAL, 2);
+    
+    wxFlexGridSizer* flexGridSizer18747 = new wxFlexGridSizer(  1, 1, 0, 0);
+    flexGridSizer18747->SetFlexibleDirection( wxBOTH );
+    flexGridSizer18747->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
+    flexGridSizer18747->AddGrowableCol(1);
+    
+    staticBoxSizer183->Add(flexGridSizer18747, 0, wxALL|wxEXPAND, 2);
+    
+    wxFlexGridSizer* flexGridSizer20448 = new wxFlexGridSizer(  1, 3, 0, 0);
+    flexGridSizer20448->SetFlexibleDirection( wxBOTH );
+    flexGridSizer20448->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
+    flexGridSizer20448->AddGrowableCol(3);
+    flexGridSizer20448->AddGrowableRow(1);
+    
+    flexGridSizer18747->Add(flexGridSizer20448, 1, wxALL, 2);
+    
+    wxBoxSizer* boxSizer19349 = new wxBoxSizer(wxHORIZONTAL);
+    
+    flexGridSizer20448->Add(boxSizer19349, 1, wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL, 2);
+    
+    m_staticText18950 = new wxStaticText(m_panelRIGCat, wxID_ANY, _("Write Delay (ms):"), wxDefaultPosition, wxSize(-1,-1), 0);
+    
+    boxSizer19349->Add(m_staticText18950, 0, wxALL|wxALIGN_CENTER_VERTICAL, 2);
+    
+    m_textCtrl19151 = new wxTextCtrl(m_panelRIGCat, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1,-1), 0);
+    
+    boxSizer19349->Add(m_textCtrl19151, 0, wxALL|wxALIGN_CENTER_VERTICAL, 2);
+    
+    wxBoxSizer* boxSizer298 = new wxBoxSizer(wxHORIZONTAL);
+    
+    flexGridSizer20448->Add(boxSizer298, 1, wxALL|wxEXPAND, 2);
+    
+    m_staticText298 = new wxStaticText(m_panelRIGCat, wxID_ANY, _("Stop Bits:"), wxDefaultPosition, wxSize(-1,-1), 0);
+    
+    boxSizer298->Add(m_staticText298, 0, wxALL, 2);
+    
+    m_sliderStopBits = new wxSlider(m_panelRIGCat, wxID_ANY, 0, 0, 2, wxDefaultPosition, wxSize(-1,-1), wxSL_HORIZONTAL);
+    
+    boxSizer298->Add(m_sliderStopBits, 0, wxALL, 5);
+    
+    wxFlexGridSizer* flexGridSizer224 = new wxFlexGridSizer(  1, 4, 0, 0);
+    flexGridSizer224->SetFlexibleDirection( wxBOTH );
+    flexGridSizer224->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
+    flexGridSizer224->AddGrowableCol(4);
+    flexGridSizer224->AddGrowableRow(1);
+    
+    staticBoxSizer183->Add(flexGridSizer224, 0, wxALL|wxEXPAND, 2);
+    
+    flexGridSizer224->Add(2, 2, 1, wxALL|wxEXPAND, 2);
+    
+    m_cbEcho = new wxCheckBox(m_panelRIGCat, wxID_ANY, _("Commands echoed"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_cbEcho->SetValue(false);
+    m_cbEcho->SetToolTip(_("Commands are echoed"));
+    
+    flexGridSizer224->Add(m_cbEcho, 0, wxALL|wxEXPAND, 1);
+    
+    flexGridSizer224->Add(2, 2, 1, wxALL|wxEXPAND, 2);
+    
+    m_cbCATPTT = new wxCheckBox(m_panelRIGCat, wxID_ANY, _("CAT command for PTT"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_cbCATPTT->SetValue(false);
+    m_cbCATPTT->SetToolTip(_("Use CAT commands for PTT"));
+    
+    flexGridSizer224->Add(m_cbCATPTT, 1, wxALL|wxEXPAND, 2);
+    
+    wxFlexGridSizer* flexGridSizer22432 = new wxFlexGridSizer(  1, 4, 0, 0);
+    flexGridSizer22432->SetFlexibleDirection( wxBOTH );
+    flexGridSizer22432->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
+    flexGridSizer22432->AddGrowableCol(4);
+    flexGridSizer22432->AddGrowableRow(1);
+    
+    staticBoxSizer183->Add(flexGridSizer22432, 0, wxALL|wxEXPAND, 2);
+    
+    flexGridSizer22432->Add(2, 2, 1, wxALL|wxEXPAND, 2);
+    
+    m_cbToggleRTSPTT = new wxCheckBox(m_panelRIGCat, wxID_ANY, _("Toggle RTS for PTT"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_cbToggleRTSPTT->SetValue(false);
+    m_cbToggleRTSPTT->SetToolTip(_("Toggle RTS for PTT"));
+    
+    flexGridSizer22432->Add(m_cbToggleRTSPTT, 1, wxALL, 2);
+    
+    flexGridSizer22432->Add(2, 2, 1, wxALL|wxEXPAND, 2);
+    
+    m_cbToggleDTRPTT = new wxCheckBox(m_panelRIGCat, wxID_ANY, _("Toggle DTR for PTT"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_cbToggleDTRPTT->SetValue(false);
+    m_cbToggleDTRPTT->SetToolTip(_("Toggle DTR for PTT"));
+    
+    flexGridSizer22432->Add(m_cbToggleDTRPTT, 1, wxALL, 2);
+    
+    wxFlexGridSizer* flexGridSizer22437 = new wxFlexGridSizer(  1, 4, 0, 0);
+    flexGridSizer22437->SetFlexibleDirection( wxBOTH );
+    flexGridSizer22437->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
+    flexGridSizer22437->AddGrowableCol(4);
+    flexGridSizer22437->AddGrowableRow(1);
+    
+    staticBoxSizer183->Add(flexGridSizer22437, 0, wxALL|wxEXPAND, 2);
+    
+    flexGridSizer22437->Add(2, 2, 1, wxALL|wxEXPAND, 2);
+    
+    m_cbRTS12VInit = new wxCheckBox(m_panelRIGCat, wxID_ANY, _("Initial RTS +12v"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_cbRTS12VInit->SetValue(false);
+    m_cbRTS12VInit->SetToolTip(_("Initialize state of RTS"));
+    
+    flexGridSizer22437->Add(m_cbRTS12VInit, 1, wxALL|wxEXPAND, 2);
+    
+    flexGridSizer22437->Add(2, 2, 1, wxALL|wxEXPAND, 2);
+    
+    m_cbDTR12VInit = new wxCheckBox(m_panelRIGCat, wxID_ANY, _("Initial DTR +12v"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_cbDTR12VInit->SetValue(false);
+    m_cbDTR12VInit->SetToolTip(_("Initialize state of DTR"));
+    
+    flexGridSizer22437->Add(m_cbDTR12VInit, 1, wxALL|wxEXPAND, 2);
+    
+    wxFlexGridSizer* flexGridSizer22442 = new wxFlexGridSizer(  1, 4, 0, 0);
+    flexGridSizer22442->SetFlexibleDirection( wxBOTH );
+    flexGridSizer22442->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
+    flexGridSizer22442->AddGrowableCol(4);
+    flexGridSizer22442->AddGrowableRow(1);
+    
+    staticBoxSizer183->Add(flexGridSizer22442, 0, wxALL|wxEXPAND, 2);
+    
+    flexGridSizer22442->Add(2, 2, 0, wxALL, 2);
+    
+    m_cbRTSCTSFlowCtl = new wxCheckBox(m_panelRIGCat, wxID_ANY, _("RTS/CTS Flow Control"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_cbRTSCTSFlowCtl->SetValue(false);
+    
+    flexGridSizer22442->Add(m_cbRTSCTSFlowCtl, 0, wxALL, 2);
+    
+    flexGridSizer22442->Add(2, 2, 0, wxALL, 2);
+    
+    m_cbVSPEnable = new wxCheckBox(m_panelRIGCat, wxID_ANY, _("RTS/CTS Flow Control"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_cbVSPEnable->SetValue(false);
+    m_cbVSPEnable->SetToolTip(_("Virtual serial port enable. Suppress WARNINGS"));
+    
+    flexGridSizer22442->Add(m_cbVSPEnable, 0, wxALL, 2);
+    
+    m_panelHAMLib = new wxPanel(m_notebook53, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), wxTAB_TRAVERSAL);
+    m_panelHAMLib->SetToolTip(_("Hamlib Configuration"));
+    m_notebook53->AddPage(m_panelHAMLib, _("HAMlib"), false);
+    
+    wxStaticBoxSizer* staticBoxSizer296 = new wxStaticBoxSizer( new wxStaticBox(m_panelHAMLib, wxID_ANY, wxT("")), wxVERTICAL);
+    m_panelHAMLib->SetSizer(staticBoxSizer296);
+    
+    wxGridSizer* gridSizer368 = new wxGridSizer(  8, 3, 0, 0);
+    
+    staticBoxSizer296->Add(gridSizer368, 0, wxALL|wxEXPAND, 5);
+    
+    wxBoxSizer* boxSizer312 = new wxBoxSizer(wxHORIZONTAL);
+    
+    gridSizer368->Add(boxSizer312, 1, wxALL|wxEXPAND, 2);
+    
+    m_staticText308 = new wxStaticText(m_panelHAMLib, wxID_ANY, _("Device:"), wxDefaultPosition, wxSize(-1,-1), 0);
+    
+    boxSizer312->Add(m_staticText308, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 2);
+    
+    wxArrayString m_comboBox314Arr;
+    m_comboBox314 = new wxComboBox(m_panelHAMLib, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1,-1), m_comboBox314Arr, 0);
+    
+    boxSizer312->Add(m_comboBox314, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 2);
+    
+    m_staticText304 = new wxStaticText(m_panelHAMLib, wxID_ANY, _("Rig:"), wxDefaultPosition, wxSize(-1,-1), 0);
+    
+    gridSizer368->Add(m_staticText304, 1, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 2);
+    
+    wxBoxSizer* boxSizer302 = new wxBoxSizer(wxHORIZONTAL);
+    
+    gridSizer368->Add(boxSizer302, 1, wxALL, 2);
+    
+    m_textCtrl306 = new wxTextCtrl(m_panelHAMLib, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1,-1), 0);
+    
+    boxSizer302->Add(m_textCtrl306, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 2);
+    
+    wxBoxSizer* boxSizer320 = new wxBoxSizer(wxHORIZONTAL);
+    
+    gridSizer368->Add(boxSizer320, 1, wxALL, 2);
+    
+    m_staticText326 = new wxStaticText(m_panelHAMLib, wxID_ANY, _("Retries:"), wxDefaultPosition, wxSize(-1,-1), 0);
+    
+    boxSizer320->Add(m_staticText326, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 2);
+    
+    m_textCtrl328 = new wxTextCtrl(m_panelHAMLib, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1,-1), 0);
+    
+    boxSizer320->Add(m_textCtrl328, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 2);
+    
+    wxBoxSizer* boxSizer32057 = new wxBoxSizer(wxHORIZONTAL);
+    
+    gridSizer368->Add(boxSizer32057, 1, wxALL, 2);
+    
+    m_staticText32658 = new wxStaticText(m_panelHAMLib, wxID_ANY, _("Retry Interval:"), wxDefaultPosition, wxSize(-1,-1), 0);
+    
+    boxSizer32057->Add(m_staticText32658, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 2);
+    
+    m_textCtrl32859 = new wxTextCtrl(m_panelHAMLib, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1,-1), 0);
+    
+    boxSizer32057->Add(m_textCtrl32859, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 2);
+    
+    wxBoxSizer* boxSizer32060 = new wxBoxSizer(wxHORIZONTAL);
+    
+    gridSizer368->Add(boxSizer32060, 1, wxALL, 2);
+    
+    m_staticText32661 = new wxStaticText(m_panelHAMLib, wxID_ANY, _("Baud Rate:"), wxDefaultPosition, wxSize(-1,-1), 0);
+    
+    boxSizer32060->Add(m_staticText32661, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 2);
+    
+    wxArrayString m_comboBox339Arr;
+    m_comboBox339Arr.Add(wxT("300"));
+    m_comboBox339Arr.Add(wxT("600"));
+    m_comboBox339Arr.Add(wxT("1200"));
+    m_comboBox339Arr.Add(wxT("2400"));
+    m_comboBox339Arr.Add(wxT("9600"));
+    m_comboBox339Arr.Add(wxT("19200"));
+    m_comboBox339Arr.Add(wxT("38400"));
+    m_comboBox339Arr.Add(wxT("56800"));
+    m_comboBox339 = new wxComboBox(m_panelHAMLib, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1,-1), m_comboBox339Arr, 0);
+    
+    boxSizer32060->Add(m_comboBox339, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 2);
+    
+    wxBoxSizer* boxSizer32064 = new wxBoxSizer(wxHORIZONTAL);
+    
+    gridSizer368->Add(boxSizer32064, 0, wxALL, 2);
+    
+    m_staticText32665 = new wxStaticText(m_panelHAMLib, wxID_ANY, _("Write Delay:"), wxDefaultPosition, wxSize(-1,-1), 0);
+    
+    boxSizer32064->Add(m_staticText32665, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 2);
+    
+    m_textCtrl32866 = new wxTextCtrl(m_panelHAMLib, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1,-1), 0);
+    
+    boxSizer32064->Add(m_textCtrl32866, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 2);
+    
+    wxBoxSizer* boxSizer3205767 = new wxBoxSizer(wxHORIZONTAL);
+    
+    gridSizer368->Add(boxSizer3205767, 1, wxALL, 2);
+    
+    m_staticText3265868 = new wxStaticText(m_panelHAMLib, wxID_ANY, _("Post Write Delay:"), wxDefaultPosition, wxSize(-1,-1), 0);
+    
+    boxSizer3205767->Add(m_staticText3265868, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 2);
+    
+    m_textCtrl3285969 = new wxTextCtrl(m_panelHAMLib, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1,-1), 0);
+    
+    boxSizer3205767->Add(m_textCtrl3285969, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 2);
+    
+    wxBoxSizer* boxSizer3206070 = new wxBoxSizer(wxHORIZONTAL);
+    
+    gridSizer368->Add(boxSizer3206070, 0, wxALL, 2);
+    
+    m_staticText3266171 = new wxStaticText(m_panelHAMLib, wxID_ANY, _("Stop bits:"), wxDefaultPosition, wxSize(-1,-1), 0);
+    
+    boxSizer3206070->Add(m_staticText3266171, 1, wxALL, 2);
+    
+    m_slider361 = new wxSlider(m_panelHAMLib, wxID_ANY, 1, 0, 2, wxDefaultPosition, wxSize(-1,-1), wxSL_LABELS|wxSL_HORIZONTAL);
+    
+    boxSizer3206070->Add(m_slider361, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 2);
+    
+    m_cbHAMLIBPTT = new wxCheckBox(m_panelHAMLib, wxID_ANY, _("PTT via HAMLib"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_cbHAMLIBPTT->SetValue(false);
+    m_cbHAMLIBPTT->SetToolTip(_("Use Hamlib to control PTT"));
+    
+    gridSizer368->Add(m_cbHAMLIBPTT, 1, wxALL, 2);
+    
+    m_staticText408 = new wxStaticText(m_panelHAMLib, wxID_ANY, _("Sideband:"), wxDefaultPosition, wxSize(-1,-1), 0);
+    
+    gridSizer368->Add(m_staticText408, 1, wxALL|wxALIGN_RIGHT, 2);
+    
+    wxBoxSizer* boxSizer410 = new wxBoxSizer(wxVERTICAL);
+    
+    gridSizer368->Add(boxSizer410, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 2);
+    
+    wxArrayString m_comboBox376Arr;
+    m_comboBox376Arr.Add(wxT("Upper"));
+    m_comboBox376Arr.Add(wxT("Lower"));
+    m_comboBox376 = new wxComboBox(m_panelHAMLib, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1,-1), m_comboBox376Arr, 0);
+    
+    boxSizer410->Add(m_comboBox376, 0, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 2);
+    
+    m_checkBox378 = new wxCheckBox(m_panelHAMLib, wxID_ANY, _("Initial RTS +12v"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_checkBox378->SetValue(false);
+    m_checkBox378->SetToolTip(_("Initialize state of RTS"));
+    
+    gridSizer368->Add(m_checkBox378, 0, wxALL, 2);
+    
+    gridSizer368->Add(0, 0, 0, wxALL, 2);
+    
+    m_checkBox382 = new wxCheckBox(m_panelHAMLib, wxID_ANY, _("Initial DTR +12v"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_checkBox382->SetValue(false);
+    
+    gridSizer368->Add(m_checkBox382, 0, wxALL, 2);
+    
+    m_cbRTSCTS = new wxCheckBox(m_panelHAMLib, wxID_ANY, _("RTS/CTS Flow Control"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_cbRTSCTS->SetValue(false);
+    m_cbRTSCTS->SetToolTip(_("Use RTS/CTS Flow Control"));
+    
+    gridSizer368->Add(m_cbRTSCTS, 0, wxALL, 2);
+    
+    gridSizer368->Add(0, 0, 0, wxALL, 2);
+    
+    m_cbXONXOFF = new wxCheckBox(m_panelHAMLib, wxID_ANY, _("XON/XOFF Flow Control"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_cbXONXOFF->SetValue(false);
+    m_cbXONXOFF->SetToolTip(_("Use XON/XOFF flow control"));
+    
+    gridSizer368->Add(m_cbXONXOFF, 0, wxALL, 2);
+    
+    m_staticText404 = new wxStaticText(m_panelHAMLib, wxID_ANY, _("Advanced Configuration:"), wxDefaultPosition, wxSize(-1,-1), 0);
+    
+    gridSizer368->Add(m_staticText404, 0, wxALL, 2);
+    
+    gridSizer368->Add(0, 0, 0, wxALL, 2);
+    
+    m_btnRevert = new wxButton(m_panelHAMLib, wxID_ANY, _("Revert"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_btnRevert->SetToolTip(_("Revert to previous settings"));
+    
+    gridSizer368->Add(m_btnRevert, 0, wxALL, 2);
+    
+    m_textAdvancedCFG = new wxTextCtrl(m_panelHAMLib, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_textAdvancedCFG->SetToolTip(_("Enter Advanced Configuration string"));
+    
+    gridSizer368->Add(m_textAdvancedCFG, 1, wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL, 2);
+    
+    gridSizer368->Add(0, 0, 0, wxALL, 2);
+    
+    m_btnInitHamlib = new wxButton(m_panelHAMLib, wxID_ANY, _("Initialize"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_btnInitHamlib->SetToolTip(_("Initialize HAMLib"));
+    
+    gridSizer368->Add(m_btnInitHamlib, 0, wxALL, 2);
+    
+    m_panelMemMap = new wxPanel(m_notebook53, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), wxTAB_TRAVERSAL);
+    m_panelMemMap->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNHIGHLIGHT));
+    m_panelMemMap->SetToolTip(_("Memory Mapped control"));
+    m_notebook53->AddPage(m_panelMemMap, _("MemMap"), false);
+    
+    wxStaticBoxSizer* staticBoxSizer294 = new wxStaticBoxSizer( new wxStaticBox(m_panelMemMap, wxID_ANY, wxT("")), wxVERTICAL);
+    m_panelMemMap->SetSizer(staticBoxSizer294);
+    
+    wxGridSizer* gridSizer420 = new wxGridSizer(  2, 1, 0, 0);
+    
+    staticBoxSizer294->Add(gridSizer420, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 2);
+    
+    wxStaticBoxSizer* staticBoxSizer424 = new wxStaticBoxSizer( new wxStaticBox(m_panelMemMap, wxID_ANY, wxT("")), wxVERTICAL);
+    
+    gridSizer420->Add(staticBoxSizer424, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
+    
+    m_staticText422 = new wxStaticText(m_panelMemMap, wxID_ANY, _("\nControl via Memory Mapped Shared Variables, i. e. Kachina \n"), wxDefaultPosition, wxSize(-1,-1), wxALIGN_CENTRE);
+    m_staticText422->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE));
+    
+    staticBoxSizer424->Add(m_staticText422, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
+    
+    wxBoxSizer* boxSizer4456 = new wxBoxSizer(wxVERTICAL);
+    
+    gridSizer420->Add(boxSizer4456, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5);
+    
+    m_checkBox4377 = new wxCheckBox(m_panelMemMap, wxID_ANY, _("Use Memorymap"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_checkBox4377->SetValue(false);
+    
+    boxSizer4456->Add(m_checkBox4377, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
+    
+    m_checkBox4398 = new wxCheckBox(m_panelMemMap, wxID_ANY, _("Use Memmap PTT"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_checkBox4398->SetValue(false);
+    
+    boxSizer4456->Add(m_checkBox4398, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_BOTTOM, 5);
+    
+    m_button4419 = new wxButton(m_panelMemMap, wxID_ANY, _("Initialize"), wxDefaultPosition, wxSize(-1,-1), 0);
+    
+    boxSizer4456->Add(m_button4419, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
+    
+    m_panelXMLRPC = new wxPanel(m_notebook53, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), wxTAB_TRAVERSAL);
+    m_panelXMLRPC->SetToolTip(_("XML-RPC control"));
+    m_notebook53->AddPage(m_panelXMLRPC, _("XML-RPC"), false);
+    
+    wxStaticBoxSizer* staticBoxSizer85 = new wxStaticBoxSizer( new wxStaticBox(m_panelXMLRPC, wxID_ANY, wxT("")), wxVERTICAL);
+    m_panelXMLRPC->SetSizer(staticBoxSizer85);
+    
+    wxGridSizer* gridSizer4203 = new wxGridSizer(  2, 1, 0, 0);
+    
+    staticBoxSizer85->Add(gridSizer4203, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 2);
+    
+    wxStaticBoxSizer* staticBoxSizer4244 = new wxStaticBoxSizer( new wxStaticBox(m_panelXMLRPC, wxID_ANY, wxT("")), wxVERTICAL);
+    
+    gridSizer4203->Add(staticBoxSizer4244, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
+    
+    m_staticText42210 = new wxStaticText(m_panelXMLRPC, wxID_ANY, _("\nRig control via external program using XML RPC Remote Calls\n"), wxDefaultPosition, wxSize(-1,-1), wxALIGN_CENTRE);
+    m_staticText42210->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE));
+    
+    staticBoxSizer4244->Add(m_staticText42210, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
+    
+    wxBoxSizer* boxSizer445 = new wxBoxSizer(wxVERTICAL);
+    
+    gridSizer4203->Add(boxSizer445, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5);
+    
+    m_checkBox437 = new wxCheckBox(m_panelXMLRPC, wxID_ANY, _("Use XML-RPC"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_checkBox437->SetValue(false);
+    
+    boxSizer445->Add(m_checkBox437, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
+    
+    m_button441 = new wxButton(m_panelXMLRPC, wxID_ANY, _("Initialize"), wxDefaultPosition, wxSize(-1,-1), 0);
+    
+    boxSizer445->Add(m_button441, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
+    
+    m_stdBtnSizer155 = new wxStdDialogButtonSizer();
+    
+    boxSizer51->Add(m_stdBtnSizer155, 0, wxALL|wxALIGN_RIGHT|wxALIGN_BOTTOM, 2);
+    
+    m_button165 = new wxButton(this, wxID_APPLY, wxT(""), wxDefaultPosition, wxSize(-1, -1), 0);
+    m_stdBtnSizer155->AddButton(m_button165);
+    
+    m_button167 = new wxButton(this, wxID_OK, wxT(""), wxDefaultPosition, wxSize(-1, -1), 0);
+    m_button167->SetDefault();
+    m_stdBtnSizer155->AddButton(m_button167);
+    
+    m_button366 = new wxButton(this, wxID_CANCEL, wxT(""), wxDefaultPosition, wxSize(-1, -1), 0);
+    m_stdBtnSizer155->AddButton(m_button366);
+    m_stdBtnSizer155->Realize();
+    
+    
+    SetSizeHints(460,315);
+    if ( GetSizer() ) {
+         GetSizer()->Fit(this);
+    }
+    Centre(wxBOTH);
+}
+
+DlgRigCtrlBase::~DlgRigCtrlBase()
+{
+}
diff --git a/freedv/branches/0.97/build/codelite/hamlib_trial/wxcrafter.h b/freedv/branches/0.97/build/codelite/hamlib_trial/wxcrafter.h
new file mode 100644 (file)
index 0000000..752b774
--- /dev/null
@@ -0,0 +1,153 @@
+//////////////////////////////////////////////////////////////////////
+// This file was auto-generated by codelite's wxCrafter Plugin
+// Do not modify this file by hand!
+//////////////////////////////////////////////////////////////////////
+
+#ifndef WXCRAFTER_BASE_CLASSES_H
+#define WXCRAFTER_BASE_CLASSES_H
+
+#include <wx/settings.h>
+#include <wx/xrc/xmlres.h>
+#include <wx/xrc/xh_bmp.h>
+#include <wx/frame.h>
+#include <wx/sizer.h>
+#include <wx/panel.h>
+#include <wx/menu.h>
+#include <wx/toolbar.h>
+#include <wx/dialog.h>
+#include <wx/notebook.h>
+#include <wx/imaglist.h>
+#include <wx/statbox.h>
+#include <wx/checkbox.h>
+#include <wx/stattext.h>
+#include <wx/combobox.h>
+#include <wx/arrstr.h>
+#include <wx/radiobox.h>
+#include <wx/button.h>
+#include <wx/slider.h>
+#include <wx/radiobut.h>
+#include <wx/textctrl.h>
+
+class MainFrameBaseClass : public wxFrame
+{
+protected:
+    wxPanel* m_mainPanel;
+    wxMenuBar* m_menuBar;
+    wxMenu* m_mbFile;
+    wxMenuItem* m_mbiNew;
+    wxMenuItem* m_mbiOpen;
+    wxMenuItem* m_mbiSave;
+    wxMenuItem* m_mbiSaveAs;
+    wxMenuItem* m_menuItem21;
+    wxMenuItem* m_mbiExit;
+    wxMenu* m_mbTools;
+    wxMenuItem* m_mbiPrefs;
+    wxMenu* m_mbHelp;
+    wxMenuItem* m_menuItem9;
+    wxToolBar* m_mainToolbar;
+
+protected:
+    virtual void OnSize(wxSizeEvent& event) { event.Skip(); }
+    virtual void OnExit(wxCommandEvent& event) { event.Skip(); }
+    virtual void OnToolsPrefs(wxCommandEvent& event) { event.Skip(); }
+    virtual void OnAbout(wxCommandEvent& event) { event.Skip(); }
+    virtual void OnNew(wxCommandEvent& event) { event.Skip(); }
+    virtual void OnOpen(wxCommandEvent& event) { event.Skip(); }
+
+public:
+    MainFrameBaseClass(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("topFrame"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(500,300), long style = wxCAPTION|wxRESIZE_BORDER|wxMAXIMIZE_BOX|wxMINIMIZE_BOX|wxSYSTEM_MENU|wxCLOSE_BOX);
+    virtual ~MainFrameBaseClass();
+};
+
+
+class DlgRigCtrlBase : public wxDialog
+{
+protected:
+    wxNotebook* m_notebook53;
+    wxPanel* m_panelHDWPTT;
+    wxCheckBox* m_checkBox7537;
+    wxCheckBox* m_checkBox9112;
+    wxStaticText* m_staticText173;
+    wxComboBox* m_comboBox9313;
+    wxRadioBox* m_radioBox10115;
+    wxRadioBox* m_radioBox10316;
+    wxButton* m_button11319;
+    wxStaticText* m_staticText177;
+    wxSlider* m_slider10721;
+    wxStaticText* m_staticText179;
+    wxSlider* m_slider10922;
+    wxPanel* m_panelRIGCat;
+    wxRadioButton* m_radioButton185;
+    wxStaticText* m_staticText189;
+    wxTextCtrl* m_textCtrl191;
+    wxButton* m_button208;
+    wxStaticText* m_staticText18930;
+    wxComboBox* m_comboBox218;
+    wxStaticText* m_staticText18927;
+    wxTextCtrl* m_textCtrl19128;
+    wxStaticText* m_staticText18924;
+    wxTextCtrl* m_textCtrl19125;
+    wxStaticText* m_staticText1893055;
+    wxComboBox* m_comboBaud;
+    wxStaticText* m_staticText18950;
+    wxTextCtrl* m_textCtrl19151;
+    wxStaticText* m_staticText298;
+    wxSlider* m_sliderStopBits;
+    wxCheckBox* m_cbEcho;
+    wxCheckBox* m_cbCATPTT;
+    wxCheckBox* m_cbToggleRTSPTT;
+    wxCheckBox* m_cbToggleDTRPTT;
+    wxCheckBox* m_cbRTS12VInit;
+    wxCheckBox* m_cbDTR12VInit;
+    wxCheckBox* m_cbRTSCTSFlowCtl;
+    wxCheckBox* m_cbVSPEnable;
+    wxPanel* m_panelHAMLib;
+    wxStaticText* m_staticText308;
+    wxComboBox* m_comboBox314;
+    wxStaticText* m_staticText304;
+    wxTextCtrl* m_textCtrl306;
+    wxStaticText* m_staticText326;
+    wxTextCtrl* m_textCtrl328;
+    wxStaticText* m_staticText32658;
+    wxTextCtrl* m_textCtrl32859;
+    wxStaticText* m_staticText32661;
+    wxComboBox* m_comboBox339;
+    wxStaticText* m_staticText32665;
+    wxTextCtrl* m_textCtrl32866;
+    wxStaticText* m_staticText3265868;
+    wxTextCtrl* m_textCtrl3285969;
+    wxStaticText* m_staticText3266171;
+    wxSlider* m_slider361;
+    wxCheckBox* m_cbHAMLIBPTT;
+    wxStaticText* m_staticText408;
+    wxComboBox* m_comboBox376;
+    wxCheckBox* m_checkBox378;
+    wxCheckBox* m_checkBox382;
+    wxCheckBox* m_cbRTSCTS;
+    wxCheckBox* m_cbXONXOFF;
+    wxStaticText* m_staticText404;
+    wxButton* m_btnRevert;
+    wxTextCtrl* m_textAdvancedCFG;
+    wxButton* m_btnInitHamlib;
+    wxPanel* m_panelMemMap;
+    wxStaticText* m_staticText422;
+    wxCheckBox* m_checkBox4377;
+    wxCheckBox* m_checkBox4398;
+    wxButton* m_button4419;
+    wxPanel* m_panelXMLRPC;
+    wxStaticText* m_staticText42210;
+    wxCheckBox* m_checkBox437;
+    wxButton* m_button441;
+    wxStdDialogButtonSizer* m_stdBtnSizer155;
+    wxButton* m_button165;
+    wxButton* m_button167;
+    wxButton* m_button366;
+
+protected:
+
+public:
+    DlgRigCtrlBase(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Rig Control"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(460,315), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxCLOSE_BOX);
+    virtual ~DlgRigCtrlBase();
+};
+
+#endif
diff --git a/freedv/branches/0.97/build/codelite/hamlib_trial/wxcrafter.wxcp b/freedv/branches/0.97/build/codelite/hamlib_trial/wxcrafter.wxcp
new file mode 100644 (file)
index 0000000..7a31bf3
--- /dev/null
@@ -0,0 +1,7969 @@
+{
+       "metadata":     {
+               "m_generatedFilesDir":  "",
+               "m_objCounter": 455,
+               "m_includeFiles":       [],
+               "m_bitmapFunction":     "wxC9ED9InitBitmapResources",
+               "m_bitmapsFile":        "wxcrafter_bitmaps.cpp",
+               "m_GenerateCodeTypes":  3,
+               "m_outputFileName":     "",
+               "m_templateClasses":    []
+       },
+       "windows":      [{
+                       "m_type":       4402,
+                       "proportion":   0,
+                       "border":       5,
+                       "gbSpan":       "1,1",
+                       "gbPosition":   "0,0",
+                       "m_styles":     ["wxCAPTION", "wxRESIZE_BORDER", "wxMAXIMIZE_BOX", "wxMINIMIZE_BOX", "wxSYSTEM_MENU", "wxCLOSE_BOX"],
+                       "m_sizerFlags": ["wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                       "m_properties": [{
+                                       "type": "string",
+                                       "m_label":      "Size:",
+                                       "m_value":      "500,300"
+                               }, {
+                                       "type": "string",
+                                       "m_label":      "Minimum Size:",
+                                       "m_value":      "-1,-1"
+                               }, {
+                                       "type": "string",
+                                       "m_label":      "Name:",
+                                       "m_value":      "MainFrameBaseClass"
+                               }, {
+                                       "type": "multi-string",
+                                       "m_label":      "Tooltip:",
+                                       "m_value":      ""
+                               }, {
+                                       "type": "colour",
+                                       "m_label":      "Bg Colour:",
+                                       "colour":       "<Default>"
+                               }, {
+                                       "type": "colour",
+                                       "m_label":      "Fg Colour:",
+                                       "colour":       "<Default>"
+                               }, {
+                                       "type": "font",
+                                       "m_label":      "Font:",
+                                       "m_value":      ""
+                               }, {
+                                       "type": "bool",
+                                       "m_label":      "Hidden",
+                                       "m_value":      false
+                               }, {
+                                       "type": "bool",
+                                       "m_label":      "Disabled",
+                                       "m_value":      false
+                               }, {
+                                       "type": "bool",
+                                       "m_label":      "Focused",
+                                       "m_value":      false
+                               }, {
+                                       "type": "string",
+                                       "m_label":      "Class Name:",
+                                       "m_value":      ""
+                               }, {
+                                       "type": "string",
+                                       "m_label":      "Include File:",
+                                       "m_value":      ""
+                               }, {
+                                       "type": "string",
+                                       "m_label":      "Title:",
+                                       "m_value":      "topFrame"
+                               }, {
+                                       "type": "virtualFolderPicker",
+                                       "m_label":      "Virtual Folder:",
+                                       "m_path":       ""
+                               }, {
+                                       "type": "choice",
+                                       "m_label":      "Centre:",
+                                       "m_selection":  1,
+                                       "m_options":    ["", "wxBOTH", "wxVERTICAL", "wxHORIZONTAL"]
+                               }, {
+                                       "type": "string",
+                                       "m_label":      "File:",
+                                       "m_value":      "MainFrame"
+                               }, {
+                                       "type": "string",
+                                       "m_label":      "Inherited Class",
+                                       "m_value":      "MainFrame"
+                               }, {
+                                       "type": "string",
+                                       "m_label":      "Class Decorator",
+                                       "m_value":      ""
+                               }],
+                       "m_events":     [],
+                       "m_children":   [{
+                                       "m_type":       4401,
+                                       "proportion":   0,
+                                       "border":       5,
+                                       "gbSpan":       "1,1",
+                                       "gbPosition":   "0,0",
+                                       "m_styles":     [],
+                                       "m_sizerFlags": ["wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                       "m_properties": [{
+                                                       "type": "string",
+                                                       "m_label":      "Name:",
+                                                       "m_value":      "boxSizer1"
+                                               }, {
+                                                       "type": "choice",
+                                                       "m_label":      "Orientation:",
+                                                       "m_selection":  0,
+                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
+                                               }],
+                                       "m_events":     [],
+                                       "m_children":   [{
+                                                       "m_type":       4408,
+                                                       "proportion":   1,
+                                                       "border":       5,
+                                                       "gbSpan":       "1,1",
+                                                       "gbPosition":   "0,0",
+                                                       "m_styles":     ["wxTAB_TRAVERSAL"],
+                                                       "m_sizerFlags": ["wxEXPAND"],
+                                                       "m_properties": [{
+                                                                       "type": "winid",
+                                                                       "m_label":      "ID:",
+                                                                       "m_winid":      "wxID_ANY"
+                                                               }, {
+                                                                       "type": "string",
+                                                                       "m_label":      "Size:",
+                                                                       "m_value":      "-1,-1"
+                                                               }, {
+                                                                       "type": "string",
+                                                                       "m_label":      "Minimum Size:",
+                                                                       "m_value":      "-1,-1"
+                                                               }, {
+                                                                       "type": "string",
+                                                                       "m_label":      "Name:",
+                                                                       "m_value":      "m_mainPanel"
+                                                               }, {
+                                                                       "type": "multi-string",
+                                                                       "m_label":      "Tooltip:",
+                                                                       "m_value":      ""
+                                                               }, {
+                                                                       "type": "colour",
+                                                                       "m_label":      "Bg Colour:",
+                                                                       "colour":       "<Default>"
+                                                               }, {
+                                                                       "type": "colour",
+                                                                       "m_label":      "Fg Colour:",
+                                                                       "colour":       "<Default>"
+                                                               }, {
+                                                                       "type": "font",
+                                                                       "m_label":      "Font:",
+                                                                       "m_value":      ""
+                                                               }, {
+                                                                       "type": "bool",
+                                                                       "m_label":      "Hidden",
+                                                                       "m_value":      false
+                                                               }, {
+                                                                       "type": "bool",
+                                                                       "m_label":      "Disabled",
+                                                                       "m_value":      false
+                                                               }, {
+                                                                       "type": "bool",
+                                                                       "m_label":      "Focused",
+                                                                       "m_value":      false
+                                                               }, {
+                                                                       "type": "string",
+                                                                       "m_label":      "Class Name:",
+                                                                       "m_value":      ""
+                                                               }, {
+                                                                       "type": "string",
+                                                                       "m_label":      "Include File:",
+                                                                       "m_value":      ""
+                                                               }],
+                                                       "m_events":     [{
+                                                                       "m_eventName":  "wxEVT_SIZE",
+                                                                       "m_eventClass": "wxSizeEvent",
+                                                                       "m_eventHandler":       "wxSizeEventHandler",
+                                                                       "m_functionNameAndSignature":   "OnSize(wxSizeEvent& event)",
+                                                                       "m_description":        "Process a wxEVT_SIZE event"
+                                                               }],
+                                                       "m_children":   [{
+                                                                       "m_type":       4401,
+                                                                       "proportion":   1,
+                                                                       "border":       5,
+                                                                       "gbSpan":       "1,1",
+                                                                       "gbPosition":   "0,0",
+                                                                       "m_styles":     [],
+                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
+                                                                       "m_properties": [{
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Name:",
+                                                                                       "m_value":      "boxSizer33"
+                                                                               }, {
+                                                                                       "type": "choice",
+                                                                                       "m_label":      "Orientation:",
+                                                                                       "m_selection":  0,
+                                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
+                                                                               }],
+                                                                       "m_events":     [],
+                                                                       "m_children":   []
+                                                               }]
+                                               }]
+                               }, {
+                                       "m_type":       4457,
+                                       "proportion":   0,
+                                       "border":       5,
+                                       "gbSpan":       "1,1",
+                                       "gbPosition":   "0,0",
+                                       "m_styles":     [],
+                                       "m_sizerFlags": ["wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                       "m_properties": [{
+                                                       "type": "winid",
+                                                       "m_label":      "ID:",
+                                                       "m_winid":      "wxID_ANY"
+                                               }, {
+                                                       "type": "string",
+                                                       "m_label":      "Size:",
+                                                       "m_value":      "-1,-1"
+                                               }, {
+                                                       "type": "string",
+                                                       "m_label":      "Minimum Size:",
+                                                       "m_value":      "-1,-1"
+                                               }, {
+                                                       "type": "string",
+                                                       "m_label":      "Name:",
+                                                       "m_value":      "m_menuBar"
+                                               }, {
+                                                       "type": "multi-string",
+                                                       "m_label":      "Tooltip:",
+                                                       "m_value":      ""
+                                               }, {
+                                                       "type": "colour",
+                                                       "m_label":      "Bg Colour:",
+                                                       "colour":       "<Default>"
+                                               }, {
+                                                       "type": "colour",
+                                                       "m_label":      "Fg Colour:",
+                                                       "colour":       "<Default>"
+                                               }, {
+                                                       "type": "font",
+                                                       "m_label":      "Font:",
+                                                       "m_value":      ""
+                                               }, {
+                                                       "type": "bool",
+                                                       "m_label":      "Hidden",
+                                                       "m_value":      false
+                                               }, {
+                                                       "type": "bool",
+                                                       "m_label":      "Disabled",
+                                                       "m_value":      false
+                                               }, {
+                                                       "type": "bool",
+                                                       "m_label":      "Focused",
+                                                       "m_value":      false
+                                               }, {
+                                                       "type": "string",
+                                                       "m_label":      "Class Name:",
+                                                       "m_value":      ""
+                                               }, {
+                                                       "type": "string",
+                                                       "m_label":      "Include File:",
+                                                       "m_value":      ""
+                                               }],
+                                       "m_events":     [],
+                                       "m_children":   [{
+                                                       "m_type":       4458,
+                                                       "proportion":   0,
+                                                       "border":       5,
+                                                       "gbSpan":       "1,1",
+                                                       "gbPosition":   "0,0",
+                                                       "m_styles":     [],
+                                                       "m_sizerFlags": ["wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                                       "m_properties": [{
+                                                                       "type": "string",
+                                                                       "m_label":      "Name:",
+                                                                       "m_value":      "m_mbFile"
+                                                               }, {
+                                                                       "type": "string",
+                                                                       "m_label":      "Label:",
+                                                                       "m_value":      "File"
+                                                               }],
+                                                       "m_events":     [],
+                                                       "m_children":   [{
+                                                                       "m_type":       4459,
+                                                                       "proportion":   0,
+                                                                       "border":       5,
+                                                                       "gbSpan":       "1,1",
+                                                                       "gbPosition":   "0,0",
+                                                                       "m_styles":     [],
+                                                                       "m_sizerFlags": [],
+                                                                       "m_properties": [{
+                                                                                       "type": "winid",
+                                                                                       "m_label":      "ID:",
+                                                                                       "m_winid":      "wxID_NEW"
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Name:",
+                                                                                       "m_value":      "m_mbiNew"
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Label:",
+                                                                                       "m_value":      "New"
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Shortcut:",
+                                                                                       "m_value":      ""
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Help String:",
+                                                                                       "m_value":      ""
+                                                                               }, {
+                                                                                       "type": "filePicker",
+                                                                                       "m_label":      "Bitmap File:",
+                                                                                       "m_path":       ""
+                                                                               }, {
+                                                                                       "type": "choice",
+                                                                                       "m_label":      "Kind:",
+                                                                                       "m_selection":  0,
+                                                                                       "m_options":    ["normal", "checkable", "radio", "separator"]
+                                                                               }, {
+                                                                                       "type": "bool",
+                                                                                       "m_label":      "Checked",
+                                                                                       "m_value":      false
+                                                                               }],
+                                                                       "m_events":     [],
+                                                                       "m_children":   []
+                                                               }, {
+                                                                       "m_type":       4459,
+                                                                       "proportion":   0,
+                                                                       "border":       5,
+                                                                       "gbSpan":       "1,1",
+                                                                       "gbPosition":   "0,0",
+                                                                       "m_styles":     [],
+                                                                       "m_sizerFlags": [],
+                                                                       "m_properties": [{
+                                                                                       "type": "winid",
+                                                                                       "m_label":      "ID:",
+                                                                                       "m_winid":      "wxID_OPEN"
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Name:",
+                                                                                       "m_value":      "m_mbiOpen"
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Label:",
+                                                                                       "m_value":      "Open"
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Shortcut:",
+                                                                                       "m_value":      ""
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Help String:",
+                                                                                       "m_value":      ""
+                                                                               }, {
+                                                                                       "type": "filePicker",
+                                                                                       "m_label":      "Bitmap File:",
+                                                                                       "m_path":       ""
+                                                                               }, {
+                                                                                       "type": "choice",
+                                                                                       "m_label":      "Kind:",
+                                                                                       "m_selection":  0,
+                                                                                       "m_options":    ["normal", "checkable", "radio", "separator"]
+                                                                               }, {
+                                                                                       "type": "bool",
+                                                                                       "m_label":      "Checked",
+                                                                                       "m_value":      false
+                                                                               }],
+                                                                       "m_events":     [],
+                                                                       "m_children":   []
+                                                               }, {
+                                                                       "m_type":       4459,
+                                                                       "proportion":   0,
+                                                                       "border":       5,
+                                                                       "gbSpan":       "1,1",
+                                                                       "gbPosition":   "0,0",
+                                                                       "m_styles":     [],
+                                                                       "m_sizerFlags": [],
+                                                                       "m_properties": [{
+                                                                                       "type": "winid",
+                                                                                       "m_label":      "ID:",
+                                                                                       "m_winid":      "wxID_SAVE"
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Name:",
+                                                                                       "m_value":      "m_mbiSave"
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Label:",
+                                                                                       "m_value":      "Save"
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Shortcut:",
+                                                                                       "m_value":      ""
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Help String:",
+                                                                                       "m_value":      ""
+                                                                               }, {
+                                                                                       "type": "filePicker",
+                                                                                       "m_label":      "Bitmap File:",
+                                                                                       "m_path":       ""
+                                                                               }, {
+                                                                                       "type": "choice",
+                                                                                       "m_label":      "Kind:",
+                                                                                       "m_selection":  0,
+                                                                                       "m_options":    ["normal", "checkable", "radio", "separator"]
+                                                                               }, {
+                                                                                       "type": "bool",
+                                                                                       "m_label":      "Checked",
+                                                                                       "m_value":      false
+                                                                               }],
+                                                                       "m_events":     [],
+                                                                       "m_children":   []
+                                                               }, {
+                                                                       "m_type":       4459,
+                                                                       "proportion":   0,
+                                                                       "border":       5,
+                                                                       "gbSpan":       "1,1",
+                                                                       "gbPosition":   "0,0",
+                                                                       "m_styles":     [],
+                                                                       "m_sizerFlags": [],
+                                                                       "m_properties": [{
+                                                                                       "type": "winid",
+                                                                                       "m_label":      "ID:",
+                                                                                       "m_winid":      "wxID_SAVEAS"
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Name:",
+                                                                                       "m_value":      "m_mbiSaveAs"
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Label:",
+                                                                                       "m_value":      "Save As"
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Shortcut:",
+                                                                                       "m_value":      ""
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Help String:",
+                                                                                       "m_value":      ""
+                                                                               }, {
+                                                                                       "type": "filePicker",
+                                                                                       "m_label":      "Bitmap File:",
+                                                                                       "m_path":       ""
+                                                                               }, {
+                                                                                       "type": "choice",
+                                                                                       "m_label":      "Kind:",
+                                                                                       "m_selection":  0,
+                                                                                       "m_options":    ["normal", "checkable", "radio", "separator"]
+                                                                               }, {
+                                                                                       "type": "bool",
+                                                                                       "m_label":      "Checked",
+                                                                                       "m_value":      false
+                                                                               }],
+                                                                       "m_events":     [],
+                                                                       "m_children":   []
+                                                               }, {
+                                                                       "m_type":       4459,
+                                                                       "proportion":   0,
+                                                                       "border":       5,
+                                                                       "gbSpan":       "1,1",
+                                                                       "gbPosition":   "0,0",
+                                                                       "m_styles":     [],
+                                                                       "m_sizerFlags": [],
+                                                                       "m_properties": [{
+                                                                                       "type": "winid",
+                                                                                       "m_label":      "ID:",
+                                                                                       "m_winid":      "wxID_ANY"
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Name:",
+                                                                                       "m_value":      "m_menuItem21"
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Label:",
+                                                                                       "m_value":      "Item7"
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Shortcut:",
+                                                                                       "m_value":      ""
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Help String:",
+                                                                                       "m_value":      ""
+                                                                               }, {
+                                                                                       "type": "filePicker",
+                                                                                       "m_label":      "Bitmap File:",
+                                                                                       "m_path":       ""
+                                                                               }, {
+                                                                                       "type": "choice",
+                                                                                       "m_label":      "Kind:",
+                                                                                       "m_selection":  3,
+                                                                                       "m_options":    ["normal", "checkable", "radio", "separator"]
+                                                                               }, {
+                                                                                       "type": "bool",
+                                                                                       "m_label":      "Checked",
+                                                                                       "m_value":      false
+                                                                               }],
+                                                                       "m_events":     [],
+                                                                       "m_children":   []
+                                                               }, {
+                                                                       "m_type":       4459,
+                                                                       "proportion":   0,
+                                                                       "border":       5,
+                                                                       "gbSpan":       "1,1",
+                                                                       "gbPosition":   "0,0",
+                                                                       "m_styles":     [],
+                                                                       "m_sizerFlags": [],
+                                                                       "m_properties": [{
+                                                                                       "type": "winid",
+                                                                                       "m_label":      "ID:",
+                                                                                       "m_winid":      "wxID_EXIT"
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Name:",
+                                                                                       "m_value":      "m_mbiExit"
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Label:",
+                                                                                       "m_value":      "Exit"
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Shortcut:",
+                                                                                       "m_value":      "Alt-X"
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Help String:",
+                                                                                       "m_value":      "Quit"
+                                                                               }, {
+                                                                                       "type": "filePicker",
+                                                                                       "m_label":      "Bitmap File:",
+                                                                                       "m_path":       ""
+                                                                               }, {
+                                                                                       "type": "choice",
+                                                                                       "m_label":      "Kind:",
+                                                                                       "m_selection":  0,
+                                                                                       "m_options":    ["normal", "checkable", "radio", "separator"]
+                                                                               }, {
+                                                                                       "type": "bool",
+                                                                                       "m_label":      "Checked",
+                                                                                       "m_value":      false
+                                                                               }],
+                                                                       "m_events":     [{
+                                                                                       "m_eventName":  "wxEVT_COMMAND_MENU_SELECTED",
+                                                                                       "m_eventClass": "wxCommandEvent",
+                                                                                       "m_eventHandler":       "wxCommandEventHandler",
+                                                                                       "m_functionNameAndSignature":   "OnExit(wxCommandEvent& event)",
+                                                                                       "m_description":        "Menu item has been clicked"
+                                                                               }],
+                                                                       "m_children":   []
+                                                               }]
+                                               }, {
+                                                       "m_type":       4458,
+                                                       "proportion":   0,
+                                                       "border":       5,
+                                                       "gbSpan":       "1,1",
+                                                       "gbPosition":   "0,0",
+                                                       "m_styles":     [],
+                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                                       "m_properties": [{
+                                                                       "type": "string",
+                                                                       "m_label":      "Name:",
+                                                                       "m_value":      "m_mbTools"
+                                                               }, {
+                                                                       "type": "string",
+                                                                       "m_label":      "Label:",
+                                                                       "m_value":      "Tools"
+                                                               }],
+                                                       "m_events":     [],
+                                                       "m_children":   [{
+                                                                       "m_type":       4459,
+                                                                       "proportion":   0,
+                                                                       "border":       5,
+                                                                       "gbSpan":       "1,1",
+                                                                       "gbPosition":   "0,0",
+                                                                       "m_styles":     [],
+                                                                       "m_sizerFlags": [],
+                                                                       "m_properties": [{
+                                                                                       "type": "winid",
+                                                                                       "m_label":      "ID:",
+                                                                                       "m_winid":      "wxID_PREFERENCES"
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Name:",
+                                                                                       "m_value":      "m_mbiPrefs"
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Label:",
+                                                                                       "m_value":      "Preferences"
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Shortcut:",
+                                                                                       "m_value":      ""
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Help String:",
+                                                                                       "m_value":      ""
+                                                                               }, {
+                                                                                       "type": "filePicker",
+                                                                                       "m_label":      "Bitmap File:",
+                                                                                       "m_path":       ""
+                                                                               }, {
+                                                                                       "type": "choice",
+                                                                                       "m_label":      "Kind:",
+                                                                                       "m_selection":  0,
+                                                                                       "m_options":    ["normal", "checkable", "radio", "separator"]
+                                                                               }, {
+                                                                                       "type": "bool",
+                                                                                       "m_label":      "Checked",
+                                                                                       "m_value":      false
+                                                                               }],
+                                                                       "m_events":     [{
+                                                                                       "m_eventName":  "wxEVT_COMMAND_MENU_SELECTED",
+                                                                                       "m_eventClass": "wxCommandEvent",
+                                                                                       "m_eventHandler":       "wxCommandEventHandler",
+                                                                                       "m_functionNameAndSignature":   "OnToolsPrefs(wxCommandEvent& event)",
+                                                                                       "m_description":        "Menu item has been clicked"
+                                                                               }],
+                                                                       "m_children":   []
+                                                               }]
+                                               }, {
+                                                       "m_type":       4458,
+                                                       "proportion":   0,
+                                                       "border":       5,
+                                                       "gbSpan":       "1,1",
+                                                       "gbPosition":   "0,0",
+                                                       "m_styles":     [],
+                                                       "m_sizerFlags": ["wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                                       "m_properties": [{
+                                                                       "type": "string",
+                                                                       "m_label":      "Name:",
+                                                                       "m_value":      "m_mbHelp"
+                                                               }, {
+                                                                       "type": "string",
+                                                                       "m_label":      "Label:",
+                                                                       "m_value":      "Help"
+                                                               }],
+                                                       "m_events":     [],
+                                                       "m_children":   [{
+                                                                       "m_type":       4459,
+                                                                       "proportion":   0,
+                                                                       "border":       5,
+                                                                       "gbSpan":       "1,1",
+                                                                       "gbPosition":   "0,0",
+                                                                       "m_styles":     [],
+                                                                       "m_sizerFlags": [],
+                                                                       "m_properties": [{
+                                                                                       "type": "winid",
+                                                                                       "m_label":      "ID:",
+                                                                                       "m_winid":      "wxID_ABOUT"
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Name:",
+                                                                                       "m_value":      "m_menuItem9"
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Label:",
+                                                                                       "m_value":      "About..."
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Shortcut:",
+                                                                                       "m_value":      ""
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Help String:",
+                                                                                       "m_value":      ""
+                                                                               }, {
+                                                                                       "type": "filePicker",
+                                                                                       "m_label":      "Bitmap File:",
+                                                                                       "m_path":       ""
+                                                                               }, {
+                                                                                       "type": "choice",
+                                                                                       "m_label":      "Kind:",
+                                                                                       "m_selection":  0,
+                                                                                       "m_options":    ["normal", "checkable", "radio", "separator"]
+                                                                               }, {
+                                                                                       "type": "bool",
+                                                                                       "m_label":      "Checked",
+                                                                                       "m_value":      false
+                                                                               }],
+                                                                       "m_events":     [{
+                                                                                       "m_eventName":  "wxEVT_COMMAND_MENU_SELECTED",
+                                                                                       "m_eventClass": "wxCommandEvent",
+                                                                                       "m_eventHandler":       "wxCommandEventHandler",
+                                                                                       "m_functionNameAndSignature":   "OnAbout(wxCommandEvent& event)",
+                                                                                       "m_description":        "Menu item has been clicked"
+                                                                               }],
+                                                                       "m_children":   []
+                                                               }]
+                                               }]
+                               }, {
+                                       "m_type":       4461,
+                                       "proportion":   0,
+                                       "border":       5,
+                                       "gbSpan":       "1,1",
+                                       "gbPosition":   "0,0",
+                                       "m_styles":     ["wxTB_FLAT"],
+                                       "m_sizerFlags": ["wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                       "m_properties": [{
+                                                       "type": "winid",
+                                                       "m_label":      "ID:",
+                                                       "m_winid":      "wxID_ANY"
+                                               }, {
+                                                       "type": "string",
+                                                       "m_label":      "Size:",
+                                                       "m_value":      "-1,-1"
+                                               }, {
+                                                       "type": "string",
+                                                       "m_label":      "Name:",
+                                                       "m_value":      "m_mainToolbar"
+                                               }, {
+                                                       "type": "string",
+                                                       "m_label":      "Tooltip:",
+                                                       "m_value":      ""
+                                               }, {
+                                                       "type": "string",
+                                                       "m_label":      "Bitmap Size:",
+                                                       "m_value":      "16,16"
+                                               }, {
+                                                       "type": "string",
+                                                       "m_label":      "Margins:",
+                                                       "m_value":      "-1,-1"
+                                               }, {
+                                                       "type": "string",
+                                                       "m_label":      "Padding:",
+                                                       "m_value":      "1"
+                                               }, {
+                                                       "type": "string",
+                                                       "m_label":      "Separator Size:",
+                                                       "m_value":      "5"
+                                               }],
+                                       "m_events":     [],
+                                       "m_children":   [{
+                                                       "m_type":       4462,
+                                                       "proportion":   0,
+                                                       "border":       5,
+                                                       "gbSpan":       "1,1",
+                                                       "gbPosition":   "0,0",
+                                                       "m_styles":     [],
+                                                       "m_sizerFlags": [],
+                                                       "m_properties": [{
+                                                                       "type": "winid",
+                                                                       "m_label":      "ID:",
+                                                                       "m_winid":      "wxID_NEW"
+                                                               }, {
+                                                                       "type": "string",
+                                                                       "m_label":      "Name:",
+                                                                       "m_value":      "m_tbiNew"
+                                                               }, {
+                                                                       "type": "string",
+                                                                       "m_label":      "Label:",
+                                                                       "m_value":      "New"
+                                                               }, {
+                                                                       "type": "multi-string",
+                                                                       "m_label":      "Tooltip:",
+                                                                       "m_value":      "New"
+                                                               }, {
+                                                                       "type": "string",
+                                                                       "m_label":      "Help String:",
+                                                                       "m_value":      "New"
+                                                               }, {
+                                                                       "type": "filePicker",
+                                                                       "m_label":      "Bitmap File:",
+                                                                       "m_path":       "C:\\Users\\wittend\\AppData\\Local\\Temp\\placeholder16.png"
+                                                               }, {
+                                                                       "type": "filePicker",
+                                                                       "m_label":      "Disabled-Bitmap File",
+                                                                       "m_path":       ""
+                                                               }, {
+                                                                       "type": "choice",
+                                                                       "m_label":      "Kind:",
+                                                                       "m_selection":  0,
+                                                                       "m_options":    ["normal", "checkable", "radio", "separator"]
+                                                               }],
+                                                       "m_events":     [{
+                                                                       "m_eventName":  "wxEVT_COMMAND_TOOL_CLICKED",
+                                                                       "m_eventClass": "wxCommandEvent",
+                                                                       "m_eventHandler":       "wxCommandEventHandler",
+                                                                       "m_functionNameAndSignature":   "OnNew(wxCommandEvent& event)",
+                                                                       "m_description":        "Process a wxEVT_COMMAND_TOOL_CLICKED event (a synonym for wxEVT_COMMAND_MENU_SELECTED). Pass the id of the tool"
+                                                               }],
+                                                       "m_children":   []
+                                               }, {
+                                                       "m_type":       4462,
+                                                       "proportion":   0,
+                                                       "border":       5,
+                                                       "gbSpan":       "1,1",
+                                                       "gbPosition":   "0,0",
+                                                       "m_styles":     [],
+                                                       "m_sizerFlags": [],
+                                                       "m_properties": [{
+                                                                       "type": "winid",
+                                                                       "m_label":      "ID:",
+                                                                       "m_winid":      "wxID_OPEN"
+                                                               }, {
+                                                                       "type": "string",
+                                                                       "m_label":      "Name:",
+                                                                       "m_value":      "m_rbiOpen"
+                                                               }, {
+                                                                       "type": "string",
+                                                                       "m_label":      "Label:",
+                                                                       "m_value":      "Tool Label"
+                                                               }, {
+                                                                       "type": "multi-string",
+                                                                       "m_label":      "Tooltip:",
+                                                                       "m_value":      "Open"
+                                                               }, {
+                                                                       "type": "string",
+                                                                       "m_label":      "Help String:",
+                                                                       "m_value":      "Open"
+                                                               }, {
+                                                                       "type": "filePicker",
+                                                                       "m_label":      "Bitmap File:",
+                                                                       "m_path":       "C:\\Users\\wittend\\AppData\\Local\\Temp\\placeholder16.png"
+                                                               }, {
+                                                                       "type": "filePicker",
+                                                                       "m_label":      "Disabled-Bitmap File",
+                                                                       "m_path":       ""
+                                                               }, {
+                                                                       "type": "choice",
+                                                                       "m_label":      "Kind:",
+                                                                       "m_selection":  0,
+                                                                       "m_options":    ["normal", "checkable", "radio", "separator"]
+                                                               }],
+                                                       "m_events":     [{
+                                                                       "m_eventName":  "wxEVT_COMMAND_TOOL_CLICKED",
+                                                                       "m_eventClass": "wxCommandEvent",
+                                                                       "m_eventHandler":       "wxCommandEventHandler",
+                                                                       "m_functionNameAndSignature":   "OnOpen(wxCommandEvent& event)",
+                                                                       "m_description":        "Process a wxEVT_COMMAND_TOOL_CLICKED event (a synonym for wxEVT_COMMAND_MENU_SELECTED). Pass the id of the tool"
+                                                               }],
+                                                       "m_children":   []
+                                               }]
+                               }]
+               }, {
+                       "m_type":       4421,
+                       "proportion":   0,
+                       "border":       5,
+                       "gbSpan":       "1,1",
+                       "gbPosition":   "0,0",
+                       "m_styles":     ["wxDEFAULT_DIALOG_STYLE", "wxRESIZE_BORDER", "wxCLOSE_BOX"],
+                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                       "m_properties": [{
+                                       "type": "string",
+                                       "m_label":      "Size:",
+                                       "m_value":      "460,315"
+                               }, {
+                                       "type": "string",
+                                       "m_label":      "Minimum Size:",
+                                       "m_value":      "-1,-1"
+                               }, {
+                                       "type": "string",
+                                       "m_label":      "Name:",
+                                       "m_value":      "DlgRigCtrlBase"
+                               }, {
+                                       "type": "multi-string",
+                                       "m_label":      "Tooltip:",
+                                       "m_value":      ""
+                               }, {
+                                       "type": "colour",
+                                       "m_label":      "Bg Colour:",
+                                       "colour":       "<Default>"
+                               }, {
+                                       "type": "colour",
+                                       "m_label":      "Fg Colour:",
+                                       "colour":       "<Default>"
+                               }, {
+                                       "type": "font",
+                                       "m_label":      "Font:",
+                                       "m_value":      ""
+                               }, {
+                                       "type": "bool",
+                                       "m_label":      "Hidden",
+                                       "m_value":      false
+                               }, {
+                                       "type": "bool",
+                                       "m_label":      "Disabled",
+                                       "m_value":      false
+                               }, {
+                                       "type": "bool",
+                                       "m_label":      "Focused",
+                                       "m_value":      false
+                               }, {
+                                       "type": "string",
+                                       "m_label":      "Class Name:",
+                                       "m_value":      ""
+                               }, {
+                                       "type": "string",
+                                       "m_label":      "Include File:",
+                                       "m_value":      ""
+                               }, {
+                                       "type": "string",
+                                       "m_label":      "Title:",
+                                       "m_value":      "Rig Control"
+                               }, {
+                                       "type": "virtualFolderPicker",
+                                       "m_label":      "Virtual Folder:",
+                                       "m_path":       "hamlib_trial:rig_ctrl"
+                               }, {
+                                       "type": "choice",
+                                       "m_label":      "Centre:",
+                                       "m_selection":  1,
+                                       "m_options":    ["", "wxBOTH", "wxVERTICAL", "wxHORIZONTAL"]
+                               }, {
+                                       "type": "string",
+                                       "m_label":      "File:",
+                                       "m_value":      "dlg_rig_ctrl"
+                               }, {
+                                       "type": "string",
+                                       "m_label":      "Inherited Class",
+                                       "m_value":      "DialogRigCtrl"
+                               }, {
+                                       "type": "string",
+                                       "m_label":      "Class Decorator",
+                                       "m_value":      ""
+                               }],
+                       "m_events":     [],
+                       "m_children":   [{
+                                       "m_type":       4401,
+                                       "proportion":   1,
+                                       "border":       5,
+                                       "gbSpan":       "1,1",
+                                       "gbPosition":   "0,0",
+                                       "m_styles":     [],
+                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
+                                       "m_properties": [{
+                                                       "type": "string",
+                                                       "m_label":      "Name:",
+                                                       "m_value":      "boxSizer51"
+                                               }, {
+                                                       "type": "choice",
+                                                       "m_label":      "Orientation:",
+                                                       "m_selection":  0,
+                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
+                                               }],
+                                       "m_events":     [],
+                                       "m_children":   [{
+                                                       "m_type":       4442,
+                                                       "proportion":   1,
+                                                       "border":       2,
+                                                       "gbSpan":       "1,1",
+                                                       "gbPosition":   "0,0",
+                                                       "m_styles":     ["wxBK_DEFAULT"],
+                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
+                                                       "m_properties": [{
+                                                                       "type": "winid",
+                                                                       "m_label":      "ID:",
+                                                                       "m_winid":      "wxID_ANY"
+                                                               }, {
+                                                                       "type": "string",
+                                                                       "m_label":      "Size:",
+                                                                       "m_value":      "-1, -1"
+                                                               }, {
+                                                                       "type": "string",
+                                                                       "m_label":      "Minimum Size:",
+                                                                       "m_value":      "-1,-1"
+                                                               }, {
+                                                                       "type": "string",
+                                                                       "m_label":      "Name:",
+                                                                       "m_value":      "m_notebook53"
+                                                               }, {
+                                                                       "type": "multi-string",
+                                                                       "m_label":      "Tooltip:",
+                                                                       "m_value":      ""
+                                                               }, {
+                                                                       "type": "colour",
+                                                                       "m_label":      "Bg Colour:",
+                                                                       "colour":       "<Default>"
+                                                               }, {
+                                                                       "type": "colour",
+                                                                       "m_label":      "Fg Colour:",
+                                                                       "colour":       "<Default>"
+                                                               }, {
+                                                                       "type": "font",
+                                                                       "m_label":      "Font:",
+                                                                       "m_value":      ""
+                                                               }, {
+                                                                       "type": "bool",
+                                                                       "m_label":      "Hidden",
+                                                                       "m_value":      false
+                                                               }, {
+                                                                       "type": "bool",
+                                                                       "m_label":      "Disabled",
+                                                                       "m_value":      false
+                                                               }, {
+                                                                       "type": "bool",
+                                                                       "m_label":      "Focused",
+                                                                       "m_value":      false
+                                                               }, {
+                                                                       "type": "string",
+                                                                       "m_label":      "Class Name:",
+                                                                       "m_value":      ""
+                                                               }, {
+                                                                       "type": "string",
+                                                                       "m_label":      "Include File:",
+                                                                       "m_value":      ""
+                                                               }],
+                                                       "m_events":     [],
+                                                       "m_children":   [{
+                                                                       "m_type":       4441,
+                                                                       "proportion":   0,
+                                                                       "border":       5,
+                                                                       "gbSpan":       "1,1",
+                                                                       "gbPosition":   "0,0",
+                                                                       "m_styles":     ["wxTAB_TRAVERSAL"],
+                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                                                       "m_properties": [{
+                                                                                       "type": "winid",
+                                                                                       "m_label":      "ID:",
+                                                                                       "m_winid":      "wxID_ANY"
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Size:",
+                                                                                       "m_value":      "-1,-1"
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Minimum Size:",
+                                                                                       "m_value":      "-1,-1"
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Name:",
+                                                                                       "m_value":      "m_panelHDWPTT"
+                                                                               }, {
+                                                                                       "type": "multi-string",
+                                                                                       "m_label":      "Tooltip:",
+                                                                                       "m_value":      "Hardware Push-to-Talk"
+                                                                               }, {
+                                                                                       "type": "colour",
+                                                                                       "m_label":      "Bg Colour:",
+                                                                                       "colour":       "<Default>"
+                                                                               }, {
+                                                                                       "type": "colour",
+                                                                                       "m_label":      "Fg Colour:",
+                                                                                       "colour":       "<Default>"
+                                                                               }, {
+                                                                                       "type": "font",
+                                                                                       "m_label":      "Font:",
+                                                                                       "m_value":      ""
+                                                                               }, {
+                                                                                       "type": "bool",
+                                                                                       "m_label":      "Hidden",
+                                                                                       "m_value":      false
+                                                                               }, {
+                                                                                       "type": "bool",
+                                                                                       "m_label":      "Disabled",
+                                                                                       "m_value":      false
+                                                                               }, {
+                                                                                       "type": "bool",
+                                                                                       "m_label":      "Focused",
+                                                                                       "m_value":      false
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Class Name:",
+                                                                                       "m_value":      ""
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Include File:",
+                                                                                       "m_value":      ""
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Label:",
+                                                                                       "m_value":      "Hardware PTT"
+                                                                               }, {
+                                                                                       "type": "filePicker",
+                                                                                       "m_label":      "Bitmap File:",
+                                                                                       "m_path":       ""
+                                                                               }, {
+                                                                                       "type": "bool",
+                                                                                       "m_label":      "Selected",
+                                                                                       "m_value":      true
+                                                                               }],
+                                                                       "m_events":     [],
+                                                                       "m_children":   [{
+                                                                                       "m_type":       4403,
+                                                                                       "proportion":   1,
+                                                                                       "border":       5,
+                                                                                       "gbSpan":       "1,1",
+                                                                                       "gbPosition":   "0,0",
+                                                                                       "m_styles":     [],
+                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
+                                                                                       "m_properties": [{
+                                                                                                       "type": "string",
+                                                                                                       "m_label":      "Name:",
+                                                                                                       "m_value":      "flexGridSizer135"
+                                                                                               }, {
+                                                                                                       "type": "string",
+                                                                                                       "m_label":      "# Columns:",
+                                                                                                       "m_value":      "1"
+                                                                                               }, {
+                                                                                                       "type": "string",
+                                                                                                       "m_label":      "# Rows:",
+                                                                                                       "m_value":      "3"
+                                                                                               }, {
+                                                                                                       "type": "string",
+                                                                                                       "m_label":      "Growable columns:",
+                                                                                                       "m_value":      "1"
+                                                                                               }, {
+                                                                                                       "type": "string",
+                                                                                                       "m_label":      "Growable rows:",
+                                                                                                       "m_value":      "3"
+                                                                                               }, {
+                                                                                                       "type": "string",
+                                                                                                       "m_label":      "Horizontal gap:",
+                                                                                                       "m_value":      "0"
+                                                                                               }, {
+                                                                                                       "type": "string",
+                                                                                                       "m_label":      "Vertical gap:",
+                                                                                                       "m_value":      "0"
+                                                                                               }],
+                                                                                       "m_events":     [],
+                                                                                       "m_children":   [{
+                                                                                                       "m_type":       4449,
+                                                                                                       "proportion":   0,
+                                                                                                       "border":       2,
+                                                                                                       "gbSpan":       "1,1",
+                                                                                                       "gbPosition":   "0,0",
+                                                                                                       "m_styles":     [],
+                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
+                                                                                                       "m_properties": [{
+                                                                                                                       "type": "string",
+                                                                                                                       "m_label":      "Name:",
+                                                                                                                       "m_value":      "staticBoxSizer169"
+                                                                                                               }, {
+                                                                                                                       "type": "choice",
+                                                                                                                       "m_label":      "Orientation:",
+                                                                                                                       "m_selection":  0,
+                                                                                                                       "m_options":    ["Vertical", "Horizontal"]
+                                                                                                               }, {
+                                                                                                                       "type": "string",
+                                                                                                                       "m_label":      "Label:",
+                                                                                                                       "m_value":      ""
+                                                                                                               }],
+                                                                                                       "m_events":     [],
+                                                                                                       "m_children":   [{
+                                                                                                                       "m_type":       4415,
+                                                                                                                       "proportion":   1,
+                                                                                                                       "border":       2,
+                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                       "m_styles":     [],
+                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_LEFT", "wxALIGN_CENTER_VERTICAL"],
+                                                                                                                       "m_properties": [{
+                                                                                                                                       "type": "winid",
+                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                       "m_value":      "m_checkBox7537"
+                                                                                                                               }, {
+                                                                                                                                       "type": "multi-string",
+                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "colour",
+                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                       "colour":       "<Default>"
+                                                                                                                               }, {
+                                                                                                                                       "type": "colour",
+                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                       "colour":       "<Default>"
+                                                                                                                               }, {
+                                                                                                                                       "type": "font",
+                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                       "m_value":      "PTT tone on right audio channel"
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Value:",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }],
+                                                                                                                       "m_events":     [],
+                                                                                                                       "m_children":   []
+                                                                                                               }]
+                                                                                               }, {
+                                                                                                       "m_type":       4452,
+                                                                                                       "proportion":   0,
+                                                                                                       "border":       2,
+                                                                                                       "gbSpan":       "1,1",
+                                                                                                       "gbPosition":   "0,0",
+                                                                                                       "m_styles":     [],
+                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_LEFT", "wxALIGN_TOP"],
+                                                                                                       "m_properties": [{
+                                                                                                                       "type": "string",
+                                                                                                                       "m_label":      "Name:",
+                                                                                                                       "m_value":      "gridSizer159"
+                                                                                                               }, {
+                                                                                                                       "type": "string",
+                                                                                                                       "m_label":      "# Columns:",
+                                                                                                                       "m_value":      "1"
+                                                                                                               }, {
+                                                                                                                       "type": "string",
+                                                                                                                       "m_label":      "# Rows:",
+                                                                                                                       "m_value":      "1"
+                                                                                                               }, {
+                                                                                                                       "type": "string",
+                                                                                                                       "m_label":      "Horizontal gap:",
+                                                                                                                       "m_value":      "0"
+                                                                                                               }, {
+                                                                                                                       "type": "string",
+                                                                                                                       "m_label":      "Vertical gap:",
+                                                                                                                       "m_value":      "0"
+                                                                                                               }],
+                                                                                                       "m_events":     [],
+                                                                                                       "m_children":   [{
+                                                                                                                       "m_type":       4449,
+                                                                                                                       "proportion":   0,
+                                                                                                                       "border":       2,
+                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                       "m_styles":     [],
+                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND", "wxALIGN_TOP"],
+                                                                                                                       "m_properties": [{
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                       "m_value":      "staticBoxSizer157"
+                                                                                                                               }, {
+                                                                                                                                       "type": "choice",
+                                                                                                                                       "m_label":      "Orientation:",
+                                                                                                                                       "m_selection":  1,
+                                                                                                                                       "m_options":    ["Vertical", "Horizontal"]
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                       "m_value":      "h/w ptt device pin"
+                                                                                                                               }],
+                                                                                                                       "m_events":     [],
+                                                                                                                       "m_children":   [{
+                                                                                                                                       "m_type":       4401,
+                                                                                                                                       "proportion":   1,
+                                                                                                                                       "border":       2,
+                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                       "m_styles":     [],
+                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                                                                                                                       "m_properties": [{
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                       "m_value":      "boxSizer175"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "choice",
+                                                                                                                                                       "m_label":      "Orientation:",
+                                                                                                                                                       "m_selection":  0,
+                                                                                                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
+                                                                                                                                               }],
+                                                                                                                                       "m_events":     [],
+                                                                                                                                       "m_children":   [{
+                                                                                                                                                       "m_type":       4415,
+                                                                                                                                                       "proportion":   0,
+                                                                                                                                                       "border":       2,
+                                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                                       "m_styles":     [],
+                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_TOP"],
+                                                                                                                                                       "m_properties": [{
+                                                                                                                                                                       "type": "winid",
+                                                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                                       "m_value":      "m_checkBox9112"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "colour",
+                                                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "colour",
+                                                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "font",
+                                                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                                                       "m_value":      false
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                                                       "m_value":      false
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                                                       "m_value":      false
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                                                       "m_value":      "Use separate PTT device pin"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                       "m_label":      "Value:",
+                                                                                                                                                                       "m_value":      false
+                                                                                                                                                               }],
+                                                                                                                                                       "m_events":     [],
+                                                                                                                                                       "m_children":   []
+                                                                                                                                               }, {
+                                                                                                                                                       "m_type":       4405,
+                                                                                                                                                       "proportion":   0,
+                                                                                                                                                       "border":       5,
+                                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                                       "m_styles":     [],
+                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                                                                                                                                       "m_properties": [{
+                                                                                                                                                                       "type": "winid",
+                                                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                                       "m_value":      "m_staticText173"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "colour",
+                                                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "colour",
+                                                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "font",
+                                                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                                                       "m_value":      false
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                                                       "m_value":      false
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                                                       "m_value":      false
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                                                       "m_value":      "Device:"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Wrap:",
+                                                                                                                                                                       "m_value":      "-1"
+                                                                                                                                                               }],
+                                                                                                                                                       "m_events":     [],
+                                                                                                                                                       "m_children":   []
+                                                                                                                                               }, {
+                                                                                                                                                       "m_type":       4410,
+                                                                                                                                                       "proportion":   0,
+                                                                                                                                                       "border":       2,
+                                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                                       "m_styles":     [],
+                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                                                                                                                                       "m_properties": [{
+                                                                                                                                                                       "type": "winid",
+                                                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                                       "m_value":      "m_comboBox9313"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "colour",
+                                                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "colour",
+                                                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "font",
+                                                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                                                       "m_value":      false
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                                                       "m_value":      false
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                                                       "m_value":      false
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                                       "m_label":      "ComboBox Choices:",
+                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Selection:",
+                                                                                                                                                                       "m_value":      "-1"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Value:",
+                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                               }],
+                                                                                                                                                       "m_events":     [],
+                                                                                                                                                       "m_children":   []
+                                                                                                                                               }]
+                                                                                                                               }, {
+                                                                                                                                       "m_type":       4401,
+                                                                                                                                       "proportion":   1,
+                                                                                                                                       "border":       2,
+                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                       "m_styles":     [],
+                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                                                                                                                       "m_properties": [{
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                       "m_value":      "boxSizer171"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "choice",
+                                                                                                                                                       "m_label":      "Orientation:",
+                                                                                                                                                       "m_selection":  1,
+                                                                                                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
+                                                                                                                                               }],
+                                                                                                                                       "m_events":     [],
+                                                                                                                                       "m_children":   [{
+                                                                                                                                                       "m_type":       4401,
+                                                                                                                                                       "proportion":   1,
+                                                                                                                                                       "border":       2,
+                                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                                       "m_styles":     [],
+                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_HORIZONTAL"],
+                                                                                                                                                       "m_properties": [{
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                                       "m_value":      "boxSizer12714"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "choice",
+                                                                                                                                                                       "m_label":      "Orientation:",
+                                                                                                                                                                       "m_selection":  0,
+                                                                                                                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
+                                                                                                                                                               }],
+                                                                                                                                                       "m_events":     [],
+                                                                                                                                                       "m_children":   [{
+                                                                                                                                                                       "m_type":       4416,
+                                                                                                                                                                       "proportion":   1,
+                                                                                                                                                                       "border":       2,
+                                                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                                                       "m_styles":     ["wxRA_SPECIFY_COLS"],
+                                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_HORIZONTAL"],
+                                                                                                                                                                       "m_properties": [{
+                                                                                                                                                                                       "type": "winid",
+                                                                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                                                       "m_value":      "m_radioBox10115"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "colour",
+                                                                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "colour",
+                                                                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "font",
+                                                                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                                                                       "m_value":      false
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                                                                       "m_value":      false
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                                                                       "m_value":      false
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                                                                       "m_value":      "Use RTS"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                                                       "m_label":      "Choices:",
+                                                                                                                                                                                       "m_value":      "Normal (V-);Inverted (V+)"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Selection:",
+                                                                                                                                                                                       "m_value":      "0"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Major Dimension:",
+                                                                                                                                                                                       "m_value":      "2"
+                                                                                                                                                                               }],
+                                                                                                                                                                       "m_events":     [],
+                                                                                                                                                                       "m_children":   []
+                                                                                                                                                               }, {
+                                                                                                                                                                       "m_type":       4416,
+                                                                                                                                                                       "proportion":   1,
+                                                                                                                                                                       "border":       2,
+                                                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                                                       "m_styles":     ["wxRA_SPECIFY_COLS"],
+                                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_HORIZONTAL"],
+                                                                                                                                                                       "m_properties": [{
+                                                                                                                                                                                       "type": "winid",
+                                                                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                                                       "m_value":      "m_radioBox10316"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "colour",
+                                                                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "colour",
+                                                                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "font",
+                                                                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                                                                       "m_value":      false
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                                                                       "m_value":      false
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                                                                       "m_value":      false
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                                                                       "m_value":      "Use DTR"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                                                       "m_label":      "Choices:",
+                                                                                                                                                                                       "m_value":      "Normal (V-);Inverted (V+)"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Selection:",
+                                                                                                                                                                                       "m_value":      "0"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Major Dimension:",
+                                                                                                                                                                                       "m_value":      "2"
+                                                                                                                                                                               }],
+                                                                                                                                                                       "m_events":     [],
+                                                                                                                                                                       "m_children":   []
+                                                                                                                                                               }, {
+                                                                                                                                                                       "m_type":       4401,
+                                                                                                                                                                       "proportion":   0,
+                                                                                                                                                                       "border":       2,
+                                                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                                                       "m_styles":     [],
+                                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_HORIZONTAL", "wxALIGN_CENTER_VERTICAL"],
+                                                                                                                                                                       "m_properties": [{
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                                                       "m_value":      "boxSizer13118"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "choice",
+                                                                                                                                                                                       "m_label":      "Orientation:",
+                                                                                                                                                                                       "m_selection":  1,
+                                                                                                                                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
+                                                                                                                                                                               }],
+                                                                                                                                                                       "m_events":     [],
+                                                                                                                                                                       "m_children":   [{
+                                                                                                                                                                                       "m_type":       4400,
+                                                                                                                                                                                       "proportion":   1,
+                                                                                                                                                                                       "border":       2,
+                                                                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                                                                       "m_styles":     [],
+                                                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                                                                                                                                                                       "m_properties": [{
+                                                                                                                                                                                                       "type": "winid",
+                                                                                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                                                                                               }, {
+                                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                                                                               }, {
+                                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                                                                               }, {
+                                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                                                                       "m_value":      "m_button11319"
+                                                                                                                                                                                               }, {
+                                                                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                                                               }, {
+                                                                                                                                                                                                       "type": "colour",
+                                                                                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                                                                               }, {
+                                                                                                                                                                                                       "type": "colour",
+                                                                                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                                                                               }, {
+                                                                                                                                                                                                       "type": "font",
+                                                                                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                                                               }, {
+                                                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                                                                                       "m_value":      false
+                                                                                                                                                                                               }, {
+                                                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                                                                                       "m_value":      false
+                                                                                                                                                                                               }, {
+                                                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                                                                                       "m_value":      false
+                                                                                                                                                                                               }, {
+                                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                                                               }, {
+                                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                                                               }, {
+                                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                                                                                       "m_value":      "Initialize"
+                                                                                                                                                                                               }, {
+                                                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                                                       "m_label":      "Default Button",
+                                                                                                                                                                                                       "m_value":      false
+                                                                                                                                                                                               }, {
+                                                                                                                                                                                                       "type": "filePicker",
+                                                                                                                                                                                                       "m_label":      "Bitmap File:",
+                                                                                                                                                                                                       "m_path":       ""
+                                                                                                                                                                                               }, {
+                                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                                       "m_label":      "Margins:",
+                                                                                                                                                                                                       "m_value":      "2,2"
+                                                                                                                                                                                               }],
+                                                                                                                                                                                       "m_events":     [],
+                                                                                                                                                                                       "m_children":   []
+                                                                                                                                                                               }]
+                                                                                                                                                               }]
+                                                                                                                                               }]
+                                                                                                                               }]
+                                                                                                               }]
+                                                                                               }, {
+                                                                                                       "m_type":       4449,
+                                                                                                       "proportion":   0,
+                                                                                                       "border":       2,
+                                                                                                       "gbSpan":       "1,1",
+                                                                                                       "gbPosition":   "0,0",
+                                                                                                       "m_styles":     [],
+                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND", "wxALIGN_LEFT"],
+                                                                                                       "m_properties": [{
+                                                                                                                       "type": "string",
+                                                                                                                       "m_label":      "Name:",
+                                                                                                                       "m_value":      "staticBoxSizer79420"
+                                                                                                               }, {
+                                                                                                                       "type": "choice",
+                                                                                                                       "m_label":      "Orientation:",
+                                                                                                                       "m_selection":  1,
+                                                                                                                       "m_options":    ["Vertical", "Horizontal"]
+                                                                                                               }, {
+                                                                                                                       "type": "string",
+                                                                                                                       "m_label":      "Label:",
+                                                                                                                       "m_value":      "PTT delay for all CAT/PTT types"
+                                                                                                               }],
+                                                                                                       "m_events":     [],
+                                                                                                       "m_children":   [{
+                                                                                                                       "m_type":       4405,
+                                                                                                                       "proportion":   0,
+                                                                                                                       "border":       2,
+                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                       "m_styles":     [],
+                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_VERTICAL"],
+                                                                                                                       "m_properties": [{
+                                                                                                                                       "type": "winid",
+                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                       "m_value":      "m_staticText177"
+                                                                                                                               }, {
+                                                                                                                                       "type": "multi-string",
+                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "colour",
+                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                       "colour":       "<Default>"
+                                                                                                                               }, {
+                                                                                                                                       "type": "colour",
+                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                       "colour":       "<Default>"
+                                                                                                                               }, {
+                                                                                                                                       "type": "font",
+                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "multi-string",
+                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                       "m_value":      "Start of xmit delay"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Wrap:",
+                                                                                                                                       "m_value":      "-1"
+                                                                                                                               }],
+                                                                                                                       "m_events":     [],
+                                                                                                                       "m_children":   []
+                                                                                                               }, {
+                                                                                                                       "m_type":       4419,
+                                                                                                                       "proportion":   1,
+                                                                                                                       "border":       2,
+                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                       "m_styles":     ["wxSL_HORIZONTAL"],
+                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_HORIZONTAL", "wxALIGN_CENTER_VERTICAL"],
+                                                                                                                       "m_properties": [{
+                                                                                                                                       "type": "winid",
+                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                       "m_value":      "m_slider10721"
+                                                                                                                               }, {
+                                                                                                                                       "type": "multi-string",
+                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "colour",
+                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                       "colour":       "<Default>"
+                                                                                                                               }, {
+                                                                                                                                       "type": "colour",
+                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                       "colour":       "<Default>"
+                                                                                                                               }, {
+                                                                                                                                       "type": "font",
+                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Value:",
+                                                                                                                                       "m_value":      "50"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Min value:",
+                                                                                                                                       "m_value":      "0"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Max value:",
+                                                                                                                                       "m_value":      "100"
+                                                                                                                               }],
+                                                                                                                       "m_events":     [],
+                                                                                                                       "m_children":   []
+                                                                                                               }, {
+                                                                                                                       "m_type":       4405,
+                                                                                                                       "proportion":   0,
+                                                                                                                       "border":       2,
+                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                       "m_styles":     [],
+                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_VERTICAL"],
+                                                                                                                       "m_properties": [{
+                                                                                                                                       "type": "winid",
+                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                       "m_value":      "m_staticText179"
+                                                                                                                               }, {
+                                                                                                                                       "type": "multi-string",
+                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "colour",
+                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                       "colour":       "<Default>"
+                                                                                                                               }, {
+                                                                                                                                       "type": "colour",
+                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                       "colour":       "<Default>"
+                                                                                                                               }, {
+                                                                                                                                       "type": "font",
+                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "multi-string",
+                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                       "m_value":      "End of xmit delay:"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Wrap:",
+                                                                                                                                       "m_value":      "-1"
+                                                                                                                               }],
+                                                                                                                       "m_events":     [],
+                                                                                                                       "m_children":   []
+                                                                                                               }, {
+                                                                                                                       "m_type":       4419,
+                                                                                                                       "proportion":   0,
+                                                                                                                       "border":       2,
+                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                       "m_styles":     ["wxSL_HORIZONTAL"],
+                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_HORIZONTAL", "wxALIGN_CENTER_VERTICAL"],
+                                                                                                                       "m_properties": [{
+                                                                                                                                       "type": "winid",
+                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                       "m_value":      "m_slider10922"
+                                                                                                                               }, {
+                                                                                                                                       "type": "multi-string",
+                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "colour",
+                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                       "colour":       "<Default>"
+                                                                                                                               }, {
+                                                                                                                                       "type": "colour",
+                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                       "colour":       "<Default>"
+                                                                                                                               }, {
+                                                                                                                                       "type": "font",
+                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Value:",
+                                                                                                                                       "m_value":      "50"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Min value:",
+                                                                                                                                       "m_value":      "0"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Max value:",
+                                                                                                                                       "m_value":      "100"
+                                                                                                                               }],
+                                                                                                                       "m_events":     [],
+                                                                                                                       "m_children":   []
+                                                                                                               }]
+                                                                                               }]
+                                                                               }]
+                                                               }, {
+                                                                       "m_type":       4441,
+                                                                       "proportion":   0,
+                                                                       "border":       5,
+                                                                       "gbSpan":       "1,1",
+                                                                       "gbPosition":   "0,0",
+                                                                       "m_styles":     ["wxTAB_TRAVERSAL"],
+                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                                                       "m_properties": [{
+                                                                                       "type": "winid",
+                                                                                       "m_label":      "ID:",
+                                                                                       "m_winid":      "wxID_ANY"
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Size:",
+                                                                                       "m_value":      "-1,-1"
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Minimum Size:",
+                                                                                       "m_value":      "-1,-1"
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Name:",
+                                                                                       "m_value":      "m_panelRIGCat"
+                                                                               }, {
+                                                                                       "type": "multi-string",
+                                                                                       "m_label":      "Tooltip:",
+                                                                                       "m_value":      "RigCat"
+                                                                               }, {
+                                                                                       "type": "colour",
+                                                                                       "m_label":      "Bg Colour:",
+                                                                                       "colour":       "<Default>"
+                                                                               }, {
+                                                                                       "type": "colour",
+                                                                                       "m_label":      "Fg Colour:",
+                                                                                       "colour":       "<Default>"
+                                                                               }, {
+                                                                                       "type": "font",
+                                                                                       "m_label":      "Font:",
+                                                                                       "m_value":      ""
+                                                                               }, {
+                                                                                       "type": "bool",
+                                                                                       "m_label":      "Hidden",
+                                                                                       "m_value":      false
+                                                                               }, {
+                                                                                       "type": "bool",
+                                                                                       "m_label":      "Disabled",
+                                                                                       "m_value":      false
+                                                                               }, {
+                                                                                       "type": "bool",
+                                                                                       "m_label":      "Focused",
+                                                                                       "m_value":      false
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Class Name:",
+                                                                                       "m_value":      ""
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Include File:",
+                                                                                       "m_value":      ""
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Label:",
+                                                                                       "m_value":      "RigCAT"
+                                                                               }, {
+                                                                                       "type": "filePicker",
+                                                                                       "m_label":      "Bitmap File:",
+                                                                                       "m_path":       ""
+                                                                               }, {
+                                                                                       "type": "bool",
+                                                                                       "m_label":      "Selected",
+                                                                                       "m_value":      false
+                                                                               }],
+                                                                       "m_events":     [],
+                                                                       "m_children":   [{
+                                                                                       "m_type":       4401,
+                                                                                       "proportion":   1,
+                                                                                       "border":       5,
+                                                                                       "gbSpan":       "1,1",
+                                                                                       "gbPosition":   "0,0",
+                                                                                       "m_styles":     [],
+                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
+                                                                                       "m_properties": [{
+                                                                                                       "type": "string",
+                                                                                                       "m_label":      "Name:",
+                                                                                                       "m_value":      "boxSizer67"
+                                                                                               }, {
+                                                                                                       "type": "choice",
+                                                                                                       "m_label":      "Orientation:",
+                                                                                                       "m_selection":  0,
+                                                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
+                                                                                               }],
+                                                                                       "m_events":     [],
+                                                                                       "m_children":   [{
+                                                                                                       "m_type":       4417,
+                                                                                                       "proportion":   0,
+                                                                                                       "border":       2,
+                                                                                                       "gbSpan":       "1,1",
+                                                                                                       "gbPosition":   "0,0",
+                                                                                                       "m_styles":     [],
+                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_HORIZONTAL"],
+                                                                                                       "m_properties": [{
+                                                                                                                       "type": "winid",
+                                                                                                                       "m_label":      "ID:",
+                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                               }, {
+                                                                                                                       "type": "string",
+                                                                                                                       "m_label":      "Size:",
+                                                                                                                       "m_value":      "-1,-1"
+                                                                                                               }, {
+                                                                                                                       "type": "string",
+                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                       "m_value":      "-1,-1"
+                                                                                                               }, {
+                                                                                                                       "type": "string",
+                                                                                                                       "m_label":      "Name:",
+                                                                                                                       "m_value":      "m_radioButton185"
+                                                                                                               }, {
+                                                                                                                       "type": "multi-string",
+                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                       "m_value":      ""
+                                                                                                               }, {
+                                                                                                                       "type": "colour",
+                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                       "colour":       "<Default>"
+                                                                                                               }, {
+                                                                                                                       "type": "colour",
+                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                       "colour":       "<Default>"
+                                                                                                               }, {
+                                                                                                                       "type": "font",
+                                                                                                                       "m_label":      "Font:",
+                                                                                                                       "m_value":      ""
+                                                                                                               }, {
+                                                                                                                       "type": "bool",
+                                                                                                                       "m_label":      "Hidden",
+                                                                                                                       "m_value":      false
+                                                                                                               }, {
+                                                                                                                       "type": "bool",
+                                                                                                                       "m_label":      "Disabled",
+                                                                                                                       "m_value":      false
+                                                                                                               }, {
+                                                                                                                       "type": "bool",
+                                                                                                                       "m_label":      "Focused",
+                                                                                                                       "m_value":      false
+                                                                                                               }, {
+                                                                                                                       "type": "string",
+                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                       "m_value":      ""
+                                                                                                               }, {
+                                                                                                                       "type": "string",
+                                                                                                                       "m_label":      "Include File:",
+                                                                                                                       "m_value":      ""
+                                                                                                               }, {
+                                                                                                                       "type": "string",
+                                                                                                                       "m_label":      "Label:",
+                                                                                                                       "m_value":      "Use RigCAT"
+                                                                                                               }, {
+                                                                                                                       "type": "bool",
+                                                                                                                       "m_label":      "Value:",
+                                                                                                                       "m_value":      true
+                                                                                                               }],
+                                                                                                       "m_events":     [],
+                                                                                                       "m_children":   []
+                                                                                               }, {
+                                                                                                       "m_type":       4449,
+                                                                                                       "proportion":   1,
+                                                                                                       "border":       2,
+                                                                                                       "gbSpan":       "1,1",
+                                                                                                       "gbPosition":   "0,0",
+                                                                                                       "m_styles":     [],
+                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND", "wxALIGN_TOP"],
+                                                                                                       "m_properties": [{
+                                                                                                                       "type": "string",
+                                                                                                                       "m_label":      "Name:",
+                                                                                                                       "m_value":      "staticBoxSizer183"
+                                                                                                               }, {
+                                                                                                                       "type": "choice",
+                                                                                                                       "m_label":      "Orientation:",
+                                                                                                                       "m_selection":  0,
+                                                                                                                       "m_options":    ["Vertical", "Horizontal"]
+                                                                                                               }, {
+                                                                                                                       "type": "string",
+                                                                                                                       "m_label":      "Label:",
+                                                                                                                       "m_value":      ""
+                                                                                                               }],
+                                                                                                       "m_events":     [],
+                                                                                                       "m_children":   [{
+                                                                                                                       "m_type":       4403,
+                                                                                                                       "proportion":   0,
+                                                                                                                       "border":       2,
+                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                       "m_styles":     [],
+                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                                                                                                       "m_properties": [{
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                       "m_value":      "flexGridSizer187"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "# Columns:",
+                                                                                                                                       "m_value":      "1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "# Rows:",
+                                                                                                                                       "m_value":      "1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Growable columns:",
+                                                                                                                                       "m_value":      "1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Growable rows:",
+                                                                                                                                       "m_value":      "1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Horizontal gap:",
+                                                                                                                                       "m_value":      "0"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Vertical gap:",
+                                                                                                                                       "m_value":      "0"
+                                                                                                                               }],
+                                                                                                                       "m_events":     [],
+                                                                                                                       "m_children":   [{
+                                                                                                                                       "m_type":       4403,
+                                                                                                                                       "proportion":   1,
+                                                                                                                                       "border":       2,
+                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                       "m_styles":     [],
+                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
+                                                                                                                                       "m_properties": [{
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                       "m_value":      "flexGridSizer204"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "# Columns:",
+                                                                                                                                                       "m_value":      "4"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "# Rows:",
+                                                                                                                                                       "m_value":      "3"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Growable columns:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Growable rows:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Horizontal gap:",
+                                                                                                                                                       "m_value":      "0"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Vertical gap:",
+                                                                                                                                                       "m_value":      "0"
+                                                                                                                                               }],
+                                                                                                                                       "m_events":     [],
+                                                                                                                                       "m_children":   [{
+                                                                                                                                                       "m_type":       4401,
+                                                                                                                                                       "proportion":   1,
+                                                                                                                                                       "border":       2,
+                                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                                       "m_styles":     [],
+                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND", "wxALIGN_CENTER_VERTICAL"],
+                                                                                                                                                       "m_properties": [{
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                                       "m_value":      "boxSizer193"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "choice",
+                                                                                                                                                                       "m_label":      "Orientation:",
+                                                                                                                                                                       "m_selection":  1,
+                                                                                                                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
+                                                                                                                                                               }],
+                                                                                                                                                       "m_events":     [],
+                                                                                                                                                       "m_children":   [{
+                                                                                                                                                                       "m_type":       4405,
+                                                                                                                                                                       "proportion":   0,
+                                                                                                                                                                       "border":       2,
+                                                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                                                       "m_styles":     [],
+                                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_VERTICAL"],
+                                                                                                                                                                       "m_properties": [{
+                                                                                                                                                                                       "type": "winid",
+                                                                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                                                       "m_value":      "m_staticText189"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "colour",
+                                                                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "colour",
+                                                                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "font",
+                                                                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                                                                       "m_value":      false
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                                                                       "m_value":      false
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                                                                       "m_value":      false
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                                                                       "m_value":      "File:"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Wrap:",
+                                                                                                                                                                                       "m_value":      "-1"
+                                                                                                                                                                               }],
+                                                                                                                                                                       "m_events":     [],
+                                                                                                                                                                       "m_children":   []
+                                                                                                                                                               }, {
+                                                                                                                                                                       "m_type":       4406,
+                                                                                                                                                                       "proportion":   0,
+                                                                                                                                                                       "border":       2,
+                                                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                                                       "m_styles":     [],
+                                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_VERTICAL"],
+                                                                                                                                                                       "m_properties": [{
+                                                                                                                                                                                       "type": "winid",
+                                                                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                                                       "m_value":      "m_textCtrl191"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "colour",
+                                                                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "colour",
+                                                                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "font",
+                                                                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                                                                       "m_value":      false
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                                                                       "m_value":      false
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                                                                       "m_value":      false
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Value:",
+                                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Max Length:",
+                                                                                                                                                                                       "m_value":      "0"
+                                                                                                                                                                               }],
+                                                                                                                                                                       "m_events":     [],
+                                                                                                                                                                       "m_children":   []
+                                                                                                                                                               }]
+                                                                                                                                               }, {
+                                                                                                                                                       "m_type":       4401,
+                                                                                                                                                       "proportion":   1,
+                                                                                                                                                       "border":       5,
+                                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                                       "m_styles":     [],
+                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
+                                                                                                                                                       "m_properties": [{
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                                       "m_value":      "boxSizer206"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "choice",
+                                                                                                                                                                       "m_label":      "Orientation:",
+                                                                                                                                                                       "m_selection":  0,
+                                                                                                                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
+                                                                                                                                                               }],
+                                                                                                                                                       "m_events":     [],
+                                                                                                                                                       "m_children":   [{
+                                                                                                                                                                       "m_type":       4400,
+                                                                                                                                                                       "proportion":   0,
+                                                                                                                                                                       "border":       2,
+                                                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                                                       "m_styles":     [],
+                                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_VERTICAL"],
+                                                                                                                                                                       "m_properties": [{
+                                                                                                                                                                                       "type": "winid",
+                                                                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                                                       "m_value":      "m_button208"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "colour",
+                                                                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "colour",
+                                                                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "font",
+                                                                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                                                                       "m_value":      false
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                                                                       "m_value":      false
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                                                                       "m_value":      false
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                                                                       "m_value":      "Open"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                                       "m_label":      "Default Button",
+                                                                                                                                                                                       "m_value":      false
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "filePicker",
+                                                                                                                                                                                       "m_label":      "Bitmap File:",
+                                                                                                                                                                                       "m_path":       ""
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Margins:",
+                                                                                                                                                                                       "m_value":      "2,2"
+                                                                                                                                                                               }],
+                                                                                                                                                                       "m_events":     [],
+                                                                                                                                                                       "m_children":   []
+                                                                                                                                                               }]
+                                                                                                                                               }, {
+                                                                                                                                                       "m_type":       4401,
+                                                                                                                                                       "proportion":   1,
+                                                                                                                                                       "border":       2,
+                                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                                       "m_styles":     [],
+                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND", "wxALIGN_CENTER_VERTICAL"],
+                                                                                                                                                       "m_properties": [{
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                                       "m_value":      "boxSizer19329"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "choice",
+                                                                                                                                                                       "m_label":      "Orientation:",
+                                                                                                                                                                       "m_selection":  1,
+                                                                                                                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
+                                                                                                                                                               }],
+                                                                                                                                                       "m_events":     [],
+                                                                                                                                                       "m_children":   [{
+                                                                                                                                                                       "m_type":       4405,
+                                                                                                                                                                       "proportion":   0,
+                                                                                                                                                                       "border":       2,
+                                                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                                                       "m_styles":     [],
+                                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_VERTICAL"],
+                                                                                                                                                                       "m_properties": [{
+                                                                                                                                                                                       "type": "winid",
+                                                                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                                                       "m_value":      "m_staticText18930"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "colour",
+                                                                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "colour",
+                                                                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "font",
+                                                                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                                                                       "m_value":      false
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                                                                       "m_value":      false
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                                                                       "m_value":      false
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                                                                       "m_value":      "Device:"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Wrap:",
+                                                                                                                                                                                       "m_value":      "-1"
+                                                                                                                                                                               }],
+                                                                                                                                                                       "m_events":     [],
+                                                                                                                                                                       "m_children":   []
+                                                                                                                                                               }, {
+                                                                                                                                                                       "m_type":       4410,
+                                                                                                                                                                       "proportion":   0,
+                                                                                                                                                                       "border":       5,
+                                                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                                                       "m_styles":     [],
+                                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_VERTICAL"],
+                                                                                                                                                                       "m_properties": [{
+                                                                                                                                                                                       "type": "winid",
+                                                                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                                                       "m_value":      "m_comboBox218"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "colour",
+                                                                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "colour",
+                                                                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "font",
+                                                                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                                                                       "m_value":      false
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                                                                       "m_value":      false
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                                                                       "m_value":      false
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                                                       "m_label":      "ComboBox Choices:",
+                                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Selection:",
+                                                                                                                                                                                       "m_value":      "-1"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Value:",
+                                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                                               }],
+                                                                                                                                                                       "m_events":     [],
+                                                                                                                                                                       "m_children":   []
+                                                                                                                                                               }]
+                                                                                                                                               }]
+                                                                                                                               }]
+                                                                                                               }, {
+                                                                                                                       "m_type":       4403,
+                                                                                                                       "proportion":   0,
+                                                                                                                       "border":       2,
+                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                       "m_styles":     [],
+                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                                                                                                       "m_properties": [{
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                       "m_value":      "flexGridSizer222"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "# Columns:",
+                                                                                                                                       "m_value":      "3"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "# Rows:",
+                                                                                                                                       "m_value":      "1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Growable columns:",
+                                                                                                                                       "m_value":      "2"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Growable rows:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Horizontal gap:",
+                                                                                                                                       "m_value":      "0"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Vertical gap:",
+                                                                                                                                       "m_value":      "0"
+                                                                                                                               }],
+                                                                                                                       "m_events":     [],
+                                                                                                                       "m_children":   [{
+                                                                                                                                       "m_type":       4401,
+                                                                                                                                       "proportion":   1,
+                                                                                                                                       "border":       2,
+                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                       "m_styles":     [],
+                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
+                                                                                                                                       "m_properties": [{
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                       "m_value":      "boxSizer19326"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "choice",
+                                                                                                                                                       "m_label":      "Orientation:",
+                                                                                                                                                       "m_selection":  1,
+                                                                                                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
+                                                                                                                                               }],
+                                                                                                                                       "m_events":     [],
+                                                                                                                                       "m_children":   [{
+                                                                                                                                                       "m_type":       4405,
+                                                                                                                                                       "proportion":   0,
+                                                                                                                                                       "border":       2,
+                                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                                       "m_styles":     [],
+                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_VERTICAL"],
+                                                                                                                                                       "m_properties": [{
+                                                                                                                                                                       "type": "winid",
+                                                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                                       "m_value":      "m_staticText18927"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "colour",
+                                                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "colour",
+                                                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "font",
+                                                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                                                       "m_value":      false
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                                                       "m_value":      false
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                                                       "m_value":      false
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                                                       "m_value":      "Retries:"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Wrap:",
+                                                                                                                                                                       "m_value":      "-1"
+                                                                                                                                                               }],
+                                                                                                                                                       "m_events":     [],
+                                                                                                                                                       "m_children":   []
+                                                                                                                                               }, {
+                                                                                                                                                       "m_type":       4406,
+                                                                                                                                                       "proportion":   1,
+                                                                                                                                                       "border":       2,
+                                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                                       "m_styles":     [],
+                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_VERTICAL"],
+                                                                                                                                                       "m_properties": [{
+                                                                                                                                                                       "type": "winid",
+                                                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                                       "m_value":      "m_textCtrl19128"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "colour",
+                                                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "colour",
+                                                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "font",
+                                                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                                                       "m_value":      false
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                                                       "m_value":      false
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                                                       "m_value":      false
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Value:",
+                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Max Length:",
+                                                                                                                                                                       "m_value":      "0"
+                                                                                                                                                               }],
+                                                                                                                                                       "m_events":     [],
+                                                                                                                                                       "m_children":   []
+                                                                                                                                               }]
+                                                                                                                               }, {
+                                                                                                                                       "m_type":       4401,
+                                                                                                                                       "proportion":   1,
+                                                                                                                                       "border":       2,
+                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                       "m_styles":     [],
+                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
+                                                                                                                                       "m_properties": [{
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                       "m_value":      "boxSizer19323"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "choice",
+                                                                                                                                                       "m_label":      "Orientation:",
+                                                                                                                                                       "m_selection":  1,
+                                                                                                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
+                                                                                                                                               }],
+                                                                                                                                       "m_events":     [],
+                                                                                                                                       "m_children":   [{
+                                                                                                                                                       "m_type":       4405,
+                                                                                                                                                       "proportion":   0,
+                                                                                                                                                       "border":       2,
+                                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                                       "m_styles":     [],
+                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_VERTICAL"],
+                                                                                                                                                       "m_properties": [{
+                                                                                                                                                                       "type": "winid",
+                                                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                                       "m_value":      "m_staticText18924"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "colour",
+                                                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "colour",
+                                                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "font",
+                                                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                                                       "m_value":      false
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                                                       "m_value":      false
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                                                       "m_value":      false
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                                                       "m_value":      "Retry Interval:"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Wrap:",
+                                                                                                                                                                       "m_value":      "-1"
+                                                                                                                                                               }],
+                                                                                                                                                       "m_events":     [],
+                                                                                                                                                       "m_children":   []
+                                                                                                                                               }, {
+                                                                                                                                                       "m_type":       4406,
+                                                                                                                                                       "proportion":   1,
+                                                                                                                                                       "border":       2,
+                                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                                       "m_styles":     [],
+                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_VERTICAL"],
+                                                                                                                                                       "m_properties": [{
+                                                                                                                                                                       "type": "winid",
+                                                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                                       "m_value":      "m_textCtrl19125"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "colour",
+                                                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "colour",
+                                                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "font",
+                                                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                                                       "m_value":      false
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                                                       "m_value":      false
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                                                       "m_value":      false
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Value:",
+                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Max Length:",
+                                                                                                                                                                       "m_value":      "0"
+                                                                                                                                                               }],
+                                                                                                                                                       "m_events":     [],
+                                                                                                                                                       "m_children":   []
+                                                                                                                                               }]
+                                                                                                                               }, {
+                                                                                                                                       "m_type":       4401,
+                                                                                                                                       "proportion":   1,
+                                                                                                                                       "border":       2,
+                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                       "m_styles":     [],
+                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
+                                                                                                                                       "m_properties": [{
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                       "m_value":      "boxSizer1932954"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "choice",
+                                                                                                                                                       "m_label":      "Orientation:",
+                                                                                                                                                       "m_selection":  1,
+                                                                                                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
+                                                                                                                                               }],
+                                                                                                                                       "m_events":     [],
+                                                                                                                                       "m_children":   [{
+                                                                                                                                                       "m_type":       4405,
+                                                                                                                                                       "proportion":   0,
+                                                                                                                                                       "border":       2,
+                                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                                       "m_styles":     [],
+                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_VERTICAL"],
+                                                                                                                                                       "m_properties": [{
+                                                                                                                                                                       "type": "winid",
+                                                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                                       "m_value":      "m_staticText1893055"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "colour",
+                                                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "colour",
+                                                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "font",
+                                                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                                                       "m_value":      false
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                                                       "m_value":      false
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                                                       "m_value":      false
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                                                       "m_value":      "Baud Rate:"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Wrap:",
+                                                                                                                                                                       "m_value":      "-1"
+                                                                                                                                                               }],
+                                                                                                                                                       "m_events":     [],
+                                                                                                                                                       "m_children":   []
+                                                                                                                                               }, {
+                                                                                                                                                       "m_type":       4410,
+                                                                                                                                                       "proportion":   1,
+                                                                                                                                                       "border":       2,
+                                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                                       "m_styles":     [],
+                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_VERTICAL"],
+                                                                                                                                                       "m_properties": [{
+                                                                                                                                                                       "type": "winid",
+                                                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                                       "m_value":      "m_comboBaud"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "colour",
+                                                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "colour",
+                                                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "font",
+                                                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                                                       "m_value":      false
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                                                       "m_value":      false
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                                                       "m_value":      false
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                                       "m_label":      "ComboBox Choices:",
+                                                                                                                                                                       "m_value":      "300\\n600\\n1200\\n2400\\n9600\\n19200\\n38400\\n56800"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Selection:",
+                                                                                                                                                                       "m_value":      "-1"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Value:",
+                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                               }],
+                                                                                                                                                       "m_events":     [],
+                                                                                                                                                       "m_children":   []
+                                                                                                                                               }]
+                                                                                                                               }]
+                                                                                                               }, {
+                                                                                                                       "m_type":       4403,
+                                                                                                                       "proportion":   0,
+                                                                                                                       "border":       2,
+                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                       "m_styles":     [],
+                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
+                                                                                                                       "m_properties": [{
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                       "m_value":      "flexGridSizer18747"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "# Columns:",
+                                                                                                                                       "m_value":      "1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "# Rows:",
+                                                                                                                                       "m_value":      "1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Growable columns:",
+                                                                                                                                       "m_value":      "1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Growable rows:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Horizontal gap:",
+                                                                                                                                       "m_value":      "0"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Vertical gap:",
+                                                                                                                                       "m_value":      "0"
+                                                                                                                               }],
+                                                                                                                       "m_events":     [],
+                                                                                                                       "m_children":   [{
+                                                                                                                                       "m_type":       4403,
+                                                                                                                                       "proportion":   1,
+                                                                                                                                       "border":       2,
+                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                       "m_styles":     [],
+                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                                                                                                                       "m_properties": [{
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                       "m_value":      "flexGridSizer20448"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "# Columns:",
+                                                                                                                                                       "m_value":      "3"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "# Rows:",
+                                                                                                                                                       "m_value":      "1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Growable columns:",
+                                                                                                                                                       "m_value":      "3"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Growable rows:",
+                                                                                                                                                       "m_value":      "1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Horizontal gap:",
+                                                                                                                                                       "m_value":      "0"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Vertical gap:",
+                                                                                                                                                       "m_value":      "0"
+                                                                                                                                               }],
+                                                                                                                                       "m_events":     [],
+                                                                                                                                       "m_children":   [{
+                                                                                                                                                       "m_type":       4401,
+                                                                                                                                                       "proportion":   1,
+                                                                                                                                                       "border":       2,
+                                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                                       "m_styles":     [],
+                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND", "wxALIGN_CENTER_VERTICAL"],
+                                                                                                                                                       "m_properties": [{
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                                       "m_value":      "boxSizer19349"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "choice",
+                                                                                                                                                                       "m_label":      "Orientation:",
+                                                                                                                                                                       "m_selection":  1,
+                                                                                                                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
+                                                                                                                                                               }],
+                                                                                                                                                       "m_events":     [],
+                                                                                                                                                       "m_children":   [{
+                                                                                                                                                                       "m_type":       4405,
+                                                                                                                                                                       "proportion":   0,
+                                                                                                                                                                       "border":       2,
+                                                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                                                       "m_styles":     [],
+                                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_VERTICAL"],
+                                                                                                                                                                       "m_properties": [{
+                                                                                                                                                                                       "type": "winid",
+                                                                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                                                       "m_value":      "m_staticText18950"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "colour",
+                                                                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "colour",
+                                                                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "font",
+                                                                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                                                                       "m_value":      false
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                                                                       "m_value":      false
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                                                                       "m_value":      false
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                                                                       "m_value":      "Write Delay (ms):"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Wrap:",
+                                                                                                                                                                                       "m_value":      "-1"
+                                                                                                                                                                               }],
+                                                                                                                                                                       "m_events":     [],
+                                                                                                                                                                       "m_children":   []
+                                                                                                                                                               }, {
+                                                                                                                                                                       "m_type":       4406,
+                                                                                                                                                                       "proportion":   0,
+                                                                                                                                                                       "border":       2,
+                                                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                                                       "m_styles":     [],
+                                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_VERTICAL"],
+                                                                                                                                                                       "m_properties": [{
+                                                                                                                                                                                       "type": "winid",
+                                                                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                                                       "m_value":      "m_textCtrl19151"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "colour",
+                                                                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "colour",
+                                                                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "font",
+                                                                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                                                                       "m_value":      false
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                                                                       "m_value":      false
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                                                                       "m_value":      false
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Value:",
+                                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Max Length:",
+                                                                                                                                                                                       "m_value":      "0"
+                                                                                                                                                                               }],
+                                                                                                                                                                       "m_events":     [],
+                                                                                                                                                                       "m_children":   []
+                                                                                                                                                               }]
+                                                                                                                                               }, {
+                                                                                                                                                       "m_type":       4401,
+                                                                                                                                                       "proportion":   1,
+                                                                                                                                                       "border":       2,
+                                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                                       "m_styles":     [],
+                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
+                                                                                                                                                       "m_properties": [{
+                                                                                                                                                                       "type": "string",
+                                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                                       "m_value":      "boxSizer298"
+                                                                                                                                                               }, {
+                                                                                                                                                                       "type": "choice",
+                                                                                                                                                                       "m_label":      "Orientation:",
+                                                                                                                                                                       "m_selection":  1,
+                                                                                                                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
+                                                                                                                                                               }],
+                                                                                                                                                       "m_events":     [],
+                                                                                                                                                       "m_children":   [{
+                                                                                                                                                                       "m_type":       4405,
+                                                                                                                                                                       "proportion":   0,
+                                                                                                                                                                       "border":       2,
+                                                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                                                       "m_styles":     [],
+                                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                                                                                                                                                       "m_properties": [{
+                                                                                                                                                                                       "type": "winid",
+                                                                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                                                       "m_value":      "m_staticText298"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "colour",
+                                                                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "colour",
+                                                                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "font",
+                                                                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                                                                       "m_value":      false
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                                                                       "m_value":      false
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                                                                       "m_value":      false
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                                                                       "m_value":      "Stop Bits:"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Wrap:",
+                                                                                                                                                                                       "m_value":      "-1"
+                                                                                                                                                                               }],
+                                                                                                                                                                       "m_events":     [],
+                                                                                                                                                                       "m_children":   []
+                                                                                                                                                               }, {
+                                                                                                                                                                       "m_type":       4419,
+                                                                                                                                                                       "proportion":   0,
+                                                                                                                                                                       "border":       5,
+                                                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                                                       "m_styles":     ["wxSL_HORIZONTAL"],
+                                                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                                                                                                                                                       "m_properties": [{
+                                                                                                                                                                                       "type": "winid",
+                                                                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                                                       "m_value":      "m_sliderStopBits"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "colour",
+                                                                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "colour",
+                                                                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "font",
+                                                                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                                                                       "m_value":      false
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                                                                       "m_value":      false
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "bool",
+                                                                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                                                                       "m_value":      false
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                                                                       "m_value":      ""
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Value:",
+                                                                                                                                                                                       "m_value":      "0"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Min value:",
+                                                                                                                                                                                       "m_value":      "0"
+                                                                                                                                                                               }, {
+                                                                                                                                                                                       "type": "string",
+                                                                                                                                                                                       "m_label":      "Max value:",
+                                                                                                                                                                                       "m_value":      "2"
+                                                                                                                                                                               }],
+                                                                                                                                                                       "m_events":     [],
+                                                                                                                                                                       "m_children":   []
+                                                                                                                                                               }]
+                                                                                                                                               }]
+                                                                                                                               }]
+                                                                                                               }, {
+                                                                                                                       "m_type":       4403,
+                                                                                                                       "proportion":   0,
+                                                                                                                       "border":       2,
+                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                       "m_styles":     [],
+                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
+                                                                                                                       "m_properties": [{
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                       "m_value":      "flexGridSizer224"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "# Columns:",
+                                                                                                                                       "m_value":      "4"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "# Rows:",
+                                                                                                                                       "m_value":      "1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Growable columns:",
+                                                                                                                                       "m_value":      "4"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Growable rows:",
+                                                                                                                                       "m_value":      "1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Horizontal gap:",
+                                                                                                                                       "m_value":      "0"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Vertical gap:",
+                                                                                                                                       "m_value":      "0"
+                                                                                                                               }],
+                                                                                                                       "m_events":     [],
+                                                                                                                       "m_children":   [{
+                                                                                                                                       "m_type":       4454,
+                                                                                                                                       "proportion":   1,
+                                                                                                                                       "border":       2,
+                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                       "m_styles":     [],
+                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
+                                                                                                                                       "m_properties": [{
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                       "m_value":      "Spacer234"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                       "m_value":      "2,2"
+                                                                                                                                               }],
+                                                                                                                                       "m_events":     [],
+                                                                                                                                       "m_children":   []
+                                                                                                                               }, {
+                                                                                                                                       "m_type":       4415,
+                                                                                                                                       "proportion":   0,
+                                                                                                                                       "border":       1,
+                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                       "m_styles":     [],
+                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
+                                                                                                                                       "m_properties": [{
+                                                                                                                                                       "type": "winid",
+                                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                       "m_value":      "m_cbEcho"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                                       "m_value":      "Commands are echoed"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "font",
+                                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                                       "m_value":      "Commands echoed"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Value:",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }],
+                                                                                                                                       "m_events":     [],
+                                                                                                                                       "m_children":   []
+                                                                                                                               }, {
+                                                                                                                                       "m_type":       4454,
+                                                                                                                                       "proportion":   1,
+                                                                                                                                       "border":       2,
+                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                       "m_styles":     [],
+                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
+                                                                                                                                       "m_properties": [{
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                       "m_value":      "Spacer240"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                       "m_value":      "2,2"
+                                                                                                                                               }],
+                                                                                                                                       "m_events":     [],
+                                                                                                                                       "m_children":   []
+                                                                                                                               }, {
+                                                                                                                                       "m_type":       4415,
+                                                                                                                                       "proportion":   1,
+                                                                                                                                       "border":       2,
+                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                       "m_styles":     [],
+                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
+                                                                                                                                       "m_properties": [{
+                                                                                                                                                       "type": "winid",
+                                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                       "m_value":      "m_cbCATPTT"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                                       "m_value":      "Use CAT commands for PTT"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "font",
+                                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                                       "m_value":      "CAT command for PTT"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Value:",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }],
+                                                                                                                                       "m_events":     [],
+                                                                                                                                       "m_children":   []
+                                                                                                                               }]
+                                                                                                               }, {
+                                                                                                                       "m_type":       4403,
+                                                                                                                       "proportion":   0,
+                                                                                                                       "border":       2,
+                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                       "m_styles":     [],
+                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
+                                                                                                                       "m_properties": [{
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                       "m_value":      "flexGridSizer22432"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "# Columns:",
+                                                                                                                                       "m_value":      "4"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "# Rows:",
+                                                                                                                                       "m_value":      "1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Growable columns:",
+                                                                                                                                       "m_value":      "4"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Growable rows:",
+                                                                                                                                       "m_value":      "1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Horizontal gap:",
+                                                                                                                                       "m_value":      "0"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Vertical gap:",
+                                                                                                                                       "m_value":      "0"
+                                                                                                                               }],
+                                                                                                                       "m_events":     [],
+                                                                                                                       "m_children":   [{
+                                                                                                                                       "m_type":       4454,
+                                                                                                                                       "proportion":   1,
+                                                                                                                                       "border":       2,
+                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                       "m_styles":     [],
+                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
+                                                                                                                                       "m_properties": [{
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                       "m_value":      "Spacer2402"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                       "m_value":      "2,2"
+                                                                                                                                               }],
+                                                                                                                                       "m_events":     [],
+                                                                                                                                       "m_children":   []
+                                                                                                                               }, {
+                                                                                                                                       "m_type":       4415,
+                                                                                                                                       "proportion":   1,
+                                                                                                                                       "border":       2,
+                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                       "m_styles":     [],
+                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                                                                                                                       "m_properties": [{
+                                                                                                                                                       "type": "winid",
+                                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                       "m_value":      "m_cbToggleRTSPTT"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                                       "m_value":      "Toggle RTS for PTT"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "font",
+                                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                                       "m_value":      "Toggle RTS for PTT"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Value:",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }],
+                                                                                                                                       "m_events":     [],
+                                                                                                                                       "m_children":   []
+                                                                                                                               }, {
+                                                                                                                                       "m_type":       4454,
+                                                                                                                                       "proportion":   1,
+                                                                                                                                       "border":       2,
+                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                       "m_styles":     [],
+                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
+                                                                                                                                       "m_properties": [{
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                       "m_value":      "Spacer2401"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                       "m_value":      "2,2"
+                                                                                                                                               }],
+                                                                                                                                       "m_events":     [],
+                                                                                                                                       "m_children":   []
+                                                                                                                               }, {
+                                                                                                                                       "m_type":       4415,
+                                                                                                                                       "proportion":   1,
+                                                                                                                                       "border":       2,
+                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                       "m_styles":     [],
+                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                                                                                                                       "m_properties": [{
+                                                                                                                                                       "type": "winid",
+                                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                       "m_value":      "m_cbToggleDTRPTT"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                                       "m_value":      "Toggle DTR for PTT"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "font",
+                                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                                       "m_value":      "Toggle DTR for PTT"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Value:",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }],
+                                                                                                                                       "m_events":     [],
+                                                                                                                                       "m_children":   []
+                                                                                                                               }]
+                                                                                                               }, {
+                                                                                                                       "m_type":       4403,
+                                                                                                                       "proportion":   0,
+                                                                                                                       "border":       2,
+                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                       "m_styles":     [],
+                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
+                                                                                                                       "m_properties": [{
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                       "m_value":      "flexGridSizer22437"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "# Columns:",
+                                                                                                                                       "m_value":      "4"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "# Rows:",
+                                                                                                                                       "m_value":      "1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Growable columns:",
+                                                                                                                                       "m_value":      "4"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Growable rows:",
+                                                                                                                                       "m_value":      "1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Horizontal gap:",
+                                                                                                                                       "m_value":      "0"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Vertical gap:",
+                                                                                                                                       "m_value":      "0"
+                                                                                                                               }],
+                                                                                                                       "m_events":     [],
+                                                                                                                       "m_children":   [{
+                                                                                                                                       "m_type":       4454,
+                                                                                                                                       "proportion":   1,
+                                                                                                                                       "border":       2,
+                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                       "m_styles":     [],
+                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
+                                                                                                                                       "m_properties": [{
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                       "m_value":      "Spacer23438"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                       "m_value":      "2,2"
+                                                                                                                                               }],
+                                                                                                                                       "m_events":     [],
+                                                                                                                                       "m_children":   []
+                                                                                                                               }, {
+                                                                                                                                       "m_type":       4415,
+                                                                                                                                       "proportion":   1,
+                                                                                                                                       "border":       2,
+                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                       "m_styles":     [],
+                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
+                                                                                                                                       "m_properties": [{
+                                                                                                                                                       "type": "winid",
+                                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                       "m_value":      "m_cbRTS12VInit"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                                       "m_value":      "Initialize state of RTS"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "font",
+                                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                                       "m_value":      "Initial RTS +12v"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Value:",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }],
+                                                                                                                                       "m_events":     [],
+                                                                                                                                       "m_children":   []
+                                                                                                                               }, {
+                                                                                                                                       "m_type":       4454,
+                                                                                                                                       "proportion":   1,
+                                                                                                                                       "border":       2,
+                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                       "m_styles":     [],
+                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
+                                                                                                                                       "m_properties": [{
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                       "m_value":      "Spacer24040"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                       "m_value":      "2,2"
+                                                                                                                                               }],
+                                                                                                                                       "m_events":     [],
+                                                                                                                                       "m_children":   []
+                                                                                                                               }, {
+                                                                                                                                       "m_type":       4415,
+                                                                                                                                       "proportion":   1,
+                                                                                                                                       "border":       2,
+                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                       "m_styles":     [],
+                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
+                                                                                                                                       "m_properties": [{
+                                                                                                                                                       "type": "winid",
+                                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                       "m_value":      "m_cbDTR12VInit"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                                       "m_value":      "Initialize state of DTR"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "font",
+                                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                                       "m_value":      "Initial DTR +12v"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Value:",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }],
+                                                                                                                                       "m_events":     [],
+                                                                                                                                       "m_children":   []
+                                                                                                                               }]
+                                                                                                               }, {
+                                                                                                                       "m_type":       4403,
+                                                                                                                       "proportion":   0,
+                                                                                                                       "border":       2,
+                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                       "m_styles":     [],
+                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
+                                                                                                                       "m_properties": [{
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                       "m_value":      "flexGridSizer22442"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "# Columns:",
+                                                                                                                                       "m_value":      "4"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "# Rows:",
+                                                                                                                                       "m_value":      "1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Growable columns:",
+                                                                                                                                       "m_value":      "4"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Growable rows:",
+                                                                                                                                       "m_value":      "1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Horizontal gap:",
+                                                                                                                                       "m_value":      "0"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Vertical gap:",
+                                                                                                                                       "m_value":      "0"
+                                                                                                                               }],
+                                                                                                                       "m_events":     [],
+                                                                                                                       "m_children":   [{
+                                                                                                                                       "m_type":       4454,
+                                                                                                                                       "proportion":   0,
+                                                                                                                                       "border":       2,
+                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                       "m_styles":     [],
+                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                                                                                                                       "m_properties": [{
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                       "m_value":      "Spacer23443"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                       "m_value":      "2,2"
+                                                                                                                                               }],
+                                                                                                                                       "m_events":     [],
+                                                                                                                                       "m_children":   []
+                                                                                                                               }, {
+                                                                                                                                       "m_type":       4415,
+                                                                                                                                       "proportion":   0,
+                                                                                                                                       "border":       2,
+                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                       "m_styles":     [],
+                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                                                                                                                       "m_properties": [{
+                                                                                                                                                       "type": "winid",
+                                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                       "m_value":      "m_cbRTSCTSFlowCtl"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "font",
+                                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                                       "m_value":      "RTS/CTS Flow Control"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Value:",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }],
+                                                                                                                                       "m_events":     [],
+                                                                                                                                       "m_children":   []
+                                                                                                                               }, {
+                                                                                                                                       "m_type":       4454,
+                                                                                                                                       "proportion":   0,
+                                                                                                                                       "border":       2,
+                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                       "m_styles":     [],
+                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                                                                                                                       "m_properties": [{
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                       "m_value":      "Spacer24045"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                       "m_value":      "2,2"
+                                                                                                                                               }],
+                                                                                                                                       "m_events":     [],
+                                                                                                                                       "m_children":   []
+                                                                                                                               }, {
+                                                                                                                                       "m_type":       4415,
+                                                                                                                                       "proportion":   0,
+                                                                                                                                       "border":       2,
+                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                       "m_styles":     [],
+                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                                                                                                                       "m_properties": [{
+                                                                                                                                                       "type": "winid",
+                                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                       "m_value":      "m_cbVSPEnable"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                                       "m_value":      "Virtual serial port enable. Suppress WARNINGS"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "font",
+                                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                                       "m_value":      "RTS/CTS Flow Control"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Value:",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }],
+                                                                                                                                       "m_events":     [],
+                                                                                                                                       "m_children":   []
+                                                                                                                               }]
+                                                                                                               }]
+                                                                                               }]
+                                                                               }]
+                                                               }, {
+                                                                       "m_type":       4441,
+                                                                       "proportion":   0,
+                                                                       "border":       5,
+                                                                       "gbSpan":       "1,1",
+                                                                       "gbPosition":   "0,0",
+                                                                       "m_styles":     ["wxTAB_TRAVERSAL"],
+                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                                                       "m_properties": [{
+                                                                                       "type": "winid",
+                                                                                       "m_label":      "ID:",
+                                                                                       "m_winid":      "wxID_ANY"
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Size:",
+                                                                                       "m_value":      "-1,-1"
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Minimum Size:",
+                                                                                       "m_value":      "-1,-1"
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Name:",
+                                                                                       "m_value":      "m_panelHAMLib"
+                                                                               }, {
+                                                                                       "type": "multi-string",
+                                                                                       "m_label":      "Tooltip:",
+                                                                                       "m_value":      "Hamlib Configuration"
+                                                                               }, {
+                                                                                       "type": "colour",
+                                                                                       "m_label":      "Bg Colour:",
+                                                                                       "colour":       "<Default>"
+                                                                               }, {
+                                                                                       "type": "colour",
+                                                                                       "m_label":      "Fg Colour:",
+                                                                                       "colour":       "<Default>"
+                                                                               }, {
+                                                                                       "type": "font",
+                                                                                       "m_label":      "Font:",
+                                                                                       "m_value":      ""
+                                                                               }, {
+                                                                                       "type": "bool",
+                                                                                       "m_label":      "Hidden",
+                                                                                       "m_value":      false
+                                                                               }, {
+                                                                                       "type": "bool",
+                                                                                       "m_label":      "Disabled",
+                                                                                       "m_value":      false
+                                                                               }, {
+                                                                                       "type": "bool",
+                                                                                       "m_label":      "Focused",
+                                                                                       "m_value":      false
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Class Name:",
+                                                                                       "m_value":      ""
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Include File:",
+                                                                                       "m_value":      ""
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Label:",
+                                                                                       "m_value":      "HAMlib"
+                                                                               }, {
+                                                                                       "type": "filePicker",
+                                                                                       "m_label":      "Bitmap File:",
+                                                                                       "m_path":       ""
+                                                                               }, {
+                                                                                       "type": "bool",
+                                                                                       "m_label":      "Selected",
+                                                                                       "m_value":      false
+                                                                               }],
+                                                                       "m_events":     [],
+                                                                       "m_children":   [{
+                                                                                       "m_type":       4449,
+                                                                                       "proportion":   1,
+                                                                                       "border":       5,
+                                                                                       "gbSpan":       "1,1",
+                                                                                       "gbPosition":   "0,0",
+                                                                                       "m_styles":     [],
+                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
+                                                                                       "m_properties": [{
+                                                                                                       "type": "string",
+                                                                                                       "m_label":      "Name:",
+                                                                                                       "m_value":      "staticBoxSizer296"
+                                                                                               }, {
+                                                                                                       "type": "choice",
+                                                                                                       "m_label":      "Orientation:",
+                                                                                                       "m_selection":  0,
+                                                                                                       "m_options":    ["Vertical", "Horizontal"]
+                                                                                               }, {
+                                                                                                       "type": "string",
+                                                                                                       "m_label":      "Label:",
+                                                                                                       "m_value":      ""
+                                                                                               }],
+                                                                                       "m_events":     [],
+                                                                                       "m_children":   [{
+                                                                                                       "m_type":       4452,
+                                                                                                       "proportion":   0,
+                                                                                                       "border":       5,
+                                                                                                       "gbSpan":       "1,1",
+                                                                                                       "gbPosition":   "0,0",
+                                                                                                       "m_styles":     [],
+                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
+                                                                                                       "m_properties": [{
+                                                                                                                       "type": "string",
+                                                                                                                       "m_label":      "Name:",
+                                                                                                                       "m_value":      "gridSizer368"
+                                                                                                               }, {
+                                                                                                                       "type": "string",
+                                                                                                                       "m_label":      "# Columns:",
+                                                                                                                       "m_value":      "3"
+                                                                                                               }, {
+                                                                                                                       "type": "string",
+                                                                                                                       "m_label":      "# Rows:",
+                                                                                                                       "m_value":      "8"
+                                                                                                               }, {
+                                                                                                                       "type": "string",
+                                                                                                                       "m_label":      "Horizontal gap:",
+                                                                                                                       "m_value":      "0"
+                                                                                                               }, {
+                                                                                                                       "type": "string",
+                                                                                                                       "m_label":      "Vertical gap:",
+                                                                                                                       "m_value":      "0"
+                                                                                                               }],
+                                                                                                       "m_events":     [],
+                                                                                                       "m_children":   [{
+                                                                                                                       "m_type":       4401,
+                                                                                                                       "proportion":   1,
+                                                                                                                       "border":       2,
+                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                       "m_styles":     [],
+                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
+                                                                                                                       "m_properties": [{
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                       "m_value":      "boxSizer312"
+                                                                                                                               }, {
+                                                                                                                                       "type": "choice",
+                                                                                                                                       "m_label":      "Orientation:",
+                                                                                                                                       "m_selection":  1,
+                                                                                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
+                                                                                                                               }],
+                                                                                                                       "m_events":     [],
+                                                                                                                       "m_children":   [{
+                                                                                                                                       "m_type":       4405,
+                                                                                                                                       "proportion":   0,
+                                                                                                                                       "border":       2,
+                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                       "m_styles":     [],
+                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_RIGHT", "wxALIGN_CENTER_VERTICAL"],
+                                                                                                                                       "m_properties": [{
+                                                                                                                                                       "type": "winid",
+                                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                       "m_value":      "m_staticText308"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "font",
+                                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                                       "m_value":      "Device:"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Wrap:",
+                                                                                                                                                       "m_value":      "-1"
+                                                                                                                                               }],
+                                                                                                                                       "m_events":     [],
+                                                                                                                                       "m_children":   []
+                                                                                                                               }, {
+                                                                                                                                       "m_type":       4410,
+                                                                                                                                       "proportion":   1,
+                                                                                                                                       "border":       2,
+                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                       "m_styles":     [],
+                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_LEFT", "wxALIGN_CENTER_VERTICAL"],
+                                                                                                                                       "m_properties": [{
+                                                                                                                                                       "type": "winid",
+                                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                       "m_value":      "m_comboBox314"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "font",
+                                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                       "m_label":      "ComboBox Choices:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Selection:",
+                                                                                                                                                       "m_value":      "-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Value:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }],
+                                                                                                                                       "m_events":     [],
+                                                                                                                                       "m_children":   []
+                                                                                                                               }]
+                                                                                                               }, {
+                                                                                                                       "m_type":       4405,
+                                                                                                                       "proportion":   1,
+                                                                                                                       "border":       2,
+                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                       "m_styles":     [],
+                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_RIGHT", "wxALIGN_CENTER_VERTICAL"],
+                                                                                                                       "m_properties": [{
+                                                                                                                                       "type": "winid",
+                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                       "m_value":      "m_staticText304"
+                                                                                                                               }, {
+                                                                                                                                       "type": "multi-string",
+                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "colour",
+                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                       "colour":       "<Default>"
+                                                                                                                               }, {
+                                                                                                                                       "type": "colour",
+                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                       "colour":       "<Default>"
+                                                                                                                               }, {
+                                                                                                                                       "type": "font",
+                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "multi-string",
+                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                       "m_value":      "Rig:"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Wrap:",
+                                                                                                                                       "m_value":      "-1"
+                                                                                                                               }],
+                                                                                                                       "m_events":     [],
+                                                                                                                       "m_children":   []
+                                                                                                               }, {
+                                                                                                                       "m_type":       4401,
+                                                                                                                       "proportion":   1,
+                                                                                                                       "border":       2,
+                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                       "m_styles":     [],
+                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                                                                                                       "m_properties": [{
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                       "m_value":      "boxSizer302"
+                                                                                                                               }, {
+                                                                                                                                       "type": "choice",
+                                                                                                                                       "m_label":      "Orientation:",
+                                                                                                                                       "m_selection":  1,
+                                                                                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
+                                                                                                                               }],
+                                                                                                                       "m_events":     [],
+                                                                                                                       "m_children":   [{
+                                                                                                                                       "m_type":       4406,
+                                                                                                                                       "proportion":   1,
+                                                                                                                                       "border":       2,
+                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                       "m_styles":     [],
+                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_LEFT", "wxALIGN_CENTER_VERTICAL"],
+                                                                                                                                       "m_properties": [{
+                                                                                                                                                       "type": "winid",
+                                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                       "m_value":      "m_textCtrl306"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "font",
+                                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Value:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Max Length:",
+                                                                                                                                                       "m_value":      "0"
+                                                                                                                                               }],
+                                                                                                                                       "m_events":     [],
+                                                                                                                                       "m_children":   []
+                                                                                                                               }]
+                                                                                                               }, {
+                                                                                                                       "m_type":       4401,
+                                                                                                                       "proportion":   1,
+                                                                                                                       "border":       2,
+                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                       "m_styles":     [],
+                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                                                                                                       "m_properties": [{
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                       "m_value":      "boxSizer320"
+                                                                                                                               }, {
+                                                                                                                                       "type": "choice",
+                                                                                                                                       "m_label":      "Orientation:",
+                                                                                                                                       "m_selection":  1,
+                                                                                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
+                                                                                                                               }],
+                                                                                                                       "m_events":     [],
+                                                                                                                       "m_children":   [{
+                                                                                                                                       "m_type":       4405,
+                                                                                                                                       "proportion":   0,
+                                                                                                                                       "border":       2,
+                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                       "m_styles":     [],
+                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_RIGHT", "wxALIGN_CENTER_VERTICAL"],
+                                                                                                                                       "m_properties": [{
+                                                                                                                                                       "type": "winid",
+                                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                       "m_value":      "m_staticText326"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "font",
+                                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                                       "m_value":      "Retries:"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Wrap:",
+                                                                                                                                                       "m_value":      "-1"
+                                                                                                                                               }],
+                                                                                                                                       "m_events":     [],
+                                                                                                                                       "m_children":   []
+                                                                                                                               }, {
+                                                                                                                                       "m_type":       4406,
+                                                                                                                                       "proportion":   1,
+                                                                                                                                       "border":       2,
+                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                       "m_styles":     [],
+                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_LEFT", "wxALIGN_CENTER_VERTICAL"],
+                                                                                                                                       "m_properties": [{
+                                                                                                                                                       "type": "winid",
+                                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                       "m_value":      "m_textCtrl328"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "font",
+                                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Value:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Max Length:",
+                                                                                                                                                       "m_value":      "0"
+                                                                                                                                               }],
+                                                                                                                                       "m_events":     [],
+                                                                                                                                       "m_children":   []
+                                                                                                                               }]
+                                                                                                               }, {
+                                                                                                                       "m_type":       4401,
+                                                                                                                       "proportion":   1,
+                                                                                                                       "border":       2,
+                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                       "m_styles":     [],
+                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                                                                                                       "m_properties": [{
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                       "m_value":      "boxSizer32057"
+                                                                                                                               }, {
+                                                                                                                                       "type": "choice",
+                                                                                                                                       "m_label":      "Orientation:",
+                                                                                                                                       "m_selection":  1,
+                                                                                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
+                                                                                                                               }],
+                                                                                                                       "m_events":     [],
+                                                                                                                       "m_children":   [{
+                                                                                                                                       "m_type":       4405,
+                                                                                                                                       "proportion":   0,
+                                                                                                                                       "border":       2,
+                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                       "m_styles":     [],
+                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_RIGHT", "wxALIGN_CENTER_VERTICAL"],
+                                                                                                                                       "m_properties": [{
+                                                                                                                                                       "type": "winid",
+                                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                       "m_value":      "m_staticText32658"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "font",
+                                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                                       "m_value":      "Retry Interval:"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Wrap:",
+                                                                                                                                                       "m_value":      "-1"
+                                                                                                                                               }],
+                                                                                                                                       "m_events":     [],
+                                                                                                                                       "m_children":   []
+                                                                                                                               }, {
+                                                                                                                                       "m_type":       4406,
+                                                                                                                                       "proportion":   1,
+                                                                                                                                       "border":       2,
+                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                       "m_styles":     [],
+                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_HORIZONTAL", "wxALIGN_CENTER_VERTICAL"],
+                                                                                                                                       "m_properties": [{
+                                                                                                                                                       "type": "winid",
+                                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                       "m_value":      "m_textCtrl32859"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "font",
+                                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Value:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Max Length:",
+                                                                                                                                                       "m_value":      "0"
+                                                                                                                                               }],
+                                                                                                                                       "m_events":     [],
+                                                                                                                                       "m_children":   []
+                                                                                                                               }]
+                                                                                                               }, {
+                                                                                                                       "m_type":       4401,
+                                                                                                                       "proportion":   1,
+                                                                                                                       "border":       2,
+                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                       "m_styles":     [],
+                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                                                                                                       "m_properties": [{
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                       "m_value":      "boxSizer32060"
+                                                                                                                               }, {
+                                                                                                                                       "type": "choice",
+                                                                                                                                       "m_label":      "Orientation:",
+                                                                                                                                       "m_selection":  1,
+                                                                                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
+                                                                                                                               }],
+                                                                                                                       "m_events":     [],
+                                                                                                                       "m_children":   [{
+                                                                                                                                       "m_type":       4405,
+                                                                                                                                       "proportion":   0,
+                                                                                                                                       "border":       2,
+                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                       "m_styles":     [],
+                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_RIGHT", "wxALIGN_CENTER_VERTICAL"],
+                                                                                                                                       "m_properties": [{
+                                                                                                                                                       "type": "winid",
+                                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                       "m_value":      "m_staticText32661"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "font",
+                                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                                       "m_value":      "Baud Rate:"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Wrap:",
+                                                                                                                                                       "m_value":      "-1"
+                                                                                                                                               }],
+                                                                                                                                       "m_events":     [],
+                                                                                                                                       "m_children":   []
+                                                                                                                               }, {
+                                                                                                                                       "m_type":       4410,
+                                                                                                                                       "proportion":   1,
+                                                                                                                                       "border":       2,
+                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                       "m_styles":     [],
+                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_HORIZONTAL", "wxALIGN_CENTER_VERTICAL"],
+                                                                                                                                       "m_properties": [{
+                                                                                                                                                       "type": "winid",
+                                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                       "m_value":      "m_comboBox339"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "font",
+                                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                       "m_label":      "ComboBox Choices:",
+                                                                                                                                                       "m_value":      "300\\n600\\n1200\\n2400\\n9600\\n19200\\n38400\\n56800\\n"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Selection:",
+                                                                                                                                                       "m_value":      "-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Value:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }],
+                                                                                                                                       "m_events":     [],
+                                                                                                                                       "m_children":   []
+                                                                                                                               }]
+                                                                                                               }, {
+                                                                                                                       "m_type":       4401,
+                                                                                                                       "proportion":   0,
+                                                                                                                       "border":       2,
+                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                       "m_styles":     [],
+                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                                                                                                       "m_properties": [{
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                       "m_value":      "boxSizer32064"
+                                                                                                                               }, {
+                                                                                                                                       "type": "choice",
+                                                                                                                                       "m_label":      "Orientation:",
+                                                                                                                                       "m_selection":  1,
+                                                                                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
+                                                                                                                               }],
+                                                                                                                       "m_events":     [],
+                                                                                                                       "m_children":   [{
+                                                                                                                                       "m_type":       4405,
+                                                                                                                                       "proportion":   0,
+                                                                                                                                       "border":       2,
+                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                       "m_styles":     [],
+                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_RIGHT", "wxALIGN_CENTER_VERTICAL"],
+                                                                                                                                       "m_properties": [{
+                                                                                                                                                       "type": "winid",
+                                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                       "m_value":      "m_staticText32665"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "font",
+                                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                                       "m_value":      "Write Delay:"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Wrap:",
+                                                                                                                                                       "m_value":      "-1"
+                                                                                                                                               }],
+                                                                                                                                       "m_events":     [],
+                                                                                                                                       "m_children":   []
+                                                                                                                               }, {
+                                                                                                                                       "m_type":       4406,
+                                                                                                                                       "proportion":   1,
+                                                                                                                                       "border":       2,
+                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                       "m_styles":     [],
+                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_LEFT", "wxALIGN_CENTER_VERTICAL"],
+                                                                                                                                       "m_properties": [{
+                                                                                                                                                       "type": "winid",
+                                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                       "m_value":      "m_textCtrl32866"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "font",
+                                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Value:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Max Length:",
+                                                                                                                                                       "m_value":      "0"
+                                                                                                                                               }],
+                                                                                                                                       "m_events":     [],
+                                                                                                                                       "m_children":   []
+                                                                                                                               }]
+                                                                                                               }, {
+                                                                                                                       "m_type":       4401,
+                                                                                                                       "proportion":   1,
+                                                                                                                       "border":       2,
+                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                       "m_styles":     [],
+                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                                                                                                       "m_properties": [{
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                       "m_value":      "boxSizer3205767"
+                                                                                                                               }, {
+                                                                                                                                       "type": "choice",
+                                                                                                                                       "m_label":      "Orientation:",
+                                                                                                                                       "m_selection":  1,
+                                                                                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
+                                                                                                                               }],
+                                                                                                                       "m_events":     [],
+                                                                                                                       "m_children":   [{
+                                                                                                                                       "m_type":       4405,
+                                                                                                                                       "proportion":   0,
+                                                                                                                                       "border":       2,
+                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                       "m_styles":     [],
+                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_RIGHT", "wxALIGN_CENTER_VERTICAL"],
+                                                                                                                                       "m_properties": [{
+                                                                                                                                                       "type": "winid",
+                                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                       "m_value":      "m_staticText3265868"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "font",
+                                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                                       "m_value":      "Post Write Delay:"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Wrap:",
+                                                                                                                                                       "m_value":      "-1"
+                                                                                                                                               }],
+                                                                                                                                       "m_events":     [],
+                                                                                                                                       "m_children":   []
+                                                                                                                               }, {
+                                                                                                                                       "m_type":       4406,
+                                                                                                                                       "proportion":   1,
+                                                                                                                                       "border":       2,
+                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                       "m_styles":     [],
+                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_HORIZONTAL", "wxALIGN_CENTER_VERTICAL"],
+                                                                                                                                       "m_properties": [{
+                                                                                                                                                       "type": "winid",
+                                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                       "m_value":      "m_textCtrl3285969"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "font",
+                                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Value:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Max Length:",
+                                                                                                                                                       "m_value":      "0"
+                                                                                                                                               }],
+                                                                                                                                       "m_events":     [],
+                                                                                                                                       "m_children":   []
+                                                                                                                               }]
+                                                                                                               }, {
+                                                                                                                       "m_type":       4401,
+                                                                                                                       "proportion":   0,
+                                                                                                                       "border":       2,
+                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                       "m_styles":     [],
+                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                                                                                                       "m_properties": [{
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                       "m_value":      "boxSizer3206070"
+                                                                                                                               }, {
+                                                                                                                                       "type": "choice",
+                                                                                                                                       "m_label":      "Orientation:",
+                                                                                                                                       "m_selection":  1,
+                                                                                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
+                                                                                                                               }],
+                                                                                                                       "m_events":     [],
+                                                                                                                       "m_children":   [{
+                                                                                                                                       "m_type":       4405,
+                                                                                                                                       "proportion":   1,
+                                                                                                                                       "border":       2,
+                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                       "m_styles":     [],
+                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                                                                                                                       "m_properties": [{
+                                                                                                                                                       "type": "winid",
+                                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                       "m_value":      "m_staticText3266171"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "font",
+                                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                                       "m_value":      "Stop bits:"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Wrap:",
+                                                                                                                                                       "m_value":      "-1"
+                                                                                                                                               }],
+                                                                                                                                       "m_events":     [],
+                                                                                                                                       "m_children":   []
+                                                                                                                               }, {
+                                                                                                                                       "m_type":       4419,
+                                                                                                                                       "proportion":   1,
+                                                                                                                                       "border":       2,
+                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                       "m_styles":     ["wxSL_LABELS", "wxSL_HORIZONTAL"],
+                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_HORIZONTAL", "wxALIGN_CENTER_VERTICAL"],
+                                                                                                                                       "m_properties": [{
+                                                                                                                                                       "type": "winid",
+                                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                       "m_value":      "m_slider361"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "font",
+                                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Value:",
+                                                                                                                                                       "m_value":      "1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Min value:",
+                                                                                                                                                       "m_value":      "0"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Max value:",
+                                                                                                                                                       "m_value":      "2"
+                                                                                                                                               }],
+                                                                                                                                       "m_events":     [],
+                                                                                                                                       "m_children":   []
+                                                                                                                               }]
+                                                                                                               }, {
+                                                                                                                       "m_type":       4415,
+                                                                                                                       "proportion":   1,
+                                                                                                                       "border":       2,
+                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                       "m_styles":     [],
+                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                                                                                                       "m_properties": [{
+                                                                                                                                       "type": "winid",
+                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                       "m_value":      "m_cbHAMLIBPTT"
+                                                                                                                               }, {
+                                                                                                                                       "type": "multi-string",
+                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                       "m_value":      "Use Hamlib to control PTT"
+                                                                                                                               }, {
+                                                                                                                                       "type": "colour",
+                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                       "colour":       "<Default>"
+                                                                                                                               }, {
+                                                                                                                                       "type": "colour",
+                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                       "colour":       "<Default>"
+                                                                                                                               }, {
+                                                                                                                                       "type": "font",
+                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                       "m_value":      "PTT via HAMLib"
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Value:",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }],
+                                                                                                                       "m_events":     [],
+                                                                                                                       "m_children":   []
+                                                                                                               }, {
+                                                                                                                       "m_type":       4405,
+                                                                                                                       "proportion":   1,
+                                                                                                                       "border":       2,
+                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                       "m_styles":     [],
+                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_RIGHT"],
+                                                                                                                       "m_properties": [{
+                                                                                                                                       "type": "winid",
+                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                       "m_value":      "m_staticText408"
+                                                                                                                               }, {
+                                                                                                                                       "type": "multi-string",
+                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "colour",
+                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                       "colour":       "<Default>"
+                                                                                                                               }, {
+                                                                                                                                       "type": "colour",
+                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                       "colour":       "<Default>"
+                                                                                                                               }, {
+                                                                                                                                       "type": "font",
+                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "multi-string",
+                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                       "m_value":      "Sideband:"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Wrap:",
+                                                                                                                                       "m_value":      "-1"
+                                                                                                                               }],
+                                                                                                                       "m_events":     [],
+                                                                                                                       "m_children":   []
+                                                                                                               }, {
+                                                                                                                       "m_type":       4401,
+                                                                                                                       "proportion":   1,
+                                                                                                                       "border":       2,
+                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                       "m_styles":     [],
+                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_HORIZONTAL", "wxALIGN_CENTER_VERTICAL"],
+                                                                                                                       "m_properties": [{
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                       "m_value":      "boxSizer410"
+                                                                                                                               }, {
+                                                                                                                                       "type": "choice",
+                                                                                                                                       "m_label":      "Orientation:",
+                                                                                                                                       "m_selection":  0,
+                                                                                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
+                                                                                                                               }],
+                                                                                                                       "m_events":     [],
+                                                                                                                       "m_children":   [{
+                                                                                                                                       "m_type":       4410,
+                                                                                                                                       "proportion":   0,
+                                                                                                                                       "border":       2,
+                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                       "m_styles":     [],
+                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_LEFT", "wxALIGN_CENTER_VERTICAL"],
+                                                                                                                                       "m_properties": [{
+                                                                                                                                                       "type": "winid",
+                                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                       "m_value":      "m_comboBox376"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "font",
+                                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                       "m_label":      "ComboBox Choices:",
+                                                                                                                                                       "m_value":      "Upper\\nLower"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Selection:",
+                                                                                                                                                       "m_value":      "-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Value:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }],
+                                                                                                                                       "m_events":     [],
+                                                                                                                                       "m_children":   []
+                                                                                                                               }]
+                                                                                                               }, {
+                                                                                                                       "m_type":       4415,
+                                                                                                                       "proportion":   0,
+                                                                                                                       "border":       2,
+                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                       "m_styles":     [],
+                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                                                                                                       "m_properties": [{
+                                                                                                                                       "type": "winid",
+                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                       "m_value":      "m_checkBox378"
+                                                                                                                               }, {
+                                                                                                                                       "type": "multi-string",
+                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                       "m_value":      "Initialize state of RTS"
+                                                                                                                               }, {
+                                                                                                                                       "type": "colour",
+                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                       "colour":       "<Default>"
+                                                                                                                               }, {
+                                                                                                                                       "type": "colour",
+                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                       "colour":       "<Default>"
+                                                                                                                               }, {
+                                                                                                                                       "type": "font",
+                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                       "m_value":      "Initial RTS +12v"
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Value:",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }],
+                                                                                                                       "m_events":     [],
+                                                                                                                       "m_children":   []
+                                                                                                               }, {
+                                                                                                                       "m_type":       4454,
+                                                                                                                       "proportion":   0,
+                                                                                                                       "border":       2,
+                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                       "m_styles":     [],
+                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                                                                                                       "m_properties": [{
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                       "m_value":      "Spacer380"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                       "m_value":      "0,0"
+                                                                                                                               }],
+                                                                                                                       "m_events":     [],
+                                                                                                                       "m_children":   []
+                                                                                                               }, {
+                                                                                                                       "m_type":       4415,
+                                                                                                                       "proportion":   0,
+                                                                                                                       "border":       2,
+                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                       "m_styles":     [],
+                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                                                                                                       "m_properties": [{
+                                                                                                                                       "type": "winid",
+                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                       "m_value":      "m_checkBox382"
+                                                                                                                               }, {
+                                                                                                                                       "type": "multi-string",
+                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "colour",
+                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                       "colour":       "<Default>"
+                                                                                                                               }, {
+                                                                                                                                       "type": "colour",
+                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                       "colour":       "<Default>"
+                                                                                                                               }, {
+                                                                                                                                       "type": "font",
+                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                       "m_value":      "Initial DTR +12v"
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Value:",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }],
+                                                                                                                       "m_events":     [],
+                                                                                                                       "m_children":   []
+                                                                                                               }, {
+                                                                                                                       "m_type":       4415,
+                                                                                                                       "proportion":   0,
+                                                                                                                       "border":       2,
+                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                       "m_styles":     [],
+                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                                                                                                       "m_properties": [{
+                                                                                                                                       "type": "winid",
+                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                       "m_value":      "m_cbRTSCTS"
+                                                                                                                               }, {
+                                                                                                                                       "type": "multi-string",
+                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                       "m_value":      "Use RTS/CTS Flow Control"
+                                                                                                                               }, {
+                                                                                                                                       "type": "colour",
+                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                       "colour":       "<Default>"
+                                                                                                                               }, {
+                                                                                                                                       "type": "colour",
+                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                       "colour":       "<Default>"
+                                                                                                                               }, {
+                                                                                                                                       "type": "font",
+                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                       "m_value":      "RTS/CTS Flow Control"
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Value:",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }],
+                                                                                                                       "m_events":     [],
+                                                                                                                       "m_children":   []
+                                                                                                               }, {
+                                                                                                                       "m_type":       4454,
+                                                                                                                       "proportion":   0,
+                                                                                                                       "border":       2,
+                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                       "m_styles":     [],
+                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                                                                                                       "m_properties": [{
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                       "m_value":      "Spacer386"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                       "m_value":      "0,0"
+                                                                                                                               }],
+                                                                                                                       "m_events":     [],
+                                                                                                                       "m_children":   []
+                                                                                                               }, {
+                                                                                                                       "m_type":       4415,
+                                                                                                                       "proportion":   0,
+                                                                                                                       "border":       2,
+                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                       "m_styles":     [],
+                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                                                                                                       "m_properties": [{
+                                                                                                                                       "type": "winid",
+                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                       "m_value":      "m_cbXONXOFF"
+                                                                                                                               }, {
+                                                                                                                                       "type": "multi-string",
+                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                       "m_value":      "Use XON/XOFF flow control"
+                                                                                                                               }, {
+                                                                                                                                       "type": "colour",
+                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                       "colour":       "<Default>"
+                                                                                                                               }, {
+                                                                                                                                       "type": "colour",
+                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                       "colour":       "<Default>"
+                                                                                                                               }, {
+                                                                                                                                       "type": "font",
+                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                       "m_value":      "XON/XOFF Flow Control"
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Value:",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }],
+                                                                                                                       "m_events":     [],
+                                                                                                                       "m_children":   []
+                                                                                                               }, {
+                                                                                                                       "m_type":       4405,
+                                                                                                                       "proportion":   0,
+                                                                                                                       "border":       2,
+                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                       "m_styles":     [],
+                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                                                                                                       "m_properties": [{
+                                                                                                                                       "type": "winid",
+                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                       "m_value":      "m_staticText404"
+                                                                                                                               }, {
+                                                                                                                                       "type": "multi-string",
+                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "colour",
+                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                       "colour":       "<Default>"
+                                                                                                                               }, {
+                                                                                                                                       "type": "colour",
+                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                       "colour":       "<Default>"
+                                                                                                                               }, {
+                                                                                                                                       "type": "font",
+                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "multi-string",
+                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                       "m_value":      "Advanced Configuration:"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Wrap:",
+                                                                                                                                       "m_value":      "-1"
+                                                                                                                               }],
+                                                                                                                       "m_events":     [],
+                                                                                                                       "m_children":   []
+                                                                                                               }, {
+                                                                                                                       "m_type":       4454,
+                                                                                                                       "proportion":   0,
+                                                                                                                       "border":       2,
+                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                       "m_styles":     [],
+                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                                                                                                       "m_properties": [{
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                       "m_value":      "Spacer396"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                       "m_value":      "0,0"
+                                                                                                                               }],
+                                                                                                                       "m_events":     [],
+                                                                                                                       "m_children":   []
+                                                                                                               }, {
+                                                                                                                       "m_type":       4400,
+                                                                                                                       "proportion":   0,
+                                                                                                                       "border":       2,
+                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                       "m_styles":     [],
+                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                                                                                                       "m_properties": [{
+                                                                                                                                       "type": "winid",
+                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                       "m_value":      "m_btnRevert"
+                                                                                                                               }, {
+                                                                                                                                       "type": "multi-string",
+                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                       "m_value":      "Revert to previous settings"
+                                                                                                                               }, {
+                                                                                                                                       "type": "colour",
+                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                       "colour":       "<Default>"
+                                                                                                                               }, {
+                                                                                                                                       "type": "colour",
+                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                       "colour":       "<Default>"
+                                                                                                                               }, {
+                                                                                                                                       "type": "font",
+                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                       "m_value":      "Revert"
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Default Button",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }, {
+                                                                                                                                       "type": "filePicker",
+                                                                                                                                       "m_label":      "Bitmap File:",
+                                                                                                                                       "m_path":       ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Margins:",
+                                                                                                                                       "m_value":      "2,2"
+                                                                                                                               }],
+                                                                                                                       "m_events":     [],
+                                                                                                                       "m_children":   []
+                                                                                                               }, {
+                                                                                                                       "m_type":       4406,
+                                                                                                                       "proportion":   1,
+                                                                                                                       "border":       2,
+                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                       "m_styles":     [],
+                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND", "wxALIGN_CENTER_VERTICAL"],
+                                                                                                                       "m_properties": [{
+                                                                                                                                       "type": "winid",
+                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                       "m_value":      "m_textAdvancedCFG"
+                                                                                                                               }, {
+                                                                                                                                       "type": "multi-string",
+                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                       "m_value":      "Enter Advanced Configuration string"
+                                                                                                                               }, {
+                                                                                                                                       "type": "colour",
+                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                       "colour":       "<Default>"
+                                                                                                                               }, {
+                                                                                                                                       "type": "colour",
+                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                       "colour":       "<Default>"
+                                                                                                                               }, {
+                                                                                                                                       "type": "font",
+                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Value:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Max Length:",
+                                                                                                                                       "m_value":      "0"
+                                                                                                                               }],
+                                                                                                                       "m_events":     [],
+                                                                                                                       "m_children":   []
+                                                                                                               }, {
+                                                                                                                       "m_type":       4454,
+                                                                                                                       "proportion":   0,
+                                                                                                                       "border":       2,
+                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                       "m_styles":     [],
+                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                                                                                                       "m_properties": [{
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                       "m_value":      "Spacer406"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                       "m_value":      "0,0"
+                                                                                                                               }],
+                                                                                                                       "m_events":     [],
+                                                                                                                       "m_children":   []
+                                                                                                               }, {
+                                                                                                                       "m_type":       4400,
+                                                                                                                       "proportion":   0,
+                                                                                                                       "border":       2,
+                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                       "m_styles":     [],
+                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                                                                                                       "m_properties": [{
+                                                                                                                                       "type": "winid",
+                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                       "m_value":      "m_btnInitHamlib"
+                                                                                                                               }, {
+                                                                                                                                       "type": "multi-string",
+                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                       "m_value":      "Initialize HAMLib"
+                                                                                                                               }, {
+                                                                                                                                       "type": "colour",
+                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                       "colour":       "<Default>"
+                                                                                                                               }, {
+                                                                                                                                       "type": "colour",
+                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                       "colour":       "<Default>"
+                                                                                                                               }, {
+                                                                                                                                       "type": "font",
+                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                       "m_value":      "Initialize"
+                                                                                                                               }, {
+                                                                                                                                       "type": "bool",
+                                                                                                                                       "m_label":      "Default Button",
+                                                                                                                                       "m_value":      false
+                                                                                                                               }, {
+                                                                                                                                       "type": "filePicker",
+                                                                                                                                       "m_label":      "Bitmap File:",
+                                                                                                                                       "m_path":       ""
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Margins:",
+                                                                                                                                       "m_value":      "2,2"
+                                                                                                                               }],
+                                                                                                                       "m_events":     [],
+                                                                                                                       "m_children":   []
+                                                                                                               }]
+                                                                                               }]
+                                                                               }]
+                                                               }, {
+                                                                       "m_type":       4441,
+                                                                       "proportion":   0,
+                                                                       "border":       5,
+                                                                       "gbSpan":       "1,1",
+                                                                       "gbPosition":   "0,0",
+                                                                       "m_styles":     ["wxTAB_TRAVERSAL"],
+                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                                                       "m_properties": [{
+                                                                                       "type": "winid",
+                                                                                       "m_label":      "ID:",
+                                                                                       "m_winid":      "wxID_ANY"
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Size:",
+                                                                                       "m_value":      "-1,-1"
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Minimum Size:",
+                                                                                       "m_value":      "-1,-1"
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Name:",
+                                                                                       "m_value":      "m_panelMemMap"
+                                                                               }, {
+                                                                                       "type": "multi-string",
+                                                                                       "m_label":      "Tooltip:",
+                                                                                       "m_value":      "Memory Mapped control"
+                                                                               }, {
+                                                                                       "type": "colour",
+                                                                                       "m_label":      "Bg Colour:",
+                                                                                       "colour":       "ButtonHighlight"
+                                                                               }, {
+                                                                                       "type": "colour",
+                                                                                       "m_label":      "Fg Colour:",
+                                                                                       "colour":       "<Default>"
+                                                                               }, {
+                                                                                       "type": "font",
+                                                                                       "m_label":      "Font:",
+                                                                                       "m_value":      ""
+                                                                               }, {
+                                                                                       "type": "bool",
+                                                                                       "m_label":      "Hidden",
+                                                                                       "m_value":      false
+                                                                               }, {
+                                                                                       "type": "bool",
+                                                                                       "m_label":      "Disabled",
+                                                                                       "m_value":      false
+                                                                               }, {
+                                                                                       "type": "bool",
+                                                                                       "m_label":      "Focused",
+                                                                                       "m_value":      false
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Class Name:",
+                                                                                       "m_value":      ""
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Include File:",
+                                                                                       "m_value":      ""
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Label:",
+                                                                                       "m_value":      "MemMap"
+                                                                               }, {
+                                                                                       "type": "filePicker",
+                                                                                       "m_label":      "Bitmap File:",
+                                                                                       "m_path":       ""
+                                                                               }, {
+                                                                                       "type": "bool",
+                                                                                       "m_label":      "Selected",
+                                                                                       "m_value":      false
+                                                                               }],
+                                                                       "m_events":     [],
+                                                                       "m_children":   [{
+                                                                                       "m_type":       4449,
+                                                                                       "proportion":   1,
+                                                                                       "border":       5,
+                                                                                       "gbSpan":       "1,1",
+                                                                                       "gbPosition":   "0,0",
+                                                                                       "m_styles":     [],
+                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
+                                                                                       "m_properties": [{
+                                                                                                       "type": "string",
+                                                                                                       "m_label":      "Name:",
+                                                                                                       "m_value":      "staticBoxSizer294"
+                                                                                               }, {
+                                                                                                       "type": "choice",
+                                                                                                       "m_label":      "Orientation:",
+                                                                                                       "m_selection":  0,
+                                                                                                       "m_options":    ["Vertical", "Horizontal"]
+                                                                                               }, {
+                                                                                                       "type": "string",
+                                                                                                       "m_label":      "Label:",
+                                                                                                       "m_value":      ""
+                                                                                               }],
+                                                                                       "m_events":     [],
+                                                                                       "m_children":   [{
+                                                                                                       "m_type":       4452,
+                                                                                                       "proportion":   1,
+                                                                                                       "border":       2,
+                                                                                                       "gbSpan":       "1,1",
+                                                                                                       "gbPosition":   "0,0",
+                                                                                                       "m_styles":     [],
+                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_HORIZONTAL", "wxALIGN_CENTER_VERTICAL"],
+                                                                                                       "m_properties": [{
+                                                                                                                       "type": "string",
+                                                                                                                       "m_label":      "Name:",
+                                                                                                                       "m_value":      "gridSizer420"
+                                                                                                               }, {
+                                                                                                                       "type": "string",
+                                                                                                                       "m_label":      "# Columns:",
+                                                                                                                       "m_value":      "1"
+                                                                                                               }, {
+                                                                                                                       "type": "string",
+                                                                                                                       "m_label":      "# Rows:",
+                                                                                                                       "m_value":      "2"
+                                                                                                               }, {
+                                                                                                                       "type": "string",
+                                                                                                                       "m_label":      "Horizontal gap:",
+                                                                                                                       "m_value":      "0"
+                                                                                                               }, {
+                                                                                                                       "type": "string",
+                                                                                                                       "m_label":      "Vertical gap:",
+                                                                                                                       "m_value":      "0"
+                                                                                                               }],
+                                                                                                       "m_events":     [],
+                                                                                                       "m_children":   [{
+                                                                                                                       "m_type":       4449,
+                                                                                                                       "proportion":   1,
+                                                                                                                       "border":       5,
+                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                       "m_styles":     [],
+                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND", "wxALIGN_CENTER_HORIZONTAL", "wxALIGN_CENTER_VERTICAL"],
+                                                                                                                       "m_properties": [{
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                       "m_value":      "staticBoxSizer424"
+                                                                                                                               }, {
+                                                                                                                                       "type": "choice",
+                                                                                                                                       "m_label":      "Orientation:",
+                                                                                                                                       "m_selection":  0,
+                                                                                                                                       "m_options":    ["Vertical", "Horizontal"]
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }],
+                                                                                                                       "m_events":     [],
+                                                                                                                       "m_children":   [{
+                                                                                                                                       "m_type":       4405,
+                                                                                                                                       "proportion":   1,
+                                                                                                                                       "border":       5,
+                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                       "m_styles":     ["wxALIGN_CENTRE"],
+                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND", "wxALIGN_CENTER_HORIZONTAL", "wxALIGN_CENTER_VERTICAL"],
+                                                                                                                                       "m_properties": [{
+                                                                                                                                                       "type": "winid",
+                                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                       "m_value":      "m_staticText422"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                                       "colour":       "ButtonFace"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "font",
+                                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                                       "m_value":      "\\nControl via Memory Mapped Shared Variables, i. e. Kachina \\n"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Wrap:",
+                                                                                                                                                       "m_value":      "-1"
+                                                                                                                                               }],
+                                                                                                                                       "m_events":     [],
+                                                                                                                                       "m_children":   []
+                                                                                                                               }]
+                                                                                                               }, {
+                                                                                                                       "m_type":       4401,
+                                                                                                                       "proportion":   0,
+                                                                                                                       "border":       5,
+                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                       "m_styles":     [],
+                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_HORIZONTAL"],
+                                                                                                                       "m_properties": [{
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                       "m_value":      "boxSizer4456"
+                                                                                                                               }, {
+                                                                                                                                       "type": "choice",
+                                                                                                                                       "m_label":      "Orientation:",
+                                                                                                                                       "m_selection":  0,
+                                                                                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
+                                                                                                                               }],
+                                                                                                                       "m_events":     [],
+                                                                                                                       "m_children":   [{
+                                                                                                                                       "m_type":       4415,
+                                                                                                                                       "proportion":   0,
+                                                                                                                                       "border":       5,
+                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                       "m_styles":     [],
+                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_HORIZONTAL", "wxALIGN_CENTER_VERTICAL"],
+                                                                                                                                       "m_properties": [{
+                                                                                                                                                       "type": "winid",
+                                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                       "m_value":      "m_checkBox4377"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "font",
+                                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                                       "m_value":      "Use Memorymap"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Value:",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }],
+                                                                                                                                       "m_events":     [],
+                                                                                                                                       "m_children":   []
+                                                                                                                               }, {
+                                                                                                                                       "m_type":       4415,
+                                                                                                                                       "proportion":   0,
+                                                                                                                                       "border":       5,
+                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                       "m_styles":     [],
+                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_HORIZONTAL", "wxALIGN_BOTTOM"],
+                                                                                                                                       "m_properties": [{
+                                                                                                                                                       "type": "winid",
+                                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                       "m_value":      "m_checkBox4398"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "font",
+                                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                                       "m_value":      "Use Memmap PTT"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Value:",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }],
+                                                                                                                                       "m_events":     [],
+                                                                                                                                       "m_children":   []
+                                                                                                                               }, {
+                                                                                                                                       "m_type":       4400,
+                                                                                                                                       "proportion":   0,
+                                                                                                                                       "border":       5,
+                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                       "m_styles":     [],
+                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_HORIZONTAL", "wxALIGN_CENTER_VERTICAL"],
+                                                                                                                                       "m_properties": [{
+                                                                                                                                                       "type": "winid",
+                                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                       "m_value":      "m_button4419"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "font",
+                                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                                       "m_value":      "Initialize"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Default Button",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "filePicker",
+                                                                                                                                                       "m_label":      "Bitmap File:",
+                                                                                                                                                       "m_path":       ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Margins:",
+                                                                                                                                                       "m_value":      "2,2"
+                                                                                                                                               }],
+                                                                                                                                       "m_events":     [],
+                                                                                                                                       "m_children":   []
+                                                                                                                               }]
+                                                                                                               }]
+                                                                                               }]
+                                                                               }]
+                                                               }, {
+                                                                       "m_type":       4441,
+                                                                       "proportion":   0,
+                                                                       "border":       5,
+                                                                       "gbSpan":       "1,1",
+                                                                       "gbPosition":   "0,0",
+                                                                       "m_styles":     ["wxTAB_TRAVERSAL"],
+                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                                                       "m_properties": [{
+                                                                                       "type": "winid",
+                                                                                       "m_label":      "ID:",
+                                                                                       "m_winid":      "wxID_ANY"
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Size:",
+                                                                                       "m_value":      "-1,-1"
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Minimum Size:",
+                                                                                       "m_value":      "-1,-1"
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Name:",
+                                                                                       "m_value":      "m_panelXMLRPC"
+                                                                               }, {
+                                                                                       "type": "multi-string",
+                                                                                       "m_label":      "Tooltip:",
+                                                                                       "m_value":      "XML-RPC control"
+                                                                               }, {
+                                                                                       "type": "colour",
+                                                                                       "m_label":      "Bg Colour:",
+                                                                                       "colour":       "<Default>"
+                                                                               }, {
+                                                                                       "type": "colour",
+                                                                                       "m_label":      "Fg Colour:",
+                                                                                       "colour":       "<Default>"
+                                                                               }, {
+                                                                                       "type": "font",
+                                                                                       "m_label":      "Font:",
+                                                                                       "m_value":      ""
+                                                                               }, {
+                                                                                       "type": "bool",
+                                                                                       "m_label":      "Hidden",
+                                                                                       "m_value":      false
+                                                                               }, {
+                                                                                       "type": "bool",
+                                                                                       "m_label":      "Disabled",
+                                                                                       "m_value":      false
+                                                                               }, {
+                                                                                       "type": "bool",
+                                                                                       "m_label":      "Focused",
+                                                                                       "m_value":      false
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Class Name:",
+                                                                                       "m_value":      ""
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Include File:",
+                                                                                       "m_value":      ""
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Label:",
+                                                                                       "m_value":      "XML-RPC"
+                                                                               }, {
+                                                                                       "type": "filePicker",
+                                                                                       "m_label":      "Bitmap File:",
+                                                                                       "m_path":       ""
+                                                                               }, {
+                                                                                       "type": "bool",
+                                                                                       "m_label":      "Selected",
+                                                                                       "m_value":      false
+                                                                               }],
+                                                                       "m_events":     [],
+                                                                       "m_children":   [{
+                                                                                       "m_type":       4449,
+                                                                                       "proportion":   1,
+                                                                                       "border":       5,
+                                                                                       "gbSpan":       "1,1",
+                                                                                       "gbPosition":   "0,0",
+                                                                                       "m_styles":     [],
+                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
+                                                                                       "m_properties": [{
+                                                                                                       "type": "string",
+                                                                                                       "m_label":      "Name:",
+                                                                                                       "m_value":      "staticBoxSizer85"
+                                                                                               }, {
+                                                                                                       "type": "choice",
+                                                                                                       "m_label":      "Orientation:",
+                                                                                                       "m_selection":  0,
+                                                                                                       "m_options":    ["Vertical", "Horizontal"]
+                                                                                               }, {
+                                                                                                       "type": "string",
+                                                                                                       "m_label":      "Label:",
+                                                                                                       "m_value":      ""
+                                                                                               }],
+                                                                                       "m_events":     [],
+                                                                                       "m_children":   [{
+                                                                                                       "m_type":       4452,
+                                                                                                       "proportion":   1,
+                                                                                                       "border":       2,
+                                                                                                       "gbSpan":       "1,1",
+                                                                                                       "gbPosition":   "0,0",
+                                                                                                       "m_styles":     [],
+                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_HORIZONTAL", "wxALIGN_CENTER_VERTICAL"],
+                                                                                                       "m_properties": [{
+                                                                                                                       "type": "string",
+                                                                                                                       "m_label":      "Name:",
+                                                                                                                       "m_value":      "gridSizer4203"
+                                                                                                               }, {
+                                                                                                                       "type": "string",
+                                                                                                                       "m_label":      "# Columns:",
+                                                                                                                       "m_value":      "1"
+                                                                                                               }, {
+                                                                                                                       "type": "string",
+                                                                                                                       "m_label":      "# Rows:",
+                                                                                                                       "m_value":      "2"
+                                                                                                               }, {
+                                                                                                                       "type": "string",
+                                                                                                                       "m_label":      "Horizontal gap:",
+                                                                                                                       "m_value":      "0"
+                                                                                                               }, {
+                                                                                                                       "type": "string",
+                                                                                                                       "m_label":      "Vertical gap:",
+                                                                                                                       "m_value":      "0"
+                                                                                                               }],
+                                                                                                       "m_events":     [],
+                                                                                                       "m_children":   [{
+                                                                                                                       "m_type":       4449,
+                                                                                                                       "proportion":   1,
+                                                                                                                       "border":       5,
+                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                       "m_styles":     [],
+                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND", "wxALIGN_CENTER_HORIZONTAL", "wxALIGN_CENTER_VERTICAL"],
+                                                                                                                       "m_properties": [{
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                       "m_value":      "staticBoxSizer4244"
+                                                                                                                               }, {
+                                                                                                                                       "type": "choice",
+                                                                                                                                       "m_label":      "Orientation:",
+                                                                                                                                       "m_selection":  0,
+                                                                                                                                       "m_options":    ["Vertical", "Horizontal"]
+                                                                                                                               }, {
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                       "m_value":      ""
+                                                                                                                               }],
+                                                                                                                       "m_events":     [],
+                                                                                                                       "m_children":   [{
+                                                                                                                                       "m_type":       4405,
+                                                                                                                                       "proportion":   1,
+                                                                                                                                       "border":       5,
+                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                       "m_styles":     ["wxALIGN_CENTRE"],
+                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND", "wxALIGN_CENTER_HORIZONTAL", "wxALIGN_CENTER_VERTICAL"],
+                                                                                                                                       "m_properties": [{
+                                                                                                                                                       "type": "winid",
+                                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                       "m_value":      "m_staticText42210"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                                       "colour":       "ButtonFace"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "font",
+                                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                                       "m_value":      "\\nRig control via external program using XML RPC Remote Calls\\n"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Wrap:",
+                                                                                                                                                       "m_value":      "-1"
+                                                                                                                                               }],
+                                                                                                                                       "m_events":     [],
+                                                                                                                                       "m_children":   []
+                                                                                                                               }]
+                                                                                                               }, {
+                                                                                                                       "m_type":       4401,
+                                                                                                                       "proportion":   0,
+                                                                                                                       "border":       5,
+                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                       "m_styles":     [],
+                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_HORIZONTAL"],
+                                                                                                                       "m_properties": [{
+                                                                                                                                       "type": "string",
+                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                       "m_value":      "boxSizer445"
+                                                                                                                               }, {
+                                                                                                                                       "type": "choice",
+                                                                                                                                       "m_label":      "Orientation:",
+                                                                                                                                       "m_selection":  0,
+                                                                                                                                       "m_options":    ["wxVERTICAL", "wxHORIZONTAL"]
+                                                                                                                               }],
+                                                                                                                       "m_events":     [],
+                                                                                                                       "m_children":   [{
+                                                                                                                                       "m_type":       4415,
+                                                                                                                                       "proportion":   0,
+                                                                                                                                       "border":       5,
+                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                       "m_styles":     [],
+                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_HORIZONTAL", "wxALIGN_CENTER_VERTICAL"],
+                                                                                                                                       "m_properties": [{
+                                                                                                                                                       "type": "winid",
+                                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                       "m_value":      "m_checkBox437"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "font",
+                                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                                       "m_value":      "Use XML-RPC"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Value:",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }],
+                                                                                                                                       "m_events":     [],
+                                                                                                                                       "m_children":   []
+                                                                                                                               }, {
+                                                                                                                                       "m_type":       4400,
+                                                                                                                                       "proportion":   0,
+                                                                                                                                       "border":       5,
+                                                                                                                                       "gbSpan":       "1,1",
+                                                                                                                                       "gbPosition":   "0,0",
+                                                                                                                                       "m_styles":     [],
+                                                                                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_HORIZONTAL", "wxALIGN_CENTER_VERTICAL"],
+                                                                                                                                       "m_properties": [{
+                                                                                                                                                       "type": "winid",
+                                                                                                                                                       "m_label":      "ID:",
+                                                                                                                                                       "m_winid":      "wxID_ANY"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Minimum Size:",
+                                                                                                                                                       "m_value":      "-1,-1"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Name:",
+                                                                                                                                                       "m_value":      "m_button441"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "multi-string",
+                                                                                                                                                       "m_label":      "Tooltip:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Bg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "colour",
+                                                                                                                                                       "m_label":      "Fg Colour:",
+                                                                                                                                                       "colour":       "<Default>"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "font",
+                                                                                                                                                       "m_label":      "Font:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Hidden",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Disabled",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Focused",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Class Name:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Include File:",
+                                                                                                                                                       "m_value":      ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Label:",
+                                                                                                                                                       "m_value":      "Initialize"
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "bool",
+                                                                                                                                                       "m_label":      "Default Button",
+                                                                                                                                                       "m_value":      false
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "filePicker",
+                                                                                                                                                       "m_label":      "Bitmap File:",
+                                                                                                                                                       "m_path":       ""
+                                                                                                                                               }, {
+                                                                                                                                                       "type": "string",
+                                                                                                                                                       "m_label":      "Margins:",
+                                                                                                                                                       "m_value":      "2,2"
+                                                                                                                                               }],
+                                                                                                                                       "m_events":     [],
+                                                                                                                                       "m_children":   []
+                                                                                                                               }]
+                                                                                                               }]
+                                                                                               }]
+                                                                               }]
+                                                               }]
+                                               }, {
+                                                       "m_type":       4467,
+                                                       "proportion":   0,
+                                                       "border":       2,
+                                                       "gbSpan":       "1,1",
+                                                       "gbPosition":   "0,0",
+                                                       "m_styles":     [],
+                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_RIGHT", "wxALIGN_BOTTOM"],
+                                                       "m_properties": [{
+                                                                       "type": "winid",
+                                                                       "m_label":      "ID:",
+                                                                       "m_winid":      "wxID_ANY"
+                                                               }, {
+                                                                       "type": "string",
+                                                                       "m_label":      "Size:",
+                                                                       "m_value":      "-1,-1"
+                                                               }, {
+                                                                       "type": "string",
+                                                                       "m_label":      "Minimum Size:",
+                                                                       "m_value":      "-1,-1"
+                                                               }, {
+                                                                       "type": "string",
+                                                                       "m_label":      "Name:",
+                                                                       "m_value":      "m_stdBtnSizer155"
+                                                               }, {
+                                                                       "type": "multi-string",
+                                                                       "m_label":      "Tooltip:",
+                                                                       "m_value":      ""
+                                                               }, {
+                                                                       "type": "colour",
+                                                                       "m_label":      "Bg Colour:",
+                                                                       "colour":       "<Default>"
+                                                               }, {
+                                                                       "type": "colour",
+                                                                       "m_label":      "Fg Colour:",
+                                                                       "colour":       "<Default>"
+                                                               }, {
+                                                                       "type": "font",
+                                                                       "m_label":      "Font:",
+                                                                       "m_value":      ""
+                                                               }, {
+                                                                       "type": "bool",
+                                                                       "m_label":      "Hidden",
+                                                                       "m_value":      false
+                                                               }, {
+                                                                       "type": "bool",
+                                                                       "m_label":      "Disabled",
+                                                                       "m_value":      false
+                                                               }, {
+                                                                       "type": "bool",
+                                                                       "m_label":      "Focused",
+                                                                       "m_value":      false
+                                                               }, {
+                                                                       "type": "string",
+                                                                       "m_label":      "Class Name:",
+                                                                       "m_value":      ""
+                                                               }, {
+                                                                       "type": "string",
+                                                                       "m_label":      "Include File:",
+                                                                       "m_value":      ""
+                                                               }],
+                                                       "m_events":     [],
+                                                       "m_children":   [{
+                                                                       "m_type":       4468,
+                                                                       "proportion":   0,
+                                                                       "border":       5,
+                                                                       "gbSpan":       "1,1",
+                                                                       "gbPosition":   "0,0",
+                                                                       "m_styles":     [],
+                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                                                       "m_properties": [{
+                                                                                       "type": "choice",
+                                                                                       "m_label":      "ID:",
+                                                                                       "m_selection":  3,
+                                                                                       "m_options":    ["wxID_OK", "wxID_YES", "wxID_SAVE", "wxID_APPLY", "wxID_CLOSE", "wxID_NO", "wxID_CANCEL", "wxID_HELP", "wxID_CONTEXT_HELP"]
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Name:",
+                                                                                       "m_value":      "m_button165"
+                                                                               }, {
+                                                                                       "type": "multi-string",
+                                                                                       "m_label":      "Tooltip:",
+                                                                                       "m_value":      ""
+                                                                               }, {
+                                                                                       "type": "bool",
+                                                                                       "m_label":      "Default Button",
+                                                                                       "m_value":      false
+                                                                               }],
+                                                                       "m_events":     [],
+                                                                       "m_children":   []
+                                                               }, {
+                                                                       "m_type":       4468,
+                                                                       "proportion":   0,
+                                                                       "border":       5,
+                                                                       "gbSpan":       "1,1",
+                                                                       "gbPosition":   "0,0",
+                                                                       "m_styles":     [],
+                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                                                       "m_properties": [{
+                                                                                       "type": "choice",
+                                                                                       "m_label":      "ID:",
+                                                                                       "m_selection":  0,
+                                                                                       "m_options":    ["wxID_OK", "wxID_YES", "wxID_SAVE", "wxID_APPLY", "wxID_CLOSE", "wxID_NO", "wxID_CANCEL", "wxID_HELP", "wxID_CONTEXT_HELP"]
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Name:",
+                                                                                       "m_value":      "m_button167"
+                                                                               }, {
+                                                                                       "type": "multi-string",
+                                                                                       "m_label":      "Tooltip:",
+                                                                                       "m_value":      ""
+                                                                               }, {
+                                                                                       "type": "bool",
+                                                                                       "m_label":      "Default Button",
+                                                                                       "m_value":      true
+                                                                               }],
+                                                                       "m_events":     [],
+                                                                       "m_children":   []
+                                                               }, {
+                                                                       "m_type":       4468,
+                                                                       "proportion":   0,
+                                                                       "border":       5,
+                                                                       "gbSpan":       "1,1",
+                                                                       "gbPosition":   "0,0",
+                                                                       "m_styles":     [],
+                                                                       "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
+                                                                       "m_properties": [{
+                                                                                       "type": "choice",
+                                                                                       "m_label":      "ID:",
+                                                                                       "m_selection":  6,
+                                                                                       "m_options":    ["wxID_OK", "wxID_YES", "wxID_SAVE", "wxID_APPLY", "wxID_CLOSE", "wxID_NO", "wxID_CANCEL", "wxID_HELP", "wxID_CONTEXT_HELP"]
+                                                                               }, {
+                                                                                       "type": "string",
+                                                                                       "m_label":      "Name:",
+                                                                                       "m_value":      "m_button366"
+                                                                               }, {
+                                                                                       "type": "multi-string",
+                                                                                       "m_label":      "Tooltip:",
+                                                                                       "m_value":      ""
+                                                                               }, {
+                                                                                       "type": "bool",
+                                                                                       "m_label":      "Default Button",
+                                                                                       "m_value":      false
+                                                                               }],
+                                                                       "m_events":     [],
+                                                                       "m_children":   []
+                                                               }]
+                                               }]
+                               }]
+               }]
+}
\ No newline at end of file
diff --git a/freedv/branches/0.97/build/codelite/hamlib_trial/wxcrafter.xrc b/freedv/branches/0.97/build/codelite/hamlib_trial/wxcrafter.xrc
new file mode 100644 (file)
index 0000000..4c562ab
--- /dev/null
@@ -0,0 +1,1326 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<resource xmlns="http://www.wxwindows.org/wxxrc" version="2.3.0.1">
+  <object class="wxFrame" name="MainFrameBaseClass">
+    <title>topFrame</title>
+    <centered>1</centered>
+    <style>wxCAPTION|wxRESIZE_BORDER|wxMAXIMIZE_BOX|wxMINIMIZE_BOX|wxSYSTEM_MENU|wxCLOSE_BOX</style>
+    <size>500,300</size>
+    <object class="wxBoxSizer">
+      <orient>wxVERTICAL</orient>
+      <object class="sizeritem">
+        <flag>wxEXPAND</flag>
+        <border>5</border>
+        <option>1</option>
+        <object class="wxPanel" name="m_mainPanel">
+          <style>wxTAB_TRAVERSAL</style>
+          <object class="wxBoxSizer">
+            <orient>wxVERTICAL</orient>
+          </object>
+        </object>
+      </object>
+    </object>
+    <object class="wxMenuBar" name="m_menuBar">
+      <style/>
+      <object class="wxMenu" name="m_mbFile">
+        <label>File</label>
+        <style/>
+        <object class="wxMenuItem" name="m_mbiNew">
+          <label>New</label>
+          <accel/>
+        </object>
+        <object class="wxMenuItem" name="m_mbiOpen">
+          <label>Open</label>
+          <accel/>
+        </object>
+        <object class="wxMenuItem" name="m_mbiSave">
+          <label>Save</label>
+          <accel/>
+        </object>
+        <object class="wxMenuItem" name="m_mbiSaveAs">
+          <label>Save As</label>
+          <accel/>
+        </object>
+        <object class="separator"/>
+        <object class="wxMenuItem" name="m_mbiExit">
+          <label>Exit</label>
+          <accel>Alt-X</accel>
+        </object>
+      </object>
+      <object class="wxMenu" name="m_mbTools">
+        <label>Tools</label>
+        <style/>
+        <object class="wxMenuItem" name="m_mbiPrefs">
+          <label>Preferences</label>
+          <accel/>
+        </object>
+      </object>
+      <object class="wxMenu" name="m_mbHelp">
+        <label>Help</label>
+        <style/>
+        <object class="wxMenuItem" name="m_menuItem9">
+          <label>About...</label>
+          <accel/>
+        </object>
+      </object>
+    </object>
+    <object class="wxToolBar" name="m_mainToolbar">
+      <style>wxTB_FLAT</style>
+      <bitmapsize>16,16</bitmapsize>
+      <object class="tool" name="m_tbiNew">
+        <label>New</label>
+        <tooltip>New</tooltip>
+        <longhelp>New</longhelp>
+        <bitmap>C:/Users/wittend/AppData/Local/Temp/placeholder16.png</bitmap>
+      </object>
+      <object class="tool" name="m_rbiOpen">
+        <label>Tool Label</label>
+        <tooltip>Open</tooltip>
+        <longhelp>Open</longhelp>
+        <bitmap>C:/Users/wittend/AppData/Local/Temp/placeholder16.png</bitmap>
+      </object>
+    </object>
+  </object>
+  <object class="wxDialog" name="DlgRigCtrlBase">
+    <title>Rig Control</title>
+    <centered>1</centered>
+    <style>wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxCLOSE_BOX</style>
+    <size>460,315</size>
+    <object class="wxBoxSizer">
+      <orient>wxVERTICAL</orient>
+      <object class="sizeritem">
+        <flag>wxALL|wxEXPAND</flag>
+        <border>2</border>
+        <option>1</option>
+        <object class="wxNotebook" name="m_notebook53">
+          <style>wxBK_DEFAULT</style>
+          <object class="notebookpage">
+            <label>Hardware PTT</label>
+            <selected>1</selected>
+            <object class="wxPanel" name="m_panelHDWPTT">
+              <style>wxTAB_TRAVERSAL</style>
+              <tooltip>Hardware Push-to-Talk</tooltip>
+              <object class="wxFlexGridSizer">
+                <cols>1</cols>
+                <rows>3</rows>
+                <vgap>0</vgap>
+                <hgap>0</hgap>
+                <growablecols>1</growablecols>
+                <growablerows>3</growablerows>
+                <object class="sizeritem" name="staticBoxSizer169">
+                  <flag>wxALL|wxEXPAND</flag>
+                  <border>2</border>
+                  <object class="wxStaticBoxSizer" name="staticBoxSizer169">
+                    <sizeritem>
+                      <object class="spacer"/>
+                    </sizeritem>
+                    <orient>wxVERTICAL</orient>
+                    <label/>
+                    <object class="sizeritem">
+                      <flag>wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL</flag>
+                      <border>2</border>
+                      <option>1</option>
+                      <object class="wxCheckBox" name="m_checkBox7537">
+                        <style/>
+                        <label>PTT tone on right audio channel</label>
+                        <checked>0</checked>
+                      </object>
+                    </object>
+                  </object>
+                </object>
+                <object class="sizeritem" name="gridSizer159">
+                  <flag>wxALL|wxALIGN_LEFT|wxALIGN_TOP</flag>
+                  <border>2</border>
+                  <object class="wxGridSizer">
+                    <cols>1</cols>
+                    <rows>1</rows>
+                    <vgap>0</vgap>
+                    <hgap>0</hgap>
+                    <object class="sizeritem" name="staticBoxSizer157">
+                      <flag>wxALL|wxEXPAND|wxALIGN_TOP</flag>
+                      <border>2</border>
+                      <object class="wxStaticBoxSizer" name="staticBoxSizer157">
+                        <sizeritem>
+                          <object class="spacer"/>
+                        </sizeritem>
+                        <orient>wxHORIZONTAL</orient>
+                        <label>h/w ptt device pin</label>
+                        <object class="sizeritem" name="boxSizer175">
+                          <flag>wxALL</flag>
+                          <border>2</border>
+                          <option>1</option>
+                          <object class="wxBoxSizer">
+                            <orient>wxVERTICAL</orient>
+                            <object class="sizeritem">
+                              <flag>wxALL|wxALIGN_TOP</flag>
+                              <border>2</border>
+                              <object class="wxCheckBox" name="m_checkBox9112">
+                                <style/>
+                                <label>Use separate PTT device pin</label>
+                                <checked>0</checked>
+                              </object>
+                            </object>
+                            <object class="sizeritem">
+                              <flag>wxALL</flag>
+                              <border>5</border>
+                              <object class="wxStaticText" name="m_staticText173">
+                                <label>Device:</label>
+                                <style/>
+                              </object>
+                            </object>
+                            <object class="sizeritem">
+                              <flag>wxALL</flag>
+                              <border>2</border>
+                              <object class="wxComboBox" name="m_comboBox9313">
+                                <style/>
+                                <selection>-1</selection>
+                                <content/>
+                              </object>
+                            </object>
+                          </object>
+                        </object>
+                        <object class="sizeritem" name="boxSizer171">
+                          <flag>wxALL</flag>
+                          <border>2</border>
+                          <option>1</option>
+                          <object class="wxBoxSizer">
+                            <orient>wxHORIZONTAL</orient>
+                            <object class="sizeritem" name="boxSizer12714">
+                              <flag>wxALL|wxALIGN_CENTER_HORIZONTAL</flag>
+                              <border>2</border>
+                              <option>1</option>
+                              <object class="wxBoxSizer">
+                                <orient>wxVERTICAL</orient>
+                                <object class="sizeritem">
+                                  <flag>wxALL|wxALIGN_CENTER_HORIZONTAL</flag>
+                                  <border>2</border>
+                                  <option>1</option>
+                                  <object class="wxRadioBox" name="m_radioBox10115">
+                                    <label>Use RTS</label>
+                                    <style>wxRA_SPECIFY_COLS</style>
+                                    <dimension>2</dimension>
+                                    <selection>0</selection>
+                                    <content>
+                                      <item>Normal (V-)</item>
+                                      <item>Inverted (V+)</item>
+                                    </content>
+                                  </object>
+                                </object>
+                                <object class="sizeritem">
+                                  <flag>wxALL|wxALIGN_CENTER_HORIZONTAL</flag>
+                                  <border>2</border>
+                                  <option>1</option>
+                                  <object class="wxRadioBox" name="m_radioBox10316">
+                                    <label>Use DTR</label>
+                                    <style>wxRA_SPECIFY_COLS</style>
+                                    <dimension>2</dimension>
+                                    <selection>0</selection>
+                                    <content>
+                                      <item>Normal (V-)</item>
+                                      <item>Inverted (V+)</item>
+                                    </content>
+                                  </object>
+                                </object>
+                                <object class="sizeritem" name="boxSizer13118">
+                                  <flag>wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
+                                  <border>2</border>
+                                  <object class="wxBoxSizer">
+                                    <orient>wxHORIZONTAL</orient>
+                                    <object class="sizeritem">
+                                      <flag>wxALL</flag>
+                                      <border>2</border>
+                                      <option>1</option>
+                                      <object class="wxButton" name="m_button11319">
+                                        <label>Initialize</label>
+                                        <style/>
+                                        <default>0</default>
+                                      </object>
+                                    </object>
+                                  </object>
+                                </object>
+                              </object>
+                            </object>
+                          </object>
+                        </object>
+                      </object>
+                    </object>
+                  </object>
+                </object>
+                <object class="sizeritem" name="staticBoxSizer79420">
+                  <flag>wxALL|wxEXPAND|wxALIGN_LEFT</flag>
+                  <border>2</border>
+                  <object class="wxStaticBoxSizer" name="staticBoxSizer79420">
+                    <sizeritem>
+                      <object class="spacer"/>
+                    </sizeritem>
+                    <orient>wxHORIZONTAL</orient>
+                    <label>PTT delay for all CAT/PTT types</label>
+                    <object class="sizeritem">
+                      <flag>wxALL|wxALIGN_CENTER_VERTICAL</flag>
+                      <border>2</border>
+                      <object class="wxStaticText" name="m_staticText177">
+                        <label>Start of xmit delay</label>
+                        <style/>
+                      </object>
+                    </object>
+                    <object class="sizeritem">
+                      <flag>wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
+                      <border>2</border>
+                      <option>1</option>
+                      <object class="wxSlider" name="m_slider10721">
+                        <style>wxSL_HORIZONTAL</style>
+                        <min>0</min>
+                        <max>100</max>
+                        <value>50</value>
+                      </object>
+                    </object>
+                    <object class="sizeritem">
+                      <flag>wxALL|wxALIGN_CENTER_VERTICAL</flag>
+                      <border>2</border>
+                      <object class="wxStaticText" name="m_staticText179">
+                        <label>End of xmit delay:</label>
+                        <style/>
+                      </object>
+                    </object>
+                    <object class="sizeritem">
+                      <flag>wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
+                      <border>2</border>
+                      <object class="wxSlider" name="m_slider10922">
+                        <style>wxSL_HORIZONTAL</style>
+                        <min>0</min>
+                        <max>100</max>
+                        <value>50</value>
+                      </object>
+                    </object>
+                  </object>
+                </object>
+              </object>
+            </object>
+          </object>
+          <object class="notebookpage">
+            <label>RigCAT</label>
+            <selected>0</selected>
+            <object class="wxPanel" name="m_panelRIGCat">
+              <style>wxTAB_TRAVERSAL</style>
+              <tooltip>RigCat</tooltip>
+              <object class="wxBoxSizer">
+                <orient>wxVERTICAL</orient>
+                <object class="sizeritem">
+                  <flag>wxALL|wxALIGN_CENTER_HORIZONTAL</flag>
+                  <border>2</border>
+                  <object class="wxRadioButton" name="m_radioButton185">
+                    <style/>
+                    <label>Use RigCAT</label>
+                    <value>1</value>
+                  </object>
+                </object>
+                <object class="sizeritem" name="staticBoxSizer183">
+                  <flag>wxALL|wxEXPAND|wxALIGN_TOP</flag>
+                  <border>2</border>
+                  <option>1</option>
+                  <object class="wxStaticBoxSizer" name="staticBoxSizer183">
+                    <sizeritem>
+                      <object class="spacer"/>
+                    </sizeritem>
+                    <orient>wxVERTICAL</orient>
+                    <label/>
+                    <object class="sizeritem" name="flexGridSizer187">
+                      <flag>wxALL</flag>
+                      <border>2</border>
+                      <object class="wxFlexGridSizer">
+                        <cols>1</cols>
+                        <rows>1</rows>
+                        <vgap>0</vgap>
+                        <hgap>0</hgap>
+                        <growablecols>1</growablecols>
+                        <growablerows>1</growablerows>
+                        <object class="sizeritem" name="flexGridSizer204">
+                          <flag>wxALL|wxEXPAND</flag>
+                          <border>2</border>
+                          <option>1</option>
+                          <object class="wxFlexGridSizer">
+                            <cols>4</cols>
+                            <rows>3</rows>
+                            <vgap>0</vgap>
+                            <hgap>0</hgap>
+                            <growablecols/>
+                            <growablerows/>
+                            <object class="sizeritem" name="boxSizer193">
+                              <flag>wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL</flag>
+                              <border>2</border>
+                              <option>1</option>
+                              <object class="wxBoxSizer">
+                                <orient>wxHORIZONTAL</orient>
+                                <object class="sizeritem">
+                                  <flag>wxALL|wxALIGN_CENTER_VERTICAL</flag>
+                                  <border>2</border>
+                                  <object class="wxStaticText" name="m_staticText189">
+                                    <label>File:</label>
+                                    <style/>
+                                  </object>
+                                </object>
+                                <object class="sizeritem">
+                                  <flag>wxALL|wxALIGN_CENTER_VERTICAL</flag>
+                                  <border>2</border>
+                                  <object class="wxTextCtrl" name="m_textCtrl191">
+                                    <style/>
+                                  </object>
+                                </object>
+                              </object>
+                            </object>
+                            <object class="sizeritem" name="boxSizer206">
+                              <flag>wxALL|wxEXPAND</flag>
+                              <border>5</border>
+                              <option>1</option>
+                              <object class="wxBoxSizer">
+                                <orient>wxVERTICAL</orient>
+                                <object class="sizeritem">
+                                  <flag>wxALL|wxALIGN_CENTER_VERTICAL</flag>
+                                  <border>2</border>
+                                  <object class="wxButton" name="m_button208">
+                                    <label>Open</label>
+                                    <style/>
+                                    <default>0</default>
+                                  </object>
+                                </object>
+                              </object>
+                            </object>
+                            <object class="sizeritem" name="boxSizer19329">
+                              <flag>wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL</flag>
+                              <border>2</border>
+                              <option>1</option>
+                              <object class="wxBoxSizer">
+                                <orient>wxHORIZONTAL</orient>
+                                <object class="sizeritem">
+                                  <flag>wxALL|wxALIGN_CENTER_VERTICAL</flag>
+                                  <border>2</border>
+                                  <object class="wxStaticText" name="m_staticText18930">
+                                    <label>Device:</label>
+                                    <style/>
+                                  </object>
+                                </object>
+                                <object class="sizeritem">
+                                  <flag>wxALL|wxALIGN_CENTER_VERTICAL</flag>
+                                  <border>5</border>
+                                  <object class="wxComboBox" name="m_comboBox218">
+                                    <style/>
+                                    <selection>-1</selection>
+                                    <content/>
+                                  </object>
+                                </object>
+                              </object>
+                            </object>
+                          </object>
+                        </object>
+                      </object>
+                    </object>
+                    <object class="sizeritem" name="flexGridSizer222">
+                      <flag>wxALL</flag>
+                      <border>2</border>
+                      <object class="wxFlexGridSizer">
+                        <cols>3</cols>
+                        <rows>1</rows>
+                        <vgap>0</vgap>
+                        <hgap>0</hgap>
+                        <growablecols>2</growablecols>
+                        <growablerows/>
+                        <object class="sizeritem" name="boxSizer19326">
+                          <flag>wxALL|wxEXPAND</flag>
+                          <border>2</border>
+                          <option>1</option>
+                          <object class="wxBoxSizer">
+                            <orient>wxHORIZONTAL</orient>
+                            <object class="sizeritem">
+                              <flag>wxALL|wxALIGN_CENTER_VERTICAL</flag>
+                              <border>2</border>
+                              <object class="wxStaticText" name="m_staticText18927">
+                                <label>Retries:</label>
+                                <style/>
+                              </object>
+                            </object>
+                            <object class="sizeritem">
+                              <flag>wxALL|wxALIGN_CENTER_VERTICAL</flag>
+                              <border>2</border>
+                              <option>1</option>
+                              <object class="wxTextCtrl" name="m_textCtrl19128">
+                                <style/>
+                              </object>
+                            </object>
+                          </object>
+                        </object>
+                        <object class="sizeritem" name="boxSizer19323">
+                          <flag>wxALL|wxEXPAND</flag>
+                          <border>2</border>
+                          <option>1</option>
+                          <object class="wxBoxSizer">
+                            <orient>wxHORIZONTAL</orient>
+                            <object class="sizeritem">
+                              <flag>wxALL|wxALIGN_CENTER_VERTICAL</flag>
+                              <border>2</border>
+                              <object class="wxStaticText" name="m_staticText18924">
+                                <label>Retry Interval:</label>
+                                <style/>
+                              </object>
+                            </object>
+                            <object class="sizeritem">
+                              <flag>wxALL|wxALIGN_CENTER_VERTICAL</flag>
+                              <border>2</border>
+                              <option>1</option>
+                              <object class="wxTextCtrl" name="m_textCtrl19125">
+                                <style/>
+                              </object>
+                            </object>
+                          </object>
+                        </object>
+                        <object class="sizeritem" name="boxSizer1932954">
+                          <flag>wxALL|wxEXPAND</flag>
+                          <border>2</border>
+                          <option>1</option>
+                          <object class="wxBoxSizer">
+                            <orient>wxHORIZONTAL</orient>
+                            <object class="sizeritem">
+                              <flag>wxALL|wxALIGN_CENTER_VERTICAL</flag>
+                              <border>2</border>
+                              <object class="wxStaticText" name="m_staticText1893055">
+                                <label>Baud Rate:</label>
+                                <style/>
+                              </object>
+                            </object>
+                            <object class="sizeritem">
+                              <flag>wxALL|wxALIGN_CENTER_VERTICAL</flag>
+                              <border>2</border>
+                              <option>1</option>
+                              <object class="wxComboBox" name="m_comboBaud">
+                                <style/>
+                                <selection>-1</selection>
+                                <content>
+                                  <item>300</item>
+                                  <item>600</item>
+                                  <item>1200</item>
+                                  <item>2400</item>
+                                  <item>9600</item>
+                                  <item>19200</item>
+                                  <item>38400</item>
+                                  <item>56800</item>
+                                </content>
+                              </object>
+                            </object>
+                          </object>
+                        </object>
+                      </object>
+                    </object>
+                    <object class="sizeritem" name="flexGridSizer18747">
+                      <flag>wxALL|wxEXPAND</flag>
+                      <border>2</border>
+                      <object class="wxFlexGridSizer">
+                        <cols>1</cols>
+                        <rows>1</rows>
+                        <vgap>0</vgap>
+                        <hgap>0</hgap>
+                        <growablecols>1</growablecols>
+                        <growablerows/>
+                        <object class="sizeritem" name="flexGridSizer20448">
+                          <flag>wxALL</flag>
+                          <border>2</border>
+                          <option>1</option>
+                          <object class="wxFlexGridSizer">
+                            <cols>3</cols>
+                            <rows>1</rows>
+                            <vgap>0</vgap>
+                            <hgap>0</hgap>
+                            <growablecols>3</growablecols>
+                            <growablerows>1</growablerows>
+                            <object class="sizeritem" name="boxSizer19349">
+                              <flag>wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL</flag>
+                              <border>2</border>
+                              <option>1</option>
+                              <object class="wxBoxSizer">
+                                <orient>wxHORIZONTAL</orient>
+                                <object class="sizeritem">
+                                  <flag>wxALL|wxALIGN_CENTER_VERTICAL</flag>
+                                  <border>2</border>
+                                  <object class="wxStaticText" name="m_staticText18950">
+                                    <label>Write Delay (ms):</label>
+                                    <style/>
+                                  </object>
+                                </object>
+                                <object class="sizeritem">
+                                  <flag>wxALL|wxALIGN_CENTER_VERTICAL</flag>
+                                  <border>2</border>
+                                  <object class="wxTextCtrl" name="m_textCtrl19151">
+                                    <style/>
+                                  </object>
+                                </object>
+                              </object>
+                            </object>
+                            <object class="sizeritem" name="boxSizer298">
+                              <flag>wxALL|wxEXPAND</flag>
+                              <border>2</border>
+                              <option>1</option>
+                              <object class="wxBoxSizer">
+                                <orient>wxHORIZONTAL</orient>
+                                <object class="sizeritem">
+                                  <flag>wxALL</flag>
+                                  <border>2</border>
+                                  <object class="wxStaticText" name="m_staticText298">
+                                    <label>Stop Bits:</label>
+                                    <style/>
+                                  </object>
+                                </object>
+                                <object class="sizeritem">
+                                  <flag>wxALL</flag>
+                                  <border>5</border>
+                                  <object class="wxSlider" name="m_sliderStopBits">
+                                    <style>wxSL_HORIZONTAL</style>
+                                    <min>0</min>
+                                    <max>2</max>
+                                    <value>0</value>
+                                  </object>
+                                </object>
+                              </object>
+                            </object>
+                          </object>
+                        </object>
+                      </object>
+                    </object>
+                    <object class="sizeritem" name="flexGridSizer224">
+                      <flag>wxALL|wxEXPAND</flag>
+                      <border>2</border>
+                      <object class="wxFlexGridSizer">
+                        <cols>4</cols>
+                        <rows>1</rows>
+                        <vgap>0</vgap>
+                        <hgap>0</hgap>
+                        <growablecols>4</growablecols>
+                        <growablerows>1</growablerows>
+                        <object class="spacer" name="Spacer234">
+                          <size>2,2</size>
+                          <flag>wxALL|wxEXPAND</flag>
+                          <border>2</border>
+                          <option>1</option>
+                        </object>
+                        <object class="sizeritem">
+                          <flag>wxALL|wxEXPAND</flag>
+                          <border>1</border>
+                          <object class="wxCheckBox" name="m_cbEcho">
+                            <tooltip>Commands are echoed</tooltip>
+                            <style/>
+                            <label>Commands echoed</label>
+                            <checked>0</checked>
+                          </object>
+                        </object>
+                        <object class="spacer" name="Spacer240">
+                          <size>2,2</size>
+                          <flag>wxALL|wxEXPAND</flag>
+                          <border>2</border>
+                          <option>1</option>
+                        </object>
+                        <object class="sizeritem">
+                          <flag>wxALL|wxEXPAND</flag>
+                          <border>2</border>
+                          <option>1</option>
+                          <object class="wxCheckBox" name="m_cbCATPTT">
+                            <tooltip>Use CAT commands for PTT</tooltip>
+                            <style/>
+                            <label>CAT command for PTT</label>
+                            <checked>0</checked>
+                          </object>
+                        </object>
+                      </object>
+                    </object>
+                    <object class="sizeritem" name="flexGridSizer22432">
+                      <flag>wxALL|wxEXPAND</flag>
+                      <border>2</border>
+                      <object class="wxFlexGridSizer">
+                        <cols>4</cols>
+                        <rows>1</rows>
+                        <vgap>0</vgap>
+                        <hgap>0</hgap>
+                        <growablecols>4</growablecols>
+                        <growablerows>1</growablerows>
+                        <object class="spacer" name="Spacer2402">
+                          <size>2,2</size>
+                          <flag>wxALL|wxEXPAND</flag>
+                          <border>2</border>
+                          <option>1</option>
+                        </object>
+                        <object class="sizeritem">
+                          <flag>wxALL</flag>
+                          <border>2</border>
+                          <option>1</option>
+                          <object class="wxCheckBox" name="m_cbToggleRTSPTT">
+                            <tooltip>Toggle RTS for PTT</tooltip>
+                            <style/>
+                            <label>Toggle RTS for PTT</label>
+                            <checked>0</checked>
+                          </object>
+                        </object>
+                        <object class="spacer" name="Spacer2401">
+                          <size>2,2</size>
+                          <flag>wxALL|wxEXPAND</flag>
+                          <border>2</border>
+                          <option>1</option>
+                        </object>
+                        <object class="sizeritem">
+                          <flag>wxALL</flag>
+                          <border>2</border>
+                          <option>1</option>
+                          <object class="wxCheckBox" name="m_cbToggleDTRPTT">
+                            <tooltip>Toggle DTR for PTT</tooltip>
+                            <style/>
+                            <label>Toggle DTR for PTT</label>
+                            <checked>0</checked>
+                          </object>
+                        </object>
+                      </object>
+                    </object>
+                    <object class="sizeritem" name="flexGridSizer22437">
+                      <flag>wxALL|wxEXPAND</flag>
+                      <border>2</border>
+                      <object class="wxFlexGridSizer">
+                        <cols>4</cols>
+                        <rows>1</rows>
+                        <vgap>0</vgap>
+                        <hgap>0</hgap>
+                        <growablecols>4</growablecols>
+                        <growablerows>1</growablerows>
+                        <object class="spacer" name="Spacer23438">
+                          <size>2,2</size>
+                          <flag>wxALL|wxEXPAND</flag>
+                          <border>2</border>
+                          <option>1</option>
+                        </object>
+                        <object class="sizeritem">
+                          <flag>wxALL|wxEXPAND</flag>
+                          <border>2</border>
+                          <option>1</option>
+                          <object class="wxCheckBox" name="m_cbRTS12VInit">
+                            <tooltip>Initialize state of RTS</tooltip>
+                            <style/>
+                            <label>Initial RTS +12v</label>
+                            <checked>0</checked>
+                          </object>
+                        </object>
+                        <object class="spacer" name="Spacer24040">
+                          <size>2,2</size>
+                          <flag>wxALL|wxEXPAND</flag>
+                          <border>2</border>
+                          <option>1</option>
+                        </object>
+                        <object class="sizeritem">
+                          <flag>wxALL|wxEXPAND</flag>
+                          <border>2</border>
+                          <option>1</option>
+                          <object class="wxCheckBox" name="m_cbDTR12VInit">
+                            <tooltip>Initialize state of DTR</tooltip>
+                            <style/>
+                            <label>Initial DTR +12v</label>
+                            <checked>0</checked>
+                          </object>
+                        </object>
+                      </object>
+                    </object>
+                    <object class="sizeritem" name="flexGridSizer22442">
+                      <flag>wxALL|wxEXPAND</flag>
+                      <border>2</border>
+                      <object class="wxFlexGridSizer">
+                        <cols>4</cols>
+                        <rows>1</rows>
+                        <vgap>0</vgap>
+                        <hgap>0</hgap>
+                        <growablecols>4</growablecols>
+                        <growablerows>1</growablerows>
+                        <object class="spacer" name="Spacer23443">
+                          <size>2,2</size>
+                          <flag>wxALL</flag>
+                          <border>2</border>
+                        </object>
+                        <object class="sizeritem">
+                          <flag>wxALL</flag>
+                          <border>2</border>
+                          <object class="wxCheckBox" name="m_cbRTSCTSFlowCtl">
+                            <style/>
+                            <label>RTS/CTS Flow Control</label>
+                            <checked>0</checked>
+                          </object>
+                        </object>
+                        <object class="spacer" name="Spacer24045">
+                          <size>2,2</size>
+                          <flag>wxALL</flag>
+                          <border>2</border>
+                        </object>
+                        <object class="sizeritem">
+                          <flag>wxALL</flag>
+                          <border>2</border>
+                          <object class="wxCheckBox" name="m_cbVSPEnable">
+                            <tooltip>Virtual serial port enable. Suppress WARNINGS</tooltip>
+                            <style/>
+                            <label>RTS/CTS Flow Control</label>
+                            <checked>0</checked>
+                          </object>
+                        </object>
+                      </object>
+                    </object>
+                  </object>
+                </object>
+              </object>
+            </object>
+          </object>
+          <object class="notebookpage">
+            <label>HAMlib</label>
+            <selected>0</selected>
+            <object class="wxPanel" name="m_panelHAMLib">
+              <style>wxTAB_TRAVERSAL</style>
+              <tooltip>Hamlib Configuration</tooltip>
+              <object class="wxStaticBoxSizer" name="staticBoxSizer296">
+                <sizeritem>
+                  <object class="spacer"/>
+                </sizeritem>
+                <orient>wxVERTICAL</orient>
+                <label/>
+                <object class="sizeritem" name="gridSizer368">
+                  <flag>wxALL|wxEXPAND</flag>
+                  <border>5</border>
+                  <object class="wxGridSizer">
+                    <cols>3</cols>
+                    <rows>8</rows>
+                    <vgap>0</vgap>
+                    <hgap>0</hgap>
+                    <object class="sizeritem" name="boxSizer312">
+                      <flag>wxALL|wxEXPAND</flag>
+                      <border>2</border>
+                      <option>1</option>
+                      <object class="wxBoxSizer">
+                        <orient>wxHORIZONTAL</orient>
+                        <object class="sizeritem">
+                          <flag>wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL</flag>
+                          <border>2</border>
+                          <object class="wxStaticText" name="m_staticText308">
+                            <label>Device:</label>
+                            <style/>
+                          </object>
+                        </object>
+                        <object class="sizeritem">
+                          <flag>wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL</flag>
+                          <border>2</border>
+                          <option>1</option>
+                          <object class="wxComboBox" name="m_comboBox314">
+                            <style/>
+                            <selection>-1</selection>
+                            <content/>
+                          </object>
+                        </object>
+                      </object>
+                    </object>
+                    <object class="sizeritem">
+                      <flag>wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL</flag>
+                      <border>2</border>
+                      <option>1</option>
+                      <object class="wxStaticText" name="m_staticText304">
+                        <label>Rig:</label>
+                        <style/>
+                      </object>
+                    </object>
+                    <object class="sizeritem" name="boxSizer302">
+                      <flag>wxALL</flag>
+                      <border>2</border>
+                      <option>1</option>
+                      <object class="wxBoxSizer">
+                        <orient>wxHORIZONTAL</orient>
+                        <object class="sizeritem">
+                          <flag>wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL</flag>
+                          <border>2</border>
+                          <option>1</option>
+                          <object class="wxTextCtrl" name="m_textCtrl306">
+                            <style/>
+                          </object>
+                        </object>
+                      </object>
+                    </object>
+                    <object class="sizeritem" name="boxSizer320">
+                      <flag>wxALL</flag>
+                      <border>2</border>
+                      <option>1</option>
+                      <object class="wxBoxSizer">
+                        <orient>wxHORIZONTAL</orient>
+                        <object class="sizeritem">
+                          <flag>wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL</flag>
+                          <border>2</border>
+                          <object class="wxStaticText" name="m_staticText326">
+                            <label>Retries:</label>
+                            <style/>
+                          </object>
+                        </object>
+                        <object class="sizeritem">
+                          <flag>wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL</flag>
+                          <border>2</border>
+                          <option>1</option>
+                          <object class="wxTextCtrl" name="m_textCtrl328">
+                            <style/>
+                          </object>
+                        </object>
+                      </object>
+                    </object>
+                    <object class="sizeritem" name="boxSizer32057">
+                      <flag>wxALL</flag>
+                      <border>2</border>
+                      <option>1</option>
+                      <object class="wxBoxSizer">
+                        <orient>wxHORIZONTAL</orient>
+                        <object class="sizeritem">
+                          <flag>wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL</flag>
+                          <border>2</border>
+                          <object class="wxStaticText" name="m_staticText32658">
+                            <label>Retry Interval:</label>
+                            <style/>
+                          </object>
+                        </object>
+                        <object class="sizeritem">
+                          <flag>wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
+                          <border>2</border>
+                          <option>1</option>
+                          <object class="wxTextCtrl" name="m_textCtrl32859">
+                            <style/>
+                          </object>
+                        </object>
+                      </object>
+                    </object>
+                    <object class="sizeritem" name="boxSizer32060">
+                      <flag>wxALL</flag>
+                      <border>2</border>
+                      <option>1</option>
+                      <object class="wxBoxSizer">
+                        <orient>wxHORIZONTAL</orient>
+                        <object class="sizeritem">
+                          <flag>wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL</flag>
+                          <border>2</border>
+                          <object class="wxStaticText" name="m_staticText32661">
+                            <label>Baud Rate:</label>
+                            <style/>
+                          </object>
+                        </object>
+                        <object class="sizeritem">
+                          <flag>wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
+                          <border>2</border>
+                          <option>1</option>
+                          <object class="wxComboBox" name="m_comboBox339">
+                            <style/>
+                            <selection>-1</selection>
+                            <content>
+                              <item>300</item>
+                              <item>600</item>
+                              <item>1200</item>
+                              <item>2400</item>
+                              <item>9600</item>
+                              <item>19200</item>
+                              <item>38400</item>
+                              <item>56800</item>
+                            </content>
+                          </object>
+                        </object>
+                      </object>
+                    </object>
+                    <object class="sizeritem" name="boxSizer32064">
+                      <flag>wxALL</flag>
+                      <border>2</border>
+                      <object class="wxBoxSizer">
+                        <orient>wxHORIZONTAL</orient>
+                        <object class="sizeritem">
+                          <flag>wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL</flag>
+                          <border>2</border>
+                          <object class="wxStaticText" name="m_staticText32665">
+                            <label>Write Delay:</label>
+                            <style/>
+                          </object>
+                        </object>
+                        <object class="sizeritem">
+                          <flag>wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL</flag>
+                          <border>2</border>
+                          <option>1</option>
+                          <object class="wxTextCtrl" name="m_textCtrl32866">
+                            <style/>
+                          </object>
+                        </object>
+                      </object>
+                    </object>
+                    <object class="sizeritem" name="boxSizer3205767">
+                      <flag>wxALL</flag>
+                      <border>2</border>
+                      <option>1</option>
+                      <object class="wxBoxSizer">
+                        <orient>wxHORIZONTAL</orient>
+                        <object class="sizeritem">
+                          <flag>wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL</flag>
+                          <border>2</border>
+                          <object class="wxStaticText" name="m_staticText3265868">
+                            <label>Post Write Delay:</label>
+                            <style/>
+                          </object>
+                        </object>
+                        <object class="sizeritem">
+                          <flag>wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
+                          <border>2</border>
+                          <option>1</option>
+                          <object class="wxTextCtrl" name="m_textCtrl3285969">
+                            <style/>
+                          </object>
+                        </object>
+                      </object>
+                    </object>
+                    <object class="sizeritem" name="boxSizer3206070">
+                      <flag>wxALL</flag>
+                      <border>2</border>
+                      <object class="wxBoxSizer">
+                        <orient>wxHORIZONTAL</orient>
+                        <object class="sizeritem">
+                          <flag>wxALL</flag>
+                          <border>2</border>
+                          <option>1</option>
+                          <object class="wxStaticText" name="m_staticText3266171">
+                            <label>Stop bits:</label>
+                            <style/>
+                          </object>
+                        </object>
+                        <object class="sizeritem">
+                          <flag>wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
+                          <border>2</border>
+                          <option>1</option>
+                          <object class="wxSlider" name="m_slider361">
+                            <style>wxSL_LABELS|wxSL_HORIZONTAL</style>
+                            <min>0</min>
+                            <max>2</max>
+                            <value>1</value>
+                          </object>
+                        </object>
+                      </object>
+                    </object>
+                    <object class="sizeritem">
+                      <flag>wxALL</flag>
+                      <border>2</border>
+                      <option>1</option>
+                      <object class="wxCheckBox" name="m_cbHAMLIBPTT">
+                        <tooltip>Use Hamlib to control PTT</tooltip>
+                        <style/>
+                        <label>PTT via HAMLib</label>
+                        <checked>0</checked>
+                      </object>
+                    </object>
+                    <object class="sizeritem">
+                      <flag>wxALL|wxALIGN_RIGHT</flag>
+                      <border>2</border>
+                      <option>1</option>
+                      <object class="wxStaticText" name="m_staticText408">
+                        <label>Sideband:</label>
+                        <style/>
+                      </object>
+                    </object>
+                    <object class="sizeritem" name="boxSizer410">
+                      <flag>wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
+                      <border>2</border>
+                      <option>1</option>
+                      <object class="wxBoxSizer">
+                        <orient>wxVERTICAL</orient>
+                        <object class="sizeritem">
+                          <flag>wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL</flag>
+                          <border>2</border>
+                          <object class="wxComboBox" name="m_comboBox376">
+                            <style/>
+                            <selection>-1</selection>
+                            <content>
+                              <item>Upper</item>
+                              <item>Lower</item>
+                            </content>
+                          </object>
+                        </object>
+                      </object>
+                    </object>
+                    <object class="sizeritem">
+                      <flag>wxALL</flag>
+                      <border>2</border>
+                      <object class="wxCheckBox" name="m_checkBox378">
+                        <tooltip>Initialize state of RTS</tooltip>
+                        <style/>
+                        <label>Initial RTS +12v</label>
+                        <checked>0</checked>
+                      </object>
+                    </object>
+                    <object class="spacer" name="Spacer380">
+                      <flag>wxALL</flag>
+                      <border>2</border>
+                    </object>
+                    <object class="sizeritem">
+                      <flag>wxALL</flag>
+                      <border>2</border>
+                      <object class="wxCheckBox" name="m_checkBox382">
+                        <style/>
+                        <label>Initial DTR +12v</label>
+                        <checked>0</checked>
+                      </object>
+                    </object>
+                    <object class="sizeritem">
+                      <flag>wxALL</flag>
+                      <border>2</border>
+                      <object class="wxCheckBox" name="m_cbRTSCTS">
+                        <tooltip>Use RTS/CTS Flow Control</tooltip>
+                        <style/>
+                        <label>RTS/CTS Flow Control</label>
+                        <checked>0</checked>
+                      </object>
+                    </object>
+                    <object class="spacer" name="Spacer386">
+                      <flag>wxALL</flag>
+                      <border>2</border>
+                    </object>
+                    <object class="sizeritem">
+                      <flag>wxALL</flag>
+                      <border>2</border>
+                      <object class="wxCheckBox" name="m_cbXONXOFF">
+                        <tooltip>Use XON/XOFF flow control</tooltip>
+                        <style/>
+                        <label>XON/XOFF Flow Control</label>
+                        <checked>0</checked>
+                      </object>
+                    </object>
+                    <object class="sizeritem">
+                      <flag>wxALL</flag>
+                      <border>2</border>
+                      <object class="wxStaticText" name="m_staticText404">
+                        <label>Advanced Configuration:</label>
+                        <style/>
+                      </object>
+                    </object>
+                    <object class="spacer" name="Spacer396">
+                      <flag>wxALL</flag>
+                      <border>2</border>
+                    </object>
+                    <object class="sizeritem">
+                      <flag>wxALL</flag>
+                      <border>2</border>
+                      <object class="wxButton" name="m_btnRevert">
+                        <label>Revert</label>
+                        <style/>
+                        <tooltip>Revert to previous settings</tooltip>
+                        <default>0</default>
+                      </object>
+                    </object>
+                    <object class="sizeritem">
+                      <flag>wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL</flag>
+                      <border>2</border>
+                      <option>1</option>
+                      <object class="wxTextCtrl" name="m_textAdvancedCFG">
+                        <style/>
+                        <tooltip>Enter Advanced Configuration string</tooltip>
+                      </object>
+                    </object>
+                    <object class="spacer" name="Spacer406">
+                      <flag>wxALL</flag>
+                      <border>2</border>
+                    </object>
+                    <object class="sizeritem">
+                      <flag>wxALL</flag>
+                      <border>2</border>
+                      <object class="wxButton" name="m_btnInitHamlib">
+                        <label>Initialize</label>
+                        <style/>
+                        <tooltip>Initialize HAMLib</tooltip>
+                        <default>0</default>
+                      </object>
+                    </object>
+                  </object>
+                </object>
+              </object>
+            </object>
+          </object>
+          <object class="notebookpage">
+            <label>MemMap</label>
+            <selected>0</selected>
+            <object class="wxPanel" name="m_panelMemMap">
+              <style>wxTAB_TRAVERSAL</style>
+              <bg>wxSYS_COLOUR_BTNHIGHLIGHT</bg>
+              <tooltip>Memory Mapped control</tooltip>
+              <object class="wxStaticBoxSizer" name="staticBoxSizer294">
+                <sizeritem>
+                  <object class="spacer"/>
+                </sizeritem>
+                <orient>wxVERTICAL</orient>
+                <label/>
+                <object class="sizeritem" name="gridSizer420">
+                  <flag>wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
+                  <border>2</border>
+                  <option>1</option>
+                  <object class="wxGridSizer">
+                    <cols>1</cols>
+                    <rows>2</rows>
+                    <vgap>0</vgap>
+                    <hgap>0</hgap>
+                    <object class="sizeritem" name="staticBoxSizer424">
+                      <flag>wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
+                      <border>5</border>
+                      <option>1</option>
+                      <object class="wxStaticBoxSizer" name="staticBoxSizer424">
+                        <sizeritem>
+                          <object class="spacer"/>
+                        </sizeritem>
+                        <orient>wxVERTICAL</orient>
+                        <label/>
+                        <object class="sizeritem">
+                          <flag>wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
+                          <border>5</border>
+                          <option>1</option>
+                          <object class="wxStaticText" name="m_staticText422">
+                            <label>\nControl via Memory Mapped Shared Variables, i. e. Kachina \n</label>
+                            <style>wxALIGN_CENTRE</style>
+                            <bg>wxSYS_COLOUR_BTNFACE</bg>
+                          </object>
+                        </object>
+                      </object>
+                    </object>
+                    <object class="sizeritem" name="boxSizer4456">
+                      <flag>wxALL|wxALIGN_CENTER_HORIZONTAL</flag>
+                      <border>5</border>
+                      <object class="wxBoxSizer">
+                        <orient>wxVERTICAL</orient>
+                        <object class="sizeritem">
+                          <flag>wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
+                          <border>5</border>
+                          <object class="wxCheckBox" name="m_checkBox4377">
+                            <style/>
+                            <label>Use Memorymap</label>
+                            <checked>0</checked>
+                          </object>
+                        </object>
+                        <object class="sizeritem">
+                          <flag>wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_BOTTOM</flag>
+                          <border>5</border>
+                          <object class="wxCheckBox" name="m_checkBox4398">
+                            <style/>
+                            <label>Use Memmap PTT</label>
+                            <checked>0</checked>
+                          </object>
+                        </object>
+                        <object class="sizeritem">
+                          <flag>wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
+                          <border>5</border>
+                          <object class="wxButton" name="m_button4419">
+                            <label>Initialize</label>
+                            <style/>
+                            <default>0</default>
+                          </object>
+                        </object>
+                      </object>
+                    </object>
+                  </object>
+                </object>
+              </object>
+            </object>
+          </object>
+          <object class="notebookpage">
+            <label>XML-RPC</label>
+            <selected>0</selected>
+            <object class="wxPanel" name="m_panelXMLRPC">
+              <style>wxTAB_TRAVERSAL</style>
+              <tooltip>XML-RPC control</tooltip>
+              <object class="wxStaticBoxSizer" name="staticBoxSizer85">
+                <sizeritem>
+                  <object class="spacer"/>
+                </sizeritem>
+                <orient>wxVERTICAL</orient>
+                <label/>
+                <object class="sizeritem" name="gridSizer4203">
+                  <flag>wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
+                  <border>2</border>
+                  <option>1</option>
+                  <object class="wxGridSizer">
+                    <cols>1</cols>
+                    <rows>2</rows>
+                    <vgap>0</vgap>
+                    <hgap>0</hgap>
+                    <object class="sizeritem" name="staticBoxSizer4244">
+                      <flag>wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
+                      <border>5</border>
+                      <option>1</option>
+                      <object class="wxStaticBoxSizer" name="staticBoxSizer4244">
+                        <sizeritem>
+                          <object class="spacer"/>
+                        </sizeritem>
+                        <orient>wxVERTICAL</orient>
+                        <label/>
+                        <object class="sizeritem">
+                          <flag>wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
+                          <border>5</border>
+                          <option>1</option>
+                          <object class="wxStaticText" name="m_staticText42210">
+                            <label>\nRig control via external program using XML RPC Remote Calls\n</label>
+                            <style>wxALIGN_CENTRE</style>
+                            <bg>wxSYS_COLOUR_BTNFACE</bg>
+                          </object>
+                        </object>
+                      </object>
+                    </object>
+                    <object class="sizeritem" name="boxSizer445">
+                      <flag>wxALL|wxALIGN_CENTER_HORIZONTAL</flag>
+                      <border>5</border>
+                      <object class="wxBoxSizer">
+                        <orient>wxVERTICAL</orient>
+                        <object class="sizeritem">
+                          <flag>wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
+                          <border>5</border>
+                          <object class="wxCheckBox" name="m_checkBox437">
+                            <style/>
+                            <label>Use XML-RPC</label>
+                            <checked>0</checked>
+                          </object>
+                        </object>
+                        <object class="sizeritem">
+                          <flag>wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
+                          <border>5</border>
+                          <object class="wxButton" name="m_button441">
+                            <label>Initialize</label>
+                            <style/>
+                            <default>0</default>
+                          </object>
+                        </object>
+                      </object>
+                    </object>
+                  </object>
+                </object>
+              </object>
+            </object>
+          </object>
+        </object>
+      </object>
+      <object class="sizeritem">
+        <flag>wxALL|wxALIGN_RIGHT|wxALIGN_BOTTOM</flag>
+        <border>2</border>
+        <object class="wxStdDialogButtonSizer" name="m_stdBtnSizer155">
+          <object class="button">
+            <object class="wxButton" name="wxID_APPLY">
+              <label/>
+              <style/>
+              <bg/>
+              <fg/>
+              <default>0</default>
+            </object>
+          </object>
+          <object class="button">
+            <object class="wxButton" name="wxID_OK">
+              <label/>
+              <style/>
+              <bg/>
+              <fg/>
+              <default>1</default>
+            </object>
+          </object>
+          <object class="button">
+            <object class="wxButton" name="wxID_CANCEL">
+              <label/>
+              <style/>
+              <bg/>
+              <fg/>
+              <default>0</default>
+            </object>
+          </object>
+        </object>
+      </object>
+    </object>
+  </object>
+</resource>
diff --git a/freedv/branches/0.97/build/codelite/hamlib_trial/wxcrafter_bitmaps.cpp b/freedv/branches/0.97/build/codelite/hamlib_trial/wxcrafter_bitmaps.cpp
new file mode 100644 (file)
index 0000000..6d25c24
--- /dev/null
@@ -0,0 +1,95 @@
+//\r
+// This file was automatically generated by wxrc, do not edit by hand.\r
+//\r
+\r
+#include <wx/wxprec.h>\r
+\r
+#ifdef __BORLANDC__\r
+    #pragma hdrstop\r
+#endif\r
+\r
+#include <wx/filesys.h>\r
+#include <wx/fs_mem.h>\r
+#include <wx/xrc/xmlres.h>\r
+#include <wx/xrc/xh_all.h>\r
+\r
+#if wxCHECK_VERSION(2,8,5) && wxABI_VERSION >= 20805\r
+    #define XRC_ADD_FILE(name, data, size, mime) \\r
+        wxMemoryFSHandler::AddFileWithMimeType(name, data, size, mime)\r
+#else\r
+    #define XRC_ADD_FILE(name, data, size, mime) \\r
+        wxMemoryFSHandler::AddFile(name, data, size)\r
+#endif\r
+\r
+static size_t xml_res_size_0 = 741;\r
+static unsigned char xml_res_file_0[] = {\r
+137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,16,0,0,0,16,8,6,0,0,\r
+0,31,243,255,97,0,0,0,4,115,66,73,84,8,8,8,8,124,8,100,136,0,0,2,156,73,\r
+68,65,84,56,141,173,147,75,72,84,81,24,199,127,231,220,235,220,235,45,199,\r
+49,197,80,163,135,129,137,61,160,162,54,45,34,132,176,22,150,72,26,97,20,\r
+18,68,181,200,144,158,180,41,122,16,34,4,81,4,165,161,133,88,17,145,16,\r
+84,84,27,193,160,168,133,76,81,19,77,106,62,26,31,89,51,57,227,157,185,\r
+143,22,87,210,86,110,250,195,225,28,248,56,191,255,247,253,15,71,48,67,\r
+67,13,53,115,50,28,251,146,227,184,181,2,55,29,119,170,32,192,69,36,164,\r
+20,205,49,169,28,207,59,122,103,130,233,146,167,95,23,119,93,21,138,60,\r
+168,173,219,64,90,81,9,34,175,128,127,0,67,3,164,66,239,49,223,116,225,\r
+218,206,181,204,147,109,135,254,2,126,156,171,106,215,10,139,170,141,242,\r
+74,80,4,36,250,33,21,1,41,61,128,237,128,111,62,232,11,192,113,137,119,\r
+60,192,12,135,238,206,59,125,111,167,24,57,91,117,222,151,95,112,202,191,\r
+167,22,98,131,48,17,2,203,34,210,209,205,216,171,48,8,200,45,45,38,103,\r
+235,74,176,28,152,187,12,50,242,137,182,52,147,28,28,184,32,237,100,170,\r
+222,95,81,9,241,97,72,244,128,106,16,31,156,100,180,243,51,37,183,14,176,\r
+244,216,54,190,61,14,130,158,9,170,1,241,30,136,15,227,175,168,196,78,165,\r
+234,165,80,125,26,1,63,164,126,130,98,128,212,49,138,151,176,188,233,48,\r
+184,26,74,90,58,129,128,14,82,7,37,221,131,164,126,66,192,15,73,71,83,29,\r
+203,241,146,80,124,120,169,9,16,2,55,97,243,245,76,11,137,190,97,150,223,\r
+57,13,147,73,80,37,184,46,40,26,72,176,108,7,53,249,59,158,36,26,243,161,\r
+231,128,57,238,49,164,68,248,85,10,27,235,189,16,19,38,8,1,210,245,204,\r
+180,44,248,21,195,182,157,164,12,199,204,219,145,214,54,208,3,144,158,237,\r
+181,168,232,196,63,245,19,172,168,35,184,189,206,115,84,116,72,51,192,200,\r
+6,61,64,164,181,141,112,212,188,45,128,130,215,251,74,155,23,173,91,189,\r
+57,119,111,13,72,1,142,5,10,160,168,83,207,104,3,210,27,211,182,25,110,\r
+106,165,247,205,187,103,235,111,190,168,85,128,216,141,119,95,187,182,248,\r
+213,108,247,227,231,85,89,155,202,64,73,3,105,0,6,160,131,52,176,127,140,\r
+18,237,236,98,232,218,13,194,161,222,251,27,110,189,60,2,244,77,89,16,126,\r
+61,48,214,180,162,162,188,6,178,137,190,125,74,111,67,35,154,161,33,164,\r
+4,1,54,152,223,77,235,209,254,39,111,175,132,70,126,247,1,125,51,191,1,\r
+31,142,86,95,119,156,47,110,228,225,101,55,184,123,163,91,182,56,111,51,\r
+176,118,198,90,13,44,244,102,153,150,0,8,238,216,225,19,153,81,211,181,\r
+44,198,38,147,207,55,182,119,158,0,186,129,20,179,72,204,216,215,76,157,\r
+199,129,240,108,23,255,155,254,0,55,116,2,121,97,65,188,6,0,0,0,0,73,69,\r
+78,68,174,66,96,130};\r
+\r
+static size_t xml_res_size_1 = 252;\r
+static unsigned char xml_res_file_1[] = {\r
+60,63,120,109,108,32,118,101,114,115,105,111,110,61,34,49,46,48,34,32,101,\r
+110,99,111,100,105,110,103,61,34,85,84,70,45,56,34,63,62,10,60,114,101,\r
+115,111,117,114,99,101,32,120,109,108,110,115,61,34,104,116,116,112,58,\r
+47,47,119,119,119,46,119,120,119,105,110,100,111,119,115,46,111,114,103,\r
+47,119,120,120,114,99,34,32,118,101,114,115,105,111,110,61,34,50,46,51,\r
+46,48,46,49,34,62,10,32,32,60,111,98,106,101,99,116,32,99,108,97,115,115,\r
+61,34,119,120,66,105,116,109,97,112,34,32,110,97,109,101,61,34,112,108,\r
+97,99,101,104,111,108,100,101,114,49,54,34,62,119,120,99,114,97,102,116,\r
+101,114,95,98,105,116,109,97,112,115,46,99,112,112,36,67,95,95,85,115,101,\r
+114,115,95,119,105,116,116,101,110,100,95,65,112,112,68,97,116,97,95,76,\r
+111,99,97,108,95,84,101,109,112,95,112,108,97,99,101,104,111,108,100,101,\r
+114,49,54,46,112,110,103,60,47,111,98,106,101,99,116,62,10,60,47,114,101,\r
+115,111,117,114,99,101,62,10};\r
+\r
+void wxC9ED9InitBitmapResources()\r
+{\r
+\r
+    // Check for memory FS. If not present, load the handler:\r
+    {\r
+        wxMemoryFSHandler::AddFile(wxT("XRC_resource/dummy_file"), wxT("dummy one"));\r
+        wxFileSystem fsys;\r
+        wxFSFile *f = fsys.OpenFile(wxT("memory:XRC_resource/dummy_file"));\r
+        wxMemoryFSHandler::RemoveFile(wxT("XRC_resource/dummy_file"));\r
+        if (f) delete f;\r
+        else wxFileSystem::AddHandler(new wxMemoryFSHandlerBase);\r
+    }\r
+\r
+    XRC_ADD_FILE(wxT("XRC_resource/wxcrafter_bitmaps.cpp$C__Users_wittend_AppData_Local_Temp_placeholder16.png"), xml_res_file_0, xml_res_size_0, wxT("image/png"));\r
+    XRC_ADD_FILE(wxT("XRC_resource/wxcrafter_bitmaps.cpp$._wxcrafter_bitmaps.xrc"), xml_res_file_1, xml_res_size_1, wxT("text/xml"));\r
+    wxXmlResource::Get()->Load(wxT("memory:XRC_resource/wxcrafter_bitmaps.cpp$._wxcrafter_bitmaps.xrc"));\r
+}\r
diff --git a/freedv/branches/0.97/build/codelite/hamlib_trial/wxcrafter_bitmaps.xrc b/freedv/branches/0.97/build/codelite/hamlib_trial/wxcrafter_bitmaps.xrc
new file mode 100644 (file)
index 0000000..8627bff
--- /dev/null
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<resource xmlns="http://www.wxwindows.org/wxxrc" version="2.3.0.1">
+  <object class="wxBitmap" name="placeholder16">C:\Users\wittend\AppData\Local\Temp\placeholder16.png</object>
+</resource>
diff --git a/freedv/branches/0.97/build/codelite/libCTB/libCTB.mk b/freedv/branches/0.97/build/codelite/libCTB/libCTB.mk
new file mode 100644 (file)
index 0000000..1f1c584
--- /dev/null
@@ -0,0 +1,213 @@
+##\r
+## Auto Generated makefile by CodeLite IDE\r
+## any manual changes will be erased      \r
+##\r
+## Debug\r
+ProjectName            :=libCTB\r
+ConfigurationName      :=Debug\r
+WorkspacePath          := "D:\Projects\Radio\fdmdv2\build\codelite"\r
+ProjectPath            := "D:\Projects\Radio\fdmdv2\build\codelite\libCTB"\r
+IntermediateDirectory  :=./Debug\r
+OutDir                 := $(IntermediateDirectory)\r
+CurrentFileName        :=\r
+CurrentFilePath        :=\r
+CurrentFileFullPath    :=\r
+User                   :=wittend\r
+Date                   :=12/30/2012\r
+CodeLitePath           :="D:\bin\CodeLite"\r
+LinkerName             :=g++\r
+SharedObjectLinkerName :=g++ -shared -fPIC\r
+ObjectSuffix           :=.o\r
+DependSuffix           :=.o.d\r
+PreprocessSuffix       :=.o.i\r
+DebugSwitch            :=-gstab\r
+IncludeSwitch          :=-I\r
+LibrarySwitch          :=-l\r
+OutputSwitch           :=-o \r
+LibraryPathSwitch      :=-L\r
+PreprocessorSwitch     :=-D\r
+SourceSwitch           :=-c \r
+OutputFile             :=$(IntermediateDirectory)/lib$(ProjectName).a\r
+Preprocessors          :=\r
+ObjectSwitch           :=-o \r
+ArchiveOutputSwitch    := \r
+PreprocessOnlySwitch   :=-E \r
+ObjectsFileList        :="D:\Projects\Radio\fdmdv2\build\codelite\libCTB\libCTB.txt"\r
+PCHCompileFlags        :=\r
+MakeDirCommand         :=makedir\r
+RcCmpOptions           := \r
+RcCompilerName         :=windres\r
+LinkOptions            :=  \r
+IncludePath            :=  $(IncludeSwitch). $(IncludeSwitch). \r
+IncludePCH             := \r
+RcIncludePath          := \r
+Libs                   := \r
+ArLibs                 :=  \r
+LibPath                := $(LibraryPathSwitch). \r
+\r
+##\r
+## Common variables\r
+## AR, CXX, CC, CXXFLAGS and CFLAGS can be overriden using an environment variables\r
+##\r
+AR       := ar rcus\r
+CXX      := g++\r
+CC       := gcc\r
+CXXFLAGS :=  -g  -DSVN_REVISION=\"1152\"  $(Preprocessors)\r
+CFLAGS   :=  -g  -DSVN_REVISION=\"1152\"  $(Preprocessors)\r
+\r
+\r
+##\r
+## User defined environment variables\r
+##\r
+CodeLiteDir:=D:\bin\CodeLite\r
+WXWIN:=D:\bin\wxWidgets-2.9.4\r
+PATH:=$(WXWIN)\lib\gcc_dll;$(PATH)\r
+WXCFG:=gcc_dll\mswu\r
+UNIT_TEST_PP_SRC_DIR:=D:\bin\UnitTest++-1.3\r
+Objects=$(IntermediateDirectory)/src_fifo$(ObjectSuffix) $(IntermediateDirectory)/src_getopt$(ObjectSuffix) $(IntermediateDirectory)/src_gpib$(ObjectSuffix) $(IntermediateDirectory)/src_iobase$(ObjectSuffix) $(IntermediateDirectory)/src_kbhit$(ObjectSuffix) $(IntermediateDirectory)/src_portscan$(ObjectSuffix) $(IntermediateDirectory)/src_serportx$(ObjectSuffix) $(IntermediateDirectory)/win32_getopt$(ObjectSuffix) $(IntermediateDirectory)/win32_serport$(ObjectSuffix) $(IntermediateDirectory)/win32_timer$(ObjectSuffix) \\r
+       \r
+\r
+##\r
+## Main Build Targets \r
+##\r
+.PHONY: all clean PreBuild PrePreBuild PostBuild\r
+all: $(IntermediateDirectory) $(OutputFile)\r
+\r
+$(OutputFile): $(Objects)\r
+       @$(MakeDirCommand) $(@D)\r
+       @echo "" > $(IntermediateDirectory)/.d\r
+       @echo $(Objects) > $(ObjectsFileList)\r
+       $(AR) $(ArchiveOutputSwitch)$(OutputFile) @$(ObjectsFileList) $(ArLibs)\r
+       @$(MakeDirCommand) "D:\Projects\Radio\fdmdv2\build\codelite\.build-debug"\r
+       @echo rebuilt > "D:\Projects\Radio\fdmdv2\build\codelite\.build-debug\libCTB"\r
+\r
+./Debug:\r
+       @$(MakeDirCommand) "./Debug"\r
+\r
+PreBuild:\r
+\r
+\r
+##\r
+## Objects\r
+##\r
+$(IntermediateDirectory)/src_fifo$(ObjectSuffix): ../../../../code/libCTB-0.16/src/fifo.cpp $(IntermediateDirectory)/src_fifo$(DependSuffix)\r
+       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/code/libCTB-0.16/src/fifo.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/src_fifo$(ObjectSuffix) $(IncludePath)\r
+$(IntermediateDirectory)/src_fifo$(DependSuffix): ../../../../code/libCTB-0.16/src/fifo.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/src_fifo$(ObjectSuffix) -MF$(IntermediateDirectory)/src_fifo$(DependSuffix) -MM "D:/Projects/Radio/code/libCTB-0.16/src/fifo.cpp"\r
+\r
+$(IntermediateDirectory)/src_fifo$(PreprocessSuffix): ../../../../code/libCTB-0.16/src/fifo.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_fifo$(PreprocessSuffix) "D:/Projects/Radio/code/libCTB-0.16/src/fifo.cpp"\r
+\r
+$(IntermediateDirectory)/src_getopt$(ObjectSuffix): ../../../../code/libCTB-0.16/src/getopt.cpp $(IntermediateDirectory)/src_getopt$(DependSuffix)\r
+       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/code/libCTB-0.16/src/getopt.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/src_getopt$(ObjectSuffix) $(IncludePath)\r
+$(IntermediateDirectory)/src_getopt$(DependSuffix): ../../../../code/libCTB-0.16/src/getopt.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/src_getopt$(ObjectSuffix) -MF$(IntermediateDirectory)/src_getopt$(DependSuffix) -MM "D:/Projects/Radio/code/libCTB-0.16/src/getopt.cpp"\r
+\r
+$(IntermediateDirectory)/src_getopt$(PreprocessSuffix): ../../../../code/libCTB-0.16/src/getopt.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_getopt$(PreprocessSuffix) "D:/Projects/Radio/code/libCTB-0.16/src/getopt.cpp"\r
+\r
+$(IntermediateDirectory)/src_gpib$(ObjectSuffix): ../../../../code/libCTB-0.16/src/gpib.cpp $(IntermediateDirectory)/src_gpib$(DependSuffix)\r
+       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/code/libCTB-0.16/src/gpib.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/src_gpib$(ObjectSuffix) $(IncludePath)\r
+$(IntermediateDirectory)/src_gpib$(DependSuffix): ../../../../code/libCTB-0.16/src/gpib.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/src_gpib$(ObjectSuffix) -MF$(IntermediateDirectory)/src_gpib$(DependSuffix) -MM "D:/Projects/Radio/code/libCTB-0.16/src/gpib.cpp"\r
+\r
+$(IntermediateDirectory)/src_gpib$(PreprocessSuffix): ../../../../code/libCTB-0.16/src/gpib.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_gpib$(PreprocessSuffix) "D:/Projects/Radio/code/libCTB-0.16/src/gpib.cpp"\r
+\r
+$(IntermediateDirectory)/src_iobase$(ObjectSuffix): ../../../../code/libCTB-0.16/src/iobase.cpp $(IntermediateDirectory)/src_iobase$(DependSuffix)\r
+       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/code/libCTB-0.16/src/iobase.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/src_iobase$(ObjectSuffix) $(IncludePath)\r
+$(IntermediateDirectory)/src_iobase$(DependSuffix): ../../../../code/libCTB-0.16/src/iobase.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/src_iobase$(ObjectSuffix) -MF$(IntermediateDirectory)/src_iobase$(DependSuffix) -MM "D:/Projects/Radio/code/libCTB-0.16/src/iobase.cpp"\r
+\r
+$(IntermediateDirectory)/src_iobase$(PreprocessSuffix): ../../../../code/libCTB-0.16/src/iobase.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_iobase$(PreprocessSuffix) "D:/Projects/Radio/code/libCTB-0.16/src/iobase.cpp"\r
+\r
+$(IntermediateDirectory)/src_kbhit$(ObjectSuffix): ../../../../code/libCTB-0.16/src/kbhit.cpp $(IntermediateDirectory)/src_kbhit$(DependSuffix)\r
+       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/code/libCTB-0.16/src/kbhit.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/src_kbhit$(ObjectSuffix) $(IncludePath)\r
+$(IntermediateDirectory)/src_kbhit$(DependSuffix): ../../../../code/libCTB-0.16/src/kbhit.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/src_kbhit$(ObjectSuffix) -MF$(IntermediateDirectory)/src_kbhit$(DependSuffix) -MM "D:/Projects/Radio/code/libCTB-0.16/src/kbhit.cpp"\r
+\r
+$(IntermediateDirectory)/src_kbhit$(PreprocessSuffix): ../../../../code/libCTB-0.16/src/kbhit.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_kbhit$(PreprocessSuffix) "D:/Projects/Radio/code/libCTB-0.16/src/kbhit.cpp"\r
+\r
+$(IntermediateDirectory)/src_portscan$(ObjectSuffix): ../../../../code/libCTB-0.16/src/portscan.cpp $(IntermediateDirectory)/src_portscan$(DependSuffix)\r
+       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/code/libCTB-0.16/src/portscan.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/src_portscan$(ObjectSuffix) $(IncludePath)\r
+$(IntermediateDirectory)/src_portscan$(DependSuffix): ../../../../code/libCTB-0.16/src/portscan.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/src_portscan$(ObjectSuffix) -MF$(IntermediateDirectory)/src_portscan$(DependSuffix) -MM "D:/Projects/Radio/code/libCTB-0.16/src/portscan.cpp"\r
+\r
+$(IntermediateDirectory)/src_portscan$(PreprocessSuffix): ../../../../code/libCTB-0.16/src/portscan.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_portscan$(PreprocessSuffix) "D:/Projects/Radio/code/libCTB-0.16/src/portscan.cpp"\r
+\r
+$(IntermediateDirectory)/src_serportx$(ObjectSuffix): ../../../../code/libCTB-0.16/src/serportx.cpp $(IntermediateDirectory)/src_serportx$(DependSuffix)\r
+       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/code/libCTB-0.16/src/serportx.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/src_serportx$(ObjectSuffix) $(IncludePath)\r
+$(IntermediateDirectory)/src_serportx$(DependSuffix): ../../../../code/libCTB-0.16/src/serportx.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/src_serportx$(ObjectSuffix) -MF$(IntermediateDirectory)/src_serportx$(DependSuffix) -MM "D:/Projects/Radio/code/libCTB-0.16/src/serportx.cpp"\r
+\r
+$(IntermediateDirectory)/src_serportx$(PreprocessSuffix): ../../../../code/libCTB-0.16/src/serportx.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_serportx$(PreprocessSuffix) "D:/Projects/Radio/code/libCTB-0.16/src/serportx.cpp"\r
+\r
+$(IntermediateDirectory)/win32_getopt$(ObjectSuffix): ../../../../code/libCTB-0.16/src/win32/getopt.cpp $(IntermediateDirectory)/win32_getopt$(DependSuffix)\r
+       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/code/libCTB-0.16/src/win32/getopt.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/win32_getopt$(ObjectSuffix) $(IncludePath)\r
+$(IntermediateDirectory)/win32_getopt$(DependSuffix): ../../../../code/libCTB-0.16/src/win32/getopt.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/win32_getopt$(ObjectSuffix) -MF$(IntermediateDirectory)/win32_getopt$(DependSuffix) -MM "D:/Projects/Radio/code/libCTB-0.16/src/win32/getopt.cpp"\r
+\r
+$(IntermediateDirectory)/win32_getopt$(PreprocessSuffix): ../../../../code/libCTB-0.16/src/win32/getopt.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/win32_getopt$(PreprocessSuffix) "D:/Projects/Radio/code/libCTB-0.16/src/win32/getopt.cpp"\r
+\r
+$(IntermediateDirectory)/win32_serport$(ObjectSuffix): ../../../../code/libCTB-0.16/src/win32/serport.cpp $(IntermediateDirectory)/win32_serport$(DependSuffix)\r
+       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/code/libCTB-0.16/src/win32/serport.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/win32_serport$(ObjectSuffix) $(IncludePath)\r
+$(IntermediateDirectory)/win32_serport$(DependSuffix): ../../../../code/libCTB-0.16/src/win32/serport.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/win32_serport$(ObjectSuffix) -MF$(IntermediateDirectory)/win32_serport$(DependSuffix) -MM "D:/Projects/Radio/code/libCTB-0.16/src/win32/serport.cpp"\r
+\r
+$(IntermediateDirectory)/win32_serport$(PreprocessSuffix): ../../../../code/libCTB-0.16/src/win32/serport.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/win32_serport$(PreprocessSuffix) "D:/Projects/Radio/code/libCTB-0.16/src/win32/serport.cpp"\r
+\r
+$(IntermediateDirectory)/win32_timer$(ObjectSuffix): ../../../../code/libCTB-0.16/src/win32/timer.cpp $(IntermediateDirectory)/win32_timer$(DependSuffix)\r
+       $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/code/libCTB-0.16/src/win32/timer.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/win32_timer$(ObjectSuffix) $(IncludePath)\r
+$(IntermediateDirectory)/win32_timer$(DependSuffix): ../../../../code/libCTB-0.16/src/win32/timer.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/win32_timer$(ObjectSuffix) -MF$(IntermediateDirectory)/win32_timer$(DependSuffix) -MM "D:/Projects/Radio/code/libCTB-0.16/src/win32/timer.cpp"\r
+\r
+$(IntermediateDirectory)/win32_timer$(PreprocessSuffix): ../../../../code/libCTB-0.16/src/win32/timer.cpp\r
+       @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/win32_timer$(PreprocessSuffix) "D:/Projects/Radio/code/libCTB-0.16/src/win32/timer.cpp"\r
+\r
+\r
+-include $(IntermediateDirectory)/*$(DependSuffix)\r
+##\r
+## Clean\r
+##\r
+clean:\r
+       $(RM) $(IntermediateDirectory)/src_fifo$(ObjectSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_fifo$(DependSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_fifo$(PreprocessSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_getopt$(ObjectSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_getopt$(DependSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_getopt$(PreprocessSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_gpib$(ObjectSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_gpib$(DependSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_gpib$(PreprocessSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_iobase$(ObjectSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_iobase$(DependSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_iobase$(PreprocessSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_kbhit$(ObjectSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_kbhit$(DependSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_kbhit$(PreprocessSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_portscan$(ObjectSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_portscan$(DependSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_portscan$(PreprocessSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_serportx$(ObjectSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_serportx$(DependSuffix)\r
+       $(RM) $(IntermediateDirectory)/src_serportx$(PreprocessSuffix)\r
+       $(RM) $(IntermediateDirectory)/win32_getopt$(ObjectSuffix)\r
+       $(RM) $(IntermediateDirectory)/win32_getopt$(DependSuffix)\r
+       $(RM) $(IntermediateDirectory)/win32_getopt$(PreprocessSuffix)\r
+       $(RM) $(IntermediateDirectory)/win32_serport$(ObjectSuffix)\r
+       $(RM) $(IntermediateDirectory)/win32_serport$(DependSuffix)\r
+       $(RM) $(IntermediateDirectory)/win32_serport$(PreprocessSuffix)\r
+       $(RM) $(IntermediateDirectory)/win32_timer$(ObjectSuffix)\r
+       $(RM) $(IntermediateDirectory)/win32_timer$(DependSuffix)\r
+       $(RM) $(IntermediateDirectory)/win32_timer$(PreprocessSuffix)\r
+       $(RM) $(OutputFile)\r
+       $(RM) $(OutputFile)\r
+       $(RM) "D:\Projects\Radio\fdmdv2\build\codelite\.build-debug\libCTB"\r
+\r
+\r
diff --git a/freedv/branches/0.97/build/codelite/libCTB/libCTB.project b/freedv/branches/0.97/build/codelite/libCTB/libCTB.project
new file mode 100644 (file)
index 0000000..86c3ddf
--- /dev/null
@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CodeLite_Project Name="libCTB" InternalType="Library">
+  <Plugins>
+    <Plugin Name="qmake">
+      <![CDATA[00010001N0005Debug000000000000]]>
+    </Plugin>
+  </Plugins>
+  <Description/>
+  <Dependencies/>
+  <VirtualDirectory Name="src">
+    <File Name="../../../../code/libCTB-0.16/src/fifo.cpp"/>
+    <File Name="../../../../code/libCTB-0.16/src/getopt.cpp"/>
+    <File Name="../../../../code/libCTB-0.16/src/gpib.cpp"/>
+    <File Name="../../../../code/libCTB-0.16/src/iobase.cpp"/>
+    <File Name="../../../../code/libCTB-0.16/src/kbhit.cpp"/>
+    <File Name="../../../../code/libCTB-0.16/src/portscan.cpp"/>
+    <File Name="../../../../code/libCTB-0.16/src/serportx.cpp"/>
+    <File Name="../../../../code/libCTB-0.16/src/win32/getopt.cpp"/>
+    <File Name="../../../../code/libCTB-0.16/src/win32/serport.cpp"/>
+    <File Name="../../../../code/libCTB-0.16/src/win32/timer.cpp"/>
+  </VirtualDirectory>
+  <VirtualDirectory Name="include">
+    <File Name="../../../../code/libCTB-0.16/include/ctb-0.16/ctb.h"/>
+    <File Name="../../../../code/libCTB-0.16/include/ctb-0.16/fifo.h"/>
+    <File Name="../../../../code/libCTB-0.16/include/ctb-0.16/getopt.h"/>
+    <File Name="../../../../code/libCTB-0.16/include/ctb-0.16/gpib.h"/>
+    <File Name="../../../../code/libCTB-0.16/include/ctb-0.16/iobase.h"/>
+    <File Name="../../../../code/libCTB-0.16/include/ctb-0.16/kbhit.h"/>
+    <File Name="../../../../code/libCTB-0.16/include/ctb-0.16/portscan.h"/>
+    <File Name="../../../../code/libCTB-0.16/include/ctb-0.16/serport.h"/>
+    <File Name="../../../../code/libCTB-0.16/include/ctb-0.16/serportx.h"/>
+    <File Name="../../../../code/libCTB-0.16/include/ctb-0.16/timer.h"/>
+    <File Name="../../../../code/libCTB-0.16/include/ctb-0.16/win32/getopt.h"/>
+    <File Name="../../../../code/libCTB-0.16/include/ctb-0.16/win32/gpib-32.h"/>
+    <File Name="../../../../code/libCTB-0.16/include/ctb-0.16/win32/serport.h"/>
+    <File Name="../../../../code/libCTB-0.16/include/ctb-0.16/win32/timer.h"/>
+  </VirtualDirectory>
+  <Settings Type="Static Library">
+    <GlobalSettings>
+      <Compiler Options="" C_Options="">
+        <IncludePath Value="."/>
+      </Compiler>
+      <Linker Options="">
+        <LibraryPath Value="."/>
+      </Linker>
+      <ResourceCompiler Options=""/>
+    </GlobalSettings>
+    <Configuration Name="Debug" CompilerType="gnu g++" DebuggerType="GNU gdb debugger" Type="Static Library" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append">
+      <Compiler Options="-g" C_Options="-g" Required="yes" PreCompiledHeader="" PCHInCommandLine="no" UseDifferentPCHFlags="no" PCHFlags="">
+        <IncludePath Value="."/>
+      </Compiler>
+      <Linker Options="" Required="yes"/>
+      <ResourceCompiler Options="" Required="no"/>
+      <General OutputFile="$(IntermediateDirectory)/lib$(ProjectName).a" IntermediateDirectory="./Debug" Command="" CommandArguments="" UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="yes"/>
+      <Environment EnvVarSetName="&lt;Use Defaults&gt;" DbgSetName="&lt;Use Defaults&gt;">
+        <![CDATA[]]>
+      </Environment>
+      <Debugger IsRemote="no" RemoteHostName="" RemoteHostPort="" DebuggerPath="">
+        <PostConnectCommands/>
+        <StartupCommands/>
+      </Debugger>
+      <PreBuild/>
+      <PostBuild/>
+      <CustomBuild Enabled="no">
+        <RebuildCommand/>
+        <CleanCommand/>
+        <BuildCommand/>
+        <PreprocessFileCommand/>
+        <SingleFileCommand/>
+        <MakefileGenerationCommand/>
+        <ThirdPartyToolName/>
+        <WorkingDirectory/>
+      </CustomBuild>
+      <AdditionalRules>
+        <CustomPostBuild/>
+        <CustomPreBuild/>
+      </AdditionalRules>
+      <Completion EnableCpp11="no">
+        <ClangCmpFlagsC/>
+        <ClangCmpFlags/>
+        <ClangPP/>
+        <SearchPaths/>
+      </Completion>
+    </Configuration>
+    <Configuration Name="Release" CompilerType="gnu g++" DebuggerType="GNU gdb debugger" Type="" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append">
+      <Compiler Options="" C_Options="" Required="yes" PreCompiledHeader="" PCHInCommandLine="no" UseDifferentPCHFlags="no" PCHFlags="">
+        <IncludePath Value="."/>
+      </Compiler>
+      <Linker Options="" Required="yes"/>
+      <ResourceCompiler Options="" Required="no"/>
+      <General OutputFile="$(IntermediateDirectory)/lib$(ProjectName).a" IntermediateDirectory="./Release" Command="" CommandArguments="" UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="yes"/>
+      <Environment EnvVarSetName="&lt;Use Defaults&gt;" DbgSetName="&lt;Use Defaults&gt;">
+        <![CDATA[]]>
+      </Environment>
+      <Debugger IsRemote="no" RemoteHostName="" RemoteHostPort="" DebuggerPath="">
+        <PostConnectCommands/>
+        <StartupCommands/>
+      </Debugger>
+      <PreBuild/>
+      <PostBuild/>
+      <CustomBuild Enabled="no">
+        <RebuildCommand/>
+        <CleanCommand/>
+        <BuildCommand/>
+        <PreprocessFileCommand/>
+        <SingleFileCommand/>
+        <MakefileGenerationCommand/>
+        <ThirdPartyToolName/>
+        <WorkingDirectory/>
+      </CustomBuild>
+      <AdditionalRules>
+        <CustomPostBuild/>
+        <CustomPreBuild/>
+      </AdditionalRules>
+      <Completion EnableCpp11="no">
+        <ClangCmpFlagsC/>
+        <ClangCmpFlags/>
+        <ClangPP/>
+        <SearchPaths/>
+      </Completion>
+    </Configuration>
+  </Settings>
+</CodeLite_Project>
diff --git a/freedv/branches/0.97/build/codelite/libPortCtrl/Debug/.d b/freedv/branches/0.97/build/codelite/libPortCtrl/Debug/.d
new file mode 100644 (file)
index 0000000..950b468
--- /dev/null
@@ -0,0 +1 @@
+"" \r
diff --git a/freedv/branches/0.97/build/codelite/libPortCtrl/Release/.d b/freedv/branches/0.97/build/codelite/libPortCtrl/Release/.d
new file mode 100644 (file)
index 0000000..950b468
--- /dev/null
@@ -0,0 +1 @@
+"" \r
diff --git a/freedv/branches/0.97/build/codelite/libPortCtrl/freedv_osx_port.patch b/freedv/branches/0.97/build/codelite/libPortCtrl/freedv_osx_port.patch
new file mode 100644 (file)
index 0000000..c34f2b3
--- /dev/null
@@ -0,0 +1,774 @@
+Index: src/Makefile.linux
+===================================================================
+--- src/Makefile.linux (revision 1152)
++++ src/Makefile.linux (working copy)
+@@ -36,12 +36,6 @@
+ SOX_INC=-I$(SOX)/src/
+ SOX_LIB=$(SOX)/src/.libs/libsox.a
+-# CTB ---------------------------------------------------
+-
+-CTB=libctb-0.16
+-CTB_INC=-I$(CTB)/include
+-CTB_LIB=$(CTB)/lib/libctb-0.16.a
+-
+ # if libasound is available, PortAudio will be using it, so we will
+ # need to add it to freedv link line.  To test if it is present, we try
+ # to link a small C program with -lasound
+@@ -50,8 +44,8 @@
+ # FreeDV ------------------------------------------------
+-CPP_FLAGS = -D_NO_AUTOTOOLS_ $(WX_CPPFLAGS) $(PORTAUDIO_INC) $(CODEC2_INC) $(SOX_INC) $(CTB_INC) -I. -g -Wall -O3 -DSVN_REVISION=\"$(SVN_REVISION)\"
+-FREEDV_LIBS = $(WX_LIBS) $(PORTAUDIO_LIB) $(CODEC2_LIB) $(SOX_LIB) $(CTB_LIB) -lm -lpthread -lsndfile -lsamplerate $(LIBASOUND)
++CPP_FLAGS = -D_NO_AUTOTOOLS_ $(WX_CPPFLAGS) $(PORTAUDIO_INC) $(CODEC2_INC) $(SOX_INC) -I. -g -Wall -O3 -DSVN_REVISION=\"$(SVN_REVISION)\"
++FREEDV_LIBS = $(WX_LIBS) $(PORTAUDIO_LIB) $(CODEC2_LIB) $(SOX_LIB) -lm -lpthread -lsndfile -lsamplerate $(LIBASOUND)
+ OBJS = topFrame.o \
+ fdmdv2_main.o \
+@@ -65,11 +59,12 @@
+ dlg_comports.o \
+ dlg_filter.o \
+ varicode.o \
+-sox_biquad.o
++sox_biquad.o \
++serialport.o
+-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
++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 serialport.h
+-all: $(WXWIDGETS)/.built $(PORTAUDIO)/.built $(CODEC2)/.built $(SOX)/.built $(CTB)/.built freedv
++all: $(WXWIDGETS)/.built $(PORTAUDIO)/.built $(CODEC2)/.built $(SOX)/.built freedv
+ freedv: $(OBJS) 
+       g++ -o freedv $(OBJS) $(CPP_FLAGS) $(FREEDV_LIBS)
+@@ -81,7 +76,7 @@
+       rm -f *.o fdmdv2 
+ clean-lib:
+-      rm -Rf $(WXWIDGETS) $(PORTAUDIO) $(CODEC2) $(SOX) $(CTB)  
++      rm -Rf $(WXWIDGETS) $(PORTAUDIO) $(CODEC2) $(SOX) 
+       rm -f *.o fdmdv2 
+ # wxWidgets ---------------------------------------------------------
+@@ -126,14 +121,3 @@
+        
+ $(SOX).tar.bz2:
+       wget http://downloads.sourceforge.net/project/sox/sox/14.4.0/sox-14.4.0.tar.bz2
+-
+-# CTB -------------------------------------------------------------
+-
+-$(CTB)/.built: $(CTB)
+-      cd $(CTB)/build && make && touch ../.built
+-               
+-$(CTB) : $(CTB).tar.gz
+-      tar xvzf $(CTB).tar.gz
+-       
+-$(CTB).tar.gz:
+-      wget https://iftools.com/download/ctb/0.16/libctb-0.16.tar.gz
+Index: src/Makefile.linux.dmw
+===================================================================
+--- src/Makefile.linux.dmw     (revision 1152)
++++ src/Makefile.linux.dmw     (working copy)
+@@ -36,7 +36,8 @@
+ dlg_comports.o \
+ dlg_filter.o \
+ varicode.o \
+-sox_biquad.o
++sox_biquad.o \
++serialport.o
+ all: fdmdv2
+@@ -44,7 +45,7 @@
+ fdmdv2: $(OBJS) fdmdv2_main.h
+       g++ -o fdmdv2 $(OBJS) $(CPP_FLAGS) $(LIBS)
+-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
++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 serialport.h
+ %.o: %.cpp
+       g++ $(CPP_FLAGS) -c $< -o $@
+Index: src/Makefile.osx
+===================================================================
+--- src/Makefile.osx   (revision 0)
++++ src/Makefile.osx   (working copy)
+@@ -0,0 +1,76 @@
++# src/Makefile.osx
++# Mooneer Salem 28 Dec 2012
++#
++# Makefile for OSX - assumes MacPorts for some libraries and builds the others locally.
++# Note: dependencies must be installed with universal binary support due to the use of Carbon by portaudio and others.
++#       (Carbon is officially deprecated by Apple and does not have 64-bit support.)
++#
++# $ sudo port install wxWidgets30 +aui +universal portaudio +universal sox +universal libsndfile +universal libsamplerate +universal
++# $ make -f Makefile.osx
++
++SVN_REVISION=$(shell svnversion)
++MACPORTS_FOLDER=/opt/local
++
++# Codec 2 -----------------------------------------------
++
++CODEC2=codec2-dev
++CODEC2_INC=-I$(CODEC2)/src
++CODEC2_LIB=$(CODEC2)/src/.libs/libcodec2.a
++
++# FreeDV ------------------------------------------------
++
++CPP_FLAGS = -D_NO_AUTOTOOLS_ -I$(MACPORTS_FOLDER)/include -arch i386 `wx-config --cppflags` $(CODEC2_INC) -I. -g -Wall -O3 -DSVN_REVISION=\"$(SVN_REVISION)\"
++FREEDV_LIBS = -arch i386 -L$(MACPORTS_FOLDER)/lib `wx-config --libs all` -lportaudio $(CODEC2_LIB) -lm -lpthread -lsndfile -lsamplerate -lsox
++
++OBJS = topFrame.o \
++fdmdv2_main.o \
++fdmdv2_plot.o \
++fdmdv2_plot_scalar.o \
++fdmdv2_plot_scatter.o \
++fdmdv2_plot_spectrum.o \
++fdmdv2_plot_waterfall_linux.o \
++fdmdv2_pa_wrapper.o \
++dlg_audiooptions.o \
++dlg_comports.o \
++dlg_filter.o \
++varicode.o \
++sox_biquad.o \
++serialport.o
++
++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 serialport.h
++
++all: $(CODEC2)/.built freedv FreeDV.app
++
++freedv: $(OBJS)
++      g++ -o freedv $(OBJS) $(CPP_FLAGS) $(FREEDV_LIBS)
++
++FreeDV.app: info.plist freedv
++      -mkdir -p $@/Contents/MacOS
++      -mkdir -p $@/Contents/Resources/English.lproj
++      cp info.plist $@/Contents
++      echo -n "APPL????" > $@/Contents/PkgInfo
++      cp freedv $@/Contents/MacOS/FreeDV
++      
++%.o: %.cpp $(HDRS)
++      g++ $(CPP_FLAGS) -c $< -o $@
++
++sox_biquad.o: sox_biquad.c
++      gcc $(CPP_FLAGS) -c sox_biquad.c -o sox_biquad.o
++
++varicode.o: varicode.c
++      cc $(CPP_FLAGS) -c varicode.c -o varicode.o
++
++clean:
++      rm -f *.o fdmdv2 
++      rm -rf FreeDV.app/
++      
++clean-lib: clean
++      rm -Rf $(CODEC2)
++ 
++# Codec 2 ----------------------------------------------------------
++
++$(CODEC2)/.built: $(CODEC2)
++      cd $(CODEC2) && CPPFLAGS="-arch i386" LDFLAGS="-arch i386" ./configure && make && touch .built
++
++$(CODEC2):
++      svn co https://freetel.svn.sourceforge.net/svnroot/freetel/codec2-dev
+\ No newline at end of file
+Index: src/Makefile.win32
+===================================================================
+--- src/Makefile.win32 (revision 1152)
++++ src/Makefile.win32 (working copy)
+@@ -16,7 +16,7 @@
+ CODEC2_LIB=$(CODEC2_PATH)/src/.libs/libcodec2.a
+ CPP_FLAGS = -D_NO_AUTOTOOLS_ -I$(INCLUDE_PATH) $(WX_CPPFLAGS) -I$(CODEC2_INC) -I../extern/include -g -Wall -DSVN_REVISION=\"$(SVN_REVISION)\"
+-LIBS = $(WX_LIBS) $(CODEC2_LIB) -lm -lportaudiocpp -lportaudio -lpthread -lsndfile -lsamplerate -lctb-0.16 -lsox
++LIBS = $(WX_LIBS) $(CODEC2_LIB) -lm -lportaudiocpp -lportaudio -lpthread -lsndfile -lsamplerate -lsox
+ OBJS = topFrame.o \
+ fdmdv2_main.o \
+@@ -30,9 +30,10 @@
+ dlg_comports.o \
+ dlg_filter.o \
+ varicode.o \
+-sox_biquad.o
++sox_biquad.o \
++serialport.o
+-HDRS = ../version.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 dlg_audiooptions.h topFrame.h varicode.h
++HDRS = ../version.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 dlg_audiooptions.h topFrame.h varicode.h serialport.h
+ all: freedv
+Index: src/Makefile.win32.dmw
+===================================================================
+--- src/Makefile.win32.dmw     (revision 1152)
++++ src/Makefile.win32.dmw     (working copy)
+@@ -40,10 +40,11 @@
+ dlg_comports.o \
+ dlg_filter.o \
+ varicode.o \
+-sox_biquad.o
++sox_biquad.o \
++serialport.o
+-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
++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 serialport.h
+ all: freedv
+Index: src/dlg_comports.cpp
+===================================================================
+--- src/dlg_comports.cpp       (revision 1152)
++++ src/dlg_comports.cpp       (working copy)
+@@ -21,7 +21,6 @@
+ //==========================================================================
+ #include "dlg_comports.h"
+ #include "fdmdv2_main.h"
+-#include <wx/msw/registry.h>
+ #include <sstream>
+ //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+@@ -62,8 +61,9 @@
+     wxArrayString m_listCtrlPortsArr;
+     m_listCtrlPorts = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxSize(-1,45), m_listCtrlPortsArr, wxLB_SINGLE | wxLB_SORT);
+     staticBoxSizer31->Add(m_listCtrlPorts, 1, wxALIGN_CENTER, 0);
+-#endif
+-#ifdef __WXGTK__
++#else
++/*#endif
++#ifdef __WXGTK__*/
+     wxBoxSizer* bSizer83;
+     bSizer83 = new wxBoxSizer(wxHORIZONTAL);
+Index: src/fdmdv2_main.cpp
+===================================================================
+--- src/fdmdv2_main.cpp        (revision 1152)
++++ src/fdmdv2_main.cpp        (working copy)
+@@ -163,7 +163,6 @@
+ {
+     m_zoom              = 1.;
+     m_serialPort        = NULL;
+-    m_device            = NULL;
+     
+     tools->AppendSeparator();
+     wxMenuItem* m_menuItemToolsConfigDelete;
+@@ -857,22 +856,22 @@
+             {
+                 if(wxGetApp().m_boolRTSPos) // RTS asserted HIGH
+                 {
+-                    m_serialPort->SetLineState(ctb::LinestateRts);
++                    m_serialPort->setRTS(true);
+                 }
+                 else                        // RTS asserted LOW
+                 {
+-                    m_serialPort->ClrLineState(ctb::LinestateRts);
++                    m_serialPort->setRTS(false);
+                 }
+             }
+             else                            // Use DTR
+             {
+                 if(wxGetApp().m_boolDTRPos) // DTR asserted HIGH
+                 {
+-                    m_serialPort->SetLineState(ctb::LinestateDtr);
++                    m_serialPort->setDTR(true);
+                 }
+                 else                        // DTR asserted LOW
+                 {
+-                    m_serialPort->ClrLineState(ctb::LinestateDtr);
++                    m_serialPort->setDTR(false);
+                 }
+             }
+         } 
+@@ -882,22 +881,22 @@
+             {
+                 if(wxGetApp().m_boolRTSPos) // RTS cleared LOW
+                 {
+-                    m_serialPort->ClrLineState(ctb::LinestateRts);
++                    m_serialPort->setRTS(false);
+                 }
+                 else                        // RTS cleared HIGH
+                 {
+-                    m_serialPort->SetLineState(ctb::LinestateRts);
++                    m_serialPort->setRTS(true);
+                 }
+             }
+             else                            // Use DTR
+             {
+                 if(wxGetApp().m_boolDTRPos) // DTR cleared LOW
+                 {
+-                    m_serialPort->ClrLineState(ctb::LinestateDtr);
++                    m_serialPort->setDTR(false);
+                 }
+                 else                        // DTR cleared HIGH
+                 {
+-                    m_serialPort->SetLineState(ctb::LinestateDtr);
++                    m_serialPort->setDTR(true);
+                 }
+             }
+         } 
+@@ -1351,13 +1350,15 @@
+ {
+     wxUnusedVar(event);
+     int rv = 0;
+-    int  iLineState  = 0;
++    bool rtsEnabled = false;
++    bool dtrEnabled = false;
+     //bool bPTTEnabled = m_btnTogPTT->IsEnabled();
+     //bool bPTTState   = m_btnTogPTT->GetValue();
+     if(m_serialPort != NULL)
+     {
+-        int iLineState   = m_serialPort->GetLineState();
++        rtsEnabled = m_serialPort->getRTS();
++        dtrEnabled = m_serialPort->getDTR();
+         CloseSerialPort();
+     }
+     ComPortsDlg *dlg = new ComPortsDlg(NULL);
+@@ -1372,21 +1373,21 @@
+         SetupSerialPort();
+         if(m_serialPort != NULL)
+         {
+-            if(iLineState | ctb::LinestateRts)
++            if(rtsEnabled)
+             {
+-                m_serialPort->SetLineState(ctb::LinestateRts);
++                m_serialPort->setRTS(true);
+             }
+             else
+             {
+-                m_serialPort->ClrLineState(ctb::LinestateRts);
++                m_serialPort->setRTS(false);
+             }
+-            if(iLineState | ctb::LinestateDtr)
++            if(dtrEnabled)
+             {
+-                m_serialPort->SetLineState(ctb::LinestateDtr);
++                m_serialPort->setDTR(true);
+             }
+             else
+             {
+-                m_serialPort->ClrLineState(ctb::LinestateDtr);
++                m_serialPort->setDTR(false);
+             }
+         // m_btnTogPTT->Enable(bPTTEnabled);
+         // m_btnTogPTT->SetValue(bPTTState);
+@@ -2631,26 +2632,25 @@
+     if(!wxGetApp().m_strRigCtrlPort.IsEmpty())
+     {
+         wxString protocol = wxGetApp().m_strRigCtrlDatabits + wxGetApp().m_strRigCtrlParity + wxGetApp().m_strRigCtrlStopbits;
+-        m_serialPort = new ctb::SerialPort();
+-        if(m_serialPort->Open(wxGetApp().m_strRigCtrlPort.c_str(), baudrate, protocol.c_str(), ctb::SerialPort::NoFlowControl ) >= 0 ) 
++        m_serialPort = new SerialPort(wxGetApp().m_strRigCtrlPort.ToAscii().data());
++        if(m_serialPort->open(/*baudrate, protocol.c_str()*/ ) >= 0 ) 
+         {
+-            m_device = m_serialPort;
+             //  always start with PTT cleared
+             if(wxGetApp().m_boolRTSPos) // RTS cleared LOW
+             {
+-                m_serialPort->ClrLineState(ctb::LinestateRts);
++                m_serialPort->setRTS(false);
+             }
+             else                        // RTS cleared HIGH
+             {
+-                m_serialPort->SetLineState(ctb::LinestateRts);
++                m_serialPort->setRTS(true);
+             }
+             if(wxGetApp().m_boolDTRPos) // DTR cleared LOW
+             {
+-                m_serialPort->ClrLineState(ctb::LinestateDtr);
++                m_serialPort->setDTR(false);
+             }
+             else                        // DTR cleared HIGH
+             {
+-                m_serialPort->SetLineState(ctb::LinestateDtr);
++                m_serialPort->setDTR(true);
+             }
+             //m_btnTogPTT->Enable(true);
+             m_btnTogPTT->SetValue(false);
+@@ -2658,7 +2658,6 @@
+         else
+         {
+             m_serialPort = NULL;
+-            m_device     = NULL;
+             //m_btnTogPTT->Disable();
+         }
+     }
+@@ -2675,11 +2674,10 @@
+ //----------------------------------------------------------------
+ void MainFrame::CloseSerialPort(void)
+ {
+-    if((m_serialPort != NULL) && m_serialPort->IsOpen())
++    if((m_serialPort != NULL) && m_serialPort->isOpen())
+     {
+-        m_serialPort->Close();
++        m_serialPort->close();
+         m_serialPort = NULL;
+-        m_device     = NULL; 
+         //m_btnTogPTT->SetLabel(wxT("PTT"));
+         //m_btnTogPTT->Enable(false);
+     }
+Index: src/fdmdv2_main.h
+===================================================================
+--- src/fdmdv2_main.h  (revision 1152)
++++ src/fdmdv2_main.h  (working copy)
+@@ -55,10 +55,7 @@
+ #include "codec2_fdmdv.h"
+ #include "codec2_fifo.h"
+-#include "ctb-0.16/ctb.h"
+-#include "ctb-0.16/portscan.h"
+-#include "ctb-0.16/serportx.h"
+-#include "ctb-0.16/serport.h"
++#include "serialport.h"
+ #include "topFrame.h"
+ #include "dlg_comports.h"
+@@ -353,8 +350,7 @@
+     protected:
+-        ctb::IOBase*            m_device;
+-        ctb::SerialPort*        m_serialPort;
++        SerialPort*             m_serialPort;
+         void setsnrBeta(bool snrSlow);
+Index: src/info.plist
+===================================================================
+--- src/info.plist     (revision 0)
++++ src/info.plist     (working copy)
+@@ -0,0 +1,34 @@
++<?xml version="1.0" encoding="UTF-8"?>
++<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
++<plist version="1.0">
++<dict>
++      <key>CFBundleDevelopmentRegion</key>
++      <string>en</string>
++      <key>CFBundleExecutable</key>
++      <string>freedv</string>
++      <key>CFBundleIconFile</key>
++      <string></string>
++      <key>CFBundleIdentifier</key>
++      <string>org.freedv.freedv</string>
++      <key>CFBundleInfoDictionaryVersion</key>
++      <string>6.0</string>
++      <key>CFBundleName</key>
++      <string>FreeDV</string>
++      <key>CFBundlePackageType</key>
++      <string>APPL</string>
++      <key>CFBundleShortVersionString</key>
++      <string>1.0</string>
++      <key>CFBundleSignature</key>
++      <string>????</string>
++      <key>CFBundleVersion</key>
++      <string>1</string>
++      <key>LSMinimumSystemVersion</key>
++      <string>10.5</string>
++      <key>NSHumanReadableCopyright</key>
++      <string>Copyright Â© 2012 FreeDV. All rights reserved.</string>
++      <!--<key>NSMainNibFile</key>
++      <string>MainMenu</string>-->
++      <key>NSPrincipalClass</key>
++      <string>NSApplication</string>
++</dict>
++</plist>
+\ No newline at end of file
+Index: src/serialport.cpp
+===================================================================
+--- src/serialport.cpp (revision 0)
++++ src/serialport.cpp (working copy)
+@@ -0,0 +1,207 @@
++//==========================================================================
++// Name:            serialport.cpp
++//
++// Purpose:         Serial port management.
++// Created:         Dec. 28, 2012
++// Authors:         Mooneer Salem
++// 
++// License:
++//
++//  This program is free software; you can redistribute it and/or modify
++//  it under the terms of the GNU General 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 License
++//  along with this program; if not, see <http://www.gnu.org/licenses/>.
++//
++//==========================================================================
++
++#ifndef WIN32
++#include <fcntl.h>
++#include <termios.h>
++#include <unistd.h>
++#include <sys/ioctl.h>
++#endif // !WIN32
++
++#include "serialport.h"
++
++#define ERROR_CONDITION (-1)
++#ifdef WIN32
++#define INVALID_FILE_DESCRIPTOR (INVALID_HANDLE_VALUE)
++#else
++#define INVALID_FILE_DESCRIPTOR (-1)
++#endif // WIN32
++
++SerialPort::SerialPort(const std::string &portName)
++    : _portName(portName)
++    , _fileDescriptor(INVALID_FILE_DESCRIPTOR)
++#ifdef WIN32
++    , _rtsEnabled(false)
++    , _dtrEnabled(false)
++#endif // WIN32
++{
++    // No action here until open() is called.
++}
++
++SerialPort::~SerialPort()
++{
++    // Close serial port if needed.
++    if (isOpen())
++    {
++        close();
++    }
++}
++
++#ifndef WIN32
++static int posixGetModemControlBits(const int fileDescriptor)
++{
++    int modemControlBits = 0;
++    
++    if (ioctl(fileDescriptor, TIOCMGET, &modemControlBits) == 0)
++    {
++        return modemControlBits;
++    }
++    else
++    {
++        return ERROR_CONDITION;
++    }
++}
++
++static int posixSetModemControlBits(const int fileDescriptor, int modemControlBits)
++{
++    if (ioctl(fileDescriptor, TIOCMSET, &modemControlBits) == 0)
++    {
++        return modemControlBits;
++    }
++    else
++    {
++        return ERROR_CONDITION;
++    }
++}
++#endif // !WIN32
++
++bool SerialPort::getRTS() const
++{
++#ifdef WIN32
++    // No way to get DTR/RTS directly from Windows, so we have to
++    // grab what the caller put in during a previous set*() call.
++    return _rtsEnabled;
++#else
++    int tmpbits = posixGetModemControlBits(_fileDescriptor);
++    if (tmpbits != ERROR_CONDITION)
++    {
++        return tmpbits & TIOCM_RTS;
++    }
++    else
++    {
++        return ERROR_CONDITION;
++    }
++#endif // WIN32
++}
++
++void SerialPort::setRTS(const bool newRTS)
++{
++#ifdef WIN32
++    if (newRTS)
++    {
++        EscapeCommFunction(_fileDescriptor, SETRTS);
++    }
++    else
++    {
++        EscapeCommFunction(_fileDescriptor, CLRRTS);
++    }
++    _rtsEnabled = newRTS;
++#else
++    int tmpbits = posixGetModemControlBits(_fileDescriptor);
++    if (tmpbits != ERROR_CONDITION)
++    {
++        if (newRTS) tmpbits |= TIOCM_RTS;
++        else tmpbits &= ~TIOCM_RTS;
++        posixSetModemControlBits(_fileDescriptor, tmpbits);
++    }
++#endif // WIN32
++}
++    
++bool SerialPort::getDTR() const
++{
++#ifdef WIN32
++    // No way to get DTR/RTS directly from Windows, so we have to
++    // grab what the caller put in during a previous set*() call.
++    return _dtrEnabled;
++#else
++    int tmpbits = posixGetModemControlBits(_fileDescriptor);
++    if (tmpbits != ERROR_CONDITION)
++    {
++        return tmpbits & TIOCM_DTR;
++    }
++    else
++    {
++        return ERROR_CONDITION;
++    }
++#endif // WIN32
++}
++
++void SerialPort::setDTR(const bool newDTR)
++{
++#ifdef WIN32
++    if (newDTR)
++    {
++        EscapeCommFunction(_fileDescriptor, SETDTR);
++    }
++    else
++    {
++        EscapeCommFunction(_fileDescriptor, CLRDTR);
++    }
++    _dtrEnabled = newDTR;
++#else
++    int tmpbits = posixGetModemControlBits(_fileDescriptor);
++    if (tmpbits != ERROR_CONDITION)
++    {
++        if (newDTR) tmpbits |= TIOCM_DTR;
++        else tmpbits &= ~TIOCM_DTR;
++        posixSetModemControlBits(_fileDescriptor, tmpbits);
++    }
++#endif // WIN32
++}
++    
++int SerialPort::open()
++{
++#ifdef WIN32
++    TCHAR portName[32];
++    _stprintf_s(portName, sizeof(portName)/sizeof(TCHAR), _T("\\\\.\\%s"), _portName.c_str());
++    
++    _fileDescriptor = CreateFile(
++        portName, 
++        GENERIC_READ | GENERIC_WRITE,
++        0, 
++        0, 
++        OPEN_EXISTING, 
++        FILE_FLAG_OVERLAPPED, 
++        0);
++#else
++    _fileDescriptor = ::open(_portName.c_str(), O_RDWR);
++#endif // WIN32
++
++    return (int)_fileDescriptor;
++}
++
++int SerialPort::close()
++{
++#ifdef WIN32
++    int rv = CloseHandle(_fileDescriptor);
++#else
++    int rv = ::close(_fileDescriptor);
++#endif // WIN32
++
++    _fileDescriptor = INVALID_FILE_DESCRIPTOR;
++    return rv;
++}
++    
++bool SerialPort::isOpen() const
++{
++    return _fileDescriptor != INVALID_FILE_DESCRIPTOR;
++}
+\ No newline at end of file
+Index: src/serialport.h
+===================================================================
+--- src/serialport.h   (revision 0)
++++ src/serialport.h   (working copy)
+@@ -0,0 +1,81 @@
++//==========================================================================
++// Name:            serialport.h
++//
++// Purpose:         Serial port management.
++// Created:         Dec. 28, 2012
++// Authors:         Mooneer Salem
++// 
++// License:
++//
++//  This program is free software; you can redistribute it and/or modify
++//  it under the terms of the GNU General 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 License
++//  along with this program; if not, see <http://www.gnu.org/licenses/>.
++//
++//==========================================================================
++
++#ifndef SERIAL_PORT_H
++#define SERIAL_PORT_H
++
++#ifdef WIN32
++#include <windows.h>
++#endif // WIN32
++
++#include <string>
++
++enum SerialPortParity
++{
++    NONE,
++    EVEN,
++    ODD
++};
++
++// Quick and dirty serial port class that supports the minimum necessary to
++// do PTT (for now). Can be extended later (send/receive data for CAT control, 
++// for example).
++class SerialPort
++{
++public:
++    // portName is a path to the serial port, in one of the following formats:
++    // OSX: /dev/tty.*
++    // Linux: /dev/ttyS*
++    // Windows: COM*:
++    SerialPort(const std::string &portName);
++    virtual ~SerialPort();
++    
++    bool getRTS() const;
++    void setRTS(const bool newRTS);
++    
++    bool getDTR() const;
++    void setDTR(const bool newDTR);
++    
++    int open();
++    int close();
++    
++    bool isOpen() const;
++    
++private:
++    const std::string _portName;
++    
++#ifdef WIN32
++    HANDLE _fileDescriptor;
++    
++    bool _rtsEnabled;
++    bool _dtrEnabled;
++#else
++    int _fileDescriptor;
++#endif // WIN32
++        
++    // Object should not be copied since there can be only one handle open
++    // per serial port. An attempt to use the copy constructor here, even
++    // implicitly, will result in a compile error due to the declaration below.
++    SerialPort(const SerialPort&);
++};
++
++#endif // SERIAL_PORT_H
+\ No newline at end of file
diff --git a/freedv/branches/0.97/build/codelite/libPortCtrl/libPortCtrl.mk b/freedv/branches/0.97/build/codelite/libPortCtrl/libPortCtrl.mk
new file mode 100644 (file)
index 0000000..fd5c6a2
--- /dev/null
@@ -0,0 +1,103 @@
+##\r
+## Auto Generated makefile by CodeLite IDE\r
+## any manual changes will be erased      \r
+##\r
+## Release\r
+ProjectName            :=libPortCtrl\r
+ConfigurationName      :=Release\r
+WorkspacePath          := "D:\Projects\Radio\fdmdv2\build\codelite"\r
+ProjectPath            := "D:\Projects\Radio\fdmdv2\build\codelite\libPortCtrl"\r
+IntermediateDirectory  :=./Release\r
+OutDir                 := $(IntermediateDirectory)\r
+CurrentFileName        :=\r
+CurrentFilePath        :=\r
+CurrentFileFullPath    :=\r
+User                   :=wittend\r
+Date                   :=3/22/2013\r
+CodeLitePath           :="D:\bin\CodeLite"\r
+LinkerName             :=g++\r
+SharedObjectLinkerName :=g++ -shared -fPIC\r
+ObjectSuffix           :=.o\r
+DependSuffix           :=.o.d\r
+PreprocessSuffix       :=.o.i\r
+DebugSwitch            :=-gstab\r
+IncludeSwitch          :=-I\r
+LibrarySwitch          :=-l\r
+OutputSwitch           :=-o \r
+LibraryPathSwitch      :=-L\r
+PreprocessorSwitch     :=-D\r
+SourceSwitch           :=-c \r
+OutputFile             :=$(IntermediateDirectory)/lib$(ProjectName).a\r
+Preprocessors          :=\r
+ObjectSwitch           :=-o \r
+ArchiveOutputSwitch    := \r
+PreprocessOnlySwitch   :=-E \r
+ObjectsFileList        :="libPortCtrl.txt"\r
+PCHCompileFlags        :=\r
+MakeDirCommand         :=makedir\r
+RcCmpOptions           := \r
+RcCompilerName         :=windres\r
+LinkOptions            :=  \r
+IncludePath            :=  $(IncludeSwitch). $(IncludeSwitch). \r
+IncludePCH             := \r
+RcIncludePath          := \r
+Libs                   := \r
+ArLibs                 :=  \r
+LibPath                := $(LibraryPathSwitch). \r
+\r
+##\r
+## Common variables\r
+## AR, CXX, CC, CXXFLAGS and CFLAGS can be overriden using an environment variables\r
+##\r
+AR       := ar rcus\r
+CXX      := g++\r
+CC       := gcc\r
+CXXFLAGS :=    -DSVN_REVISION=\"1221\"  $(Preprocessors)\r
+CFLAGS   :=    -DSVN_REVISION=\"1221\"  $(Preprocessors)\r
+\r
+\r
+##\r
+## User defined environment variables\r
+##\r
+CodeLiteDir:=D:\bin\CodeLite\r
+WXWIN:=D:\bin\wxWidgets-2.9.4\r
+PATH:=$(WXWIN)\lib\gcc_dll;$(PATH)\r
+WXCFG:=gcc_dll\mswu\r
+UNIT_TEST_PP_SRC_DIR:=D:\bin\UnitTest++1.3\r
+\r
+\r
+Objects=\r
+\r
+##\r
+## Main Build Targets \r
+##\r
+.PHONY: all clean PreBuild PrePreBuild PostBuild\r
+all: $(IntermediateDirectory) $(OutputFile)\r
+\r
+$(OutputFile): $(Objects)\r
+       @$(MakeDirCommand) $(@D)\r
+       @echo "" > $(IntermediateDirectory)/.d\r
+       $(AR) $(ArchiveOutputSwitch)$(OutputFile) @$(ObjectsFileList) $(ArLibs)\r
+       @$(MakeDirCommand) "D:\Projects\Radio\fdmdv2\build\codelite/.build-release"\r
+       @echo rebuilt > "D:\Projects\Radio\fdmdv2\build\codelite/.build-release/libPortCtrl"\r
+\r
+./Release:\r
+       @$(MakeDirCommand) "./Release"\r
+\r
+PreBuild:\r
+\r
+\r
+##\r
+## Objects\r
+##\r
+\r
+-include $(IntermediateDirectory)/*$(DependSuffix)\r
+##\r
+## Clean\r
+##\r
+clean:\r
+       $(RM) $(OutputFile)\r
+       $(RM) $(OutputFile)\r
+       $(RM) "../.build-release/libPortCtrl"\r
+\r
+\r
diff --git a/freedv/branches/0.97/build/codelite/libPortCtrl/libPortCtrl.project b/freedv/branches/0.97/build/codelite/libPortCtrl/libPortCtrl.project
new file mode 100644 (file)
index 0000000..8338fe1
--- /dev/null
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CodeLite_Project Name="libPortCtrl" InternalType="Library">
+  <Description/>
+  <Dependencies/>
+  <Settings Type="Static Library">
+    <GlobalSettings>
+      <Compiler Options="" C_Options="">
+        <IncludePath Value="."/>
+      </Compiler>
+      <Linker Options="">
+        <LibraryPath Value="."/>
+      </Linker>
+      <ResourceCompiler Options=""/>
+    </GlobalSettings>
+    <Configuration Name="Debug" CompilerType="gnu g++" DebuggerType="GNU gdb debugger" Type="" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append">
+      <Compiler Options="-g" C_Options="-g" Required="yes" PreCompiledHeader="" PCHInCommandLine="no" UseDifferentPCHFlags="no" PCHFlags="">
+        <IncludePath Value="."/>
+      </Compiler>
+      <Linker Options="" Required="yes"/>
+      <ResourceCompiler Options="" Required="no"/>
+      <General OutputFile="$(IntermediateDirectory)/lib$(ProjectName).a" IntermediateDirectory="./Debug" Command="" CommandArguments="" UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="yes"/>
+      <Environment EnvVarSetName="&lt;Use Defaults&gt;" DbgSetName="&lt;Use Defaults&gt;">
+        <![CDATA[]]>
+      </Environment>
+      <Debugger IsRemote="no" RemoteHostName="" RemoteHostPort="" DebuggerPath="">
+        <PostConnectCommands/>
+        <StartupCommands/>
+      </Debugger>
+      <PreBuild/>
+      <PostBuild/>
+      <CustomBuild Enabled="no">
+        <RebuildCommand/>
+        <CleanCommand/>
+        <BuildCommand/>
+        <PreprocessFileCommand/>
+        <SingleFileCommand/>
+        <MakefileGenerationCommand/>
+        <ThirdPartyToolName/>
+        <WorkingDirectory/>
+      </CustomBuild>
+      <AdditionalRules>
+        <CustomPostBuild/>
+        <CustomPreBuild/>
+      </AdditionalRules>
+      <Completion EnableCpp11="no">
+        <ClangCmpFlagsC/>
+        <ClangCmpFlags/>
+        <ClangPP/>
+        <SearchPaths/>
+      </Completion>
+    </Configuration>
+    <Configuration Name="Release" CompilerType="gnu g++" DebuggerType="GNU gdb debugger" Type="" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append">
+      <Compiler Options="" C_Options="" Required="yes" PreCompiledHeader="" PCHInCommandLine="no" UseDifferentPCHFlags="no" PCHFlags="">
+        <IncludePath Value="."/>
+      </Compiler>
+      <Linker Options="" Required="yes"/>
+      <ResourceCompiler Options="" Required="no"/>
+      <General OutputFile="$(IntermediateDirectory)/lib$(ProjectName).a" IntermediateDirectory="./Release" Command="" CommandArguments="" UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="yes"/>
+      <Environment EnvVarSetName="&lt;Use Defaults&gt;" DbgSetName="&lt;Use Defaults&gt;">
+        <![CDATA[]]>
+      </Environment>
+      <Debugger IsRemote="no" RemoteHostName="" RemoteHostPort="" DebuggerPath="">
+        <PostConnectCommands/>
+        <StartupCommands/>
+      </Debugger>
+      <PreBuild/>
+      <PostBuild/>
+      <CustomBuild Enabled="no">
+        <RebuildCommand/>
+        <CleanCommand/>
+        <BuildCommand/>
+        <PreprocessFileCommand/>
+        <SingleFileCommand/>
+        <MakefileGenerationCommand/>
+        <ThirdPartyToolName/>
+        <WorkingDirectory/>
+      </CustomBuild>
+      <AdditionalRules>
+        <CustomPostBuild/>
+        <CustomPreBuild/>
+      </AdditionalRules>
+      <Completion EnableCpp11="no">
+        <ClangCmpFlagsC/>
+        <ClangCmpFlags/>
+        <ClangPP/>
+        <SearchPaths/>
+      </Completion>
+    </Configuration>
+  </Settings>
+  <VirtualDirectory Name="src"/>
+  <VirtualDirectory Name="include"/>
+  <Dependencies Name="Debug"/>
+  <Dependencies Name="Release"/>
+</CodeLite_Project>
diff --git a/freedv/branches/0.97/build/codelite/libPortCtrl/libPortCtrl.txt b/freedv/branches/0.97/build/codelite/libPortCtrl/libPortCtrl.txt
new file mode 100644 (file)
index 0000000..e3f4898
--- /dev/null
@@ -0,0 +1 @@
+ECHO is off.\r
diff --git a/freedv/branches/0.97/build/codelite/wxcrafter.xrc b/freedv/branches/0.97/build/codelite/wxcrafter.xrc
new file mode 100644 (file)
index 0000000..3961d4b
--- /dev/null
@@ -0,0 +1,180 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<resource xmlns="http://www.wxwindows.org/wxxrc" version="2.3.0.1">
+  <object class="wxDialog" name="PTTDialog">
+    <title>Hardware PTT</title>
+    <centered>1</centered>
+    <style>wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</style>
+    <size>450,300</size>
+    <object class="wxBoxSizer">
+      <orient>wxVERTICAL</orient>
+      <object class="sizeritem" name="staticBoxSizer28">
+        <flag>wxEXPAND|wxALIGN_CENTER_VERTICAL</flag>
+        <border>5</border>
+        <object class="wxStaticBoxSizer" name="staticBoxSizer28">
+          <sizeritem>
+            <object class="spacer"/>
+          </sizeritem>
+          <orient>wxVERTICAL</orient>
+          <label>Audio Tone</label>
+          <object class="sizeritem">
+            <flag>wxALIGN_CENTER|wxALIGN_CENTER_VERTICAL</flag>
+            <border>5</border>
+            <object class="wxCheckBox" name="m_ckPTTRtChan">
+              <style/>
+              <label>PTT tone on right audio channel</label>
+              <checked>0</checked>
+            </object>
+          </object>
+        </object>
+      </object>
+      <object class="sizeritem" name="staticBoxSizer17">
+        <flag>wxEXPAND</flag>
+        <border>5</border>
+        <option>1</option>
+        <object class="wxStaticBoxSizer" name="staticBoxSizer17">
+          <sizeritem>
+            <object class="spacer"/>
+          </sizeritem>
+          <orient>wxVERTICAL</orient>
+          <label>Hardware PTT Settings</label>
+          <object class="sizeritem" name="staticBoxSizer31">
+            <flag>wxEXPAND</flag>
+            <border>5</border>
+            <object class="wxStaticBoxSizer" name="staticBoxSizer31">
+              <sizeritem>
+                <object class="spacer"/>
+              </sizeritem>
+              <orient>wxVERTICAL</orient>
+              <label>PTT Port</label>
+              <object class="sizeritem">
+                <flag>wxALIGN_CENTER</flag>
+                <option>1</option>
+                <object class="wxListBox" name="m_listCtrlPorts">
+                  <style>wxLB_SINGLE</style>
+                  <content/>
+                  <selection>-1</selection>
+                </object>
+              </object>
+            </object>
+          </object>
+          <object class="sizeritem" name="boxSizer19">
+            <flag>wxEXPAND</flag>
+            <border>5</border>
+            <option>1</option>
+            <object class="wxBoxSizer">
+              <orient>wxVERTICAL</orient>
+              <object class="sizeritem" name="staticBoxSizer16">
+                <flag>wxEXPAND|wxALIGN_CENTER|wxALIGN_RIGHT</flag>
+                <border>5</border>
+                <option>1</option>
+                <object class="wxStaticBoxSizer" name="staticBoxSizer16">
+                  <sizeritem>
+                    <object class="spacer"/>
+                  </sizeritem>
+                  <orient>wxHORIZONTAL</orient>
+                  <label>Signal polarity</label>
+                  <object class="sizeritem" name="gridSizer17">
+                    <flag>wxEXPAND|wxALIGN_RIGHT</flag>
+                    <border>5</border>
+                    <option>1</option>
+                    <object class="wxGridSizer">
+                      <cols>2</cols>
+                      <rows>3</rows>
+                      <vgap>0</vgap>
+                      <hgap>0</hgap>
+                      <object class="sizeritem">
+                        <flag>wxALIGN_CENTER</flag>
+                        <border>10</border>
+                        <object class="wxCheckBox" name="m_ckUseSerialPTT">
+                          <style/>
+                          <label>Use Serial Port PTT</label>
+                          <checked>0</checked>
+                        </object>
+                      </object>
+                      <object class="spacer" name="Spacer">
+                        <flag/>
+                        <border>5</border>
+                      </object>
+                      <object class="sizeritem">
+                        <flag>wxALIGN_CENTER|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL</flag>
+                        <border>5</border>
+                        <object class="wxRadioButton" name="m_rbUseDTR">
+                          <style/>
+                          <label>Use DTR</label>
+                          <value>1</value>
+                        </object>
+                      </object>
+                      <object class="sizeritem">
+                        <flag>wxALIGN_CENTER|wxALIGN_RIGHT</flag>
+                        <border>5</border>
+                        <object class="wxCheckBox" name="m_ckRTSPos">
+                          <style/>
+                          <label>DTR = +V</label>
+                          <checked>0</checked>
+                        </object>
+                      </object>
+                      <object class="sizeritem">
+                        <flag>wxALIGN_CENTER|wxALIGN_RIGHT</flag>
+                        <border>5</border>
+                        <object class="wxRadioButton" name="m_rbUseRTS">
+                          <style/>
+                          <label>Use RTS</label>
+                          <tooltip>Toggle the RTS pin for PTT</tooltip>
+                          <value>1</value>
+                        </object>
+                      </object>
+                      <object class="sizeritem">
+                        <flag>wxALIGN_CENTER|wxALIGN_RIGHT</flag>
+                        <border>5</border>
+                        <object class="wxCheckBox" name="m_ckDTRPos">
+                          <tooltip>Set Polarity of the RTS line</tooltip>
+                          <style/>
+                          <label>RTS = +V</label>
+                          <checked>0</checked>
+                        </object>
+                      </object>
+                    </object>
+                  </object>
+                </object>
+              </object>
+            </object>
+          </object>
+        </object>
+      </object>
+      <object class="sizeritem" name="boxSizer12">
+        <flag>wxLEFT|wxRIGHT|wxTOP|wxBOTTOM|wxALIGN_CENTER_HORIZONTAL</flag>
+        <border>5</border>
+        <object class="wxBoxSizer">
+          <orient>wxHORIZONTAL</orient>
+          <object class="sizeritem">
+            <flag>wxLEFT|wxRIGHT|wxTOP|wxBOTTOM</flag>
+            <border>5</border>
+            <object class="wxButton" name="m_buttonOK">
+              <label>OK</label>
+              <style/>
+              <default>1</default>
+            </object>
+          </object>
+          <object class="sizeritem">
+            <flag>wxLEFT|wxRIGHT|wxTOP|wxBOTTOM</flag>
+            <border>5</border>
+            <object class="wxButton" name="m_buttonCancel">
+              <label>Cancel</label>
+              <style/>
+              <default>0</default>
+            </object>
+          </object>
+          <object class="sizeritem">
+            <flag>wxLEFT|wxRIGHT|wxTOP|wxBOTTOM</flag>
+            <border>5</border>
+            <object class="wxButton" name="m_buttonApply">
+              <label>Apply</label>
+              <style/>
+              <default>0</default>
+            </object>
+          </object>
+        </object>
+      </object>
+    </object>
+  </object>
+</resource>
diff --git a/freedv/branches/0.97/build/msvc/.gitignore b/freedv/branches/0.97/build/msvc/.gitignore
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/freedv/branches/0.97/cmake/BuildCodec2.cmake b/freedv/branches/0.97/cmake/BuildCodec2.cmake
new file mode 100644 (file)
index 0000000..034bc46
--- /dev/null
@@ -0,0 +1,15 @@
+if(CMAKE_CROSSCOMPILING)
+    set(CODEC2_CMAKE_ARGS "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
+endif()
+
+include(ExternalProject)
+ExternalProject_Add(codec2
+   SVN_REPOSITORY https://svn.code.sf.net/p/freetel/code/codec2
+   CMAKE_ARGS ${CODEC2_CMAKE_ARGS}
+   INSTALL_COMMAND ""
+)
+set(CODEC2_LIBRARIES
+    ${CMAKE_BINARY_DIR}/codec2-prefix/src/codec2-build/src/libcodec2.a)
+include_directories(${CMAKE_BINARY_DIR}/codec2-prefix/src/codec2/src)
+list(APPEND FREEDV_LINK_LIBS ${CODEC2_LIBRARIES})
+list(APPEND FREEDV_STATIC_DEPS codec2)
diff --git a/freedv/branches/0.97/cmake/BuildLibctb.cmake b/freedv/branches/0.97/cmake/BuildLibctb.cmake
new file mode 100644 (file)
index 0000000..bb98bd2
--- /dev/null
@@ -0,0 +1,19 @@
+set(LIBCTB_TARBALL "libctb-0.16")
+
+include(ExternalProject)
+ExternalProject_Add(libctb
+   URL https://iftools.com/download/ctb/0.16/${LIBCTB_TARBALL}.tar.gz
+   PATCH_COMMAND patch -p1 < ${CMAKE_SOURCE_DIR}/cmake/libctb.patch
+   CMAKE_ARGS -DBUILD_SHARED_LIBS=FALSE
+   INSTALL_COMMAND ""
+)
+if(WIN32)
+   set(LIBCTB_LIBRARY
+       ${CMAKE_BINARY_DIR}/libctb-prefix/src/libctb-build/src/ctb-0.16.lib)
+else(WIN32)
+   set(LIBCTB_LIBRARY
+       ${CMAKE_BINARY_DIR}/libctb-prefix/src/libctb-build/src/libctb-0.16.a)
+endif(WIN32)
+include_directories(${CMAKE_BINARY_DIR}/libctb-prefix/src/libctb/include)
+list(APPEND FREEDV_LINK_LIBS ${LIBCTB_LIBRARY})
+list(APPEND FREEDV_STATIC_DEPS libctb)
diff --git a/freedv/branches/0.97/cmake/BuildPortaudio.cmake b/freedv/branches/0.97/cmake/BuildPortaudio.cmake
new file mode 100644 (file)
index 0000000..445b1e1
--- /dev/null
@@ -0,0 +1,41 @@
+set(PORTAUDIO_TARBALL "pa_stable_v19_20111121")
+
+# required linking libraries on linux. Not sure about windows.
+find_library(ALSA_LIBRARIES asound)
+
+if(UNIX AND NOT ALSA_LIBRARIES)
+    message(ERROR "Could not find alsa library which is required for portaudio.
+On Linux systems try installing:
+    alsa-lib-devel  (RPM based systems)
+    libasound2-dev  (DEB based systems)"
+    )
+endif()
+
+include(ExternalProject)
+ExternalProject_Add(portaudio
+    URL http://www.portaudio.com/archives/${PORTAUDIO_TARBALL}.tgz
+    BUILD_IN_SOURCE 1
+    INSTALL_DIR external/dist
+    CONFIGURE_COMMAND ./configure --enable-cxx --without-jack --prefix=${CMAKE_BINARY_DIR}/external/dist
+    BUILD_COMMAND $(MAKE)
+    INSTALL_COMMAND $(MAKE) install
+)
+if(WIN32)
+    set(PORTAUDIO_LIBRARIES ${CMAKE_BINARY_DIR}/external/dist/lib/portaudio.lib)
+else(WIN32)
+    find_library(RT rt)
+    find_library(ASOUND asound)
+    set(PORTAUDIO_LIBRARIES
+        ${CMAKE_BINARY_DIR}/external/dist/lib/libportaudio.a
+        ${CMAKE_BINARY_DIR}/external/dist/lib/libportaudiocpp.a
+        ${RT}
+        ${ASOUND}
+    )
+endif(WIN32)
+include_directories(${CMAKE_BINARY_DIR}/external/dist/include)
+
+# Add the portaudio library to the list of libraries that must be linked.
+list(APPEND FREEDV_LINK_LIBS ${PORTAUDIO_LIBRARIES})
+
+# Setup a dependency so that this gets built before linking to freedv.
+list(APPEND FREEDV_STATIC_DEPS portaudio)
diff --git a/freedv/branches/0.97/cmake/BuildSamplerate.cmake b/freedv/branches/0.97/cmake/BuildSamplerate.cmake
new file mode 100644 (file)
index 0000000..a3be551
--- /dev/null
@@ -0,0 +1,21 @@
+set(SAMPLERATE_TARBALL "libsamplerate-0.1.8")
+
+include(ExternalProject)
+ExternalProject_Add(samplerate
+    URL http://www.mega-nerd.com/SRC/${SAMPLERATE_TARBALL}.tar.gz 
+    BUILD_IN_SOURCE 1
+    INSTALL_DIR external/dist
+    CONFIGURE_COMMAND ./configure --prefix=${CMAKE_BINARY_DIR}/external/dist
+    BUILD_COMMAND $(MAKE)
+    INSTALL_COMMAND $(MAKE) install
+)
+if(WIN32)
+    set(SAMPLERATE_LIBRARIES
+        ${CMAKE_BINARY_DIR}/external/dist/lib/samplerate.lib)
+else(WIN32)
+    set(SAMPLERATE_LIBRARIES
+        ${CMAKE_BINARY_DIR}/external/dist/lib/libsamplerate.a)
+endif(WIN32)
+include_directories(${CMAKE_BINARY_DIR}/external/dist/include)
+list(APPEND FREEDV_LINK_LIBS ${SAMPLERATE_LIBRARIES})
+list(APPEND FREEDV_STATIC_DEPS samplerate)
diff --git a/freedv/branches/0.97/cmake/BuildSndfile.cmake b/freedv/branches/0.97/cmake/BuildSndfile.cmake
new file mode 100644 (file)
index 0000000..2375c47
--- /dev/null
@@ -0,0 +1,20 @@
+set(SNDFILE_TARBALL "libsndfile-1.0.25")
+
+include(ExternalProject)
+ExternalProject_Add(sndfile
+    URL http://www.mega-nerd.com/libsndfile/files/${SNDFILE_TARBALL}.tar.gz
+    BUILD_IN_SOURCE 1
+    INSTALL_DIR external/dist
+    CONFIGURE_COMMAND ./configure --prefix=${CMAKE_BINARY_DIR}/external/dist --disable-external-libs --disable-shared
+    BUILD_COMMAND $(MAKE) V=1
+    INSTALL_COMMAND $(MAKE) install
+)
+if(MINGW)
+    set(SNDFILE_LIBRARIES ${CMAKE_BINARY_DIR}/external/dist/bin/libsndfile-1.dll)
+else()
+    set(SNDFILE_LIBRARIES ${CMAKE_BINARY_DIR}/external/dist/lib/libsndfile.a)
+endif()
+
+include_directories(${CMAKE_BINARY_DIR}/external/dist/include)
+list(APPEND FREEDV_LINK_LIBS ${SNDFILE_LIBRARIES})
+list(APPEND FREEDV_STATIC_DEPS sndfile)
diff --git a/freedv/branches/0.97/cmake/BuildSox.cmake b/freedv/branches/0.97/cmake/BuildSox.cmake
new file mode 100644 (file)
index 0000000..635fc93
--- /dev/null
@@ -0,0 +1,41 @@
+set(SOX_TARBALL "sox-14.4.1")
+
+# required linking libraries on linux. Not sure about windows.
+find_library(ALSA_LIBRARIES asound)
+find_library(AO_LIBRARIES ao)
+
+if(UNIX AND NOT ALSA_LIBRARIES)
+    message(ERROR "Could not find alsa library.
+On Linux systems try installing:
+    alsa-lib-devel  (RPM based systems)
+    libasound2-dev  (DEB based systems)"
+    )
+endif(UNIX AND NOT ALSA_LIBRARIES)
+
+if(UNIX AND NOT AO_LIBRARIES)
+    message(ERROR "Could not find libao.
+On Linux systems try installing:
+    libao-devel  (RPM based systems)
+    libao-dev    (DEB based systems)"
+    )
+endif(UNIX AND NOT AO_LIBRARIES)
+
+include(ExternalProject)
+ExternalProject_Add(sox
+    URL http://downloads.sourceforge.net/sox/${SOX_TARBALL}.tar.gz
+    BUILD_IN_SOURCE 1
+    INSTALL_DIR external/dist
+    CONFIGURE_COMMAND ./configure --enable-shared=no --without-id3tag --without-png --disable-gomp --with-oggvorbis=no --with-oss=no --with-flac=no --with-amrnb=no --with-amrwb=no --with-mp3=no --with-wavpack=no --disable-dl-sndfile --with-pulseaudio=no --without-magic --prefix=${CMAKE_BINARY_DIR}/external/dist
+    BUILD_COMMAND $(MAKE) V=1
+    INSTALL_COMMAND $(MAKE) install
+)
+set(SOX_LIBRARIES ${CMAKE_BINARY_DIR}/external/dist/lib/libsox.a)
+if(UNIX)
+    list(APPEND SOX_LIBRARIES ${ALSA_LIBRARIES} ${AO_LIBRARIES})
+endif()
+if(MINGW)
+    list(APPEND SOX_LIBRARIES winmm)
+endif()
+include_directories(${CMAKE_BINARY_DIR}/external/dist/include)
+list(APPEND FREEDV_LINK_LIBS ${SOX_LIBRARIES})
+list(APPEND FREEDV_STATIC_DEPS sox)
\ No newline at end of file
diff --git a/freedv/branches/0.97/cmake/BuildWxWidgets.cmake b/freedv/branches/0.97/cmake/BuildWxWidgets.cmake
new file mode 100644 (file)
index 0000000..7dbcd1e
--- /dev/null
@@ -0,0 +1,40 @@
+set(WXWIDGETS_TARBALL "wxWidgets-3.0.2")
+
+# If we're cross-compiling then we need to set the target host manually.
+if(MINGW AND CMAKE_CROSSCOMPILING)
+    if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
+        set(HOST x86_64-w64-mingw32)
+    else()
+        set(HOST i686-w64-mingw32)
+    endif()
+endif()
+
+# If not cross-compiling then use the built-in makefile, otherwise use standard configure.
+if(MINGW AND NOT CMAKE_CROSSCOMPILING)
+#    set(CONFIGURE_COMMAND "true")
+#    set(MAKE_COMMAND $(MAKE) -C build/msw -f makefile.gcc SHARED=0 UNICODE=1 BUILD=release PREFIX=${CMAKE_BINARY_DIR}/external/dist)
+    set(CONFIGURE_COMMAND ./configure --disable-shared --prefix=${CMAKE_BINARY_DIR}/external/dist)
+       set(MAKE_COMMAND $(MAKE))
+else()
+    set(CONFIGURE_COMMAND ./configure --host=${HOST} --target=${HOST} --disable-shared --prefix=${CMAKE_BINARY_DIR}/external/dist)
+       set(MAKE_COMMAND $(MAKE))
+endif()
+
+include(ExternalProject)
+ExternalProject_Add(wxWidgets
+    URL http://downloads.sourceforge.net/wxwindows/${WXWIDGETS_TARBALL}.tar.bz2
+    BUILD_IN_SOURCE 1
+    INSTALL_DIR external/dist
+    CONFIGURE_COMMAND ${CONFIGURE_COMMAND}
+    BUILD_COMMAND ${MAKE_COMMAND}
+    INSTALL_COMMAND $(MAKE) install
+)
+
+ExternalProject_Get_Property(wxWidgets install_dir)
+message(STATUS "wxWidgets install dir: ${install_dir}")
+if(NOT WXCONFIG)
+    set(WXCONFIG "${install_dir}/bin/wx-config")
+endif()
+if(EXISTS ${WXCONFIG})
+    set(BS_WX_DONE TRUE)
+endif()
diff --git a/freedv/branches/0.97/cmake/FindPortaudio.cmake b/freedv/branches/0.97/cmake/FindPortaudio.cmake
new file mode 100644 (file)
index 0000000..9eca1d0
--- /dev/null
@@ -0,0 +1,112 @@
+# - Try to find Portaudio
+# Once done this will define
+#
+#  PORTAUDIO_FOUND - system has Portaudio
+#  PORTAUDIO_INCLUDE_DIRS - the Portaudio include directory
+#  PORTAUDIO_LIBRARIES - Link these to use Portaudio
+#  PORTAUDIO_DEFINITIONS - Compiler switches required for using Portaudio
+#  PORTAUDIO_VERSION - Portaudio version
+#
+#  Copyright (c) 2006 Andreas Schneider <mail@cynapses.org>
+#
+# Redistribution and use is allowed according to the terms of the New BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+#
+
+
+if(PORTAUDIO_LIBRARIES AND PORTAUDIO_INCLUDE_DIRS)
+  # in cache already
+  set(PORTAUDIO_FOUND TRUE)
+else(PORTAUDIO_LIBRARIES AND PORTAUDIO_INCLUDE_DIRS)
+  if(NOT WIN32 OR (MINGW AND CMAKE_CROSSCOMPILING))
+   include(FindPkgConfig)
+   pkg_check_modules(PORTAUDIO2 portaudio-2.0)
+  endif()
+
+  if(PORTAUDIO2_FOUND)
+
+    set(PORTAUDIO_INCLUDE_DIRS ${PORTAUDIO2_INCLUDE_DIRS})
+    if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+      set(PORTAUDIO_LIBRARIES "${PORTAUDIO2_LIBRARY_DIRS}/lib${PORTAUDIO2_LIBRARIES}.dylib")
+    else()
+      # CMake prefers absolute library paths.
+      foreach(_lib portaudio-2;${PORTAUDIO2_LIBRARIES})
+        find_library(${_lib}_LIB ${_lib} {PORTAUDIO2_LIBDIR})
+        if(${_lib}_LIB)
+          list(APPEND PORTAUDIO_LIBRARIES ${${_lib}_LIB})
+        endif()
+      endforeach()
+    endif()
+    set(PORTAUDIO_VERSION 19)
+    set(PORTAUDIO_FOUND TRUE)
+
+  else(PORTAUDIO2_FOUND)
+
+    find_path(PORTAUDIO_INCLUDE_DIR
+      NAMES
+        portaudio.h
+      PATHS
+        /usr/include
+        /usr/local/include
+        /opt/local/include
+        /sw/include
+    )
+   
+    find_library(PORTAUDIO_LIBRARY
+      NAMES
+        portaudio
+      PATHS
+        /usr/lib
+        /usr/local/lib
+        /opt/local/lib
+        /sw/lib
+    )
+   
+    find_path(PORTAUDIO_LIBRARY_DIR
+      NAMES
+        portaudio
+      PATHS
+        ${CMAKE_SYSTEM_LIBRARY_PATH}
+        ${CMAKE_LIBRARY_PATH}
+        /usr/lib
+        /usr/local/lib
+        /opt/local/lib
+        /sw/lib
+    )
+   
+    set(PORTAUDIO_INCLUDE_DIRS
+      ${PORTAUDIO_INCLUDE_DIR}
+    )
+    set(PORTAUDIO_LIBRARIES
+      ${PORTAUDIO_LIBRARY}
+    )
+   
+    set(PORTAUDIO_LIBRARY_DIRS
+      ${PORTAUDIO_LIBRARY_DIR}
+    )
+   
+    set(PORTAUDIO_VERSION
+      18
+    )
+   
+    if (PORTAUDIO_INCLUDE_DIRS AND PORTAUDIO_LIBRARIES)
+       set(PORTAUDIO_FOUND TRUE)
+    endif (PORTAUDIO_INCLUDE_DIRS AND PORTAUDIO_LIBRARIES)
+   
+    if (PORTAUDIO_FOUND)
+      if (NOT Portaudio_FIND_QUIETLY)
+        message(STATUS "Found Portaudio: ${PORTAUDIO_LIBRARIES}")
+      endif (NOT Portaudio_FIND_QUIETLY)
+    else (PORTAUDIO_FOUND)
+      if (Portaudio_FIND_REQUIRED)
+        message(FATAL_ERROR "Could not find Portaudio")
+      endif (Portaudio_FIND_REQUIRED)
+    endif (PORTAUDIO_FOUND)
+  endif (PORTAUDIO2_FOUND)
+
+
+  # show the PORTAUDIO_INCLUDE_DIRS and PORTAUDIO_LIBRARIES variables only in the advanced view
+  mark_as_advanced(PORTAUDIO_INCLUDE_DIRS PORTAUDIO_LIBRARIES)
+
+endif (PORTAUDIO_LIBRARIES AND PORTAUDIO_INCLUDE_DIRS)
+
diff --git a/freedv/branches/0.97/cmake/GetDependencies.cmake.in b/freedv/branches/0.97/cmake/GetDependencies.cmake.in
new file mode 100644 (file)
index 0000000..93204dd
--- /dev/null
@@ -0,0 +1,25 @@
+# As this script is run in a new cmake instance, it does not have access to
+# the existing cache variables. Pass them in via the configure_file command.
+set(CMAKE_BINARY_DIR @CMAKE_BINARY_DIR@)
+set(CMAKE_SOURCE_DIR @CMAKE_SOURCE_DIR@)
+set(UNIX @UNIX@)
+set(WIN32 @WIN32@)
+set(CMAKE_CROSSCOMPILING @CMAKE_CROSSCOMPILING@)
+set(CMAKE_FIND_LIBRARY_SUFFIXES @CMAKE_FIND_LIBRARY_SUFFIXES@)
+set(CMAKE_FIND_LIBRARY_PREFIXES @CMAKE_FIND_LIBRARY_PREFIXES@)
+set(CMAKE_SYSTEM_LIBRARY_PATH @CMAKE_SYSTEM_LIBRARY_PATH@)
+set(CMAKE_FIND_ROOT_PATH @CMAKE_FIND_ROOT_PATH@)
+
+set(FREEDV_EXE ${CMAKE_BINARY_DIR}/src/freedv.exe)
+
+include(GetPrerequisites)
+get_prerequisites("${FREEDV_EXE}" _deps 1 1 "" "${CMAKE_SYSTEM_LIBRARY_PATH}")
+foreach(_runtime ${_deps})
+    message("Looking for ${_runtime}")
+    find_library(RUNTIME_${_runtime} ${_runtime})
+    message("${RUNTIME_${_runtime}}")
+    if(RUNTIME_${_runtime})
+        file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/bin"
+        TYPE EXECUTABLE FILES "${RUNTIME_${_runtime}}")
+    endif()
+endforeach()
diff --git a/freedv/branches/0.97/cmake/config.h.in b/freedv/branches/0.97/cmake/config.h.in
new file mode 100644 (file)
index 0000000..8e3ab76
--- /dev/null
@@ -0,0 +1,19 @@
+/*--------------------------------------------------------------------------
+ ** This file is autogenerated from config.h.in 
+ ** during the cmake configuration of your project. If you need to make changes
+ ** edit the original file NOT THIS FILE.
+ ** --------------------------------------------------------------------------*/
+#ifndef _CONFIGURATION_HEADER_GUARD_H_
+#define _CONFIGURATION_HEADER_GUARD_H_
+
+#define SIZEOF_INT @SIZEOF_INT@
+#cmakedefine HAVE_LIMITS_H @HAVE_LIMITS_H@
+#cmakedefine HAVE_STDINT_H @HAVE_STDINT_H@
+#cmakedefine HAVE_STDDEF_H @HAVE_STDDEF_H@
+#cmakedefine HAVE_STDLIB_H @HAVE_STDLIB_H@
+#cmakedefine HAVE_STRING_H @HAVE_STRING_H@
+#cmakedefine HAVE_FLOOR @HAVE_FLOOR@
+#cmakedefine HAVE_MEMSET @HAVE_MEMSET@
+#cmakedefine HAVE_POW @HAVE_POW@
+#cmakedefine HAVE_SQRT @HAVE_SQRT@
+#endif
diff --git a/freedv/branches/0.97/conf/authz b/freedv/branches/0.97/conf/authz
new file mode 100644 (file)
index 0000000..90d8838
--- /dev/null
@@ -0,0 +1,32 @@
+### This file is an example authorization file for svnserve.\r
+### Its format is identical to that of mod_authz_svn authorization\r
+### files.\r
+### As shown below each section defines authorizations for the path and\r
+### (optional) repository specified by the section name.\r
+### The authorizations follow. An authorization line can refer to:\r
+###  - a single user,\r
+###  - a group of users defined in a special [groups] section,\r
+###  - an alias defined in a special [aliases] section,\r
+###  - all authenticated users, using the '$authenticated' token,\r
+###  - only anonymous users, using the '$anonymous' token,\r
+###  - anyone, using the '*' wildcard.\r
+###\r
+### A match can be inverted by prefixing the rule with '~'. Rules can\r
+### grant read ('r') access, read-write ('rw') access, or no access\r
+### ('').\r
+\r
+[aliases]\r
+# joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average\r
+\r
+[groups]\r
+# harry_and_sally = harry,sally\r
+# harry_sally_and_joe = harry,sally,&joe\r
+\r
+# [/foo/bar]\r
+# harry = rw\r
+# &joe = r\r
+# * =\r
+\r
+# [repository:/baz/fuz]\r
+# @harry_and_sally = rw\r
+# * = r\r
diff --git a/freedv/branches/0.97/conf/passwd b/freedv/branches/0.97/conf/passwd
new file mode 100644 (file)
index 0000000..d22bafc
--- /dev/null
@@ -0,0 +1,8 @@
+### This file is an example password file for svnserve.\r
+### Its format is similar to that of svnserve.conf. As shown in the\r
+### example below it contains one section labelled [users].\r
+### The name and password for each user follow, one account per line.\r
+\r
+[users]\r
+# harry = harryssecret\r
+# sally = sallyssecret\r
diff --git a/freedv/branches/0.97/conf/svnserve.conf b/freedv/branches/0.97/conf/svnserve.conf
new file mode 100644 (file)
index 0000000..d22d631
--- /dev/null
@@ -0,0 +1,61 @@
+### This file controls the configuration of the svnserve daemon, if you\r
+### use it to allow access to this repository.  (If you only allow\r
+### access through http: and/or file: URLs, then this file is\r
+### irrelevant.)\r
+\r
+### Visit http://subversion.apache.org/ for more information.\r
+\r
+[general]\r
+### The anon-access and auth-access options control access to the\r
+### repository for unauthenticated (a.k.a. anonymous) users and\r
+### authenticated users, respectively.\r
+### Valid values are "write", "read", and "none".\r
+### Setting the value to "none" prohibits both reading and writing;\r
+### "read" allows read-only access, and "write" allows complete \r
+### read/write access to the repository.\r
+### The sample settings below are the defaults and specify that anonymous\r
+### users have read-only access to the repository, while authenticated\r
+### users have read and write access to the repository.\r
+# anon-access = read\r
+# auth-access = write\r
+### The password-db option controls the location of the password\r
+### database file.  Unless you specify a path starting with a /,\r
+### the file's location is relative to the directory containing\r
+### this configuration file.\r
+### If SASL is enabled (see below), this file will NOT be used.\r
+### Uncomment the line below to use the default password file.\r
+# password-db = passwd\r
+### The authz-db option controls the location of the authorization\r
+### rules for path-based access control.  Unless you specify a path\r
+### starting with a /, the file's location is relative to the the\r
+### directory containing this file.  If you don't specify an\r
+### authz-db, no path-based access control is done.\r
+### Uncomment the line below to use the default authorization file.\r
+# authz-db = authz\r
+### This option specifies the authentication realm of the repository.\r
+### If two repositories have the same authentication realm, they should\r
+### have the same password database, and vice versa.  The default realm\r
+### is repository's uuid.\r
+# realm = My First Repository\r
+### The force-username-case option causes svnserve to case-normalize\r
+### usernames before comparing them against the authorization rules in the\r
+### authz-db file configured above.  Valid values are "upper" (to upper-\r
+### case the usernames), "lower" (to lowercase the usernames), and\r
+### "none" (to compare usernames as-is without case conversion, which\r
+### is the default behavior).\r
+# force-username-case = none\r
+\r
+[sasl]\r
+### This option specifies whether you want to use the Cyrus SASL\r
+### library for authentication. Default is false.\r
+### This section will be ignored if svnserve is not built with Cyrus\r
+### SASL support; to check, run 'svnserve --version' and look for a line\r
+### reading 'Cyrus SASL authentication is available.'\r
+# use-sasl = true\r
+### These options specify the desired strength of the security layer\r
+### that you want SASL to provide. 0 means no encryption, 1 means\r
+### integrity-checking only, values larger than 1 are correlated\r
+### to the effective key length for encryption (e.g. 128 means 128-bit\r
+### encryption). The values below are the defaults.\r
+# min-encryption = 0\r
+# max-encryption = 256\r
diff --git a/freedv/branches/0.97/contrib/CMakeLists.txt b/freedv/branches/0.97/contrib/CMakeLists.txt
new file mode 100644 (file)
index 0000000..3f4b7e0
--- /dev/null
@@ -0,0 +1,22 @@
+# Install icons if we're on most *nix systems.
+if(UNIX AND NOT APPLE)
+    set(ICON_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor
+        CACHE PATH "Prefix to use for installing icons.")
+    install(FILES freedv48x48.png
+        DESTINATION ${ICON_INSTALL_PREFIX}/48x48/apps
+        RENAME freedv.png)
+    install(FILES freedv64x64.png
+        DESTINATION ${ICON_INSTALL_PREFIX}/64x64/apps
+        RENAME freedv.png)
+    install(FILES freedv128x128.png
+        DESTINATION ${ICON_INSTALL_PREFIX}/128x128/apps
+        RENAME freedv.png)
+    install(FILES freedv256x256.png
+        DESTINATION ${ICON_INSTALL_PREFIX}/256x256/apps
+        RENAME freedv.png)
+
+    set(DESKTOP_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/applications
+        CACHE PATH "Location to install desktop files.")
+    install(FILES freedv.desktop
+        DESTINATION ${DESKTOP_INSTALL_DIR})
+endif(UNIX AND NOT APPLE)
diff --git a/freedv/branches/0.97/contrib/LICENSE b/freedv/branches/0.97/contrib/LICENSE
new file mode 100644 (file)
index 0000000..dc8853a
--- /dev/null
@@ -0,0 +1,393 @@
+Attribution 4.0 International
+
+=======================================================================
+
+Creative Commons Corporation ("Creative Commons") is not a law firm and
+does not provide legal services or legal advice. Distribution of
+Creative Commons public licenses does not create a lawyer-client or
+other relationship. Creative Commons makes its licenses and related
+information available on an "as-is" basis. Creative Commons gives no
+warranties regarding its licenses, any material licensed under their
+terms and conditions, or any related information. Creative Commons
+disclaims all liability for damages resulting from their use to the
+fullest extent possible.
+
+Using Creative Commons Public Licenses
+
+Creative Commons public licenses provide a standard set of terms and
+conditions that creators and other rights holders may use to share
+original works of authorship and other material subject to copyright
+and certain other rights specified in the public license below. The
+following considerations are for informational purposes only, are not
+exhaustive, and do not form part of our licenses.
+
+     Considerations for licensors: Our public licenses are
+     intended for use by those authorized to give the public
+     permission to use material in ways otherwise restricted by
+     copyright and certain other rights. Our licenses are
+     irrevocable. Licensors should read and understand the terms
+     and conditions of the license they choose before applying it.
+     Licensors should also secure all rights necessary before
+     applying our licenses so that the public can reuse the
+     material as expected. Licensors should clearly mark any
+     material not subject to the license. This includes other CC-
+     licensed material, or material used under an exception or
+     limitation to copyright. More considerations for licensors:
+       wiki.creativecommons.org/Considerations_for_licensors
+
+     Considerations for the public: By using one of our public
+     licenses, a licensor grants the public permission to use the
+     licensed material under specified terms and conditions. If
+     the licensor's permission is not necessary for any reason--for
+     example, because of any applicable exception or limitation to
+     copyright--then that use is not regulated by the license. Our
+     licenses grant only permissions under copyright and certain
+     other rights that a licensor has authority to grant. Use of
+     the licensed material may still be restricted for other
+     reasons, including because others have copyright or other
+     rights in the material. A licensor may make special requests,
+     such as asking that all changes be marked or described.
+     Although not required by our licenses, you are encouraged to
+     respect those requests where reasonable. More_considerations
+     for the public: 
+       wiki.creativecommons.org/Considerations_for_licensees
+
+=======================================================================
+
+Creative Commons Attribution 4.0 International Public License
+
+By exercising the Licensed Rights (defined below), You accept and agree
+to be bound by the terms and conditions of this Creative Commons
+Attribution 4.0 International Public License ("Public License"). To the
+extent this Public License may be interpreted as a contract, You are
+granted the Licensed Rights in consideration of Your acceptance of
+these terms and conditions, and the Licensor grants You such rights in
+consideration of benefits the Licensor receives from making the
+Licensed Material available under these terms and conditions.
+
+
+Section 1 -- Definitions.
+
+  a. Adapted Material means material subject to Copyright and Similar
+     Rights that is derived from or based upon the Licensed Material
+     and in which the Licensed Material is translated, altered,
+     arranged, transformed, or otherwise modified in a manner requiring
+     permission under the Copyright and Similar Rights held by the
+     Licensor. For purposes of this Public License, where the Licensed
+     Material is a musical work, performance, or sound recording,
+     Adapted Material is always produced where the Licensed Material is
+     synched in timed relation with a moving image.
+
+  b. Adapter's License means the license You apply to Your Copyright
+     and Similar Rights in Your contributions to Adapted Material in
+     accordance with the terms and conditions of this Public License.
+
+  c. Copyright and Similar Rights means copyright and/or similar rights
+     closely related to copyright including, without limitation,
+     performance, broadcast, sound recording, and Sui Generis Database
+     Rights, without regard to how the rights are labeled or
+     categorized. For purposes of this Public License, the rights
+     specified in Section 2(b)(1)-(2) are not Copyright and Similar
+     Rights.
+
+  d. Effective Technological Measures means those measures that, in the
+     absence of proper authority, may not be circumvented under laws
+     fulfilling obligations under Article 11 of the WIPO Copyright
+     Treaty adopted on December 20, 1996, and/or similar international
+     agreements.
+
+  e. Exceptions and Limitations means fair use, fair dealing, and/or
+     any other exception or limitation to Copyright and Similar Rights
+     that applies to Your use of the Licensed Material.
+
+  f. Licensed Material means the artistic or literary work, database,
+     or other material to which the Licensor applied this Public
+     License.
+
+  g. Licensed Rights means the rights granted to You subject to the
+     terms and conditions of this Public License, which are limited to
+     all Copyright and Similar Rights that apply to Your use of the
+     Licensed Material and that the Licensor has authority to license.
+
+  h. Licensor means the individual(s) or entity(ies) granting rights
+     under this Public License.
+
+  i. Share means to provide material to the public by any means or
+     process that requires permission under the Licensed Rights, such
+     as reproduction, public display, public performance, distribution,
+     dissemination, communication, or importation, and to make material
+     available to the public including in ways that members of the
+     public may access the material from a place and at a time
+     individually chosen by them.
+
+  j. Sui Generis Database Rights means rights other than copyright
+     resulting from Directive 96/9/EC of the European Parliament and of
+     the Council of 11 March 1996 on the legal protection of databases,
+     as amended and/or succeeded, as well as other essentially
+     equivalent rights anywhere in the world.
+
+  k. You means the individual or entity exercising the Licensed Rights
+     under this Public License. Your has a corresponding meaning.
+
+
+Section 2 -- Scope.
+
+  a. License grant.
+
+       1. Subject to the terms and conditions of this Public License,
+          the Licensor hereby grants You a worldwide, royalty-free,
+          non-sublicensable, non-exclusive, irrevocable license to
+          exercise the Licensed Rights in the Licensed Material to:
+
+            a. reproduce and Share the Licensed Material, in whole or
+               in part; and
+
+            b. produce, reproduce, and Share Adapted Material.
+
+       2. Exceptions and Limitations. For the avoidance of doubt, where
+          Exceptions and Limitations apply to Your use, this Public
+          License does not apply, and You do not need to comply with
+          its terms and conditions.
+
+       3. Term. The term of this Public License is specified in Section
+          6(a).
+
+       4. Media and formats; technical modifications allowed. The
+          Licensor authorizes You to exercise the Licensed Rights in
+          all media and formats whether now known or hereafter created,
+          and to make technical modifications necessary to do so. The
+          Licensor waives and/or agrees not to assert any right or
+          authority to forbid You from making technical modifications
+          necessary to exercise the Licensed Rights, including
+          technical modifications necessary to circumvent Effective
+          Technological Measures. For purposes of this Public License,
+          simply making modifications authorized by this Section 2(a)
+          (4) never produces Adapted Material.
+
+       5. Downstream recipients.
+
+            a. Offer from the Licensor -- Licensed Material. Every
+               recipient of the Licensed Material automatically
+               receives an offer from the Licensor to exercise the
+               Licensed Rights under the terms and conditions of this
+               Public License.
+
+            b. No downstream restrictions. You may not offer or impose
+               any additional or different terms or conditions on, or
+               apply any Effective Technological Measures to, the
+               Licensed Material if doing so restricts exercise of the
+               Licensed Rights by any recipient of the Licensed
+               Material.
+
+       6. No endorsement. Nothing in this Public License constitutes or
+          may be construed as permission to assert or imply that You
+          are, or that Your use of the Licensed Material is, connected
+          with, or sponsored, endorsed, or granted official status by,
+          the Licensor or others designated to receive attribution as
+          provided in Section 3(a)(1)(A)(i).
+
+  b. Other rights.
+
+       1. Moral rights, such as the right of integrity, are not
+          licensed under this Public License, nor are publicity,
+          privacy, and/or other similar personality rights; however, to
+          the extent possible, the Licensor waives and/or agrees not to
+          assert any such rights held by the Licensor to the limited
+          extent necessary to allow You to exercise the Licensed
+          Rights, but not otherwise.
+
+       2. Patent and trademark rights are not licensed under this
+          Public License.
+
+       3. To the extent possible, the Licensor waives any right to
+          collect royalties from You for the exercise of the Licensed
+          Rights, whether directly or through a collecting society
+          under any voluntary or waivable statutory or compulsory
+          licensing scheme. In all other cases the Licensor expressly
+          reserves any right to collect such royalties.
+
+
+Section 3 -- License Conditions.
+
+Your exercise of the Licensed Rights is expressly made subject to the
+following conditions.
+
+  a. Attribution.
+
+       1. If You Share the Licensed Material (including in modified
+          form), You must:
+
+            a. retain the following if it is supplied by the Licensor
+               with the Licensed Material:
+
+                 i. identification of the creator(s) of the Licensed
+                    Material and any others designated to receive
+                    attribution, in any reasonable manner requested by
+                    the Licensor (including by pseudonym if
+                    designated);
+
+                ii. a copyright notice;
+
+               iii. a notice that refers to this Public License;
+
+                iv. a notice that refers to the disclaimer of
+                    warranties;
+
+                 v. a URI or hyperlink to the Licensed Material to the
+                    extent reasonably practicable;
+
+            b. indicate if You modified the Licensed Material and
+               retain an indication of any previous modifications; and
+
+            c. indicate the Licensed Material is licensed under this
+               Public License, and include the text of, or the URI or
+               hyperlink to, this Public License.
+
+       2. You may satisfy the conditions in Section 3(a)(1) in any
+          reasonable manner based on the medium, means, and context in
+          which You Share the Licensed Material. For example, it may be
+          reasonable to satisfy the conditions by providing a URI or
+          hyperlink to a resource that includes the required
+          information.
+
+       3. If requested by the Licensor, You must remove any of the
+          information required by Section 3(a)(1)(A) to the extent
+          reasonably practicable.
+
+       4. If You Share Adapted Material You produce, the Adapter's
+          License You apply must not prevent recipients of the Adapted
+          Material from complying with this Public License.
+
+
+Section 4 -- Sui Generis Database Rights.
+
+Where the Licensed Rights include Sui Generis Database Rights that
+apply to Your use of the Licensed Material:
+
+  a. for the avoidance of doubt, Section 2(a)(1) grants You the right
+     to extract, reuse, reproduce, and Share all or a substantial
+     portion of the contents of the database;
+
+  b. if You include all or a substantial portion of the database
+     contents in a database in which You have Sui Generis Database
+     Rights, then the database in which You have Sui Generis Database
+     Rights (but not its individual contents) is Adapted Material; and
+
+  c. You must comply with the conditions in Section 3(a) if You Share
+     all or a substantial portion of the contents of the database.
+
+For the avoidance of doubt, this Section 4 supplements and does not
+replace Your obligations under this Public License where the Licensed
+Rights include other Copyright and Similar Rights.
+
+
+Section 5 -- Disclaimer of Warranties and Limitation of Liability.
+
+  a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
+     EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
+     AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
+     ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
+     IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
+     WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
+     PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
+     ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
+     KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
+     ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
+
+  b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
+     TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
+     NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
+     INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
+     COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
+     USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
+     ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
+     DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
+     IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
+
+  c. The disclaimer of warranties and limitation of liability provided
+     above shall be interpreted in a manner that, to the extent
+     possible, most closely approximates an absolute disclaimer and
+     waiver of all liability.
+
+
+Section 6 -- Term and Termination.
+
+  a. This Public License applies for the term of the Copyright and
+     Similar Rights licensed here. However, if You fail to comply with
+     this Public License, then Your rights under this Public License
+     terminate automatically.
+
+  b. Where Your right to use the Licensed Material has terminated under
+     Section 6(a), it reinstates:
+
+       1. automatically as of the date the violation is cured, provided
+          it is cured within 30 days of Your discovery of the
+          violation; or
+
+       2. upon express reinstatement by the Licensor.
+
+     For the avoidance of doubt, this Section 6(b) does not affect any
+     right the Licensor may have to seek remedies for Your violations
+     of this Public License.
+
+  c. For the avoidance of doubt, the Licensor may also offer the
+     Licensed Material under separate terms or conditions or stop
+     distributing the Licensed Material at any time; however, doing so
+     will not terminate this Public License.
+
+  d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
+     License.
+
+
+Section 7 -- Other Terms and Conditions.
+
+  a. The Licensor shall not be bound by any additional or different
+     terms or conditions communicated by You unless expressly agreed.
+
+  b. Any arrangements, understandings, or agreements regarding the
+     Licensed Material not stated herein are separate from and
+     independent of the terms and conditions of this Public License.
+
+
+Section 8 -- Interpretation.
+
+  a. For the avoidance of doubt, this Public License does not, and
+     shall not be interpreted to, reduce, limit, restrict, or impose
+     conditions on any use of the Licensed Material that could lawfully
+     be made without permission under this Public License.
+
+  b. To the extent possible, if any provision of this Public License is
+     deemed unenforceable, it shall be automatically reformed to the
+     minimum extent necessary to make it enforceable. If the provision
+     cannot be reformed, it shall be severed from this Public License
+     without affecting the enforceability of the remaining terms and
+     conditions.
+
+  c. No term or condition of this Public License will be waived and no
+     failure to comply consented to unless expressly agreed to by the
+     Licensor.
+
+  d. Nothing in this Public License constitutes or may be interpreted
+     as a limitation upon, or waiver of, any privileges and immunities
+     that apply to the Licensor or You, including from the legal
+     processes of any jurisdiction or authority.
+
+
+=======================================================================
+
+Creative Commons is not a party to its public licenses.
+Notwithstanding, Creative Commons may elect to apply one of its public
+licenses to material it publishes and in those instances will be
+considered the "Licensor." Except for the limited purpose of indicating
+that material is shared under a Creative Commons public license or as
+otherwise permitted by the Creative Commons policies published at
+creativecommons.org/policies, Creative Commons does not authorize the
+use of the trademark "Creative Commons" or any other trademark or logo
+of Creative Commons without its prior written consent including,
+without limitation, in connection with any unauthorized modifications
+to any of its public licenses or any other arrangements,
+understandings, or agreements concerning use of licensed material. For
+the avoidance of doubt, this paragraph does not form part of the public
+licenses.
+
+Creative Commons may be contacted at creativecommons.org.
diff --git a/freedv/branches/0.97/contrib/freedv.desktop b/freedv/branches/0.97/contrib/freedv.desktop
new file mode 100644 (file)
index 0000000..96e8293
--- /dev/null
@@ -0,0 +1,8 @@
+[Desktop Entry]
+Version=1.0
+Name=FreeDV
+Exec=freedv
+Icon=freedv
+Type=Application
+Terminal=false
+Categories=GTK;GNOME;AudioVideo;Audio;HamRadio;
diff --git a/freedv/branches/0.97/contrib/freedv.ico b/freedv/branches/0.97/contrib/freedv.ico
new file mode 100644 (file)
index 0000000..e6b9a20
Binary files /dev/null and b/freedv/branches/0.97/contrib/freedv.ico differ
diff --git a/freedv/branches/0.97/contrib/freedv.rc b/freedv/branches/0.97/contrib/freedv.rc
new file mode 100644 (file)
index 0000000..2e6655d
--- /dev/null
@@ -0,0 +1 @@
+id ICON "./freedv.ico"
diff --git a/freedv/branches/0.97/contrib/freedv128x128.png b/freedv/branches/0.97/contrib/freedv128x128.png
new file mode 100644 (file)
index 0000000..5190a77
Binary files /dev/null and b/freedv/branches/0.97/contrib/freedv128x128.png differ
diff --git a/freedv/branches/0.97/contrib/freedv256x256.png b/freedv/branches/0.97/contrib/freedv256x256.png
new file mode 100644 (file)
index 0000000..b3eb5d7
Binary files /dev/null and b/freedv/branches/0.97/contrib/freedv256x256.png differ
diff --git a/freedv/branches/0.97/contrib/freedv48x48.png b/freedv/branches/0.97/contrib/freedv48x48.png
new file mode 100644 (file)
index 0000000..bd5efc6
Binary files /dev/null and b/freedv/branches/0.97/contrib/freedv48x48.png differ
diff --git a/freedv/branches/0.97/contrib/freedv64x64.png b/freedv/branches/0.97/contrib/freedv64x64.png
new file mode 100644 (file)
index 0000000..eb89773
Binary files /dev/null and b/freedv/branches/0.97/contrib/freedv64x64.png differ
diff --git a/freedv/branches/0.97/credits.txt b/freedv/branches/0.97/credits.txt
new file mode 100644 (file)
index 0000000..b45038d
--- /dev/null
@@ -0,0 +1,12 @@
+Credits (code or ideas borrowed from):
+==============================================
+David Rowe(obviously)
+Mel Whitten K0PFX (material and moral support)
+Bruce Perens (cheerleader, promotion and publicity)
+Mooneer Salem KG6AOV(Mac OSX Patch)
+Soeren Straarup OZ2DAK (FreeBSD Port)
+Don Mak
+Steve Nance (K5FR)
+James Ahlstrom (Quisk)
+FLDIGI
+All the folks on the digital voice google group...
diff --git a/freedv/branches/0.97/db/current b/freedv/branches/0.97/db/current
new file mode 100644 (file)
index 0000000..d00491f
--- /dev/null
@@ -0,0 +1 @@
+1
diff --git a/freedv/branches/0.97/db/format b/freedv/branches/0.97/db/format
new file mode 100644 (file)
index 0000000..db06890
--- /dev/null
@@ -0,0 +1,2 @@
+4
+layout sharded 1000
diff --git a/freedv/branches/0.97/db/fs-type b/freedv/branches/0.97/db/fs-type
new file mode 100644 (file)
index 0000000..4fdd953
--- /dev/null
@@ -0,0 +1 @@
+fsfs
diff --git a/freedv/branches/0.97/db/fsfs.conf b/freedv/branches/0.97/db/fsfs.conf
new file mode 100644 (file)
index 0000000..cc08ceb
--- /dev/null
@@ -0,0 +1,38 @@
+### This file controls the configuration of the FSFS filesystem.\r
+\r
+[memcached-servers]\r
+### These options name memcached servers used to cache internal FSFS\r
+### data.  See http://www.danga.com/memcached/ for more information on\r
+### memcached.  To use memcached with FSFS, run one or more memcached\r
+### servers, and specify each of them as an option like so:\r
+# first-server = 127.0.0.1:11211\r
+# remote-memcached = mymemcached.corp.example.com:11212\r
+### The option name is ignored; the value is of the form HOST:PORT.\r
+### memcached servers can be shared between multiple repositories;\r
+### however, if you do this, you *must* ensure that repositories have\r
+### distinct UUIDs and paths, or else cached data from one repository\r
+### might be used by another accidentally.  Note also that memcached has\r
+### no authentication for reads or writes, so you must ensure that your\r
+### memcached servers are only accessible by trusted users.\r
+\r
+[caches]\r
+### When a cache-related error occurs, normally Subversion ignores it\r
+### and continues, logging an error if the server is appropriately\r
+### configured (and ignoring it with file:// access).  To make\r
+### Subversion never ignore cache errors, uncomment this line.\r
+# fail-stop = true\r
+\r
+[rep-sharing]\r
+### To conserve space, the filesystem can optionally avoid storing\r
+### duplicate representations.  This comes at a slight cost in\r
+### performance, as maintaining a database of shared representations can\r
+### increase commit times.  The space savings are dependent upon the size\r
+### of the repository, the number of objects it contains and the amount of\r
+### duplication between them, usually a function of the branching and\r
+### merging process.\r
+###\r
+### The following parameter enables rep-sharing in the repository.  It can\r
+### be switched on and off at will, but for best space-saving results\r
+### should be enabled consistently over the life of the repository.\r
+### rep-sharing is enabled by default.\r
+# enable-rep-sharing = true\r
diff --git a/freedv/branches/0.97/db/min-unpacked-rev b/freedv/branches/0.97/db/min-unpacked-rev
new file mode 100644 (file)
index 0000000..573541a
--- /dev/null
@@ -0,0 +1 @@
+0
diff --git a/freedv/branches/0.97/db/rep-cache.db b/freedv/branches/0.97/db/rep-cache.db
new file mode 100644 (file)
index 0000000..63c6f0b
Binary files /dev/null and b/freedv/branches/0.97/db/rep-cache.db differ
diff --git a/freedv/branches/0.97/db/revprops/0/0 b/freedv/branches/0.97/db/revprops/0/0
new file mode 100644 (file)
index 0000000..d0b90de
--- /dev/null
@@ -0,0 +1,5 @@
+K 8
+svn:date
+V 27
+2012-08-21T18:27:59.389906Z
+END
diff --git a/freedv/branches/0.97/db/revprops/0/1 b/freedv/branches/0.97/db/revprops/0/1
new file mode 100644 (file)
index 0000000..0af71a2
--- /dev/null
@@ -0,0 +1,13 @@
+K 10
+svn:author
+V 9
+OFA-Staff
+K 8
+svn:date
+V 27
+2012-08-21T18:28:08.741468Z
+K 7
+svn:log
+V 25
+Imported folder structure
+END
diff --git a/freedv/branches/0.97/db/revs/0/0 b/freedv/branches/0.97/db/revs/0/0
new file mode 100644 (file)
index 0000000..10f5c45
--- /dev/null
@@ -0,0 +1,11 @@
+PLAIN
+END
+ENDREP
+id: 0.0.r0/17
+type: dir
+count: 0
+text: 0 0 4 4 2d2977d1c96f487abe4a1e202dd03b4e
+cpath: /
+
+
+17 107
diff --git a/freedv/branches/0.97/db/revs/0/1 b/freedv/branches/0.97/db/revs/0/1
new file mode 100644 (file)
index 0000000..fd802a9
--- /dev/null
@@ -0,0 +1,49 @@
+id: 3-1.0.r1/0
+type: dir
+count: 0
+cpath: /tags
+copyroot: 0 /
+
+id: 0-1.0.r1/62
+type: dir
+count: 0
+cpath: /trunk
+copyroot: 0 /
+
+id: 2-1.0.r1/126
+type: dir
+count: 0
+cpath: /branches
+copyroot: 0 /
+
+PLAIN
+K 8
+branches
+V 16
+dir 2-1.0.r1/126
+K 4
+tags
+V 14
+dir 3-1.0.r1/0
+K 5
+trunk
+V 15
+dir 0-1.0.r1/62
+END
+ENDREP
+id: 0.0.r1/306
+type: dir
+pred: 0.0.r0/17
+count: 1
+text: 1 194 99 99 7b6cc14dddba4e09be5255b475d1a0a8
+cpath: /
+copyroot: 0 /
+
+_0.0.t0-0 add-dir false false /trunk
+
+_2.0.t0-0 add-dir false false /branches
+
+_3.0.t0-0 add-dir false false /tags
+
+
+306 431
diff --git a/freedv/branches/0.97/db/transactions/.gitignore b/freedv/branches/0.97/db/transactions/.gitignore
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/freedv/branches/0.97/db/txn-current b/freedv/branches/0.97/db/txn-current
new file mode 100644 (file)
index 0000000..d00491f
--- /dev/null
@@ -0,0 +1 @@
+1
diff --git a/freedv/branches/0.97/db/txn-current-lock b/freedv/branches/0.97/db/txn-current-lock
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/freedv/branches/0.97/db/txn-protorevs/.gitignore b/freedv/branches/0.97/db/txn-protorevs/.gitignore
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/freedv/branches/0.97/db/uuid b/freedv/branches/0.97/db/uuid
new file mode 100644 (file)
index 0000000..0f36297
--- /dev/null
@@ -0,0 +1 @@
+a56d66ce-6468-4744-9be7-52ce95ca47a4
diff --git a/freedv/branches/0.97/db/write-lock b/freedv/branches/0.97/db/write-lock
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/freedv/branches/0.97/fdmdv2.project b/freedv/branches/0.97/fdmdv2.project
new file mode 100644 (file)
index 0000000..1e699eb
--- /dev/null
@@ -0,0 +1,166 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CodeLite_Project Name="fdmdv2" InternalType="GUI">
+  <Plugins>
+    <Plugin Name="qmake">
+      <![CDATA[00020001N0005Debug0000000000000001N0007Release000000000000]]>
+    </Plugin>
+  </Plugins>
+  <Description/>
+  <Dependencies/>
+  <VirtualDirectory Name="src">
+    <File Name="topFrame.cpp"/>
+    <File Name="dlg_about.cpp"/>
+    <File Name="dlg_audio.cpp"/>
+    <File Name="dlg_options.cpp"/>
+    <File Name="dlg_comports.cpp"/>
+    <File Name="fdmdv2_plot.cpp"/>
+    <File Name="fdmdv2_main.cpp"/>
+    <File Name="paclass.cpp"/>
+  </VirtualDirectory>
+  <VirtualDirectory Name="include">
+    <File Name="topFrame.h"/>
+    <File Name="dlg_about.h"/>
+    <File Name="dlg_audio.h"/>
+    <File Name="dlg_options.h"/>
+    <File Name="dlg_comports.h"/>
+    <File Name="fdmdv2_plot.h"/>
+    <File Name="fdmdv2_main.h"/>
+    <File Name="extern/include/rig.h"/>
+    <File Name="extern/include/rig_dll.h"/>
+    <File Name="extern/include/riglist.h"/>
+    <File Name="extern/include/samplerate.h"/>
+    <VirtualDirectory Name="portaudio_cpp">
+      <File Name="extern/include/portaudiocpp/AsioDeviceAdapter.hxx"/>
+      <File Name="extern/include/portaudiocpp/AutoSystem.hxx"/>
+      <File Name="extern/include/portaudiocpp/BlockingStream.hxx"/>
+      <File Name="extern/include/portaudiocpp/CallbackInterface.hxx"/>
+      <File Name="extern/include/portaudiocpp/CallbackStream.hxx"/>
+      <File Name="extern/include/portaudiocpp/CFunCallbackStream.hxx"/>
+      <File Name="extern/include/portaudiocpp/CppFunCallbackStream.hxx"/>
+      <File Name="extern/include/portaudiocpp/Device.hxx"/>
+      <File Name="extern/include/portaudiocpp/DirectionSpecificStreamParameters.hxx"/>
+      <File Name="extern/include/portaudiocpp/Exception.hxx"/>
+      <File Name="extern/include/portaudiocpp/HostApi.hxx"/>
+      <File Name="extern/include/portaudiocpp/InterfaceCallbackStream.hxx"/>
+      <File Name="extern/include/portaudiocpp/MemFunCallbackStream.hxx"/>
+      <File Name="extern/include/portaudiocpp/PortAudioCpp.hxx"/>
+      <File Name="extern/include/portaudiocpp/SampleDataFormat.hxx"/>
+      <File Name="extern/include/portaudiocpp/Stream.hxx"/>
+      <File Name="extern/include/portaudiocpp/StreamParameters.hxx"/>
+      <File Name="extern/include/portaudiocpp/System.hxx"/>
+      <File Name="extern/include/portaudiocpp/SystemDeviceIterator.hxx"/>
+      <File Name="extern/include/portaudiocpp/SystemHostApiIterator.hxx"/>
+    </VirtualDirectory>
+    <File Name="paclass.h"/>
+    <File Name="../codec2/src/codec2.h"/>
+    <File Name="../codec2/src/fdmdv.h"/>
+  </VirtualDirectory>
+  <VirtualDirectory Name="resources">
+    <File Name="FDMDV2.fbp"/>
+  </VirtualDirectory>
+  <Dependencies Name="Debug"/>
+  <Dependencies Name="Release"/>
+  <Settings Type="Executable">
+    <GlobalSettings>
+      <Compiler Options="" C_Options="">
+        <IncludePath Value="."/>
+      </Compiler>
+      <Linker Options="">
+        <LibraryPath Value="."/>
+      </Linker>
+      <ResourceCompiler Options=""/>
+    </GlobalSettings>
+    <Configuration Name="Debug" CompilerType="gnu g++" DebuggerType="GNU gdb debugger" Type="Executable" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append">
+      <Compiler Options="-g;-O0;-Wall;$(shell wx-config --cxxflags --unicode=yes --debug=yes)" C_Options="-g;-O0;-Wall;$(shell wx-config --cxxflags --unicode=yes --debug=yes)" Required="yes" PreCompiledHeader="" PCHInCommandLine="no" UseDifferentPCHFlags="no" PCHFlags="">
+        <IncludePath Value="/bin/MinGW/msys/1.0/local/include"/>
+        <IncludePath Value="../codec2/src"/>
+        <Preprocessor Value="__WX__"/>
+      </Compiler>
+      <Linker Options="-mwindows;$(shell wx-config --debug=yes --libs --unicode=yes)" Required="yes">
+        <LibraryPath Value="./libsndfile/bin"/>
+        <LibraryPath Value="./extern/lib"/>
+        <Library Value="libsndfile-1.dll"/>
+        <Library Value="libcodec2.a"/>
+        <Library Value="libportaudio.a"/>
+        <Library Value="libportaudiocpp.a"/>
+      </Linker>
+      <ResourceCompiler Options="$(shell wx-config --rcflags)" Required="no"/>
+      <General OutputFile="$(IntermediateDirectory)/$(ProjectName)" IntermediateDirectory="./Debug" Command="./$(ProjectName)" CommandArguments="" UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="yes"/>
+      <Environment EnvVarSetName="&lt;Use Defaults&gt;" DbgSetName="&lt;Use Defaults&gt;">
+        <![CDATA[]]>
+      </Environment>
+      <Debugger IsRemote="no" RemoteHostName="" RemoteHostPort="" DebuggerPath="">
+        <PostConnectCommands/>
+        <StartupCommands/>
+      </Debugger>
+      <PreBuild/>
+      <PostBuild/>
+      <CustomBuild Enabled="no">
+        <RebuildCommand/>
+        <CleanCommand/>
+        <BuildCommand/>
+        <PreprocessFileCommand/>
+        <SingleFileCommand/>
+        <MakefileGenerationCommand/>
+        <ThirdPartyToolName>None</ThirdPartyToolName>
+        <WorkingDirectory/>
+      </CustomBuild>
+      <AdditionalRules>
+        <CustomPostBuild/>
+        <CustomPreBuild/>
+      </AdditionalRules>
+      <Completion EnableCpp11="no">
+        <ClangCmpFlags/>
+        <ClangPP/>
+        <SearchPaths/>
+      </Completion>
+    </Configuration>
+    <Configuration Name="Release" CompilerType="gnu g++" DebuggerType="GNU gdb debugger" Type="Executable" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append">
+      <Compiler Options="-O2;-Wall;$(shell wx-config --cxxflags --unicode=yes --debug=no)" C_Options="-O2;-Wall;$(shell wx-config --cxxflags --unicode=yes --debug=no)" Required="yes" PreCompiledHeader="" PCHInCommandLine="no" UseDifferentPCHFlags="no" PCHFlags="">
+        <IncludePath Value="/bin/MinGW/msys/1.0/local/include"/>
+        <IncludePath Value="../codec2/src"/>
+        <IncludePath Value="../../Audio/portaudio/include"/>
+        <IncludePath Value="../../Audio/portaudio/bindings/cpp/include"/>
+        <IncludePath Value="./libsndfile/include"/>
+        <Preprocessor Value="__WX__"/>
+      </Compiler>
+      <Linker Options="-mwindows;-s;$(shell wx-config --debug=no --libs --unicode=yes)" Required="yes">
+        <LibraryPath Value="/bin/MinGW/msys/1.0/local/lib"/>
+        <Library Value="libsndfile-1.dll"/>
+        <Library Value="libcodec2.a"/>
+        <Library Value="libportaudio.a"/>
+        <Library Value="libportaudiocpp.a"/>
+      </Linker>
+      <ResourceCompiler Options="$(shell wx-config --rcflags)" Required="no"/>
+      <General OutputFile="$(IntermediateDirectory)/$(ProjectName)" IntermediateDirectory="./Release" Command="./$(ProjectName)" CommandArguments="" UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="no"/>
+      <Environment EnvVarSetName="&lt;Use Defaults&gt;" DbgSetName="&lt;Use Defaults&gt;">
+        <![CDATA[]]>
+      </Environment>
+      <Debugger IsRemote="no" RemoteHostName="" RemoteHostPort="" DebuggerPath="">
+        <PostConnectCommands/>
+        <StartupCommands/>
+      </Debugger>
+      <PreBuild/>
+      <PostBuild/>
+      <CustomBuild Enabled="no">
+        <RebuildCommand/>
+        <CleanCommand/>
+        <BuildCommand/>
+        <PreprocessFileCommand/>
+        <SingleFileCommand/>
+        <MakefileGenerationCommand/>
+        <ThirdPartyToolName>None</ThirdPartyToolName>
+        <WorkingDirectory/>
+      </CustomBuild>
+      <AdditionalRules>
+        <CustomPostBuild/>
+        <CustomPreBuild/>
+      </AdditionalRules>
+      <Completion EnableCpp11="no">
+        <ClangCmpFlags/>
+        <ClangPP/>
+        <SearchPaths/>
+      </Completion>
+    </Configuration>
+  </Settings>
+</CodeLite_Project>
diff --git a/freedv/branches/0.97/format b/freedv/branches/0.97/format
new file mode 100644 (file)
index 0000000..7ed6ff8
--- /dev/null
@@ -0,0 +1 @@
+5
diff --git a/freedv/branches/0.97/hooks/post-commit.tmpl b/freedv/branches/0.97/hooks/post-commit.tmpl
new file mode 100644 (file)
index 0000000..4b70357
--- /dev/null
@@ -0,0 +1,50 @@
+#!/bin/sh\r
+\r
+# POST-COMMIT HOOK\r
+#\r
+# The post-commit hook is invoked after a commit.  Subversion runs\r
+# this hook by invoking a program (script, executable, binary, etc.)\r
+# named 'post-commit' (for which this file is a template) with the \r
+# following ordered arguments:\r
+#\r
+#   [1] REPOS-PATH   (the path to this repository)\r
+#   [2] REV          (the number of the revision just committed)\r
+#\r
+# The default working directory for the invocation is undefined, so\r
+# the program should set one explicitly if it cares.\r
+#\r
+# Because the commit has already completed and cannot be undone,\r
+# the exit code of the hook program is ignored.  The hook program\r
+# can use the 'svnlook' utility to help it examine the\r
+# newly-committed tree.\r
+#\r
+# On a Unix system, the normal procedure is to have 'post-commit'\r
+# invoke other programs to do the real work, though it may do the\r
+# work itself too.\r
+#\r
+# Note that 'post-commit' must be executable by the user(s) who will\r
+# invoke it (typically the user httpd runs as), and that user must\r
+# have filesystem-level permission to access the repository.\r
+#\r
+# On a Windows system, you should name the hook program\r
+# 'post-commit.bat' or 'post-commit.exe',\r
+# but the basic idea is the same.\r
+# \r
+# The hook program typically does not inherit the environment of\r
+# its parent process.  For example, a common problem is for the\r
+# PATH environment variable to not be set to its usual value, so\r
+# that subprograms fail to launch unless invoked via absolute path.\r
+# If you're having unexpected problems with a hook program, the\r
+# culprit may be unusual (or missing) environment variables.\r
+# \r
+# Here is an example hook script, for a Unix /bin/sh interpreter.\r
+# For more examples and pre-written hooks, see those in\r
+# the Subversion repository at\r
+# http://svn.apache.org/repos/asf/subversion/trunk/tools/hook-scripts/ and\r
+# http://svn.apache.org/repos/asf/subversion/trunk/contrib/hook-scripts/\r
+\r
+\r
+REPOS="$1"\r
+REV="$2"\r
+\r
+mailer.py commit "$REPOS" "$REV" /path/to/mailer.conf\r
diff --git a/freedv/branches/0.97/hooks/post-lock.tmpl b/freedv/branches/0.97/hooks/post-lock.tmpl
new file mode 100644 (file)
index 0000000..65a7d40
--- /dev/null
@@ -0,0 +1,44 @@
+#!/bin/sh\r
+\r
+# POST-LOCK HOOK\r
+#\r
+# The post-lock hook is run after a path is locked.  Subversion runs\r
+# this hook by invoking a program (script, executable, binary, etc.)\r
+# named 'post-lock' (for which this file is a template) with the \r
+# following ordered arguments:\r
+#\r
+#   [1] REPOS-PATH   (the path to this repository)\r
+#   [2] USER         (the user who created the lock)\r
+#\r
+# The paths that were just locked are passed to the hook via STDIN (as\r
+# of Subversion 1.2, only one path is passed per invocation, but the\r
+# plan is to pass all locked paths at once, so the hook program\r
+# should be written accordingly).\r
+#\r
+# The default working directory for the invocation is undefined, so\r
+# the program should set one explicitly if it cares.\r
+#\r
+# Because the lock has already been created and cannot be undone,\r
+# the exit code of the hook program is ignored.  The hook program\r
+# can use the 'svnlook' utility to help it examine the\r
+# newly-created lock.\r
+#\r
+# On a Unix system, the normal procedure is to have 'post-lock'\r
+# invoke other programs to do the real work, though it may do the\r
+# work itself too.\r
+#\r
+# Note that 'post-lock' must be executable by the user(s) who will\r
+# invoke it (typically the user httpd runs as), and that user must\r
+# have filesystem-level permission to access the repository.\r
+#\r
+# On a Windows system, you should name the hook program\r
+# 'post-lock.bat' or 'post-lock.exe',\r
+# but the basic idea is the same.\r
+# \r
+# Here is an example hook script, for a Unix /bin/sh interpreter:\r
+\r
+REPOS="$1"\r
+USER="$2"\r
+\r
+# Send email to interested parties, let them know a lock was created:\r
+mailer.py lock "$REPOS" "$USER" /path/to/mailer.conf\r
diff --git a/freedv/branches/0.97/hooks/post-revprop-change.tmpl b/freedv/branches/0.97/hooks/post-revprop-change.tmpl
new file mode 100644 (file)
index 0000000..be2b54a
--- /dev/null
@@ -0,0 +1,56 @@
+#!/bin/sh\r
+\r
+# POST-REVPROP-CHANGE HOOK\r
+#\r
+# The post-revprop-change hook is invoked after a revision property\r
+# has been added, modified or deleted.  Subversion runs this hook by\r
+# invoking a program (script, executable, binary, etc.) named\r
+# 'post-revprop-change' (for which this file is a template), with the\r
+# following ordered arguments:\r
+#\r
+#   [1] REPOS-PATH   (the path to this repository)\r
+#   [2] REV          (the revision that was tweaked)\r
+#   [3] USER         (the username of the person tweaking the property)\r
+#   [4] PROPNAME     (the property that was changed)\r
+#   [5] ACTION       (the property was 'A'dded, 'M'odified, or 'D'eleted)\r
+#\r
+#   [STDIN] PROPVAL  ** the old property value is passed via STDIN.\r
+#\r
+# Because the propchange has already completed and cannot be undone,\r
+# the exit code of the hook program is ignored.  The hook program\r
+# can use the 'svnlook' utility to help it examine the\r
+# new property value.\r
+#\r
+# On a Unix system, the normal procedure is to have 'post-revprop-change'\r
+# invoke other programs to do the real work, though it may do the\r
+# work itself too.\r
+#\r
+# Note that 'post-revprop-change' must be executable by the user(s) who will\r
+# invoke it (typically the user httpd runs as), and that user must\r
+# have filesystem-level permission to access the repository.\r
+#\r
+# On a Windows system, you should name the hook program\r
+# 'post-revprop-change.bat' or 'post-revprop-change.exe',\r
+# but the basic idea is the same.\r
+# \r
+# The hook program typically does not inherit the environment of\r
+# its parent process.  For example, a common problem is for the\r
+# PATH environment variable to not be set to its usual value, so\r
+# that subprograms fail to launch unless invoked via absolute path.\r
+# If you're having unexpected problems with a hook program, the\r
+# culprit may be unusual (or missing) environment variables.\r
+# \r
+# Here is an example hook script, for a Unix /bin/sh interpreter.\r
+# For more examples and pre-written hooks, see those in\r
+# the Subversion repository at\r
+# http://svn.apache.org/repos/asf/subversion/trunk/tools/hook-scripts/ and\r
+# http://svn.apache.org/repos/asf/subversion/trunk/contrib/hook-scripts/\r
+\r
+\r
+REPOS="$1"\r
+REV="$2"\r
+USER="$3"\r
+PROPNAME="$4"\r
+ACTION="$5"\r
+\r
+mailer.py propchange2 "$REPOS" "$REV" "$USER" "$PROPNAME" "$ACTION" /path/to/mailer.conf\r
diff --git a/freedv/branches/0.97/hooks/post-unlock.tmpl b/freedv/branches/0.97/hooks/post-unlock.tmpl
new file mode 100644 (file)
index 0000000..5821be8
--- /dev/null
@@ -0,0 +1,42 @@
+#!/bin/sh\r
+\r
+# POST-UNLOCK HOOK\r
+#\r
+# The post-unlock hook runs after a path is unlocked.  Subversion runs\r
+# this hook by invoking a program (script, executable, binary, etc.)\r
+# named 'post-unlock' (for which this file is a template) with the \r
+# following ordered arguments:\r
+#\r
+#   [1] REPOS-PATH   (the path to this repository)\r
+#   [2] USER         (the user who destroyed the lock)\r
+#\r
+# The paths that were just unlocked are passed to the hook via STDIN\r
+# (as of Subversion 1.2, only one path is passed per invocation, but\r
+# the plan is to pass all unlocked paths at once, so the hook program\r
+# should be written accordingly).\r
+#\r
+# The default working directory for the invocation is undefined, so\r
+# the program should set one explicitly if it cares.\r
+#\r
+# Because the lock has already been destroyed and cannot be undone,\r
+# the exit code of the hook program is ignored.\r
+#\r
+# On a Unix system, the normal procedure is to have 'post-unlock'\r
+# invoke other programs to do the real work, though it may do the\r
+# work itself too.\r
+#\r
+# Note that 'post-unlock' must be executable by the user(s) who will\r
+# invoke it (typically the user httpd runs as), and that user must\r
+# have filesystem-level permission to access the repository.\r
+#\r
+# On a Windows system, you should name the hook program\r
+# 'post-unlock.bat' or 'post-unlock.exe',\r
+# but the basic idea is the same.\r
+# \r
+# Here is an example hook script, for a Unix /bin/sh interpreter:\r
+\r
+REPOS="$1"\r
+USER="$2"\r
+\r
+# Send email to interested parties, let them know a lock was removed:\r
+mailer.py unlock "$REPOS" "$USER" /path/to/mailer.conf\r
diff --git a/freedv/branches/0.97/hooks/pre-commit.tmpl b/freedv/branches/0.97/hooks/pre-commit.tmpl
new file mode 100644 (file)
index 0000000..776968d
--- /dev/null
@@ -0,0 +1,81 @@
+#!/bin/sh\r
+\r
+# PRE-COMMIT HOOK\r
+#\r
+# The pre-commit hook is invoked before a Subversion txn is\r
+# committed.  Subversion runs this hook by invoking a program\r
+# (script, executable, binary, etc.) named 'pre-commit' (for which\r
+# this file is a template), with the following ordered arguments:\r
+#\r
+#   [1] REPOS-PATH   (the path to this repository)\r
+#   [2] TXN-NAME     (the name of the txn about to be committed)\r
+#\r
+#   [STDIN] LOCK-TOKENS ** the lock tokens are passed via STDIN.\r
+#\r
+#   If STDIN contains the line "LOCK-TOKENS:\n" (the "\n" denotes a\r
+#   single newline), the lines following it are the lock tokens for\r
+#   this commit.  The end of the list is marked by a line containing\r
+#   only a newline character.\r
+#\r
+#   Each lock token line consists of a URI-escaped path, followed\r
+#   by the separator character '|', followed by the lock token string,\r
+#   followed by a newline.\r
+#\r
+# The default working directory for the invocation is undefined, so\r
+# the program should set one explicitly if it cares.\r
+#\r
+# If the hook program exits with success, the txn is committed; but\r
+# if it exits with failure (non-zero), the txn is aborted, no commit\r
+# takes place, and STDERR is returned to the client.   The hook\r
+# program can use the 'svnlook' utility to help it examine the txn.\r
+#\r
+# On a Unix system, the normal procedure is to have 'pre-commit'\r
+# invoke other programs to do the real work, though it may do the\r
+# work itself too.\r
+#\r
+#   ***  NOTE: THE HOOK PROGRAM MUST NOT MODIFY THE TXN, EXCEPT  ***\r
+#   ***  FOR REVISION PROPERTIES (like svn:log or svn:author).   ***\r
+#\r
+#   This is why we recommend using the read-only 'svnlook' utility.\r
+#   In the future, Subversion may enforce the rule that pre-commit\r
+#   hooks should not modify the versioned data in txns, or else come\r
+#   up with a mechanism to make it safe to do so (by informing the\r
+#   committing client of the changes).  However, right now neither\r
+#   mechanism is implemented, so hook writers just have to be careful.\r
+#\r
+# Note that 'pre-commit' must be executable by the user(s) who will\r
+# invoke it (typically the user httpd runs as), and that user must\r
+# have filesystem-level permission to access the repository.\r
+#\r
+# On a Windows system, you should name the hook program\r
+# 'pre-commit.bat' or 'pre-commit.exe',\r
+# but the basic idea is the same.\r
+#\r
+# The hook program typically does not inherit the environment of\r
+# its parent process.  For example, a common problem is for the\r
+# PATH environment variable to not be set to its usual value, so\r
+# that subprograms fail to launch unless invoked via absolute path.\r
+# If you're having unexpected problems with a hook program, the\r
+# culprit may be unusual (or missing) environment variables.\r
+# \r
+# Here is an example hook script, for a Unix /bin/sh interpreter.\r
+# For more examples and pre-written hooks, see those in\r
+# the Subversion repository at\r
+# http://svn.apache.org/repos/asf/subversion/trunk/tools/hook-scripts/ and\r
+# http://svn.apache.org/repos/asf/subversion/trunk/contrib/hook-scripts/\r
+\r
+\r
+REPOS="$1"\r
+TXN="$2"\r
+\r
+# Make sure that the log message contains some text.\r
+SVNLOOK=/usr/local/bin/svnlook\r
+$SVNLOOK log -t "$TXN" "$REPOS" | \\r
+   grep "[a-zA-Z0-9]" > /dev/null || exit 1\r
+\r
+# Check that the author of this commit has the rights to perform\r
+# the commit on the files and directories being modified.\r
+commit-access-control.pl "$REPOS" "$TXN" commit-access-control.cfg || exit 1\r
+\r
+# All checks passed, so allow the commit.\r
+exit 0\r
diff --git a/freedv/branches/0.97/hooks/pre-lock.tmpl b/freedv/branches/0.97/hooks/pre-lock.tmpl
new file mode 100644 (file)
index 0000000..8ced86c
--- /dev/null
@@ -0,0 +1,73 @@
+#!/bin/sh\r
+\r
+# PRE-LOCK HOOK\r
+#\r
+# The pre-lock hook is invoked before an exclusive lock is\r
+# created.  Subversion runs this hook by invoking a program \r
+# (script, executable, binary, etc.) named 'pre-lock' (for which\r
+# this file is a template), with the following ordered arguments:\r
+#\r
+#   [1] REPOS-PATH   (the path to this repository)\r
+#   [2] PATH         (the path in the repository about to be locked)\r
+#   [3] USER         (the user creating the lock)\r
+#   [4] COMMENT      (the comment of the lock)\r
+#   [5] STEAL-LOCK   (1 if the user is trying to steal the lock, else 0)\r
+#\r
+# If the hook program outputs anything on stdout, the output string will\r
+# be used as the lock token for this lock operation.  If you choose to use\r
+# this feature, you must guarantee the tokens generated are unique across\r
+# the repository each time.\r
+#\r
+# The default working directory for the invocation is undefined, so\r
+# the program should set one explicitly if it cares.\r
+#\r
+# If the hook program exits with success, the lock is created; but\r
+# if it exits with failure (non-zero), the lock action is aborted\r
+# and STDERR is returned to the client.\r
+\r
+# On a Unix system, the normal procedure is to have 'pre-lock'\r
+# invoke other programs to do the real work, though it may do the\r
+# work itself too.\r
+#\r
+# Note that 'pre-lock' must be executable by the user(s) who will\r
+# invoke it (typically the user httpd runs as), and that user must\r
+# have filesystem-level permission to access the repository.\r
+#\r
+# On a Windows system, you should name the hook program\r
+# 'pre-lock.bat' or 'pre-lock.exe',\r
+# but the basic idea is the same.\r
+#\r
+# Here is an example hook script, for a Unix /bin/sh interpreter:\r
+\r
+REPOS="$1"\r
+PATH="$2"\r
+USER="$3"\r
+COMMENT="$4"\r
+STEAL="$5"\r
+\r
+# If a lock exists and is owned by a different person, don't allow it\r
+# to be stolen (e.g., with 'svn lock --force ...').\r
+\r
+# (Maybe this script could send email to the lock owner?)\r
+SVNLOOK=/usr/local/bin/svnlook\r
+GREP=/bin/grep\r
+SED=/bin/sed\r
+\r
+LOCK_OWNER=`$SVNLOOK lock "$REPOS" "$PATH" | \\r
+            $GREP '^Owner: ' | $SED 's/Owner: //'`\r
+\r
+# If we get no result from svnlook, there's no lock, allow the lock to\r
+# happen:\r
+if [ "$LOCK_OWNER" = "" ]; then\r
+  exit 0\r
+fi\r
+\r
+# If the person locking matches the lock's owner, allow the lock to\r
+# happen:\r
+if [ "$LOCK_OWNER" = "$USER" ]; then\r
+  exit 0\r
+fi\r
+\r
+# Otherwise, we've got an owner mismatch, so return failure:\r
+echo "Error: $PATH already locked by ${LOCK_OWNER}." 1>&2\r
+exit 1\r
diff --git a/freedv/branches/0.97/hooks/pre-revprop-change.tmpl b/freedv/branches/0.97/hooks/pre-revprop-change.tmpl
new file mode 100644 (file)
index 0000000..9aa7c95
--- /dev/null
@@ -0,0 +1,66 @@
+#!/bin/sh\r
+\r
+# PRE-REVPROP-CHANGE HOOK\r
+#\r
+# The pre-revprop-change hook is invoked before a revision property\r
+# is added, modified or deleted.  Subversion runs this hook by invoking\r
+# a program (script, executable, binary, etc.) named 'pre-revprop-change'\r
+# (for which this file is a template), with the following ordered\r
+# arguments:\r
+#\r
+#   [1] REPOS-PATH   (the path to this repository)\r
+#   [2] REV          (the revision being tweaked)\r
+#   [3] USER         (the username of the person tweaking the property)\r
+#   [4] PROPNAME     (the property being set on the revision)\r
+#   [5] ACTION       (the property is being 'A'dded, 'M'odified, or 'D'eleted)\r
+#\r
+#   [STDIN] PROPVAL  ** the new property value is passed via STDIN.\r
+#\r
+# If the hook program exits with success, the propchange happens; but\r
+# if it exits with failure (non-zero), the propchange doesn't happen.\r
+# The hook program can use the 'svnlook' utility to examine the \r
+# existing value of the revision property.\r
+#\r
+# WARNING: unlike other hooks, this hook MUST exist for revision\r
+# properties to be changed.  If the hook does not exist, Subversion \r
+# will behave as if the hook were present, but failed.  The reason\r
+# for this is that revision properties are UNVERSIONED, meaning that\r
+# a successful propchange is destructive;  the old value is gone\r
+# forever.  We recommend the hook back up the old value somewhere.\r
+#\r
+# On a Unix system, the normal procedure is to have 'pre-revprop-change'\r
+# invoke other programs to do the real work, though it may do the\r
+# work itself too.\r
+#\r
+# Note that 'pre-revprop-change' must be executable by the user(s) who will\r
+# invoke it (typically the user httpd runs as), and that user must\r
+# have filesystem-level permission to access the repository.\r
+#\r
+# On a Windows system, you should name the hook program\r
+# 'pre-revprop-change.bat' or 'pre-revprop-change.exe',\r
+# but the basic idea is the same.\r
+#\r
+# The hook program typically does not inherit the environment of\r
+# its parent process.  For example, a common problem is for the\r
+# PATH environment variable to not be set to its usual value, so\r
+# that subprograms fail to launch unless invoked via absolute path.\r
+# If you're having unexpected problems with a hook program, the\r
+# culprit may be unusual (or missing) environment variables.\r
+# \r
+# Here is an example hook script, for a Unix /bin/sh interpreter.\r
+# For more examples and pre-written hooks, see those in\r
+# the Subversion repository at\r
+# http://svn.apache.org/repos/asf/subversion/trunk/tools/hook-scripts/ and\r
+# http://svn.apache.org/repos/asf/subversion/trunk/contrib/hook-scripts/\r
+\r
+\r
+REPOS="$1"\r
+REV="$2"\r
+USER="$3"\r
+PROPNAME="$4"\r
+ACTION="$5"\r
+\r
+if [ "$ACTION" = "M" -a "$PROPNAME" = "svn:log" ]; then exit 0; fi\r
+\r
+echo "Changing revision properties other than svn:log is prohibited" >&2\r
+exit 1\r
diff --git a/freedv/branches/0.97/hooks/pre-unlock.tmpl b/freedv/branches/0.97/hooks/pre-unlock.tmpl
new file mode 100644 (file)
index 0000000..8617b22
--- /dev/null
@@ -0,0 +1,65 @@
+#!/bin/sh\r
+\r
+# PRE-UNLOCK HOOK\r
+#\r
+# The pre-unlock hook is invoked before an exclusive lock is\r
+# destroyed.  Subversion runs this hook by invoking a program \r
+# (script, executable, binary, etc.) named 'pre-unlock' (for which\r
+# this file is a template), with the following ordered arguments:\r
+#\r
+#   [1] REPOS-PATH   (the path to this repository)\r
+#   [2] PATH         (the path in the repository about to be unlocked)\r
+#   [3] USER         (the user destroying the lock)\r
+#   [4] TOKEN        (the lock token to be destroyed)\r
+#   [5] BREAK-UNLOCK (1 if the user is breaking the lock, else 0)\r
+#\r
+# The default working directory for the invocation is undefined, so\r
+# the program should set one explicitly if it cares.\r
+#\r
+# If the hook program exits with success, the lock is destroyed; but\r
+# if it exits with failure (non-zero), the unlock action is aborted\r
+# and STDERR is returned to the client.\r
+\r
+# On a Unix system, the normal procedure is to have 'pre-unlock'\r
+# invoke other programs to do the real work, though it may do the\r
+# work itself too.\r
+#\r
+# Note that 'pre-unlock' must be executable by the user(s) who will\r
+# invoke it (typically the user httpd runs as), and that user must\r
+# have filesystem-level permission to access the repository.\r
+#\r
+# On a Windows system, you should name the hook program\r
+# 'pre-unlock.bat' or 'pre-unlock.exe',\r
+# but the basic idea is the same.\r
+#\r
+# Here is an example hook script, for a Unix /bin/sh interpreter:\r
+\r
+REPOS="$1"\r
+PATH="$2"\r
+USER="$3"\r
+TOKEN="$4"\r
+BREAK="$5"\r
+\r
+# If a lock is owned by a different person, don't allow it be broken.\r
+# (Maybe this script could send email to the lock owner?)\r
+\r
+SVNLOOK=/usr/local/bin/svnlook\r
+GREP=/bin/grep\r
+SED=/bin/sed\r
+\r
+LOCK_OWNER=`$SVNLOOK lock "$REPOS" "$PATH" | \\r
+            $GREP '^Owner: ' | $SED 's/Owner: //'`\r
+\r
+# If we get no result from svnlook, there's no lock, return success:\r
+if [ "$LOCK_OWNER" = "" ]; then\r
+  exit 0\r
+fi\r
+\r
+# If the person unlocking matches the lock's owner, return success:\r
+if [ "$LOCK_OWNER" = "$USER" ]; then\r
+  exit 0\r
+fi\r
+\r
+# Otherwise, we've got an owner mismatch, so return failure:\r
+echo "Error: $PATH locked by ${LOCK_OWNER}." 1>&2\r
+exit 1\r
diff --git a/freedv/branches/0.97/hooks/start-commit.tmpl b/freedv/branches/0.97/hooks/start-commit.tmpl
new file mode 100644 (file)
index 0000000..7df182e
--- /dev/null
@@ -0,0 +1,65 @@
+#!/bin/sh\r
+\r
+# START-COMMIT HOOK\r
+#\r
+# The start-commit hook is invoked before a Subversion txn is created\r
+# in the process of doing a commit.  Subversion runs this hook\r
+# by invoking a program (script, executable, binary, etc.) named\r
+# 'start-commit' (for which this file is a template)\r
+# with the following ordered arguments:\r
+#\r
+#   [1] REPOS-PATH   (the path to this repository)\r
+#   [2] USER         (the authenticated user attempting to commit)\r
+#   [3] CAPABILITIES (a colon-separated list of capabilities reported\r
+#                     by the client; see note below)\r
+#\r
+# Note: The CAPABILITIES parameter is new in Subversion 1.5, and 1.5\r
+# clients will typically report at least the "mergeinfo" capability.\r
+# If there are other capabilities, then the list is colon-separated,\r
+# e.g.: "mergeinfo:some-other-capability" (the order is undefined).\r
+#\r
+# The list is self-reported by the client.  Therefore, you should not\r
+# make security assumptions based on the capabilities list, nor should\r
+# you assume that clients reliably report every capability they have.\r
+#\r
+# The working directory for this hook program's invocation is undefined,\r
+# so the program should set one explicitly if it cares.\r
+#\r
+# If the hook program exits with success, the commit continues; but\r
+# if it exits with failure (non-zero), the commit is stopped before\r
+# a Subversion txn is created, and STDERR is returned to the client.\r
+#\r
+# On a Unix system, the normal procedure is to have 'start-commit'\r
+# invoke other programs to do the real work, though it may do the\r
+# work itself too.\r
+#\r
+# Note that 'start-commit' must be executable by the user(s) who will\r
+# invoke it (typically the user httpd runs as), and that user must\r
+# have filesystem-level permission to access the repository.\r
+#\r
+# On a Windows system, you should name the hook program\r
+# 'start-commit.bat' or 'start-commit.exe',\r
+# but the basic idea is the same.\r
+# \r
+# The hook program typically does not inherit the environment of\r
+# its parent process.  For example, a common problem is for the\r
+# PATH environment variable to not be set to its usual value, so\r
+# that subprograms fail to launch unless invoked via absolute path.\r
+# If you're having unexpected problems with a hook program, the\r
+# culprit may be unusual (or missing) environment variables.\r
+# \r
+# Here is an example hook script, for a Unix /bin/sh interpreter.\r
+# For more examples and pre-written hooks, see those in\r
+# the Subversion repository at\r
+# http://svn.apache.org/repos/asf/subversion/trunk/tools/hook-scripts/ and\r
+# http://svn.apache.org/repos/asf/subversion/trunk/contrib/hook-scripts/\r
+\r
+\r
+REPOS="$1"\r
+USER="$2"\r
+\r
+commit-allower.pl --repository "$REPOS" --user "$USER" || exit 1\r
+special-auth-check.py --user "$USER" --auth-level 3 || exit 1\r
+\r
+# All checks passed, so allow the commit.\r
+exit 0\r
diff --git a/freedv/branches/0.97/locks/db-logs.lock b/freedv/branches/0.97/locks/db-logs.lock
new file mode 100644 (file)
index 0000000..536ac36
--- /dev/null
@@ -0,0 +1,3 @@
+This file is not used by Subversion 1.3.x or later.\r
+However, its existence is required for compatibility with\r
+Subversion 1.2.x or earlier.\r
diff --git a/freedv/branches/0.97/locks/db.lock b/freedv/branches/0.97/locks/db.lock
new file mode 100644 (file)
index 0000000..536ac36
--- /dev/null
@@ -0,0 +1,3 @@
+This file is not used by Subversion 1.3.x or later.\r
+However, its existence is required for compatibility with\r
+Subversion 1.2.x or earlier.\r
diff --git a/freedv/branches/0.97/notes/FDMDV_build_notes.txt b/freedv/branches/0.97/notes/FDMDV_build_notes.txt
new file mode 100644 (file)
index 0000000..1c936f6
--- /dev/null
@@ -0,0 +1,90 @@
+# ===========================================================\r
+# Build notes for portaudio\r
+# ===========================================================\r
+\r
+For building FDMDV2:\r
+using PortAudio November 21, 2011, SVN rev 1788 \r
+On Windows\r
+Built with MinGW/MSYS.\r
+\r
+Ignore this bit for now:  \r
+# ===========================================================\r
+# Config commandline:\r
+# ./configure --enable-cxx --with-winapi=directx  --with-dxdir="/p/Radio/fdmdv2/extern"\r
+# \r
+# I configured my "C:/Users/wittend/Projects/dx7sdk" to appear as /p in the MSys \r
+# environment.  This required editing the MSys /etc/fstab file (actually in my \r
+# C:\bin\MinGW\msys\1.0\etc folder) to contain: \r
+# \r
+# C:/bin/MinGW/   /mingw\r
+# C:/Users/wittend/Projects    /p\r
+# \r
+# Also, MSys does not seem to like paths like:\r
+# "C:\Program Files\Microsoft DirectX SDK (August 2010)\" \r
+# so I had to move it to my "C:/Users/wittend/Projects/dx7sdk".\r
+# ===========================================================\r
+\r
+Finally gave up on Dsound for now. Used this instead:\r
+\r
+./configure --enable-cxx\r
+\r
+configure output:\r
+\r
+Configuration summary:\r
+\r
+  Target ...................... i686-pc-mingw32\r
+  C++ bindings ................ yes\r
+  Debug output ................ no\r
+\r
+  WMME ........................ yes\r
+  DSound ...................... no\r
+  ASIO ........................ no\r
+  WASAPI ...................... no\r
+  WDMKS ....................... no\r
+\r
+#---------------------------------------------------------------------------------------------------------  \r
+Here is some info from the portaudio Wiki about building with Microsoft compilers that may be helpful:\r
+# -----------------------------------------------------------\r
+6) Select "all configurations" in the "Configurations" combo box above. Select "All Platforms" in the "Platforms" combo box.\r
+7) Now set a few options:\r
+\r
+C/C++ -> Optimization -> Omit frame pointers = Yes\r
+C/C++ -> Code Generation -> Runtime library = /MT\r
+Optional: C/C++ -> Code Generation -> Floating point model = fast\r
+\r
+NOTE: For most users it is not necessary to explicitly set the structure member alignment; the default should work fine. \r
+However some languages require, for example, 4-byte alignment. If you are having problems with portaudio.h structure \r
+members not being properly read or written to, it may be necessary to explicitly set this value by going to \r
+C/C++ -> Code Generation -> Struct member alignment and setting it to an appropriate value (four is a common value). \r
+If your compiler is configurable, you should ensure that it is set to use the same structure member alignment value \r
+as used for the PortAudio build.\r
+\r
+Preprocessor Definitions:\r
+# -----------------------------------------------------------\r
+Since the preprocessor definitions are different for each configuration and platform, you'll need to edit these \r
+individually for each configuration/platform combination that you want to modify using the "Configurations" and \r
+"Platforms" combo boxes.\r
+\r
+8) To suppress PortAudio runtime debug console output, go to Project -> Properties -> Configuration Properties\r
+ -> C/C++ -> Preprocessor. In the field 'Preprocessor Definitions', find PA_ENABLE_DEBUG_OUTPUT and remove it. \r
+The console will not output debug messages.\r
+9) Also in the preprocessor definitions you need to explicitly define the audio APIs you wish to use. For \r
+Windows the available API definitions are:\r
+\r
+PA_USE_ASIO[[BR]] PA_USE_DS (DirectSound)[[BR]] PA_USE_WMME (MME)[[BR]] PA_USE_WASAPI[[BR]] PA_USE_WDMKS[[BR]] PA_USE_SKELETON\r
+For each of these, the value of 0 indicates that support for this API should not be included. The value 1 indicates \r
+that support for this API should be included.\r
+\r
+Building:\r
+# -----------------------------------------------------------\r
+As when setting Preprocessor definitions, building is a per-configuration per-platform process. Follow these \r
+instructions for each configuration/platform combination that you're interested in.\r
+10) From the Build menu click Build -> Build solution. For 32-bit compilations, the dll file created by this \r
+process (portaudio_x86.dll) can be found in the directory build\msvc\Win32\Release. For 64-bit compilations, \r
+the dll file is called portaudio_x64.dll, and is found in the directory build\msvc\x64\Release.\r
+11) Now, any project which requires portaudio can be linked with portaudio_x86.lib (or _x64) and include the\r
+relevant headers (portaudio.h, and/or pa_asio.h , pa_x86_plain_converters.h) You may want to add/remove some \r
+DLL entry points. Right now those 6 entries are not from portaudio.h:\r
+(from portaudio.def) \r
+#---------------------------------------------------------------------------------------------------------  \r
+\r
diff --git a/freedv/branches/0.97/notes/codec2-MinGW-build/codec2-MinGW-build.tags b/freedv/branches/0.97/notes/codec2-MinGW-build/codec2-MinGW-build.tags
new file mode 100644 (file)
index 0000000..cceec0a
Binary files /dev/null and b/freedv/branches/0.97/notes/codec2-MinGW-build/codec2-MinGW-build.tags differ
diff --git a/freedv/branches/0.97/notes/codec2-MinGW-build/codec2-MinGW-build.workspace b/freedv/branches/0.97/notes/codec2-MinGW-build/codec2-MinGW-build.workspace
new file mode 100644 (file)
index 0000000..6a8c018
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CodeLite_Workspace Name="codec2-MinGW-build" Database="./codec2-MinGW-build.tags">
+  <Project Name="codec2basic" Path="codec2basic/codec2basic.project" Active="Yes"/>
+  <BuildMatrix>
+    <WorkspaceConfiguration Name="Debug" Selected="yes">
+      <Project Name="codec2basic" ConfigName="Debug"/>
+    </WorkspaceConfiguration>
+    <WorkspaceConfiguration Name="Release" Selected="yes">
+      <Project Name="codec2basic" ConfigName="Release"/>
+    </WorkspaceConfiguration>
+  </BuildMatrix>
+</CodeLite_Workspace>
diff --git a/freedv/branches/0.97/notes/codec2-MinGW-build/codec2-MinGW-build.workspace.session b/freedv/branches/0.97/notes/codec2-MinGW-build/codec2-MinGW-build.workspace.session
new file mode 100644 (file)
index 0000000..58e84ab
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Session Name="C:\Users\wittend\Projects\codec2-MinGW-build\codec2-MinGW-build.workspace">
+  <int Value="0" Name="m_selectedTab"/>
+  <wxString Value="C:\Users\wittend\Projects\codec2-MinGW-build\codec2-MinGW-build.workspace" Name="m_workspaceName"/>
+  <TabInfoArray Name="TabInfoArray"/>
+  <SerializedObject Name="m_breakpoints">
+    <long Value="0" Name="Count"/>
+  </SerializedObject>
+</Session>
diff --git a/freedv/branches/0.97/notes/codec2-MinGW-build/codec2basic/codec2basic.project b/freedv/branches/0.97/notes/codec2-MinGW-build/codec2basic/codec2basic.project
new file mode 100644 (file)
index 0000000..9a14a4e
--- /dev/null
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CodeLite_Project Name="codec2basic" InternalType="Console">
+  <Description/>
+  <Dependencies/>
+  <Settings Type="Executable">
+    <GlobalSettings>
+      <Compiler Options="" C_Options="">
+        <IncludePath Value="."/>
+      </Compiler>
+      <Linker Options="">
+        <LibraryPath Value="."/>
+      </Linker>
+      <ResourceCompiler Options=""/>
+    </GlobalSettings>
+    <Configuration Name="Debug" CompilerType="gnu gcc" DebuggerType="GNU gdb debugger" Type="" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append">
+      <Compiler Options="-g;-O0;-Wall" C_Options="-g;-O0;-Wall" Required="yes" PreCompiledHeader="" PCHInCommandLine="no" UseDifferentPCHFlags="no" PCHFlags="">
+        <IncludePath Value="."/>
+      </Compiler>
+      <Linker Options="" Required="yes"/>
+      <ResourceCompiler Options="" Required="no"/>
+      <General OutputFile="$(IntermediateDirectory)/$(ProjectName)" IntermediateDirectory="./Debug" Command="./$(ProjectName)" CommandArguments="" UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="yes"/>
+      <Environment EnvVarSetName="&lt;Use Defaults&gt;" DbgSetName="&lt;Use Defaults&gt;">
+        <![CDATA[]]>
+      </Environment>
+      <Debugger IsRemote="no" RemoteHostName="" RemoteHostPort="" DebuggerPath="">
+        <PostConnectCommands/>
+        <StartupCommands/>
+      </Debugger>
+      <PreBuild/>
+      <PostBuild/>
+      <CustomBuild Enabled="no">
+        <RebuildCommand/>
+        <CleanCommand/>
+        <BuildCommand/>
+        <PreprocessFileCommand/>
+        <SingleFileCommand/>
+        <MakefileGenerationCommand/>
+        <ThirdPartyToolName>None</ThirdPartyToolName>
+        <WorkingDirectory/>
+      </CustomBuild>
+      <AdditionalRules>
+        <CustomPostBuild/>
+        <CustomPreBuild/>
+      </AdditionalRules>
+      <Completion>
+        <ClangCmpFlags/>
+        <ClangPP/>
+        <SearchPaths/>
+      </Completion>
+    </Configuration>
+    <Configuration Name="Release" CompilerType="gnu gcc" DebuggerType="GNU gdb debugger" Type="" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append">
+      <Compiler Options="-O2;-Wall" C_Options="-O2;-Wall" Required="yes" PreCompiledHeader="" PCHInCommandLine="no" UseDifferentPCHFlags="no" PCHFlags="">
+        <IncludePath Value="."/>
+      </Compiler>
+      <Linker Options="" Required="yes"/>
+      <ResourceCompiler Options="" Required="no"/>
+      <General OutputFile="$(IntermediateDirectory)/$(ProjectName)" IntermediateDirectory="./Release" Command="./$(ProjectName)" CommandArguments="" UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="yes"/>
+      <Environment EnvVarSetName="&lt;Use Defaults&gt;" DbgSetName="&lt;Use Defaults&gt;">
+        <![CDATA[]]>
+      </Environment>
+      <Debugger IsRemote="no" RemoteHostName="" RemoteHostPort="" DebuggerPath="">
+        <PostConnectCommands/>
+        <StartupCommands/>
+      </Debugger>
+      <PreBuild/>
+      <PostBuild/>
+      <CustomBuild Enabled="no">
+        <RebuildCommand/>
+        <CleanCommand/>
+        <BuildCommand/>
+        <PreprocessFileCommand/>
+        <SingleFileCommand/>
+        <MakefileGenerationCommand/>
+        <ThirdPartyToolName>None</ThirdPartyToolName>
+        <WorkingDirectory/>
+      </CustomBuild>
+      <AdditionalRules>
+        <CustomPostBuild/>
+        <CustomPreBuild/>
+      </AdditionalRules>
+      <Completion>
+        <ClangCmpFlags/>
+        <ClangPP/>
+        <SearchPaths/>
+      </Completion>
+    </Configuration>
+  </Settings>
+  <VirtualDirectory Name="src">
+    <File Name="main.c"/>
+  </VirtualDirectory>
+</CodeLite_Project>
diff --git a/freedv/branches/0.97/notes/codec2-MinGW-build/codec2basic/main.c b/freedv/branches/0.97/notes/codec2-MinGW-build/codec2basic/main.c
new file mode 100644 (file)
index 0000000..82bd805
--- /dev/null
@@ -0,0 +1,7 @@
+#include <stdio.h>
+
+int main(int argc, char **argv)
+{
+       printf("hello world\n");
+       return 0;
+}
diff --git a/freedv/branches/0.97/notes/codec2-MinGW-build/extra-inc/endian.h b/freedv/branches/0.97/notes/codec2-MinGW-build/extra-inc/endian.h
new file mode 100644 (file)
index 0000000..11cbb7a
--- /dev/null
@@ -0,0 +1,96 @@
+/* Copyright (C) 1992, 1996, 1997, 2000, 2008 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library 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
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef        _ENDIAN_H
+#define        _ENDIAN_H       1
+
+//#include <features.h>
+
+/* Definitions for byte order, according to significance of bytes,
+   from low addresses to high addresses.  The value is what you get by
+   putting '4' in the most significant byte, '3' in the second most
+   significant byte, '2' in the second least significant byte, and '1'
+   in the least significant byte, and then writing down one digit for
+   each byte, starting with the byte at the lowest address at the left,
+   and proceeding to the byte with the highest address at the right.  */
+
+#define        __LITTLE_ENDIAN 1234
+#define        __BIG_ENDIAN    4321
+#define        __PDP_ENDIAN    3412
+
+/* This file defines `__BYTE_ORDER' for the particular machine.  */
+//#include <bits/endian.h>
+
+/* Some machines may need to use a different endianness for floating point
+   values.  */
+#ifndef __FLOAT_WORD_ORDER
+# define __FLOAT_WORD_ORDER __BYTE_ORDER
+#endif
+
+#ifdef __USE_BSD
+# define LITTLE_ENDIAN __LITTLE_ENDIAN
+# define BIG_ENDIAN    __BIG_ENDIAN
+# define PDP_ENDIAN    __PDP_ENDIAN
+# define BYTE_ORDER    __BYTE_ORDER
+#endif
+
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+# define __LONG_LONG_PAIR(HI, LO) LO, HI
+#elif __BYTE_ORDER == __BIG_ENDIAN
+# define __LONG_LONG_PAIR(HI, LO) HI, LO
+#endif
+
+
+#ifdef __USE_BSD
+/* Conversion interfaces.  */
+# include <bits/byteswap.h>
+
+# if __BYTE_ORDER == __LITTLE_ENDIAN
+#  define htobe16(x) __bswap_16 (x)
+#  define htole16(x) (x)
+#  define be16toh(x) __bswap_16 (x)
+#  define le16toh(x) (x)
+
+#  define htobe32(x) __bswap_32 (x)
+#  define htole32(x) (x)
+#  define be32toh(x) __bswap_32 (x)
+#  define le32toh(x) (x)
+
+#  define htobe64(x) __bswap_64 (x)
+#  define htole64(x) (x)
+#  define be64toh(x) __bswap_64 (x)
+#  define le64toh(x) (x)
+# else
+#  define htobe16(x) (x)
+#  define htole16(x) __bswap_16 (x)
+#  define be16toh(x) (x)
+#  define le16toh(x) __bswap_16 (x)
+
+#  define htobe32(x) (x)
+#  define htole32(x) __bswap_32 (x)
+#  define be32toh(x) (x)
+#  define le32toh(x) __bswap_32 (x)
+
+#  define htobe64(x) (x)
+#  define htole64(x) __bswap_64 (x)
+#  define be64toh(x) (x)
+#  define le64toh(x) __bswap_64 (x)
+# endif
+#endif
+
+#endif /* endian.h */
diff --git a/freedv/branches/0.97/notes/codec2-MinGW-build/extra-inc/sys/sound.h b/freedv/branches/0.97/notes/codec2-MinGW-build/extra-inc/sys/sound.h
new file mode 100644 (file)
index 0000000..b1fde3d
--- /dev/null
@@ -0,0 +1,26 @@
+
+/*
+ * Minor numbers for the sound driver.
+ */
+
+#include <linux/fs.h>
+
+#define SND_DEV_CTL                0   /* Control port /dev/mixer */
+#define SND_DEV_SEQ                1   /* Sequencer output /dev/sequencer (FM synthesizer and MIDI output) */
+#define SND_DEV_MIDIN          2       /* Raw midi access */
+#define SND_DEV_DSP                3   /* Digitized voice /dev/dsp */
+#define SND_DEV_AUDIO          4       /* Sparc compatible /dev/audio */
+#define SND_DEV_DSP16          5       /* Like /dev/dsp but 16 bits/sample */
+/* #define SND_DEV_STATUS      6 */    /* /dev/sndstat (obsolete) */
+#define SND_DEV_UNUSED         6
+#define SND_DEV_AWFM           7       /* Reserved */
+#define SND_DEV_SEQ2           8       /* /dev/sequencer, level 2 interface */
+/* #define SND_DEV_SNDPROC     9 */    /* /dev/sndproc for programmable devices (not used) */
+/* #define SND_DEV_DMMIDI      9 */
+#define SND_DEV_SYNTH          9       /* Raw synth access /dev/synth (same as /dev/dmfm) */
+#define SND_DEV_DMFM           10      /* Raw synth access /dev/dmfm */
+#define SND_DEV_UNKNOWN11      11
+#define SND_DEV_ADSP           12      /* Like /dev/dsp (obsolete) */
+#define SND_DEV_AMIDI          13      /* Like /dev/midi (obsolete) */
+#define SND_DEV_ADMMIDI                14      /* Like /dev/dmmidi (onsolete) */
+
diff --git a/freedv/branches/0.97/notes/codec2-MinGW-build/extra-inc/sys/soundcard.h b/freedv/branches/0.97/notes/codec2-MinGW-build/extra-inc/sys/soundcard.h
new file mode 100644 (file)
index 0000000..d811549
--- /dev/null
@@ -0,0 +1,1276 @@
+#ifndef SOUNDCARD_H
+#define SOUNDCARD_H
+/*
+ * Copyright by Hannu Savolainen 1993-1997
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met: 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer. 2.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+
+/*
+ * OSS interface version. With versions earlier than 3.6 this value is
+ * an integer with value less than 361. In versions 3.6 and later
+ * it's a six digit hexadecimal value. For example value
+ * of 0x030600 represents OSS version 3.6.0.
+ * Use ioctl(fd, OSS_GETVERSION, &int) to get the version number of
+ * the currently active driver.
+ */
+#define SOUND_VERSION  0x030802
+#define OPEN_SOUND_SYSTEM
+
+/* In Linux we need to be prepared for cross compiling */
+//#include <linux/ioctl.h>
+
+/* Endian macros. */
+#  include <endian.h>
+
+/*
+ *     Supported card ID numbers (Should be somewhere else?)
+ */
+
+#define SNDCARD_ADLIB          1
+#define SNDCARD_SB                 2
+#define SNDCARD_PAS                3
+#define SNDCARD_GUS                4
+#define SNDCARD_MPU401         5
+#define SNDCARD_SB16           6
+#define SNDCARD_SB16MIDI       7
+#define SNDCARD_UART6850       8
+#define SNDCARD_GUS16          9
+#define SNDCARD_MSS                10
+#define SNDCARD_PSS            11
+#define SNDCARD_SSCAPE         12
+#define SNDCARD_PSS_MPU     13
+#define SNDCARD_PSS_MSS     14
+#define SNDCARD_SSCAPE_MSS     15
+#define SNDCARD_TRXPRO         16
+#define SNDCARD_TRXPRO_SB      17
+#define SNDCARD_TRXPRO_MPU     18
+#define SNDCARD_MAD16          19
+#define SNDCARD_MAD16_MPU      20
+#define SNDCARD_CS4232         21
+#define SNDCARD_CS4232_MPU     22
+#define SNDCARD_MAUI           23
+#define SNDCARD_PSEUDO_MSS     24
+#define SNDCARD_GUSPNP         25
+#define SNDCARD_UART401                26
+/* Sound card numbers 27 to N are reserved. Don't add more numbers here. */
+
+/***********************************
+ * IOCTL Commands for /dev/sequencer
+ */
+
+#ifndef _SIOWR
+#if defined(_IOWR) && (defined(_AIX) || (!defined(sun) && !defined(sparc) && !defined(__sparc__) && !defined(__INCioctlh) && !defined(__Lynx__)))
+/* Use already defined ioctl defines if they exist (except with Sun or Sparc) */
+#define        SIOCPARM_MASK   IOCPARM_MASK
+#define        SIOC_VOID       IOC_VOID
+#define        SIOC_OUT        IOC_OUT
+#define        SIOC_IN         IOC_IN
+#define        SIOC_INOUT      IOC_INOUT
+#define _SIOC_SIZE     _IOC_SIZE
+#define _SIOC_DIR      _IOC_DIR
+#define _SIOC_NONE     _IOC_NONE
+#define _SIOC_READ     _IOC_READ
+#define _SIOC_WRITE    _IOC_WRITE
+#define        _SIO            _IO
+#define        _SIOR           _IOR
+#define        _SIOW           _IOW
+#define        _SIOWR          _IOWR
+#else
+
+/* Ioctl's have the command encoded in the lower word,
+ * and the size of any in or out parameters in the upper
+ * word.  The high 2 bits of the upper word are used
+ * to encode the in/out status of the parameter; for now
+ * we restrict parameters to at most 8191 bytes.
+ */
+/* #define     SIOCTYPE                (0xff<<8) */
+#define        SIOCPARM_MASK   0x1fff          /* parameters must be < 8192 bytes */
+#define        SIOC_VOID       0x00000000      /* no parameters */
+#define        SIOC_OUT        0x20000000      /* copy out parameters */
+#define        SIOC_IN         0x40000000      /* copy in parameters */
+#define        SIOC_INOUT      (SIOC_IN|SIOC_OUT)
+/* the 0x20000000 is so we can distinguish new ioctl's from old */
+#define        _SIO(x,y)       ((int)(SIOC_VOID|(x<<8)|y))
+#define        _SIOR(x,y,t)    ((int)(SIOC_OUT|((sizeof(t)&SIOCPARM_MASK)<<16)|(x<<8)|y))
+#define        _SIOW(x,y,t)    ((int)(SIOC_IN|((sizeof(t)&SIOCPARM_MASK)<<16)|(x<<8)|y))
+/* this should be _SIORW, but stdio got there first */
+#define        _SIOWR(x,y,t)   ((int)(SIOC_INOUT|((sizeof(t)&SIOCPARM_MASK)<<16)|(x<<8)|y))
+#define _SIOC_SIZE(x)  ((x>>16)&SIOCPARM_MASK) 
+#define _SIOC_DIR(x)   (x & 0xf0000000)
+#define _SIOC_NONE     SIOC_VOID
+#define _SIOC_READ     SIOC_OUT
+#define _SIOC_WRITE    SIOC_IN
+#  endif /* _IOWR */
+#endif  /* !_SIOWR */
+
+#define SNDCTL_SEQ_RESET               _SIO  ('Q', 0)
+#define SNDCTL_SEQ_SYNC                        _SIO  ('Q', 1)
+#define SNDCTL_SYNTH_INFO              _SIOWR('Q', 2, struct synth_info)
+#define SNDCTL_SEQ_CTRLRATE            _SIOWR('Q', 3, int)     /* Set/get timer resolution (HZ) */
+#define SNDCTL_SEQ_GETOUTCOUNT         _SIOR ('Q', 4, int)
+#define SNDCTL_SEQ_GETINCOUNT          _SIOR ('Q', 5, int)
+#define SNDCTL_SEQ_PERCMODE            _SIOW ('Q', 6, int)
+#define SNDCTL_FM_LOAD_INSTR           _SIOW ('Q', 7, struct sbi_instrument)   /* Obsolete. Don't use!!!!!! */
+#define SNDCTL_SEQ_TESTMIDI            _SIOW ('Q', 8, int)
+#define SNDCTL_SEQ_RESETSAMPLES                _SIOW ('Q', 9, int)
+#define SNDCTL_SEQ_NRSYNTHS            _SIOR ('Q',10, int)
+#define SNDCTL_SEQ_NRMIDIS             _SIOR ('Q',11, int)
+#define SNDCTL_MIDI_INFO               _SIOWR('Q',12, struct midi_info)
+#define SNDCTL_SEQ_THRESHOLD           _SIOW ('Q',13, int)
+#define SNDCTL_SYNTH_MEMAVL            _SIOWR('Q',14, int)     /* in=dev#, out=memsize */
+#define SNDCTL_FM_4OP_ENABLE           _SIOW ('Q',15, int)     /* in=dev# */
+#define SNDCTL_SEQ_PANIC               _SIO  ('Q',17)
+#define SNDCTL_SEQ_OUTOFBAND           _SIOW ('Q',18, struct seq_event_rec)
+#define SNDCTL_SEQ_GETTIME             _SIOR ('Q',19, int)
+#define SNDCTL_SYNTH_ID                        _SIOWR('Q',20, struct synth_info)
+#define SNDCTL_SYNTH_CONTROL           _SIOWR('Q',21, struct synth_control)
+#define SNDCTL_SYNTH_REMOVESAMPLE      _SIOWR('Q',22, struct remove_sample)
+
+typedef struct synth_control
+{
+       int devno;      /* Synthesizer # */
+       char data[4000]; /* Device spesific command/data record */
+}synth_control;
+
+typedef struct remove_sample
+{
+       int devno;      /* Synthesizer # */
+       int bankno;     /* MIDI bank # (0=General MIDI) */
+       int instrno;    /* MIDI instrument number */
+} remove_sample;
+
+typedef struct seq_event_rec {
+               unsigned char arr[8];
+} seq_event_rec;
+
+#define SNDCTL_TMR_TIMEBASE            _SIOWR('T', 1, int)
+#define SNDCTL_TMR_START               _SIO  ('T', 2)
+#define SNDCTL_TMR_STOP                        _SIO  ('T', 3)
+#define SNDCTL_TMR_CONTINUE            _SIO  ('T', 4)
+#define SNDCTL_TMR_TEMPO               _SIOWR('T', 5, int)
+#define SNDCTL_TMR_SOURCE              _SIOWR('T', 6, int)
+#      define TMR_INTERNAL             0x00000001
+#      define TMR_EXTERNAL             0x00000002
+#              define TMR_MODE_MIDI    0x00000010
+#              define TMR_MODE_FSK     0x00000020
+#              define TMR_MODE_CLS     0x00000040
+#              define TMR_MODE_SMPTE   0x00000080
+#define SNDCTL_TMR_METRONOME           _SIOW ('T', 7, int)
+#define SNDCTL_TMR_SELECT              _SIOW ('T', 8, int)
+
+/*
+ * Some big endian/little endian handling macros
+ */
+
+#define _LINUX_PATCHKEY_H_INDIRECT
+//#include <linux/patchkey.h>
+#undef _LINUX_PATCHKEY_H_INDIRECT
+
+#if   defined(__BYTE_ORDER)
+#  if __BYTE_ORDER == __BIG_ENDIAN
+#    define AFMT_S16_NE AFMT_S16_BE
+#  elif __BYTE_ORDER == __LITTLE_ENDIAN
+#    define AFMT_S16_NE AFMT_S16_LE
+#  else
+#    error "could not determine byte order"
+#  endif
+#endif
+
+/*
+ *     Sample loading mechanism for internal synthesizers (/dev/sequencer)
+ *     The following patch_info structure has been designed to support
+ *     Gravis UltraSound. It tries to be universal format for uploading
+ *     sample based patches but is probably too limited.
+ *
+ *      (PBD) As Hannu guessed, the GUS structure is too limited for 
+ *      the WaveFront, but this is the right place for a constant definition.
+ */
+
+struct patch_info {
+               unsigned short key;             /* Use WAVE_PATCH here */
+#define WAVE_PATCH        _PATCHKEY(0x04)
+#define GUS_PATCH         WAVE_PATCH
+#define WAVEFRONT_PATCH    _PATCHKEY(0x06)
+
+               short device_no;        /* Synthesizer number */
+               short instr_no;         /* Midi pgm# */
+
+               unsigned int mode;
+/*
+ * The least significant byte has the same format than the GUS .PAT
+ * files
+ */
+#define WAVE_16_BITS   0x01    /* bit 0 = 8 or 16 bit wave data. */
+#define WAVE_UNSIGNED  0x02    /* bit 1 = Signed - Unsigned data. */
+#define WAVE_LOOPING   0x04    /* bit 2 = looping enabled-1. */
+#define WAVE_BIDIR_LOOP        0x08    /* bit 3 = Set is bidirectional looping. */
+#define WAVE_LOOP_BACK 0x10    /* bit 4 = Set is looping backward. */
+#define WAVE_SUSTAIN_ON        0x20    /* bit 5 = Turn sustaining on. (Env. pts. 3)*/
+#define WAVE_ENVELOPES 0x40    /* bit 6 = Enable envelopes - 1 */
+#define WAVE_FAST_RELEASE 0x80 /* bit 7 = Shut off immediately after note off */
+                               /*      (use the env_rate/env_offs fields). */
+/* Linux specific bits */
+#define WAVE_VIBRATO   0x00010000      /* The vibrato info is valid */
+#define WAVE_TREMOLO   0x00020000      /* The tremolo info is valid */
+#define WAVE_SCALE     0x00040000      /* The scaling info is valid */
+#define WAVE_FRACTIONS 0x00080000      /* Fraction information is valid */
+/* Reserved bits */
+#define WAVE_ROM       0x40000000      /* For future use */
+#define WAVE_MULAW     0x20000000      /* For future use */
+/* Other bits must be zeroed */
+
+               int len;        /* Size of the wave data in bytes */
+               int loop_start, loop_end; /* Byte offsets from the beginning */
+
+/* 
+ * The base_freq and base_note fields are used when computing the
+ * playback speed for a note. The base_note defines the tone frequency
+ * which is heard if the sample is played using the base_freq as the
+ * playback speed.
+ *
+ * The low_note and high_note fields define the minimum and maximum note
+ * frequencies for which this sample is valid. It is possible to define
+ * more than one samples for an instrument number at the same time. The
+ * low_note and high_note fields are used to select the most suitable one.
+ *
+ * The fields base_note, high_note and low_note should contain
+ * the note frequency multiplied by 1000. For example value for the
+ * middle A is 440*1000.
+ */
+
+               unsigned int base_freq;
+               unsigned int base_note;
+               unsigned int high_note;
+               unsigned int low_note;
+               int panning;    /* -128=left, 127=right */
+               int detuning;
+
+/*     New fields introduced in version 1.99.5 */
+
+       /* Envelope. Enabled by mode bit WAVE_ENVELOPES */
+               unsigned char   env_rate[ 6 ];   /* GUS HW ramping rate */
+               unsigned char   env_offset[ 6 ]; /* 255 == 100% */
+
+       /* 
+        * The tremolo, vibrato and scale info are not supported yet.
+        * Enable by setting the mode bits WAVE_TREMOLO, WAVE_VIBRATO or
+        * WAVE_SCALE
+        */
+
+               unsigned char   tremolo_sweep;
+               unsigned char   tremolo_rate;
+               unsigned char   tremolo_depth;
+       
+               unsigned char   vibrato_sweep;
+               unsigned char   vibrato_rate;
+               unsigned char   vibrato_depth;
+
+               int             scale_frequency;
+               unsigned int    scale_factor;           /* from 0 to 2048 or 0 to 2 */
+       
+               int             volume;
+               int             fractions;
+               int             reserved1;
+               int             spare[2];
+               char data[1];   /* The waveform data starts here */
+       };
+
+struct sysex_info {
+               short key;              /* Use SYSEX_PATCH or MAUI_PATCH here */
+#define SYSEX_PATCH    _PATCHKEY(0x05)
+#define MAUI_PATCH     _PATCHKEY(0x06)
+               short device_no;        /* Synthesizer number */
+               int len;        /* Size of the sysex data in bytes */
+               unsigned char data[1];  /* Sysex data starts here */
+       };
+
+/*
+ * /dev/sequencer input events.
+ *
+ * The data written to the /dev/sequencer is a stream of events. Events
+ * are records of 4 or 8 bytes. The first byte defines the size. 
+ * Any number of events can be written with a write call. There
+ * is a set of macros for sending these events. Use these macros if you
+ * want to maximize portability of your program.
+ *
+ * Events SEQ_WAIT, SEQ_MIDIPUTC and SEQ_ECHO. Are also input events.
+ * (All input events are currently 4 bytes long. Be prepared to support
+ * 8 byte events also. If you receive any event having first byte >= 128,
+ * it's a 8 byte event.
+ *
+ * The events are documented at the end of this file.
+ *
+ * Normal events (4 bytes)
+ * There is also a 8 byte version of most of the 4 byte events. The
+ * 8 byte one is recommended.
+ */
+#define SEQ_NOTEOFF            0
+#define SEQ_FMNOTEOFF          SEQ_NOTEOFF     /* Just old name */
+#define SEQ_NOTEON             1
+#define        SEQ_FMNOTEON            SEQ_NOTEON
+#define SEQ_WAIT               TMR_WAIT_ABS
+#define SEQ_PGMCHANGE          3
+#define SEQ_FMPGMCHANGE                SEQ_PGMCHANGE
+#define SEQ_SYNCTIMER          TMR_START
+#define SEQ_MIDIPUTC           5
+#define SEQ_DRUMON             6       /*** OBSOLETE ***/
+#define SEQ_DRUMOFF            7       /*** OBSOLETE ***/
+#define SEQ_ECHO               TMR_ECHO        /* For synching programs with output */
+#define SEQ_AFTERTOUCH         9
+#define SEQ_CONTROLLER         10
+
+/*******************************************
+ *     Midi controller numbers
+ *******************************************
+ * Controllers 0 to 31 (0x00 to 0x1f) and
+ * 32 to 63 (0x20 to 0x3f) are continuous
+ * controllers.
+ * In the MIDI 1.0 these controllers are sent using
+ * two messages. Controller numbers 0 to 31 are used
+ * to send the MSB and the controller numbers 32 to 63
+ * are for the LSB. Note that just 7 bits are used in MIDI bytes.
+ */
+
+#define           CTL_BANK_SELECT              0x00
+#define           CTL_MODWHEEL                 0x01
+#define    CTL_BREATH                  0x02
+/*             undefined               0x03 */
+#define    CTL_FOOT                    0x04
+#define    CTL_PORTAMENTO_TIME         0x05
+#define    CTL_DATA_ENTRY              0x06
+#define    CTL_MAIN_VOLUME             0x07
+#define    CTL_BALANCE                 0x08
+/*             undefined               0x09 */
+#define    CTL_PAN                     0x0a
+#define    CTL_EXPRESSION              0x0b
+/*             undefined               0x0c */
+/*             undefined               0x0d */
+/*             undefined               0x0e */
+/*             undefined               0x0f */
+#define    CTL_GENERAL_PURPOSE1        0x10
+#define    CTL_GENERAL_PURPOSE2        0x11
+#define    CTL_GENERAL_PURPOSE3        0x12
+#define    CTL_GENERAL_PURPOSE4        0x13
+/*             undefined               0x14 - 0x1f */
+
+/*             undefined               0x20 */
+/* The controller numbers 0x21 to 0x3f are reserved for the */
+/* least significant bytes of the controllers 0x00 to 0x1f. */
+/* These controllers are not recognised by the driver. */
+
+/* Controllers 64 to 69 (0x40 to 0x45) are on/off switches. */
+/* 0=OFF and 127=ON (intermediate values are possible) */
+#define    CTL_DAMPER_PEDAL            0x40
+#define    CTL_SUSTAIN                 0x40    /* Alias */
+#define    CTL_HOLD                    0x40    /* Alias */
+#define    CTL_PORTAMENTO              0x41
+#define    CTL_SOSTENUTO               0x42
+#define    CTL_SOFT_PEDAL              0x43
+/*             undefined               0x44 */
+#define    CTL_HOLD2                   0x45
+/*             undefined               0x46 - 0x4f */
+
+#define    CTL_GENERAL_PURPOSE5        0x50
+#define    CTL_GENERAL_PURPOSE6        0x51
+#define    CTL_GENERAL_PURPOSE7        0x52
+#define    CTL_GENERAL_PURPOSE8        0x53
+/*             undefined               0x54 - 0x5a */
+#define    CTL_EXT_EFF_DEPTH           0x5b
+#define    CTL_TREMOLO_DEPTH           0x5c
+#define    CTL_CHORUS_DEPTH            0x5d
+#define    CTL_DETUNE_DEPTH            0x5e
+#define    CTL_CELESTE_DEPTH           0x5e    /* Alias for the above one */
+#define    CTL_PHASER_DEPTH            0x5f
+#define    CTL_DATA_INCREMENT          0x60
+#define    CTL_DATA_DECREMENT          0x61
+#define    CTL_NONREG_PARM_NUM_LSB     0x62
+#define    CTL_NONREG_PARM_NUM_MSB     0x63
+#define    CTL_REGIST_PARM_NUM_LSB     0x64
+#define    CTL_REGIST_PARM_NUM_MSB     0x65
+/*             undefined               0x66 - 0x78 */
+/*             reserved                0x79 - 0x7f */
+
+/* Pseudo controllers (not midi compatible) */
+#define    CTRL_PITCH_BENDER           255
+#define    CTRL_PITCH_BENDER_RANGE     254
+#define    CTRL_EXPRESSION             253     /* Obsolete */
+#define    CTRL_MAIN_VOLUME            252     /* Obsolete */
+#define SEQ_BALANCE            11
+#define SEQ_VOLMODE             12
+
+/*
+ * Volume mode decides how volumes are used
+ */
+
+#define VOL_METHOD_ADAGIO      1
+#define VOL_METHOD_LINEAR      2
+
+/*
+ * Note! SEQ_WAIT, SEQ_MIDIPUTC and SEQ_ECHO are used also as
+ *      input events.
+ */
+
+/*
+ * Event codes 0xf0 to 0xfc are reserved for future extensions.
+ */
+
+#define SEQ_FULLSIZE           0xfd    /* Long events */
+/*
+ *     SEQ_FULLSIZE events are used for loading patches/samples to the
+ *     synthesizer devices. These events are passed directly to the driver
+ *     of the associated synthesizer device. There is no limit to the size
+ *     of the extended events. These events are not queued but executed
+ *     immediately when the write() is called (execution can take several
+ *     seconds of time). 
+ *
+ *     When a SEQ_FULLSIZE message is written to the device, it must
+ *     be written using exactly one write() call. Other events cannot
+ *     be mixed to the same write.
+ *     
+ *     For FM synths (YM3812/OPL3) use struct sbi_instrument and write it to the 
+ *     /dev/sequencer. Don't write other data together with the instrument structure
+ *     Set the key field of the structure to FM_PATCH. The device field is used to
+ *     route the patch to the corresponding device.
+ *
+ *     For wave table use struct patch_info. Initialize the key field
+ *      to WAVE_PATCH.
+ */
+#define SEQ_PRIVATE            0xfe    /* Low level HW dependent events (8 bytes) */
+#define SEQ_EXTENDED           0xff    /* Extended events (8 bytes) OBSOLETE */
+
+/*
+ * Record for FM patches
+ */
+
+typedef unsigned char sbi_instr_data[32];
+
+struct sbi_instrument {
+               unsigned short  key;    /* FM_PATCH or OPL3_PATCH */
+#define FM_PATCH       _PATCHKEY(0x01)
+#define OPL3_PATCH     _PATCHKEY(0x03)
+               short           device;         /*      Synth# (0-4)    */
+               int             channel;        /*      Program# to be initialized      */
+               sbi_instr_data  operators;      /*      Register settings for operator cells (.SBI format)      */
+       };
+
+struct synth_info {    /* Read only */
+               char    name[30];
+               int     device;         /* 0-N. INITIALIZE BEFORE CALLING */
+               int     synth_type;
+#define SYNTH_TYPE_FM                  0
+#define SYNTH_TYPE_SAMPLE              1
+#define SYNTH_TYPE_MIDI                        2       /* Midi interface */
+
+               int     synth_subtype;
+#define FM_TYPE_ADLIB                  0x00
+#define FM_TYPE_OPL3                   0x01
+#define MIDI_TYPE_MPU401               0x401
+
+#define SAMPLE_TYPE_BASIC              0x10
+#define SAMPLE_TYPE_GUS                        SAMPLE_TYPE_BASIC
+#define SAMPLE_TYPE_WAVEFRONT           0x11
+
+               int     perc_mode;      /* No longer supported */
+               int     nr_voices;
+               int     nr_drums;       /* Obsolete field */
+               int     instr_bank_size;
+               unsigned int    capabilities;   
+#define SYNTH_CAP_PERCMODE             0x00000001 /* No longer used */
+#define SYNTH_CAP_OPL3                 0x00000002 /* Set if OPL3 supported */
+#define SYNTH_CAP_INPUT                        0x00000004 /* Input (MIDI) device */
+               int     dummies[19];    /* Reserve space */
+       };
+
+struct sound_timer_info {
+               char name[32];
+               int caps;
+       };
+
+#define MIDI_CAP_MPU401                1               /* MPU-401 intelligent mode */
+
+struct midi_info {
+               char            name[30];
+               int             device;         /* 0-N. INITIALIZE BEFORE CALLING */
+               unsigned int    capabilities;   /* To be defined later */
+               int             dev_type;
+               int             dummies[18];    /* Reserve space */
+       };
+
+/********************************************
+ * ioctl commands for the /dev/midi##
+ */
+typedef struct {
+               unsigned char cmd;
+               char nr_args, nr_returns;
+               unsigned char data[30];
+       } mpu_command_rec;
+
+#define SNDCTL_MIDI_PRETIME            _SIOWR('m', 0, int)
+#define SNDCTL_MIDI_MPUMODE            _SIOWR('m', 1, int)
+#define SNDCTL_MIDI_MPUCMD             _SIOWR('m', 2, mpu_command_rec)
+
+/********************************************
+ * IOCTL commands for /dev/dsp and /dev/audio
+ */
+
+#define SNDCTL_DSP_RESET               _SIO  ('P', 0)
+#define SNDCTL_DSP_SYNC                        _SIO  ('P', 1)
+#define SNDCTL_DSP_SPEED               _SIOWR('P', 2, int)
+#define SNDCTL_DSP_STEREO              _SIOWR('P', 3, int)
+#define SNDCTL_DSP_GETBLKSIZE          _SIOWR('P', 4, int)
+#define SNDCTL_DSP_SAMPLESIZE          SNDCTL_DSP_SETFMT
+#define SNDCTL_DSP_CHANNELS            _SIOWR('P', 6, int)
+#define SOUND_PCM_WRITE_CHANNELS       SNDCTL_DSP_CHANNELS
+#define SOUND_PCM_WRITE_FILTER         _SIOWR('P', 7, int)
+#define SNDCTL_DSP_POST                        _SIO  ('P', 8)
+#define SNDCTL_DSP_SUBDIVIDE           _SIOWR('P', 9, int)
+#define SNDCTL_DSP_SETFRAGMENT         _SIOWR('P',10, int)
+
+/*     Audio data formats (Note! U8=8 and S16_LE=16 for compatibility) */
+#define SNDCTL_DSP_GETFMTS             _SIOR ('P',11, int) /* Returns a mask */
+#define SNDCTL_DSP_SETFMT              _SIOWR('P',5, int) /* Selects ONE fmt*/
+#      define AFMT_QUERY               0x00000000      /* Return current fmt */
+#      define AFMT_MU_LAW              0x00000001
+#      define AFMT_A_LAW               0x00000002
+#      define AFMT_IMA_ADPCM           0x00000004
+#      define AFMT_U8                  0x00000008
+#      define AFMT_S16_LE              0x00000010      /* Little endian signed 16*/
+#      define AFMT_S16_BE              0x00000020      /* Big endian signed 16 */
+#      define AFMT_S8                  0x00000040
+#      define AFMT_U16_LE              0x00000080      /* Little endian U16 */
+#      define AFMT_U16_BE              0x00000100      /* Big endian U16 */
+#      define AFMT_MPEG                0x00000200      /* MPEG (2) audio */
+#      define AFMT_AC3         0x00000400      /* Dolby Digital AC3 */
+
+/*
+ * Buffer status queries.
+ */
+typedef struct audio_buf_info {
+                       int fragments;  /* # of available fragments (partially usend ones not counted) */
+                       int fragstotal; /* Total # of fragments allocated */
+                       int fragsize;   /* Size of a fragment in bytes */
+
+                       int bytes;      /* Available space in bytes (includes partially used fragments) */
+                       /* Note! 'bytes' could be more than fragments*fragsize */
+               } audio_buf_info;
+
+#define SNDCTL_DSP_GETOSPACE           _SIOR ('P',12, audio_buf_info)
+#define SNDCTL_DSP_GETISPACE           _SIOR ('P',13, audio_buf_info)
+#define SNDCTL_DSP_NONBLOCK            _SIO  ('P',14)
+#define SNDCTL_DSP_GETCAPS             _SIOR ('P',15, int)
+#      define DSP_CAP_REVISION         0x000000ff      /* Bits for revision level (0 to 255) */
+#      define DSP_CAP_DUPLEX           0x00000100      /* Full duplex record/playback */
+#      define DSP_CAP_REALTIME         0x00000200      /* Real time capability */
+#      define DSP_CAP_BATCH            0x00000400      /* Device has some kind of */
+                                                       /* internal buffers which may */
+                                                       /* cause some delays and */
+                                                       /* decrease precision of timing */
+#      define DSP_CAP_COPROC           0x00000800      /* Has a coprocessor */
+                                                       /* Sometimes it's a DSP */
+                                                       /* but usually not */
+#      define DSP_CAP_TRIGGER          0x00001000      /* Supports SETTRIGGER */
+#      define DSP_CAP_MMAP             0x00002000      /* Supports mmap() */
+#      define DSP_CAP_MULTI            0x00004000      /* support multiple open */
+#      define DSP_CAP_BIND             0x00008000      /* channel binding to front/rear/cneter/lfe */
+
+
+#define SNDCTL_DSP_GETTRIGGER          _SIOR ('P',16, int)
+#define SNDCTL_DSP_SETTRIGGER          _SIOW ('P',16, int)
+#      define PCM_ENABLE_INPUT         0x00000001
+#      define PCM_ENABLE_OUTPUT                0x00000002
+
+typedef struct count_info {
+               int bytes;      /* Total # of bytes processed */
+               int blocks;     /* # of fragment transitions since last time */
+               int ptr;        /* Current DMA pointer value */
+       } count_info;
+
+#define SNDCTL_DSP_GETIPTR             _SIOR ('P',17, count_info)
+#define SNDCTL_DSP_GETOPTR             _SIOR ('P',18, count_info)
+
+typedef struct buffmem_desc {
+               unsigned *buffer;
+               int size;
+       } buffmem_desc;
+#define SNDCTL_DSP_MAPINBUF            _SIOR ('P', 19, buffmem_desc)
+#define SNDCTL_DSP_MAPOUTBUF           _SIOR ('P', 20, buffmem_desc)
+#define SNDCTL_DSP_SETSYNCRO           _SIO  ('P', 21)
+#define SNDCTL_DSP_SETDUPLEX           _SIO  ('P', 22)
+#define SNDCTL_DSP_GETODELAY           _SIOR ('P', 23, int)
+
+#define SNDCTL_DSP_GETCHANNELMASK              _SIOWR('P', 64, int)
+#define SNDCTL_DSP_BIND_CHANNEL                _SIOWR('P', 65, int)
+#      define DSP_BIND_QUERY           0x00000000
+#      define DSP_BIND_FRONT           0x00000001
+#      define DSP_BIND_SURR            0x00000002
+#      define DSP_BIND_CENTER_LFE      0x00000004
+#      define DSP_BIND_HANDSET         0x00000008
+#      define DSP_BIND_MIC             0x00000010
+#      define DSP_BIND_MODEM1          0x00000020
+#      define DSP_BIND_MODEM2          0x00000040
+#      define DSP_BIND_I2S             0x00000080
+#      define DSP_BIND_SPDIF           0x00000100
+
+#define SNDCTL_DSP_SETSPDIF            _SIOW ('P', 66, int)
+#define SNDCTL_DSP_GETSPDIF            _SIOR ('P', 67, int)
+#      define SPDIF_PRO        0x0001
+#      define SPDIF_N_AUD      0x0002
+#      define SPDIF_COPY       0x0004
+#      define SPDIF_PRE        0x0008
+#      define SPDIF_CC         0x07f0
+#      define SPDIF_L          0x0800
+#      define SPDIF_DRS        0x4000
+#      define SPDIF_V          0x8000
+
+/*
+ * Application's profile defines the way how playback underrun situations should be handled.
+ * 
+ *     APF_NORMAL (the default) and APF_NETWORK make the driver to cleanup the
+ *     playback buffer whenever an underrun occurs. This consumes some time
+ *     prevents looping the existing buffer.
+ *     APF_CPUINTENS is intended to be set by CPU intensive applications which
+ *     are likely to run out of time occasionally. In this mode the buffer cleanup is
+ *     disabled which saves CPU time but also let's the previous buffer content to
+ *     be played during the "pause" after the underrun.
+ */
+#define SNDCTL_DSP_PROFILE             _SIOW ('P', 23, int)
+#define          APF_NORMAL    0       /* Normal applications */
+#define          APF_NETWORK   1       /* Underruns probably caused by an "external" delay */
+#define   APF_CPUINTENS 2      /* Underruns probably caused by "overheating" the CPU */
+
+#define SOUND_PCM_READ_RATE            _SIOR ('P', 2, int)
+#define SOUND_PCM_READ_CHANNELS                _SIOR ('P', 6, int)
+#define SOUND_PCM_READ_BITS            _SIOR ('P', 5, int)
+#define SOUND_PCM_READ_FILTER          _SIOR ('P', 7, int)
+
+/* Some alias names */
+#define SOUND_PCM_WRITE_BITS           SNDCTL_DSP_SETFMT
+#define SOUND_PCM_WRITE_RATE           SNDCTL_DSP_SPEED
+#define SOUND_PCM_POST                 SNDCTL_DSP_POST
+#define SOUND_PCM_RESET                        SNDCTL_DSP_RESET
+#define SOUND_PCM_SYNC                 SNDCTL_DSP_SYNC
+#define SOUND_PCM_SUBDIVIDE            SNDCTL_DSP_SUBDIVIDE
+#define SOUND_PCM_SETFRAGMENT          SNDCTL_DSP_SETFRAGMENT
+#define SOUND_PCM_GETFMTS              SNDCTL_DSP_GETFMTS
+#define SOUND_PCM_SETFMT               SNDCTL_DSP_SETFMT
+#define SOUND_PCM_GETOSPACE            SNDCTL_DSP_GETOSPACE
+#define SOUND_PCM_GETISPACE            SNDCTL_DSP_GETISPACE
+#define SOUND_PCM_NONBLOCK             SNDCTL_DSP_NONBLOCK
+#define SOUND_PCM_GETCAPS              SNDCTL_DSP_GETCAPS
+#define SOUND_PCM_GETTRIGGER           SNDCTL_DSP_GETTRIGGER
+#define SOUND_PCM_SETTRIGGER           SNDCTL_DSP_SETTRIGGER
+#define SOUND_PCM_SETSYNCRO            SNDCTL_DSP_SETSYNCRO
+#define SOUND_PCM_GETIPTR              SNDCTL_DSP_GETIPTR
+#define SOUND_PCM_GETOPTR              SNDCTL_DSP_GETOPTR
+#define SOUND_PCM_MAPINBUF             SNDCTL_DSP_MAPINBUF
+#define SOUND_PCM_MAPOUTBUF            SNDCTL_DSP_MAPOUTBUF
+
+/*
+ * ioctl calls to be used in communication with coprocessors and
+ * DSP chips.
+ */
+
+typedef struct copr_buffer {
+               int command;    /* Set to 0 if not used */
+               int flags;
+#define CPF_NONE               0x0000
+#define CPF_FIRST              0x0001  /* First block */
+#define CPF_LAST               0x0002  /* Last block */
+               int len;
+               int offs;       /* If required by the device (0 if not used) */
+
+               unsigned char data[4000]; /* NOTE! 4000 is not 4k */
+       } copr_buffer;
+
+typedef struct copr_debug_buf {
+               int command;    /* Used internally. Set to 0 */
+               int parm1;
+               int parm2;
+               int flags;      
+               int len;        /* Length of data in bytes */
+       } copr_debug_buf;
+
+typedef struct copr_msg {
+               int len;
+               unsigned char data[4000];
+       } copr_msg;
+
+#define SNDCTL_COPR_RESET             _SIO  ('C',  0)
+#define SNDCTL_COPR_LOAD             _SIOWR('C',  1, copr_buffer)
+#define SNDCTL_COPR_RDATA            _SIOWR('C',  2, copr_debug_buf)
+#define SNDCTL_COPR_RCODE            _SIOWR('C',  3, copr_debug_buf)
+#define SNDCTL_COPR_WDATA            _SIOW ('C',  4, copr_debug_buf)
+#define SNDCTL_COPR_WCODE            _SIOW ('C',  5, copr_debug_buf)
+#define SNDCTL_COPR_RUN                      _SIOWR('C',  6, copr_debug_buf)
+#define SNDCTL_COPR_HALT             _SIOWR('C',  7, copr_debug_buf)
+#define SNDCTL_COPR_SENDMSG          _SIOWR('C',  8, copr_msg)
+#define SNDCTL_COPR_RCVMSG           _SIOR ('C',  9, copr_msg)
+
+/*********************************************
+ * IOCTL commands for /dev/mixer
+ */
+       
+/* 
+ * Mixer devices
+ *
+ * There can be up to 20 different analog mixer channels. The
+ * SOUND_MIXER_NRDEVICES gives the currently supported maximum. 
+ * The SOUND_MIXER_READ_DEVMASK returns a bitmask which tells
+ * the devices supported by the particular mixer.
+ */
+
+#define SOUND_MIXER_NRDEVICES  25
+#define SOUND_MIXER_VOLUME     0
+#define SOUND_MIXER_BASS       1
+#define SOUND_MIXER_TREBLE     2
+#define SOUND_MIXER_SYNTH      3
+#define SOUND_MIXER_PCM                4
+#define SOUND_MIXER_SPEAKER    5
+#define SOUND_MIXER_LINE       6
+#define SOUND_MIXER_MIC                7
+#define SOUND_MIXER_CD         8
+#define SOUND_MIXER_IMIX       9       /*  Recording monitor  */
+#define SOUND_MIXER_ALTPCM     10
+#define SOUND_MIXER_RECLEV     11      /* Recording level */
+#define SOUND_MIXER_IGAIN      12      /* Input gain */
+#define SOUND_MIXER_OGAIN      13      /* Output gain */
+/* 
+ * The AD1848 codec and compatibles have three line level inputs
+ * (line, aux1 and aux2). Since each card manufacturer have assigned
+ * different meanings to these inputs, it's inpractical to assign
+ * specific meanings (line, cd, synth etc.) to them.
+ */
+#define SOUND_MIXER_LINE1      14      /* Input source 1  (aux1) */
+#define SOUND_MIXER_LINE2      15      /* Input source 2  (aux2) */
+#define SOUND_MIXER_LINE3      16      /* Input source 3  (line) */
+#define SOUND_MIXER_DIGITAL1   17      /* Digital (input) 1 */
+#define SOUND_MIXER_DIGITAL2   18      /* Digital (input) 2 */
+#define SOUND_MIXER_DIGITAL3   19      /* Digital (input) 3 */
+#define SOUND_MIXER_PHONEIN    20      /* Phone input */
+#define SOUND_MIXER_PHONEOUT   21      /* Phone output */
+#define SOUND_MIXER_VIDEO      22      /* Video/TV (audio) in */
+#define SOUND_MIXER_RADIO      23      /* Radio in */
+#define SOUND_MIXER_MONITOR    24      /* Monitor (usually mic) volume */
+
+/* Some on/off settings (SOUND_SPECIAL_MIN - SOUND_SPECIAL_MAX) */
+/* Not counted to SOUND_MIXER_NRDEVICES, but use the same number space */
+#define SOUND_ONOFF_MIN                28
+#define SOUND_ONOFF_MAX                30
+
+/* Note!       Number 31 cannot be used since the sign bit is reserved */
+#define SOUND_MIXER_NONE       31
+
+/*
+ * The following unsupported macros are no longer functional.
+ * Use SOUND_MIXER_PRIVATE# macros in future.
+ */
+#define SOUND_MIXER_ENHANCE    SOUND_MIXER_NONE
+#define SOUND_MIXER_MUTE       SOUND_MIXER_NONE
+#define SOUND_MIXER_LOUD       SOUND_MIXER_NONE
+
+
+#define SOUND_DEVICE_LABELS    {"Vol  ", "Bass ", "Trebl", "Synth", "Pcm  ", "Spkr ", "Line ", \
+                                "Mic  ", "CD   ", "Mix  ", "Pcm2 ", "Rec  ", "IGain", "OGain", \
+                                "Line1", "Line2", "Line3", "Digital1", "Digital2", "Digital3", \
+                                "PhoneIn", "PhoneOut", "Video", "Radio", "Monitor"}
+
+#define SOUND_DEVICE_NAMES     {"vol", "bass", "treble", "synth", "pcm", "speaker", "line", \
+                                "mic", "cd", "mix", "pcm2", "rec", "igain", "ogain", \
+                                "line1", "line2", "line3", "dig1", "dig2", "dig3", \
+                                "phin", "phout", "video", "radio", "monitor"}
+
+/*     Device bitmask identifiers      */
+
+#define SOUND_MIXER_RECSRC     0xff    /* Arg contains a bit for each recording source */
+#define SOUND_MIXER_DEVMASK    0xfe    /* Arg contains a bit for each supported device */
+#define SOUND_MIXER_RECMASK    0xfd    /* Arg contains a bit for each supported recording source */
+#define SOUND_MIXER_CAPS       0xfc
+#      define SOUND_CAP_EXCL_INPUT     0x00000001      /* Only one recording source at a time */
+#define SOUND_MIXER_STEREODEVS 0xfb    /* Mixer channels supporting stereo */
+#define SOUND_MIXER_OUTSRC     0xfa    /* Arg contains a bit for each input source to output */
+#define SOUND_MIXER_OUTMASK    0xf9    /* Arg contains a bit for each supported input source to output */
+
+/*     Device mask bits        */
+
+#define SOUND_MASK_VOLUME      (1 << SOUND_MIXER_VOLUME)
+#define SOUND_MASK_BASS                (1 << SOUND_MIXER_BASS)
+#define SOUND_MASK_TREBLE      (1 << SOUND_MIXER_TREBLE)
+#define SOUND_MASK_SYNTH       (1 << SOUND_MIXER_SYNTH)
+#define SOUND_MASK_PCM         (1 << SOUND_MIXER_PCM)
+#define SOUND_MASK_SPEAKER     (1 << SOUND_MIXER_SPEAKER)
+#define SOUND_MASK_LINE                (1 << SOUND_MIXER_LINE)
+#define SOUND_MASK_MIC         (1 << SOUND_MIXER_MIC)
+#define SOUND_MASK_CD          (1 << SOUND_MIXER_CD)
+#define SOUND_MASK_IMIX                (1 << SOUND_MIXER_IMIX)
+#define SOUND_MASK_ALTPCM      (1 << SOUND_MIXER_ALTPCM)
+#define SOUND_MASK_RECLEV      (1 << SOUND_MIXER_RECLEV)
+#define SOUND_MASK_IGAIN       (1 << SOUND_MIXER_IGAIN)
+#define SOUND_MASK_OGAIN       (1 << SOUND_MIXER_OGAIN)
+#define SOUND_MASK_LINE1       (1 << SOUND_MIXER_LINE1)
+#define SOUND_MASK_LINE2       (1 << SOUND_MIXER_LINE2)
+#define SOUND_MASK_LINE3       (1 << SOUND_MIXER_LINE3)
+#define SOUND_MASK_DIGITAL1    (1 << SOUND_MIXER_DIGITAL1)
+#define SOUND_MASK_DIGITAL2    (1 << SOUND_MIXER_DIGITAL2)
+#define SOUND_MASK_DIGITAL3    (1 << SOUND_MIXER_DIGITAL3)
+#define SOUND_MASK_PHONEIN     (1 << SOUND_MIXER_PHONEIN)
+#define SOUND_MASK_PHONEOUT    (1 << SOUND_MIXER_PHONEOUT)
+#define SOUND_MASK_RADIO       (1 << SOUND_MIXER_RADIO)
+#define SOUND_MASK_VIDEO       (1 << SOUND_MIXER_VIDEO)
+#define SOUND_MASK_MONITOR     (1 << SOUND_MIXER_MONITOR)
+
+/* Obsolete macros */
+#define SOUND_MASK_MUTE                (1 << SOUND_MIXER_MUTE)
+#define SOUND_MASK_ENHANCE     (1 << SOUND_MIXER_ENHANCE)
+#define SOUND_MASK_LOUD                (1 << SOUND_MIXER_LOUD)
+
+#define MIXER_READ(dev)                _SIOR('M', dev, int)
+#define SOUND_MIXER_READ_VOLUME                MIXER_READ(SOUND_MIXER_VOLUME)
+#define SOUND_MIXER_READ_BASS          MIXER_READ(SOUND_MIXER_BASS)
+#define SOUND_MIXER_READ_TREBLE                MIXER_READ(SOUND_MIXER_TREBLE)
+#define SOUND_MIXER_READ_SYNTH         MIXER_READ(SOUND_MIXER_SYNTH)
+#define SOUND_MIXER_READ_PCM           MIXER_READ(SOUND_MIXER_PCM)
+#define SOUND_MIXER_READ_SPEAKER       MIXER_READ(SOUND_MIXER_SPEAKER)
+#define SOUND_MIXER_READ_LINE          MIXER_READ(SOUND_MIXER_LINE)
+#define SOUND_MIXER_READ_MIC           MIXER_READ(SOUND_MIXER_MIC)
+#define SOUND_MIXER_READ_CD            MIXER_READ(SOUND_MIXER_CD)
+#define SOUND_MIXER_READ_IMIX          MIXER_READ(SOUND_MIXER_IMIX)
+#define SOUND_MIXER_READ_ALTPCM                MIXER_READ(SOUND_MIXER_ALTPCM)
+#define SOUND_MIXER_READ_RECLEV                MIXER_READ(SOUND_MIXER_RECLEV)
+#define SOUND_MIXER_READ_IGAIN         MIXER_READ(SOUND_MIXER_IGAIN)
+#define SOUND_MIXER_READ_OGAIN         MIXER_READ(SOUND_MIXER_OGAIN)
+#define SOUND_MIXER_READ_LINE1         MIXER_READ(SOUND_MIXER_LINE1)
+#define SOUND_MIXER_READ_LINE2         MIXER_READ(SOUND_MIXER_LINE2)
+#define SOUND_MIXER_READ_LINE3         MIXER_READ(SOUND_MIXER_LINE3)
+
+/* Obsolete macros */
+#define SOUND_MIXER_READ_MUTE          MIXER_READ(SOUND_MIXER_MUTE)
+#define SOUND_MIXER_READ_ENHANCE       MIXER_READ(SOUND_MIXER_ENHANCE)
+#define SOUND_MIXER_READ_LOUD          MIXER_READ(SOUND_MIXER_LOUD)
+
+#define SOUND_MIXER_READ_RECSRC                MIXER_READ(SOUND_MIXER_RECSRC)
+#define SOUND_MIXER_READ_DEVMASK       MIXER_READ(SOUND_MIXER_DEVMASK)
+#define SOUND_MIXER_READ_RECMASK       MIXER_READ(SOUND_MIXER_RECMASK)
+#define SOUND_MIXER_READ_STEREODEVS    MIXER_READ(SOUND_MIXER_STEREODEVS)
+#define SOUND_MIXER_READ_CAPS          MIXER_READ(SOUND_MIXER_CAPS)
+
+#define MIXER_WRITE(dev)               _SIOWR('M', dev, int)
+#define SOUND_MIXER_WRITE_VOLUME       MIXER_WRITE(SOUND_MIXER_VOLUME)
+#define SOUND_MIXER_WRITE_BASS         MIXER_WRITE(SOUND_MIXER_BASS)
+#define SOUND_MIXER_WRITE_TREBLE       MIXER_WRITE(SOUND_MIXER_TREBLE)
+#define SOUND_MIXER_WRITE_SYNTH                MIXER_WRITE(SOUND_MIXER_SYNTH)
+#define SOUND_MIXER_WRITE_PCM          MIXER_WRITE(SOUND_MIXER_PCM)
+#define SOUND_MIXER_WRITE_SPEAKER      MIXER_WRITE(SOUND_MIXER_SPEAKER)
+#define SOUND_MIXER_WRITE_LINE         MIXER_WRITE(SOUND_MIXER_LINE)
+#define SOUND_MIXER_WRITE_MIC          MIXER_WRITE(SOUND_MIXER_MIC)
+#define SOUND_MIXER_WRITE_CD           MIXER_WRITE(SOUND_MIXER_CD)
+#define SOUND_MIXER_WRITE_IMIX         MIXER_WRITE(SOUND_MIXER_IMIX)
+#define SOUND_MIXER_WRITE_ALTPCM       MIXER_WRITE(SOUND_MIXER_ALTPCM)
+#define SOUND_MIXER_WRITE_RECLEV       MIXER_WRITE(SOUND_MIXER_RECLEV)
+#define SOUND_MIXER_WRITE_IGAIN                MIXER_WRITE(SOUND_MIXER_IGAIN)
+#define SOUND_MIXER_WRITE_OGAIN                MIXER_WRITE(SOUND_MIXER_OGAIN)
+#define SOUND_MIXER_WRITE_LINE1                MIXER_WRITE(SOUND_MIXER_LINE1)
+#define SOUND_MIXER_WRITE_LINE2                MIXER_WRITE(SOUND_MIXER_LINE2)
+#define SOUND_MIXER_WRITE_LINE3                MIXER_WRITE(SOUND_MIXER_LINE3)
+
+/* Obsolete macros */
+#define SOUND_MIXER_WRITE_MUTE         MIXER_WRITE(SOUND_MIXER_MUTE)
+#define SOUND_MIXER_WRITE_ENHANCE      MIXER_WRITE(SOUND_MIXER_ENHANCE)
+#define SOUND_MIXER_WRITE_LOUD         MIXER_WRITE(SOUND_MIXER_LOUD)
+
+#define SOUND_MIXER_WRITE_RECSRC       MIXER_WRITE(SOUND_MIXER_RECSRC)
+
+typedef struct mixer_info
+{
+  char id[16];
+  char name[32];
+  int  modify_counter;
+  int fillers[10];
+} mixer_info;
+
+typedef struct _old_mixer_info /* Obsolete */
+{
+  char id[16];
+  char name[32];
+} _old_mixer_info;
+
+#define SOUND_MIXER_INFO               _SIOR ('M', 101, mixer_info)
+#define SOUND_OLD_MIXER_INFO           _SIOR ('M', 101, _old_mixer_info)
+
+/*
+ * A mechanism for accessing "proprietary" mixer features. This method
+ * permits passing 128 bytes of arbitrary data between a mixer application
+ * and the mixer driver. Interpretation of the record is defined by
+ * the particular mixer driver.
+ */
+typedef unsigned char mixer_record[128];
+
+#define SOUND_MIXER_ACCESS             _SIOWR('M', 102, mixer_record)
+
+/*
+ * Two ioctls for special souncard function
+ */
+#define SOUND_MIXER_AGC  _SIOWR('M', 103, int)
+#define SOUND_MIXER_3DSE  _SIOWR('M', 104, int)
+
+/*
+ * The SOUND_MIXER_PRIVATE# commands can be redefined by low level drivers.
+ * These features can be used when accessing device specific features.
+ */
+#define SOUND_MIXER_PRIVATE1           _SIOWR('M', 111, int)
+#define SOUND_MIXER_PRIVATE2           _SIOWR('M', 112, int)
+#define SOUND_MIXER_PRIVATE3           _SIOWR('M', 113, int)
+#define SOUND_MIXER_PRIVATE4           _SIOWR('M', 114, int)
+#define SOUND_MIXER_PRIVATE5           _SIOWR('M', 115, int)
+
+/*
+ * SOUND_MIXER_GETLEVELS and SOUND_MIXER_SETLEVELS calls can be used
+ * for querying current mixer settings from the driver and for loading
+ * default volume settings _prior_ activating the mixer (loading
+ * doesn't affect current state of the mixer hardware). These calls
+ * are for internal use only.
+ */
+
+typedef struct mixer_vol_table {
+  int num;     /* Index to volume table */
+  char name[32];
+  int levels[32];
+} mixer_vol_table;
+
+#define SOUND_MIXER_GETLEVELS          _SIOWR('M', 116, mixer_vol_table)
+#define SOUND_MIXER_SETLEVELS          _SIOWR('M', 117, mixer_vol_table)
+
+/* 
+ * An ioctl for identifying the driver version. It will return value
+ * of the SOUND_VERSION macro used when compiling the driver.
+ * This call was introduced in OSS version 3.6 and it will not work
+ * with earlier versions (returns EINVAL).
+ */
+#define OSS_GETVERSION                 _SIOR ('M', 118, int)
+
+/*
+ * Level 2 event types for /dev/sequencer
+ */
+
+/*
+ * The 4 most significant bits of byte 0 specify the class of
+ * the event: 
+ *
+ *     0x8X = system level events,
+ *     0x9X = device/port specific events, event[1] = device/port,
+ *             The last 4 bits give the subtype:
+ *                     0x02    = Channel event (event[3] = chn).
+ *                     0x01    = note event (event[4] = note).
+ *                     (0x01 is not used alone but always with bit 0x02).
+ *            event[2] = MIDI message code (0x80=note off etc.)
+ *
+ */
+
+#define EV_SEQ_LOCAL           0x80
+#define EV_TIMING              0x81
+#define EV_CHN_COMMON          0x92
+#define EV_CHN_VOICE           0x93
+#define EV_SYSEX               0x94
+/*
+ * Event types 200 to 220 are reserved for application use.
+ * These numbers will not be used by the driver.
+ */
+
+/*
+ * Events for event type EV_CHN_VOICE
+ */
+
+#define MIDI_NOTEOFF           0x80
+#define MIDI_NOTEON            0x90
+#define MIDI_KEY_PRESSURE      0xA0
+
+/*
+ * Events for event type EV_CHN_COMMON
+ */
+
+#define MIDI_CTL_CHANGE                0xB0
+#define MIDI_PGM_CHANGE                0xC0
+#define MIDI_CHN_PRESSURE      0xD0
+#define MIDI_PITCH_BEND                0xE0
+
+#define MIDI_SYSTEM_PREFIX     0xF0
+
+/*
+ * Timer event types
+ */
+#define TMR_WAIT_REL           1       /* Time relative to the prev time */
+#define TMR_WAIT_ABS           2       /* Absolute time since TMR_START */
+#define TMR_STOP               3
+#define TMR_START              4
+#define TMR_CONTINUE           5
+#define TMR_TEMPO              6
+#define TMR_ECHO               8
+#define TMR_CLOCK              9       /* MIDI clock */
+#define TMR_SPP                        10      /* Song position pointer */
+#define TMR_TIMESIG            11      /* Time signature */
+
+/*
+ *     Local event types
+ */
+#define LOCL_STARTAUDIO                1
+
+/*
+ *     Some convenience macros to simplify programming of the
+ *     /dev/sequencer interface
+ *
+ *     This is a legacy interface for applications written against
+ *     the OSSlib-3.8 style interface. It is no longer possible
+ *     to actually link against OSSlib with this header, but we
+ *     still provide these macros for programs using them.
+ *
+ *     If you want to use OSSlib, it is recommended that you get
+ *     the GPL version of OSS-4.x and build against that version
+ *     of the header.
+ *
+ *     We redefine the extern keyword so that make headers_check
+ *     does not complain about SEQ_USE_EXTBUF.
+ */
+#define SEQ_DECLAREBUF()               SEQ_USE_EXTBUF()
+
+void seqbuf_dump(void);        /* This function must be provided by programs */
+
+#define SEQ_PM_DEFINES int __foo_bar___
+
+#define SEQ_LOAD_GMINSTR(dev, instr)
+#define SEQ_LOAD_GMDRUM(dev, drum)
+
+#define _SEQ_EXTERN extern
+#define SEQ_USE_EXTBUF() \
+               _SEQ_EXTERN unsigned char _seqbuf[]; \
+               _SEQ_EXTERN int _seqbuflen; _SEQ_EXTERN int _seqbufptr
+
+#ifndef USE_SIMPLE_MACROS
+/* Sample seqbuf_dump() implementation:
+ *
+ *     SEQ_DEFINEBUF (2048);   -- Defines a buffer for 2048 bytes
+ *
+ *     int seqfd;              -- The file descriptor for /dev/sequencer.
+ *
+ *     void
+ *     seqbuf_dump ()
+ *     {
+ *       if (_seqbufptr)
+ *         if (write (seqfd, _seqbuf, _seqbufptr) == -1)
+ *           {
+ *             perror ("write /dev/sequencer");
+ *             exit (-1);
+ *           }
+ *       _seqbufptr = 0;
+ *     }
+ */
+
+#define SEQ_DEFINEBUF(len)             unsigned char _seqbuf[len]; int _seqbuflen = len;int _seqbufptr = 0
+#define _SEQ_NEEDBUF(len)              if ((_seqbufptr+(len)) > _seqbuflen) seqbuf_dump()
+#define _SEQ_ADVBUF(len)               _seqbufptr += len
+#define SEQ_DUMPBUF                    seqbuf_dump
+#else
+/*
+ * This variation of the sequencer macros is used just to format one event
+ * using fixed buffer.
+ * 
+ * The program using the macro library must define the following macros before
+ * using this library.
+ *
+ * #define _seqbuf              name of the buffer (unsigned char[]) 
+ * #define _SEQ_ADVBUF(len)     If the applic needs to know the exact
+ *                              size of the event, this macro can be used.
+ *                              Otherwise this must be defined as empty.
+ * #define _seqbufptr           Define the name of index variable or 0 if
+ *                              not required. 
+ */
+#define _SEQ_NEEDBUF(len)      /* empty */
+#endif
+
+#define SEQ_VOLUME_MODE(dev, mode)     {_SEQ_NEEDBUF(8);\
+                                       _seqbuf[_seqbufptr] = SEQ_EXTENDED;\
+                                       _seqbuf[_seqbufptr+1] = SEQ_VOLMODE;\
+                                       _seqbuf[_seqbufptr+2] = (dev);\
+                                       _seqbuf[_seqbufptr+3] = (mode);\
+                                       _seqbuf[_seqbufptr+4] = 0;\
+                                       _seqbuf[_seqbufptr+5] = 0;\
+                                       _seqbuf[_seqbufptr+6] = 0;\
+                                       _seqbuf[_seqbufptr+7] = 0;\
+                                       _SEQ_ADVBUF(8);}
+
+/*
+ * Midi voice messages
+ */
+
+#define _CHN_VOICE(dev, event, chn, note, parm) \
+                                       {_SEQ_NEEDBUF(8);\
+                                       _seqbuf[_seqbufptr] = EV_CHN_VOICE;\
+                                       _seqbuf[_seqbufptr+1] = (dev);\
+                                       _seqbuf[_seqbufptr+2] = (event);\
+                                       _seqbuf[_seqbufptr+3] = (chn);\
+                                       _seqbuf[_seqbufptr+4] = (note);\
+                                       _seqbuf[_seqbufptr+5] = (parm);\
+                                       _seqbuf[_seqbufptr+6] = (0);\
+                                       _seqbuf[_seqbufptr+7] = 0;\
+                                       _SEQ_ADVBUF(8);}
+
+#define SEQ_START_NOTE(dev, chn, note, vol) \
+               _CHN_VOICE(dev, MIDI_NOTEON, chn, note, vol)
+
+#define SEQ_STOP_NOTE(dev, chn, note, vol) \
+               _CHN_VOICE(dev, MIDI_NOTEOFF, chn, note, vol)
+
+#define SEQ_KEY_PRESSURE(dev, chn, note, pressure) \
+               _CHN_VOICE(dev, MIDI_KEY_PRESSURE, chn, note, pressure)
+
+/*
+ * Midi channel messages
+ */
+
+#define _CHN_COMMON(dev, event, chn, p1, p2, w14) \
+                                       {_SEQ_NEEDBUF(8);\
+                                       _seqbuf[_seqbufptr] = EV_CHN_COMMON;\
+                                       _seqbuf[_seqbufptr+1] = (dev);\
+                                       _seqbuf[_seqbufptr+2] = (event);\
+                                       _seqbuf[_seqbufptr+3] = (chn);\
+                                       _seqbuf[_seqbufptr+4] = (p1);\
+                                       _seqbuf[_seqbufptr+5] = (p2);\
+                                       *(short *)&_seqbuf[_seqbufptr+6] = (w14);\
+                                       _SEQ_ADVBUF(8);}
+/*
+ * SEQ_SYSEX permits sending of sysex messages. (It may look that it permits
+ * sending any MIDI bytes but it's absolutely not possible. Trying to do
+ * so _will_ cause problems with MPU401 intelligent mode).
+ *
+ * Sysex messages are sent in blocks of 1 to 6 bytes. Longer messages must be 
+ * sent by calling SEQ_SYSEX() several times (there must be no other events
+ * between them). First sysex fragment must have 0xf0 in the first byte
+ * and the last byte (buf[len-1] of the last fragment must be 0xf7. No byte
+ * between these sysex start and end markers cannot be larger than 0x7f. Also
+ * lengths of each fragments (except the last one) must be 6.
+ *
+ * Breaking the above rules may work with some MIDI ports but is likely to
+ * cause fatal problems with some other devices (such as MPU401).
+ */
+#define SEQ_SYSEX(dev, buf, len) \
+                                       {int ii, ll=(len); \
+                                        unsigned char *bufp=buf;\
+                                        if (ll>6)ll=6;\
+                                       _SEQ_NEEDBUF(8);\
+                                       _seqbuf[_seqbufptr] = EV_SYSEX;\
+                                       _seqbuf[_seqbufptr+1] = (dev);\
+                                       for(ii=0;ii<ll;ii++)\
+                                          _seqbuf[_seqbufptr+ii+2] = bufp[ii];\
+                                       for(ii=ll;ii<6;ii++)\
+                                          _seqbuf[_seqbufptr+ii+2] = 0xff;\
+                                       _SEQ_ADVBUF(8);}
+
+#define SEQ_CHN_PRESSURE(dev, chn, pressure) \
+               _CHN_COMMON(dev, MIDI_CHN_PRESSURE, chn, pressure, 0, 0)
+
+#define SEQ_SET_PATCH SEQ_PGM_CHANGE
+#define SEQ_PGM_CHANGE(dev, chn, patch) \
+               _CHN_COMMON(dev, MIDI_PGM_CHANGE, chn, patch, 0, 0)
+
+#define SEQ_CONTROL(dev, chn, controller, value) \
+               _CHN_COMMON(dev, MIDI_CTL_CHANGE, chn, controller, 0, value)
+
+#define SEQ_BENDER(dev, chn, value) \
+               _CHN_COMMON(dev, MIDI_PITCH_BEND, chn, 0, 0, value)
+
+
+#define SEQ_V2_X_CONTROL(dev, voice, controller, value)        {_SEQ_NEEDBUF(8);\
+                                       _seqbuf[_seqbufptr] = SEQ_EXTENDED;\
+                                       _seqbuf[_seqbufptr+1] = SEQ_CONTROLLER;\
+                                       _seqbuf[_seqbufptr+2] = (dev);\
+                                       _seqbuf[_seqbufptr+3] = (voice);\
+                                       _seqbuf[_seqbufptr+4] = (controller);\
+                                       _seqbuf[_seqbufptr+5] = ((value)&0xff);\
+                                       _seqbuf[_seqbufptr+6] = ((value>>8)&0xff);\
+                                       _seqbuf[_seqbufptr+7] = 0;\
+                                       _SEQ_ADVBUF(8);}
+/*
+ * The following 5 macros are incorrectly implemented and obsolete.
+ * Use SEQ_BENDER and SEQ_CONTROL (with proper controller) instead.
+ */
+#define SEQ_PITCHBEND(dev, voice, value) SEQ_V2_X_CONTROL(dev, voice, CTRL_PITCH_BENDER, value)
+#define SEQ_BENDER_RANGE(dev, voice, value) SEQ_V2_X_CONTROL(dev, voice, CTRL_PITCH_BENDER_RANGE, value)
+#define SEQ_EXPRESSION(dev, voice, value) SEQ_CONTROL(dev, voice, CTL_EXPRESSION, value*128)
+#define SEQ_MAIN_VOLUME(dev, voice, value) SEQ_CONTROL(dev, voice, CTL_MAIN_VOLUME, (value*16383)/100)
+#define SEQ_PANNING(dev, voice, pos) SEQ_CONTROL(dev, voice, CTL_PAN, (pos+128) / 2)
+
+/*
+ * Timing and synchronization macros
+ */
+
+#define _TIMER_EVENT(ev, parm)         {_SEQ_NEEDBUF(8);\
+                                       _seqbuf[_seqbufptr+0] = EV_TIMING; \
+                                       _seqbuf[_seqbufptr+1] = (ev); \
+                                       _seqbuf[_seqbufptr+2] = 0;\
+                                       _seqbuf[_seqbufptr+3] = 0;\
+                                       *(unsigned int *)&_seqbuf[_seqbufptr+4] = (parm); \
+                                       _SEQ_ADVBUF(8);}
+
+#define SEQ_START_TIMER()              _TIMER_EVENT(TMR_START, 0)
+#define SEQ_STOP_TIMER()               _TIMER_EVENT(TMR_STOP, 0)
+#define SEQ_CONTINUE_TIMER()           _TIMER_EVENT(TMR_CONTINUE, 0)
+#define SEQ_WAIT_TIME(ticks)           _TIMER_EVENT(TMR_WAIT_ABS, ticks)
+#define SEQ_DELTA_TIME(ticks)          _TIMER_EVENT(TMR_WAIT_REL, ticks)
+#define SEQ_ECHO_BACK(key)             _TIMER_EVENT(TMR_ECHO, key)
+#define SEQ_SET_TEMPO(value)           _TIMER_EVENT(TMR_TEMPO, value)
+#define SEQ_SONGPOS(pos)               _TIMER_EVENT(TMR_SPP, pos)
+#define SEQ_TIME_SIGNATURE(sig)                _TIMER_EVENT(TMR_TIMESIG, sig)
+
+/*
+ * Local control events
+ */
+
+#define _LOCAL_EVENT(ev, parm)         {_SEQ_NEEDBUF(8);\
+                                       _seqbuf[_seqbufptr+0] = EV_SEQ_LOCAL; \
+                                       _seqbuf[_seqbufptr+1] = (ev); \
+                                       _seqbuf[_seqbufptr+2] = 0;\
+                                       _seqbuf[_seqbufptr+3] = 0;\
+                                       *(unsigned int *)&_seqbuf[_seqbufptr+4] = (parm); \
+                                       _SEQ_ADVBUF(8);}
+
+#define SEQ_PLAYAUDIO(devmask)         _LOCAL_EVENT(LOCL_STARTAUDIO, devmask)
+/*
+ * Events for the level 1 interface only 
+ */
+
+#define SEQ_MIDIOUT(device, byte)      {_SEQ_NEEDBUF(4);\
+                                       _seqbuf[_seqbufptr] = SEQ_MIDIPUTC;\
+                                       _seqbuf[_seqbufptr+1] = (byte);\
+                                       _seqbuf[_seqbufptr+2] = (device);\
+                                       _seqbuf[_seqbufptr+3] = 0;\
+                                       _SEQ_ADVBUF(4);}
+
+/*
+ * Patch loading.
+ */
+#define SEQ_WRPATCH(patchx, len) \
+               {if (_seqbufptr) SEQ_DUMPBUF();\
+                if (write(seqfd, (char*)(patchx), len)==-1) \
+                   perror("Write patch: /dev/sequencer");}
+#define SEQ_WRPATCH2(patchx, len) \
+               (SEQ_DUMPBUF(), write(seqfd, (char*)(patchx), len))
+
+#endif
diff --git a/freedv/branches/0.97/notes/portaudio_notes.txt b/freedv/branches/0.97/notes/portaudio_notes.txt
new file mode 100644 (file)
index 0000000..63f1bc7
--- /dev/null
@@ -0,0 +1,481 @@
+David Witten wittend@wwrinc.com\r
+10:17 AM (0 minutes ago)\r
+\r
+to david \r
+David,\r
+\r
+First, you mentioned audio breakups you were experiencing on Linux.\r
+My sources related to Portaudio say that this is usually a frame\r
+buffer sizing issue.  More frames introduces latency, but less can\r
+cause breakups in the flow.\r
+\r
+Short answer:  Concerning that header file, assuming that you\r
+downloaded and expanded the PortAudio source tarball (or zip file) you\r
+need a path to [ portaudio/bindings/cpp/source/portaudiocpp/ ] for\r
+your include search.\r
+\r
+You may not want to run against the default windows shared libraries.\r
+I believe that they default to WMMA, which is pretty poor.\r
+\r
+This gets you into the fun parts of building portaudio stuff.  I\r
+attaching that particular file because I can't remember if it was\r
+missing for some reason or just not in an obvious place.\r
+\r
+I have notes about portaudio in fdmdv2/notes,  but the upshot is that\r
+I built the main dll with:\r
+\r
+ ./configure --with-winapi=directx --with-dxdir=/dxsdk\r
+--enable-cxx=yes --enable-shared=yes  --with-host_os=mingw\r
+make\r
+make install\r
+\r
+This puts the libfiles in predictable places in msys's little\r
+universe, so that they can be found by the linker.  This does not\r
+necessarily make them easy to find when you want to run fdmdv2 from\r
+the desktop, so I usually move a copy to wherever I am trying to run\r
+fdmdv2 from.\r
+\r
+I intend to clean up some of this business before I'm done, but the\r
+project as it stands uses portaudio in two ways.  The main structure\r
+of the program accesses portaudio through a thin wrapper that I wrote\r
+(fdmdv_pa_wrapper.h).  The current (largely non-functional)  audio\r
+configuration dialog uses the portaudiocpp binding wrapper provided by\r
+the portaudio bundle.  The code for it lives in [\r
+portaudio/bindings/cpp ] and involves a separate Makefile that lives\r
+in there.  There is no good reason for this, it is the consequence of\r
+multiple strategies I explored.\r
+\r
+Portaudio *can* be built in a way that supports multiple Windows sound\r
+APIs simultaneously.  The FLDigi people seem to have done this.  If\r
+you drop in the dll's lifted from a recent DLDigi implementation for\r
+Windows, GCC will link with them and will see all of the APS's\r
+available.  I posted the question of how to build the DLLs myself in\r
+this way on the appropriate portaudio list and was told that it could\r
+only be done using SCons.  I decided that life was too short for that\r
+right now and just built the dlls for direct sound, which has good\r
+latency and is supported by Microsoft.\r
+\r
+Even restricting myself to DirectSound, I found that things were *not*\r
+completely simple.  I had to locate a version of the direct sound SDK\r
+that had stuff where the build expected it to be.  The most current\r
+ones did not seem to work. I can zip this up and put it into the SVN,\r
+but it is MS's code.\r
+\r
+I also built libraries for ASIO, WMMA, and other options early on, but\r
+it seemed somewhat pointless at that point.  The ones I am using are\r
+just for DirectSound.  I can use the ones from FLDigi if I want.  You\r
+will find my built DLLs scattered around the build, often in the\r
+/Release subfolders.  This is sloppy but is just for my convenience.\r
+\r
+Good luck,\r
+\r
+Dave\r
+\r
+===========================================\r
+!!! Track record trying to build PortAudio\r
+===========================================\r
+\r
+build:\r
+make clean\r
+./configure ...\r
+make\r
+make install\r
+\r
+\r
+ ./configure --with-winapi=wmme --with-winapi=directx --with-winapi=asio --with-winapi=wasapi --with-asiodir=/p/Radio/ASIOSDK2 --with-dxdir=/p/Radio/dx7sdk --enable-cxx=yes --enable-shared=yes\r
+\r
+!!! didn't work !!! (Only configured wmme)!\r
+===========================================\r
+\r
+Trying:\r
+\r
+ ./configure --with-winapi=directx --with-dxdir=/p/Radio/dx7sdk --enable-cxx=yes --enable-shared=yes  --with-host_os=mingw\r
+\r
+ !!! didn't work !!! (build failed) \r
+===========================================\r
+\r
+Try ASIO:\r
\r
+./configure --with-winapi=asio  --with-asiodir=/p/Radio/ASIOSDK2  --enable-cxx=yes --enable-shared=yes --with-host_os=mingw\r
+\r
+Configuration summary:\r
+\r
+  Target ...................... i686-pc-mingw32\r
+  C++ bindings ................ yes\r
+  Debug output ................ no\r
+\r
+  WMME ........................ no\r
+  DSound ...................... no\r
+  ASIO ........................ yes (/p/Radio/ASIOSDK2)\r
+  WASAPI ...................... no\r
+  WDMKS ....................... no\r
+\r
+\r
+ !!! didn't work !!! (build failed libtool errors, It wants a uuid file, and it wants to find a copy of libportaudio.dll.la in /usr/lib !!???)\r
+===========================================\r
+Final lines of the build:\r
+\r
+/bin/sh ./libtool --mode=compile --tag=CXX g++ -c -g -O2 -DPA_LITTLE_ENDIAN -I./include -I./src/common -I./src/os/win -DPA_USE_WMME=\r
+0 -DPA_USE_ASIO=0 -DPA_USE_WDMKS=0 -DPA_USE_DS=0 -DPA_USE_WASAPI=0 -ffast-math -fomit-frame-pointer -I./src/hostapi/asio -I/p/Radio/\r
+ASIOSDK2/host/pc -I/p/Radio/ASIOSDK2/common -I/p/Radio/ASIOSDK2/host -UPA_USE_ASIO -DPA_USE_ASIO=1 -DWINDOWS -D_WIN32_WINNT=0x0501 -\r
+DWINVER=0x0501 /p/Radio/ASIOSDK2/host/pc/asiolist.cpp -o /p/Radio/ASIOSDK2/host/pc/asiolist.lo\r
+libtool: compile:  g++ -c -g -O2 -DPA_LITTLE_ENDIAN -I./include -I./src/common -I./src/os/win -DPA_USE_WMME=0 -DPA_USE_ASIO=0 -DPA_U\r
+SE_WDMKS=0 -DPA_USE_DS=0 -DPA_USE_WASAPI=0 -ffast-math -fomit-frame-pointer -I./src/hostapi/asio -I/p/Radio/ASIOSDK2/host/pc -I/p/Ra\r
+dio/ASIOSDK2/common -I/p/Radio/ASIOSDK2/host -UPA_USE_ASIO -DPA_USE_ASIO=1 -DWINDOWS -D_WIN32_WINNT=0x0501 -DWINVER=0x0501 /p/Radio/\r
+ASIOSDK2/host/pc/asiolist.cpp  -DDLL_EXPORT -DPIC -o /p/Radio/ASIOSDK2/host/pc/.libs/asiolist.o\r
+libtool: compile:  g++ -c -g -O2 -DPA_LITTLE_ENDIAN -I./include -I./src/common -I./src/os/win -DPA_USE_WMME=0 -DPA_USE_ASIO=0 -DPA_U\r
+SE_WDMKS=0 -DPA_USE_DS=0 -DPA_USE_WASAPI=0 -ffast-math -fomit-frame-pointer -I./src/hostapi/asio -I/p/Radio/ASIOSDK2/host/pc -I/p/Ra\r
+dio/ASIOSDK2/common -I/p/Radio/ASIOSDK2/host -UPA_USE_ASIO -DPA_USE_ASIO=1 -DWINDOWS -D_WIN32_WINNT=0x0501 -DWINVER=0x0501 /p/Radio/\r
+ASIOSDK2/host/pc/asiolist.cpp -o /p/Radio/ASIOSDK2/host/pc/asiolist.o >/dev/null 2>&1\r
+/bin/sh ./libtool --mode=link --tag=CXX g++  -shared -rpath /usr/local/lib -no-undefined -export-symbols-regex "(Pa|PaMacCore|PaJack\r
+|PaAlsa|PaAsio|PaOSS)_.*" -version-info 2:0:0 -o lib/libportaudio.la src/common/pa_allocation.lo src/common/pa_converters.lo src/com\r
+mon/pa_cpuload.lo src/common/pa_dither.lo src/common/pa_debugprint.lo src/common/pa_front.lo src/common/pa_process.lo src/common/pa_\r
+stream.lo src/common/pa_trace.lo src/hostapi/skeleton/pa_hostapi_skeleton.lo src/hostapi/asio/pa_asio.lo src/common/pa_ringbuffer.lo\r
+ src/os/win/pa_win_hostapis.lo src/os/win/pa_win_util.lo src/os/win/pa_win_coinitialize.lo src/hostapi/asio/iasiothiscallresolver.lo\r
+ /p/Radio/ASIOSDK2/common/asio.lo /p/Radio/ASIOSDK2/host/asiodrivers.lo /p/Radio/ASIOSDK2/host/pc/asiolist.lo -lwinmm -lm -lole32 -l\r
+uuid\r
+\r
+*** Warning: linker path does not have real file for library -luuid.\r
+*** I have the capability to make that library automatically link in when\r
+*** you link to this library.  But I can only do this if you have a\r
+*** shared version of the library, which you do not appear to have\r
+*** because I did check the linker path looking for a file starting\r
+*** with libuuid and none of the candidates passed a file format test\r
+*** using a file magic. Last file checked: /mingw/lib/libuuid.a\r
+*** The inter-library dependencies that have been dropped here will be\r
+*** automatically added whenever a program is linked with this library\r
+*** or is declared to -dlopen it.\r
+\r
+*** Since this library must not contain undefined symbols,\r
+*** because either the platform does not support them or\r
+*** it was explicitly requested with -no-undefined,\r
+*** libtool will only create a static version of it.\r
+libtool: link: /mingw/bin/ar cru lib/.libs/libportaudio.a src/common/.libs/pa_allocation.o src/common/.libs/pa_converters.o src/comm\r
+on/.libs/pa_cpuload.o src/common/.libs/pa_dither.o src/common/.libs/pa_debugprint.o src/common/.libs/pa_front.o src/common/.libs/pa_\r
+process.o src/common/.libs/pa_stream.o src/common/.libs/pa_trace.o src/hostapi/skeleton/.libs/pa_hostapi_skeleton.o src/hostapi/asio\r
+/.libs/pa_asio.o src/common/.libs/pa_ringbuffer.o src/os/win/.libs/pa_win_hostapis.o src/os/win/.libs/pa_win_util.o src/os/win/.libs\r
+/pa_win_coinitialize.o src/hostapi/asio/.libs/iasiothiscallresolver.o /p/Radio/ASIOSDK2/common/.libs/asio.o /p/Radio/ASIOSDK2/host/.\r
+libs/asiodrivers.o /p/Radio/ASIOSDK2/host/pc/.libs/asiolist.o\r
+libtool: link: ranlib lib/.libs/libportaudio.a\r
+libtool: link: ( cd "lib/.libs" && rm -f "libportaudio.la" && cp -p "../libportaudio.la" "libportaudio.la" )\r
+if test -n " bindings/cpp" ; then for dir in " bindings/cpp"; do make -C $dir all; done ; fi\r
+make[1]: Entering directory `/p/Radio/portaudio/bindings/cpp'\r
+Making all in lib\r
+make[2]: Entering directory `/p/Radio/portaudio/bindings/cpp/lib'\r
+/bin/sh ../libtool --tag=CXX   --mode=link g++  -g -O2 -Wall -ansi -pedantic -version-info 0:12:0 -no-undefined  -o libportaudiocpp.\r
+la -rpath /usr/local/lib BlockingStream.lo CallbackInterface.lo CallbackStream.lo CFunCallbackStream.lo CppFunCallbackStream.lo Devi\r
+ce.lo DirectionSpecificStreamParameters.lo Exception.lo HostApi.lo InterfaceCallbackStream.lo MemFunCallbackStream.lo Stream.lo Stre\r
+amParameters.lo System.lo SystemDeviceIterator.lo SystemHostApiIterator.lo ../../../lib/libportaudio.la\r
+\r
+*** Warning: This system can not link to static lib archive ../../../lib/libportaudio.la.\r
+*** I have the capability to make that library automatically link in when\r
+*** you link to this library.  But I can only do this if you have a\r
+*** shared version of the library, which you do not appear to have.\r
+libtool: link: rm -fr  .libs/libportaudiocpp.dll.a\r
+libtool: link: g++ -shared -nostdlib c:/bin/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../dllcrt2.o c:/bin/mingw/bin/../lib/gcc/mingw3\r
+2/4.6.2/crtbegin.o  .libs/BlockingStream.o .libs/CallbackInterface.o .libs/CallbackStream.o .libs/CFunCallbackStream.o .libs/CppFunC\r
+allbackStream.o .libs/Device.o .libs/DirectionSpecificStreamParameters.o .libs/Exception.o .libs/HostApi.o .libs/InterfaceCallbackSt\r
+ream.o .libs/MemFunCallbackStream.o .libs/Stream.o .libs/StreamParameters.o .libs/System.o .libs/SystemDeviceIterator.o .libs/System\r
+HostApiIterator.o   -Lc:/bin/mingw/bin/../lib/gcc/mingw32/4.6.2 -Lc:/bin/mingw/bin/../lib/gcc -Lc:/bin/mingw/bin/../lib/gcc/mingw32/\r
+4.6.2/../../../../mingw32/lib -Lc:/bin/mingw/bin/../lib/gcc/mingw32/4.6.2/../../.. -lstdc++ -lmingw32 -lgcc_s -lgcc -lmoldname -lmin\r
+gwex -lmsvcrt -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt c:/bin/mingw/bin/../lib\r
+/gcc/mingw32/4.6.2/crtend.o  -O2   -o .libs/libportaudiocpp-0.dll -Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker .libs/\r
+libportaudiocpp.dll.a\r
+Creating library file: .libs/libportaudiocpp.dll.a\r
+.libs/BlockingStream.o: In function `ZN9portaudio14BlockingStream4openERKNS_16StreamParametersE':\r
+C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/BlockingStream.cxx:39: undefined reference to `Pa_\r
+OpenStream'\r
+.libs/BlockingStream.o: In function `ZN9portaudio14BlockingStream4readEPvm':\r
+C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/BlockingStream.cxx:51: undefined reference to `Pa_\r
+ReadStream'\r
+.libs/BlockingStream.o: In function `ZN9portaudio14BlockingStream5writeEPKvm':\r
+C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/BlockingStream.cxx:61: undefined reference to `Pa_\r
+WriteStream'\r
+.libs/BlockingStream.o: In function `ZNK9portaudio14BlockingStream17availableReadSizeEv':\r
+C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/BlockingStream.cxx:73: undefined reference to `Pa_\r
+GetStreamReadAvailable'\r
+.libs/BlockingStream.o: In function `ZNK9portaudio14BlockingStream18availableWriteSizeEv':\r
+C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/BlockingStream.cxx:85: undefined reference to `Pa_\r
+GetStreamWriteAvailable'\r
+.libs/CallbackStream.o: In function `ZNK9portaudio14CallbackStream7cpuLoadEv':\r
+C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/CallbackStream.cxx:17: undefined reference to `Pa_\r
+GetStreamCpuLoad'\r
+.libs/CFunCallbackStream.o: In function `ZN9portaudio18CFunCallbackStream4openERKNS_16StreamParametersEPFiPKvPvmPK24PaStreamCallback\r
+TimeInfomS6_ES6_':\r
+C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/CFunCallbackStream.cxx:34: undefined reference to\r
+`Pa_OpenStream'\r
+.libs/CppFunCallbackStream.o: In function `ZN9portaudio17FunCallbackStream4openERKNS_16StreamParametersE':\r
+C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/CppFunCallbackStream.cxx:72: undefined reference t\r
+o `Pa_OpenStream'\r
+.libs/Device.o: In function `Device':\r
+C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/Device.cxx:19: undefined reference to `Pa_GetDevic\r
+eInfo'\r
+.libs/Exception.o: In function `ZNK9portaudio11PaException11paErrorTextEv':\r
+C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/Exception.cxx:41: undefined reference to `Pa_GetEr\r
+rorText'\r
+.libs/Exception.o: In function `ZNK9portaudio11PaException16lastHostApiErrorEv':\r
+C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/Exception.cxx:58: undefined reference to `Pa_GetLa\r
+stHostErrorInfo'\r
+.libs/Exception.o: In function `ZNK9portaudio11PaException20lastHostApiErrorTextEv':\r
+C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/Exception.cxx:68: undefined reference to `Pa_GetLa\r
+stHostErrorInfo'\r
+.libs/Exception.o: In function `ZNK9portaudio11PaException11paErrorTextEv':\r
+C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/Exception.cxx:41: undefined reference to `Pa_GetEr\r
+rorText'\r
+.libs/HostApi.o: In function `HostApi':\r
+C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/HostApi.cxx:17: undefined reference to `Pa_GetHost\r
+ApiInfo'\r
+C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/HostApi.cxx:26: undefined reference to `Pa_HostApi\r
+DeviceIndexToDeviceIndex'\r
+.libs/HostApi.o: In function `ZNK9portaudio7HostApi5indexEv':\r
+C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/HostApi.cxx:61: undefined reference to `Pa_HostApi\r
+TypeIdToHostApiIndex'\r
+.libs/InterfaceCallbackStream.o: In function `ZN9portaudio23InterfaceCallbackStream4openERKNS_16StreamParametersERNS_17CallbackInter\r
+faceE':\r
+C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/InterfaceCallbackStream.cxx:38: undefined referenc\r
+e to `Pa_OpenStream'\r
+.libs/Stream.o: In function `ZN9portaudio6Stream5closeEv':\r
+C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/Stream.cxx:33: undefined reference to `Pa_CloseStr\r
+eam'\r
+.libs/Stream.o: In function `ZN9portaudio6Stream25setStreamFinishedCallbackEPFvPvE':\r
+C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/Stream.cxx:53: undefined reference to `Pa_SetStrea\r
+mFinishedCallback'\r
+.libs/Stream.o: In function `ZN9portaudio6Stream5startEv':\r
+C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/Stream.cxx:63: undefined reference to `Pa_StartStr\r
+eam'\r
+.libs/Stream.o: In function `ZN9portaudio6Stream4stopEv':\r
+C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/Stream.cxx:71: undefined reference to `Pa_StopStre\r
+am'\r
+.libs/Stream.o: In function `ZN9portaudio6Stream5abortEv':\r
+C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/Stream.cxx:79: undefined reference to `Pa_AbortStr\r
+eam'\r
+.libs/Stream.o: In function `ZNK9portaudio6Stream9isStoppedEv':\r
+C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/Stream.cxx:87: undefined reference to `Pa_IsStream\r
+Stopped'\r
+.libs/Stream.o: In function `ZNK9portaudio6Stream8isActiveEv':\r
+C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/Stream.cxx:97: undefined reference to `Pa_IsStream\r
+Active'\r
+.libs/Stream.o: In function `ZNK9portaudio6Stream12inputLatencyEv':\r
+C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/Stream.cxx:115: undefined reference to `Pa_GetStre\r
+amInfo'\r
+.libs/Stream.o: In function `ZNK9portaudio6Stream13outputLatencyEv':\r
+C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/Stream.cxx:133: undefined reference to `Pa_GetStre\r
+amInfo'\r
+.libs/Stream.o: In function `ZNK9portaudio6Stream10sampleRateEv':\r
+C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/Stream.cxx:152: undefined reference to `Pa_GetStre\r
+amInfo'\r
+.libs/Stream.o: In function `ZNK9portaudio6Stream4timeEv':\r
+C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/Stream.cxx:166: undefined reference to `Pa_GetStre\r
+amTime'\r
+.libs/StreamParameters.o: In function `ZNK9portaudio16StreamParameters11isSupportedEv':\r
+C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/StreamParameters.cxx:103: undefined reference to `\r
+Pa_IsFormatSupported'\r
+.libs/System.o: In function `ZN9portaudio6System14defaultHostApiEv':\r
+C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/System.cxx:165: undefined reference to `Pa_GetDefa\r
+ultHostApi'\r
+.libs/System.o: In function `ZN9portaudio6System15hostApiByTypeIdE15PaHostApiTypeId':\r
+C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/System.cxx:175: undefined reference to `Pa_HostApi\r
+TypeIdToHostApiIndex'\r
+.libs/System.o: In function `ZN9portaudio6System12hostApiCountEv':\r
+C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/System.cxx:193: undefined reference to `Pa_GetHost\r
+ApiCount'\r
+.libs/System.o: In function `ZN9portaudio6System11deviceCountEv':\r
+C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/System.cxx:261: undefined reference to `Pa_GetDevi\r
+ceCount'\r
+.libs/System.o: In function `ZN9portaudio6System19defaultOutputDeviceEv':\r
+C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/System.cxx:237: undefined reference to `Pa_GetDefa\r
+ultOutputDevice'\r
+.libs/System.o: In function `ZN9portaudio6System18defaultInputDeviceEv':\r
+C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/System.cxx:227: undefined reference to `Pa_GetDefa\r
+ultInputDevice'\r
+.libs/System.o: In function `ZN9portaudio6System10initializeEv':\r
+C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/System.cxx:48: undefined reference to `Pa_Initiali\r
+ze'\r
+.libs/System.o: In function `ZN9portaudio6System9terminateEv':\r
+C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/System.cxx:118: undefined reference to `Pa_Termina\r
+te'\r
+.libs/System.o: In function `ZN9portaudio6System12sizeOfSampleEm':\r
+C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/System.cxx:283: undefined reference to `Pa_GetSamp\r
+leSize'\r
+.libs/System.o: In function `ZN9portaudio6System7versionEv':\r
+C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/System.cxx:28: undefined reference to `Pa_GetVersi\r
+on'\r
+.libs/System.o: In function `ZN9portaudio6System11versionTextEv':\r
+C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/System.cxx:33: undefined reference to `Pa_GetVersi\r
+onText'\r
+.libs/System.o: In function `ZN9portaudio6System5sleepEl':\r
+C:\Users\wittend\Projects\Radio\portaudio\bindings\cpp\lib/../source/portaudiocpp/System.cxx:278: undefined reference to `Pa_Sleep'\r
+collect2: ld returned 1 exit status\r
+make[2]: *** [libportaudiocpp.la] Error 1\r
+make[2]: Leaving directory `/p/Radio/portaudio/bindings/cpp/lib'\r
+make[1]: *** [all-recursive] Error 1\r
+make[1]: Leaving directory `/p/Radio/portaudio/bindings/cpp'\r
+make: *** [all-recursive] Error 2\r
\r
+\r
+Try a static build & DSound:\r
+===========================================\r
+ ./configure  --with-winapi=directx  --with-dxdir=/p/Radio/dx7sdk --enable-cxx=yes --enable-shared=no  --with-host_os=mingw\r
+\r
+As usual with DSound, configure goes Ok, but the last build messages I get are:\r
+/bin/sh ./libtool --mode=compile gcc -c -g -O2 -DPA_LITTLE_ENDIAN -I./include -I./src/common -I./src/os/win -DPA_USE_WMME=0 -DPA_USE\r
+_ASIO=0 -DPA_USE_WDMKS=0 -DPA_USE_DS=0 -DPA_USE_WASAPI=0 -I/p/Radio/dx7sdk/include -UPA_USE_DS -DPA_USE_DS=1 -mthreads -DPACKAGE_NAM\r
+E=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DSTDC_HEADER\r
+S=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPE\r
+S_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DLT_OBJDIR=\".libs/\" -DSIZEOF_SHORT=2 -DSIZEOF_INT=4 -DSIZEOF_LONG=4 src/hostapi/dsound/\r
+pa_win_ds.c -o src/hostapi/dsound/pa_win_ds.lo\r
+libtool: compile:  gcc -c -g -O2 -DPA_LITTLE_ENDIAN -I./include -I./src/common -I./src/os/win -DPA_USE_WMME=0 -DPA_USE_ASIO=0 -DPA_U\r
+SE_WDMKS=0 -DPA_USE_DS=0 -DPA_USE_WASAPI=0 -I/p/Radio/dx7sdk/include -UPA_USE_DS -DPA_USE_DS=1 -mthreads -DPACKAGE_NAME=\"\" -DPACKA\r
+GE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS\r
+_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_S\r
+TDINT_H=1 -DHAVE_UNISTD_H=1 -DLT_OBJDIR=\".libs/\" -DSIZEOF_SHORT=2 -DSIZEOF_INT=4 -DSIZEOF_LONG=4 src/hostapi/dsound/pa_win_ds.c -o\r
+ src/hostapi/dsound/pa_win_ds.o\r
+src/hostapi/dsound/pa_win_ds.c:68:20: fatal error: dsound.h: No such file or directory\r
+compilation terminated.\r
+make: *** [src/hostapi/dsound/pa_win_ds.lo] Error 1\r
+\r
\r
+Try a static build& ASIO:\r
+===========================================\r
+\r
+./configure --with-winapi=asio  --with-asiodir=/p/Radio/ASIOSDK2  --enable-cxx=yes --enable-shared=no --with-host_os=mingw\r
+\r
+\r
+Configuration summary:\r
+\r
+  Target ...................... i686-pc-mingw32\r
+  C++ bindings ................ yes\r
+  Debug output ................ no\r
+\r
+  WMME ........................ no\r
+  DSound ...................... no\r
+  ASIO ........................ yes (/p/Radio/ASIOSDK2)\r
+  WASAPI ...................... no\r
+  WDMKS ....................... no\r
+\r
+This one Worked!\r
+====================\r
+====================\r
+\r
+next:\r
+\r
+$ make install\r
+/bin/install -c -d /usr/local/lib\r
+/bin/sh ./libtool --mode=install /bin/install -c lib/libportaudio.la /usr/local/lib\r
+libtool: install: /bin/install -c lib/.libs/libportaudio.lai /usr/local/lib/libportaudio.la\r
+libtool: install: /bin/install -c lib/.libs/libportaudio.a /usr/local/lib/libportaudio.a\r
+libtool: install: chmod 644 /usr/local/lib/libportaudio.a\r
+libtool: install: ranlib /usr/local/lib/libportaudio.a\r
+/bin/install -c -d /usr/local/include\r
+for include in portaudio.h; do \\r
+                /bin/install -c -m 644 -m 644 ./include/$include /usr/local/include/$include; \\r
+        done\r
+/bin/install -c -d /usr/local/lib/pkgconfig\r
+/bin/install -c -m 644 portaudio-2.0.pc /usr/local/lib/pkgconfig/portaudio-2.0.pc\r
+\r
+------------------------------------------------------------\r
+PortAudio was successfully installed.\r
+\r
+On some systems (e.g. Linux) you should run 'ldconfig' now\r
+to make the shared object available.  You may also need to\r
+modify your LD_LIBRARY_PATH environment variable to include\r
+the directory /usr/local/lib\r
+------------------------------------------------------------\r
+\r
+make install-recursive\r
+make[1]: Entering directory `/p/Radio/portaudio'\r
+if test -n " bindings/cpp" ; then for dir in " bindings/cpp"; do make -C $dir install; done ; fi\r
+make[2]: Entering directory `/p/Radio/portaudio/bindings/cpp'\r
+Making install in lib\r
+make[3]: Entering directory `/p/Radio/portaudio/bindings/cpp/lib'\r
+make[4]: Entering directory `/p/Radio/portaudio/bindings/cpp/lib'\r
+test -z "/usr/local/lib" || /bin/mkdir -p "/usr/local/lib"\r
+ /bin/sh ../libtool   --mode=install /bin/install -c   libportaudiocpp.la '/usr/local/lib'\r
+libtool: install: /bin/install -c .libs/libportaudiocpp.lai /usr/local/lib/libportaudiocpp.la\r
+libtool: install: /bin/install -c .libs/libportaudiocpp.a /usr/local/lib/libportaudiocpp.a\r
+libtool: install: chmod 644 /usr/local/lib/libportaudiocpp.a\r
+libtool: install: ranlib /usr/local/lib/libportaudiocpp.a\r
+make[4]: Nothing to be done for `install-data-am'.\r
+make[4]: Leaving directory `/p/Radio/portaudio/bindings/cpp/lib'\r
+make[3]: Leaving directory `/p/Radio/portaudio/bindings/cpp/lib'\r
+Making install in include\r
+make[3]: Entering directory `/p/Radio/portaudio/bindings/cpp/include'\r
+make[4]: Entering directory `/p/Radio/portaudio/bindings/cpp/include'\r
+make[4]: Nothing to be done for `install-exec-am'.\r
+test -z "/usr/local/include/portaudiocpp" || /bin/mkdir -p "/usr/local/include/portaudiocpp"\r
+ /bin/install -c -m 644 portaudiocpp/AutoSystem.hxx portaudiocpp/BlockingStream.hxx portaudiocpp/CallbackInterface.hxx portaudiocpp/\r
+CallbackStream.hxx portaudiocpp/CFunCallbackStream.hxx portaudiocpp/CppFunCallbackStream.hxx portaudiocpp/Device.hxx portaudiocpp/Di\r
+rectionSpecificStreamParameters.hxx portaudiocpp/Exception.hxx portaudiocpp/HostApi.hxx portaudiocpp/InterfaceCallbackStream.hxx por\r
+taudiocpp/MemFunCallbackStream.hxx portaudiocpp/PortAudioCpp.hxx portaudiocpp/SampleDataFormat.hxx portaudiocpp/Stream.hxx portaudio\r
+cpp/StreamParameters.hxx portaudiocpp/SystemDeviceIterator.hxx portaudiocpp/SystemHostApiIterator.hxx portaudiocpp/System.hxx '/usr/\r
+local/include/portaudiocpp'\r
+make[4]: Leaving directory `/p/Radio/portaudio/bindings/cpp/include'\r
+make[3]: Leaving directory `/p/Radio/portaudio/bindings/cpp/include'\r
+Making install in bin\r
+make[3]: Entering directory `/p/Radio/portaudio/bindings/cpp/bin'\r
+make[4]: Entering directory `/p/Radio/portaudio/bindings/cpp/bin'\r
+make[4]: Nothing to be done for `install-exec-am'.\r
+make[4]: Nothing to be done for `install-data-am'.\r
+make[4]: Leaving directory `/p/Radio/portaudio/bindings/cpp/bin'\r
+make[3]: Leaving directory `/p/Radio/portaudio/bindings/cpp/bin'\r
+make[3]: Entering directory `/p/Radio/portaudio/bindings/cpp'\r
+make[4]: Entering directory `/p/Radio/portaudio/bindings/cpp'\r
+make[4]: Nothing to be done for `install-exec-am'.\r
+test -z "/usr/local/lib/pkgconfig" || /bin/mkdir -p "/usr/local/lib/pkgconfig"\r
+ /bin/install -c -m 644 portaudiocpp.pc '/usr/local/lib/pkgconfig'\r
+make[4]: Leaving directory `/p/Radio/portaudio/bindings/cpp'\r
+make[3]: Leaving directory `/p/Radio/portaudio/bindings/cpp'\r
+make[2]: Leaving directory `/p/Radio/portaudio/bindings/cpp'\r
+make[1]: Leaving directory `/p/Radio/portaudio'\r
+  \r
+  \r
+Trying both Direct Sound & Asio at the same time dynamicly:\r
+============================================================\r
+$ ./configure  --with-winapi=directx  --with-dxdir=/p/Radio/dx7sdk --with-winapi=asio  --with-asiodir=/p/Radio/ASIOSDK2  --enable-c\r
+xx=yes --enable-shared=yes  --with-host_os=mingw\r
+\r
+Configuration summary:\r
+\r
+  Target ...................... i686-pc-mingw32\r
+  C++ bindings ................ yes\r
+  Debug output ................ no\r
+\r
+  WMME ........................ no\r
+  DSound ...................... no\r
+  ASIO ........................ yes (/p/Radio/ASIOSDK2)\r
+  WASAPI ...................... no\r
+  WDMKS ....................... no\r
+  \r
+Fail!  configures only the last specified API (ASIO)\r
+\r
+\r
+Trying just Dsound:\r
+============================================================\r
+\r
+moved the DirectX sdk into c:/bin/ms_dxsdk/\r
+then mapped /bin/ms_dxsdk to /dxsdkin msys's /etc/fstab file.\r
+moved sal.h from MSVC10/include into /dxsdk/include.\r
+then did:\r
+\r
+ ./configure --with-winapi=directx --with-dxdir=/dxsdk --enable-cxx=yes --enable-shared=yes  --with-host_os=mingw\r
+\r
+got:\r
\r
+Configuration summary:\r
+\r
+  Target ...................... i686-pc-mingw32\r
+  C++ bindings ................ yes\r
+  Debug output ................ no\r
+\r
+  WMME ........................ no\r
+  DSound ...................... yes (/dxsdk)\r
+  ASIO ........................ no\r
+  WASAPI ...................... no\r
+  WDMKS ....................... no\r
+\r
+and did: \r
+\r
+  make\r
+\r
+  Everything seemed to work! Finally!\r
+  \r
diff --git a/freedv/branches/0.97/obsolete/README.Win32 b/freedv/branches/0.97/obsolete/README.Win32
new file mode 100644 (file)
index 0000000..3fc3f28
--- /dev/null
@@ -0,0 +1,73 @@
+README.Win32\r
+David Rowe 27 Oct 2012\r
+\r
+Debugging Under Windows\r
+-----------------------\r
+\r
+printfs don't appear until after the program finishes.  wxLogDebug()\r
+works but you need to run DebugView available from\r
+http://www.sysinternals.com to capture the messages.\r
+\r
+Building fdmdv2 for Windows\r
+---------------------------\r
+\r
+This is how David R did it, Dave Witten used a different approach.\r
+Many variations are possible.\r
+\r
+1. Install MinGW & the mysys shell\r
+   + pwd -W prints true Win32 directory\r
+   + I also installed emacs, "tortise svn", and DebugView\r
+\r
+2. "make install" for various packages below put DLLs in /usr/local/lib\r
+   "cd /usr/local/lib; pwd -W" to find the Win32 directory\r
+   add this to the Windows PATH (Control Panel - System - Advanced)\r
+\r
+3. WxWidgets:\r
+   download 2.9.4 tar ball\r
+   mkdir build-debug; cd build-debug\r
+   ./configure --with-msw\r
+   make && make install\r
+\r
+4. PortAudio:\r
+   download latest V19\r
+   ./configure --enable-cxx\r
+   make && make install\r
+\r
+5. libsndfile:\r
+   download lastest source tar ball (not Win32 binaries)\r
+   ./configure && make && make install\r
+\r
+6. libsamplerate:\r
+   download latest source tar ball:\r
+       http://www.mega-nerd.com/SRC/libsamplerate-0.1.8.tar.gz(not Win32 binaries)\r
+   ./configure && make && make install\r
+\r
+7. hamlib\r
+\r
+   I couldn't get this to compile from source, so used the pre-built Win32\r
+   DLLs:\r
+\r
+   Download https://downloads.sourceforge.net/project/hamlib/hamlib/1.2.15.3/hamlib-win32-1.2.15.3.zip\r
+   Open hamlib-win32-1.2.15.3.zip with a GUI archive tool\r
+   Copy hamlib/include/* to /usr/local/include\r
+   Copy hamlib/bin/hamlib*.dll to /usr/local/lib\r
+   Copy hamlib/lib/gcc to /usr/local/lib\r
+\r
+8. sox (used for Filter - EQ)\r
+\r
+   $ wget http://sourceforge.net/projects/sox/files/sox/14.4.0/sox-14.4.0.tar.gz\r
+   $ tar xvzf sox-14.4.0.tar.gz\r
+   $ ./configure --enable-shared=no --without-id3tag --without-png --disable-gomp --with-oggvorbis=no --with-oss=no --with-flac=no --disable-dl-sndfile --with-waveaudio=no\r
+   $ make && make install\r
+\r
+   I couldn't find an install command line that worked, so manually copied the libs and include files.\r
+\r
+9. Codec 2\r
+   $ wget https://freetel.svn.sourceforge.net/svnroot/freetel/codec2\r
+   $ cd codec2\r
+   $ ./configure && make\r
+\r
+10. svn co fdmdv2\r
+    cd fdmdv2/src\r
+    make -f Makefile.Win32\r
+\r
diff --git a/freedv/branches/0.97/obsolete/README.linux b/freedv/branches/0.97/obsolete/README.linux
new file mode 100644 (file)
index 0000000..37cf9e1
--- /dev/null
@@ -0,0 +1,75 @@
+README.linux for fdmdv2
+Created by David Rowe
+Oct 14 2012
+
+BUILDING FreeDV for Linux
+=========================
+
+1. FreeDV was developed on Ubuntu 9.1 and 10.04 systems. It has been
+   tested on OSS (Ubuntu 9.1) and ALSA (Ubuntu 10.04) sound systems.
+
+2. A typical ALSA installation (e.g., Ubuntu 10.04) first install the
+   following packages:
+
+   $ sudo apt-get install libgtk2.0-dev libsamplerate0-dev libsndfile1-dev libasound2-dev
+
+3. If you would like to use OSS rather than ALSA do not install libasound2-dev.
+
+4. Makefile.linux will download the libraries you need, configure and
+   build them, then build FreeDV.  Makefile.linux will _not_ install
+   any of the libraries built for FreeDV on your system.
+
+   cd fdmdv2/src 
+   make -f Makefile.linux
+
+Linux usage Notes
+=================
+
+1. Config is stored in ~/.FreeDV, rm this file to restore defaults
+
+
+TODO
+====
+
+[ ] Stopping Waterfall
+    + When Stop pressed lower 25% of Waterfall isn't erased
+
+[ ] release clean up
+    [ ] remove/comment out debug printfs
+    [ ] help about with URL (hyperlink?) to web site & donations
+    [ ] buffer sizes, maybe make a config number
+    [ ] tool tip help for audio config dialog
+
+IDEAS
+=====
+
+1. Tabbed page option that draws block diagram of system and draws
+   line between sound devices and modem blocks.  Lines move depending
+   if we are in sync, audio pass thru etc
+
+2. Way to I/O to/from files on each "port", for example:
+   + monitor input speech or feed input speech
+
+3. (Thomas Kocourek n4fwd) Context sensitive help.
+
+4. Look at how people hook up and use program, stop common mistakes or assumptions
+
+5. Squelch implementation.  Effect of SNR bouncing around might be to
+   have audio cut in and out.  We might need a better way of
+   triggering mute, such as amplitude of pilots, or smoother SNR.  Or
+   hysteresis in Squelch.
+
+User Manual Notes
+-----------------
+
+Count 5 seconds when removing/installing USB sound devices before
+pressing refesh.
+
+Describe what a valid one card and two card configuration looks like.
+Draw a block diagram, image of set up dialog.
+
+What a good scatter diagram/spectrum looks like
+
+Setting up in audio loopback
+
+Right click drag tabs, new window, tab order
diff --git a/freedv/branches/0.97/obsolete/README.osx b/freedv/branches/0.97/obsolete/README.osx
new file mode 100644 (file)
index 0000000..1e3eeca
--- /dev/null
@@ -0,0 +1,801 @@
+README.osx
+David Witten 29 Dec 2012
+==========================
+
+Received today:
+
+Mooneer Salem 
+Re: [digitalvoice] Re: Mac build for fdmdv2
+
+Yep. I'm attaching a patch to this email with the modifications I had to make to get FreeDV to build on OSX. I develop on 10.8.2, but it should work with 10.5-10.7 I think. Unfortunately it's 32-bit only due to a dependency on Carbon, which Apple deprecated.
+
+Directions (requires MacPorts to build dependencies):
+
+1. Apply patch.
+2. $ sudo port install wxWidgets30 +aui +universal portaudio +universal sox +universal libsndfile +universal libsamplerate +universal
+3. $ cd src && make -f Makefile.osx
+
+This will create a folder named FreeDV.app in the src folder (shows up as a single file in Finder) that when double-clicked, starts the application. I'll probably need to figure out how to include dependencies in the .app folder so that people won't need to install MacPorts just to run FreeDV ;)
+
+The patch also includes the change away from libctb. It compiles on POSIX compliant platforms, but I'm not sure about the Windows implementation due to not having a Windows development setup here at home.
+
+...
+-Mooneer KG6AOV
+
+Mooneer's patch is included as /freedv_osx_port.patch.gz in the SVN checkout or just snip & run the following --
+Patch:<cut here->
+
+Index: src/Makefile.linux
+===================================================================
+--- src/Makefile.linux (revision 1152)
++++ src/Makefile.linux (working copy)
+@@ -36,12 +36,6 @@
+ SOX_INC=-I$(SOX)/src/
+ SOX_LIB=$(SOX)/src/.libs/libsox.a
+-# CTB ---------------------------------------------------
+-
+-CTB=libctb-0.16
+-CTB_INC=-I$(CTB)/include
+-CTB_LIB=$(CTB)/lib/libctb-0.16.a
+-
+ # if libasound is available, PortAudio will be using it, so we will
+ # need to add it to freedv link line.  To test if it is present, we try
+ # to link a small C program with -lasound
+@@ -50,8 +44,8 @@
+ # FreeDV ------------------------------------------------
+-CPP_FLAGS = -D_NO_AUTOTOOLS_ $(WX_CPPFLAGS) $(PORTAUDIO_INC) $(CODEC2_INC) $(SOX_INC) $(CTB_INC) -I. -g -Wall -O3 -DSVN_REVISION=\"$(SVN_REVISION)\"
+-FREEDV_LIBS = $(WX_LIBS) $(PORTAUDIO_LIB) $(CODEC2_LIB) $(SOX_LIB) $(CTB_LIB) -lm -lpthread -lsndfile -lsamplerate $(LIBASOUND)
++CPP_FLAGS = -D_NO_AUTOTOOLS_ $(WX_CPPFLAGS) $(PORTAUDIO_INC) $(CODEC2_INC) $(SOX_INC) -I. -g -Wall -O3 -DSVN_REVISION=\"$(SVN_REVISION)\"
++FREEDV_LIBS = $(WX_LIBS) $(PORTAUDIO_LIB) $(CODEC2_LIB) $(SOX_LIB) -lm -lpthread -lsndfile -lsamplerate $(LIBASOUND)
+ OBJS = topFrame.o \
+ fdmdv2_main.o \
+@@ -65,11 +59,12 @@
+ dlg_comports.o \
+ dlg_filter.o \
+ varicode.o \
+-sox_biquad.o
++sox_biquad.o \
++serialport.o
+-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
++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 serialport.h
+-all: $(WXWIDGETS)/.built $(PORTAUDIO)/.built $(CODEC2)/.built $(SOX)/.built $(CTB)/.built freedv
++all: $(WXWIDGETS)/.built $(PORTAUDIO)/.built $(CODEC2)/.built $(SOX)/.built freedv
+ freedv: $(OBJS) 
+       g++ -o freedv $(OBJS) $(CPP_FLAGS) $(FREEDV_LIBS)
+@@ -81,7 +76,7 @@
+       rm -f *.o fdmdv2 
+ clean-lib:
+-      rm -Rf $(WXWIDGETS) $(PORTAUDIO) $(CODEC2) $(SOX) $(CTB)  
++      rm -Rf $(WXWIDGETS) $(PORTAUDIO) $(CODEC2) $(SOX) 
+       rm -f *.o fdmdv2 
+ # wxWidgets ---------------------------------------------------------
+@@ -126,14 +121,3 @@
+        
+ $(SOX).tar.bz2:
+       wget http://downloads.sourceforge.net/project/sox/sox/14.4.0/sox-14.4.0.tar.bz2
+-
+-# CTB -------------------------------------------------------------
+-
+-$(CTB)/.built: $(CTB)
+-      cd $(CTB)/build && make && touch ../.built
+-               
+-$(CTB) : $(CTB).tar.gz
+-      tar xvzf $(CTB).tar.gz
+-       
+-$(CTB).tar.gz:
+-      wget https://iftools.com/download/ctb/0.16/libctb-0.16.tar.gz
+Index: src/Makefile.linux.dmw
+===================================================================
+--- src/Makefile.linux.dmw     (revision 1152)
++++ src/Makefile.linux.dmw     (working copy)
+@@ -36,7 +36,8 @@
+ dlg_comports.o \
+ dlg_filter.o \
+ varicode.o \
+-sox_biquad.o
++sox_biquad.o \
++serialport.o
+ all: fdmdv2
+@@ -44,7 +45,7 @@
+ fdmdv2: $(OBJS) fdmdv2_main.h
+       g++ -o fdmdv2 $(OBJS) $(CPP_FLAGS) $(LIBS)
+-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
++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 serialport.h
+ %.o: %.cpp
+       g++ $(CPP_FLAGS) -c $< -o $@
+Index: src/Makefile.osx
+===================================================================
+--- src/Makefile.osx   (revision 0)
++++ src/Makefile.osx   (working copy)
+@@ -0,0 +1,76 @@
++# src/Makefile.osx
++# Mooneer Salem 28 Dec 2012
++#
++# Makefile for OSX - assumes MacPorts for some libraries and builds the others locally.
++# Note: dependencies must be installed with universal binary support due to the use of Carbon by portaudio and others.
++#       (Carbon is officially deprecated by Apple and does not have 64-bit support.)
++#
++# $ sudo port install wxWidgets30 +aui +universal portaudio +universal sox +universal libsndfile +universal libsamplerate +universal
++# $ make -f Makefile.osx
++
++SVN_REVISION=$(shell svnversion)
++MACPORTS_FOLDER=/opt/local
++
++# Codec 2 -----------------------------------------------
++
++CODEC2=codec2
++CODEC2_INC=-I$(CODEC2)/src
++CODEC2_LIB=$(CODEC2)/src/.libs/libcodec2.a
++
++# FreeDV ------------------------------------------------
++
++CPP_FLAGS = -D_NO_AUTOTOOLS_ -I$(MACPORTS_FOLDER)/include -arch i386 `wx-config --cppflags` $(CODEC2_INC) -I. -g -Wall -O3 -DSVN_REVISION=\"$(SVN_REVISION)\"
++FREEDV_LIBS = -arch i386 -L$(MACPORTS_FOLDER)/lib `wx-config --libs all` -lportaudio $(CODEC2_LIB) -lm -lpthread -lsndfile -lsamplerate -lsox
++
++OBJS = topFrame.o \
++fdmdv2_main.o \
++fdmdv2_plot.o \
++fdmdv2_plot_scalar.o \
++fdmdv2_plot_scatter.o \
++fdmdv2_plot_spectrum.o \
++fdmdv2_plot_waterfall_linux.o \
++fdmdv2_pa_wrapper.o \
++dlg_audiooptions.o \
++dlg_comports.o \
++dlg_filter.o \
++varicode.o \
++sox_biquad.o \
++serialport.o
++
++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 serialport.h
++
++all: $(CODEC2)/.built freedv FreeDV.app
++
++freedv: $(OBJS)
++      g++ -o freedv $(OBJS) $(CPP_FLAGS) $(FREEDV_LIBS)
++
++FreeDV.app: info.plist freedv
++      -mkdir -p $@/Contents/MacOS
++      -mkdir -p $@/Contents/Resources/English.lproj
++      cp info.plist $@/Contents
++      echo -n "APPL????" > $@/Contents/PkgInfo
++      cp freedv $@/Contents/MacOS/FreeDV
++      
++%.o: %.cpp $(HDRS)
++      g++ $(CPP_FLAGS) -c $< -o $@
++
++sox_biquad.o: sox_biquad.c
++      gcc $(CPP_FLAGS) -c sox_biquad.c -o sox_biquad.o
++
++varicode.o: varicode.c
++      cc $(CPP_FLAGS) -c varicode.c -o varicode.o
++
++clean:
++      rm -f *.o fdmdv2 
++      rm -rf FreeDV.app/
++      
++clean-lib: clean
++      rm -Rf $(CODEC2)
++ 
++# Codec 2 ----------------------------------------------------------
++
++$(CODEC2)/.built: $(CODEC2)
++      cd $(CODEC2) && CPPFLAGS="-arch i386" LDFLAGS="-arch i386" ./configure && make && touch .built
++
++$(CODEC2):
++      svn co https://freetel.svn.sourceforge.net/svnroot/freetel/codec2
+\ No newline at end of file
+Index: src/Makefile.win32
+===================================================================
+--- src/Makefile.win32 (revision 1152)
++++ src/Makefile.win32 (working copy)
+@@ -16,7 +16,7 @@
+ CODEC2_LIB=$(CODEC2_PATH)/src/.libs/libcodec2.a
+ CPP_FLAGS = -D_NO_AUTOTOOLS_ -I$(INCLUDE_PATH) $(WX_CPPFLAGS) -I$(CODEC2_INC) -I../extern/include -g -Wall -DSVN_REVISION=\"$(SVN_REVISION)\"
+-LIBS = $(WX_LIBS) $(CODEC2_LIB) -lm -lportaudiocpp -lportaudio -lpthread -lsndfile -lsamplerate -lctb-0.16 -lsox
++LIBS = $(WX_LIBS) $(CODEC2_LIB) -lm -lportaudiocpp -lportaudio -lpthread -lsndfile -lsamplerate -lsox
+ OBJS = topFrame.o \
+ fdmdv2_main.o \
+@@ -30,9 +30,10 @@
+ dlg_comports.o \
+ dlg_filter.o \
+ varicode.o \
+-sox_biquad.o
++sox_biquad.o \
++serialport.o
+-HDRS = ../version.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 dlg_audiooptions.h topFrame.h varicode.h
++HDRS = ../version.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 dlg_audiooptions.h topFrame.h varicode.h serialport.h
+ all: freedv
+Index: src/Makefile.win32.dmw
+===================================================================
+--- src/Makefile.win32.dmw     (revision 1152)
++++ src/Makefile.win32.dmw     (working copy)
+@@ -40,10 +40,11 @@
+ dlg_comports.o \
+ dlg_filter.o \
+ varicode.o \
+-sox_biquad.o
++sox_biquad.o \
++serialport.o
+-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
++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 serialport.h
+ all: freedv
+Index: src/dlg_comports.cpp
+===================================================================
+--- src/dlg_comports.cpp       (revision 1152)
++++ src/dlg_comports.cpp       (working copy)
+@@ -21,7 +21,6 @@
+ //==========================================================================
+ #include "dlg_comports.h"
+ #include "fdmdv2_main.h"
+-#include <wx/msw/registry.h>
+ #include <sstream>
+ //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+@@ -62,8 +61,9 @@
+     wxArrayString m_listCtrlPortsArr;
+     m_listCtrlPorts = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxSize(-1,45), m_listCtrlPortsArr, wxLB_SINGLE | wxLB_SORT);
+     staticBoxSizer31->Add(m_listCtrlPorts, 1, wxALIGN_CENTER, 0);
+-#endif
+-#ifdef __WXGTK__
++#else
++/*#endif
++#ifdef __WXGTK__*/
+     wxBoxSizer* bSizer83;
+     bSizer83 = new wxBoxSizer(wxHORIZONTAL);
+Index: src/fdmdv2_main.cpp
+===================================================================
+--- src/fdmdv2_main.cpp        (revision 1152)
++++ src/fdmdv2_main.cpp        (working copy)
+@@ -163,7 +163,6 @@
+ {
+     m_zoom              = 1.;
+     m_serialPort        = NULL;
+-    m_device            = NULL;
+     
+     tools->AppendSeparator();
+     wxMenuItem* m_menuItemToolsConfigDelete;
+@@ -857,22 +856,22 @@
+             {
+                 if(wxGetApp().m_boolRTSPos) // RTS asserted HIGH
+                 {
+-                    m_serialPort->SetLineState(ctb::LinestateRts);
++                    m_serialPort->setRTS(true);
+                 }
+                 else                        // RTS asserted LOW
+                 {
+-                    m_serialPort->ClrLineState(ctb::LinestateRts);
++                    m_serialPort->setRTS(false);
+                 }
+             }
+             else                            // Use DTR
+             {
+                 if(wxGetApp().m_boolDTRPos) // DTR asserted HIGH
+                 {
+-                    m_serialPort->SetLineState(ctb::LinestateDtr);
++                    m_serialPort->setDTR(true);
+                 }
+                 else                        // DTR asserted LOW
+                 {
+-                    m_serialPort->ClrLineState(ctb::LinestateDtr);
++                    m_serialPort->setDTR(false);
+                 }
+             }
+         } 
+@@ -882,22 +881,22 @@
+             {
+                 if(wxGetApp().m_boolRTSPos) // RTS cleared LOW
+                 {
+-                    m_serialPort->ClrLineState(ctb::LinestateRts);
++                    m_serialPort->setRTS(false);
+                 }
+                 else                        // RTS cleared HIGH
+                 {
+-                    m_serialPort->SetLineState(ctb::LinestateRts);
++                    m_serialPort->setRTS(true);
+                 }
+             }
+             else                            // Use DTR
+             {
+                 if(wxGetApp().m_boolDTRPos) // DTR cleared LOW
+                 {
+-                    m_serialPort->ClrLineState(ctb::LinestateDtr);
++                    m_serialPort->setDTR(false);
+                 }
+                 else                        // DTR cleared HIGH
+                 {
+-                    m_serialPort->SetLineState(ctb::LinestateDtr);
++                    m_serialPort->setDTR(true);
+                 }
+             }
+         } 
+@@ -1351,13 +1350,15 @@
+ {
+     wxUnusedVar(event);
+     int rv = 0;
+-    int  iLineState  = 0;
++    bool rtsEnabled = false;
++    bool dtrEnabled = false;
+     //bool bPTTEnabled = m_btnTogPTT->IsEnabled();
+     //bool bPTTState   = m_btnTogPTT->GetValue();
+     if(m_serialPort != NULL)
+     {
+-        int iLineState   = m_serialPort->GetLineState();
++        rtsEnabled = m_serialPort->getRTS();
++        dtrEnabled = m_serialPort->getDTR();
+         CloseSerialPort();
+     }
+     ComPortsDlg *dlg = new ComPortsDlg(NULL);
+@@ -1372,21 +1373,21 @@
+         SetupSerialPort();
+         if(m_serialPort != NULL)
+         {
+-            if(iLineState | ctb::LinestateRts)
++            if(rtsEnabled)
+             {
+-                m_serialPort->SetLineState(ctb::LinestateRts);
++                m_serialPort->setRTS(true);
+             }
+             else
+             {
+-                m_serialPort->ClrLineState(ctb::LinestateRts);
++                m_serialPort->setRTS(false);
+             }
+-            if(iLineState | ctb::LinestateDtr)
++            if(dtrEnabled)
+             {
+-                m_serialPort->SetLineState(ctb::LinestateDtr);
++                m_serialPort->setDTR(true);
+             }
+             else
+             {
+-                m_serialPort->ClrLineState(ctb::LinestateDtr);
++                m_serialPort->setDTR(false);
+             }
+         // m_btnTogPTT->Enable(bPTTEnabled);
+         // m_btnTogPTT->SetValue(bPTTState);
+@@ -2631,26 +2632,25 @@
+     if(!wxGetApp().m_strRigCtrlPort.IsEmpty())
+     {
+         wxString protocol = wxGetApp().m_strRigCtrlDatabits + wxGetApp().m_strRigCtrlParity + wxGetApp().m_strRigCtrlStopbits;
+-        m_serialPort = new ctb::SerialPort();
+-        if(m_serialPort->Open(wxGetApp().m_strRigCtrlPort.c_str(), baudrate, protocol.c_str(), ctb::SerialPort::NoFlowControl ) >= 0 ) 
++        m_serialPort = new SerialPort(wxGetApp().m_strRigCtrlPort.ToAscii().data());
++        if(m_serialPort->open(/*baudrate, protocol.c_str()*/ ) >= 0 ) 
+         {
+-            m_device = m_serialPort;
+             //  always start with PTT cleared
+             if(wxGetApp().m_boolRTSPos) // RTS cleared LOW
+             {
+-                m_serialPort->ClrLineState(ctb::LinestateRts);
++                m_serialPort->setRTS(false);
+             }
+             else                        // RTS cleared HIGH
+             {
+-                m_serialPort->SetLineState(ctb::LinestateRts);
++                m_serialPort->setRTS(true);
+             }
+             if(wxGetApp().m_boolDTRPos) // DTR cleared LOW
+             {
+-                m_serialPort->ClrLineState(ctb::LinestateDtr);
++                m_serialPort->setDTR(false);
+             }
+             else                        // DTR cleared HIGH
+             {
+-                m_serialPort->SetLineState(ctb::LinestateDtr);
++                m_serialPort->setDTR(true);
+             }
+             //m_btnTogPTT->Enable(true);
+             m_btnTogPTT->SetValue(false);
+@@ -2658,7 +2658,6 @@
+         else
+         {
+             m_serialPort = NULL;
+-            m_device     = NULL;
+             //m_btnTogPTT->Disable();
+         }
+     }
+@@ -2675,11 +2674,10 @@
+ //----------------------------------------------------------------
+ void MainFrame::CloseSerialPort(void)
+ {
+-    if((m_serialPort != NULL) && m_serialPort->IsOpen())
++    if((m_serialPort != NULL) && m_serialPort->isOpen())
+     {
+-        m_serialPort->Close();
++        m_serialPort->close();
+         m_serialPort = NULL;
+-        m_device     = NULL; 
+         //m_btnTogPTT->SetLabel(wxT("PTT"));
+         //m_btnTogPTT->Enable(false);
+     }
+Index: src/fdmdv2_main.h
+===================================================================
+--- src/fdmdv2_main.h  (revision 1152)
++++ src/fdmdv2_main.h  (working copy)
+@@ -55,10 +55,7 @@
+ #include "codec2_fdmdv.h"
+ #include "codec2_fifo.h"
+-#include "ctb-0.16/ctb.h"
+-#include "ctb-0.16/portscan.h"
+-#include "ctb-0.16/serportx.h"
+-#include "ctb-0.16/serport.h"
++#include "serialport.h"
+ #include "topFrame.h"
+ #include "dlg_comports.h"
+@@ -353,8 +350,7 @@
+     protected:
+-        ctb::IOBase*            m_device;
+-        ctb::SerialPort*        m_serialPort;
++        SerialPort*             m_serialPort;
+         void setsnrBeta(bool snrSlow);
+Index: src/info.plist
+===================================================================
+--- src/info.plist     (revision 0)
++++ src/info.plist     (working copy)
+@@ -0,0 +1,34 @@
++<?xml version="1.0" encoding="UTF-8"?>
++<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
++<plist version="1.0">
++<dict>
++      <key>CFBundleDevelopmentRegion</key>
++      <string>en</string>
++      <key>CFBundleExecutable</key>
++      <string>freedv</string>
++      <key>CFBundleIconFile</key>
++      <string></string>
++      <key>CFBundleIdentifier</key>
++      <string>org.freedv.freedv</string>
++      <key>CFBundleInfoDictionaryVersion</key>
++      <string>6.0</string>
++      <key>CFBundleName</key>
++      <string>FreeDV</string>
++      <key>CFBundlePackageType</key>
++      <string>APPL</string>
++      <key>CFBundleShortVersionString</key>
++      <string>1.0</string>
++      <key>CFBundleSignature</key>
++      <string>????</string>
++      <key>CFBundleVersion</key>
++      <string>1</string>
++      <key>LSMinimumSystemVersion</key>
++      <string>10.5</string>
++      <key>NSHumanReadableCopyright</key>
++      <string>Copyright Â© 2012 FreeDV. All rights reserved.</string>
++      <!--<key>NSMainNibFile</key>
++      <string>MainMenu</string>-->
++      <key>NSPrincipalClass</key>
++      <string>NSApplication</string>
++</dict>
++</plist>
+\ No newline at end of file
+Index: src/serialport.cpp
+===================================================================
+--- src/serialport.cpp (revision 0)
++++ src/serialport.cpp (working copy)
+@@ -0,0 +1,207 @@
++//==========================================================================
++// Name:            serialport.cpp
++//
++// Purpose:         Serial port management.
++// Created:         Dec. 28, 2012
++// Authors:         Mooneer Salem
++// 
++// License:
++//
++//  This program is free software; you can redistribute it and/or modify
++//  it under the terms of the GNU General 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 License
++//  along with this program; if not, see <http://www.gnu.org/licenses/>.
++//
++//==========================================================================
++
++#ifndef WIN32
++#include <fcntl.h>
++#include <termios.h>
++#include <unistd.h>
++#include <sys/ioctl.h>
++#endif // !WIN32
++
++#include "serialport.h"
++
++#define ERROR_CONDITION (-1)
++#ifdef WIN32
++#define INVALID_FILE_DESCRIPTOR (INVALID_HANDLE_VALUE)
++#else
++#define INVALID_FILE_DESCRIPTOR (-1)
++#endif // WIN32
++
++SerialPort::SerialPort(const std::string &portName)
++    : _portName(portName)
++    , _fileDescriptor(INVALID_FILE_DESCRIPTOR)
++#ifdef WIN32
++    , _rtsEnabled(false)
++    , _dtrEnabled(false)
++#endif // WIN32
++{
++    // No action here until open() is called.
++}
++
++SerialPort::~SerialPort()
++{
++    // Close serial port if needed.
++    if (isOpen())
++    {
++        close();
++    }
++}
++
++#ifndef WIN32
++static int posixGetModemControlBits(const int fileDescriptor)
++{
++    int modemControlBits = 0;
++    
++    if (ioctl(fileDescriptor, TIOCMGET, &modemControlBits) == 0)
++    {
++        return modemControlBits;
++    }
++    else
++    {
++        return ERROR_CONDITION;
++    }
++}
++
++static int posixSetModemControlBits(const int fileDescriptor, int modemControlBits)
++{
++    if (ioctl(fileDescriptor, TIOCMSET, &modemControlBits) == 0)
++    {
++        return modemControlBits;
++    }
++    else
++    {
++        return ERROR_CONDITION;
++    }
++}
++#endif // !WIN32
++
++bool SerialPort::getRTS() const
++{
++#ifdef WIN32
++    // No way to get DTR/RTS directly from Windows, so we have to
++    // grab what the caller put in during a previous set*() call.
++    return _rtsEnabled;
++#else
++    int tmpbits = posixGetModemControlBits(_fileDescriptor);
++    if (tmpbits != ERROR_CONDITION)
++    {
++        return tmpbits & TIOCM_RTS;
++    }
++    else
++    {
++        return ERROR_CONDITION;
++    }
++#endif // WIN32
++}
++
++void SerialPort::setRTS(const bool newRTS)
++{
++#ifdef WIN32
++    if (newRTS)
++    {
++        EscapeCommFunction(_fileDescriptor, SETRTS);
++    }
++    else
++    {
++        EscapeCommFunction(_fileDescriptor, CLRRTS);
++    }
++    _rtsEnabled = newRTS;
++#else
++    int tmpbits = posixGetModemControlBits(_fileDescriptor);
++    if (tmpbits != ERROR_CONDITION)
++    {
++        if (newRTS) tmpbits |= TIOCM_RTS;
++        else tmpbits &= ~TIOCM_RTS;
++        posixSetModemControlBits(_fileDescriptor, tmpbits);
++    }
++#endif // WIN32
++}
++    
++bool SerialPort::getDTR() const
++{
++#ifdef WIN32
++    // No way to get DTR/RTS directly from Windows, so we have to
++    // grab what the caller put in during a previous set*() call.
++    return _dtrEnabled;
++#else
++    int tmpbits = posixGetModemControlBits(_fileDescriptor);
++    if (tmpbits != ERROR_CONDITION)
++    {
++        return tmpbits & TIOCM_DTR;
++    }
++    else
++    {
++        return ERROR_CONDITION;
++    }
++#endif // WIN32
++}
++
++void SerialPort::setDTR(const bool newDTR)
++{
++#ifdef WIN32
++    if (newDTR)
++    {
++        EscapeCommFunction(_fileDescriptor, SETDTR);
++    }
++    else
++    {
++        EscapeCommFunction(_fileDescriptor, CLRDTR);
++    }
++    _dtrEnabled = newDTR;
++#else
++    int tmpbits = posixGetModemControlBits(_fileDescriptor);
++    if (tmpbits != ERROR_CONDITION)
++    {
++        if (newDTR) tmpbits |= TIOCM_DTR;
++        else tmpbits &= ~TIOCM_DTR;
++        posixSetModemControlBits(_fileDescriptor, tmpbits);
++    }
++#endif // WIN32
++}
++    
++int SerialPort::open()
++{
++#ifdef WIN32
++    TCHAR portName[32];
++    _stprintf_s(portName, sizeof(portName)/sizeof(TCHAR), _T("\\\\.\\%s"), _portName.c_str());
++    
++    _fileDescriptor = CreateFile(
++        portName, 
++        GENERIC_READ | GENERIC_WRITE,
++        0, 
++        0, 
++        OPEN_EXISTING, 
++        FILE_FLAG_OVERLAPPED, 
++        0);
++#else
++    _fileDescriptor = ::open(_portName.c_str(), O_RDWR);
++#endif // WIN32
++
++    return (int)_fileDescriptor;
++}
++
++int SerialPort::close()
++{
++#ifdef WIN32
++    int rv = CloseHandle(_fileDescriptor);
++#else
++    int rv = ::close(_fileDescriptor);
++#endif // WIN32
++
++    _fileDescriptor = INVALID_FILE_DESCRIPTOR;
++    return rv;
++}
++    
++bool SerialPort::isOpen() const
++{
++    return _fileDescriptor != INVALID_FILE_DESCRIPTOR;
++}
+\ No newline at end of file
+Index: src/serialport.h
+===================================================================
+--- src/serialport.h   (revision 0)
++++ src/serialport.h   (working copy)
+@@ -0,0 +1,81 @@
++//==========================================================================
++// Name:            serialport.h
++//
++// Purpose:         Serial port management.
++// Created:         Dec. 28, 2012
++// Authors:         Mooneer Salem
++// 
++// License:
++//
++//  This program is free software; you can redistribute it and/or modify
++//  it under the terms of the GNU General 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 License
++//  along with this program; if not, see <http://www.gnu.org/licenses/>.
++//
++//==========================================================================
++
++#ifndef SERIAL_PORT_H
++#define SERIAL_PORT_H
++
++#ifdef WIN32
++#include <windows.h>
++#endif // WIN32
++
++#include <string>
++
++enum SerialPortParity
++{
++    NONE,
++    EVEN,
++    ODD
++};
++
++// Quick and dirty serial port class that supports the minimum necessary to
++// do PTT (for now). Can be extended later (send/receive data for CAT control, 
++// for example).
++class SerialPort
++{
++public:
++    // portName is a path to the serial port, in one of the following formats:
++    // OSX: /dev/tty.*
++    // Linux: /dev/ttyS*
++    // Windows: COM*:
++    SerialPort(const std::string &portName);
++    virtual ~SerialPort();
++    
++    bool getRTS() const;
++    void setRTS(const bool newRTS);
++    
++    bool getDTR() const;
++    void setDTR(const bool newDTR);
++    
++    int open();
++    int close();
++    
++    bool isOpen() const;
++    
++private:
++    const std::string _portName;
++    
++#ifdef WIN32
++    HANDLE _fileDescriptor;
++    
++    bool _rtsEnabled;
++    bool _dtrEnabled;
++#else
++    int _fileDescriptor;
++#endif // WIN32
++        
++    // Object should not be copied since there can be only one handle open
++    // per serial port. An attempt to use the copy constructor here, even
++    // implicitly, will result in a compile error due to the declaration below.
++    SerialPort(const SerialPort&);
++};
++
++#endif // SERIAL_PORT_H
+\ No newline at end of file
diff --git a/freedv/branches/0.97/obsolete/freedv_osx_port.patch.gz b/freedv/branches/0.97/obsolete/freedv_osx_port.patch.gz
new file mode 100644 (file)
index 0000000..107a9d6
Binary files /dev/null and b/freedv/branches/0.97/obsolete/freedv_osx_port.patch.gz differ
diff --git a/freedv/branches/0.97/src/CMakeLists.txt b/freedv/branches/0.97/src/CMakeLists.txt
new file mode 100644 (file)
index 0000000..080bebf
--- /dev/null
@@ -0,0 +1,49 @@
+set(FREEDV_SOURCES
+    dlg_about.cpp
+    dlg_audiooptions.cpp
+    dlg_filter.cpp
+    dlg_options.cpp
+    dlg_ptt.cpp
+    fdmdv2_main.cpp
+    fdmdv2_pa_wrapper.cpp
+    fdmdv2_plot.cpp
+    fdmdv2_plot_scalar.cpp
+    fdmdv2_plot_scatter.cpp
+    fdmdv2_plot_spectrum.cpp
+    fdmdv2_plot_waterfall.cpp
+    hamlib.cpp
+    topFrame.cpp
+    sox_biquad.c
+    varicode.c
+    comp.h
+    dlg_about.h
+    dlg_audiooptions.h
+    dlg_filter.h
+    dlg_options.h
+    dlg_ptt.h
+    fdmdv2_defines.h
+    fdmdv2_main.h
+    fdmdv2_pa_wrapper.h
+    fdmdv2_plot.h
+    fdmdv2_plot_scalar.h
+    fdmdv2_plot_scatter.h
+    fdmdv2_plot_spectrum.h
+    fdmdv2_plot_waterfall.h
+    hamlib.h
+    sox_biquad.h
+    sox.h
+    topFrame.h
+    varicode.h
+    varicode_table.h
+    version.h
+)
+
+# WIN32 is needed for Windows GUI apps and is ignored for UNIX like systems.
+add_executable(freedv WIN32 ${FREEDV_SOURCES} ${RES_FILES})
+target_link_libraries(freedv ${FREEDV_LINK_LIBS})
+include_directories(${CMAKE_CURRENT_SOURCE_DIR})
+if(FREEDV_STATIC_DEPS)
+    add_dependencies(freedv ${FREEDV_STATIC_DEPS})
+endif(FREEDV_STATIC_DEPS)
+install(TARGETS freedv
+    RUNTIME DESTINATION bin)
diff --git a/freedv/branches/0.97/src/comp.h b/freedv/branches/0.97/src/comp.h
new file mode 100644 (file)
index 0000000..a3a1bd9
--- /dev/null
@@ -0,0 +1,39 @@
+/*---------------------------------------------------------------------------*\
+
+  FILE........: comp.h
+  AUTHOR......: David Rowe
+  DATE CREATED: 24/08/09
+
+  Complex number definition.
+
+\*---------------------------------------------------------------------------*/
+
+/*
+  Copyright (C) 2009 David Rowe
+
+  All rights reserved.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU Lesser 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 Lesser General Public License
+  along with this program; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef __COMP__
+#define __COMP__
+
+/* Complex number */
+
+typedef struct
+{
+    float real;
+    float imag;
+} COMP;
+
+#endif
diff --git a/freedv/branches/0.97/src/credits.txt b/freedv/branches/0.97/src/credits.txt
new file mode 100644 (file)
index 0000000..2214b14
--- /dev/null
@@ -0,0 +1,8 @@
+Credits (code or ideas borrowed from):\r
+==============================================\r
+David Rowe (obviously)\r
+Mel Whitten\r
+Don Mak\r
+Steve Nance (K5FR)\r
+James Ahlstrom (Quisk)\r
+FLDIGI\r
diff --git a/freedv/branches/0.97/src/dlg_about.cpp b/freedv/branches/0.97/src/dlg_about.cpp
new file mode 100644 (file)
index 0000000..5680821
--- /dev/null
@@ -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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#include <wx/ffile.h>
+#include <wx/dcmemory.h>
+#include "dlg_about.h"\r
+//#include "contributers.h"\r
+
+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://svn.code.sf.net/p/freetel/code/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("<h2>p/freetel/code - Revision ");
+            int startIndex = htmldata.find(s) + s.Length();
+            int endIndex = htmldata.find(wxT(": /fdmdv2</h2>"));
+            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()
+{
+}
+/*\r
+AboutDlg::AboutDlg(wxWindow* parent, const wxString &mainTitle) : AboutDlgBase(parent)\r
+{
+    wxFileName splashscreen(ManagerST::Get()->GetStarupDirectory() +
+                            wxFileName::GetPathSeparator() + 
+                            wxT("images") + 
+                            wxFileName::GetPathSeparator() + 
+                            wxT("splashscreen.png"));
+\r
+    m_bmp.LoadFile(splashscreen.GetFullPath(), wxBITMAP_TYPE_PNG);\r
+    m_bitmap->SetBitmap(m_bmp);\r
+    GetSizer()->Fit(this);
+    
+    BitmapLoader bmpLoader;
+    m_bitmapPayPal->SetBitmap(bmpLoader.LoadBitmap(wxT("about/32/paypal")));
+    \r
+    // set the page content\r
+    m_htmlWin3->SetPage(wxString::FromUTF8(about_hex));\r
+    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();\r
+}\r
+\r
+AboutDlg::~AboutDlg()
+{
+}
+*/
+\r
+void AboutDlg::ExchangeData(int inout)\r
+{\r
+//    return m_staticTextInformation->GetLabelText();\r
+}
diff --git a/freedv/branches/0.97/src/dlg_about.h b/freedv/branches/0.97/src/dlg_about.h
new file mode 100644 (file)
index 0000000..ffdc12c
--- /dev/null
@@ -0,0 +1,72 @@
+//==========================================================================\r
+// Name:            dlg_about.h\r
+// Purpose:         Provides an 'about' dialog.\r
+// Created:         Dec 06, 2012\r
+// Authors:         David Rowe, David Witten\r
+// \r
+// License:\r
+//\r
+//  This program is free software; you can redistribute it and/or modify\r
+//  it under the terms of the GNU General Public License version 2.1,\r
+//  as published by the Free Software Foundation.  This program is\r
+//  distributed in the hope that it will be useful, but WITHOUT ANY\r
+//  WARRANTY; without even the implied warranty of MERCHANTABILITY or\r
+//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public\r
+//  License for more details.\r
+//\r
+//  You should have received a copy of the GNU General Public License\r
+//  along with this program; if not, see <http://www.gnu.org/licenses/>.\r
+//\r
+//==========================================================================\r
+#ifndef __AboutDlg__\r
+#define __AboutDlg__\r
+\r
+#include "fdmdv2_main.h"\r
+#include "wx/bitmap.h"\r
+#include <wx/xrc/xmlres.h>\r
+#include <wx/settings.h>\r
+#include <wx/font.h>
+#include <wx/colour.h>
+#include <wx/settings.h>
+#include <wx/sizer.h>
+#include <wx/panel.h>
+#include <wx/html/htmlwin.h>
+#include <wx/textctrl.h>
+#include <wx/notebook.h>
+#include <wx/stattext.h>
+#include <wx/hyperlink.h>
+#include <wx/statbox.h>
+#include <wx/button.h>
+#include <wx/dialog.h>
+#include <wx/bitmap.h>
+
+/** Implementing AboutDlg */\r
+class AboutDlg : public wxDialog\r
+{\r
+   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:\r
+        /** Constructor */\r
+        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();\r
+        void ExchangeData(int inout);\r
+};\r
+\r
+#endif // __AboutDlg__\r
diff --git a/freedv/branches/0.97/src/dlg_audiooptions.cpp b/freedv/branches/0.97/src/dlg_audiooptions.cpp
new file mode 100644 (file)
index 0000000..1c312ef
--- /dev/null
@@ -0,0 +1,1264 @@
+//=========================================================================
+// Name:            AudioOptsDialog.cpp
+// Purpose:         Implements an Audio options selection dialog.
+//
+// Authors:         David Rowe, David Witten
+// License:
+//
+//  All rights reserved.
+//
+//  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 <http://www.gnu.org/licenses/>.
+//
+//=========================================================================
+#include "fdmdv2_main.h"
+#include "dlg_audiooptions.h"
+
+// constants for test waveform plots
+
+#define TEST_WAVEFORM_X          180
+#define TEST_WAVEFORM_Y          180
+#define TEST_WAVEFORM_PLOT_TIME  2.0
+#define TEST_WAVEFORM_PLOT_FS    400
+#define TEST_BUF_SIZE           1024
+#define TEST_FS                 48000.0
+#define TEST_DT                 0.1      // time between plot updates in seconds
+#define TEST_WAVEFORM_PLOT_BUF  ((int)(DT*400))
+
+void AudioOptsDialog::Pa_Init(void)
+{
+    m_isPaInitialized = false;
+
+    if((pa_err = Pa_Initialize()) == paNoError)
+    {
+        m_isPaInitialized = true;
+    }
+    else
+    {
+        wxMessageBox(wxT("Port Audio failed to initialize"), wxT("Pa_Initialize"), wxOK);
+        return;
+    }
+}
+
+
+void AudioOptsDialog::buildTestControls(PlotScalar **plotScalar, wxButton **btnTest, 
+                                        wxPanel *parentPanel, wxBoxSizer *bSizer, wxString buttonLabel)
+{
+    wxBoxSizer* bSizer1 = new wxBoxSizer(wxVERTICAL);
+
+    wxPanel *panel = new wxPanel(parentPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0);
+    *plotScalar = new PlotScalar((wxFrame*) panel, 1, TEST_WAVEFORM_PLOT_TIME, 1.0/TEST_WAVEFORM_PLOT_FS, -1, 1, 1, 0.2, "", 1);
+    (*plotScalar)->SetClientSize(wxSize(TEST_WAVEFORM_X,TEST_WAVEFORM_Y));
+    bSizer1->Add(panel, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 8);
+
+    *btnTest = new wxButton(parentPanel, wxID_ANY, buttonLabel, wxDefaultPosition, wxDefaultSize);
+    bSizer1->Add(*btnTest, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 0);
+
+    bSizer->Add(bSizer1, 0, wxALIGN_CENTER_HORIZONTAL |wxALIGN_CENTER_VERTICAL );
+}
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// AudioOptsDialog()
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+AudioOptsDialog::AudioOptsDialog(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style)
+{
+    this->SetSizeHints(wxSize(850, 600), wxDefaultSize);
+
+    Pa_Init();
+
+    wxBoxSizer* mainSizer;
+    mainSizer = new wxBoxSizer(wxVERTICAL);
+    m_panel1 = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
+    wxBoxSizer* bSizer4;
+    bSizer4 = new wxBoxSizer(wxVERTICAL);
+    m_notebook1 = new wxNotebook(m_panel1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxNB_BOTTOM);
+    m_panelRx = new wxPanel(m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
+    wxBoxSizer* bSizer20;
+    bSizer20 = new wxBoxSizer(wxVERTICAL);
+    wxGridSizer* gSizer4;
+    gSizer4 = new wxGridSizer(2, 1, 0, 0);
+
+    // Rx In -----------------------------------------------------------------------
+
+    wxStaticBoxSizer* sbSizer2;
+    sbSizer2 = new wxStaticBoxSizer(new wxStaticBox(m_panelRx, wxID_ANY, _("From Radio")), wxHORIZONTAL);
+
+    wxBoxSizer* bSizer811a = new wxBoxSizer(wxVERTICAL);
+
+    m_listCtrlRxInDevices = new wxListCtrl(m_panelRx, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VRULES);
+    bSizer811a->Add(m_listCtrlRxInDevices, 1, wxALL|wxEXPAND, 1);
+
+    wxBoxSizer* bSizer811;
+    bSizer811 = new wxBoxSizer(wxHORIZONTAL);
+    m_staticText51 = new wxStaticText(m_panelRx, wxID_ANY, _("Device:"), wxDefaultPosition, wxDefaultSize, 0);
+    m_staticText51->Wrap(-1);
+    bSizer811->Add(m_staticText51, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5);
+    m_textCtrlRxIn = new wxTextCtrl(m_panelRx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
+    bSizer811->Add(m_textCtrlRxIn, 1, wxALIGN_CENTER_VERTICAL|wxALL, 1);
+    m_staticText6 = new wxStaticText(m_panelRx, wxID_ANY, _("Sample Rate:"), wxDefaultPosition, wxDefaultSize, 0);
+    m_staticText6->Wrap(-1);
+    bSizer811->Add(m_staticText6, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5);
+    m_cbSampleRateRxIn = new wxComboBox(m_panelRx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(90,-1), 0, NULL, wxCB_DROPDOWN);
+    bSizer811->Add(m_cbSampleRateRxIn, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1);
+
+    bSizer811a->Add(bSizer811, 0, wxEXPAND, 5);
+
+    sbSizer2->Add(bSizer811a, 1, wxEXPAND, 2);
+    buildTestControls(&m_plotScalarRxIn, &m_btnRxInTest, m_panelRx, sbSizer2, _("Rec 2s"));
+
+    gSizer4->Add(sbSizer2, 1, wxEXPAND, 5);
+
+    // Rx Out -----------------------------------------------------------------------
+
+    wxStaticBoxSizer* sbSizer3;
+    sbSizer3 = new wxStaticBoxSizer(new wxStaticBox(m_panelRx, wxID_ANY, _("To Speaker/Headphones")), wxHORIZONTAL);
+
+    wxBoxSizer* bSizer81a = new wxBoxSizer(wxVERTICAL);
+
+    m_listCtrlRxOutDevices = new wxListCtrl(m_panelRx, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VRULES);
+    bSizer81a->Add(m_listCtrlRxOutDevices, 1, wxALL|wxEXPAND, 1);
+
+    wxBoxSizer* bSizer81;
+    bSizer81 = new wxBoxSizer(wxHORIZONTAL);
+    m_staticText9 = new wxStaticText(m_panelRx, wxID_ANY, _("Device:"), wxDefaultPosition, wxDefaultSize, 0);
+    m_staticText9->Wrap(-1);
+    bSizer81->Add(m_staticText9, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
+    m_textCtrlRxOut = new wxTextCtrl(m_panelRx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
+    bSizer81->Add(m_textCtrlRxOut, 1, wxALIGN_CENTER_VERTICAL|wxALL, 1);
+    m_staticText10 = new wxStaticText(m_panelRx, wxID_ANY, _("Sample Rate:"), wxDefaultPosition, wxDefaultSize, 0);
+    m_staticText10->Wrap(-1);
+    bSizer81->Add(m_staticText10, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5);
+    m_cbSampleRateRxOut = new wxComboBox(m_panelRx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(90,-1), 0, NULL, wxCB_DROPDOWN);
+    bSizer81->Add(m_cbSampleRateRxOut, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1);
+
+    bSizer81a->Add(bSizer81, 0, wxEXPAND, 5);
+
+    sbSizer3->Add(bSizer81a, 1, wxEXPAND, 2);
+    buildTestControls(&m_plotScalarRxOut, &m_btnRxOutTest, m_panelRx, sbSizer3, _("Play 2s"));
+    gSizer4->Add(sbSizer3, 1, wxEXPAND, 2);
+    bSizer20->Add(gSizer4, 1, wxEXPAND, 1);
+    m_panelRx->SetSizer(bSizer20);
+    m_panelRx->Layout();
+    bSizer20->Fit(m_panelRx);
+    m_notebook1->AddPage(m_panelRx, _("Receive"), true);
+
+    // Tx Tab -------------------------------------------------------------------------------
+
+    m_panelTx = new wxPanel(m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
+    wxBoxSizer* bSizer18;
+    bSizer18 = new wxBoxSizer(wxVERTICAL);
+    wxGridSizer* gSizer2;
+    gSizer2 = new wxGridSizer(2, 1, 0, 0);
+
+    // Tx In ----------------------------------------------------------------------------------
+
+    wxStaticBoxSizer* sbSizer22;
+    sbSizer22 = new wxStaticBoxSizer(new wxStaticBox(m_panelTx, wxID_ANY, _("From Microphone")), wxHORIZONTAL);
+
+    wxBoxSizer* bSizer83a = new wxBoxSizer(wxVERTICAL);
+
+    m_listCtrlTxInDevices = new wxListCtrl(m_panelTx, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VRULES);
+    bSizer83a->Add(m_listCtrlTxInDevices, 1, wxALL|wxEXPAND, 1);
+    wxBoxSizer* bSizer83;
+    bSizer83 = new wxBoxSizer(wxHORIZONTAL);
+    m_staticText12 = new wxStaticText(m_panelTx, wxID_ANY, _("Device:"), wxDefaultPosition, wxDefaultSize, 0);
+    m_staticText12->Wrap(-1);
+    bSizer83->Add(m_staticText12, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5);
+    m_textCtrlTxIn = new wxTextCtrl(m_panelTx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
+    bSizer83->Add(m_textCtrlTxIn, 1, wxALIGN_CENTER_VERTICAL|wxALL, 1);
+    m_staticText11 = new wxStaticText(m_panelTx, wxID_ANY, _("Sample Rate:"), wxDefaultPosition, wxDefaultSize, 0);
+    m_staticText11->Wrap(-1);
+    bSizer83->Add(m_staticText11, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5);
+    m_cbSampleRateTxIn = new wxComboBox(m_panelTx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(90,-1), 0, NULL, wxCB_DROPDOWN);
+    bSizer83->Add(m_cbSampleRateTxIn, 0, wxALL, 1);
+
+    bSizer83a->Add(bSizer83, 0, wxEXPAND, 5);
+
+    sbSizer22->Add(bSizer83a, 1, wxEXPAND, 2);
+    buildTestControls(&m_plotScalarTxIn, &m_btnTxInTest, m_panelTx, sbSizer22, _("Rec 2s"));
+
+    gSizer2->Add(sbSizer22, 1, wxEXPAND, 5);
+
+    // Tx Out ----------------------------------------------------------------------------------
+
+    wxStaticBoxSizer* sbSizer21;
+    sbSizer21 = new wxStaticBoxSizer(new wxStaticBox(m_panelTx, wxID_ANY, _("To Radio")), wxHORIZONTAL);
+
+    wxBoxSizer* bSizer82a = new wxBoxSizer(wxVERTICAL);
+
+    m_listCtrlTxOutDevices = new wxListCtrl(m_panelTx, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VRULES);
+    bSizer82a->Add(m_listCtrlTxOutDevices, 1, wxALL|wxEXPAND, 2);
+    wxBoxSizer* bSizer82;
+    bSizer82 = new wxBoxSizer(wxHORIZONTAL);
+    m_staticText81 = new wxStaticText(m_panelTx, wxID_ANY, _("Device:"), wxDefaultPosition, wxDefaultSize, 0);
+    m_staticText81->Wrap(-1);
+    bSizer82->Add(m_staticText81, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
+    m_textCtrlTxOut = new wxTextCtrl(m_panelTx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
+    bSizer82->Add(m_textCtrlTxOut, 1, wxALIGN_CENTER_VERTICAL|wxALL, 1);
+    m_staticText71 = new wxStaticText(m_panelTx, wxID_ANY, _("Sample Rate:"), wxDefaultPosition, wxDefaultSize, 0);
+    m_staticText71->Wrap(-1);
+    bSizer82->Add(m_staticText71, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5);
+    m_cbSampleRateTxOut = new wxComboBox(m_panelTx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(90,-1), 0, NULL, wxCB_DROPDOWN);
+    bSizer82->Add(m_cbSampleRateTxOut, 0, wxALL, 1);
+
+    bSizer82a->Add(bSizer82, 0, wxEXPAND, 5);
+
+    sbSizer21->Add(bSizer82a, 1, wxEXPAND, 2);
+    buildTestControls(&m_plotScalarTxOut, &m_btnTxOutTest, m_panelTx, sbSizer21, _("Play 2s"));
+
+    gSizer2->Add(sbSizer21, 1, wxEXPAND, 5);
+    bSizer18->Add(gSizer2, 1, wxEXPAND, 1);
+    m_panelTx->SetSizer(bSizer18);
+    m_panelTx->Layout();
+    bSizer18->Fit(m_panelTx);
+    m_notebook1->AddPage(m_panelTx, _("Transmit"), false);
+
+    // API Tab -------------------------------------------------------------------
+
+    m_panelAPI = new wxPanel(m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
+    wxBoxSizer* bSizer12;
+    bSizer12 = new wxBoxSizer(wxHORIZONTAL);
+    wxGridSizer* gSizer31;
+    gSizer31 = new wxGridSizer(2, 1, 0, 0);
+    wxStaticBoxSizer* sbSizer1;
+    sbSizer1 = new wxStaticBoxSizer(new wxStaticBox(m_panelAPI, wxID_ANY, _("PortAudio")), wxVERTICAL);
+
+    wxGridSizer* gSizer3;
+    gSizer3 = new wxGridSizer(4, 2, 0, 0);
+
+    m_staticText7 = new wxStaticText(m_panelAPI, wxID_ANY, _("PortAudio Version String:"), wxDefaultPosition, wxDefaultSize, 0);
+    m_staticText7->Wrap(-1);
+    gSizer3->Add(m_staticText7, 1, wxALIGN_RIGHT|wxALL|wxALIGN_CENTER_VERTICAL, 10);
+    m_textStringVer = new wxStaticText(m_panelAPI, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
+    gSizer3->Add(m_textStringVer, 1, wxALIGN_LEFT|wxALL|wxALIGN_CENTER_VERTICAL, 10);
+
+    m_staticText8 = new wxStaticText(m_panelAPI, wxID_ANY, _("PortAudio Int Version:"), wxDefaultPosition, wxDefaultSize, 0);
+    m_staticText8->Wrap(-1);
+    gSizer3->Add(m_staticText8, 1, wxALIGN_RIGHT|wxALL|wxALIGN_CENTER_VERTICAL, 10);
+    m_textIntVer = new wxStaticText(m_panelAPI, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(45,-1), 0);
+    gSizer3->Add(m_textIntVer, 1, wxALIGN_LEFT|wxALL|wxALIGN_CENTER_VERTICAL, 10);
+
+    m_staticText5 = new wxStaticText(m_panelAPI, wxID_ANY, _("Device Count:"), wxDefaultPosition, wxDefaultSize, 0);
+    m_staticText5->Wrap(-1);
+    gSizer3->Add(m_staticText5, 1, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 10);
+    m_textCDevCount = new wxStaticText(m_panelAPI, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(45,-1), 0);
+    gSizer3->Add(m_textCDevCount, 1, wxALIGN_LEFT|wxALL|wxALIGN_CENTER_VERTICAL, 10);
+
+    m_staticText4 = new wxStaticText(m_panelAPI, wxID_ANY, _("API Count:"), wxDefaultPosition, wxDefaultSize, 0);
+    m_staticText4->Wrap(-1);
+    gSizer3->Add(m_staticText4, 1, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 10);
+    m_textAPICount = new wxStaticText(m_panelAPI, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(45,-1), 0);
+    m_textAPICount->SetMaxSize(wxSize(45,-1));
+    gSizer3->Add(m_textAPICount, 1, wxALIGN_LEFT|wxALL|wxALIGN_CENTER_VERTICAL, 10);
+
+    sbSizer1->Add(gSizer3, 1, wxEXPAND, 2);
+    gSizer31->Add(sbSizer1, 1, wxEXPAND, 2);
+    wxStaticBoxSizer* sbSizer6;
+    sbSizer6 = new wxStaticBoxSizer(new wxStaticBox(m_panelAPI, wxID_ANY, _("Other")), wxVERTICAL);
+    gSizer31->Add(sbSizer6, 1, wxEXPAND, 5);
+    bSizer12->Add(gSizer31, 1, wxEXPAND, 5);
+    m_panelAPI->SetSizer(bSizer12);
+    m_panelAPI->Layout();
+    bSizer12->Fit(m_panelAPI);
+    m_notebook1->AddPage(m_panelAPI, _("API Info"), false);
+    bSizer4->Add(m_notebook1, 1, wxEXPAND | wxALL, 0);
+    m_panel1->SetSizer(bSizer4);
+    m_panel1->Layout();
+    bSizer4->Fit(m_panel1);
+    mainSizer->Add(m_panel1, 1, wxEXPAND | wxALL, 1);
+
+    wxBoxSizer* bSizer6;
+    bSizer6 = new wxBoxSizer(wxHORIZONTAL);
+    m_btnRefresh = new wxButton(this, wxID_ANY, _("Refresh"), wxDefaultPosition, wxDefaultSize, 0);
+    bSizer6->Add(m_btnRefresh, 0, wxALIGN_CENTER|wxALL, 2);
+
+    m_sdbSizer1 = new wxStdDialogButtonSizer();
+
+    m_sdbSizer1OK = new wxButton(this, wxID_OK);
+    m_sdbSizer1->AddButton(m_sdbSizer1OK);
+
+    m_sdbSizer1Cancel = new wxButton(this, wxID_CANCEL);
+    m_sdbSizer1->AddButton(m_sdbSizer1Cancel);
+
+    m_sdbSizer1Apply = new wxButton(this, wxID_APPLY);
+    m_sdbSizer1->AddButton(m_sdbSizer1Apply);
+
+    m_sdbSizer1->Realize();
+
+    bSizer6->Add(m_sdbSizer1, 1, wxALIGN_CENTER_VERTICAL, 2);
+    mainSizer->Add(bSizer6, 0, wxEXPAND, 2);
+    this->SetSizer(mainSizer);
+    this->Layout();
+    this->Centre(wxBOTH);
+//    this->Centre(wxBOTH);
+
+    m_notebook1->SetSelection(0);
+
+    showAPIInfo();
+    m_RxInDevices.m_listDevices   = m_listCtrlRxInDevices;
+    m_RxInDevices.direction       = AUDIO_IN;
+    m_RxInDevices.m_textDevice    = m_textCtrlRxIn;
+    m_RxInDevices.m_cbSampleRate  = m_cbSampleRateRxIn;
+
+    m_RxOutDevices.m_listDevices  = m_listCtrlRxOutDevices;
+    m_RxOutDevices.direction      = AUDIO_OUT;
+    m_RxOutDevices.m_textDevice   = m_textCtrlRxOut;
+    m_RxOutDevices.m_cbSampleRate = m_cbSampleRateRxOut;
+
+    m_TxInDevices.m_listDevices   = m_listCtrlTxInDevices;
+    m_TxInDevices.direction       = AUDIO_IN;
+    m_TxInDevices.m_textDevice    = m_textCtrlTxIn;
+    m_TxInDevices.m_cbSampleRate  = m_cbSampleRateTxIn;
+
+    m_TxOutDevices.m_listDevices  = m_listCtrlTxOutDevices;
+    m_TxOutDevices.direction      = AUDIO_OUT;
+    m_TxOutDevices.m_textDevice   = m_textCtrlTxOut;
+    m_TxOutDevices.m_cbSampleRate = m_cbSampleRateTxOut;
+
+    populateParams(m_RxInDevices);
+    populateParams(m_RxOutDevices);
+    populateParams(m_TxInDevices);
+    populateParams(m_TxOutDevices);
+
+    m_listCtrlRxInDevices->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( AudioOptsDialog::OnRxInDeviceSelect ), NULL, this );
+    m_listCtrlRxOutDevices->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( AudioOptsDialog::OnRxOutDeviceSelect ), NULL, this );
+    m_listCtrlTxInDevices->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( AudioOptsDialog::OnTxInDeviceSelect ), NULL, this );
+    m_listCtrlTxOutDevices->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( AudioOptsDialog::OnTxOutDeviceSelect ), NULL, this );
+
+    // wire up test buttons
+    m_btnRxInTest->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnRxInTest ), NULL, this );
+    m_btnRxOutTest->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnRxOutTest ), NULL, this );
+    m_btnTxInTest->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnTxInTest ), NULL, this );
+    m_btnTxOutTest->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnTxOutTest ), NULL, this );
+
+    m_btnRefresh->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnRefreshClick ), NULL, this );
+    m_sdbSizer1Apply->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnApplyAudioParameters ), NULL, this );
+    m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnCancelAudioParameters ), NULL, this );
+    m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnOkAudioParameters ), NULL, this );
+/*
+        void OnClose( wxCloseEvent& event ) { event.Skip(); }
+        void OnHibernate( wxActivateEvent& event ) { event.Skip(); }
+        void OnIconize( wxIconizeEvent& event ) { event.Skip(); }
+        void OnInitDialog( wxInitDialogEvent& event ) { event.Skip(); }
+*/
+//    this->Connect(wxEVT_CLOSE_WINDOW, wxCloseEventHandler(AudioOptsDialog::OnClose));
+    this->Connect(wxEVT_HIBERNATE, wxActivateEventHandler(AudioOptsDialog::OnHibernate));
+    this->Connect(wxEVT_ICONIZE, wxIconizeEventHandler(AudioOptsDialog::OnIconize));
+    this->Connect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(AudioOptsDialog::OnInitDialog));
+}
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// ~AudioOptsDialog()
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+AudioOptsDialog::~AudioOptsDialog()
+{
+    Pa_Terminate();
+
+    // Disconnect Events
+    this->Disconnect(wxEVT_HIBERNATE, wxActivateEventHandler(AudioOptsDialog::OnHibernate));
+    this->Disconnect(wxEVT_ICONIZE, wxIconizeEventHandler(AudioOptsDialog::OnIconize));
+    this->Disconnect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(AudioOptsDialog::OnInitDialog));
+
+    m_listCtrlRxInDevices->Disconnect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(AudioOptsDialog::OnRxInDeviceSelect), NULL, this);
+    m_listCtrlRxOutDevices->Disconnect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(AudioOptsDialog::OnRxOutDeviceSelect), NULL, this);
+    m_listCtrlTxInDevices->Disconnect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(AudioOptsDialog::OnTxInDeviceSelect), NULL, this);
+    m_listCtrlTxOutDevices->Disconnect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(AudioOptsDialog::OnTxOutDeviceSelect), NULL, this);
+
+    m_btnRxInTest->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnRxInTest ), NULL, this );
+    m_btnRxOutTest->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnRxOutTest ), NULL, this );
+    m_btnTxInTest->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnTxInTest ), NULL, this );
+    m_btnTxOutTest->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnTxOutTest ), NULL, this );
+
+    m_btnRefresh->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AudioOptsDialog::OnRefreshClick), NULL, this);
+    m_sdbSizer1Apply->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AudioOptsDialog::OnApplyAudioParameters), NULL, this);
+    m_sdbSizer1Cancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AudioOptsDialog::OnCancelAudioParameters), NULL, this);
+    m_sdbSizer1OK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AudioOptsDialog::OnOkAudioParameters), NULL, this);
+
+}
+
+//-------------------------------------------------------------------------
+// OnInitDialog()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnInitDialog( wxInitDialogEvent& event )
+{
+    ExchangeData(EXCHANGE_DATA_IN);
+}
+
+//-------------------------------------------------------------------------
+// OnInitDialog()
+//
+// helper function to look up name of devNum, and if it exists write
+// name to textCtrl.  Used to trap dissapearing devices.
+//-------------------------------------------------------------------------
+int AudioOptsDialog::setTextCtrlIfDevNumValid(wxTextCtrl *textCtrl, wxListCtrl *listCtrl, int devNum)
+{
+    int i, aDevNum, found_devNum;
+
+    // ignore last list entry as it is the "none" entry
+
+    found_devNum = 0;
+    for(i=0; i<listCtrl->GetItemCount()-1; i++) {
+        aDevNum = wxAtoi(listCtrl->GetItemText(i, 1));
+        //printf("aDevNum: %d devNum: %d\n", aDevNum, devNum);
+        if (aDevNum == devNum) {
+            found_devNum = 1;
+            textCtrl->SetValue(listCtrl->GetItemText(i, 0) + " (" + wxString::Format(wxT("%i"),devNum) + ")");
+            printf("setting focus of %d\n", i);
+            listCtrl->SetItemState(i, wxLIST_STATE_FOCUSED, wxLIST_STATE_FOCUSED);
+        }
+    }
+
+    if (found_devNum) 
+        return devNum;
+    else {
+        textCtrl->SetValue("none");
+        return -1;
+    }
+}
+
+//-------------------------------------------------------------------------
+// ExchangeData()
+//-------------------------------------------------------------------------
+int AudioOptsDialog::ExchangeData(int inout)
+{
+    if(inout == EXCHANGE_DATA_IN)
+    {
+        // Map sound card device numbers to tx/rx device numbers depending
+        // on number of sound cards in use
+
+        printf("EXCHANGE_DATA_IN:\n");
+        printf("  g_nSoundCards: %d\n", g_nSoundCards);
+        printf("  g_soundCard1InDeviceNum: %d\n", g_soundCard1InDeviceNum);
+        printf("  g_soundCard1OutDeviceNum: %d\n", g_soundCard1OutDeviceNum);
+        printf("  g_soundCard1SampleRate: %d\n", g_soundCard1SampleRate);
+        printf("  g_soundCard2InDeviceNum: %d\n", g_soundCard2InDeviceNum);
+        printf("  g_soundCard2OutDeviceNum: %d\n", g_soundCard2OutDeviceNum);
+        printf("  g_soundCard2SampleRate: %d\n", g_soundCard2SampleRate);
+
+        if (g_nSoundCards == 0) {
+            m_textCtrlRxIn ->SetValue("none"); rxInAudioDeviceNum  = -1;
+            m_textCtrlRxOut->SetValue("none"); rxOutAudioDeviceNum = -1;
+            m_textCtrlTxIn ->SetValue("none"); txInAudioDeviceNum  = -1;
+            m_textCtrlTxOut->SetValue("none"); txOutAudioDeviceNum = -1;           
+        }
+
+        if (g_nSoundCards == 1) {
+            rxInAudioDeviceNum  = setTextCtrlIfDevNumValid(m_textCtrlRxIn, 
+                                                           m_listCtrlRxInDevices, 
+                                                           g_soundCard1InDeviceNum);
+
+            rxOutAudioDeviceNum = setTextCtrlIfDevNumValid(m_textCtrlRxOut, 
+                                                           m_listCtrlRxOutDevices, 
+                                                           g_soundCard1OutDeviceNum);
+
+            if ((rxInAudioDeviceNum != -1) && (rxInAudioDeviceNum != -1)) {
+                m_cbSampleRateRxIn->SetValue(wxString::Format(wxT("%i"),g_soundCard1SampleRate));
+                m_cbSampleRateRxOut->SetValue(wxString::Format(wxT("%i"),g_soundCard1SampleRate));
+            }
+
+            m_textCtrlTxIn ->SetValue("none"); txInAudioDeviceNum  = -1;
+            m_textCtrlTxOut->SetValue("none"); txOutAudioDeviceNum = -1;           
+        }
+
+        if (g_nSoundCards == 2) {
+            rxInAudioDeviceNum  = setTextCtrlIfDevNumValid(m_textCtrlRxIn, 
+                                                           m_listCtrlRxInDevices, 
+                                                           g_soundCard1InDeviceNum);
+
+            rxOutAudioDeviceNum = setTextCtrlIfDevNumValid(m_textCtrlRxOut, 
+                                                           m_listCtrlRxOutDevices, 
+                                                           g_soundCard2OutDeviceNum);
+
+            txInAudioDeviceNum  = setTextCtrlIfDevNumValid(m_textCtrlTxIn, 
+                                                           m_listCtrlTxInDevices, 
+                                                           g_soundCard2InDeviceNum);
+
+            txOutAudioDeviceNum = setTextCtrlIfDevNumValid(m_textCtrlTxOut, 
+                                                           m_listCtrlTxOutDevices, 
+                                                           g_soundCard1OutDeviceNum);
+
+            if ((rxInAudioDeviceNum != -1) && (txOutAudioDeviceNum != -1)) {
+                m_cbSampleRateRxIn->SetValue(wxString::Format(wxT("%i"),g_soundCard1SampleRate));
+                m_cbSampleRateTxOut->SetValue(wxString::Format(wxT("%i"),g_soundCard1SampleRate));
+            }
+
+            if ((txInAudioDeviceNum != -1) && (rxOutAudioDeviceNum != -1)) {
+                m_cbSampleRateTxIn->SetValue(wxString::Format(wxT("%i"),g_soundCard2SampleRate));
+                m_cbSampleRateRxOut->SetValue(wxString::Format(wxT("%i"),g_soundCard2SampleRate));
+            }
+        }
+        printf("  rxInAudioDeviceNum: %d\n  rxOutAudioDeviceNum: %d\n  txInAudioDeviceNum: %d\n  txOutAudioDeviceNum: %d\n",
+               rxInAudioDeviceNum, rxOutAudioDeviceNum, txInAudioDeviceNum, txOutAudioDeviceNum);
+    }
+
+    if(inout == EXCHANGE_DATA_OUT)
+    {
+        int valid_one_card_config = 0;
+        int valid_two_card_config = 0;
+        wxString sampleRate1, sampleRate2;
+
+        printf("EXCHANGE_DATA_OUT:\n");
+        printf("  rxInAudioDeviceNum: %d\n  rxOutAudioDeviceNum: %d\n  txInAudioDeviceNum: %d\n  txOutAudioDeviceNum: %d\n",
+               rxInAudioDeviceNum, rxOutAudioDeviceNum, txInAudioDeviceNum, txOutAudioDeviceNum);
+
+        // ---------------------------------------------------------------
+        // check we have a valid 1 or 2 sound card configuration
+        // ---------------------------------------------------------------
+
+        // one sound card config, tx device numbers should be set to -1 
+
+        if ((rxInAudioDeviceNum != -1) && (rxOutAudioDeviceNum != -1) &&
+            (txInAudioDeviceNum == -1) && (txOutAudioDeviceNum == -1)) {
+            valid_one_card_config = 1; 
+
+            // in and out sample rate must be the same, as there is one callback
+            
+            sampleRate1 = m_cbSampleRateRxIn->GetValue();
+            if (!sampleRate1.IsSameAs(m_cbSampleRateRxOut->GetValue())) {
+                wxMessageBox(wxT("With a single sound card the Sample Rate of "
+                                 "From Radio and To Speaker/Headphones must be the same."), wxT(""), wxOK);
+                return -1;
+            }
+        }
+
+        // two card configuration
+
+        if ((rxInAudioDeviceNum != -1) && (rxOutAudioDeviceNum != -1) &&
+            (txInAudioDeviceNum != -1) && (txOutAudioDeviceNum != -1)) {
+
+            valid_two_card_config = 1; 
+
+            // Check we haven't doubled up on sound devices
+
+            if (rxInAudioDeviceNum == txInAudioDeviceNum) {
+                wxMessageBox(wxT("You must use different devices for From Radio and From Microphone"), wxT(""), wxOK);
+                return -1;
+            }
+
+            if (rxOutAudioDeviceNum == txOutAudioDeviceNum) {
+                wxMessageBox(wxT("You must use different devices for To Radio and To Speaker/Headphones"), wxT(""), wxOK);
+                return -1;
+            }
+
+            // Check sample rates for callback 1 devices are the same,
+            // as input and output are handled synchronously by one
+            // portaudio callback
+            
+            sampleRate1 = m_cbSampleRateRxIn->GetValue();
+            if (!sampleRate1.IsSameAs(m_cbSampleRateTxOut->GetValue())) {
+                wxMessageBox(wxT("With two sound cards the Sample Rate "
+                                 "of From Radio and To Radio must be the same."), wxT(""), wxOK);
+                return -1;
+            }
+            // check sample rate for callback 2 devices is the same
+
+            sampleRate2 = m_cbSampleRateTxIn->GetValue();
+            if (!sampleRate2.IsSameAs(m_cbSampleRateRxOut->GetValue())) {
+                wxMessageBox(wxT("With two sound cards the Sample Rate of "
+                                 "From Microphone and To Speaker/Headphones must be the same."), wxT(""), wxOK);
+                return -1;
+            }
+        }
+
+        printf("  valid_one_card_config: %d  valid_two_card_config: %d\n", valid_one_card_config, valid_two_card_config);
+
+        if (!valid_one_card_config && !valid_two_card_config) {
+            wxMessageBox(wxT("Invalid one or two sound card configuration"), wxT(""), wxOK);
+            return -1;
+        }
+
+        // ---------------------------------------------------------------
+        // Map Rx/TX device numbers to sound card device numbers used
+        // in callbacks. Portaudio uses one callback per sound card so
+        // we have to be soundcard oriented at run time rather than
+        // Tx/Rx oriented as in this dialog.
+        // ---------------------------------------------------------------
+        g_nSoundCards = 0;
+        g_soundCard1InDeviceNum = g_soundCard1OutDeviceNum = g_soundCard2InDeviceNum = g_soundCard2OutDeviceNum = -1;
+
+        if (valid_one_card_config) {
+
+            // Only callback 1 used
+
+            g_nSoundCards = 1;
+            g_soundCard1InDeviceNum  = rxInAudioDeviceNum;
+            g_soundCard1OutDeviceNum = rxOutAudioDeviceNum;
+            g_soundCard1SampleRate = wxAtoi(sampleRate1);
+        }
+
+        if (valid_two_card_config) {
+            g_nSoundCards = 2;
+            g_soundCard1InDeviceNum  = rxInAudioDeviceNum;
+            g_soundCard1OutDeviceNum = txOutAudioDeviceNum;
+            g_soundCard1SampleRate   = wxAtoi(sampleRate1);
+            g_soundCard2InDeviceNum  = txInAudioDeviceNum;
+            g_soundCard2OutDeviceNum = rxOutAudioDeviceNum;
+            g_soundCard2SampleRate   = wxAtoi(sampleRate2);
+        }
+
+        printf("  g_nSoundCards: %d\n", g_nSoundCards);
+        printf("  g_soundCard1InDeviceNum: %d\n", g_soundCard1InDeviceNum);
+        printf("  g_soundCard1OutDeviceNum: %d\n", g_soundCard1OutDeviceNum);
+        printf("  g_soundCard1SampleRate: %d\n", g_soundCard1SampleRate);
+        printf("  g_soundCard2InDeviceNum: %d\n", g_soundCard2InDeviceNum);
+        printf("  g_soundCard2OutDeviceNum: %d\n", g_soundCard2OutDeviceNum);
+        printf("  g_soundCard2SampleRate: %d\n", g_soundCard2SampleRate);
+
+        wxConfigBase *pConfig = wxConfigBase::Get();
+        pConfig->Write(wxT("/Audio/soundCard1InDeviceNum"),       g_soundCard1InDeviceNum);
+        pConfig->Write(wxT("/Audio/soundCard1OutDeviceNum"),      g_soundCard1OutDeviceNum);
+        pConfig->Write(wxT("/Audio/soundCard1SampleRate"),        g_soundCard1SampleRate );
+
+        pConfig->Write(wxT("/Audio/soundCard2InDeviceNum"),       g_soundCard2InDeviceNum);
+        pConfig->Write(wxT("/Audio/soundCard2OutDeviceNum"),      g_soundCard2OutDeviceNum);
+        pConfig->Write(wxT("/Audio/soundCard2SampleRate"),        g_soundCard2SampleRate );
+
+        pConfig->Flush();
+        delete wxConfigBase::Set((wxConfigBase *) NULL);
+    }
+
+    return 0;
+}
+
+//-------------------------------------------------------------------------
+// buildListOfSupportedSampleRates()
+//-------------------------------------------------------------------------
+int AudioOptsDialog:: buildListOfSupportedSampleRates(wxComboBox *cbSampleRate, int devNum, int in_out)
+{
+    // every sound device has a different list of supported sample rates, so
+    // we work out which ones are supported and populate the list ctrl
+
+    static double standardSampleRates[] =
+    {
+        8000.0,     9600.0,
+        11025.0,    12000.0,
+        16000.0,    22050.0,
+        24000.0,    32000.0,
+        44100.0,    48000.0,
+        88200.0,    96000.0,
+        192000.0,   -1          // negative terminated  list
+    };
+
+    const PaDeviceInfo  *deviceInfo;
+    PaStreamParameters   inputParameters, outputParameters;
+    PaError              err;
+    wxString             str;
+    int                  i, numSampleRates;
+
+    deviceInfo = Pa_GetDeviceInfo(devNum);
+    if (deviceInfo == NULL) {
+        printf("Pa_GetDeviceInfo(%d) failed!\n", devNum);
+        cbSampleRate->Clear();
+        return 0;
+    }
+
+    inputParameters.device = devNum;
+    inputParameters.channelCount = deviceInfo->maxInputChannels;
+    inputParameters.sampleFormat = paInt16;
+    inputParameters.suggestedLatency = 0;
+    inputParameters.hostApiSpecificStreamInfo = NULL;
+        
+    outputParameters.device = devNum;
+    outputParameters.channelCount = deviceInfo->maxOutputChannels;
+    outputParameters.sampleFormat = paInt16;
+    outputParameters.suggestedLatency = 0;
+    outputParameters.hostApiSpecificStreamInfo = NULL;
+    
+    cbSampleRate->Clear();
+    //printf("devNum %d supports: ", devNum);
+    numSampleRates = 0;
+    for(i = 0; standardSampleRates[i] > 0; i++)
+    {      
+        if (in_out == AUDIO_IN)
+            err = Pa_IsFormatSupported(&inputParameters, NULL, standardSampleRates[i]);
+        else
+            err = Pa_IsFormatSupported(NULL, &outputParameters, standardSampleRates[i]);
+
+        if( err == paFormatIsSupported ) {
+            str.Printf("%i", (int)standardSampleRates[i]);
+            cbSampleRate->AppendString(str);
+            printf("%i ", (int)standardSampleRates[i]);
+            numSampleRates++;
+        }
+    }
+    printf("\n");
+
+    return numSampleRates;
+}
+
+//-------------------------------------------------------------------------
+// showAPIInfo()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::showAPIInfo()
+{
+    wxString    strval;
+    int         apiVersion;
+    int         apiCount        = 0;
+    int         numDevices      = 0;
+
+    strval = Pa_GetVersionText();
+    m_textStringVer->SetLabel(strval);
+
+    apiVersion = Pa_GetVersion();
+    strval.Printf(wxT("%d"), apiVersion);
+    m_textIntVer->SetLabel(strval);
+
+    apiCount = Pa_GetHostApiCount();
+    strval.Printf(wxT("%d"), apiCount);
+    m_textAPICount->SetLabel(strval);
+
+    numDevices = Pa_GetDeviceCount();
+    strval.Printf(wxT("%d"), numDevices);
+    m_textCDevCount->SetLabel(strval);
+}
+
+//-------------------------------------------------------------------------
+// populateParams()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::populateParams(AudioInfoDisplay ai)
+{
+    const       PaDeviceInfo *deviceInfo = NULL;
+    wxListCtrl* ctrl    = ai.m_listDevices;
+    int         in_out  = ai.direction;
+    long        idx;
+    int         numDevices;
+    wxListItem  listItem;
+    wxString    buf;
+    int         devn;
+    int         col = 0;
+
+    numDevices = Pa_GetDeviceCount();
+
+    if(ctrl->GetColumnCount() > 0)
+    {
+        ctrl->ClearAll();
+    }
+
+    listItem.SetAlign(wxLIST_FORMAT_LEFT);
+    listItem.SetText(wxT("Device"));
+    idx = ctrl->InsertColumn(col, listItem);
+    ctrl->SetColumnWidth(col++, 300);
+
+    listItem.SetAlign(wxLIST_FORMAT_CENTRE);
+    listItem.SetText(wxT("ID"));
+    idx = ctrl->InsertColumn(col, listItem);
+    ctrl->SetColumnWidth(col++, 45);
+
+    listItem.SetAlign(wxLIST_FORMAT_LEFT);
+    listItem.SetText(wxT("API"));
+    idx = ctrl->InsertColumn(col, listItem);
+    ctrl->SetColumnWidth(col++, 100);
+
+    if(in_out == AUDIO_IN)
+    {
+        listItem.SetAlign(wxLIST_FORMAT_CENTRE);
+        listItem.SetText(wxT("Default Sample Rate"));
+        idx = ctrl->InsertColumn(col, listItem);
+        ctrl->SetColumnWidth(col++, 160);
+    }
+    else if(in_out == AUDIO_OUT)
+    {
+        listItem.SetAlign(wxLIST_FORMAT_CENTRE);
+        listItem.SetText(wxT("Default Sample Rate"));
+        idx = ctrl->InsertColumn(col, listItem);
+        ctrl->SetColumnWidth(col++, 160);
+    }
+
+    #ifdef LATENCY
+    listItem.SetAlign(wxLIST_FORMAT_CENTRE);
+    listItem.SetText(wxT("Min Latency"));
+    ctrl->InsertColumn(col, listItem);
+    ctrl->SetColumnWidth(col++, 100);
+
+    listItem.SetAlign(wxLIST_FORMAT_CENTRE);
+    listItem.SetText(wxT("Max Latency"));
+    ctrl->InsertColumn(col, listItem);
+    ctrl->SetColumnWidth(col++, 100);
+    #endif
+
+    for(devn = 0; devn < numDevices; devn++)
+    {
+        buf.Printf(wxT(""));
+        deviceInfo = Pa_GetDeviceInfo(devn);
+        if( ((in_out == AUDIO_IN) && (deviceInfo->maxInputChannels > 0)) ||
+            ((in_out == AUDIO_OUT) && (deviceInfo->maxOutputChannels > 0)))
+        {
+            col = 0;
+            buf.Printf(wxT("%s"), deviceInfo->name);
+            idx = ctrl->InsertItem(ctrl->GetItemCount(), buf);
+            col++;
+                
+            buf.Printf(wxT("%d"), devn);
+            ctrl->SetItem(idx, col++, buf);
+
+            buf.Printf(wxT("%s"), Pa_GetHostApiInfo(deviceInfo->hostApi)->name);
+            ctrl->SetItem(idx, col++, buf);
+
+            buf.Printf(wxT("%i"), (int)deviceInfo->defaultSampleRate);
+            ctrl->SetItem(idx, col++, buf);
+
+            #ifdef LATENCY
+            if (in_out == AUDIO_IN)
+                buf.Printf(wxT("%8.4f"), deviceInfo->defaultLowInputLatency);
+            else
+                buf.Printf(wxT("%8.4f"), deviceInfo->defaultLowOutputLatency);               
+            ctrl->SetItem(idx, col++, buf);
+
+            if (in_out == AUDIO_IN)
+                buf.Printf(wxT("%8.4f"), deviceInfo->defaultHighInputLatency);
+            else
+                 buf.Printf(wxT("%8.4f"), deviceInfo->defaultHighOutputLatency);             
+            ctrl->SetItem(idx, col++, buf);
+            #endif
+        }        
+    }
+
+    // add "none" option at end
+
+    buf.Printf(wxT("%s"), "none");
+    idx = ctrl->InsertItem(ctrl->GetItemCount(), buf);
+}
+
+//-------------------------------------------------------------------------
+// OnDeviceSelect()
+//
+// helper function to set up "Device:" and "Sample Rate:" fields when
+// we click on a line in the list of devices box
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnDeviceSelect(wxComboBox *cbSampleRate, 
+                                     wxTextCtrl *textCtrl, 
+                                     int        *devNum, 
+                                     wxListCtrl *listCtrlDevices, 
+                                     int         index,
+                                     int         in_out)
+{
+
+    wxString devName = listCtrlDevices->GetItemText(index, 0);
+     if (devName.IsSameAs("none")) {
+        *devNum = -1;
+        textCtrl->SetValue("none");
+    }
+    else {
+        *devNum = wxAtoi(listCtrlDevices->GetItemText(index, 1));
+        textCtrl->SetValue(devName + " (" + wxString::Format(wxT("%i"),*devNum) + ")");
+
+        int numSampleRates = buildListOfSupportedSampleRates(cbSampleRate, *devNum, in_out);
+        if (numSampleRates) {
+            wxString defSampleRate = listCtrlDevices->GetItemText(index, 3);        
+            cbSampleRate->SetValue(defSampleRate);
+        }
+        else {
+             cbSampleRate->SetValue("None");           
+        }
+    }
+}
+
+//-------------------------------------------------------------------------
+// OnRxInDeviceSelect()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnRxInDeviceSelect(wxListEvent& evt)
+{
+    OnDeviceSelect(m_cbSampleRateRxIn, 
+                   m_textCtrlRxIn, 
+                   &rxInAudioDeviceNum, 
+                   m_listCtrlRxInDevices, 
+                   evt.GetIndex(),
+                   AUDIO_IN);
+}
+
+//-------------------------------------------------------------------------
+// OnRxOutDeviceSelect()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnRxOutDeviceSelect(wxListEvent& evt)
+{
+    OnDeviceSelect(m_cbSampleRateRxOut, 
+                   m_textCtrlRxOut, 
+                   &rxOutAudioDeviceNum, 
+                   m_listCtrlRxOutDevices, 
+                   evt.GetIndex(),
+                   AUDIO_OUT);
+}
+
+//-------------------------------------------------------------------------
+// OnTxInDeviceSelect()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnTxInDeviceSelect(wxListEvent& evt)
+{
+    OnDeviceSelect(m_cbSampleRateTxIn, 
+                   m_textCtrlTxIn, 
+                   &txInAudioDeviceNum, 
+                   m_listCtrlTxInDevices, 
+                   evt.GetIndex(),
+                   AUDIO_IN);
+}
+
+//-------------------------------------------------------------------------
+// OnTxOutDeviceSelect()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnTxOutDeviceSelect(wxListEvent& evt)
+{
+    OnDeviceSelect(m_cbSampleRateTxOut, 
+                   m_textCtrlTxOut, 
+                   &txOutAudioDeviceNum, 
+                   m_listCtrlTxOutDevices, 
+                   evt.GetIndex(),
+                   AUDIO_OUT);
+}
+
+//-------------------------------------------------------------------------
+// plotDeviceInputForAFewSecs()
+//
+// opens a record device and plots the input speech for a few seconds.  This is "modal" using
+// synchronous portaudio functions, so the GUI will not respond until after test sample has been
+// taken
+//-------------------------------------------------------------------------
+void AudioOptsDialog::plotDeviceInputForAFewSecs(int devNum, PlotScalar *plotScalar) {
+    PaStreamParameters  inputParameters;
+    const PaDeviceInfo *deviceInfo = NULL;
+    PaStream           *stream = NULL;
+    PaError             err;
+    short               in48k_stereo_short[2*TEST_BUF_SIZE];
+    short               in48k_short[TEST_BUF_SIZE];
+    short               in8k_short[TEST_BUF_SIZE];
+    int                 numDevices, nBufs, i, j, src_error,inputChannels;
+    float               t;
+    SRC_STATE          *src;
+    FIFO               *fifo;
+
+    // a basic sanity check
+    numDevices = Pa_GetDeviceCount();
+    if (devNum >= numDevices)
+        return;
+    if (devNum < 0)
+        return;
+    printf("devNum %d\n", devNum);
+
+    fifo = fifo_create((int)(DT*TEST_WAVEFORM_PLOT_FS*2)); assert(fifo != NULL);
+    src = src_new(SRC_SINC_FASTEST, 1, &src_error); assert(src != NULL);
+
+    // work out how many input channels this device supports.
+
+    deviceInfo = Pa_GetDeviceInfo(devNum);
+    if (deviceInfo == NULL) {
+        wxMessageBox(wxT("Couldn't get device info from Port Audio for Sound Card "), wxT("Error"), wxOK);
+        return;
+    }
+    if (deviceInfo->maxInputChannels == 1)
+        inputChannels = 1;
+    else
+        inputChannels = 2;
+
+    // open device
+
+    inputParameters.device = devNum;
+    inputParameters.channelCount = inputChannels;
+    inputParameters.sampleFormat = paInt16;
+    inputParameters.suggestedLatency = Pa_GetDeviceInfo( inputParameters.device )->defaultHighInputLatency;
+    inputParameters.hostApiSpecificStreamInfo = NULL;
+
+    nBufs = TEST_WAVEFORM_PLOT_TIME*TEST_FS/TEST_BUF_SIZE;
+    printf("inputChannels: %d nBufs %d\n", inputChannels, nBufs);
+
+    err = Pa_OpenStream(
+              &stream,
+              &inputParameters,
+              NULL,
+              TEST_FS,
+              TEST_BUF_SIZE,
+              paClipOff,    
+              NULL,       // no callback, use blocking API
+              NULL ); 
+    if (err != paNoError) {
+        wxMessageBox(wxT("Couldn't initialise sound device."), wxT("Error"), wxOK);       
+        return;
+    }
+
+    err = Pa_StartStream(stream);
+    if (err != paNoError) {
+        wxMessageBox(wxT("Couldn't start sound device."), wxT("Error"), wxOK);       
+        return;
+    }
+
+    for(i=0, t=0.0; i<nBufs; i++, t+=(float)TEST_BUF_SIZE/TEST_FS) {
+        Pa_ReadStream(stream, in48k_stereo_short, TEST_BUF_SIZE);
+        if (inputChannels == 2) {
+            for(j=0; j<TEST_BUF_SIZE; j++)
+                in48k_short[j] = in48k_stereo_short[2*j]; // left channel only
+        }
+        else {
+            for(j=0; j<TEST_BUF_SIZE; j++)
+                in48k_short[j] = in48k_stereo_short[j]; 
+        }
+        int n8k = resample(src, in8k_short, in48k_short, 8000, TEST_FS, TEST_BUF_SIZE, TEST_BUF_SIZE);
+        resample_for_plot(fifo, in8k_short, n8k);
+
+        // every TEST_DT seconds update plot, unfortunately plot
+        // doesnt get updated to end as we are blocking events in this
+        // function
+
+        if (t > TEST_DT) {
+            t -= TEST_DT;
+            short plotSamples[TEST_WAVEFORM_PLOT_BUF];
+            if (fifo_read(fifo, plotSamples, TEST_WAVEFORM_PLOT_BUF))
+                memset(plotSamples, 0, TEST_WAVEFORM_PLOT_BUF*sizeof(short));
+            plotScalar->add_new_short_samples(0, plotSamples, TEST_WAVEFORM_PLOT_BUF, 32767);
+            plotScalar->Refresh();
+       }
+    }
+   
+    err = Pa_StopStream(stream);
+    if (err != paNoError) {
+        wxMessageBox(wxT("Couldn't stop sound device."), wxT("Error"), wxOK);       
+        return;
+    }
+    Pa_CloseStream(stream);
+
+    fifo_destroy(fifo);
+    src_delete(src);
+}
+
+//-------------------------------------------------------------------------
+// plotDeviceOutputForAFewSecs()
+//
+// opens a play device and plays a tone for a few seconds.  This is "modal" using
+// synchronous portaudio functions, so the GUI will not respond until after test sample has been
+// taken.  Also plots a pretty picture like the record versions
+//-------------------------------------------------------------------------
+void AudioOptsDialog::plotDeviceOutputForAFewSecs(int devNum, PlotScalar *plotScalar) {
+    PaStreamParameters  outputParameters;
+    const PaDeviceInfo *deviceInfo = NULL;
+    PaStream           *stream = NULL;
+    PaError             err;
+    short               out48k_stereo_short[2*TEST_BUF_SIZE];
+    short               out48k_short[TEST_BUF_SIZE];
+    short               out8k_short[TEST_BUF_SIZE];
+    int                 numDevices, nBufs, i, j, src_error, n, outputChannels;
+    float               t;
+    SRC_STATE          *src;
+    FIFO               *fifo;
+
+    // a basic sanity check
+    numDevices = Pa_GetDeviceCount();
+    if (devNum >= numDevices)
+        return;
+    if (devNum < 0)
+        return;
+
+    fifo = fifo_create((int)(DT*TEST_WAVEFORM_PLOT_FS*2)); assert(fifo != NULL);
+    src = src_new(SRC_SINC_FASTEST, 1, &src_error); assert(src != NULL);
+
+    // work out how many output channels this device supports.
+
+    deviceInfo = Pa_GetDeviceInfo(devNum);
+    if (deviceInfo == NULL) {
+        wxMessageBox(wxT("Couldn't get device info from Port Audio for Sound Card "), wxT("Error"), wxOK);
+        return;
+    }
+    if (deviceInfo->maxOutputChannels == 1)
+        outputChannels = 1;
+    else
+        outputChannels = 2;
+
+    printf("outputChannels: %d\n", outputChannels);
+
+    outputParameters.device = devNum;
+    outputParameters.channelCount = outputChannels;
+    outputParameters.sampleFormat = paInt16;
+    outputParameters.suggestedLatency = Pa_GetDeviceInfo( outputParameters.device )->defaultHighOutputLatency;
+    outputParameters.hostApiSpecificStreamInfo = NULL;
+
+    nBufs = TEST_WAVEFORM_PLOT_TIME*TEST_FS/TEST_BUF_SIZE;
+
+    err = Pa_OpenStream(
+              &stream,
+              NULL,
+              &outputParameters,
+              TEST_FS,
+              TEST_BUF_SIZE,
+              paClipOff,    
+              NULL,       // no callback, use blocking API
+              NULL ); 
+    if (err != paNoError) {
+        wxMessageBox(wxT("Couldn't initialise sound device."), wxT("Error"), wxOK);       
+        return;
+    }
+
+    err = Pa_StartStream(stream);
+    if (err != paNoError) {
+        wxMessageBox(wxT("Couldn't start sound device."), wxT("Error"), wxOK);       
+        return;
+    }
+
+    for(i=0, t=0.0, n=0; i<nBufs; i++, t+=(float)TEST_BUF_SIZE/TEST_FS) {
+        for(j=0; j<TEST_BUF_SIZE; j++,n++) {
+            out48k_short[j] = 2000.0*cos(6.2832*(n++)*400.0/TEST_FS);
+            if (outputChannels == 2) {
+                out48k_stereo_short[2*j] = out48k_short[j];   // left channel
+                out48k_stereo_short[2*j+1] = out48k_short[j]; // right channel
+            }
+            else {
+                out48k_stereo_short[j] = out48k_short[j];     // mono
+            }
+        }
+        Pa_WriteStream(stream, out48k_stereo_short, TEST_BUF_SIZE);
+
+        // convert back to 8kHz just for plotting
+        int n8k = resample(src, out8k_short, out48k_short, 8000, TEST_FS, TEST_BUF_SIZE, TEST_BUF_SIZE);
+        resample_for_plot(fifo, out8k_short, n8k);
+
+        // every TEST_DT seconds update plot
+
+        if (t > TEST_DT) {
+            t -= TEST_DT;
+            short plotSamples[TEST_WAVEFORM_PLOT_BUF];
+            if (fifo_read(fifo, plotSamples, TEST_WAVEFORM_PLOT_BUF))
+                memset(plotSamples, 0, TEST_WAVEFORM_PLOT_BUF*sizeof(short));
+            plotScalar->add_new_short_samples(0, plotSamples, TEST_WAVEFORM_PLOT_BUF, 32767);
+            plotScalar->Refresh();
+       }
+    }
+   
+    err = Pa_StopStream(stream);
+    if (err != paNoError) {
+        wxMessageBox(wxT("Couldn't stop sound device."), wxT("Error"), wxOK);       
+        return;
+    }
+    Pa_CloseStream(stream);
+
+    fifo_destroy(fifo);
+    src_delete(src);
+}
+
+//-------------------------------------------------------------------------
+// OnRxInTest()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnRxInTest(wxCommandEvent& event)
+{
+    plotDeviceInputForAFewSecs(rxInAudioDeviceNum, m_plotScalarRxIn);
+}
+
+//-------------------------------------------------------------------------
+// OnRxOutTest()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnRxOutTest(wxCommandEvent& event)
+{
+    plotDeviceOutputForAFewSecs(rxOutAudioDeviceNum, m_plotScalarRxOut);
+}
+
+//-------------------------------------------------------------------------
+// OnTxInTest()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnTxInTest(wxCommandEvent& event)
+{
+    plotDeviceInputForAFewSecs(txInAudioDeviceNum, m_plotScalarTxIn);
+}
+
+//-------------------------------------------------------------------------
+// OnTxOutTest()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnTxOutTest(wxCommandEvent& event)
+{
+    plotDeviceOutputForAFewSecs(txOutAudioDeviceNum, m_plotScalarTxOut);
+}
+
+//-------------------------------------------------------------------------
+// OnRefreshClick()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnRefreshClick(wxCommandEvent& event)
+{
+    // restart portaudio, to re-sample available devices
+
+    Pa_Terminate();
+    Pa_Init();
+
+    m_notebook1->SetSelection(0);
+    showAPIInfo();
+    populateParams(m_RxInDevices);
+    populateParams(m_RxOutDevices);
+    populateParams(m_TxInDevices);
+    populateParams(m_TxOutDevices);
+
+    // some devices may have dissapeared, so possibily change sound
+    // card config
+
+    ExchangeData(EXCHANGE_DATA_IN);
+}
+
+//-------------------------------------------------------------------------
+// OnApplyAudioParameters()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnApplyAudioParameters(wxCommandEvent& event)
+{
+    ExchangeData(EXCHANGE_DATA_OUT);
+    if(m_isPaInitialized)
+    {
+        if((pa_err = Pa_Terminate()) == paNoError)
+        {
+            m_isPaInitialized = false;
+        }
+        else
+        {
+            wxMessageBox(wxT("Port Audio failed to Terminate"), wxT("Pa_Terminate"), wxOK);
+        }
+    }
+}
+
+//-------------------------------------------------------------------------
+// OnCancelAudioParameters()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnCancelAudioParameters(wxCommandEvent& event)
+{
+    if(m_isPaInitialized)
+    {
+        if((pa_err = Pa_Terminate()) == paNoError)
+        {
+            m_isPaInitialized = false;
+        }
+        else
+        {
+            wxMessageBox(wxT("Port Audio failed to Terminate"), wxT("Pa_Terminate"), wxOK);
+        }
+    }
+    EndModal(wxCANCEL);
+}
+
+//-------------------------------------------------------------------------
+// OnOkAudioParameters()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnOkAudioParameters(wxCommandEvent& event)
+{
+    int status = ExchangeData(EXCHANGE_DATA_OUT);
+
+    // We only accept OK if config sucessful
+
+    printf("status: %d m_isPaInitialized: %d\n", status, m_isPaInitialized);
+    if (status == 0) {
+        if(m_isPaInitialized)
+        {
+            if((pa_err = Pa_Terminate()) == paNoError)
+            {
+                printf("terminated OK\n");
+                m_isPaInitialized = false;
+            }
+            else
+            {
+                wxMessageBox(wxT("Port Audio failed to Terminate"), wxT("Pa_Terminate"), wxOK);
+            }
+        }
+        EndModal(wxOK);
+    }
+
+}
diff --git a/freedv/branches/0.97/src/dlg_audiooptions.h b/freedv/branches/0.97/src/dlg_audiooptions.h
new file mode 100644 (file)
index 0000000..7a78b59
--- /dev/null
@@ -0,0 +1,176 @@
+//=========================================================================
+// Name:          AudioInfoDisplay.h
+// Purpose:       Declares simple wxWidgets application with GUI
+//                created using wxFormBuilder.
+// 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 <http://www.gnu.org/licenses/>.
+//
+//=========================================================================
+#ifndef __AudioOptsDialog__
+#define __AudioOptsDialog__
+
+#include "fdmdv2_main.h"
+
+#define ID_AUDIO_OPTIONS    1000
+#define AUDIO_IN            0
+#define AUDIO_OUT           1
+
+#include "portaudio.h"
+#ifdef WIN32
+#if PA_USE_ASIO
+#include "pa_asio.h"
+#endif
+#endif
+#include "codec2_fifo.h"
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// AudioInfoDisplay
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class AudioInfoDisplay
+{
+    public:
+        wxListCtrl*     m_listDevices;
+        int             direction;
+        wxTextCtrl*     m_textDevice;
+        wxComboBox*     m_cbSampleRate;
+};
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// class AudioOptsDialog
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class AudioOptsDialog : public wxDialog
+{
+    private:
+
+    protected:
+        PaError         pa_err;
+        bool            m_isPaInitialized;
+
+        int             rxInAudioDeviceNum;
+        int             rxOutAudioDeviceNum;
+        int             txInAudioDeviceNum;
+        int             txOutAudioDeviceNum;
+
+        void buildTestControls(PlotScalar **plotScalar, wxButton **btnTest, 
+                               wxPanel *parentPanel, wxBoxSizer *bSizer, wxString buttonLabel);
+        void plotDeviceInputForAFewSecs(int devNum, PlotScalar *plotScalar);
+        void plotDeviceOutputForAFewSecs(int devNum, PlotScalar *plotScalar);
+
+        int buildListOfSupportedSampleRates(wxComboBox *cbSampleRate, int devNum, int in_out);
+        void populateParams(AudioInfoDisplay);
+        void showAPIInfo();
+        int setTextCtrlIfDevNumValid(wxTextCtrl *textCtrl, wxListCtrl *listCtrl, int devNum);
+        void Pa_Init(void);
+        void OnDeviceSelect(wxComboBox *cbSampleRate, 
+                            wxTextCtrl *textCtrl, 
+                            int        *devNum, 
+                            wxListCtrl *listCtrlDevices, 
+                            int         index,
+                            int         in_out);
+
+        AudioInfoDisplay m_RxInDevices;
+        AudioInfoDisplay m_RxOutDevices;
+        AudioInfoDisplay m_TxInDevices;
+        AudioInfoDisplay m_TxOutDevices;
+        wxPanel* m_panel1;
+        wxNotebook* m_notebook1;
+
+        wxPanel* m_panelRx;
+
+        wxListCtrl* m_listCtrlRxInDevices;
+        wxStaticText* m_staticText51;
+        wxTextCtrl* m_textCtrlRxIn;
+        wxStaticText* m_staticText6;
+        wxComboBox* m_cbSampleRateRxIn;
+
+        wxButton* m_btnRxInTest;
+        PlotScalar* m_plotScalarRxIn;
+
+        wxListCtrl* m_listCtrlRxOutDevices;
+        wxStaticText* m_staticText9;
+        wxTextCtrl* m_textCtrlRxOut;
+        wxStaticText* m_staticText10;
+        wxComboBox* m_cbSampleRateRxOut;
+
+        wxButton* m_btnRxOutTest;
+        PlotScalar* m_plotScalarRxOut;
+
+        wxPanel* m_panelTx;
+
+        wxListCtrl* m_listCtrlTxInDevices;
+        wxStaticText* m_staticText12;
+        wxTextCtrl* m_textCtrlTxIn;
+        wxStaticText* m_staticText11;
+        wxComboBox* m_cbSampleRateTxIn;
+
+        wxButton* m_btnTxInTest;
+        PlotScalar* m_plotScalarTxIn;
+
+        wxListCtrl* m_listCtrlTxOutDevices;
+        wxStaticText* m_staticText81;
+        wxTextCtrl* m_textCtrlTxOut;
+        wxStaticText* m_staticText71;
+        wxComboBox* m_cbSampleRateTxOut;
+
+        wxButton* m_btnTxOutTest;
+        PlotScalar* m_plotScalarTxOut;
+
+        wxPanel* m_panelAPI;
+
+        wxStaticText* m_staticText7;
+        wxStaticText* m_textStringVer;
+        wxStaticText* m_staticText8;
+        wxStaticText* m_textIntVer;
+        wxStaticText* m_staticText5;
+        wxStaticText* m_textCDevCount;
+        wxStaticText* m_staticText4;
+        wxStaticText* m_textAPICount;
+        wxButton* m_btnRefresh;
+        wxStdDialogButtonSizer* m_sdbSizer1;
+        wxButton* m_sdbSizer1OK;
+        wxButton* m_sdbSizer1Apply;
+        wxButton* m_sdbSizer1Cancel;
+
+        // Virtual event handlers, overide them in your derived class
+        //virtual void OnActivateApp( wxActivateEvent& event ) { event.Skip(); }
+//        virtual void OnCloseFrame( wxCloseEvent& event ) { event.Skip(); }
+
+        void OnRxInDeviceSelect( wxListEvent& event );
+
+        void OnRxInTest( wxCommandEvent& event );
+        void OnRxOutTest( wxCommandEvent& event );
+        void OnTxInTest( wxCommandEvent& event );
+        void OnTxOutTest( wxCommandEvent& event );
+
+        void OnRxOutDeviceSelect( wxListEvent& event );
+        void OnTxInDeviceSelect( wxListEvent& event );
+        void OnTxOutDeviceSelect( wxListEvent& event );
+        void OnRefreshClick( wxCommandEvent& event );
+        void OnApplyAudioParameters( wxCommandEvent& event );
+        void OnCancelAudioParameters( wxCommandEvent& event );
+        void OnOkAudioParameters( wxCommandEvent& event );
+        // Virtual event handlers, overide them in your derived class
+        void OnClose( wxCloseEvent& event ) { event.Skip(); }
+        void OnHibernate( wxActivateEvent& event ) { event.Skip(); }
+        void OnIconize( wxIconizeEvent& event ) { event.Skip(); }
+        void OnInitDialog( wxInitDialogEvent& event );
+
+    public:
+
+        AudioOptsDialog( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Audio Config"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 300,300 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
+        ~AudioOptsDialog();
+        int ExchangeData(int inout);
+};
+#endif //__AudioOptsDialog__
diff --git a/freedv/branches/0.97/src/dlg_filter.cpp b/freedv/branches/0.97/src/dlg_filter.cpp
new file mode 100644 (file)
index 0000000..879373d
--- /dev/null
@@ -0,0 +1,758 @@
+//==========================================================================
+// Name:            dlg_filter.cpp
+// Purpose:         Dialog for controlling Codec audio filtering
+// Date:            Nov 25 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#include "dlg_filter.h"
+
+#define SLIDER_MAX 100
+#define SLIDER_LENGTH 100
+
+#define FILTER_MIN_MAG_DB -20.0
+#define FILTER_MAX_MAG_DB  20.0
+
+#define MAX_FREQ_BASS      600.00
+#define MAX_FREQ_TREBLE   3900.00
+#define MAX_FREQ_DEF      3000.00
+
+#define MIN_GAIN          -20
+#define MAX_GAIN           20
+
+#define MAX_LOG10_Q         1.0
+#define MIN_LOG10_Q        -1.0 
+
+// DFT parameters
+
+#define IMP_AMP           2000.0                     // amplitude of impulse
+#define NIMP              50                         // number of samples in impulse response
+#define F_STEP_DFT        10.0                       // frequency steps to sample spectrum
+#define F_MAG_N           (int)(MAX_F_HZ/F_STEP_DFT) // number of frequency steps
+
+extern struct CODEC2      *g_pCodec2;
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class FilterDlg
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+FilterDlg::FilterDlg(wxWindow* parent, bool running, bool *newMicInFilter, bool *newSpkOutFilter,
+                     wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style)
+{
+    m_running = running;
+    m_newMicInFilter = newMicInFilter;
+    m_newSpkOutFilter = newSpkOutFilter;
+
+    this->SetSizeHints(wxDefaultSize, wxDefaultSize);
+
+    wxBoxSizer* bSizer30;
+    bSizer30 = new wxBoxSizer(wxVERTICAL);
+
+    // LPC Post Filter --------------------------------------------------------
+
+    wxStaticBoxSizer* lpcpfs = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("LPC Post Filter")), wxHORIZONTAL);
+
+    wxBoxSizer* left = new wxBoxSizer(wxVERTICAL);
+
+    m_codec2LPCPostFilterEnable = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition,wxDefaultSize, wxCHK_2STATE);
+    left->Add(m_codec2LPCPostFilterEnable);
+
+    m_codec2LPCPostFilterBassBoost = new wxCheckBox(this, wxID_ANY, _("0-1 kHz 3dB Boost"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
+    left->Add(m_codec2LPCPostFilterBassBoost);
+    lpcpfs->Add(left, 0, wxALL, 5);
+
+    newLPCPFControl(&m_codec2LPCPostFilterBeta, &m_staticTextBeta, lpcpfs, "Beta");
+    newLPCPFControl(&m_codec2LPCPostFilterGamma, &m_staticTextGamma, lpcpfs, "Gamma");
+
+    m_LPCPostFilterDefault = new wxButton(this, wxID_ANY, wxT("Default"));
+    lpcpfs->Add(m_LPCPostFilterDefault, 0, wxALL|wxALIGN_CENTRE_HORIZONTAL|wxALIGN_CENTRE_VERTICAL, 5);
+
+    bSizer30->Add(lpcpfs, 0, wxALL, 0);
+
+    // EQ Filters -----------------------------------------------------------
+
+    wxStaticBoxSizer* eqMicInSizer = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Mic In Equaliser")), wxVERTICAL);
+    wxBoxSizer* eqMicInSizer1 = new wxBoxSizer(wxHORIZONTAL);
+    wxBoxSizer* eqMicInSizer2 = new wxBoxSizer(wxHORIZONTAL);
+
+    m_MicInBass   = newEQ(eqMicInSizer1, "Bass"  , MAX_FREQ_BASS, disableQ);
+    m_MicInTreble = newEQ(eqMicInSizer1, "Treble", MAX_FREQ_TREBLE, disableQ);
+    eqMicInSizer->Add(eqMicInSizer1);
+
+    m_MicInEnable = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition,wxDefaultSize, wxCHK_2STATE);
+    eqMicInSizer2->Add(m_MicInEnable,0,wxALIGN_CENTRE_VERTICAL|wxRIGHT,10);
+    m_MicInMid    = newEQ(eqMicInSizer2, "Mid"   , MAX_FREQ_DEF, enableQ);
+    m_MicInDefault = new wxButton(this, wxID_ANY, wxT("Default"));
+    eqMicInSizer2->Add(m_MicInDefault,0,wxALIGN_CENTRE_VERTICAL|wxLEFT,20);
+    eqMicInSizer->Add(eqMicInSizer2);
+
+    wxStaticBoxSizer* eqSpkOutSizer = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Speaker Out Equaliser")), wxVERTICAL);
+    wxBoxSizer* eqSpkOutSizer1 = new wxBoxSizer(wxHORIZONTAL);
+    wxBoxSizer* eqSpkOutSizer2 = new wxBoxSizer(wxHORIZONTAL);
+
+    m_SpkOutBass   = newEQ(eqSpkOutSizer1, "Bass"  , MAX_FREQ_BASS, disableQ);
+    m_SpkOutTreble = newEQ(eqSpkOutSizer1, "Treble", MAX_FREQ_TREBLE, disableQ);
+    eqSpkOutSizer->Add(eqSpkOutSizer1);
+
+    m_SpkOutEnable = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition,wxDefaultSize, wxCHK_2STATE);
+    eqSpkOutSizer2->Add(m_SpkOutEnable,0,wxALIGN_CENTRE_VERTICAL|wxRIGHT,10);
+    m_SpkOutMid    = newEQ(eqSpkOutSizer2, "Mid"   , MAX_FREQ_DEF, enableQ);
+    m_SpkOutDefault = new wxButton(this, wxID_ANY, wxT("Default"));
+    eqSpkOutSizer2->Add(m_SpkOutDefault,0,wxALIGN_CENTRE_VERTICAL|wxLEFT,20);
+    eqSpkOutSizer->Add(eqSpkOutSizer2);
+    
+    bSizer30->Add(eqMicInSizer, 0, wxALL, 0);
+    bSizer30->Add(eqSpkOutSizer, 0, wxALL, 0);
+
+    // Storgage for spectrum magnitude plots ------------------------------------
+
+    m_MicInMagdB = new float[F_MAG_N];
+    for(int i=0; i<F_MAG_N; i++)
+        m_MicInMagdB[i] = 0.0;
+
+    m_SpkOutMagdB = new float[F_MAG_N];
+    for(int i=0; i<F_MAG_N; i++)
+        m_SpkOutMagdB[i] = 0.0;
+
+    // Spectrum Plots -----------------------------------------------------------
+
+    long nb_style = wxAUI_NB_BOTTOM | wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_MOVE | wxAUI_NB_SCROLL_BUTTONS;
+    m_auiNotebook = new wxAuiNotebook(this, wxID_ANY, wxDefaultPosition, wxSize(-1,200), nb_style);
+    m_auiNotebook->SetFont(wxFont(8, 70, 90, 90, false, wxEmptyString));
+
+    bSizer30->Add(m_auiNotebook, 0, wxEXPAND|wxALL, 3);
+    
+    m_MicInFreqRespPlot = new PlotSpectrum((wxFrame*) m_auiNotebook, m_MicInMagdB, F_MAG_N, FILTER_MIN_MAG_DB, FILTER_MAX_MAG_DB);
+    m_auiNotebook->AddPage(m_MicInFreqRespPlot, _("Microphone In Equaliser"));
+
+    m_SpkOutFreqRespPlot = new PlotSpectrum((wxFrame*)m_auiNotebook, m_SpkOutMagdB, F_MAG_N, FILTER_MIN_MAG_DB, FILTER_MAX_MAG_DB);
+    m_auiNotebook->AddPage(m_SpkOutFreqRespPlot, _("Speaker Out Equaliser"));
+
+    //  OK - Cancel buttons at the bottom --------------------------
+
+    wxBoxSizer* bSizer31 = new wxBoxSizer(wxHORIZONTAL);
+
+    m_sdbSizer5OK = new wxButton(this, wxID_OK);
+    bSizer31->Add(m_sdbSizer5OK, 0, wxALL, 2);
+
+    m_sdbSizer5Cancel = new wxButton(this, wxID_CANCEL);
+    bSizer31->Add(m_sdbSizer5Cancel, 0, wxALL, 2);
+
+    bSizer30->Add(bSizer31, 0, wxALIGN_RIGHT|wxALL, 0);
+
+    this->SetSizer(bSizer30);
+    this->Layout();
+
+    this->Centre(wxBOTH);
+    // Connect Events -------------------------------------------------------
+
+    this->Connect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(FilterDlg::OnInitDialog));
+
+    m_codec2LPCPostFilterEnable->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnEnable), NULL, this);
+    m_codec2LPCPostFilterBassBoost->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnBassBoost), NULL, this);
+    m_codec2LPCPostFilterBeta->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnBetaScroll), NULL, this);
+    m_codec2LPCPostFilterGamma->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnGammaScroll), NULL, this);
+    m_LPCPostFilterDefault->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnLPCPostFilterDefault), NULL, this);
+
+    m_MicInBass.sliderFreq->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInBassFreqScroll), NULL, this);
+    m_MicInBass.sliderGain->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInBassGainScroll), NULL, this);
+    m_MicInTreble.sliderFreq->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInTrebleFreqScroll), NULL, this);
+    m_MicInTreble.sliderGain->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInTrebleGainScroll), NULL, this);
+    m_MicInMid.sliderFreq->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInMidFreqScroll), NULL, this);
+    m_MicInMid.sliderGain->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInMidGainScroll), NULL, this);
+    m_MicInMid.sliderQ->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInMidQScroll), NULL, this);
+    m_MicInEnable->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnMicInEnable), NULL, this);
+    m_MicInDefault->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnMicInDefault), NULL, this);
+
+    m_SpkOutBass.sliderFreq->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutBassFreqScroll), NULL, this);
+    m_SpkOutBass.sliderGain->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutBassGainScroll), NULL, this);
+    m_SpkOutTreble.sliderFreq->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutTrebleFreqScroll), NULL, this);
+    m_SpkOutTreble.sliderGain->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutTrebleGainScroll), NULL, this);
+    m_SpkOutMid.sliderFreq->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutMidFreqScroll), NULL, this);
+    m_SpkOutMid.sliderGain->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutMidGainScroll), NULL, this);
+    m_SpkOutMid.sliderQ->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutMidQScroll), NULL, this);
+    m_SpkOutEnable->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnSpkOutEnable), NULL, this);
+    m_SpkOutDefault->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnSpkOutDefault), NULL, this);
+
+    m_sdbSizer5Cancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnCancel), NULL, this);
+    m_sdbSizer5OK->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnOK), NULL, this);
+
+}
+
+//-------------------------------------------------------------------------
+// ~FilterDlg()
+//-------------------------------------------------------------------------
+FilterDlg::~FilterDlg()
+{
+    delete m_MicInMagdB;
+    delete m_SpkOutMagdB;
+
+    // Disconnect Events
+
+    this->Disconnect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(FilterDlg::OnInitDialog));
+
+    m_codec2LPCPostFilterEnable->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnEnable), NULL, this);
+    m_codec2LPCPostFilterBassBoost->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnBassBoost), NULL, this);
+    m_codec2LPCPostFilterBeta->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnBetaScroll), NULL, this);
+    m_codec2LPCPostFilterGamma->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnGammaScroll), NULL, this);
+    m_LPCPostFilterDefault->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnLPCPostFilterDefault), NULL, this);
+
+    m_MicInBass.sliderFreq->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInBassFreqScroll), NULL, this);
+    m_MicInBass.sliderGain->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInBassGainScroll), NULL, this);
+    m_MicInTreble.sliderFreq->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInTrebleFreqScroll), NULL, this);
+    m_MicInTreble.sliderGain->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInTrebleGainScroll), NULL, this);
+    m_MicInMid.sliderFreq->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInMidFreqScroll), NULL, this);
+    m_MicInMid.sliderGain->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInMidGainScroll), NULL, this);
+    m_MicInMid.sliderQ->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInMidQScroll), NULL, this);
+    m_MicInEnable->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnMicInEnable), NULL, this);
+    m_MicInDefault->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnMicInDefault), NULL, this);
+
+    m_SpkOutBass.sliderFreq->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutBassFreqScroll), NULL, this);
+    m_SpkOutBass.sliderGain->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutBassGainScroll), NULL, this);
+    m_SpkOutTreble.sliderFreq->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutTrebleFreqScroll), NULL, this);
+    m_SpkOutTreble.sliderGain->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutTrebleGainScroll), NULL, this);
+    m_SpkOutMid.sliderFreq->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutMidFreqScroll), NULL, this);
+    m_SpkOutMid.sliderGain->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutMidGainScroll), NULL, this);
+    m_SpkOutMid.sliderQ->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutMidQScroll), NULL, this);
+    m_SpkOutEnable->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnSpkOutEnable), NULL, this);
+    m_SpkOutDefault->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnSpkOutDefault), NULL, this);
+
+    m_sdbSizer5Cancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnCancel), NULL, this);
+    m_sdbSizer5OK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnOK), NULL, this);
+}
+
+void FilterDlg::newLPCPFControl(wxSlider **slider, wxStaticText **stValue, wxSizer *s, wxString controlName)
+{
+    wxBoxSizer *bs = new wxBoxSizer(wxHORIZONTAL);
+
+    wxStaticText* st = new wxStaticText(this, wxID_ANY, controlName, wxDefaultPosition, wxSize(70,-1), wxALIGN_RIGHT);
+    bs->Add(st, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 2);
+
+    *slider = new wxSlider(this, wxID_ANY, 0, 0, SLIDER_MAX, wxDefaultPosition, wxSize(SLIDER_LENGTH,wxDefaultCoord));
+    bs->Add(*slider, 1, wxALIGN_CENTER_VERTICAL|wxALL, 2);
+
+    *stValue = new wxStaticText(this, wxID_ANY, wxT("0.0"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
+    bs->Add(*stValue, 1, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxALL, 2);
+
+    s->Add(bs, 0);
+}
+
+void FilterDlg::newEQControl(wxSlider** slider, wxStaticText** value, wxStaticBoxSizer *bs, wxString controlName)
+{
+    wxStaticText* label = new wxStaticText(this, wxID_ANY, controlName, wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
+    bs->Add(label, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 0);
+
+    *slider = new wxSlider(this, wxID_ANY, 0, 0, SLIDER_MAX, wxDefaultPosition, wxSize(SLIDER_LENGTH,wxDefaultCoord));
+    bs->Add(*slider, 1, wxALIGN_CENTER_VERTICAL|wxALL, 0);
+
+    *value = new wxStaticText(this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(40,-1), wxALIGN_LEFT);
+    bs->Add(*value, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxRIGHT, 5);
+}
+
+EQ FilterDlg::newEQ(wxSizer *bs, wxString eqName, float maxFreqHz, bool enableQ)
+{
+    EQ eq;
+
+    wxStaticBoxSizer *bsEQ = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, eqName), wxHORIZONTAL);
+
+    newEQControl(&eq.sliderFreq, &eq.valueFreq, bsEQ, "Freq"); 
+    eq.maxFreqHz = maxFreqHz; 
+    eq.sliderFreqId = eq.sliderFreq->GetId();
+
+    newEQControl(&eq.sliderGain, &eq.valueGain, bsEQ, "Gain");
+    if (enableQ)
+        newEQControl(&eq.sliderQ, &eq.valueQ, bsEQ, "Q");
+    else
+        eq.sliderQ = NULL;
+
+    bs->Add(bsEQ);
+
+    return eq;
+}
+
+//-------------------------------------------------------------------------
+// ExchangeData()
+//-------------------------------------------------------------------------
+void FilterDlg::ExchangeData(int inout, bool storePersistent)
+{
+    wxConfigBase *pConfig = wxConfigBase::Get();
+    if(inout == EXCHANGE_DATA_IN)
+    {
+        // LPC Post filter
+
+        m_codec2LPCPostFilterEnable->SetValue(wxGetApp().m_codec2LPCPostFilterEnable);
+        m_codec2LPCPostFilterBassBoost->SetValue(wxGetApp().m_codec2LPCPostFilterBassBoost);
+        m_beta = wxGetApp().m_codec2LPCPostFilterBeta; setBeta();
+        m_gamma = wxGetApp().m_codec2LPCPostFilterGamma; setGamma();
+
+        // Mic In Equaliser
+
+        m_MicInBass.freqHz = wxGetApp().m_MicInBassFreqHz; 
+        m_MicInBass.freqHz = limit(m_MicInBass.freqHz, 1.0, MAX_FREQ_BASS);
+        setFreq(&m_MicInBass);
+        m_MicInBass.gaindB = wxGetApp().m_MicInBassGaindB;
+        m_MicInBass.gaindB = limit(m_MicInBass.gaindB, MIN_GAIN, MAX_GAIN);
+        setGain(&m_MicInBass);
+
+        m_MicInTreble.freqHz = wxGetApp().m_MicInTrebleFreqHz;
+        m_MicInTreble.freqHz = limit(m_MicInTreble.freqHz, 1.0, MAX_FREQ_TREBLE);
+        setFreq(&m_MicInTreble);
+        m_MicInTreble.gaindB = wxGetApp().m_MicInTrebleGaindB; 
+        m_MicInTreble.gaindB = limit(m_MicInTreble.gaindB, MIN_GAIN, MAX_GAIN);
+        setGain(&m_MicInTreble);
+
+        m_MicInMid.freqHz = wxGetApp().m_MicInMidFreqHz; 
+        m_MicInMid.freqHz = limit(m_MicInMid.freqHz, 1.0, MAX_FREQ_TREBLE);
+        setFreq(&m_MicInMid);
+        m_MicInMid.gaindB = wxGetApp().m_MicInMidGaindB; 
+        m_MicInMid.gaindB = limit(m_MicInMid.gaindB, MIN_GAIN, MAX_GAIN);
+        setGain(&m_MicInMid);
+        m_MicInMid.Q = wxGetApp().m_MicInMidQ;
+        m_MicInMid.Q = limit(m_MicInMid.Q, pow(10.0,MIN_LOG10_Q), pow(10.0, MAX_LOG10_Q));
+        setQ(&m_MicInMid);
+
+        m_MicInEnable->SetValue(wxGetApp().m_MicInEQEnable);
+
+        plotMicInFilterSpectrum();
+        // Spk Out Equaliser
+
+        m_SpkOutBass.freqHz = wxGetApp().m_SpkOutBassFreqHz;
+        m_SpkOutBass.freqHz = limit(m_SpkOutBass.freqHz, 1.0, MAX_FREQ_BASS);
+        setFreq(&m_SpkOutBass);
+        m_SpkOutBass.gaindB = wxGetApp().m_SpkOutBassGaindB; 
+        m_SpkOutBass.gaindB = limit(m_SpkOutBass.gaindB, MIN_GAIN, MAX_GAIN);
+        setGain(&m_SpkOutBass);
+
+        m_SpkOutTreble.freqHz = wxGetApp().m_SpkOutTrebleFreqHz; 
+        m_SpkOutTreble.freqHz = limit(m_SpkOutTreble.freqHz, 1.0, MAX_FREQ_TREBLE);
+        setFreq(&m_SpkOutTreble);
+        m_SpkOutTreble.gaindB = wxGetApp().m_SpkOutTrebleGaindB; 
+        m_SpkOutTreble.gaindB = limit(m_SpkOutTreble.gaindB, MIN_GAIN, MAX_GAIN);
+        setGain(&m_SpkOutTreble);
+
+        m_SpkOutMid.freqHz = wxGetApp().m_SpkOutMidFreqHz;
+        m_SpkOutMid.freqHz = limit(m_SpkOutMid.freqHz, 1.0, MAX_FREQ_TREBLE);
+        setFreq(&m_SpkOutMid);
+        m_SpkOutMid.gaindB = wxGetApp().m_SpkOutMidGaindB;
+        m_SpkOutMid.gaindB = limit(m_SpkOutMid.gaindB, MIN_GAIN, MAX_GAIN);
+        setGain(&m_SpkOutMid);
+        m_SpkOutMid.Q = wxGetApp().m_SpkOutMidQ;
+        m_SpkOutMid.Q = limit(m_SpkOutMid.Q, pow(10.0,MIN_LOG10_Q), pow(10.0, MAX_LOG10_Q));
+        setQ(&m_SpkOutMid);
+
+        m_SpkOutEnable->SetValue(wxGetApp().m_SpkOutEQEnable);
+
+        plotSpkOutFilterSpectrum();
+    }
+    if(inout == EXCHANGE_DATA_OUT)
+    {
+        // LPC Post filter
+
+        wxGetApp().m_codec2LPCPostFilterEnable     = m_codec2LPCPostFilterEnable->GetValue();
+        wxGetApp().m_codec2LPCPostFilterBassBoost  = m_codec2LPCPostFilterBassBoost->GetValue();
+        wxGetApp().m_codec2LPCPostFilterBeta       = m_beta;
+        wxGetApp().m_codec2LPCPostFilterGamma      = m_gamma;
+
+        // Mic In Equaliser
+
+        wxGetApp().m_MicInBassFreqHz = m_MicInBass.freqHz;
+        wxGetApp().m_MicInBassGaindB = m_MicInBass.gaindB;
+
+        wxGetApp().m_MicInTrebleFreqHz = m_MicInTreble.freqHz;
+        wxGetApp().m_MicInTrebleGaindB = m_MicInTreble.gaindB;
+
+        wxGetApp().m_MicInMidFreqHz = m_MicInMid.freqHz;
+        wxGetApp().m_MicInMidGaindB = m_MicInMid.gaindB;
+        wxGetApp().m_MicInMidQ = m_MicInMid.Q;
+
+        // Spk Out Equaliser
+
+        wxGetApp().m_SpkOutBassFreqHz = m_SpkOutBass.freqHz;
+        wxGetApp().m_SpkOutBassGaindB = m_SpkOutBass.gaindB;
+
+        wxGetApp().m_SpkOutTrebleFreqHz = m_SpkOutTreble.freqHz;
+        wxGetApp().m_SpkOutTrebleGaindB = m_SpkOutTreble.gaindB;
+
+        wxGetApp().m_SpkOutMidFreqHz = m_SpkOutMid.freqHz;
+        wxGetApp().m_SpkOutMidGaindB = m_SpkOutMid.gaindB;
+        wxGetApp().m_SpkOutMidQ = m_SpkOutMid.Q;
+
+        if (storePersistent) {
+            pConfig->Write(wxT("/Filter/codec2LPCPostFilterEnable"),     wxGetApp().m_codec2LPCPostFilterEnable);
+            pConfig->Write(wxT("/Filter/codec2LPCPostFilterBassBoost"),  wxGetApp().m_codec2LPCPostFilterBassBoost);
+            pConfig->Write(wxT("/Filter/codec2LPCPostFilterBeta"),       (int)(m_beta*100.0));
+            pConfig->Write(wxT("/Filter/codec2LPCPostFilterGamma"),      (int)(m_gamma*100.0));
+
+            pConfig->Write(wxT("/Filter/MicInBassFreqHz"), (int)m_MicInBass.freqHz);
+            pConfig->Write(wxT("/Filter/MicInBassGaindB"), (int)(10.0*m_MicInBass.gaindB));
+            pConfig->Write(wxT("/Filter/MicInTrebleFreqHz"), (int)m_MicInTreble.freqHz);
+            pConfig->Write(wxT("/Filter/MicInTrebleGaindB"), (int)(10.0*m_MicInTreble.gaindB));
+            pConfig->Write(wxT("/Filter/MicInMidFreqHz"), (int)m_MicInMid.freqHz);
+            pConfig->Write(wxT("/Filter/MicInMidGaindB"), (int)(10.0*m_MicInMid.gaindB));
+            pConfig->Write(wxT("/Filter/MicInMidQ"), (int)(100.0*m_MicInMid.Q));
+
+            pConfig->Write(wxT("/Filter/SpkOutBassFreqHz"), (int)m_SpkOutBass.freqHz);
+            pConfig->Write(wxT("/Filter/SpkOutBassGaindB"), (int)(10.0*m_SpkOutBass.gaindB));
+            pConfig->Write(wxT("/Filter/SpkOutTrebleFreqHz"), (int)m_SpkOutTreble.freqHz);
+            pConfig->Write(wxT("/Filter/SpkOutTrebleGaindB"), (int)(10.0*m_SpkOutTreble.gaindB));
+            pConfig->Write(wxT("/Filter/SpkOutMidQ"), (int)(100.0*m_SpkOutMid.Q));
+            pConfig->Write(wxT("/Filter/SpkOutMidFreqHz"), (int)m_SpkOutMid.freqHz);
+            pConfig->Write(wxT("/Filter/SpkOutMidGaindB"), (int)(10.0*m_SpkOutMid.gaindB));
+
+            pConfig->Flush();
+        }
+    }
+    delete wxConfigBase::Set((wxConfigBase *) NULL);
+}
+
+float FilterDlg::limit(float value, float min, float max) {
+    if (value < min) return min;
+    if (value > max) return max;
+    return value;
+}
+
+//-------------------------------------------------------------------------
+// OnCancel()
+//-------------------------------------------------------------------------
+void FilterDlg::OnCancel(wxCommandEvent& event)
+{
+    this->EndModal(wxID_CANCEL);
+}
+
+//-------------------------------------------------------------------------
+// OnDefault()
+//-------------------------------------------------------------------------
+
+void FilterDlg::OnLPCPostFilterDefault(wxCommandEvent& event)
+{
+    m_beta = CODEC2_LPC_PF_BETA; setBeta();
+    m_gamma = CODEC2_LPC_PF_GAMMA; setGamma();
+    m_codec2LPCPostFilterEnable->SetValue(true);
+    m_codec2LPCPostFilterBassBoost->SetValue(true);
+}
+
+void FilterDlg::OnMicInDefault(wxCommandEvent& event)
+{
+    m_MicInBass.freqHz = 100.0;
+    m_MicInBass.gaindB = 0.0;
+    setFreq(&m_MicInBass); setGain(&m_MicInBass); 
+
+    m_MicInTreble.freqHz = 3000.0;
+    m_MicInTreble.gaindB = 0.0;
+    setFreq(&m_MicInTreble); setGain(&m_MicInTreble); 
+
+    m_MicInMid.freqHz = 1500.0;
+    m_MicInMid.gaindB = 0.0;
+    m_MicInMid.Q = 1.0;
+    setFreq(&m_MicInMid); setGain(&m_MicInMid); setQ(&m_MicInMid); 
+
+    plotMicInFilterSpectrum();    
+}
+
+void FilterDlg::OnSpkOutDefault(wxCommandEvent& event)
+{
+    m_SpkOutBass.freqHz = 100.0;
+    m_SpkOutBass.gaindB = 0.0;
+    setFreq(&m_SpkOutBass); setGain(&m_SpkOutBass); 
+
+    m_SpkOutTreble.freqHz = 3000.0;
+    m_SpkOutTreble.gaindB = 0.0;
+    setFreq(&m_SpkOutTreble); setGain(&m_SpkOutTreble); 
+
+    m_SpkOutMid.freqHz = 1500.0;
+    m_SpkOutMid.gaindB = 0.0;
+    m_SpkOutMid.Q = 1.0;
+    setFreq(&m_SpkOutMid); setGain(&m_SpkOutMid); setQ(&m_SpkOutMid); 
+
+    plotSpkOutFilterSpectrum();    
+}
+
+//-------------------------------------------------------------------------
+// OnOK()
+//-------------------------------------------------------------------------
+void FilterDlg::OnOK(wxCommandEvent& event)
+{
+    //printf("FilterDlg::OnOK\n");
+    ExchangeData(EXCHANGE_DATA_OUT, true);
+    this->EndModal(wxID_OK);
+}
+
+//-------------------------------------------------------------------------
+// OnClose()
+//-------------------------------------------------------------------------
+void FilterDlg::OnClose(wxCloseEvent& event)
+{
+    this->EndModal(wxID_OK);
+}
+
+//-------------------------------------------------------------------------
+// OnInitDialog()
+//-------------------------------------------------------------------------
+void FilterDlg::OnInitDialog(wxInitDialogEvent& event)
+{
+    //printf("FilterDlg::OnInitDialog\n");
+    ExchangeData(EXCHANGE_DATA_IN, false);
+    //printf("m_beta: %f\n", m_beta);
+}
+
+void FilterDlg::setBeta(void) {
+    wxString buf;
+    buf.Printf(wxT("%3.2f"), m_beta);
+    m_staticTextBeta->SetLabel(buf);
+    int slider = (int)(m_beta*SLIDER_MAX + 0.5);
+    m_codec2LPCPostFilterBeta->SetValue(slider);
+}
+
+void FilterDlg::setCodec2(void) {
+    if (m_running) {
+        assert(g_pCodec2 != NULL);
+        codec2_set_lpc_post_filter(g_pCodec2, 
+                               m_codec2LPCPostFilterEnable->GetValue(), 
+                               m_codec2LPCPostFilterBassBoost->GetValue(), 
+                               m_beta, m_gamma);
+    }
+}
+
+void FilterDlg::setGamma(void) {
+    wxString buf;
+    buf.Printf(wxT("%3.2f"), m_gamma);
+    m_staticTextGamma->SetLabel(buf);
+    int slider = (int)(m_gamma*SLIDER_MAX + 0.5);
+    m_codec2LPCPostFilterGamma->SetValue(slider);
+}
+
+void FilterDlg::OnEnable(wxScrollEvent& event) {
+    setCodec2();    
+}
+
+void FilterDlg::OnBassBoost(wxScrollEvent& event) {
+    setCodec2();    
+}
+
+void FilterDlg::OnBetaScroll(wxScrollEvent& event) {
+    m_beta = (float)m_codec2LPCPostFilterBeta->GetValue()/SLIDER_MAX;
+    setBeta();
+    setCodec2();
+}
+
+void FilterDlg::OnGammaScroll(wxScrollEvent& event) {
+    m_gamma = (float)m_codec2LPCPostFilterGamma->GetValue()/SLIDER_MAX;
+    setGamma();
+    setCodec2();
+}
+
+// immediately change enable flags rather using ExchangeData() so we can switch on and off at run time
+
+void FilterDlg::OnMicInEnable(wxScrollEvent& event) {
+    wxGetApp().m_MicInEQEnable = m_MicInEnable->GetValue();
+}
+
+void FilterDlg::OnSpkOutEnable(wxScrollEvent& event) {
+    wxGetApp().m_SpkOutEQEnable = m_SpkOutEnable->GetValue();
+    //printf("wxGetApp().m_SpkOutEQEnable: %d\n", wxGetApp().m_SpkOutEQEnable);
+}
+
+void FilterDlg::setFreq(EQ *eq)
+{
+    wxString buf;
+    buf.Printf(wxT("%3.0f"), eq->freqHz);
+    eq->valueFreq->SetLabel(buf);
+    int slider = (int)((eq->freqHz/eq->maxFreqHz)*SLIDER_MAX + 0.5);
+    eq->sliderFreq->SetValue(slider);
+}
+
+void FilterDlg::sliderToFreq(EQ *eq, bool micIn)
+{
+    eq->freqHz = ((float)eq->sliderFreq->GetValue()/SLIDER_MAX)*eq->maxFreqHz;
+    if (eq->freqHz < 1.0) eq->freqHz = 1.0; // sox doesn't like 0 Hz;
+    setFreq(eq);
+    if (micIn) {
+        plotMicInFilterSpectrum();
+        adjRunTimeMicInFilter();
+    }
+    else {
+        plotSpkOutFilterSpectrum();
+        adjRunTimeSpkOutFilter();
+    }
+}
+
+void FilterDlg::setGain(EQ *eq)
+{
+    wxString buf;
+    buf.Printf(wxT("%3.1f"), eq->gaindB);
+    eq->valueGain->SetLabel(buf);
+    int slider = (int)(((eq->gaindB-MIN_GAIN)/(MAX_GAIN-MIN_GAIN))*SLIDER_MAX + 0.5);
+    eq->sliderGain->SetValue(slider);
+}
+
+void FilterDlg::sliderToGain(EQ *eq, bool micIn)
+{
+    float range = MAX_GAIN-MIN_GAIN;
+    
+    eq->gaindB = MIN_GAIN + range*((float)eq->sliderGain->GetValue()/SLIDER_MAX);
+    //printf("gaindB: %f\n", eq->gaindB);
+    setGain(eq);
+    if (micIn) {
+        plotMicInFilterSpectrum();
+        adjRunTimeMicInFilter();
+    }
+    else {
+        plotSpkOutFilterSpectrum();
+        adjRunTimeSpkOutFilter();
+    }
+        
+}
+
+void FilterDlg::setQ(EQ *eq)
+{
+    wxString buf;
+    buf.Printf(wxT("%2.1f"), eq->Q);
+    eq->valueQ->SetLabel(buf);
+
+    float log10_range = MAX_LOG10_Q - MIN_LOG10_Q;
+
+    int slider = (int)(((log10(eq->Q+1E-6)-MIN_LOG10_Q)/log10_range)*SLIDER_MAX + 0.5);
+    eq->sliderQ->SetValue(slider);
+}
+
+void FilterDlg::sliderToQ(EQ *eq, bool micIn)
+{
+    float log10_range = MAX_LOG10_Q - MIN_LOG10_Q;
+    
+    float sliderNorm = (float)eq->sliderQ->GetValue()/SLIDER_MAX;
+    float log10Q =  MIN_LOG10_Q + sliderNorm*(log10_range);
+    eq->Q = pow(10.0, log10Q);
+    //printf("log10Q: %f eq->Q: %f\n", log10Q, eq->Q);
+    setQ(eq);
+    if (micIn) {
+        plotMicInFilterSpectrum();
+        adjRunTimeMicInFilter();
+    }
+    else {
+        plotSpkOutFilterSpectrum();
+        adjRunTimeSpkOutFilter();
+    }
+}
+
+void FilterDlg::plotMicInFilterSpectrum(void) {
+    plotFilterSpectrum(&m_MicInBass, &m_MicInMid, &m_MicInTreble, m_MicInFreqRespPlot, m_MicInMagdB);
+}
+
+void FilterDlg::plotSpkOutFilterSpectrum(void) {
+    plotFilterSpectrum(&m_SpkOutBass, &m_SpkOutMid, &m_SpkOutTreble, m_SpkOutFreqRespPlot, m_SpkOutMagdB);
+}
+
+void FilterDlg::adjRunTimeMicInFilter(void) {
+    // signal an adjustment in running filter coeffs
+
+    if (m_running) {
+        ExchangeData(EXCHANGE_DATA_OUT, false);
+        *m_newMicInFilter = true;
+    }
+}
+        
+void FilterDlg::adjRunTimeSpkOutFilter(void) {
+    // signal an adjustment in running filter coeffs
+
+    if (m_running) {
+        ExchangeData(EXCHANGE_DATA_OUT, false);
+        *m_newSpkOutFilter = true;
+    }
+}
+        
+
+void FilterDlg::plotFilterSpectrum(EQ *eqBass, EQ *eqMid, EQ *eqTreble, PlotSpectrum* freqRespPlot, float *magdB) {
+    char  *argBass[10];
+    char  *argTreble[10];
+    char  *argMid[10];
+    char   argstorage[10][80];
+    float magBass[F_MAG_N];
+    float magTreble[F_MAG_N];
+    float magMid[F_MAG_N];
+    int   i;
+
+    for(i=0; i<10; i++) {
+        argBass[i] = &argstorage[i][0];
+        argTreble[i] = &argstorage[i][0];
+        argMid[i] = &argstorage[i][0];
+    }
+    sprintf(argBass[0], "bass");                
+    sprintf(argBass[1], "%f", eqBass->gaindB+1E-6);
+    sprintf(argBass[2], "%f", eqBass->freqHz);      
+
+    calcFilterSpectrum(magBass, 2, argBass);
+
+    sprintf(argTreble[0], "treble");                
+    sprintf(argTreble[1], "%f", eqTreble->gaindB+1E-6);
+    sprintf(argTreble[2], "%f", eqTreble->freqHz);      
+
+    calcFilterSpectrum(magTreble, 2, argTreble);
+
+    sprintf(argTreble[0], "equalizer");                
+    sprintf(argTreble[1], "%f", eqMid->freqHz);      
+    sprintf(argTreble[2], "%f", eqMid->Q);      
+    sprintf(argTreble[3], "%f", eqMid->gaindB+1E-6);
+
+    calcFilterSpectrum(magMid, 3, argMid);
+
+    for(i=0; i<F_MAG_N; i++)
+        magdB[i] = magBass[i] + magMid[i] + magTreble[i];
+    freqRespPlot->m_newdata = true;
+    freqRespPlot->Refresh();
+}
+
+void FilterDlg::calcFilterSpectrum(float magdB[], int argc, char *argv[]) {
+    void       *sbq;
+    short       in[NIMP];
+    short       out[NIMP];
+    COMP        X[F_MAG_N];
+    float       f, w;
+    int         i, k;
+
+    // find impulse response -----------------------------------
+
+    for(i=0; i<NIMP; i++)
+        in[i] = 0;
+    in[0] = IMP_AMP;
+
+    //printf("argv[0]: %s argv[1]: %s\n", argv[0], argv[1]);
+    sbq = sox_biquad_create(argc, (const char **)argv);
+
+    sox_biquad_filter(sbq, out, in, NIMP);
+    //for(i=0; i<NIMP; i++)
+    //    printf("%d\n", out[i]);
+   
+    sox_biquad_destroy(sbq);
+
+    //for(i=0; i<NIMP; i++)
+    //    out[i] = 0.0;
+    //out[0] = IMP_AMP;
+
+    // calculate discrete time continous frequency Fourer transform
+    // doing this from first principles rather than FFT for no good reason
+
+    for(f=0,i=0; f<MAX_F_HZ; f+=F_STEP_DFT,i++) {
+        w = M_PI*f/(FS/2);
+        X[i].real = 0.0; X[i].imag = 0.0;
+        for(k=0; k<NIMP; k++) {
+            X[i].real += ((float)out[k]/IMP_AMP) * cos(w*k);
+            X[i].imag -= ((float)out[k]/IMP_AMP) * sin(w*k);
+        }
+        magdB[i] = 10.0*log10(X[i].real* X[i].real + X[i].imag*X[i].imag + 1E-12);
+        //printf("f: %f X[%d] = %f %f magdB = %f\n", f, i, X[i].real, X[i].imag,  magdB[i]);
+    }
+}
diff --git a/freedv/branches/0.97/src/dlg_filter.h b/freedv/branches/0.97/src/dlg_filter.h
new file mode 100644 (file)
index 0000000..037ba24
--- /dev/null
@@ -0,0 +1,162 @@
+//==========================================================================
+// Name:            dlg_filter.h
+// Purpose:         Dialog for controlling Codec audio filtering
+// Created:         Nov 25 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+
+#ifndef __FILTER_DIALOG__
+#define __FILTER_DIALOG__
+
+#include "fdmdv2_main.h"
+
+enum {disableQ = false, enableQ = true};
+
+typedef struct { 
+    wxSlider     *sliderFreq;
+    wxStaticText *valueFreq;
+    wxSlider     *sliderGain;
+    wxStaticText *valueGain;
+    wxSlider     *sliderQ;
+    wxStaticText *valueQ;
+
+    int       sliderFreqId;
+    int       sliderGainId;
+    int       sliderQId;
+    
+    float     freqHz;
+    float     gaindB;
+    float     Q;
+
+    float     maxFreqHz;
+} EQ;
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class FilterDlg
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class FilterDlg : public wxDialog
+{
+    public:
+    FilterDlg( wxWindow* parent, bool running, bool *newMicInFilter, bool *newSpkOutFilter,
+               wxWindowID id = wxID_ANY, const wxString& title = _("Filter"), 
+               const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 800, 600 ), 
+               long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
+        ~FilterDlg();
+
+        void    ExchangeData(int inout, bool storePersistent);
+
+    protected:
+        // Handlers for events.
+        void    OnCancel(wxCommandEvent& event);
+        void    OnOK(wxCommandEvent& event);
+        void    OnClose(wxCloseEvent& event);
+        void    OnInitDialog(wxInitDialogEvent& event);
+        void    OnLPCPostFilterDefault(wxCommandEvent& event);
+
+        void    OnBetaScroll(wxScrollEvent& event);
+        void    OnGammaScroll(wxScrollEvent& event);
+        void    OnEnable(wxScrollEvent& event);
+        void    OnBassBoost(wxScrollEvent& event);
+
+        void    OnMicInBassFreqScroll(wxScrollEvent& event) { sliderToFreq(&m_MicInBass, true); }
+        void    OnMicInBassGainScroll(wxScrollEvent& event) { sliderToGain(&m_MicInBass, true); }
+        void    OnMicInTrebleFreqScroll(wxScrollEvent& event) { sliderToFreq(&m_MicInTreble, true); }
+        void    OnMicInTrebleGainScroll(wxScrollEvent& event) { sliderToGain(&m_MicInTreble, true); }
+        void    OnMicInMidFreqScroll(wxScrollEvent& event) { sliderToFreq(&m_MicInMid, true); }
+        void    OnMicInMidGainScroll(wxScrollEvent& event) { sliderToGain(&m_MicInMid, true); }
+        void    OnMicInMidQScroll(wxScrollEvent& event) { sliderToQ(&m_MicInMid, true); }
+        void    OnMicInEnable(wxScrollEvent& event);
+        void    OnMicInDefault(wxCommandEvent& event);
+
+        void    OnSpkOutBassFreqScroll(wxScrollEvent& event) { sliderToFreq(&m_SpkOutBass, false); }
+        void    OnSpkOutBassGainScroll(wxScrollEvent& event) { sliderToGain(&m_SpkOutBass, false); }
+        void    OnSpkOutTrebleFreqScroll(wxScrollEvent& event) { sliderToFreq(&m_SpkOutTreble, false); }
+        void    OnSpkOutTrebleGainScroll(wxScrollEvent& event) { sliderToGain(&m_SpkOutTreble, false); }
+        void    OnSpkOutMidFreqScroll(wxScrollEvent& event) { sliderToFreq(&m_SpkOutMid, false); }
+        void    OnSpkOutMidGainScroll(wxScrollEvent& event) { sliderToGain(&m_SpkOutMid, false); }
+        void    OnSpkOutMidQScroll(wxScrollEvent& event) { sliderToQ(&m_SpkOutMid, false); }
+        void    OnSpkOutEnable(wxScrollEvent& event);
+        void    OnSpkOutDefault(wxCommandEvent& event);
+
+        wxStaticText* m_staticText8;
+        wxCheckBox*   m_codec2LPCPostFilterEnable;
+        wxStaticText* m_staticText9;
+        wxCheckBox*   m_codec2LPCPostFilterBassBoost;
+        wxStaticText* m_staticText91;
+        wxSlider*     m_codec2LPCPostFilterBeta;
+        wxStaticText* m_staticTextBeta;
+        wxStaticText* m_staticText911;
+        wxSlider*     m_codec2LPCPostFilterGamma;
+        wxStaticText* m_staticTextGamma;
+        wxButton*     m_LPCPostFilterDefault;
+
+        wxStdDialogButtonSizer* m_sdbSizer5;
+        wxButton*     m_sdbSizer5OK;
+        wxButton*     m_sdbSizer5Cancel;
+        PlotSpectrum* m_MicInFreqRespPlot;
+        PlotSpectrum* m_SpkOutFreqRespPlot;
+        
+        wxCheckBox*   m_MicInEnable;
+        wxButton*     m_MicInDefault;
+        wxCheckBox*   m_SpkOutEnable;
+        wxButton*     m_SpkOutDefault;
+
+        float        *m_MicInMagdB;
+        float        *m_SpkOutMagdB;
+
+     private:
+        bool          m_running;
+        float         m_beta;
+        float         m_gamma;
+
+        void          setBeta(void);  // sets slider and static text from m_beta
+        void          setGamma(void); // sets slider and static text from m_gamma
+        void          setCodec2(void);
+        void          newEQControl(wxSlider** slider, wxStaticText** value, wxStaticBoxSizer *bs, wxString controlName);
+        EQ            newEQ(wxSizer *bs, wxString eqName, float maxFreqHz, bool enableQ);
+        void          newLPCPFControl(wxSlider **slider, wxStaticText **stValue, wxSizer *sbs, wxString controlName);
+        wxAuiNotebook *m_auiNotebook;
+        void          setFreq(EQ *eq);
+        void          setGain(EQ *eq);
+        void          setQ(EQ *eq);
+        void          sliderToFreq(EQ *eq, bool micIn);
+        void          sliderToGain(EQ *eq, bool micIn);
+        void          sliderToQ(EQ *eq, bool micIn);
+        void          plotFilterSpectrum(EQ *eqBass, EQ *eqMid, EQ* eqTreble, PlotSpectrum* freqRespPlot, float *magdB);
+        void          calcFilterSpectrum(float magdB[], int arc, char *argv[]);
+        void          plotMicInFilterSpectrum(void);
+        void          plotSpkOutFilterSpectrum(void);
+        void          adjRunTimeMicInFilter(void);
+        void          adjRunTimeSpkOutFilter(void);
+
+        EQ            m_MicInBass;
+        EQ            m_MicInMid;
+        EQ            m_MicInTreble;
+
+        EQ            m_SpkOutBass;
+        EQ            m_SpkOutMid;
+        EQ            m_SpkOutTreble;
+
+        float         limit(float value, float min, float max);
+        bool          *m_newMicInFilter;
+        bool          *m_newSpkOutFilter;
+
+};
+
+#endif // __FILTER_DIALOG__
diff --git a/freedv/branches/0.97/src/dlg_options.cpp b/freedv/branches/0.97/src/dlg_options.cpp
new file mode 100644 (file)
index 0000000..6acca11
--- /dev/null
@@ -0,0 +1,309 @@
+//==========================================================================
+// Name:            dlg_options.cpp
+// Purpose:         Dialog for controlling misc FreeDV options
+// Date:            May 24 2013
+// 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+
+#include "dlg_options.h"
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class OptionsDlg
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+OptionsDlg::OptionsDlg(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* bSizer30;
+    bSizer30 = new wxBoxSizer(wxVERTICAL);
+
+    //------------------------------
+    // Test Frames check box
+    //------------------------------
+
+    wxStaticBoxSizer* sbSizer_testFrames;
+    wxStaticBox *sb_testFrames = new wxStaticBox(this, wxID_ANY, _("Test Frames"));
+    sbSizer_testFrames = new wxStaticBoxSizer(sb_testFrames, wxVERTICAL);
+
+    m_ckboxTestFrame = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
+    sb_testFrames->SetToolTip(_("Send frames of known bits instead of compressed voice"));
+    sbSizer_testFrames->Add(m_ckboxTestFrame, 0, wxALIGN_LEFT, 0);
+
+    bSizer30->Add(sbSizer_testFrames,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
+
+    //------------------------------
+    // Txt Msg Text Box
+    //------------------------------
+
+    wxStaticBoxSizer* sbSizer_callSign;
+    sbSizer_callSign = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Txt Msg")), wxVERTICAL);
+
+    m_txtCtrlCallSign = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
+    m_txtCtrlCallSign->SetToolTip(_("Txt Msg you can send along with Voice"));
+    sbSizer_callSign->Add(m_txtCtrlCallSign, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3);
+
+    bSizer30->Add(sbSizer_callSign,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
+    //------------------------------
+    // Txt Encoding 
+    //------------------------------
+
+    wxStaticBoxSizer* sbSizer_encoding = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Text Encoding")), wxHORIZONTAL);
+
+    m_rb_textEncoding1 = new wxRadioButton( this, wxID_ANY, wxT("Long varicode"), wxDefaultPosition, wxDefaultSize, 0);
+    m_rb_textEncoding1->SetValue(true);
+    sbSizer_encoding->Add(m_rb_textEncoding1, 0, wxALIGN_LEFT|wxALL, 1);
+    m_rb_textEncoding2 = new wxRadioButton( this, wxID_ANY, wxT("Short Varicode"), wxDefaultPosition, wxDefaultSize, 0);
+    sbSizer_encoding->Add(m_rb_textEncoding2, 0, wxALIGN_LEFT|wxALL, 1);
+
+    bSizer30->Add(sbSizer_encoding,0, wxALL|wxEXPAND, 3);
+    //------------------------------
+    // Event processing
+    //------------------------------
+
+    wxStaticBoxSizer* sbSizer_events;
+    wxStaticBox *sb_events = new wxStaticBox(this, wxID_ANY, _("Event Processing"));
+    sbSizer_events = new wxStaticBoxSizer(sb_events, wxVERTICAL);
+
+    // event processing enable and spam timer
+
+    wxStaticBoxSizer* sbSizer_events_top;
+    wxStaticBox* sb_events1 = new wxStaticBox(this, wxID_ANY, _(""));    
+    sbSizer_events_top = new wxStaticBoxSizer(sb_events1, wxHORIZONTAL);
+
+    m_ckbox_events = new wxCheckBox(this, wxID_ANY, _("Enable System Calls    Syscall Spam Timer"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
+    sb_events->SetToolTip(_("Enable processing of events and generation of system calls"));
+    sbSizer_events_top->Add(m_ckbox_events, 0, 0, 5);
+    m_txt_spam_timer = new wxTextCtrl(this, wxID_ANY,  wxEmptyString, wxDefaultPosition, wxSize(40,-1), 0, wxTextValidator(wxFILTER_DIGITS));
+    m_txt_spam_timer->SetToolTip(_("Many matching events can cause a flood of syscalls. Set minimum time (seconds) between syscalls for each event here"));
+    sbSizer_events_top->Add(m_txt_spam_timer, 0, 0, 5);
+    m_rb_spam_timer = new wxRadioButton( this, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
+    m_rb_spam_timer->SetForegroundColour( wxColour(0, 255, 0 ) );
+    sbSizer_events_top->Add(m_rb_spam_timer, 0, 0, 10);
+    sbSizer_events->Add(sbSizer_events_top, 0, 0, 5);
+
+    // list of regexps
+
+    wxStaticBoxSizer* sbSizer_regexp = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Regular Expressions to Process Events")), wxHORIZONTAL);
+    m_txt_events_regexp_match = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(200,100), wxTE_MULTILINE);
+    m_txt_events_regexp_match->SetToolTip(_("Enter regular expressions to match events"));
+    sbSizer_regexp->Add(m_txt_events_regexp_match, 1, wxEXPAND, 5);
+    m_txt_events_regexp_replace = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(200,100), wxTE_MULTILINE);
+    m_txt_events_regexp_replace->SetToolTip(_("Enter regular expressions to replace events"));
+    sbSizer_regexp->Add(m_txt_events_regexp_replace, 1, wxEXPAND, 5);
+    sbSizer_events->Add(sbSizer_regexp, 1, wxEXPAND, 5);
+
+    // log of events and responses
+
+    wxStaticBoxSizer* sbSizer_event_log = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Log of Events and Responses")), wxVERTICAL);
+    wxBoxSizer* bSizer33 = new wxBoxSizer(wxHORIZONTAL);
+    m_txt_events_in = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(200,50), wxTE_MULTILINE | wxTE_READONLY);
+    bSizer33->Add(m_txt_events_in, 1, wxEXPAND, 5);
+    m_txt_events_out = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(200,50), wxTE_MULTILINE | wxTE_READONLY);
+    bSizer33->Add(m_txt_events_out, 1, wxEXPAND, 5);
+    sbSizer_event_log->Add(bSizer33, 1, wxEXPAND, 5);
+    sbSizer_events->Add(sbSizer_event_log, 1, wxEXPAND, 5);
+
+    bSizer30->Add(sbSizer_events,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
+
+    //------------------------------
+    // UDP control port
+    //------------------------------
+
+    wxStaticBoxSizer* sbSizer_udp;
+    wxStaticBox* sb_udp = new wxStaticBox(this, wxID_ANY, _("UDP Control Port"));
+    sbSizer_udp = new wxStaticBoxSizer(sb_udp, wxHORIZONTAL);
+    m_ckbox_udp_enable = new wxCheckBox(this, wxID_ANY, _("Enable UDP Control Port    UDP Port Number:"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
+    sb_udp->SetToolTip(_("Enable control of FreeDV via UDP port"));
+    sbSizer_udp->Add(m_ckbox_udp_enable, 0,  wxALIGN_CENTER_HORIZONTAL, 5);
+    m_txt_udp_port = new wxTextCtrl(this, wxID_ANY,  wxEmptyString, wxDefaultPosition, wxSize(50,-1), 0, wxTextValidator(wxFILTER_DIGITS));
+    sbSizer_udp->Add(m_txt_udp_port, 0, wxALIGN_CENTER_HORIZONTAL, 5);
+
+    bSizer30->Add(sbSizer_udp,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
+
+    //------------------------------
+    // OK - Cancel - Apply Buttons 
+    //------------------------------
+
+    wxBoxSizer* bSizer31 = new wxBoxSizer(wxHORIZONTAL);
+
+    m_sdbSizer5OK = new wxButton(this, wxID_OK);
+    bSizer31->Add(m_sdbSizer5OK, 0, wxALL, 2);
+
+    m_sdbSizer5Cancel = new wxButton(this, wxID_CANCEL);
+    bSizer31->Add(m_sdbSizer5Cancel, 0, wxALL, 2);
+
+    m_sdbSizer5Apply = new wxButton(this, wxID_APPLY);
+    bSizer31->Add(m_sdbSizer5Apply, 0, wxALL, 2);
+
+    bSizer30->Add(bSizer31, 0, wxALIGN_RIGHT|wxALL, 0);
+
+    this->SetSizer(bSizer30);
+    this->Layout();
+
+    this->Centre(wxBOTH);
+    // Connect Events -------------------------------------------------------
+
+    this->Connect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(OptionsDlg::OnInitDialog));
+
+    m_sdbSizer5OK->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsDlg::OnOK), NULL, this);
+    m_sdbSizer5Cancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsDlg::OnCancel), NULL, this);
+    m_sdbSizer5Apply->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsDlg::OnApply), NULL, this);
+
+    event_in_serial = 0;
+    event_out_serial = 0;
+}
+
+//-------------------------------------------------------------------------
+// ~OptionsDlg()
+//-------------------------------------------------------------------------
+OptionsDlg::~OptionsDlg()
+{
+    // Disconnect Events
+
+    this->Disconnect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(OptionsDlg::OnInitDialog));
+
+    m_sdbSizer5OK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsDlg::OnOK), NULL, this);
+    m_sdbSizer5Cancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsDlg::OnCancel), NULL, this);
+    m_sdbSizer5Apply->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsDlg::OnApply), NULL, this);
+}
+
+
+//-------------------------------------------------------------------------
+// ExchangeData()
+//-------------------------------------------------------------------------
+void OptionsDlg::ExchangeData(int inout, bool storePersistent)
+{
+    wxConfigBase *pConfig = wxConfigBase::Get();
+
+    if(inout == EXCHANGE_DATA_IN)
+    {
+        m_txtCtrlCallSign->SetValue(wxGetApp().m_callSign);
+        m_ckboxTestFrame->SetValue(wxGetApp().m_testFrames);
+
+        m_ckbox_events->SetValue(wxGetApp().m_events);
+        m_txt_spam_timer->SetValue(wxString::Format(wxT("%i"),wxGetApp().m_events_spam_timer));
+
+        m_txt_events_regexp_match->SetValue(wxGetApp().m_events_regexp_match);
+        m_txt_events_regexp_replace->SetValue(wxGetApp().m_events_regexp_replace);
+        
+        m_ckbox_udp_enable->SetValue(wxGetApp().m_udp_enable);
+        m_txt_udp_port->SetValue(wxString::Format(wxT("%i"),wxGetApp().m_udp_port));
+
+        if (wxGetApp().m_textEncoding == 1)
+            m_rb_textEncoding1->SetValue(true);
+        if (wxGetApp().m_textEncoding == 2)
+            m_rb_textEncoding2->SetValue(true);
+    }
+
+    if(inout == EXCHANGE_DATA_OUT)
+    {
+        wxGetApp().m_callSign      = m_txtCtrlCallSign->GetValue();
+        wxGetApp().m_testFrames    = m_ckboxTestFrame->GetValue();
+
+        wxGetApp().m_events        = m_ckbox_events->GetValue();
+        long spam_timer;
+        m_txt_spam_timer->GetValue().ToLong(&spam_timer);
+        wxGetApp().m_events_spam_timer = (int)spam_timer;
+
+        // make sure regexp lists are terminated by a \n
+
+        if (m_txt_events_regexp_match->GetValue().Last() != '\n') {
+            m_txt_events_regexp_match->SetValue(m_txt_events_regexp_match->GetValue()+'\n');
+        }
+        if (m_txt_events_regexp_replace->GetValue().Last() != '\n') {
+            m_txt_events_regexp_replace->SetValue(m_txt_events_regexp_replace->GetValue()+'\n');
+        }
+        wxGetApp().m_events_regexp_match = m_txt_events_regexp_match->GetValue();
+        wxGetApp().m_events_regexp_replace = m_txt_events_regexp_replace->GetValue();
+        wxGetApp().m_udp_enable     = m_ckbox_udp_enable->GetValue();
+        long port;
+        m_txt_udp_port->GetValue().ToLong(&port);
+        wxGetApp().m_udp_port       = (int)port;
+
+        if (m_rb_textEncoding1->GetValue())
+            wxGetApp().m_textEncoding = 1;
+        if (m_rb_textEncoding2->GetValue())
+            wxGetApp().m_textEncoding = 2;
+
+        if (storePersistent) {
+            pConfig->Write(wxT("/Data/CallSign"), wxGetApp().m_callSign);
+            pConfig->Write(wxT("/Data/TextEncoding"), wxGetApp().m_textEncoding);
+
+            pConfig->Write(wxT("/Events/enable"), wxGetApp().m_events);
+            pConfig->Write(wxT("/Events/spam_timer"), wxGetApp().m_events_spam_timer);
+            pConfig->Write(wxT("/Events/regexp_match"), wxGetApp().m_events_regexp_match);
+            pConfig->Write(wxT("/Events/regexp_replace"), wxGetApp().m_events_regexp_replace);
+            
+            pConfig->Write(wxT("/UDP/enable"), wxGetApp().m_udp_enable);
+            pConfig->Write(wxT("/UDP/port"),  wxGetApp().m_udp_port);
+
+            pConfig->Flush();
+        }
+    }
+    delete wxConfigBase::Set((wxConfigBase *) NULL);
+}
+
+//-------------------------------------------------------------------------
+// OnOK()
+//-------------------------------------------------------------------------
+void OptionsDlg::OnOK(wxCommandEvent& event)
+{
+    ExchangeData(EXCHANGE_DATA_OUT, true);
+    //this->EndModal(wxID_OK);
+    this->Show(false);
+}
+
+//-------------------------------------------------------------------------
+// OnCancel()
+//-------------------------------------------------------------------------
+void OptionsDlg::OnCancel(wxCommandEvent& event)
+{
+    //this->EndModal(wxID_CANCEL);
+    this->Show(false);
+}
+
+//-------------------------------------------------------------------------
+// OnApply()
+//-------------------------------------------------------------------------
+void OptionsDlg::OnApply(wxCommandEvent& event)
+{
+    ExchangeData(EXCHANGE_DATA_OUT, true);
+}
+
+//-------------------------------------------------------------------------
+// OnInitDialog()
+//-------------------------------------------------------------------------
+void OptionsDlg::OnInitDialog(wxInitDialogEvent& event)
+{
+    ExchangeData(EXCHANGE_DATA_IN, false);
+}
+
+
+void OptionsDlg::updateEventLog(wxString event_in, wxString event_out) {
+    wxString event_in_with_serial, event_out_with_serial; 
+    event_in_with_serial.Printf(_T("[%d] %s"), event_in_serial++, event_in);
+    event_out_with_serial.Printf(_T("[%d] %s"), event_out_serial++, event_out);
+
+    m_txt_events_in->AppendText(event_in_with_serial+"\n");
+    m_txt_events_out->AppendText(event_out_with_serial+"\n");
+}
+
diff --git a/freedv/branches/0.97/src/dlg_options.h b/freedv/branches/0.97/src/dlg_options.h
new file mode 100644 (file)
index 0000000..bfe30d4
--- /dev/null
@@ -0,0 +1,94 @@
+//==========================================================================
+// Name:            dlg_options.h
+// Purpose:         Dialog for controlling misc FreeDV options
+// Created:         Nov 25 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+
+#ifndef __OPTIONS_DIALOG__
+#define __OPTIONS_DIALOG__
+
+#include "fdmdv2_main.h"
+#include "fdmdv2_defines.h"
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class OptionsDlg
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class OptionsDlg : public wxDialog
+{
+    public:
+    OptionsDlg( wxWindow* parent,
+               wxWindowID id = wxID_ANY, const wxString& title = _("Options"), 
+                const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(600,580), 
+               long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
+        ~OptionsDlg();
+
+        void    ExchangeData(int inout, bool storePersistent);
+        void    updateEventLog(wxString event_in, wxString event_out);
+
+        bool    enableEventsChecked() {return m_ckbox_events->GetValue();}
+
+        void SetSpamTimerLight(bool state) {
+
+            // Colours don't work on Windows
+
+            if (state) {
+                m_rb_spam_timer->SetForegroundColour( wxColour( 255,0 , 0 ) ); // red
+                m_rb_spam_timer->SetValue(true);
+            }
+            else {
+                m_rb_spam_timer->SetForegroundColour( wxColour( 0, 255, 0 ) ); // green
+                m_rb_spam_timer->SetValue(false);
+            }
+        }
+
+
+    protected:
+        // Handlers for events.
+        void    OnOK(wxCommandEvent& event);
+        void    OnCancel(wxCommandEvent& event);
+        void    OnApply(wxCommandEvent& event);
+        void    OnClose(wxCloseEvent& event);
+        void    OnInitDialog(wxInitDialogEvent& event);
+        wxTextCtrl   *m_txtCtrlCallSign; // TODO: this should be renamed to tx_txtmsg, and rename all related incl persis strge
+        wxCheckBox   *m_ckboxTestFrame;
+
+        wxRadioButton *m_rb_textEncoding1;
+        wxRadioButton *m_rb_textEncoding2;
+
+        wxCheckBox   *m_ckbox_events;
+        wxTextCtrl   *m_txt_events_regexp_match;
+        wxTextCtrl   *m_txt_events_regexp_replace;
+        wxTextCtrl   *m_txt_events_in;
+        wxTextCtrl   *m_txt_events_out;
+        wxTextCtrl   *m_txt_spam_timer;
+        wxRadioButton *m_rb_spam_timer;
+
+        wxCheckBox   *m_ckbox_udp_enable;
+        wxTextCtrl   *m_txt_udp_port;
+
+        wxButton*     m_sdbSizer5OK;
+        wxButton*     m_sdbSizer5Cancel;
+        wxButton*     m_sdbSizer5Apply;
+
+        unsigned int  event_in_serial, event_out_serial;
+
+     private:
+};
+
+#endif // __OPTIONS_DIALOG__
diff --git a/freedv/branches/0.97/src/dlg_ptt.cpp b/freedv/branches/0.97/src/dlg_ptt.cpp
new file mode 100644 (file)
index 0000000..2643c1d
--- /dev/null
@@ -0,0 +1,416 @@
+//==========================================================================
+// Name:            dlg_ptt.cpp
+// Purpose:         Subclasses dialog GUI for PTT Config. Creates simple 
+//                  wxWidgets dialog GUI to select real/virtual Comm ports.
+// Date:            May 11 2012
+// Authors:         David Rowe, David Witten, Joel Stanley
+// 
+// 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#include "dlg_ptt.h"
+#include "fdmdv2_main.h"
+
+#ifdef __WIN32__
+#include <wx/msw/registry.h>
+#endif
+#ifdef __FreeBSD__
+#include <glob.h>
+#include <string.h>
+#endif
+
+#include <sstream>
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class ComPortsDlg
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+ComPortsDlg::ComPortsDlg(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style)
+{
+    wxBoxSizer* mainSizer = new wxBoxSizer(wxVERTICAL);
+    this->SetSizer(mainSizer);
+    
+    //----------------------------------------------------------------------
+    // Half Duplex Flag for VOX PTT
+    //----------------------------------------------------------------------
+
+    // DR: should this be on options dialog?
+
+    wxStaticBoxSizer* staticBoxSizer28 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("VOX PTT Settings")), wxHORIZONTAL);
+    m_ckHalfDuplex = new wxCheckBox(this, wxID_ANY, _("Half Duplex"), wxDefaultPosition, wxSize(-1,-1), 0);
+    staticBoxSizer28->Add(m_ckHalfDuplex, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
+    m_ckLeftChannelVoxTone = new wxCheckBox(this, wxID_ANY, _("Left Channel Vox Tone"), wxDefaultPosition, wxSize(-1,-1), 0);
+    staticBoxSizer28->Add(m_ckLeftChannelVoxTone, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
+
+    mainSizer->Add(staticBoxSizer28, 0, wxEXPAND, 5);
+
+    //----------------------------------------------------------------------
+    // Hamlib for CAT PTT
+    //----------------------------------------------------------------------
+
+    wxStaticBoxSizer* staticBoxSizer18 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("Hamlib Settings")), wxVERTICAL);
+
+    wxBoxSizer* gridSizer100 = new wxBoxSizer(wxHORIZONTAL);
+
+    /* Use Hamlib for PTT checkbox. */
+    m_ckUseHamlibPTT = new wxCheckBox(this, wxID_ANY, _("Use Hamlib PTT"), wxDefaultPosition, wxSize(-1, -1), 0);
+    m_ckUseHamlibPTT->SetValue(false);
+    gridSizer100->Add(m_ckUseHamlibPTT, 0, wxALIGN_CENTER_VERTICAL, 0);
+
+    /* Hamlib Rig Type combobox. */
+    gridSizer100->Add(new wxStaticText(this, wxID_ANY, _("Rig Model:"), wxDefaultPosition, wxDefaultSize, 0), 
+                      0, wxALIGN_CENTER_VERTICAL | wxLEFT, 20);
+    m_cbRigName = new wxComboBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(250, -1), 0, NULL, wxCB_DROPDOWN);
+    /* TODO(Joel): this is a hack. At the least, need to gurantee that m_hamLib
+     * exists. */
+    wxGetApp().m_hamlib->populateComboBox(m_cbRigName);
+    m_cbRigName->SetSelection(wxGetApp().m_intHamlibRig);
+    gridSizer100->Add(m_cbRigName, 0, wxALIGN_CENTER_VERTICAL, 0);
+
+    /* Hamlib Serial Port combobox. */
+    gridSizer100->Add(new wxStaticText(this, wxID_ANY, _("Serial Device:"), wxDefaultPosition, wxDefaultSize, 0), 
+                      0, wxALIGN_CENTER_VERTICAL | wxLEFT, 20);
+    m_cbSerialPort = new wxComboBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(140, -1), 0, NULL, wxCB_DROPDOWN);
+    gridSizer100->Add(m_cbSerialPort, 0, wxALIGN_CENTER_VERTICAL, 0);
+
+    staticBoxSizer18->Add(gridSizer100, 1);
+    mainSizer->Add(staticBoxSizer18, 1);
+
+    //----------------------------------------------------------------------
+    // Serial port PTT
+    //----------------------------------------------------------------------
+
+    wxStaticBoxSizer* staticBoxSizer17 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("Serial Port Settings")), wxVERTICAL);
+    mainSizer->Add(staticBoxSizer17, 1, wxEXPAND, 5);
+    wxStaticBoxSizer* staticBoxSizer31 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("PTT Port")), wxVERTICAL);
+    staticBoxSizer17->Add(staticBoxSizer31, 1, wxEXPAND, 5);
+
+#ifdef __WXMSW__
+    m_ckUseSerialPTT = new wxCheckBox(this, wxID_ANY, _("Use Serial Port PTT"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_ckUseSerialPTT->SetValue(false);
+    staticBoxSizer31->Add(m_ckUseSerialPTT, 0, wxALIGN_LEFT, 20);
+
+    wxArrayString m_listCtrlPortsArr;
+    m_listCtrlPorts = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxSize(-1,45), m_listCtrlPortsArr, wxLB_SINGLE | wxLB_SORT);
+    staticBoxSizer31->Add(m_listCtrlPorts, 1, wxALIGN_CENTER, 0);
+#endif
+
+#ifdef __WXGTK__
+    wxBoxSizer* bSizer83;
+    bSizer83 = new wxBoxSizer(wxHORIZONTAL);
+
+    wxGridSizer* gridSizer200 = new wxGridSizer(1, 3, 0, 0);
+    
+    m_ckUseSerialPTT = new wxCheckBox(this, wxID_ANY, _("Use Serial Port PTT"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_ckUseSerialPTT->SetValue(false);
+    gridSizer200->Add(m_ckUseSerialPTT, 1, wxALIGN_CENTER|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 2);
+
+    m_staticText12 = new wxStaticText(this, wxID_ANY, _("Serial Device:  "), wxDefaultPosition, wxDefaultSize, 0);
+    m_staticText12->Wrap(-1);
+    gridSizer200->Add(m_staticText12, 1,wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 2);
+
+    m_cbCtlDevicePath = new wxComboBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(140, -1), 0, NULL, wxCB_DROPDOWN);
+    gridSizer200->Add(m_cbCtlDevicePath, 1, wxEXPAND|wxALIGN_CENTER|wxALIGN_RIGHT, 2);
+    
+    bSizer83->Add(gridSizer200, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT | wxALL, 2);
+    staticBoxSizer31->Add(bSizer83, 1, wxALIGN_CENTER_VERTICAL|wxALL, 1);
+#endif
+
+    wxBoxSizer* boxSizer19 = new wxBoxSizer(wxVERTICAL);
+    staticBoxSizer17->Add(boxSizer19, 1, wxEXPAND, 5);
+    wxStaticBoxSizer* staticBoxSizer16 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("Signal polarity")), wxHORIZONTAL);
+    boxSizer19->Add(staticBoxSizer16, 1, wxEXPAND|wxALIGN_CENTER|wxALIGN_RIGHT, 5);
+
+    wxGridSizer* gridSizer17 = new wxGridSizer(2, 2, 0, 0);
+    staticBoxSizer16->Add(gridSizer17, 1, wxEXPAND|wxALIGN_RIGHT, 5);
+
+    m_rbUseDTR = new wxRadioButton(this, wxID_ANY, _("Use DTR"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_rbUseDTR->SetToolTip(_("Toggle DTR line for PTT"));
+    m_rbUseDTR->SetValue(1);
+    gridSizer17->Add(m_rbUseDTR, 0, wxALIGN_CENTER|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5);
+
+    m_ckDTRPos = new wxCheckBox(this, wxID_ANY, _("DTR = +V"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_ckDTRPos->SetToolTip(_("Set Polarity of the DTR line"));
+    m_ckDTRPos->SetValue(false);
+    gridSizer17->Add(m_ckDTRPos, 0, wxALIGN_CENTER|wxALIGN_RIGHT, 5);
+
+    m_rbUseRTS = new wxRadioButton(this, wxID_ANY, _("Use RTS"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_rbUseRTS->SetToolTip(_("Toggle the RTS pin for PTT"));
+    m_rbUseRTS->SetValue(1);
+    gridSizer17->Add(m_rbUseRTS, 0, wxALIGN_CENTER|wxALIGN_RIGHT, 5);
+
+    m_ckRTSPos = new wxCheckBox(this, wxID_ANY, _("RTS = +V"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_ckRTSPos->SetValue(false);
+    m_ckRTSPos->SetToolTip(_("Set Polarity of the RTS line"));
+    gridSizer17->Add(m_ckRTSPos, 0, wxALIGN_CENTER|wxALIGN_RIGHT, 5);
+
+    //----------------------------------------------------------------------
+    // OK - Cancel - Apply
+    //----------------------------------------------------------------------
+
+    wxBoxSizer* boxSizer12 = new wxBoxSizer(wxHORIZONTAL);
+
+    m_buttonOK = new wxButton(this, wxID_OK, _("OK"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_buttonOK->SetDefault();
+    boxSizer12->Add(m_buttonOK, 0, wxLEFT|wxRIGHT|wxTOP|wxBOTTOM, 5);
+
+    m_buttonCancel = new wxButton(this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxSize(-1,-1), 0);
+    boxSizer12->Add(m_buttonCancel, 0, wxLEFT|wxRIGHT|wxTOP|wxBOTTOM, 5);
+
+    m_buttonApply = new wxButton(this, wxID_APPLY, _("Apply"), wxDefaultPosition, wxSize(-1,-1), 0);
+    boxSizer12->Add(m_buttonApply, 0, wxLEFT|wxRIGHT|wxTOP|wxBOTTOM, 5);
+
+    mainSizer->Add(boxSizer12, 0, wxLEFT|wxRIGHT|wxTOP|wxBOTTOM|wxALIGN_CENTER_HORIZONTAL, 5);
+
+    if ( GetSizer() ) 
+    {
+         GetSizer()->Fit(this);
+    }
+    Centre(wxBOTH);
+
+    // Connect events
+    this->Connect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(ComPortsDlg::OnInitDialog), NULL, this);
+    m_ckUseHamlibPTT->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(ComPortsDlg::PTTUseHamLibClicked), NULL, this);
+    m_ckUseSerialPTT->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(ComPortsDlg::PTTUseSerialClicked), NULL, this);
+    m_buttonOK->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnOK), NULL, this);
+    m_buttonCancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnCancel), NULL, this);
+    m_buttonApply->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnApply), NULL, this);
+}
+
+//-------------------------------------------------------------------------
+// ~ComPortsDlg()
+//-------------------------------------------------------------------------
+ComPortsDlg::~ComPortsDlg()
+{
+    // Disconnect Events
+    this->Disconnect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(ComPortsDlg::OnInitDialog), NULL, this);
+    m_ckUseHamlibPTT->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(ComPortsDlg::PTTUseHamLibClicked), NULL, this);
+    m_ckUseSerialPTT->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(ComPortsDlg::PTTUseSerialClicked), NULL, this);
+    m_buttonOK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnOK), NULL, this);
+    m_buttonCancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnCancel), NULL, this);
+    m_buttonApply->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnApply), NULL, this);
+}
+
+//-------------------------------------------------------------------------
+// OnInitDialog()
+//-------------------------------------------------------------------------
+void ComPortsDlg::OnInitDialog(wxInitDialogEvent& event)
+{
+    populatePortList();
+    ExchangeData(EXCHANGE_DATA_IN);
+}
+
+//-------------------------------------------------------------------------
+// populatePortList()
+//-------------------------------------------------------------------------
+void ComPortsDlg::populatePortList()
+{
+#ifdef __WXMSW__
+    m_listCtrlPorts->Clear();
+    m_cbSerialPort->Clear();
+    wxArrayString aStr;
+    wxRegKey key(wxRegKey::HKLM, _T("HARDWARE\\DEVICEMAP\\SERIALCOMM"));
+    if(!key.Exists())
+    {
+        return;
+    }
+    else
+    {
+        // Get the number of subkeys and enumerate them.
+        if(!key.Open(wxRegKey::Read))
+        {
+            return;
+        }    
+        size_t subkeys;
+        size_t values;
+        if(!key.GetKeyInfo(&subkeys, NULL, &values, NULL))
+        {
+            return;
+        }
+        if(!key.HasValues())
+        {
+            return;
+        }
+        wxString key_name;
+        long el = 1;
+        key.GetFirstValue(key_name, el);
+        wxString valType;
+        wxString key_data;
+        for(unsigned int i = 0; i < values; i++)
+        {
+            key.QueryValue(key_name, key_data);
+            //wxPrintf("Value:  %s Data: %s\n", key_name, key_data);
+            aStr.Add(key_data, 1);
+            key.GetNextValue(key_name, el);
+        }
+    }
+    m_listCtrlPorts->Append(aStr);
+    m_cbSerialPort->Append(aStr);
+#endif
+#ifdef __WXGTK__
+    m_cbSerialPort->Clear();
+    m_cbCtlDevicePath->Clear();
+#ifdef __FreeBSD__
+       glob_t  gl;
+       if(glob("/dev/tty*", GLOB_MARK, NULL, &gl)==0) {
+               for(unsigned int i=0; i<gl.gl_pathc; i++) {
+                       if(gl.gl_pathv[i][strlen(gl.gl_pathv[i])-1]=='/')
+                               continue;
+                               
+                       /* Exclude pseudo TTYs */
+                       if(gl.gl_pathv[i][8] >= 'l' && gl.gl_pathv[i][8] <= 's')
+                               continue;
+                       if(gl.gl_pathv[i][8] >= 'L' && gl.gl_pathv[i][8] <= 'S')
+                               continue;
+
+                       /* Exclude virtual TTYs */
+                       if(gl.gl_pathv[i][8] == 'v')
+                               continue;
+
+                       /* Exclude initial-state and lock-state devices */
+                       if(strchr(gl.gl_pathv[i], '.') != NULL)
+                               continue;
+
+                       m_cbSerialPort->Append(gl.gl_pathv[i]);
+                       m_cbCtlDevicePath->Append(gl.gl_pathv[i]);
+               }
+               globfree(&gl);
+       }
+#else
+    /* TODO(Joel): http://stackoverflow.com/questions/2530096/how-to-find-all-serial-devices-ttys-ttyusb-on-linux-without-opening-them */
+    m_cbSerialPort->Append("/dev/ttyUSB0");
+    m_cbSerialPort->Append("/dev/ttyUSB1");
+    m_cbSerialPort->Append("/dev/ttyS0");
+    m_cbSerialPort->Append("/dev/ttyS1");
+    m_cbCtlDevicePath->Clear();
+    m_cbCtlDevicePath->Append("/dev/ttyUSB0");
+    m_cbCtlDevicePath->Append("/dev/ttyUSB1");
+    m_cbCtlDevicePath->Append("/dev/ttyS0");
+    m_cbCtlDevicePath->Append("/dev/ttyS1");
+#endif
+#endif
+}
+
+//-------------------------------------------------------------------------
+// ExchangeData()
+//-------------------------------------------------------------------------
+void ComPortsDlg::ExchangeData(int inout)
+{
+    wxConfigBase *pConfig = wxConfigBase::Get();
+    wxString str;
+    
+    if(inout == EXCHANGE_DATA_IN)
+    {
+        m_ckHalfDuplex->SetValue(wxGetApp().m_boolHalfDuplex);
+        m_ckLeftChannelVoxTone->SetValue(wxGetApp().m_leftChannelVoxTone);
+
+        m_ckUseHamlibPTT->SetValue(wxGetApp().m_boolHamlibUseForPTT);
+        m_cbRigName->SetSelection(wxGetApp().m_intHamlibRig);
+        m_cbSerialPort->SetValue(wxGetApp().m_strHamlibSerialPort);
+
+        m_ckUseSerialPTT->SetValue(wxGetApp().m_boolUseSerialPTT);
+        str = wxGetApp().m_strRigCtrlPort;
+#ifdef __WXMSW__
+        m_listCtrlPorts->SetStringSelection(str);
+#endif
+#ifdef __WXGTK__
+        m_cbCtlDevicePath->SetValue(str);
+#endif
+        m_rbUseRTS->SetValue(wxGetApp().m_boolUseRTS);
+        m_ckRTSPos->SetValue(wxGetApp().m_boolRTSPos);
+        m_rbUseDTR->SetValue(wxGetApp().m_boolUseDTR);
+        m_ckDTRPos->SetValue(wxGetApp().m_boolDTRPos);
+    }
+    if(inout == EXCHANGE_DATA_OUT)
+    {
+        wxGetApp().m_boolHalfDuplex = m_ckHalfDuplex->GetValue();
+        pConfig->Write(wxT("/Rig/HalfDuplex"), wxGetApp().m_boolHalfDuplex);
+        wxGetApp().m_leftChannelVoxTone = m_ckLeftChannelVoxTone->GetValue();
+        pConfig->Write(wxT("/Rig/leftChannelVoxTone"), wxGetApp().m_leftChannelVoxTone);
+
+        /* Hamlib settings. */
+
+        wxGetApp().m_boolHamlibUseForPTT = m_ckUseHamlibPTT->GetValue();
+        wxGetApp().m_intHamlibRig = m_cbRigName->GetSelection();
+        wxGetApp().m_strHamlibSerialPort = m_cbSerialPort->GetValue();
+
+        pConfig->Write(wxT("/Hamlib/UseForPTT"), wxGetApp().m_boolHamlibUseForPTT);
+        pConfig->Write(wxT("/Hamlib/RigName"), wxGetApp().m_intHamlibRig);
+        pConfig->Write(wxT("/Hamlib/SerialPort"), wxGetApp().m_strHamlibSerialPort);
+
+        /* Serial settings */
+
+        wxGetApp().m_boolUseSerialPTT           = m_ckUseSerialPTT->IsChecked();
+#ifdef __WXMSW__
+        wxGetApp().m_strRigCtrlPort             = m_listCtrlPorts->GetStringSelection();
+#endif
+#ifdef __WXGTK__
+        wxGetApp().m_strRigCtrlPort             = m_cbCtlDevicePath->GetValue();
+#endif
+        wxGetApp().m_boolUseRTS                 = m_rbUseRTS->GetValue();
+        wxGetApp().m_boolRTSPos                 = m_ckRTSPos->IsChecked();
+        wxGetApp().m_boolUseDTR                 = m_rbUseDTR->GetValue();
+        wxGetApp().m_boolDTRPos                 = m_ckDTRPos->IsChecked();
+        
+        pConfig->Write(wxT("/Rig/UseSerialPTT"),    wxGetApp().m_boolUseSerialPTT);
+        pConfig->Write(wxT("/Rig/Port"),            wxGetApp().m_strRigCtrlPort); 
+        pConfig->Write(wxT("/Rig/UseRTS"),          wxGetApp().m_boolUseRTS);
+        pConfig->Write(wxT("/Rig/RTSPolarity"),     wxGetApp().m_boolRTSPos);
+        pConfig->Write(wxT("/Rig/UseDTR"),          wxGetApp().m_boolUseDTR);
+        pConfig->Write(wxT("/Rig/DTRPolarity"),     wxGetApp().m_boolDTRPos);
+
+        pConfig->Flush();
+    }
+    delete wxConfigBase::Set((wxConfigBase *) NULL);
+}
+
+//-------------------------------------------------------------------------
+// PTTUseHamLibClicked()
+//-------------------------------------------------------------------------
+void ComPortsDlg::PTTUseHamLibClicked(wxCommandEvent& event)
+{
+    m_ckUseSerialPTT->SetValue(false);    
+}
+
+//-------------------------------------------------------------------------
+// PTTUseSerialClicked()
+//-------------------------------------------------------------------------
+void ComPortsDlg::PTTUseSerialClicked(wxCommandEvent& event)
+{
+    m_ckUseHamlibPTT->SetValue(false);
+}
+
+//-------------------------------------------------------------------------
+// OnApply()
+//-------------------------------------------------------------------------
+void ComPortsDlg::OnApply(wxCommandEvent& event)
+{
+    ExchangeData(EXCHANGE_DATA_OUT);
+}
+
+//-------------------------------------------------------------------------
+// OnCancel()
+//-------------------------------------------------------------------------
+void ComPortsDlg::OnCancel(wxCommandEvent& event)
+{
+    this->EndModal(wxID_CANCEL);
+}
+
+//-------------------------------------------------------------------------
+// OnClose()
+//-------------------------------------------------------------------------
+void ComPortsDlg::OnOK(wxCommandEvent& event)
+{
+    ExchangeData(EXCHANGE_DATA_OUT);
+    this->EndModal(wxID_OK);
+}
diff --git a/freedv/branches/0.97/src/dlg_ptt.h b/freedv/branches/0.97/src/dlg_ptt.h
new file mode 100644 (file)
index 0000000..8fa9b9d
--- /dev/null
@@ -0,0 +1,91 @@
+//==========================================================================
+// Name:            dlg_ptt.h
+// Purpose:         Subclasses dialog GUI for PTT Config.
+//                  
+// Created:         May. 11, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#ifndef __COMPORTS_DIALOG__
+#define __COMPORTS_DIALOG__
+
+#include "fdmdv2_main.h"
+#include "hamlib.h"
+#include <wx/settings.h>
+#include <wx/xrc/xmlres.h>
+#include <wx/xrc/xh_bmp.h>
+#include <wx/dialog.h>
+#include <wx/sizer.h>
+#include <wx/statbox.h>
+#include <wx/checkbox.h>
+#include <wx/listbox.h>
+#include <wx/radiobut.h>
+#include <wx/button.h>
+#include <wx/spinctrl.h>
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class ComPortsDlg
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class ComPortsDlg : public wxDialog
+{
+     public:
+        ComPortsDlg(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("PTT Config"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(450,300), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER);
+        virtual ~ComPortsDlg();
+        void    ExchangeData(int inout);
+
+    protected:
+        wxCheckBox* m_ckHalfDuplex;
+        wxCheckBox* m_ckLeftChannelVoxTone;
+
+        /* Hamlib settings.*/
+
+        wxCheckBox *m_ckUseHamlibPTT;
+        wxComboBox *m_cbRigName;
+        wxComboBox *m_cbSerialPort;
+
+        Hamlib *m_hamlib;
+
+        /* Serial Settings */
+
+        wxListBox     *m_listCtrlPorts;
+        wxCheckBox    *m_ckUseSerialPTT;
+        wxStaticText  *m_staticText12;
+        wxComboBox    *m_cbCtlDevicePath;
+        wxRadioButton *m_rbUseDTR;
+        wxCheckBox    *m_ckRTSPos;
+        wxRadioButton *m_rbUseRTS;
+        wxCheckBox    *m_ckDTRPos;
+
+        /* Ok - Cancel - Apply */
+
+        wxButton* m_buttonOK;
+        wxButton* m_buttonCancel;
+        wxButton* m_buttonApply;
+
+
+protected:
+        void populatePortList();
+
+        void PTTUseHamLibClicked(wxCommandEvent& event);
+        void PTTUseSerialClicked(wxCommandEvent& event);
+
+        void OnOK(wxCommandEvent& event);
+        void OnCancel(wxCommandEvent& event);
+        void OnApply(wxCommandEvent& event);
+        virtual void OnInitDialog(wxInitDialogEvent& event);
+};
+
+#endif // __COMPORTS_DIALOG__
diff --git a/freedv/branches/0.97/src/fdmdv2_defines.h b/freedv/branches/0.97/src/fdmdv2_defines.h
new file mode 100644 (file)
index 0000000..ba11f02
--- /dev/null
@@ -0,0 +1,110 @@
+//==========================================================================
+// Name:            fdmdv2_defines.h
+// Purpose:         Definitions used by plots derived from fdmdv2_plot class.
+// Created:         August 27, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#ifndef __FDMDV2_DEFINES__
+#define __FDMDV2_DEFINES__
+
+#include "wx/wx.h"
+#include "codec2_fdmdv.h"
+
+// Spectrogram and Waterfall
+
+#define MIN_MAG_DB        -40.0     // min of spectrogram/waterfall magnitude axis
+#define MAX_MAG_DB          0.0     // max of spectrogram/waterfall magnitude axis
+#define STEP_MAG_DB         5.0     // magnitude axis step
+#define BETA                0.95    // constant for time averaging spectrum data
+#define MIN_F_HZ            0       // min freq on Waterfall and Spectrum
+#define MAX_F_HZ            3000    // max freq on Waterfall and Spectrum
+#define STEP_F_HZ           500     // major (e.g. text legend) freq step on Waterfall and Spectrum graticule
+#define STEP_MINOR_F_HZ     100     // minor (ticks) freq step on Waterfall and Spectrum graticule
+#define WATERFALL_SECS_Y    30      // number of seconds respresented by y axis of waterfall
+#define WATERFALL_SECS_STEP 5       // graticule y axis steps of waterfall
+#define DT                  0.1     // time between real time graphing updates
+#define FS                  8000    // FDMDV modem sample rate
+
+// Scatter diagram 
+
+#define SCATTER_MEM_SECS    2
+// (symbols/frame)/(graphics update period) = symbols/s sent to scatter memory
+// memory (symbols) = secs of memory * symbols/sec
+#define SCATTER_MEM_SYMS_MAX    ((int)(SCATTER_MEM_SECS*((FDMDV_NC_MAX+1)/DT)))
+
+// Waveform plotting constants
+
+#define WAVEFORM_PLOT_FS    400                            // sample rate (points/s) of waveform plotted to screen
+#define WAVEFORM_PLOT_TIME  5                              // length or entire waveform on screen
+#define WAVEFORM_PLOT_BUF   ((int)(DT*WAVEFORM_PLOT_FS))   // number of new samples we plot per DT
+
+// sample rate I/O & conversion constants
+
+#define MAX_FPB             8096                           // maximum value of portAudio framesPerBuffer
+#define PA_FPB              1024                           // nominal value of portAudio framesPerBuffer
+#define SAMPLE_RATE         48000                          // 48 kHz sampling rate rec. as we can trust accuracy of sound card
+#define N8                  FDMDV_NOM_SAMPLES_PER_FRAME    // processing buffer size at 8 kHz
+#define MEM8                (FDMDV_OS_TAPS/FDMDV_OS)
+#define N48                 (N8*FDMDV_OS)                  // processing buffer size at 48 kHz
+#define NUM_CHANNELS        2                              // I think most sound cards prefer stereo we will convert to mono
+#define VOX_TONE_FREQ       1000.0                         // optional left channel vox tone freq
+#define VOX_TONE_AMP        30000                          // optional left channel vox tone amp
+
+#define MAX_BITS_PER_CODEC_FRAME 64                            // 1600 bit/s mode
+#define MAX_BYTES_PER_CODEC_FRAME (MAX_BITS_PER_CODEC_FRAME/8)
+#define MAX_BITS_PER_FDMDV_FRAME 40                            // 2000 bit/s mode
+
+// Squelch
+#define SQ_DEFAULT_SNR      1.5
+
+// Level Gauge
+#define FROM_RADIO_MAX       0.8
+#define FROM_MIC_MAX         0.8
+#define LEVEL_BETA           0.99
+
+// SNR
+#define SNRSLOW_BETA        0.5                           // time constant for slow SNR for display
+
+// Text messaging Data
+#define MAX_CALLSIGN         80
+#define MAX_EVENT_LOG        10
+#define MAX_EVENT_RULES      100
+   
+enum
+{
+    ID_ROTATE_LEFT = wxID_HIGHEST + 1,
+    ID_ROTATE_RIGHT,
+    ID_RESIZE,
+    ID_PAINT_BG
+};
+
+// Codec 2 LPC Post Filter defaults, from codec-dev/src/quantise.c
+
+#define CODEC2_LPC_PF_GAMMA 0.5
+#define CODEC2_LPC_PF_BETA  0.2
+
+// FreeDV modes
+
+#define MODE_1400_V0_91  0   // Legacy 1400 from Dec 2012 V0.91 release with incorrect QPSK mapping
+#define MODE_1400        1   // 1400 bit/s codec, no FEC
+#define MODE_1600        2   // 1300 bit/s codec, + 300 bit/s FEC
+#define MODE_2000        3   // 1400 bit/s codec, 600 bit/s FEC on most sensitive bits, 2000 bit/s total
+#define MODE_1600_WIDE   4   // As per 2 but wide carrier spacing
+
+#define FSEP_WIDE      125
+
+#endif  //__FDMDV2_DEFINES__
diff --git a/freedv/branches/0.97/src/fdmdv2_main.cpp b/freedv/branches/0.97/src/fdmdv2_main.cpp
new file mode 100644 (file)
index 0000000..83d8b20
--- /dev/null
@@ -0,0 +1,3821 @@
+//==========================================================================
+// Name:            fdmdv2_main.cpp
+//
+// Purpose:         FreeDV main()
+// Created:         Apr. 9, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#include "fdmdv2_main.h"
+
+#define wxUSE_FILEDLG   1
+#define wxUSE_LIBPNG    1
+#define wxUSE_LIBJPEG   1
+#define wxUSE_GIF       1
+#define wxUSE_PCX       1
+#define wxUSE_LIBTIFF   1
+
+//-------------------------------------------------------------------
+// Bunch of globals used for communication with sound card call
+// back functions
+// ------------------------------------------------------------------
+
+// Global Codec2 & modem states - just one reqd for tx & rx
+int                 g_Nc;
+int                 g_mode;
+struct CODEC2      *g_pCodec2;
+struct FDMDV       *g_pFDMDV;
+struct FDMDV_STATS  g_stats;
+float               g_pwr_scale;
+int                 g_clip;
+
+// test Frames
+int                 g_testFrames;
+int                 g_test_frame_sync_state;
+int                 g_test_frame_count;
+int                 g_total_bits;
+int                 g_total_bit_errors;
+int                 g_sz_error_pattern;
+short              *g_error_pattern;
+struct FIFO        *g_errorFifo;
+
+// time averaged magnitude spectrum used for waterfall and spectrum display
+float               g_avmag[FDMDV_NSPEC];
+
+// GUI controls that affect rx and tx processes
+int   g_SquelchActive;
+float g_SquelchLevel;
+int   g_analog;
+int   g_split;
+int   g_tx;
+float g_snr;
+bool  g_half_duplex;
+
+// sending and receiving Call Sign data
+struct FIFO         *g_txDataInFifo;
+struct VARICODE_DEC  g_varicode_dec_states;
+struct FIFO         *g_rxDataOutFifo;
+
+// tx/rx processing states
+int                 g_nRxIn = FDMDV_NOM_SAMPLES_PER_FRAME;
+int                 g_CodecBits[2*MAX_BITS_PER_FDMDV_FRAME];
+int                 g_State;
+paCallBackData     *g_rxUserdata;
+
+// FIFOs used for plotting waveforms
+struct FIFO        *g_plotDemodInFifo;
+struct FIFO        *g_plotSpeechOutFifo;
+struct FIFO        *g_plotSpeechInFifo;
+
+// Soundcard config
+int                 g_nSoundCards;
+int                 g_soundCard1InDeviceNum;
+int                 g_soundCard1OutDeviceNum;
+int                 g_soundCard1SampleRate;
+int                 g_soundCard2InDeviceNum;
+int                 g_soundCard2OutDeviceNum;
+int                 g_soundCard2SampleRate;
+
+// playing and recording from sound files
+
+SNDFILE            *g_sfPlayFile;
+bool                g_playFileToMicIn;
+bool                g_loopPlayFileToMicIn;
+int                 g_playFileToMicInEventId;
+
+SNDFILE            *g_sfRecFile;
+bool                g_recFileFromRadio;
+unsigned int        g_recFromRadioSamples;
+int                 g_recFileFromRadioEventId;
+
+SNDFILE            *g_sfPlayFileFromRadio;
+bool                g_playFileFromRadio;
+bool                g_loopPlayFileFromRadio;
+int                 g_playFileFromRadioEventId;
+
+wxWindow           *g_parent;
+
+// Click to tune rx and tx frequency offset states
+float               g_RxFreqOffsetHz;
+COMP                g_RxFreqOffsetPhaseRect;
+float               g_TxFreqOffsetHz;
+COMP                g_TxFreqOffsetPhaseRect;
+
+// experimental mutex to make sound card callbacks mutually exclusive
+// TODO: review code and see if we need this any more, as fifos should
+// now be thread safe
+
+wxMutex g_mutexProtectingCallbackData;
+
+// WxWidgets - initialize the application
+IMPLEMENT_APP(MainApp);
+
+//-------------------------------------------------------------------------
+// OnInit()
+//-------------------------------------------------------------------------
+bool MainApp::OnInit()
+{
+    if(!wxApp::OnInit())
+    {
+        return false;
+    }
+    SetVendorName(wxT("CODEC2-Project"));
+    SetAppName(wxT("FreeDV"));      // not needed, it's the default value
+
+    // DR - this is wrong define so won't be used on windows build, should be __WXMSW__
+    // So registry will be used for Win32
+#ifdef _WXMSW_
+    // Force use of file-based configuration persistance on Windows platforma
+    wxConfig *pConfig = new wxConfig();
+    wxFileConfig *pFConfig = new wxFileConfig(wxT("FreeDV"), wxT("CODEC2-Project"), wxT("FreeDV.conf"), wxT("FreeDV.conf"),  wxCONFIG_USE_LOCAL_FILE | wxCONFIG_USE_RELATIVE_PATH);
+    pConfig->Set(pFConfig);
+    pConfig->SetRecordDefaults();
+#else
+    wxConfigBase *pConfig = wxConfigBase::Get();
+    pConfig->SetRecordDefaults();
+#endif
+
+    m_rTopWindow = wxRect(0, 0, 0, 0);
+    m_strRxInAudio.Empty();
+    m_strRxOutAudio.Empty();
+    m_textVoiceInput.Empty();
+    m_textVoiceOutput.Empty();
+    m_strSampleRate.Empty();
+    m_strBitrate.Empty();
+    // Create the main application window
+    frame = new MainFrame(NULL);
+    SetTopWindow(frame);
+    // Should guarantee that the first plot tab defined is the one
+    // displayed. But it doesn't when built from command line.  Why?
+    frame->m_auiNbookCtrl->ChangeSelection(0);
+    frame->Layout();
+    frame->Show();
+    g_parent =frame;
+    return true;
+}
+
+//-------------------------------------------------------------------------
+// OnExit()
+//-------------------------------------------------------------------------
+int MainApp::OnExit()
+{
+    return 0;
+}
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class MainFrame(wxFrame* pa->ent) : TopFrame(parent)
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+MainFrame::MainFrame(wxWindow *parent) : TopFrame(parent)
+{
+    m_zoom              = 1.;
+
+    SetMinSize(wxSize(400,400));
+
+    // Init Hamlib library, but we dont start talking to any rigs yet
+
+    wxGetApp().m_hamlib = new Hamlib();
+
+    tools->AppendSeparator();
+    wxMenuItem* m_menuItemToolsConfigDelete;
+    m_menuItemToolsConfigDelete = new wxMenuItem(tools, wxID_ANY, wxString(_("&Restore defaults")) , wxT("Delete config file/keys and restore defaults"), wxITEM_NORMAL);
+    this->Connect(m_menuItemToolsConfigDelete->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::OnDeleteConfig));
+
+    tools->Append(m_menuItemToolsConfigDelete);
+
+    wxConfigBase *pConfig = wxConfigBase::Get();
+
+    // restore frame position and size
+    int x = pConfig->Read(wxT("/MainFrame/left"),       20);
+    int y = pConfig->Read(wxT("/MainFrame/top"),        20);
+    int w = pConfig->Read(wxT("/MainFrame/width"),     800);
+    int h = pConfig->Read(wxT("/MainFrame/height"),    550);
+
+    // sanitise frame position as a first pass at Win32 registry bug
+
+    printf("x = %d y = %d w = %d h = %d\n", x,y,w,h);
+    if (x < 0) x = 20;
+    if (y < 0) y = 20;
+    if (w < 0) w = 800;
+    if (h < 0) h = 550;
+
+    // note: run DebugView program to see this message under windows
+    //wxLogDebug("x = %d y = %d w = %d h = %d\n", x,y,w,h);
+    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_show_speech_in     = pConfig->Read(wxT("/MainFrame/show_speech_in"),    1);
+    wxGetApp().m_show_speech_out    = pConfig->Read(wxT("/MainFrame/show_speech_out"),   1);
+    wxGetApp().m_show_demod_in      = pConfig->Read(wxT("/MainFrame/show_demod_in"),     1);
+    wxGetApp().m_show_test_frame_errors = pConfig->Read(wxT("/MainFrame/show_test_frame_errors"),     1);
+
+    wxGetApp().m_rxNbookCtrl        = pConfig->Read(wxT("/MainFrame/rxNbookCtrl"),    (long)0);
+
+    g_SquelchActive = pConfig->Read(wxT("/Audio/SquelchActive"), 1);
+    g_SquelchLevel = pConfig->Read(wxT("/Audio/SquelchLevel"), (int)(SQ_DEFAULT_SNR*2));
+    g_SquelchLevel /= 2.0;
+
+    Move(x, y);
+    SetClientSize(w, h);
+    
+    if(wxGetApp().m_show_wf)
+    {
+        // Add Waterfall Plot window
+        m_panelWaterfall = new PlotWaterfall((wxFrame*) m_auiNbookCtrl, false, 0);
+        m_panelWaterfall->SetToolTip(_("Left click to tune, Right click to toggle mono/colour"));
+        m_auiNbookCtrl->AddPage(m_panelWaterfall, _("Waterfall"), true, wxNullBitmap);
+    }
+    if(wxGetApp().m_show_spect)
+    {
+        // Add Spectrum Plot window
+        m_panelSpectrum = new PlotSpectrum((wxFrame*) m_auiNbookCtrl, g_avmag,
+                                           FDMDV_NSPEC*((float)MAX_F_HZ/FDMDV_MAX_F_HZ));
+        m_panelSpectrum->SetToolTip(_("Left click to tune"));
+        m_auiNbookCtrl->AddPage(m_panelSpectrum, _("Spectrum"), true, wxNullBitmap);
+    }
+    if(wxGetApp().m_show_scatter)
+    {
+        // Add Scatter Plot window
+        m_panelScatter = new PlotScatter((wxFrame*) m_auiNbookCtrl);
+        m_auiNbookCtrl->AddPage(m_panelScatter, _("Scatter"), true, wxNullBitmap);
+    }
+    if(wxGetApp().m_show_demod_in)
+    {
+        // Add Demod Input window
+        m_panelDemodIn = new PlotScalar((wxFrame*) m_auiNbookCtrl, 1, WAVEFORM_PLOT_TIME, 1.0/WAVEFORM_PLOT_FS, -1, 1, 1, 0.2, "%2.1f", 0);
+        m_auiNbookCtrl->AddPage(m_panelDemodIn, _("Frm Radio"), true, wxNullBitmap);
+        g_plotDemodInFifo = fifo_create(2*WAVEFORM_PLOT_BUF);
+    }
+
+    if(wxGetApp().m_show_speech_in)
+    {
+        // Add Speech Input window
+        m_panelSpeechIn = new PlotScalar((wxFrame*) m_auiNbookCtrl, 1, WAVEFORM_PLOT_TIME, 1.0/WAVEFORM_PLOT_FS, -1, 1, 1, 0.2, "%2.1f", 0);
+        m_auiNbookCtrl->AddPage(m_panelSpeechIn, _("Frm Mic"), true, wxNullBitmap);
+        g_plotSpeechInFifo = fifo_create(2*WAVEFORM_PLOT_BUF);
+    }
+
+    if(wxGetApp().m_show_speech_out)
+    {
+        // Add Speech Output window
+        m_panelSpeechOut = new PlotScalar((wxFrame*) m_auiNbookCtrl, 1, WAVEFORM_PLOT_TIME, 1.0/WAVEFORM_PLOT_FS, -1, 1, 1, 0.2, "%2.1f", 0);
+        m_auiNbookCtrl->AddPage(m_panelSpeechOut, _("To Spkr/Hdphns"), true, wxNullBitmap);
+        g_plotSpeechOutFifo = fifo_create(2*WAVEFORM_PLOT_BUF);
+    }
+
+    if(wxGetApp().m_show_timing)
+    {
+        // Add Timing Offset window
+        m_panelTimeOffset = new PlotScalar((wxFrame*) m_auiNbookCtrl, 1, 5.0, DT, -0.5, 0.5, 1, 0.1, "%2.1f", 0);
+        m_auiNbookCtrl->AddPage(m_panelTimeOffset, L"Timing \u0394", true, wxNullBitmap);
+    }
+    if(wxGetApp().m_show_freq)
+    {
+        // Add Frequency Offset window
+        m_panelFreqOffset = new PlotScalar((wxFrame*) m_auiNbookCtrl, 1, 5.0, DT, -200, 200, 1, 50, "%3.0fHz", 0);
+        m_auiNbookCtrl->AddPage(m_panelFreqOffset, L"Frequency \u0394", true, wxNullBitmap);
+    }
+
+    if(wxGetApp().m_show_test_frame_errors)
+    {
+        // Add Test Frame Errors window
+        m_panelTestFrameErrors = new PlotScalar((wxFrame*) m_auiNbookCtrl, 2*FDMDV_NC_MAX, 30.0, DT, 0, 2*FDMDV_NC_MAX+2, 1, 1, "", 1);
+        m_auiNbookCtrl->AddPage(m_panelTestFrameErrors, L"Test Frame Errors", true, wxNullBitmap);
+    }
+
+    wxGetApp().m_framesPerBuffer = pConfig->Read(wxT("/Audio/framesPerBuffer"), PA_FPB);
+
+    g_soundCard1InDeviceNum  = pConfig->Read(wxT("/Audio/soundCard1InDeviceNum"),         -1);
+    g_soundCard1OutDeviceNum = pConfig->Read(wxT("/Audio/soundCard1OutDeviceNum"),        -1);
+    g_soundCard1SampleRate   = pConfig->Read(wxT("/Audio/soundCard1SampleRate"),          -1);
+
+    g_soundCard2InDeviceNum  = pConfig->Read(wxT("/Audio/soundCard2InDeviceNum"),         -1);
+    g_soundCard2OutDeviceNum = pConfig->Read(wxT("/Audio/soundCard2OutDeviceNum"),        -1);
+    g_soundCard2SampleRate   = pConfig->Read(wxT("/Audio/soundCard2SampleRate"),          -1);
+
+    g_nSoundCards = 0;
+    if ((g_soundCard1InDeviceNum > -1) && (g_soundCard1OutDeviceNum > -1)) {
+        g_nSoundCards = 1;
+        if ((g_soundCard2InDeviceNum > -1) && (g_soundCard2OutDeviceNum > -1))
+            g_nSoundCards = 2;
+    }
+
+    wxGetApp().m_playFileToMicInPath = pConfig->Read("/File/playFileToMicInPath",   wxT(""));
+    wxGetApp().m_recFileFromRadioPath = pConfig->Read("/File/recFileFromRadioPath", wxT(""));
+    wxGetApp().m_recFileFromRadioSecs = pConfig->Read("/File/recFileFromRadioSecs", 30);
+    wxGetApp().m_playFileFromRadioPath = pConfig->Read("/File/playFileFromRadioPath", wxT(""));
+
+    // PTT -------------------------------------------------------------------
+
+    wxGetApp().m_boolHalfDuplex     = pConfig->ReadBool(wxT("/Rig/HalfDuplex"),     true);
+    wxGetApp().m_leftChannelVoxTone = pConfig->ReadBool("/Rig/leftChannelVoxTone",  false);
+    wxGetApp().m_boolHamlibUseForPTT = pConfig->ReadBool("/Hamlib/UseForPTT", false);
+    wxGetApp().m_intHamlibRig = pConfig->ReadLong("/Hamlib/RigName", 0);
+    wxGetApp().m_strHamlibSerialPort = pConfig->Read("/Hamlib/SerialPort", "");
+    
+    wxGetApp().m_boolUseSerialPTT   = pConfig->ReadBool(wxT("/Rig/UseSerialPTT"),   false);
+    wxGetApp().m_strRigCtrlPort     = pConfig->Read(wxT("/Rig/Port"),               wxT(""));
+    wxGetApp().m_boolUseRTS         = pConfig->ReadBool(wxT("/Rig/UseRTS"),         true);
+    wxGetApp().m_boolRTSPos         = pConfig->ReadBool(wxT("/Rig/RTSPolarity"),    true);
+    wxGetApp().m_boolUseDTR         = pConfig->ReadBool(wxT("/Rig/UseDTR"),         false);
+    wxGetApp().m_boolDTRPos         = pConfig->ReadBool(wxT("/Rig/DTRPolarity"),    false);
+    com_handle = COM_HANDLE_INVALID;
+
+    // -----------------------------------------------------------------------
+
+    bool slow = false; // prevents compile error when using default bool
+    wxGetApp().m_snrSlow = pConfig->Read("/Audio/snrSlow", slow);
+
+    bool t = true;     // prevents compile error when using default bool
+    wxGetApp().m_codec2LPCPostFilterEnable     = pConfig->Read(wxT("/Filter/codec2LPCPostFilterEnable"),    t);
+    wxGetApp().m_codec2LPCPostFilterBassBoost  = pConfig->Read(wxT("/Filter/codec2LPCPostFilterBassBoost"), t);
+    wxGetApp().m_codec2LPCPostFilterGamma      = (float)pConfig->Read(wxT("/Filter/codec2LPCPostFilterGamma"),     CODEC2_LPC_PF_GAMMA*100)/100.0;
+    wxGetApp().m_codec2LPCPostFilterBeta       = (float)pConfig->Read(wxT("/Filter/codec2LPCPostFilterBeta"),      CODEC2_LPC_PF_BETA*100)/100.0;
+    //printf("main(): m_codec2LPCPostFilterBeta: %f\n", wxGetApp().m_codec2LPCPostFilterBeta);
+
+    wxGetApp().m_MicInBassFreqHz = (float)pConfig->Read(wxT("/Filter/MicInBassFreqHz"),    1);
+    wxGetApp().m_MicInBassGaindB = (float)pConfig->Read(wxT("/Filter/MicInBassGaindB"),    (long)0)/10.0;
+    wxGetApp().m_MicInTrebleFreqHz = (float)pConfig->Read(wxT("/Filter/MicInTrebleFreqHz"),    1);
+    wxGetApp().m_MicInTrebleGaindB = (float)pConfig->Read(wxT("/Filter/MicInTrebleGaindB"),    (long)0)/10.0;
+    wxGetApp().m_MicInMidFreqHz = (float)pConfig->Read(wxT("/Filter/MicInMidFreqHz"),    1);
+    wxGetApp().m_MicInMidGaindB = (float)pConfig->Read(wxT("/Filter/MicInMidGaindB"),    (long)0)/10.0;
+    wxGetApp().m_MicInMidQ = (float)pConfig->Read(wxT("/Filter/MicInMidQ"),              (long)100)/100.0;
+
+    bool f = false;
+    wxGetApp().m_MicInEQEnable = (float)pConfig->Read(wxT("/Filter/MicInEQEnable"), f);
+
+    wxGetApp().m_SpkOutBassFreqHz = (float)pConfig->Read(wxT("/Filter/SpkOutBassFreqHz"),    1);
+    wxGetApp().m_SpkOutBassGaindB = (float)pConfig->Read(wxT("/Filter/SpkOutBassGaindB"),    (long)0)/10.0;
+    wxGetApp().m_SpkOutTrebleFreqHz = (float)pConfig->Read(wxT("/Filter/SpkOutTrebleFreqHz"),    1);
+    wxGetApp().m_SpkOutTrebleGaindB = (float)pConfig->Read(wxT("/Filter/SpkOutTrebleGaindB"),    (long)0)/10.0;
+    wxGetApp().m_SpkOutMidFreqHz = (float)pConfig->Read(wxT("/Filter/SpkOutMidFreqHz"),    1);
+    wxGetApp().m_SpkOutMidGaindB = (float)pConfig->Read(wxT("/Filter/SpkOutMidGaindB"),    (long)0)/10.0;
+    wxGetApp().m_SpkOutMidQ = (float)pConfig->Read(wxT("/Filter/SpkOutMidQ"),                (long)100)/100.0;
+
+    wxGetApp().m_SpkOutEQEnable = (float)pConfig->Read(wxT("/Filter/SpkOutEQEnable"), f);
+
+    wxGetApp().m_callSign = pConfig->Read("/Data/CallSign", wxT(""));
+    wxGetApp().m_textEncoding = pConfig->Read("/Data/TextEncoding", 2);
+
+    wxGetApp().m_events = pConfig->Read("/Events/enable", f);
+    wxGetApp().m_events_spam_timer = (int)pConfig->Read(wxT("/Events/spam_timer"), 10);
+    wxGetApp().m_events_regexp_match = pConfig->Read("/Events/regexp_match", wxT("s=(.*)"));
+    wxGetApp().m_events_regexp_replace = pConfig->Read("/Events/regexp_replace", 
+                                                       wxT("curl http://qso.freedv.org/cgi-bin/onspot.cgi?s=\\1"));
+    // make sure regexp lists are terminated by a \n
+
+    if (wxGetApp().m_events_regexp_match.Last() != '\n') {
+        wxGetApp().m_events_regexp_match = wxGetApp().m_events_regexp_match+'\n';
+    }
+    if (wxGetApp().m_events_regexp_replace.Last() != '\n') {
+        wxGetApp().m_events_regexp_replace = wxGetApp().m_events_regexp_replace+'\n';
+    }
+
+    wxGetApp().m_udp_enable = (float)pConfig->Read(wxT("/UDP/enable"), f);
+    wxGetApp().m_udp_port = (int)pConfig->Read(wxT("/UDP/port"), 3000);
+
+    pConfig->SetPath(wxT("/"));
+
+//    this->Connect(m_menuItemHelpUpdates->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnHelpCheckUpdatesUI));
+    //m_togRxID->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnRxIDUI), NULL, this);
+    //m_togTxID->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnTxIDUI), NULL, this);
+    m_togBtnOnOff->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnOnOffUI), NULL, this);
+    m_togBtnSplit->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnSplitClickUI), NULL, this);
+    m_togBtnAnalog->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnAnalogClickUI), NULL, this);
+    //m_togBtnALC->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnALCClickUI), NULL, this);
+   // m_btnTogPTT->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnPTT_UI), NULL, this);
+
+    m_togBtnSplit->Disable();
+    //m_togRxID->Disable();
+    //m_togTxID->Disable();
+    m_togBtnAnalog->Disable();
+    m_btnTogPTT->Disable();
+    //m_togBtnALC->Disable();
+
+    // squelch settings
+    char sqsnr[15];
+    m_sliderSQ->SetValue((int)(g_SquelchLevel*2.0));
+    sprintf(sqsnr, "%4.1f", g_SquelchLevel);
+    wxString sqsnr_string(sqsnr);
+    m_textSQ->SetLabel(sqsnr_string);
+    m_ckboxSQ->SetValue(g_SquelchActive);
+
+    // SNR settings
+
+    m_ckboxSNR->SetValue(wxGetApp().m_snrSlow);
+    setsnrBeta(wxGetApp().m_snrSlow);
+
+#ifdef _USE_TIMER
+    Bind(wxEVT_TIMER, &MainFrame::OnTimer, this);       // ID_MY_WINDOW);
+    m_plotTimer.SetOwner(this, ID_TIMER_WATERFALL);
+    //m_panelWaterfall->Refresh();
+#endif
+
+    m_RxRunning = false;
+
+#ifdef _USE_ONIDLE
+    Connect(wxEVT_IDLE, wxIdleEventHandler(MainFrame::OnIdle), NULL, this);
+#endif //_USE_ONIDLE
+
+    g_sfPlayFile = NULL;
+    g_playFileToMicIn = false;
+    g_loopPlayFileToMicIn = false;
+
+    g_sfRecFile = NULL;
+    g_recFileFromRadio = false;
+
+    g_sfPlayFileFromRadio = NULL;
+    g_playFileFromRadio = false;
+    g_loopPlayFileFromRadio = false;
+
+    // init click-tune states
+
+    g_RxFreqOffsetHz = 0.0;
+    g_RxFreqOffsetPhaseRect.real = cos(0.0);
+    g_RxFreqOffsetPhaseRect.imag = sin(0.0);
+    m_panelWaterfall->setRxFreq(FDMDV_FCENTRE - g_RxFreqOffsetHz);
+    m_panelSpectrum->setRxFreq(FDMDV_FCENTRE - g_RxFreqOffsetHz);
+
+    g_TxFreqOffsetHz = 0.0;
+    g_TxFreqOffsetPhaseRect.real = cos(0.0);
+    g_TxFreqOffsetPhaseRect.imag = sin(0.0);
+
+    g_tx = 0;
+    g_split = 0;
+
+    // data states
+    g_txDataInFifo = fifo_create(MAX_CALLSIGN*VARICODE_MAX_BITS);
+    g_rxDataOutFifo = fifo_create(MAX_CALLSIGN*VARICODE_MAX_BITS);
+
+    sox_biquad_start();
+    golay23_init();
+
+    g_testFrames = 0;
+    g_test_frame_sync_state = 0;
+    g_total_bit_errors = 0;
+    g_total_bits = 0;
+    wxGetApp().m_testFrames = false;
+
+    m_modal = false;
+
+    // Start UDP listener thread
+
+    m_UDPThread = NULL;
+    startUDPThread();
+
+    optionsDlg = new OptionsDlg(NULL);
+    m_schedule_restore = false;
+}
+
+//-------------------------------------------------------------------------
+// ~MainFrame()
+//-------------------------------------------------------------------------
+MainFrame::~MainFrame()
+{
+    int x;
+    int y;
+    int w;
+    int h;
+
+    if (optionsDlg != NULL) {
+        delete optionsDlg;
+        optionsDlg = NULL;
+    }
+
+    stopUDPThread();
+
+    /* TOOD(Joel): the ownership of m_hamlib is probably wrong. */
+    if (wxGetApp().m_hamlib) delete wxGetApp().m_hamlib;
+
+    //MainApp *pApp = wxGetApp();
+    wxConfigBase *pConfig = wxConfigBase::Get();
+    if(pConfig)
+    {
+        if (!IsIconized()) {
+            GetClientSize(&w, &h);
+
+            // big hack - for some reason height shrinks by this much
+            // every time FreeDV runs!  I have no idea why
+
+            h += 23;
+
+            GetPosition(&x, &y);
+            printf("x = %d y = %d w = %d h = %d\n", x,y,w,h);
+            pConfig->Write(wxT("/MainFrame/left"),               (long) x);
+            pConfig->Write(wxT("/MainFrame/top"),                (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("/MainFrame/show_speech_in"),    wxGetApp().m_show_speech_in);
+        pConfig->Write(wxT("/MainFrame/show_speech_out"),   wxGetApp().m_show_speech_out);
+        pConfig->Write(wxT("/MainFrame/show_demod_in"),     wxGetApp().m_show_demod_in);
+        pConfig->Write(wxT("/MainFrame/show_test_frame_errors"), wxGetApp().m_show_test_frame_errors);
+
+        pConfig->Write(wxT("/MainFrame/rxNbookCtrl"), wxGetApp().m_rxNbookCtrl);
+
+        pConfig->Write(wxT("/Audio/SquelchActive"),         g_SquelchActive);
+        pConfig->Write(wxT("/Audio/SquelchLevel"),          (int)(g_SquelchLevel*2.0));
+
+        pConfig->Write(wxT("/Audio/framesPerBuffer"),       wxGetApp().m_framesPerBuffer);
+
+        pConfig->Write(wxT("/Audio/soundCard1InDeviceNum"),   g_soundCard1InDeviceNum);
+        pConfig->Write(wxT("/Audio/soundCard1OutDeviceNum"),  g_soundCard1OutDeviceNum);
+        pConfig->Write(wxT("/Audio/soundCard1SampleRate"),    g_soundCard1SampleRate );
+
+        pConfig->Write(wxT("/Audio/soundCard2InDeviceNum"),   g_soundCard2InDeviceNum);
+        pConfig->Write(wxT("/Audio/soundCard2OutDeviceNum"),  g_soundCard2OutDeviceNum);
+        pConfig->Write(wxT("/Audio/soundCard2SampleRate"),    g_soundCard2SampleRate );
+
+        pConfig->Write(wxT("/Rig/HalfDuplex"),              wxGetApp().m_boolHalfDuplex);
+        pConfig->Write(wxT("/Rig/leftChannelVoxTone"),      wxGetApp().m_leftChannelVoxTone);
+        pConfig->Write("/Hamlib/UseForPTT", wxGetApp().m_boolHamlibUseForPTT);
+        pConfig->Write("/Hamlib/RigName", wxGetApp().m_intHamlibRig);
+        pConfig->Write("/Hamlib/SerialPort", wxGetApp().m_strHamlibSerialPort);
+
+
+        pConfig->Write(wxT("/File/playFileToMicInPath"),    wxGetApp().m_playFileToMicInPath);
+        pConfig->Write(wxT("/File/recFileFromRadioPath"),   wxGetApp().m_recFileFromRadioPath);
+        pConfig->Write(wxT("/File/recFileFromRadioSecs"),   wxGetApp().m_recFileFromRadioSecs);
+        pConfig->Write(wxT("/File/playFileFromRadioPath"),  wxGetApp().m_playFileFromRadioPath);
+
+        pConfig->Write(wxT("/Audio/snrSlow"), wxGetApp().m_snrSlow);
+
+        pConfig->Write(wxT("/Data/CallSign"), wxGetApp().m_callSign);
+        pConfig->Write(wxT("/Data/TextEncoding"), wxGetApp().m_textEncoding);
+        pConfig->Write(wxT("/Events/enable"), wxGetApp().m_events);
+        pConfig->Write(wxT("/Events/spam_timer"), wxGetApp().m_events_spam_timer);
+        pConfig->Write(wxT("/Events/regexp_match"), wxGetApp().m_events_regexp_match);
+        pConfig->Write(wxT("/Events/regexp_replace"), wxGetApp().m_events_regexp_replace);
+        pConfig->Write(wxT("/UDP/enable"), wxGetApp().m_udp_enable);
+        pConfig->Write(wxT("/UDP/port"),  wxGetApp().m_udp_port);
+
+        pConfig->Write(wxT("/Filter/MicInEQEnable"), wxGetApp().m_MicInEQEnable);
+        pConfig->Write(wxT("/Filter/SpkOutEQEnable"), wxGetApp().m_SpkOutEQEnable);
+    }
+
+    //m_togRxID->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnRxIDUI), NULL, this);
+    //m_togTxID->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnTxIDUI), NULL, this);
+    m_togBtnOnOff->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnOnOffUI), NULL, this);
+    m_togBtnSplit->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnSplitClickUI), NULL, this);
+    m_togBtnAnalog->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnAnalogClickUI), NULL, this);
+    //m_togBtnALC->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnALCClickUI), NULL, this);
+    //m_btnTogPTT->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnPTT_UI), NULL, this);
+
+    sox_biquad_finish();
+
+    if (m_RxRunning)
+    {
+        stopRxStream();
+    }
+    if (g_sfPlayFile != NULL)
+    {
+        sf_close(g_sfPlayFile);
+        g_sfPlayFile = NULL;
+    }
+    if (g_sfRecFile != NULL)
+    {
+        sf_close(g_sfRecFile);
+        g_sfRecFile = NULL;
+    }
+#ifdef _USE_TIMER
+    if(m_plotTimer.IsRunning())
+    {
+        m_plotTimer.Stop();
+        Unbind(wxEVT_TIMER, &MainFrame::OnTimer, this);
+    }
+#endif //_USE_TIMER
+
+#ifdef _USE_ONIDLE
+    Disconnect(wxEVT_IDLE, wxIdleEventHandler(MainFrame::OnIdle), NULL, this);
+#endif // _USE_ONIDLE
+
+    delete wxConfigBase::Set((wxConfigBase *) NULL);
+}
+
+//----------------------------------------------------------------
+// closeComPort() closes the currently open com port
+//----------------------------------------------------------------
+void MainFrame::closeComPort(void)
+{
+#ifdef _WIN32
+       CloseHandle(com_handle);
+#else
+       close(com_handle);
+#endif
+       com_handle = COM_HANDLE_INVALID;
+}
+
+//----------------------------------------------------------------
+// openComPort() opens the com port specified by the string
+// ie: "COM1" on Windows or "/dev/ttyu0" on FreeBSD
+//----------------------------------------------------------------
+bool MainFrame::openComPort(const char *name)
+{
+       if(com_handle != COM_HANDLE_INVALID)
+               closeComPort();
+#ifdef _WIN32
+       {
+               COMMCONFIG CC;
+               DWORD CCsize=sizeof(CC);
+               COMMTIMEOUTS timeouts;
+               DCB     dcb;
+
+               if(GetDefaultCommConfigA(name, &CC, &CCsize)) {
+                       CC.dcb.fOutxCtsFlow             = FALSE;
+                       CC.dcb.fOutxDsrFlow             = FALSE;
+                       CC.dcb.fDtrControl              = DTR_CONTROL_DISABLE;
+                       CC.dcb.fDsrSensitivity  = FALSE;
+                       CC.dcb.fRtsControl              = RTS_CONTROL_DISABLE;
+                       SetDefaultCommConfigA(name, &CC, CCsize);
+               }
+
+               if((com_handle=CreateFileA(name
+                       ,GENERIC_READ|GENERIC_WRITE     /* Access */
+                       ,0                                                              /* Share mode */
+                       ,NULL                                                   /* Security attributes */
+                       ,OPEN_EXISTING                                  /* Create access */
+                       ,FILE_ATTRIBUTE_NORMAL                  /* File attributes */
+                       ,NULL                                                   /* Template */
+                       ))==INVALID_HANDLE_VALUE)
+                       return false;
+
+               if(GetCommTimeouts(com_handle, &timeouts)) {
+                       timeouts.ReadIntervalTimeout=MAXDWORD;
+                       timeouts.ReadTotalTimeoutMultiplier=0;
+                       timeouts.ReadTotalTimeoutConstant=0;            // No-wait read timeout
+                       timeouts.WriteTotalTimeoutMultiplier=0;
+                       timeouts.WriteTotalTimeoutConstant=5000;        // 5 seconds
+                       SetCommTimeouts(com_handle,&timeouts);
+               }
+
+               /* Force N-8-1 mode: */
+               if(GetCommState(com_handle, &dcb)==TRUE) {
+                       dcb.ByteSize            = 8;
+                       dcb.Parity                      = NOPARITY;
+                       dcb.StopBits            = ONESTOPBIT;
+                       dcb.DCBlength           = sizeof(DCB);
+                       dcb.fBinary                     = TRUE;
+                       dcb.fOutxCtsFlow        = FALSE;
+                       dcb.fOutxDsrFlow        = FALSE;
+                       dcb.fDtrControl         = DTR_CONTROL_DISABLE;
+                       dcb.fDsrSensitivity     = FALSE;
+                       dcb.fTXContinueOnXoff= TRUE;
+                       dcb.fOutX                       = FALSE;
+                       dcb.fInX                        = FALSE;
+                       dcb.fRtsControl         = RTS_CONTROL_DISABLE;
+                       dcb.fAbortOnError       = FALSE;
+                       SetCommState(com_handle, &dcb);
+               }
+       }
+#else
+       {
+               struct termios t;
+
+               if((com_handle=open(name, O_NONBLOCK|O_RDWR))==COM_HANDLE_INVALID)
+                       return false;
+
+               if(tcgetattr(com_handle, &t)==-1) {
+                       close(com_handle);
+                       com_handle = COM_HANDLE_INVALID;
+                       return false;
+               }
+
+               t.c_iflag = (
+                                         IGNBRK   /* ignore BREAK condition */
+                                       | IGNPAR   /* ignore (discard) parity errors */
+                                       );
+               t.c_oflag = 0;  /* No output processing */
+               t.c_cflag = (
+                                         CS8         /* 8 bits */
+                                       | CREAD       /* enable receiver */
+               /*
+               Fun snippet from the FreeBSD manpage:
+
+                        If CREAD is set, the receiver is enabled.  Otherwise, no character is
+                        received.  Not all hardware supports this bit.  In fact, this flag is
+                        pretty silly and if it were not part of the termios specification it
+                        would be omitted.
+               */
+                                       | CLOCAL      /* ignore modem status lines */
+                                       );
+               t.c_lflag = 0;  /* No local modes */
+               if(tcsetattr(com_handle, TCSANOW, &t)==-1) {
+                       close(com_handle);
+                       com_handle = COM_HANDLE_INVALID;
+                       return false;
+               }
+               
+       }
+#endif
+       return true;
+}
+
+#ifdef _USE_ONIDLE
+void MainFrame::OnIdle(wxIdleEvent &evt) {
+}
+#endif
+
+//----------------------------------------------------------------
+// (raise|lower)(RTS|DTR)()
+//
+// Raises/lowers the specified signal
+//----------------------------------------------------------------
+void MainFrame::raiseDTR(void)
+{
+       if(com_handle == COM_HANDLE_INVALID)
+               return;
+#ifdef _WIN32
+       EscapeCommFunction(com_handle, SETDTR);
+#else
+       {       // For C89 happiness
+               int flags = TIOCM_DTR;
+               ioctl(com_handle, TIOCMBIS, &flags);
+       }
+#endif
+}
+void MainFrame::raiseRTS(void)
+{
+       if(com_handle == COM_HANDLE_INVALID)
+               return;
+#ifdef _WIN32
+       EscapeCommFunction(com_handle, SETRTS);
+#else
+       {       // For C89 happiness
+               int flags = TIOCM_RTS;
+               ioctl(com_handle, TIOCMBIS, &flags);
+       }
+#endif
+}
+void MainFrame::lowerDTR(void)
+{
+       if(com_handle == COM_HANDLE_INVALID)
+               return;
+#ifdef _WIN32
+       EscapeCommFunction(com_handle, CLRDTR);
+#else
+       {       // For C89 happiness
+               int flags = TIOCM_DTR;
+               ioctl(com_handle, TIOCMBIC, &flags);
+       }
+#endif
+}
+void MainFrame::lowerRTS(void)
+{
+       if(com_handle == COM_HANDLE_INVALID)
+               return;
+#ifdef _WIN32
+       EscapeCommFunction(com_handle, CLRRTS);
+#else
+       {       // For C89 happiness
+               int flags = TIOCM_RTS;
+               ioctl(com_handle, TIOCMBIC, &flags);
+       }
+#endif
+}
+
+
+#ifdef _USE_TIMER
+//----------------------------------------------------------------
+// OnTimer()
+//
+// when the timer fires every DT seconds we update the GUI displays.
+// the tabs only the plot that is visible actually gets updated, this
+// keeps CPU load reasonable
+//----------------------------------------------------------------
+void MainFrame::OnTimer(wxTimerEvent &evt)
+{
+    if (m_panelWaterfall->checkDT()) {
+        m_panelWaterfall->setRxFreq(FDMDV_FCENTRE - g_RxFreqOffsetHz);
+        m_panelWaterfall->m_newdata = true;
+        m_panelWaterfall->Refresh();
+    }
+
+    m_panelSpectrum->setRxFreq(FDMDV_FCENTRE - g_RxFreqOffsetHz);
+    m_panelSpectrum->m_newdata = true;
+    m_panelSpectrum->Refresh();
+
+    m_panelScatter->add_new_samples(g_stats.rx_symbols);
+    m_panelScatter->Refresh();
+
+    // Oscilliscope type speech plots -------------------------------------------------------
+
+    short speechInPlotSamples[WAVEFORM_PLOT_BUF];
+    if (fifo_read(g_plotSpeechInFifo, speechInPlotSamples, WAVEFORM_PLOT_BUF))
+        memset(speechInPlotSamples, 0, WAVEFORM_PLOT_BUF*sizeof(short));
+    m_panelSpeechIn->add_new_short_samples(0, speechInPlotSamples, WAVEFORM_PLOT_BUF, 32767);
+    m_panelSpeechIn->Refresh();
+
+    short speechOutPlotSamples[WAVEFORM_PLOT_BUF];
+    if (fifo_read(g_plotSpeechOutFifo, speechOutPlotSamples, WAVEFORM_PLOT_BUF))
+        memset(speechOutPlotSamples, 0, WAVEFORM_PLOT_BUF*sizeof(short));
+    m_panelSpeechOut->add_new_short_samples(0, speechOutPlotSamples, WAVEFORM_PLOT_BUF, 32767);
+    m_panelSpeechOut->Refresh();
+
+    short demodInPlotSamples[WAVEFORM_PLOT_BUF];
+    if (fifo_read(g_plotDemodInFifo, demodInPlotSamples, WAVEFORM_PLOT_BUF))
+        memset(demodInPlotSamples, 0, WAVEFORM_PLOT_BUF*sizeof(short));
+    m_panelDemodIn->add_new_short_samples(0,demodInPlotSamples, WAVEFORM_PLOT_BUF, 32767);
+    m_panelDemodIn->Refresh();
+
+    // Demod states -----------------------------------------------------------------------
+
+    m_panelTimeOffset->add_new_sample(0, (float)g_stats.rx_timing/FDMDV_NOM_SAMPLES_PER_FRAME);
+    m_panelTimeOffset->Refresh();
+
+    m_panelFreqOffset->add_new_sample(0, g_stats.foff);
+    m_panelFreqOffset->Refresh();
+
+    // SNR text box and gauge ------------------------------------------------------------
+
+    // LP filter g_stats.snr_est some more to stabilise the
+    // display. g_stats.snr_est already has some low pass filtering
+    // but we need it fairly fast to activate squelch.  So we
+    // optionally perform some further filtering for the display
+    // version of SNR.  The "Slow" checkbox controls the amount of
+    // filtering.  The filtered snr also controls the squelch
+
+    g_snr = m_snrBeta*g_snr + (1.0 - m_snrBeta)*g_stats.snr_est;
+    float snr_limited = g_snr;
+
+    if (snr_limited < -9.0) snr_limited = -9.0; // stop text box overflow
+    char snr[15];
+    if (wxGetApp().m_snrSlow)
+        sprintf(snr, "%4.1f", snr_limited);
+    else
+        sprintf(snr, "%d", (int)(snr_limited+0.5)); // round to nearest dB
+    wxString snr_string(snr);
+    m_textSNR->SetLabel(snr_string);
+
+    if (snr_limited < 0.0) snr_limited = 0;
+    if (snr_limited > 20.0) snr_limited = 20.0;
+    m_gaugeSNR->SetValue((int)(snr_limited));
+
+    // Level Gauge -----------------------------------------------------------------------
+
+    float tooHighThresh;
+    if (!g_tx && m_RxRunning)
+    {
+        // receive mode - display From Radio peaks
+
+        // peak from this DT sampling period
+        int maxDemodIn = 0;
+        for(int i=0; i<WAVEFORM_PLOT_BUF; i++)
+            if (maxDemodIn < abs(demodInPlotSamples[i]))
+                maxDemodIn = abs(demodInPlotSamples[i]);
+
+        // peak from last second
+        if (maxDemodIn > m_maxLevel)
+            m_maxLevel = maxDemodIn;
+
+        tooHighThresh = FROM_RADIO_MAX;
+    }
+    else
+    {
+        // transmit mode - display From Mic peaks
+
+        // peak from this DT sampling period
+        int maxSpeechIn = 0;
+        for(int i=0; i<WAVEFORM_PLOT_BUF; i++)
+            if (maxSpeechIn < abs(speechInPlotSamples[i]))
+                maxSpeechIn = abs(speechInPlotSamples[i]);
+
+        // peak from last second
+        if (maxSpeechIn > m_maxLevel)
+            m_maxLevel = maxSpeechIn;
+
+       tooHighThresh = FROM_MIC_MAX;
+    }
+
+    // Peak Reading meter: updates peaks immediately, then slowly decays
+    int maxScaled = (int)(100.0 * ((float)m_maxLevel/32767.0));
+    m_gaugeLevel->SetValue(maxScaled);
+    if (((float)maxScaled/100) > tooHighThresh)
+        m_textLevel->SetLabel("Too High");
+    else
+        m_textLevel->SetLabel("");
+
+    m_maxLevel *= LEVEL_BETA;
+
+    // sync LED (Colours don't work on Windows) ------------------------
+
+    if (g_State) {
+        m_rbSync->SetForegroundColour( wxColour( 0, 255, 0 ) ); // green
+        m_rbSync->SetValue(true);
+    }
+    else {
+        m_rbSync->SetForegroundColour( wxColour( 255, 0, 0 ) ); // red
+        m_rbSync->SetValue(false);
+    }
+
+    // send Callsign ----------------------------------------------------
+
+    char callsign[MAX_CALLSIGN];
+    strncpy(callsign, (const char*) wxGetApp().m_callSign.mb_str(wxConvUTF8), MAX_CALLSIGN-1);
+
+    // buffer 1 txt message to senure tx data fifo doesn't "run dry"
+
+    if ((unsigned)fifo_used(g_txDataInFifo) < strlen(callsign)) {
+
+        unsigned char checksum = 0;
+        for(unsigned int i=0; i<strlen(callsign); i++)
+            checksum += callsign[i];
+        char callsign_checksum_cr[MAX_CALLSIGN+1];
+        sprintf(callsign_checksum_cr, "%s%2x", callsign, checksum);
+        //printf("callsign_checksum_cr: %s\n", callsign_checksum_cr);
+        callsign_checksum_cr[strlen(callsign)+2] = 13;
+        // varicode encode and write to tx data fifo
+
+        short varicode[MAX_CALLSIGN*VARICODE_MAX_BITS];
+        int nout = varicode_encode(varicode, callsign_checksum_cr, MAX_CALLSIGN*VARICODE_MAX_BITS, strlen(callsign)+3, wxGetApp().m_textEncoding);
+        //printf("\ntx varicode nout = %d: ", nout);
+        //for(int i=0; i<nout; i++)
+        //    printf("%d ", varicode[i]);
+        //printf("\n");
+        fifo_write(g_txDataInFifo, varicode, nout);
+        //printf("Callsign sending: %s nout: %d\n", callsign, nout);
+    }
+
+    // See if any Callsign info received --------------------------------
+
+    short ashort;
+    while (fifo_read(g_rxDataOutFifo, &ashort, 1) == 0) {
+        if ((ashort == 13) || ((m_pcallsign - m_callsign) > MAX_CALLSIGN-1)) {
+            // CR completes line
+            *m_pcallsign = 0;
+
+            // lets see if checksum is OK
+            
+            unsigned char checksum_rx = 0;
+            if (strlen(m_callsign) > 2) {
+                for(unsigned int i=0; i<strlen(m_callsign)-2; i++)
+                    checksum_rx += m_callsign[i];
+            }
+            unsigned int checksum_tx;
+            int ret = sscanf(&m_callsign[strlen(m_callsign)-2], "%2x", &checksum_tx);
+            printf("m_callsign: %s checksums: %2x %2x\n", m_callsign, checksum_tx, checksum_rx);
+
+            wxString s;
+            if (ret && (checksum_tx == checksum_rx)) {
+                m_callsign[strlen(m_callsign)-2] = 0;
+                s.Printf("%s", m_callsign);
+                m_txtCtrlCallSign->SetValue(s);
+
+                char s1[MAX_CALLSIGN];
+                sprintf(s1,"rx_txtmsg %s", m_callsign);
+                processTxtEvent(s1);
+
+                m_checksumGood++;
+                s.Printf("%d", m_checksumGood);
+                m_txtChecksumGood->SetLabel(s);              
+            }
+            else {
+                m_checksumBad++;
+                s.Printf("%d", m_checksumBad);
+                m_txtChecksumBad->SetLabel(s);              
+            }
+
+            // reset ptr to start of string
+            m_pcallsign = m_callsign;
+        }
+        else
+        {
+            *m_pcallsign++ = (char)ashort;
+        }
+    }
+
+    // Run time update of EQ filters -----------------------------------
+    if (m_newMicInFilter || m_newSpkOutFilter) {
+        g_mutexProtectingCallbackData.Lock();
+        deleteEQFilters(g_rxUserdata);
+        designEQFilters(g_rxUserdata);
+        g_mutexProtectingCallbackData.Unlock();
+        m_newMicInFilter = m_newSpkOutFilter = false;
+    }
+    g_rxUserdata->micInEQEnable = wxGetApp().m_MicInEQEnable;
+    g_rxUserdata->spkOutEQEnable = wxGetApp().m_SpkOutEQEnable;
+
+    // Test Frame Bit Error Updates ------------------------------------
+
+    // Toggle test frame mode at run time
+
+    if (!g_testFrames && wxGetApp().m_testFrames) {
+
+        // reset stats on check box off to on transition
+
+        g_test_frame_sync_state = 0;
+        g_total_bits = 0;
+        g_total_bit_errors = 0;
+    }
+    g_testFrames =  wxGetApp().m_testFrames;
+
+    if (g_State) {
+        char bits[80], errors[80], ber[80];
+
+        // update stats on main page
+
+        sprintf(bits, "Bits: %d", (int)g_total_bits); wxString bits_string(bits); m_textBits->SetLabel(bits_string);
+        sprintf(errors, "Errs: %d", (int)g_total_bit_errors); wxString errors_string(errors); m_textErrors->SetLabel(errors_string);
+        float b = (float)g_total_bit_errors/(1E-6+g_total_bits);
+        sprintf(ber, "BER: %4.3f", b); wxString ber_string(ber); m_textBER->SetLabel(ber_string);
+
+        // update error plots
+
+        short *error_pattern = new short[g_sz_error_pattern];
+
+        if (fifo_read(g_errorFifo, error_pattern, g_sz_error_pattern) == 0) {
+            int i,b;
+            for(b=0; b<g_Nc*2; b++) {
+                for(i=b; i<g_sz_error_pattern; i+= 2*g_Nc)
+                    m_panelTestFrameErrors->add_new_sample(b, b + 0.8*error_pattern[i]);
+            }
+
+            m_panelTestFrameErrors->Refresh();
+        }
+
+        delete error_pattern;
+    }
+
+    // command from UDP thread that is best processed in main thread to avoid seg faults
+
+    if (m_schedule_restore) {
+        if (IsIconized())
+            Restore();
+        m_schedule_restore = false;
+    }
+
+    // Light Spam Timer LED if at least one time is running
+
+    int i;
+    optionsDlg->SetSpamTimerLight(false);
+    for(i=0; i<MAX_EVENT_RULES; i++)
+        if (spamTimer[i].IsRunning())
+            optionsDlg->SetSpamTimerLight(true);        
+}
+
+#endif
+
+//-------------------------------------------------------------------------
+// OnCloseFrame()
+//-------------------------------------------------------------------------
+void MainFrame::OnCloseFrame(wxCloseEvent& event)
+{
+    Pa_Terminate();
+    Destroy();
+}
+
+//-------------------------------------------------------------------------
+// OnTop()
+//-------------------------------------------------------------------------
+void MainFrame::OnTop(wxCommandEvent& event)
+{
+    int style = GetWindowStyle();
+
+    if (style & wxSTAY_ON_TOP)
+    {
+        style &= ~wxSTAY_ON_TOP;
+    }
+    else
+    {
+        style |= wxSTAY_ON_TOP;
+    }
+    SetWindowStyle(style);
+}
+
+//-------------------------------------------------------------------------
+// OnDeleteConfig()
+//-------------------------------------------------------------------------
+void MainFrame::OnDeleteConfig(wxCommandEvent&)
+{
+    wxConfigBase *pConfig = wxConfigBase::Get();
+    if(pConfig->DeleteAll())
+    {
+        wxLogMessage(wxT("Config file/registry key successfully deleted."));
+
+        delete wxConfigBase::Set(NULL);
+        wxConfigBase::DontCreateOnDemand();
+    }
+    else
+    {
+        wxLogError(wxT("Deleting config file/registry key failed."));
+    }
+}
+
+//-------------------------------------------------------------------------
+// Paint()
+//-------------------------------------------------------------------------
+void MainFrame::OnPaint(wxPaintEvent& WXUNUSED(event))
+{
+    wxPaintDC dc(this);
+
+    if(GetMenuBar()->IsChecked(ID_PAINT_BG))
+    {
+        dc.Clear();
+    }
+    dc.SetUserScale(m_zoom, m_zoom);
+}
+
+//-------------------------------------------------------------------------
+// OnCmdSliderScroll()
+//-------------------------------------------------------------------------
+void MainFrame::OnCmdSliderScroll(wxScrollEvent& event)
+{
+    char sqsnr[15];
+    g_SquelchLevel = (float)m_sliderSQ->GetValue()/2.0;
+    sprintf(sqsnr, "%4.1f", g_SquelchLevel); // 0.5 dB steps
+    wxString sqsnr_string(sqsnr);
+    m_textSQ->SetLabel(sqsnr_string);
+
+    event.Skip();
+}
+
+//-------------------------------------------------------------------------
+// OnCheckSQClick()
+//-------------------------------------------------------------------------
+void MainFrame::OnCheckSQClick(wxCommandEvent& event)
+{
+    if(!g_SquelchActive)
+    {
+        g_SquelchActive = true;
+    }
+    else
+    {
+        g_SquelchActive = false;
+    }
+}
+
+void MainFrame::setsnrBeta(bool snrSlow)
+{
+    if(snrSlow)
+    {
+        m_snrBeta = 0.9; // make this closer to 1.0 to smooth SNR est further
+    }
+    else
+    {
+        m_snrBeta = 0.0; // no smoothing of SNR estimate from demodulator
+    }
+}
+
+//-------------------------------------------------------------------------
+// OnCheckSQClick()
+//-------------------------------------------------------------------------
+void MainFrame::OnCheckSNRClick(wxCommandEvent& event)
+{
+    wxGetApp().m_snrSlow = m_ckboxSNR->GetValue();
+    setsnrBeta(wxGetApp().m_snrSlow);
+    //printf("m_snrSlow: %d\n", (int)wxGetApp().m_snrSlow);
+}
+
+// check for space bar press (only when running)
+
+int MainApp::FilterEvent(wxEvent& event)
+{
+    if ((event.GetEventType() == wxEVT_KEY_DOWN) && 
+        (((wxKeyEvent&)event).GetKeyCode() == WXK_SPACE))
+        {
+            // only use space to toggle PTT if we are running and no modal dialogs (like options) up
+
+            if (frame->m_RxRunning && !frame->m_modal) {
+                if (frame->m_btnTogPTT->GetValue())
+                    frame->m_btnTogPTT->SetValue(false);
+                else
+                    frame->m_btnTogPTT->SetValue(true);
+
+                frame->togglePTT();
+
+                return true; // absorb space so we don't toggle control with focus (e.g. Start)
+
+            }
+        }
+
+    return -1;
+}
+
+//-------------------------------------------------------------------------
+// OnTogBtnPTT ()
+//-------------------------------------------------------------------------
+void MainFrame::OnTogBtnPTT (wxCommandEvent& event)
+{
+    togglePTT();
+    event.Skip();
+}
+
+void MainFrame::togglePTT(void) {
+
+    // Change tabbed page in centre panel depending on PTT state
+
+    if (g_tx)
+    {
+        // tx-> rx transition, swap to the page we were on for last rx
+        m_auiNbookCtrl->ChangeSelection(wxGetApp().m_rxNbookCtrl);
+    }
+    else
+    {
+        // rx-> tx transition, swap to Mic In page to monitor speech
+        wxGetApp().m_rxNbookCtrl = m_auiNbookCtrl->GetSelection();
+        m_auiNbookCtrl->ChangeSelection(m_auiNbookCtrl->GetPageIndex((wxWindow *)m_panelSpeechIn));
+        char e[80]; sprintf(e,"ptt"); processTxtEvent(e);
+    }
+
+    g_tx = m_btnTogPTT->GetValue();
+
+    // Hamlib PTT
+
+    if (wxGetApp().m_boolHamlibUseForPTT) {        
+        Hamlib *hamlib = wxGetApp().m_hamlib; 
+        if (wxGetApp().m_boolHamlibUseForPTT && hamlib != NULL) {
+            hamlib->ptt(g_tx);
+        }
+    }
+
+    // Serial PTT
+
+    /*  Truth table:
+
+          g_tx   RTSPos   RTS
+          -------------------
+          0      1        0
+          1      1        1
+          0      0        1
+          1      0        0
+
+          exclusive NOR
+    */
+
+    if(wxGetApp().m_boolUseSerialPTT && (com_handle != COM_HANDLE_INVALID)) {
+        if (wxGetApp().m_boolUseRTS) {
+            printf("g_tx: %d m_boolRTSPos: %d serialLine: %d\n", g_tx, wxGetApp().m_boolRTSPos, g_tx == wxGetApp().m_boolRTSPos);
+            if (g_tx == wxGetApp().m_boolRTSPos)
+                               raiseRTS();
+            else
+                               lowerRTS();
+        }
+        if (wxGetApp().m_boolUseDTR) {
+            printf("g_tx: %d m_boolDTRPos: %d serialLine: %d\n", g_tx, wxGetApp().m_boolDTRPos, g_tx == wxGetApp().m_boolDTRPos);
+            if (g_tx == wxGetApp().m_boolDTRPos)
+                               raiseDTR();
+            else
+                               lowerDTR();
+        }
+    }
+
+    // reset level gauge
+
+    m_maxLevel = 0;
+    m_textLevel->SetLabel(wxT(""));
+    m_gaugeLevel->SetValue(0);
+}
+
+//-------------------------------------------------------------------------
+// OnTogBtnRxID()
+//-------------------------------------------------------------------------
+void MainFrame::OnTogBtnRxID(wxCommandEvent& event)
+{
+    // empty any junk in rx data FIFO
+    short junk;
+    while(fifo_read(g_rxDataOutFifo,&junk,1) == 0);
+    event.Skip();
+}
+
+//-------------------------------------------------------------------------
+// OnTogBtnTxID()
+//-------------------------------------------------------------------------
+void MainFrame::OnTogBtnTxID(wxCommandEvent& event)
+{
+    event.Skip();
+}
+
+void MainFrame::OnTogBtnSplitClick(wxCommandEvent& event) {
+    if (g_split)
+        g_split = 0;
+    else
+        g_split = 1;
+    event.Skip();
+}
+
+//-------------------------------------------------------------------------
+// OnTogBtnAnalogClick()
+//-------------------------------------------------------------------------
+void MainFrame::OnTogBtnAnalogClick (wxCommandEvent& event)
+{
+    if (g_analog == 0)
+        g_analog = 1;
+    else
+        g_analog = 0;
+
+    event.Skip();
+}
+
+void MainFrame::OnCallSignReset(wxCommandEvent& event)
+{
+    m_pcallsign = m_callsign;
+    memset(m_callsign, 0, MAX_CALLSIGN);
+    wxString s;
+    s.Printf("%s", m_callsign);
+    m_txtCtrlCallSign->SetValue(s);
+    m_checksumGood = m_checksumBad = 0;
+    m_txtChecksumGood->SetLabel(_("0"));
+    m_txtChecksumBad->SetLabel(_("0"));
+}
+
+void MainFrame::OnBerReset(wxCommandEvent& event)
+{
+    g_total_bits = 0;
+    g_total_bit_errors = 0;
+}
+
+#ifdef ALC
+//-------------------------------------------------------------------------
+// OnTogBtnALCClick()
+//-------------------------------------------------------------------------
+void MainFrame::OnTogBtnALCClick(wxCommandEvent& event)
+{
+    wxMessageBox(wxT("Got Click!"), wxT("OnTogBtnALCClick"), wxOK);
+
+    event.Skip();
+}
+#endif
+
+// extra panel added to file open dialog to add loop checkbox
+MyExtraPlayFilePanel::MyExtraPlayFilePanel(wxWindow *parent): wxPanel(parent)
+{
+    m_cb = new wxCheckBox(this, -1, wxT("Loop"));
+    m_cb->SetToolTip(_("When checked file will repeat forever"));
+    m_cb->SetValue(g_loopPlayFileToMicIn);
+
+    // bug: I can't this to align right.....
+    wxBoxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
+    sizerTop->Add(m_cb, 0, wxALIGN_RIGHT, 0);
+    SetSizerAndFit(sizerTop);
+}
+
+static wxWindow* createMyExtraPlayFilePanel(wxWindow *parent)
+{
+    return new MyExtraPlayFilePanel(parent);
+}
+
+//-------------------------------------------------------------------------
+// OnPlayFileToMicIn()
+//-------------------------------------------------------------------------
+void MainFrame::OnPlayFileToMicIn(wxCommandEvent& event)
+{
+    wxUnusedVar(event);
+
+    if(g_playFileToMicIn)
+    {
+        g_mutexProtectingCallbackData.Lock();
+        g_playFileToMicIn = false;
+        sf_close(g_sfPlayFile);
+        SetStatusText(wxT(""));
+        g_mutexProtectingCallbackData.Unlock();
+    }
+    else
+    {
+        wxString    soundFile;
+        SF_INFO     sfInfo;
+
+        wxFileDialog openFileDialog(
+                                    this,
+                                    wxT("Play File to Mic In"),
+                                    wxGetApp().m_playFileToMicInPath,
+                                    wxEmptyString,
+                                    wxT("WAV and RAW files (*.wav;*.raw)|*.wav;*.raw|")
+                                    wxT("All files (*.*)|*.*"),
+                                    wxFD_OPEN | wxFD_FILE_MUST_EXIST
+                                    );
+
+        // add the loop check box
+        openFileDialog.SetExtraControlCreator(&createMyExtraPlayFilePanel);
+
+        if(openFileDialog.ShowModal() == wxID_CANCEL)
+        {
+            return;     // the user changed their mind...
+        }
+
+        wxString fileName, extension;
+        soundFile = openFileDialog.GetPath();
+        wxFileName::SplitPath(soundFile, &wxGetApp().m_playFileToMicInPath, &fileName, &extension);
+        //wxLogDebug("m_playFileToMicInPath: %s", wxGetApp().m_playFileToMicInPath);
+        sfInfo.format = 0;
+
+        if(!extension.IsEmpty())
+        {
+            extension.LowerCase();
+            if(extension == wxT("raw"))
+            {
+                sfInfo.format     = SF_FORMAT_RAW | SF_FORMAT_PCM_16;
+                sfInfo.channels   = 1;
+                sfInfo.samplerate = FS;
+            }
+        }
+        g_sfPlayFile = sf_open(soundFile, SFM_READ, &sfInfo);
+        if(g_sfPlayFile == NULL)
+        {
+            wxString strErr = sf_strerror(NULL);
+            wxMessageBox(strErr, wxT("Couldn't open sound file"), wxOK);
+            return;
+        }
+
+        wxWindow * const ctrl = openFileDialog.GetExtraControl();
+
+        // Huh?! I just copied wxWidgets-2.9.4/samples/dialogs ....
+        g_loopPlayFileToMicIn = static_cast<MyExtraPlayFilePanel*>(ctrl)->getLoopPlayFileToMicIn();
+
+        SetStatusText(wxT("Playing File: ") + fileName + wxT(" to Mic Input") , 0);
+        g_playFileToMicIn = true;
+    }
+}
+
+//-------------------------------------------------------------------------
+// OnPlayFileFromRadio()
+// This puppy "plays" a recorded file into the denmonulator input, allowing us
+// to replay off air signals.
+//-------------------------------------------------------------------------
+void MainFrame::OnPlayFileFromRadio(wxCommandEvent& event)
+{
+    wxUnusedVar(event);
+
+    printf("OnPlayFileFromRadio:: %d\n", (int)g_playFileFromRadio);
+    if (g_playFileFromRadio)
+    {
+        printf("OnPlayFileFromRadio:: Stop\n");
+        g_mutexProtectingCallbackData.Lock();
+        g_playFileFromRadio = false;
+        sf_close(g_sfPlayFileFromRadio);
+        SetStatusText(wxT(""));
+        g_mutexProtectingCallbackData.Unlock();
+    }
+    else
+    {
+        wxString    soundFile;
+        SF_INFO     sfInfo;
+
+        wxFileDialog openFileDialog(
+                                    this,
+                                    wxT("Play File - From Radio"),
+                                    wxGetApp().m_playFileFromRadioPath,
+                                    wxEmptyString,
+                                    wxT("WAV and RAW files (*.wav;*.raw)|*.wav;*.raw|")
+                                    wxT("All files (*.*)|*.*"),
+                                    wxFD_OPEN | wxFD_FILE_MUST_EXIST
+                                    );
+
+        // add the loop check box
+        openFileDialog.SetExtraControlCreator(&createMyExtraPlayFilePanel);
+
+        if(openFileDialog.ShowModal() == wxID_CANCEL)
+        {
+            return;     // the user changed their mind...
+        }
+
+        wxString fileName, extension;
+        soundFile = openFileDialog.GetPath();
+        wxFileName::SplitPath(soundFile, &wxGetApp().m_playFileFromRadioPath, &fileName, &extension);
+        //wxLogDebug("m_playFileToFromRadioPath: %s", wxGetApp().m_playFileFromRadioPath);
+        sfInfo.format = 0;
+
+        if(!extension.IsEmpty())
+        {
+            extension.LowerCase();
+            if(extension == wxT("raw"))
+            {
+                sfInfo.format     = SF_FORMAT_RAW | SF_FORMAT_PCM_16;
+                sfInfo.channels   = 1;
+                sfInfo.samplerate = FS;
+            }
+        }
+        g_sfPlayFileFromRadio = sf_open(soundFile, SFM_READ, &sfInfo);
+        if(g_sfPlayFileFromRadio == NULL)
+        {
+            wxString strErr = sf_strerror(NULL);
+            wxMessageBox(strErr, wxT("Couldn't open sound file"), wxOK);
+            return;
+        }
+
+        wxWindow * const ctrl = openFileDialog.GetExtraControl();
+
+        // Huh?! I just copied wxWidgets-2.9.4/samples/dialogs ....
+        g_loopPlayFileFromRadio = static_cast<MyExtraPlayFilePanel*>(ctrl)->getLoopPlayFileToMicIn();
+
+        SetStatusText(wxT("Playing File: ") + fileName + wxT(" into From Radio") , 0);
+        g_playFileFromRadio = true;
+    }
+}
+
+// extra panel added to file save dialog to set number of seconds to record for
+
+MyExtraRecFilePanel::MyExtraRecFilePanel(wxWindow *parent): wxPanel(parent)
+{
+    wxBoxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
+
+    wxStaticText* staticText = new wxStaticText(this, wxID_ANY, _("Seconds:"), wxDefaultPosition, wxDefaultSize, 0);
+    sizerTop->Add(staticText, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
+    m_secondsToRecord = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
+    m_secondsToRecord->SetToolTip(_("Number of seconds to record for"));
+    m_secondsToRecord->SetValue(wxString::Format(wxT("%i"), wxGetApp().m_recFileFromRadioSecs));
+    sizerTop->Add(m_secondsToRecord, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
+    SetSizerAndFit(sizerTop);
+}
+
+static wxWindow* createMyExtraRecFilePanel(wxWindow *parent)
+{
+    return new MyExtraRecFilePanel(parent);
+}
+
+//-------------------------------------------------------------------------
+// OnRecFileFromRadio()
+//-------------------------------------------------------------------------
+void MainFrame::OnRecFileFromRadio(wxCommandEvent& event)
+{
+    wxUnusedVar(event);
+
+    if (g_recFileFromRadio) {
+        printf("Stopping Record....\n");
+        g_mutexProtectingCallbackData.Lock();
+        g_recFileFromRadio = false;
+        sf_close(g_sfRecFile);
+        SetStatusText(wxT(""));
+        g_mutexProtectingCallbackData.Unlock();
+    }
+    else {
+
+        wxString    soundFile;
+        SF_INFO     sfInfo;
+
+         wxFileDialog openFileDialog(
+                                    this,
+                                    wxT("Record File From Radio"),
+                                    wxGetApp().m_recFileFromRadioPath,
+                                    wxEmptyString,
+                                    wxT("WAV and RAW files (*.wav;*.raw)|*.wav;*.raw|")
+                                    wxT("All files (*.*)|*.*"),
+                                    wxFD_SAVE
+                                    );
+
+        // add the loop check box
+        openFileDialog.SetExtraControlCreator(&createMyExtraRecFilePanel);
+
+        if(openFileDialog.ShowModal() == wxID_CANCEL)
+        {
+            return;     // the user changed their mind...
+        }
+
+        wxString fileName, extension;
+        soundFile = openFileDialog.GetPath();
+        wxFileName::SplitPath(soundFile, &wxGetApp().m_recFileFromRadioPath, &fileName, &extension);
+        wxLogDebug("m_recFileFromRadioPath: %s", wxGetApp().m_recFileFromRadioPath);
+        wxLogDebug("soundFile: %s", soundFile);
+        sfInfo.format = 0;
+
+        if(!extension.IsEmpty())
+        {
+            extension.LowerCase();
+            if(extension == wxT("raw"))
+            {
+                sfInfo.format     = SF_FORMAT_RAW | SF_FORMAT_PCM_16;
+                sfInfo.channels   = 1;
+                sfInfo.samplerate = FS;
+            }
+            else if(extension == wxT("wav"))
+            {
+                sfInfo.format     = SF_FORMAT_WAV | SF_FORMAT_PCM_16;
+                sfInfo.channels   = 1;
+                sfInfo.samplerate = FS;
+            } else {
+                wxMessageBox(wxT("Invalid file format"), wxT("Record File From Radio"), wxOK);
+                return;
+            }
+        }
+        else {
+            wxMessageBox(wxT("Invalid file format"), wxT("Record File From Radio"), wxOK);
+            return;
+        }
+
+        // Bug: on Win32 I cant read m_recFileFromRadioSecs, so have hard coded it
+#ifdef __WIN32__
+        long secs = wxGetApp().m_recFileFromRadioSecs;
+        g_recFromRadioSamples = FS*(unsigned int)secs;
+#else
+        // work out number of samples to record
+
+        wxWindow * const ctrl = openFileDialog.GetExtraControl();
+        wxString secsString = static_cast<MyExtraRecFilePanel*>(ctrl)->getSecondsToRecord();
+        wxLogDebug("test: %s secsString: %s\n", wxT("testing 123"), secsString);
+
+        long secs;
+        if (secsString.ToLong(&secs)) {
+            wxGetApp().m_recFileFromRadioSecs = (unsigned int)secs;
+            //printf(" secondsToRecord: %d\n",  (unsigned int)secs);
+            g_recFromRadioSamples = FS*(unsigned int)secs;
+            //printf("g_recFromRadioSamples: %d\n", g_recFromRadioSamples);
+        }
+        else {
+            wxMessageBox(wxT("Invalid number of Seconds"), wxT("Record File From Radio"), wxOK);
+            return;
+        }
+#endif
+
+        g_sfRecFile = sf_open(soundFile, SFM_WRITE, &sfInfo);
+        if(g_sfRecFile == NULL)
+        {
+            wxString strErr = sf_strerror(NULL);
+            wxMessageBox(strErr, wxT("Couldn't open sound file"), wxOK);
+            return;
+        }
+
+        SetStatusText(wxT("Recording File: ") + fileName + wxT(" From Radio") , 0);
+        g_recFileFromRadio = true;
+    }
+
+}
+
+//-------------------------------------------------------------------------
+// OnExit()
+//-------------------------------------------------------------------------
+void MainFrame::OnExit(wxCommandEvent& event)
+{
+    wxUnusedVar(event);
+#ifdef _USE_TIMER
+    m_plotTimer.Stop();
+#endif // _USE_TIMER
+    if(g_sfPlayFile != NULL)
+    {
+        sf_close(g_sfPlayFile);
+        g_sfPlayFile = NULL;
+    }
+    if(g_sfRecFile != NULL)
+    {
+        sf_close(g_sfRecFile);
+        g_sfRecFile = NULL;
+    }
+    if(m_RxRunning)
+    {
+        stopRxStream();
+    }
+    m_togBtnSplit->Disable();
+    //m_togRxID->Disable();
+    //m_togTxID->Disable();
+    m_togBtnAnalog->Disable();
+    //m_togBtnALC->Disable();
+    //m_btnTogPTT->Disable();
+    Pa_Terminate();
+    Destroy();
+}
+
+//-------------------------------------------------------------------------
+// OnExitClick()
+//-------------------------------------------------------------------------
+void MainFrame::OnExitClick(wxCommandEvent& event)
+{
+    OnExit(event);
+}
+
+//-------------------------------------------------------------------------
+// OnToolsAudio()
+//-------------------------------------------------------------------------
+void MainFrame::OnToolsAudio(wxCommandEvent& event)
+{
+    wxUnusedVar(event);
+    int rv = 0;
+    AudioOptsDialog *dlg = new AudioOptsDialog(NULL);
+    rv = dlg->ShowModal();
+    if(rv == wxID_OK)
+    {
+        dlg->ExchangeData(EXCHANGE_DATA_OUT);
+    }
+    delete dlg;
+}
+
+//-------------------------------------------------------------------------
+// OnToolsAudioUI()
+//-------------------------------------------------------------------------
+void MainFrame::OnToolsAudioUI(wxUpdateUIEvent& event)
+{
+    event.Enable(!m_RxRunning);
+}
+
+//-------------------------------------------------------------------------
+// OnToolsFilter()
+//-------------------------------------------------------------------------
+void MainFrame::OnToolsFilter(wxCommandEvent& event)
+{
+    wxUnusedVar(event);
+    FilterDlg *dlg = new FilterDlg(NULL, m_RxRunning, &m_newMicInFilter, &m_newSpkOutFilter);
+    dlg->ShowModal();
+    delete dlg;
+}
+
+//-------------------------------------------------------------------------
+// OnToolsOptions()
+//-------------------------------------------------------------------------
+void MainFrame::OnToolsOptions(wxCommandEvent& event)
+{
+    wxUnusedVar(event);
+    m_modal=true;
+    optionsDlg->Show();
+    m_modal=false;
+}
+
+//-------------------------------------------------------------------------
+// OnToolsOptionsUI()
+//-------------------------------------------------------------------------
+void MainFrame::OnToolsOptionsUI(wxUpdateUIEvent& event)
+{
+}
+
+//-------------------------------------------------------------------------
+// OnToolsComCfg()
+//-------------------------------------------------------------------------
+void MainFrame::OnToolsComCfg(wxCommandEvent& event)
+{
+    wxUnusedVar(event);
+
+    ComPortsDlg *dlg = new ComPortsDlg(NULL);
+
+    int rv = dlg->ShowModal();
+
+    // test Hamlib/Serial set up
+
+    if(rv == wxID_OK)
+    {
+        if (wxGetApp().m_boolHamlibUseForPTT) {
+            OpenHamlibRig();
+            wxGetApp().m_hamlib->close();
+        }
+        if (wxGetApp().m_boolUseSerialPTT) {
+            SetupSerialPort();
+            CloseSerialPort();
+        }
+    }
+
+    delete dlg;
+}
+
+//-------------------------------------------------------------------------
+// OnToolsComCfgUI()
+//-------------------------------------------------------------------------
+void MainFrame::OnToolsComCfgUI(wxUpdateUIEvent& event)
+{
+    event.Enable(!m_RxRunning);
+}
+
+//-------------------------------------------------------------------------
+// OnHelpCheckUpdates()
+//-------------------------------------------------------------------------
+void MainFrame::OnHelpCheckUpdates(wxCommandEvent& event)
+{
+    wxMessageBox("Got Click!", "OnHelpCheckUpdates", wxOK);
+    event.Skip();
+}
+
+//-------------------------------------------------------------------------
+// OnHelpCheckUpdatesUI()
+//-------------------------------------------------------------------------
+void MainFrame::OnHelpCheckUpdatesUI(wxUpdateUIEvent& event)
+{
+    event.Enable(false);
+}
+
+//-------------------------------------------------------------------------
+//OnHelpAbout()
+//-------------------------------------------------------------------------
+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
+    wxURL url(wxT("http://svn.code.sf.net/p/freetel/code/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("<h2>p/freetel/code - Revision ");
+            int startIndex = htmldata.find(s) + s.Length();
+            int endIndex = htmldata.find(wxT(": /fdmdv2</h2>"));
+            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("How much have you spent on Ham gear this year?  How did it compare to FreeDV? ")
+                wxT("FreeDV repesents an open and free future for digital voice over Ham Radio. ")
+                wxT("Please help by donating just $10 here: 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);
+
+#endif // _USE_ABOUT_DIALOG
+#ifdef USE_SIMPLE_ABOUT_DIALOG
+    wxUnusedVar(event);
+    wxAboutDialogInfo info;
+    info.SetCopyright(_("HAMLib Test"));
+    info.SetLicence(_("GPL v2 or later"));
+    info.SetDescription(_("Short description goes here"));
+    ::wxAboutBox(info);
+#endif // USE_SIMPLE_ABOUT_DIALOG
+
+}
+
+
+// Attempt to talk to rig using Hamlib
+
+bool MainFrame::OpenHamlibRig() {
+    if (wxGetApp().m_boolHamlibUseForPTT != true)
+       return false;
+    if (wxGetApp().m_intHamlibRig == 0)
+        return false;
+    if (wxGetApp().m_hamlib == NULL)
+        return false;
+
+    int rig = wxGetApp().m_intHamlibRig;
+    wxString port = wxGetApp().m_strHamlibSerialPort;
+    bool status = wxGetApp().m_hamlib->connect(rig, port.mb_str(wxConvUTF8));
+    if (status == false)
+        wxMessageBox("Couldn't connect to Radio with hamlib", wxT("About"), wxOK | wxICON_ERROR, this);
+    return status;
+} 
+
+//-------------------------------------------------------------------------
+// OnTogBtnOnOff()
+//-------------------------------------------------------------------------
+void MainFrame::OnTogBtnOnOff(wxCommandEvent& event)
+{
+    wxString startStop = m_togBtnOnOff->GetLabel();
+
+    // we are attempting to start
+
+    if (startStop.IsSameAs("Start"))
+    {
+        //
+        // Start Running -------------------------------------------------
+        //
+
+        // modify some button states when running
+
+        m_togBtnSplit->Enable();
+        //m_togRxID->Enable();
+        //m_togTxID->Enable();
+        m_togBtnAnalog->Enable();
+        m_togBtnOnOff->SetLabel(wxT("Stop"));
+        m_btnTogPTT->Enable();
+
+        m_rb1400old->Disable();
+        m_rb1600->Disable();
+        m_rb1600Wide->Disable();
+#ifdef DISABLED_FEATURE
+        m_rb1400->Disable();
+        m_rb2000->Disable();
+#endif
+        // determine what mode we are using
+
+        int codec2_mode;
+        if (m_rb1400old->GetValue()) {
+            g_mode = MODE_1400_V0_91;
+            g_Nc = 14;
+            codec2_mode = CODEC2_MODE_1400;
+        }
+
+        if (m_rb1600->GetValue()) {
+            g_mode = MODE_1600;
+            g_Nc = 16;
+            codec2_mode = CODEC2_MODE_1300;
+        }
+        if (m_rb1600Wide->GetValue()) {
+            g_mode = MODE_1600_WIDE;
+            g_Nc = 16;
+            codec2_mode = CODEC2_MODE_1300;
+        }
+#ifdef DISABLED_FEATURE
+        if (m_rb1400->GetValue()) {
+            g_mode = MODE_1400;
+            g_Nc = 14;
+            codec2_mode = CODEC2_MODE_1400;
+        }
+        if (m_rb2000->GetValue()) {
+            g_mode = MODE_2000;
+            g_Nc = 20;
+            codec2_mode = CODEC2_MODE_1400;
+        }
+        printf("g_mode: %d  Nc: %d  codec2_mode: %d\n", g_mode, g_Nc, codec2_mode);
+#endif
+
+        // init modem and codec states
+
+        g_pFDMDV  = fdmdv_create(g_Nc);
+        g_sz_error_pattern = fdmdv_error_pattern_size(g_pFDMDV);
+        g_error_pattern = (short*)malloc(g_sz_error_pattern*sizeof(short));
+        g_errorFifo = fifo_create(2*g_sz_error_pattern);
+
+        assert(g_error_pattern != NULL);
+
+        g_pCodec2 = codec2_create(codec2_mode);
+
+        if (g_mode == MODE_1400_V0_91)
+            fdmdv_use_old_qpsk_mapping(g_pFDMDV);
+        if (g_mode == MODE_1600_WIDE)
+            fdmdv_set_fsep(g_pFDMDV, FSEP_WIDE);
+
+        // adjust scatter diagram for Number of FDM carriers
+
+        m_panelScatter->setNc(g_Nc);
+
+        // scale factor for to normalise ouput power across modes
+        // note: PAPR will still be worse for higher Nc, especially in frame test mode
+
+        g_pwr_scale = sqrt((14.0+4.0)/(g_Nc+4.0));
+        g_clip = 120;
+
+        // init Codec 2 LPC Post Filter
+
+        codec2_set_lpc_post_filter(g_pCodec2,
+                                   wxGetApp().m_codec2LPCPostFilterEnable,
+                                   wxGetApp().m_codec2LPCPostFilterBassBoost,
+                                   wxGetApp().m_codec2LPCPostFilterBeta,
+                                   wxGetApp().m_codec2LPCPostFilterGamma);
+
+        g_State = 0;
+        g_snr = 0.0;
+        g_half_duplex = wxGetApp().m_boolHalfDuplex;
+
+        m_pcallsign = m_callsign;
+        m_checksumGood = m_checksumBad = 0;
+
+        m_maxLevel = 0;
+        m_textLevel->SetLabel(wxT(""));
+        m_gaugeLevel->SetValue(0);
+
+        // Init text msg decoding
+
+        varicode_decode_init(&g_varicode_dec_states, wxGetApp().m_textEncoding);      
+        //printf("m_textEncoding = %d\n", wxGetApp().m_textEncoding);
+        //printf("g_stats.snr: %f\n", g_stats.snr_est);
+
+        // attempt to start PTT ......
+        
+        if (wxGetApp().m_boolHamlibUseForPTT)
+            OpenHamlibRig();
+        if (wxGetApp().m_boolUseSerialPTT) {
+            SetupSerialPort();
+        }
+
+        // attempt to start sound cards and tx/rx processing
+
+        startRxStream();
+
+        if (m_RxRunning)
+        {
+#ifdef _USE_TIMER
+            m_plotTimer.Start(_REFRESH_TIMER_PERIOD, wxTIMER_CONTINUOUS);
+#endif // _USE_TIMER
+        }
+        char e[80]; sprintf(e,"start"); processTxtEvent(e);
+    }
+
+    // Stop was pressed or start up failed
+
+    if (startStop.IsSameAs("Stop") || !m_RxRunning ) {
+
+        //
+        // Stop Running -------------------------------------------------
+        //
+
+        optionsDlg->SetSpamTimerLight(false);
+
+#ifdef _USE_TIMER
+        m_plotTimer.Stop();
+#endif // _USE_TIMER
+
+        // ensure we are not transmitting and shut down audio processing
+
+        if (wxGetApp().m_boolHamlibUseForPTT) {
+            Hamlib *hamlib = wxGetApp().m_hamlib; 
+            if (wxGetApp().m_boolHamlibUseForPTT && hamlib != NULL) {
+                hamlib->ptt(false);
+                hamlib->close();
+            }
+        }
+
+        if (wxGetApp().m_boolUseSerialPTT)
+            CloseSerialPort();
+
+        m_btnTogPTT->SetValue(false);
+
+        stopRxStream();
+
+        // free up states
+
+        free(g_error_pattern);
+        fifo_destroy(g_errorFifo);
+        fdmdv_destroy(g_pFDMDV);
+        codec2_destroy(g_pCodec2);
+
+        m_newMicInFilter = m_newSpkOutFilter = true;
+
+        m_togBtnSplit->Disable();
+        //m_togRxID->Disable();
+        //m_togTxID->Disable();
+        m_togBtnAnalog->Disable();
+        m_btnTogPTT->Disable();
+        m_togBtnOnOff->SetLabel(wxT("Start"));
+        m_rb1400old->Enable();
+        m_rb1600->Enable();
+        m_rb1600Wide->Enable();
+#ifdef DISABLED_FEATURE
+        m_rb1400->Enable();
+        m_rb2000->Enable();
+#endif
+        char e[80]; sprintf(e,"stop"); processTxtEvent(e);
+    }
+}
+
+//-------------------------------------------------------------------------
+// stopRxStream()
+//-------------------------------------------------------------------------
+void MainFrame::stopRxStream()
+{
+    if(m_RxRunning)
+    {
+        m_RxRunning = false;
+
+        wxLogDebug("waiting for thread to stop");
+        m_txRxThread->m_run = 0;
+        m_txRxThread->Wait();
+        wxLogDebug("thread stopped");
+
+        m_rxInPa->stop();
+        m_rxInPa->streamClose();
+        delete m_rxInPa;
+        if(m_rxOutPa != m_rxInPa) {
+                       m_rxOutPa->stop();
+                       m_rxOutPa->streamClose();
+                       delete m_rxOutPa;
+               }
+
+        if (g_nSoundCards == 2) {
+            m_txInPa->stop();
+            m_txInPa->streamClose();
+            delete m_txInPa;
+            if(m_txInPa != m_txOutPa) {
+                               m_txOutPa->stop();
+                               m_txOutPa->streamClose();
+                               delete m_txOutPa;
+                       }
+        }
+
+        destroy_fifos();
+        destroy_src();
+        deleteEQFilters(g_rxUserdata);
+        delete g_rxUserdata;
+    }
+}
+
+void MainFrame::destroy_fifos(void)
+{
+    fifo_destroy(g_rxUserdata->infifo1);
+    fifo_destroy(g_rxUserdata->outfifo1);
+    fifo_destroy(g_rxUserdata->infifo2);
+    fifo_destroy(g_rxUserdata->outfifo2);
+    fifo_destroy(g_rxUserdata->rxinfifo);
+    fifo_destroy(g_rxUserdata->rxoutfifo);
+}
+
+void MainFrame::destroy_src(void)
+{
+    src_delete(g_rxUserdata->insrc1);
+    src_delete(g_rxUserdata->outsrc1);
+    src_delete(g_rxUserdata->insrc2);
+    src_delete(g_rxUserdata->outsrc2);
+}
+
+void  MainFrame::initPortAudioDevice(PortAudioWrap *pa, int inDevice, int outDevice,
+                                     int soundCard, int sampleRate, int inputChannels)
+{
+    // Note all of the wrapper functions below just set values in a
+    // portaudio struct so can't return any errors. So no need to trap
+    // any errors in this function.
+
+    // init input params
+
+    pa->setInputDevice(inDevice);
+    if(inDevice != paNoDevice) {
+               pa->setInputChannelCount(inputChannels);           // stereo input
+               pa->setInputSampleFormat(PA_SAMPLE_TYPE);
+               pa->setInputLatency(pa->getInputDefaultLowLatency());
+               pa->setInputHostApiStreamInfo(NULL);
+       }
+
+    // init output params
+
+       pa->setOutputDevice(outDevice);
+       if(outDevice != paNoDevice) {
+               pa->setOutputChannelCount(2);                      // stereo output
+               pa->setOutputSampleFormat(PA_SAMPLE_TYPE);
+               pa->setOutputLatency(pa->getOutputDefaultLowLatency());
+               pa->setOutputHostApiStreamInfo(NULL);
+       }
+
+    // init params that affect input and output
+
+    /*
+       On a good day, framesPerBuffer in callback will be PA_FPB.  It
+       was found that you don't always get framesPerBuffer exactly
+       equal PA_PFB, for example when I set PA_FPB to 960 I got
+       framesPerBuffer = 1024.
+    */
+    pa->setFramesPerBuffer(wxGetApp().m_framesPerBuffer);
+    pa->setSampleRate(sampleRate);
+    pa->setStreamFlags(paClipOff);
+}
+
+//-------------------------------------------------------------------------
+// startRxStream()
+//-------------------------------------------------------------------------
+void MainFrame::startRxStream()
+{
+    int   src_error;
+    const PaDeviceInfo *deviceInfo1 = NULL, *deviceInfo2 = NULL;
+    int   inputChannels1, inputChannels2;
+    bool  two_rx=false;
+    bool  two_tx=false;
+
+    if(!m_RxRunning) {
+        m_RxRunning = true;
+
+        if(Pa_Initialize())
+        {
+            wxMessageBox(wxT("Port Audio failed to initialize"), wxT("Pa_Initialize"), wxOK);
+        }
+
+        m_rxInPa = new PortAudioWrap();
+        if(g_soundCard1InDeviceNum != g_soundCard1OutDeviceNum)
+                       two_rx=true;
+        if(g_soundCard2InDeviceNum != g_soundCard2OutDeviceNum)
+                       two_tx=true;
+        
+        if(two_rx)
+                       m_rxOutPa = new PortAudioWrap();
+               else
+                       m_rxOutPa = m_rxInPa;
+
+        if (g_nSoundCards == 0) {
+            wxMessageBox(wxT("No Sound Cards configured, use Tools - Audio Config to configure"), wxT("Error"), wxOK);
+            delete m_rxInPa;
+            if(two_rx)
+                               delete m_rxOutPa;
+            m_RxRunning = false;
+            return;
+        }
+
+        // Init Sound card 1 ----------------------------------------------
+        // sanity check on sound card device numbers
+
+        if ((m_rxInPa->getDeviceCount() <= g_soundCard1InDeviceNum) ||
+            (m_rxOutPa->getDeviceCount() <= g_soundCard1OutDeviceNum)) {
+            wxMessageBox(wxT("Sound Card 1 not present"), wxT("Error"), wxOK);
+            delete m_rxInPa;
+            if(two_rx)
+                               delete m_rxOutPa;
+            m_RxRunning = false;
+            return;
+        }
+
+        // work out how many input channels this device supports.
+
+        deviceInfo1 = Pa_GetDeviceInfo(g_soundCard1InDeviceNum);
+        if (deviceInfo1 == NULL) {
+            wxMessageBox(wxT("Couldn't get device info from Port Audio for Sound Card 1"), wxT("Error"), wxOK);
+            delete m_rxInPa;
+            if(two_rx)
+                               delete m_rxOutPa;
+            m_RxRunning = false;
+            return;
+        }
+        if (deviceInfo1->maxInputChannels == 1)
+            inputChannels1 = 1;
+        else
+            inputChannels1 = 2;
+
+        if(two_rx) {
+            initPortAudioDevice(m_rxInPa, g_soundCard1InDeviceNum, paNoDevice, 1,
+                            g_soundCard1SampleRate, inputChannels1);
+            initPortAudioDevice(m_rxOutPa, paNoDevice, g_soundCard1OutDeviceNum, 1,
+                            g_soundCard1SampleRate, inputChannels1);
+               }
+        else
+            initPortAudioDevice(m_rxInPa, g_soundCard1InDeviceNum, g_soundCard1OutDeviceNum, 1,
+                            g_soundCard1SampleRate, inputChannels1);
+
+        // Init Sound Card 2 ------------------------------------------------
+
+        if (g_nSoundCards == 2) {
+
+            m_txInPa = new PortAudioWrap();
+            if(two_tx)
+                               m_txOutPa = new PortAudioWrap();
+                       else
+                               m_txOutPa = m_txInPa;
+
+            // sanity check on sound card device numbers
+
+            //printf("m_txInPa->getDeviceCount(): %d\n", m_txInPa->getDeviceCount());
+            //printf("g_soundCard2InDeviceNum: %d\n", g_soundCard2InDeviceNum);
+            //printf("g_soundCard2OutDeviceNum: %d\n", g_soundCard2OutDeviceNum);
+
+            if ((m_txInPa->getDeviceCount() <= g_soundCard2InDeviceNum) ||
+                (m_txOutPa->getDeviceCount() <= g_soundCard2OutDeviceNum)) {
+                wxMessageBox(wxT("Sound Card 2 not present"), wxT("Error"), wxOK);
+                delete m_rxInPa;
+                if(two_rx)
+                                       delete m_rxOutPa;
+                delete m_txInPa;
+                if(two_tx)
+                                       delete m_txOutPa;
+                m_RxRunning = false;
+                return;
+            }
+
+            deviceInfo2 = Pa_GetDeviceInfo(g_soundCard2InDeviceNum);
+            if (deviceInfo2 == NULL) {
+                wxMessageBox(wxT("Couldn't get device info from Port Audio for Sound Card 1"), wxT("Error"), wxOK);
+                delete m_rxInPa;
+                if(two_rx)
+                                       delete m_rxOutPa;
+                delete m_txInPa;
+                if(two_tx)
+                                       delete m_txOutPa;
+                m_RxRunning = false;
+                return;
+            }
+            if (deviceInfo2->maxInputChannels == 1)
+                inputChannels2 = 1;
+            else
+                inputChannels2 = 2;
+
+            if(two_tx) {
+                               initPortAudioDevice(m_txInPa, g_soundCard2InDeviceNum, paNoDevice, 2,
+                                g_soundCard2SampleRate, inputChannels2);
+                               initPortAudioDevice(m_txOutPa, paNoDevice, g_soundCard2OutDeviceNum, 2,
+                                g_soundCard2SampleRate, inputChannels2);
+                       }
+                       else
+                               initPortAudioDevice(m_txInPa, g_soundCard2InDeviceNum, g_soundCard2OutDeviceNum, 2,
+                                g_soundCard2SampleRate, inputChannels2);
+        }
+
+        // Init call back data structure ----------------------------------------------
+
+        g_rxUserdata = new paCallBackData;
+        g_rxUserdata->inputChannels1 = inputChannels1;
+        if (deviceInfo2 != NULL)
+            g_rxUserdata->inputChannels2 = inputChannels2;
+
+        // init sample rate conversion states
+
+        g_rxUserdata->insrc1 = src_new(SRC_SINC_FASTEST, 1, &src_error);
+        assert(g_rxUserdata->insrc1 != NULL);
+        g_rxUserdata->outsrc1 = src_new(SRC_SINC_FASTEST, 1, &src_error);
+        assert(g_rxUserdata->outsrc1 != NULL);
+        g_rxUserdata->insrc2 = src_new(SRC_SINC_FASTEST, 1, &src_error);
+        assert(g_rxUserdata->insrc2 != NULL);
+        g_rxUserdata->outsrc2 = src_new(SRC_SINC_FASTEST, 1, &src_error);
+        assert(g_rxUserdata->outsrc2 != NULL);
+
+        // create FIFOs used to interface between different buffer sizes
+
+        g_rxUserdata->infifo1 = fifo_create(8*N48);
+        g_rxUserdata->outfifo1 = fifo_create(8*N48);
+        g_rxUserdata->outfifo2 = fifo_create(8*N48);
+        g_rxUserdata->infifo2 = fifo_create(8*N48);
+
+        g_rxUserdata->rxinfifo = fifo_create(3 * FDMDV_NOM_SAMPLES_PER_FRAME);
+        g_rxUserdata->rxoutfifo = fifo_create(2 * codec2_samples_per_frame(g_pCodec2));
+
+        // Init Equaliser Filters ------------------------------------------------------
+
+        m_newMicInFilter = m_newSpkOutFilter = true;
+        designEQFilters(g_rxUserdata);
+        g_rxUserdata->micInEQEnable = wxGetApp().m_MicInEQEnable;
+        g_rxUserdata->spkOutEQEnable = wxGetApp().m_SpkOutEQEnable;
+
+        // otional tone in left channel to reliably trigger vox
+        
+        g_rxUserdata->leftChannelVoxTone = wxGetApp().m_leftChannelVoxTone;
+        g_rxUserdata->voxTonePhase = 0;
+
+        // Start sound card 1 ----------------------------------------------------------
+
+        m_rxInPa->setUserData(g_rxUserdata);
+        m_rxErr = m_rxInPa->setCallback(rxCallback);
+
+        m_rxErr = m_rxInPa->streamOpen();
+
+        if(m_rxErr != paNoError) {
+            wxMessageBox(wxT("Sound Card 1 Open/Setup error."), wxT("Error"), wxOK);
+                       delete m_rxInPa;
+                       if(two_rx)
+                               delete m_rxOutPa;
+                       delete m_txInPa;
+                       if(two_tx)
+                               delete m_txOutPa;
+            destroy_fifos();
+            destroy_src();
+            deleteEQFilters(g_rxUserdata);
+            delete g_rxUserdata;
+            m_RxRunning = false;
+            return;
+        }
+
+        m_rxErr = m_rxInPa->streamStart();
+        if(m_rxErr != paNoError) {
+            wxMessageBox(wxT("Sound Card 1 Stream Start Error."), wxT("Error"), wxOK);
+                       delete m_rxInPa;
+                       if(two_rx)
+                               delete m_rxOutPa;
+                       delete m_txInPa;
+                       if(two_tx)
+                               delete m_txOutPa;
+            destroy_fifos();
+            destroy_src();
+            deleteEQFilters(g_rxUserdata);
+            delete g_rxUserdata;
+            m_RxRunning = false;
+            return;
+        }
+
+               // Start separate output stream if needed
+
+               if(two_rx) {
+                       m_rxOutPa->setUserData(g_rxUserdata);
+                       m_rxErr = m_rxOutPa->setCallback(rxCallback);
+
+                       m_rxErr = m_rxOutPa->streamOpen();
+
+                       if(m_rxErr != paNoError) {
+                               wxMessageBox(wxT("Sound Card 1 Second Stream Open/Setup error."), wxT("Error"), wxOK);
+                               delete m_rxInPa;
+                               delete m_rxOutPa;
+                               delete m_txOutPa;
+                               if(two_tx)
+                                       delete m_txOutPa;
+                               destroy_fifos();
+                               destroy_src();
+                               deleteEQFilters(g_rxUserdata);
+                               delete g_rxUserdata;
+                               m_RxRunning = false;
+                               return;
+                       }
+
+                       m_rxErr = m_rxOutPa->streamStart();
+                       if(m_rxErr != paNoError) {
+                               wxMessageBox(wxT("Sound Card 1 Second Stream Start Error."), wxT("Error"), wxOK);
+                               m_rxInPa->stop();
+                               m_rxInPa->streamClose();
+                               delete m_rxInPa;
+                               delete m_rxOutPa;
+                               delete m_txOutPa;
+                               if(two_tx)
+                                       delete m_txOutPa;
+                               destroy_fifos();
+                               destroy_src();
+                               deleteEQFilters(g_rxUserdata);
+                               delete g_rxUserdata;
+                               m_RxRunning = false;
+                               return;
+                       }
+               }
+
+        // Start sound card 2 ----------------------------------------------------------
+
+        if (g_nSoundCards == 2) {
+
+            // question: can we use same callback data
+            // (g_rxUserdata)or both sound card callbacks?  Is there a
+            // chance of them both being called at the same time?  We
+            // could need a mutex ...
+
+            m_txInPa->setUserData(g_rxUserdata);
+            m_txErr = m_txInPa->setCallback(txCallback);
+            m_txErr = m_txInPa->streamOpen();
+
+            if(m_txErr != paNoError) {
+                fprintf(stderr, "Err: %d\n", m_txErr);
+                wxMessageBox(wxT("Sound Card 2 Open/Setup error."), wxT("Error"), wxOK);
+                m_rxInPa->stop();
+                m_rxInPa->streamClose();
+                delete m_rxInPa;
+                if(two_rx) {
+                                       m_rxOutPa->stop();
+                                       m_rxOutPa->streamClose();
+                                       delete m_rxOutPa;
+                               }
+                delete m_txInPa;
+                if(two_tx)
+                                       delete m_txOutPa;
+                destroy_fifos();
+                destroy_src();
+                deleteEQFilters(g_rxUserdata);
+                delete g_rxUserdata;
+                m_RxRunning = false;
+                return;
+            }
+            m_txErr = m_txInPa->streamStart();
+            if(m_txErr != paNoError) {
+                wxMessageBox(wxT("Sound Card 2 Start Error."), wxT("Error"), wxOK);
+                m_rxInPa->stop();
+                m_rxInPa->streamClose();
+                delete m_rxInPa;
+                if(two_rx) {
+                                       m_rxOutPa->stop();
+                                       m_rxOutPa->streamClose();
+                                       delete m_rxOutPa;
+                               }
+                delete m_txInPa;
+                if(two_tx)
+                                       delete m_txOutPa;
+                destroy_fifos();
+                destroy_src();
+                deleteEQFilters(g_rxUserdata);
+                delete g_rxUserdata;
+                m_RxRunning = false;
+                return;
+            }
+               // Start separate output stream if needed
+
+                       if (two_tx) {
+
+                               // question: can we use same callback data
+                               // (g_rxUserdata)or both sound card callbacks?  Is there a
+                               // chance of them both being called at the same time?  We
+                               // could need a mutex ...
+
+                               m_txOutPa->setUserData(g_rxUserdata);
+                               m_txErr = m_txOutPa->setCallback(txCallback);
+                               m_txErr = m_txOutPa->streamOpen();
+
+                               if(m_txErr != paNoError) {
+                                       wxMessageBox(wxT("Sound Card 2 Second Stream Open/Setup error."), wxT("Error"), wxOK);
+                                       m_rxInPa->stop();
+                                       m_rxInPa->streamClose();
+                                       delete m_rxInPa;
+                                       if(two_rx) {
+                                               m_rxOutPa->stop();
+                                               m_rxOutPa->streamClose();
+                                               delete m_rxOutPa;
+                                       }
+                                       m_txInPa->stop();
+                                       m_txInPa->streamClose();
+                                       delete m_txInPa;
+                                       delete m_txOutPa;
+                                       destroy_fifos();
+                                       destroy_src();
+                                       deleteEQFilters(g_rxUserdata);
+                                       delete g_rxUserdata;
+                                       m_RxRunning = false;
+                                       return;
+                               }
+                               m_txErr = m_txOutPa->streamStart();
+                               if(m_txErr != paNoError) {
+                                       wxMessageBox(wxT("Sound Card 2 Second Stream Start Error."), wxT("Error"), wxOK);
+                                       m_rxInPa->stop();
+                                       m_rxInPa->streamClose();
+                                       m_txInPa->stop();
+                                       m_txInPa->streamClose();
+                                       delete m_txInPa;
+                                       if(two_rx) {
+                                               m_rxOutPa->stop();
+                                               m_rxOutPa->streamClose();
+                                               delete m_rxOutPa;
+                                       }
+                                       delete m_txInPa;
+                                       delete m_txOutPa;
+                                       destroy_fifos();
+                                       destroy_src();
+                                       deleteEQFilters(g_rxUserdata);
+                                       delete g_rxUserdata;
+                                       m_RxRunning = false;
+                                       return;
+                               }
+                       }
+        }
+
+        // start tx/rx processing thread
+
+        m_txRxThread = new txRxThread;
+
+        if ( m_txRxThread->Create() != wxTHREAD_NO_ERROR )
+        {
+            wxLogError(wxT("Can't create thread!"));
+        }
+
+        m_txRxThread->SetPriority(WXTHREAD_MAX_PRIORITY);
+
+        if ( m_txRxThread->Run() != wxTHREAD_NO_ERROR )
+        {
+            wxLogError(wxT("Can't start thread!"));
+        }
+    }
+}
+
+
+void MainFrame::processTxtEvent(char event[]) {
+    int rule = 0;
+
+    printf("processTxtEvent:\n");
+    printf("  event: %s\n", event);
+
+    // process with regexp and issue system command
+
+    // Each regexp in our list is separated by a newline.  We want to try all of them.
+
+    wxString event_str(event);
+    int match_end, replace_end;
+    match_end = replace_end = 0;
+    wxString regexp_match_list = wxGetApp().m_events_regexp_match;
+    wxString regexp_replace_list = wxGetApp().m_events_regexp_replace;
+
+    bool found_match = false;
+
+    while (((match_end = regexp_match_list.Find('\n')) != wxNOT_FOUND) && (rule < MAX_EVENT_RULES)) {
+        //printf("match_end: %d\n", match_end);
+        if ((replace_end = regexp_replace_list.Find('\n')) != wxNOT_FOUND) {
+            //printf("replace_end = %d\n", replace_end);
+
+            // candidate match and replace regexps strings exist, so lets try them
+
+            wxString regexp_match = regexp_match_list.SubString(0, match_end-1);
+            wxString regexp_replace = regexp_replace_list.SubString(0, replace_end-1);
+            //printf("match: %s replace: %s\n", (const char *)regexp_match.c_str(), (const char *)regexp_replace.c_str());
+            wxRegEx re(regexp_match);
+            printf("  checking for match against: %s\n", (const char *)regexp_match.c_str());
+
+            // if we found a match, lets run the replace regexp and issue the system command
+
+            wxString event_str_rep = event_str;
+
+            if (re.Replace(&event_str_rep, regexp_replace) != 0) {
+                printf("  found match!\n");
+                found_match = true;
+
+                bool enableSystem = false;
+                if (wxGetApp().m_events)
+                    enableSystem = true;
+
+                // no syscall if spam timer still running
+
+                if (spamTimer[rule].IsRunning()) {
+                    enableSystem = false;
+                    printf("  spam timer running\n");
+                }
+
+                const char *event_out = event_str_rep.ToUTF8();
+                wxString event_out_with_return_code;
+
+                if (enableSystem) {
+                    int ret = wxExecute(event_str_rep);
+                    event_out_with_return_code.Printf(_T("%s -> returned %d"), event_out, ret);
+                    spamTimer[rule].Start((wxGetApp().m_events_spam_timer)*1000, wxTIMER_ONE_SHOT);
+                }
+                else
+                    event_out_with_return_code.Printf(_T("%s T: %d"), event_out, spamTimer[rule].IsRunning());
+
+                // update event log GUI if currently displayed
+                
+                if (optionsDlg != NULL) {                  
+                    optionsDlg->updateEventLog(wxString(event), event_out_with_return_code);                     
+                }
+            }
+        }
+        regexp_match_list = regexp_match_list.SubString(match_end+1, regexp_match_list.length());
+        regexp_replace_list = regexp_replace_list.SubString(replace_end+1, regexp_replace_list.length());
+
+        rule++;
+    }
+    if ((optionsDlg != NULL) && !found_match) {                  
+        optionsDlg->updateEventLog(wxString(event), _("<no match>"));                     
+    }
+}
+
+
+#define SBQ_MAX_ARGS 4
+
+void *MainFrame::designAnEQFilter(const char filterType[], float freqHz, float gaindB, float Q)
+{
+    char  *arg[SBQ_MAX_ARGS];
+    char   argstorage[SBQ_MAX_ARGS][80];
+    void  *sbq;
+    int    i, argc;
+
+    assert((strcmp(filterType, "bass") == 0)   ||
+           (strcmp(filterType, "treble") == 0) ||
+           (strcmp(filterType, "equalizer") == 0));
+
+    for(i=0; i<SBQ_MAX_ARGS; i++) {
+        arg[i] = &argstorage[i][0];
+        arg[i] = &argstorage[i][0];
+        arg[i] = &argstorage[i][0];
+    }
+
+    argc = 0;
+
+    if ((strcmp(filterType, "bass") == 0) || (strcmp(filterType, "treble") == 0)) {
+        sprintf(arg[argc++], "%s", filterType);
+        sprintf(arg[argc++], "%f", gaindB+1E-6);
+        sprintf(arg[argc++], "%f", freqHz);
+    }
+
+    if (strcmp(filterType, "equalizer") == 0) {
+        sprintf(arg[argc++], "%s", filterType);
+        sprintf(arg[argc++], "%f", freqHz);
+        sprintf(arg[argc++], "%f", Q);
+        sprintf(arg[argc++], "%f", gaindB+1E-6);
+    }
+
+    assert(argc <= SBQ_MAX_ARGS);
+
+    sbq = sox_biquad_create(argc-1, (const char **)arg);
+
+    return sbq;
+}
+
+void  MainFrame::designEQFilters(paCallBackData *cb)
+{
+    // init Mic In Equaliser Filters
+
+    if (m_newMicInFilter) {
+        //printf("designing new Min In filters\n");
+        cb->sbqMicInBass   = designAnEQFilter("bass", wxGetApp().m_MicInBassFreqHz, wxGetApp().m_MicInBassGaindB);
+        cb->sbqMicInTreble = designAnEQFilter("treble", wxGetApp().m_MicInTrebleFreqHz, wxGetApp().m_MicInTrebleGaindB);
+        cb->sbqMicInMid    = designAnEQFilter("equalizer", wxGetApp().m_MicInMidFreqHz, wxGetApp().m_MicInMidGaindB, wxGetApp().m_MicInMidQ);
+    }
+
+    // init Spk Out Equaliser Filters
+
+    if (m_newSpkOutFilter) {
+        //printf("designing new Spk Out filters\n");
+        //printf("designEQFilters: wxGetApp().m_SpkOutBassFreqHz: %f\n",wxGetApp().m_SpkOutBassFreqHz);
+        cb->sbqSpkOutBass   = designAnEQFilter("bass", wxGetApp().m_SpkOutBassFreqHz, wxGetApp().m_SpkOutBassGaindB);
+        cb->sbqSpkOutTreble = designAnEQFilter("treble", wxGetApp().m_SpkOutTrebleFreqHz, wxGetApp().m_SpkOutTrebleGaindB);
+        cb->sbqSpkOutMid    = designAnEQFilter("equalizer", wxGetApp().m_SpkOutMidFreqHz, wxGetApp().m_SpkOutMidGaindB, wxGetApp().m_SpkOutMidQ);
+    }
+}
+
+void  MainFrame::deleteEQFilters(paCallBackData *cb)
+{
+    if (m_newMicInFilter) {
+        sox_biquad_destroy(cb->sbqMicInBass);
+        sox_biquad_destroy(cb->sbqMicInTreble);
+        sox_biquad_destroy(cb->sbqMicInMid);
+    }
+    if (m_newSpkOutFilter) {
+        sox_biquad_destroy(cb->sbqSpkOutBass);
+        sox_biquad_destroy(cb->sbqSpkOutTreble);
+        sox_biquad_destroy(cb->sbqSpkOutMid);
+    }
+}
+
+// returns number of output samples generated by resampling
+int resample(SRC_STATE *src,
+            short      output_short[],
+            short      input_short[],
+            int        output_sample_rate,
+            int        input_sample_rate,
+            int        length_output_short, // maximum output array length in samples
+            int        length_input_short
+            )
+{
+    SRC_DATA src_data;
+    float    input[N48*2];
+    float    output[N48*2];
+
+    assert(src != NULL);
+    assert(length_input_short <= N48*2);
+    assert(length_output_short <= N48*2);
+
+    src_short_to_float_array(input_short, input, length_input_short);
+
+    src_data.data_in = input;
+    src_data.data_out = output;
+    src_data.input_frames = length_input_short;
+    src_data.output_frames = length_output_short;
+    src_data.end_of_input = 0;
+    src_data.src_ratio = (float)output_sample_rate/input_sample_rate;
+
+    src_process(src, &src_data);
+
+    assert(src_data.output_frames_gen <= length_output_short);
+    src_float_to_short_array(output, output_short, src_data.output_frames_gen);
+
+    return src_data.output_frames_gen;
+}
+
+
+// Decimates samples using an algorithm that produces nice plots of
+// speech signals at a low sample rate.  We want a low sample rate so
+// we don't hammer the graphics system too hard.  Saves decimated data
+// to a fifo for plotting on screen.
+void resample_for_plot(struct FIFO *plotFifo, short buf[], int length)
+{
+    int decimation = FS/WAVEFORM_PLOT_FS;
+    int nSamples, sample;
+    int i, st, en, max, min;
+    short dec_samples[2*N8];
+
+    assert(length <= 2*N8);
+
+    nSamples = length/decimation;
+
+    for(sample = 0; sample < nSamples; sample += 2)
+    {
+        st = decimation*sample;
+        en = decimation*(sample+2);
+        max = min = 0;
+        for(i=st; i<en; i++ )
+        {
+            if (max < buf[i]) max = buf[i];
+            if (min > buf[i]) min = buf[i];
+        }
+        dec_samples[sample] = max;
+        dec_samples[sample+1] = min;
+    }
+    fifo_write(plotFifo, dec_samples, nSamples);
+}
+
+void txRxProcessing()
+{
+    paCallBackData  *cbData = g_rxUserdata;
+
+    // Buffers re-used by tx and rx processing
+    // signals in in48k/out48k are at a maximum sample rate of 48k, could be 44.1kHz
+    // depending on sound hardware.
+
+    short           in8k_short[2*N8];
+    short           in48k_short[2*N48];
+    short           out8k_short[2*N8];
+    short           out48k_short[2*N48];
+    int             nout;
+
+    //wxLogDebug("start infifo1: %5d outfifo1: %5d\n", fifo_n(cbData->infifo1), fifo_n(cbData->outfifo1));
+
+    //
+    //  RX side processing --------------------------------------------
+    //
+
+    // while we have enough input samples available ...
+
+    int nsam = g_soundCard1SampleRate * (float)N8/FS;
+    assert(nsam <= N48);
+    g_mutexProtectingCallbackData.Lock();
+    while (fifo_read(cbData->infifo1, in48k_short, nsam) == 0)
+    {
+        g_mutexProtectingCallbackData.Unlock();
+        unsigned int n8k;
+
+        n8k = resample(cbData->insrc1, in8k_short, in48k_short, FS, g_soundCard1SampleRate, N8, nsam);
+
+        // optionally save "from radio" signal (write demod input to file)
+        // Really useful for testing and development as it allows us
+        // to repeat tests using off air signals
+
+        g_mutexProtectingCallbackData.Lock();
+        if (g_recFileFromRadio && (g_sfRecFile != NULL)) {
+            //printf("g_recFromRadioSamples: %d  n8k: %d \n", g_recFromRadioSamples);
+            if (g_recFromRadioSamples < n8k) {
+                sf_write_short(g_sfRecFile, in8k_short, g_recFromRadioSamples);
+                wxCommandEvent event( wxEVT_COMMAND_MENU_SELECTED, g_recFileFromRadioEventId );
+                // call stop/start record menu item, should be thread safe
+                g_parent->GetEventHandler()->AddPendingEvent( event );
+                g_recFromRadioSamples = 0;
+                //printf("finished recording g_recFromRadioSamples: %d n8k: %d!\n", g_recFileFromRadio, n8k);
+            }
+            else {
+                sf_write_short(g_sfRecFile, in8k_short, n8k);
+                g_recFromRadioSamples -= n8k;
+            }
+        }
+        g_mutexProtectingCallbackData.Unlock();
+
+        // optionally read "from radio" signal from file (read demod input from file)
+
+        g_mutexProtectingCallbackData.Lock();
+        if (g_playFileFromRadio && (g_sfPlayFileFromRadio != NULL)) {
+            int n = sf_read_short(g_sfPlayFileFromRadio, in8k_short, n8k);
+            if (n != N8) {
+                if (g_loopPlayFileFromRadio)
+                    sf_seek(g_sfPlayFileFromRadio, 0, SEEK_SET);
+                else {
+                    printf("playFileFromRadio finished, issuing event!\n");
+                    wxCommandEvent event( wxEVT_COMMAND_MENU_SELECTED, g_playFileFromRadioEventId );
+                    // call stop/start play menu item, should be thread safe
+                    g_parent->GetEventHandler()->AddPendingEvent( event );
+                }
+            }
+        }
+        g_mutexProtectingCallbackData.Unlock();
+
+        fifo_write(cbData->rxinfifo, in8k_short, n8k);
+        resample_for_plot(g_plotDemodInFifo, in8k_short, n8k);
+
+        per_frame_rx_processing(cbData->rxoutfifo, g_CodecBits, cbData->rxinfifo, &g_nRxIn, &g_State, g_pCodec2);
+
+        // Get some audio to send to headphones/speaker.  If out of
+        // sync or in analog mode we pass thru the "from radio" audio
+        // to the headphones/speaker.  When out of sync it's useful to
+        // hear the audio from the channel, e.g. as a tuning aid
+
+        if ((g_State == 0) || g_analog) {
+            memcpy(out8k_short, in8k_short, sizeof(short)*n8k);
+        }
+        else {
+            // we are in sync so use decoded audio
+            memset(out8k_short, 0, sizeof(short)*N8);
+            fifo_read(cbData->rxoutfifo, out8k_short, N8);
+        }
+
+        // Opional Spk Out EQ Filtering, need mutex as filter can change at run time
+        g_mutexProtectingCallbackData.Lock();
+        if (cbData->spkOutEQEnable) {
+            sox_biquad_filter(cbData->sbqSpkOutBass,   out8k_short, out8k_short, N8);
+            sox_biquad_filter(cbData->sbqSpkOutTreble, out8k_short, out8k_short, N8);
+            sox_biquad_filter(cbData->sbqSpkOutMid,    out8k_short, out8k_short, N8);
+        }
+        g_mutexProtectingCallbackData.Unlock();
+
+        // note squelch automatically disabled in analog mode
+
+        if (g_SquelchActive && (g_SquelchLevel > g_snr) && !g_analog) {
+            //printf("g_SquelchLevel: %f g_snr: %f\n", g_SquelchLevel, g_snr);
+            memset(out8k_short, 0, sizeof(short)*N8);
+        }
+
+        resample_for_plot(g_plotSpeechOutFifo, out8k_short, N8);
+
+        g_mutexProtectingCallbackData.Lock();
+        if (g_nSoundCards == 1) {
+            nout = resample(cbData->outsrc2, out48k_short, out8k_short, g_soundCard1SampleRate, FS, N48, N8);
+            fifo_write(cbData->outfifo1, out48k_short, nout);
+        }
+        else {
+            nout = resample(cbData->outsrc2, out48k_short, out8k_short, g_soundCard2SampleRate, FS, N48, N8);
+            fifo_write(cbData->outfifo2, out48k_short, nout);
+        }
+    }
+    g_mutexProtectingCallbackData.Unlock();
+
+    //
+    //  TX side processing --------------------------------------------
+    //
+
+    if ((g_nSoundCards == 2) && ((g_half_duplex && g_tx) || !g_half_duplex)) {
+
+        // Make sure we have at least 6 frames of modulator output
+        // samples.  This also locks the modulator to the sample rate
+        // of sound card 1.  We want to make sure that modulator
+        // samples are uninterrupted by differences in sample rate
+        // between this sound card and sound card 2.
+
+        g_mutexProtectingCallbackData.Lock();
+        while((unsigned)fifo_used(cbData->outfifo1) < 6*N48)
+        {
+            g_mutexProtectingCallbackData.Unlock();
+
+            int   nsam = g_soundCard2SampleRate * (float)codec2_samples_per_frame(g_pCodec2)/FS;
+            assert(nsam <= 2*N48);
+
+            // infifo2 is written to by another sound card so it may
+            // over or underflow, but we don't realy care.  It will
+            // just result in a short interruption in audio being fed
+            // to codec2_enc, possibly making a click every now and
+            // again in the decoded audio at the other end.
+
+            // zero speech input just in case infifo2 underflows
+            memset(in48k_short, 0, nsam*sizeof(short));
+            fifo_read(cbData->infifo2, in48k_short, nsam);
+
+            nout = resample(cbData->insrc2, in8k_short, in48k_short, FS, g_soundCard2SampleRate, 2*N8, nsam);
+
+            // optionally use file for mic input signal
+
+            g_mutexProtectingCallbackData.Lock();
+            if (g_playFileToMicIn && (g_sfPlayFile != NULL)) {
+                int n = sf_read_short(g_sfPlayFile, in8k_short, nout);
+                if (n != nout) {
+                    if (g_loopPlayFileToMicIn)
+                        sf_seek(g_sfPlayFile, 0, SEEK_SET);
+                    else {
+                        wxCommandEvent event( wxEVT_COMMAND_MENU_SELECTED, g_playFileToMicInEventId );
+                        // call stop/start play menu item, should be thread safe
+                        g_parent->GetEventHandler()->AddPendingEvent( event );
+                    }
+                }
+            }
+            g_mutexProtectingCallbackData.Unlock();
+
+            // Optional Mic In EQ Filtering, need mutex as filter can change at run time
+            g_mutexProtectingCallbackData.Lock();
+            if (cbData->micInEQEnable) {
+                sox_biquad_filter(cbData->sbqMicInBass, in8k_short, in8k_short, nout);
+                sox_biquad_filter(cbData->sbqMicInTreble, in8k_short, in8k_short, nout);
+                sox_biquad_filter(cbData->sbqMicInMid, in8k_short, in8k_short, nout);
+            }
+            g_mutexProtectingCallbackData.Unlock();
+
+            resample_for_plot(g_plotSpeechInFifo, in8k_short, nout);
+
+            if (g_analog) {
+
+                // Boost the "from mic" -> "to radio" audio in analog
+                // mode.  The need for the gain was found by
+                // experiment - analog SSB sounded too quiet compared
+                // to digital. With digital voice we generally drive
+                // the "to radio" (SSB radio mic input) at about 25%
+                // of the peak level for normal SSB voice. So we
+                // introduce 6dB gain to make analog SSB sound the
+                // same level as the digital.  Watch out for clipping.
+                for(int i=0; i<2*N8; i++) {
+                    float out = (float)in8k_short[i]*2.0;
+                    if (out > 32767) out = 32767.0;
+                    if (out < -32767) out = -32767.0;
+                    out8k_short[i] = out;
+                }
+            }
+            else
+                per_frame_tx_processing(out8k_short, in8k_short, g_pCodec2);
+
+            // output 40ms of modem tone
+            nout = resample(cbData->outsrc1, out48k_short, out8k_short, g_soundCard1SampleRate, FS, 2*N48, 2*N8);
+            g_mutexProtectingCallbackData.Lock();
+            fifo_write(cbData->outfifo1, out48k_short, nout);
+        }
+        g_mutexProtectingCallbackData.Unlock();
+    }
+    //wxLogDebug("  end infifo1: %5d outfifo1: %5d\n", fifo_n(cbData->infifo1), fifo_n(cbData->outfifo1));
+}
+
+//-------------------------------------------------------------------------
+// rxCallback()
+//-------------------------------------------------------------------------
+int MainFrame::rxCallback(
+                            const void      *inputBuffer,
+                            void            *outputBuffer,
+                            unsigned long   framesPerBuffer,
+                            const PaStreamCallbackTimeInfo* timeInfo,
+                            PaStreamCallbackFlags statusFlags,
+                            void            *userData
+                         )
+{
+    paCallBackData  *cbData = (paCallBackData*)userData;
+    short           *rptr    = (short*)inputBuffer;
+    short           *wptr    = (short*)outputBuffer;
+
+    short           indata[MAX_FPB];
+    short           outdata[MAX_FPB];
+
+    unsigned int    i;
+
+    (void) timeInfo;
+    (void) statusFlags;
+
+    wxMutexLocker lock(g_mutexProtectingCallbackData);
+
+    //if (statusFlags)
+    //    printf("cb1 statusFlags: 0x%x\n", (int)statusFlags);
+
+    //
+    //  RX side processing --------------------------------------------
+    //
+
+    // assemble a mono buffer and write to FIFO
+
+    assert(framesPerBuffer < MAX_FPB);
+
+       if(rptr) {
+               for(i = 0; i < framesPerBuffer; i++, rptr += cbData->inputChannels1)
+                    indata[i] = rptr[0];                       
+               if (fifo_write(cbData->infifo1, indata, framesPerBuffer)) {
+                       //wxLogDebug("infifo1 full\n");
+               }
+       }
+
+    // OK now set up output samples for this callback
+
+       if(wptr) {
+               if (fifo_read(cbData->outfifo1, outdata, framesPerBuffer) == 0)
+               {
+                       // write signal to both channels */
+                       for(i = 0; i < framesPerBuffer; i++, wptr += 2)
+                       {
+                            if (cbData->leftChannelVoxTone) {
+                                cbData->voxTonePhase += 2.0*M_PI*VOX_TONE_FREQ/g_soundCard1SampleRate;
+                                cbData->voxTonePhase -= 2.0*M_PI*floor(cbData->voxTonePhase/(2.0*M_PI));
+                                wptr[0] = VOX_TONE_AMP*cos(cbData->voxTonePhase);                              
+                                //printf("%f %d\n", cbData->voxTonePhase, wptr[0]);
+                            }
+                            else
+                               wptr[0] = outdata[i];
+                               
+                            wptr[1] = outdata[i];
+                       }
+               }
+               else
+               {
+                       //wxLogDebug("outfifo1 empty\n");
+                       // zero output if no data available
+                       for(i = 0; i < framesPerBuffer; i++, wptr += 2)
+                       {
+                               wptr[0] = 0;
+                               wptr[1] = 0;
+                       }
+               }
+       }
+
+    return paContinue;
+}
+
+//----------------------------------------------------------------
+// per_frame_rx_processing()
+//----------------------------------------------------------------
+void per_frame_rx_processing(
+                                            FIFO    *output_fifo,   // decoded speech samples
+                                            int      codec_bits[],  // current frame of bits for decoder
+                                            FIFO    *input_fifo,    // modem samples input to demod
+                                            int     *nin,           // amount of samples demod needs for next call
+                                            int     *state,         // used to collect codec_bits[] halves
+                                            CODEC2  *c2             // Codec 2 states
+                                        )
+{
+    int                 reliable_sync_bit;
+    short               input_buf[FDMDV_MAX_SAMPLES_PER_FRAME];
+    short               output_buf[N8*2];
+    COMP                rx_fdm[FDMDV_MAX_SAMPLES_PER_FRAME];
+    COMP                rx_fdm_offset[FDMDV_MAX_SAMPLES_PER_FRAME];
+    int                 rx_bits[MAX_BITS_PER_FDMDV_FRAME];
+    unsigned char       packed_bits[MAX_BYTES_PER_CODEC_FRAME];
+    float               rx_spec[FDMDV_NSPEC];
+    int                 i;
+    int                 nin_prev;
+    int                 bit;
+    int                 byte;
+    int                 next_state;
+    int                 bits_per_fdmdv_frame, bits_per_codec_frame, bytes_per_codec_frame;
+
+    bits_per_fdmdv_frame = fdmdv_bits_per_frame(g_pFDMDV);
+    //printf(" bits_per_fdmdv_frame: %d\n", bits_per_fdmdv_frame);
+    assert(bits_per_fdmdv_frame <= MAX_BITS_PER_FDMDV_FRAME);
+    bits_per_codec_frame = codec2_bits_per_frame(c2);
+    assert(bits_per_codec_frame <= MAX_BITS_PER_CODEC_FRAME);
+    bytes_per_codec_frame = (bits_per_codec_frame+7)/8;
+    assert(bytes_per_codec_frame <= MAX_BYTES_PER_CODEC_FRAME);
+
+    //
+    //  This while loop will run the demod 0, 1 (nominal) or 2 times:
+    //
+    //  0: when tx sample clock runs faster than rx, occasionally we
+    //     will run out of samples
+    //
+    //  1: normal, run decoder once, every 2nd frame output a frame of
+    //     speech samples to D/A
+    //
+    //  2: when tx sample clock runs slower than rx, occasionally we will
+    //     have enough samples to run demod twice.
+    //
+    //  With a +/- 10 Hz sample clock difference at FS=8000Hz (+/- 1250
+    //  ppm), case 0 or 2 occured about once every 30 seconds.  This is
+    //  no problem for the decoded audio.
+    //
+
+    //printf("state: %d sync: %d nin %d \n", *state, sync_bit, *nin);
+    while (fifo_read(input_fifo, input_buf, *nin) == 0)
+    {
+        nin_prev = *nin;
+
+        // demod per frame processing
+        for(i = 0; i < *nin; i++)
+        {
+            rx_fdm[i].real = (float)input_buf[i] / FDMDV_SCALE;
+            rx_fdm[i].imag = 0.0;
+        }
+        fdmdv_freq_shift(rx_fdm_offset, rx_fdm, g_RxFreqOffsetHz,  &g_RxFreqOffsetPhaseRect, *nin);
+        fdmdv_demod(g_pFDMDV, rx_bits, &reliable_sync_bit, rx_fdm_offset, nin);
+
+        // compute rx spectrum & get demod stats, and update GUI plot data
+        fdmdv_get_rx_spectrum(g_pFDMDV, rx_spec, rx_fdm, nin_prev);
+        fdmdv_get_demod_stats(g_pFDMDV, &g_stats);
+
+        // Average rx spectrum data using a simple IIR low pass filter
+        for(i = 0; i < FDMDV_NSPEC; i++)
+        {
+            g_avmag[i] = BETA * g_avmag[i] + (1.0 - BETA) * rx_spec[i];
+        }
+
+        //
+        //   State machine to:
+        //
+        //   + Mute decoded audio when out of sync.  The demod is synced
+        //     when we are using the fine freq estimate and SNR is above
+        //     a thresh.
+        //
+        //   + Decode codec bits only if we have a 0,1 sync bit
+        //     sequence.  Collects two frames of demod bits to decode
+        //     one frame of codec bits.
+        //
+        next_state = *state;
+        switch(*state)
+        {
+            case 0:
+                // mute output audio when out of sync
+
+                for(i = 0; i < N8; i++)
+                    output_buf[i] = 0;
+                fifo_write(output_fifo, output_buf, N8);
+
+                if(g_stats.sync == 1)
+                {
+                    next_state = 1;
+                }
+                //printf("sync state: %d\n", *state);
+                break;
+
+            case 1:
+                next_state = 2;
+                if(g_stats.sync == 0)
+                {
+                    next_state = 0;
+                }
+                if (reliable_sync_bit)
+                {
+                    next_state = 1;
+                }
+
+                // first half of frame of codec bits
+                memcpy(codec_bits, rx_bits, bits_per_fdmdv_frame * sizeof(int));
+
+                break;
+
+            case 2:
+                next_state = 1;
+                if(g_stats.sync == 0)
+                {
+                    next_state = 0;
+                }
+
+                int  data_flag_index, valid;
+
+                // second half of frame of codec bits
+                memcpy(&codec_bits[bits_per_fdmdv_frame], rx_bits, bits_per_fdmdv_frame *sizeof(int));
+
+                if (g_testFrames) {
+                    int bit_errors, ntest_bits, test_frame_sync;
+
+                    // test frame processing, g_test_frame_sync will be asserted when we detect a
+                    // valid test frame.
+
+                    fdmdv_put_test_bits(g_pFDMDV, &test_frame_sync, g_error_pattern, &bit_errors, &ntest_bits, codec_bits);
+
+                    if (test_frame_sync == 1) {
+                        g_test_frame_sync_state = 1;
+                        g_test_frame_count = 0;
+                    }
+
+                    if (g_test_frame_sync_state) {
+                        if (g_test_frame_count == 0) {
+                            //printf("bit_errors: %d ntest_bits: %d\n", bit_errors, ntest_bits);
+                            g_total_bit_errors += bit_errors;
+                            g_total_bits       += ntest_bits;
+                            fifo_write(g_errorFifo, g_error_pattern, g_sz_error_pattern);
+                        }
+                        g_test_frame_count++;
+                        if (g_test_frame_count == 4)
+                            g_test_frame_count = 0;
+                    }
+
+                    fdmdv_put_test_bits(g_pFDMDV, &test_frame_sync, g_error_pattern, &bit_errors, &ntest_bits, &codec_bits[bits_per_fdmdv_frame]);
+
+                    if (test_frame_sync == 1) {
+                        g_test_frame_sync_state = 1;
+                        g_test_frame_count = 0;
+                    }
+
+                    if (g_test_frame_sync_state) {
+                        if (g_test_frame_count == 0) {
+                            //printf("bit_errors: %d ntest_bits: %d\n", bit_errors, ntest_bits);
+                            g_total_bit_errors += bit_errors;
+                            g_total_bits       += ntest_bits;
+                            fifo_write(g_errorFifo, g_error_pattern, g_sz_error_pattern);
+                        }
+                        g_test_frame_count++;
+                        if (g_test_frame_count == 4)
+                            g_test_frame_count = 0;
+                    }
+
+                    // silent audio
+
+                    for(i=0; i<2*N8; i++)
+                        output_buf[i] = 0;
+
+                }
+                else {
+                    // regular Codec 2 frame decode
+
+                    // FEC Decoding  --------------------------------------------------------------
+
+                    if (g_mode == MODE_2000) {
+                        int recd_codeword, codeword1, codeword2;
+
+                        /* decode first codeword */
+
+                        recd_codeword = 0;
+                        for(i=0; i<12; i++) {
+                            recd_codeword <<= 1;
+                            recd_codeword |= codec_bits[i];
+                        }
+                        for(i=bits_per_codec_frame; i<bits_per_codec_frame+11; i++) {
+                            recd_codeword <<= 1;
+                            recd_codeword |= codec_bits[i];
+                        }
+                        codeword1 = golay23_decode(recd_codeword);
+                        g_total_bit_errors += golay23_count_errors(recd_codeword, codeword1);
+                        g_total_bits       += 23;
+
+                        //if (codeword1 != recd_codeword)
+                        //    printf("codeword1: 0x%x  recd_codeword: 0x%x\n", codeword1,recd_codeword );
+                        //fprintf(stderr, "received codeword1: 0x%x  decoded codeword1: 0x%x\n", recd_codeword, codeword1);
+
+                        for(i=0; i<12; i++) {
+                            codec_bits[i] = codeword1 >> (22-i);
+                        }
+
+                        /* decode second codeword */
+
+                        recd_codeword = 0;
+                        for(i=12; i<24; i++) {
+                            recd_codeword <<= 1;
+                            recd_codeword |= codec_bits[i];
+                        }
+                        for(i=bits_per_codec_frame+11; i<bits_per_codec_frame+11+11; i++) {
+                            recd_codeword <<= 1;
+                            recd_codeword |= codec_bits[i];
+                        }
+                        codeword2 = golay23_decode(recd_codeword);
+                        g_total_bit_errors += golay23_count_errors(recd_codeword, codeword2);
+                        g_total_bits       += 23;
+
+                        // if (codeword2 != recd_codeword)
+                        //    printf("codeword2: 0x%x  recd_codeword: 0x%x\n", codeword2,recd_codeword );
+                        //fprintf(stderr, "received codeword2: 0x%x  decoded codeword2: 0x%x\n", recd_codeword, codeword2);
+
+                        for(i=0; i<12; i++) {
+                            codec_bits[12+i] = codeword2 >> (22-i);
+                        }
+                    }
+
+                    if ((g_mode == MODE_1600) || (g_mode == MODE_1600_WIDE)) {
+                        int recd_codeword, codeword1, j;
+
+                        recd_codeword = 0;
+                        for(i=0; i<8; i++) {
+                            recd_codeword <<= 1;
+                            recd_codeword |= codec_bits[i];
+                        }
+                        for(i=11; i<15; i++) {
+                            recd_codeword <<= 1;
+                            recd_codeword |= codec_bits[i];
+                        }
+                        for(i=bits_per_codec_frame; i<bits_per_codec_frame+11; i++) {
+                            recd_codeword <<= 1;
+                            recd_codeword |= codec_bits[i];
+                        }
+                        codeword1 = golay23_decode(recd_codeword);
+                        g_total_bit_errors += golay23_count_errors(recd_codeword, codeword1);
+                        g_total_bits       += 23;
+
+                        //if (codeword1 != recd_codeword)
+                        //    printf("codeword1: 0x%x  recd_codeword: 0x%x\n", codeword1,recd_codeword );
+                        //codeword1 = recd_codeword;
+                        //fprintf(stderr, "received codeword1: 0x%x  decoded codeword1: 0x%x\n", recd_codeword, codeword1);
+
+                        for(i=0; i<8; i++) {
+                            codec_bits[i] = (codeword1 >> (22-i)) & 0x1;
+                        }
+                        for(i=8,j=11; i<12; i++,j++) {
+                            codec_bits[j] = (codeword1 >> (22-i)) & 0x1;
+                        }
+                    }
+
+                    // extract data bit ------------------------------------------------------------
+
+                    data_flag_index = codec2_get_spare_bit_index(c2);
+                    //printf("data_flag_index: %d\n", data_flag_index);
+                    assert(data_flag_index != -1); // not supported for all rates
+
+                    short abit[2];
+                    abit[0] = codec_bits[data_flag_index];
+                    abit[1] = codec_bits[bits_per_codec_frame+11]; // use spare bit, note not FEC protected
+                    char  ascii_out;
+
+                    //printf("rx bits %d %d %d\n", abit[0], abit[1], bits_per_codec_frame+11);
+                    int n_ascii = varicode_decode(&g_varicode_dec_states, &ascii_out, abit, 1, wxGetApp().m_textEncoding);
+                    assert((n_ascii == 0) || (n_ascii == 1));
+                    if (n_ascii) {
+                        short ashort = ascii_out;
+                        fifo_write(g_rxDataOutFifo, &ashort, 1);
+                    }
+
+                    // reconstruct missing bit we steal for data bit and decode speech
+
+                    valid = codec2_rebuild_spare_bit(c2, codec_bits);
+                    assert(valid != -1);
+
+                    // pack bits, MSB received first
+
+                    bit  = 7;
+                    byte = 0;
+                    memset(packed_bits, 0,  bytes_per_codec_frame);
+                    for(i = 0; i < bits_per_codec_frame; i++)
+                        {
+                            packed_bits[byte] |= (codec_bits[i] << bit);
+                            bit--;
+                            if(bit < 0)
+                                {
+                                    bit = 7;
+                                    byte++;
+                                }
+                        }
+
+                    // add decoded speech to end of output buffer
+
+                    assert(codec2_samples_per_frame(c2) == (2*N8));
+                    codec2_decode(c2, output_buf, packed_bits);
+                }
+
+                fifo_write(output_fifo, output_buf, codec2_samples_per_frame(c2));
+
+                break;
+        }
+        //printf("state: %d next_state: %d reliable_sync_bit: %d\n", *state, next_state, reliable_sync_bit);
+        *state = next_state;
+    }
+}
+
+void per_frame_tx_processing(
+                                            short   tx_fdm_scaled[],// ouput modulated samples
+                                            short   input_buf[],    // speech sample input
+                                            CODEC2  *c2             // Codec 2 states
+                                        )
+{
+    unsigned char  packed_bits[MAX_BYTES_PER_CODEC_FRAME];
+    int            bits[2*MAX_BITS_PER_FDMDV_FRAME];
+    COMP           tx_fdm[2*FDMDV_NOM_SAMPLES_PER_FRAME];
+    COMP           tx_fdm_offset[2*FDMDV_NOM_SAMPLES_PER_FRAME];
+    int            sync_bit;
+    int            i, j, bit, byte, data_flag_index;
+    short          abit[2];
+    int            bits_per_fdmdv_frame, bits_per_codec_frame, bytes_per_codec_frame;
+
+    bits_per_fdmdv_frame = fdmdv_bits_per_frame(g_pFDMDV);
+    assert(bits_per_fdmdv_frame <= MAX_BITS_PER_FDMDV_FRAME);
+    bits_per_codec_frame = codec2_bits_per_frame(c2);
+    assert(bits_per_codec_frame <= MAX_BITS_PER_CODEC_FRAME);
+    bytes_per_codec_frame = (bits_per_codec_frame+7)/8;
+    assert(bytes_per_codec_frame <= MAX_BYTES_PER_CODEC_FRAME);
+
+    codec2_encode(c2, packed_bits, input_buf);
+
+    /* unpack bits, MSB first */
+
+    bit = 7; byte = 0;
+    for(i=0; i<bits_per_codec_frame; i++) {
+        bits[i] = (packed_bits[byte] >> bit) & 0x1;
+        bit--;
+        if (bit < 0) {
+            bit = 7;
+            byte++;
+        }
+    }
+
+    /* add data bit  ----------------------------------*/
+
+    // spare bit in frame that codec defines.  Use this 1
+    // bit/frame to send call sign data
+
+    data_flag_index = codec2_get_spare_bit_index(c2);
+    assert(data_flag_index != -1); // not supported for all rates
+
+    abit[0] = abit[1] = 0;
+    if (fifo_read(g_txDataInFifo, abit, wxGetApp().m_textEncoding) == 0) {
+        bits[data_flag_index] = abit[0];
+        bits[bits_per_codec_frame+11] = abit[1];  // spare bit that was unused in 1600 mode
+                                                  // note fast varicode must be sent two bits at a time 
+    }
+    else {
+        bits[data_flag_index] = 0;
+        bits[bits_per_codec_frame+11] = 0; 
+        printf("tx fifo empty - sending a 00!\n");
+    }
+
+    /* add FEC  ---------------------------------------*/
+
+    if (g_mode == MODE_2000) {
+        int data, codeword1, codeword2;
+
+        /* Protect first 24 bits with (23,12) Golay Code.  The first
+           24 bits are the most sensitive, as they contain the
+           pitch/energy VQ and voicing bits. This uses 56 + 11 + 11 =
+           78 bits, so we have two spare in 80 bit frame sent to
+           modem. */
+
+        /* first codeword */
+
+        data = 0;
+        for(i=0; i<12; i++) {
+            data <<= 1;
+            data |= bits[i];
+        }
+        codeword1 = golay23_encode(data);
+        //fprintf(stderr, "data1: 0x%x codeword1: 0x%x\n", data, codeword1);
+
+        /* second codeword */
+
+        data = 0;
+        for(i=12; i<24; i++) {
+            data <<= 1;
+            data |= bits[i];
+        }
+        codeword2 = golay23_encode(data);
+        //fprintf(stderr, "data: 0x%x codeword2: 0x%x\n", data, codeword2);
+
+        /* now pack output frame with parity bits at end to make them
+           as far apart as possible from the data the protect.  Parity
+           bits are LSB of the Golay codeword */
+
+        for(i=bits_per_codec_frame,j=0; i<bits_per_codec_frame+11; i++,j++) {
+            bits[i] = (codeword1 >> (10-j)) & 0x1;
+        }
+        for(j=0; i<bits_per_codec_frame+11+11; i++,j++) {
+            bits[i] = (codeword2 >> (10-j)) & 0x1;
+        }
+        assert(i <= 2*bits_per_fdmdv_frame);
+    }
+
+    if ((g_mode == MODE_1600) || (g_mode == MODE_1600_WIDE)) {
+        int data, codeword1;
+
+        /* Protect first 12 out of first 16 excitation bits with (23,12) Golay Code:
+
+           0,1,2,3: v[0]..v[3]
+           4,5,6,7: MSB of pitch
+           11,12,13,14: MSB of energy
+
+        */
+
+        data = 0;
+        for(i=0; i<8; i++) {
+            data <<= 1;
+            data |= bits[i];
+        }
+        for(i=11; i<15; i++) {
+            data <<= 1;
+            data |= bits[i];
+        }
+        data =
+        codeword1 = golay23_encode(data);
+
+        /* now pack output frame with parity bits at end to make them
+           as far apart as possible from the data they protect.  Parity
+           bits are LSB of the Golay codeword */
+
+        for(j=0,i=bits_per_codec_frame; i<bits_per_codec_frame+11; i++,j++) {
+            bits[i] = (codeword1 >> (10-j)) & 0x1;
+        }
+    }
+
+
+    /* if in test frame mode replace codec payload data with test frames */
+
+    if (g_testFrames) {
+       fdmdv_get_test_bits(g_pFDMDV, bits);
+       fdmdv_get_test_bits(g_pFDMDV, &bits[bits_per_fdmdv_frame]);
+    }
+
+    /* modulate even and odd frames */
+
+    fdmdv_mod(g_pFDMDV, tx_fdm, bits, &sync_bit);
+    assert(sync_bit == 1);
+
+    fdmdv_mod(g_pFDMDV, &tx_fdm[FDMDV_NOM_SAMPLES_PER_FRAME], &bits[bits_per_fdmdv_frame], &sync_bit);
+    assert(sync_bit == 0);
+
+    fdmdv_freq_shift(tx_fdm_offset, tx_fdm, g_TxFreqOffsetHz, &g_TxFreqOffsetPhaseRect, 2*FDMDV_NOM_SAMPLES_PER_FRAME);
+
+    /* compute scale factor to normalise tx power for all modes */
+
+    /* scale and convert to shorts */
+
+    for(i=0; i<2*FDMDV_NOM_SAMPLES_PER_FRAME; i++) {
+        float s =  tx_fdm_offset[i].real;
+        if (s > g_clip)
+            s = (float)g_clip;
+        if (s < -g_clip)
+            s = (float)-g_clip;
+        tx_fdm_scaled[i] = FDMDV_SCALE * g_pwr_scale * s;
+    }
+
+}
+
+//-------------------------------------------------------------------------
+// txCallback()
+//-------------------------------------------------------------------------
+int MainFrame::txCallback(
+                            const void *inputBuffer,
+                            void *outputBuffer,
+                            unsigned long framesPerBuffer,
+                            const PaStreamCallbackTimeInfo *outTime,
+                            PaStreamCallbackFlags statusFlags,
+                            void *userData
+                        )
+{
+    paCallBackData  *cbData = (paCallBackData*)userData;
+    unsigned int    i;
+    short           *rptr    = (short*)inputBuffer;
+    short           *wptr    = (short*)outputBuffer;
+    short           indata[MAX_FPB];
+    short           outdata[MAX_FPB];
+
+    wxMutexLocker lock(g_mutexProtectingCallbackData);
+
+    //    if (statusFlags)
+    //  printf("cb2 statusFlags: 0x%x\n", (int)statusFlags);
+
+    // assemble a mono buffer and write to FIFO
+
+    assert(framesPerBuffer < MAX_FPB);
+
+       if(rptr) {
+               for(i = 0; i < framesPerBuffer; i++, rptr += cbData->inputChannels2)
+                    indata[i] = rptr[0];                        
+       }
+
+    //#define SC2_LOOPBACK
+#ifdef SC2_LOOPBACK
+       //TODO: This doesn't work unless using the same soundcard!
+
+       if(wptr) {
+               for(i = 0; i < framesPerBuffer; i++, wptr += 2)
+               {
+                       wptr[0] = indata[i];
+                       wptr[1] = indata[i];
+               }
+       }
+
+#else
+       if(rptr)
+               fifo_write(cbData->infifo2, indata, framesPerBuffer);
+
+    // OK now set up output samples for this callback
+
+       if(wptr) {
+               if (fifo_read(cbData->outfifo2, outdata, framesPerBuffer) == 0)
+               {
+                       // write signal to both channels */
+                       for(i = 0; i < framesPerBuffer; i++, wptr += 2)
+                       {
+                            wptr[0] = outdata[i];
+                            wptr[1] = outdata[i];
+                       }
+               }
+               else
+               {
+                       // zero output if no data available
+                       for(i = 0; i < framesPerBuffer; i++, wptr += 2)
+                       {
+                               wptr[0] = 0;
+                               wptr[1] = 0;
+                       }
+               }
+       }
+#endif
+    return paContinue;
+}
+
+// Callback from plot_spectrum & plot_waterfall.  would be nice to
+// work out a way to do this without globals.
+
+void fdmdv2_clickTune(float freq) {
+
+    // The demod is hard-wired to expect a centre frequency of
+    // FDMDV_FCENTRE.  So we want to take the signal centered on the
+    // click tune freq and re-centre it on FDMDV_FCENTRE.  For example
+    // if the click tune freq is 1500Hz, and FDMDV_CENTRE is 1200 Hz,
+    // we need to shift the input signal centred on 1500Hz down to
+    // 1200Hz, an offset of -300Hz.
+
+    if (g_split) {
+        g_RxFreqOffsetHz = FDMDV_FCENTRE - freq;
+    }
+    else {
+        g_TxFreqOffsetHz = freq - FDMDV_FCENTRE;
+        g_RxFreqOffsetHz = FDMDV_FCENTRE - freq;
+    }
+}
+
+//----------------------------------------------------------------
+// SetupSerialPort()
+//----------------------------------------------------------------
+void MainFrame::SetupSerialPort(void)
+{
+    if(!wxGetApp().m_strRigCtrlPort.IsEmpty())
+    {
+        if(openComPort(wxGetApp().m_strRigCtrlPort.c_str()))
+        {
+            // always start PTT in Rx state
+            SerialPTTRx();
+        }
+        else
+        {
+            wxMessageBox("Couldn't open Serial Port", wxT("About"), wxOK | wxICON_ERROR, this);
+        }
+    }
+}
+
+void MainFrame::SerialPTTRx(void)
+{
+    printf("m_boolUseRTS: %d m_boolRTSPos: %d m_boolUseDTR: %d m_boolDTRPos: %d\n",
+           wxGetApp().m_boolUseRTS, wxGetApp().m_boolRTSPos, wxGetApp().m_boolUseDTR, wxGetApp().m_boolDTRPos);
+
+        if(wxGetApp().m_boolRTSPos) // RTS cleared LOW
+            lowerRTS();
+        else                        // RTS cleared HIGH
+            raiseRTS();
+
+        if(wxGetApp().m_boolDTRPos) // DTR cleared LOW
+            lowerDTR();
+        else                        // DTR cleared HIGH
+            raiseDTR();
+}
+
+//----------------------------------------------------------------
+// CloseSerialPort()
+//----------------------------------------------------------------
+void MainFrame::CloseSerialPort(void)
+{
+    if (com_handle != COM_HANDLE_INVALID) {
+        // always end with PTT in rx state
+
+        SerialPTTRx();
+
+               closeComPort();
+    }
+}
+
+
+//----------------------------------------------------------------
+// PollUDP() - see if any commands on UDP port
+//----------------------------------------------------------------
+
+// test this puppy with netcat: 
+//   $ echo "hello" | nc -u -q1 localhost 3000
+
+int MainFrame::PollUDP(void)
+{
+    // this will block until message received, so we put it in it's own thread
+
+    char buf[1024];
+    char reply[80];
+    size_t n = m_udp_sock->RecvFrom(m_udp_addr, buf, sizeof(buf)).LastCount();
+
+    if (n) {
+        wxString bufstr = wxString::From8BitData(buf, n);
+        bufstr.Trim();
+        wxString ipaddr = m_udp_addr.IPAddress();
+        printf("Received: \"%s\" from %s:%u\n",
+               (const char *)bufstr.c_str(),
+               (const char *)ipaddr.c_str(), m_udp_addr.Service());
+
+        // for security only accept commands from local host
+
+        sprintf(reply,"nope\n");
+        if (ipaddr.Cmp(_("127.0.0.1")) == 0) {
+
+            // process commands
+
+            if (bufstr.Cmp(_("restore")) == 0) {
+                m_schedule_restore = true;  // Make Restore happen in main thread to avoid crashing
+                sprintf(reply,"ok\n");
+            }
+                
+            wxString itemToSet, val;
+            if (bufstr.StartsWith(_("set "), &itemToSet)) {
+                if (itemToSet.StartsWith("txtmsg ", &val)) {
+                    // note: if options dialog is open this will get overwritten
+                    wxGetApp().m_callSign = val;
+                }  
+                sprintf(reply,"ok\n");
+            }
+                
+        }
+        else {
+            printf("We only accept messages from locahost!\n");
+        }
+
+       if ( m_udp_sock->SendTo(m_udp_addr, reply, strlen(reply)).LastCount() != strlen(reply)) {
+           printf("ERROR: failed to send data\n");
+        }
+    }
+
+    return n;
+}
+
+void MainFrame::startUDPThread(void) {
+    printf("starting UDP thread!\n");
+    m_UDPThread = new UDPThread;
+    m_UDPThread->mf = this;
+    if (m_UDPThread->Create() != wxTHREAD_NO_ERROR ) {
+        wxLogError(wxT("Can't create thread!"));
+    }
+    if (m_UDPThread->Run() != wxTHREAD_NO_ERROR ) {
+        wxLogError(wxT("Can't start thread!"));
+        delete m_UDPThread;
+    }
+}
+
+void MainFrame::stopUDPThread(void) {
+    printf("stopping UDP thread!\n");
+    if ((m_UDPThread != NULL) && m_UDPThread->m_run) {
+        m_UDPThread->m_run = 0;
+        m_UDPThread->Wait();
+        m_UDPThread = NULL;
+    }
+}
+
+void *UDPThread::Entry() {
+    printf("UDP thread started!\n");
+    while (m_run) {
+        if (wxGetApp().m_udp_enable) {
+            printf("m_udp_enable\n");
+            mf->m_udp_addr.Service(wxGetApp().m_udp_port);
+            mf->m_udp_sock = new wxDatagramSocket(mf->m_udp_addr, wxSOCKET_NOWAIT);
+
+            while (m_run && wxGetApp().m_udp_enable) {
+                if (mf->PollUDP() == 0) {
+                    wxThread::Sleep(20);
+                }
+            }
+
+            delete mf->m_udp_sock;
+        }
+        wxThread::Sleep(20);
+    }
+    return NULL;
+}
diff --git a/freedv/branches/0.97/src/fdmdv2_main.h b/freedv/branches/0.97/src/fdmdv2_main.h
new file mode 100644 (file)
index 0000000..8c11fb8
--- /dev/null
@@ -0,0 +1,601 @@
+//==========================================================================
+// Name:            fdmdv2_main.h
+//
+// Purpose:         Declares simple wxWidgets application with GUI.
+// Created:         Apr. 9, 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 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 License
+//  along with this program; if not, see <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#ifndef __FDMDV2_MAIN__
+#define __FDMDV2_MAIN__
+
+#include "version.h"
+#ifndef _NO_AUTOTOOLS_
+#include "../config.h"
+#endif
+#include <wx/wx.h>
+
+#include <wx/tglbtn.h>
+#include <wx/app.h>
+//#include <wx/aboutdlg.h>
+#include "wx/rawbmp.h"
+#include "wx/file.h"
+#include "wx/filename.h"
+#include "wx/config.h"
+#include <wx/fileconf.h>
+#include "wx/graphics.h"
+#include "wx/mstream.h"
+#include "wx/wfstream.h"
+#include "wx/quantize.h"
+#include "wx/scopedptr.h"
+#include "wx/stopwatch.h"
+#include "wx/versioninfo.h"
+#include <wx/sound.h>
+#include <wx/url.h>
+#include <wx/sstream.h>
+#include <wx/listbox.h>
+#include <wx/textdlg.h>
+#include <wx/regex.h>
+#include <wx/socket.h>
+
+#include <samplerate.h>
+
+#include <hamlib.h> 
+#ifdef _WIN32
+#include <windows.h>
+#else
+#include <termios.h>
+#include <sys/ioctl.h>
+#endif
+
+#include "codec2.h"
+#include "codec2_fdmdv.h"
+#include "codec2_fifo.h"
+#include "golay23.h"
+
+#include "topFrame.h"
+#include "dlg_ptt.h"
+#include "dlg_options.h"
+#include "fdmdv2_plot.h"
+#include "fdmdv2_plot_scalar.h"
+#include "fdmdv2_plot_scatter.h"
+#include "fdmdv2_plot_waterfall.h"
+#include "fdmdv2_plot_spectrum.h"
+#include "fdmdv2_pa_wrapper.h"
+#include "sndfile.h"
+#include "portaudio.h"
+#include "dlg_audiooptions.h"
+#include "dlg_filter.h"
+#include "dlg_about.h"
+#include "dlg_options.h"
+#include "varicode.h"
+#include "sox_biquad.h"
+
+#define _USE_TIMER              1
+#define _USE_ONIDLE             1
+#define _DUMMY_DATA             1
+//#define _AUDIO_PASSTHROUGH    1
+#define _REFRESH_TIMER_PERIOD   (DT*1000)
+//#define _USE_ABOUT_DIALOG       1
+
+enum {
+        ID_START = wxID_HIGHEST,
+        ID_TIMER_WATERFALL,
+        ID_TIMER_SPECTRUM,
+        ID_TIMER_SCATTER,
+        ID_TIMER_SCALAR
+     };
+
+#define EXCHANGE_DATA_IN    0
+#define EXCHANGE_DATA_OUT   1
+
+#ifdef _WIN32
+#define COM_HANDLE_INVALID                     INVALID_HANDLE_VALUE
+typedef HANDLE      com_handle_t;
+#else
+#define COM_HANDLE_INVALID                     -1
+typedef int         com_handle_t;
+#endif
+
+extern int                 g_nSoundCards;
+extern int                 g_soundCard1InDeviceNum;
+extern int                 g_soundCard1OutDeviceNum;
+extern int                 g_soundCard1SampleRate;
+extern int                 g_soundCard2InDeviceNum;
+extern int                 g_soundCard2OutDeviceNum;
+extern int                 g_soundCard2SampleRate;
+
+class MainFrame;
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class MainApp
+//
+// @class $(Name)
+// @author $(User)
+// @date $(Date)
+// @file $(CurrentFileName).$(CurrentFileExt)
+// @brief
+//
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class MainApp : public wxApp
+{
+    public:
+        virtual bool        OnInit();
+        virtual int         OnExit();
+
+        wxString            m_strVendName;
+        wxString            m_StrAppName;
+
+        wxString            m_textNumChOut;
+        wxString            m_textNumChIn;
+
+        wxString            m_strRxInAudio;
+        wxString            m_strRxOutAudio;
+        wxString            m_textVoiceInput;
+        wxString            m_textVoiceOutput;
+        wxString            m_strSampleRate;
+        wxString            m_strBitrate;
+
+        // PTT -----------------------------------
+
+        bool                m_boolHalfDuplex;
+
+        bool                m_boolHamlibUseForPTT;
+        unsigned int        m_intHamlibRig;
+        wxString            m_strHamlibSerialPort;
+        Hamlib              *m_hamlib;
+
+        bool                m_boolUseSerialPTT;
+        wxString            m_strRigCtrlPort;
+        bool                m_boolUseRTS;
+        bool                m_boolRTSPos;
+        bool                m_boolUseDTR;
+        bool                m_boolDTRPos;
+
+        // Play/Rec files
+
+        wxString            m_playFileToMicInPath;
+        wxString            m_recFileFromRadioPath;
+        unsigned int        m_recFileFromRadioSecs;
+        wxString            m_playFileFromRadioPath;
+
+        // Options dialog
+
+        wxString            m_callSign;
+        bool                m_events;
+        int                 m_events_spam_timer;
+        unsigned int        m_textEncoding;
+        wxString            m_events_regexp_match;
+        wxString            m_events_regexp_replace;
+
+        bool                m_snrSlow;
+
+        // LPC Post Filter
+        bool                m_codec2LPCPostFilterEnable;
+        bool                m_codec2LPCPostFilterBassBoost;
+        float               m_codec2LPCPostFilterGamma;
+        float               m_codec2LPCPostFilterBeta;
+        
+        // Mic In Equaliser
+        float               m_MicInBassFreqHz;
+        float               m_MicInBassGaindB;
+        float               m_MicInTrebleFreqHz;
+        float               m_MicInTrebleGaindB;
+        float               m_MicInMidFreqHz;
+        float               m_MicInMidGaindB;
+        float               m_MicInMidQ;
+        bool                m_MicInEQEnable;
+
+        // Spk Out Equaliser
+        float               m_SpkOutBassFreqHz;
+        float               m_SpkOutBassGaindB;
+        float               m_SpkOutTrebleFreqHz;
+        float               m_SpkOutTrebleGaindB;
+        float               m_SpkOutMidFreqHz;
+        float               m_SpkOutMidGaindB;
+        float               m_SpkOutMidQ;
+        bool                m_SpkOutEQEnable;
+
+        // Flags for displaying windows
+        int                 m_show_wf;
+        int                 m_show_spect;
+        int                 m_show_scatter;
+        int                 m_show_timing;
+        int                 m_show_freq;
+        int                 m_show_speech_in;
+        int                 m_show_speech_out;
+        int                 m_show_demod_in;
+        int                 m_show_test_frame_errors;
+
+        // optional vox trigger tone
+        bool                m_leftChannelVoxTone;
+
+        // UDP control port
+        bool                m_udp_enable;
+        int                 m_udp_port;
+
+        // notebook display after tx->rxtransition
+        int                 m_rxNbookCtrl;
+
+        wxRect              m_rTopWindow;
+
+        int                 m_framesPerBuffer;
+
+        bool                loadConfig();
+        bool                saveConfig();
+
+        // misc
+
+        bool        m_testFrames;
+
+        int        FilterEvent(wxEvent& event);
+        MainFrame *frame;
+    protected:
+};
+
+// declare global static function wxGetApp()
+DECLARE_APP(MainApp)
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// paCallBackData
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+typedef struct
+{
+    // libresample states for 48 to 8 kHz conversions
+
+    SRC_STATE      *insrc1;
+    SRC_STATE      *outsrc1;
+    SRC_STATE      *insrc2;
+    SRC_STATE      *outsrc2;
+
+    // FIFOs attached to first sound card
+
+    struct FIFO    *infifo1;
+    struct FIFO    *outfifo1;
+
+    // FIFOs attached to second sound card
+    struct FIFO    *infifo2;
+    struct FIFO    *outfifo2;
+
+    // FIFOs for rx process
+    struct FIFO    *rxinfifo;
+    struct FIFO    *rxoutfifo;
+
+    int             inputChannels1, inputChannels2;
+
+    // EQ filter states
+    void           *sbqMicInBass;
+    void           *sbqMicInTreble;
+    void           *sbqMicInMid;
+    void           *sbqSpkOutBass;
+    void           *sbqSpkOutTreble;
+    void           *sbqSpkOutMid;
+
+    bool            micInEQEnable;
+    bool            spkOutEQEnable;
+
+    // optional loud tone on left channel to reliably trigger vox
+    bool            leftChannelVoxTone;
+    float           voxTonePhase;
+
+} paCallBackData;
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// panel with custom loop checkbox for play file dialog
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class MyExtraPlayFilePanel : public wxPanel
+{
+public:
+    MyExtraPlayFilePanel(wxWindow *parent);
+    void setLoopPlayFileToMicIn(bool checked) { m_cb->SetValue(checked); }
+    bool getLoopPlayFileToMicIn(void) { return m_cb->GetValue(); }
+private:
+    wxCheckBox *m_cb;
+};
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// panel with custom Seconds-to-record control for record file dialog
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class MyExtraRecFilePanel : public wxPanel
+{
+public:
+    MyExtraRecFilePanel(wxWindow *parent);
+    ~MyExtraRecFilePanel() 
+    {
+        wxLogDebug("Destructor\n");
+    }
+    void setSecondsToRecord(wxString value) { m_secondsToRecord->SetValue(value); }
+    wxString getSecondsToRecord(void) 
+    { 
+        wxLogDebug("getSecondsToRecord: %s\n",m_secondsToRecord->GetValue());
+        return m_secondsToRecord->GetValue(); 
+    }
+private:
+    wxTextCtrl *m_secondsToRecord;
+};
+
+class txRxThread;
+class UDPThread;
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class MainFrame
+//
+// @class $(Name)
+// @author $(User)
+// @date $(Date)
+// @file $(CurrentFileName).$(CurrentFileExt)
+// @brief
+//
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class MainFrame : public TopFrame
+{
+    public:
+        MainFrame(wxWindow *parent);
+        virtual ~MainFrame();
+
+        PlotSpectrum*           m_panelSpectrum;
+        PlotWaterfall*          m_panelWaterfall;
+        PlotScatter*            m_panelScatter;
+        PlotScalar*             m_panelTimeOffset;
+        PlotScalar*             m_panelFreqOffset;
+        PlotScalar*             m_panelSpeechIn;
+        PlotScalar*             m_panelSpeechOut;
+        PlotScalar*             m_panelDemodIn;
+        PlotScalar*             m_panelTestFrameErrors;
+
+        bool                    m_RxRunning;
+
+        PortAudioWrap           *m_rxInPa;
+        PortAudioWrap           *m_rxOutPa;
+        PortAudioWrap           *m_txInPa;
+        PortAudioWrap           *m_txOutPa;
+
+        PaError                 m_rxErr;
+        PaError                 m_txErr;
+        
+        txRxThread*             m_txRxThread;
+
+        bool                    OpenHamlibRig();
+        void                    SetupSerialPort(void);
+        void                    CloseSerialPort(void);
+        void                    SerialPTTRx(void);
+
+        bool                    m_modal;
+
+#ifdef _USE_TIMER
+        wxTimer                 m_plotTimer;
+#endif
+
+    void destroy_fifos(void);
+    void destroy_src(void);
+    void autoDetectSoundCards(PortAudioWrap *pa);
+
+        static int rxCallback(
+                                const void *inBuffer,
+                                void *outBuffer,
+                                unsigned long framesPerBuffer,
+                                const PaStreamCallbackTimeInfo *outTime,
+                                PaStreamCallbackFlags statusFlags,
+                                void *userData
+                             );
+        static int txCallback(
+                                const void *inBuffer,
+                                void *outBuffer,
+                                unsigned long framesPerBuffer,
+                                const PaStreamCallbackTimeInfo *outTime,
+                                PaStreamCallbackFlags statusFlags,
+                                void *userData
+                             );
+
+
+    void initPortAudioDevice(PortAudioWrap *pa, int inDevice, int outDevice, 
+                             int soundCard, int sampleRate, int inputChannels);
+
+    void togglePTT(void);
+
+    wxIPV4address           m_udp_addr;
+    wxDatagramSocket       *m_udp_sock;
+    UDPThread              *m_UDPThread;
+    void                    startUDPThread(void);
+    void                    stopUDPThread(void);
+    int                     PollUDP();
+    bool                    m_schedule_restore;
+
+    protected:
+
+#ifdef _WIN32
+#define COM_HANDLE_INVALID                     INVALID_HANDLE_VALUE
+        com_handle_t  com_handle;
+#else
+#define COM_HANDLE_INVALID                     -1
+        com_handle_t  com_handle;
+#endif
+        void raiseDTR(void);
+        void lowerDTR(void);
+        void raiseRTS(void);
+        void lowerRTS(void);
+        bool openComPort(const char *port);
+        void closeComPort(void);
+
+        void setsnrBeta(bool snrSlow);
+
+        // protected event handlers
+        virtual void OnCloseFrame(wxCloseEvent& event);
+        void OnExitClick(wxCommandEvent& event);
+
+        void startTxStream();
+        void startRxStream();
+        void stopTxStream();
+        void stopRxStream();
+        void abortTxStream();
+        void abortRxStream();
+        
+        void OnTop(wxCommandEvent& event);
+        void OnExit( wxCommandEvent& event );
+
+        void OnToolsAudio( wxCommandEvent& event );
+        void OnToolsAudioUI( wxUpdateUIEvent& event );
+        void OnToolsComCfg( wxCommandEvent& event );
+        void OnToolsComCfgUI( wxUpdateUIEvent& event );
+        void OnToolsFilter( wxCommandEvent& event );
+        void OnToolsOptions(wxCommandEvent& event);
+        void OnToolsOptionsUI(wxUpdateUIEvent& event);
+
+        void OnPlayFileToMicIn( wxCommandEvent& event );
+        void OnRecFileFromRadio( wxCommandEvent& event );
+        void OnPlayFileFromRadio( wxCommandEvent& event );
+
+        void OnHelpCheckUpdates( wxCommandEvent& event );
+        void OnHelpCheckUpdatesUI( wxUpdateUIEvent& event );
+        void OnHelpAbout( wxCommandEvent& event );
+        void OnCmdSliderScroll( wxScrollEvent& event );
+//        void OnSliderScrollBottom( wxScrollEvent& event );
+//        void OnCmdSliderScrollChanged( wxScrollEvent& event );
+//        void OnSliderScrollTop( wxScrollEvent& event );
+        void OnCheckSQClick( wxCommandEvent& event );
+        void OnCheckSNRClick( wxCommandEvent& event );
+
+        // Toggle Buttons
+        void OnTogBtnSplitClick(wxCommandEvent& event);
+        void OnTogBtnAnalogClick(wxCommandEvent& event);
+        void OnTogBtnRxID( wxCommandEvent& event );
+        void OnTogBtnTxID( wxCommandEvent& event );
+        void OnTogBtnPTT( wxCommandEvent& event );
+        void OnTogBtnOnOff( wxCommandEvent& event );
+
+        void OnCallSignReset( wxCommandEvent& event );
+        void OnBerReset( wxCommandEvent& event );
+
+        //System Events
+        void OnPaint(wxPaintEvent& event);
+        void OnSize( wxSizeEvent& event );
+        void OnUpdateUI( wxUpdateUIEvent& event );
+        void OnDeleteConfig(wxCommandEvent&);
+#ifdef _USE_TIMER
+        void OnTimer(wxTimerEvent &evt);
+#endif
+#ifdef _USE_ONIDLE
+        void OnIdle(wxIdleEvent &evt);
+#endif
+
+    private:
+        bool        m_useMemory;
+        wxTextCtrl* m_tc;
+        int         m_zoom;
+        float       m_snrBeta;
+        
+        // Callsign/text messaging
+        char        m_callsign[MAX_CALLSIGN];
+        char       *m_pcallsign;
+        unsigned int m_checksumGood;
+        unsigned int m_checksumBad;
+        
+        // Events
+        void        processTxtEvent(char event[]);
+        class OptionsDlg *optionsDlg;
+        wxTimer     spamTimer[MAX_EVENT_RULES];
+
+        // level Gauge
+        float       m_maxLevel;
+        // flags to indicate when new EQ filters need to be designed
+
+        bool        m_newMicInFilter;
+        bool        m_newSpkOutFilter;
+
+        void*       designAnEQFilter(const char filterType[], float freqHz, float gaindB, float Q = 0.0);
+        void        designEQFilters(paCallBackData *cb);
+        void        deleteEQFilters(paCallBackData *cb);
+};
+
+void txRxProcessing();
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// class txRxThread - experimental tx/rx processing thread
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class txRxThread : public wxThread
+{
+public:
+    txRxThread(void) : wxThread(wxTHREAD_JOINABLE) { m_run = 1; }
+
+    // thread execution starts here
+    void *Entry() 
+    {
+        while (m_run) 
+        {
+            txRxProcessing();        
+            wxThread::Sleep(20);
+        }
+        return NULL;
+    }
+
+    // called when the thread exits - whether it terminates normally or is
+    // stopped with Delete() (but not when it is Kill()ed!)
+    void OnExit() { }
+
+public:
+    bool  m_run;
+};
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// class UDPThread - waits for UDP messages
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class UDPThread : public wxThread
+{
+public:
+    UDPThread(void) : wxThread(wxTHREAD_JOINABLE) { m_run = 1; }
+
+    // thread execution starts here
+    void *Entry();
+
+    // called when the thread exits - whether it terminates normally or is
+    // stopped with Delete() (but not when it is Kill()ed!)
+    void OnExit() { }
+
+public:
+    MainFrame              *mf;
+    bool                    m_run;
+};
+
+void resample_for_plot(struct FIFO *plotFifo, short buf[], int length);
+
+int resample(SRC_STATE *src,
+             short      output_short[],
+             short      input_short[],
+             int        output_sample_rate,
+             int        input_sample_rate,
+             int        length_output_short, // maximum output array length in samples
+             int        length_input_short
+             );
+void txRxProcessing();
+void per_frame_rx_processing(
+                                        FIFO    *output_fifo,   // decoded speech samples
+                                        int     codec_bits[],  // current frame of bits for decoder
+                                        FIFO    *input_fifo,   // modem samples input to demod
+                                        int     *nin,          // amount of samples demod needs for next call
+                                        int     *state,        // used to collect codec_bits[] halves
+                                        struct  CODEC2 *c2     // Codec 2 states
+                                    );
+
+void per_frame_tx_processing(
+                                            short   tx_fdm_scaled[], // ouput modulated samples
+                                            short   input_buf[],     // speech sample input
+                                            CODEC2  *c2              // Codec 2 states
+                        );
+
+
+#endif //__FDMDV2_MAIN__
diff --git a/freedv/branches/0.97/src/fdmdv2_pa_wrapper.cpp b/freedv/branches/0.97/src/fdmdv2_pa_wrapper.cpp
new file mode 100644 (file)
index 0000000..0812087
--- /dev/null
@@ -0,0 +1,337 @@
+//==========================================================================
+// Name:            fdmdv2_pa_wrapper.cpp
+// Purpose:         Implements a wrapper class around the PortAudio library.
+// Created:         August 12, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#include "fdmdv2_pa_wrapper.h"
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// PortAudioWrap()
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+PortAudioWrap::PortAudioWrap()
+{
+    m_pStream                   = NULL;
+    m_pUserData                 = NULL;
+    m_samplerate                = 0;
+    m_framesPerBuffer           = 0;
+    m_statusFlags               = 0;
+    m_pStreamCallback           = NULL;
+    m_pStreamFinishedCallback   = NULL;
+    m_pTimeInfo                 = 0;
+    m_newdata                   = false;
+
+//    loadData();
+}
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// ~PortAudioWrap()
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+PortAudioWrap::~PortAudioWrap()
+{
+}
+
+//----------------------------------------------------------------
+// streamOpen()
+//----------------------------------------------------------------
+PaError PortAudioWrap::streamOpen()
+{
+    return Pa_OpenStream(
+                            &m_pStream,
+                            m_inputBuffer.device == paNoDevice ? NULL : &m_inputBuffer,
+                            m_outputBuffer.device == paNoDevice ? NULL : &m_outputBuffer,
+                            m_samplerate,
+                            m_framesPerBuffer,
+                            m_statusFlags,
+                            *m_pStreamCallback,
+                            m_pUserData
+                        );
+}
+
+//----------------------------------------------------------------
+// streamStart()
+//----------------------------------------------------------------
+PaError PortAudioWrap::streamStart()
+{
+    return Pa_StartStream(m_pStream);
+}
+
+//----------------------------------------------------------------
+// streamClose()
+//----------------------------------------------------------------
+PaError PortAudioWrap::streamClose()
+{
+    if(isOpen())
+    {
+        PaError rv = Pa_CloseStream(m_pStream);
+        return rv;
+    }
+    else
+    {
+        return paNoError;
+    }
+}
+
+//----------------------------------------------------------------
+// terminate()
+//----------------------------------------------------------------
+void PortAudioWrap::terminate()
+{
+    if(Pa_IsStreamStopped(m_pStream) != paNoError)
+    {
+        Pa_StopStream(m_pStream);
+    }
+    Pa_Terminate();
+}
+
+//----------------------------------------------------------------
+// stop()
+//----------------------------------------------------------------
+void PortAudioWrap::stop()
+{
+    Pa_StopStream(m_pStream);
+}
+
+//----------------------------------------------------------------
+// abort()
+//----------------------------------------------------------------
+void PortAudioWrap::abort()
+{
+    Pa_AbortStream(m_pStream);
+}
+
+//----------------------------------------------------------------
+// isStopped()
+//----------------------------------------------------------------
+bool PortAudioWrap::isStopped() const
+{
+    PaError ret = Pa_IsStreamStopped(m_pStream);
+    return ret;
+}
+
+//----------------------------------------------------------------
+// isActive()
+//----------------------------------------------------------------
+bool PortAudioWrap::isActive() const
+{
+    PaError ret = Pa_IsStreamActive(m_pStream);
+    return ret;
+}
+
+//----------------------------------------------------------------
+// isOpen()
+//----------------------------------------------------------------
+bool PortAudioWrap::isOpen() const
+{
+    return (m_pStream != NULL);
+}
+
+//----------------------------------------------------------------
+// getDefaultInputDevice()
+//----------------------------------------------------------------
+PaDeviceIndex PortAudioWrap::getDefaultInputDevice()
+{
+    return Pa_GetDefaultInputDevice();
+}
+
+//----------------------------------------------------------------
+// getDefaultOutputDevice()
+//----------------------------------------------------------------
+PaDeviceIndex PortAudioWrap::getDefaultOutputDevice()
+{
+    return Pa_GetDefaultOutputDevice();
+}
+
+//----------------------------------------------------------------
+// setInputChannelCount()
+//----------------------------------------------------------------
+PaError PortAudioWrap::setInputChannelCount(int count)
+{
+    m_inputBuffer.channelCount = count;
+    return paNoError;
+}
+
+//----------------------------------------------------------------
+// getInputChannelCount()
+//----------------------------------------------------------------
+PaError PortAudioWrap::getInputChannelCount()
+{
+    return m_inputBuffer.channelCount;
+}
+
+//----------------------------------------------------------------
+// setInputSampleFormat()
+//----------------------------------------------------------------
+PaError PortAudioWrap::setInputSampleFormat(PaSampleFormat format)
+{
+    m_inputBuffer.sampleFormat = format;
+    return paNoError;
+}
+
+//----------------------------------------------------------------
+// setInputLatency()
+//----------------------------------------------------------------
+PaError PortAudioWrap::setInputLatency(PaTime latency)
+{
+    m_inputBuffer.suggestedLatency = latency;
+    return paNoError;
+}
+
+//----------------------------------------------------------------
+// setInputHostApiStreamInfo()
+//----------------------------------------------------------------
+void PortAudioWrap::setInputHostApiStreamInfo(void *info)
+{
+    m_inputBuffer.hostApiSpecificStreamInfo = info;
+}
+
+//----------------------------------------------------------------
+// getInputDefaultLowLatency()
+//----------------------------------------------------------------
+PaTime  PortAudioWrap::getInputDefaultLowLatency()
+{
+    return Pa_GetDeviceInfo(m_inputBuffer.device)->defaultLowInputLatency;
+}
+
+//----------------------------------------------------------------
+// setOutputChannelCount()
+//----------------------------------------------------------------
+PaError PortAudioWrap::setOutputChannelCount(int count)
+{
+    m_outputBuffer.channelCount = count;
+    return paNoError;
+}
+
+//----------------------------------------------------------------
+// getOutputChannelCount()
+//----------------------------------------------------------------
+const int PortAudioWrap::getOutputChannelCount()
+{
+    return m_outputBuffer.channelCount;
+}
+
+//----------------------------------------------------------------
+// getDeviceName()
+//----------------------------------------------------------------
+const char *PortAudioWrap::getDeviceName(PaDeviceIndex dev)
+{
+    const PaDeviceInfo *info;
+    info = Pa_GetDeviceInfo(dev);
+    return info->name;
+}
+
+//----------------------------------------------------------------
+// setOutputSampleFormat()
+//----------------------------------------------------------------
+PaError PortAudioWrap::setOutputSampleFormat(PaSampleFormat format)
+{
+    m_outputBuffer.sampleFormat = format;
+    return paNoError;
+}
+
+//----------------------------------------------------------------
+// setOutputLatency()
+//----------------------------------------------------------------
+PaError PortAudioWrap::setOutputLatency(PaTime latency)
+{
+    m_outputBuffer.suggestedLatency = latency;
+    return paNoError;
+}
+
+//----------------------------------------------------------------
+// setOutputHostApiStreamInfo()
+//----------------------------------------------------------------
+void PortAudioWrap::setOutputHostApiStreamInfo(void *info)
+{
+    m_outputBuffer.hostApiSpecificStreamInfo = info;
+}
+
+//----------------------------------------------------------------
+// getOutputDefaultLowLatency()
+//----------------------------------------------------------------
+PaTime  PortAudioWrap::getOutputDefaultLowLatency()
+{
+    return Pa_GetDeviceInfo(m_outputBuffer.device)->defaultLowOutputLatency;
+}
+
+//----------------------------------------------------------------
+// setFramesPerBuffer()
+//----------------------------------------------------------------
+PaError PortAudioWrap::setFramesPerBuffer(unsigned long size)
+{
+    m_framesPerBuffer = size;
+    return paNoError;
+}
+
+//----------------------------------------------------------------
+// setSampleRate()
+//----------------------------------------------------------------
+PaError PortAudioWrap::setSampleRate(unsigned long rate)
+{
+    m_samplerate = rate;
+    return paNoError;
+}
+
+//----------------------------------------------------------------
+// setStreamFlags()
+//----------------------------------------------------------------
+PaError PortAudioWrap::setStreamFlags(PaStreamFlags flags)
+{
+    m_statusFlags = flags;
+    return paNoError;
+}
+
+//----------------------------------------------------------------
+// setInputDevice()
+//----------------------------------------------------------------
+PaError PortAudioWrap::setInputDevice(PaDeviceIndex index)
+{
+    m_inputBuffer.device = index;
+    return paNoError;
+}
+
+//----------------------------------------------------------------
+// setOutputDevice()
+//----------------------------------------------------------------
+PaError PortAudioWrap::setOutputDevice(PaDeviceIndex index)
+{
+    m_outputBuffer.device = index;
+    return paNoError;
+}
+
+//----------------------------------------------------------------
+// setCallback()
+//----------------------------------------------------------------
+PaError PortAudioWrap::setCallback(PaStreamCallback *callback)
+{
+    m_pStreamCallback = callback;
+    return paNoError;
+}
+
+/*
+//----------------------------------------------------------------
+// loadData() : create Dummy Data
+//----------------------------------------------------------------
+void PortAudioWrap::loadData()
+{
+    int i;
+    for(i = 0; i < FDMDV_NSPEC; i++)
+    {
+        m_av_mag[i] = i;
+    }
+}
+*/
diff --git a/freedv/branches/0.97/src/fdmdv2_pa_wrapper.h b/freedv/branches/0.97/src/fdmdv2_pa_wrapper.h
new file mode 100644 (file)
index 0000000..3d216c0
--- /dev/null
@@ -0,0 +1,115 @@
+//==========================================================================
+// Name:            fdmdv2_pa_wrapper.h
+// Purpose:         Defines a wrapper class around PortAudio
+// Created:         August 12, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#include <stdio.h>
+#include <math.h>
+#include "fdmdv2_defines.h"
+#include "codec2_fdmdv.h"
+#include "codec2.h"
+#include "portaudio.h"
+
+#define PA_SAMPLE_TYPE      paInt16         //paFloat32
+#define FRAMES_PER_BUFFER   (64)
+
+typedef float SAMPLE;
+
+class PortAudioWrap
+{
+    public:
+        PortAudioWrap();
+        ~PortAudioWrap();
+
+//        float                           m_av_mag[FDMDV_NSPEC];
+
+    private:
+        PaStream                        *m_pStream;
+        void                            *m_pUserData;
+        PaStreamCallback                *m_pStreamCallback;
+        PaStreamFinishedCallback        *m_pStreamFinishedCallback;
+        const PaStreamCallbackTimeInfo  *m_pTimeInfo;
+        struct FDMDV                    *m_pFDMDV_state;
+        PaStreamParameters              m_inputBuffer;
+        PaStreamParameters              m_outputBuffer;
+        int                             m_samplerate;
+        unsigned long                   m_framesPerBuffer;
+        PaStreamCallbackFlags           m_statusFlags;
+        bool                            m_newdata;
+
+    public:
+
+        void                averageData(float mag_dB[]);
+
+        int                 getDeviceCount() { return Pa_GetDeviceCount(); }
+        PaDeviceIndex       getDefaultInputDevice();
+        PaDeviceIndex       getDefaultOutputDevice();
+        PaStreamParameters  *getDeviceInfo(PaDeviceIndex idx);
+
+        PaError             setFramesPerBuffer(unsigned long size);
+        PaError             setSampleRate(unsigned long size);
+
+        PaError             setStreamFlags(PaStreamFlags flags);
+        PaError             setCallback(PaStreamCallback *m_pStreamCallback);
+        PaError             setStreamCallback(PaStream *stream, PaStreamCallback* callback) { m_pStreamCallback = callback; return 0;}
+        PaError             setStreamFinishedCallback(PaStream *stream, PaStreamFinishedCallback* m_pStreamFinishedCallback);
+
+        void                setInputBuffer(const PaStreamParameters& inputBuffer)   {this->m_inputBuffer = inputBuffer;}
+        PaError             setInputDevice(PaDeviceIndex dev);
+        PaError             setInputChannelCount(int count);
+        int                 getInputChannelCount();
+        PaError             setInputSampleFormat(PaSampleFormat format);
+        PaError             setInputSampleRate(PaSampleFormat format);
+        PaError             setInputLatency(PaTime latency);
+        void                setInputHostApiStreamInfo(void *info = NULL);
+        PaTime              getInputDefaultLowLatency();
+        const char          *getDeviceName(PaDeviceIndex dev);
+
+        PaError             setOutputDevice(PaDeviceIndex dev);
+        PaError             setOutputChannelCount(int count);
+        const int           getOutputChannelCount();
+        PaError             setOutputSampleFormat(PaSampleFormat format);
+        PaError             setOutputLatency(PaTime latency);
+        void                setOutputHostApiStreamInfo(void *info = NULL);
+        PaTime              getOutputDefaultLowLatency();
+
+        void                setFdmdvState(FDMDV* fdmdv_state)                       {this->m_pFDMDV_state = fdmdv_state;}
+        void                setOutputBuffer(const PaStreamParameters& outputBuffer) {this->m_outputBuffer = outputBuffer;}
+        void                setTimeInfo(PaStreamCallbackTimeInfo* timeInfo)         {this->m_pTimeInfo = timeInfo;}
+        void                setUserData(void* userData)                             {this->m_pUserData = userData;}
+        unsigned long       getFramesPerBuffer() const                              {return m_framesPerBuffer;}
+        const               PaStreamParameters& getInputBuffer() const              {return m_inputBuffer;}
+        const               PaStreamParameters& getOutputBuffer() const             {return m_outputBuffer;}
+        const               PaStreamCallbackFlags& getStatusFlags() const           {return m_statusFlags;}
+
+        FDMDV*              getFdmdvState()                                         {return m_pFDMDV_state;}
+        int                 getSamplerate() const                                   {return m_samplerate;}
+        PaStream*           getStream()                                             {return m_pStream;}
+        void                *getUserData()                                          {return m_pUserData;}
+        bool                getDataAvail()                                          {return m_newdata;}
+        PaError             streamStart();
+        PaError             streamClose();
+        PaError             streamOpen();
+        void                terminate();
+        void                stop();
+        void                abort();
+        bool                isOpen() const;
+        bool                isStopped() const;
+        bool                isActive() const;
+//        void                loadData();
+};
diff --git a/freedv/branches/0.97/src/fdmdv2_plot.cpp b/freedv/branches/0.97/src/fdmdv2_plot.cpp
new file mode 100644 (file)
index 0000000..1b85cd9
--- /dev/null
@@ -0,0 +1,283 @@
+//==========================================================================
+// Name:            fdmdv2_plot.cpp
+// Purpose:         Implements simple wxWidgets application with GUI.
+// Created:         Apr. 9, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#include <string.h>
+#include "fdmdv2_plot.h"
+
+BEGIN_EVENT_TABLE(PlotPanel, wxPanel)
+    EVT_PAINT           (PlotPanel::OnPaint)
+    EVT_MOTION          (PlotPanel::OnMouseMove)
+    EVT_LEFT_DOWN       (PlotPanel::OnMouseLeftDown)
+    EVT_LEFT_UP         (PlotPanel::OnMouseLeftUp)
+    EVT_RIGHT_DOWN      (PlotPanel::OnMouseRightDown)
+    EVT_MOUSEWHEEL      (PlotPanel::OnMouseWheelMoved)
+    EVT_SIZE            (PlotPanel::OnSize)
+    EVT_SHOW            (PlotPanel::OnShow)
+END_EVENT_TABLE()
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class PlotPanel(wxFrame* parent) : wxPanel(parent)
+//
+// @class $(Name)
+// @author $(User)
+// @date $(Date)
+// @file $(CurrentFileName).$(CurrentFileExt)
+// @brief
+//
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+PlotPanel::PlotPanel(wxFrame* parent) : wxPanel(parent)
+{
+    m_pNoteBook         = (wxAuiNotebook *) parent;
+    m_pTopFrame         = (MainFrame *)m_pNoteBook->GetParent();
+    m_zoomFactor        = 1.0;
+    m_pBmp              = NULL;
+    m_pPix              = NULL;
+    m_firstPass         = true;
+    m_line_color        = 0;
+    m_newdata           = false;
+    m_clip              = false;
+    m_use_bitmap        = true;
+    m_rubberBand        = false;
+    m_mouseDown         = false;
+    m_penShortDash      = wxPen(wxColor(0xA0, 0xA0, 0xA0), 1, wxPENSTYLE_SHORT_DASH);
+    m_penDotDash        = wxPen(wxColor(0xD0, 0xD0, 0xD0), 1, wxPENSTYLE_DOT_DASH);
+    m_penSolid          = wxPen(wxColor(0x00, 0x00, 0x00), 1, wxPENSTYLE_SOLID);
+    SetBackgroundStyle(wxBG_STYLE_PAINT);
+    SetLabelSize(10.0);
+}
+
+//-------------------------------------------------------------------------
+// ~PlotPanel()
+//-------------------------------------------------------------------------
+PlotPanel::~PlotPanel()
+{
+    if(m_pBmp != NULL)
+    {
+        delete m_pBmp;
+    }
+}
+
+//-------------------------------------------------------------------------
+// GetLabelSize()
+//-------------------------------------------------------------------------
+double PlotPanel::GetLabelSize()
+{
+    return m_label_size;
+}
+
+//-------------------------------------------------------------------------
+// SetLabelSize()
+//-------------------------------------------------------------------------
+void PlotPanel::SetLabelSize(double size)
+{
+    m_label_size = size;
+}
+
+//-------------------------------------------------------------------------
+// OnShow()
+//-------------------------------------------------------------------------
+void PlotPanel::OnShow(wxShowEvent& event)
+{
+    this->Refresh();
+}
+
+//-------------------------------------------------------------------------
+// OnErase()
+//-------------------------------------------------------------------------
+void PlotPanel::OnErase(wxEraseEvent& event)
+{
+    event.Skip();
+}
+
+//-------------------------------------------------------------------------
+// OnSize()
+//-------------------------------------------------------------------------
+void PlotPanel::OnSize(wxSizeEvent& event)
+{
+    m_rCtrlPrev = m_rCtrl;
+    m_rCtrl     = GetClientRect();
+    if(m_use_bitmap)
+    {
+        if(!m_oImage.IsOk())
+        {
+            m_oImage.Create(m_rCtrl.GetWidth(), m_rCtrl.GetHeight(), true);
+        }
+        else
+        {
+            m_oImage.Rescale(m_rCtrl.GetWidth(), m_rCtrl.GetHeight());
+        }
+        m_pBmp = new wxBitmap(m_oImage, wxBITMAP_SCREEN_DEPTH);
+        m_firstPass = true;
+    }
+    this->Refresh();
+}
+
+//-------------------------------------------------------------------------
+// OnMouseMove()
+//-------------------------------------------------------------------------
+void PlotPanel::OnMouseMove(wxMouseEvent& event)
+{
+//    if(m_mouseDown)
+//    {
+//        paintNow();
+//    }
+}
+
+//-------------------------------------------------------------------------
+// OnMouseLeftDown()
+//-------------------------------------------------------------------------
+void PlotPanel::OnMouseLeftDown(wxMouseEvent& event)
+{
+}
+
+//-------------------------------------------------------------------------
+// OnMouseRightDown()
+//-------------------------------------------------------------------------
+void PlotPanel::OnMouseRightDown(wxMouseEvent& event)
+{
+}
+
+//-------------------------------------------------------------------------
+// OnMouseWheelMoved()
+//-------------------------------------------------------------------------
+void PlotPanel::OnMouseWheelMoved(wxMouseEvent& event)
+{
+}
+
+//-------------------------------------------------------------------------
+// OnMouseLeftUp()
+//-------------------------------------------------------------------------
+void PlotPanel::OnMouseLeftUp(wxMouseEvent& event)
+{
+    m_mouseDown = false;
+}
+
+//-------------------------------------------------------------------------
+// SetZoomFactor()
+//-------------------------------------------------------------------------
+double PlotPanel::SetZoomFactor(double zf)
+{
+    if((zf > 0) && (zf < 5.0))
+    {
+        m_zoomFactor = zf;
+    }
+    return zf;
+}
+
+//-------------------------------------------------------------------------
+// GetZoomFactor()
+//-------------------------------------------------------------------------
+double PlotPanel::GetZoomFactor(double zf)
+{
+    return m_zoomFactor;
+}
+
+//-------------------------------------------------------------------------
+// draw()
+//-------------------------------------------------------------------------
+void PlotPanel::draw(wxAutoBufferedPaintDC& pDC)
+{
+    printf("PlotPanel::draw()");
+    wxMemoryDC m_mDC;
+    m_mDC.SelectObject(*m_pBmp);
+    m_rCtrl  = GetClientRect();
+    m_rGrid  = m_rCtrl;
+
+    m_rGrid = m_rGrid.Deflate(PLOT_BORDER + (XLEFT_OFFSET/2), (PLOT_BORDER + (YBOTTOM_OFFSET/2)));
+    m_rGrid.Offset(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER);
+
+    pDC.Clear();
+    m_rPlot = wxRect(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER, m_rGrid.GetWidth(), m_rGrid.GetHeight());
+    if(m_firstPass)
+    {
+        m_firstPass = false;
+        m_mDC.FloodFill(0, 0, VERY_LTGREY_COLOR);
+
+        // Draw a filled rectangle with aborder
+        wxBrush ltGraphBkgBrush = wxBrush(DARK_BLUE_COLOR);
+        m_mDC.SetBrush(ltGraphBkgBrush);
+        m_mDC.SetPen(wxPen(BLACK_COLOR, 0));
+        m_mDC.DrawRectangle(m_rPlot);
+    }
+    if(m_newdata)
+    {
+        m_newdata = false;
+        int t = m_rPlot.GetTop();
+        int l = m_rPlot.GetLeft();
+//        int r = m_rPlot.GetRight();
+        int h = m_rPlot.GetHeight();
+        int w = m_rPlot.GetWidth();
+        pDC.Blit(l, t, w, h, &m_mDC, l, t);
+    }
+    drawGraticule(pDC);
+    m_mDC.SetBrush(wxNullBrush);
+    m_mDC.SelectObject(wxNullBitmap);
+}
+
+//-------------------------------------------------------------------------
+// drawGraticule()
+//-------------------------------------------------------------------------
+void PlotPanel::drawGraticule(wxAutoBufferedPaintDC& pDC)
+{
+    int p;
+    char buf[15];
+    wxString s;
+
+    // Vertical gridlines
+    pDC.SetPen(m_penShortDash);
+    for(p = (PLOT_BORDER + XLEFT_OFFSET + GRID_INCREMENT); p < ((m_rGrid.GetWidth() - XLEFT_OFFSET) + GRID_INCREMENT); p += GRID_INCREMENT)
+    {
+        pDC.DrawLine(p, (m_rGrid.GetHeight() + PLOT_BORDER), p, PLOT_BORDER);
+    }
+    // Horizontal gridlines
+    pDC.SetPen(m_penDotDash);
+    for(p = (m_rGrid.GetHeight() - GRID_INCREMENT); p > PLOT_BORDER; p -= GRID_INCREMENT)
+    {
+        pDC.DrawLine(PLOT_BORDER + XLEFT_OFFSET, (p + PLOT_BORDER), (m_rGrid.GetWidth() + PLOT_BORDER + XLEFT_OFFSET), (p + PLOT_BORDER));
+    }
+    // Label the X-Axis
+    pDC.SetPen(wxPen(GREY_COLOR, 1));
+    for(p = GRID_INCREMENT; p < (m_rGrid.GetWidth() - YBOTTOM_OFFSET); p += GRID_INCREMENT)
+    {
+        sprintf(buf, "%1.1f Hz",(double)(p / 10));
+        pDC.DrawText(buf, p - PLOT_BORDER + XLEFT_OFFSET, m_rGrid.GetHeight() + YBOTTOM_OFFSET/2);
+    }
+    // Label the Y-Axis
+    //for(p = GRID_INCREMENT; p < (h - YBOTTOM_OFFSET); p += GRID_INCREMENT)
+    for(p = (m_rGrid.GetHeight() - GRID_INCREMENT); p > PLOT_BORDER; p -= GRID_INCREMENT)
+    {
+        sprintf(buf, "%1.0f", (double)((m_rGrid.GetHeight() - p) * -10));
+        pDC.DrawText(buf, XLEFT_TEXT_OFFSET, p);
+    }
+}
+
+//-------------------------------------------------------------------------
+// paintEvent()
+//
+// Called by the system of by wxWidgets when the panel needs
+// to be redrawn. You can also trigger this call by calling
+// Refresh()/Update().
+//-------------------------------------------------------------------------
+void PlotPanel::OnPaint(wxPaintEvent & evt)
+{
+    wxAutoBufferedPaintDC pdc(this);
+    draw(pdc);
+}
+
diff --git a/freedv/branches/0.97/src/fdmdv2_plot.h b/freedv/branches/0.97/src/fdmdv2_plot.h
new file mode 100644 (file)
index 0000000..25309d3
--- /dev/null
@@ -0,0 +1,150 @@
+//==========================================================================
+// Name:            fdmdv2_plot.h
+// Purpose:         Declares simple wxWidgets application with GUI
+// Created:         Apr. 10, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+//#include "fdmdv2_main.h"
+#ifndef __FDMDV2_PLOT__
+#define __FDMDV2_PLOT__
+#include <wx/wx.h>
+#include <wx/aui/auibook.h>
+#include <wx/rawbmp.h>
+#include <wx/image.h>
+#include <wx/dcbuffer.h>
+
+#define MAX_ZOOM            7
+#define MAX_BMP_X           (400 * MAX_ZOOM)
+#define MAX_BMP_Y           (400 * MAX_ZOOM)
+#define DATA_LINE_HEIGHT    10
+#define TEXT_BASELINE_OFFSET_Y  -5
+
+
+#define wxUSE_FILEDLG       1
+#define wxUSE_LIBPNG        1
+#define wxUSE_LIBJPEG       1
+#define wxUSE_GIF           1
+#define wxUSE_PCX           1
+#define wxUSE_LIBTIFF       1
+
+#define PLOT_BORDER         12
+#define XLEFT_OFFSET        40
+#define XLEFT_TEXT_OFFSET   6
+#define YBOTTOM_OFFSET      20
+#define YBOTTOM_TEXT_OFFSET 15
+#define GRID_INCREMENT      50
+
+#define BLACK_COLOR         wxColor(0x00, 0x00, 0x00)
+#define GREY_COLOR          wxColor(0x80, 0x80, 0x80)
+#define DARK_GREY_COLOR     wxColor(0x40, 0x40, 0x40)
+#define MEDIUM_GREY_COLOR   wxColor(0xC0, 0xC0, 0xC0)
+#define LIGHT_GREY_COLOR    wxColor(0xE0, 0xE0, 0xE0)
+#define VERY_LTGREY_COLOR   wxColor(0xF8, 0xF8, 0xF8)
+#define WHITE_COLOR         wxColor(0xFF, 0xFF, 0xFF)
+
+#define DARK_BLUE_COLOR     wxColor(0x00, 0x00, 0x60)
+#define BLUE_COLOR          wxColor(0x00, 0x00, 0xFF)
+#define LIGHT_BLUE_COLOR    wxColor(0x80, 0x80, 0xFF)
+
+#define RED_COLOR           wxColor(0xFF, 0x5E, 0x5E)
+#define LIGHT_RED_COLOR     wxColor(0xFF, 0xE0, 0xE0)
+#define DARK_RED_COLOR      wxColor(0xFF, 0x00, 0x00)
+#define PINK_COLOR          wxColor(0xFF, 0x80, 0xFF)
+
+#define LIGHT_GREEN_COLOR   wxColor(0xE3, 0xFF, 0xE0)
+#define GREEN_COLOR         wxColor(0x95, 0xFF, 0x8A)
+#define DARK_GREEN_COLOR    wxColor(0x20, 0xFF, 0x08)
+#define VERY_GREEN_COLOR    wxColor(0x00, 0xFF, 0x00)
+
+#define YELLOW_COLOR        wxColor(0xFF, 0xFF, 0x5E)
+#define LIGHT_YELLOW_COLOR  wxColor(0xFF, 0xFF, 0xB5)
+#define DARK_YELLOW_COLOR   wxColor(0xFF, 0xFF, 0x08)
+
+class MainFrame;
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class PlotPanel
+//
+// @class $(Name)
+// @author $(User)
+// @date $(Date)
+// @file $(CurrentFileName).$(CurrentFileExt)
+// @brief
+//
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class PlotPanel : public wxPanel
+{
+    public:
+        PlotPanel(wxFrame* parent);
+        ~PlotPanel();
+        wxPen               m_penShortDash;
+        wxPen               m_penDotDash;
+        wxPen               m_penSolid;
+        wxRect              m_rCtrlPrev;
+        wxRect              m_rCtrl;
+        wxRect              m_rGrid;
+        wxRect              m_rPlot;
+        MainFrame           *m_pTopFrame;
+        wxAuiNotebook       *m_pNoteBook;
+        double              m_label_size;
+        wxSize              m_Bufsz;
+        bool                m_newdata;
+        wxImage             m_oImage;
+        wxBitmap            *m_pBmp;
+        wxNativePixelData   *m_pPix;
+
+        // some useful events
+        void            OnMouseMove(wxMouseEvent& event);
+        virtual void    OnMouseLeftDown(wxMouseEvent& event);
+        void            OnMouseLeftUp(wxMouseEvent& event);
+        virtual void    OnMouseRightDown(wxMouseEvent& event);
+        void            OnMouseWheelMoved(wxMouseEvent& event);
+        void            OnClose(wxCloseEvent& event ){ event.Skip(); }
+        void            OnSize( wxSizeEvent& event );
+        void            OnErase(wxEraseEvent& event);
+        void            OnPaint(wxPaintEvent& event);
+        //void OnUpdateUI( wxUpdateUIEvent& event ){ event.Skip(); }
+
+        void            paintEvent(wxPaintEvent & evt);
+        virtual void    draw(wxAutoBufferedPaintDC&  pdc);
+        virtual void    drawGraticule(wxAutoBufferedPaintDC&  pdc);
+        virtual double  SetZoomFactor(double zf);
+        virtual double  GetZoomFactor(double zf);
+        virtual void    OnShow(wxShowEvent& event);
+        virtual double  GetLabelSize();
+        virtual void    SetLabelSize(double size);
+
+    protected:
+        int             m_x;
+        int             m_y;
+        int             m_left;
+        int             m_top;
+        int             m_prev_w;
+        int             m_prev_h;
+        int             m_prev_x;
+        int             m_prev_y;
+        bool            m_use_bitmap;
+        bool            m_clip;
+        bool            m_rubberBand;
+        bool            m_mouseDown;
+        bool            m_firstPass;
+        double          m_zoomFactor;
+        int             m_greyscale;
+        int             m_line_color;
+    DECLARE_EVENT_TABLE()
+};
+#endif //__FDMDV2_PLOT__
diff --git a/freedv/branches/0.97/src/fdmdv2_plot_scalar.cpp b/freedv/branches/0.97/src/fdmdv2_plot_scalar.cpp
new file mode 100644 (file)
index 0000000..a29911f
--- /dev/null
@@ -0,0 +1,281 @@
+//==========================================================================
+// Name:            fdmdv2_plot_scalar.cpp
+// Purpose:         Plots scalar amplitude against time
+// Created:         June 22, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#include <string.h>
+#include "wx/wx.h"
+#include "fdmdv2_main.h"
+#include "fdmdv2_plot_scalar.h"
+
+BEGIN_EVENT_TABLE(PlotScalar, PlotPanel)
+    EVT_PAINT           (PlotScalar::OnPaint)
+    EVT_MOTION          (PlotScalar::OnMouseMove)
+    EVT_MOUSEWHEEL      (PlotScalar::OnMouseWheelMoved)
+    EVT_SIZE            (PlotScalar::OnSize)
+    EVT_SHOW            (PlotScalar::OnShow)
+//    EVT_ERASE_BACKGROUND(PlotScalar::OnErase)
+END_EVENT_TABLE()
+
+//----------------------------------------------------------------
+// PlotScalar()
+//----------------------------------------------------------------
+PlotScalar::PlotScalar(wxFrame* parent, 
+                       int    channels,           // number on channel to plot
+                      float  t_secs,             // time covered by entire x axis in seconds
+                      float  sample_period_secs, // time between each sample in seconds
+                      float  a_min,              // min ampltude of samples being plotted
+                      float  a_max,              // max ampltude of samples being plotted
+                      float  graticule_t_step,   // time step of x (time) axis graticule in seconds
+                      float  graticule_a_step,   // step of amplitude axis graticule
+                      const char a_fmt[],        // printf format string for amlitude axis labels
+                       int    mini                // true for mini-plot - don't draw graticule
+                      ): PlotPanel(parent)
+{
+    int i;
+
+    m_rCtrl = GetClientRect();
+
+    m_channels = channels;
+    m_t_secs = t_secs;
+    m_sample_period_secs = sample_period_secs;
+    m_a_min = a_min;
+    m_a_max = a_max;
+    m_graticule_t_step = graticule_t_step;
+    m_graticule_a_step = graticule_a_step;
+    assert(strlen(a_fmt) < 15);
+    strcpy(m_a_fmt, a_fmt);
+    m_mini = mini;
+
+    // work out number of samples we will store and allocate storage
+
+    m_samples = m_t_secs/m_sample_period_secs;
+    m_mem = new float[m_samples*m_channels];
+
+    for(i = 0; i < m_samples*m_channels; i++)
+    {
+        m_mem[i] = 0.0;
+    }
+}
+
+//----------------------------------------------------------------
+// ~PlotScalar()
+//----------------------------------------------------------------
+PlotScalar::~PlotScalar()
+{
+    delete m_mem;
+}
+
+//----------------------------------------------------------------
+// add_new_sample()
+//----------------------------------------------------------------
+void PlotScalar::add_new_sample(int channel, float sample)
+{
+    int i;
+    int offset = channel*m_samples;
+
+    assert(channel < m_channels);
+
+    for(i = 0; i < m_samples-1; i++)
+    {
+        m_mem[offset+i] = m_mem[offset+i+1];
+    }
+    m_mem[offset+m_samples-1] = sample;
+}
+
+//----------------------------------------------------------------
+// add_new_samples()
+//----------------------------------------------------------------
+void  PlotScalar::add_new_short_samples(int channel, short samples[], int length, float scale_factor)
+{
+    int i;
+    int offset = channel*m_samples;
+
+    assert(channel < m_channels);
+
+    for(i = 0; i < m_samples-length; i++)
+        m_mem[offset+i] = m_mem[offset+i+length];
+    for(; i < m_samples; i++)
+       m_mem[offset+i] = (float)*samples++/scale_factor;
+}
+
+//----------------------------------------------------------------
+// draw()
+//----------------------------------------------------------------
+void PlotScalar::draw(wxAutoBufferedPaintDC&  dc)
+{
+    float index_to_px;
+    float a_to_py;
+    int   i;
+    int   x, y;
+    int   prev_x, prev_y;
+    float a;
+
+    m_rCtrl = GetClientRect();
+    m_rGrid = m_rCtrl;
+    if (!m_mini)
+        m_rGrid = m_rGrid.Deflate(PLOT_BORDER + (XLEFT_OFFSET/2), (PLOT_BORDER + (YBOTTOM_OFFSET/2)));
+
+    //printf("h %d w %d\n", m_rCtrl.GetWidth(), m_rCtrl.GetHeight());
+    //printf("h %d w %d\n", m_rGrid.GetWidth(), m_rGrid.GetHeight());
+
+    // black background
+
+    dc.Clear();
+    if (m_mini)
+        m_rPlot = wxRect(0, 0, m_rGrid.GetWidth(), m_rGrid.GetHeight());        
+    else
+        m_rPlot = wxRect(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER, m_rGrid.GetWidth(), m_rGrid.GetHeight());
+   
+    wxBrush ltGraphBkgBrush = wxBrush(BLACK_COLOR);
+    dc.SetBrush(ltGraphBkgBrush);
+    dc.SetPen(wxPen(BLACK_COLOR, 0));
+    dc.DrawRectangle(m_rPlot);
+
+    index_to_px = (float)m_rGrid.GetWidth()/m_samples;
+    a_to_py = (float)m_rGrid.GetHeight()/(m_a_max - m_a_min);
+
+    wxPen pen;
+    pen.SetColour(DARK_GREEN_COLOR);
+    pen.SetWidth(1);
+    dc.SetPen(pen);
+
+    // draw all samples
+
+    prev_x = prev_y = 0; // stop warning
+
+    // plot each channel 
+
+    int offset;
+    for(offset=0; offset<m_channels*m_samples; offset+=m_samples) {
+
+        for(i = 0; i < m_samples; i++) {
+            x = index_to_px * i;
+            a = m_mem[offset+i];
+            if (a < m_a_min) a = m_a_min;
+            if (a > m_a_max) a = m_a_max;
+
+            // invert y axis and offset by minimum
+
+            y = m_rGrid.GetHeight() - a_to_py * a + m_a_min*a_to_py;
+
+            // put inside plot window
+
+            if (!m_mini) {
+                x += PLOT_BORDER + XLEFT_OFFSET;
+                y += PLOT_BORDER;
+            }
+
+            if (i)
+                dc.DrawLine(x, y, prev_x, prev_y);
+            prev_x = x; prev_y = y;
+        }
+    }
+
+    drawGraticule(dc);
+}
+
+//-------------------------------------------------------------------------
+// drawGraticule()
+//-------------------------------------------------------------------------
+void PlotScalar::drawGraticule(wxAutoBufferedPaintDC&  dc)
+{
+    float    t, a;
+    int      x, y, text_w, text_h;
+    char     buf[15];
+    wxString s;
+    float    sec_to_px;
+    float    a_to_py;
+
+    wxBrush ltGraphBkgBrush;
+    ltGraphBkgBrush.SetStyle(wxBRUSHSTYLE_TRANSPARENT);
+    ltGraphBkgBrush.SetColour(*wxBLACK);
+    dc.SetBrush(ltGraphBkgBrush);
+    dc.SetPen(wxPen(BLACK_COLOR, 1));
+
+    sec_to_px = (float)m_rGrid.GetWidth()/m_t_secs;
+    a_to_py = (float)m_rGrid.GetHeight()/(m_a_max - m_a_min);
+
+    // upper LH coords of plot area are (PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER)
+    // lower RH coords of plot area are (PLOT_BORDER + XLEFT_OFFSET + m_rGrid.GetWidth(), 
+    //                                   PLOT_BORDER + m_rGrid.GetHeight())
+
+    // Vertical gridlines
+
+    dc.SetPen(m_penShortDash);
+    for(t=0; t<=m_t_secs; t+=m_graticule_t_step) {
+       x = t*sec_to_px;
+       if (m_mini) {
+            dc.DrawLine(x, m_rGrid.GetHeight(), x, 0);
+        }
+        else {
+            x += PLOT_BORDER + XLEFT_OFFSET;
+            dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, PLOT_BORDER);
+        }
+        if (!m_mini) {
+            sprintf(buf, "%2.1fs", t);
+            GetTextExtent(buf, &text_w, &text_h);
+            dc.DrawText(buf, x - text_w/2, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET);
+        }
+    }
+
+    // Horizontal gridlines
+
+    dc.SetPen(m_penDotDash);
+    for(a=m_a_min; a<m_a_max; a+=m_graticule_a_step) {
+       y = m_rGrid.GetHeight() - a*a_to_py + m_a_min*a_to_py;
+       if (m_mini) {
+            dc.DrawLine(0, y, m_rGrid.GetWidth(), y);
+        }
+        else {
+            y += PLOT_BORDER;
+            dc.DrawLine(PLOT_BORDER + XLEFT_OFFSET, y, 
+                        (m_rGrid.GetWidth() + PLOT_BORDER + XLEFT_OFFSET), y);
+        }
+        if (!m_mini) {
+            sprintf(buf, m_a_fmt, a);
+            GetTextExtent(buf, &text_w, &text_h);
+            dc.DrawText(buf, PLOT_BORDER + XLEFT_OFFSET - text_w - XLEFT_TEXT_OFFSET, y-text_h/2);
+        }
+   }
+
+
+}
+
+//----------------------------------------------------------------
+// OnPaint()
+//----------------------------------------------------------------
+void PlotScalar::OnPaint(wxPaintEvent& event)
+{
+    wxAutoBufferedPaintDC dc(this);
+    draw(dc);
+}
+
+//----------------------------------------------------------------
+// OnSize()
+//----------------------------------------------------------------
+void PlotScalar::OnSize(wxSizeEvent& event)
+{
+}
+
+//----------------------------------------------------------------
+// OnShow()
+//----------------------------------------------------------------
+void PlotScalar::OnShow(wxShowEvent& event)
+{
+}
diff --git a/freedv/branches/0.97/src/fdmdv2_plot_scalar.h b/freedv/branches/0.97/src/fdmdv2_plot_scalar.h
new file mode 100644 (file)
index 0000000..7043987
--- /dev/null
@@ -0,0 +1,73 @@
+//==========================================================================
+// Name:            fdmdv2_plot_scalar.h
+// Purpose:         Defines a scalar plot derivative of fdmdv2_plot.
+// Created:         June 22, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#ifndef __FDMDV2_PLOT_SCALAR__
+#define __FDMDV2_PLOT_SCALAR__
+
+#include "fdmdv2_plot.h"
+#include "fdmdv2_defines.h"
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class PlotScalar
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class PlotScalar: public PlotPanel
+{
+    public:
+
+    PlotScalar(wxFrame* parent,
+               int   channels,
+              float t_secs, 
+              float sample_period_secs,
+              float a_min,
+              float a_max,
+              float graticule_t_step,   
+              float graticule_a_step,
+              const char  a_fmt[],
+               int   mini
+              );
+        ~PlotScalar();
+         void add_new_sample(int channel, float sample);
+         void add_new_short_samples(int channel, short samples[], int length, float scale_factor);
+
+    protected:
+
+         int      m_channels;
+        float    m_t_secs;
+        float    m_sample_period_secs;
+        float    m_a_min;
+        float    m_a_max;
+        float    m_graticule_t_step;   
+        float    m_graticule_a_step;
+        char     m_a_fmt[15];
+         int      m_mini;
+        int      m_samples;
+        float   *m_mem;              
+
+        void draw(wxAutoBufferedPaintDC&  dc);
+       void drawGraticule(wxAutoBufferedPaintDC&  dc);
+        void OnPaint(wxPaintEvent& event);
+        void OnSize(wxSizeEvent& event);
+        void OnShow(wxShowEvent& event);
+
+        DECLARE_EVENT_TABLE()
+};
+
+#endif // __FDMDV2_PLOT_SCALAR__
+
diff --git a/freedv/branches/0.97/src/fdmdv2_plot_scatter.cpp b/freedv/branches/0.97/src/fdmdv2_plot_scatter.cpp
new file mode 100644 (file)
index 0000000..b9f5f7e
--- /dev/null
@@ -0,0 +1,176 @@
+//==========================================================================
+// Name:            fdmdv2_plot_scatter.cpp
+// Purpose:         A scatter plot derivative of fdmdv2_plot.
+// Created:         June 24, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#include <string.h>
+#include "wx/wx.h"
+#include "fdmdv2_plot_scatter.h"
+
+BEGIN_EVENT_TABLE(PlotScatter, PlotPanel)
+    EVT_PAINT           (PlotScatter::OnPaint)
+    EVT_MOTION          (PlotScatter::OnMouseMove)
+    EVT_MOUSEWHEEL      (PlotScatter::OnMouseWheelMoved)
+    EVT_SIZE            (PlotScatter::OnSize)
+    EVT_SHOW            (PlotScatter::OnShow)
+//    EVT_ERASE_BACKGROUND(PlotScatter::OnErase)
+END_EVENT_TABLE()
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// PlotScatter
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+PlotScatter::PlotScatter(wxFrame* parent) : PlotPanel(parent)
+{
+    int i;
+
+    for(i=0; i < SCATTER_MEM_SYMS_MAX; i++)
+    {
+        m_mem[i].real = 0.0;
+        m_mem[i].imag = 0.0;
+    }
+
+    m_filter_max_xy = 0.1;
+
+    // defaults so we start off with something sensible
+
+    Nsym = 14+1;
+    scatterMemSyms = ((int)(SCATTER_MEM_SECS*(Nsym/DT)));
+    assert(scatterMemSyms <= SCATTER_MEM_SYMS_MAX);
+        
+}
+
+// changing number of carriers changes number of symoles to plot
+void PlotScatter::setNc(int Nc) {
+    Nsym = Nc+1;
+    assert(Nsym <= (FDMDV_NC_MAX+1));
+    scatterMemSyms = ((int)(SCATTER_MEM_SECS*(Nsym/DT)));
+    assert(scatterMemSyms <= SCATTER_MEM_SYMS_MAX);
+}
+
+//----------------------------------------------------------------
+// draw()
+//----------------------------------------------------------------
+void PlotScatter::draw(wxAutoBufferedPaintDC& dc)
+{
+    float x_scale;
+    float y_scale;
+    int   i,j;
+    int   x;
+    int   y;
+
+    m_rCtrl = GetClientRect();
+    m_rGrid = m_rCtrl;
+    m_rGrid = m_rGrid.Deflate(PLOT_BORDER + (XLEFT_OFFSET/2), (PLOT_BORDER + (YBOTTOM_OFFSET/2)));
+
+    // black background
+
+    dc.Clear();
+    m_rPlot = wxRect(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER, m_rGrid.GetWidth(), m_rGrid.GetHeight());
+    wxBrush ltGraphBkgBrush = wxBrush(BLACK_COLOR);
+    dc.SetBrush(ltGraphBkgBrush);
+    dc.SetPen(wxPen(BLACK_COLOR, 0));
+    dc.DrawRectangle(m_rPlot);
+    wxPen pen;
+    pen.SetColour(LIGHT_GREEN_COLOR);
+    pen.SetWidth(1);
+    dc.SetPen(pen);
+
+    // shift memory
+
+    for(i = 0; i < scatterMemSyms - Nsym; i++)
+    {
+        m_mem[i] = m_mem[i+Nsym];
+    }
+
+    // new samples
+
+    for(j=0; i < scatterMemSyms; i++,j++)
+    {
+        m_mem[i] = m_new_samples[j];
+    }
+
+    // automatically scale
+
+    float max_xy = 1E-12;
+    float real,imag;
+    for(i=0; i< scatterMemSyms; i++) {
+        real = fabs(m_mem[i].real);
+        imag = fabs(m_mem[i].imag);
+        if (real > max_xy)
+            max_xy = real;
+        if (imag > max_xy)
+            max_xy = imag;
+    }
+    m_filter_max_xy = BETA*m_filter_max_xy + (1 - BETA)*2.5*max_xy;
+    if (m_filter_max_xy < 0.001)
+        m_filter_max_xy = 0.001;
+    //printf("max_xy: %f m_filter_max_xy: %f\n", max_xy, m_filter_max_xy);
+
+    x_scale = (float)m_rGrid.GetWidth()/m_filter_max_xy;
+    y_scale = (float)m_rGrid.GetHeight()/m_filter_max_xy;
+
+    // draw all samples
+
+    for(i = 0; i < scatterMemSyms; i++)
+    {
+        x = x_scale * m_mem[i].real + m_rGrid.GetWidth()/2;
+        y = y_scale * m_mem[i].imag + m_rGrid.GetHeight()/2;
+       x += PLOT_BORDER + XLEFT_OFFSET;
+       y += PLOT_BORDER;
+       dc.DrawPoint(x, y);
+    }
+}
+
+//----------------------------------------------------------------
+// add_new_samples()
+//----------------------------------------------------------------
+void PlotScatter::add_new_samples(COMP samples[])
+{
+    int i;
+
+    for(i = 0; i < Nsym; i++)
+    {
+        m_new_samples[i] = samples[i];
+    }
+}
+
+//----------------------------------------------------------------
+// OnPaint()
+//----------------------------------------------------------------
+void PlotScatter::OnPaint(wxPaintEvent& event)
+{
+    wxAutoBufferedPaintDC dc(this);
+    draw(dc);
+}
+
+//----------------------------------------------------------------
+// OnSize()
+//----------------------------------------------------------------
+void PlotScatter::OnSize(wxSizeEvent& event)
+{
+    // todo: clear screen
+}
+
+//----------------------------------------------------------------
+// OnShow()
+//----------------------------------------------------------------
+void PlotScatter::OnShow(wxShowEvent& event)
+{
+}
+
diff --git a/freedv/branches/0.97/src/fdmdv2_plot_scatter.h b/freedv/branches/0.97/src/fdmdv2_plot_scatter.h
new file mode 100644 (file)
index 0000000..702f633
--- /dev/null
@@ -0,0 +1,56 @@
+//==========================================================================
+// Name:            fdmdv2_plot_scatter.h
+// Purpose:         A scatter plot derivative of fdmdv2_plot.
+// Created:         June 24, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#ifndef __FDMDV2_PLOT_SCATTER__
+#define __FDMDV2_PLOT_SCATTER__
+
+#include "comp.h"
+#include "fdmdv2_plot.h"
+#include "fdmdv2_defines.h"
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class PlotScatter
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class PlotScatter : public PlotPanel
+{
+    public:
+        PlotScatter(wxFrame* parent);
+        ~PlotScatter(){};
+       void add_new_samples(COMP samples[]);
+       void setNc(int Nc);
+
+    protected:
+        COMP m_mem[SCATTER_MEM_SYMS_MAX];
+        COMP m_new_samples[FDMDV_NC_MAX+1];
+
+        void draw(wxAutoBufferedPaintDC&  dc);
+        void OnPaint(wxPaintEvent& event);
+        void OnSize(wxSizeEvent& event);
+        void OnShow(wxShowEvent& event);
+
+        DECLARE_EVENT_TABLE()
+
+    private:
+        int   Nsym;
+        int   scatterMemSyms;
+        float m_filter_max_xy;
+};
+
+#endif //__FDMDV2_PLOT_SCATTER__
diff --git a/freedv/branches/0.97/src/fdmdv2_plot_spectrum.cpp b/freedv/branches/0.97/src/fdmdv2_plot_spectrum.cpp
new file mode 100644 (file)
index 0000000..c08154e
--- /dev/null
@@ -0,0 +1,268 @@
+//==========================================================================
+// Name:            fdmdv2_plot_waterfall.cpp
+// Purpose:         Implements a waterfall plot derivative of fdmdv2_plot.
+// Created:         June 23, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#include <string.h>
+#include "wx/wx.h"
+
+#include "fdmdv2_main.h"
+
+extern float g_avmag[];                 // average mag data passed to draw() 
+void fdmdv2_clickTune(float frequency); // callback to pass new click freq
+
+BEGIN_EVENT_TABLE(PlotSpectrum, PlotPanel)
+    EVT_MOTION          (PlotSpectrum::OnMouseMove)
+    EVT_LEFT_DOWN       (PlotSpectrum::OnMouseLeftDown)
+    EVT_LEFT_UP         (PlotSpectrum::OnMouseLeftUp)
+    EVT_MOUSEWHEEL      (PlotSpectrum::OnMouseWheelMoved)
+    EVT_PAINT           (PlotSpectrum::OnPaint)
+    EVT_SHOW            (PlotSpectrum::OnShow)
+END_EVENT_TABLE()
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class PlotSpectrum
+//
+// @class $(Name)
+// @author $(User)
+// @date $(Date)
+// @file $(CurrentFileName).$(CurrentFileExt)
+// @brief
+//
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+PlotSpectrum::PlotSpectrum(wxFrame* parent, float *magdB, int n_magdB, 
+                           float min_mag_db, float max_mag_db, bool clickTune): PlotPanel(parent)
+{
+    m_greyscale     = 0;
+    m_Bufsz         = GetMaxClientSize();
+    m_newdata       = false;
+    m_firstPass     = true;
+    m_line_color    = 0;
+    SetLabelSize(10.0);
+
+    m_magdB         = magdB;
+    m_n_magdB       = n_magdB;     // number of points in magdB that covers 0 ... MAX_F_HZ of spectrum
+    m_max_mag_db    = max_mag_db;
+    m_min_mag_db    = min_mag_db;
+    m_rxFreq        = 0.0;
+    m_clickTune     = clickTune;
+}
+
+//----------------------------------------------------------------
+// ~PlotSpectrum()
+//----------------------------------------------------------------
+PlotSpectrum::~PlotSpectrum()
+{
+}
+
+//----------------------------------------------------------------
+// OnSize()
+//----------------------------------------------------------------
+void PlotSpectrum::OnSize(wxSizeEvent& event) {
+}
+
+//----------------------------------------------------------------
+// OnPaint()
+//----------------------------------------------------------------
+void PlotSpectrum::OnPaint(wxPaintEvent& event)
+{
+    wxAutoBufferedPaintDC dc(this);
+    draw(dc);
+}
+
+//----------------------------------------------------------------
+// OnShow()
+//----------------------------------------------------------------
+void PlotSpectrum::OnShow(wxShowEvent& event)
+{
+}
+
+//----------------------------------------------------------------
+// draw()
+//----------------------------------------------------------------
+void PlotSpectrum::draw(wxAutoBufferedPaintDC& dc)
+{
+    m_rCtrl  = GetClientRect();
+
+    // m_rGrid is coords of inner window we actually plot to.  We deflate it a bit
+    // to leave room for axis labels.  We need to work this out every time we draw
+    // as OnSize() may not be called before OnPaint(), for example when a new tab
+    // is selected
+
+    m_rGrid  = m_rCtrl;
+    m_rGrid = m_rGrid.Deflate(PLOT_BORDER + (XLEFT_OFFSET/2), (PLOT_BORDER + (YBOTTOM_OFFSET/2)));
+
+    dc.Clear();
+
+    // black background
+
+    m_rPlot = wxRect(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER, m_rGrid.GetWidth(), m_rGrid.GetHeight());
+    wxBrush ltGraphBkgBrush = wxBrush(BLACK_COLOR);
+    dc.SetBrush(ltGraphBkgBrush);
+    dc.SetPen(wxPen(BLACK_COLOR, 0));
+    dc.DrawRectangle(m_rPlot);
+
+    // draw spectrum
+
+    int   x, y, prev_x, prev_y, index;
+    float index_to_px, mag_dB_to_py, mag;
+
+    m_newdata = false;
+
+    wxPen pen;
+    pen.SetColour(DARK_GREEN_COLOR);
+    pen.SetWidth(1);
+    dc.SetPen(pen);
+
+    //index_to_px = ((float)FDMDV_MAX_F_HZ/(float)MAX_F_HZ)*(float)m_rGrid.GetWidth()/FDMDV_NSPEC;
+    index_to_px = (float)m_rGrid.GetWidth()/m_n_magdB;
+    mag_dB_to_py = (float)m_rGrid.GetHeight()/(m_max_mag_db - m_min_mag_db);
+    //int last_index = ((float)MAX_F_HZ/(float)FDMDV_MAX_F_HZ)*FDMDV_NSPEC;
+
+    prev_x = PLOT_BORDER + XLEFT_OFFSET;
+    prev_y = PLOT_BORDER;
+    for(index = 0; index < m_n_magdB; index++)
+    {
+        x = index*index_to_px;
+        mag = m_magdB[index];
+        if (mag > m_max_mag_db) mag = m_max_mag_db;
+        if (mag < m_min_mag_db) mag = m_min_mag_db;
+        y = -(mag - m_max_mag_db) * mag_dB_to_py;
+
+        x += PLOT_BORDER + XLEFT_OFFSET;
+        y += PLOT_BORDER;
+
+        if (index)
+            dc.DrawLine(x, y, prev_x, prev_y);
+        prev_x = x; prev_y = y;
+    }
+
+    // and finally draw Graticule
+
+    drawGraticule(dc);
+
+}
+
+//-------------------------------------------------------------------------
+// drawGraticule()
+//-------------------------------------------------------------------------
+void PlotSpectrum::drawGraticule(wxAutoBufferedPaintDC&  dc)
+{
+    int      x, y, text_w, text_h;
+    char     buf[15];
+    wxString s;
+    float    f, mag, freq_hz_to_px, mag_dB_to_py;
+
+    wxBrush ltGraphBkgBrush;
+    ltGraphBkgBrush.SetStyle(wxBRUSHSTYLE_TRANSPARENT);
+    ltGraphBkgBrush.SetColour(*wxBLACK);
+    dc.SetBrush(ltGraphBkgBrush);
+    dc.SetPen(wxPen(BLACK_COLOR, 1));
+
+    freq_hz_to_px = (float)m_rGrid.GetWidth()/(MAX_F_HZ-MIN_F_HZ);
+    mag_dB_to_py = (float)m_rGrid.GetHeight()/(m_max_mag_db - m_min_mag_db);
+
+    // upper LH coords of plot area are (PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER)
+    // lower RH coords of plot area are (PLOT_BORDER + XLEFT_OFFSET + m_rGrid.GetWidth(), 
+    //                                   PLOT_BORDER + m_rGrid.GetHeight())
+
+    // Check if small screen size means text will overlap
+
+    int textXStep = STEP_F_HZ*freq_hz_to_px;
+    int textYStep = STEP_MAG_DB*mag_dB_to_py;
+    sprintf(buf, "%4.0fHz", (float)MAX_F_HZ - STEP_F_HZ);
+    GetTextExtent(buf, &text_w, &text_h);
+    int overlappedText = (text_w > textXStep) || (text_h > textYStep);
+    //printf("text_w: %d textXStep: %d text_h: %d textYStep: %d  overlappedText: %d\n", text_w, textXStep, 
+    //      text_h, textYStep, overlappedText);
+
+    // Vertical gridlines
+
+    for(f=STEP_F_HZ; f<MAX_F_HZ; f+=STEP_F_HZ) {
+       x = f*freq_hz_to_px;
+       x += PLOT_BORDER + XLEFT_OFFSET;
+
+        dc.SetPen(m_penShortDash);
+        dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, PLOT_BORDER);
+        dc.SetPen(wxPen(BLACK_COLOR, 1));
+        dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET);
+
+        sprintf(buf, "%4.0fHz", f);
+       GetTextExtent(buf, &text_w, &text_h);
+        if (!overlappedText)
+            dc.DrawText(buf, x - text_w/2, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET);
+    }
+
+    dc.SetPen(wxPen(BLACK_COLOR, 1));
+    for(f=STEP_MINOR_F_HZ; f<MAX_F_HZ; f+=STEP_MINOR_F_HZ) 
+    {
+        x = f*freq_hz_to_px;
+        x += PLOT_BORDER + XLEFT_OFFSET;
+        dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET-5);
+    }
+    
+    // Horizontal gridlines
+
+    dc.SetPen(m_penDotDash);
+    for(mag=m_min_mag_db; mag<=m_max_mag_db; mag+=STEP_MAG_DB) {
+       y = -(mag - m_max_mag_db) * mag_dB_to_py;
+       y += PLOT_BORDER;
+       dc.DrawLine(PLOT_BORDER + XLEFT_OFFSET, y, 
+                   (m_rGrid.GetWidth() + PLOT_BORDER + XLEFT_OFFSET), y);
+        sprintf(buf, "%3.0fdB", mag);
+       GetTextExtent(buf, &text_w, &text_h);
+        if (!overlappedText)
+            dc.DrawText(buf, PLOT_BORDER + XLEFT_OFFSET - text_w - XLEFT_TEXT_OFFSET, y-text_h/2);
+    }
+
+    // red rx tuning line
+    
+    if (m_rxFreq != 0.0) {
+        dc.SetPen(wxPen(RED_COLOR, 2));
+        x = m_rxFreq*freq_hz_to_px;
+        x += PLOT_BORDER + XLEFT_OFFSET;
+        //printf("m_rxFreq %f x %d\n", m_rxFreq, x);
+        dc.DrawLine(x, m_rGrid.GetHeight()+ PLOT_BORDER, x, m_rCtrl.GetHeight());
+    }
+
+}
+
+//-------------------------------------------------------------------------
+// OnMouseDown()
+//-------------------------------------------------------------------------
+void PlotSpectrum::OnMouseLeftDown(wxMouseEvent& event)
+{
+    m_mouseDown = true;
+    wxClientDC dc(this);
+
+    wxPoint pt(event.GetLogicalPosition(dc));
+
+    // map x coord to edges of actual plot
+    pt.x -= PLOT_BORDER + XLEFT_OFFSET;
+    pt.y -= PLOT_BORDER;
+
+    // valid click if inside of plot
+    if ((pt.x >= 0) && (pt.x <= m_rGrid.GetWidth()) && (pt.y >=0) && m_clickTune) {
+        float freq_hz_to_px = (float)m_rGrid.GetWidth()/(MAX_F_HZ-MIN_F_HZ);
+        float clickFreq = (float)pt.x/freq_hz_to_px;
+
+        // see PlotWaterfall::OnMouseDown()
+
+        fdmdv2_clickTune(clickFreq);
+    }
+}
diff --git a/freedv/branches/0.97/src/fdmdv2_plot_spectrum.h b/freedv/branches/0.97/src/fdmdv2_plot_spectrum.h
new file mode 100644 (file)
index 0000000..d3d579c
--- /dev/null
@@ -0,0 +1,57 @@
+//==========================================================================
+// Name:            fdmdv2_plot_spectrum.h
+// Purpose:         Defines a spectrum plot derived from fdmdv2_plot class.
+// Created:         June 22, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#ifndef __FDMDV2_PLOT_SPECTRUM__
+#define __FDMDV2_PLOT_SPECTRUM__
+
+#include "fdmdv2_plot.h"
+#include "fdmdv2_defines.h"
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class Waterfall
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class PlotSpectrum : public PlotPanel
+{
+    public:
+    PlotSpectrum(wxFrame* parent, float *magdB, int n_magdB, 
+                 float min_mag_db=MIN_MAG_DB, float max_mag_db=MAX_MAG_DB, bool clickTune=true);
+        ~PlotSpectrum();
+        void setRxFreq(float rxFreq) { m_rxFreq = rxFreq; }
+
+    protected:
+        void        OnPaint(wxPaintEvent& event);
+        void        OnSize(wxSizeEvent& event);
+        void        OnShow(wxShowEvent& event);
+        void        drawGraticule(wxAutoBufferedPaintDC& dc);
+        void        draw(wxAutoBufferedPaintDC& dc);
+        void        OnMouseLeftDown(wxMouseEvent& event);
+
+   private:
+        float       m_rxFreq;
+        float       m_max_mag_db;
+        float       m_min_mag_db;
+        float      *m_magdB;
+        int         m_n_magdB;  
+        bool        m_clickTune;
+
+        DECLARE_EVENT_TABLE()
+};
+
+#endif //__FDMDV2_PLOT_SPECTRUM__
diff --git a/freedv/branches/0.97/src/fdmdv2_plot_waterfall.cpp b/freedv/branches/0.97/src/fdmdv2_plot_waterfall.cpp
new file mode 100644 (file)
index 0000000..b65c208
--- /dev/null
@@ -0,0 +1,481 @@
+//==========================================================================
+// Name:            fdmdv2_plot_waterfall.cpp
+// Purpose:         Implements a waterfall plot derivative of fdmdv2_plot.
+// Created:         June 22, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#include <string.h>
+#include "wx/wx.h"
+#include "fdmdv2_main.h"
+
+extern float g_avmag[];                 // av mag spec passed in to draw() 
+void fdmdv2_clickTune(float frequency); // callback to pass new click freq
+
+BEGIN_EVENT_TABLE(PlotWaterfall, PlotPanel)
+    EVT_PAINT           (PlotWaterfall::OnPaint)
+    EVT_MOTION          (PlotWaterfall::OnMouseMove)
+    EVT_LEFT_DOWN       (PlotWaterfall::OnMouseLeftDown)
+    EVT_RIGHT_DOWN      (PlotWaterfall::OnMouseRightDown)
+    EVT_LEFT_UP         (PlotWaterfall::OnMouseLeftUp)
+    EVT_MOUSEWHEEL      (PlotWaterfall::OnMouseWheelMoved)
+    EVT_SIZE            (PlotWaterfall::OnSize)
+    EVT_SHOW            (PlotWaterfall::OnShow)
+END_EVENT_TABLE()
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class WaterfallPlot
+//
+// @class   WaterfallPlot
+// @author  David Witten
+// @date    $(Date)
+// @file    $(CurrentFileName).$(CurrentFileExt)
+// @brief
+//
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+PlotWaterfall::PlotWaterfall(wxFrame* parent, bool graticule, int colour): PlotPanel(parent)
+{
+
+    for(int i = 0; i < 255; i++)
+    {
+        m_heatmap_lut[i] = heatmap((float)i, 0.0, 255.0);
+    }
+    m_graticule     = graticule;
+    m_colour        = colour;
+    m_Bufsz         = GetMaxClientSize();
+    m_newdata       = false;
+    m_firstPass     = true;
+    m_line_color    = 0;
+    SetLabelSize(10.0);
+
+    m_pBmp = NULL;
+    m_max_mag = MAX_MAG_DB;
+    m_min_mag = MIN_MAG_DB;
+}
+
+// When the window size gets set we can work outthe size of the window
+// we plot in and allocate a bit map of the correct size
+void PlotWaterfall::OnSize(wxSizeEvent& event) 
+{
+    // resize bit map
+
+    delete m_pBmp;
+    
+    m_rCtrl  = GetClientRect();
+
+    // m_rGrid is coords of inner window we actually plot to.  We deflate it a bit
+    // to leave room for axis labels.
+
+    m_rGrid  = m_rCtrl;
+    m_rGrid = m_rGrid.Deflate(PLOT_BORDER + (XLEFT_OFFSET/2), (PLOT_BORDER + (YBOTTOM_OFFSET/2)));
+
+    // we want a bit map the size of m_rGrid
+
+    m_pBmp = new wxBitmap(m_rGrid.GetWidth(), m_rGrid.GetHeight(), 24);
+
+    m_dT = DT;
+}
+
+//----------------------------------------------------------------
+// paintEvent()
+//
+// @class $(Name)
+// @author $(User)
+// @date $(Date)
+// @file $(CurrentFileName).$(CurrentFileExt)
+// @brief
+//
+// Called by the system of by wxWidgets when the panel needs
+// to be redrawn. You can also trigger this call by calling
+// Refresh()/Update().
+//----------------------------------------------------------------
+void PlotWaterfall::OnPaint(wxPaintEvent & evt)
+{
+    wxAutoBufferedPaintDC dc(this);
+    draw(dc);
+}
+
+//----------------------------------------------------------------
+// OnShow()
+//----------------------------------------------------------------
+void PlotWaterfall::OnShow(wxShowEvent& event)
+{
+}
+
+//----------------------------------------------------------------
+// ~PlotWaterfall()
+//----------------------------------------------------------------
+PlotWaterfall::~PlotWaterfall()
+{
+}
+
+//----------------------------------------------------------------
+// heatmap()
+// map val to a rgb colour
+// from http://eddiema.ca/2011/01/21/c-sharp-heatmaps/
+//----------------------------------------------------------------
+unsigned PlotWaterfall::heatmap(float val, float min, float max)
+{
+    unsigned r = 0;
+    unsigned g = 0;
+    unsigned b = 0;
+
+    val = (val - min) / (max - min);
+    if(val <= 0.2)
+    {
+        b = (unsigned)((val / 0.2) * 255);
+    }
+    else if(val >  0.2 &&  val <= 0.7)
+    {
+        b = (unsigned)((1.0 - ((val - 0.2) / 0.5)) * 255);
+    }
+    if(val >= 0.2 &&  val <= 0.6)
+    {
+        g = (unsigned)(((val - 0.2) / 0.4) * 255);
+    }
+    else if(val >  0.6 &&  val <= 0.9)
+    {
+        g = (unsigned)((1.0 - ((val - 0.6) / 0.3)) * 255);
+    }
+    if(val >= 0.5)
+    {
+        r = (unsigned)(((val - 0.5) / 0.5) * 255);
+    }
+    //printf("%f %x %x %x\n", val, r, g, b);
+    return  (b << 16) + (g << 8) + r;
+}
+
+bool PlotWaterfall::checkDT(void)
+{
+    // Check dY is > 1 pixel before proceeding. For small screens
+    // and large WATERFALL_SECS_Y we might have less than one
+    // block per pixel.  In this case increase m_dT and perform draw
+    // less often
+
+    float px_per_sec = (float)m_rGrid.GetHeight() / WATERFALL_SECS_Y;
+    float dy = m_dT * px_per_sec;
+    
+    if (dy < 1.0) {
+        m_dT += DT;
+        return false;
+    }
+    else
+        return true;
+}
+
+//----------------------------------------------------------------
+// draw()
+//----------------------------------------------------------------
+void PlotWaterfall::draw(wxAutoBufferedPaintDC& dc)
+{
+
+    m_rCtrl  = GetClientRect();
+
+    // m_rGrid is coords of inner window we actually plot to.  We deflate it a bit
+    // to leave room for axis labels.
+
+    m_rGrid = m_rCtrl;
+    m_rGrid = m_rGrid.Deflate(PLOT_BORDER + (XLEFT_OFFSET/2), (PLOT_BORDER + (YBOTTOM_OFFSET/2)));
+
+    if (m_pBmp == NULL) 
+    {
+        // we want a bit map the size of m_rGrid
+        m_pBmp = new wxBitmap(m_rGrid.GetWidth(), m_rGrid.GetHeight(), 24);
+    }
+
+    dc.Clear();
+
+    if(m_newdata)
+    {
+        m_newdata = false;
+        plotPixelData();
+        dc.DrawBitmap(*m_pBmp, PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER);
+        m_dT = DT;
+    }
+    else 
+    {
+
+        // no data to plot so just erase to black.  Blue looks nicer
+        // but is same colour as low amplitude signal
+
+        // Bug on Linux: When Stop is pressed this code doesn't erase
+        // the lower 25% of the Waterfall Window
+
+        m_rPlot = wxRect(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER, m_rGrid.GetWidth(), m_rGrid.GetHeight());
+        wxBrush ltGraphBkgBrush = wxBrush(BLACK_COLOR);
+        dc.SetBrush(ltGraphBkgBrush);
+        dc.SetPen(wxPen(BLACK_COLOR, 0));
+        dc.DrawRectangle(m_rPlot);
+    }
+    drawGraticule(dc);
+}
+
+//-------------------------------------------------------------------------
+// drawGraticule()
+//-------------------------------------------------------------------------
+void PlotWaterfall::drawGraticule(wxAutoBufferedPaintDC& dc)
+{
+    int      x, y, text_w, text_h;
+    char     buf[15];
+    wxString s;
+    float    f, time, freq_hz_to_px, time_s_to_py;
+
+    wxBrush ltGraphBkgBrush;
+    ltGraphBkgBrush.SetStyle(wxBRUSHSTYLE_TRANSPARENT);
+    ltGraphBkgBrush.SetColour(*wxBLACK);
+    dc.SetBrush(ltGraphBkgBrush);
+    dc.SetPen(wxPen(BLACK_COLOR, 1));
+
+    freq_hz_to_px = (float)m_rGrid.GetWidth()/(MAX_F_HZ-MIN_F_HZ);
+    time_s_to_py = (float)m_rGrid.GetHeight()/WATERFALL_SECS_Y;
+
+    // upper LH coords of plot area are (PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER)
+    // lower RH coords of plot area are (PLOT_BORDER + XLEFT_OFFSET + m_rGrid.GetWidth(), 
+    //                                   PLOT_BORDER + m_rGrid.GetHeight())
+
+    // Check if small screen size means text will overlap
+
+    int textXStep = STEP_F_HZ*freq_hz_to_px;
+    int textYStep = WATERFALL_SECS_STEP*time_s_to_py;
+    sprintf(buf, "%4.0fHz", (float)MAX_F_HZ - STEP_F_HZ);
+    GetTextExtent(buf, &text_w, &text_h);
+    int overlappedText = (text_w > textXStep) || (text_h > textYStep);
+
+    // Major Vertical gridlines and legend
+    //dc.SetPen(m_penShortDash);
+    for(f=STEP_F_HZ; f<MAX_F_HZ; f+=STEP_F_HZ) 
+    {
+        x = f*freq_hz_to_px;
+        x += PLOT_BORDER + XLEFT_OFFSET;
+
+        if (m_graticule)
+            dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, PLOT_BORDER);
+        else
+            dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET);
+            
+        sprintf(buf, "%4.0fHz", f);
+        GetTextExtent(buf, &text_w, &text_h);
+        if (!overlappedText)
+            dc.DrawText(buf, x - text_w/2, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET);
+    }
+
+    for(f=STEP_MINOR_F_HZ; f<MAX_F_HZ; f+=STEP_MINOR_F_HZ) 
+    {
+        x = f*freq_hz_to_px;
+        x += PLOT_BORDER + XLEFT_OFFSET;
+        dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET-5);
+    }
+    
+    // Horizontal gridlines
+    dc.SetPen(m_penDotDash);
+    for(time=0; time<=WATERFALL_SECS_Y; time+=WATERFALL_SECS_STEP) {
+       y = m_rGrid.GetHeight() - time*time_s_to_py;
+       y += PLOT_BORDER;
+
+        if (m_graticule)
+            dc.DrawLine(PLOT_BORDER + XLEFT_OFFSET, y, 
+                        (m_rGrid.GetWidth() + PLOT_BORDER + XLEFT_OFFSET), y);
+        sprintf(buf, "%3.0fs", time);
+       GetTextExtent(buf, &text_w, &text_h);
+        if (!overlappedText)
+            dc.DrawText(buf, PLOT_BORDER + XLEFT_OFFSET - text_w - XLEFT_TEXT_OFFSET, y-text_h/2);
+   }
+
+    // red rx tuning line
+    dc.SetPen(wxPen(RED_COLOR, 2));
+    x = m_rxFreq*freq_hz_to_px;
+    x += PLOT_BORDER + XLEFT_OFFSET;
+    //printf("m_rxFreq %f x %d\n", m_rxFreq, x);
+    dc.DrawLine(x, m_rGrid.GetHeight()+ PLOT_BORDER, x, m_rCtrl.GetHeight());
+    
+}
+
+//-------------------------------------------------------------------------
+// plotPixelData()
+//-------------------------------------------------------------------------
+void PlotWaterfall::plotPixelData()
+{
+    float       spec_index_per_px;
+    float       intensity_per_dB;
+    float       px_per_sec;
+    int         index;
+    float       dy;
+    int         dy_blocks;
+    int         b;
+    int         px;
+    int         py;
+    int         intensity;
+
+    /*
+      Design Notes:
+
+      The height in pixels represents WATERFALL_SECS_Y of data.  Every DT
+      seconds we get a vector of FDMDV_NSPEC spectrum samples which we use
+      to update the last row.  The height of each row is dy pixels, which
+      maps to DT seconds.  We call each dy high rectangle of pixels a
+      block.
+
+    */
+
+    // determine dy, the height of one "block"
+    px_per_sec = (float)m_rGrid.GetHeight() / WATERFALL_SECS_Y;
+    dy = m_dT * px_per_sec;
+
+    // number of dy high blocks in spectrogram
+    dy_blocks = m_rGrid.GetHeight()/ dy;
+
+    // update min and max amplitude estimates
+    float max_mag = MIN_MAG_DB;
+
+    int min_fft_bin=((float)200/FDMDV_MAX_F_HZ)*FDMDV_NSPEC;
+    int max_fft_bin=((float)2800/FDMDV_MAX_F_HZ)*FDMDV_NSPEC;
+
+    for(int i=min_fft_bin; i<max_fft_bin; i++) 
+    {
+        if (g_avmag[i] > max_mag)
+        {
+            max_mag = g_avmag[i];
+        }
+    }
+
+    m_max_mag = BETA*m_max_mag + (1 - BETA)*max_mag;
+    m_min_mag = max_mag - 20.0;
+    //printf("max_mag: %f m_max_mag: %f\n", max_mag, m_max_mag);
+    //intensity_per_dB  = (float)256 /(MAX_MAG_DB - MIN_MAG_DB);
+    intensity_per_dB  = (float)256 /(m_max_mag - m_min_mag);
+    spec_index_per_px = ((float)(MAX_F_HZ)/(float)FDMDV_MAX_F_HZ)*(float)FDMDV_NSPEC / (float) m_rGrid.GetWidth();
+
+    /*
+    printf("h %d w %d px_per_sec %d dy %d dy_blocks %d spec_index_per_px: %f\n", 
+       m_rGrid.GetHeight(), m_rGrid.GetWidth(), px_per_sec, 
+       dy, dy_blocks, spec_index_per_px);
+    */
+
+    // Shift previous bit map up one row of blocks ----------------------------
+    wxNativePixelData data(*m_pBmp);
+    wxNativePixelData::Iterator bitMapStart(data);
+    wxNativePixelData::Iterator p = bitMapStart;
+
+    for(b = 0; b < dy_blocks - 1; b++) 
+    {
+        wxNativePixelData::Iterator psrc = bitMapStart;
+        wxNativePixelData::Iterator pdest = bitMapStart;
+        pdest.OffsetY(data, dy * b);
+        psrc.OffsetY(data, dy * (b+1));
+
+        // copy one line of blocks
+
+        for(py = 0; py < dy; py++) 
+        {
+            wxNativePixelData::Iterator pdestRowStart = pdest;
+            wxNativePixelData::Iterator psrcRowStart = psrc;
+
+            for(px = 0; px < m_rGrid.GetWidth(); px++) 
+            {
+                pdest.Red() = psrc.Red();
+                pdest.Green() = psrc.Green();
+                pdest.Blue() = psrc.Blue();
+                pdest++;
+                psrc++;
+            }
+            pdest = pdestRowStart;
+            pdest.OffsetY(data, 1);
+            psrc = psrcRowStart;
+            psrc.OffsetY(data, 1);         
+        }
+    }
+
+    // Draw last line of blocks using latest amplitude data ------------------
+    p = bitMapStart;
+    p.OffsetY(data, dy *(dy_blocks - 1));
+    for(py = 0; py < dy; py++)
+    {
+        wxNativePixelData::Iterator rowStart = p;
+
+        for(px = 0; px < m_rGrid.GetWidth(); px++)
+        {
+            index = px * spec_index_per_px;
+            assert(index < FDMDV_NSPEC);
+
+            intensity = intensity_per_dB * (g_avmag[index] - m_min_mag);
+            if(intensity > 255) intensity = 255;
+            if (intensity < 0) intensity = 0;
+            //printf("%d %f %d \n", index, g_avmag[index], intensity);
+
+            switch (m_colour) {
+            case 0:
+                p.Red() = m_heatmap_lut[intensity] & 0xff;
+                p.Green() = (m_heatmap_lut[intensity] >> 8) & 0xff;
+                p.Blue() = (m_heatmap_lut[intensity] >> 16) & 0xff;
+                break;
+            case 1:
+                p.Red() = intensity;
+                p.Green() = intensity;
+                p.Blue() = intensity;       
+                break;
+            case 2:
+                p.Red() = intensity;
+                p.Green() = intensity;
+                if (intensity < 127)
+                    p.Blue() = intensity*2;
+                else
+                    p.Blue() = 255;
+                        
+                break;
+            }
+            ++p;
+        }
+        p = rowStart;
+        p.OffsetY(data, 1);
+    }
+
+}
+
+//-------------------------------------------------------------------------
+// OnMouseLeftDown()
+//-------------------------------------------------------------------------
+void PlotWaterfall::OnMouseLeftDown(wxMouseEvent& event)
+{
+    m_mouseDown = true;
+    wxClientDC dc(this);
+
+    wxPoint pt(event.GetLogicalPosition(dc));
+
+    // map x coord to edges of actual plot
+    pt.x -= PLOT_BORDER + XLEFT_OFFSET;
+    pt.y -= PLOT_BORDER;
+
+    // valid click if inside of plot
+    if ((pt.x >= 0) && (pt.x <= m_rGrid.GetWidth()) && (pt.y >=0)) 
+    {
+        float freq_hz_to_px = (float)m_rGrid.GetWidth()/(MAX_F_HZ-MIN_F_HZ);
+        float clickFreq = (float)pt.x/freq_hz_to_px;
+
+        // communicate back to other threads
+        fdmdv2_clickTune(clickFreq);
+    }
+}
+
+//-------------------------------------------------------------------------
+// OnMouseRightDown()
+//-------------------------------------------------------------------------
+void PlotWaterfall::OnMouseRightDown(wxMouseEvent& event)
+{
+    m_colour++;
+    if (m_colour == 3)
+        m_colour = 0;
+}
+
diff --git a/freedv/branches/0.97/src/fdmdv2_plot_waterfall.h b/freedv/branches/0.97/src/fdmdv2_plot_waterfall.h
new file mode 100644 (file)
index 0000000..e5c0e83
--- /dev/null
@@ -0,0 +1,71 @@
+//==========================================================================
+// Name:            fdmdv2_plot_waterfall.h
+// Purpose:         Defines a waterfall plot derivative of fdmdv2_plot.
+// Created:         June 22, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#ifndef __FDMDV2_PLOT_WATERFALL__
+#define __FDMDV2_PLOT_WATERFALL__
+
+#include "fdmdv2_plot.h"
+#include "fdmdv2_defines.h"
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class PlotWaterfall
+//
+// @class $(Name)
+// @author $(User)
+// @date $(Date)
+// @file $(CurrentFileName).$(CurrentFileExt)
+// @brief
+//
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class PlotWaterfall : public PlotPanel
+{
+    public:
+    PlotWaterfall(wxFrame* parent, bool graticule, int colour);
+        ~PlotWaterfall();
+        bool checkDT(void);
+        void setGreyscale(bool greyscale) { m_greyscale = greyscale; }
+        void setRxFreq(float rxFreq) { m_rxFreq = rxFreq; }
+
+    protected:
+        unsigned    m_heatmap_lut[256];
+
+        unsigned    heatmap(float val, float min, float max);
+
+        void        OnPaint(wxPaintEvent & evt);
+        void        OnSize(wxSizeEvent& event);
+        void        OnShow(wxShowEvent& event);
+        void        drawGraticule(wxAutoBufferedPaintDC&  dc);
+        void        draw(wxAutoBufferedPaintDC& dc);
+        void        plotPixelData();
+        void        OnMouseLeftDown(wxMouseEvent& event);
+        void        OnMouseRightDown(wxMouseEvent& event);
+
+    private:
+        float       m_dT;
+        float       m_rxFreq;
+        bool        m_graticule;
+        float       m_min_mag;
+        float       m_max_mag;
+        int         m_colour;
+
+        DECLARE_EVENT_TABLE()
+};
+
+#endif //__FDMDV2_PLOT_WATERFALL__
diff --git a/freedv/branches/0.97/src/hamlib.cpp b/freedv/branches/0.97/src/hamlib.cpp
new file mode 100644 (file)
index 0000000..575f36a
--- /dev/null
@@ -0,0 +1,127 @@
+//==========================================================================
+// Name:            hamlib.cpp
+//
+// Purpose:         Hamlib integration for FreeDV
+// Created:         May 2013
+// Authors:         Joel Stanley
+//
+// 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#include <hamlib.h>
+
+#include <vector>
+#include <algorithm>
+
+using namespace std;
+
+typedef std::vector<const struct rig_caps *> riglist_t;
+
+static bool rig_cmp(const struct rig_caps *rig1, const struct rig_caps *rig2);
+static int build_list(const struct rig_caps *rig, rig_ptr_t);
+
+Hamlib::Hamlib() : m_rig(NULL) {
+    /* Stop hamlib from spewing info to stderr. */
+    rig_set_debug(RIG_DEBUG_NONE);
+
+    /* Create sorted list of rigs. */
+    rig_load_all_backends();
+    rig_list_foreach(build_list, &m_rigList);
+    sort(m_rigList.begin(), m_rigList.end(), rig_cmp);
+
+    /* Reset debug output. */
+    rig_set_debug(RIG_DEBUG_VERBOSE);
+
+       m_rig = NULL;
+}
+
+Hamlib::~Hamlib() {
+       if(m_rig)
+               close();
+}
+
+static int build_list(const struct rig_caps *rig, rig_ptr_t rigList) {
+    ((riglist_t *)rigList)->push_back(rig); 
+    return 1;
+}
+
+static bool rig_cmp(const struct rig_caps *rig1, const struct rig_caps *rig2) {
+    /* Compare manufacturer. */
+    int r = strcasecmp(rig1->mfg_name, rig2->mfg_name);
+    if (r != 0)
+        return r < 0;
+
+    /* Compare model. */
+    r = strcasecmp(rig1->model_name, rig2->model_name);
+    if (r != 0)
+        return r < 0;
+
+    /* Compare rig ID. */
+    return rig1->rig_model < rig2->rig_model;
+}
+
+void Hamlib::populateComboBox(wxComboBox *cb) {
+
+    riglist_t::const_iterator rig = m_rigList.begin();
+    for (; rig !=m_rigList.end(); rig++) {
+        char name[128];
+        snprintf(name, 128, "%s %s", (*rig)->mfg_name, (*rig)->model_name); 
+        cb->Append(name);
+    }
+}
+
+bool Hamlib::connect(unsigned int rig_index, const char *serial_port) {
+    /* Look up model from index. */
+    if (rig_index >= m_rigList.size()) {
+        return false;
+    }
+    printf("rig: %s %s (%d)\n", m_rigList[rig_index]->mfg_name,
+            m_rigList[rig_index]->model_name, m_rigList[rig_index]->rig_model);
+
+       if(m_rig) {
+               printf("Closing old hamlib instance!\n");
+               close();
+       }
+
+    /* Initialise, configure and open. */
+    m_rig = rig_init(m_rigList[rig_index]->rig_model);
+    /* TODO: Also use baud rate from the screen. */
+    if (!m_rig)
+        return false;
+    token_t token = rig_token_lookup(m_rig, "rig_pathname");
+    if (rig_set_conf(m_rig, token, serial_port) != RIG_OK) {
+        return false;
+    }
+    if (rig_open(m_rig) == RIG_OK) {
+        return true;
+    }
+    return false;
+}
+
+bool Hamlib::ptt(bool press) {
+       if(!m_rig)
+               return false;
+    /* TODO(Joel): make ON_DATA and ON configurable. */
+    ptt_t on = press ? RIG_PTT_ON : RIG_PTT_OFF;
+    /* TODO(Joel): what should the VFO option be? */
+    return rig_set_ptt(m_rig, RIG_VFO_CURR, on) == RIG_OK;
+}
+
+void Hamlib::close(void) {
+       if(m_rig) {
+               rig_close(m_rig);
+               rig_cleanup(m_rig);
+               m_rig = NULL;
+       }
+}
diff --git a/freedv/branches/0.97/src/hamlib.h b/freedv/branches/0.97/src/hamlib.h
new file mode 100644 (file)
index 0000000..fe3496f
--- /dev/null
@@ -0,0 +1,28 @@
+#ifndef HAMLIB_H
+#define HAMLIB_H
+
+extern "C" {
+#include <hamlib/rig.h>
+}
+#include <wx/combobox.h>
+#include <vector>
+
+class Hamlib {
+
+    public:
+        Hamlib();
+        ~Hamlib();
+        void populateComboBox(wxComboBox *cb);
+        bool connect(unsigned int rig_index, const char *serial_port);
+        bool ptt(bool press);
+        void close(void);
+
+        typedef std::vector<const struct rig_caps *> riglist_t;
+
+    private:
+        RIG *m_rig;
+        /* Sorted list of rigs. */
+        riglist_t m_rigList;
+};
+
+#endif /*HAMLIB_H*/
diff --git a/freedv/branches/0.97/src/sox.h b/freedv/branches/0.97/src/sox.h
new file mode 100644 (file)
index 0000000..07aedeb
--- /dev/null
@@ -0,0 +1,2608 @@
+/* libSoX Library Public Interface
+ *
+ * Copyright 1999-2011 Chris Bagwell and SoX Contributors.
+ *
+ * This source code is freely redistributable and may be used for
+ * any purpose.  This copyright notice must be maintained.
+ * Chris Bagwell And SoX Contributors are not responsible for
+ * the consequences of using this software.
+ */
+
+/** @file
+Contains the interface exposed to clients of the libSoX library.
+Symbols starting with "sox_" or "SOX_" are part of the public interface for
+libSoX clients (applications that consume libSoX). Symbols starting with
+"lsx_" or "LSX_" are internal use by libSoX and plugins.
+LSX_ and lsx_ symbols should not be used by libSoX-based applications.
+*/
+
+#ifndef SOX_H
+#define SOX_H /**< Client API: This macro is defined if sox.h has been included. */
+
+#include <limits.h>
+#include <stdarg.h>
+#include <stddef.h>
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+/* Suppress warnings from use of type long long. */
+#if defined __GNUC__
+#pragma GCC system_header
+#endif
+
+/*****************************************************************************
+API decoration macros:
+Mostly for documentation purposes. For some compilers, decorations also affect
+code generation, influence compiler warnings or activate compiler
+optimizations.
+*****************************************************************************/
+
+/**
+Plugins API:
+Attribute required on all functions exported by libSoX and on all function
+pointer types used by the libSoX API.
+*/
+#ifdef __GNUC__
+#define LSX_API  __attribute__ ((cdecl)) /* libSoX function */
+#elif _MSC_VER
+#define LSX_API  __cdecl /* libSoX function */
+#else
+#define LSX_API /* libSoX function */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter or local variable to suppress warnings about
+the variable being unused (especially in macro-generated code).
+*/
+#ifdef __GNUC__
+#define LSX_UNUSED  __attribute__ ((unused)) /* Parameter or local variable is intentionally unused. */
+#else
+#define LSX_UNUSED /* Parameter or local variable is intentionally unused. */
+#endif
+
+/**
+Plugins API:
+LSX_PRINTF12: Attribute applied to a function to indicate that it requires
+a printf-style format string for arg1 and that printf parameters start at
+arg2.
+*/
+#ifdef __GNUC__
+#define LSX_PRINTF12  __attribute__ ((format (printf, 1, 2))) /* Function has printf-style arguments. */
+#else
+#define LSX_PRINTF12 /* Function has printf-style arguments. */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a function to indicate that it has no side effects and
+depends only its input parameters and global memory. If called repeatedly, it
+returns the same result each time.
+*/
+#ifdef __GNUC__
+#define LSX_RETURN_PURE __attribute__ ((pure)) /* Function is pure. */
+#else
+#define LSX_RETURN_PURE /* Function is pure. */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a function to indicate that the
+return value is always a pointer to a valid object (never NULL).
+*/
+#ifdef _Ret_
+#define LSX_RETURN_VALID _Ret_ /* Function always returns a valid object (never NULL). */
+#else
+#define LSX_RETURN_VALID /* Function always returns a valid object (never NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a function to indicate that the return value is always a
+pointer to a valid array (never NULL).
+*/
+#ifdef _Ret_valid_
+#define LSX_RETURN_ARRAY _Ret_valid_ /* Function always returns a valid array (never NULL). */
+#else
+#define LSX_RETURN_ARRAY /* Function always returns a valid array (never NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a function to indicate that the return value is always a
+pointer to a valid 0-terminated array (never NULL).
+*/
+#ifdef _Ret_z_
+#define LSX_RETURN_VALID_Z _Ret_z_ /* Function always returns a 0-terminated array (never NULL). */
+#else
+#define LSX_RETURN_VALID_Z /* Function always returns a 0-terminated array (never NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a function to indicate that the returned pointer may be
+null.
+*/
+#ifdef _Ret_opt_
+#define LSX_RETURN_OPT _Ret_opt_ /* Function may return NULL. */
+#else
+#define LSX_RETURN_OPT /* Function may return NULL. */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a valid
+pointer to one const element of the pointed-to type (never NULL).
+*/
+#ifdef _In_
+#define LSX_PARAM_IN _In_ /* Required const pointer to a valid object (never NULL). */
+#else
+#define LSX_PARAM_IN /* Required const pointer to a valid object (never NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a valid
+pointer to a const 0-terminated string (never NULL).
+*/
+#ifdef _In_z_
+#define LSX_PARAM_IN_Z _In_z_ /* Required const pointer to 0-terminated string (never NULL). */
+#else
+#define LSX_PARAM_IN_Z /* Required const pointer to 0-terminated string (never NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a const
+pointer to a 0-terminated printf format string.
+*/
+#ifdef _Printf_format_string_
+#define LSX_PARAM_IN_PRINTF _Printf_format_string_ /* Required const pointer to 0-terminated printf format string (never NULL). */
+#else
+#define LSX_PARAM_IN_PRINTF /* Required const pointer to 0-terminated printf format string (never NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a valid
+pointer to (len) const initialized elements of the pointed-to type, where
+(len) is the name of another parameter.
+@param len The parameter that contains the number of elements in the array.
+*/
+#ifdef _In_count_
+#define LSX_PARAM_IN_COUNT(len) _In_count_(len) /* Required const pointer to (len) valid objects (never NULL). */
+#else
+#define LSX_PARAM_IN_COUNT(len) /* Required const pointer to (len) valid objects (never NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a valid
+pointer to (len) const bytes of initialized data, where (len) is the name of
+another parameter.
+@param len The parameter that contains the number of bytes in the array.
+*/
+#ifdef _In_bytecount_
+#define LSX_PARAM_IN_BYTECOUNT(len) _In_bytecount_(len) /* Required const pointer to (len) bytes of data (never NULL). */
+#else
+#define LSX_PARAM_IN_BYTECOUNT(len) /* Required const pointer to (len) bytes of data (never NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is either NULL
+or a valid pointer to one const element of the pointed-to type.
+*/
+#ifdef _In_opt_
+#define LSX_PARAM_IN_OPT _In_opt_ /* Optional const pointer to a valid object (may be NULL). */
+#else
+#define LSX_PARAM_IN_OPT /* Optional const pointer to a valid object (may be NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is either NULL
+or a valid pointer to a const 0-terminated string.
+*/
+#ifdef _In_opt_z_
+#define LSX_PARAM_IN_OPT_Z _In_opt_z_ /* Optional const pointer to 0-terminated string (may be NULL). */
+#else
+#define LSX_PARAM_IN_OPT_Z /* Optional const pointer to 0-terminated string (may be NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a valid
+pointer to one initialized element of the pointed-to type (never NULL). The
+function may modify the element.
+*/
+#ifdef _Inout_
+#define LSX_PARAM_INOUT _Inout_ /* Required pointer to a valid object (never NULL). */
+#else
+#define LSX_PARAM_INOUT /* Required pointer to a valid object (never NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a valid
+pointer to (len) initialized elements of the pointed-to type (never NULL). The
+function may modify the elements.
+@param len The parameter that contains the number of elements in the array.
+*/
+#ifdef _Inout_count_x_
+#define LSX_PARAM_INOUT_COUNT(len) _Inout_count_x_(len) /* Required pointer to (len) valid objects (never NULL). */
+#else
+#define LSX_PARAM_INOUT_COUNT(len) /* Required pointer to (len) valid objects (never NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a valid
+pointer to memory sufficient for one element of the pointed-to type (never
+NULL). The function will initialize the element.
+*/
+#ifdef _Out_
+#define LSX_PARAM_OUT _Out_ /* Required pointer to an object to be initialized (never NULL). */
+#else
+#define LSX_PARAM_OUT /* Required pointer to an object to be initialized (never NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a valid
+pointer to memory sufficient for (len) bytes of data (never NULL), where (len)
+is the name of another parameter. The function may write up to len bytes of
+data to this memory.
+@param len The parameter that contains the number of bytes in the array.
+*/
+#ifdef _Out_bytecap_
+#define LSX_PARAM_OUT_BYTECAP(len) _Out_bytecap_(len) /* Required pointer to writable buffer with room for len bytes. */
+#else
+#define LSX_PARAM_OUT_BYTECAP(len) /* Required pointer to writable buffer with room for len bytes. */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a valid
+pointer to memory sufficient for (len) elements of the pointed-to type (never
+NULL), where (len) is the name of another parameter. On return, (filled)
+elements will have been initialized, where (filled) is either the dereference
+of another pointer parameter (for example "*written") or the "return"
+parameter (indicating that the function returns the number of elements
+written).
+@param len The parameter that contains the number of elements in the array.
+@param filled The dereference of the parameter that receives the number of elements written to the array, or "return" if the value is returned.
+*/
+#ifdef _Out_cap_post_count_
+#define LSX_PARAM_OUT_CAP_POST_COUNT(len,filled) _Out_cap_post_count_(len,filled) /* Required pointer to buffer for (len) elements (never NULL); on return, (filled) elements will have been initialized. */
+#else
+#define LSX_PARAM_OUT_CAP_POST_COUNT(len,filled) /* Required pointer to buffer for (len) elements (never NULL); on return, (filled) elements will have been initialized. */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a valid
+pointer to memory sufficient for (len) elements of the pointed-to type (never
+NULL), where (len) is the name of another parameter. On return, (filled+1)
+elements will have been initialized, with the last element having been
+initialized to 0, where (filled) is either the dereference of another pointer
+parameter (for example, "*written") or the "return" parameter (indicating that
+the function returns the number of elements written).
+@param len The parameter that contains the number of elements in the array.
+@param filled The dereference of the parameter that receives the number of elements written to the array (not counting the terminating null), or "return" if the value is returned.
+*/
+#ifdef _Out_z_cap_post_count_
+#define LSX_PARAM_OUT_Z_CAP_POST_COUNT(len,filled) _Out_z_cap_post_count_(len,filled) /* Required pointer to buffer for (len) elements (never NULL); on return, (filled+1) elements will have been initialized, and the array will be 0-terminated. */
+#else
+#define LSX_PARAM_OUT_Z_CAP_POST_COUNT(len,filled) /* Required pointer to buffer for (len) elements (never NULL); on return, (filled+1) elements will have been initialized, and the array will be 0-terminated. */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is either NULL
+or a valid pointer to memory sufficient for one element of the pointed-to
+type. The function will initialize the element.
+*/
+#ifdef _Out_opt_
+#define LSX_PARAM_OUT_OPT _Out_opt_ /* Optional pointer to an object to be initialized (may be NULL). */
+#else
+#define LSX_PARAM_OUT_OPT /* Optional pointer to an object to be initialized (may be NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a valid
+pointer (never NULL) to another pointer which may be NULL when the function is
+invoked.
+*/
+#ifdef _Deref_pre_maybenull_
+#define LSX_PARAM_DEREF_PRE_MAYBENULL _Deref_pre_maybenull_ /* Required pointer (never NULL) to another pointer (may be NULL). */
+#else
+#define LSX_PARAM_DEREF_PRE_MAYBENULL /* Required pointer (never NULL) to another pointer (may be NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a valid
+pointer (never NULL) to another pointer which will be NULL when the function
+returns.
+*/
+#ifdef _Deref_post_null_
+#define LSX_PARAM_DEREF_POST_NULL _Deref_post_null_ /* Required pointer (never NULL) to another pointer, which will be NULL on exit. */
+#else
+#define LSX_PARAM_DEREF_POST_NULL /* Required pointer (never NULL) to another pointer, which will be NULL on exit. */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a valid
+pointer (never NULL) to another pointer which will be non-NULL when the
+function returns.
+*/
+#ifdef _Deref_post_notnull_
+#define LSX_PARAM_DEREF_POST_NOTNULL _Deref_post_notnull_ /* Required pointer (never NULL) to another pointer, which will be valid (not NULL) on exit. */
+#else
+#define LSX_PARAM_DEREF_POST_NOTNULL /* Required pointer (never NULL) to another pointer, which will be valid (not NULL) on exit. */
+#endif
+
+/**
+Plugins API:
+Expression that "uses" a potentially-unused variable to avoid compiler
+warnings (especially in macro-generated code).
+*/
+#ifdef _PREFAST_
+#define LSX_USE_VAR(x)  ((void)(x=0)) /* During static analysis, initialize unused variables to 0. */
+#else
+#define LSX_USE_VAR(x)  ((void)(x)) /* Parameter or variable is intentionally unused. */
+#endif
+
+/**
+Plugins API:
+Compile-time assertion. Causes a compile error if the expression is false.
+@param e  The expression to test. If expression is false, compilation will fail.
+@param f  A unique identifier for the test, for example foo_must_not_be_zero.
+*/
+#define lsx_static_assert(e,f) enum {lsx_static_assert_##f = 1/((e) ? 1 : 0)}
+
+/*****************************************************************************
+Basic typedefs:
+*****************************************************************************/
+
+/**
+Client API:
+Signed twos-complement 8-bit type. Typically defined as signed char.
+*/
+#if SCHAR_MAX==127 && SCHAR_MIN==(-128)
+typedef signed char sox_int8_t;
+#elif CHAR_MAX==127 && CHAR_MIN==(-128)
+typedef char sox_int8_t;
+#else
+#error Unable to determine an appropriate definition for sox_int8_t.
+#endif
+
+/**
+Client API:
+Unsigned 8-bit type. Typically defined as unsigned char.
+*/
+#if UCHAR_MAX==0xff
+typedef unsigned char sox_uint8_t;
+#elif CHAR_MAX==0xff && CHAR_MIN==0
+typedef char sox_uint8_t;
+#else
+#error Unable to determine an appropriate definition for sox_uint8_t.
+#endif
+
+/**
+Client API:
+Signed twos-complement 16-bit type. Typically defined as short.
+*/
+#if SHRT_MAX==32767 && SHRT_MIN==(-32768)
+typedef short sox_int16_t;
+#elif INT_MAX==32767 && INT_MIN==(-32768)
+typedef int sox_int16_t;
+#else
+#error Unable to determine an appropriate definition for sox_int16_t.
+#endif
+
+/**
+Client API:
+Unsigned 16-bit type. Typically defined as unsigned short.
+*/
+#if USHRT_MAX==0xffff
+typedef unsigned short sox_uint16_t;
+#elif UINT_MAX==0xffff
+typedef unsigned int sox_uint16_t;
+#else
+#error Unable to determine an appropriate definition for sox_uint16_t.
+#endif
+
+/**
+Client API:
+Signed twos-complement 32-bit type. Typically defined as int.
+*/
+#if INT_MAX==2147483647 && INT_MIN==(-2147483647-1)
+typedef int sox_int32_t;
+#elif LONG_MAX==2147483647 && LONG_MIN==(-2147483647-1)
+typedef long sox_int32_t;
+#else
+#error Unable to determine an appropriate definition for sox_int32_t.
+#endif
+
+/**
+Client API:
+Unsigned 32-bit type. Typically defined as unsigned int.
+*/
+#if UINT_MAX==0xffffffff
+typedef unsigned int sox_uint32_t;
+#elif ULONG_MAX==0xffffffff
+typedef unsigned long sox_uint32_t;
+#else
+#error Unable to determine an appropriate definition for sox_uint32_t.
+#endif
+
+/**
+Client API:
+Signed twos-complement 64-bit type. Typically defined as long or long long.
+*/
+#if LONG_MAX==9223372036854775807 && LONG_MIN==(-9223372036854775807-1)
+typedef long sox_int64_t;
+#elif defined(_MSC_VER)
+typedef __int64 sox_int64_t;
+#else
+typedef long long sox_int64_t;
+#endif
+
+/**
+Client API:
+Unsigned 64-bit type. Typically defined as unsigned long or unsigned long long.
+*/
+#if ULONG_MAX==0xffffffffffffffff
+typedef unsigned long sox_uint64_t;
+#elif defined(_MSC_VER)
+typedef unsigned __int64 sox_uint64_t;
+#else
+typedef unsigned long long sox_uint64_t;
+#endif
+
+#ifndef _DOXYGEN_
+lsx_static_assert(sizeof(sox_int8_t)==1,   sox_int8_size);
+lsx_static_assert(sizeof(sox_uint8_t)==1,  sox_uint8_size);
+lsx_static_assert(sizeof(sox_int16_t)==2,  sox_int16_size);
+lsx_static_assert(sizeof(sox_uint16_t)==2, sox_uint16_size);
+lsx_static_assert(sizeof(sox_int32_t)==4,  sox_int32_size);
+lsx_static_assert(sizeof(sox_uint32_t)==4, sox_uint32_size);
+lsx_static_assert(sizeof(sox_int64_t)==8,  sox_int64_size);
+lsx_static_assert(sizeof(sox_uint64_t)==8, sox_uint64_size);
+#endif
+
+/**
+Client API:
+Alias for sox_int32_t (beware of the extra byte).
+*/
+typedef sox_int32_t sox_int24_t;
+
+/**
+Client API:
+Alias for sox_uint32_t (beware of the extra byte).
+*/
+typedef sox_uint32_t sox_uint24_t;
+
+/**
+Client API:
+Native SoX audio sample type (alias for sox_int32_t).
+*/
+typedef sox_int32_t sox_sample_t;
+
+/**
+Client API:
+Samples per second is stored as a double.
+*/
+typedef double sox_rate_t;
+
+/**
+Client API:
+File's metadata, access via sox_*_comments functions.
+*/
+typedef char * * sox_comments_t;
+
+/*****************************************************************************
+Enumerations:
+*****************************************************************************/
+
+/**
+Client API:
+Boolean type, assignment (but not necessarily binary) compatible with C++ bool.
+*/
+typedef enum sox_bool {
+    sox_false, /**< False = 0. */
+    sox_true   /**< True = 1. */
+} sox_bool;
+
+/**
+Client API:
+no, yes, or default (default usually implies some kind of auto-detect logic).
+*/
+typedef enum sox_option_t {
+    sox_option_no,      /**< Option specified as no = 0. */
+    sox_option_yes,     /**< Option specified as yes = 1. */
+    sox_option_default  /**< Option unspecified = 2. */
+} sox_option_t;
+
+/**
+Client API:
+The libSoX-specific error codes.
+libSoX functions may return these codes or others that map from errno codes.
+*/
+enum sox_error_t {
+  SOX_SUCCESS = 0,     /**< Function succeeded = 0 */
+  SOX_EOF = -1,        /**< End Of File or other error = -1 */
+  SOX_EHDR = 2000,     /**< Invalid Audio Header = 2000 */
+  SOX_EFMT,            /**< Unsupported data format = 2001 */
+  SOX_ENOMEM,          /**< Can't alloc memory = 2002 */
+  SOX_EPERM,           /**< Operation not permitted = 2003 */
+  SOX_ENOTSUP,         /**< Operation not supported = 2004 */
+  SOX_EINVAL           /**< Invalid argument = 2005 */
+};
+
+/**
+Client API:
+Flags indicating whether optional features are present in this build of libSoX.
+*/
+typedef enum sox_version_flags_t {
+    sox_version_none = 0,         /**< No special features = 0. */
+    sox_version_have_popen = 1,   /**< popen = 1. */
+    sox_version_have_magic = 2,   /**< magic = 2. */
+    sox_version_have_threads = 4, /**< threads = 4. */
+    sox_version_have_memopen = 8  /**< memopen = 8. */
+} sox_version_flags_t;
+
+/**
+Client API:
+Format of sample data.
+*/
+typedef enum sox_encoding_t {
+  SOX_ENCODING_UNKNOWN   , /**< encoding has not yet been determined */
+
+  SOX_ENCODING_SIGN2     , /**< signed linear 2's comp: Mac */
+  SOX_ENCODING_UNSIGNED  , /**< unsigned linear: Sound Blaster */
+  SOX_ENCODING_FLOAT     , /**< floating point (binary format) */
+  SOX_ENCODING_FLOAT_TEXT, /**< floating point (text format) */
+  SOX_ENCODING_FLAC      , /**< FLAC compression */
+  SOX_ENCODING_HCOM      , /**< Mac FSSD files with Huffman compression */
+  SOX_ENCODING_WAVPACK   , /**< WavPack with integer samples */
+  SOX_ENCODING_WAVPACKF  , /**< WavPack with float samples */
+  SOX_ENCODING_ULAW      , /**< u-law signed logs: US telephony, SPARC */
+  SOX_ENCODING_ALAW      , /**< A-law signed logs: non-US telephony, Psion */
+  SOX_ENCODING_G721      , /**< G.721 4-bit ADPCM */
+  SOX_ENCODING_G723      , /**< G.723 3 or 5 bit ADPCM */
+  SOX_ENCODING_CL_ADPCM  , /**< Creative Labs 8 --> 2,3,4 bit Compressed PCM */
+  SOX_ENCODING_CL_ADPCM16, /**< Creative Labs 16 --> 4 bit Compressed PCM */
+  SOX_ENCODING_MS_ADPCM  , /**< Microsoft Compressed PCM */
+  SOX_ENCODING_IMA_ADPCM , /**< IMA Compressed PCM */
+  SOX_ENCODING_OKI_ADPCM , /**< Dialogic/OKI Compressed PCM */
+  SOX_ENCODING_DPCM      , /**< Differential PCM: Fasttracker 2 (xi) */
+  SOX_ENCODING_DWVW      , /**< Delta Width Variable Word */
+  SOX_ENCODING_DWVWN     , /**< Delta Width Variable Word N-bit */
+  SOX_ENCODING_GSM       , /**< GSM 6.10 33byte frame lossy compression */
+  SOX_ENCODING_MP3       , /**< MP3 compression */
+  SOX_ENCODING_VORBIS    , /**< Vorbis compression */
+  SOX_ENCODING_AMR_WB    , /**< AMR-WB compression */
+  SOX_ENCODING_AMR_NB    , /**< AMR-NB compression */
+  SOX_ENCODING_CVSD      , /**< Continuously Variable Slope Delta modulation */
+  SOX_ENCODING_LPC10     , /**< Linear Predictive Coding */
+
+  SOX_ENCODINGS            /**< End of list marker */
+} sox_encoding_t;
+
+/**
+Client API:
+Flags for sox_encodings_info_t: lossless/lossy1/lossy2.
+*/
+typedef enum sox_encodings_flags_t {
+  sox_encodings_none   = 0, /**< no flags specified (implies lossless encoding) = 0. */
+  sox_encodings_lossy1 = 1, /**< encode, decode: lossy once = 1. */
+  sox_encodings_lossy2 = 2  /**< encode, decode, encode, decode: lossy twice = 2. */
+} sox_encodings_flags_t;
+
+/**
+Client API:
+Type of plot.
+*/
+typedef enum sox_plot_t {
+    sox_plot_off,     /**< No plot = 0. */
+    sox_plot_octave,  /**< Octave plot = 1. */
+    sox_plot_gnuplot, /**< Gnuplot plot = 2. */
+    sox_plot_data     /**< Plot data = 3. */
+} sox_plot_t;
+
+/**
+Client API:
+Loop modes: upper 4 bits mask the loop blass, lower 4 bits describe
+the loop behaviour, for example single shot, bidirectional etc.
+*/
+enum sox_loop_flags_t {
+  sox_loop_none = 0,          /**< single-shot = 0 */
+  sox_loop_forward = 1,       /**< forward loop = 1 */
+  sox_loop_forward_back = 2,  /**< forward/back loop = 2 */
+  sox_loop_8 = 32,            /**< 8 loops (??) = 32 */
+  sox_loop_sustain_decay = 64 /**< AIFF style, one sustain & one decay loop = 64 */
+};
+
+/**
+Plugins API:
+Is file a real file, a pipe, or a url?
+*/
+typedef enum lsx_io_type
+{
+    lsx_io_file, /**< File is a real file = 0. */
+    lsx_io_pipe, /**< File is a pipe (no seeking) = 1. */
+    lsx_io_url   /**< File is a URL (no seeking) = 2. */
+} lsx_io_type;
+
+/*****************************************************************************
+Macros:
+*****************************************************************************/
+
+/**
+Client API:
+Compute a 32-bit integer API version from three 8-bit parts.
+@param a Major version.
+@param b Minor version.
+@param c Revision or build number.
+@returns 32-bit integer API version 0x000a0b0c.
+*/
+#define SOX_LIB_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
+
+/**
+Client API:
+The API version of the sox.h file. It is not meant to follow the version
+number of SoX but it has historically. Please do not count on
+SOX_LIB_VERSION_CODE staying in sync with the libSoX version.
+*/
+#define SOX_LIB_VERSION_CODE   SOX_LIB_VERSION(14, 4, 0)
+
+/**
+Client API:
+Returns the smallest (negative) value storable in a twos-complement signed
+integer with the specified number of bits, cast to an unsigned integer;
+for example, SOX_INT_MIN(8) = 0x80, SOX_INT_MIN(16) = 0x8000, etc.
+@param bits Size of value for which to calculate minimum.
+@returns the smallest (negative) value storable in a twos-complement signed
+integer with the specified number of bits, cast to an unsigned integer.
+*/
+#define SOX_INT_MIN(bits) (1 <<((bits)-1))
+
+/**
+Client API:
+Returns the largest (positive) value storable in a twos-complement signed
+integer with the specified number of bits, cast to an unsigned integer;
+for example, SOX_INT_MAX(8) = 0x7F, SOX_INT_MAX(16) = 0x7FFF, etc.
+@param bits Size of value for which to calculate maximum.
+@returns the largest (positive) value storable in a twos-complement signed
+integer with the specified number of bits, cast to an unsigned integer.
+*/
+#define SOX_INT_MAX(bits) (((unsigned)-1)>>(33-(bits)))
+
+/**
+Client API:
+Returns the largest value storable in an unsigned integer with the specified
+number of bits; for example, SOX_UINT_MAX(8) = 0xFF,
+SOX_UINT_MAX(16) = 0xFFFF, etc.
+@param bits Size of value for which to calculate maximum.
+@returns the largest value storable in an unsigned integer with the specified
+number of bits.
+*/
+#define SOX_UINT_MAX(bits) (SOX_INT_MIN(bits)|SOX_INT_MAX(bits))
+
+/**
+Client API:
+Returns 0x7F.
+*/
+#define SOX_INT8_MAX  SOX_INT_MAX(8)
+
+/**
+Client API:
+Returns 0x7FFF.
+*/
+#define SOX_INT16_MAX SOX_INT_MAX(16)
+
+/**
+Client API:
+Returns 0x7FFFFF.
+*/
+#define SOX_INT24_MAX SOX_INT_MAX(24)
+
+/**
+Client API:
+Returns 0x7FFFFFFF.
+*/
+#define SOX_INT32_MAX SOX_INT_MAX(32)
+
+/**
+Client API:
+Bits in a sox_sample_t = 32.
+*/
+#define SOX_SAMPLE_PRECISION 32
+
+/**
+Client API:
+Max value for sox_sample_t = 0x7FFFFFFF.
+*/
+#define SOX_SAMPLE_MAX (sox_sample_t)SOX_INT_MAX(32)
+
+/**
+Client API:
+Min value for sox_sample_t = 0x80000000.
+*/
+#define SOX_SAMPLE_MIN (sox_sample_t)SOX_INT_MIN(32)
+
+
+/*                Conversions: Linear PCM <--> sox_sample_t
+ *
+ *   I/O      Input    sox_sample_t Clips?   Input    sox_sample_t Clips?
+ *  Format   Minimum     Minimum     I O    Maximum     Maximum     I O
+ *  ------  ---------  ------------ -- --   --------  ------------ -- --
+ *  Float     -inf         -1        y n      inf      1 - 5e-10    y n
+ *  Int8      -128        -128       n n      127     127.9999999   n y
+ *  Int16    -32768      -32768      n n     32767    32767.99998   n y
+ *  Int24   -8388608    -8388608     n n    8388607   8388607.996   n y
+ *  Int32  -2147483648 -2147483648   n n   2147483647 2147483647    n n
+ *
+ * Conversions are as accurate as possible (with rounding).
+ *
+ * Rounding: halves toward +inf, all others to nearest integer.
+ *
+ * Clips? shows whether on not there is the possibility of a conversion
+ * clipping to the minimum or maximum value when inputing from or outputing
+ * to a given type.
+ *
+ * Unsigned integers are converted to and from signed integers by flipping
+ * the upper-most bit then treating them as signed integers.
+ */
+
+/**
+Client API:
+Declares the temporary local variables that are required when using SOX
+conversion macros.
+*/
+#define SOX_SAMPLE_LOCALS sox_sample_t sox_macro_temp_sample LSX_UNUSED; \
+  double sox_macro_temp_double LSX_UNUSED
+
+/**
+Client API:
+Sign bit for sox_sample_t = 0x80000000.
+*/
+#define SOX_SAMPLE_NEG SOX_INT_MIN(32)
+
+/**
+Client API:
+Converts sox_sample_t to an unsigned integer of width (bits).
+@param bits  Width of resulting sample (1 through 32).
+@param d     Input sample to be converted.
+@param clips Variable that is incremented if the result is too big.
+@returns Unsigned integer of width (bits).
+*/
+#define SOX_SAMPLE_TO_UNSIGNED(bits,d,clips) \
+  (sox_uint##bits##_t)(SOX_SAMPLE_TO_SIGNED(bits,d,clips)^SOX_INT_MIN(bits))
+
+/**
+Client API:
+Converts sox_sample_t to a signed integer of width (bits).
+@param bits  Width of resulting sample (1 through 32).
+@param d     Input sample to be converted.
+@param clips Variable that is incremented if the result is too big.
+@returns Signed integer of width (bits).
+*/
+#define SOX_SAMPLE_TO_SIGNED(bits,d,clips) \
+  (sox_int##bits##_t)(LSX_USE_VAR(sox_macro_temp_double),sox_macro_temp_sample=(d),sox_macro_temp_sample>SOX_SAMPLE_MAX-(1<<(31-bits))?++(clips),SOX_INT_MAX(bits):((sox_uint32_t)(sox_macro_temp_sample+(1<<(31-bits))))>>(32-bits))
+
+/**
+Client API:
+Converts signed integer of width (bits) to sox_sample_t.
+@param bits Width of input sample (1 through 32).
+@param d    Input sample to be converted.
+@returns SoX native sample value.
+*/
+#define SOX_SIGNED_TO_SAMPLE(bits,d)((sox_sample_t)(d)<<(32-bits))
+
+/**
+Client API:
+Converts unsigned integer of width (bits) to sox_sample_t.
+@param bits Width of input sample (1 through 32).
+@param d    Input sample to be converted.
+@returns SoX native sample value.
+*/
+#define SOX_UNSIGNED_TO_SAMPLE(bits,d)(SOX_SIGNED_TO_SAMPLE(bits,d)^SOX_SAMPLE_NEG)
+
+/**
+Client API:
+Converts unsigned 8-bit integer to sox_sample_t.
+@param d     Input sample to be converted.
+@param clips The parameter is not used.
+@returns SoX native sample value.
+*/
+#define SOX_UNSIGNED_8BIT_TO_SAMPLE(d,clips) SOX_UNSIGNED_TO_SAMPLE(8,d)
+
+/**
+Client API:
+Converts signed 8-bit integer to sox_sample_t.
+@param d    Input sample to be converted.
+@param clips The parameter is not used.
+@returns SoX native sample value.
+*/
+#define SOX_SIGNED_8BIT_TO_SAMPLE(d,clips) SOX_SIGNED_TO_SAMPLE(8,d)
+
+/**
+Client API:
+Converts unsigned 16-bit integer to sox_sample_t.
+@param d     Input sample to be converted.
+@param clips The parameter is not used.
+@returns SoX native sample value.
+*/
+#define SOX_UNSIGNED_16BIT_TO_SAMPLE(d,clips) SOX_UNSIGNED_TO_SAMPLE(16,d)
+
+/**
+Client API:
+Converts signed 16-bit integer to sox_sample_t.
+@param d    Input sample to be converted.
+@param clips The parameter is not used.
+@returns SoX native sample value.
+*/
+#define SOX_SIGNED_16BIT_TO_SAMPLE(d,clips) SOX_SIGNED_TO_SAMPLE(16,d)
+
+/**
+Client API:
+Converts unsigned 24-bit integer to sox_sample_t.
+@param d     Input sample to be converted.
+@param clips The parameter is not used.
+@returns SoX native sample value.
+*/
+#define SOX_UNSIGNED_24BIT_TO_SAMPLE(d,clips) SOX_UNSIGNED_TO_SAMPLE(24,d)
+
+/**
+Client API:
+Converts signed 24-bit integer to sox_sample_t.
+@param d    Input sample to be converted.
+@param clips The parameter is not used.
+@returns SoX native sample value.
+*/
+#define SOX_SIGNED_24BIT_TO_SAMPLE(d,clips) SOX_SIGNED_TO_SAMPLE(24,d)
+
+/**
+Client API:
+Converts unsigned 32-bit integer to sox_sample_t.
+@param d     Input sample to be converted.
+@param clips The parameter is not used.
+@returns SoX native sample value.
+*/
+#define SOX_UNSIGNED_32BIT_TO_SAMPLE(d,clips) ((sox_sample_t)(d)^SOX_SAMPLE_NEG)
+
+/**
+Client API:
+Converts signed 32-bit integer to sox_sample_t.
+@param d    Input sample to be converted.
+@param clips The parameter is not used.
+@returns SoX native sample value.
+*/
+#define SOX_SIGNED_32BIT_TO_SAMPLE(d,clips) (sox_sample_t)(d)
+
+/**
+Client API:
+Converts 32-bit float to sox_sample_t.
+@param d     Input sample to be converted, range [-1, 1).
+@param clips Variable to increment if the input sample is too large or too small.
+@returns SoX native sample value.
+*/
+#define SOX_FLOAT_32BIT_TO_SAMPLE(d,clips) (sox_sample_t)(LSX_USE_VAR(sox_macro_temp_sample),sox_macro_temp_double=(d)*(SOX_SAMPLE_MAX+1.),sox_macro_temp_double<SOX_SAMPLE_MIN?++(clips),SOX_SAMPLE_MIN:sox_macro_temp_double>=SOX_SAMPLE_MAX+1.?sox_macro_temp_double>SOX_SAMPLE_MAX+1.?++(clips),SOX_SAMPLE_MAX:SOX_SAMPLE_MAX:sox_macro_temp_double)
+
+/**
+Client API:
+Converts 64-bit float to sox_sample_t.
+@param d     Input sample to be converted, range [-1, 1).
+@param clips Variable to increment if the input sample is too large or too small.
+@returns SoX native sample value.
+*/
+#define SOX_FLOAT_64BIT_TO_SAMPLE(d,clips) (sox_sample_t)(LSX_USE_VAR(sox_macro_temp_sample),sox_macro_temp_double=(d)*(SOX_SAMPLE_MAX+1.),sox_macro_temp_double<0?sox_macro_temp_double<=SOX_SAMPLE_MIN-.5?++(clips),SOX_SAMPLE_MIN:sox_macro_temp_double-.5:sox_macro_temp_double>=SOX_SAMPLE_MAX+.5?sox_macro_temp_double>SOX_SAMPLE_MAX+1.?++(clips),SOX_SAMPLE_MAX:SOX_SAMPLE_MAX:sox_macro_temp_double+.5)
+
+/**
+Client API:
+Converts SoX native sample to an unsigned 8-bit integer.
+@param d Input sample to be converted.
+@param clips Variable to increment if input sample is too large.
+*/
+#define SOX_SAMPLE_TO_UNSIGNED_8BIT(d,clips) SOX_SAMPLE_TO_UNSIGNED(8,d,clips)
+
+/**
+Client API:
+Converts SoX native sample to an signed 8-bit integer.
+@param d Input sample to be converted.
+@param clips Variable to increment if input sample is too large.
+*/
+#define SOX_SAMPLE_TO_SIGNED_8BIT(d,clips) SOX_SAMPLE_TO_SIGNED(8,d,clips)
+
+/**
+Client API:
+Converts SoX native sample to an unsigned 16-bit integer.
+@param d Input sample to be converted.
+@param clips Variable to increment if input sample is too large.
+*/
+#define SOX_SAMPLE_TO_UNSIGNED_16BIT(d,clips) SOX_SAMPLE_TO_UNSIGNED(16,d,clips)
+
+/**
+Client API:
+Converts SoX native sample to a signed 16-bit integer.
+@param d Input sample to be converted.
+@param clips Variable to increment if input sample is too large.
+*/
+#define SOX_SAMPLE_TO_SIGNED_16BIT(d,clips) SOX_SAMPLE_TO_SIGNED(16,d,clips)
+
+/**
+Client API:
+Converts SoX native sample to an unsigned 24-bit integer.
+@param d Input sample to be converted.
+@param clips Variable to increment if input sample is too large.
+*/
+#define SOX_SAMPLE_TO_UNSIGNED_24BIT(d,clips) SOX_SAMPLE_TO_UNSIGNED(24,d,clips)
+
+/**
+Client API:
+Converts SoX native sample to a signed 24-bit integer.
+@param d Input sample to be converted.
+@param clips Variable to increment if input sample is too large.
+*/
+#define SOX_SAMPLE_TO_SIGNED_24BIT(d,clips) SOX_SAMPLE_TO_SIGNED(24,d,clips)
+
+/**
+Client API:
+Converts SoX native sample to an unsigned 32-bit integer.
+@param d Input sample to be converted.
+@param clips The parameter is not used.
+*/
+#define SOX_SAMPLE_TO_UNSIGNED_32BIT(d,clips) (sox_uint32_t)((d)^SOX_SAMPLE_NEG)
+
+/**
+Client API:
+Converts SoX native sample to a signed 32-bit integer.
+@param d Input sample to be converted.
+@param clips The parameter is not used.
+*/
+#define SOX_SAMPLE_TO_SIGNED_32BIT(d,clips) (sox_int32_t)(d)
+
+/**
+Client API:
+Converts SoX native sample to a 32-bit float.
+@param d Input sample to be converted.
+@param clips Variable to increment if input sample is too large.
+*/
+#define SOX_SAMPLE_TO_FLOAT_32BIT(d,clips) (LSX_USE_VAR(sox_macro_temp_double),sox_macro_temp_sample=(d),sox_macro_temp_sample>SOX_SAMPLE_MAX-128?++(clips),1:(((sox_macro_temp_sample+128)&~255)*(1./(SOX_SAMPLE_MAX+1.))))
+
+/**
+Client API:
+Converts SoX native sample to a 64-bit float.
+@param d Input sample to be converted.
+@param clips The parameter is not used.
+*/
+#define SOX_SAMPLE_TO_FLOAT_64BIT(d,clips) ((d)*(1./(SOX_SAMPLE_MAX+1.)))
+
+/**
+Client API:
+Clips a value of a type that is larger then sox_sample_t (for example, int64)
+to sox_sample_t's limits and increment a counter if clipping occurs.
+@param samp Value (lvalue) to be clipped, updated as necessary.
+@param clips Value (lvalue) that is incremented if clipping is needed.
+*/
+#define SOX_SAMPLE_CLIP_COUNT(samp, clips) \
+  do { \
+    if (samp > SOX_SAMPLE_MAX) \
+      { samp = SOX_SAMPLE_MAX; clips++; } \
+    else if (samp < SOX_SAMPLE_MIN) \
+      { samp = SOX_SAMPLE_MIN; clips++; } \
+  } while (0)
+
+/**
+Client API:
+Clips a value of a type that is larger then sox_sample_t (for example, int64)
+to sox_sample_t's limits and increment a counter if clipping occurs.
+@param d Value (rvalue) to be clipped.
+@param clips Value (lvalue) that is incremented if clipping is needed.
+@returns Clipped value.
+*/
+#define SOX_ROUND_CLIP_COUNT(d, clips) \
+  ((d) < 0? (d) <= SOX_SAMPLE_MIN - 0.5? ++(clips), SOX_SAMPLE_MIN: (d) - 0.5 \
+        : (d) >= SOX_SAMPLE_MAX + 0.5? ++(clips), SOX_SAMPLE_MAX: (d) + 0.5)
+
+/**
+Client API:
+Clips a value to the limits of a signed integer of the specified width
+and increment a counter if clipping occurs.
+@param bits Width (in bits) of target integer type.
+@param i Value (rvalue) to be clipped.
+@param clips Value (lvalue) that is incremented if clipping is needed.
+@returns Clipped value.
+*/
+#define SOX_INTEGER_CLIP_COUNT(bits,i,clips) ( \
+  (i) >(1 << ((bits)-1))- 1? ++(clips),(1 << ((bits)-1))- 1 : \
+  (i) <-1 << ((bits)-1)    ? ++(clips),-1 << ((bits)-1) : (i))
+
+/**
+Client API:
+Clips a value to the limits of a 16-bit signed integer and increment a counter
+if clipping occurs.
+@param i Value (rvalue) to be clipped.
+@param clips Value (lvalue) that is incremented if clipping is needed.
+@returns Clipped value.
+*/
+#define SOX_16BIT_CLIP_COUNT(i,clips) SOX_INTEGER_CLIP_COUNT(16,i,clips)
+
+/**
+Client API:
+Clips a value to the limits of a 24-bit signed integer and increment a counter
+if clipping occurs.
+@param i Value (rvalue) to be clipped.
+@param clips Value (lvalue) that is incremented if clipping is needed.
+@returns Clipped value.
+*/
+#define SOX_24BIT_CLIP_COUNT(i,clips) SOX_INTEGER_CLIP_COUNT(24,i,clips)
+
+#define SOX_SIZE_MAX ((size_t)(-1)) /**< Client API: Maximum value of size_t. */
+
+#define SOX_UNSPEC 0                         /**< Client API: Members of sox_signalinfo_t are set to SOX_UNSPEC (= 0) if the actual value is not yet known. */
+#define SOX_UNKNOWN_LEN (sox_uint64_t)(-1) /**< Client API: sox_signalinfo_t.length is set to SOX_UNKNOWN_LEN (= -1) within the effects chain if the actual length is not known. Format handlers currently use SOX_UNSPEC instead. */
+#define SOX_IGNORE_LENGTH (sox_uint64_t)(-2) /**< Client API: sox_signalinfo_t.length is set to SOX_IGNORE_LENGTH (= -2) to indicate that a format handler should ignore length information in file headers. */
+
+#define SOX_DEFAULT_CHANNELS  2     /**< Client API: Default channel count is 2 (stereo). */
+#define SOX_DEFAULT_RATE      48000 /**< Client API: Default rate is 48000Hz. */
+#define SOX_DEFAULT_PRECISION 16    /**< Client API: Default precision is 16 bits per sample. */
+#define SOX_DEFAULT_ENCODING  SOX_ENCODING_SIGN2 /**< Client API: Default encoding is SIGN2 (linear 2's complement PCM). */
+
+#define SOX_LOOP_NONE          ((unsigned char)sox_loop_none)          /**< Client API: single-shot = 0 */
+#define SOX_LOOP_8             ((unsigned char)sox_loop_8)             /**< Client API: 8 loops = 32 */
+#define SOX_LOOP_SUSTAIN_DECAY ((unsigned char)sox_loop_sustain_decay) /**< Client API: AIFF style, one sustain & one decay loop = 64 */
+
+#define SOX_MAX_NLOOPS         8 /**< Client API: Maximum number of loops supported by sox_oob_t = 8. */
+
+#define SOX_FILE_NOSTDIO 0x0001 /**< Client API: Does not use stdio routines */
+#define SOX_FILE_DEVICE  0x0002 /**< Client API: File is an audio device */
+#define SOX_FILE_PHONY   0x0004 /**< Client API: Phony file/device (for example /dev/null) */
+#define SOX_FILE_REWIND  0x0008 /**< Client API: File should be rewound to write header */
+#define SOX_FILE_BIT_REV 0x0010 /**< Client API: Is file bit-reversed? */
+#define SOX_FILE_NIB_REV 0x0020 /**< Client API: Is file nibble-reversed? */
+#define SOX_FILE_ENDIAN  0x0040 /**< Client API: Is file format endian? */
+#define SOX_FILE_ENDBIG  0x0080 /**< Client API: For endian file format, is it big endian? */
+#define SOX_FILE_MONO    0x0100 /**< Client API: Do channel restrictions allow mono? */
+#define SOX_FILE_STEREO  0x0200 /**< Client API: Do channel restrictions allow stereo? */
+#define SOX_FILE_QUAD    0x0400 /**< Client API: Do channel restrictions allow quad? */
+
+#define SOX_FILE_CHANS   (SOX_FILE_MONO | SOX_FILE_STEREO | SOX_FILE_QUAD) /**< Client API: No channel restrictions */
+#define SOX_FILE_LIT_END (SOX_FILE_ENDIAN | 0)                             /**< Client API: File is little-endian */
+#define SOX_FILE_BIG_END (SOX_FILE_ENDIAN | SOX_FILE_ENDBIG)               /**< Client API: File is big-endian */
+
+#define SOX_EFF_CHAN     1           /**< Client API: Effect might alter the number of channels */
+#define SOX_EFF_RATE     2           /**< Client API: Effect might alter sample rate */
+#define SOX_EFF_PREC     4           /**< Client API: Effect does its own calculation of output sample precision (otherwise a default value is taken, depending on the presence of SOX_EFF_MODIFY) */
+#define SOX_EFF_LENGTH   8           /**< Client API: Effect might alter audio length (as measured in time units, not necessarily in samples) */
+#define SOX_EFF_MCHAN    16          /**< Client API: Effect handles multiple channels internally */
+#define SOX_EFF_NULL     32          /**< Client API: Effect does nothing (can be optimized out of chain) */
+#define SOX_EFF_DEPRECATED 64        /**< Client API: Effect will soon be removed from SoX */
+#define SOX_EFF_GAIN     128         /**< Client API: Effect does not support gain -r */
+#define SOX_EFF_MODIFY   256         /**< Client API: Effect does not modify sample values (but might remove or duplicate samples or insert zeros) */
+#define SOX_EFF_ALPHA    512         /**< Client API: Effect is experimental/incomplete */
+#define SOX_EFF_INTERNAL 1024        /**< Client API: Effect present in libSoX but not valid for use by SoX command-line tools */
+
+/**
+Client API:
+When used as the "whence" parameter of sox_seek, indicates that the specified
+offset is relative to the beginning of the file.
+*/
+#define SOX_SEEK_SET 0
+
+/*****************************************************************************
+Forward declarations:
+*****************************************************************************/
+
+typedef struct sox_format_t sox_format_t;
+typedef struct sox_effect_t sox_effect_t;
+typedef struct sox_effect_handler_t sox_effect_handler_t;
+typedef struct sox_format_handler_t sox_format_handler_t;
+
+/*****************************************************************************
+Function pointers:
+*****************************************************************************/
+
+/**
+Client API:
+Callback to write a message to an output device (console or log file),
+used by sox_globals_t.output_message_handler.
+*/
+typedef void (LSX_API * sox_output_message_handler_t)(
+    unsigned level,                       /* 1 = FAIL, 2 = WARN, 3 = INFO, 4 = DEBUG, 5 = DEBUG_MORE, 6 = DEBUG_MOST. */
+    LSX_PARAM_IN_Z char const * filename, /* Source code __FILENAME__ from which message originates. */
+    LSX_PARAM_IN_PRINTF char const * fmt, /* Message format string. */
+    LSX_PARAM_IN va_list ap               /* Message format parameters. */
+    );
+
+/**
+Client API:
+Callback to retrieve information about a format handler,
+used by sox_format_tab_t.fn.
+@returns format handler information.
+*/
+typedef sox_format_handler_t const * (LSX_API * sox_format_fn_t)(void);
+
+/**
+Client API:
+Callback to get information about an effect handler,
+used by the table returned from sox_get_effect_fns(void).
+@returns Pointer to information about an effect handler.
+*/
+typedef sox_effect_handler_t const * (LSX_API *sox_effect_fn_t)(void);
+
+/**
+Client API:
+Callback to initialize reader (decoder), used by
+sox_format_handler.startread.
+@returns SOX_SUCCESS if successful.
+*/
+typedef int (LSX_API * sox_format_handler_startread)(
+    LSX_PARAM_INOUT sox_format_t * ft /**< Format pointer. */
+    );
+
+/**
+Client API:
+Callback to read (decode) a block of samples,
+used by sox_format_handler.read.
+@returns number of samples read, or 0 if unsuccessful.
+*/
+typedef size_t (LSX_API * sox_format_handler_read)(
+    LSX_PARAM_INOUT sox_format_t * ft, /**< Format pointer. */
+    LSX_PARAM_OUT_CAP_POST_COUNT(len,return) sox_sample_t *buf, /**< Buffer from which to read samples. */
+    size_t len /**< Number of samples available in buf. */
+    );
+
+/**
+Client API:
+Callback to close reader (decoder),
+used by sox_format_handler.stopread.
+@returns SOX_SUCCESS if successful.
+*/
+typedef int (LSX_API * sox_format_handler_stopread)(
+    LSX_PARAM_INOUT sox_format_t * ft /**< Format pointer. */
+    );
+
+/**
+Client API:
+Callback to initialize writer (encoder),
+used by sox_format_handler.startwrite.
+@returns SOX_SUCCESS if successful.
+*/
+typedef int (LSX_API * sox_format_handler_startwrite)(
+    LSX_PARAM_INOUT sox_format_t * ft /**< Format pointer. */
+    );
+
+/**
+Client API:
+Callback to write (encode) a block of samples,
+used by sox_format_handler.write.
+@returns number of samples written, or 0 if unsuccessful.
+*/
+typedef size_t (LSX_API * sox_format_handler_write)(
+    LSX_PARAM_INOUT sox_format_t * ft, /**< Format pointer. */
+    LSX_PARAM_IN_COUNT(len) sox_sample_t const * buf, /**< Buffer to which samples are written. */
+    size_t len /**< Capacity of buf, measured in samples. */
+    );
+
+/**
+Client API:
+Callback to close writer (decoder),
+used by sox_format_handler.stopwrite.
+@returns SOX_SUCCESS if successful.
+*/
+typedef int (LSX_API * sox_format_handler_stopwrite)(
+    LSX_PARAM_INOUT sox_format_t * ft /**< Format pointer. */
+    );
+
+/**
+Client API:
+Callback to reposition reader,
+used by sox_format_handler.seek.
+@returns SOX_SUCCESS if successful.
+*/
+typedef int (LSX_API * sox_format_handler_seek)(
+    LSX_PARAM_INOUT sox_format_t * ft, /**< Format pointer. */
+    sox_uint64_t offset /**< Sample offset to which reader should be positioned. */
+    );
+
+/**
+Client API:
+Callback to parse command-line arguments (called once per effect),
+used by sox_effect_handler.getopts.
+@returns SOX_SUCCESS if successful.
+*/
+typedef int (LSX_API * sox_effect_handler_getopts)(
+    LSX_PARAM_INOUT sox_effect_t * effp, /**< Effect pointer. */
+    int argc, /**< Number of arguments in argv. */
+    LSX_PARAM_IN_COUNT(argc) char *argv[] /**< Array of command-line arguments. */
+    );
+
+/**
+Client API:
+Callback to initialize effect (called once per flow),
+used by sox_effect_handler.start.
+@returns SOX_SUCCESS if successful.
+*/
+typedef int (LSX_API * sox_effect_handler_start)(
+    LSX_PARAM_INOUT sox_effect_t * effp /**< Effect pointer. */
+    );
+
+/**
+Client API:
+Callback to process samples,
+used by sox_effect_handler.flow.
+@returns SOX_SUCCESS if successful.
+*/
+typedef int (LSX_API * sox_effect_handler_flow)(
+    LSX_PARAM_INOUT sox_effect_t * effp, /**< Effect pointer. */
+    LSX_PARAM_IN_COUNT(*isamp) sox_sample_t const * ibuf, /**< Buffer from which to read samples. */
+    LSX_PARAM_OUT_CAP_POST_COUNT(*osamp,*osamp) sox_sample_t * obuf, /**< Buffer to which samples are written. */
+    LSX_PARAM_INOUT size_t *isamp, /**< On entry, contains capacity of ibuf; on exit, contains number of samples consumed. */
+    LSX_PARAM_INOUT size_t *osamp /**< On entry, contains capacity of obuf; on exit, contains number of samples written. */
+    );
+
+/**
+Client API:
+Callback to finish getting output after input is complete,
+used by sox_effect_handler.drain.
+@returns SOX_SUCCESS if successful.
+*/
+typedef int (LSX_API * sox_effect_handler_drain)(
+    LSX_PARAM_INOUT sox_effect_t * effp, /**< Effect pointer. */
+    LSX_PARAM_OUT_CAP_POST_COUNT(*osamp,*osamp) sox_sample_t *obuf, /**< Buffer to which samples are written. */
+    LSX_PARAM_INOUT size_t *osamp /**< On entry, contains capacity of obuf; on exit, contains number of samples written. */
+    );
+
+/**
+Client API:
+Callback to shut down effect (called once per flow),
+used by sox_effect_handler.stop.
+@returns SOX_SUCCESS if successful.
+*/
+typedef int (LSX_API * sox_effect_handler_stop)(
+    LSX_PARAM_INOUT sox_effect_t * effp /**< Effect pointer. */
+    );
+
+/**
+Client API:
+Callback to shut down effect (called once per effect),
+used by sox_effect_handler.kill.
+@returns SOX_SUCCESS if successful.
+*/
+typedef int (LSX_API * sox_effect_handler_kill)(
+    LSX_PARAM_INOUT sox_effect_t * effp /**< Effect pointer. */
+    );
+
+/**
+Client API:
+Callback called while flow is running (called once per buffer),
+used by sox_flow_effects.callback.
+@returns SOX_SUCCESS to continue, other value to abort flow.
+*/
+typedef int (LSX_API * sox_flow_effects_callback)(
+    sox_bool all_done,
+    void * client_data
+    );
+
+/**
+Client API:
+Callback for enumerating the contents of a playlist,
+used by the sox_parse_playlist function.
+@returns SOX_SUCCESS if successful, any other value to abort playlist enumeration.
+*/
+typedef int (LSX_API * sox_playlist_callback_t)(
+    void * callback_data,
+    LSX_PARAM_IN_Z char const * filename
+    );
+
+/*****************************************************************************
+Structures:
+*****************************************************************************/
+
+/**
+Client API:
+Information about a build of libSoX, returned from the sox_version_info
+function.
+*/
+typedef struct sox_version_info_t {
+    size_t       size;         /**< structure size = sizeof(sox_version_info_t) */
+    sox_version_flags_t flags; /**< feature flags = popen | magic | threads | memopen */
+    sox_uint32_t version_code; /**< version number = 0x140400 */
+    char const * version;      /**< version string = sox_version(), for example, "14.4.0" */
+    char const * version_extra;/**< version extra info or null = "PACKAGE_EXTRA", for example, "beta" */
+    char const * time;         /**< build time = "__DATE__ __TIME__", for example, "Jan  7 2010 03:31:50" */
+    char const * distro;       /**< distro or null = "DISTRO", for example, "Debian" */
+    char const * compiler;     /**< compiler info or null, for example, "msvc 160040219" */
+    char const * arch;         /**< arch, for example, "1248 48 44 L OMP" */
+    /* new info should be added at the end for version backwards-compatibility. */
+} sox_version_info_t;
+
+/**
+Client API:
+Global parameters (for effects & formats), returned from the sox_get_globals
+function.
+*/
+typedef struct sox_globals_t {
+/* public: */
+  unsigned     verbosity; /**< messages are only written if globals.verbosity >= message.level */
+  sox_output_message_handler_t output_message_handler; /**< client-specified message output callback */
+  sox_bool     repeatable; /**< true to use pre-determined timestamps and PRNG seed */
+
+  /**
+  Default size (in bytes) used by libSoX for blocks of sample data.
+  Plugins should use similarly-sized buffers to get best performance.
+  */
+  size_t       bufsiz;
+
+  /**
+  Default size (in bytes) used by libSoX for blocks of input sample data.
+  Plugins should use similarly-sized buffers to get best performance.
+  */
+  size_t       input_bufsiz;
+
+  sox_int32_t  ranqd1; /**< Can be used to re-seed libSoX's PRNG */
+
+  char const * stdin_in_use_by;  /**< Private: tracks the name of the handler currently using stdin */
+  char const * stdout_in_use_by; /**< Private: tracks the name of the handler currently using stdout */
+  char const * subsystem;        /**< Private: tracks the name of the handler currently writing an output message */
+  char       * tmp_path;         /**< Private: client-configured path to use for temporary files */
+  sox_bool     use_magic;        /**< Private: true if client has requested use of 'magic' file-type detection */
+  sox_bool     use_threads;      /**< Private: true if client has requested parallel effects processing */
+} sox_globals_t;
+
+/**
+Client API:
+Signal parameters; members should be set to SOX_UNSPEC (= 0) if unknown.
+*/
+typedef struct sox_signalinfo_t {
+  sox_rate_t       rate;         /**< samples per second, 0 if unknown */
+  unsigned         channels;     /**< number of sound channels, 0 if unknown */
+  unsigned         precision;    /**< bits per sample, 0 if unknown */
+  sox_uint64_t     length;       /**< samples * chans in file, 0 if unknown, -1 if unspecified */
+  double           * mult;       /**< Effects headroom multiplier; may be null */
+} sox_signalinfo_t;
+
+/**
+Client API:
+Basic information about an encoding.
+*/
+typedef struct sox_encodings_info_t {
+  sox_encodings_flags_t flags; /**< lossy once (lossy1), lossy twice (lossy2), or lossless (none). */
+  char const * name;           /**< encoding name. */
+  char const * desc;           /**< encoding description. */
+} sox_encodings_info_t;
+
+/**
+Client API:
+Encoding parameters.
+*/
+typedef struct sox_encodinginfo_t {
+  sox_encoding_t encoding; /**< format of sample numbers */
+  unsigned bits_per_sample;/**< 0 if unknown or variable; uncompressed value if lossless; compressed value if lossy */
+  double compression;      /**< compression factor (where applicable) */
+
+  /**
+  Should bytes be reversed? If this is default during sox_open_read or
+  sox_open_write, libSoX will set them to either no or yes according to the
+  machine or format default.
+  */
+  sox_option_t reverse_bytes;
+
+  /**
+  Should nibbles be reversed? If this is default during sox_open_read or
+  sox_open_write, libSoX will set them to either no or yes according to the
+  machine or format default.
+  */
+  sox_option_t reverse_nibbles;
+
+  /**
+  Should bits be reversed? If this is default during sox_open_read or
+  sox_open_write, libSoX will set them to either no or yes according to the
+  machine or format default.
+  */
+  sox_option_t reverse_bits;
+
+  /**
+  If set to true, the format should reverse its default endianness.
+  */
+  sox_bool opposite_endian;
+} sox_encodinginfo_t;
+
+/**
+Client API:
+Looping parameters (out-of-band data).
+*/
+typedef struct sox_loopinfo_t {
+  sox_uint64_t  start;  /**< first sample */
+  sox_uint64_t  length; /**< length */
+  unsigned      count;  /**< number of repeats, 0=forever */
+  unsigned char type;   /**< 0=no, 1=forward, 2=forward/back (see sox_loop_* for valid values). */
+} sox_loopinfo_t;
+
+/**
+Client API:
+Instrument information.
+*/
+typedef struct sox_instrinfo_t{
+  signed char MIDInote;   /**< for unity pitch playback */
+  signed char MIDIlow;    /**< MIDI pitch-bend low range */
+  signed char MIDIhi;     /**< MIDI pitch-bend high range */
+  unsigned char loopmode; /**< 0=no, 1=forward, 2=forward/back (see sox_loop_* values) */
+  unsigned nloops;  /**< number of active loops (max SOX_MAX_NLOOPS). */
+} sox_instrinfo_t;
+
+/**
+Client API:
+File buffer info.  Holds info so that data can be read in blocks.
+*/
+typedef struct sox_fileinfo_t {
+  char          *buf;                 /**< Pointer to data buffer */
+  size_t        size;                 /**< Size of buffer in bytes */
+  size_t        count;                /**< Count read into buffer */
+  size_t        pos;                  /**< Position in buffer */
+} sox_fileinfo_t;
+
+/**
+Client API:
+Handler structure defined by each format.
+*/
+struct sox_format_handler_t {
+  unsigned     sox_lib_version_code;  /**< Checked on load; must be 1st in struct*/
+  char         const * description;   /**< short description of format */
+  char         const * const * names; /**< null-terminated array of filename extensions that are handled by this format */
+  unsigned int flags;                 /**< File flags (SOX_FILE_* values). */
+  sox_format_handler_startread startread; /**< called to initialize reader (decoder) */
+  sox_format_handler_read read;       /**< called to read (decode) a block of samples */
+  sox_format_handler_stopread stopread; /**< called to close reader (decoder); may be null if no closing necessary */
+  sox_format_handler_startwrite startwrite; /**< called to initialize writer (encoder) */
+  sox_format_handler_write write;     /**< called to write (encode) a block of samples */
+  sox_format_handler_stopwrite stopwrite; /**< called to close writer (decoder); may be null if no closing necessary */
+  sox_format_handler_seek seek;       /**< called to reposition reader; may be null if not supported */
+
+  /**
+  Array of values indicating the encodings and precisions supported for
+  writing (encoding). Precisions specified with default precision first.
+  Encoding, precision, precision, ..., 0, repeat. End with one more 0.
+  Example:
+  unsigned const * formats = {
+    SOX_ENCODING_SIGN2, 16, 24, 0, // Support SIGN2 at 16 and 24 bits, default to 16 bits.
+    SOX_ENCODING_UNSIGNED, 8, 0,   // Support UNSIGNED at 8 bits, default to 8 bits.
+    0 // No more supported encodings.
+  };
+  */
+  unsigned     const * write_formats;
+
+  /**
+  Array of sample rates (samples per second) supported for writing (encoding).
+  NULL if all (or almost all) rates are supported. End with 0.
+  */
+  sox_rate_t   const * write_rates;
+
+  /**
+  SoX will automatically allocate a buffer in which the handler can store data.
+  Specify the size of the buffer needed here. Usually this will be sizeof(your_struct).
+  The buffer will be allocated and zeroed before the call to startread/startwrite.
+  The buffer will be freed after the call to stopread/stopwrite.
+  The buffer will be provided via format.priv in each call to the handler.
+  */
+  size_t       priv_size;
+};
+
+/**
+Client API:
+Comments, instrument info, loop info (out-of-band data).
+*/
+typedef struct sox_oob_t{
+  /* Decoded: */
+  sox_comments_t   comments;              /**< Comment strings in id=value format. */
+  sox_instrinfo_t  instr;                 /**< Instrument specification */
+  sox_loopinfo_t   loops[SOX_MAX_NLOOPS]; /**< Looping specification */
+
+  /* TBD: Non-decoded chunks, etc: */
+} sox_oob_t;
+
+/**
+Client API:
+Data passed to/from the format handler
+*/
+struct sox_format_t {
+  char             * filename;      /**< File name */
+
+  /**
+  Signal specifications for reader (decoder) or writer (encoder):
+  sample rate, number of channels, precision, length, headroom multiplier.
+  Any info specified by the user is here on entry to startread or
+  startwrite. Info will be SOX_UNSPEC if the user provided no info.
+  At exit from startread, should be completely filled in, using
+  either data from the file's headers (if available) or whatever
+  the format is guessing/assuming (if header data is not available).
+  At exit from startwrite, should be completely filled in, using
+  either the data that was specified, or values chosen by the format
+  based on the format's defaults or capabilities.
+  */
+  sox_signalinfo_t signal;
+
+  /**
+  Encoding specifications for reader (decoder) or writer (encoder):
+  encoding (sample format), bits per sample, compression rate, endianness.
+  Should be filled in by startread. Values specified should be used
+  by startwrite when it is configuring the encoding parameters.
+  */
+  sox_encodinginfo_t encoding;
+
+  char             * filetype;      /**< Type of file, as determined by header inspection or libmagic. */
+  sox_oob_t        oob;             /**< comments, instrument info, loop info (out-of-band data) */
+  sox_bool         seekable;        /**< Can seek on this file */
+  char             mode;            /**< Read or write mode ('r' or 'w') */
+  sox_uint64_t     olength;         /**< Samples * chans written to file */
+  sox_uint64_t     clips;           /**< Incremented if clipping occurs */
+  int              sox_errno;       /**< Failure error code */
+  char             sox_errstr[256]; /**< Failure error text */
+  void             * fp;            /**< File stream pointer */
+  lsx_io_type      io_type;         /**< Stores whether this is a file, pipe or URL */
+  sox_uint64_t     tell_off;        /**< Current offset within file */
+  sox_uint64_t     data_start;      /**< Offset at which headers end and sound data begins (set by lsx_check_read_params) */
+  sox_format_handler_t handler;     /**< Format handler for this file */
+  void             * priv;          /**< Format handler's private data area */
+};
+
+/**
+Client API:
+Information about a loaded format handler, including the format name and a
+function pointer that can be invoked to get additional information about the
+format.
+*/
+typedef struct sox_format_tab_t {
+  char *name;         /**< Name of format handler */
+  sox_format_fn_t fn; /**< Function to call to get format handler's information */
+} sox_format_tab_t;
+
+/**
+Client API:
+Global parameters for effects.
+*/
+typedef struct sox_effects_globals_t {
+  sox_plot_t plot;         /**< To help the user choose effect & options */
+  sox_globals_t * global_info; /**< Pointer to associated SoX globals */
+} sox_effects_globals_t;
+
+/**
+Client API:
+Effect handler information.
+*/
+struct sox_effect_handler_t {
+  char const * name;  /**< Effect name */
+  char const * usage; /**< Short explanation of parameters accepted by effect */
+  unsigned int flags; /**< Combination of SOX_EFF_* flags */
+  sox_effect_handler_getopts getopts; /**< Called to parse command-line arguments (called once per effect). */
+  sox_effect_handler_start start;     /**< Called to initialize effect (called once per flow). */
+  sox_effect_handler_flow flow;       /**< Called to process samples. */
+  sox_effect_handler_drain drain;     /**< Called to finish getting output after input is complete. */
+  sox_effect_handler_stop stop;       /**< Called to shut down effect (called once per flow). */
+  sox_effect_handler_kill kill;       /**< Called to shut down effect (called once per effect). */
+  size_t       priv_size;             /**< Size of private data SoX should pre-allocate for effect */
+};
+
+/**
+Client API:
+Effect information.
+*/
+struct sox_effect_t {
+  sox_effects_globals_t    * global_info; /**< global effect parameters */
+  sox_signalinfo_t         in_signal;     /**< Information about the incoming data stream */
+  sox_signalinfo_t         out_signal;    /**< Information about the outgoing data stream */
+  sox_encodinginfo_t       const * in_encoding;  /**< Information about the incoming data encoding */
+  sox_encodinginfo_t       const * out_encoding; /**< Information about the outgoing data encoding */
+  sox_effect_handler_t     handler;   /**< The handler for this effect */
+  sox_sample_t             * obuf;    /**< output buffer */
+  size_t                   obeg;      /**< output buffer: start of valid data section */
+  size_t                   oend;      /**< output buffer: one past valid data section (oend-obeg is length of current content) */
+  size_t               imin;          /**< minimum input buffer content required for calling this effect's flow function; set via lsx_effect_set_imin() */
+  sox_uint64_t         clips;         /**< increment if clipping occurs */
+  size_t               flows;         /**< 1 if MCHAN, number of chans otherwise */
+  size_t               flow;          /**< flow number */
+  void                 * priv;        /**< Effect's private data area (each flow has a separate copy) */
+};
+
+/**
+Client API:
+Chain of effects to be applied to a stream.
+*/
+typedef struct sox_effects_chain_t {
+  sox_effect_t **effects;                  /**< Table of effects to be applied to a stream */
+  unsigned table_size;                     /**< Number of entries in effects table */
+  unsigned length;                         /**< Number of effects to be applied */
+  sox_sample_t **ibufc;                    /**< Channel interleave buffer */
+  sox_sample_t **obufc;                    /**< Channel interleave buffer */
+  sox_effects_globals_t global_info;       /**< Copy of global effects settings */
+  sox_encodinginfo_t const * in_enc;       /**< Input encoding */
+  sox_encodinginfo_t const * out_enc;      /**< Output encoding */
+} sox_effects_chain_t;
+
+/*****************************************************************************
+Functions:
+*****************************************************************************/
+
+/**
+Client API:
+Returns version number string of libSoX, for example, "14.4.0".
+@returns The version number string of libSoX, for example, "14.4.0".
+*/
+LSX_RETURN_VALID_Z LSX_RETURN_PURE
+char const *
+LSX_API
+sox_version(void);
+
+/**
+Client API:
+Returns information about this build of libsox.
+@returns Pointer to a version information structure.
+*/
+LSX_RETURN_VALID LSX_RETURN_PURE
+sox_version_info_t const *
+LSX_API
+sox_version_info(void);
+
+/**
+Client API:
+Returns a pointer to the structure with libSoX's global settings.
+@returns a pointer to the structure with libSoX's global settings.
+*/
+LSX_RETURN_VALID LSX_RETURN_PURE
+sox_globals_t *
+LSX_API
+sox_get_globals(void);
+
+/**
+Client API:
+Deprecated macro that returns the structure with libSoX's global settings
+as an lvalue.
+*/
+#define sox_globals (*sox_get_globals())
+
+/**
+Client API:
+Returns a pointer to the list of available encodings.
+End of list indicated by name == NULL.
+@returns pointer to the list of available encodings.
+*/
+LSX_RETURN_ARRAY LSX_RETURN_PURE
+sox_encodings_info_t const *
+LSX_API
+sox_get_encodings_info(void);
+
+/**
+Client API:
+Deprecated macro that returns the list of available encodings.
+End of list indicated by name == NULL.
+*/
+#define sox_encodings_info (sox_get_encodings_info())
+
+/**
+Client API:
+Fills in an encodinginfo with default values.
+*/
+void
+LSX_API
+sox_init_encodinginfo(
+    LSX_PARAM_OUT sox_encodinginfo_t * e /**< Pointer to uninitialized encoding info structure to be initialized. */
+    );
+
+/**
+Client API:
+Given an encoding (for example, SIGN2) and the encoded bits_per_sample (for
+example, 16), returns the number of useful bits per sample in the decoded data
+(for example, 16), or returns 0 to indicate that the value returned by the
+format handler should be used instead of a pre-determined precision.
+@returns the number of useful bits per sample in the decoded data (for example
+16), or returns 0 to indicate that the value returned by the format handler
+should be used instead of a pre-determined precision.
+*/
+LSX_RETURN_PURE
+unsigned
+LSX_API
+sox_precision(
+    sox_encoding_t encoding,   /**< Encoding for which to lookup precision information. */
+    unsigned bits_per_sample   /**< The number of encoded bits per sample. */
+    );
+
+/**
+Client API:
+Returns the number of items in the metadata block.
+@returns the number of items in the metadata block.
+*/
+size_t
+LSX_API
+sox_num_comments(
+    LSX_PARAM_IN_OPT sox_comments_t comments /**< Metadata block. */
+    );
+
+/**
+Client API:
+Adds an "id=value" item to the metadata block.
+*/
+void
+LSX_API
+sox_append_comment(
+    LSX_PARAM_DEREF_PRE_MAYBENULL LSX_PARAM_DEREF_POST_NOTNULL sox_comments_t * comments, /**< Metadata block. */
+    LSX_PARAM_IN_Z char const * item /**< Item to be added in "id=value" format. */
+    );
+
+/**
+Client API:
+Adds a newline-delimited list of "id=value" items to the metadata block.
+*/
+void
+LSX_API
+sox_append_comments(
+    LSX_PARAM_DEREF_PRE_MAYBENULL LSX_PARAM_DEREF_POST_NOTNULL sox_comments_t * comments, /**< Metadata block. */
+    LSX_PARAM_IN_Z char const * items /**< Newline-separated list of items to be added, for example "id1=value1\\nid2=value2". */
+    );
+
+/**
+Client API:
+Duplicates the metadata block.
+@returns the copied metadata block.
+*/
+LSX_RETURN_OPT
+sox_comments_t
+LSX_API
+sox_copy_comments(
+    LSX_PARAM_IN_OPT sox_comments_t comments /**< Metadata block to copy. */
+    );
+
+/**
+Client API:
+Frees the metadata block.
+*/
+void
+LSX_API
+sox_delete_comments(
+    LSX_PARAM_DEREF_PRE_MAYBENULL LSX_PARAM_DEREF_POST_NULL sox_comments_t * comments /**< Metadata block. */
+    );
+
+/**
+Client API:
+If "id=value" is found, return value, else return null.
+@returns value, or null if value not found.
+*/
+LSX_RETURN_OPT
+char const *
+LSX_API
+sox_find_comment(
+    LSX_PARAM_IN_OPT sox_comments_t comments, /**< Metadata block in which to search. */
+    LSX_PARAM_IN_Z char const * id /**< Id for which to search */
+    );
+
+/**
+Client API:
+Find and load format handler plugins.
+@returns SOX_SUCCESS if successful.
+*/
+int
+LSX_API
+sox_format_init(void);
+
+/**
+Client API:
+Unload format handler plugins.
+*/
+void
+LSX_API
+sox_format_quit(void);
+
+/**
+Client API:
+Initialize effects library.
+@returns SOX_SUCCESS if successful.
+*/
+int
+LSX_API
+sox_init(void);
+
+/**
+Client API:
+Close effects library and unload format handler plugins.
+@returns SOX_SUCCESS if successful.
+*/
+int
+LSX_API
+sox_quit(void);
+
+/**
+Client API:
+Returns the table of format handler names and functions.
+@returns the table of format handler names and functions.
+*/
+LSX_RETURN_ARRAY LSX_RETURN_PURE
+sox_format_tab_t const *
+LSX_API
+sox_get_format_fns(void);
+
+/**
+Client API:
+Deprecated macro that returns the table of format handler names and functions.
+*/
+#define sox_format_fns (sox_get_format_fns())
+
+/**
+Client API:
+Opens a decoding session for a file. Returned handle must be closed with sox_close().
+@returns The handle for the new session, or null on failure.
+*/
+LSX_RETURN_OPT
+sox_format_t *
+LSX_API
+sox_open_read(
+    LSX_PARAM_IN_Z   char               const * path,      /**< Path to file to be opened (required). */
+    LSX_PARAM_IN_OPT sox_signalinfo_t   const * signal,    /**< Information already known about audio stream, or NULL if none. */
+    LSX_PARAM_IN_OPT sox_encodinginfo_t const * encoding,  /**< Information already known about sample encoding, or NULL if none. */
+    LSX_PARAM_IN_OPT_Z char             const * filetype   /**< Previously-determined file type, or NULL to auto-detect. */
+    );
+
+/**
+Client API:
+Opens a decoding session for a memory buffer. Returned handle must be closed with sox_close().
+@returns The handle for the new session, or null on failure.
+*/
+LSX_RETURN_OPT
+sox_format_t *
+LSX_API
+sox_open_mem_read(
+    LSX_PARAM_IN_BYTECOUNT(buffer_size) void  * buffer,     /**< Pointer to audio data buffer (required). */
+    size_t                                      buffer_size,/**< Number of bytes to read from audio data buffer. */
+    LSX_PARAM_IN_OPT sox_signalinfo_t   const * signal,     /**< Information already known about audio stream, or NULL if none. */
+    LSX_PARAM_IN_OPT sox_encodinginfo_t const * encoding,   /**< Information already known about sample encoding, or NULL if none. */
+    LSX_PARAM_IN_OPT_Z char             const * filetype    /**< Previously-determined file type, or NULL to auto-detect. */
+    );
+
+/**
+Client API:
+Returns true if the format handler for the specified file type supports the specified encoding.
+@returns true if the format handler for the specified file type supports the specified encoding.
+*/
+sox_bool
+LSX_API
+sox_format_supports_encoding(
+    LSX_PARAM_IN_OPT_Z char               const * path,       /**< Path to file to be examined (required if filetype is NULL). */
+    LSX_PARAM_IN_OPT_Z char               const * filetype,   /**< Previously-determined file type, or NULL to use extension from path. */
+    LSX_PARAM_IN       sox_encodinginfo_t const * encoding    /**< Encoding for which format handler should be queried. */
+    );
+
+/**
+Client API:
+Gets the format handler for a specified file type.
+@returns The found format handler, or null if not found.
+*/
+LSX_RETURN_OPT
+sox_format_handler_t const *
+LSX_API
+sox_write_handler(
+    LSX_PARAM_IN_OPT_Z char               const * path,         /**< Path to file (required if filetype is NULL). */
+    LSX_PARAM_IN_OPT_Z char               const * filetype,     /**< Filetype for which handler is needed, or NULL to use extension from path. */
+    LSX_PARAM_OUT_OPT  char               const * * filetype1   /**< Receives the filetype that was detected. Pass NULL if not needed. */
+    );
+
+/**
+Client API:
+Opens an encoding session for a file. Returned handle must be closed with sox_close().
+@returns The new session handle, or null on failure.
+*/
+LSX_RETURN_OPT
+sox_format_t *
+LSX_API
+sox_open_write(
+    LSX_PARAM_IN_Z     char               const * path,     /**< Path to file to be written (required). */
+    LSX_PARAM_IN       sox_signalinfo_t   const * signal,   /**< Information about desired audio stream (required). */
+    LSX_PARAM_IN_OPT   sox_encodinginfo_t const * encoding, /**< Information about desired sample encoding, or NULL to use defaults. */
+    LSX_PARAM_IN_OPT_Z char               const * filetype, /**< Previously-determined file type, or NULL to auto-detect. */
+    LSX_PARAM_IN_OPT   sox_oob_t          const * oob,      /**< Out-of-band data to add to file, or NULL if none. */
+    LSX_PARAM_IN_OPT   sox_bool           (LSX_API * overwrite_permitted)(LSX_PARAM_IN_Z char const * filename) /**< Called if file exists to determine whether overwrite is ok. */
+    );
+
+/**
+Client API:
+Opens an encoding session for a memory buffer. Returned handle must be closed with sox_close().
+@returns The new session handle, or null on failure.
+*/
+LSX_RETURN_OPT
+sox_format_t *
+LSX_API
+sox_open_mem_write(
+    LSX_PARAM_OUT_BYTECAP(buffer_size) void                     * buffer,      /**< Pointer to audio data buffer that receives data (required). */
+    LSX_PARAM_IN                       size_t                     buffer_size, /**< Maximum number of bytes to write to audio data buffer. */
+    LSX_PARAM_IN                       sox_signalinfo_t   const * signal,      /**< Information about desired audio stream (required). */
+    LSX_PARAM_IN_OPT                   sox_encodinginfo_t const * encoding,    /**< Information about desired sample encoding, or NULL to use defaults. */
+    LSX_PARAM_IN_OPT_Z                 char               const * filetype,    /**< Previously-determined file type, or NULL to auto-detect. */
+    LSX_PARAM_IN_OPT                   sox_oob_t          const * oob          /**< Out-of-band data to add to file, or NULL if none. */
+    );
+
+/**
+Client API:
+Opens an encoding session for a memstream buffer. Returned handle must be closed with sox_close().
+@returns The new session handle, or null on failure.
+*/
+LSX_RETURN_OPT
+sox_format_t *
+LSX_API
+sox_open_memstream_write(
+    LSX_PARAM_OUT      char                     * * buffer_ptr,    /**< Receives pointer to audio data buffer that receives data (required). */
+    LSX_PARAM_OUT      size_t                   * buffer_size_ptr, /**< Receives size of data written to audio data buffer (required). */
+    LSX_PARAM_IN       sox_signalinfo_t   const * signal,          /**< Information about desired audio stream (required). */
+    LSX_PARAM_IN_OPT   sox_encodinginfo_t const * encoding,        /**< Information about desired sample encoding, or NULL to use defaults. */
+    LSX_PARAM_IN_OPT_Z char               const * filetype,        /**< Previously-determined file type, or NULL to auto-detect. */
+    LSX_PARAM_IN_OPT   sox_oob_t          const * oob              /**< Out-of-band data to add to file, or NULL if none. */
+    );
+
+/**
+Client API:
+Reads samples from a decoding session into a sample buffer.
+@returns Number of samples decoded, or 0 for EOF.
+*/
+size_t
+LSX_API
+sox_read(
+    LSX_PARAM_INOUT sox_format_t * ft, /**< Format pointer. */
+    LSX_PARAM_OUT_CAP_POST_COUNT(len,return) sox_sample_t *buf, /**< Buffer from which to read samples. */
+    size_t len /**< Number of samples available in buf. */
+    );
+
+/**
+Client API:
+Writes samples to an encoding session from a sample buffer.
+@returns Number of samples encoded.
+*/
+size_t
+LSX_API
+sox_write(
+    LSX_PARAM_INOUT sox_format_t * ft, /**< Format pointer. */
+    LSX_PARAM_IN_COUNT(len) sox_sample_t const * buf, /**< Buffer from which to read samples. */
+    size_t len /**< Number of samples available in buf. */
+    );
+
+/**
+Client API:
+Closes an encoding or decoding session.
+@returns SOX_SUCCESS if successful.
+*/
+int
+LSX_API
+sox_close(
+    LSX_PARAM_INOUT sox_format_t * ft /**< Format pointer. */
+    );
+
+/**
+Client API:
+Sets the location at which next samples will be decoded. Returns SOX_SUCCESS if successful.
+@returns SOX_SUCCESS if successful.
+*/
+int
+LSX_API
+sox_seek(
+    LSX_PARAM_INOUT sox_format_t * ft, /**< Format pointer. */
+    sox_uint64_t offset, /**< Sample offset at which to position reader. */
+    int whence /**< Set to SOX_SEEK_SET. */
+    );
+
+/**
+Client API:
+Finds a format handler by name.
+@returns Format handler data, or null if not found.
+*/
+LSX_RETURN_OPT
+sox_format_handler_t const *
+LSX_API
+sox_find_format(
+    LSX_PARAM_IN_Z char const * name, /**< Name of format handler to find. */
+    sox_bool ignore_devices /**< Set to true to ignore device names. */
+    );
+
+/**
+Client API:
+Returns global parameters for effects
+@returns global parameters for effects.
+*/
+LSX_RETURN_VALID LSX_RETURN_PURE
+sox_effects_globals_t *
+LSX_API
+sox_get_effects_globals(void);
+
+/**
+Client API:
+Deprecated macro that returns global parameters for effects.
+*/
+#define sox_effects_globals (*sox_get_effects_globals())
+
+/**
+Client API:
+Finds the effect handler with the given name.
+@returns Effect pointer, or null if not found.
+*/
+LSX_RETURN_OPT LSX_RETURN_PURE
+sox_effect_handler_t const *
+LSX_API
+sox_find_effect(
+    LSX_PARAM_IN_Z char const * name /**< Name of effect to find. */
+    );
+
+/**
+Client API:
+Creates an effect using the given handler.
+@returns The new effect, or null if not found.
+*/
+LSX_RETURN_OPT
+sox_effect_t *
+LSX_API
+sox_create_effect(
+    LSX_PARAM_IN sox_effect_handler_t const * eh /**< Handler to use for effect. */
+    );
+
+/**
+Client API:
+Applies the command-line options to the effect.
+@returns the number of arguments consumed.
+*/
+int
+LSX_API
+sox_effect_options(
+    LSX_PARAM_IN sox_effect_t *effp, /**< Effect pointer on which to set options. */
+    int argc, /**< Number of arguments in argv. */
+    LSX_PARAM_IN_COUNT(argc) char * const argv[] /**< Array of command-line options. */
+    );
+
+/**
+Client API:
+Returns an array containing the known effect handlers.
+@returns An array containing the known effect handlers.
+*/
+LSX_RETURN_VALID_Z LSX_RETURN_PURE
+sox_effect_fn_t const *
+LSX_API
+sox_get_effect_fns(void);
+
+/**
+Client API:
+Deprecated macro that returns an array containing the known effect handlers.
+*/
+#define sox_effect_fns (sox_get_effect_fns())
+
+/**
+Client API:
+Initializes an effects chain. Returned handle must be closed with sox_delete_effects_chain().
+@returns Handle, or null on failure.
+*/
+LSX_RETURN_OPT
+sox_effects_chain_t *
+LSX_API
+sox_create_effects_chain(
+    LSX_PARAM_IN sox_encodinginfo_t const * in_enc, /**< Input encoding. */
+    LSX_PARAM_IN sox_encodinginfo_t const * out_enc /**< Output encoding. */
+    );
+
+/**
+Client API:
+Closes an effects chain.
+*/
+void
+LSX_API
+sox_delete_effects_chain(
+    LSX_PARAM_INOUT sox_effects_chain_t *ecp /**< Effects chain pointer. */
+    );
+
+/**
+Client API:
+Adds an effect to the effects chain, returns SOX_SUCCESS if successful.
+@returns SOX_SUCCESS if successful.
+*/
+int
+LSX_API
+sox_add_effect(
+    LSX_PARAM_INOUT sox_effects_chain_t * chain, /**< Effects chain to which effect should be added . */
+    LSX_PARAM_INOUT sox_effect_t * effp, /**< Effect to be added. */
+    LSX_PARAM_INOUT sox_signalinfo_t * in, /**< Input format. */
+    LSX_PARAM_IN    sox_signalinfo_t const * out /**< Output format. */
+    );
+
+/**
+Client API:
+Runs the effects chain, returns SOX_SUCCESS if successful.
+@returns SOX_SUCCESS if successful.
+*/
+int
+LSX_API
+sox_flow_effects(
+    LSX_PARAM_INOUT  sox_effects_chain_t * chain, /**< Effects chain to run. */
+    LSX_PARAM_IN_OPT sox_flow_effects_callback callback, /**< Callback for monitoring flow progress. */
+    LSX_PARAM_IN_OPT void * client_data /**< Data to pass into callback. */
+    );
+
+/**
+Client API:
+Gets the number of clips that occurred while running an effects chain.
+@returns the number of clips that occurred while running an effects chain.
+*/
+sox_uint64_t
+LSX_API
+sox_effects_clips(
+    LSX_PARAM_IN sox_effects_chain_t * chain /**< Effects chain from which to read clip information. */
+    );
+
+/**
+Client API:
+Shuts down an effect (calls stop on each of its flows).
+@returns the number of clips from all flows.
+*/
+sox_uint64_t
+LSX_API
+sox_stop_effect(
+    LSX_PARAM_INOUT_COUNT(effp->flows) sox_effect_t * effp /**< Effect to stop. */
+    );
+
+/**
+Client API:
+Adds an already-initialized effect to the end of the chain.
+*/
+void
+LSX_API
+sox_push_effect_last(
+    LSX_PARAM_INOUT sox_effects_chain_t * chain, /**< Effects chain to which effect should be added. */
+    LSX_PARAM_INOUT sox_effect_t * effp /**< Effect to be added. */
+    );
+
+/**
+Client API:
+Removes and returns an effect from the end of the chain.
+@returns the removed effect, or null if no effects.
+*/
+LSX_RETURN_OPT
+sox_effect_t *
+LSX_API
+sox_pop_effect_last(
+    LSX_PARAM_INOUT sox_effects_chain_t *chain /**< Effects chain from which to remove an effect. */
+    );
+
+/**
+Client API:
+Shut down and delete an effect.
+*/
+void
+LSX_API
+sox_delete_effect(
+    LSX_PARAM_INOUT_COUNT(effp->flows) sox_effect_t *effp /**< Effect to be deleted. */
+    );
+
+/**
+Client API:
+Shut down and delete the last effect in the chain.
+*/
+void
+LSX_API
+sox_delete_effect_last(
+    LSX_PARAM_INOUT sox_effects_chain_t *chain /**< Effects chain from which to remove the last effect. */
+    );
+
+/**
+Client API:
+Shut down and delete all effects in the chain.
+*/
+void
+LSX_API
+sox_delete_effects(
+    LSX_PARAM_INOUT sox_effects_chain_t *chain /**< Effects chain from which to delete effects. */
+    );
+
+/**
+Client API:
+Gets the sample offset of the start of the trim, useful for efficiently
+skipping the part that will be trimmed anyway (get trim start, seek, then
+clear trim start).
+@returns the sample offset of the start of the trim.
+*/
+sox_uint64_t
+LSX_API
+sox_trim_get_start(
+    LSX_PARAM_IN sox_effect_t * effp /**< Trim effect. */
+    );
+
+/**
+Client API:
+Clears the start of the trim to 0.
+*/
+void
+LSX_API
+sox_trim_clear_start(
+    LSX_PARAM_INOUT sox_effect_t * effp /**< Trim effect. */
+    );
+
+/**
+Client API:
+Returns true if the specified file is a known playlist file type.
+@returns true if the specified file is a known playlist file type.
+*/
+sox_bool
+LSX_API
+sox_is_playlist(
+    LSX_PARAM_IN_Z char const * filename /**< Name of file to examine. */
+    );
+
+/**
+Client API:
+Parses the specified playlist file.
+@returns SOX_SUCCESS if successful.
+*/
+int
+LSX_API
+sox_parse_playlist(
+    LSX_PARAM_IN sox_playlist_callback_t callback, /**< Callback to call for each item in the playlist. */
+    void * p, /**< Data to pass to callback. */
+    LSX_PARAM_IN char const * const listname /**< Filename of playlist file. */
+    );
+
+/**
+Client API:
+Converts a SoX error code into an error string.
+@returns error string corresponding to the specified error code,
+or a generic message if the error code is not recognized.
+*/
+LSX_RETURN_VALID_Z LSX_RETURN_PURE
+char const *
+LSX_API
+sox_strerror(
+    int sox_errno /**< Error code to look up. */
+    );
+
+/**
+Client API:
+Gets the basename of the specified file; for example, the basename of
+"/a/b/c.d" would be "c".
+@returns the number of characters written to base_buffer, excluding the null,
+or 0 on failure.
+*/
+size_t
+LSX_API
+sox_basename(
+    LSX_PARAM_OUT_Z_CAP_POST_COUNT(base_buffer_len,return) char * base_buffer, /**< Buffer into which basename should be written. */
+    size_t base_buffer_len, /**< Size of base_buffer, in bytes. */
+    LSX_PARAM_IN_Z char const * filename /**< Filename from which to extract basename. */
+    );
+
+/*****************************************************************************
+Internal API:
+WARNING - The items in this section are subject to instability. They only
+exist in the public header because sox (the application) currently uses them.
+These may be changed or removed in future versions of libSoX.
+*****************************************************************************/
+
+/**
+Plugins API:
+Print a fatal error in libSoX.
+*/
+void
+LSX_API
+lsx_fail_impl(
+    LSX_PARAM_IN_PRINTF char const * fmt, /**< printf-style format string. */
+    ...)
+    LSX_PRINTF12;
+
+/**
+Plugins API:
+Print a warning in libSoX.
+*/
+void
+LSX_API
+lsx_warn_impl(
+    LSX_PARAM_IN_PRINTF char const * fmt, /**< printf-style format string. */
+    ...)
+    LSX_PRINTF12;
+
+/**
+Plugins API:
+Print an informational message in libSoX.
+*/
+void
+LSX_API
+lsx_report_impl(
+    LSX_PARAM_IN_PRINTF char const * fmt, /**< printf-style format string. */
+    ...)
+    LSX_PRINTF12;
+
+/**
+Plugins API:
+Print a debug message in libSoX.
+*/
+void
+LSX_API
+lsx_debug_impl(
+    LSX_PARAM_IN_PRINTF char const * fmt, /**< printf-style format string. */
+    ...)
+    LSX_PRINTF12;
+
+/**
+Plugins API:
+Report a fatal error in libSoX; printf-style arguments must follow.
+*/
+#define lsx_fail       sox_get_globals()->subsystem=__FILE__,lsx_fail_impl
+
+/**
+Plugins API:
+Report a warning in libSoX; printf-style arguments must follow.
+*/
+#define lsx_warn       sox_get_globals()->subsystem=__FILE__,lsx_warn_impl
+
+/**
+Plugins API:
+Report an informational message in libSoX; printf-style arguments must follow.
+*/
+#define lsx_report     sox_get_globals()->subsystem=__FILE__,lsx_report_impl
+
+/**
+Plugins API:
+Report a debug message in libSoX; printf-style arguments must follow.
+*/
+#define lsx_debug      sox_get_globals()->subsystem=__FILE__,lsx_debug_impl
+
+/**
+Plugins API:
+String name and integer values for enumerated types (type metadata), for use
+with LSX_ENUM_ITEM, lsx_find_enum_text, and lsx_find_enum_value.
+*/
+typedef struct lsx_enum_item {
+    char const *text; /**< String name of enumeration. */
+    unsigned value;   /**< Integer value of enumeration. */
+} lsx_enum_item;
+
+/**
+Plugins API:
+Declares a static instance of an lsx_enum_item structure in format
+{ "item", prefixitem }, for use in declaring lsx_enum_item[] arrays.
+@param prefix The prefix to prepend to the item in the enumeration symbolic name.
+@param item   The user-visible text name of the item (must also be a valid C symbol name).
+*/
+#define LSX_ENUM_ITEM(prefix, item) {#item, prefix##item},
+
+/**
+Plugins API:
+Flags for use with lsx_find_enum_item.
+*/
+enum
+{
+    lsx_find_enum_item_none = 0, /**< Default parameters (case-insensitive). */
+    lsx_find_enum_item_case_sensitive = 1 /**< Enable case-sensitive search. */
+};
+
+/**
+Plugins API:
+Looks up an enumeration by name in an array of lsx_enum_items.
+@returns the corresponding item, or null if not found.
+*/
+LSX_RETURN_OPT LSX_RETURN_PURE
+lsx_enum_item const *
+LSX_API
+lsx_find_enum_text(
+    LSX_PARAM_IN_Z char const * text, /**< Name of enumeration to find. */
+    LSX_PARAM_IN lsx_enum_item const * lsx_enum_items, /**< Array of items to search, with text == NULL for last item. */
+    int flags /**< Search flags: 0 (case-insensitive) or lsx_find_enum_item_case_sensitive (case-sensitive). */
+    );
+
+/**
+Plugins API:
+Looks up an enumeration by value in an array of lsx_enum_items.
+@returns the corresponding item, or null if not found.
+*/
+LSX_RETURN_OPT LSX_RETURN_PURE
+lsx_enum_item const *
+LSX_API
+lsx_find_enum_value(
+    unsigned value, /**< Enumeration value to find. */
+    LSX_PARAM_IN lsx_enum_item const * lsx_enum_items /**< Array of items to search, with text == NULL for last item. */
+    );
+
+/**
+Plugins API:
+Looks up a command-line argument in a set of enumeration names, showing an
+error message if the argument is not found in the set of names.
+@returns The enumeration value corresponding to the matching enumeration, or
+INT_MAX if the argument does not match any enumeration name.
+*/
+LSX_RETURN_PURE
+int
+LSX_API
+lsx_enum_option(
+    int c, /**< Option character to which arg is associated, for example with -a, c would be 'a'. */
+    LSX_PARAM_IN_Z char const * arg, /**< Argument to find in enumeration list. */
+    LSX_PARAM_IN lsx_enum_item const * items /**< Array of items to search, with text == NULL for last item. */
+    );
+
+/**
+Plugins API:
+Determines whether the specified string ends with the specified suffix (case-sensitive).
+@returns true if the specified string ends with the specified suffix.
+*/
+LSX_RETURN_PURE
+sox_bool
+LSX_API
+lsx_strends(
+    LSX_PARAM_IN_Z char const * str, /**< String to search. */
+    LSX_PARAM_IN_Z char const * end  /**< Suffix to search for. */
+    );
+
+/**
+Plugins API:
+Finds the file extension for a filename.
+@returns the file extension, not including the '.', or null if filename does
+not have an extension.
+*/
+LSX_RETURN_VALID_Z LSX_RETURN_PURE
+char const *
+LSX_API
+lsx_find_file_extension(
+    LSX_PARAM_IN_Z char const * pathname /**< Filename to search for extension. */
+    );
+
+/**
+Plugins API:
+Formats the specified number with up to three significant figures and adds a
+metric suffix in place of the exponent, such as 1.23G.
+@returns A static buffer with the formatted number, valid until the next time
+this function is called (note: not thread safe).
+*/
+LSX_RETURN_VALID_Z
+char const *
+LSX_API
+lsx_sigfigs3(
+    double number /**< Number to be formatted. */
+    );
+
+/**
+Plugins API:
+Formats the specified number as a percentage, showing up to three significant
+figures.
+@returns A static buffer with the formatted number, valid until the next time
+this function is called (note: not thread safe).
+*/
+LSX_RETURN_VALID_Z
+char const *
+LSX_API
+lsx_sigfigs3p(
+    double percentage /**< Number to be formatted. */
+    );
+
+/**
+Plugins API:
+Allocates, deallocates, or resizes; like C's realloc, except that this version
+terminates the running application if unable to allocate the requested memory.
+@returns New buffer, or null if buffer was freed.
+*/
+LSX_RETURN_OPT
+void *
+LSX_API
+lsx_realloc(
+    LSX_PARAM_IN_OPT void *ptr, /**< Pointer to be freed or resized, or null if allocating a new buffer. */
+    size_t newsize /**< New size for buffer, or 0 to free the buffer. */
+    );
+
+/**
+Plugins API:
+Like strcmp, except that the characters are compared without regard to case.
+@returns 0 (s1 == s2), negative (s1 < s2), or positive (s1 > s2).
+*/
+LSX_RETURN_PURE
+int
+LSX_API
+lsx_strcasecmp(
+    LSX_PARAM_IN_Z char const * s1, /**< First string. */
+    LSX_PARAM_IN_Z char const * s2  /**< Second string. */
+    );
+
+
+/**
+Plugins API:
+Like strncmp, except that the characters are compared without regard to case.
+@returns 0 (s1 == s2), negative (s1 < s2), or positive (s1 > s2).
+*/
+LSX_RETURN_PURE
+int
+LSX_API
+lsx_strncasecmp(
+    LSX_PARAM_IN_Z char const * s1, /**< First string. */
+    LSX_PARAM_IN_Z char const * s2, /**< Second string. */
+    size_t n /**< Maximum number of characters to examine. */
+    );
+
+/**
+Plugins API:
+Is option argument unsupported, required, or optional.
+*/
+typedef enum lsx_option_arg_t {
+    lsx_option_arg_none, /**< Option does not have an argument. */
+    lsx_option_arg_required, /**< Option requires an argument. */
+    lsx_option_arg_optional /**< Option can optionally be followed by an argument. */
+} lsx_option_arg_t;
+
+/**
+Plugins API:
+lsx_getopt_init options.
+*/
+typedef enum lsx_getopt_flags_t {
+    lsx_getopt_flag_none = 0,      /**< no flags (no output, not long-only) */
+    lsx_getopt_flag_opterr = 1,    /**< if set, invalid options trigger lsx_warn output */
+    lsx_getopt_flag_longonly = 2   /**< if set, recognize -option as a long option */
+} lsx_getopt_flags_t;
+
+/**
+Plugins API:
+lsx_getopt long option descriptor.
+*/
+typedef struct lsx_option_t {
+    char const *     name;    /**< Name of the long option. */
+    lsx_option_arg_t has_arg; /**< Whether the long option supports an argument and, if so, whether the argument is required or optional. */
+    int *            flag;    /**< Flag to set if argument is present. */
+    int              val;     /**< Value to put in flag if argument is present. */
+} lsx_option_t;
+
+/**
+Plugins API:
+lsx_getopt session information (initialization data and state).
+*/
+typedef struct lsx_getopt_t {
+    int                  argc;     /**< IN    argc:      Number of arguments in argv */
+    char * const *       argv;     /**< IN    argv:      Array of arguments */
+    char const *         shortopts;/**< IN    shortopts: Short option characters */
+    lsx_option_t const * longopts; /**< IN    longopts:  Array of long option descriptors */
+    lsx_getopt_flags_t   flags;    /**< IN    flags:     Flags for longonly and opterr */
+    char const *         curpos;   /**< INOUT curpos:    Maintains state between calls to lsx_getopt */
+    int                  ind;      /**< INOUT optind:    Maintains the index of next element to be processed */
+    int                  opt;      /**< OUT   optopt:    Receives the option character that caused error */
+    char const *         arg;      /**< OUT   optarg:    Receives the value of the option's argument */
+    int                  lngind;   /**< OUT   lngind:    Receives the index of the matched long option or -1 if not a long option */
+} lsx_getopt_t;
+
+/**
+Plugins API:
+Initializes an lsx_getopt_t structure for use with lsx_getopt.
+*/
+void
+LSX_API
+lsx_getopt_init(
+    LSX_PARAM_IN             int argc,                      /**< Number of arguments in argv */
+    LSX_PARAM_IN_COUNT(argc) char * const * argv,           /**< Array of arguments */
+    LSX_PARAM_IN_Z           char const * shortopts,        /**< Short options, for example ":abc:def::ghi" (+/- not supported) */
+    LSX_PARAM_IN_OPT         lsx_option_t const * longopts, /**< Array of long option descriptors */
+    LSX_PARAM_IN             lsx_getopt_flags_t flags,      /**< Flags for longonly and opterr */
+    LSX_PARAM_IN             int first,                     /**< First argv to check (usually 1) */
+    LSX_PARAM_OUT            lsx_getopt_t * state           /**< State object to be initialized */
+    );
+
+/**
+Plugins API:
+Gets the next option. Options are parameters that start with "-" or "--".
+If no more options, returns -1. If unrecognized short option, returns '?'.
+If a recognized short option is missing a required argument,
+return (shortopts[0]==':' ? ':' : '?'). If successfully recognized short
+option, return the recognized character. If successfully recognized long
+option, returns (option.flag ? 0 : option.val).
+Note: lsx_getopt does not permute the non-option arguments.
+@returns option character (short), val or 0 (long), or -1 (no more).
+*/
+int
+LSX_API
+lsx_getopt(
+    LSX_PARAM_INOUT lsx_getopt_t * state /**< The getopt state pointer. */
+    );
+
+/* WARNING END */
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif /* SOX_H */
diff --git a/freedv/branches/0.97/src/sox_biquad.c b/freedv/branches/0.97/src/sox_biquad.c
new file mode 100644 (file)
index 0000000..f5a0913
--- /dev/null
@@ -0,0 +1,129 @@
+//==========================================================================
+// Name:            sox_biquad.h
+// Purpose:         Interface into Sox Biquad filters 
+// Created:         Dec 1, 2012
+// Authors:         David Rowe
+// 
+// To test:
+//          $ gcc sox_biquad.c -o sox_biquad -DSOX_BIQUAD_UNITTEST -Wall \
+//            /path/to/sox-14.4.0/src/.libs/libsox.a -lm -lsndfile
+//          $ ./sox_biquad
+//
+// 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+
+#include <assert.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include "sox.h"
+
+#include "sox_biquad.h"
+
+
+#define N_MAX 1024
+
+int lsx_biquad_flow(sox_effect_t * effp, const sox_sample_t *ibuf,
+                    sox_sample_t *obuf, size_t *isamp, size_t *osamp);
+
+void sox_biquad_start(void)
+{
+    int r = sox_init();
+    assert(r == SOX_SUCCESS);
+}
+
+void sox_biquad_finish(void)
+{
+    sox_quit();
+}
+
+/*
+  Effect must be implemented by biquads.c in sox, arguments are just
+  like sox command line, for example:
+
+  char *argv[10];
+  argv[0] = "highpass"; argv[1]="1000"; argc=1;
+*/
+
+void *sox_biquad_create(int argc, const char *argv[])
+{
+    int ret;
+    sox_effect_t *e;
+    int (*start)(sox_effect_t *); /* function pointer to effect start func */
+    
+    e = sox_create_effect(sox_find_effect(argv[0])); assert(e != NULL);
+    ret = sox_effect_options(e, argc, (char * const*)&argv[1]);
+    assert(ret == SOX_SUCCESS);
+
+    start = e->handler.start;
+    e->in_signal.rate = 8000;     /* locked at FS=8000 Hz */
+    ret = start(e); assert(ret == SOX_SUCCESS);
+    
+    return (void *)e;
+}
+
+void sox_biquad_destroy(void *sbq) {
+    sox_effect_t *e = (sox_effect_t *)sbq;
+    free(e);
+}
+
+void sox_biquad_filter(void *sbq, short out[], short in[], int n)
+{
+    sox_effect_t *e = (sox_effect_t *)sbq;
+    sox_sample_t ibuf[N_MAX];
+    sox_sample_t obuf[N_MAX];
+    size_t isamp, osamp;
+    unsigned int clips;
+    SOX_SAMPLE_LOCALS; 
+    int i;
+
+    assert(n <= N_MAX);
+
+    clips = 0;
+    for(i=0; i<n; i++)
+        ibuf[i] = SOX_SIGNED_16BIT_TO_SAMPLE(in[i], clips);
+    isamp = osamp = (unsigned int)n;
+    lsx_biquad_flow(e, ibuf, obuf, &isamp, &osamp);
+    for(i=0; i<n; i++)
+        out[i] = SOX_SAMPLE_TO_SIGNED_16BIT(obuf[i], clips); 
+}
+
+
+#ifdef SOX_BIQUAD_UNITTEST
+#define N 20
+int main(void) {
+    void *sbq;
+    char *argv[10];
+    short in[N];
+    short out[N];
+    int   i, argc;;
+
+    for(i=0; i<N; i++)
+        in[i] = 0;
+    in[0] = 8000;
+
+    sox_biquad_start();
+    argv[0] = "highpass"; argv[1]="1000"; argc=1;
+    sbq = sox_biquad_create(argc, argv);
+
+    sox_biquad_filter(sbq, out, in, N);
+    for(i=0; i<N; i++)
+        printf("%d\n", out[i]);
+   
+    sox_biquad_destroy(sbq);
+    sox_biquad_finish();
+
+    return 0;
+}
+#endif
diff --git a/freedv/branches/0.97/src/sox_biquad.h b/freedv/branches/0.97/src/sox_biquad.h
new file mode 100644 (file)
index 0000000..f38de64
--- /dev/null
@@ -0,0 +1,40 @@
+//==========================================================================
+// Name:            sox_biquad.h
+// Purpose:         Interface into Sox Biquad filters 
+// Created:         Dec 1, 2012
+// Authors:         David Rowe
+// 
+// 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+
+#ifndef __SOX_BIQUAD__
+#define __SOX_BIQUAD__
+
+#ifdef __cplusplus
+extern "C" {
+
+#endif
+
+void sox_biquad_start(void);
+void sox_biquad_finish(void);
+void *sox_biquad_create(int argc, const char *argv[]);
+void sox_biquad_destroy(void *sbq);
+void sox_biquad_filter(void *sbq, short out[], short in[], int n);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/freedv/branches/0.97/src/topFrame.cpp b/freedv/branches/0.97/src/topFrame.cpp
new file mode 100644 (file)
index 0000000..c383a8f
--- /dev/null
@@ -0,0 +1,549 @@
+//==========================================================================
+// Name:            topFrame.cpp
+//
+// Purpose:         Implements simple wxWidgets application with GUI.
+// Created:         Apr. 9, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#include "topFrame.h"
+
+extern int g_playFileToMicInEventId;
+extern int g_recFileFromRadioEventId;
+extern int g_playFileFromRadioEventId;
+
+//=========================================================================
+// Code that lays out the main application window
+//=========================================================================
+TopFrame::TopFrame(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxFrame(parent, id, title, pos, size, style)
+{
+    this->SetSizeHints(wxDefaultSize, wxDefaultSize);
+    this->SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
+    this->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DLIGHT));
+    this->SetSizeHints(wxDefaultSize, wxDefaultSize);
+    this->SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
+    this->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DLIGHT));
+    //=====================================================
+    // Menubar Setup
+    m_menubarMain = new wxMenuBar(wxMB_DOCKABLE);
+    file = new wxMenu();
+
+    wxMenuItem* m_menuItemOnTop;
+    m_menuItemOnTop = new wxMenuItem(file, wxID_ANY, wxString(_("On Top")) , _("Always Top Window"), wxITEM_NORMAL);
+    file->Append(m_menuItemOnTop);
+
+    wxMenuItem* m_menuItemExit;
+    m_menuItemExit = new wxMenuItem(file, ID_EXIT, wxString(_("E&xit")) , _("Exit Program"), wxITEM_NORMAL);
+    file->Append(m_menuItemExit);
+
+    m_menubarMain->Append(file, _("&File"));
+
+    tools = new wxMenu();
+    wxMenuItem* m_menuItemAudio;
+    m_menuItemAudio = new wxMenuItem(tools, wxID_ANY, wxString(_("&Audio Config")) , wxEmptyString, wxITEM_NORMAL);
+    tools->Append(m_menuItemAudio);
+
+    wxMenuItem* m_menuItemRigCtrlCfg;
+    m_menuItemRigCtrlCfg = new wxMenuItem(tools, wxID_ANY, wxString(_("&PTT Config")) , wxEmptyString, wxITEM_NORMAL);
+    tools->Append(m_menuItemRigCtrlCfg);
+
+    wxMenuItem* m_menuItemOptions;
+    m_menuItemOptions = new wxMenuItem(tools, wxID_ANY, wxString(_("Options")) , wxEmptyString, wxITEM_NORMAL);
+    tools->Append(m_menuItemOptions);
+
+    wxMenuItem* m_menuItemFilter;
+    m_menuItemFilter = new wxMenuItem(tools, wxID_ANY, wxString(_("&Filter")) , wxEmptyString, wxITEM_NORMAL);
+    tools->Append(m_menuItemFilter);
+
+    wxMenuItem* m_menuItemPlayFileToMicIn;
+    m_menuItemPlayFileToMicIn = new wxMenuItem(tools, wxID_ANY, wxString(_("Start/Stop Play File - Mic In")) , wxEmptyString, wxITEM_NORMAL);
+    g_playFileToMicInEventId = m_menuItemPlayFileToMicIn->GetId();
+    tools->Append(m_menuItemPlayFileToMicIn);
+
+    wxMenuItem* m_menuItemRecFileFromRadio;
+    m_menuItemRecFileFromRadio = new wxMenuItem(tools, wxID_ANY, wxString(_("Start/Stop Record File - From Radio")) , wxEmptyString, wxITEM_NORMAL);
+    g_recFileFromRadioEventId = m_menuItemRecFileFromRadio->GetId();
+    tools->Append(m_menuItemRecFileFromRadio);
+
+    wxMenuItem* m_menuItemPlayFileFromRadio;
+    m_menuItemPlayFileFromRadio = new wxMenuItem(tools, wxID_ANY, wxString(_("Start/Stop Play File - From Radio")) , wxEmptyString, wxITEM_NORMAL);
+    g_playFileFromRadioEventId = m_menuItemPlayFileFromRadio->GetId();
+    tools->Append(m_menuItemPlayFileFromRadio);
+    m_menubarMain->Append(tools, _("&Tools"));
+
+    help = new wxMenu();
+    wxMenuItem* m_menuItemHelpUpdates;
+    m_menuItemHelpUpdates = new wxMenuItem(help, wxID_ANY, wxString(_("Check for Updates")) , wxEmptyString, wxITEM_NORMAL);
+    help->Append(m_menuItemHelpUpdates);
+    m_menuItemHelpUpdates->Enable(false);
+
+    wxMenuItem* m_menuItemAbout;
+    m_menuItemAbout = new wxMenuItem(help, ID_ABOUT, wxString(_("&About")) , _("About this program"), wxITEM_NORMAL);
+    help->Append(m_menuItemAbout);
+
+    m_menubarMain->Append(help, _("&Help"));
+
+    this->SetMenuBar(m_menubarMain);
+
+    wxBoxSizer* bSizer1;
+    bSizer1 = new wxBoxSizer(wxHORIZONTAL);
+
+    //=====================================================
+    // Left side
+    //=====================================================
+    wxBoxSizer* leftSizer;
+    leftSizer = new wxBoxSizer(wxVERTICAL);
+
+    wxStaticBoxSizer* snrSizer;
+    snrSizer = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("SNR")), wxVERTICAL);
+
+    //------------------------------
+    // S/N ratio Guage (vert. bargraph)
+    //------------------------------
+    m_gaugeSNR = new wxGauge(this, wxID_ANY, 20, wxDefaultPosition, wxSize(15,135), wxGA_SMOOTH|wxGA_VERTICAL);
+    m_gaugeSNR->SetToolTip(_("Displays signal to noise ratio in dB."));
+    snrSizer->Add(m_gaugeSNR, 1, wxALIGN_CENTER_HORIZONTAL|wxALL, 10);
+
+    //------------------------------
+    // Box for S/N ratio (Numeric)
+    //------------------------------
+    m_textSNR = new wxStaticText(this, wxID_ANY, wxT(" 0.0"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE);
+    snrSizer->Add(m_textSNR, 0, wxALIGN_CENTER_HORIZONTAL, 1);
+
+    //------------------------------
+    // S/N ratio slow Checkbox
+    //------------------------------
+    m_ckboxSNR = new wxCheckBox(this, wxID_ANY, _("Slow"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
+    m_ckboxSNR->SetToolTip(_("Smooth but slow SNR estimation"));
+    snrSizer->Add(m_ckboxSNR, 0, wxALIGN_CENTER_HORIZONTAL, 5);
+
+    leftSizer->Add(snrSizer, 2, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxALL, 1);
+
+    //------------------------------
+    // Sync  Indicator box
+    //------------------------------
+    wxStaticBoxSizer* sbSizer3_33;
+    sbSizer3_33 = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Sync")), wxVERTICAL);
+
+    m_rbSync = new wxRadioButton( this, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
+    m_rbSync->SetForegroundColour( wxColour( 255, 0, 0 ) );
+    sbSizer3_33->Add(m_rbSync, 0, wxALIGN_CENTER|wxALL, 1);
+    leftSizer->Add(sbSizer3_33,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
+
+    //------------------------------
+    // BER Frames box
+    //------------------------------
+
+    wxStaticBoxSizer* sbSizer_ber;
+    sbSizer_ber = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Bit Error Rate")), wxVERTICAL);
+
+    m_BtnBerReset = new wxButton(this, wxID_ANY, _("Reset"), wxDefaultPosition, wxDefaultSize, 0);
+    sbSizer_ber->Add(m_BtnBerReset, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
+
+    m_textBits = new wxStaticText(this, wxID_ANY, wxT("Bits: 0"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
+    sbSizer_ber->Add(m_textBits, 0, wxALIGN_LEFT, 1);
+    m_textErrors = new wxStaticText(this, wxID_ANY, wxT("Errs: 0"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
+    sbSizer_ber->Add(m_textErrors, 0, wxALIGN_LEFT, 1);
+    m_textBER = new wxStaticText(this, wxID_ANY, wxT("BER: 0.0"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
+    sbSizer_ber->Add(m_textBER, 0, wxALIGN_LEFT, 1);
+
+    leftSizer->Add(sbSizer_ber,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
+
+    //------------------------------
+    // Signal Level(vert. bargraph)
+    //------------------------------
+    wxStaticBoxSizer* levelSizer;
+    levelSizer = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Level")), wxVERTICAL);
+
+    m_textLevel = new wxStaticText(this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(60,-1), wxALIGN_CENTRE);
+    m_textLevel->SetForegroundColour(wxColour(255,0,0));
+    levelSizer->Add(m_textLevel, 0, wxALIGN_LEFT, 1);
+
+    m_gaugeLevel = new wxGauge(this, wxID_ANY, 100, wxDefaultPosition, wxSize(15,135), wxGA_SMOOTH|wxGA_VERTICAL);
+    m_gaugeLevel->SetToolTip(_("Peak of From Radio in Rx, or peak of From Mic in Tx mode.  If Red you should reduce your levels"));
+    levelSizer->Add(m_gaugeLevel, 1, wxALIGN_CENTER_HORIZONTAL|wxALL, 10);
+
+    leftSizer->Add(levelSizer, 2, wxALIGN_CENTER|wxALL|wxEXPAND, 1);
+
+    bSizer1->Add(leftSizer, 0, wxALL|wxEXPAND, 5);
+
+    //=====================================================
+    // Center Section
+    //=====================================================
+    wxBoxSizer* centerSizer;
+    centerSizer = new wxBoxSizer(wxVERTICAL);
+    wxBoxSizer* upperSizer;
+    upperSizer = new wxBoxSizer(wxVERTICAL);
+
+    //=====================================================
+    // Tabbed Notebook control containing display graphs
+    //=====================================================
+    //m_auiNbookCtrl = new wxAuiNotebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_NB_BOTTOM|wxAUI_NB_DEFAULT_STYLE);
+    //long style = wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_MOVE | wxAUI_NB_SCROLL_BUTTONS | wxAUI_NB_CLOSE_ON_ACTIVE_TAB | wxAUI_NB_MIDDLE_CLICK_CLOSE;
+    long nb_style = wxAUI_NB_BOTTOM | wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_MOVE | wxAUI_NB_SCROLL_BUTTONS;
+    m_auiNbookCtrl = new wxAuiNotebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, nb_style);
+    // This line sets the fontsize for the tabs on the notebook control
+    m_auiNbookCtrl->SetFont(wxFont(8, 70, 90, 90, false, wxEmptyString));
+
+    upperSizer->Add(m_auiNbookCtrl, 1, wxALIGN_TOP|wxEXPAND, 1);
+    centerSizer->Add(upperSizer, 1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALIGN_TOP|wxEXPAND, 0);
+
+    // lower middle used for user ID
+
+    wxBoxSizer* lowerSizer;
+    lowerSizer = new wxBoxSizer(wxHORIZONTAL);
+
+    m_BtnCallSignReset = new wxButton(this, wxID_ANY, _("Clear"), wxDefaultPosition, wxDefaultSize, 0);
+    lowerSizer->Add(m_BtnCallSignReset, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
+
+    wxBoxSizer* bSizer15;
+    bSizer15 = new wxBoxSizer(wxVERTICAL);
+    m_txtCtrlCallSign = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
+    m_txtCtrlCallSign->SetToolTip(_("Call Sign of transmitting station will appear here"));
+    bSizer15->Add(m_txtCtrlCallSign, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 5);
+    lowerSizer->Add(bSizer15, 1, wxEXPAND, 5);
+
+    wxStaticBoxSizer* sbSizer_Checksum = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Checksums")), wxHORIZONTAL);
+
+    wxStaticText *goodLabel = new wxStaticText(this, wxID_ANY, wxT("Good: "), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE);
+    sbSizer_Checksum->Add(goodLabel, 0, 0, 2);
+    m_txtChecksumGood = new wxStaticText(this, wxID_ANY, wxT("0"), wxDefaultPosition, wxSize(30,-1), wxALIGN_CENTRE);
+    sbSizer_Checksum->Add(m_txtChecksumGood, 0, 0, 2);
+
+    wxStaticText *badLabel = new wxStaticText(this, wxID_ANY, wxT("Bad: "), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE);
+    sbSizer_Checksum->Add(badLabel, 0, 0, 1);
+    m_txtChecksumBad = new wxStaticText(this, wxID_ANY, wxT("0"), wxDefaultPosition, wxSize(30,-1), wxALIGN_CENTRE);
+    sbSizer_Checksum->Add(m_txtChecksumBad, 0, 0, 1);
+
+    lowerSizer->Add(sbSizer_Checksum, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
+
+    //=====================================================
+    // These are the buttons that autosend the userid (?)
+    //=====================================================
+
+    // DR 4 Dec - taken off for screen for Beta release to avoid questions on their use until
+    // we implement this feature
+ #ifdef UNIMPLEMENTED
+    wxBoxSizer* bSizer141;
+    bSizer141 = new wxBoxSizer(wxHORIZONTAL);
+
+    // TxID
+    //---------
+    m_togTxID = new wxToggleButton(this, wxID_ANY, _("TxID"), wxDefaultPosition, wxDefaultSize, 0);
+    m_togTxID->SetToolTip(_("Send Tx ID information"));
+    bSizer141->Add(m_togTxID, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
+
+    // RxID
+    //---------
+    m_togRxID = new wxToggleButton(this, wxID_ANY, _("RxID"), wxDefaultPosition, wxDefaultSize, 0);
+    m_togRxID->SetToolTip(_("Enable reception of ID information"));
+    bSizer141->Add(m_togRxID, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_LEFT|wxALL|wxFIXED_MINSIZE, 5);
+
+    lowerSizer->Add(bSizer141, 0, wxALIGN_RIGHT, 5);
+#endif
+
+    centerSizer->Add(lowerSizer, 0, wxALIGN_BOTTOM|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 2);
+    bSizer1->Add(centerSizer, 4, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 1);
+
+    //=====================================================
+    // Right side
+    //=====================================================
+    wxBoxSizer* rightSizer;
+    rightSizer = new wxBoxSizer(wxVERTICAL);
+
+    //=====================================================
+    // Squelch Slider Control
+    //=====================================================
+    wxStaticBoxSizer* sbSizer3;
+    sbSizer3 = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Squelch")), wxVERTICAL);
+
+    m_sliderSQ = new wxSlider(this, wxID_ANY, 0, 0, 40, wxDefaultPosition, wxSize(-1,80), wxSL_AUTOTICKS|wxSL_INVERSE|wxSL_VERTICAL);
+    m_sliderSQ->SetToolTip(_("Set Squelch level in dB."));
+
+    sbSizer3->Add(m_sliderSQ, 1, wxALIGN_CENTER_HORIZONTAL, 0);
+
+    //------------------------------
+    // Squelch Level static text box
+    //------------------------------
+    m_textSQ = new wxStaticText(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE);
+
+    sbSizer3->Add(m_textSQ, 0, wxALIGN_CENTER_HORIZONTAL, 0);
+
+    //------------------------------
+    // Squelch Toggle Checkbox
+    //------------------------------
+    m_ckboxSQ = new wxCheckBox(this, wxID_ANY, _(""), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
+
+    sbSizer3->Add(m_ckboxSQ, 0, wxALIGN_CENTER_HORIZONTAL, 0);
+    rightSizer->Add(sbSizer3, 2, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 0);
+
+    //rightSizer->Add(sbSizer3_33,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
+
+    /* new --- */
+
+    //------------------------------
+    // Mode box
+    //------------------------------
+    wxStaticBoxSizer* sbSizer_mode;
+    sbSizer_mode = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Mode")), wxVERTICAL);
+
+    m_rb1400old = new wxRadioButton( this, wxID_ANY, wxT("1400 V0.91"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
+    sbSizer_mode->Add(m_rb1400old, 0, wxALIGN_LEFT|wxALL, 1);
+#ifdef DISABLED_FEATURE
+    m_rb1400 = new wxRadioButton( this, wxID_ANY, wxT("1400"), wxDefaultPosition, wxDefaultSize, 0);
+    sbSizer_mode->Add(m_rb1400, 0, wxALIGN_LEFT|wxALL, 1);
+#endif
+    m_rb1600 = new wxRadioButton( this, wxID_ANY, wxT("1600"), wxDefaultPosition, wxDefaultSize, 0);
+    sbSizer_mode->Add(m_rb1600, 0, wxALIGN_LEFT|wxALL, 1);
+    m_rb1600->SetValue(true);
+    m_rb1600Wide = new wxRadioButton( this, wxID_ANY, wxT("1600 Wide"), wxDefaultPosition, wxDefaultSize, 0);
+    sbSizer_mode->Add(m_rb1600Wide, 0, wxALIGN_LEFT|wxALL, 1);
+#ifdef DISABLED_FEATURE
+    m_rb2000 = new wxRadioButton( this, wxID_ANY, wxT("2000"), wxDefaultPosition, wxDefaultSize, 0);
+    sbSizer_mode->Add(m_rb2000, 0, wxALIGN_LEFT|wxALL, 1);
+#endif
+
+    rightSizer->Add(sbSizer_mode,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
+
+    #ifdef MOVED_TO_OPTIONS_DIALOG
+    /* new --- */
+
+    //------------------------------
+    // Test Frames box
+    //------------------------------
+
+    wxStaticBoxSizer* sbSizer_testFrames;
+    sbSizer_testFrames = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Test Frames")), wxVERTICAL);
+
+    m_ckboxTestFrame = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
+    sbSizer_testFrames->Add(m_ckboxTestFrame, 0, wxALIGN_LEFT, 0);
+
+    rightSizer->Add(sbSizer_testFrames,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
+    #endif
+
+    //=====================================================
+    // Control Toggles box
+    //=====================================================
+    wxStaticBoxSizer* sbSizer5;
+    sbSizer5 = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Control")), wxVERTICAL);
+    wxBoxSizer* bSizer1511;
+    bSizer1511 = new wxBoxSizer(wxVERTICAL);
+
+    //-------------------------------
+    // Stop/Stop signal processing (rx and tx)
+    //-------------------------------
+    m_togBtnOnOff = new wxToggleButton(this, wxID_ANY, _("Start"), wxDefaultPosition, wxDefaultSize, 0);
+    m_togBtnOnOff->SetToolTip(_("Begin/End receiving data."));
+    bSizer1511->Add(m_togBtnOnOff, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
+    sbSizer5->Add(bSizer1511, 0, wxEXPAND, 1);
+
+#ifdef UNIMPLEMENTED
+    //------------------------------
+    // Toggle Loopback button for RX
+    //------------------------------
+    wxBoxSizer* bSizer15113;
+    bSizer15113 = new wxBoxSizer(wxHORIZONTAL);
+    wxBoxSizer* bSizer15111;
+    bSizer15111 = new wxBoxSizer(wxVERTICAL);
+    wxSize wxSz = wxSize(44, 30);
+    m_togBtnLoopRx = new wxToggleButton(this, wxID_ANY, _("Loop\nRX"), wxDefaultPosition, wxSz, 0);
+    m_togBtnLoopRx->SetFont(wxFont(6, 70, 90, 90, false, wxEmptyString));
+    m_togBtnLoopRx->SetToolTip(_("Loopback Receive audio data."));
+
+    bSizer15111->Add(m_togBtnLoopRx, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 0);
+
+    //sbSizer5->Add(bSizer15111, 0, wxEXPAND, 1);
+    bSizer15113->Add(bSizer15111, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 0);
+
+    //------------------------------
+    // Toggle Loopback button for Tx
+    //------------------------------
+    wxBoxSizer* bSizer15112;
+    bSizer15112 = new wxBoxSizer(wxVERTICAL);
+    m_togBtnLoopTx = new wxToggleButton(this, wxID_ANY, _("Loop\nTX"), wxDefaultPosition, wxSz, 0);
+    m_togBtnLoopTx->SetFont(wxFont(6, 70, 90, 90, false, wxEmptyString));
+    m_togBtnLoopTx->SetToolTip(_("Loopback Transmit audio data."));
+
+    bSizer15112->Add(m_togBtnLoopTx, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 0);
+    bSizer15113->Add(bSizer15112, 0,  wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 0);
+
+    sbSizer5->Add(bSizer15113, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
+#endif
+
+    //------------------------------
+    // Split Frequency Mode Toggle
+    //------------------------------
+    wxBoxSizer* bSizer151;
+    bSizer151 = new wxBoxSizer(wxVERTICAL);
+
+    m_togBtnSplit = new wxToggleButton(this, wxID_ANY, _("Split"), wxDefaultPosition, wxDefaultSize, 0);
+    m_togBtnSplit->SetToolTip(_("Toggle split frequency mode."));
+
+    bSizer151->Add(m_togBtnSplit, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
+    sbSizer5->Add(bSizer151, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 1);
+    wxBoxSizer* bSizer13;
+    bSizer13 = new wxBoxSizer(wxVERTICAL);
+
+    //------------------------------
+    // Analog Passthrough Toggle
+    //------------------------------
+    m_togBtnAnalog = new wxToggleButton(this, wxID_ANY, _("Analog"), wxDefaultPosition, wxDefaultSize, 0);
+    m_togBtnAnalog->SetToolTip(_("Toggle analog/digital operation."));
+    bSizer13->Add(m_togBtnAnalog, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
+    sbSizer5->Add(bSizer13, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
+
+    // not implemented on fdmdv2
+#ifdef ALC
+    //------------------------------
+    // Toggle for ALC
+    //------------------------------
+    wxBoxSizer* bSizer14;
+    bSizer14 = new wxBoxSizer(wxVERTICAL);
+    m_togBtnALC = new wxToggleButton(this, wxID_ANY, _("ALC"), wxDefaultPosition, wxDefaultSize, 0);
+    m_togBtnALC->SetToolTip(_("Toggle automatic level control mode."));
+
+    bSizer14->Add(m_togBtnALC, 0, wxALL, 1);
+    sbSizer5->Add(bSizer14, 0, wxALIGN_CENTER|wxALIGN_CENTER_HORIZONTAL|wxALL, 1);
+#endif
+
+    //------------------------------
+    // Toggle Transmit/Receive relays
+    //------------------------------
+    wxBoxSizer* bSizer11;
+    bSizer11 = new wxBoxSizer(wxVERTICAL);
+    m_btnTogPTT = new wxToggleButton(this, wxID_ANY, _("PTT"), wxDefaultPosition, wxDefaultSize, 0);
+    m_btnTogPTT->SetToolTip(_("Push to Talk - Switch between Receive and Transmit - you can also use the space bar "));
+    bSizer11->Add(m_btnTogPTT, 1, wxALIGN_CENTER|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
+    sbSizer5->Add(bSizer11, 2, wxEXPAND, 1);
+    rightSizer->Add(sbSizer5, 2, wxALIGN_CENTER|wxALL|wxEXPAND, 3);
+    bSizer1->Add(rightSizer, 0, wxALL|wxEXPAND, 3);
+    this->SetSizer(bSizer1);
+    this->Layout();
+    m_statusBar1 = this->CreateStatusBar(3, wxST_SIZEGRIP, wxID_ANY);
+
+    //=====================================================
+    // End of layout
+    //=====================================================
+
+    //-------------------
+    // Connect Events
+    //-------------------
+    this->Connect(wxEVT_CLOSE_WINDOW, wxCloseEventHandler(TopFrame::topFrame_OnClose));
+    this->Connect(wxEVT_PAINT, wxPaintEventHandler(TopFrame::topFrame_OnPaint));
+    this->Connect(wxEVT_SIZE, wxSizeEventHandler(TopFrame::topFrame_OnSize));
+    this->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::topFrame_OnUpdateUI));
+
+    this->Connect(m_menuItemExit->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnExit));
+    this->Connect(m_menuItemOnTop->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnTop));
+
+    this->Connect(m_menuItemAudio->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsAudio));
+    this->Connect(m_menuItemAudio->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsAudioUI));
+    this->Connect(m_menuItemFilter->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsFilter));
+    this->Connect(m_menuItemFilter->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsFilterUI));
+    this->Connect(m_menuItemRigCtrlCfg->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsComCfg));
+    this->Connect(m_menuItemRigCtrlCfg->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsComCfgUI));
+    this->Connect(m_menuItemOptions->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsOptions));
+    this->Connect(m_menuItemOptions->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsOptionsUI));
+
+    this->Connect(m_menuItemPlayFileToMicIn->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnPlayFileToMicIn));
+    this->Connect(m_menuItemRecFileFromRadio->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnRecFileFromRadio));
+    this->Connect(m_menuItemPlayFileFromRadio->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnPlayFileFromRadio));
+
+    this->Connect(m_menuItemHelpUpdates->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnHelpCheckUpdates));
+    this->Connect(m_menuItemHelpUpdates->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnHelpCheckUpdatesUI));
+    this->Connect(m_menuItemAbout->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnHelpAbout));
+    //m_togRxID->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnRxID), NULL, this);
+    //m_togTxID->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnTxID), NULL, this);
+    m_sliderSQ->Connect(wxEVT_SCROLL_TOP, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Connect(wxEVT_SCROLL_BOTTOM, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Connect(wxEVT_SCROLL_LINEUP, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Connect(wxEVT_SCROLL_LINEDOWN, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Connect(wxEVT_SCROLL_PAGEUP, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Connect(wxEVT_SCROLL_PAGEDOWN, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Connect(wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Connect(wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Connect(wxEVT_SCROLL_BOTTOM, wxScrollEventHandler(TopFrame::OnSliderScrollBottom), NULL, this);
+    m_sliderSQ->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(TopFrame::OnCmdSliderScrollChanged), NULL, this);
+    m_sliderSQ->Connect(wxEVT_SCROLL_TOP, wxScrollEventHandler(TopFrame::OnSliderScrollTop), NULL, this);
+    m_ckboxSQ->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(TopFrame::OnCheckSQClick), NULL, this);
+
+    m_ckboxSNR->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(TopFrame::OnCheckSNRClick), NULL, this);
+
+    m_togBtnOnOff->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnOnOff), NULL, this);
+    m_togBtnSplit->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnSplitClick), NULL, this);
+    m_togBtnAnalog->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnAnalogClick), NULL, this);
+#ifdef ALC
+    m_togBtnALC->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnALCClick), NULL, this);
+#endif
+    m_btnTogPTT->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnPTT), NULL, this);
+
+    m_BtnCallSignReset->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnCallSignReset), NULL, this);
+    m_BtnBerReset->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnBerReset), NULL, this);
+}
+
+TopFrame::~TopFrame()
+{
+    //-------------------
+    // Disconnect Events
+    //-------------------
+    this->Disconnect(wxEVT_CLOSE_WINDOW, wxCloseEventHandler(TopFrame::topFrame_OnClose));
+    this->Disconnect(wxEVT_PAINT, wxPaintEventHandler(TopFrame::topFrame_OnPaint));
+    this->Disconnect(wxEVT_SIZE, wxSizeEventHandler(TopFrame::topFrame_OnSize));
+    this->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::topFrame_OnUpdateUI));
+    this->Disconnect(ID_EXIT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnExit));
+    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsAudio));
+    this->Disconnect(wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsAudioUI));
+    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsFilter));
+    this->Disconnect(wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsFilterUI));
+    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsComCfg));
+    this->Disconnect(wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsComCfgUI));
+    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsOptions));
+    this->Disconnect(wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsOptionsUI));
+
+    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnPlayFileToMicIn));
+    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnRecFileFromRadio));
+    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnPlayFileFromRadio));
+
+    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnHelpCheckUpdates));
+    this->Disconnect(wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnHelpCheckUpdatesUI));
+    this->Disconnect(ID_ABOUT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnHelpAbout));
+    //m_togRxID->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnRxID), NULL, this);
+    //m_togTxID->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnTxID), NULL, this);
+    m_sliderSQ->Disconnect(wxEVT_SCROLL_TOP, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Disconnect(wxEVT_SCROLL_BOTTOM, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Disconnect(wxEVT_SCROLL_LINEUP, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Disconnect(wxEVT_SCROLL_LINEDOWN, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Disconnect(wxEVT_SCROLL_PAGEUP, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Disconnect(wxEVT_SCROLL_PAGEDOWN, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Disconnect(wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Disconnect(wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Disconnect(wxEVT_SCROLL_BOTTOM, wxScrollEventHandler(TopFrame::OnSliderScrollBottom), NULL, this);
+    m_sliderSQ->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(TopFrame::OnCmdSliderScrollChanged), NULL, this);
+    m_sliderSQ->Disconnect(wxEVT_SCROLL_TOP, wxScrollEventHandler(TopFrame::OnSliderScrollTop), NULL, this);
+    m_ckboxSQ->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(TopFrame::OnCheckSQClick), NULL, this);
+
+    m_togBtnOnOff->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnOnOff), NULL, this);
+    m_togBtnSplit->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnSplitClick), NULL, this);
+    m_togBtnAnalog->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnAnalogClick), NULL, this);
+#ifdef ALC
+    m_togBtnALC->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnALCClick), NULL, this);
+#endif
+    m_btnTogPTT->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnPTT), NULL, this);
+
+}
+
diff --git a/freedv/branches/0.97/src/topFrame.h b/freedv/branches/0.97/src/topFrame.h
new file mode 100644 (file)
index 0000000..86ddb38
--- /dev/null
@@ -0,0 +1,182 @@
+//==========================================================================
+// Name:            topFrame.h
+//
+// Purpose:         Implements simple wxWidgets application with GUI.
+// Created:         Apr. 9, 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 Lesser 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 Lesser General Public License
+//  along with this program; if not, see <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#ifndef __TOPFRAME_H__
+#define __TOPFRAME_H__
+
+#include "version.h"
+#include <wx/artprov.h>
+#include <wx/xrc/xmlres.h>
+#include <wx/intl.h>
+#include <wx/string.h>
+#include <wx/bitmap.h>
+#include <wx/image.h>
+#include <wx/icon.h>
+#include <wx/menu.h>
+#include <wx/gdicmn.h>
+#include <wx/font.h>
+#include <wx/colour.h>
+#include <wx/settings.h>
+#include <wx/gauge.h>
+#include <wx/textctrl.h>
+#include <wx/sizer.h>
+#include <wx/statbox.h>
+#include <wx/aui/auibook.h>
+#include <wx/tglbtn.h>
+#include <wx/slider.h>
+#include <wx/checkbox.h>
+#include <wx/statusbr.h>
+#include <wx/frame.h>
+#include <wx/statbmp.h>
+#include <wx/stattext.h>
+#include <wx/button.h>
+#include <wx/dialog.h>
+#include <wx/radiobut.h>
+#include <wx/combobox.h>
+#include <wx/panel.h>
+#include <wx/listbox.h>
+#include <wx/notebook.h>
+#include <wx/listctrl.h>
+
+
+///////////////////////////////////////////////////////////////////////////
+
+#define ID_OPEN 1000
+#define ID_SAVE 1001
+#define ID_CLOSE 1002
+#define ID_EXIT 1003
+#define ID_COPY 1004
+#define ID_CUT 1005
+#define ID_PASTE 1006
+#define ID_OPTIONS 1007
+#define ID_ABOUT 1008
+
+///////////////////////////////////////////////////////////////////////////////
+/// Class TopFrame
+///////////////////////////////////////////////////////////////////////////////
+class TopFrame : public wxFrame
+{
+    private:
+
+    protected:
+        wxMenuBar* m_menubarMain;
+        wxMenu* file;
+        wxMenu* edit;
+        wxMenu* tools;
+        wxMenu* help;
+        wxGauge* m_gaugeSNR;
+        wxStaticText* m_textSNR;
+        wxCheckBox* m_ckboxSNR;
+        wxGauge* m_gaugeLevel;
+        wxStaticText* m_textLevel;
+
+        wxButton*     m_BtnCallSignReset;
+        wxTextCtrl*   m_txtCtrlCallSign;
+        wxStaticText* m_txtChecksumGood;
+        wxStaticText* m_txtChecksumBad;
+
+        wxSlider* m_sliderSQ;
+        wxCheckBox* m_ckboxSQ;
+        wxStaticText* m_textSQ;
+        wxStatusBar* m_statusBar1;
+
+        wxButton*     m_BtnBerReset;
+        wxStaticText  *m_textBits;
+        wxStaticText  *m_textErrors;
+        wxStaticText  *m_textBER;
+
+        wxRadioButton *m_rbSync;
+        wxRadioButton *m_rb1400old;
+        wxRadioButton *m_rb1400;
+        wxRadioButton *m_rb1600;
+        wxRadioButton *m_rb2000;
+        wxRadioButton *m_rb1600Wide;
+
+        // Virtual event handlers, overide them in your derived class
+        virtual void topFrame_OnClose( wxCloseEvent& event ) { event.Skip(); }
+        virtual void topFrame_OnPaint( wxPaintEvent& event ) { event.Skip(); }
+        virtual void topFrame_OnSize( wxSizeEvent& event ) { event.Skip(); }
+        virtual void topFrame_OnUpdateUI( wxUpdateUIEvent& event ) { event.Skip(); }
+
+        virtual void OnExit( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnTop( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnToolsAudio( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnToolsAudioUI( wxUpdateUIEvent& event ) { event.Skip(); }
+        virtual void OnToolsFilter( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnToolsFilterUI( wxUpdateUIEvent& event ) { event.Skip(); }
+        virtual void OnToolsOptions( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnToolsUDP( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnToolsOptionsUI( wxUpdateUIEvent& event ) { event.Skip(); }
+        virtual void OnToolsComCfg( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnToolsComCfgUI( wxUpdateUIEvent& event ) { event.Skip(); }
+        virtual void OnPlayFileToMicIn( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnRecFileFromRadio( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnPlayFileFromRadio( wxCommandEvent& event ) { event.Skip(); }
+
+        virtual void OnHelpCheckUpdates( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnHelpCheckUpdatesUI( wxUpdateUIEvent& event ) { event.Skip(); }
+        virtual void OnHelpAbout( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnTogBtnRxID( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnTogBtnTxID( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnCmdSliderScroll( wxScrollEvent& event ) { event.Skip(); }
+        virtual void OnSliderScrollBottom( wxScrollEvent& event ) { event.Skip(); }
+        virtual void OnCmdSliderScrollChanged( wxScrollEvent& event ) { event.Skip(); }
+        virtual void OnSliderScrollTop( wxScrollEvent& event ) { event.Skip(); }
+        virtual void OnCheckSQClick( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnCheckSNRClick( wxCommandEvent& event ) { event.Skip(); }
+
+        virtual void OnTogBtnLoopRx( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnTogBtnLoopTx( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnTogBtnOnOff( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnTogBtnSplitClick( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnTogBtnAnalogClick( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnTogBtnALCClick( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnTogBtnPTT( wxCommandEvent& event ) { event.Skip(); }
+
+        virtual void OnTogBtnSplitClickUI(wxUpdateUIEvent& event) { event.Skip(); }
+        virtual void OnTogBtnAnalogClickUI(wxUpdateUIEvent& event) { event.Skip(); }
+        virtual void OnTogBtnALCClickUI(wxUpdateUIEvent& event) { event.Skip(); }
+        virtual void OnTogBtnRxIDUI(wxUpdateUIEvent& event ) { event.Skip(); }
+        virtual void OnTogBtnTxIDUI(wxUpdateUIEvent& event ) { event.Skip(); }
+        virtual void OnTogBtnPTT_UI(wxUpdateUIEvent& event ) { event.Skip(); }
+        virtual void OnTogBtnOnOffUI(wxUpdateUIEvent& event ) { event.Skip(); }
+
+        virtual void OnCallSignReset( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnBerReset( wxCommandEvent& event ) { event.Skip(); }
+
+    public:
+        wxToggleButton* m_togRxID;
+        wxToggleButton* m_togTxID;
+        wxToggleButton* m_togBtnOnOff;
+        wxToggleButton* m_togBtnSplit;
+        wxToggleButton* m_togBtnAnalog;
+        wxToggleButton* m_togBtnALC;
+        wxToggleButton* m_btnTogPTT;
+        wxToggleButton* m_togBtnLoopRx;
+        wxToggleButton* m_togBtnLoopTx;
+        wxAuiNotebook* m_auiNbookCtrl;
+
+        TopFrame( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("FreeDV ") + _(FREEDV_VERSION), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(561,300 ), long style = wxDEFAULT_FRAME_STYLE|wxRESIZE_BORDER|wxTAB_TRAVERSAL );
+
+        ~TopFrame();
+};
+
+#endif //__TOPFRAME_H__
diff --git a/freedv/branches/0.97/src/varicode.c b/freedv/branches/0.97/src/varicode.c
new file mode 100644 (file)
index 0000000..26de09a
--- /dev/null
@@ -0,0 +1,479 @@
+//==========================================================================
+// Name:            varicode.h
+// Purpose:         Varicode encoded and decode functions
+// Created:         Nov 24, 2012
+// Authors:         David Rowe
+//
+// To test:
+//          $ gcc varicode.c -o varicode -DVARICODE_UNITTEST -Wall
+//          $ ./varicode
+// 
+// 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+
+#include <assert.h>
+#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "varicode.h"
+#include "varicode_table.h"
+
+
+/*
+  output is an unpacked array of bits of maximum size max_out.  Note
+  unpacked arrays are a more suitable form for modulator input.
+
+  Code 1 covers the entire ASCII char set.
+*/
+
+int varicode_encode1(short varicode_out[], char ascii_in[], int max_out, int n_in) {
+    int            n_out, index, n_zeros, v_len;
+    unsigned short byte1, byte2, packed;
+
+    n_out = 0;
+
+    while(n_in && (n_out < max_out)) {
+
+        assert((unsigned int)(*ascii_in) < 128);
+
+        index = 2*(unsigned int)(*ascii_in);
+        byte1 = varicode_table1[index];
+        byte2 = varicode_table1[index+1];
+        packed = (byte1 << 8) + byte2;
+
+        //printf("n_in: %d ascii_in: %c index: %d packed 0x%x\n", n_in, *ascii_in, index, packed);
+        ascii_in++;
+
+        n_zeros = 0;
+        v_len = 0;
+        while ((n_zeros < 2) && (n_out < max_out) && (v_len <= VARICODE_MAX_BITS)) {
+            if (packed & 0x8000) {
+                *varicode_out = 1;
+                n_zeros = 0;
+            }
+            else {
+                *varicode_out = 0;
+                n_zeros++;
+            }
+            //printf("packed: 0x%x *varicode_out: %d n_zeros: %d v_len: %d\n", packed, *varicode_out, n_zeros,v_len );
+            packed <<= 1;
+            varicode_out++;
+            n_out++;
+            v_len++;                
+        }
+        assert(v_len <= VARICODE_MAX_BITS);
+
+        n_in--;            
+    }
+
+    return n_out;
+}
+
+
+/*
+  Code 2 covers a subset, but is more efficient that Code 1 (282
+  compared to 1315 bits on unittest) Unsupported characters are
+  replaced by spaces.  We encode/decode two bits at a time.  
+*/
+
+int varicode_encode2(short varicode_out[], char ascii_in[], int max_out, int n_in) {
+    int            n_out, n_zeros, v_len, i;
+    unsigned short packed;
+
+    n_out = 0;
+
+    while(n_in && (n_out < max_out)) {
+
+        packed = varicode_table2[0]; // default to space if char not found
+          
+        // see if our character exists
+        for(i=0; i<sizeof(varicode_table2); i+=2) {
+            if (varicode_table2[i] == *ascii_in)
+                packed = (unsigned short)varicode_table2[i+1] << 8;
+        }
+
+        //printf("n_in: %d ascii_in: %c index: %d packed 0x%x\n", n_in, *ascii_in, index, packed);
+        ascii_in++;
+
+        n_zeros = 0;
+        v_len = 0;
+        while ((n_zeros < 2) && (n_out < max_out) && (v_len <= VARICODE_MAX_BITS)) {
+            if (packed & 0x8000)
+                varicode_out[0] = 1;
+            else
+                varicode_out[0] = 0;
+                    
+            if (packed & 0x4000)
+                varicode_out[1] = 1;
+            else
+                varicode_out[1] = 0;
+                
+            if (packed & 0xc000)
+                n_zeros = 0;
+            else
+                n_zeros += 2;
+
+            //printf("packed: 0x%x *varicode_out: %d n_zeros: %d v_len: %d\n", packed, *varicode_out, n_zeros,v_len );
+            packed <<= 2;
+            varicode_out +=2;
+            n_out += 2;
+            v_len += 2;
+        }
+        assert(v_len <= VARICODE_MAX_BITS);
+
+        n_in--;            
+    }
+
+    assert((n_out % 2) == 0);  /* outputs two bits at a time */
+
+    return n_out;
+}
+
+
+int varicode_encode(short varicode_out[], char ascii_in[], int max_out, int n_in, int code_num) {
+    
+    assert((code_num ==1) || (code_num ==2));
+
+    if (code_num == 1)
+        return varicode_encode1(varicode_out, ascii_in, max_out, n_in);
+    else
+       return  varicode_encode2(varicode_out, ascii_in, max_out, n_in);
+}
+
+
+void varicode_decode_init(struct VARICODE_DEC *dec_states, int code_num)
+{
+    assert((code_num ==1) || (code_num == 2));
+
+    dec_states->state = 0;
+    dec_states->n_zeros = 0;
+    dec_states->v_len = 0;
+    dec_states->packed = 0;
+    dec_states->code_num = code_num;
+    dec_states->n_in = 0;
+    dec_states->in[0] = dec_states->in[1] = 0;
+}
+
+
+/* Code 1 decode function, accepts one bit at a time */
+
+static int decode_one_bit(struct VARICODE_DEC *s, char *single_ascii, short varicode_in, int long_code)
+{
+    int            found=0, i;
+    unsigned short byte1, byte2;
+
+    //printf("decode_one_bit : state: %d varicode_in: %d packed: 0x%x n_zeros: %d\n",
+    //       s->state, varicode_in, s->packed, s->n_zeros);
+
+    if (s->state == 0) {
+        if (!varicode_in)
+            return 0;
+        else 
+            s->state = 1;
+    }
+
+    if (s->state == 1) {
+        if (varicode_in) {
+            s->packed |= (0x8000 >> s->v_len);
+            s->n_zeros = 0;
+        }
+        else {
+            s->n_zeros++;
+        }
+        s->v_len++;
+        found = 0;
+
+        /* end of character code */
+
+        if (s->n_zeros == 2) {
+            if (s->v_len) {
+                /* run thru table but note with bit errors we might not actually find a match */
+
+                byte1 = s->packed >> 8;
+                //printf("looking for byte1 : 0x%x ... ", byte1);
+                byte2 = s->packed & 0xff;
+
+                for(i=0; i<128; i++) {
+                    if ((byte1 == varicode_table1[2*i]) && (byte2 == varicode_table1[2*i+1])) {
+                        found = 1;
+                        *single_ascii = i;
+                    }
+                }
+            }
+            varicode_decode_init(s, s->code_num);
+        }
+
+        /* code can run too long if we have a bit error */
+
+        if (s->v_len > VARICODE_MAX_BITS)
+            varicode_decode_init(s, s->code_num);
+    }
+
+    return found;
+}
+
+
+/* Code 2 decode function, accepts two bits at a time */
+
+static int decode_two_bits(struct VARICODE_DEC *s, char *single_ascii, short varicode_in1, short varicode_in2)
+{
+    int            found=0, i;
+    unsigned short byte1;
+
+    if (s->state == 0) {
+        if (!(varicode_in1 || varicode_in2))
+            return 0;
+        else 
+            s->state = 1;
+    }
+
+    if (s->state == 1) {
+        if (varicode_in1)
+            s->packed |= (0x8000 >> s->v_len);
+        if (varicode_in2)
+            s->packed |= (0x4000 >> s->v_len);
+        if (varicode_in1 || varicode_in2)
+            s->n_zeros = 0;
+        else
+            s->n_zeros+=2;
+
+        s->v_len+=2;            
+        found = 0;
+
+        /* end of character code */
+
+        if (s->n_zeros == 2) {
+            if (s->v_len) {
+                /* run thru table but note with bit errors we might not actually find a match */
+
+                byte1 = s->packed >> 8;
+                //printf("looking for byte1 : 0x%x ... ", byte1);
+                for(i=0; i<sizeof(varicode_table2); i+=2) {
+                    //printf("byte1: 0x%x 0x%x\n", byte1, (unsigned char)varicode_table2[i+1]);
+                    if (byte1 == (unsigned char)varicode_table2[i+1]) {
+                        found = 1;
+                        *single_ascii = varicode_table2[i];
+                        //printf("found: %d i=%d char=%c ", found, i, *single_ascii);
+                    }
+                }
+            }
+            varicode_decode_init(s, s->code_num);
+        }
+
+        /* code can run too long if we have a bit error */
+
+        if (s->v_len > VARICODE_MAX_BITS)
+            varicode_decode_init(s, s->code_num);
+    }
+
+    return found;
+}
+
+
+int varicode_decode1(struct VARICODE_DEC *dec_states, char ascii_out[], short varicode_in[], int max_out, int n_in) {
+    int            output, n_out;
+    char           single_ascii = 0;
+
+    n_out = 0;
+
+    //printf("varicode_decode: n_in: %d\n", n_in);
+
+    while(n_in && (n_out < max_out)) {
+        output = decode_one_bit(dec_states, &single_ascii, varicode_in[0], 0);
+        varicode_in++;
+        n_in--;
+
+        if (output) {
+            *ascii_out++ = single_ascii;
+            n_out++;
+        }            
+    }
+
+    return n_out;
+}
+
+
+int varicode_decode2(struct VARICODE_DEC *dec_states, char ascii_out[], short varicode_in[], int max_out, int n_in) {
+    int            output, n_out;
+    char           single_ascii = 0;
+
+    n_out = 0;
+
+    //printf("varicode_decode2: n_in: %d varicode_in[0] %d dec_states->n_in: %d\n", n_in, varicode_in[0], dec_states->n_in);
+    //printf("%d ", varicode_in[0]);
+    while(n_in && (n_out < max_out)) {
+
+        // keep two bit buffer so we can process two at a time
+
+        dec_states->in[0] = dec_states->in[1];
+        dec_states->in[1] = varicode_in[0];
+        dec_states->n_in++;
+        varicode_in++;
+        n_in--;
+
+        if (dec_states->n_in == 2) {
+            output = decode_two_bits(dec_states, &single_ascii, dec_states->in[0], dec_states->in[1]);
+
+            dec_states->n_in = 0;
+            if (output) {
+                //printf("  output: %d single_ascii: 0x%x %c\n", output, (int)single_ascii, single_ascii);
+                *ascii_out++ = single_ascii;
+                n_out++;
+            }            
+        }
+    }
+
+    return n_out;
+}
+
+
+int varicode_decode(struct VARICODE_DEC *dec_states, char ascii_out[], short varicode_in[], int max_out, int n_in) {
+    if (dec_states->code_num == 1)
+        return varicode_decode1(dec_states, ascii_out, varicode_in, max_out, n_in);
+    else
+        return varicode_decode2(dec_states, ascii_out, varicode_in, max_out, n_in);
+}
+
+
+#ifdef VARICODE_UNITTEST
+void test_varicode(int code_num) {
+    char *ascii_in;
+    short *varicode;
+    int  i, n_varicode_bits_out, n_ascii_chars_out, length, half, n_out, j, len;
+    char *ascii_out;
+    struct VARICODE_DEC dec_states;
+
+    if (code_num == 1) {
+        printf("long code:\n");
+        length = sizeof(varicode_table1)/2;
+    }
+    else {
+        printf("short code:\n");
+        length = sizeof(varicode_table2)/2;
+    }
+    //length = 10;
+    ascii_in = (char*)malloc(length);
+    varicode = (short*)malloc(VARICODE_MAX_BITS*sizeof(short)*length);
+    ascii_out = (char*)malloc(length);
+
+    // 1. test all Varicode codes -------------------------------------------------------------
+
+    if (code_num == 1) {
+        for(i=0; i<length; i++)
+            ascii_in[i] = (char)i;
+    }
+    else {
+        for(i=0; i<length; i++)
+            ascii_in[i] = varicode_table2[2*i];
+    }
+    //printf("  ascii_in: %s\n", ascii_in);
+    n_varicode_bits_out = varicode_encode(varicode, ascii_in, VARICODE_MAX_BITS*length, length, code_num);
+
+    printf("  n_varicode_bits_out: %d\n", n_varicode_bits_out);
+    //for(i=0; i<n_varicode_bits_out; i++) {
+    //    printf("%d \n", varicode[i]);
+    //}
+
+    // split decode in half to test how it preserves state between calls 
+
+    varicode_decode_init(&dec_states, code_num);
+    half = n_varicode_bits_out/2;
+    n_ascii_chars_out  = varicode_decode(&dec_states, ascii_out, varicode, length, half);
+    // printf("  n_ascii_chars_out: %d\n", n_ascii_chars_out);
+
+    n_ascii_chars_out += varicode_decode(&dec_states, &ascii_out[n_ascii_chars_out], 
+                                         &varicode[half], length-n_ascii_chars_out, n_varicode_bits_out - half);
+    assert(n_ascii_chars_out == length);
+
+    printf("  n_ascii_chars_out: %d\n", n_ascii_chars_out);
+    printf("  average bits/character: %3.2f\n", (float)n_varicode_bits_out/n_ascii_chars_out);
+
+    //printf("ascii_out: %s\n", ascii_out);
+
+    if (memcmp(ascii_in, ascii_out, length) == 0)
+        printf("  Test 1 Pass\n");
+    else
+        printf("  Test 1 Fail\n");
+
+    // 2. Test some ascii with a run of zeros -----------------------------------------------------
+
+    sprintf(ascii_in, "CQ CQ CQ this is VK5DGR");
+        
+    assert(strlen(ascii_in) < length);
+    if (code_num == 2)
+        for(i=0; i<strlen(ascii_in); i++)
+            ascii_in[i] = tolower(ascii_in[i]);
+
+    for(i=0; i<3; i++) {
+        n_varicode_bits_out = varicode_encode(varicode, ascii_in, VARICODE_MAX_BITS*length, strlen(ascii_in), code_num);
+        n_ascii_chars_out   = varicode_decode(&dec_states, ascii_out, varicode, length, n_varicode_bits_out);
+        ascii_out[n_ascii_chars_out] = 0;
+
+        printf("  ascii_out: %s\n", ascii_out);
+        if (strcmp(ascii_in, ascii_out) == 0)
+            printf("  Test 2 Pass\n");
+        else
+            printf("  Test 2 Fail\n");
+
+        memset(varicode, 0, sizeof(short)*20);
+        n_ascii_chars_out = varicode_decode(&dec_states, ascii_out, varicode, length, 20);
+        assert(n_ascii_chars_out == 0);
+    }
+
+    // 3. Test receiving one bit at a time -----------------------------------------------------
+
+    sprintf(ascii_in, "s=vk5dgr qth=adelaide");
+    len = strlen(ascii_in);
+    ascii_in[len] = 13;
+    ascii_in[len+1] = 0;
+
+    assert(strlen(ascii_in) < length);
+    if (code_num == 2)
+        for(i=0; i<strlen(ascii_in); i++)
+            ascii_in[i] = tolower(ascii_in[i]);
+
+    for(i=0; i<3; i++) {
+        n_varicode_bits_out = varicode_encode(varicode, ascii_in, VARICODE_MAX_BITS*length, strlen(ascii_in), code_num);
+        printf("n_varicode_bits_out: %d\n", n_varicode_bits_out);
+
+        n_ascii_chars_out = 0;
+        for(j=0; j<n_varicode_bits_out; j++) {
+            n_out = varicode_decode(&dec_states, &ascii_out[n_ascii_chars_out], &varicode[j], 1, 1);
+            if (n_out) 
+                n_ascii_chars_out++;
+        }
+        ascii_out[n_ascii_chars_out] = 0;
+
+        printf("  ascii_out: %s\n", ascii_out);
+        if (strcmp(ascii_in, ascii_out) == 0)
+            printf("  Test 3 Pass\n");
+        else
+            printf("  Test 3 Fail\n");
+    }
+
+    free(ascii_in);
+    free(ascii_out);
+    free(varicode);
+}
+
+int main(void) {
+    test_varicode(1);
+    test_varicode(2);
+    return 0;
+}
+#endif
diff --git a/freedv/branches/0.97/src/varicode.h b/freedv/branches/0.97/src/varicode.h
new file mode 100644 (file)
index 0000000..4834a95
--- /dev/null
@@ -0,0 +1,51 @@
+//==========================================================================
+// Name:            varicode.h
+// Purpose:         Varicode encoded and decode functions
+// Created:         Nov 24, 2012
+// Authors:         David Rowe
+// 
+// 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+
+#ifndef __VARICODE__
+#define __VARICODE__
+
+#ifdef __cplusplus
+extern "C" {
+
+#endif
+
+#define VARICODE_MAX_BITS (10+2) /* max varicode bits for each ascii character */
+                                 /* 10 bits for code plus 2 0 bits for inter-character space */
+
+struct VARICODE_DEC {
+    int            state;
+    int            n_zeros;
+    int            v_len;
+    unsigned short packed;
+    int            code_num;
+    int            n_in;
+    int            in[2];
+};
+    
+int varicode_encode(short varicode_out[], char ascii_in[], int max_out, int n_in, int code_num);
+void varicode_decode_init(struct VARICODE_DEC *dec_states, int code_num);
+int varicode_decode(struct VARICODE_DEC *dec_states, char ascii_out[], short varicode_in[], int max_out, int n_in);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/freedv/branches/0.97/src/varicode_table.h b/freedv/branches/0.97/src/varicode_table.h
new file mode 100644 (file)
index 0000000..08f38fd
--- /dev/null
@@ -0,0 +1,338 @@
+//==========================================================================
+// Name:            varicode_table.h
+// Purpose:         Varicode look up table
+// Created:         Nov 24, 2012
+// Authors:         Clint Turner, KA7OEI,  Peter Martinez, G3PLX
+// 
+// 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+
+/* The following table defines the PKS31 varicode.  There are 128 entries,
+corresponding to ASCII characters 0-127 with two bytes for each entry.  The bits
+for the varicode are to be shifted out MSB-first for both bytes, with the first byte
+in the table being the first one to be sent.
+
+More than one zero in sequence signifies the end of the character (i.e.
+two zeroes are the intercharacter sequence, so at least two zeroes should always be
+sent before the next character is sent.
+
+This file is constructed with information from the article "PSK31 Fundamentals"
+by Peter Martinez, G3PLX by Clint Turner, KA7OEI
+*/
+unsigned char const varicode_table1[256] =     {
+    0b10101010,
+    0b11000000, // 0 NUL
+    0b10110110,
+    0b11000000, // 1 SOH
+    0b10111011,
+    0b01000000, // 2 STX
+    0b11011101,
+    0b11000000, // 3 ETX
+    0b10111010,
+    0b11000000, // 4 EOT
+    0b11010111,
+    0b11000000, // 5 ENQ
+    0b10111011,
+    0b11000000, // 6 ACK
+    0b10111111,
+    0b01000000, // 7 BEL
+    0b10111111,
+    0b11000000, // 8 BS
+    0b11101111,
+    0b00000000, // 9 HT
+    0b11101000,
+    0b00000000, // 10 LF
+    0b11011011,
+    0b11000000, // 11 VT
+    0b10110111,
+    0b01000000, // 12 FF
+    0b11111000,
+    0b00000000, // 13 CR
+    0b11011101,
+    0b01000000, // 14 SO
+    0b11101010,
+    0b11000000, // 15 SI
+    0b10111101,
+    0b11000000, // 16 DLE
+    0b10111101,
+    0b01000000, // 17 DC1
+    0b11101011,
+    0b01000000, // 18 DC2
+    0b11101011,
+    0b11000000, // 19 DC3
+    0b11010110,
+    0b11000000, // 20 DC4
+    0b11011010,
+    0b11000000, // 21 NAK
+    0b11011011,
+    0b01000000, // 22 SYN
+    0b11010101,
+    0b11000000, // 23 ETB
+    0b11011110,
+    0b11000000, // 24 CAN
+    0b11011111,
+    0b01000000, // 25 EM
+    0b11101101,
+    0b11000000, // 26 SUB
+    0b11010101,
+    0b01000000, // 27 ESC
+    0b11010111,
+    0b01000000, // 28 FS
+    0b11101110,
+    0b11000000, // 29 GS
+    0b10111110,
+    0b11000000, // 30 RS
+    0b11011111,
+    0b11000000, // 31 US
+    0b10000000,
+    0b00000000, // 32 SP
+    0b11111111,
+    0b10000000, // 33 !
+    0b10101111,
+    0b10000000, // 34 "
+    0b11111010,
+    0b10000000, // 35 #
+    0b11101101,
+    0b10000000, // 36 $
+    0b10110101,
+    0b01000000, // 37 %
+    0b10101110,
+    0b11000000, // 38 &
+    0b10111111,
+    0b10000000, // 39 '
+    0b11111011,
+    0b00000000, // 40 (
+    0b11110111,
+    0b00000000, // 41 )
+    0b10110111,
+    0b10000000, // 42 *
+    0b11101111,
+    0b10000000, // 43 +
+    0b11101010,
+    0b00000000, // 44 ,
+    0b11010100,
+    0b00000000, // 45 -
+    0b10101110,
+    0b00000000, // 46 .
+    0b11010111,
+    0b10000000, // 47 /
+    0b10110111,
+    0b00000000, // 48 0
+    0b10111101,
+    0b00000000, // 49 1
+    0b11101101,
+    0b00000000, // 50 2
+    0b11111111,
+    0b00000000, // 51 3
+    0b10111011,
+    0b10000000, // 52 4
+    0b10101101,
+    0b10000000, // 53 5
+    0b10110101,
+    0b10000000, // 54 6
+    0b11010110,
+    0b10000000, // 55 7
+    0b11010101,
+    0b10000000, // 56 8
+    0b11011011,
+    0b10000000, // 57 9
+    0b11110101,
+    0b00000000, // 58 :
+    0b11011110,
+    0b10000000, // 59 ;
+    0b11110110,
+    0b10000000, // 60 <
+    0b10101010,
+    0b00000000, // 61 =
+    0b11101011,
+    0b10000000, // 62 >
+    0b10101011,
+    0b11000000, // 63 ?
+    0b10101111,
+    0b01000000, // 64 @
+    0b11111010,
+    0b00000000, // 65 A
+    0b11101011,
+    0b00000000, // 66 B
+    0b10101101,
+    0b00000000, // 67 C
+    0b10110101,
+    0b00000000, // 68 D
+    0b11101110,
+    0b00000000, // 69 E
+    0b11011011,
+    0b00000000, // 70 F
+    0b11111101,
+    0b00000000, // 71 G
+    0b10101010,
+    0b10000000, // 72 H
+    0b11111110,
+    0b00000000, // 73 I
+    0b11111110,
+    0b10000000, // 74 J
+    0b10111110,
+    0b10000000, // 75 K
+    0b11010111,
+    0b00000000, // 76 L
+    0b10111011,
+    0b00000000, // 77 M
+    0b11011101,
+    0b00000000, // 78 N
+    0b10101011,
+    0b00000000, // 79 O
+    0b11010101,
+    0b00000000, // 80 P
+    0b11101110,
+    0b10000000, // 81 Q
+    0b10101111,
+    0b00000000, // 82 R
+    0b11011110,
+    0b00000000, // 83 S
+    0b11011010,
+    0b00000000, // 84 T
+    0b10101011,
+    0b10000000, // 85 U
+    0b11011010,
+    0b10000000, // 86 V
+    0b10101110,
+    0b10000000, // 87 W
+    0b10111010,
+    0b10000000, // 88 X
+    0b10111101,
+    0b10000000, // 89 Y
+    0b10101011,
+    0b01000000, // 90 Z
+    0b11111011,
+    0b10000000, // 91 [
+    0b11110111,
+    0b10000000, // 92 "\"
+    0b11111101,
+    0b10000000, // 93 ]
+    0b10101111,
+    0b11000000, // 94 ^
+    0b10110110,
+    0b10000000, // 95 _ (underline)
+    0b10110111,
+    0b11000000, // 96 `
+    0b10110000,
+    0b00000000, // 97 a
+    0b10111110,
+    0b00000000, // 98 b
+    0b10111100,
+    0b00000000, // 99 c
+    0b10110100,
+    0b00000000, // 100 d
+    0b11000000,
+    0b00000000, // 101 e
+    0b11110100,
+    0b00000000, // 102 f
+    0b10110110,
+    0b00000000, // 103 g
+    0b10101100,
+    0b00000000, // 104 h
+    0b11010000,
+    0b00000000, // 105 i
+    0b11110101,
+    0b10000000, // 106 j
+    0b10111111,
+    0b00000000, // 107 k
+    0b11011000,
+    0b00000000, // 108 l
+    0b11101100,
+    0b00000000, // 109 m
+    0b11110000,
+    0b00000000, // 110 n
+    0b11100000,
+    0b00000000, // 111 o
+    0b11111100,
+    0b00000000, // 112 p
+    0b11011111,
+    0b10000000, // 113 q
+    0b10101000,
+    0b00000000, // 114 r
+    0b10111000,
+    0b00000000, // 115 s
+    0b10100000,
+    0b00000000, // 116 t
+    0b11011100,
+    0b00000000, // 117 u
+    0b11110110,
+    0b00000000, // 118 v
+    0b11010110,
+    0b00000000, // 119 w
+    0b11011111,
+    0b00000000, // 120 x
+    0b10111010,
+    0b00000000, // 121 y
+    0b11101010,
+    0b10000000, // 122 z
+    0b10101101,
+    0b11000000, // 123 {
+    0b11011101,
+    0b10000000, // 124 |
+    0b10101101,
+    0b01000000, // 125 }
+    0b10110101,
+    0b11000000, // 126 ~
+    0b11101101,
+    0b01000000, // 127 (del)
+};
+
+// This code was used on FDMDV version 1, and is more compact that Code 1, but only covers a subset
+// of the ASCII cahacter set
+char const varicode_table2[] = {
+
+    ' ' ,0b11000000,
+    13  ,0b01000000, // CR, end of message
+    '=' ,0b10000000, 
+    '1' ,0b11110000,
+    '2' ,0b01110000,
+    '3' ,0b10110000,
+    '4' ,0b11010000,
+    '5' ,0b01010000,
+    '6' ,0b10010000,
+    '7' ,0b11100000,
+    '8' ,0b01100000,
+    '9' ,0b10100000,
+    'a' ,0b11111100,
+    'b' ,0b01111100,
+    'c' ,0b10111100,
+    'd' ,0b11011100,
+    'e' ,0b01011100,
+    'f' ,0b10011100,
+    'g' ,0b11101100,
+    'h' ,0b01101100,
+    'i' ,0b10101100,
+    'j' ,0b11110100,
+    'k' ,0b01110100,
+    'l' ,0b10110100,
+    'm' ,0b11010100,
+    'n' ,0b01010100,
+    'o' ,0b10010100,
+    'p' ,0b11100100,
+    'q' ,0b01100100,
+    'r' ,0b10100100,
+    's' ,0b11111000,
+    't' ,0b01111000,
+    'u' ,0b10111000,
+    'v' ,0b11011000,
+    'w' ,0b01011000,
+    'x' ,0b10011000,
+    'y' ,0b11101000,
+    'z' ,0b01101000,
+    '0' ,0b10101000
+};
+
diff --git a/freedv/branches/0.97/src/version.h b/freedv/branches/0.97/src/version.h
new file mode 100644 (file)
index 0000000..fa80cbe
--- /dev/null
@@ -0,0 +1,11 @@
+#ifndef FREEDV_VER_DOT_H
+#define FREEDV_VER_DOT_H 1
+
+#define FREEDV_VERSION_MAJOR 0
+#define FREEDV_VERSION_MINOR 97
+#define FREEDV_VERSION_PATCH 0
+#define FREEDV_VERSION_SUFFIX "Beta"
+
+#define FREEDV_VERSION "0.97.0 Beta"
+
+#endif //FREEDV_VER_DOT_H
diff --git a/freedv/branches/0.97/svn.ico b/freedv/branches/0.97/svn.ico
new file mode 100644 (file)
index 0000000..ba63376
Binary files /dev/null and b/freedv/branches/0.97/svn.ico differ
diff --git a/freedv/branches/0.99/.clang/.gitignore b/freedv/branches/0.99/.clang/.gitignore
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/freedv/branches/0.99/CMakeLists.txt b/freedv/branches/0.99/CMakeLists.txt
new file mode 100644 (file)
index 0000000..40e95e3
--- /dev/null
@@ -0,0 +1,487 @@
+#
+# FreeDV - HF Digital Voice for Radio Amateurs
+#
+# CMake configuration contributed by Richard Shaw (KF5OIM)
+# Please report questions, comments, problems, or patches to the freetel
+# mailing list: https://lists.sourceforge.net/lists/listinfo/freetel-codec2
+#
+
+cmake_minimum_required(VERSION 2.8)
+
+# Prevent in-source builds to protect automake/autoconf config.
+# If an in-source build is attempted, you will still need to clean up a few
+# files manually.
+set(CMAKE_DISABLE_SOURCE_CHANGES ON)
+set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
+if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
+  message(FATAL_ERROR "In-source builds in ${CMAKE_BINARY_DIR} are not "   
+   "allowed, please remove ./CMakeCache.txt and ./CMakeFiles/, create a "
+   "separate build directory and run cmake from there.")
+endif("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
+
+# Set local module path.
+list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
+
+project(FreeDV)
+
+#
+# Set FreeDV version and generate src/version.h
+#
+set(FREEDV_VERSION_MAJOR 0)
+set(FREEDV_VERSION_MINOR 99)
+set(FREEDV_VERSION_PATCH FALSE)
+set(FREEDV_VERSION ${FREEDV_VERSION_MAJOR}.${FREEDV_VERSION_MINOR})
+if(FREEDV_VERSION_PATCH)
+    set(FREEDV_VERSION ${FREEDV_VERSION}.${FREEDV_VERSION_PATCH})
+endif()
+set(FREEDV_VERSION_SUFFIX "Beta")
+if(FREEDV_VERSION_SUFFIX)
+    set(FREEDV_VERSION_STRING "${FREEDV_VERSION} ${FREEDV_VERSION_SUFFIX}")
+endif()
+message(STATUS "FreeDV version: ${FREEDV_VERSION_STRING}")
+configure_file(cmake/version.h.in src/version.h @ONLY)
+
+# Set default build type
+if(NOT CMAKE_BUILD_TYPE)
+    set(CMAKE_BUILD_TYPE "Release")
+    message(STATUS "Build type not specified, defaulting to ${CMAKE_BUILD_TYPE}")
+endif(NOT CMAKE_BUILD_TYPE)
+
+
+# Work around for not using a svn working copy.
+add_definitions(-D_NO_AUTOTOOLS_)
+find_program(SVNVERSION_PATH svnversion)
+if(SVNVERSION_PATH)
+    execute_process(COMMAND ${SVNVERSION_PATH} .
+        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+        RESULT_VARIABLE SVN_REVISION_RESULT
+        OUTPUT_VARIABLE SVN_CURRENT_REVISION
+        ERROR_QUIET
+    )
+else()
+    set(SVN_REVISION_RESULT 1)
+endif()
+if(SVN_REVISION_RESULT EQUAL 0)
+string(STRIP ${SVN_CURRENT_REVISION} SVN_REVISION)
+add_definitions(-DSVN_REVISION="${SVN_REVISION}")
+else()
+add_definitions(-DSVN_REVISION="Unversioned directory")
+endif()
+
+
+# Set default build flags.
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
+
+#
+# Setup cmake options
+#
+set(CMAKE_VERBOSE_MAKEFILE TRUE CACHE BOOL "Verbose makefile.")
+set(USE_STATIC_DEPS FALSE CACHE BOOL 
+    "Download and build static libraries instead of system libraries.")
+set(USE_STATIC_PORTAUDIO FALSE CACHE BOOL 
+    "Download and build static portaudio instead of the system library.")
+set(USE_STATIC_SNDFILE FALSE CACHE BOOL
+    "Download and build static sndfile instead of the system library.")
+set(USE_STATIC_SAMPLERATE FALSE CACHE BOOL
+    "Download and build static samplerate instead of the system library.")
+set(USE_STATIC_SOX FALSE CACHE BOOL
+    "Download and build static sox instead of the system library.")
+set(USE_STATIC_CODEC2 FALSE CACHE BOOL
+    "Download and build static codec2 instead of the system library.")
+set(USE_STATIC_SPEEXDSP FALSE CACHE BOOL
+    "Download and build static speex instead of the system library.")
+set(BOOTSTRAP_WXWIDGETS FALSE CACHE BOOL
+    "Download and build static wxWidgets instead of the system library.")
+
+if(USE_STATIC_DEPS)
+    set(USE_STATIC_PORTAUDIO TRUE FORCE)
+    set(USE_STATIC_SNDFILE TRUE FORCE)
+    set(USE_STATIC_SAMPLERATE TRUE FORCE)
+    set(USE_STATIC_SOX TRUE FORCE)
+    set(USE_STATIC_CODEC2 TRUE FORCE)
+endif(USE_STATIC_DEPS)
+
+#
+# Pull in external wxWidgets target if performing static build.
+#
+if(BOOTSTRAP_WXWIDGETS)
+    message(STATUS "Adding wxWidgets build target...")
+    include(cmake/BuildWxWidgets.cmake)
+endif(BOOTSTRAP_WXWIDGETS)
+
+#
+# Perform bootstrap build of wxWidgets
+#
+if(BOOTSTRAP_WXWIDGETS AND NOT EXISTS ${WXCONFIG})
+    message(STATUS "Will perform bootstrap build of wxWidgets.
+   After make step completes, re-run cmake and make again to perform FreeDV build.")
+#
+# Continue normal build if not bootstrapping wxWidgets or is already built.
+#
+else(BOOTSTRAP_WXWIDGETS AND NOT EXISTS ${WXCONFIG})
+
+
+#
+# Various hacks and work arounds for building under MinGW.
+#
+if(MINGW)
+    message(STATUS "System is MinGW.")
+    # Setup HOST variable.
+    include(cmake/MinGW.cmake)
+    # This sets up the exe icon for windows under mingw.
+    set(RES_FILES "")
+    set(RES_FILES "${CMAKE_SOURCE_DIR}/contrib/freedv.rc")
+    set(CMAKE_RC_COMPILER_INIT windres)
+    enable_language(RC)
+    set(CMAKE_RC_COMPILE_OBJECT
+        "<CMAKE_RC_COMPILER> <FLAGS> -O coff <DEFINES> -i <SOURCE> -o <OBJECT>")
+    # These are DLOPEN'ed and can't be automatically pulled in by dependency.
+    foreach(RUNTIME
+        hamlib-adat.dll
+        hamlib-alinco.dll
+        hamlib-amsat.dll
+        hamlib-aor.dll
+        hamlib-ars.dll
+        hamlib-celestron.dll
+        hamlib-drake.dll
+        hamlib-dummy.dll
+        hamlib-easycomm.dll
+        hamlib-flexradio.dll
+        hamlib-fodtrack.dll
+        hamlib-gs232a.dll
+        hamlib-heathkit.dll
+        hamlib-icom.dll
+        hamlib-jrc.dll
+        hamlib-kachina.dll
+        hamlib-kenwood.dll
+        hamlib-kit.dll
+        hamlib-lowe.dll
+        hamlib-m2.dll
+        hamlib-pcr.dll
+        hamlib-prm80.dll
+        hamlib-racal.dll
+        hamlib-rft.dll
+        hamlib-rotorez.dll
+        hamlib-rs.dll
+        hamlib-sartek.dll
+        hamlib-skanti.dll
+        hamlib-spid.dll
+        hamlib-tapr.dll
+        hamlib-tentec.dll
+        hamlib-ts7400.dll
+        hamlib-tuner.dll
+        hamlib-uniden.dll
+        hamlib-winradio.dll
+        hamlib-wj.dll
+        hamlib-yaesu.dll)
+        message(STATUS "Checking for ${RUNTIME}")
+        find_library(${RUNTIME}_LIB ${RUNTIME}
+            PATH_SUFFIXES hamlib)
+        message(STATUS "runtime found: ${${RUNTIME}_LIB}")
+        list(APPEND CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS ${${RUNTIME}_LIB})
+    endforeach()
+    include(InstallRequiredSystemLibraries)
+endif(MINGW)
+
+# Math library is automatic on MinGW
+if(UNIX)
+    set(CMAKE_REQUIRED_INCLUDES math.h)
+    set(CMAKE_REQUIRED_LIBRARIES m)
+endif(UNIX)
+
+# Find some standard headers and functions.
+include(CheckIncludeFiles)
+check_include_files("limits.h" HAVE_LIMITS_H)
+check_include_files("stddef.h" HAVE_STDDEF_H)
+check_include_files("stdlib.h" HAVE_STDLIB_H)
+check_include_files("string.h" HAVE_STRING_H)
+
+include(CheckTypeSize)
+check_type_size("int" SIZEOF_INT)
+
+include(CheckFunctionExists)
+check_function_exists(floor HAVE_FLOOR)
+check_function_exists(memset HAVE_MEMSET)
+check_function_exists(pow HAVE_POW)
+check_function_exists(sqrt HAVE_SQRT)
+
+# fdmdv2_main.h requires patching to find config.h as it current looks in the
+# source directory and the generated file goes in the binary directory.
+configure_file ("${PROJECT_SOURCE_DIR}/cmake/config.h.in"
+                "${PROJECT_BINARY_DIR}/config.h" )
+include_directories(${PROJECT_BINARY_DIR})
+add_definitions(-DHAVE_CONFIG_H)
+
+# Pthread Library
+find_package(Threads REQUIRED)
+message(STATUS "Threads library flags: ${CMAKE_THREAD_LIBS_INIT}")
+
+#
+# Find codec2
+#
+if(NOT USE_STATIC_CODEC2)
+    message(STATUS "Looking for codec2...")
+    find_package(codec2 CONFIG QUIET)
+    if(codec2_FOUND)
+        get_target_property(CODEC2_LIBRARY codec2 LOCATION)
+        message(STATUS "  codec2 library: ${CODEC2_LIBRARY}")
+        message(STATUS "  codec2 headers: ${codec2_INCLUDE_DIRS}")
+    else()
+        # Try to find manually
+        find_path(CODEC2_INCLUDE_DIRS codec2.h
+                  PATH_SUFFIXES codec2)
+        find_library(CODEC2_LIBRARY NAMES codec2)
+        if(CODEC2_LIBRARY AND CODEC2_INCLUDE_DIRS)
+            message(STATUS "  codec2 library: ${CODEC2_LIBRARY}")
+            message(STATUS "  codec2 headers: ${CODEC2_INCLUDE_DIRS}")
+            list(APPEND FREEDV_LINK_LIBS ${CODEC2_LIBRARY})
+            include_directories(${CODEC2_INCLUDE_DIRS})
+        else()
+            message(FATAL_ERROR "codec2 library not found.
+Linux: 
+Codec2 may not be in your distribution so build yourself or use the cmake option to build statically into FreeDV.
+Windws:
+It's easiest to use the cmake option: USE_STATIC_CODEC2"
+        )
+        endif()
+    endif()
+else(NOT USE_STATIC_CODEC2)
+    message(STATUS "Will attempt static build of codec2.")
+    include(cmake/BuildCodec2.cmake)
+endif(NOT USE_STATIC_CODEC2)
+
+#
+# Find or build portaudio Library
+#
+if(NOT USE_STATIC_PORTAUDIO)
+    message(STATUS "Looking for portaudio...")
+    find_package(Portaudio REQUIRED)
+    if(PORTAUDIO_FOUND)
+        message(STATUS "  portaudio library: ${PORTAUDIO_LIBRARIES}")
+        message(STATUS "  portaudio headers: ${PORTAUDIO_INCLUDE_DIRS}")
+        list(APPEND FREEDV_LINK_LIBS ${PORTAUDIO_LIBRARIES})
+        include_directories(${PORTAUDIO_INCLUDE_DIRS})
+    else()
+        message(FATAL_ERROR "portaudio library not found.
+On Linux systems try installing:
+    portaudio-devel  (RPM based systems)
+    libportaudio-dev (DEB based systems)
+On Windows it's easiest to use the cmake option: USE_STATIC_PORTAUDIO"
+        )
+    endif()
+    if(NOT ${PORTAUDIO_VERSION} EQUAL 19)
+        message(WARNING "Portaudio versions other than 19 are known to have issues. You have been warned!")
+    endif()
+else(NOT USE_STATIC_PORTAUDIO)
+    message(STATUS "Will attempt static build of portaudio.")
+    include(cmake/BuildPortaudio.cmake)
+endif(NOT USE_STATIC_PORTAUDIO)
+
+#
+# Hamlib library
+#
+message(STATUS "Looking for hamlib...")
+find_path(HAMLIB_INCLUDE_DIR hamlib/rig.h)
+find_library(HAMLIB_LIBRARY hamlib)
+message(STATUS "Hamlib library: ${HAMLIB_LIBRARY}")
+message(STATUS "Hamlib headers: ${HAMLIB_INCLUDE_DIR}")
+if(HAMLIB_LIBRARY AND HAMLIB_INCLUDE_DIR)
+    message(STATUS "Hamlib library found.")
+    include_directories(${HAMLIB_INCLUDE_DIR})
+    list(APPEND FREEDV_LINK_LIBS ${HAMLIB_LIBRARY})
+else(HAMLIB_LIBRARY AND HAMLIB_INCLUDE_DIR)
+    message(FATAL_ERROR "hamlib not found.
+On Linux systems try installing:
+    hamlib-devel  (RPM based systems)
+    libhamlib-dev (DEB based systems)"
+    )
+endif(HAMLIB_LIBRARY AND HAMLIB_INCLUDE_DIR)
+
+
+#
+# Samplerate Library
+#
+if(NOT USE_STATIC_SAMPLERATE)
+    message(STATUS "Looking for samplerate...")
+    find_library(LIBSAMPLERATE samplerate)
+    find_path(LIBSAMPLERATE_INCLUDE_DIR samplerate.h)
+    message(STATUS "  samplerate library: ${LIBSAMPLERATE}")
+    message(STATUS "  samplerate headers: ${LIBSAMPLERATE_INCLUDE_DIR}")
+    if(LIBSAMPLERATE AND LIBSAMPLERATE_INCLUDE_DIR)
+        list(APPEND FREEDV_LINK_LIBS ${LIBSAMPLERATE})
+        include_directories(${LIBSAMPLERATE_INCLUDE_DIR})
+    else(LIBSTAMPLERATE AND LIBSAMPLERATE_INCLUDE_DIR)
+        message(FATAL_ERROR "samplerate library not found.
+On Linux systems try installing:
+    samplerate-devel  (RPM based systems)
+    libsamplerate-dev (DEB based systems)
+On Windows it's easiest to use the cmake option: USE_STATIC_SAMPLERATE"
+        )
+    endif(LIBSAMPLERATE AND LIBSAMPLERATE_INCLUDE_DIR)
+else(NOT USE_STATIC_SAMPLERATE)
+    message(STATUS "Will attempt static build of samplerate.")
+    include(cmake/BuildSamplerate.cmake)
+endif(NOT USE_STATIC_SAMPLERATE)
+
+#
+# Find sox library
+#
+if(NOT USE_STATIC_SOX)
+    message(STATUS "Looking for sox...")
+    find_library(LIBSOX_LIBRARY sox)
+    find_path(LIBSOX_INCLUDE_DIR NAMES sox/sox.h sox.h)
+    message(STATUS "  sox library: ${LIBSOX_LIBRARY}")
+    message(STATUS "  sox headers: ${LIBSOX_INCLUDE_DIR}")
+    if(LIBSOX_LIBRARY AND LIBSOX_INCLUDE_DIR)
+        list(APPEND FREEDV_LINK_LIBS ${LIBSOX_LIBRARY})
+        include_directories(${LIBSOX_INCLUDE_DIR})
+    else(LIBSOX_LIBRARY AND LIBSOX_INCLUDE_DIR)
+        message(FATAL_ERROR "sox library not found.
+On Linux systems try installing:
+    sox-devel (RPM based systems)
+    libsox-dev (DEB based systems)
+On Windows it's easiest to use the cmake option: USE_STATIC_SOX"
+        )
+    endif(LIBSOX_LIBRARY AND LIBSOX_INCLUDE_DIR)
+else(NOT USE_STATIC_SOX)
+    message(STATUS "Will attempt static build of sox.")
+    include(cmake/BuildSox.cmake)
+endif(NOT USE_STATIC_SOX)
+
+#    
+# sndfile Library
+#
+if(NOT USE_STATIC_SNDFILE)
+    message(STATUS "Looking for sndfile...")
+    find_library(LIBSNDFILE sndfile)
+    find_path(LIBSNDFILE_INCLUDE_DIR sndfile.h)
+    message(STATUS "  sndfile library: ${LIBSNDFILE}")
+    message(STATUS "  sndfile headers: ${LIBSNDFILE_INCLUDE_DIR}")
+    if(LIBSNDFILE AND LIBSNDFILE_INCLUDE_DIR)
+        list(APPEND FREEDV_LINK_LIBS ${LIBSNDFILE})
+    else(LIBSNDFILE AND LIBSNDFILE_INCLUDE_DIR)
+        message(FATAL_ERROR "sndfile library not found.
+On Linux systems try installing:
+    libsndfile-devel (RPM based systems)
+    libsndfile-dev   (DEB based systems)
+On Windows it's easiest to use the cmake option: USE_STATIC_SNDFILE"
+        )
+    endif(LIBSNDFILE AND LIBSNDFILE_INCLUDE_DIR)
+else(NOT USE_STATIC_SNDFILE)
+    message(STATUS "Will attempt static build of sndfile.")
+    include(cmake/BuildSndfile.cmake)
+endif(NOT USE_STATIC_SNDFILE)
+
+#
+# Find wxWidgets
+#
+if(NOT BOOTSTRAP_WXWIDGETS)
+    set(WXCONFIG "" CACHE FILEPATH "Location of wx-config binary.")
+    set(WXRC "" CACHE FILEPATH "Location of wxrc binary.")
+endif(NOT BOOTSTRAP_WXWIDGETS)
+#if(BOOTSTRAP_WXWIDGETS)
+#    set(WXCONFIG "${CMAKE_BINARY_DIR}/external/dist/bin/wx-config")
+#    set(WXRC "${CMAKE_BINARY_DIR}/external/dist/bin/wxrc")
+#    list(APPEND FREEDV_STATIC_DEPS wxWidgets)
+#endif(BOOTSTRAP_WXWIDGETS)
+message(STATUS "Looking for wxWidgets...")
+if(WXCONFIG)
+    message(STATUS "wx-config: ${WXCONFIG}")
+    set(wxWidgets_CONFIG_EXECUTABLE ${WXCONFIG})
+endif(WXCONFIG)
+if(WXRC)
+    message(STATUS "wxrc: ${WXRC}")
+    set(wxWidgets_wxrc_EXECUTABLE ${WXRC})
+endif(WXRC)
+set(WX_VERSION_MIN 3.0.0)
+find_package(wxWidgets REQUIRED core base aui html net adv)
+execute_process(COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}" --version
+    OUTPUT_VARIABLE WX_VERSION)
+string(STRIP ${WX_VERSION} WX_VERSION)
+if(WX_VERSION VERSION_EQUAL ${WX_VERSION_MIN}
+    OR WX_VERSION VERSION_GREATER ${WX_VERSION_MIN})
+   message(STATUS "wxWidgets version: ${WX_VERSION}")
+else()
+    message(FATAL_ERROR "wxWidgets must be installed on your system.
+Please check that wx-config is in path, the directory
+where wxWidgets libraries are installed (returned by
+'wx-config --libs' or 'wx-config --static --libs' command)
+is in LD_LIBRARY_PATH or equivalent variable and
+wxWidgets version is ${WX_VERSION_MIN} or above.")
+endif()
+if(wxWidgets_FOUND)
+    include("${wxWidgets_USE_FILE}")
+    list(APPEND FREEDV_LINK_LIBS ${wxWidgets_LIBRARIES})
+endif(wxWidgets_FOUND)
+
+#
+# Find speex library
+#
+if(NOT USE_STATIC_SPEEXDSP)
+    message(STATUS "Looking for Speex DSP library.")
+    find_path(SPEEXDSP_INCLUDE_DIR speex/speex.h)
+    find_library(SPEEXDSP_LIBRARY speexdsp)
+    message(STATUS "  Speex DSP headers: ${SPEEXDSP_INCLUDE_DIR}")
+    message(STATUS "  Speex DSP library: ${SPEEXDSP_LIBRARY}")
+    if(SPEEXDSP_INCLUDE_DIR AND SPEEXDSP_LIBRARY)
+        include_directories(${SPEEXDSP_INCLUDE_DIR})
+        list(APPEND FREEDV_LINK_LIBS ${SPEEXDSP_LIBRARY})
+    else(SPEEXDSP_INCLUDE_DIR AND SPEEXDSP_LIBRARY)
+        message(FATAL_ERROR "Speex DSP library not found!")
+    endif(SPEEXDSP_INCLUDE_DIR AND SPEEXDSP_LIBRARY)
+else()
+    message(STATUS "Will attempt static build of speex.")
+    include(cmake/BuildSpeex.cmake)
+endif()
+    
+#Freedv 
+add_subdirectory(src)
+
+# Icons and desktop file
+add_subdirectory(contrib)
+
+message(STATUS "Build type will be: ${CMAKE_BUILD_TYPE}")
+
+#
+# Cpack NSIS configuration for Windows.
+#
+if(WIN32)
+    # Detect if we're doing a 32-bit or 64-bit windows build.
+    if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
+        set(CMAKE_CL_64 TRUE)
+    endif()
+    if(NOT ${CMAKE_BUILD_TYPE} STREQUAL "Debug")
+        set(CPACK_STRIP_FILES TRUE)
+    endif()
+    configure_file(cmake/GetDependencies.cmake.in cmake/GetDependencies.cmake
+        @ONLY
+    )
+    install(SCRIPT ${CMAKE_BINARY_DIR}/cmake/GetDependencies.cmake)
+    set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "HF Digital Voice for Radio Amateurs")
+    set(CPACK_PACKAGE_VENDOR "CMake")
+    #set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
+    set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
+    set(CPACK_PACKAGE_VERSION_MAJOR ${FREEDV_VERSION_MAJOR})
+    set(CPACK_PACKAGE_VERSION_MINOR ${FREEDV_VERSION_MINOR})
+    # CPack expects a patch level version so set it here and override if we
+    # are actually setting one.
+    set(CPACK_PACKAGE_VERSION_PATCH 0)
+    if(FREEDV_VERSION_PATCH)
+        set(CPACK_PACKAGE_VERSION_PATCH ${FREEDV_VERSION_PATCH})
+    endif()
+    if(FREEDV_VERSION_SUFFIX)
+        set(CPACK_PACKAGE_VERSION_PATCH "${CPACK_PACKAGE_VERSION_PATCH}-${FREEDV_VERSION_SUFFIX}")
+    endif()
+    # There is a bug in NSI that does not handle full unix paths properly. Make
+    # sure there is at least one set of four (4) backlasshes.
+    #set(CPACK_PACKAGE_ICON "${CMake_SOURCE_DIR}/Utilities/Release\\\\InstallIcon.bmp")
+    set(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\freedv.exe")
+    set(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}")
+    set(CPACK_NSIS_PACKAGE_NAME "FreeDV")
+    set(CPACK_NSIS_URL_INFO_ABOUT "http://freedv.org")
+    set(CPACK_NSIS_MODIFY_PATH OFF)
+    set(CPACK_NSIS_MENU_LINKS "http://freedv.org" "FreeDV Homepage")
+    include(CPack)
+endif(WIN32)
+
+endif(BOOTSTRAP_WXWIDGETS AND NOT EXISTS ${WXCONFIG})
diff --git a/freedv/branches/0.99/COPYING b/freedv/branches/0.99/COPYING
new file mode 100644 (file)
index 0000000..cfd4e99
--- /dev/null
@@ -0,0 +1,502 @@
+                  GNU LESSER GENERAL PUBLIC LICENSE
+                       Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+                            Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+  When we speak of free software, we are referring to freedom of use,
+not price.  Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+\f
+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard.  To achieve this, non-free programs must be
+allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+\f
+                  GNU LESSER GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+\f
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+\f
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+\f
+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+\f
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+\f
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+\f
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+                            NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+                     END OF TERMS AND CONDITIONS
+\f
+           How to Apply These Terms to Your New Libraries
+
+  If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change.  You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+  To apply these terms, attach the following notices to the library.  It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the library's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, see
+    <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+  <signature of Ty Coon>, 1 April 1990
+  Ty Coon, President of Vice
+
+That's all there is to it!
diff --git a/freedv/branches/0.99/README.txt b/freedv/branches/0.99/README.txt
new file mode 100644 (file)
index 0000000..f28f204
--- /dev/null
@@ -0,0 +1,274 @@
+==================================
+ Building and installing on Linux
+==================================
+
+Quickstart 1
+-----------
+
+Builds static versions of wxWidgets, portaudio, codec2-dev, which are commonly
+missing on many Linux systems, or of the wrong (older) version.
+
+1/ Assuming the fdmdv2-dev source is checked out into ~/fdmdv2-dev:
+
+  $ sudo apt-get install libgtk2.0-dev libhamlib-dev libsamplerate-dev libasound2-dev libao-dev
+  $ cd fdmdv2-dev
+  $ mkdir build_linux
+  $ cd build_linux
+  $ cmake -DBOOTSTRAP_WXWIDGETS=TRUE ~/fdmdv2-dev
+  $ make
+
+2/ Then you can configure FreeDV using your local codec-dev, something like:
+
+  $ cmake -DCMAKE_BUILD_TYPE=Debug -DBOOTSTRAP_WXWIDGETS=TRUE -DCODEC2_INCLUDE_DIRS=/path/to/codec2-dev/src -DCODEC2_LIBRARY=/path/to/codec2-dev/build_linux/src/libcodec2.so -DUSE_STATIC_CODEC2=FALSE -DUSE_STATIC_PORTAUDIO=TRUE -DUSE_STATIC_SOX=TRUE ../
+
+3/ OR build a local copy of codec2-dev:
+
+  $ cmake -DBOOTSTRAP_WXWIDGETS=TRUE -DUSE_STATIC_CODEC2=TRUE -DUSE_STATIC_PORTAUDIO=TRUE -DUSE_STATIC_SOX=TRUE ../
+  
+4/ Build and run FreeDV:
+
+   $ make
+   $ ./src/freedv
+
+Quickstart 2
+------------
+
+1/ Assuming you have all the dependant libraries:
+
+  $ cd /path/to/fdmdv2
+  $ mkdir build_linux
+  $ cd build_linux
+  $ cmake ../ (defaults to /usr/local, use CMAKE_INSTALL_PREFIX to override)
+  (if no errors)
+  $ make
+  (as root)
+  $ make install
+
+
+=======================================================
+ Building for Windows on Ubuntu Linux (Cross compiling)
+=======================================================
+
+1/ Install the cross compiling toolchain:
+
+  $ sudo apt-get install mingw-w64
+
+2/ Patch cmake using: http://www.cmake.org/gitweb?p=stage/cmake.git;a=patch;h=33286235048495ceafb636d549d9a4e8891967ae
+
+3/ Checkout a fresh copy of codec2-dev and build for Windows, pointing to the generate_codebook built by a linux build of generate_codebook, using this cmake line
+
+  $ cmake .. -DCMAKE_TOOLCHAIN_FILE=../fdmdv2-dev/cmake/Toolchain-Ubuntu-mingw32.cmake -DUNITTEST=FALSE -DGENERATE_CODEBOOK=/home/david/codec2-dev/build_linux/src/generate_codebook 
+
+4/ Build WxWidgets
+
+  $ cd /path/to/fdmdv2-dev
+  $ mkdir build_windows
+  $ cd build_windows
+  $ cmake -DBOOTSTRAP_WXWIDGETS=TRUE .. -DCMAKE_TOOLCHAIN_FILE=cmake/Toolchain-Ubuntu-mingw32.cmake -DCMAKE_BUILD_TYPE=Debug
+  $ make
+
+5/ Download and install the Windows version of Hamlib:
+
+  $ wget http://internode.dl.sourceforge.net/project/hamlib/hamlib/1.2.15.3/hamlib-win32-1.2.15.3.zip
+  $ unzip hamlib-win32-1.2.15.3.zip
+
+6/ Build All the libraries and FreeDV:
+
+  $ cmake -DBOOTSTRAP_WXWIDGETS=TRUE -DCMAKE_TOOLCHAIN_FILE=cmake/Toolchain-Ubuntu-mingw32.cmake -DUSE_STATIC_PORTAUDIO=TRUE -DUSE_STATIC_SNDFILE=TRUE -DUSE_STATIC_SAMPLERATE=TRUE -DUSE_STATIC_SOX=TRUE -DUSE_STATIC_CODEC2=FALSE -DCODEC2_INCLUDE_DIRS=/home/david/tmp/codec2-dev/src -DCODEC2_LIBRARY=/home/david/tmp/codec2-dev/build_windows/src/libcodec2.dll.a -DHAMLIB_INCLUDE_DIR=hamlib-win32-1.2.15.3/include -DHAMLIB_LIBRARY=hamlib-win32-1.2.15.3/lib/gcc/libhamlib.dll.a -DCMAKE_BUILD_TYPE=Debug ..
+  $ make
+
+====================================
+ Building and installing on Windows
+====================================
+
+The windows build is similar to linux and follows the same basic workflow,
+however, while codec2 and FreeDV (fdmdv2) build well on windows, some of the
+dependencies do not. For that reson current windows releases are cross-compiled
+from linux.
+
+Only MinGW is supported. While it is likely possible to perform a pure MinGW
+build, installing MSYS2 will make your life easier.
+
+CMake may not automatically detect that you're in the MSYS environment. If this
+occurs you need to pass cmake the proper generator:
+
+cmake -G"MSYS Makefiles" [other options] </path/to/source>
+
+===============================
+ Bootstrapping wxWidgets build
+===============================
+
+If wxWidgets (>= 3.0) is not available then one option is to have CMake boot-
+strap the build for FreeDV.
+
+This is required because the tool wx-config is used to get the correct compiler
+and linker flags of the wxWidgets components needed by FreeDV. Since this is
+normally done at configure time, not during "make", it is not possible for CMake
+or have this information prior to building wxWidgets.
+
+In order to work around this issue you can "bootstrap" the wxWidgets build using
+the CMake option, "BOOTSTRAP_WXWIDGETS". wxWidgets will be built using static
+libraries.
+
+NOTE: This forces "USE_STATIC_WXWIDGETS" to be true internally regarless of the
+value set manually.
+
+(from any directory, but empty directory outside of the source is prefered.)
+$ cmake -DBOOTSTRAP_WXWIDGETS=TRUE /path/to/fdmdv2
+$ make
+(wxWidgets is downloaded and built)
+$ cmake .
+(wxWidgets build should be detected)
+$ make
+(if all goes well, as root)
+$ make install
+
+====================================
+ Building and installing on OSX
+====================================
+
+====================================
+ Building and installing on FreeBSD
+====================================
+
+As per "Quickstart 2" above but change build_linux to build_freebsd
+
+=======
+Editing
+=======
+
+Please make sure your text editor does not insert tabs, and
+used indents of 4 spaces.  The following .emacs code was used to
+configure emacs:
+
+(setq-default indent-tabs-mode nil)
+
+(add-hook 'c-mode-common-hook
+          (function (lambda ()
+                      (setq c-basic-offset 4)
+                      )))
+
+====
+TODO
+====
+
+[ ] Open R&D questions
+    + Goal is to develop an open source DV mode that performs comparably to SSB
+    [ ] Does 700 perform OK next to SSB?
+        + approx same tx pk level (hard to measure exactly)
+        + try some low SNR channels
+        + try some fast fading/nasty channels
+    [ ] Is 700 speech quality acceptable?
+
+[X] test frames 
+    [X] freedv API support
+    [X] BER displayed on GUI for 700 and 1600
+    [X] plot error patterns for 700 and 1600
+        + callback for error patterns, or poll via stats interface
+    [X] plot error histograms for 700 and 1600
+        + map bit error to carrier, have done this in tcohpsk?
+        + how to reset histogram?  On error reset?
+        + histogram screen ... new code?
+        + test with filter
+
+[X] Bugs
+    [X] resync issue
+    [X] equalise power on 700 and 1600
+    [X] research real and complex PAPR
+    [X] waterfall and spectrum in analog mode
+    [X] The waterfall in analog mode appears to quit working sometimes?
+
+    [X] On TX, intermittently PTT will cause signal to be heard in speakers.  Toggle PTT or 
+        Stop/Start toggle and then starts working.
+    [X] Squelch control on 1600 mode will not open up squelch to 0 (appears to be around 2 dB)
+    [X] space bar keys PTT when entering text info box
+    [X] checksum based txt reception
+        + only print if valid
+    [X] IC7200 audio breakup
+    [ ] short varicode doesn't work
+        + #ifdef-ed out for now
+        + cld be broken in freedv_api
+    [X] On 700 audio sounds tinny and clicky when out of sync compared to 1600 why?
+        + clue: only when analog not pressed
+        + this was 7.5 to 8kHz interpolator bug
+    [X] spectrum and waterfall scale changes when analog pressed
+    [X] ocassional test frames error counter goes crazy
+    [ ] 700 syncs up to 1000Hz sine waves
+        + shouldn't trigger sync logic, will be a problem with carriers
+    [ ] "clip" led, encourage people to adjust gain to hit that occ when speaking
+    [ ] Win32 record from radio time
+
+[ ] FreeDV 700 improvements
+    [ ] bpf filter after clipping to remove clicks
+        [ ] tcohpsk first, measure PAPR, impl loss
+    [ ] error masking
+        [ ] C version
+        [ ] training off air?  Switchable?
+        [ ] excitation params
+        [ ] training
+    [ ] plotting other demod stats like ch ampl and phase ests
+    [ ] profile with perf, different libresample routine
+    [ ] check for occassional freedv 700 loss of sync
+        + scatter seems to jump
+    [ ] switchable diversity (narrowband) option
+        + measure difference on a few channels
+        + blog
+
+[X] win32
+    [X] X-compile works
+    [X] basic installer
+    [X] Win32 installer
+        + Richard has taken care of this
+
+[ ] Small fixes
+    [X] Playfile bug
+    [X] running again
+    [X] bump ver number
+    [X] long varicode default
+    [X] option to _not_ require checksum, on by default
+    [X] default squelch 2dB
+    [X] scatter diagram tweaks
+        + e.g. meaningful plots on fading channels in real time 
+        [X] agc with hysteresis
+            + changed to log steps
+        [X] longer persistance
+            + changed to 6 seconds
+        [X] diversity addtions on 700
+            + still not real obvious on plot
+            + might be useful to make this switchable
+    [X] scatter diagram different colours/carrier
+    [X] remember what mode you were in
+    [ ] cmd line file decode
+    [ ] Waterfall direction
+    [ ] documentation or use, walk through, you tube, blog posts
+
+[ ] Web support for Presence/spotting hooks
+
+=================
+USER GUIDE NOTES
+=================
+
+TODO: Put this in a more usable form, video tutorials etc
+
+1/ Error Histogram.  Displays BER of each carrier when in "test frame"
+ mode.  As each QPSK carrier has 2 bits there are 2*Nc histogram
+ points.
+
+ Ideally all carriers will have about the same BER (+/- 20% after 5000
+ total bit errors).  However problems can occur with filtering in the
+ tx path.  If one carrier has less power, then it will have a higher
+ BER.  The errors in this carrier will tend to dominate overall
+ BER. For example if one carrier is attenuated due to SSB filter
+ ripple in the tx path then the BER on that carrier will be higher.
+ This is bad news for DV.
+
+ Suggested usage: Transmit FreeDV in test frame mode.  Use a 2nd rx
+ (or get a friend) to monitor your rx signal with FreeDV in test frame
+ mode.  Adjust your rx SNR to get a BER of a few % (e.g. reduce tx power,
+ use a short antenna for the rx, point your beam away, adjust rx RF
+ gain).  Monitor the error histogram for a few minutes, until you have
+ say 5000 total bit errors.  You have a problem if the BER of any
+ carrier is more than 20% different from the rest.
+
+  A typical issue will be one carrier at 1.0, the others at 0.5,
+  indicating the poorer carrier BER is twice the larger.
diff --git a/freedv/branches/0.99/cmake/BuildCodec2.cmake b/freedv/branches/0.99/cmake/BuildCodec2.cmake
new file mode 100644 (file)
index 0000000..471eef8
--- /dev/null
@@ -0,0 +1,23 @@
+set(SPEEXDSP_CMAKE_ARGS -DBUILD_SHARED_LIBS=FALSE -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/external/dist)
+
+if(USE_STATIC_SPEEXDSP)
+    list(APPEND SPEEXDSP_CMAKE_ARGS 
+        -DSPEEXDSP_LIBRARIES=${CMAKE_BINARY_DIR}/external/dist/lib/libspeexdsp.a
+        -DSPEEXDSP_INCLUDE_DIR=${CMAKE_BINARY_DIR}/external/dist/include)
+endif()
+
+if(CMAKE_CROSSCOMPILING)
+    set(CODEC2_CMAKE_ARGS "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
+endif()
+
+include(ExternalProject)
+ExternalProject_Add(codec2
+   SVN_REPOSITORY https://svn.code.sf.net/p/freetel/code/codec2-dev
+   CMAKE_ARGS ${CODEC2_CMAKE_ARGS} ${SPEEXDSP_CMAKE_ARGS}
+   INSTALL_COMMAND ""
+)
+set(CODEC2_LIBRARIES
+    ${CMAKE_BINARY_DIR}/codec2-prefix/src/codec2-build/src/libcodec2.a)
+include_directories(${CMAKE_BINARY_DIR}/codec2-prefix/src/codec2/src)
+list(APPEND FREEDV_LINK_LIBS ${CODEC2_LIBRARIES})
+list(APPEND FREEDV_STATIC_DEPS codec2)
diff --git a/freedv/branches/0.99/cmake/BuildPortaudio.cmake b/freedv/branches/0.99/cmake/BuildPortaudio.cmake
new file mode 100644 (file)
index 0000000..cc33d06
--- /dev/null
@@ -0,0 +1,52 @@
+set(PORTAUDIO_TARBALL "pa_stable_v19_20111121")
+
+# required linking libraries on linux. Not sure about windows.
+find_library(ALSA_LIBRARIES asound)
+
+if(UNIX AND NOT ALSA_LIBRARIES)
+    message(ERROR "Could not find alsa library which is required for portaudio.
+On Linux systems try installing:
+    alsa-lib-devel  (RPM based systems)
+    libasound2-dev  (DEB based systems)"
+    )
+endif()
+
+# Make sure that configure knows what system we're using when cross-compiling.
+if(MINGW AND CMAKE_CROSSCOMPILING)
+    include(cmake/MinGW.cmake)
+    set(CONFIGURE_COMMAND ./configure --build=${HOST} --host=${HOST} --target=${HOST} --enable-cxx --without-jack --disable-shared --prefix=${CMAKE_BINARY_DIR}/external/dist)
+else()
+    set(CONFIGURE_COMMAND ./configure --enable-cxx --without-jack --disable-shared --prefix=${CMAKE_BINARY_DIR}/external/dist)
+endif()
+
+include(ExternalProject)
+ExternalProject_Add(portaudio
+    URL http://www.portaudio.com/archives/${PORTAUDIO_TARBALL}.tgz
+    BUILD_IN_SOURCE 1
+    INSTALL_DIR external/dist
+    CONFIGURE_COMMAND ${CONFIGURE_COMMAND}
+    BUILD_COMMAND $(MAKE)
+    INSTALL_COMMAND $(MAKE) install
+)
+if(WIN32)
+    set(PORTAUDIO_LIBRARIES 
+        ${CMAKE_BINARY_DIR}/external/dist/lib/libportaudio.a
+        ${CMAKE_BINARY_DIR}/external/dist/lib/libportaudiocpp.a
+)
+else(WIN32)
+    find_library(RT rt)
+    find_library(ASOUND asound)
+    set(PORTAUDIO_LIBRARIES
+        ${CMAKE_BINARY_DIR}/external/dist/lib/libportaudio.a
+        ${CMAKE_BINARY_DIR}/external/dist/lib/libportaudiocpp.a
+        ${RT}
+        ${ASOUND}
+    )
+endif(WIN32)
+include_directories(${CMAKE_BINARY_DIR}/external/dist/include)
+
+# Add the portaudio library to the list of libraries that must be linked.
+list(APPEND FREEDV_LINK_LIBS ${PORTAUDIO_LIBRARIES})
+
+# Setup a dependency so that this gets built before linking to freedv.
+list(APPEND FREEDV_STATIC_DEPS portaudio)
diff --git a/freedv/branches/0.99/cmake/BuildSamplerate.cmake b/freedv/branches/0.99/cmake/BuildSamplerate.cmake
new file mode 100644 (file)
index 0000000..aa09f85
--- /dev/null
@@ -0,0 +1,27 @@
+set(SAMPLERATE_TARBALL "libsamplerate-0.1.8")
+
+if(MINGW AND CMAKE_CROSSCOMPILING)
+    set(CONFIGURE_COMMAND ./configure --build=${HOST} --host=${HOST} --target=${HOST} --prefix=${CMAKE_BINARY_DIR}/external/dist --disable-sndfile)
+else()
+    set(CONFIGURE_COMMAND ./configure --prefix=${CMAKE_BINARY_DIR}/external/dist)
+endif()
+
+include(ExternalProject)
+ExternalProject_Add(samplerate
+    URL http://www.mega-nerd.com/SRC/${SAMPLERATE_TARBALL}.tar.gz 
+    BUILD_IN_SOURCE 1
+    INSTALL_DIR external/dist
+    CONFIGURE_COMMAND ${CONFIGURE_COMMAND}
+    BUILD_COMMAND $(MAKE)
+    INSTALL_COMMAND $(MAKE) install
+)
+if(WIN32)
+    set(SAMPLERATE_LIBRARIES
+        ${CMAKE_BINARY_DIR}/external/dist/lib/libsamplerate.a)
+else(WIN32)
+    set(SAMPLERATE_LIBRARIES
+        ${CMAKE_BINARY_DIR}/external/dist/lib/libsamplerate.a)
+endif(WIN32)
+include_directories(${CMAKE_BINARY_DIR}/external/dist/include)
+list(APPEND FREEDV_LINK_LIBS ${SAMPLERATE_LIBRARIES})
+list(APPEND FREEDV_STATIC_DEPS samplerate)
diff --git a/freedv/branches/0.99/cmake/BuildSndfile.cmake b/freedv/branches/0.99/cmake/BuildSndfile.cmake
new file mode 100644 (file)
index 0000000..43233fb
--- /dev/null
@@ -0,0 +1,26 @@
+set(SNDFILE_TARBALL "libsndfile-1.0.25")
+
+if(MINGW AND CMAKE_CROSSCOMPILING)
+    set(CONFIGURE_COMMAND ./configure --host=${HOST}  --prefix=${CMAKE_BINARY_DIR}/external/dist --disable-external-libs --disable-shared)
+else()
+    set(CONFIGURE_COMMAND ./configure --prefix=${CMAKE_BINARY_DIR}/external/dist --disable-external-libs --disable-shared --disable-external-libs)
+endif()
+
+include(ExternalProject)
+ExternalProject_Add(sndfile
+    URL http://www.mega-nerd.com/libsndfile/files/${SNDFILE_TARBALL}.tar.gz
+    BUILD_IN_SOURCE 1
+    INSTALL_DIR external/dist
+    CONFIGURE_COMMAND ${CONFIGURE_COMMAND}
+    BUILD_COMMAND $(MAKE) V=1
+    INSTALL_COMMAND $(MAKE) install
+)
+if(MINGW)
+    set(SNDFILE_LIBRARIES ${CMAKE_BINARY_DIR}/external/dist/lib/libsndfile.a)
+else()
+    set(SNDFILE_LIBRARIES ${CMAKE_BINARY_DIR}/external/dist/lib/libsndfile.a)
+endif()
+
+include_directories(${CMAKE_BINARY_DIR}/external/dist/include)
+list(APPEND FREEDV_LINK_LIBS ${SNDFILE_LIBRARIES})
+list(APPEND FREEDV_STATIC_DEPS sndfile)
diff --git a/freedv/branches/0.99/cmake/BuildSox.cmake b/freedv/branches/0.99/cmake/BuildSox.cmake
new file mode 100644 (file)
index 0000000..d54488b
--- /dev/null
@@ -0,0 +1,48 @@
+set(SOX_TARBALL "sox-14.4.1")
+
+# required linking libraries on linux. Not sure about windows.
+find_library(ALSA_LIBRARIES asound)
+find_library(AO_LIBRARIES ao)
+find_library(GSM_LIBRARIES gsm)
+
+if(UNIX AND NOT ALSA_LIBRARIES)
+    message(ERROR "Could not find alsa library.
+On Linux systems try installing:
+    alsa-lib-devel  (RPM based systems)
+    libasound2-dev  (DEB based systems)"
+    )
+endif(UNIX AND NOT ALSA_LIBRARIES)
+
+if(UNIX AND NOT AO_LIBRARIES)
+    message(ERROR "Could not find libao.
+On Linux systems try installing:
+    libao-devel  (RPM based systems)
+    libao-dev    (DEB based systems)"
+    )
+endif(UNIX AND NOT AO_LIBRARIES)
+
+if(MINGW AND CMAKE_CROSSCOMPILING)
+    set(CONFIGURE_COMMAND ./configure --host=${HOST} --enable-shared=no --without-id3tag --without-png --disable-gomp --with-oggvorbis=no --with-oss=no --with-flac=no --with-amrnb=no --with-amrwb=no --with-mp3=no --with-wavpack=no --disable-dl-sndfile --with-pulseaudio=no --without-magic --with-gsm --prefix=${CMAKE_BINARY_DIR}/external/dist)
+else()
+    set(CONFIGURE_COMMAND ./configure --enable-shared=no --without-id3tag --without-png --disable-gomp --with-oggvorbis=no --with-oss=no --with-flac=no --with-amrnb=no --with-amrwb=no --with-mp3=no --with-wavpack=no --disable-dl-sndfile --with-pulseaudio=no --without-magic --with-gsm --prefix=${CMAKE_BINARY_DIR}/external/dist)
+endif()
+
+include(ExternalProject)
+ExternalProject_Add(sox
+    URL http://downloads.sourceforge.net/sox/${SOX_TARBALL}.tar.gz
+    BUILD_IN_SOURCE 1
+    INSTALL_DIR external/dist
+    CONFIGURE_COMMAND ${CONFIGURE_COMMAND}
+    BUILD_COMMAND $(MAKE) V=1
+    INSTALL_COMMAND $(MAKE) install
+)
+set(SOX_LIBRARIES ${CMAKE_BINARY_DIR}/external/dist/lib/libsox.a)
+if(UNIX)
+    list(APPEND SOX_LIBRARIES ${ALSA_LIBRARIES} ${AO_LIBRARIES} ${GSM_LIBRARIES})
+endif()
+if(MINGW)
+    list(APPEND SOX_LIBRARIES winmm)
+endif()
+include_directories(${CMAKE_BINARY_DIR}/external/dist/include)
+list(APPEND FREEDV_LINK_LIBS ${SOX_LIBRARIES})
+list(APPEND FREEDV_STATIC_DEPS sox)
diff --git a/freedv/branches/0.99/cmake/BuildSpeex.cmake b/freedv/branches/0.99/cmake/BuildSpeex.cmake
new file mode 100644 (file)
index 0000000..262d558
--- /dev/null
@@ -0,0 +1,26 @@
+set(SPEEXDSP_TARBALL "speexdsp-1.2rc3.tar.gz")
+
+if(MINGW AND CMAKE_CROSSCOMPILING)
+    include(cmake/MinGW.cmake)
+    set(CONFIGURE_COMMAND ./configure --host=${HOST} --prefix=${CMAKE_BINARY_DIR}/external/dist --disable-examples)
+else()
+    set(CONFIGURE_COMMAND ./configure --prefix=${CMAKE_BINARY_DIR}/external/dist --disable-examples)
+endif()
+
+include(ExternalProject)
+ExternalProject_Add(speex
+   URL http://downloads.xiph.org/releases/speex/${SPEEXDSP_TARBALL}
+   BUILD_IN_SOURCE 1
+   INSTALL_DIR external/dist
+   CONFIGURE_COMMAND ${CONFIGURE_COMMAND}
+   BUILD_COMMAND $(MAKE)
+   INSTALL_COMMAND $(MAKE) install
+)
+
+set(SPEEXDSP_LIBRARIES ${CMAKE_BINARY_DIR}/external/dist/lib/libspeexdsp.a)
+include_directories(${CMAKE_BINARY_DIR}/external/dist/include)
+list(APPEND FREEDV_LINK_LIBS ${SPEEXDSP_LIBRARIES})
+list(APPEND FREEDV_STATIC_DEPS speex)
+if(USE_STATIC_CODEC2)
+    add_dependencies(codec2 speex)
+endif()
diff --git a/freedv/branches/0.99/cmake/BuildWxWidgets.cmake b/freedv/branches/0.99/cmake/BuildWxWidgets.cmake
new file mode 100644 (file)
index 0000000..901d806
--- /dev/null
@@ -0,0 +1,43 @@
+set(WXWIDGETS_TARBALL "wxWidgets-3.0.2")
+
+# If we're cross-compiling then we need to set the target host manually.
+if(MINGW AND CMAKE_CROSSCOMPILING)
+    include(cmake/MinGW.cmake)
+endif()
+
+# If not cross-compiling then use the built-in makefile, otherwise use standard configure.
+if(MINGW AND NOT CMAKE_CROSSCOMPILING)
+#    set(CONFIGURE_COMMAND "true")
+#    set(MAKE_COMMAND $(MAKE) -C build/msw -f makefile.gcc SHARED=0 UNICODE=1 BUILD=release PREFIX=${CMAKE_BINARY_DIR}/external/dist)
+    set(CONFIGURE_COMMAND ./configure --disable-shared --prefix=${CMAKE_BINARY_DIR}/external/dist)
+       set(MAKE_COMMAND $(MAKE))
+endif()
+
+if(MINGW AND CMAKE_CROSSCOMPILING)
+    set(CONFIGURE_COMMAND ./configure --build=${HOST} --host=${HOST} --target=${HOST} --disable-shared --prefix=${CMAKE_BINARY_DIR}/external/dist)
+       set(MAKE_COMMAND $(MAKE))
+endif()
+
+if(NOT MINGW)
+    set(CONFIGURE_COMMAND ./configure --host=${HOST} --target=${HOST} --disable-shared --prefix=${CMAKE_BINARY_DIR}/external/dist)
+       set(MAKE_COMMAND $(MAKE))
+endif()
+
+include(ExternalProject)
+ExternalProject_Add(wxWidgets
+    URL http://downloads.sourceforge.net/wxwindows/${WXWIDGETS_TARBALL}.tar.bz2
+    BUILD_IN_SOURCE 1
+    INSTALL_DIR external/dist
+    CONFIGURE_COMMAND ${CONFIGURE_COMMAND}
+    BUILD_COMMAND ${MAKE_COMMAND}
+    INSTALL_COMMAND $(MAKE) install
+)
+
+ExternalProject_Get_Property(wxWidgets install_dir)
+message(STATUS "wxWidgets install dir: ${install_dir}")
+if(NOT WXCONFIG)
+    set(WXCONFIG "${install_dir}/bin/wx-config")
+endif()
+if(EXISTS ${WXCONFIG})
+    set(BS_WX_DONE TRUE)
+endif()
diff --git a/freedv/branches/0.99/cmake/FindPortaudio.cmake b/freedv/branches/0.99/cmake/FindPortaudio.cmake
new file mode 100644 (file)
index 0000000..158e20e
--- /dev/null
@@ -0,0 +1,107 @@
+# - Try to find Portaudio
+# Once done this will define
+#
+#  PORTAUDIO_FOUND - system has Portaudio
+#  PORTAUDIO_INCLUDE_DIRS - the Portaudio include directory
+#  PORTAUDIO_LIBRARIES - Link these to use Portaudio
+#  PORTAUDIO_DEFINITIONS - Compiler switches required for using Portaudio
+#  PORTAUDIO_VERSION - Portaudio version
+#
+#  Copyright (c) 2006 Andreas Schneider <mail@cynapses.org>
+#
+# Redistribution and use is allowed according to the terms of the New BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+#
+
+
+if (PORTAUDIO_LIBRARIES AND PORTAUDIO_INCLUDE_DIRS)
+  # in cache already
+  set(PORTAUDIO_FOUND TRUE)
+else (PORTAUDIO_LIBRARIES AND PORTAUDIO_INCLUDE_DIRS)
+  if (NOT WIN32)
+   include(FindPkgConfig)
+   pkg_check_modules(PORTAUDIO2 portaudio-2.0)
+  endif (NOT WIN32)
+
+  if (PORTAUDIO2_FOUND)
+    set(PORTAUDIO_INCLUDE_DIRS
+      ${PORTAUDIO2_INCLUDE_DIRS}
+    )
+    if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+      set(PORTAUDIO_LIBRARIES "${PORTAUDIO2_LIBRARY_DIRS}/lib${PORTAUDIO2_LIBRARIES}.dylib")
+    else (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+      set(PORTAUDIO_LIBRARIES
+        ${PORTAUDIO2_LIBRARIES}
+      )
+    endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+    set(PORTAUDIO_VERSION
+      19
+    )
+    set(PORTAUDIO_FOUND TRUE)
+  else (PORTAUDIO2_FOUND)
+    find_path(PORTAUDIO_INCLUDE_DIR
+      NAMES
+        portaudio.h
+      PATHS
+        /usr/include
+        /usr/local/include
+        /opt/local/include
+        /sw/include
+    )
+   
+    find_library(PORTAUDIO_LIBRARY
+      NAMES
+        portaudio
+      PATHS
+        /usr/lib
+        /usr/local/lib
+        /opt/local/lib
+        /sw/lib
+    )
+   
+    find_path(PORTAUDIO_LIBRARY_DIR
+      NAMES
+        portaudio
+      PATHS
+        /usr/lib
+        /usr/local/lib
+        /opt/local/lib
+        /sw/lib
+    )
+   
+    set(PORTAUDIO_INCLUDE_DIRS
+      ${PORTAUDIO_INCLUDE_DIR}
+    )
+    set(PORTAUDIO_LIBRARIES
+      ${PORTAUDIO_LIBRARY}
+    )
+   
+    set(PORTAUDIO_LIBRARY_DIRS
+      ${PORTAUDIO_LIBRARY_DIR}
+    )
+   
+    set(PORTAUDIO_VERSION
+      18
+    )
+   
+    if (PORTAUDIO_INCLUDE_DIRS AND PORTAUDIO_LIBRARIES)
+       set(PORTAUDIO_FOUND TRUE)
+    endif (PORTAUDIO_INCLUDE_DIRS AND PORTAUDIO_LIBRARIES)
+   
+    if (PORTAUDIO_FOUND)
+      if (NOT Portaudio_FIND_QUIETLY)
+        message(STATUS "Found Portaudio: ${PORTAUDIO_LIBRARIES}")
+      endif (NOT Portaudio_FIND_QUIETLY)
+    else (PORTAUDIO_FOUND)
+      if (Portaudio_FIND_REQUIRED)
+        message(FATAL_ERROR "Could not find Portaudio")
+      endif (Portaudio_FIND_REQUIRED)
+    endif (PORTAUDIO_FOUND)
+  endif (PORTAUDIO2_FOUND)
+
+
+  # show the PORTAUDIO_INCLUDE_DIRS and PORTAUDIO_LIBRARIES variables only in the advanced view
+  mark_as_advanced(PORTAUDIO_INCLUDE_DIRS PORTAUDIO_LIBRARIES)
+
+endif (PORTAUDIO_LIBRARIES AND PORTAUDIO_INCLUDE_DIRS)
+
diff --git a/freedv/branches/0.99/cmake/GetDependencies.cmake.in b/freedv/branches/0.99/cmake/GetDependencies.cmake.in
new file mode 100644 (file)
index 0000000..93204dd
--- /dev/null
@@ -0,0 +1,25 @@
+# As this script is run in a new cmake instance, it does not have access to
+# the existing cache variables. Pass them in via the configure_file command.
+set(CMAKE_BINARY_DIR @CMAKE_BINARY_DIR@)
+set(CMAKE_SOURCE_DIR @CMAKE_SOURCE_DIR@)
+set(UNIX @UNIX@)
+set(WIN32 @WIN32@)
+set(CMAKE_CROSSCOMPILING @CMAKE_CROSSCOMPILING@)
+set(CMAKE_FIND_LIBRARY_SUFFIXES @CMAKE_FIND_LIBRARY_SUFFIXES@)
+set(CMAKE_FIND_LIBRARY_PREFIXES @CMAKE_FIND_LIBRARY_PREFIXES@)
+set(CMAKE_SYSTEM_LIBRARY_PATH @CMAKE_SYSTEM_LIBRARY_PATH@)
+set(CMAKE_FIND_ROOT_PATH @CMAKE_FIND_ROOT_PATH@)
+
+set(FREEDV_EXE ${CMAKE_BINARY_DIR}/src/freedv.exe)
+
+include(GetPrerequisites)
+get_prerequisites("${FREEDV_EXE}" _deps 1 1 "" "${CMAKE_SYSTEM_LIBRARY_PATH}")
+foreach(_runtime ${_deps})
+    message("Looking for ${_runtime}")
+    find_library(RUNTIME_${_runtime} ${_runtime})
+    message("${RUNTIME_${_runtime}}")
+    if(RUNTIME_${_runtime})
+        file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/bin"
+        TYPE EXECUTABLE FILES "${RUNTIME_${_runtime}}")
+    endif()
+endforeach()
diff --git a/freedv/branches/0.99/cmake/MinGW.cmake b/freedv/branches/0.99/cmake/MinGW.cmake
new file mode 100644 (file)
index 0000000..333c1dc
--- /dev/null
@@ -0,0 +1,8 @@
+# If we're cross-compiling then we need to set the target host manually.
+if(MINGW AND CMAKE_CROSSCOMPILING)
+    if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
+        set(HOST x86_64-w64-mingw32)
+    else()
+        set(HOST i686-w64-mingw32)
+    endif()
+endif()
diff --git a/freedv/branches/0.99/cmake/Toolchain-Ubuntu-mingw32.cmake b/freedv/branches/0.99/cmake/Toolchain-Ubuntu-mingw32.cmake
new file mode 100644 (file)
index 0000000..3507d72
--- /dev/null
@@ -0,0 +1,25 @@
+# Sample toolchain file for building for Windows from an Ubuntu Linux system.
+#
+# Typical usage:
+#    *) install cross compiler: `sudo apt-get install mingw-w64 g++-mingw-w64`
+#    *) cd build
+#    *) cmake -DCMAKE_TOOLCHAIN_FILE=~/Toolchain-Ubuntu-mingw32.cmake ..
+
+set(CMAKE_SYSTEM_NAME Windows)
+set(TOOLCHAIN_PREFIX i686-w64-mingw32)
+
+# cross compilers to use for C and C++
+set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc)
+set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
+set(CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres)
+
+# target environment on the build host system
+#   set 1st to dir with the cross compiler's C/C++ headers/libs
+set(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX})
+
+# modify default behavior of FIND_XXX() commands to
+# search for headers/libs in the target environment and
+# search for programs in the build host environment
+set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
diff --git a/freedv/branches/0.99/cmake/config.h.in b/freedv/branches/0.99/cmake/config.h.in
new file mode 100644 (file)
index 0000000..8e3ab76
--- /dev/null
@@ -0,0 +1,19 @@
+/*--------------------------------------------------------------------------
+ ** This file is autogenerated from config.h.in 
+ ** during the cmake configuration of your project. If you need to make changes
+ ** edit the original file NOT THIS FILE.
+ ** --------------------------------------------------------------------------*/
+#ifndef _CONFIGURATION_HEADER_GUARD_H_
+#define _CONFIGURATION_HEADER_GUARD_H_
+
+#define SIZEOF_INT @SIZEOF_INT@
+#cmakedefine HAVE_LIMITS_H @HAVE_LIMITS_H@
+#cmakedefine HAVE_STDINT_H @HAVE_STDINT_H@
+#cmakedefine HAVE_STDDEF_H @HAVE_STDDEF_H@
+#cmakedefine HAVE_STDLIB_H @HAVE_STDLIB_H@
+#cmakedefine HAVE_STRING_H @HAVE_STRING_H@
+#cmakedefine HAVE_FLOOR @HAVE_FLOOR@
+#cmakedefine HAVE_MEMSET @HAVE_MEMSET@
+#cmakedefine HAVE_POW @HAVE_POW@
+#cmakedefine HAVE_SQRT @HAVE_SQRT@
+#endif
diff --git a/freedv/branches/0.99/cmake/version.h.in b/freedv/branches/0.99/cmake/version.h.in
new file mode 100644 (file)
index 0000000..43b3b7a
--- /dev/null
@@ -0,0 +1,11 @@
+#ifndef FREEDV_VER_DOT_H
+#define FREEDV_VER_DOT_H 1
+
+#define FREEDV_VERSION_MAJOR @FREEDV_VERSION_MAJOR@
+#define FREEDV_VERSION_MINOR @FREEDV_VERSION_MINOR@
+#define FREEDV_VERSION_PATCH @FREEDV_VERSION_PATCH@
+#define FREEDV_VERSION_SUFFIX "@FREEDV_VERSION_SUFFIX@"
+
+#define FREEDV_VERSION "@FREEDV_VERSION_STRING@"
+
+#endif //FREEDV_VER_DOT_H
diff --git a/freedv/branches/0.99/contrib/CMakeLists.txt b/freedv/branches/0.99/contrib/CMakeLists.txt
new file mode 100644 (file)
index 0000000..3f4b7e0
--- /dev/null
@@ -0,0 +1,22 @@
+# Install icons if we're on most *nix systems.
+if(UNIX AND NOT APPLE)
+    set(ICON_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor
+        CACHE PATH "Prefix to use for installing icons.")
+    install(FILES freedv48x48.png
+        DESTINATION ${ICON_INSTALL_PREFIX}/48x48/apps
+        RENAME freedv.png)
+    install(FILES freedv64x64.png
+        DESTINATION ${ICON_INSTALL_PREFIX}/64x64/apps
+        RENAME freedv.png)
+    install(FILES freedv128x128.png
+        DESTINATION ${ICON_INSTALL_PREFIX}/128x128/apps
+        RENAME freedv.png)
+    install(FILES freedv256x256.png
+        DESTINATION ${ICON_INSTALL_PREFIX}/256x256/apps
+        RENAME freedv.png)
+
+    set(DESKTOP_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/applications
+        CACHE PATH "Location to install desktop files.")
+    install(FILES freedv.desktop
+        DESTINATION ${DESKTOP_INSTALL_DIR})
+endif(UNIX AND NOT APPLE)
diff --git a/freedv/branches/0.99/contrib/LICENSE b/freedv/branches/0.99/contrib/LICENSE
new file mode 100644 (file)
index 0000000..dc8853a
--- /dev/null
@@ -0,0 +1,393 @@
+Attribution 4.0 International
+
+=======================================================================
+
+Creative Commons Corporation ("Creative Commons") is not a law firm and
+does not provide legal services or legal advice. Distribution of
+Creative Commons public licenses does not create a lawyer-client or
+other relationship. Creative Commons makes its licenses and related
+information available on an "as-is" basis. Creative Commons gives no
+warranties regarding its licenses, any material licensed under their
+terms and conditions, or any related information. Creative Commons
+disclaims all liability for damages resulting from their use to the
+fullest extent possible.
+
+Using Creative Commons Public Licenses
+
+Creative Commons public licenses provide a standard set of terms and
+conditions that creators and other rights holders may use to share
+original works of authorship and other material subject to copyright
+and certain other rights specified in the public license below. The
+following considerations are for informational purposes only, are not
+exhaustive, and do not form part of our licenses.
+
+     Considerations for licensors: Our public licenses are
+     intended for use by those authorized to give the public
+     permission to use material in ways otherwise restricted by
+     copyright and certain other rights. Our licenses are
+     irrevocable. Licensors should read and understand the terms
+     and conditions of the license they choose before applying it.
+     Licensors should also secure all rights necessary before
+     applying our licenses so that the public can reuse the
+     material as expected. Licensors should clearly mark any
+     material not subject to the license. This includes other CC-
+     licensed material, or material used under an exception or
+     limitation to copyright. More considerations for licensors:
+       wiki.creativecommons.org/Considerations_for_licensors
+
+     Considerations for the public: By using one of our public
+     licenses, a licensor grants the public permission to use the
+     licensed material under specified terms and conditions. If
+     the licensor's permission is not necessary for any reason--for
+     example, because of any applicable exception or limitation to
+     copyright--then that use is not regulated by the license. Our
+     licenses grant only permissions under copyright and certain
+     other rights that a licensor has authority to grant. Use of
+     the licensed material may still be restricted for other
+     reasons, including because others have copyright or other
+     rights in the material. A licensor may make special requests,
+     such as asking that all changes be marked or described.
+     Although not required by our licenses, you are encouraged to
+     respect those requests where reasonable. More_considerations
+     for the public: 
+       wiki.creativecommons.org/Considerations_for_licensees
+
+=======================================================================
+
+Creative Commons Attribution 4.0 International Public License
+
+By exercising the Licensed Rights (defined below), You accept and agree
+to be bound by the terms and conditions of this Creative Commons
+Attribution 4.0 International Public License ("Public License"). To the
+extent this Public License may be interpreted as a contract, You are
+granted the Licensed Rights in consideration of Your acceptance of
+these terms and conditions, and the Licensor grants You such rights in
+consideration of benefits the Licensor receives from making the
+Licensed Material available under these terms and conditions.
+
+
+Section 1 -- Definitions.
+
+  a. Adapted Material means material subject to Copyright and Similar
+     Rights that is derived from or based upon the Licensed Material
+     and in which the Licensed Material is translated, altered,
+     arranged, transformed, or otherwise modified in a manner requiring
+     permission under the Copyright and Similar Rights held by the
+     Licensor. For purposes of this Public License, where the Licensed
+     Material is a musical work, performance, or sound recording,
+     Adapted Material is always produced where the Licensed Material is
+     synched in timed relation with a moving image.
+
+  b. Adapter's License means the license You apply to Your Copyright
+     and Similar Rights in Your contributions to Adapted Material in
+     accordance with the terms and conditions of this Public License.
+
+  c. Copyright and Similar Rights means copyright and/or similar rights
+     closely related to copyright including, without limitation,
+     performance, broadcast, sound recording, and Sui Generis Database
+     Rights, without regard to how the rights are labeled or
+     categorized. For purposes of this Public License, the rights
+     specified in Section 2(b)(1)-(2) are not Copyright and Similar
+     Rights.
+
+  d. Effective Technological Measures means those measures that, in the
+     absence of proper authority, may not be circumvented under laws
+     fulfilling obligations under Article 11 of the WIPO Copyright
+     Treaty adopted on December 20, 1996, and/or similar international
+     agreements.
+
+  e. Exceptions and Limitations means fair use, fair dealing, and/or
+     any other exception or limitation to Copyright and Similar Rights
+     that applies to Your use of the Licensed Material.
+
+  f. Licensed Material means the artistic or literary work, database,
+     or other material to which the Licensor applied this Public
+     License.
+
+  g. Licensed Rights means the rights granted to You subject to the
+     terms and conditions of this Public License, which are limited to
+     all Copyright and Similar Rights that apply to Your use of the
+     Licensed Material and that the Licensor has authority to license.
+
+  h. Licensor means the individual(s) or entity(ies) granting rights
+     under this Public License.
+
+  i. Share means to provide material to the public by any means or
+     process that requires permission under the Licensed Rights, such
+     as reproduction, public display, public performance, distribution,
+     dissemination, communication, or importation, and to make material
+     available to the public including in ways that members of the
+     public may access the material from a place and at a time
+     individually chosen by them.
+
+  j. Sui Generis Database Rights means rights other than copyright
+     resulting from Directive 96/9/EC of the European Parliament and of
+     the Council of 11 March 1996 on the legal protection of databases,
+     as amended and/or succeeded, as well as other essentially
+     equivalent rights anywhere in the world.
+
+  k. You means the individual or entity exercising the Licensed Rights
+     under this Public License. Your has a corresponding meaning.
+
+
+Section 2 -- Scope.
+
+  a. License grant.
+
+       1. Subject to the terms and conditions of this Public License,
+          the Licensor hereby grants You a worldwide, royalty-free,
+          non-sublicensable, non-exclusive, irrevocable license to
+          exercise the Licensed Rights in the Licensed Material to:
+
+            a. reproduce and Share the Licensed Material, in whole or
+               in part; and
+
+            b. produce, reproduce, and Share Adapted Material.
+
+       2. Exceptions and Limitations. For the avoidance of doubt, where
+          Exceptions and Limitations apply to Your use, this Public
+          License does not apply, and You do not need to comply with
+          its terms and conditions.
+
+       3. Term. The term of this Public License is specified in Section
+          6(a).
+
+       4. Media and formats; technical modifications allowed. The
+          Licensor authorizes You to exercise the Licensed Rights in
+          all media and formats whether now known or hereafter created,
+          and to make technical modifications necessary to do so. The
+          Licensor waives and/or agrees not to assert any right or
+          authority to forbid You from making technical modifications
+          necessary to exercise the Licensed Rights, including
+          technical modifications necessary to circumvent Effective
+          Technological Measures. For purposes of this Public License,
+          simply making modifications authorized by this Section 2(a)
+          (4) never produces Adapted Material.
+
+       5. Downstream recipients.
+
+            a. Offer from the Licensor -- Licensed Material. Every
+               recipient of the Licensed Material automatically
+               receives an offer from the Licensor to exercise the
+               Licensed Rights under the terms and conditions of this
+               Public License.
+
+            b. No downstream restrictions. You may not offer or impose
+               any additional or different terms or conditions on, or
+               apply any Effective Technological Measures to, the
+               Licensed Material if doing so restricts exercise of the
+               Licensed Rights by any recipient of the Licensed
+               Material.
+
+       6. No endorsement. Nothing in this Public License constitutes or
+          may be construed as permission to assert or imply that You
+          are, or that Your use of the Licensed Material is, connected
+          with, or sponsored, endorsed, or granted official status by,
+          the Licensor or others designated to receive attribution as
+          provided in Section 3(a)(1)(A)(i).
+
+  b. Other rights.
+
+       1. Moral rights, such as the right of integrity, are not
+          licensed under this Public License, nor are publicity,
+          privacy, and/or other similar personality rights; however, to
+          the extent possible, the Licensor waives and/or agrees not to
+          assert any such rights held by the Licensor to the limited
+          extent necessary to allow You to exercise the Licensed
+          Rights, but not otherwise.
+
+       2. Patent and trademark rights are not licensed under this
+          Public License.
+
+       3. To the extent possible, the Licensor waives any right to
+          collect royalties from You for the exercise of the Licensed
+          Rights, whether directly or through a collecting society
+          under any voluntary or waivable statutory or compulsory
+          licensing scheme. In all other cases the Licensor expressly
+          reserves any right to collect such royalties.
+
+
+Section 3 -- License Conditions.
+
+Your exercise of the Licensed Rights is expressly made subject to the
+following conditions.
+
+  a. Attribution.
+
+       1. If You Share the Licensed Material (including in modified
+          form), You must:
+
+            a. retain the following if it is supplied by the Licensor
+               with the Licensed Material:
+
+                 i. identification of the creator(s) of the Licensed
+                    Material and any others designated to receive
+                    attribution, in any reasonable manner requested by
+                    the Licensor (including by pseudonym if
+                    designated);
+
+                ii. a copyright notice;
+
+               iii. a notice that refers to this Public License;
+
+                iv. a notice that refers to the disclaimer of
+                    warranties;
+
+                 v. a URI or hyperlink to the Licensed Material to the
+                    extent reasonably practicable;
+
+            b. indicate if You modified the Licensed Material and
+               retain an indication of any previous modifications; and
+
+            c. indicate the Licensed Material is licensed under this
+               Public License, and include the text of, or the URI or
+               hyperlink to, this Public License.
+
+       2. You may satisfy the conditions in Section 3(a)(1) in any
+          reasonable manner based on the medium, means, and context in
+          which You Share the Licensed Material. For example, it may be
+          reasonable to satisfy the conditions by providing a URI or
+          hyperlink to a resource that includes the required
+          information.
+
+       3. If requested by the Licensor, You must remove any of the
+          information required by Section 3(a)(1)(A) to the extent
+          reasonably practicable.
+
+       4. If You Share Adapted Material You produce, the Adapter's
+          License You apply must not prevent recipients of the Adapted
+          Material from complying with this Public License.
+
+
+Section 4 -- Sui Generis Database Rights.
+
+Where the Licensed Rights include Sui Generis Database Rights that
+apply to Your use of the Licensed Material:
+
+  a. for the avoidance of doubt, Section 2(a)(1) grants You the right
+     to extract, reuse, reproduce, and Share all or a substantial
+     portion of the contents of the database;
+
+  b. if You include all or a substantial portion of the database
+     contents in a database in which You have Sui Generis Database
+     Rights, then the database in which You have Sui Generis Database
+     Rights (but not its individual contents) is Adapted Material; and
+
+  c. You must comply with the conditions in Section 3(a) if You Share
+     all or a substantial portion of the contents of the database.
+
+For the avoidance of doubt, this Section 4 supplements and does not
+replace Your obligations under this Public License where the Licensed
+Rights include other Copyright and Similar Rights.
+
+
+Section 5 -- Disclaimer of Warranties and Limitation of Liability.
+
+  a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
+     EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
+     AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
+     ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
+     IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
+     WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
+     PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
+     ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
+     KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
+     ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
+
+  b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
+     TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
+     NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
+     INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
+     COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
+     USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
+     ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
+     DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
+     IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
+
+  c. The disclaimer of warranties and limitation of liability provided
+     above shall be interpreted in a manner that, to the extent
+     possible, most closely approximates an absolute disclaimer and
+     waiver of all liability.
+
+
+Section 6 -- Term and Termination.
+
+  a. This Public License applies for the term of the Copyright and
+     Similar Rights licensed here. However, if You fail to comply with
+     this Public License, then Your rights under this Public License
+     terminate automatically.
+
+  b. Where Your right to use the Licensed Material has terminated under
+     Section 6(a), it reinstates:
+
+       1. automatically as of the date the violation is cured, provided
+          it is cured within 30 days of Your discovery of the
+          violation; or
+
+       2. upon express reinstatement by the Licensor.
+
+     For the avoidance of doubt, this Section 6(b) does not affect any
+     right the Licensor may have to seek remedies for Your violations
+     of this Public License.
+
+  c. For the avoidance of doubt, the Licensor may also offer the
+     Licensed Material under separate terms or conditions or stop
+     distributing the Licensed Material at any time; however, doing so
+     will not terminate this Public License.
+
+  d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
+     License.
+
+
+Section 7 -- Other Terms and Conditions.
+
+  a. The Licensor shall not be bound by any additional or different
+     terms or conditions communicated by You unless expressly agreed.
+
+  b. Any arrangements, understandings, or agreements regarding the
+     Licensed Material not stated herein are separate from and
+     independent of the terms and conditions of this Public License.
+
+
+Section 8 -- Interpretation.
+
+  a. For the avoidance of doubt, this Public License does not, and
+     shall not be interpreted to, reduce, limit, restrict, or impose
+     conditions on any use of the Licensed Material that could lawfully
+     be made without permission under this Public License.
+
+  b. To the extent possible, if any provision of this Public License is
+     deemed unenforceable, it shall be automatically reformed to the
+     minimum extent necessary to make it enforceable. If the provision
+     cannot be reformed, it shall be severed from this Public License
+     without affecting the enforceability of the remaining terms and
+     conditions.
+
+  c. No term or condition of this Public License will be waived and no
+     failure to comply consented to unless expressly agreed to by the
+     Licensor.
+
+  d. Nothing in this Public License constitutes or may be interpreted
+     as a limitation upon, or waiver of, any privileges and immunities
+     that apply to the Licensor or You, including from the legal
+     processes of any jurisdiction or authority.
+
+
+=======================================================================
+
+Creative Commons is not a party to its public licenses.
+Notwithstanding, Creative Commons may elect to apply one of its public
+licenses to material it publishes and in those instances will be
+considered the "Licensor." Except for the limited purpose of indicating
+that material is shared under a Creative Commons public license or as
+otherwise permitted by the Creative Commons policies published at
+creativecommons.org/policies, Creative Commons does not authorize the
+use of the trademark "Creative Commons" or any other trademark or logo
+of Creative Commons without its prior written consent including,
+without limitation, in connection with any unauthorized modifications
+to any of its public licenses or any other arrangements,
+understandings, or agreements concerning use of licensed material. For
+the avoidance of doubt, this paragraph does not form part of the public
+licenses.
+
+Creative Commons may be contacted at creativecommons.org.
diff --git a/freedv/branches/0.99/contrib/freedv.desktop b/freedv/branches/0.99/contrib/freedv.desktop
new file mode 100644 (file)
index 0000000..96e8293
--- /dev/null
@@ -0,0 +1,8 @@
+[Desktop Entry]
+Version=1.0
+Name=FreeDV
+Exec=freedv
+Icon=freedv
+Type=Application
+Terminal=false
+Categories=GTK;GNOME;AudioVideo;Audio;HamRadio;
diff --git a/freedv/branches/0.99/contrib/freedv.ico b/freedv/branches/0.99/contrib/freedv.ico
new file mode 100644 (file)
index 0000000..e6b9a20
Binary files /dev/null and b/freedv/branches/0.99/contrib/freedv.ico differ
diff --git a/freedv/branches/0.99/contrib/freedv.rc b/freedv/branches/0.99/contrib/freedv.rc
new file mode 100644 (file)
index 0000000..2e6655d
--- /dev/null
@@ -0,0 +1 @@
+id ICON "./freedv.ico"
diff --git a/freedv/branches/0.99/contrib/freedv128x128.png b/freedv/branches/0.99/contrib/freedv128x128.png
new file mode 100644 (file)
index 0000000..5190a77
Binary files /dev/null and b/freedv/branches/0.99/contrib/freedv128x128.png differ
diff --git a/freedv/branches/0.99/contrib/freedv256x256.png b/freedv/branches/0.99/contrib/freedv256x256.png
new file mode 100644 (file)
index 0000000..b3eb5d7
Binary files /dev/null and b/freedv/branches/0.99/contrib/freedv256x256.png differ
diff --git a/freedv/branches/0.99/contrib/freedv48x48.png b/freedv/branches/0.99/contrib/freedv48x48.png
new file mode 100644 (file)
index 0000000..bd5efc6
Binary files /dev/null and b/freedv/branches/0.99/contrib/freedv48x48.png differ
diff --git a/freedv/branches/0.99/contrib/freedv64x64.png b/freedv/branches/0.99/contrib/freedv64x64.png
new file mode 100644 (file)
index 0000000..eb89773
Binary files /dev/null and b/freedv/branches/0.99/contrib/freedv64x64.png differ
diff --git a/freedv/branches/0.99/credits.txt b/freedv/branches/0.99/credits.txt
new file mode 100644 (file)
index 0000000..431e399
--- /dev/null
@@ -0,0 +1,13 @@
+Credits (code or ideas borrowed from):
+==============================================
+Dave Witten and David Rowe (obviously)
+Mel Whitten K0PFX (material and moral support)
+Bruce Perens (cheerleader, promotion and publicity)
+Mooneer Salem KG6AOV(Mac OSX Patch)
+Soeren Straarup OZ2DAK (FreeBSD Port)
+Don Mak
+Steve Nance (K5FR)
+Joel Stanley (Hamlib prototyping) and Mark Jessop (Mac OSX) 
+James Ahlstrom (Quisk)
+FLDIGI
+All the folks on the digital voice google group...
diff --git a/freedv/branches/0.99/db/current b/freedv/branches/0.99/db/current
new file mode 100644 (file)
index 0000000..d00491f
--- /dev/null
@@ -0,0 +1 @@
+1
diff --git a/freedv/branches/0.99/db/format b/freedv/branches/0.99/db/format
new file mode 100644 (file)
index 0000000..db06890
--- /dev/null
@@ -0,0 +1,2 @@
+4
+layout sharded 1000
diff --git a/freedv/branches/0.99/db/fs-type b/freedv/branches/0.99/db/fs-type
new file mode 100644 (file)
index 0000000..4fdd953
--- /dev/null
@@ -0,0 +1 @@
+fsfs
diff --git a/freedv/branches/0.99/db/fsfs.conf b/freedv/branches/0.99/db/fsfs.conf
new file mode 100644 (file)
index 0000000..cc08ceb
--- /dev/null
@@ -0,0 +1,38 @@
+### This file controls the configuration of the FSFS filesystem.\r
+\r
+[memcached-servers]\r
+### These options name memcached servers used to cache internal FSFS\r
+### data.  See http://www.danga.com/memcached/ for more information on\r
+### memcached.  To use memcached with FSFS, run one or more memcached\r
+### servers, and specify each of them as an option like so:\r
+# first-server = 127.0.0.1:11211\r
+# remote-memcached = mymemcached.corp.example.com:11212\r
+### The option name is ignored; the value is of the form HOST:PORT.\r
+### memcached servers can be shared between multiple repositories;\r
+### however, if you do this, you *must* ensure that repositories have\r
+### distinct UUIDs and paths, or else cached data from one repository\r
+### might be used by another accidentally.  Note also that memcached has\r
+### no authentication for reads or writes, so you must ensure that your\r
+### memcached servers are only accessible by trusted users.\r
+\r
+[caches]\r
+### When a cache-related error occurs, normally Subversion ignores it\r
+### and continues, logging an error if the server is appropriately\r
+### configured (and ignoring it with file:// access).  To make\r
+### Subversion never ignore cache errors, uncomment this line.\r
+# fail-stop = true\r
+\r
+[rep-sharing]\r
+### To conserve space, the filesystem can optionally avoid storing\r
+### duplicate representations.  This comes at a slight cost in\r
+### performance, as maintaining a database of shared representations can\r
+### increase commit times.  The space savings are dependent upon the size\r
+### of the repository, the number of objects it contains and the amount of\r
+### duplication between them, usually a function of the branching and\r
+### merging process.\r
+###\r
+### The following parameter enables rep-sharing in the repository.  It can\r
+### be switched on and off at will, but for best space-saving results\r
+### should be enabled consistently over the life of the repository.\r
+### rep-sharing is enabled by default.\r
+# enable-rep-sharing = true\r
diff --git a/freedv/branches/0.99/db/min-unpacked-rev b/freedv/branches/0.99/db/min-unpacked-rev
new file mode 100644 (file)
index 0000000..573541a
--- /dev/null
@@ -0,0 +1 @@
+0
diff --git a/freedv/branches/0.99/db/rep-cache.db b/freedv/branches/0.99/db/rep-cache.db
new file mode 100644 (file)
index 0000000..63c6f0b
Binary files /dev/null and b/freedv/branches/0.99/db/rep-cache.db differ
diff --git a/freedv/branches/0.99/db/revprops/0/0 b/freedv/branches/0.99/db/revprops/0/0
new file mode 100644 (file)
index 0000000..d0b90de
--- /dev/null
@@ -0,0 +1,5 @@
+K 8
+svn:date
+V 27
+2012-08-21T18:27:59.389906Z
+END
diff --git a/freedv/branches/0.99/db/revprops/0/1 b/freedv/branches/0.99/db/revprops/0/1
new file mode 100644 (file)
index 0000000..0af71a2
--- /dev/null
@@ -0,0 +1,13 @@
+K 10
+svn:author
+V 9
+OFA-Staff
+K 8
+svn:date
+V 27
+2012-08-21T18:28:08.741468Z
+K 7
+svn:log
+V 25
+Imported folder structure
+END
diff --git a/freedv/branches/0.99/db/revs/0/0 b/freedv/branches/0.99/db/revs/0/0
new file mode 100644 (file)
index 0000000..10f5c45
--- /dev/null
@@ -0,0 +1,11 @@
+PLAIN
+END
+ENDREP
+id: 0.0.r0/17
+type: dir
+count: 0
+text: 0 0 4 4 2d2977d1c96f487abe4a1e202dd03b4e
+cpath: /
+
+
+17 107
diff --git a/freedv/branches/0.99/db/revs/0/1 b/freedv/branches/0.99/db/revs/0/1
new file mode 100644 (file)
index 0000000..fd802a9
--- /dev/null
@@ -0,0 +1,49 @@
+id: 3-1.0.r1/0
+type: dir
+count: 0
+cpath: /tags
+copyroot: 0 /
+
+id: 0-1.0.r1/62
+type: dir
+count: 0
+cpath: /trunk
+copyroot: 0 /
+
+id: 2-1.0.r1/126
+type: dir
+count: 0
+cpath: /branches
+copyroot: 0 /
+
+PLAIN
+K 8
+branches
+V 16
+dir 2-1.0.r1/126
+K 4
+tags
+V 14
+dir 3-1.0.r1/0
+K 5
+trunk
+V 15
+dir 0-1.0.r1/62
+END
+ENDREP
+id: 0.0.r1/306
+type: dir
+pred: 0.0.r0/17
+count: 1
+text: 1 194 99 99 7b6cc14dddba4e09be5255b475d1a0a8
+cpath: /
+copyroot: 0 /
+
+_0.0.t0-0 add-dir false false /trunk
+
+_2.0.t0-0 add-dir false false /branches
+
+_3.0.t0-0 add-dir false false /tags
+
+
+306 431
diff --git a/freedv/branches/0.99/db/transactions/.gitignore b/freedv/branches/0.99/db/transactions/.gitignore
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/freedv/branches/0.99/db/txn-current b/freedv/branches/0.99/db/txn-current
new file mode 100644 (file)
index 0000000..d00491f
--- /dev/null
@@ -0,0 +1 @@
+1
diff --git a/freedv/branches/0.99/db/txn-current-lock b/freedv/branches/0.99/db/txn-current-lock
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/freedv/branches/0.99/db/txn-protorevs/.gitignore b/freedv/branches/0.99/db/txn-protorevs/.gitignore
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/freedv/branches/0.99/db/uuid b/freedv/branches/0.99/db/uuid
new file mode 100644 (file)
index 0000000..0f36297
--- /dev/null
@@ -0,0 +1 @@
+a56d66ce-6468-4744-9be7-52ce95ca47a4
diff --git a/freedv/branches/0.99/db/write-lock b/freedv/branches/0.99/db/write-lock
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/freedv/branches/0.99/src/CMakeLists.txt b/freedv/branches/0.99/src/CMakeLists.txt
new file mode 100644 (file)
index 0000000..44ccfe7
--- /dev/null
@@ -0,0 +1,44 @@
+set(FREEDV_SOURCES
+    dlg_audiooptions.cpp
+    dlg_filter.cpp
+    dlg_options.cpp
+    dlg_ptt.cpp
+    fdmdv2_main.cpp
+    fdmdv2_pa_wrapper.cpp
+    fdmdv2_plot.cpp
+    fdmdv2_plot_scalar.cpp
+    fdmdv2_plot_scatter.cpp
+    fdmdv2_plot_spectrum.cpp
+    fdmdv2_plot_waterfall.cpp
+    hamlib.cpp
+    topFrame.cpp
+    sox_biquad.c
+    comp.h
+    dlg_audiooptions.h
+    dlg_filter.h
+    dlg_options.h
+    dlg_ptt.h
+    fdmdv2_defines.h
+    fdmdv2_main.h
+    fdmdv2_pa_wrapper.h
+    fdmdv2_plot.h
+    fdmdv2_plot_scalar.h
+    fdmdv2_plot_scatter.h
+    fdmdv2_plot_spectrum.h
+    fdmdv2_plot_waterfall.h
+    hamlib.h
+    sox_biquad.h
+    sox.h
+    topFrame.h
+    version.h
+)
+
+# WIN32 is needed for Windows GUI apps and is ignored for UNIX like systems.
+add_executable(freedv WIN32 ${FREEDV_SOURCES} ${RES_FILES})
+target_link_libraries(freedv ${FREEDV_LINK_LIBS})
+include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
+if(FREEDV_STATIC_DEPS)
+    add_dependencies(freedv ${FREEDV_STATIC_DEPS})
+endif(FREEDV_STATIC_DEPS)
+install(TARGETS freedv
+    RUNTIME DESTINATION bin)
diff --git a/freedv/branches/0.99/src/Makefile.win32 b/freedv/branches/0.99/src/Makefile.win32
new file mode 100644 (file)
index 0000000..932e851
--- /dev/null
@@ -0,0 +1,52 @@
+# src/Makefile.win32
+# David Rowe 26 Oct 2012
+#
+# Makefile for Win32 on msys/Mingw to help David R get up to speed
+#
+# $ make -f Makefile.Win32
+
+CODEC2_PATH=$(HOME)/codec2-dev
+INCLUDE_PATH=/usr/local/include
+
+WX_CONFIG=wx-config
+WX_CPPFLAGS = $(shell $(WX_CONFIG) --cxxflags) -D__WXDEBUG__
+WX_LIBS = $(shell $(WX_CONFIG) --libs core, base, aui, adv, net)
+SVN_REVISION=$(shell svnversion)
+CODEC2_INC=$(CODEC2_PATH)/src 
+CODEC2_LIB=$(CODEC2_PATH)/build_win32/src/
+
+CPP_FLAGS = -D_NO_AUTOTOOLS_ -I$(INCLUDE_PATH) $(WX_CPPFLAGS) -I$(CODEC2_INC) -I../extern/include -I. -g -Wall -DSVN_REVISION=\"$(SVN_REVISION)\"
+LIBS = $(WX_LIBS) -L$(CODEC2_LIB) -lcodec2 -lm -lportaudiocpp -lportaudio -lpthread -lsndfile -lsamplerate -lhamlib -lsox -lspeexdsp
+
+OBJS = topFrame.o \
+fdmdv2_main.o \
+fdmdv2_plot.o \
+fdmdv2_plot_scalar.o \
+fdmdv2_plot_scatter.o \
+fdmdv2_plot_spectrum.o \
+fdmdv2_plot_waterfall.o \
+fdmdv2_pa_wrapper.o \
+dlg_audiooptions.o \
+dlg_ptt.o \
+dlg_options.o \
+dlg_filter.o \
+sox_biquad.o \
+hamlib.o \
+../../codec2-dev/src/golay23.o
+
+HDRS = version.h dlg_audiooptions.h dlg_ptt.h dlg_filter.h fdmdv2_main.h fdmdv2_defines.h fdmdv2_plot.h fdmdv2_plot_scalar.h fdmdv2_plot_waterfall.h fdmdv2_plot_scatter.h fdmdv2_plot_spectrum.h fdmdv2_pa_wrapper.h topFrame.h dlg_audiooptions.h topFrame.h varicode.h ../../codec2-dev/src/golay23.h hamlib.h
+
+all: freedv
+
+freedv: $(OBJS) 
+       g++ -o freedv $(OBJS) $(CPP_FLAGS) $(LIBS)
+
+%.o: %.cpp $(HDRS) Makefile.win32
+       g++ $(CPP_FLAGS) -c $< -o $@
+
+%.o: %.c $(HDRS) Makefile.win32
+       gcc $(CPP_FLAGS) -c $< -o $@
+
+clean:
+       rm -f *.o fdmdv2
+
diff --git a/freedv/branches/0.99/src/comp.h b/freedv/branches/0.99/src/comp.h
new file mode 100644 (file)
index 0000000..a3a1bd9
--- /dev/null
@@ -0,0 +1,39 @@
+/*---------------------------------------------------------------------------*\
+
+  FILE........: comp.h
+  AUTHOR......: David Rowe
+  DATE CREATED: 24/08/09
+
+  Complex number definition.
+
+\*---------------------------------------------------------------------------*/
+
+/*
+  Copyright (C) 2009 David Rowe
+
+  All rights reserved.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU Lesser 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 Lesser General Public License
+  along with this program; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef __COMP__
+#define __COMP__
+
+/* Complex number */
+
+typedef struct
+{
+    float real;
+    float imag;
+} COMP;
+
+#endif
diff --git a/freedv/branches/0.99/src/dlg_audiooptions.cpp b/freedv/branches/0.99/src/dlg_audiooptions.cpp
new file mode 100644 (file)
index 0000000..7d23a08
--- /dev/null
@@ -0,0 +1,1264 @@
+//=========================================================================
+// Name:            AudioOptsDialog.cpp
+// Purpose:         Implements an Audio options selection dialog.
+//
+// Authors:         David Rowe, David Witten
+// License:
+//
+//  All rights reserved.
+//
+//  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 <http://www.gnu.org/licenses/>.
+//
+//=========================================================================
+#include "fdmdv2_main.h"
+#include "dlg_audiooptions.h"
+
+// constants for test waveform plots
+
+#define TEST_WAVEFORM_X          180
+#define TEST_WAVEFORM_Y          180
+#define TEST_WAVEFORM_PLOT_TIME  2.0
+#define TEST_WAVEFORM_PLOT_FS    400
+#define TEST_BUF_SIZE           1024
+#define TEST_FS                 48000.0
+#define TEST_DT                 0.1      // time between plot updates in seconds
+#define TEST_WAVEFORM_PLOT_BUF  ((int)(DT*400))
+
+void AudioOptsDialog::Pa_Init(void)
+{
+    m_isPaInitialized = false;
+
+    if((pa_err = Pa_Initialize()) == paNoError)
+    {
+        m_isPaInitialized = true;
+    }
+    else
+    {
+        wxMessageBox(wxT("Port Audio failed to initialize"), wxT("Pa_Initialize"), wxOK);
+        return;
+    }
+}
+
+
+void AudioOptsDialog::buildTestControls(PlotScalar **plotScalar, wxButton **btnTest, 
+                                        wxPanel *parentPanel, wxBoxSizer *bSizer, wxString buttonLabel)
+{
+    wxBoxSizer* bSizer1 = new wxBoxSizer(wxVERTICAL);
+
+    wxPanel *panel = new wxPanel(parentPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0);
+    *plotScalar = new PlotScalar((wxFrame*) panel, 1, TEST_WAVEFORM_PLOT_TIME, 1.0/TEST_WAVEFORM_PLOT_FS, -1, 1, 1, 0.2, "", 1);
+    (*plotScalar)->SetClientSize(wxSize(TEST_WAVEFORM_X,TEST_WAVEFORM_Y));
+    bSizer1->Add(panel, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 8);
+
+    *btnTest = new wxButton(parentPanel, wxID_ANY, buttonLabel, wxDefaultPosition, wxDefaultSize);
+    bSizer1->Add(*btnTest, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 0);
+
+    bSizer->Add(bSizer1, 0, wxALIGN_CENTER_HORIZONTAL |wxALIGN_CENTER_VERTICAL );
+}
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// AudioOptsDialog()
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+AudioOptsDialog::AudioOptsDialog(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style)
+{
+    this->SetSizeHints(wxSize(850, 600), wxDefaultSize);
+
+    Pa_Init();
+
+    wxBoxSizer* mainSizer;
+    mainSizer = new wxBoxSizer(wxVERTICAL);
+    m_panel1 = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
+    wxBoxSizer* bSizer4;
+    bSizer4 = new wxBoxSizer(wxVERTICAL);
+    m_notebook1 = new wxNotebook(m_panel1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxNB_BOTTOM);
+    m_panelRx = new wxPanel(m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
+    wxBoxSizer* bSizer20;
+    bSizer20 = new wxBoxSizer(wxVERTICAL);
+    wxGridSizer* gSizer4;
+    gSizer4 = new wxGridSizer(2, 1, 0, 0);
+
+    // Rx In -----------------------------------------------------------------------
+
+    wxStaticBoxSizer* sbSizer2;
+    sbSizer2 = new wxStaticBoxSizer(new wxStaticBox(m_panelRx, wxID_ANY, _("From Radio")), wxHORIZONTAL);
+
+    wxBoxSizer* bSizer811a = new wxBoxSizer(wxVERTICAL);
+
+    m_listCtrlRxInDevices = new wxListCtrl(m_panelRx, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VRULES);
+    bSizer811a->Add(m_listCtrlRxInDevices, 1, wxALL|wxEXPAND, 1);
+
+    wxBoxSizer* bSizer811;
+    bSizer811 = new wxBoxSizer(wxHORIZONTAL);
+    m_staticText51 = new wxStaticText(m_panelRx, wxID_ANY, _("Device:"), wxDefaultPosition, wxDefaultSize, 0);
+    m_staticText51->Wrap(-1);
+    bSizer811->Add(m_staticText51, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5);
+    m_textCtrlRxIn = new wxTextCtrl(m_panelRx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
+    bSizer811->Add(m_textCtrlRxIn, 1, wxALIGN_CENTER_VERTICAL|wxALL, 1);
+    m_staticText6 = new wxStaticText(m_panelRx, wxID_ANY, _("Sample Rate:"), wxDefaultPosition, wxDefaultSize, 0);
+    m_staticText6->Wrap(-1);
+    bSizer811->Add(m_staticText6, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5);
+    m_cbSampleRateRxIn = new wxComboBox(m_panelRx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(90,-1), 0, NULL, wxCB_DROPDOWN);
+    bSizer811->Add(m_cbSampleRateRxIn, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1);
+
+    bSizer811a->Add(bSizer811, 0, wxEXPAND, 5);
+
+    sbSizer2->Add(bSizer811a, 1, wxEXPAND, 2);
+    buildTestControls(&m_plotScalarRxIn, &m_btnRxInTest, m_panelRx, sbSizer2, _("Rec 2s"));
+
+    gSizer4->Add(sbSizer2, 1, wxEXPAND, 5);
+
+    // Rx Out -----------------------------------------------------------------------
+
+    wxStaticBoxSizer* sbSizer3;
+    sbSizer3 = new wxStaticBoxSizer(new wxStaticBox(m_panelRx, wxID_ANY, _("To Speaker/Headphones")), wxHORIZONTAL);
+
+    wxBoxSizer* bSizer81a = new wxBoxSizer(wxVERTICAL);
+
+    m_listCtrlRxOutDevices = new wxListCtrl(m_panelRx, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VRULES);
+    bSizer81a->Add(m_listCtrlRxOutDevices, 1, wxALL|wxEXPAND, 1);
+
+    wxBoxSizer* bSizer81;
+    bSizer81 = new wxBoxSizer(wxHORIZONTAL);
+    m_staticText9 = new wxStaticText(m_panelRx, wxID_ANY, _("Device:"), wxDefaultPosition, wxDefaultSize, 0);
+    m_staticText9->Wrap(-1);
+    bSizer81->Add(m_staticText9, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
+    m_textCtrlRxOut = new wxTextCtrl(m_panelRx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
+    bSizer81->Add(m_textCtrlRxOut, 1, wxALIGN_CENTER_VERTICAL|wxALL, 1);
+    m_staticText10 = new wxStaticText(m_panelRx, wxID_ANY, _("Sample Rate:"), wxDefaultPosition, wxDefaultSize, 0);
+    m_staticText10->Wrap(-1);
+    bSizer81->Add(m_staticText10, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5);
+    m_cbSampleRateRxOut = new wxComboBox(m_panelRx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(90,-1), 0, NULL, wxCB_DROPDOWN);
+    bSizer81->Add(m_cbSampleRateRxOut, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1);
+
+    bSizer81a->Add(bSizer81, 0, wxEXPAND, 5);
+
+    sbSizer3->Add(bSizer81a, 1, wxEXPAND, 2);
+    buildTestControls(&m_plotScalarRxOut, &m_btnRxOutTest, m_panelRx, sbSizer3, _("Play 2s"));
+    gSizer4->Add(sbSizer3, 1, wxEXPAND, 2);
+    bSizer20->Add(gSizer4, 1, wxEXPAND, 1);
+    m_panelRx->SetSizer(bSizer20);
+    m_panelRx->Layout();
+    bSizer20->Fit(m_panelRx);
+    m_notebook1->AddPage(m_panelRx, _("Receive"), true);
+
+    // Tx Tab -------------------------------------------------------------------------------
+
+    m_panelTx = new wxPanel(m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
+    wxBoxSizer* bSizer18;
+    bSizer18 = new wxBoxSizer(wxVERTICAL);
+    wxGridSizer* gSizer2;
+    gSizer2 = new wxGridSizer(2, 1, 0, 0);
+
+    // Tx In ----------------------------------------------------------------------------------
+
+    wxStaticBoxSizer* sbSizer22;
+    sbSizer22 = new wxStaticBoxSizer(new wxStaticBox(m_panelTx, wxID_ANY, _("From Microphone")), wxHORIZONTAL);
+
+    wxBoxSizer* bSizer83a = new wxBoxSizer(wxVERTICAL);
+
+    m_listCtrlTxInDevices = new wxListCtrl(m_panelTx, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VRULES);
+    bSizer83a->Add(m_listCtrlTxInDevices, 1, wxALL|wxEXPAND, 1);
+    wxBoxSizer* bSizer83;
+    bSizer83 = new wxBoxSizer(wxHORIZONTAL);
+    m_staticText12 = new wxStaticText(m_panelTx, wxID_ANY, _("Device:"), wxDefaultPosition, wxDefaultSize, 0);
+    m_staticText12->Wrap(-1);
+    bSizer83->Add(m_staticText12, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5);
+    m_textCtrlTxIn = new wxTextCtrl(m_panelTx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
+    bSizer83->Add(m_textCtrlTxIn, 1, wxALIGN_CENTER_VERTICAL|wxALL, 1);
+    m_staticText11 = new wxStaticText(m_panelTx, wxID_ANY, _("Sample Rate:"), wxDefaultPosition, wxDefaultSize, 0);
+    m_staticText11->Wrap(-1);
+    bSizer83->Add(m_staticText11, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5);
+    m_cbSampleRateTxIn = new wxComboBox(m_panelTx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(90,-1), 0, NULL, wxCB_DROPDOWN);
+    bSizer83->Add(m_cbSampleRateTxIn, 0, wxALL, 1);
+
+    bSizer83a->Add(bSizer83, 0, wxEXPAND, 5);
+
+    sbSizer22->Add(bSizer83a, 1, wxEXPAND, 2);
+    buildTestControls(&m_plotScalarTxIn, &m_btnTxInTest, m_panelTx, sbSizer22, _("Rec 2s"));
+
+    gSizer2->Add(sbSizer22, 1, wxEXPAND, 5);
+
+    // Tx Out ----------------------------------------------------------------------------------
+
+    wxStaticBoxSizer* sbSizer21;
+    sbSizer21 = new wxStaticBoxSizer(new wxStaticBox(m_panelTx, wxID_ANY, _("To Radio")), wxHORIZONTAL);
+
+    wxBoxSizer* bSizer82a = new wxBoxSizer(wxVERTICAL);
+
+    m_listCtrlTxOutDevices = new wxListCtrl(m_panelTx, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VRULES);
+    bSizer82a->Add(m_listCtrlTxOutDevices, 1, wxALL|wxEXPAND, 2);
+    wxBoxSizer* bSizer82;
+    bSizer82 = new wxBoxSizer(wxHORIZONTAL);
+    m_staticText81 = new wxStaticText(m_panelTx, wxID_ANY, _("Device:"), wxDefaultPosition, wxDefaultSize, 0);
+    m_staticText81->Wrap(-1);
+    bSizer82->Add(m_staticText81, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
+    m_textCtrlTxOut = new wxTextCtrl(m_panelTx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
+    bSizer82->Add(m_textCtrlTxOut, 1, wxALIGN_CENTER_VERTICAL|wxALL, 1);
+    m_staticText71 = new wxStaticText(m_panelTx, wxID_ANY, _("Sample Rate:"), wxDefaultPosition, wxDefaultSize, 0);
+    m_staticText71->Wrap(-1);
+    bSizer82->Add(m_staticText71, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5);
+    m_cbSampleRateTxOut = new wxComboBox(m_panelTx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(90,-1), 0, NULL, wxCB_DROPDOWN);
+    bSizer82->Add(m_cbSampleRateTxOut, 0, wxALL, 1);
+
+    bSizer82a->Add(bSizer82, 0, wxEXPAND, 5);
+
+    sbSizer21->Add(bSizer82a, 1, wxEXPAND, 2);
+    buildTestControls(&m_plotScalarTxOut, &m_btnTxOutTest, m_panelTx, sbSizer21, _("Play 2s"));
+
+    gSizer2->Add(sbSizer21, 1, wxEXPAND, 5);
+    bSizer18->Add(gSizer2, 1, wxEXPAND, 1);
+    m_panelTx->SetSizer(bSizer18);
+    m_panelTx->Layout();
+    bSizer18->Fit(m_panelTx);
+    m_notebook1->AddPage(m_panelTx, _("Transmit"), false);
+
+    // API Tab -------------------------------------------------------------------
+
+    m_panelAPI = new wxPanel(m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
+    wxBoxSizer* bSizer12;
+    bSizer12 = new wxBoxSizer(wxHORIZONTAL);
+    wxGridSizer* gSizer31;
+    gSizer31 = new wxGridSizer(2, 1, 0, 0);
+    wxStaticBoxSizer* sbSizer1;
+    sbSizer1 = new wxStaticBoxSizer(new wxStaticBox(m_panelAPI, wxID_ANY, _("PortAudio")), wxVERTICAL);
+
+    wxGridSizer* gSizer3;
+    gSizer3 = new wxGridSizer(4, 2, 0, 0);
+
+    m_staticText7 = new wxStaticText(m_panelAPI, wxID_ANY, _("PortAudio Version String:"), wxDefaultPosition, wxDefaultSize, 0);
+    m_staticText7->Wrap(-1);
+    gSizer3->Add(m_staticText7, 1, wxALIGN_RIGHT|wxALL|wxALIGN_CENTER_VERTICAL, 10);
+    m_textStringVer = new wxStaticText(m_panelAPI, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
+    gSizer3->Add(m_textStringVer, 1, wxALIGN_LEFT|wxALL|wxALIGN_CENTER_VERTICAL, 10);
+
+    m_staticText8 = new wxStaticText(m_panelAPI, wxID_ANY, _("PortAudio Int Version:"), wxDefaultPosition, wxDefaultSize, 0);
+    m_staticText8->Wrap(-1);
+    gSizer3->Add(m_staticText8, 1, wxALIGN_RIGHT|wxALL|wxALIGN_CENTER_VERTICAL, 10);
+    m_textIntVer = new wxStaticText(m_panelAPI, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(45,-1), 0);
+    gSizer3->Add(m_textIntVer, 1, wxALIGN_LEFT|wxALL|wxALIGN_CENTER_VERTICAL, 10);
+
+    m_staticText5 = new wxStaticText(m_panelAPI, wxID_ANY, _("Device Count:"), wxDefaultPosition, wxDefaultSize, 0);
+    m_staticText5->Wrap(-1);
+    gSizer3->Add(m_staticText5, 1, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 10);
+    m_textCDevCount = new wxStaticText(m_panelAPI, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(45,-1), 0);
+    gSizer3->Add(m_textCDevCount, 1, wxALIGN_LEFT|wxALL|wxALIGN_CENTER_VERTICAL, 10);
+
+    m_staticText4 = new wxStaticText(m_panelAPI, wxID_ANY, _("API Count:"), wxDefaultPosition, wxDefaultSize, 0);
+    m_staticText4->Wrap(-1);
+    gSizer3->Add(m_staticText4, 1, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 10);
+    m_textAPICount = new wxStaticText(m_panelAPI, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(45,-1), 0);
+    m_textAPICount->SetMaxSize(wxSize(45,-1));
+    gSizer3->Add(m_textAPICount, 1, wxALIGN_LEFT|wxALL|wxALIGN_CENTER_VERTICAL, 10);
+
+    sbSizer1->Add(gSizer3, 1, wxEXPAND, 2);
+    gSizer31->Add(sbSizer1, 1, wxEXPAND, 2);
+    wxStaticBoxSizer* sbSizer6;
+    sbSizer6 = new wxStaticBoxSizer(new wxStaticBox(m_panelAPI, wxID_ANY, _("Other")), wxVERTICAL);
+    gSizer31->Add(sbSizer6, 1, wxEXPAND, 5);
+    bSizer12->Add(gSizer31, 1, wxEXPAND, 5);
+    m_panelAPI->SetSizer(bSizer12);
+    m_panelAPI->Layout();
+    bSizer12->Fit(m_panelAPI);
+    m_notebook1->AddPage(m_panelAPI, _("API Info"), false);
+    bSizer4->Add(m_notebook1, 1, wxEXPAND | wxALL, 0);
+    m_panel1->SetSizer(bSizer4);
+    m_panel1->Layout();
+    bSizer4->Fit(m_panel1);
+    mainSizer->Add(m_panel1, 1, wxEXPAND | wxALL, 1);
+
+    wxBoxSizer* bSizer6;
+    bSizer6 = new wxBoxSizer(wxHORIZONTAL);
+    m_btnRefresh = new wxButton(this, wxID_ANY, _("Refresh"), wxDefaultPosition, wxDefaultSize, 0);
+    bSizer6->Add(m_btnRefresh, 0, wxALIGN_CENTER|wxALL, 2);
+
+    m_sdbSizer1 = new wxStdDialogButtonSizer();
+
+    m_sdbSizer1OK = new wxButton(this, wxID_OK);
+    m_sdbSizer1->AddButton(m_sdbSizer1OK);
+
+    m_sdbSizer1Cancel = new wxButton(this, wxID_CANCEL);
+    m_sdbSizer1->AddButton(m_sdbSizer1Cancel);
+
+    m_sdbSizer1Apply = new wxButton(this, wxID_APPLY);
+    m_sdbSizer1->AddButton(m_sdbSizer1Apply);
+
+    m_sdbSizer1->Realize();
+
+    bSizer6->Add(m_sdbSizer1, 1, wxALIGN_CENTER_VERTICAL, 2);
+    mainSizer->Add(bSizer6, 0, wxEXPAND, 2);
+    this->SetSizer(mainSizer);
+    this->Layout();
+    this->Centre(wxBOTH);
+//    this->Centre(wxBOTH);
+
+    m_notebook1->SetSelection(0);
+
+    showAPIInfo();
+    m_RxInDevices.m_listDevices   = m_listCtrlRxInDevices;
+    m_RxInDevices.direction       = AUDIO_IN;
+    m_RxInDevices.m_textDevice    = m_textCtrlRxIn;
+    m_RxInDevices.m_cbSampleRate  = m_cbSampleRateRxIn;
+
+    m_RxOutDevices.m_listDevices  = m_listCtrlRxOutDevices;
+    m_RxOutDevices.direction      = AUDIO_OUT;
+    m_RxOutDevices.m_textDevice   = m_textCtrlRxOut;
+    m_RxOutDevices.m_cbSampleRate = m_cbSampleRateRxOut;
+
+    m_TxInDevices.m_listDevices   = m_listCtrlTxInDevices;
+    m_TxInDevices.direction       = AUDIO_IN;
+    m_TxInDevices.m_textDevice    = m_textCtrlTxIn;
+    m_TxInDevices.m_cbSampleRate  = m_cbSampleRateTxIn;
+
+    m_TxOutDevices.m_listDevices  = m_listCtrlTxOutDevices;
+    m_TxOutDevices.direction      = AUDIO_OUT;
+    m_TxOutDevices.m_textDevice   = m_textCtrlTxOut;
+    m_TxOutDevices.m_cbSampleRate = m_cbSampleRateTxOut;
+
+    populateParams(m_RxInDevices);
+    populateParams(m_RxOutDevices);
+    populateParams(m_TxInDevices);
+    populateParams(m_TxOutDevices);
+
+    m_listCtrlRxInDevices->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( AudioOptsDialog::OnRxInDeviceSelect ), NULL, this );
+    m_listCtrlRxOutDevices->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( AudioOptsDialog::OnRxOutDeviceSelect ), NULL, this );
+    m_listCtrlTxInDevices->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( AudioOptsDialog::OnTxInDeviceSelect ), NULL, this );
+    m_listCtrlTxOutDevices->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( AudioOptsDialog::OnTxOutDeviceSelect ), NULL, this );
+
+    // wire up test buttons
+    m_btnRxInTest->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnRxInTest ), NULL, this );
+    m_btnRxOutTest->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnRxOutTest ), NULL, this );
+    m_btnTxInTest->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnTxInTest ), NULL, this );
+    m_btnTxOutTest->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnTxOutTest ), NULL, this );
+
+    m_btnRefresh->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnRefreshClick ), NULL, this );
+    m_sdbSizer1Apply->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnApplyAudioParameters ), NULL, this );
+    m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnCancelAudioParameters ), NULL, this );
+    m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnOkAudioParameters ), NULL, this );
+/*
+        void OnClose( wxCloseEvent& event ) { event.Skip(); }
+        void OnHibernate( wxActivateEvent& event ) { event.Skip(); }
+        void OnIconize( wxIconizeEvent& event ) { event.Skip(); }
+        void OnInitDialog( wxInitDialogEvent& event ) { event.Skip(); }
+*/
+//    this->Connect(wxEVT_CLOSE_WINDOW, wxCloseEventHandler(AudioOptsDialog::OnClose));
+    this->Connect(wxEVT_HIBERNATE, wxActivateEventHandler(AudioOptsDialog::OnHibernate));
+    this->Connect(wxEVT_ICONIZE, wxIconizeEventHandler(AudioOptsDialog::OnIconize));
+    this->Connect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(AudioOptsDialog::OnInitDialog));
+}
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// ~AudioOptsDialog()
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+AudioOptsDialog::~AudioOptsDialog()
+{
+    Pa_Terminate();
+
+    // Disconnect Events
+    this->Disconnect(wxEVT_HIBERNATE, wxActivateEventHandler(AudioOptsDialog::OnHibernate));
+    this->Disconnect(wxEVT_ICONIZE, wxIconizeEventHandler(AudioOptsDialog::OnIconize));
+    this->Disconnect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(AudioOptsDialog::OnInitDialog));
+
+    m_listCtrlRxInDevices->Disconnect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(AudioOptsDialog::OnRxInDeviceSelect), NULL, this);
+    m_listCtrlRxOutDevices->Disconnect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(AudioOptsDialog::OnRxOutDeviceSelect), NULL, this);
+    m_listCtrlTxInDevices->Disconnect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(AudioOptsDialog::OnTxInDeviceSelect), NULL, this);
+    m_listCtrlTxOutDevices->Disconnect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(AudioOptsDialog::OnTxOutDeviceSelect), NULL, this);
+
+    m_btnRxInTest->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnRxInTest ), NULL, this );
+    m_btnRxOutTest->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnRxOutTest ), NULL, this );
+    m_btnTxInTest->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnTxInTest ), NULL, this );
+    m_btnTxOutTest->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnTxOutTest ), NULL, this );
+
+    m_btnRefresh->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AudioOptsDialog::OnRefreshClick), NULL, this);
+    m_sdbSizer1Apply->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AudioOptsDialog::OnApplyAudioParameters), NULL, this);
+    m_sdbSizer1Cancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AudioOptsDialog::OnCancelAudioParameters), NULL, this);
+    m_sdbSizer1OK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AudioOptsDialog::OnOkAudioParameters), NULL, this);
+
+}
+
+//-------------------------------------------------------------------------
+// OnInitDialog()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnInitDialog( wxInitDialogEvent& event )
+{
+    ExchangeData(EXCHANGE_DATA_IN);
+}
+
+//-------------------------------------------------------------------------
+// OnInitDialog()
+//
+// helper function to look up name of devNum, and if it exists write
+// name to textCtrl.  Used to trap dissapearing devices.
+//-------------------------------------------------------------------------
+int AudioOptsDialog::setTextCtrlIfDevNumValid(wxTextCtrl *textCtrl, wxListCtrl *listCtrl, int devNum)
+{
+    int i, aDevNum, found_devNum;
+
+    // ignore last list entry as it is the "none" entry
+
+    found_devNum = 0;
+    for(i=0; i<listCtrl->GetItemCount()-1; i++) {
+        aDevNum = wxAtoi(listCtrl->GetItemText(i, 1));
+        //printf("aDevNum: %d devNum: %d\n", aDevNum, devNum);
+        if (aDevNum == devNum) {
+            found_devNum = 1;
+            textCtrl->SetValue(listCtrl->GetItemText(i, 0) + " (" + wxString::Format(wxT("%i"),devNum) + ")");
+            printf("setting focus of %d\n", i);
+            listCtrl->SetItemState(i, wxLIST_STATE_FOCUSED, wxLIST_STATE_FOCUSED);
+        }
+    }
+
+    if (found_devNum) 
+        return devNum;
+    else {
+        textCtrl->SetValue("none");
+        return -1;
+    }
+}
+
+//-------------------------------------------------------------------------
+// ExchangeData()
+//-------------------------------------------------------------------------
+int AudioOptsDialog::ExchangeData(int inout)
+{
+    if(inout == EXCHANGE_DATA_IN)
+    {
+        // Map sound card device numbers to tx/rx device numbers depending
+        // on number of sound cards in use
+
+        printf("EXCHANGE_DATA_IN:\n");
+        printf("  g_nSoundCards: %d\n", g_nSoundCards);
+        printf("  g_soundCard1InDeviceNum: %d\n", g_soundCard1InDeviceNum);
+        printf("  g_soundCard1OutDeviceNum: %d\n", g_soundCard1OutDeviceNum);
+        printf("  g_soundCard1SampleRate: %d\n", g_soundCard1SampleRate);
+        printf("  g_soundCard2InDeviceNum: %d\n", g_soundCard2InDeviceNum);
+        printf("  g_soundCard2OutDeviceNum: %d\n", g_soundCard2OutDeviceNum);
+        printf("  g_soundCard2SampleRate: %d\n", g_soundCard2SampleRate);
+
+        if (g_nSoundCards == 0) {
+            m_textCtrlRxIn ->SetValue("none"); rxInAudioDeviceNum  = -1;
+            m_textCtrlRxOut->SetValue("none"); rxOutAudioDeviceNum = -1;
+            m_textCtrlTxIn ->SetValue("none"); txInAudioDeviceNum  = -1;
+            m_textCtrlTxOut->SetValue("none"); txOutAudioDeviceNum = -1;           
+        }
+
+        if (g_nSoundCards == 1) {
+            rxInAudioDeviceNum  = setTextCtrlIfDevNumValid(m_textCtrlRxIn, 
+                                                           m_listCtrlRxInDevices, 
+                                                           g_soundCard1InDeviceNum);
+
+            rxOutAudioDeviceNum = setTextCtrlIfDevNumValid(m_textCtrlRxOut, 
+                                                           m_listCtrlRxOutDevices, 
+                                                           g_soundCard1OutDeviceNum);
+
+            if ((rxInAudioDeviceNum != -1) && (rxInAudioDeviceNum != -1)) {
+                m_cbSampleRateRxIn->SetValue(wxString::Format(wxT("%i"),g_soundCard1SampleRate));
+                m_cbSampleRateRxOut->SetValue(wxString::Format(wxT("%i"),g_soundCard1SampleRate));
+            }
+
+            m_textCtrlTxIn ->SetValue("none"); txInAudioDeviceNum  = -1;
+            m_textCtrlTxOut->SetValue("none"); txOutAudioDeviceNum = -1;           
+        }
+
+        if (g_nSoundCards == 2) {
+            rxInAudioDeviceNum  = setTextCtrlIfDevNumValid(m_textCtrlRxIn, 
+                                                           m_listCtrlRxInDevices, 
+                                                           g_soundCard1InDeviceNum);
+
+            rxOutAudioDeviceNum = setTextCtrlIfDevNumValid(m_textCtrlRxOut, 
+                                                           m_listCtrlRxOutDevices, 
+                                                           g_soundCard2OutDeviceNum);
+
+            txInAudioDeviceNum  = setTextCtrlIfDevNumValid(m_textCtrlTxIn, 
+                                                           m_listCtrlTxInDevices, 
+                                                           g_soundCard2InDeviceNum);
+
+            txOutAudioDeviceNum = setTextCtrlIfDevNumValid(m_textCtrlTxOut, 
+                                                           m_listCtrlTxOutDevices, 
+                                                           g_soundCard1OutDeviceNum);
+
+            if ((rxInAudioDeviceNum != -1) && (txOutAudioDeviceNum != -1)) {
+                m_cbSampleRateRxIn->SetValue(wxString::Format(wxT("%i"),g_soundCard1SampleRate));
+                m_cbSampleRateTxOut->SetValue(wxString::Format(wxT("%i"),g_soundCard1SampleRate));
+            }
+
+            if ((txInAudioDeviceNum != -1) && (rxOutAudioDeviceNum != -1)) {
+                m_cbSampleRateTxIn->SetValue(wxString::Format(wxT("%i"),g_soundCard2SampleRate));
+                m_cbSampleRateRxOut->SetValue(wxString::Format(wxT("%i"),g_soundCard2SampleRate));
+            }
+        }
+        printf("  rxInAudioDeviceNum: %d\n  rxOutAudioDeviceNum: %d\n  txInAudioDeviceNum: %d\n  txOutAudioDeviceNum: %d\n",
+               rxInAudioDeviceNum, rxOutAudioDeviceNum, txInAudioDeviceNum, txOutAudioDeviceNum);
+    }
+
+    if(inout == EXCHANGE_DATA_OUT)
+    {
+        int valid_one_card_config = 0;
+        int valid_two_card_config = 0;
+        wxString sampleRate1, sampleRate2;
+
+        printf("EXCHANGE_DATA_OUT:\n");
+        printf("  rxInAudioDeviceNum: %d\n  rxOutAudioDeviceNum: %d\n  txInAudioDeviceNum: %d\n  txOutAudioDeviceNum: %d\n",
+               rxInAudioDeviceNum, rxOutAudioDeviceNum, txInAudioDeviceNum, txOutAudioDeviceNum);
+
+        // ---------------------------------------------------------------
+        // check we have a valid 1 or 2 sound card configuration
+        // ---------------------------------------------------------------
+
+        // one sound card config, tx device numbers should be set to -1 
+
+        if ((rxInAudioDeviceNum != -1) && (rxOutAudioDeviceNum != -1) &&
+            (txInAudioDeviceNum == -1) && (txOutAudioDeviceNum == -1)) {
+            valid_one_card_config = 1; 
+
+            // in and out sample rate must be the same, as there is one callback
+            
+            sampleRate1 = m_cbSampleRateRxIn->GetValue();
+            if (!sampleRate1.IsSameAs(m_cbSampleRateRxOut->GetValue())) {
+                wxMessageBox(wxT("With a single sound card the Sample Rate of "
+                                 "From Radio and To Speaker/Headphones must be the same."), wxT(""), wxOK);
+                return -1;
+            }
+        }
+
+        // two card configuration
+
+        if ((rxInAudioDeviceNum != -1) && (rxOutAudioDeviceNum != -1) &&
+            (txInAudioDeviceNum != -1) && (txOutAudioDeviceNum != -1)) {
+
+            valid_two_card_config = 1; 
+
+            // Check we haven't doubled up on sound devices
+
+            if (rxInAudioDeviceNum == txInAudioDeviceNum) {
+                wxMessageBox(wxT("You must use different devices for From Radio and From Microphone"), wxT(""), wxOK);
+                return -1;
+            }
+
+            if (rxOutAudioDeviceNum == txOutAudioDeviceNum) {
+                wxMessageBox(wxT("You must use different devices for To Radio and To Speaker/Headphones"), wxT(""), wxOK);
+                return -1;
+            }
+
+            // Check sample rates for callback 1 devices are the same,
+            // as input and output are handled synchronously by one
+            // portaudio callback
+            
+            sampleRate1 = m_cbSampleRateRxIn->GetValue();
+            if (!sampleRate1.IsSameAs(m_cbSampleRateTxOut->GetValue())) {
+                wxMessageBox(wxT("With two sound cards the Sample Rate "
+                                 "of From Radio and To Radio must be the same."), wxT(""), wxOK);
+                return -1;
+            }
+            // check sample rate for callback 2 devices is the same
+
+            sampleRate2 = m_cbSampleRateTxIn->GetValue();
+            if (!sampleRate2.IsSameAs(m_cbSampleRateRxOut->GetValue())) {
+                wxMessageBox(wxT("With two sound cards the Sample Rate of "
+                                 "From Microphone and To Speaker/Headphones must be the same."), wxT(""), wxOK);
+                return -1;
+            }
+        }
+
+        printf("  valid_one_card_config: %d  valid_two_card_config: %d\n", valid_one_card_config, valid_two_card_config);
+
+        if (!valid_one_card_config && !valid_two_card_config) {
+            wxMessageBox(wxT("Invalid one or two sound card configuration"), wxT(""), wxOK);
+            return -1;
+        }
+
+        // ---------------------------------------------------------------
+        // Map Rx/TX device numbers to sound card device numbers used
+        // in callbacks. Portaudio uses one callback per sound card so
+        // we have to be soundcard oriented at run time rather than
+        // Tx/Rx oriented as in this dialog.
+        // ---------------------------------------------------------------
+        g_nSoundCards = 0;
+        g_soundCard1InDeviceNum = g_soundCard1OutDeviceNum = g_soundCard2InDeviceNum = g_soundCard2OutDeviceNum = -1;
+
+        if (valid_one_card_config) {
+
+            // Only callback 1 used
+
+            g_nSoundCards = 1;
+            g_soundCard1InDeviceNum  = rxInAudioDeviceNum;
+            g_soundCard1OutDeviceNum = rxOutAudioDeviceNum;
+            g_soundCard1SampleRate = wxAtoi(sampleRate1);
+        }
+
+        if (valid_two_card_config) {
+            g_nSoundCards = 2;
+            g_soundCard1InDeviceNum  = rxInAudioDeviceNum;
+            g_soundCard1OutDeviceNum = txOutAudioDeviceNum;
+            g_soundCard1SampleRate   = wxAtoi(sampleRate1);
+            g_soundCard2InDeviceNum  = txInAudioDeviceNum;
+            g_soundCard2OutDeviceNum = rxOutAudioDeviceNum;
+            g_soundCard2SampleRate   = wxAtoi(sampleRate2);
+        }
+
+        printf("  g_nSoundCards: %d\n", g_nSoundCards);
+        printf("  g_soundCard1InDeviceNum: %d\n", g_soundCard1InDeviceNum);
+        printf("  g_soundCard1OutDeviceNum: %d\n", g_soundCard1OutDeviceNum);
+        printf("  g_soundCard1SampleRate: %d\n", g_soundCard1SampleRate);
+        printf("  g_soundCard2InDeviceNum: %d\n", g_soundCard2InDeviceNum);
+        printf("  g_soundCard2OutDeviceNum: %d\n", g_soundCard2OutDeviceNum);
+        printf("  g_soundCard2SampleRate: %d\n", g_soundCard2SampleRate);
+
+        wxConfigBase *pConfig = wxConfigBase::Get();
+        pConfig->Write(wxT("/Audio/soundCard1InDeviceNum"),       g_soundCard1InDeviceNum);
+        pConfig->Write(wxT("/Audio/soundCard1OutDeviceNum"),      g_soundCard1OutDeviceNum);
+        pConfig->Write(wxT("/Audio/soundCard1SampleRate"),        g_soundCard1SampleRate );
+
+        pConfig->Write(wxT("/Audio/soundCard2InDeviceNum"),       g_soundCard2InDeviceNum);
+        pConfig->Write(wxT("/Audio/soundCard2OutDeviceNum"),      g_soundCard2OutDeviceNum);
+        pConfig->Write(wxT("/Audio/soundCard2SampleRate"),        g_soundCard2SampleRate );
+
+        pConfig->Flush();
+        delete wxConfigBase::Set((wxConfigBase *) NULL);
+    }
+
+    return 0;
+}
+
+//-------------------------------------------------------------------------
+// buildListOfSupportedSampleRates()
+//-------------------------------------------------------------------------
+int AudioOptsDialog:: buildListOfSupportedSampleRates(wxComboBox *cbSampleRate, int devNum, int in_out)
+{
+    // every sound device has a different list of supported sample rates, so
+    // we work out which ones are supported and populate the list ctrl
+
+    static double standardSampleRates[] =
+    {
+        8000.0,     9600.0,
+        11025.0,    12000.0,
+        16000.0,    22050.0,
+        24000.0,    32000.0,
+        44100.0,    48000.0,
+        88200.0,    96000.0,
+        192000.0,   -1          // negative terminated  list
+    };
+
+    const PaDeviceInfo  *deviceInfo;
+    PaStreamParameters   inputParameters, outputParameters;
+    PaError              err;
+    wxString             str;
+    int                  i, numSampleRates;
+
+    deviceInfo = Pa_GetDeviceInfo(devNum);
+    if (deviceInfo == NULL) {
+        printf("Pa_GetDeviceInfo(%d) failed!\n", devNum);
+        cbSampleRate->Clear();
+        return 0;
+    }
+
+    inputParameters.device = devNum;
+    inputParameters.channelCount = deviceInfo->maxInputChannels;
+    inputParameters.sampleFormat = paInt16;
+    inputParameters.suggestedLatency = 0;
+    inputParameters.hostApiSpecificStreamInfo = NULL;
+        
+    outputParameters.device = devNum;
+    outputParameters.channelCount = deviceInfo->maxOutputChannels;
+    outputParameters.sampleFormat = paInt16;
+    outputParameters.suggestedLatency = 0;
+    outputParameters.hostApiSpecificStreamInfo = NULL;
+    
+    cbSampleRate->Clear();
+    //printf("devNum %d supports: ", devNum);
+    numSampleRates = 0;
+    for(i = 0; standardSampleRates[i] > 0; i++)
+    {      
+        if (in_out == AUDIO_IN)
+            err = Pa_IsFormatSupported(&inputParameters, NULL, standardSampleRates[i]);
+        else
+            err = Pa_IsFormatSupported(NULL, &outputParameters, standardSampleRates[i]);
+
+        if( err == paFormatIsSupported ) {
+            str.Printf("%i", (int)standardSampleRates[i]);
+            cbSampleRate->AppendString(str);
+            printf("%i ", (int)standardSampleRates[i]);
+            numSampleRates++;
+        }
+    }
+    printf("\n");
+
+    return numSampleRates;
+}
+
+//-------------------------------------------------------------------------
+// showAPIInfo()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::showAPIInfo()
+{
+    wxString    strval;
+    int         apiVersion;
+    int         apiCount        = 0;
+    int         numDevices      = 0;
+
+    strval = Pa_GetVersionText();
+    m_textStringVer->SetLabel(strval);
+
+    apiVersion = Pa_GetVersion();
+    strval.Printf(wxT("%d"), apiVersion);
+    m_textIntVer->SetLabel(strval);
+
+    apiCount = Pa_GetHostApiCount();
+    strval.Printf(wxT("%d"), apiCount);
+    m_textAPICount->SetLabel(strval);
+
+    numDevices = Pa_GetDeviceCount();
+    strval.Printf(wxT("%d"), numDevices);
+    m_textCDevCount->SetLabel(strval);
+}
+
+//-------------------------------------------------------------------------
+// populateParams()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::populateParams(AudioInfoDisplay ai)
+{
+    const       PaDeviceInfo *deviceInfo = NULL;
+    wxListCtrl* ctrl    = ai.m_listDevices;
+    int         in_out  = ai.direction;
+    long        idx;
+    int         numDevices;
+    wxListItem  listItem;
+    wxString    buf;
+    int         devn;
+    int         col = 0;
+
+    numDevices = Pa_GetDeviceCount();
+
+    if(ctrl->GetColumnCount() > 0)
+    {
+        ctrl->ClearAll();
+    }
+
+    listItem.SetAlign(wxLIST_FORMAT_LEFT);
+    listItem.SetText(wxT("Device"));
+    idx = ctrl->InsertColumn(col, listItem);
+    ctrl->SetColumnWidth(col++, 300);
+
+    listItem.SetAlign(wxLIST_FORMAT_CENTRE);
+    listItem.SetText(wxT("ID"));
+    idx = ctrl->InsertColumn(col, listItem);
+    ctrl->SetColumnWidth(col++, 45);
+
+    listItem.SetAlign(wxLIST_FORMAT_LEFT);
+    listItem.SetText(wxT("API"));
+    idx = ctrl->InsertColumn(col, listItem);
+    ctrl->SetColumnWidth(col++, 100);
+
+    if(in_out == AUDIO_IN)
+    {
+        listItem.SetAlign(wxLIST_FORMAT_CENTRE);
+        listItem.SetText(wxT("Default Sample Rate"));
+        idx = ctrl->InsertColumn(col, listItem);
+        ctrl->SetColumnWidth(col++, 160);
+    }
+    else if(in_out == AUDIO_OUT)
+    {
+        listItem.SetAlign(wxLIST_FORMAT_CENTRE);
+        listItem.SetText(wxT("Default Sample Rate"));
+        idx = ctrl->InsertColumn(col, listItem);
+        ctrl->SetColumnWidth(col++, 160);
+    }
+
+    #ifdef LATENCY
+    listItem.SetAlign(wxLIST_FORMAT_CENTRE);
+    listItem.SetText(wxT("Min Latency"));
+    ctrl->InsertColumn(col, listItem);
+    ctrl->SetColumnWidth(col++, 100);
+
+    listItem.SetAlign(wxLIST_FORMAT_CENTRE);
+    listItem.SetText(wxT("Max Latency"));
+    ctrl->InsertColumn(col, listItem);
+    ctrl->SetColumnWidth(col++, 100);
+    #endif
+
+    for(devn = 0; devn < numDevices; devn++)
+    {
+        buf.Printf(wxT(""));
+        deviceInfo = Pa_GetDeviceInfo(devn);
+        if( ((in_out == AUDIO_IN) && (deviceInfo->maxInputChannels > 0)) ||
+            ((in_out == AUDIO_OUT) && (deviceInfo->maxOutputChannels > 0)))
+        {
+            col = 0;
+            buf.Printf(wxT("%s"), deviceInfo->name);
+            idx = ctrl->InsertItem(ctrl->GetItemCount(), buf);
+            col++;
+                
+            buf.Printf(wxT("%d"), devn);
+            ctrl->SetItem(idx, col++, buf);
+
+            buf.Printf(wxT("%s"), Pa_GetHostApiInfo(deviceInfo->hostApi)->name);
+            ctrl->SetItem(idx, col++, buf);
+
+            buf.Printf(wxT("%i"), (int)deviceInfo->defaultSampleRate);
+            ctrl->SetItem(idx, col++, buf);
+
+            #ifdef LATENCY
+            if (in_out == AUDIO_IN)
+                buf.Printf(wxT("%8.4f"), deviceInfo->defaultLowInputLatency);
+            else
+                buf.Printf(wxT("%8.4f"), deviceInfo->defaultLowOutputLatency);               
+            ctrl->SetItem(idx, col++, buf);
+
+            if (in_out == AUDIO_IN)
+                buf.Printf(wxT("%8.4f"), deviceInfo->defaultHighInputLatency);
+            else
+                 buf.Printf(wxT("%8.4f"), deviceInfo->defaultHighOutputLatency);             
+            ctrl->SetItem(idx, col++, buf);
+            #endif
+        }        
+    }
+
+    // add "none" option at end
+
+    buf.Printf(wxT("%s"), "none");
+    idx = ctrl->InsertItem(ctrl->GetItemCount(), buf);
+}
+
+//-------------------------------------------------------------------------
+// OnDeviceSelect()
+//
+// helper function to set up "Device:" and "Sample Rate:" fields when
+// we click on a line in the list of devices box
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnDeviceSelect(wxComboBox *cbSampleRate, 
+                                     wxTextCtrl *textCtrl, 
+                                     int        *devNum, 
+                                     wxListCtrl *listCtrlDevices, 
+                                     int         index,
+                                     int         in_out)
+{
+
+    wxString devName = listCtrlDevices->GetItemText(index, 0);
+     if (devName.IsSameAs("none")) {
+        *devNum = -1;
+        textCtrl->SetValue("none");
+    }
+    else {
+        *devNum = wxAtoi(listCtrlDevices->GetItemText(index, 1));
+        textCtrl->SetValue(devName + " (" + wxString::Format(wxT("%i"),*devNum) + ")");
+
+        int numSampleRates = buildListOfSupportedSampleRates(cbSampleRate, *devNum, in_out);
+        if (numSampleRates) {
+            wxString defSampleRate = listCtrlDevices->GetItemText(index, 3);        
+            cbSampleRate->SetValue(defSampleRate);
+        }
+        else {
+             cbSampleRate->SetValue("None");           
+        }
+    }
+}
+
+//-------------------------------------------------------------------------
+// OnRxInDeviceSelect()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnRxInDeviceSelect(wxListEvent& evt)
+{
+    OnDeviceSelect(m_cbSampleRateRxIn, 
+                   m_textCtrlRxIn, 
+                   &rxInAudioDeviceNum, 
+                   m_listCtrlRxInDevices, 
+                   evt.GetIndex(),
+                   AUDIO_IN);
+}
+
+//-------------------------------------------------------------------------
+// OnRxOutDeviceSelect()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnRxOutDeviceSelect(wxListEvent& evt)
+{
+    OnDeviceSelect(m_cbSampleRateRxOut, 
+                   m_textCtrlRxOut, 
+                   &rxOutAudioDeviceNum, 
+                   m_listCtrlRxOutDevices, 
+                   evt.GetIndex(),
+                   AUDIO_OUT);
+}
+
+//-------------------------------------------------------------------------
+// OnTxInDeviceSelect()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnTxInDeviceSelect(wxListEvent& evt)
+{
+    OnDeviceSelect(m_cbSampleRateTxIn, 
+                   m_textCtrlTxIn, 
+                   &txInAudioDeviceNum, 
+                   m_listCtrlTxInDevices, 
+                   evt.GetIndex(),
+                   AUDIO_IN);
+}
+
+//-------------------------------------------------------------------------
+// OnTxOutDeviceSelect()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnTxOutDeviceSelect(wxListEvent& evt)
+{
+    OnDeviceSelect(m_cbSampleRateTxOut, 
+                   m_textCtrlTxOut, 
+                   &txOutAudioDeviceNum, 
+                   m_listCtrlTxOutDevices, 
+                   evt.GetIndex(),
+                   AUDIO_OUT);
+}
+
+//-------------------------------------------------------------------------
+// plotDeviceInputForAFewSecs()
+//
+// opens a record device and plots the input speech for a few seconds.  This is "modal" using
+// synchronous portaudio functions, so the GUI will not respond until after test sample has been
+// taken
+//-------------------------------------------------------------------------
+void AudioOptsDialog::plotDeviceInputForAFewSecs(int devNum, PlotScalar *plotScalar) {
+    PaStreamParameters  inputParameters;
+    const PaDeviceInfo *deviceInfo = NULL;
+    PaStream           *stream = NULL;
+    PaError             err;
+    short               in48k_stereo_short[2*TEST_BUF_SIZE];
+    short               in48k_short[TEST_BUF_SIZE];
+    short               in8k_short[TEST_BUF_SIZE];
+    int                 numDevices, nBufs, i, j, src_error,inputChannels;
+    float               t;
+    SRC_STATE          *src;
+    FIFO               *fifo;
+
+    // a basic sanity check
+    numDevices = Pa_GetDeviceCount();
+    if (devNum >= numDevices)
+        return;
+    if (devNum < 0)
+        return;
+    printf("devNum %d\n", devNum);
+
+    fifo = fifo_create((int)(DT*TEST_WAVEFORM_PLOT_FS*2)); assert(fifo != NULL);
+    src = src_new(SRC_SINC_FASTEST, 1, &src_error); assert(src != NULL);
+
+    // work out how many input channels this device supports.
+
+    deviceInfo = Pa_GetDeviceInfo(devNum);
+    if (deviceInfo == NULL) {
+        wxMessageBox(wxT("Couldn't get device info from Port Audio for Sound Card "), wxT("Error"), wxOK);
+        return;
+    }
+    if (deviceInfo->maxInputChannels == 1)
+        inputChannels = 1;
+    else
+        inputChannels = 2;
+
+    // open device
+
+    inputParameters.device = devNum;
+    inputParameters.channelCount = inputChannels;
+    inputParameters.sampleFormat = paInt16;
+    inputParameters.suggestedLatency = Pa_GetDeviceInfo( inputParameters.device )->defaultHighInputLatency;
+    inputParameters.hostApiSpecificStreamInfo = NULL;
+
+    nBufs = TEST_WAVEFORM_PLOT_TIME*TEST_FS/TEST_BUF_SIZE;
+    printf("inputChannels: %d nBufs %d\n", inputChannels, nBufs);
+
+    err = Pa_OpenStream(
+              &stream,
+              &inputParameters,
+              NULL,
+              TEST_FS,
+              TEST_BUF_SIZE,
+              paClipOff,    
+              NULL,       // no callback, use blocking API
+              NULL ); 
+    if (err != paNoError) {
+        wxMessageBox(wxT("Couldn't initialise sound device."), wxT("Error"), wxOK);       
+        return;
+    }
+
+    err = Pa_StartStream(stream);
+    if (err != paNoError) {
+        wxMessageBox(wxT("Couldn't start sound device."), wxT("Error"), wxOK);       
+        return;
+    }
+
+    for(i=0, t=0.0; i<nBufs; i++, t+=(float)TEST_BUF_SIZE/TEST_FS) {
+        Pa_ReadStream(stream, in48k_stereo_short, TEST_BUF_SIZE);
+        if (inputChannels == 2) {
+            for(j=0; j<TEST_BUF_SIZE; j++)
+                in48k_short[j] = in48k_stereo_short[2*j]; // left channel only
+        }
+        else {
+            for(j=0; j<TEST_BUF_SIZE; j++)
+                in48k_short[j] = in48k_stereo_short[j]; 
+        }
+        int n8k = resample(src, in8k_short, in48k_short, 8000, TEST_FS, TEST_BUF_SIZE, TEST_BUF_SIZE);
+        resample_for_plot(fifo, in8k_short, n8k, FS);
+
+        // every TEST_DT seconds update plot, unfortunately plot
+        // doesnt get updated to end as we are blocking events in this
+        // function
+
+        if (t > TEST_DT) {
+            t -= TEST_DT;
+            short plotSamples[TEST_WAVEFORM_PLOT_BUF];
+            if (fifo_read(fifo, plotSamples, TEST_WAVEFORM_PLOT_BUF))
+                memset(plotSamples, 0, TEST_WAVEFORM_PLOT_BUF*sizeof(short));
+            plotScalar->add_new_short_samples(0, plotSamples, TEST_WAVEFORM_PLOT_BUF, 32767);
+            plotScalar->Refresh();
+       }
+    }
+   
+    err = Pa_StopStream(stream);
+    if (err != paNoError) {
+        wxMessageBox(wxT("Couldn't stop sound device."), wxT("Error"), wxOK);       
+        return;
+    }
+    Pa_CloseStream(stream);
+
+    fifo_destroy(fifo);
+    src_delete(src);
+}
+
+//-------------------------------------------------------------------------
+// plotDeviceOutputForAFewSecs()
+//
+// opens a play device and plays a tone for a few seconds.  This is "modal" using
+// synchronous portaudio functions, so the GUI will not respond until after test sample has been
+// taken.  Also plots a pretty picture like the record versions
+//-------------------------------------------------------------------------
+void AudioOptsDialog::plotDeviceOutputForAFewSecs(int devNum, PlotScalar *plotScalar) {
+    PaStreamParameters  outputParameters;
+    const PaDeviceInfo *deviceInfo = NULL;
+    PaStream           *stream = NULL;
+    PaError             err;
+    short               out48k_stereo_short[2*TEST_BUF_SIZE];
+    short               out48k_short[TEST_BUF_SIZE];
+    short               out8k_short[TEST_BUF_SIZE];
+    int                 numDevices, nBufs, i, j, src_error, n, outputChannels;
+    float               t;
+    SRC_STATE          *src;
+    FIFO               *fifo;
+
+    // a basic sanity check
+    numDevices = Pa_GetDeviceCount();
+    if (devNum >= numDevices)
+        return;
+    if (devNum < 0)
+        return;
+
+    fifo = fifo_create((int)(DT*TEST_WAVEFORM_PLOT_FS*2)); assert(fifo != NULL);
+    src = src_new(SRC_SINC_FASTEST, 1, &src_error); assert(src != NULL);
+
+    // work out how many output channels this device supports.
+
+    deviceInfo = Pa_GetDeviceInfo(devNum);
+    if (deviceInfo == NULL) {
+        wxMessageBox(wxT("Couldn't get device info from Port Audio for Sound Card "), wxT("Error"), wxOK);
+        return;
+    }
+    if (deviceInfo->maxOutputChannels == 1)
+        outputChannels = 1;
+    else
+        outputChannels = 2;
+
+    printf("outputChannels: %d\n", outputChannels);
+
+    outputParameters.device = devNum;
+    outputParameters.channelCount = outputChannels;
+    outputParameters.sampleFormat = paInt16;
+    outputParameters.suggestedLatency = Pa_GetDeviceInfo( outputParameters.device )->defaultHighOutputLatency;
+    outputParameters.hostApiSpecificStreamInfo = NULL;
+
+    nBufs = TEST_WAVEFORM_PLOT_TIME*TEST_FS/TEST_BUF_SIZE;
+
+    err = Pa_OpenStream(
+              &stream,
+              NULL,
+              &outputParameters,
+              TEST_FS,
+              TEST_BUF_SIZE,
+              paClipOff,    
+              NULL,       // no callback, use blocking API
+              NULL ); 
+    if (err != paNoError) {
+        wxMessageBox(wxT("Couldn't initialise sound device."), wxT("Error"), wxOK);       
+        return;
+    }
+
+    err = Pa_StartStream(stream);
+    if (err != paNoError) {
+        wxMessageBox(wxT("Couldn't start sound device."), wxT("Error"), wxOK);       
+        return;
+    }
+
+    for(i=0, t=0.0, n=0; i<nBufs; i++, t+=(float)TEST_BUF_SIZE/TEST_FS) {
+        for(j=0; j<TEST_BUF_SIZE; j++,n++) {
+            out48k_short[j] = 2000.0*cos(6.2832*(n++)*400.0/TEST_FS);
+            if (outputChannels == 2) {
+                out48k_stereo_short[2*j] = out48k_short[j];   // left channel
+                out48k_stereo_short[2*j+1] = out48k_short[j]; // right channel
+            }
+            else {
+                out48k_stereo_short[j] = out48k_short[j];     // mono
+            }
+        }
+        Pa_WriteStream(stream, out48k_stereo_short, TEST_BUF_SIZE);
+
+        // convert back to 8kHz just for plotting
+        int n8k = resample(src, out8k_short, out48k_short, 8000, TEST_FS, TEST_BUF_SIZE, TEST_BUF_SIZE);
+        resample_for_plot(fifo, out8k_short, n8k, FS);
+
+        // every TEST_DT seconds update plot
+
+        if (t > TEST_DT) {
+            t -= TEST_DT;
+            short plotSamples[TEST_WAVEFORM_PLOT_BUF];
+            if (fifo_read(fifo, plotSamples, TEST_WAVEFORM_PLOT_BUF))
+                memset(plotSamples, 0, TEST_WAVEFORM_PLOT_BUF*sizeof(short));
+            plotScalar->add_new_short_samples(0, plotSamples, TEST_WAVEFORM_PLOT_BUF, 32767);
+            plotScalar->Refresh();
+       }
+    }
+   
+    err = Pa_StopStream(stream);
+    if (err != paNoError) {
+        wxMessageBox(wxT("Couldn't stop sound device."), wxT("Error"), wxOK);       
+        return;
+    }
+    Pa_CloseStream(stream);
+
+    fifo_destroy(fifo);
+    src_delete(src);
+}
+
+//-------------------------------------------------------------------------
+// OnRxInTest()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnRxInTest(wxCommandEvent& event)
+{
+    plotDeviceInputForAFewSecs(rxInAudioDeviceNum, m_plotScalarRxIn);
+}
+
+//-------------------------------------------------------------------------
+// OnRxOutTest()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnRxOutTest(wxCommandEvent& event)
+{
+    plotDeviceOutputForAFewSecs(rxOutAudioDeviceNum, m_plotScalarRxOut);
+}
+
+//-------------------------------------------------------------------------
+// OnTxInTest()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnTxInTest(wxCommandEvent& event)
+{
+    plotDeviceInputForAFewSecs(txInAudioDeviceNum, m_plotScalarTxIn);
+}
+
+//-------------------------------------------------------------------------
+// OnTxOutTest()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnTxOutTest(wxCommandEvent& event)
+{
+    plotDeviceOutputForAFewSecs(txOutAudioDeviceNum, m_plotScalarTxOut);
+}
+
+//-------------------------------------------------------------------------
+// OnRefreshClick()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnRefreshClick(wxCommandEvent& event)
+{
+    // restart portaudio, to re-sample available devices
+
+    Pa_Terminate();
+    Pa_Init();
+
+    m_notebook1->SetSelection(0);
+    showAPIInfo();
+    populateParams(m_RxInDevices);
+    populateParams(m_RxOutDevices);
+    populateParams(m_TxInDevices);
+    populateParams(m_TxOutDevices);
+
+    // some devices may have dissapeared, so possibily change sound
+    // card config
+
+    ExchangeData(EXCHANGE_DATA_IN);
+}
+
+//-------------------------------------------------------------------------
+// OnApplyAudioParameters()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnApplyAudioParameters(wxCommandEvent& event)
+{
+    ExchangeData(EXCHANGE_DATA_OUT);
+    if(m_isPaInitialized)
+    {
+        if((pa_err = Pa_Terminate()) == paNoError)
+        {
+            m_isPaInitialized = false;
+        }
+        else
+        {
+            wxMessageBox(wxT("Port Audio failed to Terminate"), wxT("Pa_Terminate"), wxOK);
+        }
+    }
+}
+
+//-------------------------------------------------------------------------
+// OnCancelAudioParameters()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnCancelAudioParameters(wxCommandEvent& event)
+{
+    if(m_isPaInitialized)
+    {
+        if((pa_err = Pa_Terminate()) == paNoError)
+        {
+            m_isPaInitialized = false;
+        }
+        else
+        {
+            wxMessageBox(wxT("Port Audio failed to Terminate"), wxT("Pa_Terminate"), wxOK);
+        }
+    }
+    EndModal(wxCANCEL);
+}
+
+//-------------------------------------------------------------------------
+// OnOkAudioParameters()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnOkAudioParameters(wxCommandEvent& event)
+{
+    int status = ExchangeData(EXCHANGE_DATA_OUT);
+
+    // We only accept OK if config sucessful
+
+    printf("status: %d m_isPaInitialized: %d\n", status, m_isPaInitialized);
+    if (status == 0) {
+        if(m_isPaInitialized)
+        {
+            if((pa_err = Pa_Terminate()) == paNoError)
+            {
+                printf("terminated OK\n");
+                m_isPaInitialized = false;
+            }
+            else
+            {
+                wxMessageBox(wxT("Port Audio failed to Terminate"), wxT("Pa_Terminate"), wxOK);
+            }
+        }
+        EndModal(wxOK);
+    }
+
+}
diff --git a/freedv/branches/0.99/src/dlg_audiooptions.h b/freedv/branches/0.99/src/dlg_audiooptions.h
new file mode 100644 (file)
index 0000000..7a78b59
--- /dev/null
@@ -0,0 +1,176 @@
+//=========================================================================
+// Name:          AudioInfoDisplay.h
+// Purpose:       Declares simple wxWidgets application with GUI
+//                created using wxFormBuilder.
+// 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 <http://www.gnu.org/licenses/>.
+//
+//=========================================================================
+#ifndef __AudioOptsDialog__
+#define __AudioOptsDialog__
+
+#include "fdmdv2_main.h"
+
+#define ID_AUDIO_OPTIONS    1000
+#define AUDIO_IN            0
+#define AUDIO_OUT           1
+
+#include "portaudio.h"
+#ifdef WIN32
+#if PA_USE_ASIO
+#include "pa_asio.h"
+#endif
+#endif
+#include "codec2_fifo.h"
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// AudioInfoDisplay
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class AudioInfoDisplay
+{
+    public:
+        wxListCtrl*     m_listDevices;
+        int             direction;
+        wxTextCtrl*     m_textDevice;
+        wxComboBox*     m_cbSampleRate;
+};
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// class AudioOptsDialog
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class AudioOptsDialog : public wxDialog
+{
+    private:
+
+    protected:
+        PaError         pa_err;
+        bool            m_isPaInitialized;
+
+        int             rxInAudioDeviceNum;
+        int             rxOutAudioDeviceNum;
+        int             txInAudioDeviceNum;
+        int             txOutAudioDeviceNum;
+
+        void buildTestControls(PlotScalar **plotScalar, wxButton **btnTest, 
+                               wxPanel *parentPanel, wxBoxSizer *bSizer, wxString buttonLabel);
+        void plotDeviceInputForAFewSecs(int devNum, PlotScalar *plotScalar);
+        void plotDeviceOutputForAFewSecs(int devNum, PlotScalar *plotScalar);
+
+        int buildListOfSupportedSampleRates(wxComboBox *cbSampleRate, int devNum, int in_out);
+        void populateParams(AudioInfoDisplay);
+        void showAPIInfo();
+        int setTextCtrlIfDevNumValid(wxTextCtrl *textCtrl, wxListCtrl *listCtrl, int devNum);
+        void Pa_Init(void);
+        void OnDeviceSelect(wxComboBox *cbSampleRate, 
+                            wxTextCtrl *textCtrl, 
+                            int        *devNum, 
+                            wxListCtrl *listCtrlDevices, 
+                            int         index,
+                            int         in_out);
+
+        AudioInfoDisplay m_RxInDevices;
+        AudioInfoDisplay m_RxOutDevices;
+        AudioInfoDisplay m_TxInDevices;
+        AudioInfoDisplay m_TxOutDevices;
+        wxPanel* m_panel1;
+        wxNotebook* m_notebook1;
+
+        wxPanel* m_panelRx;
+
+        wxListCtrl* m_listCtrlRxInDevices;
+        wxStaticText* m_staticText51;
+        wxTextCtrl* m_textCtrlRxIn;
+        wxStaticText* m_staticText6;
+        wxComboBox* m_cbSampleRateRxIn;
+
+        wxButton* m_btnRxInTest;
+        PlotScalar* m_plotScalarRxIn;
+
+        wxListCtrl* m_listCtrlRxOutDevices;
+        wxStaticText* m_staticText9;
+        wxTextCtrl* m_textCtrlRxOut;
+        wxStaticText* m_staticText10;
+        wxComboBox* m_cbSampleRateRxOut;
+
+        wxButton* m_btnRxOutTest;
+        PlotScalar* m_plotScalarRxOut;
+
+        wxPanel* m_panelTx;
+
+        wxListCtrl* m_listCtrlTxInDevices;
+        wxStaticText* m_staticText12;
+        wxTextCtrl* m_textCtrlTxIn;
+        wxStaticText* m_staticText11;
+        wxComboBox* m_cbSampleRateTxIn;
+
+        wxButton* m_btnTxInTest;
+        PlotScalar* m_plotScalarTxIn;
+
+        wxListCtrl* m_listCtrlTxOutDevices;
+        wxStaticText* m_staticText81;
+        wxTextCtrl* m_textCtrlTxOut;
+        wxStaticText* m_staticText71;
+        wxComboBox* m_cbSampleRateTxOut;
+
+        wxButton* m_btnTxOutTest;
+        PlotScalar* m_plotScalarTxOut;
+
+        wxPanel* m_panelAPI;
+
+        wxStaticText* m_staticText7;
+        wxStaticText* m_textStringVer;
+        wxStaticText* m_staticText8;
+        wxStaticText* m_textIntVer;
+        wxStaticText* m_staticText5;
+        wxStaticText* m_textCDevCount;
+        wxStaticText* m_staticText4;
+        wxStaticText* m_textAPICount;
+        wxButton* m_btnRefresh;
+        wxStdDialogButtonSizer* m_sdbSizer1;
+        wxButton* m_sdbSizer1OK;
+        wxButton* m_sdbSizer1Apply;
+        wxButton* m_sdbSizer1Cancel;
+
+        // Virtual event handlers, overide them in your derived class
+        //virtual void OnActivateApp( wxActivateEvent& event ) { event.Skip(); }
+//        virtual void OnCloseFrame( wxCloseEvent& event ) { event.Skip(); }
+
+        void OnRxInDeviceSelect( wxListEvent& event );
+
+        void OnRxInTest( wxCommandEvent& event );
+        void OnRxOutTest( wxCommandEvent& event );
+        void OnTxInTest( wxCommandEvent& event );
+        void OnTxOutTest( wxCommandEvent& event );
+
+        void OnRxOutDeviceSelect( wxListEvent& event );
+        void OnTxInDeviceSelect( wxListEvent& event );
+        void OnTxOutDeviceSelect( wxListEvent& event );
+        void OnRefreshClick( wxCommandEvent& event );
+        void OnApplyAudioParameters( wxCommandEvent& event );
+        void OnCancelAudioParameters( wxCommandEvent& event );
+        void OnOkAudioParameters( wxCommandEvent& event );
+        // Virtual event handlers, overide them in your derived class
+        void OnClose( wxCloseEvent& event ) { event.Skip(); }
+        void OnHibernate( wxActivateEvent& event ) { event.Skip(); }
+        void OnIconize( wxIconizeEvent& event ) { event.Skip(); }
+        void OnInitDialog( wxInitDialogEvent& event );
+
+    public:
+
+        AudioOptsDialog( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Audio Config"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 300,300 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
+        ~AudioOptsDialog();
+        int ExchangeData(int inout);
+};
+#endif //__AudioOptsDialog__
diff --git a/freedv/branches/0.99/src/dlg_filter.cpp b/freedv/branches/0.99/src/dlg_filter.cpp
new file mode 100644 (file)
index 0000000..0de8e8c
--- /dev/null
@@ -0,0 +1,786 @@
+//==========================================================================
+// Name:            dlg_filter.cpp
+// Purpose:         Dialog for controlling Codec audio filtering
+// Date:            Nov 25 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#include "dlg_filter.h"
+
+#define SLIDER_MAX 100
+#define SLIDER_LENGTH 100
+
+#define FILTER_MIN_MAG_DB -20.0
+#define FILTER_MAX_MAG_DB  20.0
+
+#define MAX_FREQ_BASS      600.00
+#define MAX_FREQ_TREBLE   3900.00
+#define MAX_FREQ_DEF      3000.00
+
+#define MIN_GAIN          -20
+#define MAX_GAIN           20
+
+#define MAX_LOG10_Q         1.0
+#define MIN_LOG10_Q        -1.0 
+
+// DFT parameters
+
+#define IMP_AMP           2000.0                     // amplitude of impulse
+#define NIMP              50                         // number of samples in impulse response
+#define F_STEP_DFT        10.0                       // frequency steps to sample spectrum
+#define F_MAG_N           (int)(MAX_F_HZ/F_STEP_DFT) // number of frequency steps
+
+extern struct freedv      *g_pfreedv;
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class FilterDlg
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+FilterDlg::FilterDlg(wxWindow* parent, bool running, bool *newMicInFilter, bool *newSpkOutFilter,
+                     wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style)
+{
+    m_running = running;
+    m_newMicInFilter = newMicInFilter;
+    m_newSpkOutFilter = newSpkOutFilter;
+
+    this->SetSizeHints(wxDefaultSize, wxDefaultSize);
+
+    wxBoxSizer* bSizer30;
+    bSizer30 = new wxBoxSizer(wxVERTICAL);
+
+    // LPC Post Filter --------------------------------------------------------
+
+    wxStaticBoxSizer* lpcpfs = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("LPC Post Filter")), wxHORIZONTAL);
+
+    wxBoxSizer* left = new wxBoxSizer(wxVERTICAL);
+
+    m_codec2LPCPostFilterEnable = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition,wxDefaultSize, wxCHK_2STATE);
+    left->Add(m_codec2LPCPostFilterEnable);
+
+    m_codec2LPCPostFilterBassBoost = new wxCheckBox(this, wxID_ANY, _("0-1 kHz 3dB Boost"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
+    left->Add(m_codec2LPCPostFilterBassBoost);
+    lpcpfs->Add(left, 0, wxALL, 5);
+
+    newLPCPFControl(&m_codec2LPCPostFilterBeta, &m_staticTextBeta, lpcpfs, "Beta");
+    newLPCPFControl(&m_codec2LPCPostFilterGamma, &m_staticTextGamma, lpcpfs, "Gamma");
+
+    m_LPCPostFilterDefault = new wxButton(this, wxID_ANY, wxT("Default"));
+    lpcpfs->Add(m_LPCPostFilterDefault, 0, wxALL|wxALIGN_CENTRE_HORIZONTAL|wxALIGN_CENTRE_VERTICAL, 5);
+
+    bSizer30->Add(lpcpfs, 0, wxALL, 0);
+
+    // Speex pre-processor --------------------------------------------------
+
+    wxStaticBoxSizer* sbSizer_speexpp;
+    wxStaticBox *sb_speexpp = new wxStaticBox(this, wxID_ANY, _("Speex Mic Audio Pre-Processor"));
+    sbSizer_speexpp = new wxStaticBoxSizer(sb_speexpp, wxVERTICAL);
+
+    m_ckboxSpeexpp = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
+    sb_speexpp->SetToolTip(_("Enable noise supression, dereverberation, AGC of mic signal"));
+    sbSizer_speexpp->Add(m_ckboxSpeexpp, wxALIGN_LEFT, 2);
+
+    bSizer30->Add(sbSizer_speexpp, 0, wxALL, 0);   
+
+    // EQ Filters -----------------------------------------------------------
+
+    wxStaticBoxSizer* eqMicInSizer = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Mic In Equaliser")), wxVERTICAL);
+    wxBoxSizer* eqMicInSizer1 = new wxBoxSizer(wxHORIZONTAL);
+    wxBoxSizer* eqMicInSizer2 = new wxBoxSizer(wxHORIZONTAL);
+
+    m_MicInBass   = newEQ(eqMicInSizer1, "Bass"  , MAX_FREQ_BASS, disableQ);
+    m_MicInTreble = newEQ(eqMicInSizer1, "Treble", MAX_FREQ_TREBLE, disableQ);
+    eqMicInSizer->Add(eqMicInSizer1);
+
+    m_MicInEnable = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition,wxDefaultSize, wxCHK_2STATE);
+    eqMicInSizer2->Add(m_MicInEnable,0,wxALIGN_CENTRE_VERTICAL|wxRIGHT,10);
+    m_MicInMid    = newEQ(eqMicInSizer2, "Mid"   , MAX_FREQ_DEF, enableQ);
+    m_MicInDefault = new wxButton(this, wxID_ANY, wxT("Default"));
+    eqMicInSizer2->Add(m_MicInDefault,0,wxALIGN_CENTRE_VERTICAL|wxLEFT,20);
+    eqMicInSizer->Add(eqMicInSizer2);
+
+    wxStaticBoxSizer* eqSpkOutSizer = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Speaker Out Equaliser")), wxVERTICAL);
+    wxBoxSizer* eqSpkOutSizer1 = new wxBoxSizer(wxHORIZONTAL);
+    wxBoxSizer* eqSpkOutSizer2 = new wxBoxSizer(wxHORIZONTAL);
+
+    m_SpkOutBass   = newEQ(eqSpkOutSizer1, "Bass"  , MAX_FREQ_BASS, disableQ);
+    m_SpkOutTreble = newEQ(eqSpkOutSizer1, "Treble", MAX_FREQ_TREBLE, disableQ);
+    eqSpkOutSizer->Add(eqSpkOutSizer1);
+
+    m_SpkOutEnable = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition,wxDefaultSize, wxCHK_2STATE);
+    eqSpkOutSizer2->Add(m_SpkOutEnable,0,wxALIGN_CENTRE_VERTICAL|wxRIGHT,10);
+    m_SpkOutMid    = newEQ(eqSpkOutSizer2, "Mid"   , MAX_FREQ_DEF, enableQ);
+    m_SpkOutDefault = new wxButton(this, wxID_ANY, wxT("Default"));
+    eqSpkOutSizer2->Add(m_SpkOutDefault,0,wxALIGN_CENTRE_VERTICAL|wxLEFT,20);
+    eqSpkOutSizer->Add(eqSpkOutSizer2);
+    
+    bSizer30->Add(eqMicInSizer, 0, wxALL, 0);
+    bSizer30->Add(eqSpkOutSizer, 0, wxALL, 0);
+
+    // Storgage for spectrum magnitude plots ------------------------------------
+
+    m_MicInMagdB = new float[F_MAG_N];
+    for(int i=0; i<F_MAG_N; i++)
+        m_MicInMagdB[i] = 0.0;
+
+    m_SpkOutMagdB = new float[F_MAG_N];
+    for(int i=0; i<F_MAG_N; i++)
+        m_SpkOutMagdB[i] = 0.0;
+
+    // Spectrum Plots -----------------------------------------------------------
+
+    long nb_style = wxAUI_NB_BOTTOM | wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_MOVE | wxAUI_NB_SCROLL_BUTTONS;
+    m_auiNotebook = new wxAuiNotebook(this, wxID_ANY, wxDefaultPosition, wxSize(-1,200), nb_style);
+    m_auiNotebook->SetFont(wxFont(8, 70, 90, 90, false, wxEmptyString));
+
+    bSizer30->Add(m_auiNotebook, 0, wxEXPAND|wxALL, 3);
+    
+    m_MicInFreqRespPlot = new PlotSpectrum((wxFrame*) m_auiNotebook, m_MicInMagdB, F_MAG_N, FILTER_MIN_MAG_DB, FILTER_MAX_MAG_DB);
+    m_auiNotebook->AddPage(m_MicInFreqRespPlot, _("Microphone In Equaliser"));
+
+    m_SpkOutFreqRespPlot = new PlotSpectrum((wxFrame*)m_auiNotebook, m_SpkOutMagdB, F_MAG_N, FILTER_MIN_MAG_DB, FILTER_MAX_MAG_DB);
+    m_auiNotebook->AddPage(m_SpkOutFreqRespPlot, _("Speaker Out Equaliser"));
+
+    //  OK - Cancel buttons at the bottom --------------------------
+
+    wxBoxSizer* bSizer31 = new wxBoxSizer(wxHORIZONTAL);
+
+    m_sdbSizer5OK = new wxButton(this, wxID_OK);
+    bSizer31->Add(m_sdbSizer5OK, 0, wxALL, 2);
+
+    m_sdbSizer5Cancel = new wxButton(this, wxID_CANCEL);
+    bSizer31->Add(m_sdbSizer5Cancel, 0, wxALL, 2);
+
+    bSizer30->Add(bSizer31, 0, wxALIGN_RIGHT|wxALL, 0);
+
+    this->SetSizer(bSizer30);
+    this->Layout();
+
+    this->Centre(wxBOTH);
+    // Connect Events -------------------------------------------------------
+
+    this->Connect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(FilterDlg::OnInitDialog));
+
+    m_codec2LPCPostFilterEnable->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnEnable), NULL, this);
+    m_codec2LPCPostFilterBassBoost->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnBassBoost), NULL, this);
+    m_codec2LPCPostFilterBeta->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnBetaScroll), NULL, this);
+    m_codec2LPCPostFilterGamma->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnGammaScroll), NULL, this);
+    m_LPCPostFilterDefault->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnLPCPostFilterDefault), NULL, this);
+
+    m_ckboxSpeexpp->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnSpeexppEnable), NULL, this);
+
+    m_MicInBass.sliderFreq->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInBassFreqScroll), NULL, this);
+    m_MicInBass.sliderGain->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInBassGainScroll), NULL, this);
+    m_MicInTreble.sliderFreq->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInTrebleFreqScroll), NULL, this);
+    m_MicInTreble.sliderGain->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInTrebleGainScroll), NULL, this);
+    m_MicInMid.sliderFreq->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInMidFreqScroll), NULL, this);
+    m_MicInMid.sliderGain->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInMidGainScroll), NULL, this);
+    m_MicInMid.sliderQ->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInMidQScroll), NULL, this);
+    m_MicInEnable->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnMicInEnable), NULL, this);
+    m_MicInDefault->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnMicInDefault), NULL, this);
+
+    m_SpkOutBass.sliderFreq->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutBassFreqScroll), NULL, this);
+    m_SpkOutBass.sliderGain->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutBassGainScroll), NULL, this);
+    m_SpkOutTreble.sliderFreq->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutTrebleFreqScroll), NULL, this);
+    m_SpkOutTreble.sliderGain->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutTrebleGainScroll), NULL, this);
+    m_SpkOutMid.sliderFreq->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutMidFreqScroll), NULL, this);
+    m_SpkOutMid.sliderGain->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutMidGainScroll), NULL, this);
+    m_SpkOutMid.sliderQ->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutMidQScroll), NULL, this);
+    m_SpkOutEnable->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnSpkOutEnable), NULL, this);
+    m_SpkOutDefault->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnSpkOutDefault), NULL, this);
+
+    m_sdbSizer5Cancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnCancel), NULL, this);
+    m_sdbSizer5OK->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnOK), NULL, this);
+
+}
+
+//-------------------------------------------------------------------------
+// ~FilterDlg()
+//-------------------------------------------------------------------------
+FilterDlg::~FilterDlg()
+{
+    delete m_MicInMagdB;
+    delete m_SpkOutMagdB;
+
+    // Disconnect Events
+
+    this->Disconnect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(FilterDlg::OnInitDialog));
+
+    m_codec2LPCPostFilterEnable->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnEnable), NULL, this);
+    m_codec2LPCPostFilterBassBoost->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnBassBoost), NULL, this);
+    m_codec2LPCPostFilterBeta->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnBetaScroll), NULL, this);
+    m_codec2LPCPostFilterGamma->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnGammaScroll), NULL, this);
+    m_LPCPostFilterDefault->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnLPCPostFilterDefault), NULL, this);
+
+    m_MicInBass.sliderFreq->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInBassFreqScroll), NULL, this);
+    m_MicInBass.sliderGain->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInBassGainScroll), NULL, this);
+    m_MicInTreble.sliderFreq->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInTrebleFreqScroll), NULL, this);
+    m_MicInTreble.sliderGain->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInTrebleGainScroll), NULL, this);
+    m_MicInMid.sliderFreq->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInMidFreqScroll), NULL, this);
+    m_MicInMid.sliderGain->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInMidGainScroll), NULL, this);
+    m_MicInMid.sliderQ->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInMidQScroll), NULL, this);
+    m_MicInEnable->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnMicInEnable), NULL, this);
+    m_MicInDefault->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnMicInDefault), NULL, this);
+
+    m_SpkOutBass.sliderFreq->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutBassFreqScroll), NULL, this);
+    m_SpkOutBass.sliderGain->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutBassGainScroll), NULL, this);
+    m_SpkOutTreble.sliderFreq->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutTrebleFreqScroll), NULL, this);
+    m_SpkOutTreble.sliderGain->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutTrebleGainScroll), NULL, this);
+    m_SpkOutMid.sliderFreq->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutMidFreqScroll), NULL, this);
+    m_SpkOutMid.sliderGain->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutMidGainScroll), NULL, this);
+    m_SpkOutMid.sliderQ->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutMidQScroll), NULL, this);
+    m_SpkOutEnable->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnSpkOutEnable), NULL, this);
+    m_SpkOutDefault->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnSpkOutDefault), NULL, this);
+
+    m_sdbSizer5Cancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnCancel), NULL, this);
+    m_sdbSizer5OK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnOK), NULL, this);
+}
+
+void FilterDlg::newLPCPFControl(wxSlider **slider, wxStaticText **stValue, wxSizer *s, wxString controlName)
+{
+    wxBoxSizer *bs = new wxBoxSizer(wxHORIZONTAL);
+
+    wxStaticText* st = new wxStaticText(this, wxID_ANY, controlName, wxDefaultPosition, wxSize(70,-1), wxALIGN_RIGHT);
+    bs->Add(st, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 2);
+
+    *slider = new wxSlider(this, wxID_ANY, 0, 0, SLIDER_MAX, wxDefaultPosition, wxSize(SLIDER_LENGTH,wxDefaultCoord));
+    bs->Add(*slider, 1, wxALIGN_CENTER_VERTICAL|wxALL, 2);
+
+    *stValue = new wxStaticText(this, wxID_ANY, wxT("0.0"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
+    bs->Add(*stValue, 1, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxALL, 2);
+
+    s->Add(bs, 0);
+}
+
+void FilterDlg::newEQControl(wxSlider** slider, wxStaticText** value, wxStaticBoxSizer *bs, wxString controlName)
+{
+    wxStaticText* label = new wxStaticText(this, wxID_ANY, controlName, wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
+    bs->Add(label, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 0);
+
+    *slider = new wxSlider(this, wxID_ANY, 0, 0, SLIDER_MAX, wxDefaultPosition, wxSize(SLIDER_LENGTH,wxDefaultCoord));
+    bs->Add(*slider, 1, wxALIGN_CENTER_VERTICAL|wxALL, 0);
+
+    *value = new wxStaticText(this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(40,-1), wxALIGN_LEFT);
+    bs->Add(*value, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxRIGHT, 5);
+}
+
+EQ FilterDlg::newEQ(wxSizer *bs, wxString eqName, float maxFreqHz, bool enableQ)
+{
+    EQ eq;
+
+    wxStaticBoxSizer *bsEQ = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, eqName), wxHORIZONTAL);
+
+    newEQControl(&eq.sliderFreq, &eq.valueFreq, bsEQ, "Freq"); 
+    eq.maxFreqHz = maxFreqHz; 
+    eq.sliderFreqId = eq.sliderFreq->GetId();
+
+    newEQControl(&eq.sliderGain, &eq.valueGain, bsEQ, "Gain");
+    if (enableQ)
+        newEQControl(&eq.sliderQ, &eq.valueQ, bsEQ, "Q");
+    else
+        eq.sliderQ = NULL;
+
+    bs->Add(bsEQ);
+
+    return eq;
+}
+
+//-------------------------------------------------------------------------
+// ExchangeData()
+//-------------------------------------------------------------------------
+void FilterDlg::ExchangeData(int inout, bool storePersistent)
+{
+    wxConfigBase *pConfig = wxConfigBase::Get();
+    if(inout == EXCHANGE_DATA_IN)
+    {
+        // LPC Post filter
+
+        m_codec2LPCPostFilterEnable->SetValue(wxGetApp().m_codec2LPCPostFilterEnable);
+        m_codec2LPCPostFilterBassBoost->SetValue(wxGetApp().m_codec2LPCPostFilterBassBoost);
+        m_beta = wxGetApp().m_codec2LPCPostFilterBeta; setBeta();
+        m_gamma = wxGetApp().m_codec2LPCPostFilterGamma; setGamma();
+
+        // Speex Pre-Processor
+
+        m_ckboxSpeexpp->SetValue(wxGetApp().m_speexpp_enable);
+
+        // Mic In Equaliser
+
+        m_MicInBass.freqHz = wxGetApp().m_MicInBassFreqHz; 
+        m_MicInBass.freqHz = limit(m_MicInBass.freqHz, 1.0, MAX_FREQ_BASS);
+        setFreq(&m_MicInBass);
+        m_MicInBass.gaindB = wxGetApp().m_MicInBassGaindB;
+        m_MicInBass.gaindB = limit(m_MicInBass.gaindB, MIN_GAIN, MAX_GAIN);
+        setGain(&m_MicInBass);
+
+        m_MicInTreble.freqHz = wxGetApp().m_MicInTrebleFreqHz;
+        m_MicInTreble.freqHz = limit(m_MicInTreble.freqHz, 1.0, MAX_FREQ_TREBLE);
+        setFreq(&m_MicInTreble);
+        m_MicInTreble.gaindB = wxGetApp().m_MicInTrebleGaindB; 
+        m_MicInTreble.gaindB = limit(m_MicInTreble.gaindB, MIN_GAIN, MAX_GAIN);
+        setGain(&m_MicInTreble);
+
+        m_MicInMid.freqHz = wxGetApp().m_MicInMidFreqHz; 
+        m_MicInMid.freqHz = limit(m_MicInMid.freqHz, 1.0, MAX_FREQ_TREBLE);
+        setFreq(&m_MicInMid);
+        m_MicInMid.gaindB = wxGetApp().m_MicInMidGaindB; 
+        m_MicInMid.gaindB = limit(m_MicInMid.gaindB, MIN_GAIN, MAX_GAIN);
+        setGain(&m_MicInMid);
+        m_MicInMid.Q = wxGetApp().m_MicInMidQ;
+        m_MicInMid.Q = limit(m_MicInMid.Q, pow(10.0,MIN_LOG10_Q), pow(10.0, MAX_LOG10_Q));
+        setQ(&m_MicInMid);
+
+        m_MicInEnable->SetValue(wxGetApp().m_MicInEQEnable);
+
+        plotMicInFilterSpectrum();
+        // Spk Out Equaliser
+
+        m_SpkOutBass.freqHz = wxGetApp().m_SpkOutBassFreqHz;
+        m_SpkOutBass.freqHz = limit(m_SpkOutBass.freqHz, 1.0, MAX_FREQ_BASS);
+        setFreq(&m_SpkOutBass);
+        m_SpkOutBass.gaindB = wxGetApp().m_SpkOutBassGaindB; 
+        m_SpkOutBass.gaindB = limit(m_SpkOutBass.gaindB, MIN_GAIN, MAX_GAIN);
+        setGain(&m_SpkOutBass);
+
+        m_SpkOutTreble.freqHz = wxGetApp().m_SpkOutTrebleFreqHz; 
+        m_SpkOutTreble.freqHz = limit(m_SpkOutTreble.freqHz, 1.0, MAX_FREQ_TREBLE);
+        setFreq(&m_SpkOutTreble);
+        m_SpkOutTreble.gaindB = wxGetApp().m_SpkOutTrebleGaindB; 
+        m_SpkOutTreble.gaindB = limit(m_SpkOutTreble.gaindB, MIN_GAIN, MAX_GAIN);
+        setGain(&m_SpkOutTreble);
+
+        m_SpkOutMid.freqHz = wxGetApp().m_SpkOutMidFreqHz;
+        m_SpkOutMid.freqHz = limit(m_SpkOutMid.freqHz, 1.0, MAX_FREQ_TREBLE);
+        setFreq(&m_SpkOutMid);
+        m_SpkOutMid.gaindB = wxGetApp().m_SpkOutMidGaindB;
+        m_SpkOutMid.gaindB = limit(m_SpkOutMid.gaindB, MIN_GAIN, MAX_GAIN);
+        setGain(&m_SpkOutMid);
+        m_SpkOutMid.Q = wxGetApp().m_SpkOutMidQ;
+        m_SpkOutMid.Q = limit(m_SpkOutMid.Q, pow(10.0,MIN_LOG10_Q), pow(10.0, MAX_LOG10_Q));
+        setQ(&m_SpkOutMid);
+
+        m_SpkOutEnable->SetValue(wxGetApp().m_SpkOutEQEnable);
+
+        plotSpkOutFilterSpectrum();
+    }
+    if(inout == EXCHANGE_DATA_OUT)
+    {
+        // LPC Post filter
+
+        wxGetApp().m_codec2LPCPostFilterEnable     = m_codec2LPCPostFilterEnable->GetValue();
+        wxGetApp().m_codec2LPCPostFilterBassBoost  = m_codec2LPCPostFilterBassBoost->GetValue();
+        wxGetApp().m_codec2LPCPostFilterBeta       = m_beta;
+        wxGetApp().m_codec2LPCPostFilterGamma      = m_gamma;
+
+        // Speex Pre-Processor
+
+        wxGetApp().m_speexpp_enable = m_ckboxSpeexpp->GetValue();
+
+        // Mic In Equaliser
+
+        wxGetApp().m_MicInBassFreqHz = m_MicInBass.freqHz;
+        wxGetApp().m_MicInBassGaindB = m_MicInBass.gaindB;
+
+        wxGetApp().m_MicInTrebleFreqHz = m_MicInTreble.freqHz;
+        wxGetApp().m_MicInTrebleGaindB = m_MicInTreble.gaindB;
+
+        wxGetApp().m_MicInMidFreqHz = m_MicInMid.freqHz;
+        wxGetApp().m_MicInMidGaindB = m_MicInMid.gaindB;
+        wxGetApp().m_MicInMidQ = m_MicInMid.Q;
+
+        // Spk Out Equaliser
+
+        wxGetApp().m_SpkOutBassFreqHz = m_SpkOutBass.freqHz;
+        wxGetApp().m_SpkOutBassGaindB = m_SpkOutBass.gaindB;
+
+        wxGetApp().m_SpkOutTrebleFreqHz = m_SpkOutTreble.freqHz;
+        wxGetApp().m_SpkOutTrebleGaindB = m_SpkOutTreble.gaindB;
+
+        wxGetApp().m_SpkOutMidFreqHz = m_SpkOutMid.freqHz;
+        wxGetApp().m_SpkOutMidGaindB = m_SpkOutMid.gaindB;
+        wxGetApp().m_SpkOutMidQ = m_SpkOutMid.Q;
+
+        if (storePersistent) {
+            pConfig->Write(wxT("/Filter/codec2LPCPostFilterEnable"),     wxGetApp().m_codec2LPCPostFilterEnable);
+            pConfig->Write(wxT("/Filter/codec2LPCPostFilterBassBoost"),  wxGetApp().m_codec2LPCPostFilterBassBoost);
+            pConfig->Write(wxT("/Filter/codec2LPCPostFilterBeta"),       (int)(m_beta*100.0));
+            pConfig->Write(wxT("/Filter/codec2LPCPostFilterGamma"),      (int)(m_gamma*100.0));
+
+            pConfig->Write(wxT("/Filter/speexpp_enable"),                wxGetApp().m_speexpp_enable);
+
+            pConfig->Write(wxT("/Filter/MicInBassFreqHz"), (int)m_MicInBass.freqHz);
+            pConfig->Write(wxT("/Filter/MicInBassGaindB"), (int)(10.0*m_MicInBass.gaindB));
+            pConfig->Write(wxT("/Filter/MicInTrebleFreqHz"), (int)m_MicInTreble.freqHz);
+            pConfig->Write(wxT("/Filter/MicInTrebleGaindB"), (int)(10.0*m_MicInTreble.gaindB));
+            pConfig->Write(wxT("/Filter/MicInMidFreqHz"), (int)m_MicInMid.freqHz);
+            pConfig->Write(wxT("/Filter/MicInMidGaindB"), (int)(10.0*m_MicInMid.gaindB));
+            pConfig->Write(wxT("/Filter/MicInMidQ"), (int)(100.0*m_MicInMid.Q));
+
+            pConfig->Write(wxT("/Filter/SpkOutBassFreqHz"), (int)m_SpkOutBass.freqHz);
+            pConfig->Write(wxT("/Filter/SpkOutBassGaindB"), (int)(10.0*m_SpkOutBass.gaindB));
+            pConfig->Write(wxT("/Filter/SpkOutTrebleFreqHz"), (int)m_SpkOutTreble.freqHz);
+            pConfig->Write(wxT("/Filter/SpkOutTrebleGaindB"), (int)(10.0*m_SpkOutTreble.gaindB));
+            pConfig->Write(wxT("/Filter/SpkOutMidQ"), (int)(100.0*m_SpkOutMid.Q));
+            pConfig->Write(wxT("/Filter/SpkOutMidFreqHz"), (int)m_SpkOutMid.freqHz);
+            pConfig->Write(wxT("/Filter/SpkOutMidGaindB"), (int)(10.0*m_SpkOutMid.gaindB));
+
+            pConfig->Flush();
+        }
+    }
+    delete wxConfigBase::Set((wxConfigBase *) NULL);
+}
+
+float FilterDlg::limit(float value, float min, float max) {
+    if (value < min) return min;
+    if (value > max) return max;
+    return value;
+}
+
+//-------------------------------------------------------------------------
+// OnCancel()
+//-------------------------------------------------------------------------
+void FilterDlg::OnCancel(wxCommandEvent& event)
+{
+    this->EndModal(wxID_CANCEL);
+}
+
+//-------------------------------------------------------------------------
+// OnDefault()
+//-------------------------------------------------------------------------
+
+void FilterDlg::OnLPCPostFilterDefault(wxCommandEvent& event)
+{
+    m_beta = CODEC2_LPC_PF_BETA; setBeta();
+    m_gamma = CODEC2_LPC_PF_GAMMA; setGamma();
+    m_codec2LPCPostFilterEnable->SetValue(true);
+    m_codec2LPCPostFilterBassBoost->SetValue(true);
+}
+
+void FilterDlg::OnMicInDefault(wxCommandEvent& event)
+{
+    m_MicInBass.freqHz = 100.0;
+    m_MicInBass.gaindB = 0.0;
+    setFreq(&m_MicInBass); setGain(&m_MicInBass); 
+
+    m_MicInTreble.freqHz = 3000.0;
+    m_MicInTreble.gaindB = 0.0;
+    setFreq(&m_MicInTreble); setGain(&m_MicInTreble); 
+
+    m_MicInMid.freqHz = 1500.0;
+    m_MicInMid.gaindB = 0.0;
+    m_MicInMid.Q = 1.0;
+    setFreq(&m_MicInMid); setGain(&m_MicInMid); setQ(&m_MicInMid); 
+
+    plotMicInFilterSpectrum();    
+}
+
+void FilterDlg::OnSpkOutDefault(wxCommandEvent& event)
+{
+    m_SpkOutBass.freqHz = 100.0;
+    m_SpkOutBass.gaindB = 0.0;
+    setFreq(&m_SpkOutBass); setGain(&m_SpkOutBass); 
+
+    m_SpkOutTreble.freqHz = 3000.0;
+    m_SpkOutTreble.gaindB = 0.0;
+    setFreq(&m_SpkOutTreble); setGain(&m_SpkOutTreble); 
+
+    m_SpkOutMid.freqHz = 1500.0;
+    m_SpkOutMid.gaindB = 0.0;
+    m_SpkOutMid.Q = 1.0;
+    setFreq(&m_SpkOutMid); setGain(&m_SpkOutMid); setQ(&m_SpkOutMid); 
+
+    plotSpkOutFilterSpectrum();    
+}
+
+//-------------------------------------------------------------------------
+// OnOK()
+//-------------------------------------------------------------------------
+void FilterDlg::OnOK(wxCommandEvent& event)
+{
+    //printf("FilterDlg::OnOK\n");
+    ExchangeData(EXCHANGE_DATA_OUT, true);
+    this->EndModal(wxID_OK);
+}
+
+//-------------------------------------------------------------------------
+// OnClose()
+//-------------------------------------------------------------------------
+void FilterDlg::OnClose(wxCloseEvent& event)
+{
+    this->EndModal(wxID_OK);
+}
+
+//-------------------------------------------------------------------------
+// OnInitDialog()
+//-------------------------------------------------------------------------
+void FilterDlg::OnInitDialog(wxInitDialogEvent& event)
+{
+    //printf("FilterDlg::OnInitDialog\n");
+    ExchangeData(EXCHANGE_DATA_IN, false);
+    //printf("m_beta: %f\n", m_beta);
+}
+
+void FilterDlg::setBeta(void) {
+    wxString buf;
+    buf.Printf(wxT("%3.2f"), m_beta);
+    m_staticTextBeta->SetLabel(buf);
+    int slider = (int)(m_beta*SLIDER_MAX + 0.5);
+    m_codec2LPCPostFilterBeta->SetValue(slider);
+}
+
+void FilterDlg::setCodec2(void) {
+    if (m_running) {
+        assert(g_pfreedv->codec2 != NULL);
+        codec2_set_lpc_post_filter(g_pfreedv->codec2, 
+                               m_codec2LPCPostFilterEnable->GetValue(), 
+                               m_codec2LPCPostFilterBassBoost->GetValue(), 
+                               m_beta, m_gamma);
+    }
+}
+
+void FilterDlg::setGamma(void) {
+    wxString buf;
+    buf.Printf(wxT("%3.2f"), m_gamma);
+    m_staticTextGamma->SetLabel(buf);
+    int slider = (int)(m_gamma*SLIDER_MAX + 0.5);
+    m_codec2LPCPostFilterGamma->SetValue(slider);
+}
+
+void FilterDlg::OnEnable(wxScrollEvent& event) {
+    setCodec2();    
+}
+
+void FilterDlg::OnBassBoost(wxScrollEvent& event) {
+    setCodec2();    
+}
+
+void FilterDlg::OnBetaScroll(wxScrollEvent& event) {
+    m_beta = (float)m_codec2LPCPostFilterBeta->GetValue()/SLIDER_MAX;
+    setBeta();
+    setCodec2();
+}
+
+void FilterDlg::OnGammaScroll(wxScrollEvent& event) {
+    m_gamma = (float)m_codec2LPCPostFilterGamma->GetValue()/SLIDER_MAX;
+    setGamma();
+    setCodec2();
+}
+
+// immediately change enable flags rather using ExchangeData() so we can switch on and off at run time
+
+void FilterDlg::OnSpeexppEnable(wxScrollEvent& event) {
+    wxGetApp().m_speexpp_enable = m_ckboxSpeexpp->GetValue();
+}
+
+void FilterDlg::OnMicInEnable(wxScrollEvent& event) {
+    wxGetApp().m_MicInEQEnable = m_MicInEnable->GetValue();
+}
+
+void FilterDlg::OnSpkOutEnable(wxScrollEvent& event) {
+    wxGetApp().m_SpkOutEQEnable = m_SpkOutEnable->GetValue();
+    //printf("wxGetApp().m_SpkOutEQEnable: %d\n", wxGetApp().m_SpkOutEQEnable);
+}
+
+void FilterDlg::setFreq(EQ *eq)
+{
+    wxString buf;
+    buf.Printf(wxT("%3.0f"), eq->freqHz);
+    eq->valueFreq->SetLabel(buf);
+    int slider = (int)((eq->freqHz/eq->maxFreqHz)*SLIDER_MAX + 0.5);
+    eq->sliderFreq->SetValue(slider);
+}
+
+void FilterDlg::sliderToFreq(EQ *eq, bool micIn)
+{
+    eq->freqHz = ((float)eq->sliderFreq->GetValue()/SLIDER_MAX)*eq->maxFreqHz;
+    if (eq->freqHz < 1.0) eq->freqHz = 1.0; // sox doesn't like 0 Hz;
+    setFreq(eq);
+    if (micIn) {
+        plotMicInFilterSpectrum();
+        adjRunTimeMicInFilter();
+    }
+    else {
+        plotSpkOutFilterSpectrum();
+        adjRunTimeSpkOutFilter();
+    }
+}
+
+void FilterDlg::setGain(EQ *eq)
+{
+    wxString buf;
+    buf.Printf(wxT("%3.1f"), eq->gaindB);
+    eq->valueGain->SetLabel(buf);
+    int slider = (int)(((eq->gaindB-MIN_GAIN)/(MAX_GAIN-MIN_GAIN))*SLIDER_MAX + 0.5);
+    eq->sliderGain->SetValue(slider);
+}
+
+void FilterDlg::sliderToGain(EQ *eq, bool micIn)
+{
+    float range = MAX_GAIN-MIN_GAIN;
+    
+    eq->gaindB = MIN_GAIN + range*((float)eq->sliderGain->GetValue()/SLIDER_MAX);
+    //printf("gaindB: %f\n", eq->gaindB);
+    setGain(eq);
+    if (micIn) {
+        plotMicInFilterSpectrum();
+        adjRunTimeMicInFilter();
+    }
+    else {
+        plotSpkOutFilterSpectrum();
+        adjRunTimeSpkOutFilter();
+    }
+        
+}
+
+void FilterDlg::setQ(EQ *eq)
+{
+    wxString buf;
+    buf.Printf(wxT("%2.1f"), eq->Q);
+    eq->valueQ->SetLabel(buf);
+
+    float log10_range = MAX_LOG10_Q - MIN_LOG10_Q;
+
+    int slider = (int)(((log10(eq->Q+1E-6)-MIN_LOG10_Q)/log10_range)*SLIDER_MAX + 0.5);
+    eq->sliderQ->SetValue(slider);
+}
+
+void FilterDlg::sliderToQ(EQ *eq, bool micIn)
+{
+    float log10_range = MAX_LOG10_Q - MIN_LOG10_Q;
+    
+    float sliderNorm = (float)eq->sliderQ->GetValue()/SLIDER_MAX;
+    float log10Q =  MIN_LOG10_Q + sliderNorm*(log10_range);
+    eq->Q = pow(10.0, log10Q);
+    //printf("log10Q: %f eq->Q: %f\n", log10Q, eq->Q);
+    setQ(eq);
+    if (micIn) {
+        plotMicInFilterSpectrum();
+        adjRunTimeMicInFilter();
+    }
+    else {
+        plotSpkOutFilterSpectrum();
+        adjRunTimeSpkOutFilter();
+    }
+}
+
+void FilterDlg::plotMicInFilterSpectrum(void) {
+    plotFilterSpectrum(&m_MicInBass, &m_MicInMid, &m_MicInTreble, m_MicInFreqRespPlot, m_MicInMagdB);
+}
+
+void FilterDlg::plotSpkOutFilterSpectrum(void) {
+    plotFilterSpectrum(&m_SpkOutBass, &m_SpkOutMid, &m_SpkOutTreble, m_SpkOutFreqRespPlot, m_SpkOutMagdB);
+}
+
+void FilterDlg::adjRunTimeMicInFilter(void) {
+    // signal an adjustment in running filter coeffs
+
+    if (m_running) {
+        ExchangeData(EXCHANGE_DATA_OUT, false);
+        *m_newMicInFilter = true;
+    }
+}
+        
+void FilterDlg::adjRunTimeSpkOutFilter(void) {
+    // signal an adjustment in running filter coeffs
+
+    if (m_running) {
+        ExchangeData(EXCHANGE_DATA_OUT, false);
+        *m_newSpkOutFilter = true;
+    }
+}
+        
+
+void FilterDlg::plotFilterSpectrum(EQ *eqBass, EQ *eqMid, EQ *eqTreble, PlotSpectrum* freqRespPlot, float *magdB) {
+    char  *argBass[10];
+    char  *argTreble[10];
+    char  *argMid[10];
+    char   argstorage[10][80];
+    float magBass[F_MAG_N];
+    float magTreble[F_MAG_N];
+    float magMid[F_MAG_N];
+    int   i;
+
+    for(i=0; i<10; i++) {
+        argBass[i] = &argstorage[i][0];
+        argTreble[i] = &argstorage[i][0];
+        argMid[i] = &argstorage[i][0];
+    }
+    sprintf(argBass[0], "bass");                
+    sprintf(argBass[1], "%f", eqBass->gaindB+1E-6);
+    sprintf(argBass[2], "%f", eqBass->freqHz);      
+
+    calcFilterSpectrum(magBass, 2, argBass);
+
+    sprintf(argTreble[0], "treble");                
+    sprintf(argTreble[1], "%f", eqTreble->gaindB+1E-6);
+    sprintf(argTreble[2], "%f", eqTreble->freqHz);      
+
+    calcFilterSpectrum(magTreble, 2, argTreble);
+
+    sprintf(argTreble[0], "equalizer");                
+    sprintf(argTreble[1], "%f", eqMid->freqHz);      
+    sprintf(argTreble[2], "%f", eqMid->Q);      
+    sprintf(argTreble[3], "%f", eqMid->gaindB+1E-6);
+
+    calcFilterSpectrum(magMid, 3, argMid);
+
+    for(i=0; i<F_MAG_N; i++)
+        magdB[i] = magBass[i] + magMid[i] + magTreble[i];
+    freqRespPlot->m_newdata = true;
+    freqRespPlot->Refresh();
+}
+
+void FilterDlg::calcFilterSpectrum(float magdB[], int argc, char *argv[]) {
+    void       *sbq;
+    short       in[NIMP];
+    short       out[NIMP];
+    COMP        X[F_MAG_N];
+    float       f, w;
+    int         i, k;
+
+    // find impulse response -----------------------------------
+
+    for(i=0; i<NIMP; i++)
+        in[i] = 0;
+    in[0] = IMP_AMP;
+
+    //printf("argv[0]: %s argv[1]: %s\n", argv[0], argv[1]);
+    sbq = sox_biquad_create(argc, (const char **)argv);
+
+    sox_biquad_filter(sbq, out, in, NIMP);
+    //for(i=0; i<NIMP; i++)
+    //    printf("%d\n", out[i]);
+   
+    sox_biquad_destroy(sbq);
+
+    //for(i=0; i<NIMP; i++)
+    //    out[i] = 0.0;
+    //out[0] = IMP_AMP;
+
+    // calculate discrete time continous frequency Fourer transform
+    // doing this from first principles rather than FFT for no good reason
+
+    for(f=0,i=0; f<MAX_F_HZ; f+=F_STEP_DFT,i++) {
+        w = M_PI*f/(FS/2);
+        X[i].real = 0.0; X[i].imag = 0.0;
+        for(k=0; k<NIMP; k++) {
+            X[i].real += ((float)out[k]/IMP_AMP) * cos(w*k);
+            X[i].imag -= ((float)out[k]/IMP_AMP) * sin(w*k);
+        }
+        magdB[i] = 10.0*log10(X[i].real* X[i].real + X[i].imag*X[i].imag + 1E-12);
+        //printf("f: %f X[%d] = %f %f magdB = %f\n", f, i, X[i].real, X[i].imag,  magdB[i]);
+    }
+}
diff --git a/freedv/branches/0.99/src/dlg_filter.h b/freedv/branches/0.99/src/dlg_filter.h
new file mode 100644 (file)
index 0000000..82c43df
--- /dev/null
@@ -0,0 +1,166 @@
+//==========================================================================
+// Name:            dlg_filter.h
+// Purpose:         Dialog for controlling Codec audio filtering
+// Created:         Nov 25 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+
+#ifndef __FILTER_DIALOG__
+#define __FILTER_DIALOG__
+
+#include "fdmdv2_main.h"
+
+enum {disableQ = false, enableQ = true};
+
+typedef struct { 
+    wxSlider     *sliderFreq;
+    wxStaticText *valueFreq;
+    wxSlider     *sliderGain;
+    wxStaticText *valueGain;
+    wxSlider     *sliderQ;
+    wxStaticText *valueQ;
+
+    int       sliderFreqId;
+    int       sliderGainId;
+    int       sliderQId;
+    
+    float     freqHz;
+    float     gaindB;
+    float     Q;
+
+    float     maxFreqHz;
+} EQ;
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class FilterDlg
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class FilterDlg : public wxDialog
+{
+    public:
+    FilterDlg( wxWindow* parent, bool running, bool *newMicInFilter, bool *newSpkOutFilter,
+               wxWindowID id = wxID_ANY, const wxString& title = _("Filter"), 
+               const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 800, 630 ), 
+               long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
+        ~FilterDlg();
+
+        void    ExchangeData(int inout, bool storePersistent);
+
+    protected:
+        // Handlers for events.
+        void    OnCancel(wxCommandEvent& event);
+        void    OnOK(wxCommandEvent& event);
+        void    OnClose(wxCloseEvent& event);
+        void    OnInitDialog(wxInitDialogEvent& event);
+        void    OnLPCPostFilterDefault(wxCommandEvent& event);
+
+        void    OnBetaScroll(wxScrollEvent& event);
+        void    OnGammaScroll(wxScrollEvent& event);
+        void    OnEnable(wxScrollEvent& event);
+        void    OnBassBoost(wxScrollEvent& event);
+
+        void    OnSpeexppEnable(wxScrollEvent& event);
+
+        void    OnMicInBassFreqScroll(wxScrollEvent& event) { sliderToFreq(&m_MicInBass, true); }
+        void    OnMicInBassGainScroll(wxScrollEvent& event) { sliderToGain(&m_MicInBass, true); }
+        void    OnMicInTrebleFreqScroll(wxScrollEvent& event) { sliderToFreq(&m_MicInTreble, true); }
+        void    OnMicInTrebleGainScroll(wxScrollEvent& event) { sliderToGain(&m_MicInTreble, true); }
+        void    OnMicInMidFreqScroll(wxScrollEvent& event) { sliderToFreq(&m_MicInMid, true); }
+        void    OnMicInMidGainScroll(wxScrollEvent& event) { sliderToGain(&m_MicInMid, true); }
+        void    OnMicInMidQScroll(wxScrollEvent& event) { sliderToQ(&m_MicInMid, true); }
+        void    OnMicInEnable(wxScrollEvent& event);
+        void    OnMicInDefault(wxCommandEvent& event);
+
+        void    OnSpkOutBassFreqScroll(wxScrollEvent& event) { sliderToFreq(&m_SpkOutBass, false); }
+        void    OnSpkOutBassGainScroll(wxScrollEvent& event) { sliderToGain(&m_SpkOutBass, false); }
+        void    OnSpkOutTrebleFreqScroll(wxScrollEvent& event) { sliderToFreq(&m_SpkOutTreble, false); }
+        void    OnSpkOutTrebleGainScroll(wxScrollEvent& event) { sliderToGain(&m_SpkOutTreble, false); }
+        void    OnSpkOutMidFreqScroll(wxScrollEvent& event) { sliderToFreq(&m_SpkOutMid, false); }
+        void    OnSpkOutMidGainScroll(wxScrollEvent& event) { sliderToGain(&m_SpkOutMid, false); }
+        void    OnSpkOutMidQScroll(wxScrollEvent& event) { sliderToQ(&m_SpkOutMid, false); }
+        void    OnSpkOutEnable(wxScrollEvent& event);
+        void    OnSpkOutDefault(wxCommandEvent& event);
+
+        wxStaticText* m_staticText8;
+        wxCheckBox*   m_codec2LPCPostFilterEnable;
+        wxStaticText* m_staticText9;
+        wxCheckBox*   m_codec2LPCPostFilterBassBoost;
+        wxStaticText* m_staticText91;
+        wxSlider*     m_codec2LPCPostFilterBeta;
+        wxStaticText* m_staticTextBeta;
+        wxStaticText* m_staticText911;
+        wxSlider*     m_codec2LPCPostFilterGamma;
+        wxStaticText* m_staticTextGamma;
+        wxButton*     m_LPCPostFilterDefault;
+
+        wxCheckBox*   m_ckboxSpeexpp;
+
+        wxStdDialogButtonSizer* m_sdbSizer5;
+        wxButton*     m_sdbSizer5OK;
+        wxButton*     m_sdbSizer5Cancel;
+        PlotSpectrum* m_MicInFreqRespPlot;
+        PlotSpectrum* m_SpkOutFreqRespPlot;
+        
+        wxCheckBox*   m_MicInEnable;
+        wxButton*     m_MicInDefault;
+        wxCheckBox*   m_SpkOutEnable;
+        wxButton*     m_SpkOutDefault;
+
+        float        *m_MicInMagdB;
+        float        *m_SpkOutMagdB;
+
+     private:
+        bool          m_running;
+        float         m_beta;
+        float         m_gamma;
+
+        void          setBeta(void);  // sets slider and static text from m_beta
+        void          setGamma(void); // sets slider and static text from m_gamma
+        void          setCodec2(void);
+        void          newEQControl(wxSlider** slider, wxStaticText** value, wxStaticBoxSizer *bs, wxString controlName);
+        EQ            newEQ(wxSizer *bs, wxString eqName, float maxFreqHz, bool enableQ);
+        void          newLPCPFControl(wxSlider **slider, wxStaticText **stValue, wxSizer *sbs, wxString controlName);
+        wxAuiNotebook *m_auiNotebook;
+        void          setFreq(EQ *eq);
+        void          setGain(EQ *eq);
+        void          setQ(EQ *eq);
+        void          sliderToFreq(EQ *eq, bool micIn);
+        void          sliderToGain(EQ *eq, bool micIn);
+        void          sliderToQ(EQ *eq, bool micIn);
+        void          plotFilterSpectrum(EQ *eqBass, EQ *eqMid, EQ* eqTreble, PlotSpectrum* freqRespPlot, float *magdB);
+        void          calcFilterSpectrum(float magdB[], int arc, char *argv[]);
+        void          plotMicInFilterSpectrum(void);
+        void          plotSpkOutFilterSpectrum(void);
+        void          adjRunTimeMicInFilter(void);
+        void          adjRunTimeSpkOutFilter(void);
+
+        EQ            m_MicInBass;
+        EQ            m_MicInMid;
+        EQ            m_MicInTreble;
+
+        EQ            m_SpkOutBass;
+        EQ            m_SpkOutMid;
+        EQ            m_SpkOutTreble;
+
+        float         limit(float value, float min, float max);
+        bool          *m_newMicInFilter;
+        bool          *m_newSpkOutFilter;
+
+};
+
+#endif // __FILTER_DIALOG__
diff --git a/freedv/branches/0.99/src/dlg_options.cpp b/freedv/branches/0.99/src/dlg_options.cpp
new file mode 100644 (file)
index 0000000..9189feb
--- /dev/null
@@ -0,0 +1,363 @@
+//==========================================================================
+// Name:            dlg_options.cpp
+// Purpose:         Dialog for controlling misc FreeDV options
+// Date:            May 24 2013
+// 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+
+#include "dlg_options.h"
+extern bool g_modal;
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class OptionsDlg
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+OptionsDlg::OptionsDlg(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* bSizer30;
+    bSizer30 = new wxBoxSizer(wxVERTICAL);
+
+    //------------------------------
+    // Test Frames check box
+    //------------------------------
+
+    wxStaticBoxSizer* sbSizer_testFrames;
+    wxStaticBox *sb_testFrames = new wxStaticBox(this, wxID_ANY, _("Test Frames"));
+    sbSizer_testFrames = new wxStaticBoxSizer(sb_testFrames, wxHORIZONTAL);
+
+    m_ckboxTestFrame = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
+    m_ckboxTestFrame->SetToolTip(_("Send frames of known bits instead of compressed voice"));
+    sbSizer_testFrames->Add(m_ckboxTestFrame, 0, wxALIGN_LEFT, 0);
+
+    m_ckboxChannelNoise = new wxCheckBox(this, wxID_ANY, _("Channel Noise"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
+    m_ckboxChannelNoise->SetToolTip(_("Add simulated AWGN channel noise to received signal"));
+    sbSizer_testFrames->Add(m_ckboxChannelNoise, 0, wxALIGN_LEFT, 0);
+
+    bSizer30->Add(sbSizer_testFrames,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
+
+    //------------------------------
+    // FreeDV 700 Options
+    //------------------------------
+
+    wxStaticBoxSizer* sbSizer_freedv700;
+    wxStaticBox *sb_freedv700 = new wxStaticBox(this, wxID_ANY, _("FreeDV 700 Clipping"));
+    sbSizer_freedv700 = new wxStaticBoxSizer(sb_freedv700, wxHORIZONTAL);
+
+    m_ckboxFreeDV700txClip = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
+    m_ckboxFreeDV700txClip->SetToolTip(_("Clip FreeDv 700 tx waveform to reduce Peak to Average Power Ratio (PAPR)"));
+    sbSizer_freedv700->Add(m_ckboxFreeDV700txClip, 0, wxALIGN_LEFT, 0);
+
+    bSizer30->Add(sbSizer_freedv700,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
+
+    //------------------------------
+    // Txt Msg Text Box
+    //------------------------------
+
+    wxStaticBoxSizer* sbSizer_callSign;
+    wxStaticBox *sb_textMsg = new wxStaticBox(this, wxID_ANY, _("Txt Msg"));
+    sbSizer_callSign = new wxStaticBoxSizer(sb_textMsg, wxVERTICAL);
+
+    m_txtCtrlCallSign = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
+    m_txtCtrlCallSign->SetToolTip(_("Txt Msg you can send along with Voice"));
+    sbSizer_callSign->Add(m_txtCtrlCallSign, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3);
+
+    bSizer30->Add(sbSizer_callSign,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
+    //------------------------------
+    // Txt Encoding 
+    //------------------------------
+
+    wxStaticBoxSizer* sbSizer_encoding = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Text Encoding")), wxHORIZONTAL);
+
+#ifdef SHORT_VARICODE
+    m_rb_textEncoding1 = new wxRadioButton( this, wxID_ANY, wxT("Long varicode"), wxDefaultPosition, wxDefaultSize, 0);
+    m_rb_textEncoding1->SetValue(true);
+    sbSizer_encoding->Add(m_rb_textEncoding1, 0, wxALIGN_LEFT|wxALL, 1);
+    m_rb_textEncoding2 = new wxRadioButton( this, wxID_ANY, wxT("Short Varicode"), wxDefaultPosition, wxDefaultSize, 0);
+    sbSizer_encoding->Add(m_rb_textEncoding2, 0, wxALIGN_LEFT|wxALL, 1);
+#endif
+
+    m_ckboxEnableChecksum = new wxCheckBox(this, wxID_ANY, _("Use Checksum on Rx"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
+    sbSizer_encoding->Add(m_ckboxEnableChecksum, 0, wxALIGN_LEFT, 0);
+
+    bSizer30->Add(sbSizer_encoding,0, wxALL|wxEXPAND, 3);
+    //------------------------------
+    // Event processing
+    //------------------------------
+
+    wxStaticBoxSizer* sbSizer_events;
+    wxStaticBox *sb_events = new wxStaticBox(this, wxID_ANY, _("Event Processing"));
+    sbSizer_events = new wxStaticBoxSizer(sb_events, wxVERTICAL);
+
+    // event processing enable and spam timer
+
+    wxStaticBoxSizer* sbSizer_events_top;
+    wxStaticBox* sb_events1 = new wxStaticBox(this, wxID_ANY, _(""));    
+    sbSizer_events_top = new wxStaticBoxSizer(sb_events1, wxHORIZONTAL);
+
+    m_ckbox_events = new wxCheckBox(this, wxID_ANY, _("Enable System Calls    Syscall Spam Timer"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
+    sb_events->SetToolTip(_("Enable processing of events and generation of system calls"));
+    sbSizer_events_top->Add(m_ckbox_events, 0, 0, 5);
+    m_txt_spam_timer = new wxTextCtrl(this, wxID_ANY,  wxEmptyString, wxDefaultPosition, wxSize(40,-1), 0, wxTextValidator(wxFILTER_DIGITS));
+    m_txt_spam_timer->SetToolTip(_("Many matching events can cause a flood of syscalls. Set minimum time (seconds) between syscalls for each event here"));
+    sbSizer_events_top->Add(m_txt_spam_timer, 0, 0, 5);
+    m_rb_spam_timer = new wxRadioButton( this, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
+    m_rb_spam_timer->SetForegroundColour( wxColour(0, 255, 0 ) );
+    sbSizer_events_top->Add(m_rb_spam_timer, 0, 0, 10);
+    sbSizer_events->Add(sbSizer_events_top, 0, 0, 5);
+
+    // list of regexps
+
+    wxStaticBoxSizer* sbSizer_regexp = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Regular Expressions to Process Events")), wxHORIZONTAL);
+    m_txt_events_regexp_match = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(200,100), wxTE_MULTILINE);
+    m_txt_events_regexp_match->SetToolTip(_("Enter regular expressions to match events"));
+    sbSizer_regexp->Add(m_txt_events_regexp_match, 1, wxEXPAND, 5);
+    m_txt_events_regexp_replace = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(200,100), wxTE_MULTILINE);
+    m_txt_events_regexp_replace->SetToolTip(_("Enter regular expressions to replace events"));
+    sbSizer_regexp->Add(m_txt_events_regexp_replace, 1, wxEXPAND, 5);
+    sbSizer_events->Add(sbSizer_regexp, 1, wxEXPAND, 5);
+
+    // log of events and responses
+
+    wxStaticBoxSizer* sbSizer_event_log = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Log of Events and Responses")), wxVERTICAL);
+    wxBoxSizer* bSizer33 = new wxBoxSizer(wxHORIZONTAL);
+    m_txt_events_in = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(200,50), wxTE_MULTILINE | wxTE_READONLY);
+    bSizer33->Add(m_txt_events_in, 1, wxEXPAND, 5);
+    m_txt_events_out = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(200,50), wxTE_MULTILINE | wxTE_READONLY);
+    bSizer33->Add(m_txt_events_out, 1, wxEXPAND, 5);
+    sbSizer_event_log->Add(bSizer33, 1, wxEXPAND, 5);
+    sbSizer_events->Add(sbSizer_event_log, 1, wxEXPAND, 5);
+
+    bSizer30->Add(sbSizer_events,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
+
+    //------------------------------
+    // UDP control port
+    //------------------------------
+
+    wxStaticBoxSizer* sbSizer_udp;
+    wxStaticBox* sb_udp = new wxStaticBox(this, wxID_ANY, _("UDP Control Port"));
+    sbSizer_udp = new wxStaticBoxSizer(sb_udp, wxHORIZONTAL);
+    m_ckbox_udp_enable = new wxCheckBox(this, wxID_ANY, _("Enable UDP Control Port    UDP Port Number:"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
+    sb_udp->SetToolTip(_("Enable control of FreeDV via UDP port"));
+    sbSizer_udp->Add(m_ckbox_udp_enable, 0,  wxALIGN_CENTER_HORIZONTAL, 5);
+    m_txt_udp_port = new wxTextCtrl(this, wxID_ANY,  wxEmptyString, wxDefaultPosition, wxSize(50,-1), 0, wxTextValidator(wxFILTER_DIGITS));
+    sbSizer_udp->Add(m_txt_udp_port, 0, wxALIGN_CENTER_HORIZONTAL, 5);
+
+    bSizer30->Add(sbSizer_udp,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
+
+    //------------------------------
+    // OK - Cancel - Apply Buttons 
+    //------------------------------
+
+    wxBoxSizer* bSizer31 = new wxBoxSizer(wxHORIZONTAL);
+
+    m_sdbSizer5OK = new wxButton(this, wxID_OK);
+    bSizer31->Add(m_sdbSizer5OK, 0, wxALL, 2);
+
+    m_sdbSizer5Cancel = new wxButton(this, wxID_CANCEL);
+    bSizer31->Add(m_sdbSizer5Cancel, 0, wxALL, 2);
+
+    m_sdbSizer5Apply = new wxButton(this, wxID_APPLY);
+    bSizer31->Add(m_sdbSizer5Apply, 0, wxALL, 2);
+
+    bSizer30->Add(bSizer31, 0, wxALIGN_RIGHT|wxALL, 0);
+
+    this->SetSizer(bSizer30);
+    this->Layout();
+
+    this->Centre(wxBOTH);
+    // Connect Events -------------------------------------------------------
+
+    this->Connect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(OptionsDlg::OnInitDialog));
+
+    m_sdbSizer5OK->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsDlg::OnOK), NULL, this);
+    m_sdbSizer5Cancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsDlg::OnCancel), NULL, this);
+    m_sdbSizer5Apply->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsDlg::OnApply), NULL, this);
+
+    m_ckboxFreeDV700txClip->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(OptionsDlg::OnFreeDV700txClip), NULL, this);
+
+    event_in_serial = 0;
+    event_out_serial = 0;
+}
+
+//-------------------------------------------------------------------------
+// ~OptionsDlg()
+//-------------------------------------------------------------------------
+OptionsDlg::~OptionsDlg()
+{
+
+    // Disconnect Events
+
+    this->Disconnect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(OptionsDlg::OnInitDialog));
+
+    m_sdbSizer5OK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsDlg::OnOK), NULL, this);
+    m_sdbSizer5Cancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsDlg::OnCancel), NULL, this);
+    m_sdbSizer5Apply->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsDlg::OnApply), NULL, this);
+    m_ckboxFreeDV700txClip->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(OptionsDlg::OnFreeDV700txClip), NULL, this);
+}
+
+
+//-------------------------------------------------------------------------
+// ExchangeData()
+//-------------------------------------------------------------------------
+void OptionsDlg::ExchangeData(int inout, bool storePersistent)
+{
+    wxConfigBase *pConfig = wxConfigBase::Get();
+
+    if(inout == EXCHANGE_DATA_IN)
+    {
+        m_txtCtrlCallSign->SetValue(wxGetApp().m_callSign);
+        m_ckboxTestFrame->SetValue(wxGetApp().m_testFrames);
+        m_ckboxChannelNoise->SetValue(wxGetApp().m_channel_noise);
+
+        m_ckbox_events->SetValue(wxGetApp().m_events);
+        m_txt_spam_timer->SetValue(wxString::Format(wxT("%i"),wxGetApp().m_events_spam_timer));
+
+        m_txt_events_regexp_match->SetValue(wxGetApp().m_events_regexp_match);
+        m_txt_events_regexp_replace->SetValue(wxGetApp().m_events_regexp_replace);
+        
+        m_ckbox_udp_enable->SetValue(wxGetApp().m_udp_enable);
+        m_txt_udp_port->SetValue(wxString::Format(wxT("%i"),wxGetApp().m_udp_port));
+
+#ifdef SHORT_VARICODE
+        if (wxGetApp().m_textEncoding == 1)
+            m_rb_textEncoding1->SetValue(true);
+        if (wxGetApp().m_textEncoding == 2)
+            m_rb_textEncoding2->SetValue(true);
+#endif
+        m_ckboxEnableChecksum->SetValue(wxGetApp().m_enable_checksum);
+
+        m_ckboxFreeDV700txClip->SetValue(wxGetApp().m_FreeDV700txClip);
+    }
+
+    if(inout == EXCHANGE_DATA_OUT)
+    {
+        wxGetApp().m_callSign      = m_txtCtrlCallSign->GetValue();
+        wxGetApp().m_testFrames    = m_ckboxTestFrame->GetValue();
+        wxGetApp().m_channel_noise = m_ckboxChannelNoise->GetValue();
+
+        wxGetApp().m_events        = m_ckbox_events->GetValue();
+        long spam_timer;
+        m_txt_spam_timer->GetValue().ToLong(&spam_timer);
+        wxGetApp().m_events_spam_timer = (int)spam_timer;
+
+        // make sure regexp lists are terminated by a \n
+
+        if (m_txt_events_regexp_match->GetValue().Last() != '\n') {
+            m_txt_events_regexp_match->SetValue(m_txt_events_regexp_match->GetValue()+'\n');
+        }
+        if (m_txt_events_regexp_replace->GetValue().Last() != '\n') {
+            m_txt_events_regexp_replace->SetValue(m_txt_events_regexp_replace->GetValue()+'\n');
+        }
+        wxGetApp().m_events_regexp_match = m_txt_events_regexp_match->GetValue();
+        wxGetApp().m_events_regexp_replace = m_txt_events_regexp_replace->GetValue();
+        wxGetApp().m_udp_enable     = m_ckbox_udp_enable->GetValue();
+        long port;
+        m_txt_udp_port->GetValue().ToLong(&port);
+        wxGetApp().m_udp_port       = (int)port;
+
+#ifdef SHORT_VARICODE
+        if (m_rb_textEncoding1->GetValue())
+            wxGetApp().m_textEncoding = 1;
+        if (m_rb_textEncoding2->GetValue())
+            wxGetApp().m_textEncoding = 2;
+#endif
+        wxGetApp().m_enable_checksum = m_ckboxEnableChecksum->GetValue();
+
+        wxGetApp().m_FreeDV700txClip = m_ckboxFreeDV700txClip->GetValue();
+
+        if (storePersistent) {
+            pConfig->Write(wxT("/Data/CallSign"), wxGetApp().m_callSign);
+#ifdef SHORT_VARICODE
+            pConfig->Write(wxT("/Data/TextEncoding"), wxGetApp().m_textEncoding);
+#endif
+            pConfig->Write(wxT("/Data/EnableChecksumOnMsgRx"), wxGetApp().m_enable_checksum);
+
+            pConfig->Write(wxT("/Events/enable"), wxGetApp().m_events);
+            pConfig->Write(wxT("/Events/spam_timer"), wxGetApp().m_events_spam_timer);
+            pConfig->Write(wxT("/Events/regexp_match"), wxGetApp().m_events_regexp_match);
+            pConfig->Write(wxT("/Events/regexp_replace"), wxGetApp().m_events_regexp_replace);
+            
+            pConfig->Write(wxT("/UDP/enable"), wxGetApp().m_udp_enable);
+            pConfig->Write(wxT("/UDP/port"),  wxGetApp().m_udp_port);
+
+            pConfig->Write(wxT("/FreeDV700/txClip"), wxGetApp().m_FreeDV700txClip);
+
+            pConfig->Flush();
+        }
+    }
+    delete wxConfigBase::Set((wxConfigBase *) NULL);
+}
+
+//-------------------------------------------------------------------------
+// OnOK()
+//-------------------------------------------------------------------------
+void OptionsDlg::OnOK(wxCommandEvent& event)
+{
+    ExchangeData(EXCHANGE_DATA_OUT, true);
+    //this->EndModal(wxID_OK);
+    g_modal = false;
+    this->Show(false);
+}
+
+//-------------------------------------------------------------------------
+// OnCancel()
+//-------------------------------------------------------------------------
+void OptionsDlg::OnCancel(wxCommandEvent& event)
+{
+    //this->EndModal(wxID_CANCEL);
+    g_modal = false;
+    this->Show(false);
+}
+
+//-------------------------------------------------------------------------
+// OnApply()
+//-------------------------------------------------------------------------
+void OptionsDlg::OnApply(wxCommandEvent& event)
+{
+    ExchangeData(EXCHANGE_DATA_OUT, true);
+}
+
+//-------------------------------------------------------------------------
+// OnInitDialog()
+//-------------------------------------------------------------------------
+void OptionsDlg::OnInitDialog(wxInitDialogEvent& event)
+{
+    ExchangeData(EXCHANGE_DATA_IN, false);
+}
+
+// immediately change flags rather using ExchangeData() so we can switch on and off at run time
+
+void OptionsDlg::OnFreeDV700txClip(wxScrollEvent& event) {
+    wxGetApp().m_FreeDV700txClip = m_ckboxFreeDV700txClip->GetValue();
+}
+
+
+void OptionsDlg::updateEventLog(wxString event_in, wxString event_out) {
+    wxString event_in_with_serial, event_out_with_serial; 
+    event_in_with_serial.Printf(_T("[%d] %s"), event_in_serial++, event_in);
+    event_out_with_serial.Printf(_T("[%d] %s"), event_out_serial++, event_out);
+
+    m_txt_events_in->AppendText(event_in_with_serial+"\n");
+    m_txt_events_out->AppendText(event_out_with_serial+"\n");
+}
+
diff --git a/freedv/branches/0.99/src/dlg_options.h b/freedv/branches/0.99/src/dlg_options.h
new file mode 100644 (file)
index 0000000..fe355ac
--- /dev/null
@@ -0,0 +1,99 @@
+//==========================================================================
+// Name:            dlg_options.h
+// Purpose:         Dialog for controlling misc FreeDV options
+// Created:         Nov 25 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+
+#ifndef __OPTIONS_DIALOG__
+#define __OPTIONS_DIALOG__
+
+#include "fdmdv2_main.h"
+#include "fdmdv2_defines.h"
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class OptionsDlg
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class OptionsDlg : public wxDialog
+{
+    public:
+    OptionsDlg( wxWindow* parent,
+               wxWindowID id = wxID_ANY, const wxString& title = _("Options"), 
+                const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(600,630), 
+               long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
+        ~OptionsDlg();
+
+        void    ExchangeData(int inout, bool storePersistent);
+        void    updateEventLog(wxString event_in, wxString event_out);
+
+        bool    enableEventsChecked() {return m_ckbox_events->GetValue();}
+
+        void SetSpamTimerLight(bool state) {
+
+            // Colours don't work on Windows
+
+            if (state) {
+                m_rb_spam_timer->SetForegroundColour( wxColour( 255,0 , 0 ) ); // red
+                m_rb_spam_timer->SetValue(true);
+            }
+            else {
+                m_rb_spam_timer->SetForegroundColour( wxColour( 0, 255, 0 ) ); // green
+                m_rb_spam_timer->SetValue(false);
+            }
+        }
+
+
+    protected:
+        // Handlers for events.
+        void    OnOK(wxCommandEvent& event);
+        void    OnCancel(wxCommandEvent& event);
+        void    OnApply(wxCommandEvent& event);
+        void    OnClose(wxCloseEvent& event);
+        void    OnInitDialog(wxInitDialogEvent& event);
+        void    OnFreeDV700txClip(wxScrollEvent& event);
+
+        wxTextCtrl   *m_txtCtrlCallSign; // TODO: this should be renamed to tx_txtmsg, and rename all related incl persis strge
+        wxCheckBox   *m_ckboxTestFrame;
+        wxCheckBox   *m_ckboxChannelNoise;
+        wxCheckBox   *m_ckboxFreeDV700txClip;
+
+        wxRadioButton *m_rb_textEncoding1;
+        wxRadioButton *m_rb_textEncoding2;
+        wxCheckBox    *m_ckboxEnableChecksum;
+
+        wxCheckBox   *m_ckbox_events;
+        wxTextCtrl   *m_txt_events_regexp_match;
+        wxTextCtrl   *m_txt_events_regexp_replace;
+        wxTextCtrl   *m_txt_events_in;
+        wxTextCtrl   *m_txt_events_out;
+        wxTextCtrl   *m_txt_spam_timer;
+        wxRadioButton *m_rb_spam_timer;
+
+        wxCheckBox   *m_ckbox_udp_enable;
+        wxTextCtrl   *m_txt_udp_port;
+
+        wxButton*     m_sdbSizer5OK;
+        wxButton*     m_sdbSizer5Cancel;
+        wxButton*     m_sdbSizer5Apply;
+
+        unsigned int  event_in_serial, event_out_serial;
+
+     private:
+};
+
+#endif // __OPTIONS_DIALOG__
diff --git a/freedv/branches/0.99/src/dlg_ptt.cpp b/freedv/branches/0.99/src/dlg_ptt.cpp
new file mode 100644 (file)
index 0000000..2643c1d
--- /dev/null
@@ -0,0 +1,416 @@
+//==========================================================================
+// Name:            dlg_ptt.cpp
+// Purpose:         Subclasses dialog GUI for PTT Config. Creates simple 
+//                  wxWidgets dialog GUI to select real/virtual Comm ports.
+// Date:            May 11 2012
+// Authors:         David Rowe, David Witten, Joel Stanley
+// 
+// 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#include "dlg_ptt.h"
+#include "fdmdv2_main.h"
+
+#ifdef __WIN32__
+#include <wx/msw/registry.h>
+#endif
+#ifdef __FreeBSD__
+#include <glob.h>
+#include <string.h>
+#endif
+
+#include <sstream>
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class ComPortsDlg
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+ComPortsDlg::ComPortsDlg(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style)
+{
+    wxBoxSizer* mainSizer = new wxBoxSizer(wxVERTICAL);
+    this->SetSizer(mainSizer);
+    
+    //----------------------------------------------------------------------
+    // Half Duplex Flag for VOX PTT
+    //----------------------------------------------------------------------
+
+    // DR: should this be on options dialog?
+
+    wxStaticBoxSizer* staticBoxSizer28 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("VOX PTT Settings")), wxHORIZONTAL);
+    m_ckHalfDuplex = new wxCheckBox(this, wxID_ANY, _("Half Duplex"), wxDefaultPosition, wxSize(-1,-1), 0);
+    staticBoxSizer28->Add(m_ckHalfDuplex, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
+    m_ckLeftChannelVoxTone = new wxCheckBox(this, wxID_ANY, _("Left Channel Vox Tone"), wxDefaultPosition, wxSize(-1,-1), 0);
+    staticBoxSizer28->Add(m_ckLeftChannelVoxTone, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
+
+    mainSizer->Add(staticBoxSizer28, 0, wxEXPAND, 5);
+
+    //----------------------------------------------------------------------
+    // Hamlib for CAT PTT
+    //----------------------------------------------------------------------
+
+    wxStaticBoxSizer* staticBoxSizer18 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("Hamlib Settings")), wxVERTICAL);
+
+    wxBoxSizer* gridSizer100 = new wxBoxSizer(wxHORIZONTAL);
+
+    /* Use Hamlib for PTT checkbox. */
+    m_ckUseHamlibPTT = new wxCheckBox(this, wxID_ANY, _("Use Hamlib PTT"), wxDefaultPosition, wxSize(-1, -1), 0);
+    m_ckUseHamlibPTT->SetValue(false);
+    gridSizer100->Add(m_ckUseHamlibPTT, 0, wxALIGN_CENTER_VERTICAL, 0);
+
+    /* Hamlib Rig Type combobox. */
+    gridSizer100->Add(new wxStaticText(this, wxID_ANY, _("Rig Model:"), wxDefaultPosition, wxDefaultSize, 0), 
+                      0, wxALIGN_CENTER_VERTICAL | wxLEFT, 20);
+    m_cbRigName = new wxComboBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(250, -1), 0, NULL, wxCB_DROPDOWN);
+    /* TODO(Joel): this is a hack. At the least, need to gurantee that m_hamLib
+     * exists. */
+    wxGetApp().m_hamlib->populateComboBox(m_cbRigName);
+    m_cbRigName->SetSelection(wxGetApp().m_intHamlibRig);
+    gridSizer100->Add(m_cbRigName, 0, wxALIGN_CENTER_VERTICAL, 0);
+
+    /* Hamlib Serial Port combobox. */
+    gridSizer100->Add(new wxStaticText(this, wxID_ANY, _("Serial Device:"), wxDefaultPosition, wxDefaultSize, 0), 
+                      0, wxALIGN_CENTER_VERTICAL | wxLEFT, 20);
+    m_cbSerialPort = new wxComboBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(140, -1), 0, NULL, wxCB_DROPDOWN);
+    gridSizer100->Add(m_cbSerialPort, 0, wxALIGN_CENTER_VERTICAL, 0);
+
+    staticBoxSizer18->Add(gridSizer100, 1);
+    mainSizer->Add(staticBoxSizer18, 1);
+
+    //----------------------------------------------------------------------
+    // Serial port PTT
+    //----------------------------------------------------------------------
+
+    wxStaticBoxSizer* staticBoxSizer17 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("Serial Port Settings")), wxVERTICAL);
+    mainSizer->Add(staticBoxSizer17, 1, wxEXPAND, 5);
+    wxStaticBoxSizer* staticBoxSizer31 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("PTT Port")), wxVERTICAL);
+    staticBoxSizer17->Add(staticBoxSizer31, 1, wxEXPAND, 5);
+
+#ifdef __WXMSW__
+    m_ckUseSerialPTT = new wxCheckBox(this, wxID_ANY, _("Use Serial Port PTT"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_ckUseSerialPTT->SetValue(false);
+    staticBoxSizer31->Add(m_ckUseSerialPTT, 0, wxALIGN_LEFT, 20);
+
+    wxArrayString m_listCtrlPortsArr;
+    m_listCtrlPorts = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxSize(-1,45), m_listCtrlPortsArr, wxLB_SINGLE | wxLB_SORT);
+    staticBoxSizer31->Add(m_listCtrlPorts, 1, wxALIGN_CENTER, 0);
+#endif
+
+#ifdef __WXGTK__
+    wxBoxSizer* bSizer83;
+    bSizer83 = new wxBoxSizer(wxHORIZONTAL);
+
+    wxGridSizer* gridSizer200 = new wxGridSizer(1, 3, 0, 0);
+    
+    m_ckUseSerialPTT = new wxCheckBox(this, wxID_ANY, _("Use Serial Port PTT"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_ckUseSerialPTT->SetValue(false);
+    gridSizer200->Add(m_ckUseSerialPTT, 1, wxALIGN_CENTER|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 2);
+
+    m_staticText12 = new wxStaticText(this, wxID_ANY, _("Serial Device:  "), wxDefaultPosition, wxDefaultSize, 0);
+    m_staticText12->Wrap(-1);
+    gridSizer200->Add(m_staticText12, 1,wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 2);
+
+    m_cbCtlDevicePath = new wxComboBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(140, -1), 0, NULL, wxCB_DROPDOWN);
+    gridSizer200->Add(m_cbCtlDevicePath, 1, wxEXPAND|wxALIGN_CENTER|wxALIGN_RIGHT, 2);
+    
+    bSizer83->Add(gridSizer200, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT | wxALL, 2);
+    staticBoxSizer31->Add(bSizer83, 1, wxALIGN_CENTER_VERTICAL|wxALL, 1);
+#endif
+
+    wxBoxSizer* boxSizer19 = new wxBoxSizer(wxVERTICAL);
+    staticBoxSizer17->Add(boxSizer19, 1, wxEXPAND, 5);
+    wxStaticBoxSizer* staticBoxSizer16 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("Signal polarity")), wxHORIZONTAL);
+    boxSizer19->Add(staticBoxSizer16, 1, wxEXPAND|wxALIGN_CENTER|wxALIGN_RIGHT, 5);
+
+    wxGridSizer* gridSizer17 = new wxGridSizer(2, 2, 0, 0);
+    staticBoxSizer16->Add(gridSizer17, 1, wxEXPAND|wxALIGN_RIGHT, 5);
+
+    m_rbUseDTR = new wxRadioButton(this, wxID_ANY, _("Use DTR"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_rbUseDTR->SetToolTip(_("Toggle DTR line for PTT"));
+    m_rbUseDTR->SetValue(1);
+    gridSizer17->Add(m_rbUseDTR, 0, wxALIGN_CENTER|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5);
+
+    m_ckDTRPos = new wxCheckBox(this, wxID_ANY, _("DTR = +V"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_ckDTRPos->SetToolTip(_("Set Polarity of the DTR line"));
+    m_ckDTRPos->SetValue(false);
+    gridSizer17->Add(m_ckDTRPos, 0, wxALIGN_CENTER|wxALIGN_RIGHT, 5);
+
+    m_rbUseRTS = new wxRadioButton(this, wxID_ANY, _("Use RTS"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_rbUseRTS->SetToolTip(_("Toggle the RTS pin for PTT"));
+    m_rbUseRTS->SetValue(1);
+    gridSizer17->Add(m_rbUseRTS, 0, wxALIGN_CENTER|wxALIGN_RIGHT, 5);
+
+    m_ckRTSPos = new wxCheckBox(this, wxID_ANY, _("RTS = +V"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_ckRTSPos->SetValue(false);
+    m_ckRTSPos->SetToolTip(_("Set Polarity of the RTS line"));
+    gridSizer17->Add(m_ckRTSPos, 0, wxALIGN_CENTER|wxALIGN_RIGHT, 5);
+
+    //----------------------------------------------------------------------
+    // OK - Cancel - Apply
+    //----------------------------------------------------------------------
+
+    wxBoxSizer* boxSizer12 = new wxBoxSizer(wxHORIZONTAL);
+
+    m_buttonOK = new wxButton(this, wxID_OK, _("OK"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_buttonOK->SetDefault();
+    boxSizer12->Add(m_buttonOK, 0, wxLEFT|wxRIGHT|wxTOP|wxBOTTOM, 5);
+
+    m_buttonCancel = new wxButton(this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxSize(-1,-1), 0);
+    boxSizer12->Add(m_buttonCancel, 0, wxLEFT|wxRIGHT|wxTOP|wxBOTTOM, 5);
+
+    m_buttonApply = new wxButton(this, wxID_APPLY, _("Apply"), wxDefaultPosition, wxSize(-1,-1), 0);
+    boxSizer12->Add(m_buttonApply, 0, wxLEFT|wxRIGHT|wxTOP|wxBOTTOM, 5);
+
+    mainSizer->Add(boxSizer12, 0, wxLEFT|wxRIGHT|wxTOP|wxBOTTOM|wxALIGN_CENTER_HORIZONTAL, 5);
+
+    if ( GetSizer() ) 
+    {
+         GetSizer()->Fit(this);
+    }
+    Centre(wxBOTH);
+
+    // Connect events
+    this->Connect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(ComPortsDlg::OnInitDialog), NULL, this);
+    m_ckUseHamlibPTT->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(ComPortsDlg::PTTUseHamLibClicked), NULL, this);
+    m_ckUseSerialPTT->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(ComPortsDlg::PTTUseSerialClicked), NULL, this);
+    m_buttonOK->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnOK), NULL, this);
+    m_buttonCancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnCancel), NULL, this);
+    m_buttonApply->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnApply), NULL, this);
+}
+
+//-------------------------------------------------------------------------
+// ~ComPortsDlg()
+//-------------------------------------------------------------------------
+ComPortsDlg::~ComPortsDlg()
+{
+    // Disconnect Events
+    this->Disconnect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(ComPortsDlg::OnInitDialog), NULL, this);
+    m_ckUseHamlibPTT->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(ComPortsDlg::PTTUseHamLibClicked), NULL, this);
+    m_ckUseSerialPTT->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(ComPortsDlg::PTTUseSerialClicked), NULL, this);
+    m_buttonOK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnOK), NULL, this);
+    m_buttonCancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnCancel), NULL, this);
+    m_buttonApply->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnApply), NULL, this);
+}
+
+//-------------------------------------------------------------------------
+// OnInitDialog()
+//-------------------------------------------------------------------------
+void ComPortsDlg::OnInitDialog(wxInitDialogEvent& event)
+{
+    populatePortList();
+    ExchangeData(EXCHANGE_DATA_IN);
+}
+
+//-------------------------------------------------------------------------
+// populatePortList()
+//-------------------------------------------------------------------------
+void ComPortsDlg::populatePortList()
+{
+#ifdef __WXMSW__
+    m_listCtrlPorts->Clear();
+    m_cbSerialPort->Clear();
+    wxArrayString aStr;
+    wxRegKey key(wxRegKey::HKLM, _T("HARDWARE\\DEVICEMAP\\SERIALCOMM"));
+    if(!key.Exists())
+    {
+        return;
+    }
+    else
+    {
+        // Get the number of subkeys and enumerate them.
+        if(!key.Open(wxRegKey::Read))
+        {
+            return;
+        }    
+        size_t subkeys;
+        size_t values;
+        if(!key.GetKeyInfo(&subkeys, NULL, &values, NULL))
+        {
+            return;
+        }
+        if(!key.HasValues())
+        {
+            return;
+        }
+        wxString key_name;
+        long el = 1;
+        key.GetFirstValue(key_name, el);
+        wxString valType;
+        wxString key_data;
+        for(unsigned int i = 0; i < values; i++)
+        {
+            key.QueryValue(key_name, key_data);
+            //wxPrintf("Value:  %s Data: %s\n", key_name, key_data);
+            aStr.Add(key_data, 1);
+            key.GetNextValue(key_name, el);
+        }
+    }
+    m_listCtrlPorts->Append(aStr);
+    m_cbSerialPort->Append(aStr);
+#endif
+#ifdef __WXGTK__
+    m_cbSerialPort->Clear();
+    m_cbCtlDevicePath->Clear();
+#ifdef __FreeBSD__
+       glob_t  gl;
+       if(glob("/dev/tty*", GLOB_MARK, NULL, &gl)==0) {
+               for(unsigned int i=0; i<gl.gl_pathc; i++) {
+                       if(gl.gl_pathv[i][strlen(gl.gl_pathv[i])-1]=='/')
+                               continue;
+                               
+                       /* Exclude pseudo TTYs */
+                       if(gl.gl_pathv[i][8] >= 'l' && gl.gl_pathv[i][8] <= 's')
+                               continue;
+                       if(gl.gl_pathv[i][8] >= 'L' && gl.gl_pathv[i][8] <= 'S')
+                               continue;
+
+                       /* Exclude virtual TTYs */
+                       if(gl.gl_pathv[i][8] == 'v')
+                               continue;
+
+                       /* Exclude initial-state and lock-state devices */
+                       if(strchr(gl.gl_pathv[i], '.') != NULL)
+                               continue;
+
+                       m_cbSerialPort->Append(gl.gl_pathv[i]);
+                       m_cbCtlDevicePath->Append(gl.gl_pathv[i]);
+               }
+               globfree(&gl);
+       }
+#else
+    /* TODO(Joel): http://stackoverflow.com/questions/2530096/how-to-find-all-serial-devices-ttys-ttyusb-on-linux-without-opening-them */
+    m_cbSerialPort->Append("/dev/ttyUSB0");
+    m_cbSerialPort->Append("/dev/ttyUSB1");
+    m_cbSerialPort->Append("/dev/ttyS0");
+    m_cbSerialPort->Append("/dev/ttyS1");
+    m_cbCtlDevicePath->Clear();
+    m_cbCtlDevicePath->Append("/dev/ttyUSB0");
+    m_cbCtlDevicePath->Append("/dev/ttyUSB1");
+    m_cbCtlDevicePath->Append("/dev/ttyS0");
+    m_cbCtlDevicePath->Append("/dev/ttyS1");
+#endif
+#endif
+}
+
+//-------------------------------------------------------------------------
+// ExchangeData()
+//-------------------------------------------------------------------------
+void ComPortsDlg::ExchangeData(int inout)
+{
+    wxConfigBase *pConfig = wxConfigBase::Get();
+    wxString str;
+    
+    if(inout == EXCHANGE_DATA_IN)
+    {
+        m_ckHalfDuplex->SetValue(wxGetApp().m_boolHalfDuplex);
+        m_ckLeftChannelVoxTone->SetValue(wxGetApp().m_leftChannelVoxTone);
+
+        m_ckUseHamlibPTT->SetValue(wxGetApp().m_boolHamlibUseForPTT);
+        m_cbRigName->SetSelection(wxGetApp().m_intHamlibRig);
+        m_cbSerialPort->SetValue(wxGetApp().m_strHamlibSerialPort);
+
+        m_ckUseSerialPTT->SetValue(wxGetApp().m_boolUseSerialPTT);
+        str = wxGetApp().m_strRigCtrlPort;
+#ifdef __WXMSW__
+        m_listCtrlPorts->SetStringSelection(str);
+#endif
+#ifdef __WXGTK__
+        m_cbCtlDevicePath->SetValue(str);
+#endif
+        m_rbUseRTS->SetValue(wxGetApp().m_boolUseRTS);
+        m_ckRTSPos->SetValue(wxGetApp().m_boolRTSPos);
+        m_rbUseDTR->SetValue(wxGetApp().m_boolUseDTR);
+        m_ckDTRPos->SetValue(wxGetApp().m_boolDTRPos);
+    }
+    if(inout == EXCHANGE_DATA_OUT)
+    {
+        wxGetApp().m_boolHalfDuplex = m_ckHalfDuplex->GetValue();
+        pConfig->Write(wxT("/Rig/HalfDuplex"), wxGetApp().m_boolHalfDuplex);
+        wxGetApp().m_leftChannelVoxTone = m_ckLeftChannelVoxTone->GetValue();
+        pConfig->Write(wxT("/Rig/leftChannelVoxTone"), wxGetApp().m_leftChannelVoxTone);
+
+        /* Hamlib settings. */
+
+        wxGetApp().m_boolHamlibUseForPTT = m_ckUseHamlibPTT->GetValue();
+        wxGetApp().m_intHamlibRig = m_cbRigName->GetSelection();
+        wxGetApp().m_strHamlibSerialPort = m_cbSerialPort->GetValue();
+
+        pConfig->Write(wxT("/Hamlib/UseForPTT"), wxGetApp().m_boolHamlibUseForPTT);
+        pConfig->Write(wxT("/Hamlib/RigName"), wxGetApp().m_intHamlibRig);
+        pConfig->Write(wxT("/Hamlib/SerialPort"), wxGetApp().m_strHamlibSerialPort);
+
+        /* Serial settings */
+
+        wxGetApp().m_boolUseSerialPTT           = m_ckUseSerialPTT->IsChecked();
+#ifdef __WXMSW__
+        wxGetApp().m_strRigCtrlPort             = m_listCtrlPorts->GetStringSelection();
+#endif
+#ifdef __WXGTK__
+        wxGetApp().m_strRigCtrlPort             = m_cbCtlDevicePath->GetValue();
+#endif
+        wxGetApp().m_boolUseRTS                 = m_rbUseRTS->GetValue();
+        wxGetApp().m_boolRTSPos                 = m_ckRTSPos->IsChecked();
+        wxGetApp().m_boolUseDTR                 = m_rbUseDTR->GetValue();
+        wxGetApp().m_boolDTRPos                 = m_ckDTRPos->IsChecked();
+        
+        pConfig->Write(wxT("/Rig/UseSerialPTT"),    wxGetApp().m_boolUseSerialPTT);
+        pConfig->Write(wxT("/Rig/Port"),            wxGetApp().m_strRigCtrlPort); 
+        pConfig->Write(wxT("/Rig/UseRTS"),          wxGetApp().m_boolUseRTS);
+        pConfig->Write(wxT("/Rig/RTSPolarity"),     wxGetApp().m_boolRTSPos);
+        pConfig->Write(wxT("/Rig/UseDTR"),          wxGetApp().m_boolUseDTR);
+        pConfig->Write(wxT("/Rig/DTRPolarity"),     wxGetApp().m_boolDTRPos);
+
+        pConfig->Flush();
+    }
+    delete wxConfigBase::Set((wxConfigBase *) NULL);
+}
+
+//-------------------------------------------------------------------------
+// PTTUseHamLibClicked()
+//-------------------------------------------------------------------------
+void ComPortsDlg::PTTUseHamLibClicked(wxCommandEvent& event)
+{
+    m_ckUseSerialPTT->SetValue(false);    
+}
+
+//-------------------------------------------------------------------------
+// PTTUseSerialClicked()
+//-------------------------------------------------------------------------
+void ComPortsDlg::PTTUseSerialClicked(wxCommandEvent& event)
+{
+    m_ckUseHamlibPTT->SetValue(false);
+}
+
+//-------------------------------------------------------------------------
+// OnApply()
+//-------------------------------------------------------------------------
+void ComPortsDlg::OnApply(wxCommandEvent& event)
+{
+    ExchangeData(EXCHANGE_DATA_OUT);
+}
+
+//-------------------------------------------------------------------------
+// OnCancel()
+//-------------------------------------------------------------------------
+void ComPortsDlg::OnCancel(wxCommandEvent& event)
+{
+    this->EndModal(wxID_CANCEL);
+}
+
+//-------------------------------------------------------------------------
+// OnClose()
+//-------------------------------------------------------------------------
+void ComPortsDlg::OnOK(wxCommandEvent& event)
+{
+    ExchangeData(EXCHANGE_DATA_OUT);
+    this->EndModal(wxID_OK);
+}
diff --git a/freedv/branches/0.99/src/dlg_ptt.h b/freedv/branches/0.99/src/dlg_ptt.h
new file mode 100644 (file)
index 0000000..8fa9b9d
--- /dev/null
@@ -0,0 +1,91 @@
+//==========================================================================
+// Name:            dlg_ptt.h
+// Purpose:         Subclasses dialog GUI for PTT Config.
+//                  
+// Created:         May. 11, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#ifndef __COMPORTS_DIALOG__
+#define __COMPORTS_DIALOG__
+
+#include "fdmdv2_main.h"
+#include "hamlib.h"
+#include <wx/settings.h>
+#include <wx/xrc/xmlres.h>
+#include <wx/xrc/xh_bmp.h>
+#include <wx/dialog.h>
+#include <wx/sizer.h>
+#include <wx/statbox.h>
+#include <wx/checkbox.h>
+#include <wx/listbox.h>
+#include <wx/radiobut.h>
+#include <wx/button.h>
+#include <wx/spinctrl.h>
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class ComPortsDlg
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class ComPortsDlg : public wxDialog
+{
+     public:
+        ComPortsDlg(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("PTT Config"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(450,300), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER);
+        virtual ~ComPortsDlg();
+        void    ExchangeData(int inout);
+
+    protected:
+        wxCheckBox* m_ckHalfDuplex;
+        wxCheckBox* m_ckLeftChannelVoxTone;
+
+        /* Hamlib settings.*/
+
+        wxCheckBox *m_ckUseHamlibPTT;
+        wxComboBox *m_cbRigName;
+        wxComboBox *m_cbSerialPort;
+
+        Hamlib *m_hamlib;
+
+        /* Serial Settings */
+
+        wxListBox     *m_listCtrlPorts;
+        wxCheckBox    *m_ckUseSerialPTT;
+        wxStaticText  *m_staticText12;
+        wxComboBox    *m_cbCtlDevicePath;
+        wxRadioButton *m_rbUseDTR;
+        wxCheckBox    *m_ckRTSPos;
+        wxRadioButton *m_rbUseRTS;
+        wxCheckBox    *m_ckDTRPos;
+
+        /* Ok - Cancel - Apply */
+
+        wxButton* m_buttonOK;
+        wxButton* m_buttonCancel;
+        wxButton* m_buttonApply;
+
+
+protected:
+        void populatePortList();
+
+        void PTTUseHamLibClicked(wxCommandEvent& event);
+        void PTTUseSerialClicked(wxCommandEvent& event);
+
+        void OnOK(wxCommandEvent& event);
+        void OnCancel(wxCommandEvent& event);
+        void OnApply(wxCommandEvent& event);
+        virtual void OnInitDialog(wxInitDialogEvent& event);
+};
+
+#endif // __COMPORTS_DIALOG__
diff --git a/freedv/branches/0.99/src/fdmdv2_defines.h b/freedv/branches/0.99/src/fdmdv2_defines.h
new file mode 100644 (file)
index 0000000..64aa606
--- /dev/null
@@ -0,0 +1,102 @@
+//==========================================================================
+// Name:            fdmdv2_defines.h
+// Purpose:         Definitions used by plots derived from fdmdv2_plot class.
+// Created:         August 27, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#ifndef __FDMDV2_DEFINES__
+#define __FDMDV2_DEFINES__
+
+#include "wx/wx.h"
+#include "freedv_api.h"
+#include "freedv_api_internal.h"
+
+// Spectrogram and Waterfall
+
+#define MIN_MAG_DB        -40.0     // min of spectrogram/waterfall magnitude axis
+#define MAX_MAG_DB          0.0     // max of spectrogram/waterfall magnitude axis
+#define STEP_MAG_DB         5.0     // magnitude axis step
+#define BETA                0.95    // constant for time averaging spectrum data
+#define MIN_F_HZ            0       // min freq on Waterfall and Spectrum
+#define MAX_F_HZ            3000    // max freq on Waterfall and Spectrum
+#define STEP_F_HZ           500     // major (e.g. text legend) freq step on Waterfall and Spectrum graticule
+#define STEP_MINOR_F_HZ     100     // minor (ticks) freq step on Waterfall and Spectrum graticule
+#define WATERFALL_SECS_Y    30      // number of seconds respresented by y axis of waterfall
+#define WATERFALL_SECS_STEP 5       // graticule y axis steps of waterfall
+#define DT                  0.1     // time between real time graphing updates
+#define FS                  8000    // FDMDV modem sample rate
+
+// Scatter diagram 
+
+#define SCATTER_MEM_SECS    10
+// (symbols/frame)/(graphics update period) = symbols/s sent to scatter memory
+// memory (symbols) = secs of memory * symbols/sec
+#define SCATTER_MEM_SYMS_MAX    ((int)(SCATTER_MEM_SECS*((FDMDV_NC_MAX+1)/DT)))
+
+// Waveform plotting constants
+
+#define WAVEFORM_PLOT_FS    400                            // sample rate (points/s) of waveform plotted to screen
+#define WAVEFORM_PLOT_TIME  5                              // length or entire waveform on screen
+#define WAVEFORM_PLOT_BUF   ((int)(DT*WAVEFORM_PLOT_FS))   // number of new samples we plot per DT
+
+// sample rate I/O & conversion constants
+
+#define MAX_FPB             8096                           // maximum value of portAudio framesPerBuffer
+#define PA_FPB              1024                           // nominal value of portAudio framesPerBuffer
+#define SAMPLE_RATE         48000                          // 48 kHz sampling rate rec. as we can trust accuracy of sound card
+#define N8                  160                            // processing buffer size at 8 kHz
+#define MEM8                (FDMDV_OS_TAPS/FDMDV_OS)
+#define N48                 (N8*SAMPLE_RATE/FS)            // processing buffer size at 48 kHz
+#define NUM_CHANNELS        2                              // I think most sound cards prefer stereo we will convert to mono
+#define VOX_TONE_FREQ       1000.0                         // optional left channel vox tone freq
+#define VOX_TONE_AMP        30000                          // optional left channel vox tone amp
+
+#define MAX_BITS_PER_CODEC_FRAME 64                            // 1600 bit/s mode
+#define MAX_BYTES_PER_CODEC_FRAME (MAX_BITS_PER_CODEC_FRAME/8)
+#define MAX_BITS_PER_FDMDV_FRAME 40                            // 2000 bit/s mode
+
+// Squelch
+#define SQ_DEFAULT_SNR       2.0
+
+// Level Gauge
+#define FROM_RADIO_MAX       0.8
+#define FROM_MIC_MAX         0.8
+#define LEVEL_BETA           0.99
+
+// SNR
+#define SNRSLOW_BETA        0.5                           // time constant for slow SNR for display
+
+// Text messaging Data
+#define MAX_CALLSIGN         80
+#define MAX_EVENT_LOG        10
+#define MAX_EVENT_RULES      100
+   
+enum
+{
+    ID_ROTATE_LEFT = wxID_HIGHEST + 1,
+    ID_ROTATE_RIGHT,
+    ID_RESIZE,
+    ID_PAINT_BG
+};
+
+// Codec 2 LPC Post Filter defaults, from codec-dev/src/quantise.c
+
+#define CODEC2_LPC_PF_GAMMA 0.5
+#define CODEC2_LPC_PF_BETA  0.2
+
+
+#endif  //__FDMDV2_DEFINES__
diff --git a/freedv/branches/0.99/src/fdmdv2_main.cpp b/freedv/branches/0.99/src/fdmdv2_main.cpp
new file mode 100644 (file)
index 0000000..2adec2c
--- /dev/null
@@ -0,0 +1,3686 @@
+//==========================================================================
+// Name:            fdmdv2_main.cpp
+//
+// Purpose:         FreeDV main()
+// Created:         Apr. 9, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+
+#include "fdmdv2_main.h"
+
+#define wxUSE_FILEDLG   1
+#define wxUSE_LIBPNG    1
+#define wxUSE_LIBJPEG   1
+#define wxUSE_GIF       1
+#define wxUSE_PCX       1
+#define wxUSE_LIBTIFF   1
+
+//-------------------------------------------------------------------
+// Bunch of globals used for communication with sound card call
+// back functions
+// ------------------------------------------------------------------
+
+int g_in, g_out;
+
+// Global Codec2 & modem states - just one reqd for tx & rx
+int                 g_Nc;
+int                 g_mode;
+struct freedv      *g_pfreedv;
+struct MODEM_STATS  g_stats;
+float               g_pwr_scale;
+int                 g_clip;
+
+// test Frames
+int                 g_testFrames;
+int                 g_test_frame_sync_state;
+int                 g_test_frame_count;
+int                 g_total_bits;
+int                 g_total_bit_errors;
+int                 g_channel_noise;
+float               g_sig_pwr_av = 0.0;
+struct FIFO        *g_error_pattern_fifo;
+short              *g_error_hist;
+// time averaged magnitude spectrum used for waterfall and spectrum display
+float               g_avmag[MODEM_STATS_NSPEC];
+
+// GUI controls that affect rx and tx processes
+int   g_SquelchActive;
+float g_SquelchLevel;
+int   g_analog;
+int   g_split;
+int   g_tx;
+float g_snr;
+bool  g_half_duplex;
+bool  g_modal;
+
+// sending and receiving Call Sign data
+struct FIFO         *g_txDataInFifo;
+struct FIFO         *g_rxDataOutFifo;
+
+// tx/rx processing states
+int                 g_State;
+paCallBackData     *g_rxUserdata;
+
+// FIFOs used for plotting waveforms
+struct FIFO        *g_plotDemodInFifo;
+struct FIFO        *g_plotSpeechOutFifo;
+struct FIFO        *g_plotSpeechInFifo;
+
+// Soundcard config
+int                 g_nSoundCards;
+int                 g_soundCard1InDeviceNum;
+int                 g_soundCard1OutDeviceNum;
+int                 g_soundCard1SampleRate;
+int                 g_soundCard2InDeviceNum;
+int                 g_soundCard2OutDeviceNum;
+int                 g_soundCard2SampleRate;
+
+// playing and recording from sound files
+
+SNDFILE            *g_sfPlayFile;
+bool                g_playFileToMicIn;
+bool                g_loopPlayFileToMicIn;
+int                 g_playFileToMicInEventId;
+
+SNDFILE            *g_sfRecFile;
+bool                g_recFileFromRadio;
+unsigned int        g_recFromRadioSamples;
+int                 g_recFileFromRadioEventId;
+
+SNDFILE            *g_sfPlayFileFromRadio;
+bool                g_playFileFromRadio;
+int                 g_sfFs;
+bool                g_loopPlayFileFromRadio;
+int                 g_playFileFromRadioEventId;
+float               g_blink;
+
+wxWindow           *g_parent;
+
+// Click to tune rx and tx frequency offset states
+float               g_RxFreqOffsetHz;
+COMP                g_RxFreqOffsetPhaseRect;
+float               g_TxFreqOffsetHz;
+COMP                g_TxFreqOffsetPhaseRect;
+
+// experimental mutex to make sound card callbacks mutually exclusive
+// TODO: review code and see if we need this any more, as fifos should
+// now be thread safe
+
+wxMutex g_mutexProtectingCallbackData;
+
+// Speex pre-processor states
+
+SpeexPreprocessState *g_speex_st;
+
+// WxWidgets - initialize the application
+IMPLEMENT_APP(MainApp);
+
+//FILE *ft;
+FILE *g_logfile;
+
+//-------------------------------------------------------------------------
+// OnInit()
+//-------------------------------------------------------------------------
+bool MainApp::OnInit()
+{
+    if(!wxApp::OnInit())
+    {
+        return false;
+    }
+    SetVendorName(wxT("CODEC2-Project"));
+    SetAppName(wxT("FreeDV"));      // not needed, it's the default value
+
+    // DR - this is wrong define so won't be used on windows build, should be __WXMSW__
+    // So registry will be used for Win32
+#ifdef _WXMSW_
+    // Force use of file-based configuration persistance on Windows platforma
+    wxConfig *pConfig = new wxConfig();
+    wxFileConfig *pFConfig = new wxFileConfig(wxT("FreeDV"), wxT("CODEC2-Project"), wxT("FreeDV.conf"), wxT("FreeDV.conf"),  wxCONFIG_USE_LOCAL_FILE | wxCONFIG_USE_RELATIVE_PATH);
+    pConfig->Set(pFConfig);
+    pConfig->SetRecordDefaults();
+#else
+    wxConfigBase *pConfig = wxConfigBase::Get();
+    pConfig->SetRecordDefaults();
+#endif
+
+    m_rTopWindow = wxRect(0, 0, 0, 0);
+    m_strRxInAudio.Empty();
+    m_strRxOutAudio.Empty();
+    m_textVoiceInput.Empty();
+    m_textVoiceOutput.Empty();
+    m_strSampleRate.Empty();
+    m_strBitrate.Empty();
+    // Create the main application window
+    frame = new MainFrame(NULL);
+    SetTopWindow(frame);
+    // Should guarantee that the first plot tab defined is the one
+    // displayed. But it doesn't when built from command line.  Why?
+    frame->m_auiNbookCtrl->ChangeSelection(0);
+    frame->Layout();
+    frame->Show();
+    g_parent =frame;
+
+    //ft = fopen("tmp.raw","wb");
+    //assert(ft != NULL);
+
+    return true;
+}
+
+//-------------------------------------------------------------------------
+// OnExit()
+//-------------------------------------------------------------------------
+int MainApp::OnExit()
+{
+    return 0;
+}
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class MainFrame(wxFrame* pa->ent) : TopFrame(parent)
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+MainFrame::MainFrame(wxWindow *parent) : TopFrame(parent)
+{
+    m_zoom              = 1.;
+
+    #ifdef __WXMSW__
+    g_logfile = fopen("log.txt","wt");
+    #else
+    g_logfile = stderr;
+    #endif
+
+    SetMinSize(wxSize(400,400));
+
+    // Init Hamlib library, but we dont start talking to any rigs yet
+
+    wxGetApp().m_hamlib = new Hamlib();
+
+    tools->AppendSeparator();
+    wxMenuItem* m_menuItemToolsConfigDelete;
+    m_menuItemToolsConfigDelete = new wxMenuItem(tools, wxID_ANY, wxString(_("&Restore defaults")) , wxT("Delete config file/keys and restore defaults"), wxITEM_NORMAL);
+    this->Connect(m_menuItemToolsConfigDelete->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::OnDeleteConfig));
+
+    tools->Append(m_menuItemToolsConfigDelete);
+
+    wxConfigBase *pConfig = wxConfigBase::Get();
+
+    // restore frame position and size
+    int x = pConfig->Read(wxT("/MainFrame/left"),       20);
+    int y = pConfig->Read(wxT("/MainFrame/top"),        20);
+    int w = pConfig->Read(wxT("/MainFrame/width"),     800);
+    int h = pConfig->Read(wxT("/MainFrame/height"),    550);
+
+    // sanitise frame position as a first pass at Win32 registry bug
+
+    fprintf(g_logfile, "x = %d y = %d w = %d h = %d\n", x,y,w,h);
+    if (x < 0 || x > 2048) x = 20;
+    if (y < 0 || y > 2048) y = 20;
+    if (w < 0 || w > 2048) w = 800;
+    if (h < 0 || h > 2048) h = 550;
+
+    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_show_speech_in     = pConfig->Read(wxT("/MainFrame/show_speech_in"),    1);
+    wxGetApp().m_show_speech_out    = pConfig->Read(wxT("/MainFrame/show_speech_out"),   1);
+    wxGetApp().m_show_demod_in      = pConfig->Read(wxT("/MainFrame/show_demod_in"),     1);
+    wxGetApp().m_show_test_frame_errors = pConfig->Read(wxT("/MainFrame/show_test_frame_errors"),     1);
+    wxGetApp().m_show_test_frame_errors_hist = pConfig->Read(wxT("/MainFrame/show_test_frame_errors_hist"),     1);
+
+    wxGetApp().m_rxNbookCtrl        = pConfig->Read(wxT("/MainFrame/rxNbookCtrl"),    (long)0);
+
+    g_SquelchActive = pConfig->Read(wxT("/Audio/SquelchActive"), (long)0);
+    g_SquelchLevel = pConfig->Read(wxT("/Audio/SquelchLevel"), (int)(SQ_DEFAULT_SNR*2));
+    g_SquelchLevel /= 2.0;
+
+    Move(x, y);
+    SetClientSize(w, h);
+    
+    if(wxGetApp().m_show_wf)
+    {
+        // Add Waterfall Plot window
+        m_panelWaterfall = new PlotWaterfall((wxFrame*) m_auiNbookCtrl, false, 0);
+        m_panelWaterfall->SetToolTip(_("Left click to tune, Right click to toggle mono/colour"));
+        m_auiNbookCtrl->AddPage(m_panelWaterfall, _("Waterfall"), true, wxNullBitmap);
+    }
+    if(wxGetApp().m_show_spect)
+    {
+        // Add Spectrum Plot window
+        m_panelSpectrum = new PlotSpectrum((wxFrame*) m_auiNbookCtrl, g_avmag,
+                                           MODEM_STATS_NSPEC*((float)MAX_F_HZ/MODEM_STATS_MAX_F_HZ));
+        m_panelSpectrum->SetToolTip(_("Left click to tune"));
+        m_auiNbookCtrl->AddPage(m_panelSpectrum, _("Spectrum"), true, wxNullBitmap);
+    }
+    if(wxGetApp().m_show_scatter)
+    {
+        // Add Scatter Plot window
+        m_panelScatter = new PlotScatter((wxFrame*) m_auiNbookCtrl);
+        m_auiNbookCtrl->AddPage(m_panelScatter, _("Scatter"), true, wxNullBitmap);
+    }
+    if(wxGetApp().m_show_demod_in)
+    {
+        // Add Demod Input window
+        m_panelDemodIn = new PlotScalar((wxFrame*) m_auiNbookCtrl, 1, WAVEFORM_PLOT_TIME, 1.0/WAVEFORM_PLOT_FS, -1, 1, 1, 0.2, "%2.1f", 0);
+        m_auiNbookCtrl->AddPage(m_panelDemodIn, _("Frm Radio"), true, wxNullBitmap);
+        g_plotDemodInFifo = fifo_create(2*WAVEFORM_PLOT_BUF);
+    }
+
+    if(wxGetApp().m_show_speech_in)
+    {
+        // Add Speech Input window
+        m_panelSpeechIn = new PlotScalar((wxFrame*) m_auiNbookCtrl, 1, WAVEFORM_PLOT_TIME, 1.0/WAVEFORM_PLOT_FS, -1, 1, 1, 0.2, "%2.1f", 0);
+        m_auiNbookCtrl->AddPage(m_panelSpeechIn, _("Frm Mic"), true, wxNullBitmap);
+        g_plotSpeechInFifo = fifo_create(4*WAVEFORM_PLOT_BUF);
+    }
+
+    if(wxGetApp().m_show_speech_out)
+    {
+        // Add Speech Output window
+        m_panelSpeechOut = new PlotScalar((wxFrame*) m_auiNbookCtrl, 1, WAVEFORM_PLOT_TIME, 1.0/WAVEFORM_PLOT_FS, -1, 1, 1, 0.2, "%2.1f", 0);
+        m_auiNbookCtrl->AddPage(m_panelSpeechOut, _("To Spkr/Hdphns"), true, wxNullBitmap);
+        g_plotSpeechOutFifo = fifo_create(2*WAVEFORM_PLOT_BUF);
+    }
+
+    if(wxGetApp().m_show_timing)
+    {
+        // Add Timing Offset window
+        m_panelTimeOffset = new PlotScalar((wxFrame*) m_auiNbookCtrl, 1, 5.0, DT, -0.5, 0.5, 1, 0.1, "%2.1f", 0);
+        m_auiNbookCtrl->AddPage(m_panelTimeOffset, L"Timing \u0394", true, wxNullBitmap);
+    }
+    if(wxGetApp().m_show_freq)
+    {
+        // Add Frequency Offset window
+        m_panelFreqOffset = new PlotScalar((wxFrame*) m_auiNbookCtrl, 1, 5.0, DT, -200, 200, 1, 50, "%3.0fHz", 0);
+        m_auiNbookCtrl->AddPage(m_panelFreqOffset, L"Frequency \u0394", true, wxNullBitmap);
+    }
+
+    if(wxGetApp().m_show_test_frame_errors)
+    {
+        // Add Test Frame Errors window
+        m_panelTestFrameErrors = new PlotScalar((wxFrame*) m_auiNbookCtrl, 2*MODEM_STATS_NC_MAX, 30.0, DT, 0, 2*MODEM_STATS_NC_MAX+2, 1, 1, "", 1);
+        m_auiNbookCtrl->AddPage(m_panelTestFrameErrors, L"Test Frame Errors", true, wxNullBitmap);
+    }
+
+    if(wxGetApp().m_show_test_frame_errors_hist)
+    {
+        // Add Test Frame Errors window
+        m_panelTestFrameErrorsHist = new PlotScalar((wxFrame*) m_auiNbookCtrl, 1, 1.0, 1.0/(2*FDMDV_NC_MAX), 0.0, 1.0, 1.0/FDMDV_NC_MAX, 0.1, "%3.2f", 0);
+        m_auiNbookCtrl->AddPage(m_panelTestFrameErrorsHist, L"Test Frame Histogram", true, wxNullBitmap);
+    }
+
+    wxGetApp().m_framesPerBuffer = pConfig->Read(wxT("/Audio/framesPerBuffer"), PA_FPB);
+
+    g_soundCard1InDeviceNum  = pConfig->Read(wxT("/Audio/soundCard1InDeviceNum"),         -1);
+    g_soundCard1OutDeviceNum = pConfig->Read(wxT("/Audio/soundCard1OutDeviceNum"),        -1);
+    g_soundCard1SampleRate   = pConfig->Read(wxT("/Audio/soundCard1SampleRate"),          -1);
+
+    g_soundCard2InDeviceNum  = pConfig->Read(wxT("/Audio/soundCard2InDeviceNum"),         -1);
+    g_soundCard2OutDeviceNum = pConfig->Read(wxT("/Audio/soundCard2OutDeviceNum"),        -1);
+    g_soundCard2SampleRate   = pConfig->Read(wxT("/Audio/soundCard2SampleRate"),          -1);
+
+    g_nSoundCards = 0;
+    if ((g_soundCard1InDeviceNum > -1) && (g_soundCard1OutDeviceNum > -1)) {
+        g_nSoundCards = 1;
+        if ((g_soundCard2InDeviceNum > -1) && (g_soundCard2OutDeviceNum > -1))
+            g_nSoundCards = 2;
+    }
+
+    wxGetApp().m_playFileToMicInPath = pConfig->Read("/File/playFileToMicInPath",   wxT(""));
+    wxGetApp().m_recFileFromRadioPath = pConfig->Read("/File/recFileFromRadioPath", wxT(""));
+    wxGetApp().m_recFileFromRadioSecs = pConfig->Read("/File/recFileFromRadioSecs", 30);
+    wxGetApp().m_playFileFromRadioPath = pConfig->Read("/File/playFileFromRadioPath", wxT(""));
+
+    // PTT -------------------------------------------------------------------
+
+    wxGetApp().m_boolHalfDuplex     = pConfig->ReadBool(wxT("/Rig/HalfDuplex"),     true);
+    wxGetApp().m_leftChannelVoxTone = pConfig->ReadBool("/Rig/leftChannelVoxTone",  false);
+    wxGetApp().m_boolHamlibUseForPTT = pConfig->ReadBool("/Hamlib/UseForPTT", false);
+    wxGetApp().m_intHamlibRig = pConfig->ReadLong("/Hamlib/RigName", 0);
+    wxGetApp().m_strHamlibSerialPort = pConfig->Read("/Hamlib/SerialPort", "");
+    
+    wxGetApp().m_boolUseSerialPTT   = pConfig->ReadBool(wxT("/Rig/UseSerialPTT"),   false);
+    wxGetApp().m_strRigCtrlPort     = pConfig->Read(wxT("/Rig/Port"),               wxT(""));
+    wxGetApp().m_boolUseRTS         = pConfig->ReadBool(wxT("/Rig/UseRTS"),         true);
+    wxGetApp().m_boolRTSPos         = pConfig->ReadBool(wxT("/Rig/RTSPolarity"),    true);
+    wxGetApp().m_boolUseDTR         = pConfig->ReadBool(wxT("/Rig/UseDTR"),         false);
+    wxGetApp().m_boolDTRPos         = pConfig->ReadBool(wxT("/Rig/DTRPolarity"),    false);
+    com_handle = COM_HANDLE_INVALID;
+
+    // -----------------------------------------------------------------------
+
+    bool slow = false; // prevents compile error when using default bool
+    wxGetApp().m_snrSlow = pConfig->Read("/Audio/snrSlow", slow);
+
+    bool t = true;     // prevents compile error when using default bool
+    wxGetApp().m_codec2LPCPostFilterEnable     = pConfig->Read(wxT("/Filter/codec2LPCPostFilterEnable"),    t);
+    wxGetApp().m_codec2LPCPostFilterBassBoost  = pConfig->Read(wxT("/Filter/codec2LPCPostFilterBassBoost"), t);
+    wxGetApp().m_codec2LPCPostFilterGamma      = (float)pConfig->Read(wxT("/Filter/codec2LPCPostFilterGamma"),     CODEC2_LPC_PF_GAMMA*100)/100.0;
+    wxGetApp().m_codec2LPCPostFilterBeta       = (float)pConfig->Read(wxT("/Filter/codec2LPCPostFilterBeta"),      CODEC2_LPC_PF_BETA*100)/100.0;
+    //printf("main(): m_codec2LPCPostFilterBeta: %f\n", wxGetApp().m_codec2LPCPostFilterBeta);
+
+    wxGetApp().m_speexpp_enable     = pConfig->Read(wxT("/Filter/speexpp_enable"),    t);
+
+    wxGetApp().m_MicInBassFreqHz = (float)pConfig->Read(wxT("/Filter/MicInBassFreqHz"),    1);
+    wxGetApp().m_MicInBassGaindB = (float)pConfig->Read(wxT("/Filter/MicInBassGaindB"),    (long)0)/10.0;
+    wxGetApp().m_MicInTrebleFreqHz = (float)pConfig->Read(wxT("/Filter/MicInTrebleFreqHz"),    1);
+    wxGetApp().m_MicInTrebleGaindB = (float)pConfig->Read(wxT("/Filter/MicInTrebleGaindB"),    (long)0)/10.0;
+    wxGetApp().m_MicInMidFreqHz = (float)pConfig->Read(wxT("/Filter/MicInMidFreqHz"),    1);
+    wxGetApp().m_MicInMidGaindB = (float)pConfig->Read(wxT("/Filter/MicInMidGaindB"),    (long)0)/10.0;
+    wxGetApp().m_MicInMidQ = (float)pConfig->Read(wxT("/Filter/MicInMidQ"),              (long)100)/100.0;
+
+    bool f = false;
+    wxGetApp().m_MicInEQEnable = (float)pConfig->Read(wxT("/Filter/MicInEQEnable"), f);
+
+    wxGetApp().m_SpkOutBassFreqHz = (float)pConfig->Read(wxT("/Filter/SpkOutBassFreqHz"),    1);
+    wxGetApp().m_SpkOutBassGaindB = (float)pConfig->Read(wxT("/Filter/SpkOutBassGaindB"),    (long)0)/10.0;
+    wxGetApp().m_SpkOutTrebleFreqHz = (float)pConfig->Read(wxT("/Filter/SpkOutTrebleFreqHz"),    1);
+    wxGetApp().m_SpkOutTrebleGaindB = (float)pConfig->Read(wxT("/Filter/SpkOutTrebleGaindB"),    (long)0)/10.0;
+    wxGetApp().m_SpkOutMidFreqHz = (float)pConfig->Read(wxT("/Filter/SpkOutMidFreqHz"),    1);
+    wxGetApp().m_SpkOutMidGaindB = (float)pConfig->Read(wxT("/Filter/SpkOutMidGaindB"),    (long)0)/10.0;
+    wxGetApp().m_SpkOutMidQ = (float)pConfig->Read(wxT("/Filter/SpkOutMidQ"),                (long)100)/100.0;
+
+    wxGetApp().m_SpkOutEQEnable = (float)pConfig->Read(wxT("/Filter/SpkOutEQEnable"), f);
+
+    wxGetApp().m_callSign = pConfig->Read("/Data/CallSign", wxT(""));
+    wxGetApp().m_textEncoding = pConfig->Read("/Data/TextEncoding", 1);
+    wxGetApp().m_enable_checksum = pConfig->Read("/Data/EnableChecksumOnMsgRx", f);
+
+    wxGetApp().m_events = pConfig->Read("/Events/enable", f);
+    wxGetApp().m_events_spam_timer = (int)pConfig->Read(wxT("/Events/spam_timer"), 10);
+    wxGetApp().m_events_regexp_match = pConfig->Read("/Events/regexp_match", wxT("s=(.*)"));
+    wxGetApp().m_events_regexp_replace = pConfig->Read("/Events/regexp_replace", 
+                                                       wxT("curl http://qso.freedv.org/cgi-bin/onspot.cgi?s=\\1"));
+    // make sure regexp lists are terminated by a \n
+
+    if (wxGetApp().m_events_regexp_match.Last() != '\n') {
+        wxGetApp().m_events_regexp_match = wxGetApp().m_events_regexp_match+'\n';
+    }
+    if (wxGetApp().m_events_regexp_replace.Last() != '\n') {
+        wxGetApp().m_events_regexp_replace = wxGetApp().m_events_regexp_replace+'\n';
+    }
+
+    wxGetApp().m_udp_enable = (float)pConfig->Read(wxT("/UDP/enable"), f);
+    wxGetApp().m_udp_port = (int)pConfig->Read(wxT("/UDP/port"), 3000);
+
+    wxGetApp().m_FreeDV700txClip = (float)pConfig->Read(wxT("/FreeDV700/txClip"), t);
+
+    int mode  = pConfig->Read(wxT("/Audio/mode"), (long)0);
+    if (mode == 0)
+        m_rb1600->SetValue(1);
+    if (mode == 1)
+        m_rb700->SetValue(1);
+        
+    pConfig->SetPath(wxT("/"));
+
+//    this->Connect(m_menuItemHelpUpdates->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnHelpCheckUpdatesUI));
+    //m_togRxID->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnRxIDUI), NULL, this);
+    //m_togTxID->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnTxIDUI), NULL, this);
+    m_togBtnOnOff->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnOnOffUI), NULL, this);
+    m_togBtnSplit->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnSplitClickUI), NULL, this);
+    m_togBtnAnalog->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnAnalogClickUI), NULL, this);
+    //m_togBtnALC->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnALCClickUI), NULL, this);
+   // m_btnTogPTT->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnPTT_UI), NULL, this);
+
+    m_togBtnSplit->Disable();
+    //m_togRxID->Disable();
+    //m_togTxID->Disable();
+    m_togBtnAnalog->Disable();
+    m_btnTogPTT->Disable();
+    //m_togBtnALC->Disable();
+
+    // squelch settings
+    char sqsnr[15];
+    m_sliderSQ->SetValue((int)((g_SquelchLevel+5.0)*2.0));
+    sprintf(sqsnr, "%4.1f", g_SquelchLevel);
+    wxString sqsnr_string(sqsnr);
+    m_textSQ->SetLabel(sqsnr_string);
+    m_ckboxSQ->SetValue(g_SquelchActive);
+
+    // SNR settings
+
+    m_ckboxSNR->SetValue(wxGetApp().m_snrSlow);
+    setsnrBeta(wxGetApp().m_snrSlow);
+
+#ifdef _USE_TIMER
+    Bind(wxEVT_TIMER, &MainFrame::OnTimer, this);       // ID_MY_WINDOW);
+    m_plotTimer.SetOwner(this, ID_TIMER_WATERFALL);
+    //m_panelWaterfall->Refresh();
+#endif
+
+    m_RxRunning = false;
+
+#ifdef _USE_ONIDLE
+    Connect(wxEVT_IDLE, wxIdleEventHandler(MainFrame::OnIdle), NULL, this);
+#endif //_USE_ONIDLE
+
+    g_sfPlayFile = NULL;
+    g_playFileToMicIn = false;
+    g_loopPlayFileToMicIn = false;
+
+    g_sfRecFile = NULL;
+    g_recFileFromRadio = false;
+
+    g_sfPlayFileFromRadio = NULL;
+    g_playFileFromRadio = false;
+    g_loopPlayFileFromRadio = false;
+
+    // init click-tune states
+
+    g_RxFreqOffsetHz = 0.0;
+    g_RxFreqOffsetPhaseRect.real = cos(0.0);
+    g_RxFreqOffsetPhaseRect.imag = sin(0.0);
+    m_panelWaterfall->setRxFreq(FDMDV_FCENTRE - g_RxFreqOffsetHz);
+    m_panelSpectrum->setRxFreq(FDMDV_FCENTRE - g_RxFreqOffsetHz);
+
+    g_TxFreqOffsetHz = 0.0;
+    g_TxFreqOffsetPhaseRect.real = cos(0.0);
+    g_TxFreqOffsetPhaseRect.imag = sin(0.0);
+
+    g_tx = 0;
+    g_split = 0;
+
+    // data states
+    g_txDataInFifo = fifo_create(MAX_CALLSIGN*VARICODE_MAX_BITS);
+    g_rxDataOutFifo = fifo_create(MAX_CALLSIGN*VARICODE_MAX_BITS);
+
+    sox_biquad_start();
+    golay23_init();
+
+    g_testFrames = 0;
+    g_test_frame_sync_state = 0;
+    g_total_bit_errors = 0;
+    g_total_bits = 0;
+    wxGetApp().m_testFrames = false;
+
+    g_modal = false;
+
+    // Start UDP listener thread
+
+    m_UDPThread = NULL;
+    startUDPThread();
+
+    optionsDlg = new OptionsDlg(NULL);
+    m_schedule_restore = false;
+
+}
+
+//-------------------------------------------------------------------------
+// ~MainFrame()
+//-------------------------------------------------------------------------
+MainFrame::~MainFrame()
+{
+    int x;
+    int y;
+    int w;
+    int h;
+
+    //fclose(ft);
+    #ifdef __WXMSW__
+    fclose(g_logfile);
+    #endif
+
+    if (optionsDlg != NULL) {
+        delete optionsDlg;
+        optionsDlg = NULL;
+    }
+
+    stopUDPThread();
+
+    /* TOOD(Joel): the ownership of m_hamlib is probably wrong. */
+    if (wxGetApp().m_hamlib) delete wxGetApp().m_hamlib;
+
+    //MainApp *pApp = wxGetApp();
+    wxConfigBase *pConfig = wxConfigBase::Get();
+    if(pConfig)
+    {
+        if (!IsIconized()) {
+            GetClientSize(&w, &h);
+
+            // big hack - for some reason height shrinks by this much
+            // every time FreeDV runs!  I have no idea why
+
+            h += 23;
+
+            GetPosition(&x, &y);
+            printf("x = %d y = %d w = %d h = %d\n", x,y,w,h);
+            pConfig->Write(wxT("/MainFrame/left"),               (long) x);
+            pConfig->Write(wxT("/MainFrame/top"),                (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("/MainFrame/show_speech_in"),    wxGetApp().m_show_speech_in);
+        pConfig->Write(wxT("/MainFrame/show_speech_out"),   wxGetApp().m_show_speech_out);
+        pConfig->Write(wxT("/MainFrame/show_demod_in"),     wxGetApp().m_show_demod_in);
+        pConfig->Write(wxT("/MainFrame/show_test_frame_errors"), wxGetApp().m_show_test_frame_errors);
+        pConfig->Write(wxT("/MainFrame/show_test_frame_errors_hist"), wxGetApp().m_show_test_frame_errors_hist);
+
+        pConfig->Write(wxT("/MainFrame/rxNbookCtrl"), wxGetApp().m_rxNbookCtrl);
+
+        pConfig->Write(wxT("/Audio/SquelchActive"),         g_SquelchActive);
+        pConfig->Write(wxT("/Audio/SquelchLevel"),          (int)(g_SquelchLevel*2.0));
+
+        pConfig->Write(wxT("/Audio/framesPerBuffer"),       wxGetApp().m_framesPerBuffer);
+
+        pConfig->Write(wxT("/Audio/soundCard1InDeviceNum"),   g_soundCard1InDeviceNum);
+        pConfig->Write(wxT("/Audio/soundCard1OutDeviceNum"),  g_soundCard1OutDeviceNum);
+        pConfig->Write(wxT("/Audio/soundCard1SampleRate"),    g_soundCard1SampleRate );
+
+        pConfig->Write(wxT("/Audio/soundCard2InDeviceNum"),   g_soundCard2InDeviceNum);
+        pConfig->Write(wxT("/Audio/soundCard2OutDeviceNum"),  g_soundCard2OutDeviceNum);
+        pConfig->Write(wxT("/Audio/soundCard2SampleRate"),    g_soundCard2SampleRate );
+
+        pConfig->Write(wxT("/Rig/HalfDuplex"),              wxGetApp().m_boolHalfDuplex);
+        pConfig->Write(wxT("/Rig/leftChannelVoxTone"),      wxGetApp().m_leftChannelVoxTone);
+        pConfig->Write("/Hamlib/UseForPTT", wxGetApp().m_boolHamlibUseForPTT);
+        pConfig->Write("/Hamlib/RigName", wxGetApp().m_intHamlibRig);
+        pConfig->Write("/Hamlib/SerialPort", wxGetApp().m_strHamlibSerialPort);
+
+
+        pConfig->Write(wxT("/File/playFileToMicInPath"),    wxGetApp().m_playFileToMicInPath);
+        pConfig->Write(wxT("/File/recFileFromRadioPath"),   wxGetApp().m_recFileFromRadioPath);
+        pConfig->Write(wxT("/File/recFileFromRadioSecs"),   wxGetApp().m_recFileFromRadioSecs);
+        pConfig->Write(wxT("/File/playFileFromRadioPath"),  wxGetApp().m_playFileFromRadioPath);
+
+        pConfig->Write(wxT("/Audio/snrSlow"), wxGetApp().m_snrSlow);
+
+        pConfig->Write(wxT("/Data/CallSign"), wxGetApp().m_callSign);
+        pConfig->Write(wxT("/Data/TextEncoding"), wxGetApp().m_textEncoding);
+        pConfig->Write(wxT("/Data/EnableChecksumOnMsgRx"), wxGetApp().m_enable_checksum);
+        pConfig->Write(wxT("/Events/enable"), wxGetApp().m_events);
+        pConfig->Write(wxT("/Events/spam_timer"), wxGetApp().m_events_spam_timer);
+        pConfig->Write(wxT("/Events/regexp_match"), wxGetApp().m_events_regexp_match);
+        pConfig->Write(wxT("/Events/regexp_replace"), wxGetApp().m_events_regexp_replace);
+        pConfig->Write(wxT("/UDP/enable"), wxGetApp().m_udp_enable);
+        pConfig->Write(wxT("/UDP/port"),  wxGetApp().m_udp_port);
+
+        pConfig->Write(wxT("/Filter/MicInEQEnable"), wxGetApp().m_MicInEQEnable);
+        pConfig->Write(wxT("/Filter/SpkOutEQEnable"), wxGetApp().m_SpkOutEQEnable);
+
+        pConfig->Write(wxT("/FreeDV700/txClip"), wxGetApp().m_FreeDV700txClip);
+
+        int mode;
+        if (m_rb1600->GetValue())
+            mode = 0;
+        if (m_rb700->GetValue())
+            mode = 1;
+        pConfig->Write(wxT("/Audio/mode"), mode);
+    }
+
+    //m_togRxID->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnRxIDUI), NULL, this);
+    //m_togTxID->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnTxIDUI), NULL, this);
+    m_togBtnOnOff->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnOnOffUI), NULL, this);
+    m_togBtnSplit->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnSplitClickUI), NULL, this);
+    m_togBtnAnalog->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnAnalogClickUI), NULL, this);
+    //m_togBtnALC->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnALCClickUI), NULL, this);
+    //m_btnTogPTT->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnPTT_UI), NULL, this);
+
+    sox_biquad_finish();
+
+    if (m_RxRunning)
+    {
+        stopRxStream();
+    }
+    if (g_sfPlayFile != NULL)
+    {
+        sf_close(g_sfPlayFile);
+        g_sfPlayFile = NULL;
+    }
+    if (g_sfRecFile != NULL)
+    {
+        sf_close(g_sfRecFile);
+        g_sfRecFile = NULL;
+    }
+#ifdef _USE_TIMER
+    if(m_plotTimer.IsRunning())
+    {
+        m_plotTimer.Stop();
+        Unbind(wxEVT_TIMER, &MainFrame::OnTimer, this);
+    }
+#endif //_USE_TIMER
+
+#ifdef _USE_ONIDLE
+    Disconnect(wxEVT_IDLE, wxIdleEventHandler(MainFrame::OnIdle), NULL, this);
+#endif // _USE_ONIDLE
+
+    delete wxConfigBase::Set((wxConfigBase *) NULL);
+}
+
+//----------------------------------------------------------------
+// closeComPort() closes the currently open com port
+//----------------------------------------------------------------
+void MainFrame::closeComPort(void)
+{
+#ifdef _WIN32
+       CloseHandle(com_handle);
+#else
+       close(com_handle);
+#endif
+       com_handle = COM_HANDLE_INVALID;
+}
+
+//----------------------------------------------------------------
+// openComPort() opens the com port specified by the string
+// ie: "COM1" on Windows or "/dev/ttyu0" on FreeBSD
+//----------------------------------------------------------------
+bool MainFrame::openComPort(const char *name)
+{
+       if(com_handle != COM_HANDLE_INVALID)
+               closeComPort();
+#ifdef _WIN32
+       {
+               COMMCONFIG CC;
+               DWORD CCsize=sizeof(CC);
+               COMMTIMEOUTS timeouts;
+               DCB     dcb;
+
+               if(GetDefaultCommConfigA(name, &CC, &CCsize)) {
+                       CC.dcb.fOutxCtsFlow             = FALSE;
+                       CC.dcb.fOutxDsrFlow             = FALSE;
+                       CC.dcb.fDtrControl              = DTR_CONTROL_DISABLE;
+                       CC.dcb.fDsrSensitivity  = FALSE;
+                       CC.dcb.fRtsControl              = RTS_CONTROL_DISABLE;
+                       SetDefaultCommConfigA(name, &CC, CCsize);
+               }
+
+               if((com_handle=CreateFileA(name
+                       ,GENERIC_READ|GENERIC_WRITE     /* Access */
+                       ,0                                                              /* Share mode */
+                       ,NULL                                                   /* Security attributes */
+                       ,OPEN_EXISTING                                  /* Create access */
+                       ,FILE_ATTRIBUTE_NORMAL                  /* File attributes */
+                       ,NULL                                                   /* Template */
+                       ))==INVALID_HANDLE_VALUE)
+                       return false;
+
+               if(GetCommTimeouts(com_handle, &timeouts)) {
+                       timeouts.ReadIntervalTimeout=MAXDWORD;
+                       timeouts.ReadTotalTimeoutMultiplier=0;
+                       timeouts.ReadTotalTimeoutConstant=0;            // No-wait read timeout
+                       timeouts.WriteTotalTimeoutMultiplier=0;
+                       timeouts.WriteTotalTimeoutConstant=5000;        // 5 seconds
+                       SetCommTimeouts(com_handle,&timeouts);
+               }
+
+               /* Force N-8-1 mode: */
+               if(GetCommState(com_handle, &dcb)==TRUE) {
+                       dcb.ByteSize            = 8;
+                       dcb.Parity                      = NOPARITY;
+                       dcb.StopBits            = ONESTOPBIT;
+                       dcb.DCBlength           = sizeof(DCB);
+                       dcb.fBinary                     = TRUE;
+                       dcb.fOutxCtsFlow        = FALSE;
+                       dcb.fOutxDsrFlow        = FALSE;
+                       dcb.fDtrControl         = DTR_CONTROL_DISABLE;
+                       dcb.fDsrSensitivity     = FALSE;
+                       dcb.fTXContinueOnXoff= TRUE;
+                       dcb.fOutX                       = FALSE;
+                       dcb.fInX                        = FALSE;
+                       dcb.fRtsControl         = RTS_CONTROL_DISABLE;
+                       dcb.fAbortOnError       = FALSE;
+                       SetCommState(com_handle, &dcb);
+               }
+       }
+#else
+       {
+               struct termios t;
+
+               if((com_handle=open(name, O_NONBLOCK|O_RDWR))==COM_HANDLE_INVALID)
+                       return false;
+
+               if(tcgetattr(com_handle, &t)==-1) {
+                       close(com_handle);
+                       com_handle = COM_HANDLE_INVALID;
+                       return false;
+               }
+
+               t.c_iflag = (
+                                         IGNBRK   /* ignore BREAK condition */
+                                       | IGNPAR   /* ignore (discard) parity errors */
+                                       );
+               t.c_oflag = 0;  /* No output processing */
+               t.c_cflag = (
+                                         CS8         /* 8 bits */
+                                       | CREAD       /* enable receiver */
+               /*
+               Fun snippet from the FreeBSD manpage:
+
+                        If CREAD is set, the receiver is enabled.  Otherwise, no character is
+                        received.  Not all hardware supports this bit.  In fact, this flag is
+                        pretty silly and if it were not part of the termios specification it
+                        would be omitted.
+               */
+                                       | CLOCAL      /* ignore modem status lines */
+                                       );
+               t.c_lflag = 0;  /* No local modes */
+               if(tcsetattr(com_handle, TCSANOW, &t)==-1) {
+                       close(com_handle);
+                       com_handle = COM_HANDLE_INVALID;
+                       return false;
+               }
+               
+       }
+#endif
+       return true;
+}
+
+#ifdef _USE_ONIDLE
+void MainFrame::OnIdle(wxIdleEvent &evt) {
+}
+#endif
+
+//----------------------------------------------------------------
+// (raise|lower)(RTS|DTR)()
+//
+// Raises/lowers the specified signal
+//----------------------------------------------------------------
+void MainFrame::raiseDTR(void)
+{
+       if(com_handle == COM_HANDLE_INVALID)
+               return;
+#ifdef _WIN32
+       EscapeCommFunction(com_handle, SETDTR);
+#else
+       {       // For C89 happiness
+               int flags = TIOCM_DTR;
+               ioctl(com_handle, TIOCMBIS, &flags);
+       }
+#endif
+}
+void MainFrame::raiseRTS(void)
+{
+       if(com_handle == COM_HANDLE_INVALID)
+               return;
+#ifdef _WIN32
+       EscapeCommFunction(com_handle, SETRTS);
+#else
+       {       // For C89 happiness
+               int flags = TIOCM_RTS;
+               ioctl(com_handle, TIOCMBIS, &flags);
+       }
+#endif
+}
+void MainFrame::lowerDTR(void)
+{
+       if(com_handle == COM_HANDLE_INVALID)
+               return;
+#ifdef _WIN32
+       EscapeCommFunction(com_handle, CLRDTR);
+#else
+       {       // For C89 happiness
+               int flags = TIOCM_DTR;
+               ioctl(com_handle, TIOCMBIC, &flags);
+       }
+#endif
+}
+void MainFrame::lowerRTS(void)
+{
+       if(com_handle == COM_HANDLE_INVALID)
+               return;
+#ifdef _WIN32
+       EscapeCommFunction(com_handle, CLRRTS);
+#else
+       {       // For C89 happiness
+               int flags = TIOCM_RTS;
+               ioctl(com_handle, TIOCMBIC, &flags);
+       }
+#endif
+}
+
+
+#ifdef _USE_TIMER
+//----------------------------------------------------------------
+// OnTimer()
+//
+// when the timer fires every DT seconds we update the GUI displays.
+// the tabs only the plot that is visible actually gets updated, this
+// keeps CPU load reasonable
+//----------------------------------------------------------------
+void MainFrame::OnTimer(wxTimerEvent &evt)
+{
+
+    int r,c;
+
+    if (m_panelWaterfall->checkDT()) {
+        m_panelWaterfall->setRxFreq(FDMDV_FCENTRE - g_RxFreqOffsetHz);
+        m_panelWaterfall->m_newdata = true;
+        m_panelWaterfall->Refresh();
+    }
+
+    m_panelSpectrum->setRxFreq(FDMDV_FCENTRE - g_RxFreqOffsetHz);
+    m_panelSpectrum->m_newdata = true;
+    m_panelSpectrum->Refresh();
+
+    /* update scatter plot -----------------------------------------------------------------*/
+
+    for (r=0; r<g_stats.nr; r++) {
+        
+        if (g_pfreedv->mode == FREEDV_MODE_1600) {
+            m_panelScatter->add_new_samples(&g_stats.rx_symbols[r][0]);
+        }
+
+        if (g_pfreedv->mode == FREEDV_MODE_700) {
+
+            /* 
+               FreeDV 700 uses diversity, so combine symbols for
+               scatter plot, as combined symbols are used for
+               demodulation.  Note we need to use a copy of the
+               symbols, as we are not sure when the stats will be
+               updated.
+            */
+
+            COMP rx_symbols_copy[g_Nc/2];
+
+            for(c=0; c<g_Nc/2; c++)
+                rx_symbols_copy[c] = cadd(g_stats.rx_symbols[r][c], g_stats.rx_symbols[r][c+g_Nc/2]);
+            m_panelScatter->add_new_samples(rx_symbols_copy);
+        }
+       
+    }
+
+    m_panelScatter->Refresh();
+
+    // Oscilliscope type speech plots -------------------------------------------------------
+
+    short speechInPlotSamples[WAVEFORM_PLOT_BUF];
+    if (fifo_read(g_plotSpeechInFifo, speechInPlotSamples, WAVEFORM_PLOT_BUF)) {
+        memset(speechInPlotSamples, 0, WAVEFORM_PLOT_BUF*sizeof(short));
+        //fprintf(stderr, "empty!\n");
+    }
+    m_panelSpeechIn->add_new_short_samples(0, speechInPlotSamples, WAVEFORM_PLOT_BUF, 32767);
+    m_panelSpeechIn->Refresh();
+
+    short speechOutPlotSamples[WAVEFORM_PLOT_BUF];
+    if (fifo_read(g_plotSpeechOutFifo, speechOutPlotSamples, WAVEFORM_PLOT_BUF))
+        memset(speechOutPlotSamples, 0, WAVEFORM_PLOT_BUF*sizeof(short));
+    m_panelSpeechOut->add_new_short_samples(0, speechOutPlotSamples, WAVEFORM_PLOT_BUF, 32767);
+    m_panelSpeechOut->Refresh();
+
+    short demodInPlotSamples[WAVEFORM_PLOT_BUF];
+    if (fifo_read(g_plotDemodInFifo, demodInPlotSamples, WAVEFORM_PLOT_BUF)) {
+        memset(demodInPlotSamples, 0, WAVEFORM_PLOT_BUF*sizeof(short));
+    }
+    m_panelDemodIn->add_new_short_samples(0,demodInPlotSamples, WAVEFORM_PLOT_BUF, 32767);
+    m_panelDemodIn->Refresh();
+
+    // Demod states -----------------------------------------------------------------------
+
+    m_panelTimeOffset->add_new_sample(0, (float)g_stats.rx_timing/FDMDV_NOM_SAMPLES_PER_FRAME);
+    m_panelTimeOffset->Refresh();
+
+    m_panelFreqOffset->add_new_sample(0, g_stats.foff);
+    m_panelFreqOffset->Refresh();
+
+    // SNR text box and gauge ------------------------------------------------------------
+
+    // LP filter g_stats.snr_est some more to stabilise the
+    // display. g_stats.snr_est already has some low pass filtering
+    // but we need it fairly fast to activate squelch.  So we
+    // optionally perform some further filtering for the display
+    // version of SNR.  The "Slow" checkbox controls the amount of
+    // filtering.  The filtered snr also controls the squelch
+
+    g_snr = m_snrBeta*g_snr + (1.0 - m_snrBeta)*g_stats.snr_est;
+    float snr_limited = g_snr;
+    if (snr_limited < -5.0) snr_limited = -5.0;
+    if (snr_limited > 20.0) snr_limited = 20.0;
+
+    char snr[15];
+    sprintf(snr, "%d", (int)(g_snr+0.5)); // round to nearest dB
+
+    //printf("snr_est: %f m_snrBeta: %f g_snr: %f snr_limited: %f\n", g_stats.snr_est,  m_snrBeta, g_snr, snr_limited);
+
+    wxString snr_string(snr);
+    m_textSNR->SetLabel(snr_string);
+    m_gaugeSNR->SetValue((int)(snr_limited+5));
+
+    // Level Gauge -----------------------------------------------------------------------
+
+    float tooHighThresh;
+    if (!g_tx && m_RxRunning)
+    {
+        // receive mode - display From Radio peaks
+        // peak from this DT sampling period
+        int maxDemodIn = 0;
+        for(int i=0; i<WAVEFORM_PLOT_BUF; i++)
+            if (maxDemodIn < abs(demodInPlotSamples[i]))
+                maxDemodIn = abs(demodInPlotSamples[i]);
+
+        // peak from last second
+        if (maxDemodIn > m_maxLevel)
+            m_maxLevel = maxDemodIn;
+
+        tooHighThresh = FROM_RADIO_MAX;
+    }
+    else
+    {
+        // transmit mode - display From Mic peaks
+
+        // peak from this DT sampling period
+        int maxSpeechIn = 0;
+        for(int i=0; i<WAVEFORM_PLOT_BUF; i++)
+            if (maxSpeechIn < abs(speechInPlotSamples[i]))
+                maxSpeechIn = abs(speechInPlotSamples[i]);
+
+        // peak from last second
+        if (maxSpeechIn > m_maxLevel)
+            m_maxLevel = maxSpeechIn;
+
+       tooHighThresh = FROM_MIC_MAX;
+    }
+
+    // Peak Reading meter: updates peaks immediately, then slowly decays
+    int maxScaled = (int)(100.0 * ((float)m_maxLevel/32767.0));
+    m_gaugeLevel->SetValue(maxScaled);
+    //printf("maxScaled: %d\n", maxScaled);
+    if (((float)maxScaled/100) > tooHighThresh)
+        m_textLevel->SetLabel("Too High");
+    else
+        m_textLevel->SetLabel("");
+
+    m_maxLevel *= LEVEL_BETA;
+
+    // sync LED (Colours don't work on Windows) ------------------------
+
+    if (g_State) {
+        m_rbSync->SetForegroundColour( wxColour( 0, 255, 0 ) ); // green
+        m_rbSync->SetValue(true);
+    }
+    else {
+        m_rbSync->SetForegroundColour( wxColour( 255, 0, 0 ) ); // red
+        m_rbSync->SetValue(false);
+    }
+
+    // send Callsign ----------------------------------------------------
+
+    char callsign[MAX_CALLSIGN];
+    strncpy(callsign, (const char*) wxGetApp().m_callSign.mb_str(wxConvUTF8), MAX_CALLSIGN-1);
+
+    // buffer 1 txt message to ensure tx data fifo doesn't "run dry"
+
+    if ((unsigned)fifo_used(g_txDataInFifo) < strlen(callsign)) {
+        unsigned int  i;
+
+        //fprintf(g_logfile, "tx callsign: %s.\n", callsign);
+
+        /* optionally append checksum */
+
+        if (wxGetApp().m_enable_checksum) {
+
+            unsigned char checksum = 0;
+            char callsign_checksum_cr[MAX_CALLSIGN+1];
+
+            for(i=0; i<strlen(callsign); i++)
+                checksum += callsign[i];
+            sprintf(callsign_checksum_cr, "%s%2x", callsign, checksum);
+            callsign_checksum_cr[strlen(callsign)+2] = 13;
+            callsign_checksum_cr[strlen(callsign)+3] = 0;
+            strcpy(callsign, callsign_checksum_cr);
+        }
+        else {
+            callsign[strlen(callsign)] = 13;
+            callsign[strlen(callsign)+1] = 0;
+        }
+
+        //fprintf(g_logfile, "tx callsign: %s.\n", callsign);
+
+        // write chars to tx data fifo
+
+        for(i=0; i<strlen(callsign); i++) {
+            short ashort = (short)callsign[i];
+            fifo_write(g_txDataInFifo, &ashort, 1);
+        }
+    }
+
+    // See if any Callsign info received --------------------------------
+
+    short ashort;
+    while (fifo_read(g_rxDataOutFifo, &ashort, 1) == 0) {
+
+        if ((ashort == 13) || ((m_pcallsign - m_callsign) > MAX_CALLSIGN-1)) {
+            // CR completes line
+            *m_pcallsign = 0;
+            
+            /* Checksums can be disabled, e.g. for compatability with
+               older vesions.  In that case we print msg but don't do
+               any event processing.  If checksums enabled, only print
+               out when checksum is good. */
+
+            if (wxGetApp().m_enable_checksum) {
+                // lets see if checksum is OK
+            
+                unsigned char checksum_rx = 0;
+                if (strlen(m_callsign) > 2) {
+                    for(unsigned int i=0; i<strlen(m_callsign)-2; i++)
+                        checksum_rx += m_callsign[i];
+                }
+                unsigned int checksum_tx;
+                int ret = sscanf(&m_callsign[strlen(m_callsign)-2], "%2x", &checksum_tx);
+                //fprintf(g_logfile, "rx callsign: %s.\n  checksum tx: %02x checksum rx: %02x\n", m_callsign, checksum_tx, checksum_rx);
+
+                wxString s;
+                if (ret && (checksum_tx == checksum_rx)) {
+                    m_callsign[strlen(m_callsign)-2] = 0;
+                    s.Printf("%s", m_callsign);
+                    m_txtCtrlCallSign->SetValue(s);
+
+                    char s1[MAX_CALLSIGN];
+                    sprintf(s1,"rx_txtmsg %s", m_callsign);
+                    processTxtEvent(s1);
+
+                    m_checksumGood++;
+                    s.Printf("%d", m_checksumGood);
+                    m_txtChecksumGood->SetLabel(s);              
+                }
+                else {
+                    m_checksumBad++;
+                    s.Printf("%d", m_checksumBad);
+                    m_txtChecksumBad->SetLabel(s);        
+                }
+            }
+
+            //fprintf(g_logfile,"resetting callsign %s %ld\n", m_callsign, m_pcallsign-m_callsign);
+            // reset ptr to start of string
+            m_pcallsign = m_callsign;
+        }
+        else {
+            //fprintf(g_logfile, "new char %d %c\n", ashort, (char)ashort);
+            *m_pcallsign++ = (char)ashort;
+        }
+
+        /* If checksums disabled, display txt chars as they arrive */
+
+        if (!wxGetApp().m_enable_checksum) {
+            m_txtCtrlCallSign->SetValue(m_callsign);
+        }
+    }
+
+    // Run time update of EQ filters -----------------------------------
+    if (m_newMicInFilter || m_newSpkOutFilter) {
+        g_mutexProtectingCallbackData.Lock();
+        deleteEQFilters(g_rxUserdata);
+        designEQFilters(g_rxUserdata);
+        g_mutexProtectingCallbackData.Unlock();
+        m_newMicInFilter = m_newSpkOutFilter = false;
+    }
+    g_rxUserdata->micInEQEnable = wxGetApp().m_MicInEQEnable;
+    g_rxUserdata->spkOutEQEnable = wxGetApp().m_SpkOutEQEnable;
+
+    // Run time update of FreeDV 700 tx clipper
+
+    g_pfreedv->clip = (int)wxGetApp().m_FreeDV700txClip;
+
+    // Test Frame Bit Error Updates ------------------------------------
+
+    // Toggle test frame mode at run time
+
+    if (!g_pfreedv->test_frames && wxGetApp().m_testFrames) {
+
+        // reset stats on check box off to on transition
+
+        g_pfreedv->test_frames = 1;
+        g_pfreedv->test_frame_sync_state = 0;
+        g_pfreedv->total_bits = 0;
+        g_pfreedv->total_bit_errors = 0;
+    }
+    g_pfreedv->test_frames =  wxGetApp().m_testFrames;
+    g_channel_noise =  wxGetApp().m_channel_noise;
+
+    if (g_State) {
+        char bits[80], errors[80], ber[80];
+
+        // update stats on main page
+
+        sprintf(bits, "Bits: %d", (int)g_pfreedv->total_bits); wxString bits_string(bits); m_textBits->SetLabel(bits_string);
+        sprintf(errors, "Errs: %d", (int)g_pfreedv->total_bit_errors); wxString errors_string(errors); m_textErrors->SetLabel(errors_string);
+        float b = (float)g_pfreedv->total_bit_errors/(1E-6+g_pfreedv->total_bits);
+        sprintf(ber, "BER: %4.3f", b); wxString ber_string(ber); m_textBER->SetLabel(ber_string);
+
+        // update error plots
+
+        int sz_error_pattern = g_pfreedv->sz_error_pattern;
+        short error_pattern[sz_error_pattern];
+
+        if (fifo_read(g_error_pattern_fifo, error_pattern, sz_error_pattern) == 0) {
+            int i,b;
+
+            /* both modes map IQ to alternate bits, but one same carrier */
+
+            if (g_pfreedv->mode == FREEDV_MODE_1600) {
+                /* FreeDV 1600 mapping from error pattern to bit on each carrier */
+
+                for(b=0; b<g_Nc*2; b++) {
+                    for(i=b; i<sz_error_pattern; i+= 2*g_Nc) {
+                        m_panelTestFrameErrors->add_new_sample(b, b + 0.8*error_pattern[i]);
+                        g_error_hist[b] += error_pattern[i];
+                    }
+                    //if (b%2)
+                    //    printf("g_error_hist[%d]: %d\n", b/2, g_error_hist[b/2]);
+                }
+
+                int max_hist = 0;
+                for(b=0; b<g_Nc; b++)
+                    if (g_error_hist[b] > max_hist)
+                        max_hist = g_error_hist[b];
+
+                m_panelTestFrameErrorsHist->add_new_short_samples(0, g_error_hist, 2*FDMDV_NC_MAX, max_hist);
+            }
+       
+            if (g_pfreedv->mode == FREEDV_MODE_700) {
+                int c;
+
+                /* FreeDV 700 mapping from error pattern to bit on each
+                   carrier.  Note we don't have access to carriers before
+                   diversity re-combination, so this won't give us the full
+                   picture, we have to assume Nc/2 carriers. */
+
+                for(i=0; i<sz_error_pattern; i++) {
+                    c = i/4;
+                    m_panelTestFrameErrors->add_new_sample(c, c + 0.8*error_pattern[i]);
+                    g_error_hist[c] += error_pattern[i];
+                    //printf("i: %d c: %d\n", i, c);
+                }
+
+                int max_hist = 0;
+                for(b=0; b<g_Nc; b++)
+                    if (g_error_hist[b] > max_hist)
+                        max_hist = g_error_hist[b];
+                m_panelTestFrameErrorsHist->add_new_short_samples(0, g_error_hist, 2*FDMDV_NC_MAX, max_hist);                
+            }
+            m_panelTestFrameErrors->Refresh();       
+            m_panelTestFrameErrorsHist->Refresh();
+        }
+    }
+
+    // command from UDP thread that is best processed in main thread to avoid seg faults
+
+    if (m_schedule_restore) {
+        if (IsIconized())
+            Restore();
+        m_schedule_restore = false;
+    }
+
+    // Light Spam Timer LED if at least one timer is running
+
+    int i;
+    optionsDlg->SetSpamTimerLight(false);
+    for(i=0; i<MAX_EVENT_RULES; i++)
+        if (spamTimer[i].IsRunning())
+            optionsDlg->SetSpamTimerLight(true);        
+
+    // Blink file playback status line
+
+    if (g_playFileFromRadio) {
+        g_blink += DT;
+        //fprintf(g_logfile, "g_blink: %f\n", g_blink);
+        if ((g_blink >= 1.0) && (g_blink < 2.0))
+            SetStatusText(wxT("Playing into from radio"), 0);
+        if (g_blink >= 2.0) {
+            SetStatusText(wxT(""), 0);
+            g_blink = 0.0;
+        }
+    }
+
+}
+#endif
+
+
+//-------------------------------------------------------------------------
+// OnCloseFrame()
+//-------------------------------------------------------------------------
+void MainFrame::OnCloseFrame(wxCloseEvent& event)
+{
+    Pa_Terminate();
+    Destroy();
+}
+
+//-------------------------------------------------------------------------
+// OnTop()
+//-------------------------------------------------------------------------
+void MainFrame::OnTop(wxCommandEvent& event)
+{
+    int style = GetWindowStyle();
+
+    if (style & wxSTAY_ON_TOP)
+    {
+        style &= ~wxSTAY_ON_TOP;
+    }
+    else
+    {
+        style |= wxSTAY_ON_TOP;
+    }
+    SetWindowStyle(style);
+}
+
+//-------------------------------------------------------------------------
+// OnDeleteConfig()
+//-------------------------------------------------------------------------
+void MainFrame::OnDeleteConfig(wxCommandEvent&)
+{
+    wxConfigBase *pConfig = wxConfigBase::Get();
+    if(pConfig->DeleteAll())
+    {
+        wxLogMessage(wxT("Config file/registry key successfully deleted."));
+
+        delete wxConfigBase::Set(NULL);
+        wxConfigBase::DontCreateOnDemand();
+    }
+    else
+    {
+        wxLogError(wxT("Deleting config file/registry key failed."));
+    }
+}
+
+//-------------------------------------------------------------------------
+// Paint()
+//-------------------------------------------------------------------------
+void MainFrame::OnPaint(wxPaintEvent& WXUNUSED(event))
+{
+    wxPaintDC dc(this);
+
+    if(GetMenuBar()->IsChecked(ID_PAINT_BG))
+    {
+        dc.Clear();
+    }
+    dc.SetUserScale(m_zoom, m_zoom);
+}
+
+//-------------------------------------------------------------------------
+// OnCmdSliderScroll()
+//-------------------------------------------------------------------------
+void MainFrame::OnCmdSliderScroll(wxScrollEvent& event)
+{
+    char sqsnr[15];
+    g_SquelchLevel = (float)m_sliderSQ->GetValue()/2.0 - 5.0;   
+    sprintf(sqsnr, "%4.1f", g_SquelchLevel); // 0.5 dB steps
+    wxString sqsnr_string(sqsnr);
+    m_textSQ->SetLabel(sqsnr_string);
+
+    event.Skip();
+}
+
+//-------------------------------------------------------------------------
+// OnCheckSQClick()
+//-------------------------------------------------------------------------
+void MainFrame::OnCheckSQClick(wxCommandEvent& event)
+{
+    if(!g_SquelchActive)
+    {
+        g_SquelchActive = true;
+    }
+    else
+    {
+        g_SquelchActive = false;
+    }
+}
+
+void MainFrame::setsnrBeta(bool snrSlow)
+{
+    if(snrSlow)
+    {
+        m_snrBeta = 0.95; // make this closer to 1.0 to smooth SNR est further
+    }
+    else
+    {
+        m_snrBeta = 0.0; // no smoothing of SNR estimate from demodulator
+    }
+}
+
+//-------------------------------------------------------------------------
+// OnCheckSQClick()
+//-------------------------------------------------------------------------
+void MainFrame::OnCheckSNRClick(wxCommandEvent& event)
+{
+    wxGetApp().m_snrSlow = m_ckboxSNR->GetValue();
+    setsnrBeta(wxGetApp().m_snrSlow);
+    //printf("m_snrSlow: %d\n", (int)wxGetApp().m_snrSlow);
+}
+
+// check for space bar press (only when running)
+
+int MainApp::FilterEvent(wxEvent& event)
+{
+    if ((event.GetEventType() == wxEVT_KEY_DOWN) && 
+        (((wxKeyEvent&)event).GetKeyCode() == WXK_SPACE))
+        {
+            // only use space to toggle PTT if we are running and no modal dialogs (like options) up
+            //fprintf(stderr,"frame->m_RxRunning: %d g_modal: %d\n",
+            //        frame->m_RxRunning, g_modal);
+            if (frame->m_RxRunning && !g_modal) {
+                if (frame->m_btnTogPTT->GetValue())
+                    frame->m_btnTogPTT->SetValue(false);
+                else
+                    frame->m_btnTogPTT->SetValue(true);
+
+                frame->togglePTT();
+
+                return true; // absorb space so we don't toggle control with focus (e.g. Start)
+
+            }
+        }
+
+    return -1;
+}
+
+//-------------------------------------------------------------------------
+// OnTogBtnPTT ()
+//-------------------------------------------------------------------------
+void MainFrame::OnTogBtnPTT (wxCommandEvent& event)
+{
+    togglePTT();
+    event.Skip();
+}
+
+void MainFrame::togglePTT(void) {
+
+    // Change tabbed page in centre panel depending on PTT state
+
+    if (g_tx)
+    {
+        // tx-> rx transition, swap to the page we were on for last rx
+        m_auiNbookCtrl->ChangeSelection(wxGetApp().m_rxNbookCtrl);
+    }
+    else
+    {
+        // rx-> tx transition, swap to Mic In page to monitor speech
+        wxGetApp().m_rxNbookCtrl = m_auiNbookCtrl->GetSelection();
+        m_auiNbookCtrl->ChangeSelection(m_auiNbookCtrl->GetPageIndex((wxWindow *)m_panelSpeechIn));
+        char e[80]; sprintf(e,"ptt"); processTxtEvent(e);
+    }
+
+    g_tx = m_btnTogPTT->GetValue();
+
+    // Hamlib PTT
+
+    if (wxGetApp().m_boolHamlibUseForPTT) {        
+        Hamlib *hamlib = wxGetApp().m_hamlib; 
+        if (wxGetApp().m_boolHamlibUseForPTT && hamlib != NULL) {
+            hamlib->ptt(g_tx);
+        }
+    }
+
+    // Serial PTT
+
+    /*  Truth table:
+
+          g_tx   RTSPos   RTS
+          -------------------
+          0      1        0
+          1      1        1
+          0      0        1
+          1      0        0
+
+          exclusive NOR
+    */
+
+    if(wxGetApp().m_boolUseSerialPTT && (com_handle != COM_HANDLE_INVALID)) {
+        if (wxGetApp().m_boolUseRTS) {
+            printf("g_tx: %d m_boolRTSPos: %d serialLine: %d\n", g_tx, wxGetApp().m_boolRTSPos, g_tx == wxGetApp().m_boolRTSPos);
+            if (g_tx == wxGetApp().m_boolRTSPos)
+                raiseRTS();
+            else
+                lowerRTS();
+        }
+        if (wxGetApp().m_boolUseDTR) {
+            printf("g_tx: %d m_boolDTRPos: %d serialLine: %d\n", g_tx, wxGetApp().m_boolDTRPos, g_tx == wxGetApp().m_boolDTRPos);
+            if (g_tx == wxGetApp().m_boolDTRPos)
+                raiseDTR();
+            else
+                lowerDTR();
+        }
+    }
+
+    // reset level gauge
+
+    m_maxLevel = 0;
+    m_textLevel->SetLabel(wxT(""));
+    m_gaugeLevel->SetValue(0);
+}
+
+//-------------------------------------------------------------------------
+// OnTogBtnRxID()
+//-------------------------------------------------------------------------
+void MainFrame::OnTogBtnRxID(wxCommandEvent& event)
+{
+    // empty any junk in rx data FIFO
+    short junk;
+    while(fifo_read(g_rxDataOutFifo,&junk,1) == 0);
+    event.Skip();
+}
+
+//-------------------------------------------------------------------------
+// OnTogBtnTxID()
+//-------------------------------------------------------------------------
+void MainFrame::OnTogBtnTxID(wxCommandEvent& event)
+{
+    event.Skip();
+}
+
+void MainFrame::OnTogBtnSplitClick(wxCommandEvent& event) {
+    if (g_split)
+        g_split = 0;
+    else
+        g_split = 1;
+    event.Skip();
+}
+
+//-------------------------------------------------------------------------
+// OnTogBtnAnalogClick()
+//-------------------------------------------------------------------------
+void MainFrame::OnTogBtnAnalogClick (wxCommandEvent& event)
+{
+    if (g_analog == 0) {
+        g_analog = 1;
+        m_panelSpectrum->setFreqScale(MODEM_STATS_NSPEC*((float)MAX_F_HZ/(FS/2)));
+        m_panelWaterfall->setFs(FS);
+    }
+    else {
+        g_analog = 0;
+        m_panelSpectrum->setFreqScale(MODEM_STATS_NSPEC*((float)MAX_F_HZ/(g_pfreedv->modem_sample_rate/2)));
+        m_panelWaterfall->setFs(g_pfreedv->modem_sample_rate);
+    }
+
+    g_State = 0;
+    g_stats.snr_est = 0;
+
+    event.Skip();
+}
+
+void MainFrame::OnCallSignReset(wxCommandEvent& event)
+{
+    m_pcallsign = m_callsign;
+    memset(m_callsign, 0, MAX_CALLSIGN);
+    wxString s;
+    s.Printf("%s", m_callsign);
+    m_txtCtrlCallSign->SetValue(s);
+    m_checksumGood = m_checksumBad = 0;
+    m_txtChecksumGood->SetLabel(_("0"));
+    m_txtChecksumBad->SetLabel(_("0"));
+}
+
+void MainFrame::OnBerReset(wxCommandEvent& event)
+{
+    g_pfreedv->total_bits = 0;
+    g_pfreedv->total_bit_errors = 0;
+    int i;
+    for(i=0; i<2*g_Nc; i++)
+        g_error_hist[i] = 0;
+    
+}
+
+#ifdef ALC
+//-------------------------------------------------------------------------
+// OnTogBtnALCClick()
+//-------------------------------------------------------------------------
+void MainFrame::OnTogBtnALCClick(wxCommandEvent& event)
+{
+    wxMessageBox(wxT("Got Click!"), wxT("OnTogBtnALCClick"), wxOK);
+
+    event.Skip();
+}
+#endif
+
+// extra panel added to file open dialog to add loop checkbox
+MyExtraPlayFilePanel::MyExtraPlayFilePanel(wxWindow *parent): wxPanel(parent)
+{
+    m_cb = new wxCheckBox(this, -1, wxT("Loop"));
+    m_cb->SetToolTip(_("When checked file will repeat forever"));
+    m_cb->SetValue(g_loopPlayFileToMicIn);
+
+    // bug: I can't this to align right.....
+    wxBoxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
+    sizerTop->Add(m_cb, 0, wxALIGN_RIGHT, 0);
+    SetSizerAndFit(sizerTop);
+}
+
+static wxWindow* createMyExtraPlayFilePanel(wxWindow *parent)
+{
+    return new MyExtraPlayFilePanel(parent);
+}
+
+//-------------------------------------------------------------------------
+// OnPlayFileToMicIn()
+//-------------------------------------------------------------------------
+void MainFrame::OnPlayFileToMicIn(wxCommandEvent& event)
+{
+    wxUnusedVar(event);
+
+    if(g_playFileToMicIn)
+    {
+        g_mutexProtectingCallbackData.Lock();
+        g_playFileToMicIn = false;
+        sf_close(g_sfPlayFile);
+        SetStatusText(wxT(""));
+        g_mutexProtectingCallbackData.Unlock();
+    }
+    else
+    {
+        wxString    soundFile;
+        SF_INFO     sfInfo;
+
+        wxFileDialog openFileDialog(
+                                    this,
+                                    wxT("Play File to Mic In"),
+                                    wxGetApp().m_playFileToMicInPath,
+                                    wxEmptyString,
+                                    wxT("WAV and RAW files (*.wav;*.raw)|*.wav;*.raw|")
+                                    wxT("All files (*.*)|*.*"),
+                                    wxFD_OPEN | wxFD_FILE_MUST_EXIST
+                                    );
+
+        // add the loop check box
+        openFileDialog.SetExtraControlCreator(&createMyExtraPlayFilePanel);
+
+        if(openFileDialog.ShowModal() == wxID_CANCEL)
+        {
+            return;     // the user changed their mind...
+        }
+
+        wxString fileName, extension;
+        soundFile = openFileDialog.GetPath();
+        wxFileName::SplitPath(soundFile, &wxGetApp().m_playFileToMicInPath, &fileName, &extension);
+        //wxLogDebug("m_playFileToMicInPath: %s", wxGetApp().m_playFileToMicInPath);
+        sfInfo.format = 0;
+
+        if(!extension.IsEmpty())
+        {
+            extension.LowerCase();
+            if(extension == wxT("raw"))
+            {
+                sfInfo.format     = SF_FORMAT_RAW | SF_FORMAT_PCM_16;
+                sfInfo.channels   = 1;
+                sfInfo.samplerate = FS;
+            }
+        }
+        g_sfPlayFile = sf_open(soundFile, SFM_READ, &sfInfo);
+        if(g_sfPlayFile == NULL)
+        {
+            wxString strErr = sf_strerror(NULL);
+            wxMessageBox(strErr, wxT("Couldn't open sound file"), wxOK);
+            return;
+        }
+
+        wxWindow * const ctrl = openFileDialog.GetExtraControl();
+
+        // Huh?! I just copied wxWidgets-2.9.4/samples/dialogs ....
+        g_loopPlayFileToMicIn = static_cast<MyExtraPlayFilePanel*>(ctrl)->getLoopPlayFileToMicIn();
+
+        SetStatusText(wxT("Playing File: ") + fileName + wxT(" to Mic Input") , 0);
+        g_playFileToMicIn = true;
+    }
+}
+
+//-------------------------------------------------------------------------
+// OnPlayFileFromRadio()
+// This puppy "plays" a recorded file into the demodulator input, allowing us
+// to replay off air signals.
+//-------------------------------------------------------------------------
+void MainFrame::OnPlayFileFromRadio(wxCommandEvent& event)
+{
+    wxUnusedVar(event);
+
+    printf("OnPlayFileFromRadio:: %d\n", (int)g_playFileFromRadio);
+    if (g_playFileFromRadio)
+    {
+        printf("OnPlayFileFromRadio:: Stop\n");
+        g_mutexProtectingCallbackData.Lock();
+        g_playFileFromRadio = false;
+        sf_close(g_sfPlayFileFromRadio);
+        SetStatusText(wxT(""),0);
+        SetStatusText(wxT(""),1);
+        g_mutexProtectingCallbackData.Unlock();
+    }
+    else
+    {
+        wxString    soundFile;
+        SF_INFO     sfInfo;
+
+        wxFileDialog openFileDialog(
+                                    this,
+                                    wxT("Play File - From Radio"),
+                                    wxGetApp().m_playFileFromRadioPath,
+                                    wxEmptyString,
+                                    wxT("WAV and RAW files (*.wav;*.raw)|*.wav;*.raw|")
+                                    wxT("All files (*.*)|*.*"),
+                                    wxFD_OPEN | wxFD_FILE_MUST_EXIST
+                                    );
+
+        // add the loop check box
+        openFileDialog.SetExtraControlCreator(&createMyExtraPlayFilePanel);
+
+        if(openFileDialog.ShowModal() == wxID_CANCEL)
+        {
+            return;     // the user changed their mind...
+        }
+
+        wxString fileName, extension;
+        soundFile = openFileDialog.GetPath();
+        wxFileName::SplitPath(soundFile, &wxGetApp().m_playFileFromRadioPath, &fileName, &extension);
+        //wxLogDebug("m_playFileToFromRadioPath: %s", wxGetApp().m_playFileFromRadioPath);
+        sfInfo.format = 0;
+
+        if(!extension.IsEmpty())
+        {
+            extension.LowerCase();
+            if(extension == wxT("raw"))
+            {
+                sfInfo.format     = SF_FORMAT_RAW | SF_FORMAT_PCM_16;
+                sfInfo.channels   = 1;
+                sfInfo.samplerate = g_pfreedv->modem_sample_rate;
+            }
+        }
+        g_sfPlayFileFromRadio = sf_open(soundFile, SFM_READ, &sfInfo);
+        g_sfFs = sfInfo.samplerate;
+        if(g_sfPlayFileFromRadio == NULL)
+        {
+            wxString strErr = sf_strerror(NULL);
+            wxMessageBox(strErr, wxT("Couldn't open sound file"), wxOK);
+            return;
+        }
+
+        wxWindow * const ctrl = openFileDialog.GetExtraControl();
+
+        // Huh?! I just copied wxWidgets-2.9.4/samples/dialogs ....
+        g_loopPlayFileFromRadio = static_cast<MyExtraPlayFilePanel*>(ctrl)->getLoopPlayFileToMicIn();
+
+        SetStatusText(wxT("Playing into from radio"), 0);
+        if(extension == wxT("raw")) {
+            wxString stringnumber = wxString::Format(wxT("%d"), (int)sfInfo.samplerate);
+            SetStatusText(wxT("raw file assuming Fs=") + stringnumber, 1);          
+        }
+        fprintf(g_logfile, "OnPlayFileFromRadio:: Playing File\n");
+        g_playFileFromRadio = true;
+        g_blink = 0.0;
+    }
+}
+
+// extra panel added to file save dialog to set number of seconds to record for
+
+MyExtraRecFilePanel::MyExtraRecFilePanel(wxWindow *parent): wxPanel(parent)
+{
+    wxBoxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
+
+    wxStaticText* staticText = new wxStaticText(this, wxID_ANY, _("Seconds:"), wxDefaultPosition, wxDefaultSize, 0);
+    sizerTop->Add(staticText, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
+    m_secondsToRecord = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
+    m_secondsToRecord->SetToolTip(_("Number of seconds to record for"));
+    m_secondsToRecord->SetValue(wxString::Format(wxT("%i"), wxGetApp().m_recFileFromRadioSecs));
+    sizerTop->Add(m_secondsToRecord, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
+    SetSizerAndFit(sizerTop);
+}
+
+static wxWindow* createMyExtraRecFilePanel(wxWindow *parent)
+{
+    return new MyExtraRecFilePanel(parent);
+}
+
+//-------------------------------------------------------------------------
+// OnRecFileFromRadio()
+//-------------------------------------------------------------------------
+void MainFrame::OnRecFileFromRadio(wxCommandEvent& event)
+{
+    wxUnusedVar(event);
+
+    if (g_recFileFromRadio) {
+        printf("Stopping Record....\n");
+        g_mutexProtectingCallbackData.Lock();
+        g_recFileFromRadio = false;
+        sf_close(g_sfRecFile);
+        SetStatusText(wxT(""));
+        g_mutexProtectingCallbackData.Unlock();
+    }
+    else {
+
+        wxString    soundFile;
+        SF_INFO     sfInfo;
+
+         wxFileDialog openFileDialog(
+                                    this,
+                                    wxT("Record File From Radio"),
+                                    wxGetApp().m_recFileFromRadioPath,
+                                    wxEmptyString,
+                                    wxT("WAV and RAW files (*.wav;*.raw)|*.wav;*.raw|")
+                                    wxT("All files (*.*)|*.*"),
+                                    wxFD_SAVE
+                                    );
+
+        // add the loop check box
+        openFileDialog.SetExtraControlCreator(&createMyExtraRecFilePanel);
+
+        if(openFileDialog.ShowModal() == wxID_CANCEL)
+        {
+            return;     // the user changed their mind...
+        }
+
+        wxString fileName, extension;
+        soundFile = openFileDialog.GetPath();
+        wxFileName::SplitPath(soundFile, &wxGetApp().m_recFileFromRadioPath, &fileName, &extension);
+        wxLogDebug("m_recFileFromRadioPath: %s", wxGetApp().m_recFileFromRadioPath);
+        wxLogDebug("soundFile: %s", soundFile);
+        sfInfo.format = 0;
+
+        if(!extension.IsEmpty())
+        {
+            extension.LowerCase();
+            if(extension == wxT("raw"))
+            {
+                sfInfo.format     = SF_FORMAT_RAW | SF_FORMAT_PCM_16;
+                sfInfo.channels   = 1;
+                sfInfo.samplerate = g_pfreedv->modem_sample_rate;
+            }
+            else if(extension == wxT("wav"))
+            {
+                sfInfo.format     = SF_FORMAT_WAV | SF_FORMAT_PCM_16;
+                sfInfo.channels   = 1;
+                sfInfo.samplerate = g_pfreedv->modem_sample_rate;
+            } else {
+                wxMessageBox(wxT("Invalid file format"), wxT("Record File From Radio"), wxOK);
+                return;
+            }
+        }
+        else {
+            wxMessageBox(wxT("Invalid file format"), wxT("Record File From Radio"), wxOK);
+            return;
+        }
+
+        // Bug: on Win32 I cant read m_recFileFromRadioSecs, so have hard coded it
+#ifdef __WIN32__
+        long secs = wxGetApp().m_recFileFromRadioSecs;
+        g_recFromRadioSamples = FS*(unsigned int)secs;
+#else
+        // work out number of samples to record
+
+        wxWindow * const ctrl = openFileDialog.GetExtraControl();
+        wxString secsString = static_cast<MyExtraRecFilePanel*>(ctrl)->getSecondsToRecord();
+        wxLogDebug("test: %s secsString: %s\n", wxT("testing 123"), secsString);
+
+        long secs;
+        if (secsString.ToLong(&secs)) {
+            wxGetApp().m_recFileFromRadioSecs = (unsigned int)secs;
+            //printf(" secondsToRecord: %d\n",  (unsigned int)secs);
+            g_recFromRadioSamples = FS*(unsigned int)secs;
+            //printf("g_recFromRadioSamples: %d\n", g_recFromRadioSamples);
+        }
+        else {
+            wxMessageBox(wxT("Invalid number of Seconds"), wxT("Record File From Radio"), wxOK);
+            return;
+        }
+#endif
+
+        g_sfRecFile = sf_open(soundFile, SFM_WRITE, &sfInfo);
+        if(g_sfRecFile == NULL)
+        {
+            wxString strErr = sf_strerror(NULL);
+            wxMessageBox(strErr, wxT("Couldn't open sound file"), wxOK);
+            return;
+        }
+
+        SetStatusText(wxT("Recording File: ") + fileName + wxT(" From Radio") , 0);
+        g_recFileFromRadio = true;
+    }
+
+}
+
+//-------------------------------------------------------------------------
+// OnExit()
+//-------------------------------------------------------------------------
+void MainFrame::OnExit(wxCommandEvent& event)
+{
+    wxUnusedVar(event);
+#ifdef _USE_TIMER
+    m_plotTimer.Stop();
+#endif // _USE_TIMER
+    if(g_sfPlayFile != NULL)
+    {
+        sf_close(g_sfPlayFile);
+        g_sfPlayFile = NULL;
+    }
+    if(g_sfRecFile != NULL)
+    {
+        sf_close(g_sfRecFile);
+        g_sfRecFile = NULL;
+    }
+    if(m_RxRunning)
+    {
+        stopRxStream();
+    }
+    m_togBtnSplit->Disable();
+    //m_togRxID->Disable();
+    //m_togTxID->Disable();
+    m_togBtnAnalog->Disable();
+    //m_togBtnALC->Disable();
+    //m_btnTogPTT->Disable();
+    Pa_Terminate();
+    Destroy();
+}
+
+//-------------------------------------------------------------------------
+// OnExitClick()
+//-------------------------------------------------------------------------
+void MainFrame::OnExitClick(wxCommandEvent& event)
+{
+    OnExit(event);
+}
+
+//-------------------------------------------------------------------------
+// OnToolsAudio()
+//-------------------------------------------------------------------------
+void MainFrame::OnToolsAudio(wxCommandEvent& event)
+{
+    wxUnusedVar(event);
+    int rv = 0;
+    AudioOptsDialog *dlg = new AudioOptsDialog(NULL);
+    rv = dlg->ShowModal();
+    if(rv == wxID_OK)
+    {
+        dlg->ExchangeData(EXCHANGE_DATA_OUT);
+    }
+    delete dlg;
+}
+
+//-------------------------------------------------------------------------
+// OnToolsAudioUI()
+//-------------------------------------------------------------------------
+void MainFrame::OnToolsAudioUI(wxUpdateUIEvent& event)
+{
+    event.Enable(!m_RxRunning);
+}
+
+//-------------------------------------------------------------------------
+// OnToolsFilter()
+//-------------------------------------------------------------------------
+void MainFrame::OnToolsFilter(wxCommandEvent& event)
+{
+    wxUnusedVar(event);
+    FilterDlg *dlg = new FilterDlg(NULL, m_RxRunning, &m_newMicInFilter, &m_newSpkOutFilter);
+    dlg->ShowModal();
+    delete dlg;
+}
+
+//-------------------------------------------------------------------------
+// OnToolsOptions()
+//-------------------------------------------------------------------------
+void MainFrame::OnToolsOptions(wxCommandEvent& event)
+{
+    wxUnusedVar(event);
+    g_modal = true;
+    //fprintf(stderr,"g_modal: %d\n", g_modal);
+    optionsDlg->Show();
+}
+
+//-------------------------------------------------------------------------
+// OnToolsOptionsUI()
+//-------------------------------------------------------------------------
+void MainFrame::OnToolsOptionsUI(wxUpdateUIEvent& event)
+{
+}
+
+//-------------------------------------------------------------------------
+// OnToolsComCfg()
+//-------------------------------------------------------------------------
+void MainFrame::OnToolsComCfg(wxCommandEvent& event)
+{
+    wxUnusedVar(event);
+
+    ComPortsDlg *dlg = new ComPortsDlg(NULL);
+
+    int rv = dlg->ShowModal();
+
+    // test Hamlib/Serial set up
+
+    if(rv == wxID_OK)
+    {
+        if (wxGetApp().m_boolHamlibUseForPTT) {
+            OpenHamlibRig();
+            wxGetApp().m_hamlib->close();
+        }
+        if (wxGetApp().m_boolUseSerialPTT) {
+            SetupSerialPort();
+            CloseSerialPort();
+        }
+    }
+
+    delete dlg;
+}
+
+//-------------------------------------------------------------------------
+// OnToolsComCfgUI()
+//-------------------------------------------------------------------------
+void MainFrame::OnToolsComCfgUI(wxUpdateUIEvent& event)
+{
+    event.Enable(!m_RxRunning);
+}
+
+//-------------------------------------------------------------------------
+// OnHelpCheckUpdates()
+//-------------------------------------------------------------------------
+void MainFrame::OnHelpCheckUpdates(wxCommandEvent& event)
+{
+    wxMessageBox("Got Click!", "OnHelpCheckUpdates", wxOK);
+    event.Skip();
+}
+
+//-------------------------------------------------------------------------
+// OnHelpCheckUpdatesUI()
+//-------------------------------------------------------------------------
+void MainFrame::OnHelpCheckUpdatesUI(wxUpdateUIEvent& event)
+{
+    event.Enable(false);
+}
+
+//-------------------------------------------------------------------------
+//OnHelpAbout()
+//-------------------------------------------------------------------------
+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
+    wxURL url(wxT("http://svn.code.sf.net/p/freetel/code/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("<h2>p/freetel/code - Revision ");
+            int startIndex = htmldata.find(s) + s.Length();
+            int endIndex = htmldata.find(wxT(": /fdmdv2</h2>"));
+            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("How much have you spent on Ham gear this year?  How did it compare to FreeDV? ")
+                wxT("FreeDV repesents an open and free future for digital voice over Ham Radio. ")
+                wxT("Please help by donating just $10 here: 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);
+
+#endif // _USE_ABOUT_DIALOG
+#ifdef USE_SIMPLE_ABOUT_DIALOG
+    wxUnusedVar(event);
+    wxAboutDialogInfo info;
+    info.SetCopyright(_("HAMLib Test"));
+    info.SetLicence(_("GPL v2 or later"));
+    info.SetDescription(_("Short description goes here"));
+    ::wxAboutBox(info);
+#endif // USE_SIMPLE_ABOUT_DIALOG
+
+}
+
+
+// Attempt to talk to rig using Hamlib
+
+bool MainFrame::OpenHamlibRig() {
+    if (wxGetApp().m_boolHamlibUseForPTT != true)
+       return false;
+    if (wxGetApp().m_intHamlibRig == 0)
+        return false;
+    if (wxGetApp().m_hamlib == NULL)
+        return false;
+
+    int rig = wxGetApp().m_intHamlibRig;
+    wxString port = wxGetApp().m_strHamlibSerialPort;
+    bool status = wxGetApp().m_hamlib->connect(rig, port.mb_str(wxConvUTF8));
+    if (status == false)
+        wxMessageBox("Couldn't connect to Radio with hamlib", wxT("About"), wxOK | wxICON_ERROR, this);
+    return status;
+} 
+
+//-------------------------------------------------------------------------
+// OnTogBtnOnOff()
+//-------------------------------------------------------------------------
+void MainFrame::OnTogBtnOnOff(wxCommandEvent& event)
+{
+    wxString startStop = m_togBtnOnOff->GetLabel();
+
+    // we are attempting to start
+
+    if (startStop.IsSameAs("Start"))
+    {
+        //
+        // Start Running -------------------------------------------------
+        //
+
+        // modify some button states when running
+
+        m_togBtnSplit->Enable();
+        m_togBtnAnalog->Enable();
+        m_togBtnOnOff->SetLabel(wxT("Stop"));
+        m_btnTogPTT->Enable();
+
+        m_rb1600->Disable();
+        m_rb700->Disable();
+
+        // determine what mode we are using
+
+        if (m_rb1600->GetValue()) {
+            g_mode = FREEDV_MODE_1600;
+            g_Nc = 16;
+            m_panelScatter->setNc(g_Nc);
+        }
+        if (m_rb700->GetValue()) {
+            g_mode = FREEDV_MODE_700;
+            g_Nc = 14;
+            m_panelScatter->setNc(g_Nc/2-1);  /* due to diversity, -1 due to no pilot like FreeDV 1600 */
+        }
+   
+        // init freedv states
+
+        g_pfreedv = freedv_open(g_mode);
+        g_pfreedv->callback_state = NULL;
+        g_pfreedv->freedv_get_next_tx_char = &my_get_next_tx_char;
+        g_pfreedv->freedv_put_next_rx_char = &my_put_next_rx_char;
+
+        g_pfreedv->error_pattern_callback_state = (void*)m_panelTestFrameErrors;
+        g_pfreedv->freedv_put_error_pattern = &my_freedv_put_error_pattern;
+        g_error_pattern_fifo = fifo_create(2*g_pfreedv->sz_error_pattern);
+        g_error_hist = new short[FDMDV_NC_MAX*2];
+        int i;
+        for(i=0; i<2*FDMDV_NC_MAX; i++)
+            g_error_hist[i] = 0;
+
+        //if (g_mode == FREEDV_MODE_700)
+        //    cohpsk_set_verbose(g_pfreedv->cohpsk, 1);
+
+        //cohpsk_set_verbose(g_pfreedv->cohpsk, 1);
+        assert(g_pfreedv != NULL);
+        modem_stats_open(&g_stats);
+
+        // Init Speex pre-processor states
+        // by inspecting Speex source it seems that only denoiser is on be default
+
+        g_speex_st = speex_preprocess_state_init(g_pfreedv->n_speech_samples, FS); 
+
+        // adjust spectrum and waterfall freq scaling base on mode
+
+        m_panelSpectrum->setFreqScale(MODEM_STATS_NSPEC*((float)MAX_F_HZ/(g_pfreedv->modem_sample_rate/2)));
+        m_panelWaterfall->setFs(g_pfreedv->modem_sample_rate);
+
+        // adjust scatter diagram for Number of FDM carriers
+
+        // init Codec 2 LPC Post Filter
+
+        codec2_set_lpc_post_filter(g_pfreedv->codec2,
+                                   wxGetApp().m_codec2LPCPostFilterEnable,
+                                   wxGetApp().m_codec2LPCPostFilterBassBoost,
+                                   wxGetApp().m_codec2LPCPostFilterBeta,
+                                   wxGetApp().m_codec2LPCPostFilterGamma);
+
+        g_State = 0;
+        g_snr = 0.0;
+        g_half_duplex = wxGetApp().m_boolHalfDuplex;
+
+        m_pcallsign = m_callsign;
+        memset(m_callsign, 0, sizeof(m_callsign));
+        m_checksumGood = m_checksumBad = 0;
+        wxString s;
+        s.Printf("%d", m_checksumGood);
+        m_txtChecksumGood->SetLabel(s);              
+        s.Printf("%d", m_checksumBad);
+        m_txtChecksumBad->SetLabel(s);        
+
+        m_maxLevel = 0;
+        m_textLevel->SetLabel(wxT(""));
+        m_gaugeLevel->SetValue(0);
+
+        // Init text msg decoding
+
+        varicode_set_code_num(&g_pfreedv->varicode_dec_states, wxGetApp().m_textEncoding);
+        //printf("m_textEncoding = %d\n", wxGetApp().m_textEncoding);
+        //printf("g_stats.snr: %f\n", g_stats.snr_est);
+
+        // attempt to start PTT ......
+        
+        if (wxGetApp().m_boolHamlibUseForPTT)
+            OpenHamlibRig();
+        if (wxGetApp().m_boolUseSerialPTT) {
+            SetupSerialPort();
+        }
+
+        // attempt to start sound cards and tx/rx processing
+
+        startRxStream();
+
+        if (m_RxRunning)
+        {
+#ifdef _USE_TIMER
+            m_plotTimer.Start(_REFRESH_TIMER_PERIOD, wxTIMER_CONTINUOUS);
+#endif // _USE_TIMER
+        }
+        char e[80]; sprintf(e,"start"); processTxtEvent(e);
+    }
+
+    // Stop was pressed or start up failed
+
+    if (startStop.IsSameAs("Stop") || !m_RxRunning ) {
+
+        //
+        // Stop Running -------------------------------------------------
+        //
+
+        optionsDlg->SetSpamTimerLight(false);
+
+#ifdef _USE_TIMER
+        m_plotTimer.Stop();
+#endif // _USE_TIMER
+
+        // ensure we are not transmitting and shut down audio processing
+
+        if (wxGetApp().m_boolHamlibUseForPTT) {
+            Hamlib *hamlib = wxGetApp().m_hamlib; 
+            if (wxGetApp().m_boolHamlibUseForPTT && hamlib != NULL) {
+                hamlib->ptt(false);
+                hamlib->close();
+            }
+        }
+
+        if (wxGetApp().m_boolUseSerialPTT)
+            CloseSerialPort();
+
+        m_btnTogPTT->SetValue(false);
+
+        stopRxStream();
+
+        // free up states
+
+        modem_stats_close(&g_stats);
+        delete g_error_hist;
+        fifo_destroy(g_error_pattern_fifo);
+        freedv_close(g_pfreedv);
+        speex_preprocess_state_destroy(g_speex_st);
+        m_newMicInFilter = m_newSpkOutFilter = true;
+
+        m_togBtnSplit->Disable();
+        //m_togRxID->Disable();
+        //m_togTxID->Disable();
+        m_togBtnAnalog->Disable();
+        m_btnTogPTT->Disable();
+        m_togBtnOnOff->SetLabel(wxT("Start"));
+        m_rb1600->Enable();
+        m_rb700->Enable();
+#ifdef DISABLED_FEATURE
+        m_rb1400old->Enable();
+        m_rb1600Wide->Enable();
+        m_rb1400->Enable();
+        m_rb2000->Enable();
+#endif
+        char e[80]; sprintf(e,"stop"); processTxtEvent(e);
+    }
+}
+
+//-------------------------------------------------------------------------
+// stopRxStream()
+//-------------------------------------------------------------------------
+void MainFrame::stopRxStream()
+{
+    if(m_RxRunning)
+    {
+        m_RxRunning = false;
+
+        fprintf(g_logfile, "waiting for thread to stop");
+        m_txRxThread->m_run = 0;
+        m_txRxThread->Wait();
+        fprintf(g_logfile, "thread stopped");
+
+        m_rxInPa->stop();
+        m_rxInPa->streamClose();
+        delete m_rxInPa;
+        if(m_rxOutPa != m_rxInPa) {
+                       m_rxOutPa->stop();
+                       m_rxOutPa->streamClose();
+                       delete m_rxOutPa;
+               }
+
+        if (g_nSoundCards == 2) {
+            m_txInPa->stop();
+            m_txInPa->streamClose();
+            delete m_txInPa;
+            if(m_txInPa != m_txOutPa) {
+                               m_txOutPa->stop();
+                               m_txOutPa->streamClose();
+                               delete m_txOutPa;
+                       }
+        }
+
+        destroy_fifos();
+        destroy_src();
+        deleteEQFilters(g_rxUserdata);
+        delete g_rxUserdata;
+    }
+}
+
+void MainFrame::destroy_fifos(void)
+{
+    fifo_destroy(g_rxUserdata->infifo1);
+    fifo_destroy(g_rxUserdata->outfifo1);
+    fifo_destroy(g_rxUserdata->infifo2);
+    fifo_destroy(g_rxUserdata->outfifo2);
+    fifo_destroy(g_rxUserdata->rxinfifo);
+    fifo_destroy(g_rxUserdata->rxoutfifo);
+}
+
+void MainFrame::destroy_src(void)
+{
+    src_delete(g_rxUserdata->insrc1);
+    src_delete(g_rxUserdata->outsrc1);
+    src_delete(g_rxUserdata->insrc2);
+    src_delete(g_rxUserdata->outsrc2);
+    src_delete(g_rxUserdata->insrcsf);
+}
+
+void  MainFrame::initPortAudioDevice(PortAudioWrap *pa, int inDevice, int outDevice,
+                                     int soundCard, int sampleRate, int inputChannels)
+{
+    // Note all of the wrapper functions below just set values in a
+    // portaudio struct so can't return any errors. So no need to trap
+    // any errors in this function.
+
+    // init input params
+
+    pa->setInputDevice(inDevice);
+    if(inDevice != paNoDevice) {
+        pa->setInputChannelCount(inputChannels);           // stereo input
+        pa->setInputSampleFormat(PA_SAMPLE_TYPE);
+        pa->setInputLatency(pa->getInputDefaultLowLatency());
+        pa->setInputHostApiStreamInfo(NULL);
+    }
+
+    pa->setOutputDevice(paNoDevice);
+    
+    // init output params
+    
+    pa->setOutputDevice(outDevice);
+    if(outDevice != paNoDevice) {
+        pa->setOutputChannelCount(2);                      // stereo output
+        pa->setOutputSampleFormat(PA_SAMPLE_TYPE);
+        pa->setOutputLatency(pa->getOutputDefaultLowLatency());
+        pa->setOutputHostApiStreamInfo(NULL);
+    }
+
+    // init params that affect input and output
+
+    /*
+      On Linux, setting this to wxGetApp().m_framesPerBuffer caused
+      intermittant break up on the audio from my IC7200 on Ubuntu 14.
+      After a day of bug hunting I found that 0, as recommended by the
+      PortAudio docunmentation, fixed the problem.
+    */
+
+    //pa->setFramesPerBuffer(wxGetApp().m_framesPerBuffer);
+    pa->setFramesPerBuffer(0);
+
+    pa->setSampleRate(sampleRate);
+    pa->setStreamFlags(paClipOff);
+}
+
+//-------------------------------------------------------------------------
+// startRxStream()
+//-------------------------------------------------------------------------
+void MainFrame::startRxStream()
+{
+    int   src_error;
+    const PaDeviceInfo *deviceInfo1 = NULL, *deviceInfo2 = NULL;
+    int   inputChannels1, inputChannels2;
+    bool  two_rx=false;
+    bool  two_tx=false;
+
+    if(!m_RxRunning) {
+        m_RxRunning = true;
+
+        if(Pa_Initialize())
+        {
+            wxMessageBox(wxT("Port Audio failed to initialize"), wxT("Pa_Initialize"), wxOK);
+        }
+
+        m_rxInPa = new PortAudioWrap();
+        if(g_soundCard1InDeviceNum != g_soundCard1OutDeviceNum)
+            two_rx=true;
+        if(g_soundCard2InDeviceNum != g_soundCard2OutDeviceNum)
+            two_tx=true;
+        
+        fprintf(g_logfile, "two_rx: %d two_tx: %d\n", two_rx, two_tx);
+        if(two_rx)
+            m_rxOutPa = new PortAudioWrap();
+        else
+            m_rxOutPa = m_rxInPa;
+
+        if (g_nSoundCards == 0) {
+            wxMessageBox(wxT("No Sound Cards configured, use Tools - Audio Config to configure"), wxT("Error"), wxOK);
+            delete m_rxInPa;
+            if(two_rx)
+                delete m_rxOutPa;
+            m_RxRunning = false;
+            return;
+        }
+
+        // Init Sound card 1 ----------------------------------------------
+        // sanity check on sound card device numbers
+
+        if ((m_rxInPa->getDeviceCount() <= g_soundCard1InDeviceNum) ||
+            (m_rxOutPa->getDeviceCount() <= g_soundCard1OutDeviceNum)) {
+            wxMessageBox(wxT("Sound Card 1 not present"), wxT("Error"), wxOK);
+            delete m_rxInPa;
+            if(two_rx)
+                               delete m_rxOutPa;
+            m_RxRunning = false;
+            return;
+        }
+
+        // work out how many input channels this device supports.
+
+        deviceInfo1 = Pa_GetDeviceInfo(g_soundCard1InDeviceNum);
+        if (deviceInfo1 == NULL) {
+            wxMessageBox(wxT("Couldn't get device info from Port Audio for Sound Card 1"), wxT("Error"), wxOK);
+            delete m_rxInPa;
+            if(two_rx)
+                               delete m_rxOutPa;
+            m_RxRunning = false;
+            return;
+        }
+        if (deviceInfo1->maxInputChannels == 1)
+            inputChannels1 = 1;
+        else
+            inputChannels1 = 2;
+
+        if(two_rx) {
+            initPortAudioDevice(m_rxInPa, g_soundCard1InDeviceNum, paNoDevice, 1,
+                            g_soundCard1SampleRate, inputChannels1);
+            initPortAudioDevice(m_rxOutPa, paNoDevice, g_soundCard1OutDeviceNum, 1,
+                            g_soundCard1SampleRate, inputChannels1);
+               }
+        else
+            initPortAudioDevice(m_rxInPa, g_soundCard1InDeviceNum, g_soundCard1OutDeviceNum, 1,
+                            g_soundCard1SampleRate, inputChannels1);
+
+        // Init Sound Card 2 ------------------------------------------------
+
+        if (g_nSoundCards == 2) {
+
+            m_txInPa = new PortAudioWrap();
+            if(two_tx)
+                m_txOutPa = new PortAudioWrap();
+            else
+                m_txOutPa = m_txInPa;
+
+            // sanity check on sound card device numbers
+
+            //printf("m_txInPa->getDeviceCount(): %d\n", m_txInPa->getDeviceCount());
+            //printf("g_soundCard2InDeviceNum: %d\n", g_soundCard2InDeviceNum);
+            //printf("g_soundCard2OutDeviceNum: %d\n", g_soundCard2OutDeviceNum);
+
+            if ((m_txInPa->getDeviceCount() <= g_soundCard2InDeviceNum) ||
+                (m_txOutPa->getDeviceCount() <= g_soundCard2OutDeviceNum)) {
+                wxMessageBox(wxT("Sound Card 2 not present"), wxT("Error"), wxOK);
+                delete m_rxInPa;
+                if(two_rx)
+                    delete m_rxOutPa;
+                delete m_txInPa;
+                if(two_tx)
+                    delete m_txOutPa;
+                m_RxRunning = false;
+                return;
+            }
+
+            deviceInfo2 = Pa_GetDeviceInfo(g_soundCard2InDeviceNum);
+            if (deviceInfo2 == NULL) {
+                wxMessageBox(wxT("Couldn't get device info from Port Audio for Sound Card 1"), wxT("Error"), wxOK);
+                delete m_rxInPa;
+                if(two_rx)
+                                       delete m_rxOutPa;
+                delete m_txInPa;
+                if(two_tx)
+                                       delete m_txOutPa;
+                m_RxRunning = false;
+                return;
+            }
+            if (deviceInfo2->maxInputChannels == 1)
+                inputChannels2 = 1;
+            else
+                inputChannels2 = 2;
+
+            if(two_tx) {
+                               initPortAudioDevice(m_txInPa, g_soundCard2InDeviceNum, paNoDevice, 2,
+                                g_soundCard2SampleRate, inputChannels2);
+                               initPortAudioDevice(m_txOutPa, paNoDevice, g_soundCard2OutDeviceNum, 2,
+                                g_soundCard2SampleRate, inputChannels2);
+                       }
+                       else
+                               initPortAudioDevice(m_txInPa, g_soundCard2InDeviceNum, g_soundCard2OutDeviceNum, 2,
+                                g_soundCard2SampleRate, inputChannels2);
+        }
+
+        // Init call back data structure ----------------------------------------------
+
+        g_rxUserdata = new paCallBackData;
+        g_rxUserdata->inputChannels1 = inputChannels1;
+        if (deviceInfo2 != NULL)
+            g_rxUserdata->inputChannels2 = inputChannels2;
+
+        // init sample rate conversion states
+
+        g_rxUserdata->insrc1 = src_new(SRC_SINC_FASTEST, 1, &src_error);
+        assert(g_rxUserdata->insrc1 != NULL);
+        g_rxUserdata->outsrc1 = src_new(SRC_SINC_FASTEST, 1, &src_error);
+        assert(g_rxUserdata->outsrc1 != NULL);
+        g_rxUserdata->insrc2 = src_new(SRC_SINC_FASTEST, 1, &src_error);
+        assert(g_rxUserdata->insrc2 != NULL);
+        g_rxUserdata->outsrc2 = src_new(SRC_SINC_FASTEST, 1, &src_error);
+        assert(g_rxUserdata->outsrc2 != NULL);
+
+        g_rxUserdata->insrcsf = src_new(SRC_SINC_FASTEST, 1, &src_error);
+        assert(g_rxUserdata->insrcsf != NULL);
+
+        // create FIFOs used to interface between different buffer sizes
+
+        g_rxUserdata->infifo1 = fifo_create(8*N48);
+        g_rxUserdata->outfifo1 = fifo_create(10*N48);
+        g_rxUserdata->outfifo2 = fifo_create(8*N48);
+        g_rxUserdata->infifo2 = fifo_create(8*N48);
+        printf("N48: %d\n", N48);
+
+        g_rxUserdata->rxinfifo = fifo_create(3 * g_pfreedv->n_speech_samples);
+        g_rxUserdata->rxoutfifo = fifo_create(2 * g_pfreedv->n_speech_samples);
+
+        // Init Equaliser Filters ------------------------------------------------------
+
+        m_newMicInFilter = m_newSpkOutFilter = true;
+        designEQFilters(g_rxUserdata);
+        g_rxUserdata->micInEQEnable = wxGetApp().m_MicInEQEnable;
+        g_rxUserdata->spkOutEQEnable = wxGetApp().m_SpkOutEQEnable;
+
+        // optional tone in left channel to reliably trigger vox
+        
+        g_rxUserdata->leftChannelVoxTone = wxGetApp().m_leftChannelVoxTone;
+        g_rxUserdata->voxTonePhase = 0;
+
+        // Start sound card 1 ----------------------------------------------------------
+
+        m_rxInPa->setUserData(g_rxUserdata);
+        m_rxErr = m_rxInPa->setCallback(rxCallback);
+
+        m_rxErr = m_rxInPa->streamOpen();
+
+        if(m_rxErr != paNoError) {
+            wxMessageBox(wxT("Sound Card 1 Open/Setup error."), wxT("Error"), wxOK);
+                       delete m_rxInPa;
+                       if(two_rx)
+                               delete m_rxOutPa;
+                       delete m_txInPa;
+                       if(two_tx)
+                               delete m_txOutPa;
+            destroy_fifos();
+            destroy_src();
+            deleteEQFilters(g_rxUserdata);
+            delete g_rxUserdata;
+            m_RxRunning = false;
+            return;
+        }
+
+        m_rxErr = m_rxInPa->streamStart();
+        if(m_rxErr != paNoError) {
+            wxMessageBox(wxT("Sound Card 1 Stream Start Error."), wxT("Error"), wxOK);
+                       delete m_rxInPa;
+                       if(two_rx)
+                               delete m_rxOutPa;
+                       delete m_txInPa;
+                       if(two_tx)
+                               delete m_txOutPa;
+            destroy_fifos();
+            destroy_src();
+            deleteEQFilters(g_rxUserdata);
+            delete g_rxUserdata;
+            m_RxRunning = false;
+            return;
+        }
+
+        // Start separate output stream if needed
+
+        if(two_rx) {
+            m_rxOutPa->setUserData(g_rxUserdata);
+            m_rxErr = m_rxOutPa->setCallback(rxCallback);
+
+            m_rxErr = m_rxOutPa->streamOpen();
+
+            if(m_rxErr != paNoError) {
+                wxMessageBox(wxT("Sound Card 1 Second Stream Open/Setup error."), wxT("Error"), wxOK);
+                delete m_rxInPa;
+                delete m_rxOutPa;
+                delete m_txOutPa;
+                if(two_tx)
+                    delete m_txOutPa;
+                destroy_fifos();
+                destroy_src();
+                deleteEQFilters(g_rxUserdata);
+                delete g_rxUserdata;
+                m_RxRunning = false;
+                return;
+            }
+
+            m_rxErr = m_rxOutPa->streamStart();
+            if(m_rxErr != paNoError) {
+                wxMessageBox(wxT("Sound Card 1 Second Stream Start Error."), wxT("Error"), wxOK);
+                m_rxInPa->stop();
+                m_rxInPa->streamClose();
+                delete m_rxInPa;
+                delete m_rxOutPa;
+                delete m_txOutPa;
+                if(two_tx)
+                    delete m_txOutPa;
+                destroy_fifos();
+                destroy_src();
+                deleteEQFilters(g_rxUserdata);
+                delete g_rxUserdata;
+                m_RxRunning = false;
+                return;
+            }
+        }
+
+        // Start sound card 2 ----------------------------------------------------------
+
+        if (g_nSoundCards == 2) {
+
+            // question: can we use same callback data
+            // (g_rxUserdata)or both sound card callbacks?  Is there a
+            // chance of them both being called at the same time?  We
+            // could need a mutex ...
+
+            m_txInPa->setUserData(g_rxUserdata);
+            m_txErr = m_txInPa->setCallback(txCallback);
+            m_txErr = m_txInPa->streamOpen();
+
+            if(m_txErr != paNoError) {
+                fprintf(stderr, "Err: %d\n", m_txErr);
+                wxMessageBox(wxT("Sound Card 2 Open/Setup error."), wxT("Error"), wxOK);
+                m_rxInPa->stop();
+                m_rxInPa->streamClose();
+                delete m_rxInPa;
+                if(two_rx) {
+                    m_rxOutPa->stop();
+                    m_rxOutPa->streamClose();
+                    delete m_rxOutPa;
+                }
+                delete m_txInPa;
+                if(two_tx)
+                    delete m_txOutPa;
+                destroy_fifos();
+                destroy_src();
+                deleteEQFilters(g_rxUserdata);
+                delete g_rxUserdata;
+                m_RxRunning = false;
+                return;
+            }
+            m_txErr = m_txInPa->streamStart();
+            if(m_txErr != paNoError) {
+                wxMessageBox(wxT("Sound Card 2 Start Error."), wxT("Error"), wxOK);
+                m_rxInPa->stop();
+                m_rxInPa->streamClose();
+                delete m_rxInPa;
+                if(two_rx) {
+                    m_rxOutPa->stop();
+                    m_rxOutPa->streamClose();
+                    delete m_rxOutPa;
+                }
+                delete m_txInPa;
+                if(two_tx)
+                    delete m_txOutPa;
+                destroy_fifos();
+                destroy_src();
+                deleteEQFilters(g_rxUserdata);
+                delete g_rxUserdata;
+                m_RxRunning = false;
+                return;
+            }
+
+            // Start separate output stream if needed
+
+            if (two_tx) {
+
+                // question: can we use same callback data
+                // (g_rxUserdata)or both sound card callbacks?  Is there a
+                // chance of them both being called at the same time?  We
+                // could need a mutex ...
+
+                m_txOutPa->setUserData(g_rxUserdata);
+                m_txErr = m_txOutPa->setCallback(txCallback);
+                m_txErr = m_txOutPa->streamOpen();
+
+                if(m_txErr != paNoError) {
+                    wxMessageBox(wxT("Sound Card 2 Second Stream Open/Setup error."), wxT("Error"), wxOK);
+                    m_rxInPa->stop();
+                    m_rxInPa->streamClose();
+                    delete m_rxInPa;
+                    if(two_rx) {
+                        m_rxOutPa->stop();
+                        m_rxOutPa->streamClose();
+                        delete m_rxOutPa;
+                    }
+                    m_txInPa->stop();
+                    m_txInPa->streamClose();
+                    delete m_txInPa;
+                    delete m_txOutPa;
+                    destroy_fifos();
+                    destroy_src();
+                    deleteEQFilters(g_rxUserdata);
+                    delete g_rxUserdata;
+                    m_RxRunning = false;
+                    return;
+                }
+                m_txErr = m_txOutPa->streamStart();
+                if(m_txErr != paNoError) {
+                    wxMessageBox(wxT("Sound Card 2 Second Stream Start Error."), wxT("Error"), wxOK);
+                    m_rxInPa->stop();
+                    m_rxInPa->streamClose();
+                    m_txInPa->stop();
+                    m_txInPa->streamClose();
+                    delete m_txInPa;
+                    if(two_rx) {
+                        m_rxOutPa->stop();
+                        m_rxOutPa->streamClose();
+                        delete m_rxOutPa;
+                    }
+                    delete m_txInPa;
+                    delete m_txOutPa;
+                    destroy_fifos();
+                    destroy_src();
+                    deleteEQFilters(g_rxUserdata);
+                    delete g_rxUserdata;
+                    m_RxRunning = false;
+                    return;
+                }
+            }
+        }
+
+        // start tx/rx processing thread
+
+        m_txRxThread = new txRxThread;
+
+        if ( m_txRxThread->Create() != wxTHREAD_NO_ERROR )
+        {
+            wxLogError(wxT("Can't create thread!"));
+        }
+
+        m_txRxThread->SetPriority(WXTHREAD_MAX_PRIORITY);
+
+        if ( m_txRxThread->Run() != wxTHREAD_NO_ERROR )
+        {
+            wxLogError(wxT("Can't start thread!"));
+        }
+
+    }
+}
+
+
+void MainFrame::processTxtEvent(char event[]) {
+    int rule = 0;
+
+    //printf("processTxtEvent:\n");
+    //printf("  event: %s\n", event);
+
+    // process with regexp and issue system command
+
+    // Each regexp in our list is separated by a newline.  We want to try all of them.
+
+    wxString event_str(event);
+    int match_end, replace_end;
+    match_end = replace_end = 0;
+    wxString regexp_match_list = wxGetApp().m_events_regexp_match;
+    wxString regexp_replace_list = wxGetApp().m_events_regexp_replace;
+
+    bool found_match = false;
+
+    while (((match_end = regexp_match_list.Find('\n')) != wxNOT_FOUND) && (rule < MAX_EVENT_RULES)) {
+        //printf("match_end: %d\n", match_end);
+        if ((replace_end = regexp_replace_list.Find('\n')) != wxNOT_FOUND) {
+            //printf("replace_end = %d\n", replace_end);
+
+            // candidate match and replace regexps strings exist, so lets try them
+
+            wxString regexp_match = regexp_match_list.SubString(0, match_end-1);
+            wxString regexp_replace = regexp_replace_list.SubString(0, replace_end-1);
+            //printf("match: %s replace: %s\n", (const char *)regexp_match.c_str(), (const char *)regexp_replace.c_str());
+            wxRegEx re(regexp_match);
+            //printf("  checking for match against: %s\n", (const char *)regexp_match.c_str());
+
+            // if we found a match, lets run the replace regexp and issue the system command
+
+            wxString event_str_rep = event_str;
+
+            if (re.Replace(&event_str_rep, regexp_replace) != 0) {
+                //printf("  found match!\n");
+                found_match = true;
+
+                bool enableSystem = false;
+                if (wxGetApp().m_events)
+                    enableSystem = true;
+
+                // no syscall if spam timer still running
+
+                if (spamTimer[rule].IsRunning()) {
+                    enableSystem = false;
+                    //printf("  spam timer running\n");
+                }
+
+                const char *event_out = event_str_rep.ToUTF8();
+                wxString event_out_with_return_code;
+
+                if (enableSystem) {
+                    int ret = wxExecute(event_str_rep);
+                    event_out_with_return_code.Printf(_T("%s -> returned %d"), event_out, ret);
+                    spamTimer[rule].Start((wxGetApp().m_events_spam_timer)*1000, wxTIMER_ONE_SHOT);
+                }
+                else
+                    event_out_with_return_code.Printf(_T("%s T: %d"), event_out, spamTimer[rule].IsRunning());
+
+                // update event log GUI if currently displayed
+                
+                if (optionsDlg != NULL) {                  
+                    optionsDlg->updateEventLog(wxString(event), event_out_with_return_code);                     
+                }
+            }
+        }
+        regexp_match_list = regexp_match_list.SubString(match_end+1, regexp_match_list.length());
+        regexp_replace_list = regexp_replace_list.SubString(replace_end+1, regexp_replace_list.length());
+
+        rule++;
+    }
+    if ((optionsDlg != NULL) && !found_match) {                  
+        optionsDlg->updateEventLog(wxString(event), _("<no match>"));                     
+    }
+}
+
+
+#define SBQ_MAX_ARGS 4
+
+void *MainFrame::designAnEQFilter(const char filterType[], float freqHz, float gaindB, float Q)
+{
+    char  *arg[SBQ_MAX_ARGS];
+    char   argstorage[SBQ_MAX_ARGS][80];
+    void  *sbq;
+    int    i, argc;
+
+    assert((strcmp(filterType, "bass") == 0)   ||
+           (strcmp(filterType, "treble") == 0) ||
+           (strcmp(filterType, "equalizer") == 0));
+
+    for(i=0; i<SBQ_MAX_ARGS; i++) {
+        arg[i] = &argstorage[i][0];
+        arg[i] = &argstorage[i][0];
+        arg[i] = &argstorage[i][0];
+    }
+
+    argc = 0;
+
+    if ((strcmp(filterType, "bass") == 0) || (strcmp(filterType, "treble") == 0)) {
+        sprintf(arg[argc++], "%s", filterType);
+        sprintf(arg[argc++], "%f", gaindB+1E-6);
+        sprintf(arg[argc++], "%f", freqHz);
+    }
+
+    if (strcmp(filterType, "equalizer") == 0) {
+        sprintf(arg[argc++], "%s", filterType);
+        sprintf(arg[argc++], "%f", freqHz);
+        sprintf(arg[argc++], "%f", Q);
+        sprintf(arg[argc++], "%f", gaindB+1E-6);
+    }
+
+    assert(argc <= SBQ_MAX_ARGS);
+
+    sbq = sox_biquad_create(argc-1, (const char **)arg);
+
+    return sbq;
+}
+
+void  MainFrame::designEQFilters(paCallBackData *cb)
+{
+    // init Mic In Equaliser Filters
+
+    if (m_newMicInFilter) {
+        //printf("designing new Min In filters\n");
+        cb->sbqMicInBass   = designAnEQFilter("bass", wxGetApp().m_MicInBassFreqHz, wxGetApp().m_MicInBassGaindB);
+        cb->sbqMicInTreble = designAnEQFilter("treble", wxGetApp().m_MicInTrebleFreqHz, wxGetApp().m_MicInTrebleGaindB);
+        cb->sbqMicInMid    = designAnEQFilter("equalizer", wxGetApp().m_MicInMidFreqHz, wxGetApp().m_MicInMidGaindB, wxGetApp().m_MicInMidQ);
+    }
+
+    // init Spk Out Equaliser Filters
+
+    if (m_newSpkOutFilter) {
+        //printf("designing new Spk Out filters\n");
+        //printf("designEQFilters: wxGetApp().m_SpkOutBassFreqHz: %f\n",wxGetApp().m_SpkOutBassFreqHz);
+        cb->sbqSpkOutBass   = designAnEQFilter("bass", wxGetApp().m_SpkOutBassFreqHz, wxGetApp().m_SpkOutBassGaindB);
+        cb->sbqSpkOutTreble = designAnEQFilter("treble", wxGetApp().m_SpkOutTrebleFreqHz, wxGetApp().m_SpkOutTrebleGaindB);
+        cb->sbqSpkOutMid    = designAnEQFilter("equalizer", wxGetApp().m_SpkOutMidFreqHz, wxGetApp().m_SpkOutMidGaindB, wxGetApp().m_SpkOutMidQ);
+    }
+}
+
+void  MainFrame::deleteEQFilters(paCallBackData *cb)
+{
+    if (m_newMicInFilter) {
+        sox_biquad_destroy(cb->sbqMicInBass);
+        sox_biquad_destroy(cb->sbqMicInTreble);
+        sox_biquad_destroy(cb->sbqMicInMid);
+    }
+    if (m_newSpkOutFilter) {
+        sox_biquad_destroy(cb->sbqSpkOutBass);
+        sox_biquad_destroy(cb->sbqSpkOutTreble);
+        sox_biquad_destroy(cb->sbqSpkOutMid);
+    }
+}
+
+// returns number of output samples generated by resampling
+int resample(SRC_STATE *src,
+            short      output_short[],
+            short      input_short[],
+            int        output_sample_rate,
+            int        input_sample_rate,
+            int        length_output_short, // maximum output array length in samples
+            int        length_input_short
+            )
+{
+    SRC_DATA src_data;
+    float    input[N48*4];
+    float    output[N48*4];
+    int      ret;
+
+    assert(src != NULL);
+    assert(length_input_short <= N48*4);
+    assert(length_output_short <= N48*4);
+
+    src_short_to_float_array(input_short, input, length_input_short);
+
+    src_data.data_in = input;
+    src_data.data_out = output;
+    src_data.input_frames = length_input_short;
+    src_data.output_frames = length_output_short;
+    src_data.end_of_input = 0;
+    src_data.src_ratio = (float)output_sample_rate/input_sample_rate;
+
+    ret = src_process(src, &src_data);
+    assert(ret == 0);
+
+    assert(src_data.output_frames_gen <= length_output_short);
+    src_float_to_short_array(output, output_short, src_data.output_frames_gen);
+
+    return src_data.output_frames_gen;
+}
+
+
+// Decimates samples using an algorithm that produces nice plots of
+// speech signals at a low sample rate.  We want a low sample rate so
+// we don't hammer the graphics system too hard.  Saves decimated data
+// to a fifo for plotting on screen.
+void resample_for_plot(struct FIFO *plotFifo, short buf[], int length, int fs)
+{
+    int decimation = fs/WAVEFORM_PLOT_FS;
+    int nSamples, sample;
+    int i, st, en, max, min;
+    short dec_samples[length];
+
+    nSamples = length/decimation;
+
+    for(sample = 0; sample < nSamples; sample += 2)
+    {
+        st = decimation*sample;
+        en = decimation*(sample+2);
+        max = min = 0;
+        for(i=st; i<en; i++ )
+        {
+            if (max < buf[i]) max = buf[i];
+            if (min > buf[i]) min = buf[i];
+        }
+        dec_samples[sample] = max;
+        dec_samples[sample+1] = min;
+    }
+    fifo_write(plotFifo, dec_samples, nSamples);
+}
+
+void txRxProcessing()
+{
+
+    paCallBackData  *cbData = g_rxUserdata;
+
+    // Buffers re-used by tx and rx processing
+    // signals in in48k/out48k are at a maximum sample rate of 48k, could be 44.1kHz
+    // depending on sound hardware.
+
+    short           in8k_short[4*N8];
+    short           in48k_short[4*N48];
+    short           out8k_short[4*N8];
+    short           out48k_short[4*N48];
+    int             nout, samplerate, n_samples;
+
+    //fprintf(g_logfile, "start infifo1: %5d outfifo2: %5d\n", fifo_used(cbData->infifo1), fifo_used(cbData->outfifo2));
+
+    // FreeDV 700 uses a modem sample rate of 7500 Hz which requires some special treatment
+
+    if (g_analog) 
+        samplerate = FS;
+    else
+        samplerate = g_pfreedv->modem_sample_rate;
+
+    //
+    //  RX side processing --------------------------------------------
+    //
+
+    // while we have enough input samples available ...
+
+    int nsam = g_soundCard1SampleRate * (float)N8/FS;
+    assert(nsam <= N48);
+    g_mutexProtectingCallbackData.Lock();
+    while ((fifo_read(cbData->infifo1, in48k_short, nsam) == 0) && ((g_half_duplex && !g_tx) || !g_half_duplex)) 
+    {
+        g_mutexProtectingCallbackData.Unlock();
+        unsigned int n8k;
+
+        n8k = resample(cbData->insrc1, in8k_short, in48k_short, samplerate, g_soundCard1SampleRate, N8, nsam);
+        assert(n8k <= N8);
+
+        // optionally save "from radio" signal (write demod input to file)
+        // Really useful for testing and development as it allows us
+        // to repeat tests using off air signals
+
+        g_mutexProtectingCallbackData.Lock();
+        if (g_recFileFromRadio && (g_sfRecFile != NULL)) {
+            //printf("g_recFromRadioSamples: %d  n8k: %d \n", g_recFromRadioSamples);
+            if (g_recFromRadioSamples < n8k) {
+                sf_write_short(g_sfRecFile, in8k_short, g_recFromRadioSamples);
+                wxCommandEvent event( wxEVT_COMMAND_MENU_SELECTED, g_recFileFromRadioEventId );
+                // call stop/start record menu item, should be thread safe
+                g_parent->GetEventHandler()->AddPendingEvent( event );
+                g_recFromRadioSamples = 0;
+                //printf("finished recording g_recFromRadioSamples: %d n8k: %d!\n", g_recFileFromRadio, n8k);
+            }
+            else {
+                sf_write_short(g_sfRecFile, in8k_short, n8k);
+                g_recFromRadioSamples -= n8k;
+            }
+        }
+        g_mutexProtectingCallbackData.Unlock();
+
+        // optionally read "from radio" signal from file (read demod input from file)
+
+        g_mutexProtectingCallbackData.Lock();
+        if (g_playFileFromRadio && (g_sfPlayFileFromRadio != NULL)) {
+            unsigned int nsf = n8k*g_sfFs/samplerate;
+            short        insf_short[nsf];
+            unsigned int n = sf_read_short(g_sfPlayFileFromRadio, insf_short, nsf);
+            n8k = resample(cbData->insrcsf, in8k_short, insf_short, samplerate, g_sfFs, N8, nsf);
+            //fprintf(g_logfile, "n: %d nsnf: %d n8k: %d\n", n, nsf, n8k);
+            assert(n8k <= N8);
+
+            if (n == 0) {
+                if (g_loopPlayFileFromRadio)
+                    sf_seek(g_sfPlayFileFromRadio, 0, SEEK_SET);
+                else {
+                    printf("playFileFromRadio finished, issuing event!\n");
+                    wxCommandEvent event( wxEVT_COMMAND_MENU_SELECTED, g_playFileFromRadioEventId );
+                    // call stop/start play menu item, should be thread safe
+                    g_parent->GetEventHandler()->AddPendingEvent( event );
+                }
+            }
+        }
+        g_mutexProtectingCallbackData.Unlock();
+
+        resample_for_plot(g_plotDemodInFifo, in8k_short, n8k, samplerate);
+
+        // send latest squelch level to FreeDV API, as it handles squelch internally
+
+        g_pfreedv->squelch_en = g_SquelchActive;
+        g_pfreedv->snr_squelch_thresh = g_SquelchLevel;
+        //fprintf(g_logfile, "snr_squelch_thresh: %f\n",  g_pfreedv->snr_squelch_thresh);
+
+        // Get some audio to send to headphones/speaker.  If in analog
+        // mode we pass thru the "from radio" audio to the
+        // headphones/speaker.
+
+        if (g_analog) {
+            memcpy(out8k_short, in8k_short, sizeof(short)*n8k);
+            
+            // compute rx spectrum 
+
+            COMP  rx_fdm[n8k];
+            float rx_spec[MODEM_STATS_NSPEC];
+            unsigned int   i;
+
+            for(i=0; i<n8k; i++) {
+                rx_fdm[i].real = in8k_short[i];
+                rx_fdm[i].imag = 0.0;
+            }            
+            modem_stats_get_rx_spectrum(&g_stats, rx_spec, rx_fdm, n8k);
+
+            // Average rx spectrum data using a simple IIR low pass filter
+
+            for(i = 0; i<MODEM_STATS_NSPEC; i++) {
+                g_avmag[i] = BETA * g_avmag[i] + (1.0 - BETA) * rx_spec[i];
+            }
+        }
+        else {
+            fifo_write(cbData->rxinfifo, in8k_short, n8k);
+            per_frame_rx_processing(cbData->rxoutfifo, cbData->rxinfifo);
+            memset(out8k_short, 0, sizeof(short)*N8);
+            fifo_read(cbData->rxoutfifo, out8k_short, N8);
+        }
+
+
+        // Optional Spk Out EQ Filtering, need mutex as filter can change at run time
+        g_mutexProtectingCallbackData.Lock();
+        if (cbData->spkOutEQEnable) {
+            sox_biquad_filter(cbData->sbqSpkOutBass,   out8k_short, out8k_short, N8);
+            sox_biquad_filter(cbData->sbqSpkOutTreble, out8k_short, out8k_short, N8);
+            sox_biquad_filter(cbData->sbqSpkOutMid,    out8k_short, out8k_short, N8);
+        }
+        g_mutexProtectingCallbackData.Unlock();
+
+        resample_for_plot(g_plotSpeechOutFifo, out8k_short, N8, FS);
+
+        g_mutexProtectingCallbackData.Lock();
+        if (g_nSoundCards == 1) {
+            nout = resample(cbData->outsrc2, out48k_short, out8k_short, g_soundCard1SampleRate, FS, N48, N8);
+            fifo_write(cbData->outfifo1, out48k_short, nout);
+        }
+        else {
+            nout = resample(cbData->outsrc2, out48k_short, out8k_short, g_soundCard2SampleRate, FS, N48, N8);
+            fifo_write(cbData->outfifo2, out48k_short, nout);
+        }
+    }
+    g_mutexProtectingCallbackData.Unlock();
+
+    //
+    //  TX side processing --------------------------------------------
+    //
+
+    if ((g_nSoundCards == 2) && ((g_half_duplex && g_tx) || !g_half_duplex)) {
+        int ret;
+
+        // Make sure we have q few frames of modulator output
+        // samples.  This also locks the modulator to the sample rate
+        // of sound card 1.  We want to make sure that modulator
+        // samples are uninterrupted by differences in sample rate
+        // between this sound card and sound card 2.
+
+        g_mutexProtectingCallbackData.Lock();
+        while((unsigned)fifo_used(cbData->outfifo1) < 6*N48)
+        {
+            g_mutexProtectingCallbackData.Unlock();
+
+            int   nsam = g_soundCard2SampleRate * g_pfreedv->n_speech_samples/FS;
+            assert(nsam <= 4*N48);
+
+            // infifo2 is written to by another sound card so it may
+            // over or underflow, but we don't realy care.  It will
+            // just result in a short interruption in audio being fed
+            // to codec2_enc, possibly making a click every now and
+            // again in the decoded audio at the other end.
+
+            // zero speech input just in case infifo2 underflows
+            memset(in48k_short, 0, nsam*sizeof(short));
+            fifo_read(cbData->infifo2, in48k_short, nsam);
+
+            nout = resample(cbData->insrc2, in8k_short, in48k_short, FS, g_soundCard2SampleRate, 4*N8, nsam);
+
+            // optionally use file for mic input signal
+
+            g_mutexProtectingCallbackData.Lock();
+            if (g_playFileToMicIn && (g_sfPlayFile != NULL)) {
+                int n = sf_read_short(g_sfPlayFile, in8k_short, nout);
+                //fprintf(stderr, "n: %d nout: %d\n", n, nout);
+                if (n != nout) {
+                    if (g_loopPlayFileToMicIn)
+                        sf_seek(g_sfPlayFile, 0, SEEK_SET);
+                    else {
+                        wxCommandEvent event( wxEVT_COMMAND_MENU_SELECTED, g_playFileToMicInEventId );
+                        // call stop/start play menu item, should be thread safe
+                        g_parent->GetEventHandler()->AddPendingEvent( event );
+                    }
+                }
+            }
+            g_mutexProtectingCallbackData.Unlock();
+
+            // Optional Speex pre-processor for acoustic noise reduction
+
+            if (wxGetApp().m_speexpp_enable) {
+                speex_preprocess_run(g_speex_st, in8k_short);
+            }
+
+            // Optional Mic In EQ Filtering, need mutex as filter can change at run time
+
+            g_mutexProtectingCallbackData.Lock();
+            if (cbData->micInEQEnable) {
+                sox_biquad_filter(cbData->sbqMicInBass, in8k_short, in8k_short, nout);
+                sox_biquad_filter(cbData->sbqMicInTreble, in8k_short, in8k_short, nout);
+                sox_biquad_filter(cbData->sbqMicInMid, in8k_short, in8k_short, nout);
+            }
+            g_mutexProtectingCallbackData.Unlock();
+
+            resample_for_plot(g_plotSpeechInFifo, in8k_short, nout, FS);
+
+            n_samples = g_pfreedv->n_nom_modem_samples;
+
+            if (g_analog) {
+                n_samples = g_pfreedv->n_speech_samples;
+
+                // Boost the "from mic" -> "to radio" audio in analog
+                // mode.  The need for the gain was found by
+                // experiment - analog SSB sounded too quiet compared
+                // to digital. With digital voice we generally drive
+                // the "to radio" (SSB radio mic input) at about 25%
+                // of the peak level for normal SSB voice. So we
+                // introduce 6dB gain to make analog SSB sound the
+                // same level as the digital.  Watch out for clipping.
+                for(int i=0; i<n_samples; i++) {
+                    float out = (float)in8k_short[i]*2.0;
+                    if (out > 32767) out = 32767.0;
+                    if (out < -32767) out = -32767.0;
+                    out8k_short[i] = out;
+                }
+            }
+            else {
+                COMP tx_fdm[g_pfreedv->n_nom_modem_samples];
+                COMP tx_fdm_offset[g_pfreedv->n_nom_modem_samples];
+                int  i;
+
+                freedv_comptx(g_pfreedv, tx_fdm, in8k_short);
+  
+                fdmdv_freq_shift_coh(tx_fdm_offset, tx_fdm, g_TxFreqOffsetHz, g_pfreedv->modem_sample_rate, &g_TxFreqOffsetPhaseRect, g_pfreedv->n_nom_modem_samples);
+                for(i=0; i<g_pfreedv->n_nom_modem_samples; i++)
+                    out8k_short[i] = tx_fdm_offset[i].real;
+            }
+
+            // output one frame of modem signal
+            nout = resample(cbData->outsrc1, out48k_short, out8k_short, g_soundCard1SampleRate, samplerate, N48*4, n_samples);
+            g_mutexProtectingCallbackData.Lock();
+            ret = fifo_write(cbData->outfifo1, out48k_short, nout);
+            //fprintf(stderr,"nout: %d ret: %d N48*4: %d\n", nout, ret, N48*4);
+
+            assert(ret != -1);
+        }
+        g_mutexProtectingCallbackData.Unlock();
+    }
+   
+    //fprintf(g_logfile, "  end infifo1: %5d outfifo2: %5d\n", fifo_used(cbData->infifo1), fifo_used(cbData->outfifo2));
+
+}
+
+//----------------------------------------------------------------
+// per_frame_rx_processing()
+//----------------------------------------------------------------
+
+void per_frame_rx_processing(
+                                            FIFO    *output_fifo,   // decoded speech samples
+                                            FIFO    *input_fifo
+                                        )
+{
+    short               input_buf[g_pfreedv->n_max_modem_samples];
+    short               output_buf[g_pfreedv->n_speech_samples];
+    COMP                rx_fdm[g_pfreedv->n_max_modem_samples];
+    COMP                rx_fdm_offset[g_pfreedv->n_max_modem_samples];
+    float               rx_spec[MODEM_STATS_NSPEC];
+    int                 i;
+    int                 nin, nin_prev, nout;
+
+    nin = freedv_nin(g_pfreedv);
+    while (fifo_read(input_fifo, input_buf, nin) == 0)
+    {
+        assert(nin <= g_pfreedv->n_max_modem_samples);
+
+        nin_prev = nin;
+        //fwrite(input_buf, sizeof(short), nin, ft);
+
+        // demod per frame processing
+        for(i=0; i<nin; i++)
+        {
+            rx_fdm[i].real = (float)input_buf[i];
+            rx_fdm[i].imag = 0.0;
+        }
+       
+        if (g_channel_noise) {
+            float snr;
+
+            /* enough noise to get a couple of % errors */
+
+            if (g_pfreedv->mode == FREEDV_MODE_1600)
+                snr = 2.0;
+             if (g_pfreedv->mode == FREEDV_MODE_700)
+                snr = -1.0;           
+            fdmdv_simulate_channel(&g_sig_pwr_av, rx_fdm, nin, snr);
+        }
+        fdmdv_freq_shift_coh(rx_fdm_offset, rx_fdm, g_RxFreqOffsetHz, g_pfreedv->modem_sample_rate, &g_RxFreqOffsetPhaseRect, nin);
+        nout = freedv_comprx(g_pfreedv, output_buf, rx_fdm_offset);
+        
+        fifo_write(output_fifo, output_buf, nout);
+        
+        nin = freedv_nin(g_pfreedv);
+        g_State = g_pfreedv->sync;
+        //fprintf(g_logfile, "g_State: %d g_stats.sync: %d snr: %f \n", g_State, g_stats.sync, f->snr);
+
+        // compute rx spectrum 
+
+        modem_stats_get_rx_spectrum(&g_stats, rx_spec, rx_fdm, nin_prev);
+        // Average rx spectrum data using a simple IIR low pass filter
+
+        for(i = 0; i<MODEM_STATS_NSPEC; i++) {
+            g_avmag[i] = BETA * g_avmag[i] + (1.0 - BETA) * rx_spec[i];
+        }
+
+        if (g_pfreedv->mode == FREEDV_MODE_1600)
+            fdmdv_get_demod_stats(g_pfreedv->fdmdv, &g_stats);
+        if (g_pfreedv->mode == FREEDV_MODE_700)
+            cohpsk_get_demod_stats(g_pfreedv->cohpsk, &g_stats);
+
+    }
+}
+
+
+//-------------------------------------------------------------------------
+// rxCallback()
+//
+// Sound card 1 callback from PortAudio, that is used for processing rx
+// side:
+//
+// + infifo1 is the "from radio" off air modem signal from the SSB rx that we send to the demod.
+// + In single sound card mode outfifo1 is the "to speaker/headphones" decoded speech output.
+// + In dual sound card mode outfifo1 is the "to radio" modulator signal to the SSB tx.
+//
+//-------------------------------------------------------------------------
+int MainFrame::rxCallback(
+                            const void      *inputBuffer,
+                            void            *outputBuffer,
+                            unsigned long   framesPerBuffer,
+                            const PaStreamCallbackTimeInfo* timeInfo,
+                            PaStreamCallbackFlags statusFlags,
+                            void            *userData
+                         )
+{
+    paCallBackData  *cbData = (paCallBackData*)userData;
+    short           *rptr    = (short*)inputBuffer;
+    short           *wptr    = (short*)outputBuffer;
+
+    short           indata[MAX_FPB];
+    short           outdata[MAX_FPB];
+
+    unsigned int    i;
+
+    (void) timeInfo;
+    (void) statusFlags;
+
+    wxMutexLocker lock(g_mutexProtectingCallbackData);
+
+    //fprintf(g_logfile, "cb1 statusFlags: 0x%x framesPerBuffer: %d rptr: 0x%x wptr: 0x%x \n", (int)statusFlags,
+    //        framesPerBuffer, rptr, wptr);
+
+    //
+    //  RX side processing --------------------------------------------
+    //
+
+    // assemble a mono buffer and write to FIFO
+
+    assert(framesPerBuffer < MAX_FPB);
+
+    if(rptr) {
+        //fprintf(g_logfile,"in %ld %d\n",  framesPerBuffer, g_in++);
+        //g_indata += framesPerBuffer;
+        for(i = 0; i < framesPerBuffer; i++, rptr += cbData->inputChannels1)
+            indata[i] = rptr[0];                       
+        if (fifo_write(cbData->infifo1, indata, framesPerBuffer)) {
+            //fprintf(g_logfile, "infifo1 full\n");
+        }
+        //fifo_write(cbData->outfifo1, indata, framesPerBuffer);
+    }
+
+    // OK now set up output samples for this callback
+
+    if(wptr) {
+        //fprintf(g_logfile,"out %ld %d\n",  framesPerBuffer, g_out++);
+        if (fifo_read(cbData->outfifo1, outdata, framesPerBuffer) == 0) {
+
+            // write signal to both channels
+
+            for(i = 0; i < framesPerBuffer; i++, wptr += 2) {
+                if (cbData->leftChannelVoxTone) {
+                    cbData->voxTonePhase += 2.0*M_PI*VOX_TONE_FREQ/g_soundCard1SampleRate;
+                    cbData->voxTonePhase -= 2.0*M_PI*floor(cbData->voxTonePhase/(2.0*M_PI));
+                    wptr[0] = VOX_TONE_AMP*cos(cbData->voxTonePhase);                              
+                    //printf("%f %d\n", cbData->voxTonePhase, wptr[0]);
+                }
+                else
+                    wptr[0] = outdata[i];
+                               
+                wptr[1] = outdata[i];
+            }
+        }
+        else {
+            //fprintf(g_logfile, "outfifo1 empty\n");
+            // zero output if no data available
+            for(i = 0; i < framesPerBuffer; i++, wptr += 2) {
+                wptr[0] = 0;
+                wptr[1] = 0;
+            }
+        }
+    }
+
+    return paContinue;
+}
+
+
+//-------------------------------------------------------------------------
+// txCallback()
+//-------------------------------------------------------------------------
+int MainFrame::txCallback(
+                            const void *inputBuffer,
+                            void *outputBuffer,
+                            unsigned long framesPerBuffer,
+                            const PaStreamCallbackTimeInfo *outTime,
+                            PaStreamCallbackFlags statusFlags,
+                            void *userData
+                        )
+{
+    paCallBackData  *cbData = (paCallBackData*)userData;
+    unsigned int    i;
+    short           *rptr    = (short*)inputBuffer;
+    short           *wptr    = (short*)outputBuffer;
+    short           indata[MAX_FPB];
+    short           outdata[MAX_FPB];
+
+    wxMutexLocker lock(g_mutexProtectingCallbackData);
+
+    //    if (statusFlags)
+    //    printf("cb2 statusFlags: 0x%x\n", (int)statusFlags);
+
+    // assemble a mono buffer and write to FIFO
+
+    assert(framesPerBuffer < MAX_FPB);
+
+    if(rptr) {
+        for(i = 0; i < framesPerBuffer; i++, rptr += cbData->inputChannels2)
+            indata[i] = rptr[0];                        
+    }
+
+    //#define SC2_LOOPBACK
+#ifdef SC2_LOOPBACK
+    //TODO: This doesn't work unless using the same soundcard!
+
+    if(wptr) {
+        for(i = 0; i < framesPerBuffer; i++, wptr += 2) {
+            wptr[0] = indata[i];
+            wptr[1] = indata[i];
+        }
+    }
+
+#else
+    if(rptr) {
+        if (fifo_write(cbData->infifo2, indata, framesPerBuffer)) {
+            //fprintf(g_logfile, "infifo2 full\n");
+        }
+    }
+
+    // OK now set up output samples for this callback
+
+    if(wptr) {
+        if (fifo_read(cbData->outfifo2, outdata, framesPerBuffer) == 0) {
+               
+            // write signal to both channels */
+            for(i = 0; i < framesPerBuffer; i++, wptr += 2) {
+                wptr[0] = outdata[i];
+                wptr[1] = outdata[i];
+            }
+        }
+        else {
+            //fprintf(g_logfile, "outfifo2 empty\n");
+            // zero output if no data available
+            for(i = 0; i < framesPerBuffer; i++, wptr += 2) {
+                wptr[0] = 0;
+                wptr[1] = 0;
+            }
+        }
+    }
+#endif
+    return paContinue;
+}
+
+// Callback from plot_spectrum & plot_waterfall.  would be nice to
+// work out a way to do this without globals.
+
+void fdmdv2_clickTune(float freq) {
+
+    // The demod is hard-wired to expect a centre frequency of
+    // FDMDV_FCENTRE.  So we want to take the signal centered on the
+    // click tune freq and re-centre it on FDMDV_FCENTRE.  For example
+    // if the click tune freq is 1500Hz, and FDMDV_CENTRE is 1200 Hz,
+    // we need to shift the input signal centred on 1500Hz down to
+    // 1200Hz, an offset of -300Hz.
+
+    if (g_split) {
+        g_RxFreqOffsetHz = FDMDV_FCENTRE - freq;
+    }
+    else {
+        g_TxFreqOffsetHz = freq - FDMDV_FCENTRE;
+        g_RxFreqOffsetHz = FDMDV_FCENTRE - freq;
+    }
+}
+
+//----------------------------------------------------------------
+// SetupSerialPort()
+//----------------------------------------------------------------
+void MainFrame::SetupSerialPort(void)
+{
+    if(!wxGetApp().m_strRigCtrlPort.IsEmpty())
+    {
+        if(openComPort(wxGetApp().m_strRigCtrlPort.c_str()))
+        {
+            // always start PTT in Rx state
+            SerialPTTRx();
+        }
+        else
+        {
+            wxMessageBox("Couldn't open Serial Port", wxT("About"), wxOK | wxICON_ERROR, this);
+        }
+    }
+}
+
+void MainFrame::SerialPTTRx(void)
+{
+    printf("m_boolUseRTS: %d m_boolRTSPos: %d m_boolUseDTR: %d m_boolDTRPos: %d\n",
+           wxGetApp().m_boolUseRTS, wxGetApp().m_boolRTSPos, wxGetApp().m_boolUseDTR, wxGetApp().m_boolDTRPos);
+
+        if(wxGetApp().m_boolRTSPos) // RTS cleared LOW
+            lowerRTS();
+        else                        // RTS cleared HIGH
+            raiseRTS();
+
+        if(wxGetApp().m_boolDTRPos) // DTR cleared LOW
+            lowerDTR();
+        else                        // DTR cleared HIGH
+            raiseDTR();
+}
+
+//----------------------------------------------------------------
+// CloseSerialPort()
+//----------------------------------------------------------------
+void MainFrame::CloseSerialPort(void)
+{
+    if (com_handle != COM_HANDLE_INVALID) {
+        // always end with PTT in rx state
+
+        SerialPTTRx();
+
+               closeComPort();
+    }
+}
+
+
+//----------------------------------------------------------------
+// PollUDP() - see if any commands on UDP port
+//----------------------------------------------------------------
+
+// test this puppy with netcat: 
+//   $ echo "hello" | nc -u -q1 localhost 3000
+
+int MainFrame::PollUDP(void)
+{
+    // this will block until message received, so we put it in it's own thread
+
+    char buf[1024];
+    char reply[80];
+    size_t n = m_udp_sock->RecvFrom(m_udp_addr, buf, sizeof(buf)).LastCount();
+
+    if (n) {
+        wxString bufstr = wxString::From8BitData(buf, n);
+        bufstr.Trim();
+        wxString ipaddr = m_udp_addr.IPAddress();
+        printf("Received: \"%s\" from %s:%u\n",
+               (const char *)bufstr.c_str(),
+               (const char *)ipaddr.c_str(), m_udp_addr.Service());
+
+        // for security only accept commands from local host
+
+        sprintf(reply,"nope\n");
+        if (ipaddr.Cmp(_("127.0.0.1")) == 0) {
+
+            // process commands
+
+            if (bufstr.Cmp(_("restore")) == 0) {
+                m_schedule_restore = true;  // Make Restore happen in main thread to avoid crashing
+                sprintf(reply,"ok\n");
+            }
+                
+            wxString itemToSet, val;
+            if (bufstr.StartsWith(_("set "), &itemToSet)) {
+                if (itemToSet.StartsWith("txtmsg ", &val)) {
+                    // note: if options dialog is open this will get overwritten
+                    wxGetApp().m_callSign = val;
+                }  
+                sprintf(reply,"ok\n");
+            }
+                
+        }
+        else {
+            printf("We only accept messages from locahost!\n");
+        }
+
+       if ( m_udp_sock->SendTo(m_udp_addr, reply, strlen(reply)).LastCount() != strlen(reply)) {
+           printf("ERROR: failed to send data\n");
+        }
+    }
+
+    return n;
+}
+
+void MainFrame::startUDPThread(void) {
+    printf("starting UDP thread!\n");
+    m_UDPThread = new UDPThread;
+    m_UDPThread->mf = this;
+    if (m_UDPThread->Create() != wxTHREAD_NO_ERROR ) {
+        wxLogError(wxT("Can't create thread!"));
+    }
+    if (m_UDPThread->Run() != wxTHREAD_NO_ERROR ) {
+        wxLogError(wxT("Can't start thread!"));
+        delete m_UDPThread;
+    }
+}
+
+void MainFrame::stopUDPThread(void) {
+    printf("stopping UDP thread!\n");
+    if ((m_UDPThread != NULL) && m_UDPThread->m_run) {
+        m_UDPThread->m_run = 0;
+        m_UDPThread->Wait();
+        m_UDPThread = NULL;
+    }
+}
+
+void *UDPThread::Entry() {
+    printf("UDP thread started!\n");
+    while (m_run) {
+        if (wxGetApp().m_udp_enable) {
+            printf("m_udp_enable\n");
+            mf->m_udp_addr.Service(wxGetApp().m_udp_port);
+            mf->m_udp_sock = new wxDatagramSocket(mf->m_udp_addr, wxSOCKET_NOWAIT);
+
+            while (m_run && wxGetApp().m_udp_enable) {
+                if (mf->PollUDP() == 0) {
+                    wxThread::Sleep(20);
+                }
+            }
+
+            delete mf->m_udp_sock;
+        }
+        wxThread::Sleep(20);
+    }
+    return NULL;
+}
+
+
+char my_get_next_tx_char(void *callback_state) {
+    short ch = 0;
+    
+    fifo_read(g_txDataInFifo, &ch, 1);
+    //fprintf(stderr, "get_next_tx_char: %c\n", (char)ch);
+    return (char)ch;
+}
+
+void my_put_next_rx_char(void *callback_state, char c) {
+    short ch = (short)c;
+    //fprintf(stderr, "put_next_rx_char: %c\n", (char)c);
+    fifo_write(g_rxDataOutFifo, &ch, 1);
+}
+
+// Callback from FreeDv API to update error plots
+
+void my_freedv_put_error_pattern(void *state, short error_pattern[], int sz_error_pattern) {
+    fifo_write(g_error_pattern_fifo, error_pattern, sz_error_pattern);
+}
diff --git a/freedv/branches/0.99/src/fdmdv2_main.h b/freedv/branches/0.99/src/fdmdv2_main.h
new file mode 100644 (file)
index 0000000..25a1e70
--- /dev/null
@@ -0,0 +1,614 @@
+//==========================================================================
+// Name:            fdmdv2_main.h
+//
+// Purpose:         Declares simple wxWidgets application with GUI.
+// Created:         Apr. 9, 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 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 License
+//  along with this program; if not, see <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#ifndef __FDMDV2_MAIN__
+#define __FDMDV2_MAIN__
+
+#include "version.h"
+#ifndef _NO_AUTOTOOLS_
+#include "../config.h"
+#endif
+#include <wx/wx.h>
+
+#include <wx/tglbtn.h>
+#include <wx/app.h>
+//#include <wx/aboutdlg.h>
+#include "wx/rawbmp.h"
+#include "wx/file.h"
+#include "wx/filename.h"
+#include "wx/config.h"
+#include <wx/fileconf.h>
+#include "wx/graphics.h"
+#include "wx/mstream.h"
+#include "wx/wfstream.h"
+#include "wx/quantize.h"
+#include "wx/scopedptr.h"
+#include "wx/stopwatch.h"
+#include "wx/versioninfo.h"
+#include <wx/sound.h>
+#include <wx/url.h>
+#include <wx/sstream.h>
+#include <wx/listbox.h>
+#include <wx/textdlg.h>
+#include <wx/regex.h>
+#include <wx/socket.h>
+
+#include <samplerate.h>
+
+#include <hamlib.h> 
+#include <stdint.h>
+#include <speex/speex_preprocess.h>
+
+#ifdef _WIN32
+#include <windows.h>
+#else
+#include <termios.h>
+#include <sys/ioctl.h>
+#endif
+
+#include "codec2.h"
+#include "codec2_fdmdv.h"
+#include "codec2_fifo.h"
+#include "golay23.h"
+#include "modem_stats.h"
+
+#include "topFrame.h"
+#include "dlg_ptt.h"
+#include "dlg_options.h"
+#include "fdmdv2_plot.h"
+#include "fdmdv2_plot_scalar.h"
+#include "fdmdv2_plot_scatter.h"
+#include "fdmdv2_plot_waterfall.h"
+#include "fdmdv2_plot_spectrum.h"
+#include "fdmdv2_pa_wrapper.h"
+#include "sndfile.h"
+#include "portaudio.h"
+#include "dlg_audiooptions.h"
+#include "dlg_filter.h"
+#include "dlg_options.h"
+#include "varicode.h"
+#include "sox_biquad.h"
+#include "comp_prim.h"
+
+#define _USE_TIMER              1
+#define _USE_ONIDLE             1
+#define _DUMMY_DATA             1
+//#define _AUDIO_PASSTHROUGH    1
+#define _REFRESH_TIMER_PERIOD   (DT*1000)
+//#define _USE_ABOUT_DIALOG       1
+
+enum {
+        ID_START = wxID_HIGHEST,
+        ID_TIMER_WATERFALL,
+        ID_TIMER_SPECTRUM,
+        ID_TIMER_SCATTER,
+        ID_TIMER_SCALAR
+     };
+
+#define EXCHANGE_DATA_IN    0
+#define EXCHANGE_DATA_OUT   1
+
+#ifdef _WIN32
+#define COM_HANDLE_INVALID                     INVALID_HANDLE_VALUE
+typedef HANDLE      com_handle_t;
+#else
+#define COM_HANDLE_INVALID                     -1
+typedef int         com_handle_t;
+#endif
+
+extern int                 g_nSoundCards;
+extern int                 g_soundCard1InDeviceNum;
+extern int                 g_soundCard1OutDeviceNum;
+extern int                 g_soundCard1SampleRate;
+extern int                 g_soundCard2InDeviceNum;
+extern int                 g_soundCard2OutDeviceNum;
+extern int                 g_soundCard2SampleRate;
+
+class MainFrame;
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class MainApp
+//
+// @class $(Name)
+// @author $(User)
+// @date $(Date)
+// @file $(CurrentFileName).$(CurrentFileExt)
+// @brief
+//
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class MainApp : public wxApp
+{
+    public:
+        virtual bool        OnInit();
+        virtual int         OnExit();
+
+        wxString            m_strVendName;
+        wxString            m_StrAppName;
+
+        wxString            m_textNumChOut;
+        wxString            m_textNumChIn;
+
+        wxString            m_strRxInAudio;
+        wxString            m_strRxOutAudio;
+        wxString            m_textVoiceInput;
+        wxString            m_textVoiceOutput;
+        wxString            m_strSampleRate;
+        wxString            m_strBitrate;
+
+        // PTT -----------------------------------
+
+        bool                m_boolHalfDuplex;
+
+        bool                m_boolHamlibUseForPTT;
+        unsigned int        m_intHamlibRig;
+        wxString            m_strHamlibSerialPort;
+        Hamlib              *m_hamlib;
+
+        bool                m_boolUseSerialPTT;
+        wxString            m_strRigCtrlPort;
+        bool                m_boolUseRTS;
+        bool                m_boolRTSPos;
+        bool                m_boolUseDTR;
+        bool                m_boolDTRPos;
+
+        // Play/Rec files
+
+        wxString            m_playFileToMicInPath;
+        wxString            m_recFileFromRadioPath;
+        unsigned int        m_recFileFromRadioSecs;
+        wxString            m_playFileFromRadioPath;
+
+        // Options dialog
+
+        wxString            m_callSign;
+        bool                m_events;
+        int                 m_events_spam_timer;
+        unsigned int        m_textEncoding;
+        bool                m_enable_checksum;
+        wxString            m_events_regexp_match;
+        wxString            m_events_regexp_replace;
+
+        bool                m_snrSlow;
+
+        // LPC Post Filter
+        bool                m_codec2LPCPostFilterEnable;
+        bool                m_codec2LPCPostFilterBassBoost;
+        float               m_codec2LPCPostFilterGamma;
+        float               m_codec2LPCPostFilterBeta;
+        
+        // Speex Pre-Processor
+        bool                m_speexpp_enable;
+
+        // Mic In Equaliser
+        float               m_MicInBassFreqHz;
+        float               m_MicInBassGaindB;
+        float               m_MicInTrebleFreqHz;
+        float               m_MicInTrebleGaindB;
+        float               m_MicInMidFreqHz;
+        float               m_MicInMidGaindB;
+        float               m_MicInMidQ;
+        bool                m_MicInEQEnable;
+
+        // Spk Out Equaliser
+        float               m_SpkOutBassFreqHz;
+        float               m_SpkOutBassGaindB;
+        float               m_SpkOutTrebleFreqHz;
+        float               m_SpkOutTrebleGaindB;
+        float               m_SpkOutMidFreqHz;
+        float               m_SpkOutMidGaindB;
+        float               m_SpkOutMidQ;
+        bool                m_SpkOutEQEnable;
+
+        // Flags for displaying windows
+        int                 m_show_wf;
+        int                 m_show_spect;
+        int                 m_show_scatter;
+        int                 m_show_timing;
+        int                 m_show_freq;
+        int                 m_show_speech_in;
+        int                 m_show_speech_out;
+        int                 m_show_demod_in;
+        int                 m_show_test_frame_errors;
+        int                 m_show_test_frame_errors_hist;
+
+        // optional vox trigger tone
+        bool                m_leftChannelVoxTone;
+
+        // UDP control port
+        bool                m_udp_enable;
+        int                 m_udp_port;
+
+        // notebook display after tx->rxtransition
+        int                 m_rxNbookCtrl;
+
+        wxRect              m_rTopWindow;
+
+        int                 m_framesPerBuffer;
+
+        bool                loadConfig();
+        bool                saveConfig();
+
+        // misc
+
+        bool       m_testFrames;
+        bool       m_channel_noise;
+        float      m_channel_snr_dB;
+
+        int        FilterEvent(wxEvent& event);
+        MainFrame *frame;
+
+        bool       m_FreeDV700txClip;
+    protected:
+};
+
+// declare global static function wxGetApp()
+DECLARE_APP(MainApp)
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// paCallBackData
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+typedef struct
+{
+    // libresample states for 48 to 8 kHz conversions
+
+    SRC_STATE      *insrc1;
+    SRC_STATE      *outsrc1;
+    SRC_STATE      *insrc2;
+    SRC_STATE      *outsrc2;
+    SRC_STATE      *insrcsf;
+
+    // FIFOs attached to first sound card
+
+    struct FIFO    *infifo1;
+    struct FIFO    *outfifo1;
+
+    // FIFOs attached to second sound card
+    struct FIFO    *infifo2;
+    struct FIFO    *outfifo2;
+
+    // FIFOs for rx process
+    struct FIFO    *rxinfifo;
+    struct FIFO    *rxoutfifo;
+
+    int             inputChannels1, inputChannels2;
+
+    // EQ filter states
+    void           *sbqMicInBass;
+    void           *sbqMicInTreble;
+    void           *sbqMicInMid;
+    void           *sbqSpkOutBass;
+    void           *sbqSpkOutTreble;
+    void           *sbqSpkOutMid;
+
+    bool            micInEQEnable;
+    bool            spkOutEQEnable;
+
+    // optional loud tone on left channel to reliably trigger vox
+    bool            leftChannelVoxTone;
+    float           voxTonePhase;
+
+} paCallBackData;
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// panel with custom loop checkbox for play file dialog
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class MyExtraPlayFilePanel : public wxPanel
+{
+public:
+    MyExtraPlayFilePanel(wxWindow *parent);
+    void setLoopPlayFileToMicIn(bool checked) { m_cb->SetValue(checked); }
+    bool getLoopPlayFileToMicIn(void) { return m_cb->GetValue(); }
+private:
+    wxCheckBox *m_cb;
+};
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// panel with custom Seconds-to-record control for record file dialog
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class MyExtraRecFilePanel : public wxPanel
+{
+public:
+    MyExtraRecFilePanel(wxWindow *parent);
+    ~MyExtraRecFilePanel() 
+    {
+        wxLogDebug("Destructor\n");
+    }
+    void setSecondsToRecord(wxString value) { m_secondsToRecord->SetValue(value); }
+    wxString getSecondsToRecord(void) 
+    { 
+        wxLogDebug("getSecondsToRecord: %s\n",m_secondsToRecord->GetValue());
+        return m_secondsToRecord->GetValue(); 
+    }
+private:
+    wxTextCtrl *m_secondsToRecord;
+};
+
+class txRxThread;
+class UDPThread;
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class MainFrame
+//
+// @class $(Name)
+// @author $(User)
+// @date $(Date)
+// @file $(CurrentFileName).$(CurrentFileExt)
+// @brief
+//
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class MainFrame : public TopFrame
+{
+    public:
+        MainFrame(wxWindow *parent);
+        virtual ~MainFrame();
+
+        PlotSpectrum*           m_panelSpectrum;
+        PlotWaterfall*          m_panelWaterfall;
+        PlotScatter*            m_panelScatter;
+        PlotScalar*             m_panelTimeOffset;
+        PlotScalar*             m_panelFreqOffset;
+        PlotScalar*             m_panelSpeechIn;
+        PlotScalar*             m_panelSpeechOut;
+        PlotScalar*             m_panelDemodIn;
+        PlotScalar*             m_panelTestFrameErrors;
+        PlotScalar*             m_panelTestFrameErrorsHist;
+
+        bool                    m_RxRunning;
+
+        PortAudioWrap           *m_rxInPa;
+        PortAudioWrap           *m_rxOutPa;
+        PortAudioWrap           *m_txInPa;
+        PortAudioWrap           *m_txOutPa;
+
+        PaError                 m_rxErr;
+        PaError                 m_txErr;
+        
+        txRxThread*             m_txRxThread;
+
+        bool                    OpenHamlibRig();
+        void                    SetupSerialPort(void);
+        void                    CloseSerialPort(void);
+        void                    SerialPTTRx(void);
+
+        bool                    m_modal;
+
+#ifdef _USE_TIMER
+        wxTimer                 m_plotTimer;
+#endif
+
+    void destroy_fifos(void);
+    void destroy_src(void);
+    void autoDetectSoundCards(PortAudioWrap *pa);
+
+        static int rxCallback(
+                                const void *inBuffer,
+                                void *outBuffer,
+                                unsigned long framesPerBuffer,
+                                const PaStreamCallbackTimeInfo *outTime,
+                                PaStreamCallbackFlags statusFlags,
+                                void *userData
+                             );
+        static int txCallback(
+                                const void *inBuffer,
+                                void *outBuffer,
+                                unsigned long framesPerBuffer,
+                                const PaStreamCallbackTimeInfo *outTime,
+                                PaStreamCallbackFlags statusFlags,
+                                void *userData
+                             );
+
+
+    void initPortAudioDevice(PortAudioWrap *pa, int inDevice, int outDevice, 
+                             int soundCard, int sampleRate, int inputChannels);
+
+    void togglePTT(void);
+
+    wxIPV4address           m_udp_addr;
+    wxDatagramSocket       *m_udp_sock;
+    UDPThread              *m_UDPThread;
+    void                    startUDPThread(void);
+    void                    stopUDPThread(void);
+    int                     PollUDP();
+    bool                    m_schedule_restore;
+
+    protected:
+
+#ifdef _WIN32
+#define COM_HANDLE_INVALID                     INVALID_HANDLE_VALUE
+        com_handle_t  com_handle;
+#else
+#define COM_HANDLE_INVALID                     -1
+        com_handle_t  com_handle;
+#endif
+        void raiseDTR(void);
+        void lowerDTR(void);
+        void raiseRTS(void);
+        void lowerRTS(void);
+        bool openComPort(const char *port);
+        void closeComPort(void);
+
+        void setsnrBeta(bool snrSlow);
+
+        // protected event handlers
+        virtual void OnCloseFrame(wxCloseEvent& event);
+        void OnExitClick(wxCommandEvent& event);
+
+        void startTxStream();
+        void startRxStream();
+        void stopTxStream();
+        void stopRxStream();
+        void abortTxStream();
+        void abortRxStream();
+        
+        void OnTop(wxCommandEvent& event);
+        void OnExit( wxCommandEvent& event );
+
+        void OnToolsAudio( wxCommandEvent& event );
+        void OnToolsAudioUI( wxUpdateUIEvent& event );
+        void OnToolsComCfg( wxCommandEvent& event );
+        void OnToolsComCfgUI( wxUpdateUIEvent& event );
+        void OnToolsFilter( wxCommandEvent& event );
+        void OnToolsOptions(wxCommandEvent& event);
+        void OnToolsOptionsUI(wxUpdateUIEvent& event);
+
+        void OnPlayFileToMicIn( wxCommandEvent& event );
+        void OnRecFileFromRadio( wxCommandEvent& event );
+        void OnPlayFileFromRadio( wxCommandEvent& event );
+
+        void OnHelpCheckUpdates( wxCommandEvent& event );
+        void OnHelpCheckUpdatesUI( wxUpdateUIEvent& event );
+        void OnHelpAbout( wxCommandEvent& event );
+        void OnCmdSliderScroll( wxScrollEvent& event );
+//        void OnSliderScrollBottom( wxScrollEvent& event );
+//        void OnCmdSliderScrollChanged( wxScrollEvent& event );
+//        void OnSliderScrollTop( wxScrollEvent& event );
+        void OnCheckSQClick( wxCommandEvent& event );
+        void OnCheckSNRClick( wxCommandEvent& event );
+
+        // Toggle Buttons
+        void OnTogBtnSplitClick(wxCommandEvent& event);
+        void OnTogBtnAnalogClick(wxCommandEvent& event);
+        void OnTogBtnRxID( wxCommandEvent& event );
+        void OnTogBtnTxID( wxCommandEvent& event );
+        void OnTogBtnPTT( wxCommandEvent& event );
+        void OnTogBtnOnOff( wxCommandEvent& event );
+
+        void OnCallSignReset( wxCommandEvent& event );
+        void OnBerReset( wxCommandEvent& event );
+
+        //System Events
+        void OnPaint(wxPaintEvent& event);
+        void OnSize( wxSizeEvent& event );
+        void OnUpdateUI( wxUpdateUIEvent& event );
+        void OnDeleteConfig(wxCommandEvent&);
+#ifdef _USE_TIMER
+        void OnTimer(wxTimerEvent &evt);
+#endif
+#ifdef _USE_ONIDLE
+        void OnIdle(wxIdleEvent &evt);
+#endif
+
+    private:
+        bool        m_useMemory;
+        wxTextCtrl* m_tc;
+        int         m_zoom;
+        float       m_snrBeta;
+        
+        // Callsign/text messaging
+        char        m_callsign[MAX_CALLSIGN];
+        char       *m_pcallsign;
+        unsigned int m_checksumGood;
+        unsigned int m_checksumBad;
+        
+        // Events
+        void        processTxtEvent(char event[]);
+        class OptionsDlg *optionsDlg;
+        wxTimer     spamTimer[MAX_EVENT_RULES];
+
+        // level Gauge
+        float       m_maxLevel;
+        // flags to indicate when new EQ filters need to be designed
+
+        bool        m_newMicInFilter;
+        bool        m_newSpkOutFilter;
+
+        void*       designAnEQFilter(const char filterType[], float freqHz, float gaindB, float Q = 0.0);
+        void        designEQFilters(paCallBackData *cb);
+        void        deleteEQFilters(paCallBackData *cb);
+};
+
+void txRxProcessing();
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// class txRxThread - experimental tx/rx processing thread
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class txRxThread : public wxThread
+{
+public:
+    txRxThread(void) : wxThread(wxTHREAD_JOINABLE) { m_run = 1; }
+
+    // thread execution starts here
+    void *Entry() 
+    {
+        while (m_run) 
+        {
+            txRxProcessing();        
+            wxThread::Sleep(20);
+        }
+        return NULL;
+    }
+
+    // called when the thread exits - whether it terminates normally or is
+    // stopped with Delete() (but not when it is Kill()ed!)
+    void OnExit() { }
+
+public:
+    bool  m_run;
+};
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// class UDPThread - waits for UDP messages
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class UDPThread : public wxThread
+{
+public:
+    UDPThread(void) : wxThread(wxTHREAD_JOINABLE) { m_run = 1; }
+
+    // thread execution starts here
+    void *Entry();
+
+    // called when the thread exits - whether it terminates normally or is
+    // stopped with Delete() (but not when it is Kill()ed!)
+    void OnExit() { }
+
+public:
+    MainFrame              *mf;
+    bool                    m_run;
+};
+
+void resample_for_plot(struct FIFO *plotFifo, short buf[], int length, int fs);
+
+int resample(SRC_STATE *src,
+             short      output_short[],
+             short      input_short[],
+             int        output_sample_rate,
+             int        input_sample_rate,
+             int        length_output_short, // maximum output array length in samples
+             int        length_input_short
+             );
+void txRxProcessing();
+void per_frame_rx_processing(
+                                        FIFO    *output_fifo,   // decoded speech samples
+                                        FIFO    *input_fifo     // modem samples input to demod
+                                    );
+
+// FreeDv API calls this when there is a test frame that needs a-plottin'
+
+void my_freedv_put_error_pattern(void *state, short error_pattern[], int sz_error_pattern);
+
+// FreeDv API calls these puppies when it needs/receives a text char 
+
+char my_get_next_tx_char(void *callback_state);
+void my_put_next_rx_char(void *callback_state, char c);
+
+#endif //__FDMDV2_MAIN__
diff --git a/freedv/branches/0.99/src/fdmdv2_pa_wrapper.cpp b/freedv/branches/0.99/src/fdmdv2_pa_wrapper.cpp
new file mode 100644 (file)
index 0000000..2f67ca2
--- /dev/null
@@ -0,0 +1,324 @@
+//==========================================================================
+// Name:            fdmdv2_pa_wrapper.cpp
+// Purpose:         Implements a wrapper class around the PortAudio library.
+// Created:         August 12, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#include "fdmdv2_pa_wrapper.h"
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// PortAudioWrap()
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+PortAudioWrap::PortAudioWrap()
+{
+    m_pStream                   = NULL;
+    m_pUserData                 = NULL;
+    m_samplerate                = 0;
+    m_framesPerBuffer           = 0;
+    m_statusFlags               = 0;
+    m_pStreamCallback           = NULL;
+    m_pStreamFinishedCallback   = NULL;
+    m_pTimeInfo                 = 0;
+    m_newdata                   = false;
+
+//    loadData();
+}
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// ~PortAudioWrap()
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+PortAudioWrap::~PortAudioWrap()
+{
+}
+
+//----------------------------------------------------------------
+// streamOpen()
+//----------------------------------------------------------------
+PaError PortAudioWrap::streamOpen()
+{
+    return Pa_OpenStream(
+                            &m_pStream,
+                            m_inputBuffer.device == paNoDevice ? NULL : &m_inputBuffer,
+                            m_outputBuffer.device == paNoDevice ? NULL : &m_outputBuffer,
+                            m_samplerate,
+                            m_framesPerBuffer,
+                            m_statusFlags,
+                            *m_pStreamCallback,
+                            m_pUserData
+                        );
+}
+
+//----------------------------------------------------------------
+// streamStart()
+//----------------------------------------------------------------
+PaError PortAudioWrap::streamStart()
+{
+    return Pa_StartStream(m_pStream);
+}
+
+//----------------------------------------------------------------
+// streamClose()
+//----------------------------------------------------------------
+PaError PortAudioWrap::streamClose()
+{
+    if(isOpen())
+    {
+        PaError rv = Pa_CloseStream(m_pStream);
+        return rv;
+    }
+    else
+    {
+        return paNoError;
+    }
+}
+
+//----------------------------------------------------------------
+// terminate()
+//----------------------------------------------------------------
+void PortAudioWrap::terminate()
+{
+    if(Pa_IsStreamStopped(m_pStream) != paNoError)
+    {
+        Pa_StopStream(m_pStream);
+    }
+    Pa_Terminate();
+}
+
+//----------------------------------------------------------------
+// stop()
+//----------------------------------------------------------------
+void PortAudioWrap::stop()
+{
+    Pa_StopStream(m_pStream);
+}
+
+//----------------------------------------------------------------
+// abort()
+//----------------------------------------------------------------
+void PortAudioWrap::abort()
+{
+    Pa_AbortStream(m_pStream);
+}
+
+//----------------------------------------------------------------
+// isStopped()
+//----------------------------------------------------------------
+bool PortAudioWrap::isStopped() const
+{
+    PaError ret = Pa_IsStreamStopped(m_pStream);
+    return ret;
+}
+
+//----------------------------------------------------------------
+// isActive()
+//----------------------------------------------------------------
+bool PortAudioWrap::isActive() const
+{
+    PaError ret = Pa_IsStreamActive(m_pStream);
+    return ret;
+}
+
+//----------------------------------------------------------------
+// isOpen()
+//----------------------------------------------------------------
+bool PortAudioWrap::isOpen() const
+{
+    return (m_pStream != NULL);
+}
+
+//----------------------------------------------------------------
+// getDefaultInputDevice()
+//----------------------------------------------------------------
+PaDeviceIndex PortAudioWrap::getDefaultInputDevice()
+{
+    return Pa_GetDefaultInputDevice();
+}
+
+//----------------------------------------------------------------
+// getDefaultOutputDevice()
+//----------------------------------------------------------------
+PaDeviceIndex PortAudioWrap::getDefaultOutputDevice()
+{
+    return Pa_GetDefaultOutputDevice();
+}
+
+//----------------------------------------------------------------
+// setInputChannelCount()
+//----------------------------------------------------------------
+PaError PortAudioWrap::setInputChannelCount(int count)
+{
+    m_inputBuffer.channelCount = count;
+    return paNoError;
+}
+
+//----------------------------------------------------------------
+// getInputChannelCount()
+//----------------------------------------------------------------
+PaError PortAudioWrap::getInputChannelCount()
+{
+    return m_inputBuffer.channelCount;
+}
+
+//----------------------------------------------------------------
+// setInputSampleFormat()
+//----------------------------------------------------------------
+PaError PortAudioWrap::setInputSampleFormat(PaSampleFormat format)
+{
+    m_inputBuffer.sampleFormat = format;
+    return paNoError;
+}
+
+//----------------------------------------------------------------
+// setInputLatency()
+//----------------------------------------------------------------
+PaError PortAudioWrap::setInputLatency(PaTime latency)
+{
+    m_inputBuffer.suggestedLatency = latency;
+    return paNoError;
+}
+
+//----------------------------------------------------------------
+// setInputHostApiStreamInfo()
+//----------------------------------------------------------------
+void PortAudioWrap::setInputHostApiStreamInfo(void *info)
+{
+    m_inputBuffer.hostApiSpecificStreamInfo = info;
+}
+
+//----------------------------------------------------------------
+// getInputDefaultLowLatency()
+//----------------------------------------------------------------
+PaTime  PortAudioWrap::getInputDefaultLowLatency()
+{
+    return Pa_GetDeviceInfo(m_inputBuffer.device)->defaultLowInputLatency;
+}
+
+//----------------------------------------------------------------
+// setOutputChannelCount()
+//----------------------------------------------------------------
+PaError PortAudioWrap::setOutputChannelCount(int count)
+{
+    m_outputBuffer.channelCount = count;
+    return paNoError;
+}
+
+//----------------------------------------------------------------
+// getOutputChannelCount()
+//----------------------------------------------------------------
+const int PortAudioWrap::getOutputChannelCount()
+{
+    return m_outputBuffer.channelCount;
+}
+
+//----------------------------------------------------------------
+// getDeviceName()
+//----------------------------------------------------------------
+const char *PortAudioWrap::getDeviceName(PaDeviceIndex dev)
+{
+    const PaDeviceInfo *info;
+    info = Pa_GetDeviceInfo(dev);
+    return info->name;
+}
+
+//----------------------------------------------------------------
+// setOutputSampleFormat()
+//----------------------------------------------------------------
+PaError PortAudioWrap::setOutputSampleFormat(PaSampleFormat format)
+{
+    m_outputBuffer.sampleFormat = format;
+    return paNoError;
+}
+
+//----------------------------------------------------------------
+// setOutputLatency()
+//----------------------------------------------------------------
+PaError PortAudioWrap::setOutputLatency(PaTime latency)
+{
+    m_outputBuffer.suggestedLatency = latency;
+    return paNoError;
+}
+
+//----------------------------------------------------------------
+// setOutputHostApiStreamInfo()
+//----------------------------------------------------------------
+void PortAudioWrap::setOutputHostApiStreamInfo(void *info)
+{
+    m_outputBuffer.hostApiSpecificStreamInfo = info;
+}
+
+//----------------------------------------------------------------
+// getOutputDefaultLowLatency()
+//----------------------------------------------------------------
+PaTime  PortAudioWrap::getOutputDefaultLowLatency()
+{
+    return Pa_GetDeviceInfo(m_outputBuffer.device)->defaultLowOutputLatency;
+}
+
+//----------------------------------------------------------------
+// setFramesPerBuffer()
+//----------------------------------------------------------------
+PaError PortAudioWrap::setFramesPerBuffer(unsigned long size)
+{
+    m_framesPerBuffer = size;
+    return paNoError;
+}
+
+//----------------------------------------------------------------
+// setSampleRate()
+//----------------------------------------------------------------
+PaError PortAudioWrap::setSampleRate(unsigned long rate)
+{
+    m_samplerate = rate;
+    return paNoError;
+}
+
+//----------------------------------------------------------------
+// setStreamFlags()
+//----------------------------------------------------------------
+PaError PortAudioWrap::setStreamFlags(PaStreamFlags flags)
+{
+    m_statusFlags = flags;
+    return paNoError;
+}
+
+//----------------------------------------------------------------
+// setInputDevice()
+//----------------------------------------------------------------
+PaError PortAudioWrap::setInputDevice(PaDeviceIndex index)
+{
+    m_inputBuffer.device = index;
+    return paNoError;
+}
+
+//----------------------------------------------------------------
+// setOutputDevice()
+//----------------------------------------------------------------
+PaError PortAudioWrap::setOutputDevice(PaDeviceIndex index)
+{
+    m_outputBuffer.device = index;
+    return paNoError;
+}
+
+//----------------------------------------------------------------
+// setCallback()
+//----------------------------------------------------------------
+PaError PortAudioWrap::setCallback(PaStreamCallback *callback)
+{
+    m_pStreamCallback = callback;
+    return paNoError;
+}
+
diff --git a/freedv/branches/0.99/src/fdmdv2_pa_wrapper.h b/freedv/branches/0.99/src/fdmdv2_pa_wrapper.h
new file mode 100644 (file)
index 0000000..3d216c0
--- /dev/null
@@ -0,0 +1,115 @@
+//==========================================================================
+// Name:            fdmdv2_pa_wrapper.h
+// Purpose:         Defines a wrapper class around PortAudio
+// Created:         August 12, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#include <stdio.h>
+#include <math.h>
+#include "fdmdv2_defines.h"
+#include "codec2_fdmdv.h"
+#include "codec2.h"
+#include "portaudio.h"
+
+#define PA_SAMPLE_TYPE      paInt16         //paFloat32
+#define FRAMES_PER_BUFFER   (64)
+
+typedef float SAMPLE;
+
+class PortAudioWrap
+{
+    public:
+        PortAudioWrap();
+        ~PortAudioWrap();
+
+//        float                           m_av_mag[FDMDV_NSPEC];
+
+    private:
+        PaStream                        *m_pStream;
+        void                            *m_pUserData;
+        PaStreamCallback                *m_pStreamCallback;
+        PaStreamFinishedCallback        *m_pStreamFinishedCallback;
+        const PaStreamCallbackTimeInfo  *m_pTimeInfo;
+        struct FDMDV                    *m_pFDMDV_state;
+        PaStreamParameters              m_inputBuffer;
+        PaStreamParameters              m_outputBuffer;
+        int                             m_samplerate;
+        unsigned long                   m_framesPerBuffer;
+        PaStreamCallbackFlags           m_statusFlags;
+        bool                            m_newdata;
+
+    public:
+
+        void                averageData(float mag_dB[]);
+
+        int                 getDeviceCount() { return Pa_GetDeviceCount(); }
+        PaDeviceIndex       getDefaultInputDevice();
+        PaDeviceIndex       getDefaultOutputDevice();
+        PaStreamParameters  *getDeviceInfo(PaDeviceIndex idx);
+
+        PaError             setFramesPerBuffer(unsigned long size);
+        PaError             setSampleRate(unsigned long size);
+
+        PaError             setStreamFlags(PaStreamFlags flags);
+        PaError             setCallback(PaStreamCallback *m_pStreamCallback);
+        PaError             setStreamCallback(PaStream *stream, PaStreamCallback* callback) { m_pStreamCallback = callback; return 0;}
+        PaError             setStreamFinishedCallback(PaStream *stream, PaStreamFinishedCallback* m_pStreamFinishedCallback);
+
+        void                setInputBuffer(const PaStreamParameters& inputBuffer)   {this->m_inputBuffer = inputBuffer;}
+        PaError             setInputDevice(PaDeviceIndex dev);
+        PaError             setInputChannelCount(int count);
+        int                 getInputChannelCount();
+        PaError             setInputSampleFormat(PaSampleFormat format);
+        PaError             setInputSampleRate(PaSampleFormat format);
+        PaError             setInputLatency(PaTime latency);
+        void                setInputHostApiStreamInfo(void *info = NULL);
+        PaTime              getInputDefaultLowLatency();
+        const char          *getDeviceName(PaDeviceIndex dev);
+
+        PaError             setOutputDevice(PaDeviceIndex dev);
+        PaError             setOutputChannelCount(int count);
+        const int           getOutputChannelCount();
+        PaError             setOutputSampleFormat(PaSampleFormat format);
+        PaError             setOutputLatency(PaTime latency);
+        void                setOutputHostApiStreamInfo(void *info = NULL);
+        PaTime              getOutputDefaultLowLatency();
+
+        void                setFdmdvState(FDMDV* fdmdv_state)                       {this->m_pFDMDV_state = fdmdv_state;}
+        void                setOutputBuffer(const PaStreamParameters& outputBuffer) {this->m_outputBuffer = outputBuffer;}
+        void                setTimeInfo(PaStreamCallbackTimeInfo* timeInfo)         {this->m_pTimeInfo = timeInfo;}
+        void                setUserData(void* userData)                             {this->m_pUserData = userData;}
+        unsigned long       getFramesPerBuffer() const                              {return m_framesPerBuffer;}
+        const               PaStreamParameters& getInputBuffer() const              {return m_inputBuffer;}
+        const               PaStreamParameters& getOutputBuffer() const             {return m_outputBuffer;}
+        const               PaStreamCallbackFlags& getStatusFlags() const           {return m_statusFlags;}
+
+        FDMDV*              getFdmdvState()                                         {return m_pFDMDV_state;}
+        int                 getSamplerate() const                                   {return m_samplerate;}
+        PaStream*           getStream()                                             {return m_pStream;}
+        void                *getUserData()                                          {return m_pUserData;}
+        bool                getDataAvail()                                          {return m_newdata;}
+        PaError             streamStart();
+        PaError             streamClose();
+        PaError             streamOpen();
+        void                terminate();
+        void                stop();
+        void                abort();
+        bool                isOpen() const;
+        bool                isStopped() const;
+        bool                isActive() const;
+//        void                loadData();
+};
diff --git a/freedv/branches/0.99/src/fdmdv2_plot.cpp b/freedv/branches/0.99/src/fdmdv2_plot.cpp
new file mode 100644 (file)
index 0000000..1b85cd9
--- /dev/null
@@ -0,0 +1,283 @@
+//==========================================================================
+// Name:            fdmdv2_plot.cpp
+// Purpose:         Implements simple wxWidgets application with GUI.
+// Created:         Apr. 9, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#include <string.h>
+#include "fdmdv2_plot.h"
+
+BEGIN_EVENT_TABLE(PlotPanel, wxPanel)
+    EVT_PAINT           (PlotPanel::OnPaint)
+    EVT_MOTION          (PlotPanel::OnMouseMove)
+    EVT_LEFT_DOWN       (PlotPanel::OnMouseLeftDown)
+    EVT_LEFT_UP         (PlotPanel::OnMouseLeftUp)
+    EVT_RIGHT_DOWN      (PlotPanel::OnMouseRightDown)
+    EVT_MOUSEWHEEL      (PlotPanel::OnMouseWheelMoved)
+    EVT_SIZE            (PlotPanel::OnSize)
+    EVT_SHOW            (PlotPanel::OnShow)
+END_EVENT_TABLE()
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class PlotPanel(wxFrame* parent) : wxPanel(parent)
+//
+// @class $(Name)
+// @author $(User)
+// @date $(Date)
+// @file $(CurrentFileName).$(CurrentFileExt)
+// @brief
+//
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+PlotPanel::PlotPanel(wxFrame* parent) : wxPanel(parent)
+{
+    m_pNoteBook         = (wxAuiNotebook *) parent;
+    m_pTopFrame         = (MainFrame *)m_pNoteBook->GetParent();
+    m_zoomFactor        = 1.0;
+    m_pBmp              = NULL;
+    m_pPix              = NULL;
+    m_firstPass         = true;
+    m_line_color        = 0;
+    m_newdata           = false;
+    m_clip              = false;
+    m_use_bitmap        = true;
+    m_rubberBand        = false;
+    m_mouseDown         = false;
+    m_penShortDash      = wxPen(wxColor(0xA0, 0xA0, 0xA0), 1, wxPENSTYLE_SHORT_DASH);
+    m_penDotDash        = wxPen(wxColor(0xD0, 0xD0, 0xD0), 1, wxPENSTYLE_DOT_DASH);
+    m_penSolid          = wxPen(wxColor(0x00, 0x00, 0x00), 1, wxPENSTYLE_SOLID);
+    SetBackgroundStyle(wxBG_STYLE_PAINT);
+    SetLabelSize(10.0);
+}
+
+//-------------------------------------------------------------------------
+// ~PlotPanel()
+//-------------------------------------------------------------------------
+PlotPanel::~PlotPanel()
+{
+    if(m_pBmp != NULL)
+    {
+        delete m_pBmp;
+    }
+}
+
+//-------------------------------------------------------------------------
+// GetLabelSize()
+//-------------------------------------------------------------------------
+double PlotPanel::GetLabelSize()
+{
+    return m_label_size;
+}
+
+//-------------------------------------------------------------------------
+// SetLabelSize()
+//-------------------------------------------------------------------------
+void PlotPanel::SetLabelSize(double size)
+{
+    m_label_size = size;
+}
+
+//-------------------------------------------------------------------------
+// OnShow()
+//-------------------------------------------------------------------------
+void PlotPanel::OnShow(wxShowEvent& event)
+{
+    this->Refresh();
+}
+
+//-------------------------------------------------------------------------
+// OnErase()
+//-------------------------------------------------------------------------
+void PlotPanel::OnErase(wxEraseEvent& event)
+{
+    event.Skip();
+}
+
+//-------------------------------------------------------------------------
+// OnSize()
+//-------------------------------------------------------------------------
+void PlotPanel::OnSize(wxSizeEvent& event)
+{
+    m_rCtrlPrev = m_rCtrl;
+    m_rCtrl     = GetClientRect();
+    if(m_use_bitmap)
+    {
+        if(!m_oImage.IsOk())
+        {
+            m_oImage.Create(m_rCtrl.GetWidth(), m_rCtrl.GetHeight(), true);
+        }
+        else
+        {
+            m_oImage.Rescale(m_rCtrl.GetWidth(), m_rCtrl.GetHeight());
+        }
+        m_pBmp = new wxBitmap(m_oImage, wxBITMAP_SCREEN_DEPTH);
+        m_firstPass = true;
+    }
+    this->Refresh();
+}
+
+//-------------------------------------------------------------------------
+// OnMouseMove()
+//-------------------------------------------------------------------------
+void PlotPanel::OnMouseMove(wxMouseEvent& event)
+{
+//    if(m_mouseDown)
+//    {
+//        paintNow();
+//    }
+}
+
+//-------------------------------------------------------------------------
+// OnMouseLeftDown()
+//-------------------------------------------------------------------------
+void PlotPanel::OnMouseLeftDown(wxMouseEvent& event)
+{
+}
+
+//-------------------------------------------------------------------------
+// OnMouseRightDown()
+//-------------------------------------------------------------------------
+void PlotPanel::OnMouseRightDown(wxMouseEvent& event)
+{
+}
+
+//-------------------------------------------------------------------------
+// OnMouseWheelMoved()
+//-------------------------------------------------------------------------
+void PlotPanel::OnMouseWheelMoved(wxMouseEvent& event)
+{
+}
+
+//-------------------------------------------------------------------------
+// OnMouseLeftUp()
+//-------------------------------------------------------------------------
+void PlotPanel::OnMouseLeftUp(wxMouseEvent& event)
+{
+    m_mouseDown = false;
+}
+
+//-------------------------------------------------------------------------
+// SetZoomFactor()
+//-------------------------------------------------------------------------
+double PlotPanel::SetZoomFactor(double zf)
+{
+    if((zf > 0) && (zf < 5.0))
+    {
+        m_zoomFactor = zf;
+    }
+    return zf;
+}
+
+//-------------------------------------------------------------------------
+// GetZoomFactor()
+//-------------------------------------------------------------------------
+double PlotPanel::GetZoomFactor(double zf)
+{
+    return m_zoomFactor;
+}
+
+//-------------------------------------------------------------------------
+// draw()
+//-------------------------------------------------------------------------
+void PlotPanel::draw(wxAutoBufferedPaintDC& pDC)
+{
+    printf("PlotPanel::draw()");
+    wxMemoryDC m_mDC;
+    m_mDC.SelectObject(*m_pBmp);
+    m_rCtrl  = GetClientRect();
+    m_rGrid  = m_rCtrl;
+
+    m_rGrid = m_rGrid.Deflate(PLOT_BORDER + (XLEFT_OFFSET/2), (PLOT_BORDER + (YBOTTOM_OFFSET/2)));
+    m_rGrid.Offset(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER);
+
+    pDC.Clear();
+    m_rPlot = wxRect(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER, m_rGrid.GetWidth(), m_rGrid.GetHeight());
+    if(m_firstPass)
+    {
+        m_firstPass = false;
+        m_mDC.FloodFill(0, 0, VERY_LTGREY_COLOR);
+
+        // Draw a filled rectangle with aborder
+        wxBrush ltGraphBkgBrush = wxBrush(DARK_BLUE_COLOR);
+        m_mDC.SetBrush(ltGraphBkgBrush);
+        m_mDC.SetPen(wxPen(BLACK_COLOR, 0));
+        m_mDC.DrawRectangle(m_rPlot);
+    }
+    if(m_newdata)
+    {
+        m_newdata = false;
+        int t = m_rPlot.GetTop();
+        int l = m_rPlot.GetLeft();
+//        int r = m_rPlot.GetRight();
+        int h = m_rPlot.GetHeight();
+        int w = m_rPlot.GetWidth();
+        pDC.Blit(l, t, w, h, &m_mDC, l, t);
+    }
+    drawGraticule(pDC);
+    m_mDC.SetBrush(wxNullBrush);
+    m_mDC.SelectObject(wxNullBitmap);
+}
+
+//-------------------------------------------------------------------------
+// drawGraticule()
+//-------------------------------------------------------------------------
+void PlotPanel::drawGraticule(wxAutoBufferedPaintDC& pDC)
+{
+    int p;
+    char buf[15];
+    wxString s;
+
+    // Vertical gridlines
+    pDC.SetPen(m_penShortDash);
+    for(p = (PLOT_BORDER + XLEFT_OFFSET + GRID_INCREMENT); p < ((m_rGrid.GetWidth() - XLEFT_OFFSET) + GRID_INCREMENT); p += GRID_INCREMENT)
+    {
+        pDC.DrawLine(p, (m_rGrid.GetHeight() + PLOT_BORDER), p, PLOT_BORDER);
+    }
+    // Horizontal gridlines
+    pDC.SetPen(m_penDotDash);
+    for(p = (m_rGrid.GetHeight() - GRID_INCREMENT); p > PLOT_BORDER; p -= GRID_INCREMENT)
+    {
+        pDC.DrawLine(PLOT_BORDER + XLEFT_OFFSET, (p + PLOT_BORDER), (m_rGrid.GetWidth() + PLOT_BORDER + XLEFT_OFFSET), (p + PLOT_BORDER));
+    }
+    // Label the X-Axis
+    pDC.SetPen(wxPen(GREY_COLOR, 1));
+    for(p = GRID_INCREMENT; p < (m_rGrid.GetWidth() - YBOTTOM_OFFSET); p += GRID_INCREMENT)
+    {
+        sprintf(buf, "%1.1f Hz",(double)(p / 10));
+        pDC.DrawText(buf, p - PLOT_BORDER + XLEFT_OFFSET, m_rGrid.GetHeight() + YBOTTOM_OFFSET/2);
+    }
+    // Label the Y-Axis
+    //for(p = GRID_INCREMENT; p < (h - YBOTTOM_OFFSET); p += GRID_INCREMENT)
+    for(p = (m_rGrid.GetHeight() - GRID_INCREMENT); p > PLOT_BORDER; p -= GRID_INCREMENT)
+    {
+        sprintf(buf, "%1.0f", (double)((m_rGrid.GetHeight() - p) * -10));
+        pDC.DrawText(buf, XLEFT_TEXT_OFFSET, p);
+    }
+}
+
+//-------------------------------------------------------------------------
+// paintEvent()
+//
+// Called by the system of by wxWidgets when the panel needs
+// to be redrawn. You can also trigger this call by calling
+// Refresh()/Update().
+//-------------------------------------------------------------------------
+void PlotPanel::OnPaint(wxPaintEvent & evt)
+{
+    wxAutoBufferedPaintDC pdc(this);
+    draw(pdc);
+}
+
diff --git a/freedv/branches/0.99/src/fdmdv2_plot.h b/freedv/branches/0.99/src/fdmdv2_plot.h
new file mode 100644 (file)
index 0000000..25309d3
--- /dev/null
@@ -0,0 +1,150 @@
+//==========================================================================
+// Name:            fdmdv2_plot.h
+// Purpose:         Declares simple wxWidgets application with GUI
+// Created:         Apr. 10, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+//#include "fdmdv2_main.h"
+#ifndef __FDMDV2_PLOT__
+#define __FDMDV2_PLOT__
+#include <wx/wx.h>
+#include <wx/aui/auibook.h>
+#include <wx/rawbmp.h>
+#include <wx/image.h>
+#include <wx/dcbuffer.h>
+
+#define MAX_ZOOM            7
+#define MAX_BMP_X           (400 * MAX_ZOOM)
+#define MAX_BMP_Y           (400 * MAX_ZOOM)
+#define DATA_LINE_HEIGHT    10
+#define TEXT_BASELINE_OFFSET_Y  -5
+
+
+#define wxUSE_FILEDLG       1
+#define wxUSE_LIBPNG        1
+#define wxUSE_LIBJPEG       1
+#define wxUSE_GIF           1
+#define wxUSE_PCX           1
+#define wxUSE_LIBTIFF       1
+
+#define PLOT_BORDER         12
+#define XLEFT_OFFSET        40
+#define XLEFT_TEXT_OFFSET   6
+#define YBOTTOM_OFFSET      20
+#define YBOTTOM_TEXT_OFFSET 15
+#define GRID_INCREMENT      50
+
+#define BLACK_COLOR         wxColor(0x00, 0x00, 0x00)
+#define GREY_COLOR          wxColor(0x80, 0x80, 0x80)
+#define DARK_GREY_COLOR     wxColor(0x40, 0x40, 0x40)
+#define MEDIUM_GREY_COLOR   wxColor(0xC0, 0xC0, 0xC0)
+#define LIGHT_GREY_COLOR    wxColor(0xE0, 0xE0, 0xE0)
+#define VERY_LTGREY_COLOR   wxColor(0xF8, 0xF8, 0xF8)
+#define WHITE_COLOR         wxColor(0xFF, 0xFF, 0xFF)
+
+#define DARK_BLUE_COLOR     wxColor(0x00, 0x00, 0x60)
+#define BLUE_COLOR          wxColor(0x00, 0x00, 0xFF)
+#define LIGHT_BLUE_COLOR    wxColor(0x80, 0x80, 0xFF)
+
+#define RED_COLOR           wxColor(0xFF, 0x5E, 0x5E)
+#define LIGHT_RED_COLOR     wxColor(0xFF, 0xE0, 0xE0)
+#define DARK_RED_COLOR      wxColor(0xFF, 0x00, 0x00)
+#define PINK_COLOR          wxColor(0xFF, 0x80, 0xFF)
+
+#define LIGHT_GREEN_COLOR   wxColor(0xE3, 0xFF, 0xE0)
+#define GREEN_COLOR         wxColor(0x95, 0xFF, 0x8A)
+#define DARK_GREEN_COLOR    wxColor(0x20, 0xFF, 0x08)
+#define VERY_GREEN_COLOR    wxColor(0x00, 0xFF, 0x00)
+
+#define YELLOW_COLOR        wxColor(0xFF, 0xFF, 0x5E)
+#define LIGHT_YELLOW_COLOR  wxColor(0xFF, 0xFF, 0xB5)
+#define DARK_YELLOW_COLOR   wxColor(0xFF, 0xFF, 0x08)
+
+class MainFrame;
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class PlotPanel
+//
+// @class $(Name)
+// @author $(User)
+// @date $(Date)
+// @file $(CurrentFileName).$(CurrentFileExt)
+// @brief
+//
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class PlotPanel : public wxPanel
+{
+    public:
+        PlotPanel(wxFrame* parent);
+        ~PlotPanel();
+        wxPen               m_penShortDash;
+        wxPen               m_penDotDash;
+        wxPen               m_penSolid;
+        wxRect              m_rCtrlPrev;
+        wxRect              m_rCtrl;
+        wxRect              m_rGrid;
+        wxRect              m_rPlot;
+        MainFrame           *m_pTopFrame;
+        wxAuiNotebook       *m_pNoteBook;
+        double              m_label_size;
+        wxSize              m_Bufsz;
+        bool                m_newdata;
+        wxImage             m_oImage;
+        wxBitmap            *m_pBmp;
+        wxNativePixelData   *m_pPix;
+
+        // some useful events
+        void            OnMouseMove(wxMouseEvent& event);
+        virtual void    OnMouseLeftDown(wxMouseEvent& event);
+        void            OnMouseLeftUp(wxMouseEvent& event);
+        virtual void    OnMouseRightDown(wxMouseEvent& event);
+        void            OnMouseWheelMoved(wxMouseEvent& event);
+        void            OnClose(wxCloseEvent& event ){ event.Skip(); }
+        void            OnSize( wxSizeEvent& event );
+        void            OnErase(wxEraseEvent& event);
+        void            OnPaint(wxPaintEvent& event);
+        //void OnUpdateUI( wxUpdateUIEvent& event ){ event.Skip(); }
+
+        void            paintEvent(wxPaintEvent & evt);
+        virtual void    draw(wxAutoBufferedPaintDC&  pdc);
+        virtual void    drawGraticule(wxAutoBufferedPaintDC&  pdc);
+        virtual double  SetZoomFactor(double zf);
+        virtual double  GetZoomFactor(double zf);
+        virtual void    OnShow(wxShowEvent& event);
+        virtual double  GetLabelSize();
+        virtual void    SetLabelSize(double size);
+
+    protected:
+        int             m_x;
+        int             m_y;
+        int             m_left;
+        int             m_top;
+        int             m_prev_w;
+        int             m_prev_h;
+        int             m_prev_x;
+        int             m_prev_y;
+        bool            m_use_bitmap;
+        bool            m_clip;
+        bool            m_rubberBand;
+        bool            m_mouseDown;
+        bool            m_firstPass;
+        double          m_zoomFactor;
+        int             m_greyscale;
+        int             m_line_color;
+    DECLARE_EVENT_TABLE()
+};
+#endif //__FDMDV2_PLOT__
diff --git a/freedv/branches/0.99/src/fdmdv2_plot_scalar.cpp b/freedv/branches/0.99/src/fdmdv2_plot_scalar.cpp
new file mode 100644 (file)
index 0000000..7a07f46
--- /dev/null
@@ -0,0 +1,281 @@
+//==========================================================================
+// Name:            fdmdv2_plot_scalar.cpp
+// Purpose:         Plots scalar amplitude against time
+// Created:         June 22, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#include <string.h>
+#include "wx/wx.h"
+#include "fdmdv2_main.h"
+#include "fdmdv2_plot_scalar.h"
+
+BEGIN_EVENT_TABLE(PlotScalar, PlotPanel)
+    EVT_PAINT           (PlotScalar::OnPaint)
+    EVT_MOTION          (PlotScalar::OnMouseMove)
+    EVT_MOUSEWHEEL      (PlotScalar::OnMouseWheelMoved)
+    EVT_SIZE            (PlotScalar::OnSize)
+    EVT_SHOW            (PlotScalar::OnShow)
+//    EVT_ERASE_BACKGROUND(PlotScalar::OnErase)
+END_EVENT_TABLE()
+
+//----------------------------------------------------------------
+// PlotScalar()
+//----------------------------------------------------------------
+PlotScalar::PlotScalar(wxFrame* parent, 
+                       int    channels,           // number on channels to plot
+                      float  t_secs,             // time covered by entire x axis in seconds
+                      float  sample_period_secs, // time between each sample in seconds
+                      float  a_min,              // min ampltude of samples being plotted
+                      float  a_max,              // max ampltude of samples being plotted
+                      float  graticule_t_step,   // time step of x (time) axis graticule in seconds
+                      float  graticule_a_step,   // step of amplitude axis graticule
+                      const char a_fmt[],        // printf format string for amplitude axis labels
+                       int    mini                // true for mini-plot - don't draw graticule
+                      ): PlotPanel(parent)
+{
+    int i;
+
+    m_rCtrl = GetClientRect();
+
+    m_channels = channels;
+    m_t_secs = t_secs;
+    m_sample_period_secs = sample_period_secs;
+    m_a_min = a_min;
+    m_a_max = a_max;
+    m_graticule_t_step = graticule_t_step;
+    m_graticule_a_step = graticule_a_step;
+    assert(strlen(a_fmt) < 15);
+    strcpy(m_a_fmt, a_fmt);
+    m_mini = mini;
+
+    // work out number of samples we will store and allocate storage
+
+    m_samples = m_t_secs/m_sample_period_secs;
+    m_mem = new float[m_samples*m_channels];
+
+    for(i = 0; i < m_samples*m_channels; i++)
+    {
+        m_mem[i] = 0.0;
+    }
+}
+
+//----------------------------------------------------------------
+// ~PlotScalar()
+//----------------------------------------------------------------
+PlotScalar::~PlotScalar()
+{
+    delete m_mem;
+}
+
+//----------------------------------------------------------------
+// add_new_sample()
+//----------------------------------------------------------------
+void PlotScalar::add_new_sample(int channel, float sample)
+{
+    int i;
+    int offset = channel*m_samples;
+
+    assert(channel < m_channels);
+
+    for(i = 0; i < m_samples-1; i++)
+    {
+        m_mem[offset+i] = m_mem[offset+i+1];
+    }
+    m_mem[offset+m_samples-1] = sample;
+}
+
+//----------------------------------------------------------------
+// add_new_samples()
+//----------------------------------------------------------------
+void  PlotScalar::add_new_short_samples(int channel, short samples[], int length, float scale_factor)
+{
+    int i;
+    int offset = channel*m_samples;
+
+    assert(channel < m_channels);
+
+    for(i = 0; i < m_samples-length; i++)
+        m_mem[offset+i] = m_mem[offset+i+length];
+    for(; i < m_samples; i++)
+       m_mem[offset+i] = (float)*samples++/scale_factor;
+}
+
+//----------------------------------------------------------------
+// draw()
+//----------------------------------------------------------------
+void PlotScalar::draw(wxAutoBufferedPaintDC&  dc)
+{
+    float index_to_px;
+    float a_to_py;
+    int   i;
+    int   x, y;
+    int   prev_x, prev_y;
+    float a;
+
+    m_rCtrl = GetClientRect();
+    m_rGrid = m_rCtrl;
+    if (!m_mini)
+        m_rGrid = m_rGrid.Deflate(PLOT_BORDER + (XLEFT_OFFSET/2), (PLOT_BORDER + (YBOTTOM_OFFSET/2)));
+
+    //printf("h %d w %d\n", m_rCtrl.GetWidth(), m_rCtrl.GetHeight());
+    //printf("h %d w %d\n", m_rGrid.GetWidth(), m_rGrid.GetHeight());
+
+    // black background
+
+    dc.Clear();
+    if (m_mini)
+        m_rPlot = wxRect(0, 0, m_rGrid.GetWidth(), m_rGrid.GetHeight());        
+    else
+        m_rPlot = wxRect(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER, m_rGrid.GetWidth(), m_rGrid.GetHeight());
+   
+    wxBrush ltGraphBkgBrush = wxBrush(BLACK_COLOR);
+    dc.SetBrush(ltGraphBkgBrush);
+    dc.SetPen(wxPen(BLACK_COLOR, 0));
+    dc.DrawRectangle(m_rPlot);
+
+    index_to_px = (float)m_rGrid.GetWidth()/m_samples;
+    a_to_py = (float)m_rGrid.GetHeight()/(m_a_max - m_a_min);
+
+    wxPen pen;
+    pen.SetColour(DARK_GREEN_COLOR);
+    pen.SetWidth(1);
+    dc.SetPen(pen);
+
+    // draw all samples
+
+    prev_x = prev_y = 0; // stop warning
+
+    // plot each channel 
+
+    int offset;
+    for(offset=0; offset<m_channels*m_samples; offset+=m_samples) {
+
+        for(i = 0; i < m_samples; i++) {
+            x = index_to_px * i;
+            a = m_mem[offset+i];
+            if (a < m_a_min) a = m_a_min;
+            if (a > m_a_max) a = m_a_max;
+
+            // invert y axis and offset by minimum
+
+            y = m_rGrid.GetHeight() - a_to_py * a + m_a_min*a_to_py;
+
+            // put inside plot window
+
+            if (!m_mini) {
+                x += PLOT_BORDER + XLEFT_OFFSET;
+                y += PLOT_BORDER;
+            }
+
+            if (i)
+                dc.DrawLine(x, y, prev_x, prev_y);
+            prev_x = x; prev_y = y;
+        }
+    }
+
+    drawGraticule(dc);
+}
+
+//-------------------------------------------------------------------------
+// drawGraticule()
+//-------------------------------------------------------------------------
+void PlotScalar::drawGraticule(wxAutoBufferedPaintDC&  dc)
+{
+    float    t, a;
+    int      x, y, text_w, text_h;
+    char     buf[15];
+    wxString s;
+    float    sec_to_px;
+    float    a_to_py;
+
+    wxBrush ltGraphBkgBrush;
+    ltGraphBkgBrush.SetStyle(wxBRUSHSTYLE_TRANSPARENT);
+    ltGraphBkgBrush.SetColour(*wxBLACK);
+    dc.SetBrush(ltGraphBkgBrush);
+    dc.SetPen(wxPen(BLACK_COLOR, 1));
+
+    sec_to_px = (float)m_rGrid.GetWidth()/m_t_secs;
+    a_to_py = (float)m_rGrid.GetHeight()/(m_a_max - m_a_min);
+
+    // upper LH coords of plot area are (PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER)
+    // lower RH coords of plot area are (PLOT_BORDER + XLEFT_OFFSET + m_rGrid.GetWidth(), 
+    //                                   PLOT_BORDER + m_rGrid.GetHeight())
+
+    // Vertical gridlines
+
+    dc.SetPen(m_penShortDash);
+    for(t=0; t<=m_t_secs; t+=m_graticule_t_step) {
+       x = t*sec_to_px;
+       if (m_mini) {
+            dc.DrawLine(x, m_rGrid.GetHeight(), x, 0);
+        }
+        else {
+            x += PLOT_BORDER + XLEFT_OFFSET;
+            dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, PLOT_BORDER);
+        }
+        if (!m_mini) {
+            sprintf(buf, "%2.1fs", t);
+            GetTextExtent(buf, &text_w, &text_h);
+            dc.DrawText(buf, x - text_w/2, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET);
+        }
+    }
+
+    // Horizontal gridlines
+
+    dc.SetPen(m_penDotDash);
+    for(a=m_a_min; a<m_a_max; a+=m_graticule_a_step) {
+       y = m_rGrid.GetHeight() - a*a_to_py + m_a_min*a_to_py;
+       if (m_mini) {
+            dc.DrawLine(0, y, m_rGrid.GetWidth(), y);
+        }
+        else {
+            y += PLOT_BORDER;
+            dc.DrawLine(PLOT_BORDER + XLEFT_OFFSET, y, 
+                        (m_rGrid.GetWidth() + PLOT_BORDER + XLEFT_OFFSET), y);
+        }
+        if (!m_mini) {
+            sprintf(buf, m_a_fmt, a);
+            GetTextExtent(buf, &text_w, &text_h);
+            dc.DrawText(buf, PLOT_BORDER + XLEFT_OFFSET - text_w - XLEFT_TEXT_OFFSET, y-text_h/2);
+        }
+   }
+
+
+}
+
+//----------------------------------------------------------------
+// OnPaint()
+//----------------------------------------------------------------
+void PlotScalar::OnPaint(wxPaintEvent& event)
+{
+    wxAutoBufferedPaintDC dc(this);
+    draw(dc);
+}
+
+//----------------------------------------------------------------
+// OnSize()
+//----------------------------------------------------------------
+void PlotScalar::OnSize(wxSizeEvent& event)
+{
+}
+
+//----------------------------------------------------------------
+// OnShow()
+//----------------------------------------------------------------
+void PlotScalar::OnShow(wxShowEvent& event)
+{
+}
diff --git a/freedv/branches/0.99/src/fdmdv2_plot_scalar.h b/freedv/branches/0.99/src/fdmdv2_plot_scalar.h
new file mode 100644 (file)
index 0000000..7043987
--- /dev/null
@@ -0,0 +1,73 @@
+//==========================================================================
+// Name:            fdmdv2_plot_scalar.h
+// Purpose:         Defines a scalar plot derivative of fdmdv2_plot.
+// Created:         June 22, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#ifndef __FDMDV2_PLOT_SCALAR__
+#define __FDMDV2_PLOT_SCALAR__
+
+#include "fdmdv2_plot.h"
+#include "fdmdv2_defines.h"
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class PlotScalar
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class PlotScalar: public PlotPanel
+{
+    public:
+
+    PlotScalar(wxFrame* parent,
+               int   channels,
+              float t_secs, 
+              float sample_period_secs,
+              float a_min,
+              float a_max,
+              float graticule_t_step,   
+              float graticule_a_step,
+              const char  a_fmt[],
+               int   mini
+              );
+        ~PlotScalar();
+         void add_new_sample(int channel, float sample);
+         void add_new_short_samples(int channel, short samples[], int length, float scale_factor);
+
+    protected:
+
+         int      m_channels;
+        float    m_t_secs;
+        float    m_sample_period_secs;
+        float    m_a_min;
+        float    m_a_max;
+        float    m_graticule_t_step;   
+        float    m_graticule_a_step;
+        char     m_a_fmt[15];
+         int      m_mini;
+        int      m_samples;
+        float   *m_mem;              
+
+        void draw(wxAutoBufferedPaintDC&  dc);
+       void drawGraticule(wxAutoBufferedPaintDC&  dc);
+        void OnPaint(wxPaintEvent& event);
+        void OnSize(wxSizeEvent& event);
+        void OnShow(wxShowEvent& event);
+
+        DECLARE_EVENT_TABLE()
+};
+
+#endif // __FDMDV2_PLOT_SCALAR__
+
diff --git a/freedv/branches/0.99/src/fdmdv2_plot_scatter.cpp b/freedv/branches/0.99/src/fdmdv2_plot_scatter.cpp
new file mode 100644 (file)
index 0000000..3c0b155
--- /dev/null
@@ -0,0 +1,199 @@
+//==========================================================================
+// Name:            fdmdv2_plot_scatter.cpp
+// Purpose:         A scatter plot derivative of fdmdv2_plot.
+// Created:         June 24, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#include <string.h>
+#include "wx/wx.h"
+#include "fdmdv2_plot_scatter.h"
+
+BEGIN_EVENT_TABLE(PlotScatter, PlotPanel)
+    EVT_PAINT           (PlotScatter::OnPaint)
+    EVT_MOTION          (PlotScatter::OnMouseMove)
+    EVT_MOUSEWHEEL      (PlotScatter::OnMouseWheelMoved)
+    EVT_SIZE            (PlotScatter::OnSize)
+    EVT_SHOW            (PlotScatter::OnShow)
+//    EVT_ERASE_BACKGROUND(PlotScatter::OnErase)
+END_EVENT_TABLE()
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// PlotScatter
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+PlotScatter::PlotScatter(wxFrame* parent) : PlotPanel(parent)
+{
+    int i;
+
+    for(i=0; i < SCATTER_MEM_SYMS_MAX; i++)
+    {
+        m_mem[i].real = 0.0;
+        m_mem[i].imag = 0.0;
+    }
+
+    m_filter_max_xy = 0.1;
+
+    // defaults so we start off with something sensible
+
+    Nsym = 14+1;
+    scatterMemSyms = ((int)(SCATTER_MEM_SECS*(Nsym/DT)));
+    assert(scatterMemSyms <= SCATTER_MEM_SYMS_MAX);
+        
+}
+
+// changing number of carriers changes number of symbols to plot
+void PlotScatter::setNc(int Nc) {
+    Nsym = Nc+1;
+    assert(Nsym <= (FDMDV_NC_MAX+1));
+    scatterMemSyms = ((int)(SCATTER_MEM_SECS*(Nsym/DT)));
+    assert(scatterMemSyms <= SCATTER_MEM_SYMS_MAX);
+}
+
+//----------------------------------------------------------------
+// draw()
+//----------------------------------------------------------------
+void PlotScatter::draw(wxAutoBufferedPaintDC& dc)
+{
+    float x_scale;
+    float y_scale;
+    int   i;
+    int   x;
+    int   y;
+    wxColour sym_to_colour[] = {wxColor(0,0,255), 
+                                wxColor(0,255,0),
+                                wxColor(0,255,255),
+                                wxColor(255,0,0),
+                                wxColor(255,0,255), 
+                                wxColor(255,255,0),
+                                wxColor(255,255,255),
+                                wxColor(0,0,255), 
+                                wxColor(0,255,0),
+                                wxColor(0,255,255),
+                                wxColor(255,0,0),
+                                wxColor(255,0,255), 
+                                wxColor(255,255,0),
+                                wxColor(255,255,255),
+                                wxColor(0,0,255), 
+                                wxColor(0,255,0),
+                                wxColor(0,255,255),
+                                wxColor(255,0,0),
+                                wxColor(255,0,255)
+    };
+
+    m_rCtrl = GetClientRect();
+    m_rGrid = m_rCtrl;
+    m_rGrid = m_rGrid.Deflate(PLOT_BORDER + (XLEFT_OFFSET/2), (PLOT_BORDER + (YBOTTOM_OFFSET/2)));
+
+    // black background
+
+    dc.Clear();
+    m_rPlot = wxRect(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER, m_rGrid.GetWidth(), m_rGrid.GetHeight());
+    wxBrush ltGraphBkgBrush = wxBrush(BLACK_COLOR);
+    dc.SetBrush(ltGraphBkgBrush);
+    dc.SetPen(wxPen(BLACK_COLOR, 0));
+    dc.DrawRectangle(m_rPlot);
+    wxPen pen;
+    pen.SetWidth(1); // note this is ignored by DrawPoint
+
+    // automatically scale, first measure the maximum value
+
+    float max_xy = 1E-12;
+    float real,imag;
+    for(i=0; i< scatterMemSyms; i++) {
+        real = fabs(m_mem[i].real);
+        imag = fabs(m_mem[i].imag);
+        if (real > max_xy)
+            max_xy = real;
+        if (imag > max_xy)
+            max_xy = imag;
+    }
+
+    // smooth it out and set a lower limit to prevent didev by 0 issues
+
+    m_filter_max_xy = BETA*m_filter_max_xy + (1 - BETA)*2.5*max_xy;
+    if (m_filter_max_xy < 0.001)
+        m_filter_max_xy = 0.001;
+
+    // quantise to log steps to prevent scatter scaling bobbing about too
+    // much as scaling varies
+
+    float quant_m_filter_max_xy = exp(floor(0.5+log(m_filter_max_xy)));
+    //printf("max_xy: %f m_filter_max_xy: %f quant_m_filter_max_xy: %f\n", max_xy, m_filter_max_xy, quant_m_filter_max_xy);
+
+    x_scale = (float)m_rGrid.GetWidth()/quant_m_filter_max_xy;
+    y_scale = (float)m_rGrid.GetHeight()/quant_m_filter_max_xy;
+
+    // draw all samples
+
+    for(i = 0; i < scatterMemSyms; i++)
+    {
+        x = x_scale * m_mem[i].real + m_rGrid.GetWidth()/2;
+        y = y_scale * m_mem[i].imag + m_rGrid.GetHeight()/2;
+       x += PLOT_BORDER + XLEFT_OFFSET;
+       y += PLOT_BORDER;
+        pen.SetColour(sym_to_colour[i%Nsym]);
+        dc.SetPen(pen);
+       dc.DrawPoint(x, y);
+    }
+}
+
+//----------------------------------------------------------------
+// add_new_samples()
+//----------------------------------------------------------------
+void PlotScatter::add_new_samples(COMP samples[])
+{
+    int i,j;
+
+    // shift memory
+
+    for(i = 0; i < scatterMemSyms - Nsym; i++)
+    {
+        m_mem[i] = m_mem[i+Nsym];
+    }
+
+    // new samples
+
+    for(j=0; i < scatterMemSyms; i++,j++)
+    {
+        m_mem[i] = samples[j];
+    }
+}
+
+//----------------------------------------------------------------
+// OnPaint()
+//----------------------------------------------------------------
+void PlotScatter::OnPaint(wxPaintEvent& event)
+{
+    wxAutoBufferedPaintDC dc(this);
+    draw(dc);
+}
+
+//----------------------------------------------------------------
+// OnSize()
+//----------------------------------------------------------------
+void PlotScatter::OnSize(wxSizeEvent& event)
+{
+    // todo: clear screen
+}
+
+//----------------------------------------------------------------
+// OnShow()
+//----------------------------------------------------------------
+void PlotScatter::OnShow(wxShowEvent& event)
+{
+}
+
diff --git a/freedv/branches/0.99/src/fdmdv2_plot_scatter.h b/freedv/branches/0.99/src/fdmdv2_plot_scatter.h
new file mode 100644 (file)
index 0000000..702f633
--- /dev/null
@@ -0,0 +1,56 @@
+//==========================================================================
+// Name:            fdmdv2_plot_scatter.h
+// Purpose:         A scatter plot derivative of fdmdv2_plot.
+// Created:         June 24, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#ifndef __FDMDV2_PLOT_SCATTER__
+#define __FDMDV2_PLOT_SCATTER__
+
+#include "comp.h"
+#include "fdmdv2_plot.h"
+#include "fdmdv2_defines.h"
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class PlotScatter
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class PlotScatter : public PlotPanel
+{
+    public:
+        PlotScatter(wxFrame* parent);
+        ~PlotScatter(){};
+       void add_new_samples(COMP samples[]);
+       void setNc(int Nc);
+
+    protected:
+        COMP m_mem[SCATTER_MEM_SYMS_MAX];
+        COMP m_new_samples[FDMDV_NC_MAX+1];
+
+        void draw(wxAutoBufferedPaintDC&  dc);
+        void OnPaint(wxPaintEvent& event);
+        void OnSize(wxSizeEvent& event);
+        void OnShow(wxShowEvent& event);
+
+        DECLARE_EVENT_TABLE()
+
+    private:
+        int   Nsym;
+        int   scatterMemSyms;
+        float m_filter_max_xy;
+};
+
+#endif //__FDMDV2_PLOT_SCATTER__
diff --git a/freedv/branches/0.99/src/fdmdv2_plot_spectrum.cpp b/freedv/branches/0.99/src/fdmdv2_plot_spectrum.cpp
new file mode 100644 (file)
index 0000000..d9c72d0
--- /dev/null
@@ -0,0 +1,266 @@
+//==========================================================================
+// Name:            fdmdv2_plot_waterfall.cpp
+// Purpose:         Implements a waterfall plot derivative of fdmdv2_plot.
+// Created:         June 23, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#include <string.h>
+#include "wx/wx.h"
+
+#include "fdmdv2_main.h"
+
+extern float g_avmag[];                 // average mag data passed to draw() 
+void fdmdv2_clickTune(float frequency); // callback to pass new click freq
+
+BEGIN_EVENT_TABLE(PlotSpectrum, PlotPanel)
+    EVT_MOTION          (PlotSpectrum::OnMouseMove)
+    EVT_LEFT_DOWN       (PlotSpectrum::OnMouseLeftDown)
+    EVT_LEFT_UP         (PlotSpectrum::OnMouseLeftUp)
+    EVT_MOUSEWHEEL      (PlotSpectrum::OnMouseWheelMoved)
+    EVT_PAINT           (PlotSpectrum::OnPaint)
+    EVT_SHOW            (PlotSpectrum::OnShow)
+END_EVENT_TABLE()
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class PlotSpectrum
+//
+// @class $(Name)
+// @author $(User)
+// @date $(Date)
+// @file $(CurrentFileName).$(CurrentFileExt)
+// @brief
+//
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+PlotSpectrum::PlotSpectrum(wxFrame* parent, float *magdB, int n_magdB, 
+                           float min_mag_db, float max_mag_db, bool clickTune): PlotPanel(parent)
+{
+    m_greyscale     = 0;
+    m_Bufsz         = GetMaxClientSize();
+    m_newdata       = false;
+    m_firstPass     = true;
+    m_line_color    = 0;
+    SetLabelSize(10.0);
+
+    m_magdB         = magdB;
+    m_n_magdB       = n_magdB;     // number of points in magdB that covers 0 ... MAX_F_HZ of spectrum
+    m_max_mag_db    = max_mag_db;
+    m_min_mag_db    = min_mag_db;
+    m_rxFreq        = 0.0;
+    m_clickTune     = clickTune;
+}
+
+//----------------------------------------------------------------
+// ~PlotSpectrum()
+//----------------------------------------------------------------
+PlotSpectrum::~PlotSpectrum()
+{
+}
+
+//----------------------------------------------------------------
+// OnSize()
+//----------------------------------------------------------------
+void PlotSpectrum::OnSize(wxSizeEvent& event) {
+}
+
+//----------------------------------------------------------------
+// OnPaint()
+//----------------------------------------------------------------
+void PlotSpectrum::OnPaint(wxPaintEvent& event)
+{
+    wxAutoBufferedPaintDC dc(this);
+    draw(dc);
+}
+
+//----------------------------------------------------------------
+// OnShow()
+//----------------------------------------------------------------
+void PlotSpectrum::OnShow(wxShowEvent& event)
+{
+}
+
+//----------------------------------------------------------------
+// draw()
+//----------------------------------------------------------------
+void PlotSpectrum::draw(wxAutoBufferedPaintDC& dc)
+{
+    m_rCtrl  = GetClientRect();
+
+    // m_rGrid is coords of inner window we actually plot to.  We deflate it a bit
+    // to leave room for axis labels.  We need to work this out every time we draw
+    // as OnSize() may not be called before OnPaint(), for example when a new tab
+    // is selected
+
+    m_rGrid  = m_rCtrl;
+    m_rGrid = m_rGrid.Deflate(PLOT_BORDER + (XLEFT_OFFSET/2), (PLOT_BORDER + (YBOTTOM_OFFSET/2)));
+
+    dc.Clear();
+
+    // black background
+
+    m_rPlot = wxRect(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER, m_rGrid.GetWidth(), m_rGrid.GetHeight());
+    wxBrush ltGraphBkgBrush = wxBrush(BLACK_COLOR);
+    dc.SetBrush(ltGraphBkgBrush);
+    dc.SetPen(wxPen(BLACK_COLOR, 0));
+    dc.DrawRectangle(m_rPlot);
+
+    // draw spectrum
+
+    int   x, y, prev_x, prev_y, index;
+    float index_to_px, mag_dB_to_py, mag;
+
+    m_newdata = false;
+
+    wxPen pen;
+    pen.SetColour(DARK_GREEN_COLOR);
+    pen.SetWidth(1);
+    dc.SetPen(pen);
+
+    index_to_px = (float)m_rGrid.GetWidth()/m_n_magdB;
+    mag_dB_to_py = (float)m_rGrid.GetHeight()/(m_max_mag_db - m_min_mag_db);
+
+    prev_x = PLOT_BORDER + XLEFT_OFFSET;
+    prev_y = PLOT_BORDER;
+    for(index = 0; index < m_n_magdB; index++)
+    {
+        x = index*index_to_px;
+        mag = m_magdB[index];
+        if (mag > m_max_mag_db) mag = m_max_mag_db;
+        if (mag < m_min_mag_db) mag = m_min_mag_db;
+        y = -(mag - m_max_mag_db) * mag_dB_to_py;
+
+        x += PLOT_BORDER + XLEFT_OFFSET;
+        y += PLOT_BORDER;
+
+        if (index)
+            dc.DrawLine(x, y, prev_x, prev_y);
+        prev_x = x; prev_y = y;
+    }
+
+    // and finally draw Graticule
+
+    drawGraticule(dc);
+
+}
+
+//-------------------------------------------------------------------------
+// drawGraticule()
+//-------------------------------------------------------------------------
+void PlotSpectrum::drawGraticule(wxAutoBufferedPaintDC&  dc)
+{
+    int      x, y, text_w, text_h;
+    char     buf[15];
+    wxString s;
+    float    f, mag, freq_hz_to_px, mag_dB_to_py;
+
+    wxBrush ltGraphBkgBrush;
+    ltGraphBkgBrush.SetStyle(wxBRUSHSTYLE_TRANSPARENT);
+    ltGraphBkgBrush.SetColour(*wxBLACK);
+    dc.SetBrush(ltGraphBkgBrush);
+    dc.SetPen(wxPen(BLACK_COLOR, 1));
+
+    freq_hz_to_px = (float)m_rGrid.GetWidth()/(MAX_F_HZ-MIN_F_HZ);
+    mag_dB_to_py = (float)m_rGrid.GetHeight()/(m_max_mag_db - m_min_mag_db);
+
+    // upper LH coords of plot area are (PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER)
+    // lower RH coords of plot area are (PLOT_BORDER + XLEFT_OFFSET + m_rGrid.GetWidth(), 
+    //                                   PLOT_BORDER + m_rGrid.GetHeight())
+
+    // Check if small screen size means text will overlap
+
+    int textXStep = STEP_F_HZ*freq_hz_to_px;
+    int textYStep = STEP_MAG_DB*mag_dB_to_py;
+    sprintf(buf, "%4.0fHz", (float)MAX_F_HZ - STEP_F_HZ);
+    GetTextExtent(buf, &text_w, &text_h);
+    int overlappedText = (text_w > textXStep) || (text_h > textYStep);
+    //printf("text_w: %d textXStep: %d text_h: %d textYStep: %d  overlappedText: %d\n", text_w, textXStep, 
+    //      text_h, textYStep, overlappedText);
+
+    // Vertical gridlines
+
+    for(f=STEP_F_HZ; f<MAX_F_HZ; f+=STEP_F_HZ) {
+       x = f*freq_hz_to_px;
+       x += PLOT_BORDER + XLEFT_OFFSET;
+
+        dc.SetPen(m_penShortDash);
+        dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, PLOT_BORDER);
+        dc.SetPen(wxPen(BLACK_COLOR, 1));
+        dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET);
+
+        sprintf(buf, "%4.0fHz", f);
+       GetTextExtent(buf, &text_w, &text_h);
+        if (!overlappedText)
+            dc.DrawText(buf, x - text_w/2, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET);
+    }
+
+    dc.SetPen(wxPen(BLACK_COLOR, 1));
+    for(f=STEP_MINOR_F_HZ; f<MAX_F_HZ; f+=STEP_MINOR_F_HZ) 
+    {
+        x = f*freq_hz_to_px;
+        x += PLOT_BORDER + XLEFT_OFFSET;
+        dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET-5);
+    }
+    
+    // Horizontal gridlines
+
+    dc.SetPen(m_penDotDash);
+    for(mag=m_min_mag_db; mag<=m_max_mag_db; mag+=STEP_MAG_DB) {
+       y = -(mag - m_max_mag_db) * mag_dB_to_py;
+       y += PLOT_BORDER;
+       dc.DrawLine(PLOT_BORDER + XLEFT_OFFSET, y, 
+                   (m_rGrid.GetWidth() + PLOT_BORDER + XLEFT_OFFSET), y);
+        sprintf(buf, "%3.0fdB", mag);
+       GetTextExtent(buf, &text_w, &text_h);
+        if (!overlappedText)
+            dc.DrawText(buf, PLOT_BORDER + XLEFT_OFFSET - text_w - XLEFT_TEXT_OFFSET, y-text_h/2);
+    }
+
+    // red rx tuning line
+    
+    if (m_rxFreq != 0.0) {
+        dc.SetPen(wxPen(RED_COLOR, 2));
+        x = m_rxFreq*freq_hz_to_px;
+        x += PLOT_BORDER + XLEFT_OFFSET;
+        //printf("m_rxFreq %f x %d\n", m_rxFreq, x);
+        dc.DrawLine(x, m_rGrid.GetHeight()+ PLOT_BORDER, x, m_rCtrl.GetHeight());
+    }
+
+}
+
+//-------------------------------------------------------------------------
+// OnMouseDown()
+//-------------------------------------------------------------------------
+void PlotSpectrum::OnMouseLeftDown(wxMouseEvent& event)
+{
+    m_mouseDown = true;
+    wxClientDC dc(this);
+
+    wxPoint pt(event.GetLogicalPosition(dc));
+
+    // map x coord to edges of actual plot
+    pt.x -= PLOT_BORDER + XLEFT_OFFSET;
+    pt.y -= PLOT_BORDER;
+
+    // valid click if inside of plot
+    if ((pt.x >= 0) && (pt.x <= m_rGrid.GetWidth()) && (pt.y >=0) && m_clickTune) {
+        float freq_hz_to_px = (float)m_rGrid.GetWidth()/(MAX_F_HZ-MIN_F_HZ);
+        float clickFreq = (float)pt.x/freq_hz_to_px;
+
+        // see PlotWaterfall::OnMouseDown()
+
+        fdmdv2_clickTune(clickFreq);
+    }
+}
diff --git a/freedv/branches/0.99/src/fdmdv2_plot_spectrum.h b/freedv/branches/0.99/src/fdmdv2_plot_spectrum.h
new file mode 100644 (file)
index 0000000..353f312
--- /dev/null
@@ -0,0 +1,58 @@
+//==========================================================================
+// Name:            fdmdv2_plot_spectrum.h
+// Purpose:         Defines a spectrum plot derived from fdmdv2_plot class.
+// Created:         June 22, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#ifndef __FDMDV2_PLOT_SPECTRUM__
+#define __FDMDV2_PLOT_SPECTRUM__
+
+#include "fdmdv2_plot.h"
+#include "fdmdv2_defines.h"
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class Waterfall
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class PlotSpectrum : public PlotPanel
+{
+    public:
+    PlotSpectrum(wxFrame* parent, float *magdB, int n_magdB, 
+                 float min_mag_db=MIN_MAG_DB, float max_mag_db=MAX_MAG_DB, bool clickTune=true);
+        ~PlotSpectrum();
+        void setRxFreq(float rxFreq) { m_rxFreq = rxFreq; }
+        void setFreqScale(int n_magdB) { m_n_magdB = n_magdB; }
+
+    protected:
+        void        OnPaint(wxPaintEvent& event);
+        void        OnSize(wxSizeEvent& event);
+        void        OnShow(wxShowEvent& event);
+        void        drawGraticule(wxAutoBufferedPaintDC& dc);
+        void        draw(wxAutoBufferedPaintDC& dc);
+        void        OnMouseLeftDown(wxMouseEvent& event);
+
+   private:
+        float       m_rxFreq;
+        float       m_max_mag_db;
+        float       m_min_mag_db;
+        float      *m_magdB;
+        int         m_n_magdB;  
+        bool        m_clickTune;
+
+        DECLARE_EVENT_TABLE()
+};
+
+#endif //__FDMDV2_PLOT_SPECTRUM__
diff --git a/freedv/branches/0.99/src/fdmdv2_plot_waterfall.cpp b/freedv/branches/0.99/src/fdmdv2_plot_waterfall.cpp
new file mode 100644 (file)
index 0000000..4a8b447
--- /dev/null
@@ -0,0 +1,483 @@
+//==========================================================================
+// Name:            fdmdv2_plot_waterfall.cpp
+// Purpose:         Implements a waterfall plot derivative of fdmdv2_plot.
+// Created:         June 22, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#include <string.h>
+#include "wx/wx.h"
+#include "fdmdv2_main.h"
+
+extern float g_avmag[];                 // av mag spec passed in to draw() 
+void fdmdv2_clickTune(float frequency); // callback to pass new click freq
+
+BEGIN_EVENT_TABLE(PlotWaterfall, PlotPanel)
+    EVT_PAINT           (PlotWaterfall::OnPaint)
+    EVT_MOTION          (PlotWaterfall::OnMouseMove)
+    EVT_LEFT_DOWN       (PlotWaterfall::OnMouseLeftDown)
+    EVT_RIGHT_DOWN      (PlotWaterfall::OnMouseRightDown)
+    EVT_LEFT_UP         (PlotWaterfall::OnMouseLeftUp)
+    EVT_MOUSEWHEEL      (PlotWaterfall::OnMouseWheelMoved)
+    EVT_SIZE            (PlotWaterfall::OnSize)
+    EVT_SHOW            (PlotWaterfall::OnShow)
+END_EVENT_TABLE()
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class WaterfallPlot
+//
+// @class   WaterfallPlot
+// @author  David Witten
+// @date    $(Date)
+// @file    $(CurrentFileName).$(CurrentFileExt)
+// @brief
+//
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+PlotWaterfall::PlotWaterfall(wxFrame* parent, bool graticule, int colour): PlotPanel(parent)
+{
+
+    for(int i = 0; i < 255; i++)
+    {
+        m_heatmap_lut[i] = heatmap((float)i, 0.0, 255.0);
+    }
+    m_graticule     = graticule;
+    m_colour        = colour;
+    m_Bufsz         = GetMaxClientSize();
+    m_newdata       = false;
+    m_firstPass     = true;
+    m_line_color    = 0;
+    m_modem_stats_max_f_hz = MODEM_STATS_MAX_F_HZ;
+
+    SetLabelSize(10.0);
+
+    m_pBmp = NULL;
+    m_max_mag = MAX_MAG_DB;
+    m_min_mag = MIN_MAG_DB;
+}
+
+// When the window size gets set we can work outthe size of the window
+// we plot in and allocate a bit map of the correct size
+void PlotWaterfall::OnSize(wxSizeEvent& event) 
+{
+    // resize bit map
+
+    delete m_pBmp;
+    
+    m_rCtrl  = GetClientRect();
+
+    // m_rGrid is coords of inner window we actually plot to.  We deflate it a bit
+    // to leave room for axis labels.
+
+    m_rGrid  = m_rCtrl;
+    m_rGrid = m_rGrid.Deflate(PLOT_BORDER + (XLEFT_OFFSET/2), (PLOT_BORDER + (YBOTTOM_OFFSET/2)));
+
+    // we want a bit map the size of m_rGrid
+
+    m_pBmp = new wxBitmap(m_rGrid.GetWidth(), m_rGrid.GetHeight(), 24);
+
+    m_dT = DT;
+}
+
+//----------------------------------------------------------------
+// paintEvent()
+//
+// @class $(Name)
+// @author $(User)
+// @date $(Date)
+// @file $(CurrentFileName).$(CurrentFileExt)
+// @brief
+//
+// Called by the system of by wxWidgets when the panel needs
+// to be redrawn. You can also trigger this call by calling
+// Refresh()/Update().
+//----------------------------------------------------------------
+void PlotWaterfall::OnPaint(wxPaintEvent & evt)
+{
+    wxAutoBufferedPaintDC dc(this);
+    draw(dc);
+}
+
+//----------------------------------------------------------------
+// OnShow()
+//----------------------------------------------------------------
+void PlotWaterfall::OnShow(wxShowEvent& event)
+{
+}
+
+//----------------------------------------------------------------
+// ~PlotWaterfall()
+//----------------------------------------------------------------
+PlotWaterfall::~PlotWaterfall()
+{
+}
+
+//----------------------------------------------------------------
+// heatmap()
+// map val to a rgb colour
+// from http://eddiema.ca/2011/01/21/c-sharp-heatmaps/
+//----------------------------------------------------------------
+unsigned PlotWaterfall::heatmap(float val, float min, float max)
+{
+    unsigned r = 0;
+    unsigned g = 0;
+    unsigned b = 0;
+
+    val = (val - min) / (max - min);
+    if(val <= 0.2)
+    {
+        b = (unsigned)((val / 0.2) * 255);
+    }
+    else if(val >  0.2 &&  val <= 0.7)
+    {
+        b = (unsigned)((1.0 - ((val - 0.2) / 0.5)) * 255);
+    }
+    if(val >= 0.2 &&  val <= 0.6)
+    {
+        g = (unsigned)(((val - 0.2) / 0.4) * 255);
+    }
+    else if(val >  0.6 &&  val <= 0.9)
+    {
+        g = (unsigned)((1.0 - ((val - 0.6) / 0.3)) * 255);
+    }
+    if(val >= 0.5)
+    {
+        r = (unsigned)(((val - 0.5) / 0.5) * 255);
+    }
+    //printf("%f %x %x %x\n", val, r, g, b);
+    return  (b << 16) + (g << 8) + r;
+}
+
+bool PlotWaterfall::checkDT(void)
+{
+    // Check dY is > 1 pixel before proceeding. For small screens
+    // and large WATERFALL_SECS_Y we might have less than one
+    // block per pixel.  In this case increase m_dT and perform draw
+    // less often
+
+    float px_per_sec = (float)m_rGrid.GetHeight() / WATERFALL_SECS_Y;
+    float dy = m_dT * px_per_sec;
+    
+    if (dy < 1.0) {
+        m_dT += DT;
+        return false;
+    }
+    else
+        return true;
+}
+
+//----------------------------------------------------------------
+// draw()
+//----------------------------------------------------------------
+void PlotWaterfall::draw(wxAutoBufferedPaintDC& dc)
+{
+
+    m_rCtrl  = GetClientRect();
+
+    // m_rGrid is coords of inner window we actually plot to.  We deflate it a bit
+    // to leave room for axis labels.
+
+    m_rGrid = m_rCtrl;
+    m_rGrid = m_rGrid.Deflate(PLOT_BORDER + (XLEFT_OFFSET/2), (PLOT_BORDER + (YBOTTOM_OFFSET/2)));
+
+    if (m_pBmp == NULL) 
+    {
+        // we want a bit map the size of m_rGrid
+        m_pBmp = new wxBitmap(m_rGrid.GetWidth(), m_rGrid.GetHeight(), 24);
+    }
+
+    dc.Clear();
+
+    if(m_newdata)
+    {
+        m_newdata = false;
+        plotPixelData();
+        dc.DrawBitmap(*m_pBmp, PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER);
+        m_dT = DT;
+    }
+    else 
+    {
+
+        // no data to plot so just erase to black.  Blue looks nicer
+        // but is same colour as low amplitude signal
+
+        // Bug on Linux: When Stop is pressed this code doesn't erase
+        // the lower 25% of the Waterfall Window
+
+        m_rPlot = wxRect(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER, m_rGrid.GetWidth(), m_rGrid.GetHeight());
+        wxBrush ltGraphBkgBrush = wxBrush(BLACK_COLOR);
+        dc.SetBrush(ltGraphBkgBrush);
+        dc.SetPen(wxPen(BLACK_COLOR, 0));
+        dc.DrawRectangle(m_rPlot);
+    }
+    drawGraticule(dc);
+}
+
+//-------------------------------------------------------------------------
+// drawGraticule()
+//-------------------------------------------------------------------------
+void PlotWaterfall::drawGraticule(wxAutoBufferedPaintDC& dc)
+{
+    int      x, y, text_w, text_h;
+    char     buf[15];
+    wxString s;
+    float    f, time, freq_hz_to_px, time_s_to_py;
+
+    wxBrush ltGraphBkgBrush;
+    ltGraphBkgBrush.SetStyle(wxBRUSHSTYLE_TRANSPARENT);
+    ltGraphBkgBrush.SetColour(*wxBLACK);
+    dc.SetBrush(ltGraphBkgBrush);
+    dc.SetPen(wxPen(BLACK_COLOR, 1));
+
+    freq_hz_to_px = (float)m_rGrid.GetWidth()/(MAX_F_HZ-MIN_F_HZ);
+    time_s_to_py = (float)m_rGrid.GetHeight()/WATERFALL_SECS_Y;
+
+    // upper LH coords of plot area are (PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER)
+    // lower RH coords of plot area are (PLOT_BORDER + XLEFT_OFFSET + m_rGrid.GetWidth(), 
+    //                                   PLOT_BORDER + m_rGrid.GetHeight())
+
+    // Check if small screen size means text will overlap
+
+    int textXStep = STEP_F_HZ*freq_hz_to_px;
+    int textYStep = WATERFALL_SECS_STEP*time_s_to_py;
+    sprintf(buf, "%4.0fHz", (float)MAX_F_HZ - STEP_F_HZ);
+    GetTextExtent(buf, &text_w, &text_h);
+    int overlappedText = (text_w > textXStep) || (text_h > textYStep);
+
+    // Major Vertical gridlines and legend
+    //dc.SetPen(m_penShortDash);
+    for(f=STEP_F_HZ; f<MAX_F_HZ; f+=STEP_F_HZ) 
+    {
+        x = f*freq_hz_to_px;
+        x += PLOT_BORDER + XLEFT_OFFSET;
+
+        if (m_graticule)
+            dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, PLOT_BORDER);
+        else
+            dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET);
+            
+        sprintf(buf, "%4.0fHz", f);
+        GetTextExtent(buf, &text_w, &text_h);
+        if (!overlappedText)
+            dc.DrawText(buf, x - text_w/2, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET);
+    }
+
+    for(f=STEP_MINOR_F_HZ; f<MAX_F_HZ; f+=STEP_MINOR_F_HZ) 
+    {
+        x = f*freq_hz_to_px;
+        x += PLOT_BORDER + XLEFT_OFFSET;
+        dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET-5);
+    }
+    
+    // Horizontal gridlines
+    dc.SetPen(m_penDotDash);
+    for(time=0; time<=WATERFALL_SECS_Y; time+=WATERFALL_SECS_STEP) {
+       y = m_rGrid.GetHeight() - time*time_s_to_py;
+       y += PLOT_BORDER;
+
+        if (m_graticule)
+            dc.DrawLine(PLOT_BORDER + XLEFT_OFFSET, y, 
+                        (m_rGrid.GetWidth() + PLOT_BORDER + XLEFT_OFFSET), y);
+        sprintf(buf, "%3.0fs", time);
+       GetTextExtent(buf, &text_w, &text_h);
+        if (!overlappedText)
+            dc.DrawText(buf, PLOT_BORDER + XLEFT_OFFSET - text_w - XLEFT_TEXT_OFFSET, y-text_h/2);
+   }
+
+    // red rx tuning line
+    dc.SetPen(wxPen(RED_COLOR, 2));
+    x = m_rxFreq*freq_hz_to_px;
+    x += PLOT_BORDER + XLEFT_OFFSET;
+    //printf("m_rxFreq %f x %d\n", m_rxFreq, x);
+    dc.DrawLine(x, m_rGrid.GetHeight()+ PLOT_BORDER, x, m_rCtrl.GetHeight());
+    
+}
+
+//-------------------------------------------------------------------------
+// plotPixelData()
+//-------------------------------------------------------------------------
+void PlotWaterfall::plotPixelData()
+{
+    float       spec_index_per_px;
+    float       intensity_per_dB;
+    float       px_per_sec;
+    int         index;
+    float       dy;
+    int         dy_blocks;
+    int         b;
+    int         px;
+    int         py;
+    int         intensity;
+
+    /*
+      Design Notes:
+
+      The height in pixels represents WATERFALL_SECS_Y of data.  Every DT
+      seconds we get a vector of MODEM_STATS_NSPEC spectrum samples which we use
+      to update the last row.  The height of each row is dy pixels, which
+      maps to DT seconds.  We call each dy high rectangle of pixels a
+      block.
+
+    */
+
+    // determine dy, the height of one "block"
+    px_per_sec = (float)m_rGrid.GetHeight() / WATERFALL_SECS_Y;
+    dy = m_dT * px_per_sec;
+
+    // number of dy high blocks in spectrogram
+    dy_blocks = m_rGrid.GetHeight()/ dy;
+
+    // update min and max amplitude estimates
+    float max_mag = MIN_MAG_DB;
+
+    int min_fft_bin=((float)200/m_modem_stats_max_f_hz)*MODEM_STATS_NSPEC;
+    int max_fft_bin=((float)2800/m_modem_stats_max_f_hz)*MODEM_STATS_NSPEC;
+
+    for(int i=min_fft_bin; i<max_fft_bin; i++) 
+    {
+        if (g_avmag[i] > max_mag)
+        {
+            max_mag = g_avmag[i];
+        }
+    }
+
+    m_max_mag = BETA*m_max_mag + (1 - BETA)*max_mag;
+    m_min_mag = max_mag - 20.0;
+    //printf("max_mag: %f m_max_mag: %f\n", max_mag, m_max_mag);
+    intensity_per_dB  = (float)256 /(MAX_MAG_DB - MIN_MAG_DB);
+    //intensity_per_dB  = (float)256 /(m_max_mag - m_min_mag);
+    spec_index_per_px = ((float)(MAX_F_HZ)/(float)m_modem_stats_max_f_hz)*(float)MODEM_STATS_NSPEC / (float) m_rGrid.GetWidth();
+
+    /*
+    printf("h %d w %d px_per_sec %d dy %d dy_blocks %d spec_index_per_px: %f\n", 
+       m_rGrid.GetHeight(), m_rGrid.GetWidth(), px_per_sec, 
+       dy, dy_blocks, spec_index_per_px);
+    */
+
+    // Shift previous bit map up one row of blocks ----------------------------
+    wxNativePixelData data(*m_pBmp);
+    wxNativePixelData::Iterator bitMapStart(data);
+    wxNativePixelData::Iterator p = bitMapStart;
+
+    for(b = 0; b < dy_blocks - 1; b++) 
+    {
+        wxNativePixelData::Iterator psrc = bitMapStart;
+        wxNativePixelData::Iterator pdest = bitMapStart;
+        pdest.OffsetY(data, dy * b);
+        psrc.OffsetY(data, dy * (b+1));
+
+        // copy one line of blocks
+
+        for(py = 0; py < dy; py++) 
+        {
+            wxNativePixelData::Iterator pdestRowStart = pdest;
+            wxNativePixelData::Iterator psrcRowStart = psrc;
+
+            for(px = 0; px < m_rGrid.GetWidth(); px++) 
+            {
+                pdest.Red() = psrc.Red();
+                pdest.Green() = psrc.Green();
+                pdest.Blue() = psrc.Blue();
+                pdest++;
+                psrc++;
+            }
+            pdest = pdestRowStart;
+            pdest.OffsetY(data, 1);
+            psrc = psrcRowStart;
+            psrc.OffsetY(data, 1);         
+        }
+    }
+
+    // Draw last line of blocks using latest amplitude data ------------------
+    p = bitMapStart;
+    p.OffsetY(data, dy *(dy_blocks - 1));
+    for(py = 0; py < dy; py++)
+    {
+        wxNativePixelData::Iterator rowStart = p;
+
+        for(px = 0; px < m_rGrid.GetWidth(); px++)
+        {
+            index = px * spec_index_per_px;
+            assert(index < MODEM_STATS_NSPEC);
+
+            intensity = intensity_per_dB * (g_avmag[index] - m_min_mag);
+            if(intensity > 255) intensity = 255;
+            if (intensity < 0) intensity = 0;
+            //printf("%d %f %d \n", index, g_avmag[index], intensity);
+
+            switch (m_colour) {
+            case 0:
+                p.Red() = m_heatmap_lut[intensity] & 0xff;
+                p.Green() = (m_heatmap_lut[intensity] >> 8) & 0xff;
+                p.Blue() = (m_heatmap_lut[intensity] >> 16) & 0xff;
+                break;
+            case 1:
+                p.Red() = intensity;
+                p.Green() = intensity;
+                p.Blue() = intensity;       
+                break;
+            case 2:
+                p.Red() = intensity;
+                p.Green() = intensity;
+                if (intensity < 127)
+                    p.Blue() = intensity*2;
+                else
+                    p.Blue() = 255;
+                        
+                break;
+            }
+            ++p;
+        }
+        p = rowStart;
+        p.OffsetY(data, 1);
+    }
+
+}
+
+//-------------------------------------------------------------------------
+// OnMouseLeftDown()
+//-------------------------------------------------------------------------
+void PlotWaterfall::OnMouseLeftDown(wxMouseEvent& event)
+{
+    m_mouseDown = true;
+    wxClientDC dc(this);
+
+    wxPoint pt(event.GetLogicalPosition(dc));
+
+    // map x coord to edges of actual plot
+    pt.x -= PLOT_BORDER + XLEFT_OFFSET;
+    pt.y -= PLOT_BORDER;
+
+    // valid click if inside of plot
+    if ((pt.x >= 0) && (pt.x <= m_rGrid.GetWidth()) && (pt.y >=0)) 
+    {
+        float freq_hz_to_px = (float)m_rGrid.GetWidth()/(MAX_F_HZ-MIN_F_HZ);
+        float clickFreq = (float)pt.x/freq_hz_to_px;
+
+        // communicate back to other threads
+        fdmdv2_clickTune(clickFreq);
+    }
+}
+
+//-------------------------------------------------------------------------
+// OnMouseRightDown()
+//-------------------------------------------------------------------------
+void PlotWaterfall::OnMouseRightDown(wxMouseEvent& event)
+{
+    m_colour++;
+    if (m_colour == 3)
+        m_colour = 0;
+}
+
diff --git a/freedv/branches/0.99/src/fdmdv2_plot_waterfall.h b/freedv/branches/0.99/src/fdmdv2_plot_waterfall.h
new file mode 100644 (file)
index 0000000..77058fd
--- /dev/null
@@ -0,0 +1,73 @@
+//==========================================================================
+// Name:            fdmdv2_plot_waterfall.h
+// Purpose:         Defines a waterfall plot derivative of fdmdv2_plot.
+// Created:         June 22, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#ifndef __FDMDV2_PLOT_WATERFALL__
+#define __FDMDV2_PLOT_WATERFALL__
+
+#include "fdmdv2_plot.h"
+#include "fdmdv2_defines.h"
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class PlotWaterfall
+//
+// @class $(Name)
+// @author $(User)
+// @date $(Date)
+// @file $(CurrentFileName).$(CurrentFileExt)
+// @brief
+//
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class PlotWaterfall : public PlotPanel
+{
+    public:
+    PlotWaterfall(wxFrame* parent, bool graticule, int colour);
+        ~PlotWaterfall();
+        bool checkDT(void);
+        void setGreyscale(bool greyscale) { m_greyscale = greyscale; }
+        void setRxFreq(float rxFreq) { m_rxFreq = rxFreq; }
+        void setFs(int fs) { m_modem_stats_max_f_hz = fs/2; }
+
+    protected:
+        unsigned    m_heatmap_lut[256];
+
+        unsigned    heatmap(float val, float min, float max);
+
+        void        OnPaint(wxPaintEvent & evt);
+        void        OnSize(wxSizeEvent& event);
+        void        OnShow(wxShowEvent& event);
+        void        drawGraticule(wxAutoBufferedPaintDC&  dc);
+        void        draw(wxAutoBufferedPaintDC& dc);
+        void        plotPixelData();
+        void        OnMouseLeftDown(wxMouseEvent& event);
+        void        OnMouseRightDown(wxMouseEvent& event);
+
+    private:
+        float       m_dT;
+        float       m_rxFreq;
+        bool        m_graticule;
+        float       m_min_mag;
+        float       m_max_mag;
+        int         m_colour;
+        int         m_modem_stats_max_f_hz;
+
+        DECLARE_EVENT_TABLE()
+};
+
+#endif //__FDMDV2_PLOT_WATERFALL__
diff --git a/freedv/branches/0.99/src/hamlib.cpp b/freedv/branches/0.99/src/hamlib.cpp
new file mode 100644 (file)
index 0000000..575f36a
--- /dev/null
@@ -0,0 +1,127 @@
+//==========================================================================
+// Name:            hamlib.cpp
+//
+// Purpose:         Hamlib integration for FreeDV
+// Created:         May 2013
+// Authors:         Joel Stanley
+//
+// 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#include <hamlib.h>
+
+#include <vector>
+#include <algorithm>
+
+using namespace std;
+
+typedef std::vector<const struct rig_caps *> riglist_t;
+
+static bool rig_cmp(const struct rig_caps *rig1, const struct rig_caps *rig2);
+static int build_list(const struct rig_caps *rig, rig_ptr_t);
+
+Hamlib::Hamlib() : m_rig(NULL) {
+    /* Stop hamlib from spewing info to stderr. */
+    rig_set_debug(RIG_DEBUG_NONE);
+
+    /* Create sorted list of rigs. */
+    rig_load_all_backends();
+    rig_list_foreach(build_list, &m_rigList);
+    sort(m_rigList.begin(), m_rigList.end(), rig_cmp);
+
+    /* Reset debug output. */
+    rig_set_debug(RIG_DEBUG_VERBOSE);
+
+       m_rig = NULL;
+}
+
+Hamlib::~Hamlib() {
+       if(m_rig)
+               close();
+}
+
+static int build_list(const struct rig_caps *rig, rig_ptr_t rigList) {
+    ((riglist_t *)rigList)->push_back(rig); 
+    return 1;
+}
+
+static bool rig_cmp(const struct rig_caps *rig1, const struct rig_caps *rig2) {
+    /* Compare manufacturer. */
+    int r = strcasecmp(rig1->mfg_name, rig2->mfg_name);
+    if (r != 0)
+        return r < 0;
+
+    /* Compare model. */
+    r = strcasecmp(rig1->model_name, rig2->model_name);
+    if (r != 0)
+        return r < 0;
+
+    /* Compare rig ID. */
+    return rig1->rig_model < rig2->rig_model;
+}
+
+void Hamlib::populateComboBox(wxComboBox *cb) {
+
+    riglist_t::const_iterator rig = m_rigList.begin();
+    for (; rig !=m_rigList.end(); rig++) {
+        char name[128];
+        snprintf(name, 128, "%s %s", (*rig)->mfg_name, (*rig)->model_name); 
+        cb->Append(name);
+    }
+}
+
+bool Hamlib::connect(unsigned int rig_index, const char *serial_port) {
+    /* Look up model from index. */
+    if (rig_index >= m_rigList.size()) {
+        return false;
+    }
+    printf("rig: %s %s (%d)\n", m_rigList[rig_index]->mfg_name,
+            m_rigList[rig_index]->model_name, m_rigList[rig_index]->rig_model);
+
+       if(m_rig) {
+               printf("Closing old hamlib instance!\n");
+               close();
+       }
+
+    /* Initialise, configure and open. */
+    m_rig = rig_init(m_rigList[rig_index]->rig_model);
+    /* TODO: Also use baud rate from the screen. */
+    if (!m_rig)
+        return false;
+    token_t token = rig_token_lookup(m_rig, "rig_pathname");
+    if (rig_set_conf(m_rig, token, serial_port) != RIG_OK) {
+        return false;
+    }
+    if (rig_open(m_rig) == RIG_OK) {
+        return true;
+    }
+    return false;
+}
+
+bool Hamlib::ptt(bool press) {
+       if(!m_rig)
+               return false;
+    /* TODO(Joel): make ON_DATA and ON configurable. */
+    ptt_t on = press ? RIG_PTT_ON : RIG_PTT_OFF;
+    /* TODO(Joel): what should the VFO option be? */
+    return rig_set_ptt(m_rig, RIG_VFO_CURR, on) == RIG_OK;
+}
+
+void Hamlib::close(void) {
+       if(m_rig) {
+               rig_close(m_rig);
+               rig_cleanup(m_rig);
+               m_rig = NULL;
+       }
+}
diff --git a/freedv/branches/0.99/src/hamlib.h b/freedv/branches/0.99/src/hamlib.h
new file mode 100644 (file)
index 0000000..fe3496f
--- /dev/null
@@ -0,0 +1,28 @@
+#ifndef HAMLIB_H
+#define HAMLIB_H
+
+extern "C" {
+#include <hamlib/rig.h>
+}
+#include <wx/combobox.h>
+#include <vector>
+
+class Hamlib {
+
+    public:
+        Hamlib();
+        ~Hamlib();
+        void populateComboBox(wxComboBox *cb);
+        bool connect(unsigned int rig_index, const char *serial_port);
+        bool ptt(bool press);
+        void close(void);
+
+        typedef std::vector<const struct rig_caps *> riglist_t;
+
+    private:
+        RIG *m_rig;
+        /* Sorted list of rigs. */
+        riglist_t m_rigList;
+};
+
+#endif /*HAMLIB_H*/
diff --git a/freedv/branches/0.99/src/sox.h b/freedv/branches/0.99/src/sox.h
new file mode 100644 (file)
index 0000000..07aedeb
--- /dev/null
@@ -0,0 +1,2608 @@
+/* libSoX Library Public Interface
+ *
+ * Copyright 1999-2011 Chris Bagwell and SoX Contributors.
+ *
+ * This source code is freely redistributable and may be used for
+ * any purpose.  This copyright notice must be maintained.
+ * Chris Bagwell And SoX Contributors are not responsible for
+ * the consequences of using this software.
+ */
+
+/** @file
+Contains the interface exposed to clients of the libSoX library.
+Symbols starting with "sox_" or "SOX_" are part of the public interface for
+libSoX clients (applications that consume libSoX). Symbols starting with
+"lsx_" or "LSX_" are internal use by libSoX and plugins.
+LSX_ and lsx_ symbols should not be used by libSoX-based applications.
+*/
+
+#ifndef SOX_H
+#define SOX_H /**< Client API: This macro is defined if sox.h has been included. */
+
+#include <limits.h>
+#include <stdarg.h>
+#include <stddef.h>
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+/* Suppress warnings from use of type long long. */
+#if defined __GNUC__
+#pragma GCC system_header
+#endif
+
+/*****************************************************************************
+API decoration macros:
+Mostly for documentation purposes. For some compilers, decorations also affect
+code generation, influence compiler warnings or activate compiler
+optimizations.
+*****************************************************************************/
+
+/**
+Plugins API:
+Attribute required on all functions exported by libSoX and on all function
+pointer types used by the libSoX API.
+*/
+#ifdef __GNUC__
+#define LSX_API  __attribute__ ((cdecl)) /* libSoX function */
+#elif _MSC_VER
+#define LSX_API  __cdecl /* libSoX function */
+#else
+#define LSX_API /* libSoX function */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter or local variable to suppress warnings about
+the variable being unused (especially in macro-generated code).
+*/
+#ifdef __GNUC__
+#define LSX_UNUSED  __attribute__ ((unused)) /* Parameter or local variable is intentionally unused. */
+#else
+#define LSX_UNUSED /* Parameter or local variable is intentionally unused. */
+#endif
+
+/**
+Plugins API:
+LSX_PRINTF12: Attribute applied to a function to indicate that it requires
+a printf-style format string for arg1 and that printf parameters start at
+arg2.
+*/
+#ifdef __GNUC__
+#define LSX_PRINTF12  __attribute__ ((format (printf, 1, 2))) /* Function has printf-style arguments. */
+#else
+#define LSX_PRINTF12 /* Function has printf-style arguments. */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a function to indicate that it has no side effects and
+depends only its input parameters and global memory. If called repeatedly, it
+returns the same result each time.
+*/
+#ifdef __GNUC__
+#define LSX_RETURN_PURE __attribute__ ((pure)) /* Function is pure. */
+#else
+#define LSX_RETURN_PURE /* Function is pure. */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a function to indicate that the
+return value is always a pointer to a valid object (never NULL).
+*/
+#ifdef _Ret_
+#define LSX_RETURN_VALID _Ret_ /* Function always returns a valid object (never NULL). */
+#else
+#define LSX_RETURN_VALID /* Function always returns a valid object (never NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a function to indicate that the return value is always a
+pointer to a valid array (never NULL).
+*/
+#ifdef _Ret_valid_
+#define LSX_RETURN_ARRAY _Ret_valid_ /* Function always returns a valid array (never NULL). */
+#else
+#define LSX_RETURN_ARRAY /* Function always returns a valid array (never NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a function to indicate that the return value is always a
+pointer to a valid 0-terminated array (never NULL).
+*/
+#ifdef _Ret_z_
+#define LSX_RETURN_VALID_Z _Ret_z_ /* Function always returns a 0-terminated array (never NULL). */
+#else
+#define LSX_RETURN_VALID_Z /* Function always returns a 0-terminated array (never NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a function to indicate that the returned pointer may be
+null.
+*/
+#ifdef _Ret_opt_
+#define LSX_RETURN_OPT _Ret_opt_ /* Function may return NULL. */
+#else
+#define LSX_RETURN_OPT /* Function may return NULL. */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a valid
+pointer to one const element of the pointed-to type (never NULL).
+*/
+#ifdef _In_
+#define LSX_PARAM_IN _In_ /* Required const pointer to a valid object (never NULL). */
+#else
+#define LSX_PARAM_IN /* Required const pointer to a valid object (never NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a valid
+pointer to a const 0-terminated string (never NULL).
+*/
+#ifdef _In_z_
+#define LSX_PARAM_IN_Z _In_z_ /* Required const pointer to 0-terminated string (never NULL). */
+#else
+#define LSX_PARAM_IN_Z /* Required const pointer to 0-terminated string (never NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a const
+pointer to a 0-terminated printf format string.
+*/
+#ifdef _Printf_format_string_
+#define LSX_PARAM_IN_PRINTF _Printf_format_string_ /* Required const pointer to 0-terminated printf format string (never NULL). */
+#else
+#define LSX_PARAM_IN_PRINTF /* Required const pointer to 0-terminated printf format string (never NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a valid
+pointer to (len) const initialized elements of the pointed-to type, where
+(len) is the name of another parameter.
+@param len The parameter that contains the number of elements in the array.
+*/
+#ifdef _In_count_
+#define LSX_PARAM_IN_COUNT(len) _In_count_(len) /* Required const pointer to (len) valid objects (never NULL). */
+#else
+#define LSX_PARAM_IN_COUNT(len) /* Required const pointer to (len) valid objects (never NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a valid
+pointer to (len) const bytes of initialized data, where (len) is the name of
+another parameter.
+@param len The parameter that contains the number of bytes in the array.
+*/
+#ifdef _In_bytecount_
+#define LSX_PARAM_IN_BYTECOUNT(len) _In_bytecount_(len) /* Required const pointer to (len) bytes of data (never NULL). */
+#else
+#define LSX_PARAM_IN_BYTECOUNT(len) /* Required const pointer to (len) bytes of data (never NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is either NULL
+or a valid pointer to one const element of the pointed-to type.
+*/
+#ifdef _In_opt_
+#define LSX_PARAM_IN_OPT _In_opt_ /* Optional const pointer to a valid object (may be NULL). */
+#else
+#define LSX_PARAM_IN_OPT /* Optional const pointer to a valid object (may be NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is either NULL
+or a valid pointer to a const 0-terminated string.
+*/
+#ifdef _In_opt_z_
+#define LSX_PARAM_IN_OPT_Z _In_opt_z_ /* Optional const pointer to 0-terminated string (may be NULL). */
+#else
+#define LSX_PARAM_IN_OPT_Z /* Optional const pointer to 0-terminated string (may be NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a valid
+pointer to one initialized element of the pointed-to type (never NULL). The
+function may modify the element.
+*/
+#ifdef _Inout_
+#define LSX_PARAM_INOUT _Inout_ /* Required pointer to a valid object (never NULL). */
+#else
+#define LSX_PARAM_INOUT /* Required pointer to a valid object (never NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a valid
+pointer to (len) initialized elements of the pointed-to type (never NULL). The
+function may modify the elements.
+@param len The parameter that contains the number of elements in the array.
+*/
+#ifdef _Inout_count_x_
+#define LSX_PARAM_INOUT_COUNT(len) _Inout_count_x_(len) /* Required pointer to (len) valid objects (never NULL). */
+#else
+#define LSX_PARAM_INOUT_COUNT(len) /* Required pointer to (len) valid objects (never NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a valid
+pointer to memory sufficient for one element of the pointed-to type (never
+NULL). The function will initialize the element.
+*/
+#ifdef _Out_
+#define LSX_PARAM_OUT _Out_ /* Required pointer to an object to be initialized (never NULL). */
+#else
+#define LSX_PARAM_OUT /* Required pointer to an object to be initialized (never NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a valid
+pointer to memory sufficient for (len) bytes of data (never NULL), where (len)
+is the name of another parameter. The function may write up to len bytes of
+data to this memory.
+@param len The parameter that contains the number of bytes in the array.
+*/
+#ifdef _Out_bytecap_
+#define LSX_PARAM_OUT_BYTECAP(len) _Out_bytecap_(len) /* Required pointer to writable buffer with room for len bytes. */
+#else
+#define LSX_PARAM_OUT_BYTECAP(len) /* Required pointer to writable buffer with room for len bytes. */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a valid
+pointer to memory sufficient for (len) elements of the pointed-to type (never
+NULL), where (len) is the name of another parameter. On return, (filled)
+elements will have been initialized, where (filled) is either the dereference
+of another pointer parameter (for example "*written") or the "return"
+parameter (indicating that the function returns the number of elements
+written).
+@param len The parameter that contains the number of elements in the array.
+@param filled The dereference of the parameter that receives the number of elements written to the array, or "return" if the value is returned.
+*/
+#ifdef _Out_cap_post_count_
+#define LSX_PARAM_OUT_CAP_POST_COUNT(len,filled) _Out_cap_post_count_(len,filled) /* Required pointer to buffer for (len) elements (never NULL); on return, (filled) elements will have been initialized. */
+#else
+#define LSX_PARAM_OUT_CAP_POST_COUNT(len,filled) /* Required pointer to buffer for (len) elements (never NULL); on return, (filled) elements will have been initialized. */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a valid
+pointer to memory sufficient for (len) elements of the pointed-to type (never
+NULL), where (len) is the name of another parameter. On return, (filled+1)
+elements will have been initialized, with the last element having been
+initialized to 0, where (filled) is either the dereference of another pointer
+parameter (for example, "*written") or the "return" parameter (indicating that
+the function returns the number of elements written).
+@param len The parameter that contains the number of elements in the array.
+@param filled The dereference of the parameter that receives the number of elements written to the array (not counting the terminating null), or "return" if the value is returned.
+*/
+#ifdef _Out_z_cap_post_count_
+#define LSX_PARAM_OUT_Z_CAP_POST_COUNT(len,filled) _Out_z_cap_post_count_(len,filled) /* Required pointer to buffer for (len) elements (never NULL); on return, (filled+1) elements will have been initialized, and the array will be 0-terminated. */
+#else
+#define LSX_PARAM_OUT_Z_CAP_POST_COUNT(len,filled) /* Required pointer to buffer for (len) elements (never NULL); on return, (filled+1) elements will have been initialized, and the array will be 0-terminated. */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is either NULL
+or a valid pointer to memory sufficient for one element of the pointed-to
+type. The function will initialize the element.
+*/
+#ifdef _Out_opt_
+#define LSX_PARAM_OUT_OPT _Out_opt_ /* Optional pointer to an object to be initialized (may be NULL). */
+#else
+#define LSX_PARAM_OUT_OPT /* Optional pointer to an object to be initialized (may be NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a valid
+pointer (never NULL) to another pointer which may be NULL when the function is
+invoked.
+*/
+#ifdef _Deref_pre_maybenull_
+#define LSX_PARAM_DEREF_PRE_MAYBENULL _Deref_pre_maybenull_ /* Required pointer (never NULL) to another pointer (may be NULL). */
+#else
+#define LSX_PARAM_DEREF_PRE_MAYBENULL /* Required pointer (never NULL) to another pointer (may be NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a valid
+pointer (never NULL) to another pointer which will be NULL when the function
+returns.
+*/
+#ifdef _Deref_post_null_
+#define LSX_PARAM_DEREF_POST_NULL _Deref_post_null_ /* Required pointer (never NULL) to another pointer, which will be NULL on exit. */
+#else
+#define LSX_PARAM_DEREF_POST_NULL /* Required pointer (never NULL) to another pointer, which will be NULL on exit. */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a valid
+pointer (never NULL) to another pointer which will be non-NULL when the
+function returns.
+*/
+#ifdef _Deref_post_notnull_
+#define LSX_PARAM_DEREF_POST_NOTNULL _Deref_post_notnull_ /* Required pointer (never NULL) to another pointer, which will be valid (not NULL) on exit. */
+#else
+#define LSX_PARAM_DEREF_POST_NOTNULL /* Required pointer (never NULL) to another pointer, which will be valid (not NULL) on exit. */
+#endif
+
+/**
+Plugins API:
+Expression that "uses" a potentially-unused variable to avoid compiler
+warnings (especially in macro-generated code).
+*/
+#ifdef _PREFAST_
+#define LSX_USE_VAR(x)  ((void)(x=0)) /* During static analysis, initialize unused variables to 0. */
+#else
+#define LSX_USE_VAR(x)  ((void)(x)) /* Parameter or variable is intentionally unused. */
+#endif
+
+/**
+Plugins API:
+Compile-time assertion. Causes a compile error if the expression is false.
+@param e  The expression to test. If expression is false, compilation will fail.
+@param f  A unique identifier for the test, for example foo_must_not_be_zero.
+*/
+#define lsx_static_assert(e,f) enum {lsx_static_assert_##f = 1/((e) ? 1 : 0)}
+
+/*****************************************************************************
+Basic typedefs:
+*****************************************************************************/
+
+/**
+Client API:
+Signed twos-complement 8-bit type. Typically defined as signed char.
+*/
+#if SCHAR_MAX==127 && SCHAR_MIN==(-128)
+typedef signed char sox_int8_t;
+#elif CHAR_MAX==127 && CHAR_MIN==(-128)
+typedef char sox_int8_t;
+#else
+#error Unable to determine an appropriate definition for sox_int8_t.
+#endif
+
+/**
+Client API:
+Unsigned 8-bit type. Typically defined as unsigned char.
+*/
+#if UCHAR_MAX==0xff
+typedef unsigned char sox_uint8_t;
+#elif CHAR_MAX==0xff && CHAR_MIN==0
+typedef char sox_uint8_t;
+#else
+#error Unable to determine an appropriate definition for sox_uint8_t.
+#endif
+
+/**
+Client API:
+Signed twos-complement 16-bit type. Typically defined as short.
+*/
+#if SHRT_MAX==32767 && SHRT_MIN==(-32768)
+typedef short sox_int16_t;
+#elif INT_MAX==32767 && INT_MIN==(-32768)
+typedef int sox_int16_t;
+#else
+#error Unable to determine an appropriate definition for sox_int16_t.
+#endif
+
+/**
+Client API:
+Unsigned 16-bit type. Typically defined as unsigned short.
+*/
+#if USHRT_MAX==0xffff
+typedef unsigned short sox_uint16_t;
+#elif UINT_MAX==0xffff
+typedef unsigned int sox_uint16_t;
+#else
+#error Unable to determine an appropriate definition for sox_uint16_t.
+#endif
+
+/**
+Client API:
+Signed twos-complement 32-bit type. Typically defined as int.
+*/
+#if INT_MAX==2147483647 && INT_MIN==(-2147483647-1)
+typedef int sox_int32_t;
+#elif LONG_MAX==2147483647 && LONG_MIN==(-2147483647-1)
+typedef long sox_int32_t;
+#else
+#error Unable to determine an appropriate definition for sox_int32_t.
+#endif
+
+/**
+Client API:
+Unsigned 32-bit type. Typically defined as unsigned int.
+*/
+#if UINT_MAX==0xffffffff
+typedef unsigned int sox_uint32_t;
+#elif ULONG_MAX==0xffffffff
+typedef unsigned long sox_uint32_t;
+#else
+#error Unable to determine an appropriate definition for sox_uint32_t.
+#endif
+
+/**
+Client API:
+Signed twos-complement 64-bit type. Typically defined as long or long long.
+*/
+#if LONG_MAX==9223372036854775807 && LONG_MIN==(-9223372036854775807-1)
+typedef long sox_int64_t;
+#elif defined(_MSC_VER)
+typedef __int64 sox_int64_t;
+#else
+typedef long long sox_int64_t;
+#endif
+
+/**
+Client API:
+Unsigned 64-bit type. Typically defined as unsigned long or unsigned long long.
+*/
+#if ULONG_MAX==0xffffffffffffffff
+typedef unsigned long sox_uint64_t;
+#elif defined(_MSC_VER)
+typedef unsigned __int64 sox_uint64_t;
+#else
+typedef unsigned long long sox_uint64_t;
+#endif
+
+#ifndef _DOXYGEN_
+lsx_static_assert(sizeof(sox_int8_t)==1,   sox_int8_size);
+lsx_static_assert(sizeof(sox_uint8_t)==1,  sox_uint8_size);
+lsx_static_assert(sizeof(sox_int16_t)==2,  sox_int16_size);
+lsx_static_assert(sizeof(sox_uint16_t)==2, sox_uint16_size);
+lsx_static_assert(sizeof(sox_int32_t)==4,  sox_int32_size);
+lsx_static_assert(sizeof(sox_uint32_t)==4, sox_uint32_size);
+lsx_static_assert(sizeof(sox_int64_t)==8,  sox_int64_size);
+lsx_static_assert(sizeof(sox_uint64_t)==8, sox_uint64_size);
+#endif
+
+/**
+Client API:
+Alias for sox_int32_t (beware of the extra byte).
+*/
+typedef sox_int32_t sox_int24_t;
+
+/**
+Client API:
+Alias for sox_uint32_t (beware of the extra byte).
+*/
+typedef sox_uint32_t sox_uint24_t;
+
+/**
+Client API:
+Native SoX audio sample type (alias for sox_int32_t).
+*/
+typedef sox_int32_t sox_sample_t;
+
+/**
+Client API:
+Samples per second is stored as a double.
+*/
+typedef double sox_rate_t;
+
+/**
+Client API:
+File's metadata, access via sox_*_comments functions.
+*/
+typedef char * * sox_comments_t;
+
+/*****************************************************************************
+Enumerations:
+*****************************************************************************/
+
+/**
+Client API:
+Boolean type, assignment (but not necessarily binary) compatible with C++ bool.
+*/
+typedef enum sox_bool {
+    sox_false, /**< False = 0. */
+    sox_true   /**< True = 1. */
+} sox_bool;
+
+/**
+Client API:
+no, yes, or default (default usually implies some kind of auto-detect logic).
+*/
+typedef enum sox_option_t {
+    sox_option_no,      /**< Option specified as no = 0. */
+    sox_option_yes,     /**< Option specified as yes = 1. */
+    sox_option_default  /**< Option unspecified = 2. */
+} sox_option_t;
+
+/**
+Client API:
+The libSoX-specific error codes.
+libSoX functions may return these codes or others that map from errno codes.
+*/
+enum sox_error_t {
+  SOX_SUCCESS = 0,     /**< Function succeeded = 0 */
+  SOX_EOF = -1,        /**< End Of File or other error = -1 */
+  SOX_EHDR = 2000,     /**< Invalid Audio Header = 2000 */
+  SOX_EFMT,            /**< Unsupported data format = 2001 */
+  SOX_ENOMEM,          /**< Can't alloc memory = 2002 */
+  SOX_EPERM,           /**< Operation not permitted = 2003 */
+  SOX_ENOTSUP,         /**< Operation not supported = 2004 */
+  SOX_EINVAL           /**< Invalid argument = 2005 */
+};
+
+/**
+Client API:
+Flags indicating whether optional features are present in this build of libSoX.
+*/
+typedef enum sox_version_flags_t {
+    sox_version_none = 0,         /**< No special features = 0. */
+    sox_version_have_popen = 1,   /**< popen = 1. */
+    sox_version_have_magic = 2,   /**< magic = 2. */
+    sox_version_have_threads = 4, /**< threads = 4. */
+    sox_version_have_memopen = 8  /**< memopen = 8. */
+} sox_version_flags_t;
+
+/**
+Client API:
+Format of sample data.
+*/
+typedef enum sox_encoding_t {
+  SOX_ENCODING_UNKNOWN   , /**< encoding has not yet been determined */
+
+  SOX_ENCODING_SIGN2     , /**< signed linear 2's comp: Mac */
+  SOX_ENCODING_UNSIGNED  , /**< unsigned linear: Sound Blaster */
+  SOX_ENCODING_FLOAT     , /**< floating point (binary format) */
+  SOX_ENCODING_FLOAT_TEXT, /**< floating point (text format) */
+  SOX_ENCODING_FLAC      , /**< FLAC compression */
+  SOX_ENCODING_HCOM      , /**< Mac FSSD files with Huffman compression */
+  SOX_ENCODING_WAVPACK   , /**< WavPack with integer samples */
+  SOX_ENCODING_WAVPACKF  , /**< WavPack with float samples */
+  SOX_ENCODING_ULAW      , /**< u-law signed logs: US telephony, SPARC */
+  SOX_ENCODING_ALAW      , /**< A-law signed logs: non-US telephony, Psion */
+  SOX_ENCODING_G721      , /**< G.721 4-bit ADPCM */
+  SOX_ENCODING_G723      , /**< G.723 3 or 5 bit ADPCM */
+  SOX_ENCODING_CL_ADPCM  , /**< Creative Labs 8 --> 2,3,4 bit Compressed PCM */
+  SOX_ENCODING_CL_ADPCM16, /**< Creative Labs 16 --> 4 bit Compressed PCM */
+  SOX_ENCODING_MS_ADPCM  , /**< Microsoft Compressed PCM */
+  SOX_ENCODING_IMA_ADPCM , /**< IMA Compressed PCM */
+  SOX_ENCODING_OKI_ADPCM , /**< Dialogic/OKI Compressed PCM */
+  SOX_ENCODING_DPCM      , /**< Differential PCM: Fasttracker 2 (xi) */
+  SOX_ENCODING_DWVW      , /**< Delta Width Variable Word */
+  SOX_ENCODING_DWVWN     , /**< Delta Width Variable Word N-bit */
+  SOX_ENCODING_GSM       , /**< GSM 6.10 33byte frame lossy compression */
+  SOX_ENCODING_MP3       , /**< MP3 compression */
+  SOX_ENCODING_VORBIS    , /**< Vorbis compression */
+  SOX_ENCODING_AMR_WB    , /**< AMR-WB compression */
+  SOX_ENCODING_AMR_NB    , /**< AMR-NB compression */
+  SOX_ENCODING_CVSD      , /**< Continuously Variable Slope Delta modulation */
+  SOX_ENCODING_LPC10     , /**< Linear Predictive Coding */
+
+  SOX_ENCODINGS            /**< End of list marker */
+} sox_encoding_t;
+
+/**
+Client API:
+Flags for sox_encodings_info_t: lossless/lossy1/lossy2.
+*/
+typedef enum sox_encodings_flags_t {
+  sox_encodings_none   = 0, /**< no flags specified (implies lossless encoding) = 0. */
+  sox_encodings_lossy1 = 1, /**< encode, decode: lossy once = 1. */
+  sox_encodings_lossy2 = 2  /**< encode, decode, encode, decode: lossy twice = 2. */
+} sox_encodings_flags_t;
+
+/**
+Client API:
+Type of plot.
+*/
+typedef enum sox_plot_t {
+    sox_plot_off,     /**< No plot = 0. */
+    sox_plot_octave,  /**< Octave plot = 1. */
+    sox_plot_gnuplot, /**< Gnuplot plot = 2. */
+    sox_plot_data     /**< Plot data = 3. */
+} sox_plot_t;
+
+/**
+Client API:
+Loop modes: upper 4 bits mask the loop blass, lower 4 bits describe
+the loop behaviour, for example single shot, bidirectional etc.
+*/
+enum sox_loop_flags_t {
+  sox_loop_none = 0,          /**< single-shot = 0 */
+  sox_loop_forward = 1,       /**< forward loop = 1 */
+  sox_loop_forward_back = 2,  /**< forward/back loop = 2 */
+  sox_loop_8 = 32,            /**< 8 loops (??) = 32 */
+  sox_loop_sustain_decay = 64 /**< AIFF style, one sustain & one decay loop = 64 */
+};
+
+/**
+Plugins API:
+Is file a real file, a pipe, or a url?
+*/
+typedef enum lsx_io_type
+{
+    lsx_io_file, /**< File is a real file = 0. */
+    lsx_io_pipe, /**< File is a pipe (no seeking) = 1. */
+    lsx_io_url   /**< File is a URL (no seeking) = 2. */
+} lsx_io_type;
+
+/*****************************************************************************
+Macros:
+*****************************************************************************/
+
+/**
+Client API:
+Compute a 32-bit integer API version from three 8-bit parts.
+@param a Major version.
+@param b Minor version.
+@param c Revision or build number.
+@returns 32-bit integer API version 0x000a0b0c.
+*/
+#define SOX_LIB_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
+
+/**
+Client API:
+The API version of the sox.h file. It is not meant to follow the version
+number of SoX but it has historically. Please do not count on
+SOX_LIB_VERSION_CODE staying in sync with the libSoX version.
+*/
+#define SOX_LIB_VERSION_CODE   SOX_LIB_VERSION(14, 4, 0)
+
+/**
+Client API:
+Returns the smallest (negative) value storable in a twos-complement signed
+integer with the specified number of bits, cast to an unsigned integer;
+for example, SOX_INT_MIN(8) = 0x80, SOX_INT_MIN(16) = 0x8000, etc.
+@param bits Size of value for which to calculate minimum.
+@returns the smallest (negative) value storable in a twos-complement signed
+integer with the specified number of bits, cast to an unsigned integer.
+*/
+#define SOX_INT_MIN(bits) (1 <<((bits)-1))
+
+/**
+Client API:
+Returns the largest (positive) value storable in a twos-complement signed
+integer with the specified number of bits, cast to an unsigned integer;
+for example, SOX_INT_MAX(8) = 0x7F, SOX_INT_MAX(16) = 0x7FFF, etc.
+@param bits Size of value for which to calculate maximum.
+@returns the largest (positive) value storable in a twos-complement signed
+integer with the specified number of bits, cast to an unsigned integer.
+*/
+#define SOX_INT_MAX(bits) (((unsigned)-1)>>(33-(bits)))
+
+/**
+Client API:
+Returns the largest value storable in an unsigned integer with the specified
+number of bits; for example, SOX_UINT_MAX(8) = 0xFF,
+SOX_UINT_MAX(16) = 0xFFFF, etc.
+@param bits Size of value for which to calculate maximum.
+@returns the largest value storable in an unsigned integer with the specified
+number of bits.
+*/
+#define SOX_UINT_MAX(bits) (SOX_INT_MIN(bits)|SOX_INT_MAX(bits))
+
+/**
+Client API:
+Returns 0x7F.
+*/
+#define SOX_INT8_MAX  SOX_INT_MAX(8)
+
+/**
+Client API:
+Returns 0x7FFF.
+*/
+#define SOX_INT16_MAX SOX_INT_MAX(16)
+
+/**
+Client API:
+Returns 0x7FFFFF.
+*/
+#define SOX_INT24_MAX SOX_INT_MAX(24)
+
+/**
+Client API:
+Returns 0x7FFFFFFF.
+*/
+#define SOX_INT32_MAX SOX_INT_MAX(32)
+
+/**
+Client API:
+Bits in a sox_sample_t = 32.
+*/
+#define SOX_SAMPLE_PRECISION 32
+
+/**
+Client API:
+Max value for sox_sample_t = 0x7FFFFFFF.
+*/
+#define SOX_SAMPLE_MAX (sox_sample_t)SOX_INT_MAX(32)
+
+/**
+Client API:
+Min value for sox_sample_t = 0x80000000.
+*/
+#define SOX_SAMPLE_MIN (sox_sample_t)SOX_INT_MIN(32)
+
+
+/*                Conversions: Linear PCM <--> sox_sample_t
+ *
+ *   I/O      Input    sox_sample_t Clips?   Input    sox_sample_t Clips?
+ *  Format   Minimum     Minimum     I O    Maximum     Maximum     I O
+ *  ------  ---------  ------------ -- --   --------  ------------ -- --
+ *  Float     -inf         -1        y n      inf      1 - 5e-10    y n
+ *  Int8      -128        -128       n n      127     127.9999999   n y
+ *  Int16    -32768      -32768      n n     32767    32767.99998   n y
+ *  Int24   -8388608    -8388608     n n    8388607   8388607.996   n y
+ *  Int32  -2147483648 -2147483648   n n   2147483647 2147483647    n n
+ *
+ * Conversions are as accurate as possible (with rounding).
+ *
+ * Rounding: halves toward +inf, all others to nearest integer.
+ *
+ * Clips? shows whether on not there is the possibility of a conversion
+ * clipping to the minimum or maximum value when inputing from or outputing
+ * to a given type.
+ *
+ * Unsigned integers are converted to and from signed integers by flipping
+ * the upper-most bit then treating them as signed integers.
+ */
+
+/**
+Client API:
+Declares the temporary local variables that are required when using SOX
+conversion macros.
+*/
+#define SOX_SAMPLE_LOCALS sox_sample_t sox_macro_temp_sample LSX_UNUSED; \
+  double sox_macro_temp_double LSX_UNUSED
+
+/**
+Client API:
+Sign bit for sox_sample_t = 0x80000000.
+*/
+#define SOX_SAMPLE_NEG SOX_INT_MIN(32)
+
+/**
+Client API:
+Converts sox_sample_t to an unsigned integer of width (bits).
+@param bits  Width of resulting sample (1 through 32).
+@param d     Input sample to be converted.
+@param clips Variable that is incremented if the result is too big.
+@returns Unsigned integer of width (bits).
+*/
+#define SOX_SAMPLE_TO_UNSIGNED(bits,d,clips) \
+  (sox_uint##bits##_t)(SOX_SAMPLE_TO_SIGNED(bits,d,clips)^SOX_INT_MIN(bits))
+
+/**
+Client API:
+Converts sox_sample_t to a signed integer of width (bits).
+@param bits  Width of resulting sample (1 through 32).
+@param d     Input sample to be converted.
+@param clips Variable that is incremented if the result is too big.
+@returns Signed integer of width (bits).
+*/
+#define SOX_SAMPLE_TO_SIGNED(bits,d,clips) \
+  (sox_int##bits##_t)(LSX_USE_VAR(sox_macro_temp_double),sox_macro_temp_sample=(d),sox_macro_temp_sample>SOX_SAMPLE_MAX-(1<<(31-bits))?++(clips),SOX_INT_MAX(bits):((sox_uint32_t)(sox_macro_temp_sample+(1<<(31-bits))))>>(32-bits))
+
+/**
+Client API:
+Converts signed integer of width (bits) to sox_sample_t.
+@param bits Width of input sample (1 through 32).
+@param d    Input sample to be converted.
+@returns SoX native sample value.
+*/
+#define SOX_SIGNED_TO_SAMPLE(bits,d)((sox_sample_t)(d)<<(32-bits))
+
+/**
+Client API:
+Converts unsigned integer of width (bits) to sox_sample_t.
+@param bits Width of input sample (1 through 32).
+@param d    Input sample to be converted.
+@returns SoX native sample value.
+*/
+#define SOX_UNSIGNED_TO_SAMPLE(bits,d)(SOX_SIGNED_TO_SAMPLE(bits,d)^SOX_SAMPLE_NEG)
+
+/**
+Client API:
+Converts unsigned 8-bit integer to sox_sample_t.
+@param d     Input sample to be converted.
+@param clips The parameter is not used.
+@returns SoX native sample value.
+*/
+#define SOX_UNSIGNED_8BIT_TO_SAMPLE(d,clips) SOX_UNSIGNED_TO_SAMPLE(8,d)
+
+/**
+Client API:
+Converts signed 8-bit integer to sox_sample_t.
+@param d    Input sample to be converted.
+@param clips The parameter is not used.
+@returns SoX native sample value.
+*/
+#define SOX_SIGNED_8BIT_TO_SAMPLE(d,clips) SOX_SIGNED_TO_SAMPLE(8,d)
+
+/**
+Client API:
+Converts unsigned 16-bit integer to sox_sample_t.
+@param d     Input sample to be converted.
+@param clips The parameter is not used.
+@returns SoX native sample value.
+*/
+#define SOX_UNSIGNED_16BIT_TO_SAMPLE(d,clips) SOX_UNSIGNED_TO_SAMPLE(16,d)
+
+/**
+Client API:
+Converts signed 16-bit integer to sox_sample_t.
+@param d    Input sample to be converted.
+@param clips The parameter is not used.
+@returns SoX native sample value.
+*/
+#define SOX_SIGNED_16BIT_TO_SAMPLE(d,clips) SOX_SIGNED_TO_SAMPLE(16,d)
+
+/**
+Client API:
+Converts unsigned 24-bit integer to sox_sample_t.
+@param d     Input sample to be converted.
+@param clips The parameter is not used.
+@returns SoX native sample value.
+*/
+#define SOX_UNSIGNED_24BIT_TO_SAMPLE(d,clips) SOX_UNSIGNED_TO_SAMPLE(24,d)
+
+/**
+Client API:
+Converts signed 24-bit integer to sox_sample_t.
+@param d    Input sample to be converted.
+@param clips The parameter is not used.
+@returns SoX native sample value.
+*/
+#define SOX_SIGNED_24BIT_TO_SAMPLE(d,clips) SOX_SIGNED_TO_SAMPLE(24,d)
+
+/**
+Client API:
+Converts unsigned 32-bit integer to sox_sample_t.
+@param d     Input sample to be converted.
+@param clips The parameter is not used.
+@returns SoX native sample value.
+*/
+#define SOX_UNSIGNED_32BIT_TO_SAMPLE(d,clips) ((sox_sample_t)(d)^SOX_SAMPLE_NEG)
+
+/**
+Client API:
+Converts signed 32-bit integer to sox_sample_t.
+@param d    Input sample to be converted.
+@param clips The parameter is not used.
+@returns SoX native sample value.
+*/
+#define SOX_SIGNED_32BIT_TO_SAMPLE(d,clips) (sox_sample_t)(d)
+
+/**
+Client API:
+Converts 32-bit float to sox_sample_t.
+@param d     Input sample to be converted, range [-1, 1).
+@param clips Variable to increment if the input sample is too large or too small.
+@returns SoX native sample value.
+*/
+#define SOX_FLOAT_32BIT_TO_SAMPLE(d,clips) (sox_sample_t)(LSX_USE_VAR(sox_macro_temp_sample),sox_macro_temp_double=(d)*(SOX_SAMPLE_MAX+1.),sox_macro_temp_double<SOX_SAMPLE_MIN?++(clips),SOX_SAMPLE_MIN:sox_macro_temp_double>=SOX_SAMPLE_MAX+1.?sox_macro_temp_double>SOX_SAMPLE_MAX+1.?++(clips),SOX_SAMPLE_MAX:SOX_SAMPLE_MAX:sox_macro_temp_double)
+
+/**
+Client API:
+Converts 64-bit float to sox_sample_t.
+@param d     Input sample to be converted, range [-1, 1).
+@param clips Variable to increment if the input sample is too large or too small.
+@returns SoX native sample value.
+*/
+#define SOX_FLOAT_64BIT_TO_SAMPLE(d,clips) (sox_sample_t)(LSX_USE_VAR(sox_macro_temp_sample),sox_macro_temp_double=(d)*(SOX_SAMPLE_MAX+1.),sox_macro_temp_double<0?sox_macro_temp_double<=SOX_SAMPLE_MIN-.5?++(clips),SOX_SAMPLE_MIN:sox_macro_temp_double-.5:sox_macro_temp_double>=SOX_SAMPLE_MAX+.5?sox_macro_temp_double>SOX_SAMPLE_MAX+1.?++(clips),SOX_SAMPLE_MAX:SOX_SAMPLE_MAX:sox_macro_temp_double+.5)
+
+/**
+Client API:
+Converts SoX native sample to an unsigned 8-bit integer.
+@param d Input sample to be converted.
+@param clips Variable to increment if input sample is too large.
+*/
+#define SOX_SAMPLE_TO_UNSIGNED_8BIT(d,clips) SOX_SAMPLE_TO_UNSIGNED(8,d,clips)
+
+/**
+Client API:
+Converts SoX native sample to an signed 8-bit integer.
+@param d Input sample to be converted.
+@param clips Variable to increment if input sample is too large.
+*/
+#define SOX_SAMPLE_TO_SIGNED_8BIT(d,clips) SOX_SAMPLE_TO_SIGNED(8,d,clips)
+
+/**
+Client API:
+Converts SoX native sample to an unsigned 16-bit integer.
+@param d Input sample to be converted.
+@param clips Variable to increment if input sample is too large.
+*/
+#define SOX_SAMPLE_TO_UNSIGNED_16BIT(d,clips) SOX_SAMPLE_TO_UNSIGNED(16,d,clips)
+
+/**
+Client API:
+Converts SoX native sample to a signed 16-bit integer.
+@param d Input sample to be converted.
+@param clips Variable to increment if input sample is too large.
+*/
+#define SOX_SAMPLE_TO_SIGNED_16BIT(d,clips) SOX_SAMPLE_TO_SIGNED(16,d,clips)
+
+/**
+Client API:
+Converts SoX native sample to an unsigned 24-bit integer.
+@param d Input sample to be converted.
+@param clips Variable to increment if input sample is too large.
+*/
+#define SOX_SAMPLE_TO_UNSIGNED_24BIT(d,clips) SOX_SAMPLE_TO_UNSIGNED(24,d,clips)
+
+/**
+Client API:
+Converts SoX native sample to a signed 24-bit integer.
+@param d Input sample to be converted.
+@param clips Variable to increment if input sample is too large.
+*/
+#define SOX_SAMPLE_TO_SIGNED_24BIT(d,clips) SOX_SAMPLE_TO_SIGNED(24,d,clips)
+
+/**
+Client API:
+Converts SoX native sample to an unsigned 32-bit integer.
+@param d Input sample to be converted.
+@param clips The parameter is not used.
+*/
+#define SOX_SAMPLE_TO_UNSIGNED_32BIT(d,clips) (sox_uint32_t)((d)^SOX_SAMPLE_NEG)
+
+/**
+Client API:
+Converts SoX native sample to a signed 32-bit integer.
+@param d Input sample to be converted.
+@param clips The parameter is not used.
+*/
+#define SOX_SAMPLE_TO_SIGNED_32BIT(d,clips) (sox_int32_t)(d)
+
+/**
+Client API:
+Converts SoX native sample to a 32-bit float.
+@param d Input sample to be converted.
+@param clips Variable to increment if input sample is too large.
+*/
+#define SOX_SAMPLE_TO_FLOAT_32BIT(d,clips) (LSX_USE_VAR(sox_macro_temp_double),sox_macro_temp_sample=(d),sox_macro_temp_sample>SOX_SAMPLE_MAX-128?++(clips),1:(((sox_macro_temp_sample+128)&~255)*(1./(SOX_SAMPLE_MAX+1.))))
+
+/**
+Client API:
+Converts SoX native sample to a 64-bit float.
+@param d Input sample to be converted.
+@param clips The parameter is not used.
+*/
+#define SOX_SAMPLE_TO_FLOAT_64BIT(d,clips) ((d)*(1./(SOX_SAMPLE_MAX+1.)))
+
+/**
+Client API:
+Clips a value of a type that is larger then sox_sample_t (for example, int64)
+to sox_sample_t's limits and increment a counter if clipping occurs.
+@param samp Value (lvalue) to be clipped, updated as necessary.
+@param clips Value (lvalue) that is incremented if clipping is needed.
+*/
+#define SOX_SAMPLE_CLIP_COUNT(samp, clips) \
+  do { \
+    if (samp > SOX_SAMPLE_MAX) \
+      { samp = SOX_SAMPLE_MAX; clips++; } \
+    else if (samp < SOX_SAMPLE_MIN) \
+      { samp = SOX_SAMPLE_MIN; clips++; } \
+  } while (0)
+
+/**
+Client API:
+Clips a value of a type that is larger then sox_sample_t (for example, int64)
+to sox_sample_t's limits and increment a counter if clipping occurs.
+@param d Value (rvalue) to be clipped.
+@param clips Value (lvalue) that is incremented if clipping is needed.
+@returns Clipped value.
+*/
+#define SOX_ROUND_CLIP_COUNT(d, clips) \
+  ((d) < 0? (d) <= SOX_SAMPLE_MIN - 0.5? ++(clips), SOX_SAMPLE_MIN: (d) - 0.5 \
+        : (d) >= SOX_SAMPLE_MAX + 0.5? ++(clips), SOX_SAMPLE_MAX: (d) + 0.5)
+
+/**
+Client API:
+Clips a value to the limits of a signed integer of the specified width
+and increment a counter if clipping occurs.
+@param bits Width (in bits) of target integer type.
+@param i Value (rvalue) to be clipped.
+@param clips Value (lvalue) that is incremented if clipping is needed.
+@returns Clipped value.
+*/
+#define SOX_INTEGER_CLIP_COUNT(bits,i,clips) ( \
+  (i) >(1 << ((bits)-1))- 1? ++(clips),(1 << ((bits)-1))- 1 : \
+  (i) <-1 << ((bits)-1)    ? ++(clips),-1 << ((bits)-1) : (i))
+
+/**
+Client API:
+Clips a value to the limits of a 16-bit signed integer and increment a counter
+if clipping occurs.
+@param i Value (rvalue) to be clipped.
+@param clips Value (lvalue) that is incremented if clipping is needed.
+@returns Clipped value.
+*/
+#define SOX_16BIT_CLIP_COUNT(i,clips) SOX_INTEGER_CLIP_COUNT(16,i,clips)
+
+/**
+Client API:
+Clips a value to the limits of a 24-bit signed integer and increment a counter
+if clipping occurs.
+@param i Value (rvalue) to be clipped.
+@param clips Value (lvalue) that is incremented if clipping is needed.
+@returns Clipped value.
+*/
+#define SOX_24BIT_CLIP_COUNT(i,clips) SOX_INTEGER_CLIP_COUNT(24,i,clips)
+
+#define SOX_SIZE_MAX ((size_t)(-1)) /**< Client API: Maximum value of size_t. */
+
+#define SOX_UNSPEC 0                         /**< Client API: Members of sox_signalinfo_t are set to SOX_UNSPEC (= 0) if the actual value is not yet known. */
+#define SOX_UNKNOWN_LEN (sox_uint64_t)(-1) /**< Client API: sox_signalinfo_t.length is set to SOX_UNKNOWN_LEN (= -1) within the effects chain if the actual length is not known. Format handlers currently use SOX_UNSPEC instead. */
+#define SOX_IGNORE_LENGTH (sox_uint64_t)(-2) /**< Client API: sox_signalinfo_t.length is set to SOX_IGNORE_LENGTH (= -2) to indicate that a format handler should ignore length information in file headers. */
+
+#define SOX_DEFAULT_CHANNELS  2     /**< Client API: Default channel count is 2 (stereo). */
+#define SOX_DEFAULT_RATE      48000 /**< Client API: Default rate is 48000Hz. */
+#define SOX_DEFAULT_PRECISION 16    /**< Client API: Default precision is 16 bits per sample. */
+#define SOX_DEFAULT_ENCODING  SOX_ENCODING_SIGN2 /**< Client API: Default encoding is SIGN2 (linear 2's complement PCM). */
+
+#define SOX_LOOP_NONE          ((unsigned char)sox_loop_none)          /**< Client API: single-shot = 0 */
+#define SOX_LOOP_8             ((unsigned char)sox_loop_8)             /**< Client API: 8 loops = 32 */
+#define SOX_LOOP_SUSTAIN_DECAY ((unsigned char)sox_loop_sustain_decay) /**< Client API: AIFF style, one sustain & one decay loop = 64 */
+
+#define SOX_MAX_NLOOPS         8 /**< Client API: Maximum number of loops supported by sox_oob_t = 8. */
+
+#define SOX_FILE_NOSTDIO 0x0001 /**< Client API: Does not use stdio routines */
+#define SOX_FILE_DEVICE  0x0002 /**< Client API: File is an audio device */
+#define SOX_FILE_PHONY   0x0004 /**< Client API: Phony file/device (for example /dev/null) */
+#define SOX_FILE_REWIND  0x0008 /**< Client API: File should be rewound to write header */
+#define SOX_FILE_BIT_REV 0x0010 /**< Client API: Is file bit-reversed? */
+#define SOX_FILE_NIB_REV 0x0020 /**< Client API: Is file nibble-reversed? */
+#define SOX_FILE_ENDIAN  0x0040 /**< Client API: Is file format endian? */
+#define SOX_FILE_ENDBIG  0x0080 /**< Client API: For endian file format, is it big endian? */
+#define SOX_FILE_MONO    0x0100 /**< Client API: Do channel restrictions allow mono? */
+#define SOX_FILE_STEREO  0x0200 /**< Client API: Do channel restrictions allow stereo? */
+#define SOX_FILE_QUAD    0x0400 /**< Client API: Do channel restrictions allow quad? */
+
+#define SOX_FILE_CHANS   (SOX_FILE_MONO | SOX_FILE_STEREO | SOX_FILE_QUAD) /**< Client API: No channel restrictions */
+#define SOX_FILE_LIT_END (SOX_FILE_ENDIAN | 0)                             /**< Client API: File is little-endian */
+#define SOX_FILE_BIG_END (SOX_FILE_ENDIAN | SOX_FILE_ENDBIG)               /**< Client API: File is big-endian */
+
+#define SOX_EFF_CHAN     1           /**< Client API: Effect might alter the number of channels */
+#define SOX_EFF_RATE     2           /**< Client API: Effect might alter sample rate */
+#define SOX_EFF_PREC     4           /**< Client API: Effect does its own calculation of output sample precision (otherwise a default value is taken, depending on the presence of SOX_EFF_MODIFY) */
+#define SOX_EFF_LENGTH   8           /**< Client API: Effect might alter audio length (as measured in time units, not necessarily in samples) */
+#define SOX_EFF_MCHAN    16          /**< Client API: Effect handles multiple channels internally */
+#define SOX_EFF_NULL     32          /**< Client API: Effect does nothing (can be optimized out of chain) */
+#define SOX_EFF_DEPRECATED 64        /**< Client API: Effect will soon be removed from SoX */
+#define SOX_EFF_GAIN     128         /**< Client API: Effect does not support gain -r */
+#define SOX_EFF_MODIFY   256         /**< Client API: Effect does not modify sample values (but might remove or duplicate samples or insert zeros) */
+#define SOX_EFF_ALPHA    512         /**< Client API: Effect is experimental/incomplete */
+#define SOX_EFF_INTERNAL 1024        /**< Client API: Effect present in libSoX but not valid for use by SoX command-line tools */
+
+/**
+Client API:
+When used as the "whence" parameter of sox_seek, indicates that the specified
+offset is relative to the beginning of the file.
+*/
+#define SOX_SEEK_SET 0
+
+/*****************************************************************************
+Forward declarations:
+*****************************************************************************/
+
+typedef struct sox_format_t sox_format_t;
+typedef struct sox_effect_t sox_effect_t;
+typedef struct sox_effect_handler_t sox_effect_handler_t;
+typedef struct sox_format_handler_t sox_format_handler_t;
+
+/*****************************************************************************
+Function pointers:
+*****************************************************************************/
+
+/**
+Client API:
+Callback to write a message to an output device (console or log file),
+used by sox_globals_t.output_message_handler.
+*/
+typedef void (LSX_API * sox_output_message_handler_t)(
+    unsigned level,                       /* 1 = FAIL, 2 = WARN, 3 = INFO, 4 = DEBUG, 5 = DEBUG_MORE, 6 = DEBUG_MOST. */
+    LSX_PARAM_IN_Z char const * filename, /* Source code __FILENAME__ from which message originates. */
+    LSX_PARAM_IN_PRINTF char const * fmt, /* Message format string. */
+    LSX_PARAM_IN va_list ap               /* Message format parameters. */
+    );
+
+/**
+Client API:
+Callback to retrieve information about a format handler,
+used by sox_format_tab_t.fn.
+@returns format handler information.
+*/
+typedef sox_format_handler_t const * (LSX_API * sox_format_fn_t)(void);
+
+/**
+Client API:
+Callback to get information about an effect handler,
+used by the table returned from sox_get_effect_fns(void).
+@returns Pointer to information about an effect handler.
+*/
+typedef sox_effect_handler_t const * (LSX_API *sox_effect_fn_t)(void);
+
+/**
+Client API:
+Callback to initialize reader (decoder), used by
+sox_format_handler.startread.
+@returns SOX_SUCCESS if successful.
+*/
+typedef int (LSX_API * sox_format_handler_startread)(
+    LSX_PARAM_INOUT sox_format_t * ft /**< Format pointer. */
+    );
+
+/**
+Client API:
+Callback to read (decode) a block of samples,
+used by sox_format_handler.read.
+@returns number of samples read, or 0 if unsuccessful.
+*/
+typedef size_t (LSX_API * sox_format_handler_read)(
+    LSX_PARAM_INOUT sox_format_t * ft, /**< Format pointer. */
+    LSX_PARAM_OUT_CAP_POST_COUNT(len,return) sox_sample_t *buf, /**< Buffer from which to read samples. */
+    size_t len /**< Number of samples available in buf. */
+    );
+
+/**
+Client API:
+Callback to close reader (decoder),
+used by sox_format_handler.stopread.
+@returns SOX_SUCCESS if successful.
+*/
+typedef int (LSX_API * sox_format_handler_stopread)(
+    LSX_PARAM_INOUT sox_format_t * ft /**< Format pointer. */
+    );
+
+/**
+Client API:
+Callback to initialize writer (encoder),
+used by sox_format_handler.startwrite.
+@returns SOX_SUCCESS if successful.
+*/
+typedef int (LSX_API * sox_format_handler_startwrite)(
+    LSX_PARAM_INOUT sox_format_t * ft /**< Format pointer. */
+    );
+
+/**
+Client API:
+Callback to write (encode) a block of samples,
+used by sox_format_handler.write.
+@returns number of samples written, or 0 if unsuccessful.
+*/
+typedef size_t (LSX_API * sox_format_handler_write)(
+    LSX_PARAM_INOUT sox_format_t * ft, /**< Format pointer. */
+    LSX_PARAM_IN_COUNT(len) sox_sample_t const * buf, /**< Buffer to which samples are written. */
+    size_t len /**< Capacity of buf, measured in samples. */
+    );
+
+/**
+Client API:
+Callback to close writer (decoder),
+used by sox_format_handler.stopwrite.
+@returns SOX_SUCCESS if successful.
+*/
+typedef int (LSX_API * sox_format_handler_stopwrite)(
+    LSX_PARAM_INOUT sox_format_t * ft /**< Format pointer. */
+    );
+
+/**
+Client API:
+Callback to reposition reader,
+used by sox_format_handler.seek.
+@returns SOX_SUCCESS if successful.
+*/
+typedef int (LSX_API * sox_format_handler_seek)(
+    LSX_PARAM_INOUT sox_format_t * ft, /**< Format pointer. */
+    sox_uint64_t offset /**< Sample offset to which reader should be positioned. */
+    );
+
+/**
+Client API:
+Callback to parse command-line arguments (called once per effect),
+used by sox_effect_handler.getopts.
+@returns SOX_SUCCESS if successful.
+*/
+typedef int (LSX_API * sox_effect_handler_getopts)(
+    LSX_PARAM_INOUT sox_effect_t * effp, /**< Effect pointer. */
+    int argc, /**< Number of arguments in argv. */
+    LSX_PARAM_IN_COUNT(argc) char *argv[] /**< Array of command-line arguments. */
+    );
+
+/**
+Client API:
+Callback to initialize effect (called once per flow),
+used by sox_effect_handler.start.
+@returns SOX_SUCCESS if successful.
+*/
+typedef int (LSX_API * sox_effect_handler_start)(
+    LSX_PARAM_INOUT sox_effect_t * effp /**< Effect pointer. */
+    );
+
+/**
+Client API:
+Callback to process samples,
+used by sox_effect_handler.flow.
+@returns SOX_SUCCESS if successful.
+*/
+typedef int (LSX_API * sox_effect_handler_flow)(
+    LSX_PARAM_INOUT sox_effect_t * effp, /**< Effect pointer. */
+    LSX_PARAM_IN_COUNT(*isamp) sox_sample_t const * ibuf, /**< Buffer from which to read samples. */
+    LSX_PARAM_OUT_CAP_POST_COUNT(*osamp,*osamp) sox_sample_t * obuf, /**< Buffer to which samples are written. */
+    LSX_PARAM_INOUT size_t *isamp, /**< On entry, contains capacity of ibuf; on exit, contains number of samples consumed. */
+    LSX_PARAM_INOUT size_t *osamp /**< On entry, contains capacity of obuf; on exit, contains number of samples written. */
+    );
+
+/**
+Client API:
+Callback to finish getting output after input is complete,
+used by sox_effect_handler.drain.
+@returns SOX_SUCCESS if successful.
+*/
+typedef int (LSX_API * sox_effect_handler_drain)(
+    LSX_PARAM_INOUT sox_effect_t * effp, /**< Effect pointer. */
+    LSX_PARAM_OUT_CAP_POST_COUNT(*osamp,*osamp) sox_sample_t *obuf, /**< Buffer to which samples are written. */
+    LSX_PARAM_INOUT size_t *osamp /**< On entry, contains capacity of obuf; on exit, contains number of samples written. */
+    );
+
+/**
+Client API:
+Callback to shut down effect (called once per flow),
+used by sox_effect_handler.stop.
+@returns SOX_SUCCESS if successful.
+*/
+typedef int (LSX_API * sox_effect_handler_stop)(
+    LSX_PARAM_INOUT sox_effect_t * effp /**< Effect pointer. */
+    );
+
+/**
+Client API:
+Callback to shut down effect (called once per effect),
+used by sox_effect_handler.kill.
+@returns SOX_SUCCESS if successful.
+*/
+typedef int (LSX_API * sox_effect_handler_kill)(
+    LSX_PARAM_INOUT sox_effect_t * effp /**< Effect pointer. */
+    );
+
+/**
+Client API:
+Callback called while flow is running (called once per buffer),
+used by sox_flow_effects.callback.
+@returns SOX_SUCCESS to continue, other value to abort flow.
+*/
+typedef int (LSX_API * sox_flow_effects_callback)(
+    sox_bool all_done,
+    void * client_data
+    );
+
+/**
+Client API:
+Callback for enumerating the contents of a playlist,
+used by the sox_parse_playlist function.
+@returns SOX_SUCCESS if successful, any other value to abort playlist enumeration.
+*/
+typedef int (LSX_API * sox_playlist_callback_t)(
+    void * callback_data,
+    LSX_PARAM_IN_Z char const * filename
+    );
+
+/*****************************************************************************
+Structures:
+*****************************************************************************/
+
+/**
+Client API:
+Information about a build of libSoX, returned from the sox_version_info
+function.
+*/
+typedef struct sox_version_info_t {
+    size_t       size;         /**< structure size = sizeof(sox_version_info_t) */
+    sox_version_flags_t flags; /**< feature flags = popen | magic | threads | memopen */
+    sox_uint32_t version_code; /**< version number = 0x140400 */
+    char const * version;      /**< version string = sox_version(), for example, "14.4.0" */
+    char const * version_extra;/**< version extra info or null = "PACKAGE_EXTRA", for example, "beta" */
+    char const * time;         /**< build time = "__DATE__ __TIME__", for example, "Jan  7 2010 03:31:50" */
+    char const * distro;       /**< distro or null = "DISTRO", for example, "Debian" */
+    char const * compiler;     /**< compiler info or null, for example, "msvc 160040219" */
+    char const * arch;         /**< arch, for example, "1248 48 44 L OMP" */
+    /* new info should be added at the end for version backwards-compatibility. */
+} sox_version_info_t;
+
+/**
+Client API:
+Global parameters (for effects & formats), returned from the sox_get_globals
+function.
+*/
+typedef struct sox_globals_t {
+/* public: */
+  unsigned     verbosity; /**< messages are only written if globals.verbosity >= message.level */
+  sox_output_message_handler_t output_message_handler; /**< client-specified message output callback */
+  sox_bool     repeatable; /**< true to use pre-determined timestamps and PRNG seed */
+
+  /**
+  Default size (in bytes) used by libSoX for blocks of sample data.
+  Plugins should use similarly-sized buffers to get best performance.
+  */
+  size_t       bufsiz;
+
+  /**
+  Default size (in bytes) used by libSoX for blocks of input sample data.
+  Plugins should use similarly-sized buffers to get best performance.
+  */
+  size_t       input_bufsiz;
+
+  sox_int32_t  ranqd1; /**< Can be used to re-seed libSoX's PRNG */
+
+  char const * stdin_in_use_by;  /**< Private: tracks the name of the handler currently using stdin */
+  char const * stdout_in_use_by; /**< Private: tracks the name of the handler currently using stdout */
+  char const * subsystem;        /**< Private: tracks the name of the handler currently writing an output message */
+  char       * tmp_path;         /**< Private: client-configured path to use for temporary files */
+  sox_bool     use_magic;        /**< Private: true if client has requested use of 'magic' file-type detection */
+  sox_bool     use_threads;      /**< Private: true if client has requested parallel effects processing */
+} sox_globals_t;
+
+/**
+Client API:
+Signal parameters; members should be set to SOX_UNSPEC (= 0) if unknown.
+*/
+typedef struct sox_signalinfo_t {
+  sox_rate_t       rate;         /**< samples per second, 0 if unknown */
+  unsigned         channels;     /**< number of sound channels, 0 if unknown */
+  unsigned         precision;    /**< bits per sample, 0 if unknown */
+  sox_uint64_t     length;       /**< samples * chans in file, 0 if unknown, -1 if unspecified */
+  double           * mult;       /**< Effects headroom multiplier; may be null */
+} sox_signalinfo_t;
+
+/**
+Client API:
+Basic information about an encoding.
+*/
+typedef struct sox_encodings_info_t {
+  sox_encodings_flags_t flags; /**< lossy once (lossy1), lossy twice (lossy2), or lossless (none). */
+  char const * name;           /**< encoding name. */
+  char const * desc;           /**< encoding description. */
+} sox_encodings_info_t;
+
+/**
+Client API:
+Encoding parameters.
+*/
+typedef struct sox_encodinginfo_t {
+  sox_encoding_t encoding; /**< format of sample numbers */
+  unsigned bits_per_sample;/**< 0 if unknown or variable; uncompressed value if lossless; compressed value if lossy */
+  double compression;      /**< compression factor (where applicable) */
+
+  /**
+  Should bytes be reversed? If this is default during sox_open_read or
+  sox_open_write, libSoX will set them to either no or yes according to the
+  machine or format default.
+  */
+  sox_option_t reverse_bytes;
+
+  /**
+  Should nibbles be reversed? If this is default during sox_open_read or
+  sox_open_write, libSoX will set them to either no or yes according to the
+  machine or format default.
+  */
+  sox_option_t reverse_nibbles;
+
+  /**
+  Should bits be reversed? If this is default during sox_open_read or
+  sox_open_write, libSoX will set them to either no or yes according to the
+  machine or format default.
+  */
+  sox_option_t reverse_bits;
+
+  /**
+  If set to true, the format should reverse its default endianness.
+  */
+  sox_bool opposite_endian;
+} sox_encodinginfo_t;
+
+/**
+Client API:
+Looping parameters (out-of-band data).
+*/
+typedef struct sox_loopinfo_t {
+  sox_uint64_t  start;  /**< first sample */
+  sox_uint64_t  length; /**< length */
+  unsigned      count;  /**< number of repeats, 0=forever */
+  unsigned char type;   /**< 0=no, 1=forward, 2=forward/back (see sox_loop_* for valid values). */
+} sox_loopinfo_t;
+
+/**
+Client API:
+Instrument information.
+*/
+typedef struct sox_instrinfo_t{
+  signed char MIDInote;   /**< for unity pitch playback */
+  signed char MIDIlow;    /**< MIDI pitch-bend low range */
+  signed char MIDIhi;     /**< MIDI pitch-bend high range */
+  unsigned char loopmode; /**< 0=no, 1=forward, 2=forward/back (see sox_loop_* values) */
+  unsigned nloops;  /**< number of active loops (max SOX_MAX_NLOOPS). */
+} sox_instrinfo_t;
+
+/**
+Client API:
+File buffer info.  Holds info so that data can be read in blocks.
+*/
+typedef struct sox_fileinfo_t {
+  char          *buf;                 /**< Pointer to data buffer */
+  size_t        size;                 /**< Size of buffer in bytes */
+  size_t        count;                /**< Count read into buffer */
+  size_t        pos;                  /**< Position in buffer */
+} sox_fileinfo_t;
+
+/**
+Client API:
+Handler structure defined by each format.
+*/
+struct sox_format_handler_t {
+  unsigned     sox_lib_version_code;  /**< Checked on load; must be 1st in struct*/
+  char         const * description;   /**< short description of format */
+  char         const * const * names; /**< null-terminated array of filename extensions that are handled by this format */
+  unsigned int flags;                 /**< File flags (SOX_FILE_* values). */
+  sox_format_handler_startread startread; /**< called to initialize reader (decoder) */
+  sox_format_handler_read read;       /**< called to read (decode) a block of samples */
+  sox_format_handler_stopread stopread; /**< called to close reader (decoder); may be null if no closing necessary */
+  sox_format_handler_startwrite startwrite; /**< called to initialize writer (encoder) */
+  sox_format_handler_write write;     /**< called to write (encode) a block of samples */
+  sox_format_handler_stopwrite stopwrite; /**< called to close writer (decoder); may be null if no closing necessary */
+  sox_format_handler_seek seek;       /**< called to reposition reader; may be null if not supported */
+
+  /**
+  Array of values indicating the encodings and precisions supported for
+  writing (encoding). Precisions specified with default precision first.
+  Encoding, precision, precision, ..., 0, repeat. End with one more 0.
+  Example:
+  unsigned const * formats = {
+    SOX_ENCODING_SIGN2, 16, 24, 0, // Support SIGN2 at 16 and 24 bits, default to 16 bits.
+    SOX_ENCODING_UNSIGNED, 8, 0,   // Support UNSIGNED at 8 bits, default to 8 bits.
+    0 // No more supported encodings.
+  };
+  */
+  unsigned     const * write_formats;
+
+  /**
+  Array of sample rates (samples per second) supported for writing (encoding).
+  NULL if all (or almost all) rates are supported. End with 0.
+  */
+  sox_rate_t   const * write_rates;
+
+  /**
+  SoX will automatically allocate a buffer in which the handler can store data.
+  Specify the size of the buffer needed here. Usually this will be sizeof(your_struct).
+  The buffer will be allocated and zeroed before the call to startread/startwrite.
+  The buffer will be freed after the call to stopread/stopwrite.
+  The buffer will be provided via format.priv in each call to the handler.
+  */
+  size_t       priv_size;
+};
+
+/**
+Client API:
+Comments, instrument info, loop info (out-of-band data).
+*/
+typedef struct sox_oob_t{
+  /* Decoded: */
+  sox_comments_t   comments;              /**< Comment strings in id=value format. */
+  sox_instrinfo_t  instr;                 /**< Instrument specification */
+  sox_loopinfo_t   loops[SOX_MAX_NLOOPS]; /**< Looping specification */
+
+  /* TBD: Non-decoded chunks, etc: */
+} sox_oob_t;
+
+/**
+Client API:
+Data passed to/from the format handler
+*/
+struct sox_format_t {
+  char             * filename;      /**< File name */
+
+  /**
+  Signal specifications for reader (decoder) or writer (encoder):
+  sample rate, number of channels, precision, length, headroom multiplier.
+  Any info specified by the user is here on entry to startread or
+  startwrite. Info will be SOX_UNSPEC if the user provided no info.
+  At exit from startread, should be completely filled in, using
+  either data from the file's headers (if available) or whatever
+  the format is guessing/assuming (if header data is not available).
+  At exit from startwrite, should be completely filled in, using
+  either the data that was specified, or values chosen by the format
+  based on the format's defaults or capabilities.
+  */
+  sox_signalinfo_t signal;
+
+  /**
+  Encoding specifications for reader (decoder) or writer (encoder):
+  encoding (sample format), bits per sample, compression rate, endianness.
+  Should be filled in by startread. Values specified should be used
+  by startwrite when it is configuring the encoding parameters.
+  */
+  sox_encodinginfo_t encoding;
+
+  char             * filetype;      /**< Type of file, as determined by header inspection or libmagic. */
+  sox_oob_t        oob;             /**< comments, instrument info, loop info (out-of-band data) */
+  sox_bool         seekable;        /**< Can seek on this file */
+  char             mode;            /**< Read or write mode ('r' or 'w') */
+  sox_uint64_t     olength;         /**< Samples * chans written to file */
+  sox_uint64_t     clips;           /**< Incremented if clipping occurs */
+  int              sox_errno;       /**< Failure error code */
+  char             sox_errstr[256]; /**< Failure error text */
+  void             * fp;            /**< File stream pointer */
+  lsx_io_type      io_type;         /**< Stores whether this is a file, pipe or URL */
+  sox_uint64_t     tell_off;        /**< Current offset within file */
+  sox_uint64_t     data_start;      /**< Offset at which headers end and sound data begins (set by lsx_check_read_params) */
+  sox_format_handler_t handler;     /**< Format handler for this file */
+  void             * priv;          /**< Format handler's private data area */
+};
+
+/**
+Client API:
+Information about a loaded format handler, including the format name and a
+function pointer that can be invoked to get additional information about the
+format.
+*/
+typedef struct sox_format_tab_t {
+  char *name;         /**< Name of format handler */
+  sox_format_fn_t fn; /**< Function to call to get format handler's information */
+} sox_format_tab_t;
+
+/**
+Client API:
+Global parameters for effects.
+*/
+typedef struct sox_effects_globals_t {
+  sox_plot_t plot;         /**< To help the user choose effect & options */
+  sox_globals_t * global_info; /**< Pointer to associated SoX globals */
+} sox_effects_globals_t;
+
+/**
+Client API:
+Effect handler information.
+*/
+struct sox_effect_handler_t {
+  char const * name;  /**< Effect name */
+  char const * usage; /**< Short explanation of parameters accepted by effect */
+  unsigned int flags; /**< Combination of SOX_EFF_* flags */
+  sox_effect_handler_getopts getopts; /**< Called to parse command-line arguments (called once per effect). */
+  sox_effect_handler_start start;     /**< Called to initialize effect (called once per flow). */
+  sox_effect_handler_flow flow;       /**< Called to process samples. */
+  sox_effect_handler_drain drain;     /**< Called to finish getting output after input is complete. */
+  sox_effect_handler_stop stop;       /**< Called to shut down effect (called once per flow). */
+  sox_effect_handler_kill kill;       /**< Called to shut down effect (called once per effect). */
+  size_t       priv_size;             /**< Size of private data SoX should pre-allocate for effect */
+};
+
+/**
+Client API:
+Effect information.
+*/
+struct sox_effect_t {
+  sox_effects_globals_t    * global_info; /**< global effect parameters */
+  sox_signalinfo_t         in_signal;     /**< Information about the incoming data stream */
+  sox_signalinfo_t         out_signal;    /**< Information about the outgoing data stream */
+  sox_encodinginfo_t       const * in_encoding;  /**< Information about the incoming data encoding */
+  sox_encodinginfo_t       const * out_encoding; /**< Information about the outgoing data encoding */
+  sox_effect_handler_t     handler;   /**< The handler for this effect */
+  sox_sample_t             * obuf;    /**< output buffer */
+  size_t                   obeg;      /**< output buffer: start of valid data section */
+  size_t                   oend;      /**< output buffer: one past valid data section (oend-obeg is length of current content) */
+  size_t               imin;          /**< minimum input buffer content required for calling this effect's flow function; set via lsx_effect_set_imin() */
+  sox_uint64_t         clips;         /**< increment if clipping occurs */
+  size_t               flows;         /**< 1 if MCHAN, number of chans otherwise */
+  size_t               flow;          /**< flow number */
+  void                 * priv;        /**< Effect's private data area (each flow has a separate copy) */
+};
+
+/**
+Client API:
+Chain of effects to be applied to a stream.
+*/
+typedef struct sox_effects_chain_t {
+  sox_effect_t **effects;                  /**< Table of effects to be applied to a stream */
+  unsigned table_size;                     /**< Number of entries in effects table */
+  unsigned length;                         /**< Number of effects to be applied */
+  sox_sample_t **ibufc;                    /**< Channel interleave buffer */
+  sox_sample_t **obufc;                    /**< Channel interleave buffer */
+  sox_effects_globals_t global_info;       /**< Copy of global effects settings */
+  sox_encodinginfo_t const * in_enc;       /**< Input encoding */
+  sox_encodinginfo_t const * out_enc;      /**< Output encoding */
+} sox_effects_chain_t;
+
+/*****************************************************************************
+Functions:
+*****************************************************************************/
+
+/**
+Client API:
+Returns version number string of libSoX, for example, "14.4.0".
+@returns The version number string of libSoX, for example, "14.4.0".
+*/
+LSX_RETURN_VALID_Z LSX_RETURN_PURE
+char const *
+LSX_API
+sox_version(void);
+
+/**
+Client API:
+Returns information about this build of libsox.
+@returns Pointer to a version information structure.
+*/
+LSX_RETURN_VALID LSX_RETURN_PURE
+sox_version_info_t const *
+LSX_API
+sox_version_info(void);
+
+/**
+Client API:
+Returns a pointer to the structure with libSoX's global settings.
+@returns a pointer to the structure with libSoX's global settings.
+*/
+LSX_RETURN_VALID LSX_RETURN_PURE
+sox_globals_t *
+LSX_API
+sox_get_globals(void);
+
+/**
+Client API:
+Deprecated macro that returns the structure with libSoX's global settings
+as an lvalue.
+*/
+#define sox_globals (*sox_get_globals())
+
+/**
+Client API:
+Returns a pointer to the list of available encodings.
+End of list indicated by name == NULL.
+@returns pointer to the list of available encodings.
+*/
+LSX_RETURN_ARRAY LSX_RETURN_PURE
+sox_encodings_info_t const *
+LSX_API
+sox_get_encodings_info(void);
+
+/**
+Client API:
+Deprecated macro that returns the list of available encodings.
+End of list indicated by name == NULL.
+*/
+#define sox_encodings_info (sox_get_encodings_info())
+
+/**
+Client API:
+Fills in an encodinginfo with default values.
+*/
+void
+LSX_API
+sox_init_encodinginfo(
+    LSX_PARAM_OUT sox_encodinginfo_t * e /**< Pointer to uninitialized encoding info structure to be initialized. */
+    );
+
+/**
+Client API:
+Given an encoding (for example, SIGN2) and the encoded bits_per_sample (for
+example, 16), returns the number of useful bits per sample in the decoded data
+(for example, 16), or returns 0 to indicate that the value returned by the
+format handler should be used instead of a pre-determined precision.
+@returns the number of useful bits per sample in the decoded data (for example
+16), or returns 0 to indicate that the value returned by the format handler
+should be used instead of a pre-determined precision.
+*/
+LSX_RETURN_PURE
+unsigned
+LSX_API
+sox_precision(
+    sox_encoding_t encoding,   /**< Encoding for which to lookup precision information. */
+    unsigned bits_per_sample   /**< The number of encoded bits per sample. */
+    );
+
+/**
+Client API:
+Returns the number of items in the metadata block.
+@returns the number of items in the metadata block.
+*/
+size_t
+LSX_API
+sox_num_comments(
+    LSX_PARAM_IN_OPT sox_comments_t comments /**< Metadata block. */
+    );
+
+/**
+Client API:
+Adds an "id=value" item to the metadata block.
+*/
+void
+LSX_API
+sox_append_comment(
+    LSX_PARAM_DEREF_PRE_MAYBENULL LSX_PARAM_DEREF_POST_NOTNULL sox_comments_t * comments, /**< Metadata block. */
+    LSX_PARAM_IN_Z char const * item /**< Item to be added in "id=value" format. */
+    );
+
+/**
+Client API:
+Adds a newline-delimited list of "id=value" items to the metadata block.
+*/
+void
+LSX_API
+sox_append_comments(
+    LSX_PARAM_DEREF_PRE_MAYBENULL LSX_PARAM_DEREF_POST_NOTNULL sox_comments_t * comments, /**< Metadata block. */
+    LSX_PARAM_IN_Z char const * items /**< Newline-separated list of items to be added, for example "id1=value1\\nid2=value2". */
+    );
+
+/**
+Client API:
+Duplicates the metadata block.
+@returns the copied metadata block.
+*/
+LSX_RETURN_OPT
+sox_comments_t
+LSX_API
+sox_copy_comments(
+    LSX_PARAM_IN_OPT sox_comments_t comments /**< Metadata block to copy. */
+    );
+
+/**
+Client API:
+Frees the metadata block.
+*/
+void
+LSX_API
+sox_delete_comments(
+    LSX_PARAM_DEREF_PRE_MAYBENULL LSX_PARAM_DEREF_POST_NULL sox_comments_t * comments /**< Metadata block. */
+    );
+
+/**
+Client API:
+If "id=value" is found, return value, else return null.
+@returns value, or null if value not found.
+*/
+LSX_RETURN_OPT
+char const *
+LSX_API
+sox_find_comment(
+    LSX_PARAM_IN_OPT sox_comments_t comments, /**< Metadata block in which to search. */
+    LSX_PARAM_IN_Z char const * id /**< Id for which to search */
+    );
+
+/**
+Client API:
+Find and load format handler plugins.
+@returns SOX_SUCCESS if successful.
+*/
+int
+LSX_API
+sox_format_init(void);
+
+/**
+Client API:
+Unload format handler plugins.
+*/
+void
+LSX_API
+sox_format_quit(void);
+
+/**
+Client API:
+Initialize effects library.
+@returns SOX_SUCCESS if successful.
+*/
+int
+LSX_API
+sox_init(void);
+
+/**
+Client API:
+Close effects library and unload format handler plugins.
+@returns SOX_SUCCESS if successful.
+*/
+int
+LSX_API
+sox_quit(void);
+
+/**
+Client API:
+Returns the table of format handler names and functions.
+@returns the table of format handler names and functions.
+*/
+LSX_RETURN_ARRAY LSX_RETURN_PURE
+sox_format_tab_t const *
+LSX_API
+sox_get_format_fns(void);
+
+/**
+Client API:
+Deprecated macro that returns the table of format handler names and functions.
+*/
+#define sox_format_fns (sox_get_format_fns())
+
+/**
+Client API:
+Opens a decoding session for a file. Returned handle must be closed with sox_close().
+@returns The handle for the new session, or null on failure.
+*/
+LSX_RETURN_OPT
+sox_format_t *
+LSX_API
+sox_open_read(
+    LSX_PARAM_IN_Z   char               const * path,      /**< Path to file to be opened (required). */
+    LSX_PARAM_IN_OPT sox_signalinfo_t   const * signal,    /**< Information already known about audio stream, or NULL if none. */
+    LSX_PARAM_IN_OPT sox_encodinginfo_t const * encoding,  /**< Information already known about sample encoding, or NULL if none. */
+    LSX_PARAM_IN_OPT_Z char             const * filetype   /**< Previously-determined file type, or NULL to auto-detect. */
+    );
+
+/**
+Client API:
+Opens a decoding session for a memory buffer. Returned handle must be closed with sox_close().
+@returns The handle for the new session, or null on failure.
+*/
+LSX_RETURN_OPT
+sox_format_t *
+LSX_API
+sox_open_mem_read(
+    LSX_PARAM_IN_BYTECOUNT(buffer_size) void  * buffer,     /**< Pointer to audio data buffer (required). */
+    size_t                                      buffer_size,/**< Number of bytes to read from audio data buffer. */
+    LSX_PARAM_IN_OPT sox_signalinfo_t   const * signal,     /**< Information already known about audio stream, or NULL if none. */
+    LSX_PARAM_IN_OPT sox_encodinginfo_t const * encoding,   /**< Information already known about sample encoding, or NULL if none. */
+    LSX_PARAM_IN_OPT_Z char             const * filetype    /**< Previously-determined file type, or NULL to auto-detect. */
+    );
+
+/**
+Client API:
+Returns true if the format handler for the specified file type supports the specified encoding.
+@returns true if the format handler for the specified file type supports the specified encoding.
+*/
+sox_bool
+LSX_API
+sox_format_supports_encoding(
+    LSX_PARAM_IN_OPT_Z char               const * path,       /**< Path to file to be examined (required if filetype is NULL). */
+    LSX_PARAM_IN_OPT_Z char               const * filetype,   /**< Previously-determined file type, or NULL to use extension from path. */
+    LSX_PARAM_IN       sox_encodinginfo_t const * encoding    /**< Encoding for which format handler should be queried. */
+    );
+
+/**
+Client API:
+Gets the format handler for a specified file type.
+@returns The found format handler, or null if not found.
+*/
+LSX_RETURN_OPT
+sox_format_handler_t const *
+LSX_API
+sox_write_handler(
+    LSX_PARAM_IN_OPT_Z char               const * path,         /**< Path to file (required if filetype is NULL). */
+    LSX_PARAM_IN_OPT_Z char               const * filetype,     /**< Filetype for which handler is needed, or NULL to use extension from path. */
+    LSX_PARAM_OUT_OPT  char               const * * filetype1   /**< Receives the filetype that was detected. Pass NULL if not needed. */
+    );
+
+/**
+Client API:
+Opens an encoding session for a file. Returned handle must be closed with sox_close().
+@returns The new session handle, or null on failure.
+*/
+LSX_RETURN_OPT
+sox_format_t *
+LSX_API
+sox_open_write(
+    LSX_PARAM_IN_Z     char               const * path,     /**< Path to file to be written (required). */
+    LSX_PARAM_IN       sox_signalinfo_t   const * signal,   /**< Information about desired audio stream (required). */
+    LSX_PARAM_IN_OPT   sox_encodinginfo_t const * encoding, /**< Information about desired sample encoding, or NULL to use defaults. */
+    LSX_PARAM_IN_OPT_Z char               const * filetype, /**< Previously-determined file type, or NULL to auto-detect. */
+    LSX_PARAM_IN_OPT   sox_oob_t          const * oob,      /**< Out-of-band data to add to file, or NULL if none. */
+    LSX_PARAM_IN_OPT   sox_bool           (LSX_API * overwrite_permitted)(LSX_PARAM_IN_Z char const * filename) /**< Called if file exists to determine whether overwrite is ok. */
+    );
+
+/**
+Client API:
+Opens an encoding session for a memory buffer. Returned handle must be closed with sox_close().
+@returns The new session handle, or null on failure.
+*/
+LSX_RETURN_OPT
+sox_format_t *
+LSX_API
+sox_open_mem_write(
+    LSX_PARAM_OUT_BYTECAP(buffer_size) void                     * buffer,      /**< Pointer to audio data buffer that receives data (required). */
+    LSX_PARAM_IN                       size_t                     buffer_size, /**< Maximum number of bytes to write to audio data buffer. */
+    LSX_PARAM_IN                       sox_signalinfo_t   const * signal,      /**< Information about desired audio stream (required). */
+    LSX_PARAM_IN_OPT                   sox_encodinginfo_t const * encoding,    /**< Information about desired sample encoding, or NULL to use defaults. */
+    LSX_PARAM_IN_OPT_Z                 char               const * filetype,    /**< Previously-determined file type, or NULL to auto-detect. */
+    LSX_PARAM_IN_OPT                   sox_oob_t          const * oob          /**< Out-of-band data to add to file, or NULL if none. */
+    );
+
+/**
+Client API:
+Opens an encoding session for a memstream buffer. Returned handle must be closed with sox_close().
+@returns The new session handle, or null on failure.
+*/
+LSX_RETURN_OPT
+sox_format_t *
+LSX_API
+sox_open_memstream_write(
+    LSX_PARAM_OUT      char                     * * buffer_ptr,    /**< Receives pointer to audio data buffer that receives data (required). */
+    LSX_PARAM_OUT      size_t                   * buffer_size_ptr, /**< Receives size of data written to audio data buffer (required). */
+    LSX_PARAM_IN       sox_signalinfo_t   const * signal,          /**< Information about desired audio stream (required). */
+    LSX_PARAM_IN_OPT   sox_encodinginfo_t const * encoding,        /**< Information about desired sample encoding, or NULL to use defaults. */
+    LSX_PARAM_IN_OPT_Z char               const * filetype,        /**< Previously-determined file type, or NULL to auto-detect. */
+    LSX_PARAM_IN_OPT   sox_oob_t          const * oob              /**< Out-of-band data to add to file, or NULL if none. */
+    );
+
+/**
+Client API:
+Reads samples from a decoding session into a sample buffer.
+@returns Number of samples decoded, or 0 for EOF.
+*/
+size_t
+LSX_API
+sox_read(
+    LSX_PARAM_INOUT sox_format_t * ft, /**< Format pointer. */
+    LSX_PARAM_OUT_CAP_POST_COUNT(len,return) sox_sample_t *buf, /**< Buffer from which to read samples. */
+    size_t len /**< Number of samples available in buf. */
+    );
+
+/**
+Client API:
+Writes samples to an encoding session from a sample buffer.
+@returns Number of samples encoded.
+*/
+size_t
+LSX_API
+sox_write(
+    LSX_PARAM_INOUT sox_format_t * ft, /**< Format pointer. */
+    LSX_PARAM_IN_COUNT(len) sox_sample_t const * buf, /**< Buffer from which to read samples. */
+    size_t len /**< Number of samples available in buf. */
+    );
+
+/**
+Client API:
+Closes an encoding or decoding session.
+@returns SOX_SUCCESS if successful.
+*/
+int
+LSX_API
+sox_close(
+    LSX_PARAM_INOUT sox_format_t * ft /**< Format pointer. */
+    );
+
+/**
+Client API:
+Sets the location at which next samples will be decoded. Returns SOX_SUCCESS if successful.
+@returns SOX_SUCCESS if successful.
+*/
+int
+LSX_API
+sox_seek(
+    LSX_PARAM_INOUT sox_format_t * ft, /**< Format pointer. */
+    sox_uint64_t offset, /**< Sample offset at which to position reader. */
+    int whence /**< Set to SOX_SEEK_SET. */
+    );
+
+/**
+Client API:
+Finds a format handler by name.
+@returns Format handler data, or null if not found.
+*/
+LSX_RETURN_OPT
+sox_format_handler_t const *
+LSX_API
+sox_find_format(
+    LSX_PARAM_IN_Z char const * name, /**< Name of format handler to find. */
+    sox_bool ignore_devices /**< Set to true to ignore device names. */
+    );
+
+/**
+Client API:
+Returns global parameters for effects
+@returns global parameters for effects.
+*/
+LSX_RETURN_VALID LSX_RETURN_PURE
+sox_effects_globals_t *
+LSX_API
+sox_get_effects_globals(void);
+
+/**
+Client API:
+Deprecated macro that returns global parameters for effects.
+*/
+#define sox_effects_globals (*sox_get_effects_globals())
+
+/**
+Client API:
+Finds the effect handler with the given name.
+@returns Effect pointer, or null if not found.
+*/
+LSX_RETURN_OPT LSX_RETURN_PURE
+sox_effect_handler_t const *
+LSX_API
+sox_find_effect(
+    LSX_PARAM_IN_Z char const * name /**< Name of effect to find. */
+    );
+
+/**
+Client API:
+Creates an effect using the given handler.
+@returns The new effect, or null if not found.
+*/
+LSX_RETURN_OPT
+sox_effect_t *
+LSX_API
+sox_create_effect(
+    LSX_PARAM_IN sox_effect_handler_t const * eh /**< Handler to use for effect. */
+    );
+
+/**
+Client API:
+Applies the command-line options to the effect.
+@returns the number of arguments consumed.
+*/
+int
+LSX_API
+sox_effect_options(
+    LSX_PARAM_IN sox_effect_t *effp, /**< Effect pointer on which to set options. */
+    int argc, /**< Number of arguments in argv. */
+    LSX_PARAM_IN_COUNT(argc) char * const argv[] /**< Array of command-line options. */
+    );
+
+/**
+Client API:
+Returns an array containing the known effect handlers.
+@returns An array containing the known effect handlers.
+*/
+LSX_RETURN_VALID_Z LSX_RETURN_PURE
+sox_effect_fn_t const *
+LSX_API
+sox_get_effect_fns(void);
+
+/**
+Client API:
+Deprecated macro that returns an array containing the known effect handlers.
+*/
+#define sox_effect_fns (sox_get_effect_fns())
+
+/**
+Client API:
+Initializes an effects chain. Returned handle must be closed with sox_delete_effects_chain().
+@returns Handle, or null on failure.
+*/
+LSX_RETURN_OPT
+sox_effects_chain_t *
+LSX_API
+sox_create_effects_chain(
+    LSX_PARAM_IN sox_encodinginfo_t const * in_enc, /**< Input encoding. */
+    LSX_PARAM_IN sox_encodinginfo_t const * out_enc /**< Output encoding. */
+    );
+
+/**
+Client API:
+Closes an effects chain.
+*/
+void
+LSX_API
+sox_delete_effects_chain(
+    LSX_PARAM_INOUT sox_effects_chain_t *ecp /**< Effects chain pointer. */
+    );
+
+/**
+Client API:
+Adds an effect to the effects chain, returns SOX_SUCCESS if successful.
+@returns SOX_SUCCESS if successful.
+*/
+int
+LSX_API
+sox_add_effect(
+    LSX_PARAM_INOUT sox_effects_chain_t * chain, /**< Effects chain to which effect should be added . */
+    LSX_PARAM_INOUT sox_effect_t * effp, /**< Effect to be added. */
+    LSX_PARAM_INOUT sox_signalinfo_t * in, /**< Input format. */
+    LSX_PARAM_IN    sox_signalinfo_t const * out /**< Output format. */
+    );
+
+/**
+Client API:
+Runs the effects chain, returns SOX_SUCCESS if successful.
+@returns SOX_SUCCESS if successful.
+*/
+int
+LSX_API
+sox_flow_effects(
+    LSX_PARAM_INOUT  sox_effects_chain_t * chain, /**< Effects chain to run. */
+    LSX_PARAM_IN_OPT sox_flow_effects_callback callback, /**< Callback for monitoring flow progress. */
+    LSX_PARAM_IN_OPT void * client_data /**< Data to pass into callback. */
+    );
+
+/**
+Client API:
+Gets the number of clips that occurred while running an effects chain.
+@returns the number of clips that occurred while running an effects chain.
+*/
+sox_uint64_t
+LSX_API
+sox_effects_clips(
+    LSX_PARAM_IN sox_effects_chain_t * chain /**< Effects chain from which to read clip information. */
+    );
+
+/**
+Client API:
+Shuts down an effect (calls stop on each of its flows).
+@returns the number of clips from all flows.
+*/
+sox_uint64_t
+LSX_API
+sox_stop_effect(
+    LSX_PARAM_INOUT_COUNT(effp->flows) sox_effect_t * effp /**< Effect to stop. */
+    );
+
+/**
+Client API:
+Adds an already-initialized effect to the end of the chain.
+*/
+void
+LSX_API
+sox_push_effect_last(
+    LSX_PARAM_INOUT sox_effects_chain_t * chain, /**< Effects chain to which effect should be added. */
+    LSX_PARAM_INOUT sox_effect_t * effp /**< Effect to be added. */
+    );
+
+/**
+Client API:
+Removes and returns an effect from the end of the chain.
+@returns the removed effect, or null if no effects.
+*/
+LSX_RETURN_OPT
+sox_effect_t *
+LSX_API
+sox_pop_effect_last(
+    LSX_PARAM_INOUT sox_effects_chain_t *chain /**< Effects chain from which to remove an effect. */
+    );
+
+/**
+Client API:
+Shut down and delete an effect.
+*/
+void
+LSX_API
+sox_delete_effect(
+    LSX_PARAM_INOUT_COUNT(effp->flows) sox_effect_t *effp /**< Effect to be deleted. */
+    );
+
+/**
+Client API:
+Shut down and delete the last effect in the chain.
+*/
+void
+LSX_API
+sox_delete_effect_last(
+    LSX_PARAM_INOUT sox_effects_chain_t *chain /**< Effects chain from which to remove the last effect. */
+    );
+
+/**
+Client API:
+Shut down and delete all effects in the chain.
+*/
+void
+LSX_API
+sox_delete_effects(
+    LSX_PARAM_INOUT sox_effects_chain_t *chain /**< Effects chain from which to delete effects. */
+    );
+
+/**
+Client API:
+Gets the sample offset of the start of the trim, useful for efficiently
+skipping the part that will be trimmed anyway (get trim start, seek, then
+clear trim start).
+@returns the sample offset of the start of the trim.
+*/
+sox_uint64_t
+LSX_API
+sox_trim_get_start(
+    LSX_PARAM_IN sox_effect_t * effp /**< Trim effect. */
+    );
+
+/**
+Client API:
+Clears the start of the trim to 0.
+*/
+void
+LSX_API
+sox_trim_clear_start(
+    LSX_PARAM_INOUT sox_effect_t * effp /**< Trim effect. */
+    );
+
+/**
+Client API:
+Returns true if the specified file is a known playlist file type.
+@returns true if the specified file is a known playlist file type.
+*/
+sox_bool
+LSX_API
+sox_is_playlist(
+    LSX_PARAM_IN_Z char const * filename /**< Name of file to examine. */
+    );
+
+/**
+Client API:
+Parses the specified playlist file.
+@returns SOX_SUCCESS if successful.
+*/
+int
+LSX_API
+sox_parse_playlist(
+    LSX_PARAM_IN sox_playlist_callback_t callback, /**< Callback to call for each item in the playlist. */
+    void * p, /**< Data to pass to callback. */
+    LSX_PARAM_IN char const * const listname /**< Filename of playlist file. */
+    );
+
+/**
+Client API:
+Converts a SoX error code into an error string.
+@returns error string corresponding to the specified error code,
+or a generic message if the error code is not recognized.
+*/
+LSX_RETURN_VALID_Z LSX_RETURN_PURE
+char const *
+LSX_API
+sox_strerror(
+    int sox_errno /**< Error code to look up. */
+    );
+
+/**
+Client API:
+Gets the basename of the specified file; for example, the basename of
+"/a/b/c.d" would be "c".
+@returns the number of characters written to base_buffer, excluding the null,
+or 0 on failure.
+*/
+size_t
+LSX_API
+sox_basename(
+    LSX_PARAM_OUT_Z_CAP_POST_COUNT(base_buffer_len,return) char * base_buffer, /**< Buffer into which basename should be written. */
+    size_t base_buffer_len, /**< Size of base_buffer, in bytes. */
+    LSX_PARAM_IN_Z char const * filename /**< Filename from which to extract basename. */
+    );
+
+/*****************************************************************************
+Internal API:
+WARNING - The items in this section are subject to instability. They only
+exist in the public header because sox (the application) currently uses them.
+These may be changed or removed in future versions of libSoX.
+*****************************************************************************/
+
+/**
+Plugins API:
+Print a fatal error in libSoX.
+*/
+void
+LSX_API
+lsx_fail_impl(
+    LSX_PARAM_IN_PRINTF char const * fmt, /**< printf-style format string. */
+    ...)
+    LSX_PRINTF12;
+
+/**
+Plugins API:
+Print a warning in libSoX.
+*/
+void
+LSX_API
+lsx_warn_impl(
+    LSX_PARAM_IN_PRINTF char const * fmt, /**< printf-style format string. */
+    ...)
+    LSX_PRINTF12;
+
+/**
+Plugins API:
+Print an informational message in libSoX.
+*/
+void
+LSX_API
+lsx_report_impl(
+    LSX_PARAM_IN_PRINTF char const * fmt, /**< printf-style format string. */
+    ...)
+    LSX_PRINTF12;
+
+/**
+Plugins API:
+Print a debug message in libSoX.
+*/
+void
+LSX_API
+lsx_debug_impl(
+    LSX_PARAM_IN_PRINTF char const * fmt, /**< printf-style format string. */
+    ...)
+    LSX_PRINTF12;
+
+/**
+Plugins API:
+Report a fatal error in libSoX; printf-style arguments must follow.
+*/
+#define lsx_fail       sox_get_globals()->subsystem=__FILE__,lsx_fail_impl
+
+/**
+Plugins API:
+Report a warning in libSoX; printf-style arguments must follow.
+*/
+#define lsx_warn       sox_get_globals()->subsystem=__FILE__,lsx_warn_impl
+
+/**
+Plugins API:
+Report an informational message in libSoX; printf-style arguments must follow.
+*/
+#define lsx_report     sox_get_globals()->subsystem=__FILE__,lsx_report_impl
+
+/**
+Plugins API:
+Report a debug message in libSoX; printf-style arguments must follow.
+*/
+#define lsx_debug      sox_get_globals()->subsystem=__FILE__,lsx_debug_impl
+
+/**
+Plugins API:
+String name and integer values for enumerated types (type metadata), for use
+with LSX_ENUM_ITEM, lsx_find_enum_text, and lsx_find_enum_value.
+*/
+typedef struct lsx_enum_item {
+    char const *text; /**< String name of enumeration. */
+    unsigned value;   /**< Integer value of enumeration. */
+} lsx_enum_item;
+
+/**
+Plugins API:
+Declares a static instance of an lsx_enum_item structure in format
+{ "item", prefixitem }, for use in declaring lsx_enum_item[] arrays.
+@param prefix The prefix to prepend to the item in the enumeration symbolic name.
+@param item   The user-visible text name of the item (must also be a valid C symbol name).
+*/
+#define LSX_ENUM_ITEM(prefix, item) {#item, prefix##item},
+
+/**
+Plugins API:
+Flags for use with lsx_find_enum_item.
+*/
+enum
+{
+    lsx_find_enum_item_none = 0, /**< Default parameters (case-insensitive). */
+    lsx_find_enum_item_case_sensitive = 1 /**< Enable case-sensitive search. */
+};
+
+/**
+Plugins API:
+Looks up an enumeration by name in an array of lsx_enum_items.
+@returns the corresponding item, or null if not found.
+*/
+LSX_RETURN_OPT LSX_RETURN_PURE
+lsx_enum_item const *
+LSX_API
+lsx_find_enum_text(
+    LSX_PARAM_IN_Z char const * text, /**< Name of enumeration to find. */
+    LSX_PARAM_IN lsx_enum_item const * lsx_enum_items, /**< Array of items to search, with text == NULL for last item. */
+    int flags /**< Search flags: 0 (case-insensitive) or lsx_find_enum_item_case_sensitive (case-sensitive). */
+    );
+
+/**
+Plugins API:
+Looks up an enumeration by value in an array of lsx_enum_items.
+@returns the corresponding item, or null if not found.
+*/
+LSX_RETURN_OPT LSX_RETURN_PURE
+lsx_enum_item const *
+LSX_API
+lsx_find_enum_value(
+    unsigned value, /**< Enumeration value to find. */
+    LSX_PARAM_IN lsx_enum_item const * lsx_enum_items /**< Array of items to search, with text == NULL for last item. */
+    );
+
+/**
+Plugins API:
+Looks up a command-line argument in a set of enumeration names, showing an
+error message if the argument is not found in the set of names.
+@returns The enumeration value corresponding to the matching enumeration, or
+INT_MAX if the argument does not match any enumeration name.
+*/
+LSX_RETURN_PURE
+int
+LSX_API
+lsx_enum_option(
+    int c, /**< Option character to which arg is associated, for example with -a, c would be 'a'. */
+    LSX_PARAM_IN_Z char const * arg, /**< Argument to find in enumeration list. */
+    LSX_PARAM_IN lsx_enum_item const * items /**< Array of items to search, with text == NULL for last item. */
+    );
+
+/**
+Plugins API:
+Determines whether the specified string ends with the specified suffix (case-sensitive).
+@returns true if the specified string ends with the specified suffix.
+*/
+LSX_RETURN_PURE
+sox_bool
+LSX_API
+lsx_strends(
+    LSX_PARAM_IN_Z char const * str, /**< String to search. */
+    LSX_PARAM_IN_Z char const * end  /**< Suffix to search for. */
+    );
+
+/**
+Plugins API:
+Finds the file extension for a filename.
+@returns the file extension, not including the '.', or null if filename does
+not have an extension.
+*/
+LSX_RETURN_VALID_Z LSX_RETURN_PURE
+char const *
+LSX_API
+lsx_find_file_extension(
+    LSX_PARAM_IN_Z char const * pathname /**< Filename to search for extension. */
+    );
+
+/**
+Plugins API:
+Formats the specified number with up to three significant figures and adds a
+metric suffix in place of the exponent, such as 1.23G.
+@returns A static buffer with the formatted number, valid until the next time
+this function is called (note: not thread safe).
+*/
+LSX_RETURN_VALID_Z
+char const *
+LSX_API
+lsx_sigfigs3(
+    double number /**< Number to be formatted. */
+    );
+
+/**
+Plugins API:
+Formats the specified number as a percentage, showing up to three significant
+figures.
+@returns A static buffer with the formatted number, valid until the next time
+this function is called (note: not thread safe).
+*/
+LSX_RETURN_VALID_Z
+char const *
+LSX_API
+lsx_sigfigs3p(
+    double percentage /**< Number to be formatted. */
+    );
+
+/**
+Plugins API:
+Allocates, deallocates, or resizes; like C's realloc, except that this version
+terminates the running application if unable to allocate the requested memory.
+@returns New buffer, or null if buffer was freed.
+*/
+LSX_RETURN_OPT
+void *
+LSX_API
+lsx_realloc(
+    LSX_PARAM_IN_OPT void *ptr, /**< Pointer to be freed or resized, or null if allocating a new buffer. */
+    size_t newsize /**< New size for buffer, or 0 to free the buffer. */
+    );
+
+/**
+Plugins API:
+Like strcmp, except that the characters are compared without regard to case.
+@returns 0 (s1 == s2), negative (s1 < s2), or positive (s1 > s2).
+*/
+LSX_RETURN_PURE
+int
+LSX_API
+lsx_strcasecmp(
+    LSX_PARAM_IN_Z char const * s1, /**< First string. */
+    LSX_PARAM_IN_Z char const * s2  /**< Second string. */
+    );
+
+
+/**
+Plugins API:
+Like strncmp, except that the characters are compared without regard to case.
+@returns 0 (s1 == s2), negative (s1 < s2), or positive (s1 > s2).
+*/
+LSX_RETURN_PURE
+int
+LSX_API
+lsx_strncasecmp(
+    LSX_PARAM_IN_Z char const * s1, /**< First string. */
+    LSX_PARAM_IN_Z char const * s2, /**< Second string. */
+    size_t n /**< Maximum number of characters to examine. */
+    );
+
+/**
+Plugins API:
+Is option argument unsupported, required, or optional.
+*/
+typedef enum lsx_option_arg_t {
+    lsx_option_arg_none, /**< Option does not have an argument. */
+    lsx_option_arg_required, /**< Option requires an argument. */
+    lsx_option_arg_optional /**< Option can optionally be followed by an argument. */
+} lsx_option_arg_t;
+
+/**
+Plugins API:
+lsx_getopt_init options.
+*/
+typedef enum lsx_getopt_flags_t {
+    lsx_getopt_flag_none = 0,      /**< no flags (no output, not long-only) */
+    lsx_getopt_flag_opterr = 1,    /**< if set, invalid options trigger lsx_warn output */
+    lsx_getopt_flag_longonly = 2   /**< if set, recognize -option as a long option */
+} lsx_getopt_flags_t;
+
+/**
+Plugins API:
+lsx_getopt long option descriptor.
+*/
+typedef struct lsx_option_t {
+    char const *     name;    /**< Name of the long option. */
+    lsx_option_arg_t has_arg; /**< Whether the long option supports an argument and, if so, whether the argument is required or optional. */
+    int *            flag;    /**< Flag to set if argument is present. */
+    int              val;     /**< Value to put in flag if argument is present. */
+} lsx_option_t;
+
+/**
+Plugins API:
+lsx_getopt session information (initialization data and state).
+*/
+typedef struct lsx_getopt_t {
+    int                  argc;     /**< IN    argc:      Number of arguments in argv */
+    char * const *       argv;     /**< IN    argv:      Array of arguments */
+    char const *         shortopts;/**< IN    shortopts: Short option characters */
+    lsx_option_t const * longopts; /**< IN    longopts:  Array of long option descriptors */
+    lsx_getopt_flags_t   flags;    /**< IN    flags:     Flags for longonly and opterr */
+    char const *         curpos;   /**< INOUT curpos:    Maintains state between calls to lsx_getopt */
+    int                  ind;      /**< INOUT optind:    Maintains the index of next element to be processed */
+    int                  opt;      /**< OUT   optopt:    Receives the option character that caused error */
+    char const *         arg;      /**< OUT   optarg:    Receives the value of the option's argument */
+    int                  lngind;   /**< OUT   lngind:    Receives the index of the matched long option or -1 if not a long option */
+} lsx_getopt_t;
+
+/**
+Plugins API:
+Initializes an lsx_getopt_t structure for use with lsx_getopt.
+*/
+void
+LSX_API
+lsx_getopt_init(
+    LSX_PARAM_IN             int argc,                      /**< Number of arguments in argv */
+    LSX_PARAM_IN_COUNT(argc) char * const * argv,           /**< Array of arguments */
+    LSX_PARAM_IN_Z           char const * shortopts,        /**< Short options, for example ":abc:def::ghi" (+/- not supported) */
+    LSX_PARAM_IN_OPT         lsx_option_t const * longopts, /**< Array of long option descriptors */
+    LSX_PARAM_IN             lsx_getopt_flags_t flags,      /**< Flags for longonly and opterr */
+    LSX_PARAM_IN             int first,                     /**< First argv to check (usually 1) */
+    LSX_PARAM_OUT            lsx_getopt_t * state           /**< State object to be initialized */
+    );
+
+/**
+Plugins API:
+Gets the next option. Options are parameters that start with "-" or "--".
+If no more options, returns -1. If unrecognized short option, returns '?'.
+If a recognized short option is missing a required argument,
+return (shortopts[0]==':' ? ':' : '?'). If successfully recognized short
+option, return the recognized character. If successfully recognized long
+option, returns (option.flag ? 0 : option.val).
+Note: lsx_getopt does not permute the non-option arguments.
+@returns option character (short), val or 0 (long), or -1 (no more).
+*/
+int
+LSX_API
+lsx_getopt(
+    LSX_PARAM_INOUT lsx_getopt_t * state /**< The getopt state pointer. */
+    );
+
+/* WARNING END */
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif /* SOX_H */
diff --git a/freedv/branches/0.99/src/sox_biquad.c b/freedv/branches/0.99/src/sox_biquad.c
new file mode 100644 (file)
index 0000000..f5a0913
--- /dev/null
@@ -0,0 +1,129 @@
+//==========================================================================
+// Name:            sox_biquad.h
+// Purpose:         Interface into Sox Biquad filters 
+// Created:         Dec 1, 2012
+// Authors:         David Rowe
+// 
+// To test:
+//          $ gcc sox_biquad.c -o sox_biquad -DSOX_BIQUAD_UNITTEST -Wall \
+//            /path/to/sox-14.4.0/src/.libs/libsox.a -lm -lsndfile
+//          $ ./sox_biquad
+//
+// 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+
+#include <assert.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include "sox.h"
+
+#include "sox_biquad.h"
+
+
+#define N_MAX 1024
+
+int lsx_biquad_flow(sox_effect_t * effp, const sox_sample_t *ibuf,
+                    sox_sample_t *obuf, size_t *isamp, size_t *osamp);
+
+void sox_biquad_start(void)
+{
+    int r = sox_init();
+    assert(r == SOX_SUCCESS);
+}
+
+void sox_biquad_finish(void)
+{
+    sox_quit();
+}
+
+/*
+  Effect must be implemented by biquads.c in sox, arguments are just
+  like sox command line, for example:
+
+  char *argv[10];
+  argv[0] = "highpass"; argv[1]="1000"; argc=1;
+*/
+
+void *sox_biquad_create(int argc, const char *argv[])
+{
+    int ret;
+    sox_effect_t *e;
+    int (*start)(sox_effect_t *); /* function pointer to effect start func */
+    
+    e = sox_create_effect(sox_find_effect(argv[0])); assert(e != NULL);
+    ret = sox_effect_options(e, argc, (char * const*)&argv[1]);
+    assert(ret == SOX_SUCCESS);
+
+    start = e->handler.start;
+    e->in_signal.rate = 8000;     /* locked at FS=8000 Hz */
+    ret = start(e); assert(ret == SOX_SUCCESS);
+    
+    return (void *)e;
+}
+
+void sox_biquad_destroy(void *sbq) {
+    sox_effect_t *e = (sox_effect_t *)sbq;
+    free(e);
+}
+
+void sox_biquad_filter(void *sbq, short out[], short in[], int n)
+{
+    sox_effect_t *e = (sox_effect_t *)sbq;
+    sox_sample_t ibuf[N_MAX];
+    sox_sample_t obuf[N_MAX];
+    size_t isamp, osamp;
+    unsigned int clips;
+    SOX_SAMPLE_LOCALS; 
+    int i;
+
+    assert(n <= N_MAX);
+
+    clips = 0;
+    for(i=0; i<n; i++)
+        ibuf[i] = SOX_SIGNED_16BIT_TO_SAMPLE(in[i], clips);
+    isamp = osamp = (unsigned int)n;
+    lsx_biquad_flow(e, ibuf, obuf, &isamp, &osamp);
+    for(i=0; i<n; i++)
+        out[i] = SOX_SAMPLE_TO_SIGNED_16BIT(obuf[i], clips); 
+}
+
+
+#ifdef SOX_BIQUAD_UNITTEST
+#define N 20
+int main(void) {
+    void *sbq;
+    char *argv[10];
+    short in[N];
+    short out[N];
+    int   i, argc;;
+
+    for(i=0; i<N; i++)
+        in[i] = 0;
+    in[0] = 8000;
+
+    sox_biquad_start();
+    argv[0] = "highpass"; argv[1]="1000"; argc=1;
+    sbq = sox_biquad_create(argc, argv);
+
+    sox_biquad_filter(sbq, out, in, N);
+    for(i=0; i<N; i++)
+        printf("%d\n", out[i]);
+   
+    sox_biquad_destroy(sbq);
+    sox_biquad_finish();
+
+    return 0;
+}
+#endif
diff --git a/freedv/branches/0.99/src/sox_biquad.h b/freedv/branches/0.99/src/sox_biquad.h
new file mode 100644 (file)
index 0000000..f38de64
--- /dev/null
@@ -0,0 +1,40 @@
+//==========================================================================
+// Name:            sox_biquad.h
+// Purpose:         Interface into Sox Biquad filters 
+// Created:         Dec 1, 2012
+// Authors:         David Rowe
+// 
+// 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+
+#ifndef __SOX_BIQUAD__
+#define __SOX_BIQUAD__
+
+#ifdef __cplusplus
+extern "C" {
+
+#endif
+
+void sox_biquad_start(void);
+void sox_biquad_finish(void);
+void *sox_biquad_create(int argc, const char *argv[]);
+void sox_biquad_destroy(void *sbq);
+void sox_biquad_filter(void *sbq, short out[], short in[], int n);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/freedv/branches/0.99/src/topFrame.cpp b/freedv/branches/0.99/src/topFrame.cpp
new file mode 100644 (file)
index 0000000..54ea80a
--- /dev/null
@@ -0,0 +1,551 @@
+//==========================================================================
+// Name:            topFrame.cpp
+//
+// Purpose:         Implements simple wxWidgets application with GUI.
+// Created:         Apr. 9, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#include "topFrame.h"
+
+extern int g_playFileToMicInEventId;
+extern int g_recFileFromRadioEventId;
+extern int g_playFileFromRadioEventId;
+
+//=========================================================================
+// Code that lays out the main application window
+//=========================================================================
+TopFrame::TopFrame(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxFrame(parent, id, title, pos, size, style)
+{
+    this->SetSizeHints(wxDefaultSize, wxDefaultSize);
+    this->SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
+    this->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DLIGHT));
+    this->SetSizeHints(wxDefaultSize, wxDefaultSize);
+    this->SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
+    this->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DLIGHT));
+    //=====================================================
+    // Menubar Setup
+    m_menubarMain = new wxMenuBar(wxMB_DOCKABLE);
+    file = new wxMenu();
+
+    wxMenuItem* m_menuItemOnTop;
+    m_menuItemOnTop = new wxMenuItem(file, wxID_ANY, wxString(_("On Top")) , _("Always Top Window"), wxITEM_NORMAL);
+    file->Append(m_menuItemOnTop);
+
+    wxMenuItem* m_menuItemExit;
+    m_menuItemExit = new wxMenuItem(file, ID_EXIT, wxString(_("E&xit")) , _("Exit Program"), wxITEM_NORMAL);
+    file->Append(m_menuItemExit);
+
+    m_menubarMain->Append(file, _("&File"));
+
+    tools = new wxMenu();
+    wxMenuItem* m_menuItemAudio;
+    m_menuItemAudio = new wxMenuItem(tools, wxID_ANY, wxString(_("&Audio Config")) , wxEmptyString, wxITEM_NORMAL);
+    tools->Append(m_menuItemAudio);
+
+    wxMenuItem* m_menuItemRigCtrlCfg;
+    m_menuItemRigCtrlCfg = new wxMenuItem(tools, wxID_ANY, wxString(_("&PTT Config")) , wxEmptyString, wxITEM_NORMAL);
+    tools->Append(m_menuItemRigCtrlCfg);
+
+    wxMenuItem* m_menuItemOptions;
+    m_menuItemOptions = new wxMenuItem(tools, wxID_ANY, wxString(_("Options")) , wxEmptyString, wxITEM_NORMAL);
+    tools->Append(m_menuItemOptions);
+
+    wxMenuItem* m_menuItemFilter;
+    m_menuItemFilter = new wxMenuItem(tools, wxID_ANY, wxString(_("&Filter")) , wxEmptyString, wxITEM_NORMAL);
+    tools->Append(m_menuItemFilter);
+
+    wxMenuItem* m_menuItemPlayFileToMicIn;
+    m_menuItemPlayFileToMicIn = new wxMenuItem(tools, wxID_ANY, wxString(_("Start/Stop Play File - Mic In")) , wxEmptyString, wxITEM_NORMAL);
+    g_playFileToMicInEventId = m_menuItemPlayFileToMicIn->GetId();
+    tools->Append(m_menuItemPlayFileToMicIn);
+
+    wxMenuItem* m_menuItemRecFileFromRadio;
+    m_menuItemRecFileFromRadio = new wxMenuItem(tools, wxID_ANY, wxString(_("Start/Stop Record File - From Radio")) , wxEmptyString, wxITEM_NORMAL);
+    g_recFileFromRadioEventId = m_menuItemRecFileFromRadio->GetId();
+    tools->Append(m_menuItemRecFileFromRadio);
+
+    wxMenuItem* m_menuItemPlayFileFromRadio;
+    m_menuItemPlayFileFromRadio = new wxMenuItem(tools, wxID_ANY, wxString(_("Start/Stop Play File - From Radio")) , wxEmptyString, wxITEM_NORMAL);
+    g_playFileFromRadioEventId = m_menuItemPlayFileFromRadio->GetId();
+    tools->Append(m_menuItemPlayFileFromRadio);
+    m_menubarMain->Append(tools, _("&Tools"));
+
+    help = new wxMenu();
+    wxMenuItem* m_menuItemHelpUpdates;
+    m_menuItemHelpUpdates = new wxMenuItem(help, wxID_ANY, wxString(_("Check for Updates")) , wxEmptyString, wxITEM_NORMAL);
+    help->Append(m_menuItemHelpUpdates);
+    m_menuItemHelpUpdates->Enable(false);
+
+    wxMenuItem* m_menuItemAbout;
+    m_menuItemAbout = new wxMenuItem(help, ID_ABOUT, wxString(_("&About")) , _("About this program"), wxITEM_NORMAL);
+    help->Append(m_menuItemAbout);
+
+    m_menubarMain->Append(help, _("&Help"));
+
+    this->SetMenuBar(m_menubarMain);
+
+    wxBoxSizer* bSizer1;
+    bSizer1 = new wxBoxSizer(wxHORIZONTAL);
+
+    //=====================================================
+    // Left side
+    //=====================================================
+    wxBoxSizer* leftSizer;
+    leftSizer = new wxBoxSizer(wxVERTICAL);
+
+    wxStaticBoxSizer* snrSizer;
+    snrSizer = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("SNR")), wxVERTICAL);
+
+    //------------------------------
+    // S/N ratio Guage (vert. bargraph)
+    //------------------------------
+    m_gaugeSNR = new wxGauge(this, wxID_ANY, 25, wxDefaultPosition, wxSize(15,135), wxGA_SMOOTH|wxGA_VERTICAL);
+    m_gaugeSNR->SetToolTip(_("Displays signal to noise ratio in dB."));
+    snrSizer->Add(m_gaugeSNR, 1, wxALIGN_CENTER_HORIZONTAL|wxALL, 10);
+
+    //------------------------------
+    // Box for S/N ratio (Numeric)
+    //------------------------------
+    m_textSNR = new wxStaticText(this, wxID_ANY, wxT(" 0.0"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE);
+    snrSizer->Add(m_textSNR, 0, wxALIGN_CENTER_HORIZONTAL, 1);
+
+    //------------------------------
+    // S/N ratio slow Checkbox
+    //------------------------------
+    m_ckboxSNR = new wxCheckBox(this, wxID_ANY, _("Slow"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
+    m_ckboxSNR->SetToolTip(_("Smooth but slow SNR estimation"));
+    snrSizer->Add(m_ckboxSNR, 0, wxALIGN_CENTER_HORIZONTAL, 5);
+
+    leftSizer->Add(snrSizer, 2, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxALL, 1);
+
+    //------------------------------
+    // Sync  Indicator box
+    //------------------------------
+    wxStaticBoxSizer* sbSizer3_33;
+    sbSizer3_33 = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Sync")), wxVERTICAL);
+
+    m_rbSync = new wxRadioButton( this, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
+    m_rbSync->SetForegroundColour( wxColour( 255, 0, 0 ) );
+    sbSizer3_33->Add(m_rbSync, 0, wxALIGN_CENTER|wxALL, 1);
+    leftSizer->Add(sbSizer3_33,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
+
+    //------------------------------
+    // BER Frames box
+    //------------------------------
+
+    wxStaticBoxSizer* sbSizer_ber;
+    sbSizer_ber = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Bit Error Rate")), wxVERTICAL);
+
+    m_BtnBerReset = new wxButton(this, wxID_ANY, _("Reset"), wxDefaultPosition, wxDefaultSize, 0);
+    sbSizer_ber->Add(m_BtnBerReset, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
+
+    m_textBits = new wxStaticText(this, wxID_ANY, wxT("Bits: 0"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
+    sbSizer_ber->Add(m_textBits, 0, wxALIGN_LEFT, 1);
+    m_textErrors = new wxStaticText(this, wxID_ANY, wxT("Errs: 0"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
+    sbSizer_ber->Add(m_textErrors, 0, wxALIGN_LEFT, 1);
+    m_textBER = new wxStaticText(this, wxID_ANY, wxT("BER: 0.0"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
+    sbSizer_ber->Add(m_textBER, 0, wxALIGN_LEFT, 1);
+
+    leftSizer->Add(sbSizer_ber,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
+
+    //------------------------------
+    // Signal Level(vert. bargraph)
+    //------------------------------
+    wxStaticBoxSizer* levelSizer;
+    levelSizer = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Level")), wxVERTICAL);
+
+    m_textLevel = new wxStaticText(this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(60,-1), wxALIGN_CENTRE);
+    m_textLevel->SetForegroundColour(wxColour(255,0,0));
+    levelSizer->Add(m_textLevel, 0, wxALIGN_LEFT, 1);
+
+    m_gaugeLevel = new wxGauge(this, wxID_ANY, 100, wxDefaultPosition, wxSize(15,135), wxGA_SMOOTH|wxGA_VERTICAL);
+    m_gaugeLevel->SetToolTip(_("Peak of From Radio in Rx, or peak of From Mic in Tx mode.  If Red you should reduce your levels"));
+    levelSizer->Add(m_gaugeLevel, 1, wxALIGN_CENTER_HORIZONTAL|wxALL, 10);
+
+    leftSizer->Add(levelSizer, 2, wxALIGN_CENTER|wxALL|wxEXPAND, 1);
+
+    bSizer1->Add(leftSizer, 0, wxALL|wxEXPAND, 5);
+
+    //=====================================================
+    // Center Section
+    //=====================================================
+    wxBoxSizer* centerSizer;
+    centerSizer = new wxBoxSizer(wxVERTICAL);
+    wxBoxSizer* upperSizer;
+    upperSizer = new wxBoxSizer(wxVERTICAL);
+
+    //=====================================================
+    // Tabbed Notebook control containing display graphs
+    //=====================================================
+    //m_auiNbookCtrl = new wxAuiNotebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_NB_BOTTOM|wxAUI_NB_DEFAULT_STYLE);
+    //long style = wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_MOVE | wxAUI_NB_SCROLL_BUTTONS | wxAUI_NB_CLOSE_ON_ACTIVE_TAB | wxAUI_NB_MIDDLE_CLICK_CLOSE;
+    long nb_style = wxAUI_NB_BOTTOM | wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_MOVE | wxAUI_NB_SCROLL_BUTTONS;
+    m_auiNbookCtrl = new wxAuiNotebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, nb_style);
+    // This line sets the fontsize for the tabs on the notebook control
+    m_auiNbookCtrl->SetFont(wxFont(8, 70, 90, 90, false, wxEmptyString));
+
+    upperSizer->Add(m_auiNbookCtrl, 1, wxALIGN_TOP|wxEXPAND, 1);
+    centerSizer->Add(upperSizer, 1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALIGN_TOP|wxEXPAND, 0);
+
+    // lower middle used for user ID
+
+    wxBoxSizer* lowerSizer;
+    lowerSizer = new wxBoxSizer(wxHORIZONTAL);
+
+    m_BtnCallSignReset = new wxButton(this, wxID_ANY, _("Clear"), wxDefaultPosition, wxDefaultSize, 0);
+    lowerSizer->Add(m_BtnCallSignReset, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
+
+    wxBoxSizer* bSizer15;
+    bSizer15 = new wxBoxSizer(wxVERTICAL);
+    m_txtCtrlCallSign = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
+    m_txtCtrlCallSign->SetToolTip(_("Call Sign of transmitting station will appear here"));
+    bSizer15->Add(m_txtCtrlCallSign, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 5);
+    lowerSizer->Add(bSizer15, 1, wxEXPAND, 5);
+
+    wxStaticBoxSizer* sbSizer_Checksum = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Checksums")), wxHORIZONTAL);
+
+    wxStaticText *goodLabel = new wxStaticText(this, wxID_ANY, wxT("Good: "), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE);
+    sbSizer_Checksum->Add(goodLabel, 0, 0, 2);
+    m_txtChecksumGood = new wxStaticText(this, wxID_ANY, wxT("0"), wxDefaultPosition, wxSize(30,-1), wxALIGN_CENTRE);
+    sbSizer_Checksum->Add(m_txtChecksumGood, 0, 0, 2);
+
+    wxStaticText *badLabel = new wxStaticText(this, wxID_ANY, wxT("Bad: "), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE);
+    sbSizer_Checksum->Add(badLabel, 0, 0, 1);
+    m_txtChecksumBad = new wxStaticText(this, wxID_ANY, wxT("0"), wxDefaultPosition, wxSize(30,-1), wxALIGN_CENTRE);
+    sbSizer_Checksum->Add(m_txtChecksumBad, 0, 0, 1);
+
+    lowerSizer->Add(sbSizer_Checksum, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
+
+    //=====================================================
+    // These are the buttons that autosend the userid (?)
+    //=====================================================
+
+    // DR 4 Dec - taken off for screen for Beta release to avoid questions on their use until
+    // we implement this feature
+ #ifdef UNIMPLEMENTED
+    wxBoxSizer* bSizer141;
+    bSizer141 = new wxBoxSizer(wxHORIZONTAL);
+
+    // TxID
+    //---------
+    m_togTxID = new wxToggleButton(this, wxID_ANY, _("TxID"), wxDefaultPosition, wxDefaultSize, 0);
+    m_togTxID->SetToolTip(_("Send Tx ID information"));
+    bSizer141->Add(m_togTxID, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
+
+    // RxID
+    //---------
+    m_togRxID = new wxToggleButton(this, wxID_ANY, _("RxID"), wxDefaultPosition, wxDefaultSize, 0);
+    m_togRxID->SetToolTip(_("Enable reception of ID information"));
+    bSizer141->Add(m_togRxID, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_LEFT|wxALL|wxFIXED_MINSIZE, 5);
+
+    lowerSizer->Add(bSizer141, 0, wxALIGN_RIGHT, 5);
+#endif
+
+    centerSizer->Add(lowerSizer, 0, wxALIGN_BOTTOM|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 2);
+    bSizer1->Add(centerSizer, 4, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 1);
+
+    //=====================================================
+    // Right side
+    //=====================================================
+    wxBoxSizer* rightSizer;
+    rightSizer = new wxBoxSizer(wxVERTICAL);
+
+    //=====================================================
+    // Squelch Slider Control
+    //=====================================================
+    wxStaticBoxSizer* sbSizer3;
+    sbSizer3 = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Squelch")), wxVERTICAL);
+
+    m_sliderSQ = new wxSlider(this, wxID_ANY, 0, 0, 40, wxDefaultPosition, wxSize(-1,80), wxSL_AUTOTICKS|wxSL_INVERSE|wxSL_VERTICAL);
+    m_sliderSQ->SetToolTip(_("Set Squelch level in dB."));
+
+    sbSizer3->Add(m_sliderSQ, 1, wxALIGN_CENTER_HORIZONTAL, 0);
+
+    //------------------------------
+    // Squelch Level static text box
+    //------------------------------
+    m_textSQ = new wxStaticText(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE);
+
+    sbSizer3->Add(m_textSQ, 0, wxALIGN_CENTER_HORIZONTAL, 0);
+
+    //------------------------------
+    // Squelch Toggle Checkbox
+    //------------------------------
+    m_ckboxSQ = new wxCheckBox(this, wxID_ANY, _(""), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
+
+    sbSizer3->Add(m_ckboxSQ, 0, wxALIGN_CENTER_HORIZONTAL, 0);
+    rightSizer->Add(sbSizer3, 2, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 0);
+
+    //rightSizer->Add(sbSizer3_33,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
+
+    /* new --- */
+
+    //------------------------------
+    // Mode box
+    //------------------------------
+    wxStaticBoxSizer* sbSizer_mode;
+    sbSizer_mode = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Mode")), wxVERTICAL);
+
+#ifdef DISABLED_FEATURE
+    m_rb1400old = new wxRadioButton( this, wxID_ANY, wxT("1400 V0.91"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
+    sbSizer_mode->Add(m_rb1400old, 0, wxALIGN_LEFT|wxALL, 1);
+    m_rb1400 = new wxRadioButton( this, wxID_ANY, wxT("1400"), wxDefaultPosition, wxDefaultSize, 0);
+    sbSizer_mode->Add(m_rb1400, 0, wxALIGN_LEFT|wxALL, 1);
+#endif
+    m_rb700 = new wxRadioButton( this, wxID_ANY, wxT("700"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
+    sbSizer_mode->Add(m_rb700, 0, wxALIGN_LEFT|wxALL, 1);
+    m_rb1600 = new wxRadioButton( this, wxID_ANY, wxT("1600"), wxDefaultPosition, wxDefaultSize, 0);
+    sbSizer_mode->Add(m_rb1600, 0, wxALIGN_LEFT|wxALL, 1);
+    m_rb1600->SetValue(true);
+#ifdef DISABLED_FEATURE
+    m_rb1600Wide = new wxRadioButton( this, wxID_ANY, wxT("1600 Wide"), wxDefaultPosition, wxDefaultSize, 0);
+    sbSizer_mode->Add(m_rb1600Wide, 0, wxALIGN_LEFT|wxALL, 1);
+    m_rb2000 = new wxRadioButton( this, wxID_ANY, wxT("2000"), wxDefaultPosition, wxDefaultSize, 0);
+    sbSizer_mode->Add(m_rb2000, 0, wxALIGN_LEFT|wxALL, 1);
+#endif
+
+    rightSizer->Add(sbSizer_mode,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
+
+    #ifdef MOVED_TO_OPTIONS_DIALOG
+    /* new --- */
+
+    //------------------------------
+    // Test Frames box
+    //------------------------------
+
+    wxStaticBoxSizer* sbSizer_testFrames;
+    sbSizer_testFrames = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Test Frames")), wxVERTICAL);
+
+    m_ckboxTestFrame = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
+    sbSizer_testFrames->Add(m_ckboxTestFrame, 0, wxALIGN_LEFT, 0);
+
+    rightSizer->Add(sbSizer_testFrames,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
+    #endif
+
+    //=====================================================
+    // Control Toggles box
+    //=====================================================
+    wxStaticBoxSizer* sbSizer5;
+    sbSizer5 = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Control")), wxVERTICAL);
+    wxBoxSizer* bSizer1511;
+    bSizer1511 = new wxBoxSizer(wxVERTICAL);
+
+    //-------------------------------
+    // Stop/Stop signal processing (rx and tx)
+    //-------------------------------
+    m_togBtnOnOff = new wxToggleButton(this, wxID_ANY, _("Start"), wxDefaultPosition, wxDefaultSize, 0);
+    m_togBtnOnOff->SetToolTip(_("Begin/End receiving data."));
+    bSizer1511->Add(m_togBtnOnOff, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
+    sbSizer5->Add(bSizer1511, 0, wxEXPAND, 1);
+
+#ifdef UNIMPLEMENTED
+    //------------------------------
+    // Toggle Loopback button for RX
+    //------------------------------
+    wxBoxSizer* bSizer15113;
+    bSizer15113 = new wxBoxSizer(wxHORIZONTAL);
+    wxBoxSizer* bSizer15111;
+    bSizer15111 = new wxBoxSizer(wxVERTICAL);
+    wxSize wxSz = wxSize(44, 30);
+    m_togBtnLoopRx = new wxToggleButton(this, wxID_ANY, _("Loop\nRX"), wxDefaultPosition, wxSz, 0);
+    m_togBtnLoopRx->SetFont(wxFont(6, 70, 90, 90, false, wxEmptyString));
+    m_togBtnLoopRx->SetToolTip(_("Loopback Receive audio data."));
+
+    bSizer15111->Add(m_togBtnLoopRx, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 0);
+
+    //sbSizer5->Add(bSizer15111, 0, wxEXPAND, 1);
+    bSizer15113->Add(bSizer15111, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 0);
+
+    //------------------------------
+    // Toggle Loopback button for Tx
+    //------------------------------
+    wxBoxSizer* bSizer15112;
+    bSizer15112 = new wxBoxSizer(wxVERTICAL);
+    m_togBtnLoopTx = new wxToggleButton(this, wxID_ANY, _("Loop\nTX"), wxDefaultPosition, wxSz, 0);
+    m_togBtnLoopTx->SetFont(wxFont(6, 70, 90, 90, false, wxEmptyString));
+    m_togBtnLoopTx->SetToolTip(_("Loopback Transmit audio data."));
+
+    bSizer15112->Add(m_togBtnLoopTx, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 0);
+    bSizer15113->Add(bSizer15112, 0,  wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 0);
+
+    sbSizer5->Add(bSizer15113, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
+#endif
+
+    //------------------------------
+    // Split Frequency Mode Toggle
+    //------------------------------
+    wxBoxSizer* bSizer151;
+    bSizer151 = new wxBoxSizer(wxVERTICAL);
+
+    m_togBtnSplit = new wxToggleButton(this, wxID_ANY, _("Split"), wxDefaultPosition, wxDefaultSize, 0);
+    m_togBtnSplit->SetToolTip(_("Toggle split frequency mode."));
+
+    bSizer151->Add(m_togBtnSplit, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
+    sbSizer5->Add(bSizer151, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 1);
+    wxBoxSizer* bSizer13;
+    bSizer13 = new wxBoxSizer(wxVERTICAL);
+
+    //------------------------------
+    // Analog Passthrough Toggle
+    //------------------------------
+    m_togBtnAnalog = new wxToggleButton(this, wxID_ANY, _("Analog"), wxDefaultPosition, wxDefaultSize, 0);
+    m_togBtnAnalog->SetToolTip(_("Toggle analog/digital operation."));
+    bSizer13->Add(m_togBtnAnalog, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
+    sbSizer5->Add(bSizer13, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
+
+    // not implemented on fdmdv2
+#ifdef ALC
+    //------------------------------
+    // Toggle for ALC
+    //------------------------------
+    wxBoxSizer* bSizer14;
+    bSizer14 = new wxBoxSizer(wxVERTICAL);
+    m_togBtnALC = new wxToggleButton(this, wxID_ANY, _("ALC"), wxDefaultPosition, wxDefaultSize, 0);
+    m_togBtnALC->SetToolTip(_("Toggle automatic level control mode."));
+
+    bSizer14->Add(m_togBtnALC, 0, wxALL, 1);
+    sbSizer5->Add(bSizer14, 0, wxALIGN_CENTER|wxALIGN_CENTER_HORIZONTAL|wxALL, 1);
+#endif
+
+    //------------------------------
+    // Toggle Transmit/Receive relays
+    //------------------------------
+    wxBoxSizer* bSizer11;
+    bSizer11 = new wxBoxSizer(wxVERTICAL);
+    m_btnTogPTT = new wxToggleButton(this, wxID_ANY, _("PTT"), wxDefaultPosition, wxDefaultSize, 0);
+    m_btnTogPTT->SetToolTip(_("Push to Talk - Switch between Receive and Transmit - you can also use the space bar "));
+    bSizer11->Add(m_btnTogPTT, 1, wxALIGN_CENTER|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
+    sbSizer5->Add(bSizer11, 2, wxEXPAND, 1);
+    rightSizer->Add(sbSizer5, 2, wxALIGN_CENTER|wxALL|wxEXPAND, 3);
+    bSizer1->Add(rightSizer, 0, wxALL|wxEXPAND, 3);
+    this->SetSizer(bSizer1);
+    this->Layout();
+    m_statusBar1 = this->CreateStatusBar(3, wxST_SIZEGRIP, wxID_ANY);
+
+    //=====================================================
+    // End of layout
+    //=====================================================
+
+    //-------------------
+    // Connect Events
+    //-------------------
+    this->Connect(wxEVT_CLOSE_WINDOW, wxCloseEventHandler(TopFrame::topFrame_OnClose));
+    this->Connect(wxEVT_PAINT, wxPaintEventHandler(TopFrame::topFrame_OnPaint));
+    this->Connect(wxEVT_SIZE, wxSizeEventHandler(TopFrame::topFrame_OnSize));
+    this->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::topFrame_OnUpdateUI));
+
+    this->Connect(m_menuItemExit->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnExit));
+    this->Connect(m_menuItemOnTop->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnTop));
+
+    this->Connect(m_menuItemAudio->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsAudio));
+    this->Connect(m_menuItemAudio->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsAudioUI));
+    this->Connect(m_menuItemFilter->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsFilter));
+    this->Connect(m_menuItemFilter->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsFilterUI));
+    this->Connect(m_menuItemRigCtrlCfg->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsComCfg));
+    this->Connect(m_menuItemRigCtrlCfg->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsComCfgUI));
+    this->Connect(m_menuItemOptions->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsOptions));
+    this->Connect(m_menuItemOptions->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsOptionsUI));
+
+    this->Connect(m_menuItemPlayFileToMicIn->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnPlayFileToMicIn));
+    this->Connect(m_menuItemRecFileFromRadio->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnRecFileFromRadio));
+    this->Connect(m_menuItemPlayFileFromRadio->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnPlayFileFromRadio));
+
+    this->Connect(m_menuItemHelpUpdates->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnHelpCheckUpdates));
+    this->Connect(m_menuItemHelpUpdates->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnHelpCheckUpdatesUI));
+    this->Connect(m_menuItemAbout->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnHelpAbout));
+    //m_togRxID->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnRxID), NULL, this);
+    //m_togTxID->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnTxID), NULL, this);
+    m_sliderSQ->Connect(wxEVT_SCROLL_TOP, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Connect(wxEVT_SCROLL_BOTTOM, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Connect(wxEVT_SCROLL_LINEUP, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Connect(wxEVT_SCROLL_LINEDOWN, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Connect(wxEVT_SCROLL_PAGEUP, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Connect(wxEVT_SCROLL_PAGEDOWN, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Connect(wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Connect(wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Connect(wxEVT_SCROLL_BOTTOM, wxScrollEventHandler(TopFrame::OnSliderScrollBottom), NULL, this);
+    m_sliderSQ->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(TopFrame::OnCmdSliderScrollChanged), NULL, this);
+    m_sliderSQ->Connect(wxEVT_SCROLL_TOP, wxScrollEventHandler(TopFrame::OnSliderScrollTop), NULL, this);
+    m_ckboxSQ->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(TopFrame::OnCheckSQClick), NULL, this);
+
+    m_ckboxSNR->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(TopFrame::OnCheckSNRClick), NULL, this);
+
+    m_togBtnOnOff->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnOnOff), NULL, this);
+    m_togBtnSplit->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnSplitClick), NULL, this);
+    m_togBtnAnalog->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnAnalogClick), NULL, this);
+#ifdef ALC
+    m_togBtnALC->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnALCClick), NULL, this);
+#endif
+    m_btnTogPTT->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnPTT), NULL, this);
+
+    m_BtnCallSignReset->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnCallSignReset), NULL, this);
+    m_BtnBerReset->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnBerReset), NULL, this);
+}
+
+TopFrame::~TopFrame()
+{
+    //-------------------
+    // Disconnect Events
+    //-------------------
+    this->Disconnect(wxEVT_CLOSE_WINDOW, wxCloseEventHandler(TopFrame::topFrame_OnClose));
+    this->Disconnect(wxEVT_PAINT, wxPaintEventHandler(TopFrame::topFrame_OnPaint));
+    this->Disconnect(wxEVT_SIZE, wxSizeEventHandler(TopFrame::topFrame_OnSize));
+    this->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::topFrame_OnUpdateUI));
+    this->Disconnect(ID_EXIT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnExit));
+    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsAudio));
+    this->Disconnect(wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsAudioUI));
+    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsFilter));
+    this->Disconnect(wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsFilterUI));
+    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsComCfg));
+    this->Disconnect(wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsComCfgUI));
+    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsOptions));
+    this->Disconnect(wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsOptionsUI));
+
+    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnPlayFileToMicIn));
+    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnRecFileFromRadio));
+    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnPlayFileFromRadio));
+
+    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnHelpCheckUpdates));
+    this->Disconnect(wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnHelpCheckUpdatesUI));
+    this->Disconnect(ID_ABOUT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnHelpAbout));
+    //m_togRxID->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnRxID), NULL, this);
+    //m_togTxID->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnTxID), NULL, this);
+    m_sliderSQ->Disconnect(wxEVT_SCROLL_TOP, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Disconnect(wxEVT_SCROLL_BOTTOM, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Disconnect(wxEVT_SCROLL_LINEUP, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Disconnect(wxEVT_SCROLL_LINEDOWN, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Disconnect(wxEVT_SCROLL_PAGEUP, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Disconnect(wxEVT_SCROLL_PAGEDOWN, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Disconnect(wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Disconnect(wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Disconnect(wxEVT_SCROLL_BOTTOM, wxScrollEventHandler(TopFrame::OnSliderScrollBottom), NULL, this);
+    m_sliderSQ->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(TopFrame::OnCmdSliderScrollChanged), NULL, this);
+    m_sliderSQ->Disconnect(wxEVT_SCROLL_TOP, wxScrollEventHandler(TopFrame::OnSliderScrollTop), NULL, this);
+    m_ckboxSQ->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(TopFrame::OnCheckSQClick), NULL, this);
+
+    m_togBtnOnOff->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnOnOff), NULL, this);
+    m_togBtnSplit->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnSplitClick), NULL, this);
+    m_togBtnAnalog->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnAnalogClick), NULL, this);
+#ifdef ALC
+    m_togBtnALC->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnALCClick), NULL, this);
+#endif
+    m_btnTogPTT->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnPTT), NULL, this);
+
+}
+
diff --git a/freedv/branches/0.99/src/topFrame.h b/freedv/branches/0.99/src/topFrame.h
new file mode 100644 (file)
index 0000000..4341315
--- /dev/null
@@ -0,0 +1,183 @@
+//==========================================================================
+// Name:            topFrame.h
+//
+// Purpose:         Implements simple wxWidgets application with GUI.
+// Created:         Apr. 9, 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 Lesser 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 Lesser General Public License
+//  along with this program; if not, see <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#ifndef __TOPFRAME_H__
+#define __TOPFRAME_H__
+
+#include "version.h"
+#include <wx/artprov.h>
+#include <wx/xrc/xmlres.h>
+#include <wx/intl.h>
+#include <wx/string.h>
+#include <wx/bitmap.h>
+#include <wx/image.h>
+#include <wx/icon.h>
+#include <wx/menu.h>
+#include <wx/gdicmn.h>
+#include <wx/font.h>
+#include <wx/colour.h>
+#include <wx/settings.h>
+#include <wx/gauge.h>
+#include <wx/textctrl.h>
+#include <wx/sizer.h>
+#include <wx/statbox.h>
+#include <wx/aui/auibook.h>
+#include <wx/tglbtn.h>
+#include <wx/slider.h>
+#include <wx/checkbox.h>
+#include <wx/statusbr.h>
+#include <wx/frame.h>
+#include <wx/statbmp.h>
+#include <wx/stattext.h>
+#include <wx/button.h>
+#include <wx/dialog.h>
+#include <wx/radiobut.h>
+#include <wx/combobox.h>
+#include <wx/panel.h>
+#include <wx/listbox.h>
+#include <wx/notebook.h>
+#include <wx/listctrl.h>
+
+
+///////////////////////////////////////////////////////////////////////////
+
+#define ID_OPEN 1000
+#define ID_SAVE 1001
+#define ID_CLOSE 1002
+#define ID_EXIT 1003
+#define ID_COPY 1004
+#define ID_CUT 1005
+#define ID_PASTE 1006
+#define ID_OPTIONS 1007
+#define ID_ABOUT 1008
+
+///////////////////////////////////////////////////////////////////////////////
+/// Class TopFrame
+///////////////////////////////////////////////////////////////////////////////
+class TopFrame : public wxFrame
+{
+    private:
+
+    protected:
+        wxMenuBar* m_menubarMain;
+        wxMenu* file;
+        wxMenu* edit;
+        wxMenu* tools;
+        wxMenu* help;
+        wxGauge* m_gaugeSNR;
+        wxStaticText* m_textSNR;
+        wxCheckBox* m_ckboxSNR;
+        wxGauge* m_gaugeLevel;
+        wxStaticText* m_textLevel;
+
+        wxButton*     m_BtnCallSignReset;
+        wxTextCtrl*   m_txtCtrlCallSign;
+        wxStaticText* m_txtChecksumGood;
+        wxStaticText* m_txtChecksumBad;
+
+        wxSlider* m_sliderSQ;
+        wxCheckBox* m_ckboxSQ;
+        wxStaticText* m_textSQ;
+        wxStatusBar* m_statusBar1;
+
+        wxButton*     m_BtnBerReset;
+        wxStaticText  *m_textBits;
+        wxStaticText  *m_textErrors;
+        wxStaticText  *m_textBER;
+
+        wxRadioButton *m_rbSync;
+        wxRadioButton *m_rb1400old;
+        wxRadioButton *m_rb1400;
+        wxRadioButton *m_rb700;
+        wxRadioButton *m_rb1600;
+        wxRadioButton *m_rb2000;
+        wxRadioButton *m_rb1600Wide;
+
+        // Virtual event handlers, overide them in your derived class
+        virtual void topFrame_OnClose( wxCloseEvent& event ) { event.Skip(); }
+        virtual void topFrame_OnPaint( wxPaintEvent& event ) { event.Skip(); }
+        virtual void topFrame_OnSize( wxSizeEvent& event ) { event.Skip(); }
+        virtual void topFrame_OnUpdateUI( wxUpdateUIEvent& event ) { event.Skip(); }
+
+        virtual void OnExit( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnTop( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnToolsAudio( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnToolsAudioUI( wxUpdateUIEvent& event ) { event.Skip(); }
+        virtual void OnToolsFilter( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnToolsFilterUI( wxUpdateUIEvent& event ) { event.Skip(); }
+        virtual void OnToolsOptions( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnToolsUDP( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnToolsOptionsUI( wxUpdateUIEvent& event ) { event.Skip(); }
+        virtual void OnToolsComCfg( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnToolsComCfgUI( wxUpdateUIEvent& event ) { event.Skip(); }
+        virtual void OnPlayFileToMicIn( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnRecFileFromRadio( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnPlayFileFromRadio( wxCommandEvent& event ) { event.Skip(); }
+
+        virtual void OnHelpCheckUpdates( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnHelpCheckUpdatesUI( wxUpdateUIEvent& event ) { event.Skip(); }
+        virtual void OnHelpAbout( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnTogBtnRxID( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnTogBtnTxID( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnCmdSliderScroll( wxScrollEvent& event ) { event.Skip(); }
+        virtual void OnSliderScrollBottom( wxScrollEvent& event ) { event.Skip(); }
+        virtual void OnCmdSliderScrollChanged( wxScrollEvent& event ) { event.Skip(); }
+        virtual void OnSliderScrollTop( wxScrollEvent& event ) { event.Skip(); }
+        virtual void OnCheckSQClick( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnCheckSNRClick( wxCommandEvent& event ) { event.Skip(); }
+
+        virtual void OnTogBtnLoopRx( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnTogBtnLoopTx( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnTogBtnOnOff( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnTogBtnSplitClick( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnTogBtnAnalogClick( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnTogBtnALCClick( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnTogBtnPTT( wxCommandEvent& event ) { event.Skip(); }
+
+        virtual void OnTogBtnSplitClickUI(wxUpdateUIEvent& event) { event.Skip(); }
+        virtual void OnTogBtnAnalogClickUI(wxUpdateUIEvent& event) { event.Skip(); }
+        virtual void OnTogBtnALCClickUI(wxUpdateUIEvent& event) { event.Skip(); }
+        virtual void OnTogBtnRxIDUI(wxUpdateUIEvent& event ) { event.Skip(); }
+        virtual void OnTogBtnTxIDUI(wxUpdateUIEvent& event ) { event.Skip(); }
+        virtual void OnTogBtnPTT_UI(wxUpdateUIEvent& event ) { event.Skip(); }
+        virtual void OnTogBtnOnOffUI(wxUpdateUIEvent& event ) { event.Skip(); }
+
+        virtual void OnCallSignReset( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnBerReset( wxCommandEvent& event ) { event.Skip(); }
+
+    public:
+        wxToggleButton* m_togRxID;
+        wxToggleButton* m_togTxID;
+        wxToggleButton* m_togBtnOnOff;
+        wxToggleButton* m_togBtnSplit;
+        wxToggleButton* m_togBtnAnalog;
+        wxToggleButton* m_togBtnALC;
+        wxToggleButton* m_btnTogPTT;
+        wxToggleButton* m_togBtnLoopRx;
+        wxToggleButton* m_togBtnLoopTx;
+        wxAuiNotebook* m_auiNbookCtrl;
+
+        TopFrame( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("FreeDV ") + _(FREEDV_VERSION), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(561,300 ), long style = wxDEFAULT_FRAME_STYLE|wxRESIZE_BORDER|wxTAB_TRAVERSAL );
+
+        ~TopFrame();
+};
+
+#endif //__TOPFRAME_H__
diff --git a/freedv/tags/0.99-Beta/.clang/.gitignore b/freedv/tags/0.99-Beta/.clang/.gitignore
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/freedv/tags/0.99-Beta/CMakeLists.txt b/freedv/tags/0.99-Beta/CMakeLists.txt
new file mode 100644 (file)
index 0000000..40e95e3
--- /dev/null
@@ -0,0 +1,487 @@
+#
+# FreeDV - HF Digital Voice for Radio Amateurs
+#
+# CMake configuration contributed by Richard Shaw (KF5OIM)
+# Please report questions, comments, problems, or patches to the freetel
+# mailing list: https://lists.sourceforge.net/lists/listinfo/freetel-codec2
+#
+
+cmake_minimum_required(VERSION 2.8)
+
+# Prevent in-source builds to protect automake/autoconf config.
+# If an in-source build is attempted, you will still need to clean up a few
+# files manually.
+set(CMAKE_DISABLE_SOURCE_CHANGES ON)
+set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
+if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
+  message(FATAL_ERROR "In-source builds in ${CMAKE_BINARY_DIR} are not "   
+   "allowed, please remove ./CMakeCache.txt and ./CMakeFiles/, create a "
+   "separate build directory and run cmake from there.")
+endif("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
+
+# Set local module path.
+list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
+
+project(FreeDV)
+
+#
+# Set FreeDV version and generate src/version.h
+#
+set(FREEDV_VERSION_MAJOR 0)
+set(FREEDV_VERSION_MINOR 99)
+set(FREEDV_VERSION_PATCH FALSE)
+set(FREEDV_VERSION ${FREEDV_VERSION_MAJOR}.${FREEDV_VERSION_MINOR})
+if(FREEDV_VERSION_PATCH)
+    set(FREEDV_VERSION ${FREEDV_VERSION}.${FREEDV_VERSION_PATCH})
+endif()
+set(FREEDV_VERSION_SUFFIX "Beta")
+if(FREEDV_VERSION_SUFFIX)
+    set(FREEDV_VERSION_STRING "${FREEDV_VERSION} ${FREEDV_VERSION_SUFFIX}")
+endif()
+message(STATUS "FreeDV version: ${FREEDV_VERSION_STRING}")
+configure_file(cmake/version.h.in src/version.h @ONLY)
+
+# Set default build type
+if(NOT CMAKE_BUILD_TYPE)
+    set(CMAKE_BUILD_TYPE "Release")
+    message(STATUS "Build type not specified, defaulting to ${CMAKE_BUILD_TYPE}")
+endif(NOT CMAKE_BUILD_TYPE)
+
+
+# Work around for not using a svn working copy.
+add_definitions(-D_NO_AUTOTOOLS_)
+find_program(SVNVERSION_PATH svnversion)
+if(SVNVERSION_PATH)
+    execute_process(COMMAND ${SVNVERSION_PATH} .
+        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+        RESULT_VARIABLE SVN_REVISION_RESULT
+        OUTPUT_VARIABLE SVN_CURRENT_REVISION
+        ERROR_QUIET
+    )
+else()
+    set(SVN_REVISION_RESULT 1)
+endif()
+if(SVN_REVISION_RESULT EQUAL 0)
+string(STRIP ${SVN_CURRENT_REVISION} SVN_REVISION)
+add_definitions(-DSVN_REVISION="${SVN_REVISION}")
+else()
+add_definitions(-DSVN_REVISION="Unversioned directory")
+endif()
+
+
+# Set default build flags.
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
+
+#
+# Setup cmake options
+#
+set(CMAKE_VERBOSE_MAKEFILE TRUE CACHE BOOL "Verbose makefile.")
+set(USE_STATIC_DEPS FALSE CACHE BOOL 
+    "Download and build static libraries instead of system libraries.")
+set(USE_STATIC_PORTAUDIO FALSE CACHE BOOL 
+    "Download and build static portaudio instead of the system library.")
+set(USE_STATIC_SNDFILE FALSE CACHE BOOL
+    "Download and build static sndfile instead of the system library.")
+set(USE_STATIC_SAMPLERATE FALSE CACHE BOOL
+    "Download and build static samplerate instead of the system library.")
+set(USE_STATIC_SOX FALSE CACHE BOOL
+    "Download and build static sox instead of the system library.")
+set(USE_STATIC_CODEC2 FALSE CACHE BOOL
+    "Download and build static codec2 instead of the system library.")
+set(USE_STATIC_SPEEXDSP FALSE CACHE BOOL
+    "Download and build static speex instead of the system library.")
+set(BOOTSTRAP_WXWIDGETS FALSE CACHE BOOL
+    "Download and build static wxWidgets instead of the system library.")
+
+if(USE_STATIC_DEPS)
+    set(USE_STATIC_PORTAUDIO TRUE FORCE)
+    set(USE_STATIC_SNDFILE TRUE FORCE)
+    set(USE_STATIC_SAMPLERATE TRUE FORCE)
+    set(USE_STATIC_SOX TRUE FORCE)
+    set(USE_STATIC_CODEC2 TRUE FORCE)
+endif(USE_STATIC_DEPS)
+
+#
+# Pull in external wxWidgets target if performing static build.
+#
+if(BOOTSTRAP_WXWIDGETS)
+    message(STATUS "Adding wxWidgets build target...")
+    include(cmake/BuildWxWidgets.cmake)
+endif(BOOTSTRAP_WXWIDGETS)
+
+#
+# Perform bootstrap build of wxWidgets
+#
+if(BOOTSTRAP_WXWIDGETS AND NOT EXISTS ${WXCONFIG})
+    message(STATUS "Will perform bootstrap build of wxWidgets.
+   After make step completes, re-run cmake and make again to perform FreeDV build.")
+#
+# Continue normal build if not bootstrapping wxWidgets or is already built.
+#
+else(BOOTSTRAP_WXWIDGETS AND NOT EXISTS ${WXCONFIG})
+
+
+#
+# Various hacks and work arounds for building under MinGW.
+#
+if(MINGW)
+    message(STATUS "System is MinGW.")
+    # Setup HOST variable.
+    include(cmake/MinGW.cmake)
+    # This sets up the exe icon for windows under mingw.
+    set(RES_FILES "")
+    set(RES_FILES "${CMAKE_SOURCE_DIR}/contrib/freedv.rc")
+    set(CMAKE_RC_COMPILER_INIT windres)
+    enable_language(RC)
+    set(CMAKE_RC_COMPILE_OBJECT
+        "<CMAKE_RC_COMPILER> <FLAGS> -O coff <DEFINES> -i <SOURCE> -o <OBJECT>")
+    # These are DLOPEN'ed and can't be automatically pulled in by dependency.
+    foreach(RUNTIME
+        hamlib-adat.dll
+        hamlib-alinco.dll
+        hamlib-amsat.dll
+        hamlib-aor.dll
+        hamlib-ars.dll
+        hamlib-celestron.dll
+        hamlib-drake.dll
+        hamlib-dummy.dll
+        hamlib-easycomm.dll
+        hamlib-flexradio.dll
+        hamlib-fodtrack.dll
+        hamlib-gs232a.dll
+        hamlib-heathkit.dll
+        hamlib-icom.dll
+        hamlib-jrc.dll
+        hamlib-kachina.dll
+        hamlib-kenwood.dll
+        hamlib-kit.dll
+        hamlib-lowe.dll
+        hamlib-m2.dll
+        hamlib-pcr.dll
+        hamlib-prm80.dll
+        hamlib-racal.dll
+        hamlib-rft.dll
+        hamlib-rotorez.dll
+        hamlib-rs.dll
+        hamlib-sartek.dll
+        hamlib-skanti.dll
+        hamlib-spid.dll
+        hamlib-tapr.dll
+        hamlib-tentec.dll
+        hamlib-ts7400.dll
+        hamlib-tuner.dll
+        hamlib-uniden.dll
+        hamlib-winradio.dll
+        hamlib-wj.dll
+        hamlib-yaesu.dll)
+        message(STATUS "Checking for ${RUNTIME}")
+        find_library(${RUNTIME}_LIB ${RUNTIME}
+            PATH_SUFFIXES hamlib)
+        message(STATUS "runtime found: ${${RUNTIME}_LIB}")
+        list(APPEND CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS ${${RUNTIME}_LIB})
+    endforeach()
+    include(InstallRequiredSystemLibraries)
+endif(MINGW)
+
+# Math library is automatic on MinGW
+if(UNIX)
+    set(CMAKE_REQUIRED_INCLUDES math.h)
+    set(CMAKE_REQUIRED_LIBRARIES m)
+endif(UNIX)
+
+# Find some standard headers and functions.
+include(CheckIncludeFiles)
+check_include_files("limits.h" HAVE_LIMITS_H)
+check_include_files("stddef.h" HAVE_STDDEF_H)
+check_include_files("stdlib.h" HAVE_STDLIB_H)
+check_include_files("string.h" HAVE_STRING_H)
+
+include(CheckTypeSize)
+check_type_size("int" SIZEOF_INT)
+
+include(CheckFunctionExists)
+check_function_exists(floor HAVE_FLOOR)
+check_function_exists(memset HAVE_MEMSET)
+check_function_exists(pow HAVE_POW)
+check_function_exists(sqrt HAVE_SQRT)
+
+# fdmdv2_main.h requires patching to find config.h as it current looks in the
+# source directory and the generated file goes in the binary directory.
+configure_file ("${PROJECT_SOURCE_DIR}/cmake/config.h.in"
+                "${PROJECT_BINARY_DIR}/config.h" )
+include_directories(${PROJECT_BINARY_DIR})
+add_definitions(-DHAVE_CONFIG_H)
+
+# Pthread Library
+find_package(Threads REQUIRED)
+message(STATUS "Threads library flags: ${CMAKE_THREAD_LIBS_INIT}")
+
+#
+# Find codec2
+#
+if(NOT USE_STATIC_CODEC2)
+    message(STATUS "Looking for codec2...")
+    find_package(codec2 CONFIG QUIET)
+    if(codec2_FOUND)
+        get_target_property(CODEC2_LIBRARY codec2 LOCATION)
+        message(STATUS "  codec2 library: ${CODEC2_LIBRARY}")
+        message(STATUS "  codec2 headers: ${codec2_INCLUDE_DIRS}")
+    else()
+        # Try to find manually
+        find_path(CODEC2_INCLUDE_DIRS codec2.h
+                  PATH_SUFFIXES codec2)
+        find_library(CODEC2_LIBRARY NAMES codec2)
+        if(CODEC2_LIBRARY AND CODEC2_INCLUDE_DIRS)
+            message(STATUS "  codec2 library: ${CODEC2_LIBRARY}")
+            message(STATUS "  codec2 headers: ${CODEC2_INCLUDE_DIRS}")
+            list(APPEND FREEDV_LINK_LIBS ${CODEC2_LIBRARY})
+            include_directories(${CODEC2_INCLUDE_DIRS})
+        else()
+            message(FATAL_ERROR "codec2 library not found.
+Linux: 
+Codec2 may not be in your distribution so build yourself or use the cmake option to build statically into FreeDV.
+Windws:
+It's easiest to use the cmake option: USE_STATIC_CODEC2"
+        )
+        endif()
+    endif()
+else(NOT USE_STATIC_CODEC2)
+    message(STATUS "Will attempt static build of codec2.")
+    include(cmake/BuildCodec2.cmake)
+endif(NOT USE_STATIC_CODEC2)
+
+#
+# Find or build portaudio Library
+#
+if(NOT USE_STATIC_PORTAUDIO)
+    message(STATUS "Looking for portaudio...")
+    find_package(Portaudio REQUIRED)
+    if(PORTAUDIO_FOUND)
+        message(STATUS "  portaudio library: ${PORTAUDIO_LIBRARIES}")
+        message(STATUS "  portaudio headers: ${PORTAUDIO_INCLUDE_DIRS}")
+        list(APPEND FREEDV_LINK_LIBS ${PORTAUDIO_LIBRARIES})
+        include_directories(${PORTAUDIO_INCLUDE_DIRS})
+    else()
+        message(FATAL_ERROR "portaudio library not found.
+On Linux systems try installing:
+    portaudio-devel  (RPM based systems)
+    libportaudio-dev (DEB based systems)
+On Windows it's easiest to use the cmake option: USE_STATIC_PORTAUDIO"
+        )
+    endif()
+    if(NOT ${PORTAUDIO_VERSION} EQUAL 19)
+        message(WARNING "Portaudio versions other than 19 are known to have issues. You have been warned!")
+    endif()
+else(NOT USE_STATIC_PORTAUDIO)
+    message(STATUS "Will attempt static build of portaudio.")
+    include(cmake/BuildPortaudio.cmake)
+endif(NOT USE_STATIC_PORTAUDIO)
+
+#
+# Hamlib library
+#
+message(STATUS "Looking for hamlib...")
+find_path(HAMLIB_INCLUDE_DIR hamlib/rig.h)
+find_library(HAMLIB_LIBRARY hamlib)
+message(STATUS "Hamlib library: ${HAMLIB_LIBRARY}")
+message(STATUS "Hamlib headers: ${HAMLIB_INCLUDE_DIR}")
+if(HAMLIB_LIBRARY AND HAMLIB_INCLUDE_DIR)
+    message(STATUS "Hamlib library found.")
+    include_directories(${HAMLIB_INCLUDE_DIR})
+    list(APPEND FREEDV_LINK_LIBS ${HAMLIB_LIBRARY})
+else(HAMLIB_LIBRARY AND HAMLIB_INCLUDE_DIR)
+    message(FATAL_ERROR "hamlib not found.
+On Linux systems try installing:
+    hamlib-devel  (RPM based systems)
+    libhamlib-dev (DEB based systems)"
+    )
+endif(HAMLIB_LIBRARY AND HAMLIB_INCLUDE_DIR)
+
+
+#
+# Samplerate Library
+#
+if(NOT USE_STATIC_SAMPLERATE)
+    message(STATUS "Looking for samplerate...")
+    find_library(LIBSAMPLERATE samplerate)
+    find_path(LIBSAMPLERATE_INCLUDE_DIR samplerate.h)
+    message(STATUS "  samplerate library: ${LIBSAMPLERATE}")
+    message(STATUS "  samplerate headers: ${LIBSAMPLERATE_INCLUDE_DIR}")
+    if(LIBSAMPLERATE AND LIBSAMPLERATE_INCLUDE_DIR)
+        list(APPEND FREEDV_LINK_LIBS ${LIBSAMPLERATE})
+        include_directories(${LIBSAMPLERATE_INCLUDE_DIR})
+    else(LIBSTAMPLERATE AND LIBSAMPLERATE_INCLUDE_DIR)
+        message(FATAL_ERROR "samplerate library not found.
+On Linux systems try installing:
+    samplerate-devel  (RPM based systems)
+    libsamplerate-dev (DEB based systems)
+On Windows it's easiest to use the cmake option: USE_STATIC_SAMPLERATE"
+        )
+    endif(LIBSAMPLERATE AND LIBSAMPLERATE_INCLUDE_DIR)
+else(NOT USE_STATIC_SAMPLERATE)
+    message(STATUS "Will attempt static build of samplerate.")
+    include(cmake/BuildSamplerate.cmake)
+endif(NOT USE_STATIC_SAMPLERATE)
+
+#
+# Find sox library
+#
+if(NOT USE_STATIC_SOX)
+    message(STATUS "Looking for sox...")
+    find_library(LIBSOX_LIBRARY sox)
+    find_path(LIBSOX_INCLUDE_DIR NAMES sox/sox.h sox.h)
+    message(STATUS "  sox library: ${LIBSOX_LIBRARY}")
+    message(STATUS "  sox headers: ${LIBSOX_INCLUDE_DIR}")
+    if(LIBSOX_LIBRARY AND LIBSOX_INCLUDE_DIR)
+        list(APPEND FREEDV_LINK_LIBS ${LIBSOX_LIBRARY})
+        include_directories(${LIBSOX_INCLUDE_DIR})
+    else(LIBSOX_LIBRARY AND LIBSOX_INCLUDE_DIR)
+        message(FATAL_ERROR "sox library not found.
+On Linux systems try installing:
+    sox-devel (RPM based systems)
+    libsox-dev (DEB based systems)
+On Windows it's easiest to use the cmake option: USE_STATIC_SOX"
+        )
+    endif(LIBSOX_LIBRARY AND LIBSOX_INCLUDE_DIR)
+else(NOT USE_STATIC_SOX)
+    message(STATUS "Will attempt static build of sox.")
+    include(cmake/BuildSox.cmake)
+endif(NOT USE_STATIC_SOX)
+
+#    
+# sndfile Library
+#
+if(NOT USE_STATIC_SNDFILE)
+    message(STATUS "Looking for sndfile...")
+    find_library(LIBSNDFILE sndfile)
+    find_path(LIBSNDFILE_INCLUDE_DIR sndfile.h)
+    message(STATUS "  sndfile library: ${LIBSNDFILE}")
+    message(STATUS "  sndfile headers: ${LIBSNDFILE_INCLUDE_DIR}")
+    if(LIBSNDFILE AND LIBSNDFILE_INCLUDE_DIR)
+        list(APPEND FREEDV_LINK_LIBS ${LIBSNDFILE})
+    else(LIBSNDFILE AND LIBSNDFILE_INCLUDE_DIR)
+        message(FATAL_ERROR "sndfile library not found.
+On Linux systems try installing:
+    libsndfile-devel (RPM based systems)
+    libsndfile-dev   (DEB based systems)
+On Windows it's easiest to use the cmake option: USE_STATIC_SNDFILE"
+        )
+    endif(LIBSNDFILE AND LIBSNDFILE_INCLUDE_DIR)
+else(NOT USE_STATIC_SNDFILE)
+    message(STATUS "Will attempt static build of sndfile.")
+    include(cmake/BuildSndfile.cmake)
+endif(NOT USE_STATIC_SNDFILE)
+
+#
+# Find wxWidgets
+#
+if(NOT BOOTSTRAP_WXWIDGETS)
+    set(WXCONFIG "" CACHE FILEPATH "Location of wx-config binary.")
+    set(WXRC "" CACHE FILEPATH "Location of wxrc binary.")
+endif(NOT BOOTSTRAP_WXWIDGETS)
+#if(BOOTSTRAP_WXWIDGETS)
+#    set(WXCONFIG "${CMAKE_BINARY_DIR}/external/dist/bin/wx-config")
+#    set(WXRC "${CMAKE_BINARY_DIR}/external/dist/bin/wxrc")
+#    list(APPEND FREEDV_STATIC_DEPS wxWidgets)
+#endif(BOOTSTRAP_WXWIDGETS)
+message(STATUS "Looking for wxWidgets...")
+if(WXCONFIG)
+    message(STATUS "wx-config: ${WXCONFIG}")
+    set(wxWidgets_CONFIG_EXECUTABLE ${WXCONFIG})
+endif(WXCONFIG)
+if(WXRC)
+    message(STATUS "wxrc: ${WXRC}")
+    set(wxWidgets_wxrc_EXECUTABLE ${WXRC})
+endif(WXRC)
+set(WX_VERSION_MIN 3.0.0)
+find_package(wxWidgets REQUIRED core base aui html net adv)
+execute_process(COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}" --version
+    OUTPUT_VARIABLE WX_VERSION)
+string(STRIP ${WX_VERSION} WX_VERSION)
+if(WX_VERSION VERSION_EQUAL ${WX_VERSION_MIN}
+    OR WX_VERSION VERSION_GREATER ${WX_VERSION_MIN})
+   message(STATUS "wxWidgets version: ${WX_VERSION}")
+else()
+    message(FATAL_ERROR "wxWidgets must be installed on your system.
+Please check that wx-config is in path, the directory
+where wxWidgets libraries are installed (returned by
+'wx-config --libs' or 'wx-config --static --libs' command)
+is in LD_LIBRARY_PATH or equivalent variable and
+wxWidgets version is ${WX_VERSION_MIN} or above.")
+endif()
+if(wxWidgets_FOUND)
+    include("${wxWidgets_USE_FILE}")
+    list(APPEND FREEDV_LINK_LIBS ${wxWidgets_LIBRARIES})
+endif(wxWidgets_FOUND)
+
+#
+# Find speex library
+#
+if(NOT USE_STATIC_SPEEXDSP)
+    message(STATUS "Looking for Speex DSP library.")
+    find_path(SPEEXDSP_INCLUDE_DIR speex/speex.h)
+    find_library(SPEEXDSP_LIBRARY speexdsp)
+    message(STATUS "  Speex DSP headers: ${SPEEXDSP_INCLUDE_DIR}")
+    message(STATUS "  Speex DSP library: ${SPEEXDSP_LIBRARY}")
+    if(SPEEXDSP_INCLUDE_DIR AND SPEEXDSP_LIBRARY)
+        include_directories(${SPEEXDSP_INCLUDE_DIR})
+        list(APPEND FREEDV_LINK_LIBS ${SPEEXDSP_LIBRARY})
+    else(SPEEXDSP_INCLUDE_DIR AND SPEEXDSP_LIBRARY)
+        message(FATAL_ERROR "Speex DSP library not found!")
+    endif(SPEEXDSP_INCLUDE_DIR AND SPEEXDSP_LIBRARY)
+else()
+    message(STATUS "Will attempt static build of speex.")
+    include(cmake/BuildSpeex.cmake)
+endif()
+    
+#Freedv 
+add_subdirectory(src)
+
+# Icons and desktop file
+add_subdirectory(contrib)
+
+message(STATUS "Build type will be: ${CMAKE_BUILD_TYPE}")
+
+#
+# Cpack NSIS configuration for Windows.
+#
+if(WIN32)
+    # Detect if we're doing a 32-bit or 64-bit windows build.
+    if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
+        set(CMAKE_CL_64 TRUE)
+    endif()
+    if(NOT ${CMAKE_BUILD_TYPE} STREQUAL "Debug")
+        set(CPACK_STRIP_FILES TRUE)
+    endif()
+    configure_file(cmake/GetDependencies.cmake.in cmake/GetDependencies.cmake
+        @ONLY
+    )
+    install(SCRIPT ${CMAKE_BINARY_DIR}/cmake/GetDependencies.cmake)
+    set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "HF Digital Voice for Radio Amateurs")
+    set(CPACK_PACKAGE_VENDOR "CMake")
+    #set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
+    set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
+    set(CPACK_PACKAGE_VERSION_MAJOR ${FREEDV_VERSION_MAJOR})
+    set(CPACK_PACKAGE_VERSION_MINOR ${FREEDV_VERSION_MINOR})
+    # CPack expects a patch level version so set it here and override if we
+    # are actually setting one.
+    set(CPACK_PACKAGE_VERSION_PATCH 0)
+    if(FREEDV_VERSION_PATCH)
+        set(CPACK_PACKAGE_VERSION_PATCH ${FREEDV_VERSION_PATCH})
+    endif()
+    if(FREEDV_VERSION_SUFFIX)
+        set(CPACK_PACKAGE_VERSION_PATCH "${CPACK_PACKAGE_VERSION_PATCH}-${FREEDV_VERSION_SUFFIX}")
+    endif()
+    # There is a bug in NSI that does not handle full unix paths properly. Make
+    # sure there is at least one set of four (4) backlasshes.
+    #set(CPACK_PACKAGE_ICON "${CMake_SOURCE_DIR}/Utilities/Release\\\\InstallIcon.bmp")
+    set(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\freedv.exe")
+    set(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}")
+    set(CPACK_NSIS_PACKAGE_NAME "FreeDV")
+    set(CPACK_NSIS_URL_INFO_ABOUT "http://freedv.org")
+    set(CPACK_NSIS_MODIFY_PATH OFF)
+    set(CPACK_NSIS_MENU_LINKS "http://freedv.org" "FreeDV Homepage")
+    include(CPack)
+endif(WIN32)
+
+endif(BOOTSTRAP_WXWIDGETS AND NOT EXISTS ${WXCONFIG})
diff --git a/freedv/tags/0.99-Beta/COPYING b/freedv/tags/0.99-Beta/COPYING
new file mode 100644 (file)
index 0000000..cfd4e99
--- /dev/null
@@ -0,0 +1,502 @@
+                  GNU LESSER GENERAL PUBLIC LICENSE
+                       Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+                            Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+  When we speak of free software, we are referring to freedom of use,
+not price.  Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+\f
+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard.  To achieve this, non-free programs must be
+allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+\f
+                  GNU LESSER GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+\f
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+\f
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+\f
+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+\f
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+\f
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+\f
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+                            NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+                     END OF TERMS AND CONDITIONS
+\f
+           How to Apply These Terms to Your New Libraries
+
+  If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change.  You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+  To apply these terms, attach the following notices to the library.  It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the library's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, see
+    <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+  <signature of Ty Coon>, 1 April 1990
+  Ty Coon, President of Vice
+
+That's all there is to it!
diff --git a/freedv/tags/0.99-Beta/README.txt b/freedv/tags/0.99-Beta/README.txt
new file mode 100644 (file)
index 0000000..f28f204
--- /dev/null
@@ -0,0 +1,274 @@
+==================================
+ Building and installing on Linux
+==================================
+
+Quickstart 1
+-----------
+
+Builds static versions of wxWidgets, portaudio, codec2-dev, which are commonly
+missing on many Linux systems, or of the wrong (older) version.
+
+1/ Assuming the fdmdv2-dev source is checked out into ~/fdmdv2-dev:
+
+  $ sudo apt-get install libgtk2.0-dev libhamlib-dev libsamplerate-dev libasound2-dev libao-dev
+  $ cd fdmdv2-dev
+  $ mkdir build_linux
+  $ cd build_linux
+  $ cmake -DBOOTSTRAP_WXWIDGETS=TRUE ~/fdmdv2-dev
+  $ make
+
+2/ Then you can configure FreeDV using your local codec-dev, something like:
+
+  $ cmake -DCMAKE_BUILD_TYPE=Debug -DBOOTSTRAP_WXWIDGETS=TRUE -DCODEC2_INCLUDE_DIRS=/path/to/codec2-dev/src -DCODEC2_LIBRARY=/path/to/codec2-dev/build_linux/src/libcodec2.so -DUSE_STATIC_CODEC2=FALSE -DUSE_STATIC_PORTAUDIO=TRUE -DUSE_STATIC_SOX=TRUE ../
+
+3/ OR build a local copy of codec2-dev:
+
+  $ cmake -DBOOTSTRAP_WXWIDGETS=TRUE -DUSE_STATIC_CODEC2=TRUE -DUSE_STATIC_PORTAUDIO=TRUE -DUSE_STATIC_SOX=TRUE ../
+  
+4/ Build and run FreeDV:
+
+   $ make
+   $ ./src/freedv
+
+Quickstart 2
+------------
+
+1/ Assuming you have all the dependant libraries:
+
+  $ cd /path/to/fdmdv2
+  $ mkdir build_linux
+  $ cd build_linux
+  $ cmake ../ (defaults to /usr/local, use CMAKE_INSTALL_PREFIX to override)
+  (if no errors)
+  $ make
+  (as root)
+  $ make install
+
+
+=======================================================
+ Building for Windows on Ubuntu Linux (Cross compiling)
+=======================================================
+
+1/ Install the cross compiling toolchain:
+
+  $ sudo apt-get install mingw-w64
+
+2/ Patch cmake using: http://www.cmake.org/gitweb?p=stage/cmake.git;a=patch;h=33286235048495ceafb636d549d9a4e8891967ae
+
+3/ Checkout a fresh copy of codec2-dev and build for Windows, pointing to the generate_codebook built by a linux build of generate_codebook, using this cmake line
+
+  $ cmake .. -DCMAKE_TOOLCHAIN_FILE=../fdmdv2-dev/cmake/Toolchain-Ubuntu-mingw32.cmake -DUNITTEST=FALSE -DGENERATE_CODEBOOK=/home/david/codec2-dev/build_linux/src/generate_codebook 
+
+4/ Build WxWidgets
+
+  $ cd /path/to/fdmdv2-dev
+  $ mkdir build_windows
+  $ cd build_windows
+  $ cmake -DBOOTSTRAP_WXWIDGETS=TRUE .. -DCMAKE_TOOLCHAIN_FILE=cmake/Toolchain-Ubuntu-mingw32.cmake -DCMAKE_BUILD_TYPE=Debug
+  $ make
+
+5/ Download and install the Windows version of Hamlib:
+
+  $ wget http://internode.dl.sourceforge.net/project/hamlib/hamlib/1.2.15.3/hamlib-win32-1.2.15.3.zip
+  $ unzip hamlib-win32-1.2.15.3.zip
+
+6/ Build All the libraries and FreeDV:
+
+  $ cmake -DBOOTSTRAP_WXWIDGETS=TRUE -DCMAKE_TOOLCHAIN_FILE=cmake/Toolchain-Ubuntu-mingw32.cmake -DUSE_STATIC_PORTAUDIO=TRUE -DUSE_STATIC_SNDFILE=TRUE -DUSE_STATIC_SAMPLERATE=TRUE -DUSE_STATIC_SOX=TRUE -DUSE_STATIC_CODEC2=FALSE -DCODEC2_INCLUDE_DIRS=/home/david/tmp/codec2-dev/src -DCODEC2_LIBRARY=/home/david/tmp/codec2-dev/build_windows/src/libcodec2.dll.a -DHAMLIB_INCLUDE_DIR=hamlib-win32-1.2.15.3/include -DHAMLIB_LIBRARY=hamlib-win32-1.2.15.3/lib/gcc/libhamlib.dll.a -DCMAKE_BUILD_TYPE=Debug ..
+  $ make
+
+====================================
+ Building and installing on Windows
+====================================
+
+The windows build is similar to linux and follows the same basic workflow,
+however, while codec2 and FreeDV (fdmdv2) build well on windows, some of the
+dependencies do not. For that reson current windows releases are cross-compiled
+from linux.
+
+Only MinGW is supported. While it is likely possible to perform a pure MinGW
+build, installing MSYS2 will make your life easier.
+
+CMake may not automatically detect that you're in the MSYS environment. If this
+occurs you need to pass cmake the proper generator:
+
+cmake -G"MSYS Makefiles" [other options] </path/to/source>
+
+===============================
+ Bootstrapping wxWidgets build
+===============================
+
+If wxWidgets (>= 3.0) is not available then one option is to have CMake boot-
+strap the build for FreeDV.
+
+This is required because the tool wx-config is used to get the correct compiler
+and linker flags of the wxWidgets components needed by FreeDV. Since this is
+normally done at configure time, not during "make", it is not possible for CMake
+or have this information prior to building wxWidgets.
+
+In order to work around this issue you can "bootstrap" the wxWidgets build using
+the CMake option, "BOOTSTRAP_WXWIDGETS". wxWidgets will be built using static
+libraries.
+
+NOTE: This forces "USE_STATIC_WXWIDGETS" to be true internally regarless of the
+value set manually.
+
+(from any directory, but empty directory outside of the source is prefered.)
+$ cmake -DBOOTSTRAP_WXWIDGETS=TRUE /path/to/fdmdv2
+$ make
+(wxWidgets is downloaded and built)
+$ cmake .
+(wxWidgets build should be detected)
+$ make
+(if all goes well, as root)
+$ make install
+
+====================================
+ Building and installing on OSX
+====================================
+
+====================================
+ Building and installing on FreeBSD
+====================================
+
+As per "Quickstart 2" above but change build_linux to build_freebsd
+
+=======
+Editing
+=======
+
+Please make sure your text editor does not insert tabs, and
+used indents of 4 spaces.  The following .emacs code was used to
+configure emacs:
+
+(setq-default indent-tabs-mode nil)
+
+(add-hook 'c-mode-common-hook
+          (function (lambda ()
+                      (setq c-basic-offset 4)
+                      )))
+
+====
+TODO
+====
+
+[ ] Open R&D questions
+    + Goal is to develop an open source DV mode that performs comparably to SSB
+    [ ] Does 700 perform OK next to SSB?
+        + approx same tx pk level (hard to measure exactly)
+        + try some low SNR channels
+        + try some fast fading/nasty channels
+    [ ] Is 700 speech quality acceptable?
+
+[X] test frames 
+    [X] freedv API support
+    [X] BER displayed on GUI for 700 and 1600
+    [X] plot error patterns for 700 and 1600
+        + callback for error patterns, or poll via stats interface
+    [X] plot error histograms for 700 and 1600
+        + map bit error to carrier, have done this in tcohpsk?
+        + how to reset histogram?  On error reset?
+        + histogram screen ... new code?
+        + test with filter
+
+[X] Bugs
+    [X] resync issue
+    [X] equalise power on 700 and 1600
+    [X] research real and complex PAPR
+    [X] waterfall and spectrum in analog mode
+    [X] The waterfall in analog mode appears to quit working sometimes?
+
+    [X] On TX, intermittently PTT will cause signal to be heard in speakers.  Toggle PTT or 
+        Stop/Start toggle and then starts working.
+    [X] Squelch control on 1600 mode will not open up squelch to 0 (appears to be around 2 dB)
+    [X] space bar keys PTT when entering text info box
+    [X] checksum based txt reception
+        + only print if valid
+    [X] IC7200 audio breakup
+    [ ] short varicode doesn't work
+        + #ifdef-ed out for now
+        + cld be broken in freedv_api
+    [X] On 700 audio sounds tinny and clicky when out of sync compared to 1600 why?
+        + clue: only when analog not pressed
+        + this was 7.5 to 8kHz interpolator bug
+    [X] spectrum and waterfall scale changes when analog pressed
+    [X] ocassional test frames error counter goes crazy
+    [ ] 700 syncs up to 1000Hz sine waves
+        + shouldn't trigger sync logic, will be a problem with carriers
+    [ ] "clip" led, encourage people to adjust gain to hit that occ when speaking
+    [ ] Win32 record from radio time
+
+[ ] FreeDV 700 improvements
+    [ ] bpf filter after clipping to remove clicks
+        [ ] tcohpsk first, measure PAPR, impl loss
+    [ ] error masking
+        [ ] C version
+        [ ] training off air?  Switchable?
+        [ ] excitation params
+        [ ] training
+    [ ] plotting other demod stats like ch ampl and phase ests
+    [ ] profile with perf, different libresample routine
+    [ ] check for occassional freedv 700 loss of sync
+        + scatter seems to jump
+    [ ] switchable diversity (narrowband) option
+        + measure difference on a few channels
+        + blog
+
+[X] win32
+    [X] X-compile works
+    [X] basic installer
+    [X] Win32 installer
+        + Richard has taken care of this
+
+[ ] Small fixes
+    [X] Playfile bug
+    [X] running again
+    [X] bump ver number
+    [X] long varicode default
+    [X] option to _not_ require checksum, on by default
+    [X] default squelch 2dB
+    [X] scatter diagram tweaks
+        + e.g. meaningful plots on fading channels in real time 
+        [X] agc with hysteresis
+            + changed to log steps
+        [X] longer persistance
+            + changed to 6 seconds
+        [X] diversity addtions on 700
+            + still not real obvious on plot
+            + might be useful to make this switchable
+    [X] scatter diagram different colours/carrier
+    [X] remember what mode you were in
+    [ ] cmd line file decode
+    [ ] Waterfall direction
+    [ ] documentation or use, walk through, you tube, blog posts
+
+[ ] Web support for Presence/spotting hooks
+
+=================
+USER GUIDE NOTES
+=================
+
+TODO: Put this in a more usable form, video tutorials etc
+
+1/ Error Histogram.  Displays BER of each carrier when in "test frame"
+ mode.  As each QPSK carrier has 2 bits there are 2*Nc histogram
+ points.
+
+ Ideally all carriers will have about the same BER (+/- 20% after 5000
+ total bit errors).  However problems can occur with filtering in the
+ tx path.  If one carrier has less power, then it will have a higher
+ BER.  The errors in this carrier will tend to dominate overall
+ BER. For example if one carrier is attenuated due to SSB filter
+ ripple in the tx path then the BER on that carrier will be higher.
+ This is bad news for DV.
+
+ Suggested usage: Transmit FreeDV in test frame mode.  Use a 2nd rx
+ (or get a friend) to monitor your rx signal with FreeDV in test frame
+ mode.  Adjust your rx SNR to get a BER of a few % (e.g. reduce tx power,
+ use a short antenna for the rx, point your beam away, adjust rx RF
+ gain).  Monitor the error histogram for a few minutes, until you have
+ say 5000 total bit errors.  You have a problem if the BER of any
+ carrier is more than 20% different from the rest.
+
+  A typical issue will be one carrier at 1.0, the others at 0.5,
+  indicating the poorer carrier BER is twice the larger.
diff --git a/freedv/tags/0.99-Beta/cmake/BuildCodec2.cmake b/freedv/tags/0.99-Beta/cmake/BuildCodec2.cmake
new file mode 100644 (file)
index 0000000..471eef8
--- /dev/null
@@ -0,0 +1,23 @@
+set(SPEEXDSP_CMAKE_ARGS -DBUILD_SHARED_LIBS=FALSE -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/external/dist)
+
+if(USE_STATIC_SPEEXDSP)
+    list(APPEND SPEEXDSP_CMAKE_ARGS 
+        -DSPEEXDSP_LIBRARIES=${CMAKE_BINARY_DIR}/external/dist/lib/libspeexdsp.a
+        -DSPEEXDSP_INCLUDE_DIR=${CMAKE_BINARY_DIR}/external/dist/include)
+endif()
+
+if(CMAKE_CROSSCOMPILING)
+    set(CODEC2_CMAKE_ARGS "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
+endif()
+
+include(ExternalProject)
+ExternalProject_Add(codec2
+   SVN_REPOSITORY https://svn.code.sf.net/p/freetel/code/codec2-dev
+   CMAKE_ARGS ${CODEC2_CMAKE_ARGS} ${SPEEXDSP_CMAKE_ARGS}
+   INSTALL_COMMAND ""
+)
+set(CODEC2_LIBRARIES
+    ${CMAKE_BINARY_DIR}/codec2-prefix/src/codec2-build/src/libcodec2.a)
+include_directories(${CMAKE_BINARY_DIR}/codec2-prefix/src/codec2/src)
+list(APPEND FREEDV_LINK_LIBS ${CODEC2_LIBRARIES})
+list(APPEND FREEDV_STATIC_DEPS codec2)
diff --git a/freedv/tags/0.99-Beta/cmake/BuildPortaudio.cmake b/freedv/tags/0.99-Beta/cmake/BuildPortaudio.cmake
new file mode 100644 (file)
index 0000000..cc33d06
--- /dev/null
@@ -0,0 +1,52 @@
+set(PORTAUDIO_TARBALL "pa_stable_v19_20111121")
+
+# required linking libraries on linux. Not sure about windows.
+find_library(ALSA_LIBRARIES asound)
+
+if(UNIX AND NOT ALSA_LIBRARIES)
+    message(ERROR "Could not find alsa library which is required for portaudio.
+On Linux systems try installing:
+    alsa-lib-devel  (RPM based systems)
+    libasound2-dev  (DEB based systems)"
+    )
+endif()
+
+# Make sure that configure knows what system we're using when cross-compiling.
+if(MINGW AND CMAKE_CROSSCOMPILING)
+    include(cmake/MinGW.cmake)
+    set(CONFIGURE_COMMAND ./configure --build=${HOST} --host=${HOST} --target=${HOST} --enable-cxx --without-jack --disable-shared --prefix=${CMAKE_BINARY_DIR}/external/dist)
+else()
+    set(CONFIGURE_COMMAND ./configure --enable-cxx --without-jack --disable-shared --prefix=${CMAKE_BINARY_DIR}/external/dist)
+endif()
+
+include(ExternalProject)
+ExternalProject_Add(portaudio
+    URL http://www.portaudio.com/archives/${PORTAUDIO_TARBALL}.tgz
+    BUILD_IN_SOURCE 1
+    INSTALL_DIR external/dist
+    CONFIGURE_COMMAND ${CONFIGURE_COMMAND}
+    BUILD_COMMAND $(MAKE)
+    INSTALL_COMMAND $(MAKE) install
+)
+if(WIN32)
+    set(PORTAUDIO_LIBRARIES 
+        ${CMAKE_BINARY_DIR}/external/dist/lib/libportaudio.a
+        ${CMAKE_BINARY_DIR}/external/dist/lib/libportaudiocpp.a
+)
+else(WIN32)
+    find_library(RT rt)
+    find_library(ASOUND asound)
+    set(PORTAUDIO_LIBRARIES
+        ${CMAKE_BINARY_DIR}/external/dist/lib/libportaudio.a
+        ${CMAKE_BINARY_DIR}/external/dist/lib/libportaudiocpp.a
+        ${RT}
+        ${ASOUND}
+    )
+endif(WIN32)
+include_directories(${CMAKE_BINARY_DIR}/external/dist/include)
+
+# Add the portaudio library to the list of libraries that must be linked.
+list(APPEND FREEDV_LINK_LIBS ${PORTAUDIO_LIBRARIES})
+
+# Setup a dependency so that this gets built before linking to freedv.
+list(APPEND FREEDV_STATIC_DEPS portaudio)
diff --git a/freedv/tags/0.99-Beta/cmake/BuildSamplerate.cmake b/freedv/tags/0.99-Beta/cmake/BuildSamplerate.cmake
new file mode 100644 (file)
index 0000000..aa09f85
--- /dev/null
@@ -0,0 +1,27 @@
+set(SAMPLERATE_TARBALL "libsamplerate-0.1.8")
+
+if(MINGW AND CMAKE_CROSSCOMPILING)
+    set(CONFIGURE_COMMAND ./configure --build=${HOST} --host=${HOST} --target=${HOST} --prefix=${CMAKE_BINARY_DIR}/external/dist --disable-sndfile)
+else()
+    set(CONFIGURE_COMMAND ./configure --prefix=${CMAKE_BINARY_DIR}/external/dist)
+endif()
+
+include(ExternalProject)
+ExternalProject_Add(samplerate
+    URL http://www.mega-nerd.com/SRC/${SAMPLERATE_TARBALL}.tar.gz 
+    BUILD_IN_SOURCE 1
+    INSTALL_DIR external/dist
+    CONFIGURE_COMMAND ${CONFIGURE_COMMAND}
+    BUILD_COMMAND $(MAKE)
+    INSTALL_COMMAND $(MAKE) install
+)
+if(WIN32)
+    set(SAMPLERATE_LIBRARIES
+        ${CMAKE_BINARY_DIR}/external/dist/lib/libsamplerate.a)
+else(WIN32)
+    set(SAMPLERATE_LIBRARIES
+        ${CMAKE_BINARY_DIR}/external/dist/lib/libsamplerate.a)
+endif(WIN32)
+include_directories(${CMAKE_BINARY_DIR}/external/dist/include)
+list(APPEND FREEDV_LINK_LIBS ${SAMPLERATE_LIBRARIES})
+list(APPEND FREEDV_STATIC_DEPS samplerate)
diff --git a/freedv/tags/0.99-Beta/cmake/BuildSndfile.cmake b/freedv/tags/0.99-Beta/cmake/BuildSndfile.cmake
new file mode 100644 (file)
index 0000000..43233fb
--- /dev/null
@@ -0,0 +1,26 @@
+set(SNDFILE_TARBALL "libsndfile-1.0.25")
+
+if(MINGW AND CMAKE_CROSSCOMPILING)
+    set(CONFIGURE_COMMAND ./configure --host=${HOST}  --prefix=${CMAKE_BINARY_DIR}/external/dist --disable-external-libs --disable-shared)
+else()
+    set(CONFIGURE_COMMAND ./configure --prefix=${CMAKE_BINARY_DIR}/external/dist --disable-external-libs --disable-shared --disable-external-libs)
+endif()
+
+include(ExternalProject)
+ExternalProject_Add(sndfile
+    URL http://www.mega-nerd.com/libsndfile/files/${SNDFILE_TARBALL}.tar.gz
+    BUILD_IN_SOURCE 1
+    INSTALL_DIR external/dist
+    CONFIGURE_COMMAND ${CONFIGURE_COMMAND}
+    BUILD_COMMAND $(MAKE) V=1
+    INSTALL_COMMAND $(MAKE) install
+)
+if(MINGW)
+    set(SNDFILE_LIBRARIES ${CMAKE_BINARY_DIR}/external/dist/lib/libsndfile.a)
+else()
+    set(SNDFILE_LIBRARIES ${CMAKE_BINARY_DIR}/external/dist/lib/libsndfile.a)
+endif()
+
+include_directories(${CMAKE_BINARY_DIR}/external/dist/include)
+list(APPEND FREEDV_LINK_LIBS ${SNDFILE_LIBRARIES})
+list(APPEND FREEDV_STATIC_DEPS sndfile)
diff --git a/freedv/tags/0.99-Beta/cmake/BuildSox.cmake b/freedv/tags/0.99-Beta/cmake/BuildSox.cmake
new file mode 100644 (file)
index 0000000..d54488b
--- /dev/null
@@ -0,0 +1,48 @@
+set(SOX_TARBALL "sox-14.4.1")
+
+# required linking libraries on linux. Not sure about windows.
+find_library(ALSA_LIBRARIES asound)
+find_library(AO_LIBRARIES ao)
+find_library(GSM_LIBRARIES gsm)
+
+if(UNIX AND NOT ALSA_LIBRARIES)
+    message(ERROR "Could not find alsa library.
+On Linux systems try installing:
+    alsa-lib-devel  (RPM based systems)
+    libasound2-dev  (DEB based systems)"
+    )
+endif(UNIX AND NOT ALSA_LIBRARIES)
+
+if(UNIX AND NOT AO_LIBRARIES)
+    message(ERROR "Could not find libao.
+On Linux systems try installing:
+    libao-devel  (RPM based systems)
+    libao-dev    (DEB based systems)"
+    )
+endif(UNIX AND NOT AO_LIBRARIES)
+
+if(MINGW AND CMAKE_CROSSCOMPILING)
+    set(CONFIGURE_COMMAND ./configure --host=${HOST} --enable-shared=no --without-id3tag --without-png --disable-gomp --with-oggvorbis=no --with-oss=no --with-flac=no --with-amrnb=no --with-amrwb=no --with-mp3=no --with-wavpack=no --disable-dl-sndfile --with-pulseaudio=no --without-magic --with-gsm --prefix=${CMAKE_BINARY_DIR}/external/dist)
+else()
+    set(CONFIGURE_COMMAND ./configure --enable-shared=no --without-id3tag --without-png --disable-gomp --with-oggvorbis=no --with-oss=no --with-flac=no --with-amrnb=no --with-amrwb=no --with-mp3=no --with-wavpack=no --disable-dl-sndfile --with-pulseaudio=no --without-magic --with-gsm --prefix=${CMAKE_BINARY_DIR}/external/dist)
+endif()
+
+include(ExternalProject)
+ExternalProject_Add(sox
+    URL http://downloads.sourceforge.net/sox/${SOX_TARBALL}.tar.gz
+    BUILD_IN_SOURCE 1
+    INSTALL_DIR external/dist
+    CONFIGURE_COMMAND ${CONFIGURE_COMMAND}
+    BUILD_COMMAND $(MAKE) V=1
+    INSTALL_COMMAND $(MAKE) install
+)
+set(SOX_LIBRARIES ${CMAKE_BINARY_DIR}/external/dist/lib/libsox.a)
+if(UNIX)
+    list(APPEND SOX_LIBRARIES ${ALSA_LIBRARIES} ${AO_LIBRARIES} ${GSM_LIBRARIES})
+endif()
+if(MINGW)
+    list(APPEND SOX_LIBRARIES winmm)
+endif()
+include_directories(${CMAKE_BINARY_DIR}/external/dist/include)
+list(APPEND FREEDV_LINK_LIBS ${SOX_LIBRARIES})
+list(APPEND FREEDV_STATIC_DEPS sox)
diff --git a/freedv/tags/0.99-Beta/cmake/BuildSpeex.cmake b/freedv/tags/0.99-Beta/cmake/BuildSpeex.cmake
new file mode 100644 (file)
index 0000000..262d558
--- /dev/null
@@ -0,0 +1,26 @@
+set(SPEEXDSP_TARBALL "speexdsp-1.2rc3.tar.gz")
+
+if(MINGW AND CMAKE_CROSSCOMPILING)
+    include(cmake/MinGW.cmake)
+    set(CONFIGURE_COMMAND ./configure --host=${HOST} --prefix=${CMAKE_BINARY_DIR}/external/dist --disable-examples)
+else()
+    set(CONFIGURE_COMMAND ./configure --prefix=${CMAKE_BINARY_DIR}/external/dist --disable-examples)
+endif()
+
+include(ExternalProject)
+ExternalProject_Add(speex
+   URL http://downloads.xiph.org/releases/speex/${SPEEXDSP_TARBALL}
+   BUILD_IN_SOURCE 1
+   INSTALL_DIR external/dist
+   CONFIGURE_COMMAND ${CONFIGURE_COMMAND}
+   BUILD_COMMAND $(MAKE)
+   INSTALL_COMMAND $(MAKE) install
+)
+
+set(SPEEXDSP_LIBRARIES ${CMAKE_BINARY_DIR}/external/dist/lib/libspeexdsp.a)
+include_directories(${CMAKE_BINARY_DIR}/external/dist/include)
+list(APPEND FREEDV_LINK_LIBS ${SPEEXDSP_LIBRARIES})
+list(APPEND FREEDV_STATIC_DEPS speex)
+if(USE_STATIC_CODEC2)
+    add_dependencies(codec2 speex)
+endif()
diff --git a/freedv/tags/0.99-Beta/cmake/BuildWxWidgets.cmake b/freedv/tags/0.99-Beta/cmake/BuildWxWidgets.cmake
new file mode 100644 (file)
index 0000000..901d806
--- /dev/null
@@ -0,0 +1,43 @@
+set(WXWIDGETS_TARBALL "wxWidgets-3.0.2")
+
+# If we're cross-compiling then we need to set the target host manually.
+if(MINGW AND CMAKE_CROSSCOMPILING)
+    include(cmake/MinGW.cmake)
+endif()
+
+# If not cross-compiling then use the built-in makefile, otherwise use standard configure.
+if(MINGW AND NOT CMAKE_CROSSCOMPILING)
+#    set(CONFIGURE_COMMAND "true")
+#    set(MAKE_COMMAND $(MAKE) -C build/msw -f makefile.gcc SHARED=0 UNICODE=1 BUILD=release PREFIX=${CMAKE_BINARY_DIR}/external/dist)
+    set(CONFIGURE_COMMAND ./configure --disable-shared --prefix=${CMAKE_BINARY_DIR}/external/dist)
+       set(MAKE_COMMAND $(MAKE))
+endif()
+
+if(MINGW AND CMAKE_CROSSCOMPILING)
+    set(CONFIGURE_COMMAND ./configure --build=${HOST} --host=${HOST} --target=${HOST} --disable-shared --prefix=${CMAKE_BINARY_DIR}/external/dist)
+       set(MAKE_COMMAND $(MAKE))
+endif()
+
+if(NOT MINGW)
+    set(CONFIGURE_COMMAND ./configure --host=${HOST} --target=${HOST} --disable-shared --prefix=${CMAKE_BINARY_DIR}/external/dist)
+       set(MAKE_COMMAND $(MAKE))
+endif()
+
+include(ExternalProject)
+ExternalProject_Add(wxWidgets
+    URL http://downloads.sourceforge.net/wxwindows/${WXWIDGETS_TARBALL}.tar.bz2
+    BUILD_IN_SOURCE 1
+    INSTALL_DIR external/dist
+    CONFIGURE_COMMAND ${CONFIGURE_COMMAND}
+    BUILD_COMMAND ${MAKE_COMMAND}
+    INSTALL_COMMAND $(MAKE) install
+)
+
+ExternalProject_Get_Property(wxWidgets install_dir)
+message(STATUS "wxWidgets install dir: ${install_dir}")
+if(NOT WXCONFIG)
+    set(WXCONFIG "${install_dir}/bin/wx-config")
+endif()
+if(EXISTS ${WXCONFIG})
+    set(BS_WX_DONE TRUE)
+endif()
diff --git a/freedv/tags/0.99-Beta/cmake/FindPortaudio.cmake b/freedv/tags/0.99-Beta/cmake/FindPortaudio.cmake
new file mode 100644 (file)
index 0000000..158e20e
--- /dev/null
@@ -0,0 +1,107 @@
+# - Try to find Portaudio
+# Once done this will define
+#
+#  PORTAUDIO_FOUND - system has Portaudio
+#  PORTAUDIO_INCLUDE_DIRS - the Portaudio include directory
+#  PORTAUDIO_LIBRARIES - Link these to use Portaudio
+#  PORTAUDIO_DEFINITIONS - Compiler switches required for using Portaudio
+#  PORTAUDIO_VERSION - Portaudio version
+#
+#  Copyright (c) 2006 Andreas Schneider <mail@cynapses.org>
+#
+# Redistribution and use is allowed according to the terms of the New BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+#
+
+
+if (PORTAUDIO_LIBRARIES AND PORTAUDIO_INCLUDE_DIRS)
+  # in cache already
+  set(PORTAUDIO_FOUND TRUE)
+else (PORTAUDIO_LIBRARIES AND PORTAUDIO_INCLUDE_DIRS)
+  if (NOT WIN32)
+   include(FindPkgConfig)
+   pkg_check_modules(PORTAUDIO2 portaudio-2.0)
+  endif (NOT WIN32)
+
+  if (PORTAUDIO2_FOUND)
+    set(PORTAUDIO_INCLUDE_DIRS
+      ${PORTAUDIO2_INCLUDE_DIRS}
+    )
+    if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+      set(PORTAUDIO_LIBRARIES "${PORTAUDIO2_LIBRARY_DIRS}/lib${PORTAUDIO2_LIBRARIES}.dylib")
+    else (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+      set(PORTAUDIO_LIBRARIES
+        ${PORTAUDIO2_LIBRARIES}
+      )
+    endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+    set(PORTAUDIO_VERSION
+      19
+    )
+    set(PORTAUDIO_FOUND TRUE)
+  else (PORTAUDIO2_FOUND)
+    find_path(PORTAUDIO_INCLUDE_DIR
+      NAMES
+        portaudio.h
+      PATHS
+        /usr/include
+        /usr/local/include
+        /opt/local/include
+        /sw/include
+    )
+   
+    find_library(PORTAUDIO_LIBRARY
+      NAMES
+        portaudio
+      PATHS
+        /usr/lib
+        /usr/local/lib
+        /opt/local/lib
+        /sw/lib
+    )
+   
+    find_path(PORTAUDIO_LIBRARY_DIR
+      NAMES
+        portaudio
+      PATHS
+        /usr/lib
+        /usr/local/lib
+        /opt/local/lib
+        /sw/lib
+    )
+   
+    set(PORTAUDIO_INCLUDE_DIRS
+      ${PORTAUDIO_INCLUDE_DIR}
+    )
+    set(PORTAUDIO_LIBRARIES
+      ${PORTAUDIO_LIBRARY}
+    )
+   
+    set(PORTAUDIO_LIBRARY_DIRS
+      ${PORTAUDIO_LIBRARY_DIR}
+    )
+   
+    set(PORTAUDIO_VERSION
+      18
+    )
+   
+    if (PORTAUDIO_INCLUDE_DIRS AND PORTAUDIO_LIBRARIES)
+       set(PORTAUDIO_FOUND TRUE)
+    endif (PORTAUDIO_INCLUDE_DIRS AND PORTAUDIO_LIBRARIES)
+   
+    if (PORTAUDIO_FOUND)
+      if (NOT Portaudio_FIND_QUIETLY)
+        message(STATUS "Found Portaudio: ${PORTAUDIO_LIBRARIES}")
+      endif (NOT Portaudio_FIND_QUIETLY)
+    else (PORTAUDIO_FOUND)
+      if (Portaudio_FIND_REQUIRED)
+        message(FATAL_ERROR "Could not find Portaudio")
+      endif (Portaudio_FIND_REQUIRED)
+    endif (PORTAUDIO_FOUND)
+  endif (PORTAUDIO2_FOUND)
+
+
+  # show the PORTAUDIO_INCLUDE_DIRS and PORTAUDIO_LIBRARIES variables only in the advanced view
+  mark_as_advanced(PORTAUDIO_INCLUDE_DIRS PORTAUDIO_LIBRARIES)
+
+endif (PORTAUDIO_LIBRARIES AND PORTAUDIO_INCLUDE_DIRS)
+
diff --git a/freedv/tags/0.99-Beta/cmake/GetDependencies.cmake.in b/freedv/tags/0.99-Beta/cmake/GetDependencies.cmake.in
new file mode 100644 (file)
index 0000000..93204dd
--- /dev/null
@@ -0,0 +1,25 @@
+# As this script is run in a new cmake instance, it does not have access to
+# the existing cache variables. Pass them in via the configure_file command.
+set(CMAKE_BINARY_DIR @CMAKE_BINARY_DIR@)
+set(CMAKE_SOURCE_DIR @CMAKE_SOURCE_DIR@)
+set(UNIX @UNIX@)
+set(WIN32 @WIN32@)
+set(CMAKE_CROSSCOMPILING @CMAKE_CROSSCOMPILING@)
+set(CMAKE_FIND_LIBRARY_SUFFIXES @CMAKE_FIND_LIBRARY_SUFFIXES@)
+set(CMAKE_FIND_LIBRARY_PREFIXES @CMAKE_FIND_LIBRARY_PREFIXES@)
+set(CMAKE_SYSTEM_LIBRARY_PATH @CMAKE_SYSTEM_LIBRARY_PATH@)
+set(CMAKE_FIND_ROOT_PATH @CMAKE_FIND_ROOT_PATH@)
+
+set(FREEDV_EXE ${CMAKE_BINARY_DIR}/src/freedv.exe)
+
+include(GetPrerequisites)
+get_prerequisites("${FREEDV_EXE}" _deps 1 1 "" "${CMAKE_SYSTEM_LIBRARY_PATH}")
+foreach(_runtime ${_deps})
+    message("Looking for ${_runtime}")
+    find_library(RUNTIME_${_runtime} ${_runtime})
+    message("${RUNTIME_${_runtime}}")
+    if(RUNTIME_${_runtime})
+        file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/bin"
+        TYPE EXECUTABLE FILES "${RUNTIME_${_runtime}}")
+    endif()
+endforeach()
diff --git a/freedv/tags/0.99-Beta/cmake/MinGW.cmake b/freedv/tags/0.99-Beta/cmake/MinGW.cmake
new file mode 100644 (file)
index 0000000..333c1dc
--- /dev/null
@@ -0,0 +1,8 @@
+# If we're cross-compiling then we need to set the target host manually.
+if(MINGW AND CMAKE_CROSSCOMPILING)
+    if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
+        set(HOST x86_64-w64-mingw32)
+    else()
+        set(HOST i686-w64-mingw32)
+    endif()
+endif()
diff --git a/freedv/tags/0.99-Beta/cmake/Toolchain-Ubuntu-mingw32.cmake b/freedv/tags/0.99-Beta/cmake/Toolchain-Ubuntu-mingw32.cmake
new file mode 100644 (file)
index 0000000..3507d72
--- /dev/null
@@ -0,0 +1,25 @@
+# Sample toolchain file for building for Windows from an Ubuntu Linux system.
+#
+# Typical usage:
+#    *) install cross compiler: `sudo apt-get install mingw-w64 g++-mingw-w64`
+#    *) cd build
+#    *) cmake -DCMAKE_TOOLCHAIN_FILE=~/Toolchain-Ubuntu-mingw32.cmake ..
+
+set(CMAKE_SYSTEM_NAME Windows)
+set(TOOLCHAIN_PREFIX i686-w64-mingw32)
+
+# cross compilers to use for C and C++
+set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc)
+set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
+set(CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres)
+
+# target environment on the build host system
+#   set 1st to dir with the cross compiler's C/C++ headers/libs
+set(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX})
+
+# modify default behavior of FIND_XXX() commands to
+# search for headers/libs in the target environment and
+# search for programs in the build host environment
+set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
diff --git a/freedv/tags/0.99-Beta/cmake/config.h.in b/freedv/tags/0.99-Beta/cmake/config.h.in
new file mode 100644 (file)
index 0000000..8e3ab76
--- /dev/null
@@ -0,0 +1,19 @@
+/*--------------------------------------------------------------------------
+ ** This file is autogenerated from config.h.in 
+ ** during the cmake configuration of your project. If you need to make changes
+ ** edit the original file NOT THIS FILE.
+ ** --------------------------------------------------------------------------*/
+#ifndef _CONFIGURATION_HEADER_GUARD_H_
+#define _CONFIGURATION_HEADER_GUARD_H_
+
+#define SIZEOF_INT @SIZEOF_INT@
+#cmakedefine HAVE_LIMITS_H @HAVE_LIMITS_H@
+#cmakedefine HAVE_STDINT_H @HAVE_STDINT_H@
+#cmakedefine HAVE_STDDEF_H @HAVE_STDDEF_H@
+#cmakedefine HAVE_STDLIB_H @HAVE_STDLIB_H@
+#cmakedefine HAVE_STRING_H @HAVE_STRING_H@
+#cmakedefine HAVE_FLOOR @HAVE_FLOOR@
+#cmakedefine HAVE_MEMSET @HAVE_MEMSET@
+#cmakedefine HAVE_POW @HAVE_POW@
+#cmakedefine HAVE_SQRT @HAVE_SQRT@
+#endif
diff --git a/freedv/tags/0.99-Beta/cmake/version.h.in b/freedv/tags/0.99-Beta/cmake/version.h.in
new file mode 100644 (file)
index 0000000..43b3b7a
--- /dev/null
@@ -0,0 +1,11 @@
+#ifndef FREEDV_VER_DOT_H
+#define FREEDV_VER_DOT_H 1
+
+#define FREEDV_VERSION_MAJOR @FREEDV_VERSION_MAJOR@
+#define FREEDV_VERSION_MINOR @FREEDV_VERSION_MINOR@
+#define FREEDV_VERSION_PATCH @FREEDV_VERSION_PATCH@
+#define FREEDV_VERSION_SUFFIX "@FREEDV_VERSION_SUFFIX@"
+
+#define FREEDV_VERSION "@FREEDV_VERSION_STRING@"
+
+#endif //FREEDV_VER_DOT_H
diff --git a/freedv/tags/0.99-Beta/contrib/CMakeLists.txt b/freedv/tags/0.99-Beta/contrib/CMakeLists.txt
new file mode 100644 (file)
index 0000000..3f4b7e0
--- /dev/null
@@ -0,0 +1,22 @@
+# Install icons if we're on most *nix systems.
+if(UNIX AND NOT APPLE)
+    set(ICON_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor
+        CACHE PATH "Prefix to use for installing icons.")
+    install(FILES freedv48x48.png
+        DESTINATION ${ICON_INSTALL_PREFIX}/48x48/apps
+        RENAME freedv.png)
+    install(FILES freedv64x64.png
+        DESTINATION ${ICON_INSTALL_PREFIX}/64x64/apps
+        RENAME freedv.png)
+    install(FILES freedv128x128.png
+        DESTINATION ${ICON_INSTALL_PREFIX}/128x128/apps
+        RENAME freedv.png)
+    install(FILES freedv256x256.png
+        DESTINATION ${ICON_INSTALL_PREFIX}/256x256/apps
+        RENAME freedv.png)
+
+    set(DESKTOP_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/applications
+        CACHE PATH "Location to install desktop files.")
+    install(FILES freedv.desktop
+        DESTINATION ${DESKTOP_INSTALL_DIR})
+endif(UNIX AND NOT APPLE)
diff --git a/freedv/tags/0.99-Beta/contrib/LICENSE b/freedv/tags/0.99-Beta/contrib/LICENSE
new file mode 100644 (file)
index 0000000..dc8853a
--- /dev/null
@@ -0,0 +1,393 @@
+Attribution 4.0 International
+
+=======================================================================
+
+Creative Commons Corporation ("Creative Commons") is not a law firm and
+does not provide legal services or legal advice. Distribution of
+Creative Commons public licenses does not create a lawyer-client or
+other relationship. Creative Commons makes its licenses and related
+information available on an "as-is" basis. Creative Commons gives no
+warranties regarding its licenses, any material licensed under their
+terms and conditions, or any related information. Creative Commons
+disclaims all liability for damages resulting from their use to the
+fullest extent possible.
+
+Using Creative Commons Public Licenses
+
+Creative Commons public licenses provide a standard set of terms and
+conditions that creators and other rights holders may use to share
+original works of authorship and other material subject to copyright
+and certain other rights specified in the public license below. The
+following considerations are for informational purposes only, are not
+exhaustive, and do not form part of our licenses.
+
+     Considerations for licensors: Our public licenses are
+     intended for use by those authorized to give the public
+     permission to use material in ways otherwise restricted by
+     copyright and certain other rights. Our licenses are
+     irrevocable. Licensors should read and understand the terms
+     and conditions of the license they choose before applying it.
+     Licensors should also secure all rights necessary before
+     applying our licenses so that the public can reuse the
+     material as expected. Licensors should clearly mark any
+     material not subject to the license. This includes other CC-
+     licensed material, or material used under an exception or
+     limitation to copyright. More considerations for licensors:
+       wiki.creativecommons.org/Considerations_for_licensors
+
+     Considerations for the public: By using one of our public
+     licenses, a licensor grants the public permission to use the
+     licensed material under specified terms and conditions. If
+     the licensor's permission is not necessary for any reason--for
+     example, because of any applicable exception or limitation to
+     copyright--then that use is not regulated by the license. Our
+     licenses grant only permissions under copyright and certain
+     other rights that a licensor has authority to grant. Use of
+     the licensed material may still be restricted for other
+     reasons, including because others have copyright or other
+     rights in the material. A licensor may make special requests,
+     such as asking that all changes be marked or described.
+     Although not required by our licenses, you are encouraged to
+     respect those requests where reasonable. More_considerations
+     for the public: 
+       wiki.creativecommons.org/Considerations_for_licensees
+
+=======================================================================
+
+Creative Commons Attribution 4.0 International Public License
+
+By exercising the Licensed Rights (defined below), You accept and agree
+to be bound by the terms and conditions of this Creative Commons
+Attribution 4.0 International Public License ("Public License"). To the
+extent this Public License may be interpreted as a contract, You are
+granted the Licensed Rights in consideration of Your acceptance of
+these terms and conditions, and the Licensor grants You such rights in
+consideration of benefits the Licensor receives from making the
+Licensed Material available under these terms and conditions.
+
+
+Section 1 -- Definitions.
+
+  a. Adapted Material means material subject to Copyright and Similar
+     Rights that is derived from or based upon the Licensed Material
+     and in which the Licensed Material is translated, altered,
+     arranged, transformed, or otherwise modified in a manner requiring
+     permission under the Copyright and Similar Rights held by the
+     Licensor. For purposes of this Public License, where the Licensed
+     Material is a musical work, performance, or sound recording,
+     Adapted Material is always produced where the Licensed Material is
+     synched in timed relation with a moving image.
+
+  b. Adapter's License means the license You apply to Your Copyright
+     and Similar Rights in Your contributions to Adapted Material in
+     accordance with the terms and conditions of this Public License.
+
+  c. Copyright and Similar Rights means copyright and/or similar rights
+     closely related to copyright including, without limitation,
+     performance, broadcast, sound recording, and Sui Generis Database
+     Rights, without regard to how the rights are labeled or
+     categorized. For purposes of this Public License, the rights
+     specified in Section 2(b)(1)-(2) are not Copyright and Similar
+     Rights.
+
+  d. Effective Technological Measures means those measures that, in the
+     absence of proper authority, may not be circumvented under laws
+     fulfilling obligations under Article 11 of the WIPO Copyright
+     Treaty adopted on December 20, 1996, and/or similar international
+     agreements.
+
+  e. Exceptions and Limitations means fair use, fair dealing, and/or
+     any other exception or limitation to Copyright and Similar Rights
+     that applies to Your use of the Licensed Material.
+
+  f. Licensed Material means the artistic or literary work, database,
+     or other material to which the Licensor applied this Public
+     License.
+
+  g. Licensed Rights means the rights granted to You subject to the
+     terms and conditions of this Public License, which are limited to
+     all Copyright and Similar Rights that apply to Your use of the
+     Licensed Material and that the Licensor has authority to license.
+
+  h. Licensor means the individual(s) or entity(ies) granting rights
+     under this Public License.
+
+  i. Share means to provide material to the public by any means or
+     process that requires permission under the Licensed Rights, such
+     as reproduction, public display, public performance, distribution,
+     dissemination, communication, or importation, and to make material
+     available to the public including in ways that members of the
+     public may access the material from a place and at a time
+     individually chosen by them.
+
+  j. Sui Generis Database Rights means rights other than copyright
+     resulting from Directive 96/9/EC of the European Parliament and of
+     the Council of 11 March 1996 on the legal protection of databases,
+     as amended and/or succeeded, as well as other essentially
+     equivalent rights anywhere in the world.
+
+  k. You means the individual or entity exercising the Licensed Rights
+     under this Public License. Your has a corresponding meaning.
+
+
+Section 2 -- Scope.
+
+  a. License grant.
+
+       1. Subject to the terms and conditions of this Public License,
+          the Licensor hereby grants You a worldwide, royalty-free,
+          non-sublicensable, non-exclusive, irrevocable license to
+          exercise the Licensed Rights in the Licensed Material to:
+
+            a. reproduce and Share the Licensed Material, in whole or
+               in part; and
+
+            b. produce, reproduce, and Share Adapted Material.
+
+       2. Exceptions and Limitations. For the avoidance of doubt, where
+          Exceptions and Limitations apply to Your use, this Public
+          License does not apply, and You do not need to comply with
+          its terms and conditions.
+
+       3. Term. The term of this Public License is specified in Section
+          6(a).
+
+       4. Media and formats; technical modifications allowed. The
+          Licensor authorizes You to exercise the Licensed Rights in
+          all media and formats whether now known or hereafter created,
+          and to make technical modifications necessary to do so. The
+          Licensor waives and/or agrees not to assert any right or
+          authority to forbid You from making technical modifications
+          necessary to exercise the Licensed Rights, including
+          technical modifications necessary to circumvent Effective
+          Technological Measures. For purposes of this Public License,
+          simply making modifications authorized by this Section 2(a)
+          (4) never produces Adapted Material.
+
+       5. Downstream recipients.
+
+            a. Offer from the Licensor -- Licensed Material. Every
+               recipient of the Licensed Material automatically
+               receives an offer from the Licensor to exercise the
+               Licensed Rights under the terms and conditions of this
+               Public License.
+
+            b. No downstream restrictions. You may not offer or impose
+               any additional or different terms or conditions on, or
+               apply any Effective Technological Measures to, the
+               Licensed Material if doing so restricts exercise of the
+               Licensed Rights by any recipient of the Licensed
+               Material.
+
+       6. No endorsement. Nothing in this Public License constitutes or
+          may be construed as permission to assert or imply that You
+          are, or that Your use of the Licensed Material is, connected
+          with, or sponsored, endorsed, or granted official status by,
+          the Licensor or others designated to receive attribution as
+          provided in Section 3(a)(1)(A)(i).
+
+  b. Other rights.
+
+       1. Moral rights, such as the right of integrity, are not
+          licensed under this Public License, nor are publicity,
+          privacy, and/or other similar personality rights; however, to
+          the extent possible, the Licensor waives and/or agrees not to
+          assert any such rights held by the Licensor to the limited
+          extent necessary to allow You to exercise the Licensed
+          Rights, but not otherwise.
+
+       2. Patent and trademark rights are not licensed under this
+          Public License.
+
+       3. To the extent possible, the Licensor waives any right to
+          collect royalties from You for the exercise of the Licensed
+          Rights, whether directly or through a collecting society
+          under any voluntary or waivable statutory or compulsory
+          licensing scheme. In all other cases the Licensor expressly
+          reserves any right to collect such royalties.
+
+
+Section 3 -- License Conditions.
+
+Your exercise of the Licensed Rights is expressly made subject to the
+following conditions.
+
+  a. Attribution.
+
+       1. If You Share the Licensed Material (including in modified
+          form), You must:
+
+            a. retain the following if it is supplied by the Licensor
+               with the Licensed Material:
+
+                 i. identification of the creator(s) of the Licensed
+                    Material and any others designated to receive
+                    attribution, in any reasonable manner requested by
+                    the Licensor (including by pseudonym if
+                    designated);
+
+                ii. a copyright notice;
+
+               iii. a notice that refers to this Public License;
+
+                iv. a notice that refers to the disclaimer of
+                    warranties;
+
+                 v. a URI or hyperlink to the Licensed Material to the
+                    extent reasonably practicable;
+
+            b. indicate if You modified the Licensed Material and
+               retain an indication of any previous modifications; and
+
+            c. indicate the Licensed Material is licensed under this
+               Public License, and include the text of, or the URI or
+               hyperlink to, this Public License.
+
+       2. You may satisfy the conditions in Section 3(a)(1) in any
+          reasonable manner based on the medium, means, and context in
+          which You Share the Licensed Material. For example, it may be
+          reasonable to satisfy the conditions by providing a URI or
+          hyperlink to a resource that includes the required
+          information.
+
+       3. If requested by the Licensor, You must remove any of the
+          information required by Section 3(a)(1)(A) to the extent
+          reasonably practicable.
+
+       4. If You Share Adapted Material You produce, the Adapter's
+          License You apply must not prevent recipients of the Adapted
+          Material from complying with this Public License.
+
+
+Section 4 -- Sui Generis Database Rights.
+
+Where the Licensed Rights include Sui Generis Database Rights that
+apply to Your use of the Licensed Material:
+
+  a. for the avoidance of doubt, Section 2(a)(1) grants You the right
+     to extract, reuse, reproduce, and Share all or a substantial
+     portion of the contents of the database;
+
+  b. if You include all or a substantial portion of the database
+     contents in a database in which You have Sui Generis Database
+     Rights, then the database in which You have Sui Generis Database
+     Rights (but not its individual contents) is Adapted Material; and
+
+  c. You must comply with the conditions in Section 3(a) if You Share
+     all or a substantial portion of the contents of the database.
+
+For the avoidance of doubt, this Section 4 supplements and does not
+replace Your obligations under this Public License where the Licensed
+Rights include other Copyright and Similar Rights.
+
+
+Section 5 -- Disclaimer of Warranties and Limitation of Liability.
+
+  a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
+     EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
+     AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
+     ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
+     IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
+     WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
+     PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
+     ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
+     KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
+     ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
+
+  b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
+     TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
+     NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
+     INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
+     COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
+     USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
+     ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
+     DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
+     IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
+
+  c. The disclaimer of warranties and limitation of liability provided
+     above shall be interpreted in a manner that, to the extent
+     possible, most closely approximates an absolute disclaimer and
+     waiver of all liability.
+
+
+Section 6 -- Term and Termination.
+
+  a. This Public License applies for the term of the Copyright and
+     Similar Rights licensed here. However, if You fail to comply with
+     this Public License, then Your rights under this Public License
+     terminate automatically.
+
+  b. Where Your right to use the Licensed Material has terminated under
+     Section 6(a), it reinstates:
+
+       1. automatically as of the date the violation is cured, provided
+          it is cured within 30 days of Your discovery of the
+          violation; or
+
+       2. upon express reinstatement by the Licensor.
+
+     For the avoidance of doubt, this Section 6(b) does not affect any
+     right the Licensor may have to seek remedies for Your violations
+     of this Public License.
+
+  c. For the avoidance of doubt, the Licensor may also offer the
+     Licensed Material under separate terms or conditions or stop
+     distributing the Licensed Material at any time; however, doing so
+     will not terminate this Public License.
+
+  d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
+     License.
+
+
+Section 7 -- Other Terms and Conditions.
+
+  a. The Licensor shall not be bound by any additional or different
+     terms or conditions communicated by You unless expressly agreed.
+
+  b. Any arrangements, understandings, or agreements regarding the
+     Licensed Material not stated herein are separate from and
+     independent of the terms and conditions of this Public License.
+
+
+Section 8 -- Interpretation.
+
+  a. For the avoidance of doubt, this Public License does not, and
+     shall not be interpreted to, reduce, limit, restrict, or impose
+     conditions on any use of the Licensed Material that could lawfully
+     be made without permission under this Public License.
+
+  b. To the extent possible, if any provision of this Public License is
+     deemed unenforceable, it shall be automatically reformed to the
+     minimum extent necessary to make it enforceable. If the provision
+     cannot be reformed, it shall be severed from this Public License
+     without affecting the enforceability of the remaining terms and
+     conditions.
+
+  c. No term or condition of this Public License will be waived and no
+     failure to comply consented to unless expressly agreed to by the
+     Licensor.
+
+  d. Nothing in this Public License constitutes or may be interpreted
+     as a limitation upon, or waiver of, any privileges and immunities
+     that apply to the Licensor or You, including from the legal
+     processes of any jurisdiction or authority.
+
+
+=======================================================================
+
+Creative Commons is not a party to its public licenses.
+Notwithstanding, Creative Commons may elect to apply one of its public
+licenses to material it publishes and in those instances will be
+considered the "Licensor." Except for the limited purpose of indicating
+that material is shared under a Creative Commons public license or as
+otherwise permitted by the Creative Commons policies published at
+creativecommons.org/policies, Creative Commons does not authorize the
+use of the trademark "Creative Commons" or any other trademark or logo
+of Creative Commons without its prior written consent including,
+without limitation, in connection with any unauthorized modifications
+to any of its public licenses or any other arrangements,
+understandings, or agreements concerning use of licensed material. For
+the avoidance of doubt, this paragraph does not form part of the public
+licenses.
+
+Creative Commons may be contacted at creativecommons.org.
diff --git a/freedv/tags/0.99-Beta/contrib/freedv.desktop b/freedv/tags/0.99-Beta/contrib/freedv.desktop
new file mode 100644 (file)
index 0000000..96e8293
--- /dev/null
@@ -0,0 +1,8 @@
+[Desktop Entry]
+Version=1.0
+Name=FreeDV
+Exec=freedv
+Icon=freedv
+Type=Application
+Terminal=false
+Categories=GTK;GNOME;AudioVideo;Audio;HamRadio;
diff --git a/freedv/tags/0.99-Beta/contrib/freedv.ico b/freedv/tags/0.99-Beta/contrib/freedv.ico
new file mode 100644 (file)
index 0000000..e6b9a20
Binary files /dev/null and b/freedv/tags/0.99-Beta/contrib/freedv.ico differ
diff --git a/freedv/tags/0.99-Beta/contrib/freedv.rc b/freedv/tags/0.99-Beta/contrib/freedv.rc
new file mode 100644 (file)
index 0000000..2e6655d
--- /dev/null
@@ -0,0 +1 @@
+id ICON "./freedv.ico"
diff --git a/freedv/tags/0.99-Beta/contrib/freedv128x128.png b/freedv/tags/0.99-Beta/contrib/freedv128x128.png
new file mode 100644 (file)
index 0000000..5190a77
Binary files /dev/null and b/freedv/tags/0.99-Beta/contrib/freedv128x128.png differ
diff --git a/freedv/tags/0.99-Beta/contrib/freedv256x256.png b/freedv/tags/0.99-Beta/contrib/freedv256x256.png
new file mode 100644 (file)
index 0000000..b3eb5d7
Binary files /dev/null and b/freedv/tags/0.99-Beta/contrib/freedv256x256.png differ
diff --git a/freedv/tags/0.99-Beta/contrib/freedv48x48.png b/freedv/tags/0.99-Beta/contrib/freedv48x48.png
new file mode 100644 (file)
index 0000000..bd5efc6
Binary files /dev/null and b/freedv/tags/0.99-Beta/contrib/freedv48x48.png differ
diff --git a/freedv/tags/0.99-Beta/contrib/freedv64x64.png b/freedv/tags/0.99-Beta/contrib/freedv64x64.png
new file mode 100644 (file)
index 0000000..eb89773
Binary files /dev/null and b/freedv/tags/0.99-Beta/contrib/freedv64x64.png differ
diff --git a/freedv/tags/0.99-Beta/credits.txt b/freedv/tags/0.99-Beta/credits.txt
new file mode 100644 (file)
index 0000000..431e399
--- /dev/null
@@ -0,0 +1,13 @@
+Credits (code or ideas borrowed from):
+==============================================
+Dave Witten and David Rowe (obviously)
+Mel Whitten K0PFX (material and moral support)
+Bruce Perens (cheerleader, promotion and publicity)
+Mooneer Salem KG6AOV(Mac OSX Patch)
+Soeren Straarup OZ2DAK (FreeBSD Port)
+Don Mak
+Steve Nance (K5FR)
+Joel Stanley (Hamlib prototyping) and Mark Jessop (Mac OSX) 
+James Ahlstrom (Quisk)
+FLDIGI
+All the folks on the digital voice google group...
diff --git a/freedv/tags/0.99-Beta/db/current b/freedv/tags/0.99-Beta/db/current
new file mode 100644 (file)
index 0000000..d00491f
--- /dev/null
@@ -0,0 +1 @@
+1
diff --git a/freedv/tags/0.99-Beta/db/format b/freedv/tags/0.99-Beta/db/format
new file mode 100644 (file)
index 0000000..db06890
--- /dev/null
@@ -0,0 +1,2 @@
+4
+layout sharded 1000
diff --git a/freedv/tags/0.99-Beta/db/fs-type b/freedv/tags/0.99-Beta/db/fs-type
new file mode 100644 (file)
index 0000000..4fdd953
--- /dev/null
@@ -0,0 +1 @@
+fsfs
diff --git a/freedv/tags/0.99-Beta/db/fsfs.conf b/freedv/tags/0.99-Beta/db/fsfs.conf
new file mode 100644 (file)
index 0000000..cc08ceb
--- /dev/null
@@ -0,0 +1,38 @@
+### This file controls the configuration of the FSFS filesystem.\r
+\r
+[memcached-servers]\r
+### These options name memcached servers used to cache internal FSFS\r
+### data.  See http://www.danga.com/memcached/ for more information on\r
+### memcached.  To use memcached with FSFS, run one or more memcached\r
+### servers, and specify each of them as an option like so:\r
+# first-server = 127.0.0.1:11211\r
+# remote-memcached = mymemcached.corp.example.com:11212\r
+### The option name is ignored; the value is of the form HOST:PORT.\r
+### memcached servers can be shared between multiple repositories;\r
+### however, if you do this, you *must* ensure that repositories have\r
+### distinct UUIDs and paths, or else cached data from one repository\r
+### might be used by another accidentally.  Note also that memcached has\r
+### no authentication for reads or writes, so you must ensure that your\r
+### memcached servers are only accessible by trusted users.\r
+\r
+[caches]\r
+### When a cache-related error occurs, normally Subversion ignores it\r
+### and continues, logging an error if the server is appropriately\r
+### configured (and ignoring it with file:// access).  To make\r
+### Subversion never ignore cache errors, uncomment this line.\r
+# fail-stop = true\r
+\r
+[rep-sharing]\r
+### To conserve space, the filesystem can optionally avoid storing\r
+### duplicate representations.  This comes at a slight cost in\r
+### performance, as maintaining a database of shared representations can\r
+### increase commit times.  The space savings are dependent upon the size\r
+### of the repository, the number of objects it contains and the amount of\r
+### duplication between them, usually a function of the branching and\r
+### merging process.\r
+###\r
+### The following parameter enables rep-sharing in the repository.  It can\r
+### be switched on and off at will, but for best space-saving results\r
+### should be enabled consistently over the life of the repository.\r
+### rep-sharing is enabled by default.\r
+# enable-rep-sharing = true\r
diff --git a/freedv/tags/0.99-Beta/db/min-unpacked-rev b/freedv/tags/0.99-Beta/db/min-unpacked-rev
new file mode 100644 (file)
index 0000000..573541a
--- /dev/null
@@ -0,0 +1 @@
+0
diff --git a/freedv/tags/0.99-Beta/db/rep-cache.db b/freedv/tags/0.99-Beta/db/rep-cache.db
new file mode 100644 (file)
index 0000000..63c6f0b
Binary files /dev/null and b/freedv/tags/0.99-Beta/db/rep-cache.db differ
diff --git a/freedv/tags/0.99-Beta/db/revprops/0/0 b/freedv/tags/0.99-Beta/db/revprops/0/0
new file mode 100644 (file)
index 0000000..d0b90de
--- /dev/null
@@ -0,0 +1,5 @@
+K 8
+svn:date
+V 27
+2012-08-21T18:27:59.389906Z
+END
diff --git a/freedv/tags/0.99-Beta/db/revprops/0/1 b/freedv/tags/0.99-Beta/db/revprops/0/1
new file mode 100644 (file)
index 0000000..0af71a2
--- /dev/null
@@ -0,0 +1,13 @@
+K 10
+svn:author
+V 9
+OFA-Staff
+K 8
+svn:date
+V 27
+2012-08-21T18:28:08.741468Z
+K 7
+svn:log
+V 25
+Imported folder structure
+END
diff --git a/freedv/tags/0.99-Beta/db/revs/0/0 b/freedv/tags/0.99-Beta/db/revs/0/0
new file mode 100644 (file)
index 0000000..10f5c45
--- /dev/null
@@ -0,0 +1,11 @@
+PLAIN
+END
+ENDREP
+id: 0.0.r0/17
+type: dir
+count: 0
+text: 0 0 4 4 2d2977d1c96f487abe4a1e202dd03b4e
+cpath: /
+
+
+17 107
diff --git a/freedv/tags/0.99-Beta/db/revs/0/1 b/freedv/tags/0.99-Beta/db/revs/0/1
new file mode 100644 (file)
index 0000000..fd802a9
--- /dev/null
@@ -0,0 +1,49 @@
+id: 3-1.0.r1/0
+type: dir
+count: 0
+cpath: /tags
+copyroot: 0 /
+
+id: 0-1.0.r1/62
+type: dir
+count: 0
+cpath: /trunk
+copyroot: 0 /
+
+id: 2-1.0.r1/126
+type: dir
+count: 0
+cpath: /branches
+copyroot: 0 /
+
+PLAIN
+K 8
+branches
+V 16
+dir 2-1.0.r1/126
+K 4
+tags
+V 14
+dir 3-1.0.r1/0
+K 5
+trunk
+V 15
+dir 0-1.0.r1/62
+END
+ENDREP
+id: 0.0.r1/306
+type: dir
+pred: 0.0.r0/17
+count: 1
+text: 1 194 99 99 7b6cc14dddba4e09be5255b475d1a0a8
+cpath: /
+copyroot: 0 /
+
+_0.0.t0-0 add-dir false false /trunk
+
+_2.0.t0-0 add-dir false false /branches
+
+_3.0.t0-0 add-dir false false /tags
+
+
+306 431
diff --git a/freedv/tags/0.99-Beta/db/transactions/.gitignore b/freedv/tags/0.99-Beta/db/transactions/.gitignore
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/freedv/tags/0.99-Beta/db/txn-current b/freedv/tags/0.99-Beta/db/txn-current
new file mode 100644 (file)
index 0000000..d00491f
--- /dev/null
@@ -0,0 +1 @@
+1
diff --git a/freedv/tags/0.99-Beta/db/txn-current-lock b/freedv/tags/0.99-Beta/db/txn-current-lock
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/freedv/tags/0.99-Beta/db/txn-protorevs/.gitignore b/freedv/tags/0.99-Beta/db/txn-protorevs/.gitignore
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/freedv/tags/0.99-Beta/db/uuid b/freedv/tags/0.99-Beta/db/uuid
new file mode 100644 (file)
index 0000000..0f36297
--- /dev/null
@@ -0,0 +1 @@
+a56d66ce-6468-4744-9be7-52ce95ca47a4
diff --git a/freedv/tags/0.99-Beta/db/write-lock b/freedv/tags/0.99-Beta/db/write-lock
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/freedv/tags/0.99-Beta/src/CMakeLists.txt b/freedv/tags/0.99-Beta/src/CMakeLists.txt
new file mode 100644 (file)
index 0000000..44ccfe7
--- /dev/null
@@ -0,0 +1,44 @@
+set(FREEDV_SOURCES
+    dlg_audiooptions.cpp
+    dlg_filter.cpp
+    dlg_options.cpp
+    dlg_ptt.cpp
+    fdmdv2_main.cpp
+    fdmdv2_pa_wrapper.cpp
+    fdmdv2_plot.cpp
+    fdmdv2_plot_scalar.cpp
+    fdmdv2_plot_scatter.cpp
+    fdmdv2_plot_spectrum.cpp
+    fdmdv2_plot_waterfall.cpp
+    hamlib.cpp
+    topFrame.cpp
+    sox_biquad.c
+    comp.h
+    dlg_audiooptions.h
+    dlg_filter.h
+    dlg_options.h
+    dlg_ptt.h
+    fdmdv2_defines.h
+    fdmdv2_main.h
+    fdmdv2_pa_wrapper.h
+    fdmdv2_plot.h
+    fdmdv2_plot_scalar.h
+    fdmdv2_plot_scatter.h
+    fdmdv2_plot_spectrum.h
+    fdmdv2_plot_waterfall.h
+    hamlib.h
+    sox_biquad.h
+    sox.h
+    topFrame.h
+    version.h
+)
+
+# WIN32 is needed for Windows GUI apps and is ignored for UNIX like systems.
+add_executable(freedv WIN32 ${FREEDV_SOURCES} ${RES_FILES})
+target_link_libraries(freedv ${FREEDV_LINK_LIBS})
+include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
+if(FREEDV_STATIC_DEPS)
+    add_dependencies(freedv ${FREEDV_STATIC_DEPS})
+endif(FREEDV_STATIC_DEPS)
+install(TARGETS freedv
+    RUNTIME DESTINATION bin)
diff --git a/freedv/tags/0.99-Beta/src/Makefile.win32 b/freedv/tags/0.99-Beta/src/Makefile.win32
new file mode 100644 (file)
index 0000000..932e851
--- /dev/null
@@ -0,0 +1,52 @@
+# src/Makefile.win32
+# David Rowe 26 Oct 2012
+#
+# Makefile for Win32 on msys/Mingw to help David R get up to speed
+#
+# $ make -f Makefile.Win32
+
+CODEC2_PATH=$(HOME)/codec2-dev
+INCLUDE_PATH=/usr/local/include
+
+WX_CONFIG=wx-config
+WX_CPPFLAGS = $(shell $(WX_CONFIG) --cxxflags) -D__WXDEBUG__
+WX_LIBS = $(shell $(WX_CONFIG) --libs core, base, aui, adv, net)
+SVN_REVISION=$(shell svnversion)
+CODEC2_INC=$(CODEC2_PATH)/src 
+CODEC2_LIB=$(CODEC2_PATH)/build_win32/src/
+
+CPP_FLAGS = -D_NO_AUTOTOOLS_ -I$(INCLUDE_PATH) $(WX_CPPFLAGS) -I$(CODEC2_INC) -I../extern/include -I. -g -Wall -DSVN_REVISION=\"$(SVN_REVISION)\"
+LIBS = $(WX_LIBS) -L$(CODEC2_LIB) -lcodec2 -lm -lportaudiocpp -lportaudio -lpthread -lsndfile -lsamplerate -lhamlib -lsox -lspeexdsp
+
+OBJS = topFrame.o \
+fdmdv2_main.o \
+fdmdv2_plot.o \
+fdmdv2_plot_scalar.o \
+fdmdv2_plot_scatter.o \
+fdmdv2_plot_spectrum.o \
+fdmdv2_plot_waterfall.o \
+fdmdv2_pa_wrapper.o \
+dlg_audiooptions.o \
+dlg_ptt.o \
+dlg_options.o \
+dlg_filter.o \
+sox_biquad.o \
+hamlib.o \
+../../codec2-dev/src/golay23.o
+
+HDRS = version.h dlg_audiooptions.h dlg_ptt.h dlg_filter.h fdmdv2_main.h fdmdv2_defines.h fdmdv2_plot.h fdmdv2_plot_scalar.h fdmdv2_plot_waterfall.h fdmdv2_plot_scatter.h fdmdv2_plot_spectrum.h fdmdv2_pa_wrapper.h topFrame.h dlg_audiooptions.h topFrame.h varicode.h ../../codec2-dev/src/golay23.h hamlib.h
+
+all: freedv
+
+freedv: $(OBJS) 
+       g++ -o freedv $(OBJS) $(CPP_FLAGS) $(LIBS)
+
+%.o: %.cpp $(HDRS) Makefile.win32
+       g++ $(CPP_FLAGS) -c $< -o $@
+
+%.o: %.c $(HDRS) Makefile.win32
+       gcc $(CPP_FLAGS) -c $< -o $@
+
+clean:
+       rm -f *.o fdmdv2
+
diff --git a/freedv/tags/0.99-Beta/src/comp.h b/freedv/tags/0.99-Beta/src/comp.h
new file mode 100644 (file)
index 0000000..a3a1bd9
--- /dev/null
@@ -0,0 +1,39 @@
+/*---------------------------------------------------------------------------*\
+
+  FILE........: comp.h
+  AUTHOR......: David Rowe
+  DATE CREATED: 24/08/09
+
+  Complex number definition.
+
+\*---------------------------------------------------------------------------*/
+
+/*
+  Copyright (C) 2009 David Rowe
+
+  All rights reserved.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU Lesser 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 Lesser General Public License
+  along with this program; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef __COMP__
+#define __COMP__
+
+/* Complex number */
+
+typedef struct
+{
+    float real;
+    float imag;
+} COMP;
+
+#endif
diff --git a/freedv/tags/0.99-Beta/src/dlg_audiooptions.cpp b/freedv/tags/0.99-Beta/src/dlg_audiooptions.cpp
new file mode 100644 (file)
index 0000000..7d23a08
--- /dev/null
@@ -0,0 +1,1264 @@
+//=========================================================================
+// Name:            AudioOptsDialog.cpp
+// Purpose:         Implements an Audio options selection dialog.
+//
+// Authors:         David Rowe, David Witten
+// License:
+//
+//  All rights reserved.
+//
+//  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 <http://www.gnu.org/licenses/>.
+//
+//=========================================================================
+#include "fdmdv2_main.h"
+#include "dlg_audiooptions.h"
+
+// constants for test waveform plots
+
+#define TEST_WAVEFORM_X          180
+#define TEST_WAVEFORM_Y          180
+#define TEST_WAVEFORM_PLOT_TIME  2.0
+#define TEST_WAVEFORM_PLOT_FS    400
+#define TEST_BUF_SIZE           1024
+#define TEST_FS                 48000.0
+#define TEST_DT                 0.1      // time between plot updates in seconds
+#define TEST_WAVEFORM_PLOT_BUF  ((int)(DT*400))
+
+void AudioOptsDialog::Pa_Init(void)
+{
+    m_isPaInitialized = false;
+
+    if((pa_err = Pa_Initialize()) == paNoError)
+    {
+        m_isPaInitialized = true;
+    }
+    else
+    {
+        wxMessageBox(wxT("Port Audio failed to initialize"), wxT("Pa_Initialize"), wxOK);
+        return;
+    }
+}
+
+
+void AudioOptsDialog::buildTestControls(PlotScalar **plotScalar, wxButton **btnTest, 
+                                        wxPanel *parentPanel, wxBoxSizer *bSizer, wxString buttonLabel)
+{
+    wxBoxSizer* bSizer1 = new wxBoxSizer(wxVERTICAL);
+
+    wxPanel *panel = new wxPanel(parentPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0);
+    *plotScalar = new PlotScalar((wxFrame*) panel, 1, TEST_WAVEFORM_PLOT_TIME, 1.0/TEST_WAVEFORM_PLOT_FS, -1, 1, 1, 0.2, "", 1);
+    (*plotScalar)->SetClientSize(wxSize(TEST_WAVEFORM_X,TEST_WAVEFORM_Y));
+    bSizer1->Add(panel, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 8);
+
+    *btnTest = new wxButton(parentPanel, wxID_ANY, buttonLabel, wxDefaultPosition, wxDefaultSize);
+    bSizer1->Add(*btnTest, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 0);
+
+    bSizer->Add(bSizer1, 0, wxALIGN_CENTER_HORIZONTAL |wxALIGN_CENTER_VERTICAL );
+}
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// AudioOptsDialog()
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+AudioOptsDialog::AudioOptsDialog(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style)
+{
+    this->SetSizeHints(wxSize(850, 600), wxDefaultSize);
+
+    Pa_Init();
+
+    wxBoxSizer* mainSizer;
+    mainSizer = new wxBoxSizer(wxVERTICAL);
+    m_panel1 = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
+    wxBoxSizer* bSizer4;
+    bSizer4 = new wxBoxSizer(wxVERTICAL);
+    m_notebook1 = new wxNotebook(m_panel1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxNB_BOTTOM);
+    m_panelRx = new wxPanel(m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
+    wxBoxSizer* bSizer20;
+    bSizer20 = new wxBoxSizer(wxVERTICAL);
+    wxGridSizer* gSizer4;
+    gSizer4 = new wxGridSizer(2, 1, 0, 0);
+
+    // Rx In -----------------------------------------------------------------------
+
+    wxStaticBoxSizer* sbSizer2;
+    sbSizer2 = new wxStaticBoxSizer(new wxStaticBox(m_panelRx, wxID_ANY, _("From Radio")), wxHORIZONTAL);
+
+    wxBoxSizer* bSizer811a = new wxBoxSizer(wxVERTICAL);
+
+    m_listCtrlRxInDevices = new wxListCtrl(m_panelRx, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VRULES);
+    bSizer811a->Add(m_listCtrlRxInDevices, 1, wxALL|wxEXPAND, 1);
+
+    wxBoxSizer* bSizer811;
+    bSizer811 = new wxBoxSizer(wxHORIZONTAL);
+    m_staticText51 = new wxStaticText(m_panelRx, wxID_ANY, _("Device:"), wxDefaultPosition, wxDefaultSize, 0);
+    m_staticText51->Wrap(-1);
+    bSizer811->Add(m_staticText51, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5);
+    m_textCtrlRxIn = new wxTextCtrl(m_panelRx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
+    bSizer811->Add(m_textCtrlRxIn, 1, wxALIGN_CENTER_VERTICAL|wxALL, 1);
+    m_staticText6 = new wxStaticText(m_panelRx, wxID_ANY, _("Sample Rate:"), wxDefaultPosition, wxDefaultSize, 0);
+    m_staticText6->Wrap(-1);
+    bSizer811->Add(m_staticText6, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5);
+    m_cbSampleRateRxIn = new wxComboBox(m_panelRx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(90,-1), 0, NULL, wxCB_DROPDOWN);
+    bSizer811->Add(m_cbSampleRateRxIn, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1);
+
+    bSizer811a->Add(bSizer811, 0, wxEXPAND, 5);
+
+    sbSizer2->Add(bSizer811a, 1, wxEXPAND, 2);
+    buildTestControls(&m_plotScalarRxIn, &m_btnRxInTest, m_panelRx, sbSizer2, _("Rec 2s"));
+
+    gSizer4->Add(sbSizer2, 1, wxEXPAND, 5);
+
+    // Rx Out -----------------------------------------------------------------------
+
+    wxStaticBoxSizer* sbSizer3;
+    sbSizer3 = new wxStaticBoxSizer(new wxStaticBox(m_panelRx, wxID_ANY, _("To Speaker/Headphones")), wxHORIZONTAL);
+
+    wxBoxSizer* bSizer81a = new wxBoxSizer(wxVERTICAL);
+
+    m_listCtrlRxOutDevices = new wxListCtrl(m_panelRx, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VRULES);
+    bSizer81a->Add(m_listCtrlRxOutDevices, 1, wxALL|wxEXPAND, 1);
+
+    wxBoxSizer* bSizer81;
+    bSizer81 = new wxBoxSizer(wxHORIZONTAL);
+    m_staticText9 = new wxStaticText(m_panelRx, wxID_ANY, _("Device:"), wxDefaultPosition, wxDefaultSize, 0);
+    m_staticText9->Wrap(-1);
+    bSizer81->Add(m_staticText9, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
+    m_textCtrlRxOut = new wxTextCtrl(m_panelRx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
+    bSizer81->Add(m_textCtrlRxOut, 1, wxALIGN_CENTER_VERTICAL|wxALL, 1);
+    m_staticText10 = new wxStaticText(m_panelRx, wxID_ANY, _("Sample Rate:"), wxDefaultPosition, wxDefaultSize, 0);
+    m_staticText10->Wrap(-1);
+    bSizer81->Add(m_staticText10, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5);
+    m_cbSampleRateRxOut = new wxComboBox(m_panelRx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(90,-1), 0, NULL, wxCB_DROPDOWN);
+    bSizer81->Add(m_cbSampleRateRxOut, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1);
+
+    bSizer81a->Add(bSizer81, 0, wxEXPAND, 5);
+
+    sbSizer3->Add(bSizer81a, 1, wxEXPAND, 2);
+    buildTestControls(&m_plotScalarRxOut, &m_btnRxOutTest, m_panelRx, sbSizer3, _("Play 2s"));
+    gSizer4->Add(sbSizer3, 1, wxEXPAND, 2);
+    bSizer20->Add(gSizer4, 1, wxEXPAND, 1);
+    m_panelRx->SetSizer(bSizer20);
+    m_panelRx->Layout();
+    bSizer20->Fit(m_panelRx);
+    m_notebook1->AddPage(m_panelRx, _("Receive"), true);
+
+    // Tx Tab -------------------------------------------------------------------------------
+
+    m_panelTx = new wxPanel(m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
+    wxBoxSizer* bSizer18;
+    bSizer18 = new wxBoxSizer(wxVERTICAL);
+    wxGridSizer* gSizer2;
+    gSizer2 = new wxGridSizer(2, 1, 0, 0);
+
+    // Tx In ----------------------------------------------------------------------------------
+
+    wxStaticBoxSizer* sbSizer22;
+    sbSizer22 = new wxStaticBoxSizer(new wxStaticBox(m_panelTx, wxID_ANY, _("From Microphone")), wxHORIZONTAL);
+
+    wxBoxSizer* bSizer83a = new wxBoxSizer(wxVERTICAL);
+
+    m_listCtrlTxInDevices = new wxListCtrl(m_panelTx, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VRULES);
+    bSizer83a->Add(m_listCtrlTxInDevices, 1, wxALL|wxEXPAND, 1);
+    wxBoxSizer* bSizer83;
+    bSizer83 = new wxBoxSizer(wxHORIZONTAL);
+    m_staticText12 = new wxStaticText(m_panelTx, wxID_ANY, _("Device:"), wxDefaultPosition, wxDefaultSize, 0);
+    m_staticText12->Wrap(-1);
+    bSizer83->Add(m_staticText12, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5);
+    m_textCtrlTxIn = new wxTextCtrl(m_panelTx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
+    bSizer83->Add(m_textCtrlTxIn, 1, wxALIGN_CENTER_VERTICAL|wxALL, 1);
+    m_staticText11 = new wxStaticText(m_panelTx, wxID_ANY, _("Sample Rate:"), wxDefaultPosition, wxDefaultSize, 0);
+    m_staticText11->Wrap(-1);
+    bSizer83->Add(m_staticText11, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5);
+    m_cbSampleRateTxIn = new wxComboBox(m_panelTx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(90,-1), 0, NULL, wxCB_DROPDOWN);
+    bSizer83->Add(m_cbSampleRateTxIn, 0, wxALL, 1);
+
+    bSizer83a->Add(bSizer83, 0, wxEXPAND, 5);
+
+    sbSizer22->Add(bSizer83a, 1, wxEXPAND, 2);
+    buildTestControls(&m_plotScalarTxIn, &m_btnTxInTest, m_panelTx, sbSizer22, _("Rec 2s"));
+
+    gSizer2->Add(sbSizer22, 1, wxEXPAND, 5);
+
+    // Tx Out ----------------------------------------------------------------------------------
+
+    wxStaticBoxSizer* sbSizer21;
+    sbSizer21 = new wxStaticBoxSizer(new wxStaticBox(m_panelTx, wxID_ANY, _("To Radio")), wxHORIZONTAL);
+
+    wxBoxSizer* bSizer82a = new wxBoxSizer(wxVERTICAL);
+
+    m_listCtrlTxOutDevices = new wxListCtrl(m_panelTx, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VRULES);
+    bSizer82a->Add(m_listCtrlTxOutDevices, 1, wxALL|wxEXPAND, 2);
+    wxBoxSizer* bSizer82;
+    bSizer82 = new wxBoxSizer(wxHORIZONTAL);
+    m_staticText81 = new wxStaticText(m_panelTx, wxID_ANY, _("Device:"), wxDefaultPosition, wxDefaultSize, 0);
+    m_staticText81->Wrap(-1);
+    bSizer82->Add(m_staticText81, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
+    m_textCtrlTxOut = new wxTextCtrl(m_panelTx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
+    bSizer82->Add(m_textCtrlTxOut, 1, wxALIGN_CENTER_VERTICAL|wxALL, 1);
+    m_staticText71 = new wxStaticText(m_panelTx, wxID_ANY, _("Sample Rate:"), wxDefaultPosition, wxDefaultSize, 0);
+    m_staticText71->Wrap(-1);
+    bSizer82->Add(m_staticText71, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5);
+    m_cbSampleRateTxOut = new wxComboBox(m_panelTx, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(90,-1), 0, NULL, wxCB_DROPDOWN);
+    bSizer82->Add(m_cbSampleRateTxOut, 0, wxALL, 1);
+
+    bSizer82a->Add(bSizer82, 0, wxEXPAND, 5);
+
+    sbSizer21->Add(bSizer82a, 1, wxEXPAND, 2);
+    buildTestControls(&m_plotScalarTxOut, &m_btnTxOutTest, m_panelTx, sbSizer21, _("Play 2s"));
+
+    gSizer2->Add(sbSizer21, 1, wxEXPAND, 5);
+    bSizer18->Add(gSizer2, 1, wxEXPAND, 1);
+    m_panelTx->SetSizer(bSizer18);
+    m_panelTx->Layout();
+    bSizer18->Fit(m_panelTx);
+    m_notebook1->AddPage(m_panelTx, _("Transmit"), false);
+
+    // API Tab -------------------------------------------------------------------
+
+    m_panelAPI = new wxPanel(m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
+    wxBoxSizer* bSizer12;
+    bSizer12 = new wxBoxSizer(wxHORIZONTAL);
+    wxGridSizer* gSizer31;
+    gSizer31 = new wxGridSizer(2, 1, 0, 0);
+    wxStaticBoxSizer* sbSizer1;
+    sbSizer1 = new wxStaticBoxSizer(new wxStaticBox(m_panelAPI, wxID_ANY, _("PortAudio")), wxVERTICAL);
+
+    wxGridSizer* gSizer3;
+    gSizer3 = new wxGridSizer(4, 2, 0, 0);
+
+    m_staticText7 = new wxStaticText(m_panelAPI, wxID_ANY, _("PortAudio Version String:"), wxDefaultPosition, wxDefaultSize, 0);
+    m_staticText7->Wrap(-1);
+    gSizer3->Add(m_staticText7, 1, wxALIGN_RIGHT|wxALL|wxALIGN_CENTER_VERTICAL, 10);
+    m_textStringVer = new wxStaticText(m_panelAPI, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
+    gSizer3->Add(m_textStringVer, 1, wxALIGN_LEFT|wxALL|wxALIGN_CENTER_VERTICAL, 10);
+
+    m_staticText8 = new wxStaticText(m_panelAPI, wxID_ANY, _("PortAudio Int Version:"), wxDefaultPosition, wxDefaultSize, 0);
+    m_staticText8->Wrap(-1);
+    gSizer3->Add(m_staticText8, 1, wxALIGN_RIGHT|wxALL|wxALIGN_CENTER_VERTICAL, 10);
+    m_textIntVer = new wxStaticText(m_panelAPI, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(45,-1), 0);
+    gSizer3->Add(m_textIntVer, 1, wxALIGN_LEFT|wxALL|wxALIGN_CENTER_VERTICAL, 10);
+
+    m_staticText5 = new wxStaticText(m_panelAPI, wxID_ANY, _("Device Count:"), wxDefaultPosition, wxDefaultSize, 0);
+    m_staticText5->Wrap(-1);
+    gSizer3->Add(m_staticText5, 1, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 10);
+    m_textCDevCount = new wxStaticText(m_panelAPI, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(45,-1), 0);
+    gSizer3->Add(m_textCDevCount, 1, wxALIGN_LEFT|wxALL|wxALIGN_CENTER_VERTICAL, 10);
+
+    m_staticText4 = new wxStaticText(m_panelAPI, wxID_ANY, _("API Count:"), wxDefaultPosition, wxDefaultSize, 0);
+    m_staticText4->Wrap(-1);
+    gSizer3->Add(m_staticText4, 1, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 10);
+    m_textAPICount = new wxStaticText(m_panelAPI, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(45,-1), 0);
+    m_textAPICount->SetMaxSize(wxSize(45,-1));
+    gSizer3->Add(m_textAPICount, 1, wxALIGN_LEFT|wxALL|wxALIGN_CENTER_VERTICAL, 10);
+
+    sbSizer1->Add(gSizer3, 1, wxEXPAND, 2);
+    gSizer31->Add(sbSizer1, 1, wxEXPAND, 2);
+    wxStaticBoxSizer* sbSizer6;
+    sbSizer6 = new wxStaticBoxSizer(new wxStaticBox(m_panelAPI, wxID_ANY, _("Other")), wxVERTICAL);
+    gSizer31->Add(sbSizer6, 1, wxEXPAND, 5);
+    bSizer12->Add(gSizer31, 1, wxEXPAND, 5);
+    m_panelAPI->SetSizer(bSizer12);
+    m_panelAPI->Layout();
+    bSizer12->Fit(m_panelAPI);
+    m_notebook1->AddPage(m_panelAPI, _("API Info"), false);
+    bSizer4->Add(m_notebook1, 1, wxEXPAND | wxALL, 0);
+    m_panel1->SetSizer(bSizer4);
+    m_panel1->Layout();
+    bSizer4->Fit(m_panel1);
+    mainSizer->Add(m_panel1, 1, wxEXPAND | wxALL, 1);
+
+    wxBoxSizer* bSizer6;
+    bSizer6 = new wxBoxSizer(wxHORIZONTAL);
+    m_btnRefresh = new wxButton(this, wxID_ANY, _("Refresh"), wxDefaultPosition, wxDefaultSize, 0);
+    bSizer6->Add(m_btnRefresh, 0, wxALIGN_CENTER|wxALL, 2);
+
+    m_sdbSizer1 = new wxStdDialogButtonSizer();
+
+    m_sdbSizer1OK = new wxButton(this, wxID_OK);
+    m_sdbSizer1->AddButton(m_sdbSizer1OK);
+
+    m_sdbSizer1Cancel = new wxButton(this, wxID_CANCEL);
+    m_sdbSizer1->AddButton(m_sdbSizer1Cancel);
+
+    m_sdbSizer1Apply = new wxButton(this, wxID_APPLY);
+    m_sdbSizer1->AddButton(m_sdbSizer1Apply);
+
+    m_sdbSizer1->Realize();
+
+    bSizer6->Add(m_sdbSizer1, 1, wxALIGN_CENTER_VERTICAL, 2);
+    mainSizer->Add(bSizer6, 0, wxEXPAND, 2);
+    this->SetSizer(mainSizer);
+    this->Layout();
+    this->Centre(wxBOTH);
+//    this->Centre(wxBOTH);
+
+    m_notebook1->SetSelection(0);
+
+    showAPIInfo();
+    m_RxInDevices.m_listDevices   = m_listCtrlRxInDevices;
+    m_RxInDevices.direction       = AUDIO_IN;
+    m_RxInDevices.m_textDevice    = m_textCtrlRxIn;
+    m_RxInDevices.m_cbSampleRate  = m_cbSampleRateRxIn;
+
+    m_RxOutDevices.m_listDevices  = m_listCtrlRxOutDevices;
+    m_RxOutDevices.direction      = AUDIO_OUT;
+    m_RxOutDevices.m_textDevice   = m_textCtrlRxOut;
+    m_RxOutDevices.m_cbSampleRate = m_cbSampleRateRxOut;
+
+    m_TxInDevices.m_listDevices   = m_listCtrlTxInDevices;
+    m_TxInDevices.direction       = AUDIO_IN;
+    m_TxInDevices.m_textDevice    = m_textCtrlTxIn;
+    m_TxInDevices.m_cbSampleRate  = m_cbSampleRateTxIn;
+
+    m_TxOutDevices.m_listDevices  = m_listCtrlTxOutDevices;
+    m_TxOutDevices.direction      = AUDIO_OUT;
+    m_TxOutDevices.m_textDevice   = m_textCtrlTxOut;
+    m_TxOutDevices.m_cbSampleRate = m_cbSampleRateTxOut;
+
+    populateParams(m_RxInDevices);
+    populateParams(m_RxOutDevices);
+    populateParams(m_TxInDevices);
+    populateParams(m_TxOutDevices);
+
+    m_listCtrlRxInDevices->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( AudioOptsDialog::OnRxInDeviceSelect ), NULL, this );
+    m_listCtrlRxOutDevices->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( AudioOptsDialog::OnRxOutDeviceSelect ), NULL, this );
+    m_listCtrlTxInDevices->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( AudioOptsDialog::OnTxInDeviceSelect ), NULL, this );
+    m_listCtrlTxOutDevices->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( AudioOptsDialog::OnTxOutDeviceSelect ), NULL, this );
+
+    // wire up test buttons
+    m_btnRxInTest->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnRxInTest ), NULL, this );
+    m_btnRxOutTest->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnRxOutTest ), NULL, this );
+    m_btnTxInTest->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnTxInTest ), NULL, this );
+    m_btnTxOutTest->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnTxOutTest ), NULL, this );
+
+    m_btnRefresh->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnRefreshClick ), NULL, this );
+    m_sdbSizer1Apply->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnApplyAudioParameters ), NULL, this );
+    m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnCancelAudioParameters ), NULL, this );
+    m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnOkAudioParameters ), NULL, this );
+/*
+        void OnClose( wxCloseEvent& event ) { event.Skip(); }
+        void OnHibernate( wxActivateEvent& event ) { event.Skip(); }
+        void OnIconize( wxIconizeEvent& event ) { event.Skip(); }
+        void OnInitDialog( wxInitDialogEvent& event ) { event.Skip(); }
+*/
+//    this->Connect(wxEVT_CLOSE_WINDOW, wxCloseEventHandler(AudioOptsDialog::OnClose));
+    this->Connect(wxEVT_HIBERNATE, wxActivateEventHandler(AudioOptsDialog::OnHibernate));
+    this->Connect(wxEVT_ICONIZE, wxIconizeEventHandler(AudioOptsDialog::OnIconize));
+    this->Connect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(AudioOptsDialog::OnInitDialog));
+}
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// ~AudioOptsDialog()
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+AudioOptsDialog::~AudioOptsDialog()
+{
+    Pa_Terminate();
+
+    // Disconnect Events
+    this->Disconnect(wxEVT_HIBERNATE, wxActivateEventHandler(AudioOptsDialog::OnHibernate));
+    this->Disconnect(wxEVT_ICONIZE, wxIconizeEventHandler(AudioOptsDialog::OnIconize));
+    this->Disconnect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(AudioOptsDialog::OnInitDialog));
+
+    m_listCtrlRxInDevices->Disconnect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(AudioOptsDialog::OnRxInDeviceSelect), NULL, this);
+    m_listCtrlRxOutDevices->Disconnect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(AudioOptsDialog::OnRxOutDeviceSelect), NULL, this);
+    m_listCtrlTxInDevices->Disconnect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(AudioOptsDialog::OnTxInDeviceSelect), NULL, this);
+    m_listCtrlTxOutDevices->Disconnect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(AudioOptsDialog::OnTxOutDeviceSelect), NULL, this);
+
+    m_btnRxInTest->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnRxInTest ), NULL, this );
+    m_btnRxOutTest->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnRxOutTest ), NULL, this );
+    m_btnTxInTest->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnTxInTest ), NULL, this );
+    m_btnTxOutTest->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AudioOptsDialog::OnTxOutTest ), NULL, this );
+
+    m_btnRefresh->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AudioOptsDialog::OnRefreshClick), NULL, this);
+    m_sdbSizer1Apply->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AudioOptsDialog::OnApplyAudioParameters), NULL, this);
+    m_sdbSizer1Cancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AudioOptsDialog::OnCancelAudioParameters), NULL, this);
+    m_sdbSizer1OK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AudioOptsDialog::OnOkAudioParameters), NULL, this);
+
+}
+
+//-------------------------------------------------------------------------
+// OnInitDialog()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnInitDialog( wxInitDialogEvent& event )
+{
+    ExchangeData(EXCHANGE_DATA_IN);
+}
+
+//-------------------------------------------------------------------------
+// OnInitDialog()
+//
+// helper function to look up name of devNum, and if it exists write
+// name to textCtrl.  Used to trap dissapearing devices.
+//-------------------------------------------------------------------------
+int AudioOptsDialog::setTextCtrlIfDevNumValid(wxTextCtrl *textCtrl, wxListCtrl *listCtrl, int devNum)
+{
+    int i, aDevNum, found_devNum;
+
+    // ignore last list entry as it is the "none" entry
+
+    found_devNum = 0;
+    for(i=0; i<listCtrl->GetItemCount()-1; i++) {
+        aDevNum = wxAtoi(listCtrl->GetItemText(i, 1));
+        //printf("aDevNum: %d devNum: %d\n", aDevNum, devNum);
+        if (aDevNum == devNum) {
+            found_devNum = 1;
+            textCtrl->SetValue(listCtrl->GetItemText(i, 0) + " (" + wxString::Format(wxT("%i"),devNum) + ")");
+            printf("setting focus of %d\n", i);
+            listCtrl->SetItemState(i, wxLIST_STATE_FOCUSED, wxLIST_STATE_FOCUSED);
+        }
+    }
+
+    if (found_devNum) 
+        return devNum;
+    else {
+        textCtrl->SetValue("none");
+        return -1;
+    }
+}
+
+//-------------------------------------------------------------------------
+// ExchangeData()
+//-------------------------------------------------------------------------
+int AudioOptsDialog::ExchangeData(int inout)
+{
+    if(inout == EXCHANGE_DATA_IN)
+    {
+        // Map sound card device numbers to tx/rx device numbers depending
+        // on number of sound cards in use
+
+        printf("EXCHANGE_DATA_IN:\n");
+        printf("  g_nSoundCards: %d\n", g_nSoundCards);
+        printf("  g_soundCard1InDeviceNum: %d\n", g_soundCard1InDeviceNum);
+        printf("  g_soundCard1OutDeviceNum: %d\n", g_soundCard1OutDeviceNum);
+        printf("  g_soundCard1SampleRate: %d\n", g_soundCard1SampleRate);
+        printf("  g_soundCard2InDeviceNum: %d\n", g_soundCard2InDeviceNum);
+        printf("  g_soundCard2OutDeviceNum: %d\n", g_soundCard2OutDeviceNum);
+        printf("  g_soundCard2SampleRate: %d\n", g_soundCard2SampleRate);
+
+        if (g_nSoundCards == 0) {
+            m_textCtrlRxIn ->SetValue("none"); rxInAudioDeviceNum  = -1;
+            m_textCtrlRxOut->SetValue("none"); rxOutAudioDeviceNum = -1;
+            m_textCtrlTxIn ->SetValue("none"); txInAudioDeviceNum  = -1;
+            m_textCtrlTxOut->SetValue("none"); txOutAudioDeviceNum = -1;           
+        }
+
+        if (g_nSoundCards == 1) {
+            rxInAudioDeviceNum  = setTextCtrlIfDevNumValid(m_textCtrlRxIn, 
+                                                           m_listCtrlRxInDevices, 
+                                                           g_soundCard1InDeviceNum);
+
+            rxOutAudioDeviceNum = setTextCtrlIfDevNumValid(m_textCtrlRxOut, 
+                                                           m_listCtrlRxOutDevices, 
+                                                           g_soundCard1OutDeviceNum);
+
+            if ((rxInAudioDeviceNum != -1) && (rxInAudioDeviceNum != -1)) {
+                m_cbSampleRateRxIn->SetValue(wxString::Format(wxT("%i"),g_soundCard1SampleRate));
+                m_cbSampleRateRxOut->SetValue(wxString::Format(wxT("%i"),g_soundCard1SampleRate));
+            }
+
+            m_textCtrlTxIn ->SetValue("none"); txInAudioDeviceNum  = -1;
+            m_textCtrlTxOut->SetValue("none"); txOutAudioDeviceNum = -1;           
+        }
+
+        if (g_nSoundCards == 2) {
+            rxInAudioDeviceNum  = setTextCtrlIfDevNumValid(m_textCtrlRxIn, 
+                                                           m_listCtrlRxInDevices, 
+                                                           g_soundCard1InDeviceNum);
+
+            rxOutAudioDeviceNum = setTextCtrlIfDevNumValid(m_textCtrlRxOut, 
+                                                           m_listCtrlRxOutDevices, 
+                                                           g_soundCard2OutDeviceNum);
+
+            txInAudioDeviceNum  = setTextCtrlIfDevNumValid(m_textCtrlTxIn, 
+                                                           m_listCtrlTxInDevices, 
+                                                           g_soundCard2InDeviceNum);
+
+            txOutAudioDeviceNum = setTextCtrlIfDevNumValid(m_textCtrlTxOut, 
+                                                           m_listCtrlTxOutDevices, 
+                                                           g_soundCard1OutDeviceNum);
+
+            if ((rxInAudioDeviceNum != -1) && (txOutAudioDeviceNum != -1)) {
+                m_cbSampleRateRxIn->SetValue(wxString::Format(wxT("%i"),g_soundCard1SampleRate));
+                m_cbSampleRateTxOut->SetValue(wxString::Format(wxT("%i"),g_soundCard1SampleRate));
+            }
+
+            if ((txInAudioDeviceNum != -1) && (rxOutAudioDeviceNum != -1)) {
+                m_cbSampleRateTxIn->SetValue(wxString::Format(wxT("%i"),g_soundCard2SampleRate));
+                m_cbSampleRateRxOut->SetValue(wxString::Format(wxT("%i"),g_soundCard2SampleRate));
+            }
+        }
+        printf("  rxInAudioDeviceNum: %d\n  rxOutAudioDeviceNum: %d\n  txInAudioDeviceNum: %d\n  txOutAudioDeviceNum: %d\n",
+               rxInAudioDeviceNum, rxOutAudioDeviceNum, txInAudioDeviceNum, txOutAudioDeviceNum);
+    }
+
+    if(inout == EXCHANGE_DATA_OUT)
+    {
+        int valid_one_card_config = 0;
+        int valid_two_card_config = 0;
+        wxString sampleRate1, sampleRate2;
+
+        printf("EXCHANGE_DATA_OUT:\n");
+        printf("  rxInAudioDeviceNum: %d\n  rxOutAudioDeviceNum: %d\n  txInAudioDeviceNum: %d\n  txOutAudioDeviceNum: %d\n",
+               rxInAudioDeviceNum, rxOutAudioDeviceNum, txInAudioDeviceNum, txOutAudioDeviceNum);
+
+        // ---------------------------------------------------------------
+        // check we have a valid 1 or 2 sound card configuration
+        // ---------------------------------------------------------------
+
+        // one sound card config, tx device numbers should be set to -1 
+
+        if ((rxInAudioDeviceNum != -1) && (rxOutAudioDeviceNum != -1) &&
+            (txInAudioDeviceNum == -1) && (txOutAudioDeviceNum == -1)) {
+            valid_one_card_config = 1; 
+
+            // in and out sample rate must be the same, as there is one callback
+            
+            sampleRate1 = m_cbSampleRateRxIn->GetValue();
+            if (!sampleRate1.IsSameAs(m_cbSampleRateRxOut->GetValue())) {
+                wxMessageBox(wxT("With a single sound card the Sample Rate of "
+                                 "From Radio and To Speaker/Headphones must be the same."), wxT(""), wxOK);
+                return -1;
+            }
+        }
+
+        // two card configuration
+
+        if ((rxInAudioDeviceNum != -1) && (rxOutAudioDeviceNum != -1) &&
+            (txInAudioDeviceNum != -1) && (txOutAudioDeviceNum != -1)) {
+
+            valid_two_card_config = 1; 
+
+            // Check we haven't doubled up on sound devices
+
+            if (rxInAudioDeviceNum == txInAudioDeviceNum) {
+                wxMessageBox(wxT("You must use different devices for From Radio and From Microphone"), wxT(""), wxOK);
+                return -1;
+            }
+
+            if (rxOutAudioDeviceNum == txOutAudioDeviceNum) {
+                wxMessageBox(wxT("You must use different devices for To Radio and To Speaker/Headphones"), wxT(""), wxOK);
+                return -1;
+            }
+
+            // Check sample rates for callback 1 devices are the same,
+            // as input and output are handled synchronously by one
+            // portaudio callback
+            
+            sampleRate1 = m_cbSampleRateRxIn->GetValue();
+            if (!sampleRate1.IsSameAs(m_cbSampleRateTxOut->GetValue())) {
+                wxMessageBox(wxT("With two sound cards the Sample Rate "
+                                 "of From Radio and To Radio must be the same."), wxT(""), wxOK);
+                return -1;
+            }
+            // check sample rate for callback 2 devices is the same
+
+            sampleRate2 = m_cbSampleRateTxIn->GetValue();
+            if (!sampleRate2.IsSameAs(m_cbSampleRateRxOut->GetValue())) {
+                wxMessageBox(wxT("With two sound cards the Sample Rate of "
+                                 "From Microphone and To Speaker/Headphones must be the same."), wxT(""), wxOK);
+                return -1;
+            }
+        }
+
+        printf("  valid_one_card_config: %d  valid_two_card_config: %d\n", valid_one_card_config, valid_two_card_config);
+
+        if (!valid_one_card_config && !valid_two_card_config) {
+            wxMessageBox(wxT("Invalid one or two sound card configuration"), wxT(""), wxOK);
+            return -1;
+        }
+
+        // ---------------------------------------------------------------
+        // Map Rx/TX device numbers to sound card device numbers used
+        // in callbacks. Portaudio uses one callback per sound card so
+        // we have to be soundcard oriented at run time rather than
+        // Tx/Rx oriented as in this dialog.
+        // ---------------------------------------------------------------
+        g_nSoundCards = 0;
+        g_soundCard1InDeviceNum = g_soundCard1OutDeviceNum = g_soundCard2InDeviceNum = g_soundCard2OutDeviceNum = -1;
+
+        if (valid_one_card_config) {
+
+            // Only callback 1 used
+
+            g_nSoundCards = 1;
+            g_soundCard1InDeviceNum  = rxInAudioDeviceNum;
+            g_soundCard1OutDeviceNum = rxOutAudioDeviceNum;
+            g_soundCard1SampleRate = wxAtoi(sampleRate1);
+        }
+
+        if (valid_two_card_config) {
+            g_nSoundCards = 2;
+            g_soundCard1InDeviceNum  = rxInAudioDeviceNum;
+            g_soundCard1OutDeviceNum = txOutAudioDeviceNum;
+            g_soundCard1SampleRate   = wxAtoi(sampleRate1);
+            g_soundCard2InDeviceNum  = txInAudioDeviceNum;
+            g_soundCard2OutDeviceNum = rxOutAudioDeviceNum;
+            g_soundCard2SampleRate   = wxAtoi(sampleRate2);
+        }
+
+        printf("  g_nSoundCards: %d\n", g_nSoundCards);
+        printf("  g_soundCard1InDeviceNum: %d\n", g_soundCard1InDeviceNum);
+        printf("  g_soundCard1OutDeviceNum: %d\n", g_soundCard1OutDeviceNum);
+        printf("  g_soundCard1SampleRate: %d\n", g_soundCard1SampleRate);
+        printf("  g_soundCard2InDeviceNum: %d\n", g_soundCard2InDeviceNum);
+        printf("  g_soundCard2OutDeviceNum: %d\n", g_soundCard2OutDeviceNum);
+        printf("  g_soundCard2SampleRate: %d\n", g_soundCard2SampleRate);
+
+        wxConfigBase *pConfig = wxConfigBase::Get();
+        pConfig->Write(wxT("/Audio/soundCard1InDeviceNum"),       g_soundCard1InDeviceNum);
+        pConfig->Write(wxT("/Audio/soundCard1OutDeviceNum"),      g_soundCard1OutDeviceNum);
+        pConfig->Write(wxT("/Audio/soundCard1SampleRate"),        g_soundCard1SampleRate );
+
+        pConfig->Write(wxT("/Audio/soundCard2InDeviceNum"),       g_soundCard2InDeviceNum);
+        pConfig->Write(wxT("/Audio/soundCard2OutDeviceNum"),      g_soundCard2OutDeviceNum);
+        pConfig->Write(wxT("/Audio/soundCard2SampleRate"),        g_soundCard2SampleRate );
+
+        pConfig->Flush();
+        delete wxConfigBase::Set((wxConfigBase *) NULL);
+    }
+
+    return 0;
+}
+
+//-------------------------------------------------------------------------
+// buildListOfSupportedSampleRates()
+//-------------------------------------------------------------------------
+int AudioOptsDialog:: buildListOfSupportedSampleRates(wxComboBox *cbSampleRate, int devNum, int in_out)
+{
+    // every sound device has a different list of supported sample rates, so
+    // we work out which ones are supported and populate the list ctrl
+
+    static double standardSampleRates[] =
+    {
+        8000.0,     9600.0,
+        11025.0,    12000.0,
+        16000.0,    22050.0,
+        24000.0,    32000.0,
+        44100.0,    48000.0,
+        88200.0,    96000.0,
+        192000.0,   -1          // negative terminated  list
+    };
+
+    const PaDeviceInfo  *deviceInfo;
+    PaStreamParameters   inputParameters, outputParameters;
+    PaError              err;
+    wxString             str;
+    int                  i, numSampleRates;
+
+    deviceInfo = Pa_GetDeviceInfo(devNum);
+    if (deviceInfo == NULL) {
+        printf("Pa_GetDeviceInfo(%d) failed!\n", devNum);
+        cbSampleRate->Clear();
+        return 0;
+    }
+
+    inputParameters.device = devNum;
+    inputParameters.channelCount = deviceInfo->maxInputChannels;
+    inputParameters.sampleFormat = paInt16;
+    inputParameters.suggestedLatency = 0;
+    inputParameters.hostApiSpecificStreamInfo = NULL;
+        
+    outputParameters.device = devNum;
+    outputParameters.channelCount = deviceInfo->maxOutputChannels;
+    outputParameters.sampleFormat = paInt16;
+    outputParameters.suggestedLatency = 0;
+    outputParameters.hostApiSpecificStreamInfo = NULL;
+    
+    cbSampleRate->Clear();
+    //printf("devNum %d supports: ", devNum);
+    numSampleRates = 0;
+    for(i = 0; standardSampleRates[i] > 0; i++)
+    {      
+        if (in_out == AUDIO_IN)
+            err = Pa_IsFormatSupported(&inputParameters, NULL, standardSampleRates[i]);
+        else
+            err = Pa_IsFormatSupported(NULL, &outputParameters, standardSampleRates[i]);
+
+        if( err == paFormatIsSupported ) {
+            str.Printf("%i", (int)standardSampleRates[i]);
+            cbSampleRate->AppendString(str);
+            printf("%i ", (int)standardSampleRates[i]);
+            numSampleRates++;
+        }
+    }
+    printf("\n");
+
+    return numSampleRates;
+}
+
+//-------------------------------------------------------------------------
+// showAPIInfo()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::showAPIInfo()
+{
+    wxString    strval;
+    int         apiVersion;
+    int         apiCount        = 0;
+    int         numDevices      = 0;
+
+    strval = Pa_GetVersionText();
+    m_textStringVer->SetLabel(strval);
+
+    apiVersion = Pa_GetVersion();
+    strval.Printf(wxT("%d"), apiVersion);
+    m_textIntVer->SetLabel(strval);
+
+    apiCount = Pa_GetHostApiCount();
+    strval.Printf(wxT("%d"), apiCount);
+    m_textAPICount->SetLabel(strval);
+
+    numDevices = Pa_GetDeviceCount();
+    strval.Printf(wxT("%d"), numDevices);
+    m_textCDevCount->SetLabel(strval);
+}
+
+//-------------------------------------------------------------------------
+// populateParams()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::populateParams(AudioInfoDisplay ai)
+{
+    const       PaDeviceInfo *deviceInfo = NULL;
+    wxListCtrl* ctrl    = ai.m_listDevices;
+    int         in_out  = ai.direction;
+    long        idx;
+    int         numDevices;
+    wxListItem  listItem;
+    wxString    buf;
+    int         devn;
+    int         col = 0;
+
+    numDevices = Pa_GetDeviceCount();
+
+    if(ctrl->GetColumnCount() > 0)
+    {
+        ctrl->ClearAll();
+    }
+
+    listItem.SetAlign(wxLIST_FORMAT_LEFT);
+    listItem.SetText(wxT("Device"));
+    idx = ctrl->InsertColumn(col, listItem);
+    ctrl->SetColumnWidth(col++, 300);
+
+    listItem.SetAlign(wxLIST_FORMAT_CENTRE);
+    listItem.SetText(wxT("ID"));
+    idx = ctrl->InsertColumn(col, listItem);
+    ctrl->SetColumnWidth(col++, 45);
+
+    listItem.SetAlign(wxLIST_FORMAT_LEFT);
+    listItem.SetText(wxT("API"));
+    idx = ctrl->InsertColumn(col, listItem);
+    ctrl->SetColumnWidth(col++, 100);
+
+    if(in_out == AUDIO_IN)
+    {
+        listItem.SetAlign(wxLIST_FORMAT_CENTRE);
+        listItem.SetText(wxT("Default Sample Rate"));
+        idx = ctrl->InsertColumn(col, listItem);
+        ctrl->SetColumnWidth(col++, 160);
+    }
+    else if(in_out == AUDIO_OUT)
+    {
+        listItem.SetAlign(wxLIST_FORMAT_CENTRE);
+        listItem.SetText(wxT("Default Sample Rate"));
+        idx = ctrl->InsertColumn(col, listItem);
+        ctrl->SetColumnWidth(col++, 160);
+    }
+
+    #ifdef LATENCY
+    listItem.SetAlign(wxLIST_FORMAT_CENTRE);
+    listItem.SetText(wxT("Min Latency"));
+    ctrl->InsertColumn(col, listItem);
+    ctrl->SetColumnWidth(col++, 100);
+
+    listItem.SetAlign(wxLIST_FORMAT_CENTRE);
+    listItem.SetText(wxT("Max Latency"));
+    ctrl->InsertColumn(col, listItem);
+    ctrl->SetColumnWidth(col++, 100);
+    #endif
+
+    for(devn = 0; devn < numDevices; devn++)
+    {
+        buf.Printf(wxT(""));
+        deviceInfo = Pa_GetDeviceInfo(devn);
+        if( ((in_out == AUDIO_IN) && (deviceInfo->maxInputChannels > 0)) ||
+            ((in_out == AUDIO_OUT) && (deviceInfo->maxOutputChannels > 0)))
+        {
+            col = 0;
+            buf.Printf(wxT("%s"), deviceInfo->name);
+            idx = ctrl->InsertItem(ctrl->GetItemCount(), buf);
+            col++;
+                
+            buf.Printf(wxT("%d"), devn);
+            ctrl->SetItem(idx, col++, buf);
+
+            buf.Printf(wxT("%s"), Pa_GetHostApiInfo(deviceInfo->hostApi)->name);
+            ctrl->SetItem(idx, col++, buf);
+
+            buf.Printf(wxT("%i"), (int)deviceInfo->defaultSampleRate);
+            ctrl->SetItem(idx, col++, buf);
+
+            #ifdef LATENCY
+            if (in_out == AUDIO_IN)
+                buf.Printf(wxT("%8.4f"), deviceInfo->defaultLowInputLatency);
+            else
+                buf.Printf(wxT("%8.4f"), deviceInfo->defaultLowOutputLatency);               
+            ctrl->SetItem(idx, col++, buf);
+
+            if (in_out == AUDIO_IN)
+                buf.Printf(wxT("%8.4f"), deviceInfo->defaultHighInputLatency);
+            else
+                 buf.Printf(wxT("%8.4f"), deviceInfo->defaultHighOutputLatency);             
+            ctrl->SetItem(idx, col++, buf);
+            #endif
+        }        
+    }
+
+    // add "none" option at end
+
+    buf.Printf(wxT("%s"), "none");
+    idx = ctrl->InsertItem(ctrl->GetItemCount(), buf);
+}
+
+//-------------------------------------------------------------------------
+// OnDeviceSelect()
+//
+// helper function to set up "Device:" and "Sample Rate:" fields when
+// we click on a line in the list of devices box
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnDeviceSelect(wxComboBox *cbSampleRate, 
+                                     wxTextCtrl *textCtrl, 
+                                     int        *devNum, 
+                                     wxListCtrl *listCtrlDevices, 
+                                     int         index,
+                                     int         in_out)
+{
+
+    wxString devName = listCtrlDevices->GetItemText(index, 0);
+     if (devName.IsSameAs("none")) {
+        *devNum = -1;
+        textCtrl->SetValue("none");
+    }
+    else {
+        *devNum = wxAtoi(listCtrlDevices->GetItemText(index, 1));
+        textCtrl->SetValue(devName + " (" + wxString::Format(wxT("%i"),*devNum) + ")");
+
+        int numSampleRates = buildListOfSupportedSampleRates(cbSampleRate, *devNum, in_out);
+        if (numSampleRates) {
+            wxString defSampleRate = listCtrlDevices->GetItemText(index, 3);        
+            cbSampleRate->SetValue(defSampleRate);
+        }
+        else {
+             cbSampleRate->SetValue("None");           
+        }
+    }
+}
+
+//-------------------------------------------------------------------------
+// OnRxInDeviceSelect()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnRxInDeviceSelect(wxListEvent& evt)
+{
+    OnDeviceSelect(m_cbSampleRateRxIn, 
+                   m_textCtrlRxIn, 
+                   &rxInAudioDeviceNum, 
+                   m_listCtrlRxInDevices, 
+                   evt.GetIndex(),
+                   AUDIO_IN);
+}
+
+//-------------------------------------------------------------------------
+// OnRxOutDeviceSelect()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnRxOutDeviceSelect(wxListEvent& evt)
+{
+    OnDeviceSelect(m_cbSampleRateRxOut, 
+                   m_textCtrlRxOut, 
+                   &rxOutAudioDeviceNum, 
+                   m_listCtrlRxOutDevices, 
+                   evt.GetIndex(),
+                   AUDIO_OUT);
+}
+
+//-------------------------------------------------------------------------
+// OnTxInDeviceSelect()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnTxInDeviceSelect(wxListEvent& evt)
+{
+    OnDeviceSelect(m_cbSampleRateTxIn, 
+                   m_textCtrlTxIn, 
+                   &txInAudioDeviceNum, 
+                   m_listCtrlTxInDevices, 
+                   evt.GetIndex(),
+                   AUDIO_IN);
+}
+
+//-------------------------------------------------------------------------
+// OnTxOutDeviceSelect()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnTxOutDeviceSelect(wxListEvent& evt)
+{
+    OnDeviceSelect(m_cbSampleRateTxOut, 
+                   m_textCtrlTxOut, 
+                   &txOutAudioDeviceNum, 
+                   m_listCtrlTxOutDevices, 
+                   evt.GetIndex(),
+                   AUDIO_OUT);
+}
+
+//-------------------------------------------------------------------------
+// plotDeviceInputForAFewSecs()
+//
+// opens a record device and plots the input speech for a few seconds.  This is "modal" using
+// synchronous portaudio functions, so the GUI will not respond until after test sample has been
+// taken
+//-------------------------------------------------------------------------
+void AudioOptsDialog::plotDeviceInputForAFewSecs(int devNum, PlotScalar *plotScalar) {
+    PaStreamParameters  inputParameters;
+    const PaDeviceInfo *deviceInfo = NULL;
+    PaStream           *stream = NULL;
+    PaError             err;
+    short               in48k_stereo_short[2*TEST_BUF_SIZE];
+    short               in48k_short[TEST_BUF_SIZE];
+    short               in8k_short[TEST_BUF_SIZE];
+    int                 numDevices, nBufs, i, j, src_error,inputChannels;
+    float               t;
+    SRC_STATE          *src;
+    FIFO               *fifo;
+
+    // a basic sanity check
+    numDevices = Pa_GetDeviceCount();
+    if (devNum >= numDevices)
+        return;
+    if (devNum < 0)
+        return;
+    printf("devNum %d\n", devNum);
+
+    fifo = fifo_create((int)(DT*TEST_WAVEFORM_PLOT_FS*2)); assert(fifo != NULL);
+    src = src_new(SRC_SINC_FASTEST, 1, &src_error); assert(src != NULL);
+
+    // work out how many input channels this device supports.
+
+    deviceInfo = Pa_GetDeviceInfo(devNum);
+    if (deviceInfo == NULL) {
+        wxMessageBox(wxT("Couldn't get device info from Port Audio for Sound Card "), wxT("Error"), wxOK);
+        return;
+    }
+    if (deviceInfo->maxInputChannels == 1)
+        inputChannels = 1;
+    else
+        inputChannels = 2;
+
+    // open device
+
+    inputParameters.device = devNum;
+    inputParameters.channelCount = inputChannels;
+    inputParameters.sampleFormat = paInt16;
+    inputParameters.suggestedLatency = Pa_GetDeviceInfo( inputParameters.device )->defaultHighInputLatency;
+    inputParameters.hostApiSpecificStreamInfo = NULL;
+
+    nBufs = TEST_WAVEFORM_PLOT_TIME*TEST_FS/TEST_BUF_SIZE;
+    printf("inputChannels: %d nBufs %d\n", inputChannels, nBufs);
+
+    err = Pa_OpenStream(
+              &stream,
+              &inputParameters,
+              NULL,
+              TEST_FS,
+              TEST_BUF_SIZE,
+              paClipOff,    
+              NULL,       // no callback, use blocking API
+              NULL ); 
+    if (err != paNoError) {
+        wxMessageBox(wxT("Couldn't initialise sound device."), wxT("Error"), wxOK);       
+        return;
+    }
+
+    err = Pa_StartStream(stream);
+    if (err != paNoError) {
+        wxMessageBox(wxT("Couldn't start sound device."), wxT("Error"), wxOK);       
+        return;
+    }
+
+    for(i=0, t=0.0; i<nBufs; i++, t+=(float)TEST_BUF_SIZE/TEST_FS) {
+        Pa_ReadStream(stream, in48k_stereo_short, TEST_BUF_SIZE);
+        if (inputChannels == 2) {
+            for(j=0; j<TEST_BUF_SIZE; j++)
+                in48k_short[j] = in48k_stereo_short[2*j]; // left channel only
+        }
+        else {
+            for(j=0; j<TEST_BUF_SIZE; j++)
+                in48k_short[j] = in48k_stereo_short[j]; 
+        }
+        int n8k = resample(src, in8k_short, in48k_short, 8000, TEST_FS, TEST_BUF_SIZE, TEST_BUF_SIZE);
+        resample_for_plot(fifo, in8k_short, n8k, FS);
+
+        // every TEST_DT seconds update plot, unfortunately plot
+        // doesnt get updated to end as we are blocking events in this
+        // function
+
+        if (t > TEST_DT) {
+            t -= TEST_DT;
+            short plotSamples[TEST_WAVEFORM_PLOT_BUF];
+            if (fifo_read(fifo, plotSamples, TEST_WAVEFORM_PLOT_BUF))
+                memset(plotSamples, 0, TEST_WAVEFORM_PLOT_BUF*sizeof(short));
+            plotScalar->add_new_short_samples(0, plotSamples, TEST_WAVEFORM_PLOT_BUF, 32767);
+            plotScalar->Refresh();
+       }
+    }
+   
+    err = Pa_StopStream(stream);
+    if (err != paNoError) {
+        wxMessageBox(wxT("Couldn't stop sound device."), wxT("Error"), wxOK);       
+        return;
+    }
+    Pa_CloseStream(stream);
+
+    fifo_destroy(fifo);
+    src_delete(src);
+}
+
+//-------------------------------------------------------------------------
+// plotDeviceOutputForAFewSecs()
+//
+// opens a play device and plays a tone for a few seconds.  This is "modal" using
+// synchronous portaudio functions, so the GUI will not respond until after test sample has been
+// taken.  Also plots a pretty picture like the record versions
+//-------------------------------------------------------------------------
+void AudioOptsDialog::plotDeviceOutputForAFewSecs(int devNum, PlotScalar *plotScalar) {
+    PaStreamParameters  outputParameters;
+    const PaDeviceInfo *deviceInfo = NULL;
+    PaStream           *stream = NULL;
+    PaError             err;
+    short               out48k_stereo_short[2*TEST_BUF_SIZE];
+    short               out48k_short[TEST_BUF_SIZE];
+    short               out8k_short[TEST_BUF_SIZE];
+    int                 numDevices, nBufs, i, j, src_error, n, outputChannels;
+    float               t;
+    SRC_STATE          *src;
+    FIFO               *fifo;
+
+    // a basic sanity check
+    numDevices = Pa_GetDeviceCount();
+    if (devNum >= numDevices)
+        return;
+    if (devNum < 0)
+        return;
+
+    fifo = fifo_create((int)(DT*TEST_WAVEFORM_PLOT_FS*2)); assert(fifo != NULL);
+    src = src_new(SRC_SINC_FASTEST, 1, &src_error); assert(src != NULL);
+
+    // work out how many output channels this device supports.
+
+    deviceInfo = Pa_GetDeviceInfo(devNum);
+    if (deviceInfo == NULL) {
+        wxMessageBox(wxT("Couldn't get device info from Port Audio for Sound Card "), wxT("Error"), wxOK);
+        return;
+    }
+    if (deviceInfo->maxOutputChannels == 1)
+        outputChannels = 1;
+    else
+        outputChannels = 2;
+
+    printf("outputChannels: %d\n", outputChannels);
+
+    outputParameters.device = devNum;
+    outputParameters.channelCount = outputChannels;
+    outputParameters.sampleFormat = paInt16;
+    outputParameters.suggestedLatency = Pa_GetDeviceInfo( outputParameters.device )->defaultHighOutputLatency;
+    outputParameters.hostApiSpecificStreamInfo = NULL;
+
+    nBufs = TEST_WAVEFORM_PLOT_TIME*TEST_FS/TEST_BUF_SIZE;
+
+    err = Pa_OpenStream(
+              &stream,
+              NULL,
+              &outputParameters,
+              TEST_FS,
+              TEST_BUF_SIZE,
+              paClipOff,    
+              NULL,       // no callback, use blocking API
+              NULL ); 
+    if (err != paNoError) {
+        wxMessageBox(wxT("Couldn't initialise sound device."), wxT("Error"), wxOK);       
+        return;
+    }
+
+    err = Pa_StartStream(stream);
+    if (err != paNoError) {
+        wxMessageBox(wxT("Couldn't start sound device."), wxT("Error"), wxOK);       
+        return;
+    }
+
+    for(i=0, t=0.0, n=0; i<nBufs; i++, t+=(float)TEST_BUF_SIZE/TEST_FS) {
+        for(j=0; j<TEST_BUF_SIZE; j++,n++) {
+            out48k_short[j] = 2000.0*cos(6.2832*(n++)*400.0/TEST_FS);
+            if (outputChannels == 2) {
+                out48k_stereo_short[2*j] = out48k_short[j];   // left channel
+                out48k_stereo_short[2*j+1] = out48k_short[j]; // right channel
+            }
+            else {
+                out48k_stereo_short[j] = out48k_short[j];     // mono
+            }
+        }
+        Pa_WriteStream(stream, out48k_stereo_short, TEST_BUF_SIZE);
+
+        // convert back to 8kHz just for plotting
+        int n8k = resample(src, out8k_short, out48k_short, 8000, TEST_FS, TEST_BUF_SIZE, TEST_BUF_SIZE);
+        resample_for_plot(fifo, out8k_short, n8k, FS);
+
+        // every TEST_DT seconds update plot
+
+        if (t > TEST_DT) {
+            t -= TEST_DT;
+            short plotSamples[TEST_WAVEFORM_PLOT_BUF];
+            if (fifo_read(fifo, plotSamples, TEST_WAVEFORM_PLOT_BUF))
+                memset(plotSamples, 0, TEST_WAVEFORM_PLOT_BUF*sizeof(short));
+            plotScalar->add_new_short_samples(0, plotSamples, TEST_WAVEFORM_PLOT_BUF, 32767);
+            plotScalar->Refresh();
+       }
+    }
+   
+    err = Pa_StopStream(stream);
+    if (err != paNoError) {
+        wxMessageBox(wxT("Couldn't stop sound device."), wxT("Error"), wxOK);       
+        return;
+    }
+    Pa_CloseStream(stream);
+
+    fifo_destroy(fifo);
+    src_delete(src);
+}
+
+//-------------------------------------------------------------------------
+// OnRxInTest()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnRxInTest(wxCommandEvent& event)
+{
+    plotDeviceInputForAFewSecs(rxInAudioDeviceNum, m_plotScalarRxIn);
+}
+
+//-------------------------------------------------------------------------
+// OnRxOutTest()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnRxOutTest(wxCommandEvent& event)
+{
+    plotDeviceOutputForAFewSecs(rxOutAudioDeviceNum, m_plotScalarRxOut);
+}
+
+//-------------------------------------------------------------------------
+// OnTxInTest()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnTxInTest(wxCommandEvent& event)
+{
+    plotDeviceInputForAFewSecs(txInAudioDeviceNum, m_plotScalarTxIn);
+}
+
+//-------------------------------------------------------------------------
+// OnTxOutTest()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnTxOutTest(wxCommandEvent& event)
+{
+    plotDeviceOutputForAFewSecs(txOutAudioDeviceNum, m_plotScalarTxOut);
+}
+
+//-------------------------------------------------------------------------
+// OnRefreshClick()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnRefreshClick(wxCommandEvent& event)
+{
+    // restart portaudio, to re-sample available devices
+
+    Pa_Terminate();
+    Pa_Init();
+
+    m_notebook1->SetSelection(0);
+    showAPIInfo();
+    populateParams(m_RxInDevices);
+    populateParams(m_RxOutDevices);
+    populateParams(m_TxInDevices);
+    populateParams(m_TxOutDevices);
+
+    // some devices may have dissapeared, so possibily change sound
+    // card config
+
+    ExchangeData(EXCHANGE_DATA_IN);
+}
+
+//-------------------------------------------------------------------------
+// OnApplyAudioParameters()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnApplyAudioParameters(wxCommandEvent& event)
+{
+    ExchangeData(EXCHANGE_DATA_OUT);
+    if(m_isPaInitialized)
+    {
+        if((pa_err = Pa_Terminate()) == paNoError)
+        {
+            m_isPaInitialized = false;
+        }
+        else
+        {
+            wxMessageBox(wxT("Port Audio failed to Terminate"), wxT("Pa_Terminate"), wxOK);
+        }
+    }
+}
+
+//-------------------------------------------------------------------------
+// OnCancelAudioParameters()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnCancelAudioParameters(wxCommandEvent& event)
+{
+    if(m_isPaInitialized)
+    {
+        if((pa_err = Pa_Terminate()) == paNoError)
+        {
+            m_isPaInitialized = false;
+        }
+        else
+        {
+            wxMessageBox(wxT("Port Audio failed to Terminate"), wxT("Pa_Terminate"), wxOK);
+        }
+    }
+    EndModal(wxCANCEL);
+}
+
+//-------------------------------------------------------------------------
+// OnOkAudioParameters()
+//-------------------------------------------------------------------------
+void AudioOptsDialog::OnOkAudioParameters(wxCommandEvent& event)
+{
+    int status = ExchangeData(EXCHANGE_DATA_OUT);
+
+    // We only accept OK if config sucessful
+
+    printf("status: %d m_isPaInitialized: %d\n", status, m_isPaInitialized);
+    if (status == 0) {
+        if(m_isPaInitialized)
+        {
+            if((pa_err = Pa_Terminate()) == paNoError)
+            {
+                printf("terminated OK\n");
+                m_isPaInitialized = false;
+            }
+            else
+            {
+                wxMessageBox(wxT("Port Audio failed to Terminate"), wxT("Pa_Terminate"), wxOK);
+            }
+        }
+        EndModal(wxOK);
+    }
+
+}
diff --git a/freedv/tags/0.99-Beta/src/dlg_audiooptions.h b/freedv/tags/0.99-Beta/src/dlg_audiooptions.h
new file mode 100644 (file)
index 0000000..7a78b59
--- /dev/null
@@ -0,0 +1,176 @@
+//=========================================================================
+// Name:          AudioInfoDisplay.h
+// Purpose:       Declares simple wxWidgets application with GUI
+//                created using wxFormBuilder.
+// 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 <http://www.gnu.org/licenses/>.
+//
+//=========================================================================
+#ifndef __AudioOptsDialog__
+#define __AudioOptsDialog__
+
+#include "fdmdv2_main.h"
+
+#define ID_AUDIO_OPTIONS    1000
+#define AUDIO_IN            0
+#define AUDIO_OUT           1
+
+#include "portaudio.h"
+#ifdef WIN32
+#if PA_USE_ASIO
+#include "pa_asio.h"
+#endif
+#endif
+#include "codec2_fifo.h"
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// AudioInfoDisplay
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class AudioInfoDisplay
+{
+    public:
+        wxListCtrl*     m_listDevices;
+        int             direction;
+        wxTextCtrl*     m_textDevice;
+        wxComboBox*     m_cbSampleRate;
+};
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// class AudioOptsDialog
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class AudioOptsDialog : public wxDialog
+{
+    private:
+
+    protected:
+        PaError         pa_err;
+        bool            m_isPaInitialized;
+
+        int             rxInAudioDeviceNum;
+        int             rxOutAudioDeviceNum;
+        int             txInAudioDeviceNum;
+        int             txOutAudioDeviceNum;
+
+        void buildTestControls(PlotScalar **plotScalar, wxButton **btnTest, 
+                               wxPanel *parentPanel, wxBoxSizer *bSizer, wxString buttonLabel);
+        void plotDeviceInputForAFewSecs(int devNum, PlotScalar *plotScalar);
+        void plotDeviceOutputForAFewSecs(int devNum, PlotScalar *plotScalar);
+
+        int buildListOfSupportedSampleRates(wxComboBox *cbSampleRate, int devNum, int in_out);
+        void populateParams(AudioInfoDisplay);
+        void showAPIInfo();
+        int setTextCtrlIfDevNumValid(wxTextCtrl *textCtrl, wxListCtrl *listCtrl, int devNum);
+        void Pa_Init(void);
+        void OnDeviceSelect(wxComboBox *cbSampleRate, 
+                            wxTextCtrl *textCtrl, 
+                            int        *devNum, 
+                            wxListCtrl *listCtrlDevices, 
+                            int         index,
+                            int         in_out);
+
+        AudioInfoDisplay m_RxInDevices;
+        AudioInfoDisplay m_RxOutDevices;
+        AudioInfoDisplay m_TxInDevices;
+        AudioInfoDisplay m_TxOutDevices;
+        wxPanel* m_panel1;
+        wxNotebook* m_notebook1;
+
+        wxPanel* m_panelRx;
+
+        wxListCtrl* m_listCtrlRxInDevices;
+        wxStaticText* m_staticText51;
+        wxTextCtrl* m_textCtrlRxIn;
+        wxStaticText* m_staticText6;
+        wxComboBox* m_cbSampleRateRxIn;
+
+        wxButton* m_btnRxInTest;
+        PlotScalar* m_plotScalarRxIn;
+
+        wxListCtrl* m_listCtrlRxOutDevices;
+        wxStaticText* m_staticText9;
+        wxTextCtrl* m_textCtrlRxOut;
+        wxStaticText* m_staticText10;
+        wxComboBox* m_cbSampleRateRxOut;
+
+        wxButton* m_btnRxOutTest;
+        PlotScalar* m_plotScalarRxOut;
+
+        wxPanel* m_panelTx;
+
+        wxListCtrl* m_listCtrlTxInDevices;
+        wxStaticText* m_staticText12;
+        wxTextCtrl* m_textCtrlTxIn;
+        wxStaticText* m_staticText11;
+        wxComboBox* m_cbSampleRateTxIn;
+
+        wxButton* m_btnTxInTest;
+        PlotScalar* m_plotScalarTxIn;
+
+        wxListCtrl* m_listCtrlTxOutDevices;
+        wxStaticText* m_staticText81;
+        wxTextCtrl* m_textCtrlTxOut;
+        wxStaticText* m_staticText71;
+        wxComboBox* m_cbSampleRateTxOut;
+
+        wxButton* m_btnTxOutTest;
+        PlotScalar* m_plotScalarTxOut;
+
+        wxPanel* m_panelAPI;
+
+        wxStaticText* m_staticText7;
+        wxStaticText* m_textStringVer;
+        wxStaticText* m_staticText8;
+        wxStaticText* m_textIntVer;
+        wxStaticText* m_staticText5;
+        wxStaticText* m_textCDevCount;
+        wxStaticText* m_staticText4;
+        wxStaticText* m_textAPICount;
+        wxButton* m_btnRefresh;
+        wxStdDialogButtonSizer* m_sdbSizer1;
+        wxButton* m_sdbSizer1OK;
+        wxButton* m_sdbSizer1Apply;
+        wxButton* m_sdbSizer1Cancel;
+
+        // Virtual event handlers, overide them in your derived class
+        //virtual void OnActivateApp( wxActivateEvent& event ) { event.Skip(); }
+//        virtual void OnCloseFrame( wxCloseEvent& event ) { event.Skip(); }
+
+        void OnRxInDeviceSelect( wxListEvent& event );
+
+        void OnRxInTest( wxCommandEvent& event );
+        void OnRxOutTest( wxCommandEvent& event );
+        void OnTxInTest( wxCommandEvent& event );
+        void OnTxOutTest( wxCommandEvent& event );
+
+        void OnRxOutDeviceSelect( wxListEvent& event );
+        void OnTxInDeviceSelect( wxListEvent& event );
+        void OnTxOutDeviceSelect( wxListEvent& event );
+        void OnRefreshClick( wxCommandEvent& event );
+        void OnApplyAudioParameters( wxCommandEvent& event );
+        void OnCancelAudioParameters( wxCommandEvent& event );
+        void OnOkAudioParameters( wxCommandEvent& event );
+        // Virtual event handlers, overide them in your derived class
+        void OnClose( wxCloseEvent& event ) { event.Skip(); }
+        void OnHibernate( wxActivateEvent& event ) { event.Skip(); }
+        void OnIconize( wxIconizeEvent& event ) { event.Skip(); }
+        void OnInitDialog( wxInitDialogEvent& event );
+
+    public:
+
+        AudioOptsDialog( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Audio Config"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 300,300 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
+        ~AudioOptsDialog();
+        int ExchangeData(int inout);
+};
+#endif //__AudioOptsDialog__
diff --git a/freedv/tags/0.99-Beta/src/dlg_filter.cpp b/freedv/tags/0.99-Beta/src/dlg_filter.cpp
new file mode 100644 (file)
index 0000000..0de8e8c
--- /dev/null
@@ -0,0 +1,786 @@
+//==========================================================================
+// Name:            dlg_filter.cpp
+// Purpose:         Dialog for controlling Codec audio filtering
+// Date:            Nov 25 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#include "dlg_filter.h"
+
+#define SLIDER_MAX 100
+#define SLIDER_LENGTH 100
+
+#define FILTER_MIN_MAG_DB -20.0
+#define FILTER_MAX_MAG_DB  20.0
+
+#define MAX_FREQ_BASS      600.00
+#define MAX_FREQ_TREBLE   3900.00
+#define MAX_FREQ_DEF      3000.00
+
+#define MIN_GAIN          -20
+#define MAX_GAIN           20
+
+#define MAX_LOG10_Q         1.0
+#define MIN_LOG10_Q        -1.0 
+
+// DFT parameters
+
+#define IMP_AMP           2000.0                     // amplitude of impulse
+#define NIMP              50                         // number of samples in impulse response
+#define F_STEP_DFT        10.0                       // frequency steps to sample spectrum
+#define F_MAG_N           (int)(MAX_F_HZ/F_STEP_DFT) // number of frequency steps
+
+extern struct freedv      *g_pfreedv;
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class FilterDlg
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+FilterDlg::FilterDlg(wxWindow* parent, bool running, bool *newMicInFilter, bool *newSpkOutFilter,
+                     wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style)
+{
+    m_running = running;
+    m_newMicInFilter = newMicInFilter;
+    m_newSpkOutFilter = newSpkOutFilter;
+
+    this->SetSizeHints(wxDefaultSize, wxDefaultSize);
+
+    wxBoxSizer* bSizer30;
+    bSizer30 = new wxBoxSizer(wxVERTICAL);
+
+    // LPC Post Filter --------------------------------------------------------
+
+    wxStaticBoxSizer* lpcpfs = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("LPC Post Filter")), wxHORIZONTAL);
+
+    wxBoxSizer* left = new wxBoxSizer(wxVERTICAL);
+
+    m_codec2LPCPostFilterEnable = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition,wxDefaultSize, wxCHK_2STATE);
+    left->Add(m_codec2LPCPostFilterEnable);
+
+    m_codec2LPCPostFilterBassBoost = new wxCheckBox(this, wxID_ANY, _("0-1 kHz 3dB Boost"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
+    left->Add(m_codec2LPCPostFilterBassBoost);
+    lpcpfs->Add(left, 0, wxALL, 5);
+
+    newLPCPFControl(&m_codec2LPCPostFilterBeta, &m_staticTextBeta, lpcpfs, "Beta");
+    newLPCPFControl(&m_codec2LPCPostFilterGamma, &m_staticTextGamma, lpcpfs, "Gamma");
+
+    m_LPCPostFilterDefault = new wxButton(this, wxID_ANY, wxT("Default"));
+    lpcpfs->Add(m_LPCPostFilterDefault, 0, wxALL|wxALIGN_CENTRE_HORIZONTAL|wxALIGN_CENTRE_VERTICAL, 5);
+
+    bSizer30->Add(lpcpfs, 0, wxALL, 0);
+
+    // Speex pre-processor --------------------------------------------------
+
+    wxStaticBoxSizer* sbSizer_speexpp;
+    wxStaticBox *sb_speexpp = new wxStaticBox(this, wxID_ANY, _("Speex Mic Audio Pre-Processor"));
+    sbSizer_speexpp = new wxStaticBoxSizer(sb_speexpp, wxVERTICAL);
+
+    m_ckboxSpeexpp = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
+    sb_speexpp->SetToolTip(_("Enable noise supression, dereverberation, AGC of mic signal"));
+    sbSizer_speexpp->Add(m_ckboxSpeexpp, wxALIGN_LEFT, 2);
+
+    bSizer30->Add(sbSizer_speexpp, 0, wxALL, 0);   
+
+    // EQ Filters -----------------------------------------------------------
+
+    wxStaticBoxSizer* eqMicInSizer = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Mic In Equaliser")), wxVERTICAL);
+    wxBoxSizer* eqMicInSizer1 = new wxBoxSizer(wxHORIZONTAL);
+    wxBoxSizer* eqMicInSizer2 = new wxBoxSizer(wxHORIZONTAL);
+
+    m_MicInBass   = newEQ(eqMicInSizer1, "Bass"  , MAX_FREQ_BASS, disableQ);
+    m_MicInTreble = newEQ(eqMicInSizer1, "Treble", MAX_FREQ_TREBLE, disableQ);
+    eqMicInSizer->Add(eqMicInSizer1);
+
+    m_MicInEnable = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition,wxDefaultSize, wxCHK_2STATE);
+    eqMicInSizer2->Add(m_MicInEnable,0,wxALIGN_CENTRE_VERTICAL|wxRIGHT,10);
+    m_MicInMid    = newEQ(eqMicInSizer2, "Mid"   , MAX_FREQ_DEF, enableQ);
+    m_MicInDefault = new wxButton(this, wxID_ANY, wxT("Default"));
+    eqMicInSizer2->Add(m_MicInDefault,0,wxALIGN_CENTRE_VERTICAL|wxLEFT,20);
+    eqMicInSizer->Add(eqMicInSizer2);
+
+    wxStaticBoxSizer* eqSpkOutSizer = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Speaker Out Equaliser")), wxVERTICAL);
+    wxBoxSizer* eqSpkOutSizer1 = new wxBoxSizer(wxHORIZONTAL);
+    wxBoxSizer* eqSpkOutSizer2 = new wxBoxSizer(wxHORIZONTAL);
+
+    m_SpkOutBass   = newEQ(eqSpkOutSizer1, "Bass"  , MAX_FREQ_BASS, disableQ);
+    m_SpkOutTreble = newEQ(eqSpkOutSizer1, "Treble", MAX_FREQ_TREBLE, disableQ);
+    eqSpkOutSizer->Add(eqSpkOutSizer1);
+
+    m_SpkOutEnable = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition,wxDefaultSize, wxCHK_2STATE);
+    eqSpkOutSizer2->Add(m_SpkOutEnable,0,wxALIGN_CENTRE_VERTICAL|wxRIGHT,10);
+    m_SpkOutMid    = newEQ(eqSpkOutSizer2, "Mid"   , MAX_FREQ_DEF, enableQ);
+    m_SpkOutDefault = new wxButton(this, wxID_ANY, wxT("Default"));
+    eqSpkOutSizer2->Add(m_SpkOutDefault,0,wxALIGN_CENTRE_VERTICAL|wxLEFT,20);
+    eqSpkOutSizer->Add(eqSpkOutSizer2);
+    
+    bSizer30->Add(eqMicInSizer, 0, wxALL, 0);
+    bSizer30->Add(eqSpkOutSizer, 0, wxALL, 0);
+
+    // Storgage for spectrum magnitude plots ------------------------------------
+
+    m_MicInMagdB = new float[F_MAG_N];
+    for(int i=0; i<F_MAG_N; i++)
+        m_MicInMagdB[i] = 0.0;
+
+    m_SpkOutMagdB = new float[F_MAG_N];
+    for(int i=0; i<F_MAG_N; i++)
+        m_SpkOutMagdB[i] = 0.0;
+
+    // Spectrum Plots -----------------------------------------------------------
+
+    long nb_style = wxAUI_NB_BOTTOM | wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_MOVE | wxAUI_NB_SCROLL_BUTTONS;
+    m_auiNotebook = new wxAuiNotebook(this, wxID_ANY, wxDefaultPosition, wxSize(-1,200), nb_style);
+    m_auiNotebook->SetFont(wxFont(8, 70, 90, 90, false, wxEmptyString));
+
+    bSizer30->Add(m_auiNotebook, 0, wxEXPAND|wxALL, 3);
+    
+    m_MicInFreqRespPlot = new PlotSpectrum((wxFrame*) m_auiNotebook, m_MicInMagdB, F_MAG_N, FILTER_MIN_MAG_DB, FILTER_MAX_MAG_DB);
+    m_auiNotebook->AddPage(m_MicInFreqRespPlot, _("Microphone In Equaliser"));
+
+    m_SpkOutFreqRespPlot = new PlotSpectrum((wxFrame*)m_auiNotebook, m_SpkOutMagdB, F_MAG_N, FILTER_MIN_MAG_DB, FILTER_MAX_MAG_DB);
+    m_auiNotebook->AddPage(m_SpkOutFreqRespPlot, _("Speaker Out Equaliser"));
+
+    //  OK - Cancel buttons at the bottom --------------------------
+
+    wxBoxSizer* bSizer31 = new wxBoxSizer(wxHORIZONTAL);
+
+    m_sdbSizer5OK = new wxButton(this, wxID_OK);
+    bSizer31->Add(m_sdbSizer5OK, 0, wxALL, 2);
+
+    m_sdbSizer5Cancel = new wxButton(this, wxID_CANCEL);
+    bSizer31->Add(m_sdbSizer5Cancel, 0, wxALL, 2);
+
+    bSizer30->Add(bSizer31, 0, wxALIGN_RIGHT|wxALL, 0);
+
+    this->SetSizer(bSizer30);
+    this->Layout();
+
+    this->Centre(wxBOTH);
+    // Connect Events -------------------------------------------------------
+
+    this->Connect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(FilterDlg::OnInitDialog));
+
+    m_codec2LPCPostFilterEnable->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnEnable), NULL, this);
+    m_codec2LPCPostFilterBassBoost->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnBassBoost), NULL, this);
+    m_codec2LPCPostFilterBeta->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnBetaScroll), NULL, this);
+    m_codec2LPCPostFilterGamma->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnGammaScroll), NULL, this);
+    m_LPCPostFilterDefault->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnLPCPostFilterDefault), NULL, this);
+
+    m_ckboxSpeexpp->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnSpeexppEnable), NULL, this);
+
+    m_MicInBass.sliderFreq->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInBassFreqScroll), NULL, this);
+    m_MicInBass.sliderGain->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInBassGainScroll), NULL, this);
+    m_MicInTreble.sliderFreq->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInTrebleFreqScroll), NULL, this);
+    m_MicInTreble.sliderGain->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInTrebleGainScroll), NULL, this);
+    m_MicInMid.sliderFreq->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInMidFreqScroll), NULL, this);
+    m_MicInMid.sliderGain->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInMidGainScroll), NULL, this);
+    m_MicInMid.sliderQ->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInMidQScroll), NULL, this);
+    m_MicInEnable->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnMicInEnable), NULL, this);
+    m_MicInDefault->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnMicInDefault), NULL, this);
+
+    m_SpkOutBass.sliderFreq->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutBassFreqScroll), NULL, this);
+    m_SpkOutBass.sliderGain->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutBassGainScroll), NULL, this);
+    m_SpkOutTreble.sliderFreq->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutTrebleFreqScroll), NULL, this);
+    m_SpkOutTreble.sliderGain->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutTrebleGainScroll), NULL, this);
+    m_SpkOutMid.sliderFreq->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutMidFreqScroll), NULL, this);
+    m_SpkOutMid.sliderGain->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutMidGainScroll), NULL, this);
+    m_SpkOutMid.sliderQ->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutMidQScroll), NULL, this);
+    m_SpkOutEnable->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnSpkOutEnable), NULL, this);
+    m_SpkOutDefault->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnSpkOutDefault), NULL, this);
+
+    m_sdbSizer5Cancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnCancel), NULL, this);
+    m_sdbSizer5OK->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnOK), NULL, this);
+
+}
+
+//-------------------------------------------------------------------------
+// ~FilterDlg()
+//-------------------------------------------------------------------------
+FilterDlg::~FilterDlg()
+{
+    delete m_MicInMagdB;
+    delete m_SpkOutMagdB;
+
+    // Disconnect Events
+
+    this->Disconnect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(FilterDlg::OnInitDialog));
+
+    m_codec2LPCPostFilterEnable->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnEnable), NULL, this);
+    m_codec2LPCPostFilterBassBoost->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnBassBoost), NULL, this);
+    m_codec2LPCPostFilterBeta->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnBetaScroll), NULL, this);
+    m_codec2LPCPostFilterGamma->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnGammaScroll), NULL, this);
+    m_LPCPostFilterDefault->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnLPCPostFilterDefault), NULL, this);
+
+    m_MicInBass.sliderFreq->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInBassFreqScroll), NULL, this);
+    m_MicInBass.sliderGain->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInBassGainScroll), NULL, this);
+    m_MicInTreble.sliderFreq->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInTrebleFreqScroll), NULL, this);
+    m_MicInTreble.sliderGain->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInTrebleGainScroll), NULL, this);
+    m_MicInMid.sliderFreq->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInMidFreqScroll), NULL, this);
+    m_MicInMid.sliderGain->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInMidGainScroll), NULL, this);
+    m_MicInMid.sliderQ->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnMicInMidQScroll), NULL, this);
+    m_MicInEnable->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnMicInEnable), NULL, this);
+    m_MicInDefault->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnMicInDefault), NULL, this);
+
+    m_SpkOutBass.sliderFreq->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutBassFreqScroll), NULL, this);
+    m_SpkOutBass.sliderGain->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutBassGainScroll), NULL, this);
+    m_SpkOutTreble.sliderFreq->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutTrebleFreqScroll), NULL, this);
+    m_SpkOutTreble.sliderGain->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutTrebleGainScroll), NULL, this);
+    m_SpkOutMid.sliderFreq->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutMidFreqScroll), NULL, this);
+    m_SpkOutMid.sliderGain->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutMidGainScroll), NULL, this);
+    m_SpkOutMid.sliderQ->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnSpkOutMidQScroll), NULL, this);
+    m_SpkOutEnable->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(FilterDlg::OnSpkOutEnable), NULL, this);
+    m_SpkOutDefault->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnSpkOutDefault), NULL, this);
+
+    m_sdbSizer5Cancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnCancel), NULL, this);
+    m_sdbSizer5OK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnOK), NULL, this);
+}
+
+void FilterDlg::newLPCPFControl(wxSlider **slider, wxStaticText **stValue, wxSizer *s, wxString controlName)
+{
+    wxBoxSizer *bs = new wxBoxSizer(wxHORIZONTAL);
+
+    wxStaticText* st = new wxStaticText(this, wxID_ANY, controlName, wxDefaultPosition, wxSize(70,-1), wxALIGN_RIGHT);
+    bs->Add(st, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 2);
+
+    *slider = new wxSlider(this, wxID_ANY, 0, 0, SLIDER_MAX, wxDefaultPosition, wxSize(SLIDER_LENGTH,wxDefaultCoord));
+    bs->Add(*slider, 1, wxALIGN_CENTER_VERTICAL|wxALL, 2);
+
+    *stValue = new wxStaticText(this, wxID_ANY, wxT("0.0"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
+    bs->Add(*stValue, 1, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxALL, 2);
+
+    s->Add(bs, 0);
+}
+
+void FilterDlg::newEQControl(wxSlider** slider, wxStaticText** value, wxStaticBoxSizer *bs, wxString controlName)
+{
+    wxStaticText* label = new wxStaticText(this, wxID_ANY, controlName, wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
+    bs->Add(label, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 0);
+
+    *slider = new wxSlider(this, wxID_ANY, 0, 0, SLIDER_MAX, wxDefaultPosition, wxSize(SLIDER_LENGTH,wxDefaultCoord));
+    bs->Add(*slider, 1, wxALIGN_CENTER_VERTICAL|wxALL, 0);
+
+    *value = new wxStaticText(this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(40,-1), wxALIGN_LEFT);
+    bs->Add(*value, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxRIGHT, 5);
+}
+
+EQ FilterDlg::newEQ(wxSizer *bs, wxString eqName, float maxFreqHz, bool enableQ)
+{
+    EQ eq;
+
+    wxStaticBoxSizer *bsEQ = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, eqName), wxHORIZONTAL);
+
+    newEQControl(&eq.sliderFreq, &eq.valueFreq, bsEQ, "Freq"); 
+    eq.maxFreqHz = maxFreqHz; 
+    eq.sliderFreqId = eq.sliderFreq->GetId();
+
+    newEQControl(&eq.sliderGain, &eq.valueGain, bsEQ, "Gain");
+    if (enableQ)
+        newEQControl(&eq.sliderQ, &eq.valueQ, bsEQ, "Q");
+    else
+        eq.sliderQ = NULL;
+
+    bs->Add(bsEQ);
+
+    return eq;
+}
+
+//-------------------------------------------------------------------------
+// ExchangeData()
+//-------------------------------------------------------------------------
+void FilterDlg::ExchangeData(int inout, bool storePersistent)
+{
+    wxConfigBase *pConfig = wxConfigBase::Get();
+    if(inout == EXCHANGE_DATA_IN)
+    {
+        // LPC Post filter
+
+        m_codec2LPCPostFilterEnable->SetValue(wxGetApp().m_codec2LPCPostFilterEnable);
+        m_codec2LPCPostFilterBassBoost->SetValue(wxGetApp().m_codec2LPCPostFilterBassBoost);
+        m_beta = wxGetApp().m_codec2LPCPostFilterBeta; setBeta();
+        m_gamma = wxGetApp().m_codec2LPCPostFilterGamma; setGamma();
+
+        // Speex Pre-Processor
+
+        m_ckboxSpeexpp->SetValue(wxGetApp().m_speexpp_enable);
+
+        // Mic In Equaliser
+
+        m_MicInBass.freqHz = wxGetApp().m_MicInBassFreqHz; 
+        m_MicInBass.freqHz = limit(m_MicInBass.freqHz, 1.0, MAX_FREQ_BASS);
+        setFreq(&m_MicInBass);
+        m_MicInBass.gaindB = wxGetApp().m_MicInBassGaindB;
+        m_MicInBass.gaindB = limit(m_MicInBass.gaindB, MIN_GAIN, MAX_GAIN);
+        setGain(&m_MicInBass);
+
+        m_MicInTreble.freqHz = wxGetApp().m_MicInTrebleFreqHz;
+        m_MicInTreble.freqHz = limit(m_MicInTreble.freqHz, 1.0, MAX_FREQ_TREBLE);
+        setFreq(&m_MicInTreble);
+        m_MicInTreble.gaindB = wxGetApp().m_MicInTrebleGaindB; 
+        m_MicInTreble.gaindB = limit(m_MicInTreble.gaindB, MIN_GAIN, MAX_GAIN);
+        setGain(&m_MicInTreble);
+
+        m_MicInMid.freqHz = wxGetApp().m_MicInMidFreqHz; 
+        m_MicInMid.freqHz = limit(m_MicInMid.freqHz, 1.0, MAX_FREQ_TREBLE);
+        setFreq(&m_MicInMid);
+        m_MicInMid.gaindB = wxGetApp().m_MicInMidGaindB; 
+        m_MicInMid.gaindB = limit(m_MicInMid.gaindB, MIN_GAIN, MAX_GAIN);
+        setGain(&m_MicInMid);
+        m_MicInMid.Q = wxGetApp().m_MicInMidQ;
+        m_MicInMid.Q = limit(m_MicInMid.Q, pow(10.0,MIN_LOG10_Q), pow(10.0, MAX_LOG10_Q));
+        setQ(&m_MicInMid);
+
+        m_MicInEnable->SetValue(wxGetApp().m_MicInEQEnable);
+
+        plotMicInFilterSpectrum();
+        // Spk Out Equaliser
+
+        m_SpkOutBass.freqHz = wxGetApp().m_SpkOutBassFreqHz;
+        m_SpkOutBass.freqHz = limit(m_SpkOutBass.freqHz, 1.0, MAX_FREQ_BASS);
+        setFreq(&m_SpkOutBass);
+        m_SpkOutBass.gaindB = wxGetApp().m_SpkOutBassGaindB; 
+        m_SpkOutBass.gaindB = limit(m_SpkOutBass.gaindB, MIN_GAIN, MAX_GAIN);
+        setGain(&m_SpkOutBass);
+
+        m_SpkOutTreble.freqHz = wxGetApp().m_SpkOutTrebleFreqHz; 
+        m_SpkOutTreble.freqHz = limit(m_SpkOutTreble.freqHz, 1.0, MAX_FREQ_TREBLE);
+        setFreq(&m_SpkOutTreble);
+        m_SpkOutTreble.gaindB = wxGetApp().m_SpkOutTrebleGaindB; 
+        m_SpkOutTreble.gaindB = limit(m_SpkOutTreble.gaindB, MIN_GAIN, MAX_GAIN);
+        setGain(&m_SpkOutTreble);
+
+        m_SpkOutMid.freqHz = wxGetApp().m_SpkOutMidFreqHz;
+        m_SpkOutMid.freqHz = limit(m_SpkOutMid.freqHz, 1.0, MAX_FREQ_TREBLE);
+        setFreq(&m_SpkOutMid);
+        m_SpkOutMid.gaindB = wxGetApp().m_SpkOutMidGaindB;
+        m_SpkOutMid.gaindB = limit(m_SpkOutMid.gaindB, MIN_GAIN, MAX_GAIN);
+        setGain(&m_SpkOutMid);
+        m_SpkOutMid.Q = wxGetApp().m_SpkOutMidQ;
+        m_SpkOutMid.Q = limit(m_SpkOutMid.Q, pow(10.0,MIN_LOG10_Q), pow(10.0, MAX_LOG10_Q));
+        setQ(&m_SpkOutMid);
+
+        m_SpkOutEnable->SetValue(wxGetApp().m_SpkOutEQEnable);
+
+        plotSpkOutFilterSpectrum();
+    }
+    if(inout == EXCHANGE_DATA_OUT)
+    {
+        // LPC Post filter
+
+        wxGetApp().m_codec2LPCPostFilterEnable     = m_codec2LPCPostFilterEnable->GetValue();
+        wxGetApp().m_codec2LPCPostFilterBassBoost  = m_codec2LPCPostFilterBassBoost->GetValue();
+        wxGetApp().m_codec2LPCPostFilterBeta       = m_beta;
+        wxGetApp().m_codec2LPCPostFilterGamma      = m_gamma;
+
+        // Speex Pre-Processor
+
+        wxGetApp().m_speexpp_enable = m_ckboxSpeexpp->GetValue();
+
+        // Mic In Equaliser
+
+        wxGetApp().m_MicInBassFreqHz = m_MicInBass.freqHz;
+        wxGetApp().m_MicInBassGaindB = m_MicInBass.gaindB;
+
+        wxGetApp().m_MicInTrebleFreqHz = m_MicInTreble.freqHz;
+        wxGetApp().m_MicInTrebleGaindB = m_MicInTreble.gaindB;
+
+        wxGetApp().m_MicInMidFreqHz = m_MicInMid.freqHz;
+        wxGetApp().m_MicInMidGaindB = m_MicInMid.gaindB;
+        wxGetApp().m_MicInMidQ = m_MicInMid.Q;
+
+        // Spk Out Equaliser
+
+        wxGetApp().m_SpkOutBassFreqHz = m_SpkOutBass.freqHz;
+        wxGetApp().m_SpkOutBassGaindB = m_SpkOutBass.gaindB;
+
+        wxGetApp().m_SpkOutTrebleFreqHz = m_SpkOutTreble.freqHz;
+        wxGetApp().m_SpkOutTrebleGaindB = m_SpkOutTreble.gaindB;
+
+        wxGetApp().m_SpkOutMidFreqHz = m_SpkOutMid.freqHz;
+        wxGetApp().m_SpkOutMidGaindB = m_SpkOutMid.gaindB;
+        wxGetApp().m_SpkOutMidQ = m_SpkOutMid.Q;
+
+        if (storePersistent) {
+            pConfig->Write(wxT("/Filter/codec2LPCPostFilterEnable"),     wxGetApp().m_codec2LPCPostFilterEnable);
+            pConfig->Write(wxT("/Filter/codec2LPCPostFilterBassBoost"),  wxGetApp().m_codec2LPCPostFilterBassBoost);
+            pConfig->Write(wxT("/Filter/codec2LPCPostFilterBeta"),       (int)(m_beta*100.0));
+            pConfig->Write(wxT("/Filter/codec2LPCPostFilterGamma"),      (int)(m_gamma*100.0));
+
+            pConfig->Write(wxT("/Filter/speexpp_enable"),                wxGetApp().m_speexpp_enable);
+
+            pConfig->Write(wxT("/Filter/MicInBassFreqHz"), (int)m_MicInBass.freqHz);
+            pConfig->Write(wxT("/Filter/MicInBassGaindB"), (int)(10.0*m_MicInBass.gaindB));
+            pConfig->Write(wxT("/Filter/MicInTrebleFreqHz"), (int)m_MicInTreble.freqHz);
+            pConfig->Write(wxT("/Filter/MicInTrebleGaindB"), (int)(10.0*m_MicInTreble.gaindB));
+            pConfig->Write(wxT("/Filter/MicInMidFreqHz"), (int)m_MicInMid.freqHz);
+            pConfig->Write(wxT("/Filter/MicInMidGaindB"), (int)(10.0*m_MicInMid.gaindB));
+            pConfig->Write(wxT("/Filter/MicInMidQ"), (int)(100.0*m_MicInMid.Q));
+
+            pConfig->Write(wxT("/Filter/SpkOutBassFreqHz"), (int)m_SpkOutBass.freqHz);
+            pConfig->Write(wxT("/Filter/SpkOutBassGaindB"), (int)(10.0*m_SpkOutBass.gaindB));
+            pConfig->Write(wxT("/Filter/SpkOutTrebleFreqHz"), (int)m_SpkOutTreble.freqHz);
+            pConfig->Write(wxT("/Filter/SpkOutTrebleGaindB"), (int)(10.0*m_SpkOutTreble.gaindB));
+            pConfig->Write(wxT("/Filter/SpkOutMidQ"), (int)(100.0*m_SpkOutMid.Q));
+            pConfig->Write(wxT("/Filter/SpkOutMidFreqHz"), (int)m_SpkOutMid.freqHz);
+            pConfig->Write(wxT("/Filter/SpkOutMidGaindB"), (int)(10.0*m_SpkOutMid.gaindB));
+
+            pConfig->Flush();
+        }
+    }
+    delete wxConfigBase::Set((wxConfigBase *) NULL);
+}
+
+float FilterDlg::limit(float value, float min, float max) {
+    if (value < min) return min;
+    if (value > max) return max;
+    return value;
+}
+
+//-------------------------------------------------------------------------
+// OnCancel()
+//-------------------------------------------------------------------------
+void FilterDlg::OnCancel(wxCommandEvent& event)
+{
+    this->EndModal(wxID_CANCEL);
+}
+
+//-------------------------------------------------------------------------
+// OnDefault()
+//-------------------------------------------------------------------------
+
+void FilterDlg::OnLPCPostFilterDefault(wxCommandEvent& event)
+{
+    m_beta = CODEC2_LPC_PF_BETA; setBeta();
+    m_gamma = CODEC2_LPC_PF_GAMMA; setGamma();
+    m_codec2LPCPostFilterEnable->SetValue(true);
+    m_codec2LPCPostFilterBassBoost->SetValue(true);
+}
+
+void FilterDlg::OnMicInDefault(wxCommandEvent& event)
+{
+    m_MicInBass.freqHz = 100.0;
+    m_MicInBass.gaindB = 0.0;
+    setFreq(&m_MicInBass); setGain(&m_MicInBass); 
+
+    m_MicInTreble.freqHz = 3000.0;
+    m_MicInTreble.gaindB = 0.0;
+    setFreq(&m_MicInTreble); setGain(&m_MicInTreble); 
+
+    m_MicInMid.freqHz = 1500.0;
+    m_MicInMid.gaindB = 0.0;
+    m_MicInMid.Q = 1.0;
+    setFreq(&m_MicInMid); setGain(&m_MicInMid); setQ(&m_MicInMid); 
+
+    plotMicInFilterSpectrum();    
+}
+
+void FilterDlg::OnSpkOutDefault(wxCommandEvent& event)
+{
+    m_SpkOutBass.freqHz = 100.0;
+    m_SpkOutBass.gaindB = 0.0;
+    setFreq(&m_SpkOutBass); setGain(&m_SpkOutBass); 
+
+    m_SpkOutTreble.freqHz = 3000.0;
+    m_SpkOutTreble.gaindB = 0.0;
+    setFreq(&m_SpkOutTreble); setGain(&m_SpkOutTreble); 
+
+    m_SpkOutMid.freqHz = 1500.0;
+    m_SpkOutMid.gaindB = 0.0;
+    m_SpkOutMid.Q = 1.0;
+    setFreq(&m_SpkOutMid); setGain(&m_SpkOutMid); setQ(&m_SpkOutMid); 
+
+    plotSpkOutFilterSpectrum();    
+}
+
+//-------------------------------------------------------------------------
+// OnOK()
+//-------------------------------------------------------------------------
+void FilterDlg::OnOK(wxCommandEvent& event)
+{
+    //printf("FilterDlg::OnOK\n");
+    ExchangeData(EXCHANGE_DATA_OUT, true);
+    this->EndModal(wxID_OK);
+}
+
+//-------------------------------------------------------------------------
+// OnClose()
+//-------------------------------------------------------------------------
+void FilterDlg::OnClose(wxCloseEvent& event)
+{
+    this->EndModal(wxID_OK);
+}
+
+//-------------------------------------------------------------------------
+// OnInitDialog()
+//-------------------------------------------------------------------------
+void FilterDlg::OnInitDialog(wxInitDialogEvent& event)
+{
+    //printf("FilterDlg::OnInitDialog\n");
+    ExchangeData(EXCHANGE_DATA_IN, false);
+    //printf("m_beta: %f\n", m_beta);
+}
+
+void FilterDlg::setBeta(void) {
+    wxString buf;
+    buf.Printf(wxT("%3.2f"), m_beta);
+    m_staticTextBeta->SetLabel(buf);
+    int slider = (int)(m_beta*SLIDER_MAX + 0.5);
+    m_codec2LPCPostFilterBeta->SetValue(slider);
+}
+
+void FilterDlg::setCodec2(void) {
+    if (m_running) {
+        assert(g_pfreedv->codec2 != NULL);
+        codec2_set_lpc_post_filter(g_pfreedv->codec2, 
+                               m_codec2LPCPostFilterEnable->GetValue(), 
+                               m_codec2LPCPostFilterBassBoost->GetValue(), 
+                               m_beta, m_gamma);
+    }
+}
+
+void FilterDlg::setGamma(void) {
+    wxString buf;
+    buf.Printf(wxT("%3.2f"), m_gamma);
+    m_staticTextGamma->SetLabel(buf);
+    int slider = (int)(m_gamma*SLIDER_MAX + 0.5);
+    m_codec2LPCPostFilterGamma->SetValue(slider);
+}
+
+void FilterDlg::OnEnable(wxScrollEvent& event) {
+    setCodec2();    
+}
+
+void FilterDlg::OnBassBoost(wxScrollEvent& event) {
+    setCodec2();    
+}
+
+void FilterDlg::OnBetaScroll(wxScrollEvent& event) {
+    m_beta = (float)m_codec2LPCPostFilterBeta->GetValue()/SLIDER_MAX;
+    setBeta();
+    setCodec2();
+}
+
+void FilterDlg::OnGammaScroll(wxScrollEvent& event) {
+    m_gamma = (float)m_codec2LPCPostFilterGamma->GetValue()/SLIDER_MAX;
+    setGamma();
+    setCodec2();
+}
+
+// immediately change enable flags rather using ExchangeData() so we can switch on and off at run time
+
+void FilterDlg::OnSpeexppEnable(wxScrollEvent& event) {
+    wxGetApp().m_speexpp_enable = m_ckboxSpeexpp->GetValue();
+}
+
+void FilterDlg::OnMicInEnable(wxScrollEvent& event) {
+    wxGetApp().m_MicInEQEnable = m_MicInEnable->GetValue();
+}
+
+void FilterDlg::OnSpkOutEnable(wxScrollEvent& event) {
+    wxGetApp().m_SpkOutEQEnable = m_SpkOutEnable->GetValue();
+    //printf("wxGetApp().m_SpkOutEQEnable: %d\n", wxGetApp().m_SpkOutEQEnable);
+}
+
+void FilterDlg::setFreq(EQ *eq)
+{
+    wxString buf;
+    buf.Printf(wxT("%3.0f"), eq->freqHz);
+    eq->valueFreq->SetLabel(buf);
+    int slider = (int)((eq->freqHz/eq->maxFreqHz)*SLIDER_MAX + 0.5);
+    eq->sliderFreq->SetValue(slider);
+}
+
+void FilterDlg::sliderToFreq(EQ *eq, bool micIn)
+{
+    eq->freqHz = ((float)eq->sliderFreq->GetValue()/SLIDER_MAX)*eq->maxFreqHz;
+    if (eq->freqHz < 1.0) eq->freqHz = 1.0; // sox doesn't like 0 Hz;
+    setFreq(eq);
+    if (micIn) {
+        plotMicInFilterSpectrum();
+        adjRunTimeMicInFilter();
+    }
+    else {
+        plotSpkOutFilterSpectrum();
+        adjRunTimeSpkOutFilter();
+    }
+}
+
+void FilterDlg::setGain(EQ *eq)
+{
+    wxString buf;
+    buf.Printf(wxT("%3.1f"), eq->gaindB);
+    eq->valueGain->SetLabel(buf);
+    int slider = (int)(((eq->gaindB-MIN_GAIN)/(MAX_GAIN-MIN_GAIN))*SLIDER_MAX + 0.5);
+    eq->sliderGain->SetValue(slider);
+}
+
+void FilterDlg::sliderToGain(EQ *eq, bool micIn)
+{
+    float range = MAX_GAIN-MIN_GAIN;
+    
+    eq->gaindB = MIN_GAIN + range*((float)eq->sliderGain->GetValue()/SLIDER_MAX);
+    //printf("gaindB: %f\n", eq->gaindB);
+    setGain(eq);
+    if (micIn) {
+        plotMicInFilterSpectrum();
+        adjRunTimeMicInFilter();
+    }
+    else {
+        plotSpkOutFilterSpectrum();
+        adjRunTimeSpkOutFilter();
+    }
+        
+}
+
+void FilterDlg::setQ(EQ *eq)
+{
+    wxString buf;
+    buf.Printf(wxT("%2.1f"), eq->Q);
+    eq->valueQ->SetLabel(buf);
+
+    float log10_range = MAX_LOG10_Q - MIN_LOG10_Q;
+
+    int slider = (int)(((log10(eq->Q+1E-6)-MIN_LOG10_Q)/log10_range)*SLIDER_MAX + 0.5);
+    eq->sliderQ->SetValue(slider);
+}
+
+void FilterDlg::sliderToQ(EQ *eq, bool micIn)
+{
+    float log10_range = MAX_LOG10_Q - MIN_LOG10_Q;
+    
+    float sliderNorm = (float)eq->sliderQ->GetValue()/SLIDER_MAX;
+    float log10Q =  MIN_LOG10_Q + sliderNorm*(log10_range);
+    eq->Q = pow(10.0, log10Q);
+    //printf("log10Q: %f eq->Q: %f\n", log10Q, eq->Q);
+    setQ(eq);
+    if (micIn) {
+        plotMicInFilterSpectrum();
+        adjRunTimeMicInFilter();
+    }
+    else {
+        plotSpkOutFilterSpectrum();
+        adjRunTimeSpkOutFilter();
+    }
+}
+
+void FilterDlg::plotMicInFilterSpectrum(void) {
+    plotFilterSpectrum(&m_MicInBass, &m_MicInMid, &m_MicInTreble, m_MicInFreqRespPlot, m_MicInMagdB);
+}
+
+void FilterDlg::plotSpkOutFilterSpectrum(void) {
+    plotFilterSpectrum(&m_SpkOutBass, &m_SpkOutMid, &m_SpkOutTreble, m_SpkOutFreqRespPlot, m_SpkOutMagdB);
+}
+
+void FilterDlg::adjRunTimeMicInFilter(void) {
+    // signal an adjustment in running filter coeffs
+
+    if (m_running) {
+        ExchangeData(EXCHANGE_DATA_OUT, false);
+        *m_newMicInFilter = true;
+    }
+}
+        
+void FilterDlg::adjRunTimeSpkOutFilter(void) {
+    // signal an adjustment in running filter coeffs
+
+    if (m_running) {
+        ExchangeData(EXCHANGE_DATA_OUT, false);
+        *m_newSpkOutFilter = true;
+    }
+}
+        
+
+void FilterDlg::plotFilterSpectrum(EQ *eqBass, EQ *eqMid, EQ *eqTreble, PlotSpectrum* freqRespPlot, float *magdB) {
+    char  *argBass[10];
+    char  *argTreble[10];
+    char  *argMid[10];
+    char   argstorage[10][80];
+    float magBass[F_MAG_N];
+    float magTreble[F_MAG_N];
+    float magMid[F_MAG_N];
+    int   i;
+
+    for(i=0; i<10; i++) {
+        argBass[i] = &argstorage[i][0];
+        argTreble[i] = &argstorage[i][0];
+        argMid[i] = &argstorage[i][0];
+    }
+    sprintf(argBass[0], "bass");                
+    sprintf(argBass[1], "%f", eqBass->gaindB+1E-6);
+    sprintf(argBass[2], "%f", eqBass->freqHz);      
+
+    calcFilterSpectrum(magBass, 2, argBass);
+
+    sprintf(argTreble[0], "treble");                
+    sprintf(argTreble[1], "%f", eqTreble->gaindB+1E-6);
+    sprintf(argTreble[2], "%f", eqTreble->freqHz);      
+
+    calcFilterSpectrum(magTreble, 2, argTreble);
+
+    sprintf(argTreble[0], "equalizer");                
+    sprintf(argTreble[1], "%f", eqMid->freqHz);      
+    sprintf(argTreble[2], "%f", eqMid->Q);      
+    sprintf(argTreble[3], "%f", eqMid->gaindB+1E-6);
+
+    calcFilterSpectrum(magMid, 3, argMid);
+
+    for(i=0; i<F_MAG_N; i++)
+        magdB[i] = magBass[i] + magMid[i] + magTreble[i];
+    freqRespPlot->m_newdata = true;
+    freqRespPlot->Refresh();
+}
+
+void FilterDlg::calcFilterSpectrum(float magdB[], int argc, char *argv[]) {
+    void       *sbq;
+    short       in[NIMP];
+    short       out[NIMP];
+    COMP        X[F_MAG_N];
+    float       f, w;
+    int         i, k;
+
+    // find impulse response -----------------------------------
+
+    for(i=0; i<NIMP; i++)
+        in[i] = 0;
+    in[0] = IMP_AMP;
+
+    //printf("argv[0]: %s argv[1]: %s\n", argv[0], argv[1]);
+    sbq = sox_biquad_create(argc, (const char **)argv);
+
+    sox_biquad_filter(sbq, out, in, NIMP);
+    //for(i=0; i<NIMP; i++)
+    //    printf("%d\n", out[i]);
+   
+    sox_biquad_destroy(sbq);
+
+    //for(i=0; i<NIMP; i++)
+    //    out[i] = 0.0;
+    //out[0] = IMP_AMP;
+
+    // calculate discrete time continous frequency Fourer transform
+    // doing this from first principles rather than FFT for no good reason
+
+    for(f=0,i=0; f<MAX_F_HZ; f+=F_STEP_DFT,i++) {
+        w = M_PI*f/(FS/2);
+        X[i].real = 0.0; X[i].imag = 0.0;
+        for(k=0; k<NIMP; k++) {
+            X[i].real += ((float)out[k]/IMP_AMP) * cos(w*k);
+            X[i].imag -= ((float)out[k]/IMP_AMP) * sin(w*k);
+        }
+        magdB[i] = 10.0*log10(X[i].real* X[i].real + X[i].imag*X[i].imag + 1E-12);
+        //printf("f: %f X[%d] = %f %f magdB = %f\n", f, i, X[i].real, X[i].imag,  magdB[i]);
+    }
+}
diff --git a/freedv/tags/0.99-Beta/src/dlg_filter.h b/freedv/tags/0.99-Beta/src/dlg_filter.h
new file mode 100644 (file)
index 0000000..82c43df
--- /dev/null
@@ -0,0 +1,166 @@
+//==========================================================================
+// Name:            dlg_filter.h
+// Purpose:         Dialog for controlling Codec audio filtering
+// Created:         Nov 25 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+
+#ifndef __FILTER_DIALOG__
+#define __FILTER_DIALOG__
+
+#include "fdmdv2_main.h"
+
+enum {disableQ = false, enableQ = true};
+
+typedef struct { 
+    wxSlider     *sliderFreq;
+    wxStaticText *valueFreq;
+    wxSlider     *sliderGain;
+    wxStaticText *valueGain;
+    wxSlider     *sliderQ;
+    wxStaticText *valueQ;
+
+    int       sliderFreqId;
+    int       sliderGainId;
+    int       sliderQId;
+    
+    float     freqHz;
+    float     gaindB;
+    float     Q;
+
+    float     maxFreqHz;
+} EQ;
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class FilterDlg
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class FilterDlg : public wxDialog
+{
+    public:
+    FilterDlg( wxWindow* parent, bool running, bool *newMicInFilter, bool *newSpkOutFilter,
+               wxWindowID id = wxID_ANY, const wxString& title = _("Filter"), 
+               const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 800, 630 ), 
+               long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
+        ~FilterDlg();
+
+        void    ExchangeData(int inout, bool storePersistent);
+
+    protected:
+        // Handlers for events.
+        void    OnCancel(wxCommandEvent& event);
+        void    OnOK(wxCommandEvent& event);
+        void    OnClose(wxCloseEvent& event);
+        void    OnInitDialog(wxInitDialogEvent& event);
+        void    OnLPCPostFilterDefault(wxCommandEvent& event);
+
+        void    OnBetaScroll(wxScrollEvent& event);
+        void    OnGammaScroll(wxScrollEvent& event);
+        void    OnEnable(wxScrollEvent& event);
+        void    OnBassBoost(wxScrollEvent& event);
+
+        void    OnSpeexppEnable(wxScrollEvent& event);
+
+        void    OnMicInBassFreqScroll(wxScrollEvent& event) { sliderToFreq(&m_MicInBass, true); }
+        void    OnMicInBassGainScroll(wxScrollEvent& event) { sliderToGain(&m_MicInBass, true); }
+        void    OnMicInTrebleFreqScroll(wxScrollEvent& event) { sliderToFreq(&m_MicInTreble, true); }
+        void    OnMicInTrebleGainScroll(wxScrollEvent& event) { sliderToGain(&m_MicInTreble, true); }
+        void    OnMicInMidFreqScroll(wxScrollEvent& event) { sliderToFreq(&m_MicInMid, true); }
+        void    OnMicInMidGainScroll(wxScrollEvent& event) { sliderToGain(&m_MicInMid, true); }
+        void    OnMicInMidQScroll(wxScrollEvent& event) { sliderToQ(&m_MicInMid, true); }
+        void    OnMicInEnable(wxScrollEvent& event);
+        void    OnMicInDefault(wxCommandEvent& event);
+
+        void    OnSpkOutBassFreqScroll(wxScrollEvent& event) { sliderToFreq(&m_SpkOutBass, false); }
+        void    OnSpkOutBassGainScroll(wxScrollEvent& event) { sliderToGain(&m_SpkOutBass, false); }
+        void    OnSpkOutTrebleFreqScroll(wxScrollEvent& event) { sliderToFreq(&m_SpkOutTreble, false); }
+        void    OnSpkOutTrebleGainScroll(wxScrollEvent& event) { sliderToGain(&m_SpkOutTreble, false); }
+        void    OnSpkOutMidFreqScroll(wxScrollEvent& event) { sliderToFreq(&m_SpkOutMid, false); }
+        void    OnSpkOutMidGainScroll(wxScrollEvent& event) { sliderToGain(&m_SpkOutMid, false); }
+        void    OnSpkOutMidQScroll(wxScrollEvent& event) { sliderToQ(&m_SpkOutMid, false); }
+        void    OnSpkOutEnable(wxScrollEvent& event);
+        void    OnSpkOutDefault(wxCommandEvent& event);
+
+        wxStaticText* m_staticText8;
+        wxCheckBox*   m_codec2LPCPostFilterEnable;
+        wxStaticText* m_staticText9;
+        wxCheckBox*   m_codec2LPCPostFilterBassBoost;
+        wxStaticText* m_staticText91;
+        wxSlider*     m_codec2LPCPostFilterBeta;
+        wxStaticText* m_staticTextBeta;
+        wxStaticText* m_staticText911;
+        wxSlider*     m_codec2LPCPostFilterGamma;
+        wxStaticText* m_staticTextGamma;
+        wxButton*     m_LPCPostFilterDefault;
+
+        wxCheckBox*   m_ckboxSpeexpp;
+
+        wxStdDialogButtonSizer* m_sdbSizer5;
+        wxButton*     m_sdbSizer5OK;
+        wxButton*     m_sdbSizer5Cancel;
+        PlotSpectrum* m_MicInFreqRespPlot;
+        PlotSpectrum* m_SpkOutFreqRespPlot;
+        
+        wxCheckBox*   m_MicInEnable;
+        wxButton*     m_MicInDefault;
+        wxCheckBox*   m_SpkOutEnable;
+        wxButton*     m_SpkOutDefault;
+
+        float        *m_MicInMagdB;
+        float        *m_SpkOutMagdB;
+
+     private:
+        bool          m_running;
+        float         m_beta;
+        float         m_gamma;
+
+        void          setBeta(void);  // sets slider and static text from m_beta
+        void          setGamma(void); // sets slider and static text from m_gamma
+        void          setCodec2(void);
+        void          newEQControl(wxSlider** slider, wxStaticText** value, wxStaticBoxSizer *bs, wxString controlName);
+        EQ            newEQ(wxSizer *bs, wxString eqName, float maxFreqHz, bool enableQ);
+        void          newLPCPFControl(wxSlider **slider, wxStaticText **stValue, wxSizer *sbs, wxString controlName);
+        wxAuiNotebook *m_auiNotebook;
+        void          setFreq(EQ *eq);
+        void          setGain(EQ *eq);
+        void          setQ(EQ *eq);
+        void          sliderToFreq(EQ *eq, bool micIn);
+        void          sliderToGain(EQ *eq, bool micIn);
+        void          sliderToQ(EQ *eq, bool micIn);
+        void          plotFilterSpectrum(EQ *eqBass, EQ *eqMid, EQ* eqTreble, PlotSpectrum* freqRespPlot, float *magdB);
+        void          calcFilterSpectrum(float magdB[], int arc, char *argv[]);
+        void          plotMicInFilterSpectrum(void);
+        void          plotSpkOutFilterSpectrum(void);
+        void          adjRunTimeMicInFilter(void);
+        void          adjRunTimeSpkOutFilter(void);
+
+        EQ            m_MicInBass;
+        EQ            m_MicInMid;
+        EQ            m_MicInTreble;
+
+        EQ            m_SpkOutBass;
+        EQ            m_SpkOutMid;
+        EQ            m_SpkOutTreble;
+
+        float         limit(float value, float min, float max);
+        bool          *m_newMicInFilter;
+        bool          *m_newSpkOutFilter;
+
+};
+
+#endif // __FILTER_DIALOG__
diff --git a/freedv/tags/0.99-Beta/src/dlg_options.cpp b/freedv/tags/0.99-Beta/src/dlg_options.cpp
new file mode 100644 (file)
index 0000000..9189feb
--- /dev/null
@@ -0,0 +1,363 @@
+//==========================================================================
+// Name:            dlg_options.cpp
+// Purpose:         Dialog for controlling misc FreeDV options
+// Date:            May 24 2013
+// 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+
+#include "dlg_options.h"
+extern bool g_modal;
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class OptionsDlg
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+OptionsDlg::OptionsDlg(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* bSizer30;
+    bSizer30 = new wxBoxSizer(wxVERTICAL);
+
+    //------------------------------
+    // Test Frames check box
+    //------------------------------
+
+    wxStaticBoxSizer* sbSizer_testFrames;
+    wxStaticBox *sb_testFrames = new wxStaticBox(this, wxID_ANY, _("Test Frames"));
+    sbSizer_testFrames = new wxStaticBoxSizer(sb_testFrames, wxHORIZONTAL);
+
+    m_ckboxTestFrame = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
+    m_ckboxTestFrame->SetToolTip(_("Send frames of known bits instead of compressed voice"));
+    sbSizer_testFrames->Add(m_ckboxTestFrame, 0, wxALIGN_LEFT, 0);
+
+    m_ckboxChannelNoise = new wxCheckBox(this, wxID_ANY, _("Channel Noise"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
+    m_ckboxChannelNoise->SetToolTip(_("Add simulated AWGN channel noise to received signal"));
+    sbSizer_testFrames->Add(m_ckboxChannelNoise, 0, wxALIGN_LEFT, 0);
+
+    bSizer30->Add(sbSizer_testFrames,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
+
+    //------------------------------
+    // FreeDV 700 Options
+    //------------------------------
+
+    wxStaticBoxSizer* sbSizer_freedv700;
+    wxStaticBox *sb_freedv700 = new wxStaticBox(this, wxID_ANY, _("FreeDV 700 Clipping"));
+    sbSizer_freedv700 = new wxStaticBoxSizer(sb_freedv700, wxHORIZONTAL);
+
+    m_ckboxFreeDV700txClip = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
+    m_ckboxFreeDV700txClip->SetToolTip(_("Clip FreeDv 700 tx waveform to reduce Peak to Average Power Ratio (PAPR)"));
+    sbSizer_freedv700->Add(m_ckboxFreeDV700txClip, 0, wxALIGN_LEFT, 0);
+
+    bSizer30->Add(sbSizer_freedv700,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
+
+    //------------------------------
+    // Txt Msg Text Box
+    //------------------------------
+
+    wxStaticBoxSizer* sbSizer_callSign;
+    wxStaticBox *sb_textMsg = new wxStaticBox(this, wxID_ANY, _("Txt Msg"));
+    sbSizer_callSign = new wxStaticBoxSizer(sb_textMsg, wxVERTICAL);
+
+    m_txtCtrlCallSign = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
+    m_txtCtrlCallSign->SetToolTip(_("Txt Msg you can send along with Voice"));
+    sbSizer_callSign->Add(m_txtCtrlCallSign, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3);
+
+    bSizer30->Add(sbSizer_callSign,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
+    //------------------------------
+    // Txt Encoding 
+    //------------------------------
+
+    wxStaticBoxSizer* sbSizer_encoding = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Text Encoding")), wxHORIZONTAL);
+
+#ifdef SHORT_VARICODE
+    m_rb_textEncoding1 = new wxRadioButton( this, wxID_ANY, wxT("Long varicode"), wxDefaultPosition, wxDefaultSize, 0);
+    m_rb_textEncoding1->SetValue(true);
+    sbSizer_encoding->Add(m_rb_textEncoding1, 0, wxALIGN_LEFT|wxALL, 1);
+    m_rb_textEncoding2 = new wxRadioButton( this, wxID_ANY, wxT("Short Varicode"), wxDefaultPosition, wxDefaultSize, 0);
+    sbSizer_encoding->Add(m_rb_textEncoding2, 0, wxALIGN_LEFT|wxALL, 1);
+#endif
+
+    m_ckboxEnableChecksum = new wxCheckBox(this, wxID_ANY, _("Use Checksum on Rx"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
+    sbSizer_encoding->Add(m_ckboxEnableChecksum, 0, wxALIGN_LEFT, 0);
+
+    bSizer30->Add(sbSizer_encoding,0, wxALL|wxEXPAND, 3);
+    //------------------------------
+    // Event processing
+    //------------------------------
+
+    wxStaticBoxSizer* sbSizer_events;
+    wxStaticBox *sb_events = new wxStaticBox(this, wxID_ANY, _("Event Processing"));
+    sbSizer_events = new wxStaticBoxSizer(sb_events, wxVERTICAL);
+
+    // event processing enable and spam timer
+
+    wxStaticBoxSizer* sbSizer_events_top;
+    wxStaticBox* sb_events1 = new wxStaticBox(this, wxID_ANY, _(""));    
+    sbSizer_events_top = new wxStaticBoxSizer(sb_events1, wxHORIZONTAL);
+
+    m_ckbox_events = new wxCheckBox(this, wxID_ANY, _("Enable System Calls    Syscall Spam Timer"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
+    sb_events->SetToolTip(_("Enable processing of events and generation of system calls"));
+    sbSizer_events_top->Add(m_ckbox_events, 0, 0, 5);
+    m_txt_spam_timer = new wxTextCtrl(this, wxID_ANY,  wxEmptyString, wxDefaultPosition, wxSize(40,-1), 0, wxTextValidator(wxFILTER_DIGITS));
+    m_txt_spam_timer->SetToolTip(_("Many matching events can cause a flood of syscalls. Set minimum time (seconds) between syscalls for each event here"));
+    sbSizer_events_top->Add(m_txt_spam_timer, 0, 0, 5);
+    m_rb_spam_timer = new wxRadioButton( this, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
+    m_rb_spam_timer->SetForegroundColour( wxColour(0, 255, 0 ) );
+    sbSizer_events_top->Add(m_rb_spam_timer, 0, 0, 10);
+    sbSizer_events->Add(sbSizer_events_top, 0, 0, 5);
+
+    // list of regexps
+
+    wxStaticBoxSizer* sbSizer_regexp = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Regular Expressions to Process Events")), wxHORIZONTAL);
+    m_txt_events_regexp_match = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(200,100), wxTE_MULTILINE);
+    m_txt_events_regexp_match->SetToolTip(_("Enter regular expressions to match events"));
+    sbSizer_regexp->Add(m_txt_events_regexp_match, 1, wxEXPAND, 5);
+    m_txt_events_regexp_replace = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(200,100), wxTE_MULTILINE);
+    m_txt_events_regexp_replace->SetToolTip(_("Enter regular expressions to replace events"));
+    sbSizer_regexp->Add(m_txt_events_regexp_replace, 1, wxEXPAND, 5);
+    sbSizer_events->Add(sbSizer_regexp, 1, wxEXPAND, 5);
+
+    // log of events and responses
+
+    wxStaticBoxSizer* sbSizer_event_log = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Log of Events and Responses")), wxVERTICAL);
+    wxBoxSizer* bSizer33 = new wxBoxSizer(wxHORIZONTAL);
+    m_txt_events_in = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(200,50), wxTE_MULTILINE | wxTE_READONLY);
+    bSizer33->Add(m_txt_events_in, 1, wxEXPAND, 5);
+    m_txt_events_out = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(200,50), wxTE_MULTILINE | wxTE_READONLY);
+    bSizer33->Add(m_txt_events_out, 1, wxEXPAND, 5);
+    sbSizer_event_log->Add(bSizer33, 1, wxEXPAND, 5);
+    sbSizer_events->Add(sbSizer_event_log, 1, wxEXPAND, 5);
+
+    bSizer30->Add(sbSizer_events,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
+
+    //------------------------------
+    // UDP control port
+    //------------------------------
+
+    wxStaticBoxSizer* sbSizer_udp;
+    wxStaticBox* sb_udp = new wxStaticBox(this, wxID_ANY, _("UDP Control Port"));
+    sbSizer_udp = new wxStaticBoxSizer(sb_udp, wxHORIZONTAL);
+    m_ckbox_udp_enable = new wxCheckBox(this, wxID_ANY, _("Enable UDP Control Port    UDP Port Number:"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
+    sb_udp->SetToolTip(_("Enable control of FreeDV via UDP port"));
+    sbSizer_udp->Add(m_ckbox_udp_enable, 0,  wxALIGN_CENTER_HORIZONTAL, 5);
+    m_txt_udp_port = new wxTextCtrl(this, wxID_ANY,  wxEmptyString, wxDefaultPosition, wxSize(50,-1), 0, wxTextValidator(wxFILTER_DIGITS));
+    sbSizer_udp->Add(m_txt_udp_port, 0, wxALIGN_CENTER_HORIZONTAL, 5);
+
+    bSizer30->Add(sbSizer_udp,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
+
+    //------------------------------
+    // OK - Cancel - Apply Buttons 
+    //------------------------------
+
+    wxBoxSizer* bSizer31 = new wxBoxSizer(wxHORIZONTAL);
+
+    m_sdbSizer5OK = new wxButton(this, wxID_OK);
+    bSizer31->Add(m_sdbSizer5OK, 0, wxALL, 2);
+
+    m_sdbSizer5Cancel = new wxButton(this, wxID_CANCEL);
+    bSizer31->Add(m_sdbSizer5Cancel, 0, wxALL, 2);
+
+    m_sdbSizer5Apply = new wxButton(this, wxID_APPLY);
+    bSizer31->Add(m_sdbSizer5Apply, 0, wxALL, 2);
+
+    bSizer30->Add(bSizer31, 0, wxALIGN_RIGHT|wxALL, 0);
+
+    this->SetSizer(bSizer30);
+    this->Layout();
+
+    this->Centre(wxBOTH);
+    // Connect Events -------------------------------------------------------
+
+    this->Connect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(OptionsDlg::OnInitDialog));
+
+    m_sdbSizer5OK->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsDlg::OnOK), NULL, this);
+    m_sdbSizer5Cancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsDlg::OnCancel), NULL, this);
+    m_sdbSizer5Apply->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsDlg::OnApply), NULL, this);
+
+    m_ckboxFreeDV700txClip->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(OptionsDlg::OnFreeDV700txClip), NULL, this);
+
+    event_in_serial = 0;
+    event_out_serial = 0;
+}
+
+//-------------------------------------------------------------------------
+// ~OptionsDlg()
+//-------------------------------------------------------------------------
+OptionsDlg::~OptionsDlg()
+{
+
+    // Disconnect Events
+
+    this->Disconnect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(OptionsDlg::OnInitDialog));
+
+    m_sdbSizer5OK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsDlg::OnOK), NULL, this);
+    m_sdbSizer5Cancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsDlg::OnCancel), NULL, this);
+    m_sdbSizer5Apply->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsDlg::OnApply), NULL, this);
+    m_ckboxFreeDV700txClip->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(OptionsDlg::OnFreeDV700txClip), NULL, this);
+}
+
+
+//-------------------------------------------------------------------------
+// ExchangeData()
+//-------------------------------------------------------------------------
+void OptionsDlg::ExchangeData(int inout, bool storePersistent)
+{
+    wxConfigBase *pConfig = wxConfigBase::Get();
+
+    if(inout == EXCHANGE_DATA_IN)
+    {
+        m_txtCtrlCallSign->SetValue(wxGetApp().m_callSign);
+        m_ckboxTestFrame->SetValue(wxGetApp().m_testFrames);
+        m_ckboxChannelNoise->SetValue(wxGetApp().m_channel_noise);
+
+        m_ckbox_events->SetValue(wxGetApp().m_events);
+        m_txt_spam_timer->SetValue(wxString::Format(wxT("%i"),wxGetApp().m_events_spam_timer));
+
+        m_txt_events_regexp_match->SetValue(wxGetApp().m_events_regexp_match);
+        m_txt_events_regexp_replace->SetValue(wxGetApp().m_events_regexp_replace);
+        
+        m_ckbox_udp_enable->SetValue(wxGetApp().m_udp_enable);
+        m_txt_udp_port->SetValue(wxString::Format(wxT("%i"),wxGetApp().m_udp_port));
+
+#ifdef SHORT_VARICODE
+        if (wxGetApp().m_textEncoding == 1)
+            m_rb_textEncoding1->SetValue(true);
+        if (wxGetApp().m_textEncoding == 2)
+            m_rb_textEncoding2->SetValue(true);
+#endif
+        m_ckboxEnableChecksum->SetValue(wxGetApp().m_enable_checksum);
+
+        m_ckboxFreeDV700txClip->SetValue(wxGetApp().m_FreeDV700txClip);
+    }
+
+    if(inout == EXCHANGE_DATA_OUT)
+    {
+        wxGetApp().m_callSign      = m_txtCtrlCallSign->GetValue();
+        wxGetApp().m_testFrames    = m_ckboxTestFrame->GetValue();
+        wxGetApp().m_channel_noise = m_ckboxChannelNoise->GetValue();
+
+        wxGetApp().m_events        = m_ckbox_events->GetValue();
+        long spam_timer;
+        m_txt_spam_timer->GetValue().ToLong(&spam_timer);
+        wxGetApp().m_events_spam_timer = (int)spam_timer;
+
+        // make sure regexp lists are terminated by a \n
+
+        if (m_txt_events_regexp_match->GetValue().Last() != '\n') {
+            m_txt_events_regexp_match->SetValue(m_txt_events_regexp_match->GetValue()+'\n');
+        }
+        if (m_txt_events_regexp_replace->GetValue().Last() != '\n') {
+            m_txt_events_regexp_replace->SetValue(m_txt_events_regexp_replace->GetValue()+'\n');
+        }
+        wxGetApp().m_events_regexp_match = m_txt_events_regexp_match->GetValue();
+        wxGetApp().m_events_regexp_replace = m_txt_events_regexp_replace->GetValue();
+        wxGetApp().m_udp_enable     = m_ckbox_udp_enable->GetValue();
+        long port;
+        m_txt_udp_port->GetValue().ToLong(&port);
+        wxGetApp().m_udp_port       = (int)port;
+
+#ifdef SHORT_VARICODE
+        if (m_rb_textEncoding1->GetValue())
+            wxGetApp().m_textEncoding = 1;
+        if (m_rb_textEncoding2->GetValue())
+            wxGetApp().m_textEncoding = 2;
+#endif
+        wxGetApp().m_enable_checksum = m_ckboxEnableChecksum->GetValue();
+
+        wxGetApp().m_FreeDV700txClip = m_ckboxFreeDV700txClip->GetValue();
+
+        if (storePersistent) {
+            pConfig->Write(wxT("/Data/CallSign"), wxGetApp().m_callSign);
+#ifdef SHORT_VARICODE
+            pConfig->Write(wxT("/Data/TextEncoding"), wxGetApp().m_textEncoding);
+#endif
+            pConfig->Write(wxT("/Data/EnableChecksumOnMsgRx"), wxGetApp().m_enable_checksum);
+
+            pConfig->Write(wxT("/Events/enable"), wxGetApp().m_events);
+            pConfig->Write(wxT("/Events/spam_timer"), wxGetApp().m_events_spam_timer);
+            pConfig->Write(wxT("/Events/regexp_match"), wxGetApp().m_events_regexp_match);
+            pConfig->Write(wxT("/Events/regexp_replace"), wxGetApp().m_events_regexp_replace);
+            
+            pConfig->Write(wxT("/UDP/enable"), wxGetApp().m_udp_enable);
+            pConfig->Write(wxT("/UDP/port"),  wxGetApp().m_udp_port);
+
+            pConfig->Write(wxT("/FreeDV700/txClip"), wxGetApp().m_FreeDV700txClip);
+
+            pConfig->Flush();
+        }
+    }
+    delete wxConfigBase::Set((wxConfigBase *) NULL);
+}
+
+//-------------------------------------------------------------------------
+// OnOK()
+//-------------------------------------------------------------------------
+void OptionsDlg::OnOK(wxCommandEvent& event)
+{
+    ExchangeData(EXCHANGE_DATA_OUT, true);
+    //this->EndModal(wxID_OK);
+    g_modal = false;
+    this->Show(false);
+}
+
+//-------------------------------------------------------------------------
+// OnCancel()
+//-------------------------------------------------------------------------
+void OptionsDlg::OnCancel(wxCommandEvent& event)
+{
+    //this->EndModal(wxID_CANCEL);
+    g_modal = false;
+    this->Show(false);
+}
+
+//-------------------------------------------------------------------------
+// OnApply()
+//-------------------------------------------------------------------------
+void OptionsDlg::OnApply(wxCommandEvent& event)
+{
+    ExchangeData(EXCHANGE_DATA_OUT, true);
+}
+
+//-------------------------------------------------------------------------
+// OnInitDialog()
+//-------------------------------------------------------------------------
+void OptionsDlg::OnInitDialog(wxInitDialogEvent& event)
+{
+    ExchangeData(EXCHANGE_DATA_IN, false);
+}
+
+// immediately change flags rather using ExchangeData() so we can switch on and off at run time
+
+void OptionsDlg::OnFreeDV700txClip(wxScrollEvent& event) {
+    wxGetApp().m_FreeDV700txClip = m_ckboxFreeDV700txClip->GetValue();
+}
+
+
+void OptionsDlg::updateEventLog(wxString event_in, wxString event_out) {
+    wxString event_in_with_serial, event_out_with_serial; 
+    event_in_with_serial.Printf(_T("[%d] %s"), event_in_serial++, event_in);
+    event_out_with_serial.Printf(_T("[%d] %s"), event_out_serial++, event_out);
+
+    m_txt_events_in->AppendText(event_in_with_serial+"\n");
+    m_txt_events_out->AppendText(event_out_with_serial+"\n");
+}
+
diff --git a/freedv/tags/0.99-Beta/src/dlg_options.h b/freedv/tags/0.99-Beta/src/dlg_options.h
new file mode 100644 (file)
index 0000000..fe355ac
--- /dev/null
@@ -0,0 +1,99 @@
+//==========================================================================
+// Name:            dlg_options.h
+// Purpose:         Dialog for controlling misc FreeDV options
+// Created:         Nov 25 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+
+#ifndef __OPTIONS_DIALOG__
+#define __OPTIONS_DIALOG__
+
+#include "fdmdv2_main.h"
+#include "fdmdv2_defines.h"
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class OptionsDlg
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class OptionsDlg : public wxDialog
+{
+    public:
+    OptionsDlg( wxWindow* parent,
+               wxWindowID id = wxID_ANY, const wxString& title = _("Options"), 
+                const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(600,630), 
+               long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
+        ~OptionsDlg();
+
+        void    ExchangeData(int inout, bool storePersistent);
+        void    updateEventLog(wxString event_in, wxString event_out);
+
+        bool    enableEventsChecked() {return m_ckbox_events->GetValue();}
+
+        void SetSpamTimerLight(bool state) {
+
+            // Colours don't work on Windows
+
+            if (state) {
+                m_rb_spam_timer->SetForegroundColour( wxColour( 255,0 , 0 ) ); // red
+                m_rb_spam_timer->SetValue(true);
+            }
+            else {
+                m_rb_spam_timer->SetForegroundColour( wxColour( 0, 255, 0 ) ); // green
+                m_rb_spam_timer->SetValue(false);
+            }
+        }
+
+
+    protected:
+        // Handlers for events.
+        void    OnOK(wxCommandEvent& event);
+        void    OnCancel(wxCommandEvent& event);
+        void    OnApply(wxCommandEvent& event);
+        void    OnClose(wxCloseEvent& event);
+        void    OnInitDialog(wxInitDialogEvent& event);
+        void    OnFreeDV700txClip(wxScrollEvent& event);
+
+        wxTextCtrl   *m_txtCtrlCallSign; // TODO: this should be renamed to tx_txtmsg, and rename all related incl persis strge
+        wxCheckBox   *m_ckboxTestFrame;
+        wxCheckBox   *m_ckboxChannelNoise;
+        wxCheckBox   *m_ckboxFreeDV700txClip;
+
+        wxRadioButton *m_rb_textEncoding1;
+        wxRadioButton *m_rb_textEncoding2;
+        wxCheckBox    *m_ckboxEnableChecksum;
+
+        wxCheckBox   *m_ckbox_events;
+        wxTextCtrl   *m_txt_events_regexp_match;
+        wxTextCtrl   *m_txt_events_regexp_replace;
+        wxTextCtrl   *m_txt_events_in;
+        wxTextCtrl   *m_txt_events_out;
+        wxTextCtrl   *m_txt_spam_timer;
+        wxRadioButton *m_rb_spam_timer;
+
+        wxCheckBox   *m_ckbox_udp_enable;
+        wxTextCtrl   *m_txt_udp_port;
+
+        wxButton*     m_sdbSizer5OK;
+        wxButton*     m_sdbSizer5Cancel;
+        wxButton*     m_sdbSizer5Apply;
+
+        unsigned int  event_in_serial, event_out_serial;
+
+     private:
+};
+
+#endif // __OPTIONS_DIALOG__
diff --git a/freedv/tags/0.99-Beta/src/dlg_ptt.cpp b/freedv/tags/0.99-Beta/src/dlg_ptt.cpp
new file mode 100644 (file)
index 0000000..2643c1d
--- /dev/null
@@ -0,0 +1,416 @@
+//==========================================================================
+// Name:            dlg_ptt.cpp
+// Purpose:         Subclasses dialog GUI for PTT Config. Creates simple 
+//                  wxWidgets dialog GUI to select real/virtual Comm ports.
+// Date:            May 11 2012
+// Authors:         David Rowe, David Witten, Joel Stanley
+// 
+// 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#include "dlg_ptt.h"
+#include "fdmdv2_main.h"
+
+#ifdef __WIN32__
+#include <wx/msw/registry.h>
+#endif
+#ifdef __FreeBSD__
+#include <glob.h>
+#include <string.h>
+#endif
+
+#include <sstream>
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class ComPortsDlg
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+ComPortsDlg::ComPortsDlg(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style)
+{
+    wxBoxSizer* mainSizer = new wxBoxSizer(wxVERTICAL);
+    this->SetSizer(mainSizer);
+    
+    //----------------------------------------------------------------------
+    // Half Duplex Flag for VOX PTT
+    //----------------------------------------------------------------------
+
+    // DR: should this be on options dialog?
+
+    wxStaticBoxSizer* staticBoxSizer28 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("VOX PTT Settings")), wxHORIZONTAL);
+    m_ckHalfDuplex = new wxCheckBox(this, wxID_ANY, _("Half Duplex"), wxDefaultPosition, wxSize(-1,-1), 0);
+    staticBoxSizer28->Add(m_ckHalfDuplex, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
+    m_ckLeftChannelVoxTone = new wxCheckBox(this, wxID_ANY, _("Left Channel Vox Tone"), wxDefaultPosition, wxSize(-1,-1), 0);
+    staticBoxSizer28->Add(m_ckLeftChannelVoxTone, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
+
+    mainSizer->Add(staticBoxSizer28, 0, wxEXPAND, 5);
+
+    //----------------------------------------------------------------------
+    // Hamlib for CAT PTT
+    //----------------------------------------------------------------------
+
+    wxStaticBoxSizer* staticBoxSizer18 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("Hamlib Settings")), wxVERTICAL);
+
+    wxBoxSizer* gridSizer100 = new wxBoxSizer(wxHORIZONTAL);
+
+    /* Use Hamlib for PTT checkbox. */
+    m_ckUseHamlibPTT = new wxCheckBox(this, wxID_ANY, _("Use Hamlib PTT"), wxDefaultPosition, wxSize(-1, -1), 0);
+    m_ckUseHamlibPTT->SetValue(false);
+    gridSizer100->Add(m_ckUseHamlibPTT, 0, wxALIGN_CENTER_VERTICAL, 0);
+
+    /* Hamlib Rig Type combobox. */
+    gridSizer100->Add(new wxStaticText(this, wxID_ANY, _("Rig Model:"), wxDefaultPosition, wxDefaultSize, 0), 
+                      0, wxALIGN_CENTER_VERTICAL | wxLEFT, 20);
+    m_cbRigName = new wxComboBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(250, -1), 0, NULL, wxCB_DROPDOWN);
+    /* TODO(Joel): this is a hack. At the least, need to gurantee that m_hamLib
+     * exists. */
+    wxGetApp().m_hamlib->populateComboBox(m_cbRigName);
+    m_cbRigName->SetSelection(wxGetApp().m_intHamlibRig);
+    gridSizer100->Add(m_cbRigName, 0, wxALIGN_CENTER_VERTICAL, 0);
+
+    /* Hamlib Serial Port combobox. */
+    gridSizer100->Add(new wxStaticText(this, wxID_ANY, _("Serial Device:"), wxDefaultPosition, wxDefaultSize, 0), 
+                      0, wxALIGN_CENTER_VERTICAL | wxLEFT, 20);
+    m_cbSerialPort = new wxComboBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(140, -1), 0, NULL, wxCB_DROPDOWN);
+    gridSizer100->Add(m_cbSerialPort, 0, wxALIGN_CENTER_VERTICAL, 0);
+
+    staticBoxSizer18->Add(gridSizer100, 1);
+    mainSizer->Add(staticBoxSizer18, 1);
+
+    //----------------------------------------------------------------------
+    // Serial port PTT
+    //----------------------------------------------------------------------
+
+    wxStaticBoxSizer* staticBoxSizer17 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("Serial Port Settings")), wxVERTICAL);
+    mainSizer->Add(staticBoxSizer17, 1, wxEXPAND, 5);
+    wxStaticBoxSizer* staticBoxSizer31 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("PTT Port")), wxVERTICAL);
+    staticBoxSizer17->Add(staticBoxSizer31, 1, wxEXPAND, 5);
+
+#ifdef __WXMSW__
+    m_ckUseSerialPTT = new wxCheckBox(this, wxID_ANY, _("Use Serial Port PTT"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_ckUseSerialPTT->SetValue(false);
+    staticBoxSizer31->Add(m_ckUseSerialPTT, 0, wxALIGN_LEFT, 20);
+
+    wxArrayString m_listCtrlPortsArr;
+    m_listCtrlPorts = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxSize(-1,45), m_listCtrlPortsArr, wxLB_SINGLE | wxLB_SORT);
+    staticBoxSizer31->Add(m_listCtrlPorts, 1, wxALIGN_CENTER, 0);
+#endif
+
+#ifdef __WXGTK__
+    wxBoxSizer* bSizer83;
+    bSizer83 = new wxBoxSizer(wxHORIZONTAL);
+
+    wxGridSizer* gridSizer200 = new wxGridSizer(1, 3, 0, 0);
+    
+    m_ckUseSerialPTT = new wxCheckBox(this, wxID_ANY, _("Use Serial Port PTT"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_ckUseSerialPTT->SetValue(false);
+    gridSizer200->Add(m_ckUseSerialPTT, 1, wxALIGN_CENTER|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 2);
+
+    m_staticText12 = new wxStaticText(this, wxID_ANY, _("Serial Device:  "), wxDefaultPosition, wxDefaultSize, 0);
+    m_staticText12->Wrap(-1);
+    gridSizer200->Add(m_staticText12, 1,wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 2);
+
+    m_cbCtlDevicePath = new wxComboBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(140, -1), 0, NULL, wxCB_DROPDOWN);
+    gridSizer200->Add(m_cbCtlDevicePath, 1, wxEXPAND|wxALIGN_CENTER|wxALIGN_RIGHT, 2);
+    
+    bSizer83->Add(gridSizer200, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT | wxALL, 2);
+    staticBoxSizer31->Add(bSizer83, 1, wxALIGN_CENTER_VERTICAL|wxALL, 1);
+#endif
+
+    wxBoxSizer* boxSizer19 = new wxBoxSizer(wxVERTICAL);
+    staticBoxSizer17->Add(boxSizer19, 1, wxEXPAND, 5);
+    wxStaticBoxSizer* staticBoxSizer16 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("Signal polarity")), wxHORIZONTAL);
+    boxSizer19->Add(staticBoxSizer16, 1, wxEXPAND|wxALIGN_CENTER|wxALIGN_RIGHT, 5);
+
+    wxGridSizer* gridSizer17 = new wxGridSizer(2, 2, 0, 0);
+    staticBoxSizer16->Add(gridSizer17, 1, wxEXPAND|wxALIGN_RIGHT, 5);
+
+    m_rbUseDTR = new wxRadioButton(this, wxID_ANY, _("Use DTR"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_rbUseDTR->SetToolTip(_("Toggle DTR line for PTT"));
+    m_rbUseDTR->SetValue(1);
+    gridSizer17->Add(m_rbUseDTR, 0, wxALIGN_CENTER|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5);
+
+    m_ckDTRPos = new wxCheckBox(this, wxID_ANY, _("DTR = +V"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_ckDTRPos->SetToolTip(_("Set Polarity of the DTR line"));
+    m_ckDTRPos->SetValue(false);
+    gridSizer17->Add(m_ckDTRPos, 0, wxALIGN_CENTER|wxALIGN_RIGHT, 5);
+
+    m_rbUseRTS = new wxRadioButton(this, wxID_ANY, _("Use RTS"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_rbUseRTS->SetToolTip(_("Toggle the RTS pin for PTT"));
+    m_rbUseRTS->SetValue(1);
+    gridSizer17->Add(m_rbUseRTS, 0, wxALIGN_CENTER|wxALIGN_RIGHT, 5);
+
+    m_ckRTSPos = new wxCheckBox(this, wxID_ANY, _("RTS = +V"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_ckRTSPos->SetValue(false);
+    m_ckRTSPos->SetToolTip(_("Set Polarity of the RTS line"));
+    gridSizer17->Add(m_ckRTSPos, 0, wxALIGN_CENTER|wxALIGN_RIGHT, 5);
+
+    //----------------------------------------------------------------------
+    // OK - Cancel - Apply
+    //----------------------------------------------------------------------
+
+    wxBoxSizer* boxSizer12 = new wxBoxSizer(wxHORIZONTAL);
+
+    m_buttonOK = new wxButton(this, wxID_OK, _("OK"), wxDefaultPosition, wxSize(-1,-1), 0);
+    m_buttonOK->SetDefault();
+    boxSizer12->Add(m_buttonOK, 0, wxLEFT|wxRIGHT|wxTOP|wxBOTTOM, 5);
+
+    m_buttonCancel = new wxButton(this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxSize(-1,-1), 0);
+    boxSizer12->Add(m_buttonCancel, 0, wxLEFT|wxRIGHT|wxTOP|wxBOTTOM, 5);
+
+    m_buttonApply = new wxButton(this, wxID_APPLY, _("Apply"), wxDefaultPosition, wxSize(-1,-1), 0);
+    boxSizer12->Add(m_buttonApply, 0, wxLEFT|wxRIGHT|wxTOP|wxBOTTOM, 5);
+
+    mainSizer->Add(boxSizer12, 0, wxLEFT|wxRIGHT|wxTOP|wxBOTTOM|wxALIGN_CENTER_HORIZONTAL, 5);
+
+    if ( GetSizer() ) 
+    {
+         GetSizer()->Fit(this);
+    }
+    Centre(wxBOTH);
+
+    // Connect events
+    this->Connect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(ComPortsDlg::OnInitDialog), NULL, this);
+    m_ckUseHamlibPTT->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(ComPortsDlg::PTTUseHamLibClicked), NULL, this);
+    m_ckUseSerialPTT->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(ComPortsDlg::PTTUseSerialClicked), NULL, this);
+    m_buttonOK->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnOK), NULL, this);
+    m_buttonCancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnCancel), NULL, this);
+    m_buttonApply->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnApply), NULL, this);
+}
+
+//-------------------------------------------------------------------------
+// ~ComPortsDlg()
+//-------------------------------------------------------------------------
+ComPortsDlg::~ComPortsDlg()
+{
+    // Disconnect Events
+    this->Disconnect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(ComPortsDlg::OnInitDialog), NULL, this);
+    m_ckUseHamlibPTT->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(ComPortsDlg::PTTUseHamLibClicked), NULL, this);
+    m_ckUseSerialPTT->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(ComPortsDlg::PTTUseSerialClicked), NULL, this);
+    m_buttonOK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnOK), NULL, this);
+    m_buttonCancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnCancel), NULL, this);
+    m_buttonApply->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnApply), NULL, this);
+}
+
+//-------------------------------------------------------------------------
+// OnInitDialog()
+//-------------------------------------------------------------------------
+void ComPortsDlg::OnInitDialog(wxInitDialogEvent& event)
+{
+    populatePortList();
+    ExchangeData(EXCHANGE_DATA_IN);
+}
+
+//-------------------------------------------------------------------------
+// populatePortList()
+//-------------------------------------------------------------------------
+void ComPortsDlg::populatePortList()
+{
+#ifdef __WXMSW__
+    m_listCtrlPorts->Clear();
+    m_cbSerialPort->Clear();
+    wxArrayString aStr;
+    wxRegKey key(wxRegKey::HKLM, _T("HARDWARE\\DEVICEMAP\\SERIALCOMM"));
+    if(!key.Exists())
+    {
+        return;
+    }
+    else
+    {
+        // Get the number of subkeys and enumerate them.
+        if(!key.Open(wxRegKey::Read))
+        {
+            return;
+        }    
+        size_t subkeys;
+        size_t values;
+        if(!key.GetKeyInfo(&subkeys, NULL, &values, NULL))
+        {
+            return;
+        }
+        if(!key.HasValues())
+        {
+            return;
+        }
+        wxString key_name;
+        long el = 1;
+        key.GetFirstValue(key_name, el);
+        wxString valType;
+        wxString key_data;
+        for(unsigned int i = 0; i < values; i++)
+        {
+            key.QueryValue(key_name, key_data);
+            //wxPrintf("Value:  %s Data: %s\n", key_name, key_data);
+            aStr.Add(key_data, 1);
+            key.GetNextValue(key_name, el);
+        }
+    }
+    m_listCtrlPorts->Append(aStr);
+    m_cbSerialPort->Append(aStr);
+#endif
+#ifdef __WXGTK__
+    m_cbSerialPort->Clear();
+    m_cbCtlDevicePath->Clear();
+#ifdef __FreeBSD__
+       glob_t  gl;
+       if(glob("/dev/tty*", GLOB_MARK, NULL, &gl)==0) {
+               for(unsigned int i=0; i<gl.gl_pathc; i++) {
+                       if(gl.gl_pathv[i][strlen(gl.gl_pathv[i])-1]=='/')
+                               continue;
+                               
+                       /* Exclude pseudo TTYs */
+                       if(gl.gl_pathv[i][8] >= 'l' && gl.gl_pathv[i][8] <= 's')
+                               continue;
+                       if(gl.gl_pathv[i][8] >= 'L' && gl.gl_pathv[i][8] <= 'S')
+                               continue;
+
+                       /* Exclude virtual TTYs */
+                       if(gl.gl_pathv[i][8] == 'v')
+                               continue;
+
+                       /* Exclude initial-state and lock-state devices */
+                       if(strchr(gl.gl_pathv[i], '.') != NULL)
+                               continue;
+
+                       m_cbSerialPort->Append(gl.gl_pathv[i]);
+                       m_cbCtlDevicePath->Append(gl.gl_pathv[i]);
+               }
+               globfree(&gl);
+       }
+#else
+    /* TODO(Joel): http://stackoverflow.com/questions/2530096/how-to-find-all-serial-devices-ttys-ttyusb-on-linux-without-opening-them */
+    m_cbSerialPort->Append("/dev/ttyUSB0");
+    m_cbSerialPort->Append("/dev/ttyUSB1");
+    m_cbSerialPort->Append("/dev/ttyS0");
+    m_cbSerialPort->Append("/dev/ttyS1");
+    m_cbCtlDevicePath->Clear();
+    m_cbCtlDevicePath->Append("/dev/ttyUSB0");
+    m_cbCtlDevicePath->Append("/dev/ttyUSB1");
+    m_cbCtlDevicePath->Append("/dev/ttyS0");
+    m_cbCtlDevicePath->Append("/dev/ttyS1");
+#endif
+#endif
+}
+
+//-------------------------------------------------------------------------
+// ExchangeData()
+//-------------------------------------------------------------------------
+void ComPortsDlg::ExchangeData(int inout)
+{
+    wxConfigBase *pConfig = wxConfigBase::Get();
+    wxString str;
+    
+    if(inout == EXCHANGE_DATA_IN)
+    {
+        m_ckHalfDuplex->SetValue(wxGetApp().m_boolHalfDuplex);
+        m_ckLeftChannelVoxTone->SetValue(wxGetApp().m_leftChannelVoxTone);
+
+        m_ckUseHamlibPTT->SetValue(wxGetApp().m_boolHamlibUseForPTT);
+        m_cbRigName->SetSelection(wxGetApp().m_intHamlibRig);
+        m_cbSerialPort->SetValue(wxGetApp().m_strHamlibSerialPort);
+
+        m_ckUseSerialPTT->SetValue(wxGetApp().m_boolUseSerialPTT);
+        str = wxGetApp().m_strRigCtrlPort;
+#ifdef __WXMSW__
+        m_listCtrlPorts->SetStringSelection(str);
+#endif
+#ifdef __WXGTK__
+        m_cbCtlDevicePath->SetValue(str);
+#endif
+        m_rbUseRTS->SetValue(wxGetApp().m_boolUseRTS);
+        m_ckRTSPos->SetValue(wxGetApp().m_boolRTSPos);
+        m_rbUseDTR->SetValue(wxGetApp().m_boolUseDTR);
+        m_ckDTRPos->SetValue(wxGetApp().m_boolDTRPos);
+    }
+    if(inout == EXCHANGE_DATA_OUT)
+    {
+        wxGetApp().m_boolHalfDuplex = m_ckHalfDuplex->GetValue();
+        pConfig->Write(wxT("/Rig/HalfDuplex"), wxGetApp().m_boolHalfDuplex);
+        wxGetApp().m_leftChannelVoxTone = m_ckLeftChannelVoxTone->GetValue();
+        pConfig->Write(wxT("/Rig/leftChannelVoxTone"), wxGetApp().m_leftChannelVoxTone);
+
+        /* Hamlib settings. */
+
+        wxGetApp().m_boolHamlibUseForPTT = m_ckUseHamlibPTT->GetValue();
+        wxGetApp().m_intHamlibRig = m_cbRigName->GetSelection();
+        wxGetApp().m_strHamlibSerialPort = m_cbSerialPort->GetValue();
+
+        pConfig->Write(wxT("/Hamlib/UseForPTT"), wxGetApp().m_boolHamlibUseForPTT);
+        pConfig->Write(wxT("/Hamlib/RigName"), wxGetApp().m_intHamlibRig);
+        pConfig->Write(wxT("/Hamlib/SerialPort"), wxGetApp().m_strHamlibSerialPort);
+
+        /* Serial settings */
+
+        wxGetApp().m_boolUseSerialPTT           = m_ckUseSerialPTT->IsChecked();
+#ifdef __WXMSW__
+        wxGetApp().m_strRigCtrlPort             = m_listCtrlPorts->GetStringSelection();
+#endif
+#ifdef __WXGTK__
+        wxGetApp().m_strRigCtrlPort             = m_cbCtlDevicePath->GetValue();
+#endif
+        wxGetApp().m_boolUseRTS                 = m_rbUseRTS->GetValue();
+        wxGetApp().m_boolRTSPos                 = m_ckRTSPos->IsChecked();
+        wxGetApp().m_boolUseDTR                 = m_rbUseDTR->GetValue();
+        wxGetApp().m_boolDTRPos                 = m_ckDTRPos->IsChecked();
+        
+        pConfig->Write(wxT("/Rig/UseSerialPTT"),    wxGetApp().m_boolUseSerialPTT);
+        pConfig->Write(wxT("/Rig/Port"),            wxGetApp().m_strRigCtrlPort); 
+        pConfig->Write(wxT("/Rig/UseRTS"),          wxGetApp().m_boolUseRTS);
+        pConfig->Write(wxT("/Rig/RTSPolarity"),     wxGetApp().m_boolRTSPos);
+        pConfig->Write(wxT("/Rig/UseDTR"),          wxGetApp().m_boolUseDTR);
+        pConfig->Write(wxT("/Rig/DTRPolarity"),     wxGetApp().m_boolDTRPos);
+
+        pConfig->Flush();
+    }
+    delete wxConfigBase::Set((wxConfigBase *) NULL);
+}
+
+//-------------------------------------------------------------------------
+// PTTUseHamLibClicked()
+//-------------------------------------------------------------------------
+void ComPortsDlg::PTTUseHamLibClicked(wxCommandEvent& event)
+{
+    m_ckUseSerialPTT->SetValue(false);    
+}
+
+//-------------------------------------------------------------------------
+// PTTUseSerialClicked()
+//-------------------------------------------------------------------------
+void ComPortsDlg::PTTUseSerialClicked(wxCommandEvent& event)
+{
+    m_ckUseHamlibPTT->SetValue(false);
+}
+
+//-------------------------------------------------------------------------
+// OnApply()
+//-------------------------------------------------------------------------
+void ComPortsDlg::OnApply(wxCommandEvent& event)
+{
+    ExchangeData(EXCHANGE_DATA_OUT);
+}
+
+//-------------------------------------------------------------------------
+// OnCancel()
+//-------------------------------------------------------------------------
+void ComPortsDlg::OnCancel(wxCommandEvent& event)
+{
+    this->EndModal(wxID_CANCEL);
+}
+
+//-------------------------------------------------------------------------
+// OnClose()
+//-------------------------------------------------------------------------
+void ComPortsDlg::OnOK(wxCommandEvent& event)
+{
+    ExchangeData(EXCHANGE_DATA_OUT);
+    this->EndModal(wxID_OK);
+}
diff --git a/freedv/tags/0.99-Beta/src/dlg_ptt.h b/freedv/tags/0.99-Beta/src/dlg_ptt.h
new file mode 100644 (file)
index 0000000..8fa9b9d
--- /dev/null
@@ -0,0 +1,91 @@
+//==========================================================================
+// Name:            dlg_ptt.h
+// Purpose:         Subclasses dialog GUI for PTT Config.
+//                  
+// Created:         May. 11, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#ifndef __COMPORTS_DIALOG__
+#define __COMPORTS_DIALOG__
+
+#include "fdmdv2_main.h"
+#include "hamlib.h"
+#include <wx/settings.h>
+#include <wx/xrc/xmlres.h>
+#include <wx/xrc/xh_bmp.h>
+#include <wx/dialog.h>
+#include <wx/sizer.h>
+#include <wx/statbox.h>
+#include <wx/checkbox.h>
+#include <wx/listbox.h>
+#include <wx/radiobut.h>
+#include <wx/button.h>
+#include <wx/spinctrl.h>
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class ComPortsDlg
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class ComPortsDlg : public wxDialog
+{
+     public:
+        ComPortsDlg(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("PTT Config"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(450,300), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER);
+        virtual ~ComPortsDlg();
+        void    ExchangeData(int inout);
+
+    protected:
+        wxCheckBox* m_ckHalfDuplex;
+        wxCheckBox* m_ckLeftChannelVoxTone;
+
+        /* Hamlib settings.*/
+
+        wxCheckBox *m_ckUseHamlibPTT;
+        wxComboBox *m_cbRigName;
+        wxComboBox *m_cbSerialPort;
+
+        Hamlib *m_hamlib;
+
+        /* Serial Settings */
+
+        wxListBox     *m_listCtrlPorts;
+        wxCheckBox    *m_ckUseSerialPTT;
+        wxStaticText  *m_staticText12;
+        wxComboBox    *m_cbCtlDevicePath;
+        wxRadioButton *m_rbUseDTR;
+        wxCheckBox    *m_ckRTSPos;
+        wxRadioButton *m_rbUseRTS;
+        wxCheckBox    *m_ckDTRPos;
+
+        /* Ok - Cancel - Apply */
+
+        wxButton* m_buttonOK;
+        wxButton* m_buttonCancel;
+        wxButton* m_buttonApply;
+
+
+protected:
+        void populatePortList();
+
+        void PTTUseHamLibClicked(wxCommandEvent& event);
+        void PTTUseSerialClicked(wxCommandEvent& event);
+
+        void OnOK(wxCommandEvent& event);
+        void OnCancel(wxCommandEvent& event);
+        void OnApply(wxCommandEvent& event);
+        virtual void OnInitDialog(wxInitDialogEvent& event);
+};
+
+#endif // __COMPORTS_DIALOG__
diff --git a/freedv/tags/0.99-Beta/src/fdmdv2_defines.h b/freedv/tags/0.99-Beta/src/fdmdv2_defines.h
new file mode 100644 (file)
index 0000000..64aa606
--- /dev/null
@@ -0,0 +1,102 @@
+//==========================================================================
+// Name:            fdmdv2_defines.h
+// Purpose:         Definitions used by plots derived from fdmdv2_plot class.
+// Created:         August 27, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#ifndef __FDMDV2_DEFINES__
+#define __FDMDV2_DEFINES__
+
+#include "wx/wx.h"
+#include "freedv_api.h"
+#include "freedv_api_internal.h"
+
+// Spectrogram and Waterfall
+
+#define MIN_MAG_DB        -40.0     // min of spectrogram/waterfall magnitude axis
+#define MAX_MAG_DB          0.0     // max of spectrogram/waterfall magnitude axis
+#define STEP_MAG_DB         5.0     // magnitude axis step
+#define BETA                0.95    // constant for time averaging spectrum data
+#define MIN_F_HZ            0       // min freq on Waterfall and Spectrum
+#define MAX_F_HZ            3000    // max freq on Waterfall and Spectrum
+#define STEP_F_HZ           500     // major (e.g. text legend) freq step on Waterfall and Spectrum graticule
+#define STEP_MINOR_F_HZ     100     // minor (ticks) freq step on Waterfall and Spectrum graticule
+#define WATERFALL_SECS_Y    30      // number of seconds respresented by y axis of waterfall
+#define WATERFALL_SECS_STEP 5       // graticule y axis steps of waterfall
+#define DT                  0.1     // time between real time graphing updates
+#define FS                  8000    // FDMDV modem sample rate
+
+// Scatter diagram 
+
+#define SCATTER_MEM_SECS    10
+// (symbols/frame)/(graphics update period) = symbols/s sent to scatter memory
+// memory (symbols) = secs of memory * symbols/sec
+#define SCATTER_MEM_SYMS_MAX    ((int)(SCATTER_MEM_SECS*((FDMDV_NC_MAX+1)/DT)))
+
+// Waveform plotting constants
+
+#define WAVEFORM_PLOT_FS    400                            // sample rate (points/s) of waveform plotted to screen
+#define WAVEFORM_PLOT_TIME  5                              // length or entire waveform on screen
+#define WAVEFORM_PLOT_BUF   ((int)(DT*WAVEFORM_PLOT_FS))   // number of new samples we plot per DT
+
+// sample rate I/O & conversion constants
+
+#define MAX_FPB             8096                           // maximum value of portAudio framesPerBuffer
+#define PA_FPB              1024                           // nominal value of portAudio framesPerBuffer
+#define SAMPLE_RATE         48000                          // 48 kHz sampling rate rec. as we can trust accuracy of sound card
+#define N8                  160                            // processing buffer size at 8 kHz
+#define MEM8                (FDMDV_OS_TAPS/FDMDV_OS)
+#define N48                 (N8*SAMPLE_RATE/FS)            // processing buffer size at 48 kHz
+#define NUM_CHANNELS        2                              // I think most sound cards prefer stereo we will convert to mono
+#define VOX_TONE_FREQ       1000.0                         // optional left channel vox tone freq
+#define VOX_TONE_AMP        30000                          // optional left channel vox tone amp
+
+#define MAX_BITS_PER_CODEC_FRAME 64                            // 1600 bit/s mode
+#define MAX_BYTES_PER_CODEC_FRAME (MAX_BITS_PER_CODEC_FRAME/8)
+#define MAX_BITS_PER_FDMDV_FRAME 40                            // 2000 bit/s mode
+
+// Squelch
+#define SQ_DEFAULT_SNR       2.0
+
+// Level Gauge
+#define FROM_RADIO_MAX       0.8
+#define FROM_MIC_MAX         0.8
+#define LEVEL_BETA           0.99
+
+// SNR
+#define SNRSLOW_BETA        0.5                           // time constant for slow SNR for display
+
+// Text messaging Data
+#define MAX_CALLSIGN         80
+#define MAX_EVENT_LOG        10
+#define MAX_EVENT_RULES      100
+   
+enum
+{
+    ID_ROTATE_LEFT = wxID_HIGHEST + 1,
+    ID_ROTATE_RIGHT,
+    ID_RESIZE,
+    ID_PAINT_BG
+};
+
+// Codec 2 LPC Post Filter defaults, from codec-dev/src/quantise.c
+
+#define CODEC2_LPC_PF_GAMMA 0.5
+#define CODEC2_LPC_PF_BETA  0.2
+
+
+#endif  //__FDMDV2_DEFINES__
diff --git a/freedv/tags/0.99-Beta/src/fdmdv2_main.cpp b/freedv/tags/0.99-Beta/src/fdmdv2_main.cpp
new file mode 100644 (file)
index 0000000..2adec2c
--- /dev/null
@@ -0,0 +1,3686 @@
+//==========================================================================
+// Name:            fdmdv2_main.cpp
+//
+// Purpose:         FreeDV main()
+// Created:         Apr. 9, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+
+#include "fdmdv2_main.h"
+
+#define wxUSE_FILEDLG   1
+#define wxUSE_LIBPNG    1
+#define wxUSE_LIBJPEG   1
+#define wxUSE_GIF       1
+#define wxUSE_PCX       1
+#define wxUSE_LIBTIFF   1
+
+//-------------------------------------------------------------------
+// Bunch of globals used for communication with sound card call
+// back functions
+// ------------------------------------------------------------------
+
+int g_in, g_out;
+
+// Global Codec2 & modem states - just one reqd for tx & rx
+int                 g_Nc;
+int                 g_mode;
+struct freedv      *g_pfreedv;
+struct MODEM_STATS  g_stats;
+float               g_pwr_scale;
+int                 g_clip;
+
+// test Frames
+int                 g_testFrames;
+int                 g_test_frame_sync_state;
+int                 g_test_frame_count;
+int                 g_total_bits;
+int                 g_total_bit_errors;
+int                 g_channel_noise;
+float               g_sig_pwr_av = 0.0;
+struct FIFO        *g_error_pattern_fifo;
+short              *g_error_hist;
+// time averaged magnitude spectrum used for waterfall and spectrum display
+float               g_avmag[MODEM_STATS_NSPEC];
+
+// GUI controls that affect rx and tx processes
+int   g_SquelchActive;
+float g_SquelchLevel;
+int   g_analog;
+int   g_split;
+int   g_tx;
+float g_snr;
+bool  g_half_duplex;
+bool  g_modal;
+
+// sending and receiving Call Sign data
+struct FIFO         *g_txDataInFifo;
+struct FIFO         *g_rxDataOutFifo;
+
+// tx/rx processing states
+int                 g_State;
+paCallBackData     *g_rxUserdata;
+
+// FIFOs used for plotting waveforms
+struct FIFO        *g_plotDemodInFifo;
+struct FIFO        *g_plotSpeechOutFifo;
+struct FIFO        *g_plotSpeechInFifo;
+
+// Soundcard config
+int                 g_nSoundCards;
+int                 g_soundCard1InDeviceNum;
+int                 g_soundCard1OutDeviceNum;
+int                 g_soundCard1SampleRate;
+int                 g_soundCard2InDeviceNum;
+int                 g_soundCard2OutDeviceNum;
+int                 g_soundCard2SampleRate;
+
+// playing and recording from sound files
+
+SNDFILE            *g_sfPlayFile;
+bool                g_playFileToMicIn;
+bool                g_loopPlayFileToMicIn;
+int                 g_playFileToMicInEventId;
+
+SNDFILE            *g_sfRecFile;
+bool                g_recFileFromRadio;
+unsigned int        g_recFromRadioSamples;
+int                 g_recFileFromRadioEventId;
+
+SNDFILE            *g_sfPlayFileFromRadio;
+bool                g_playFileFromRadio;
+int                 g_sfFs;
+bool                g_loopPlayFileFromRadio;
+int                 g_playFileFromRadioEventId;
+float               g_blink;
+
+wxWindow           *g_parent;
+
+// Click to tune rx and tx frequency offset states
+float               g_RxFreqOffsetHz;
+COMP                g_RxFreqOffsetPhaseRect;
+float               g_TxFreqOffsetHz;
+COMP                g_TxFreqOffsetPhaseRect;
+
+// experimental mutex to make sound card callbacks mutually exclusive
+// TODO: review code and see if we need this any more, as fifos should
+// now be thread safe
+
+wxMutex g_mutexProtectingCallbackData;
+
+// Speex pre-processor states
+
+SpeexPreprocessState *g_speex_st;
+
+// WxWidgets - initialize the application
+IMPLEMENT_APP(MainApp);
+
+//FILE *ft;
+FILE *g_logfile;
+
+//-------------------------------------------------------------------------
+// OnInit()
+//-------------------------------------------------------------------------
+bool MainApp::OnInit()
+{
+    if(!wxApp::OnInit())
+    {
+        return false;
+    }
+    SetVendorName(wxT("CODEC2-Project"));
+    SetAppName(wxT("FreeDV"));      // not needed, it's the default value
+
+    // DR - this is wrong define so won't be used on windows build, should be __WXMSW__
+    // So registry will be used for Win32
+#ifdef _WXMSW_
+    // Force use of file-based configuration persistance on Windows platforma
+    wxConfig *pConfig = new wxConfig();
+    wxFileConfig *pFConfig = new wxFileConfig(wxT("FreeDV"), wxT("CODEC2-Project"), wxT("FreeDV.conf"), wxT("FreeDV.conf"),  wxCONFIG_USE_LOCAL_FILE | wxCONFIG_USE_RELATIVE_PATH);
+    pConfig->Set(pFConfig);
+    pConfig->SetRecordDefaults();
+#else
+    wxConfigBase *pConfig = wxConfigBase::Get();
+    pConfig->SetRecordDefaults();
+#endif
+
+    m_rTopWindow = wxRect(0, 0, 0, 0);
+    m_strRxInAudio.Empty();
+    m_strRxOutAudio.Empty();
+    m_textVoiceInput.Empty();
+    m_textVoiceOutput.Empty();
+    m_strSampleRate.Empty();
+    m_strBitrate.Empty();
+    // Create the main application window
+    frame = new MainFrame(NULL);
+    SetTopWindow(frame);
+    // Should guarantee that the first plot tab defined is the one
+    // displayed. But it doesn't when built from command line.  Why?
+    frame->m_auiNbookCtrl->ChangeSelection(0);
+    frame->Layout();
+    frame->Show();
+    g_parent =frame;
+
+    //ft = fopen("tmp.raw","wb");
+    //assert(ft != NULL);
+
+    return true;
+}
+
+//-------------------------------------------------------------------------
+// OnExit()
+//-------------------------------------------------------------------------
+int MainApp::OnExit()
+{
+    return 0;
+}
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class MainFrame(wxFrame* pa->ent) : TopFrame(parent)
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+MainFrame::MainFrame(wxWindow *parent) : TopFrame(parent)
+{
+    m_zoom              = 1.;
+
+    #ifdef __WXMSW__
+    g_logfile = fopen("log.txt","wt");
+    #else
+    g_logfile = stderr;
+    #endif
+
+    SetMinSize(wxSize(400,400));
+
+    // Init Hamlib library, but we dont start talking to any rigs yet
+
+    wxGetApp().m_hamlib = new Hamlib();
+
+    tools->AppendSeparator();
+    wxMenuItem* m_menuItemToolsConfigDelete;
+    m_menuItemToolsConfigDelete = new wxMenuItem(tools, wxID_ANY, wxString(_("&Restore defaults")) , wxT("Delete config file/keys and restore defaults"), wxITEM_NORMAL);
+    this->Connect(m_menuItemToolsConfigDelete->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::OnDeleteConfig));
+
+    tools->Append(m_menuItemToolsConfigDelete);
+
+    wxConfigBase *pConfig = wxConfigBase::Get();
+
+    // restore frame position and size
+    int x = pConfig->Read(wxT("/MainFrame/left"),       20);
+    int y = pConfig->Read(wxT("/MainFrame/top"),        20);
+    int w = pConfig->Read(wxT("/MainFrame/width"),     800);
+    int h = pConfig->Read(wxT("/MainFrame/height"),    550);
+
+    // sanitise frame position as a first pass at Win32 registry bug
+
+    fprintf(g_logfile, "x = %d y = %d w = %d h = %d\n", x,y,w,h);
+    if (x < 0 || x > 2048) x = 20;
+    if (y < 0 || y > 2048) y = 20;
+    if (w < 0 || w > 2048) w = 800;
+    if (h < 0 || h > 2048) h = 550;
+
+    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_show_speech_in     = pConfig->Read(wxT("/MainFrame/show_speech_in"),    1);
+    wxGetApp().m_show_speech_out    = pConfig->Read(wxT("/MainFrame/show_speech_out"),   1);
+    wxGetApp().m_show_demod_in      = pConfig->Read(wxT("/MainFrame/show_demod_in"),     1);
+    wxGetApp().m_show_test_frame_errors = pConfig->Read(wxT("/MainFrame/show_test_frame_errors"),     1);
+    wxGetApp().m_show_test_frame_errors_hist = pConfig->Read(wxT("/MainFrame/show_test_frame_errors_hist"),     1);
+
+    wxGetApp().m_rxNbookCtrl        = pConfig->Read(wxT("/MainFrame/rxNbookCtrl"),    (long)0);
+
+    g_SquelchActive = pConfig->Read(wxT("/Audio/SquelchActive"), (long)0);
+    g_SquelchLevel = pConfig->Read(wxT("/Audio/SquelchLevel"), (int)(SQ_DEFAULT_SNR*2));
+    g_SquelchLevel /= 2.0;
+
+    Move(x, y);
+    SetClientSize(w, h);
+    
+    if(wxGetApp().m_show_wf)
+    {
+        // Add Waterfall Plot window
+        m_panelWaterfall = new PlotWaterfall((wxFrame*) m_auiNbookCtrl, false, 0);
+        m_panelWaterfall->SetToolTip(_("Left click to tune, Right click to toggle mono/colour"));
+        m_auiNbookCtrl->AddPage(m_panelWaterfall, _("Waterfall"), true, wxNullBitmap);
+    }
+    if(wxGetApp().m_show_spect)
+    {
+        // Add Spectrum Plot window
+        m_panelSpectrum = new PlotSpectrum((wxFrame*) m_auiNbookCtrl, g_avmag,
+                                           MODEM_STATS_NSPEC*((float)MAX_F_HZ/MODEM_STATS_MAX_F_HZ));
+        m_panelSpectrum->SetToolTip(_("Left click to tune"));
+        m_auiNbookCtrl->AddPage(m_panelSpectrum, _("Spectrum"), true, wxNullBitmap);
+    }
+    if(wxGetApp().m_show_scatter)
+    {
+        // Add Scatter Plot window
+        m_panelScatter = new PlotScatter((wxFrame*) m_auiNbookCtrl);
+        m_auiNbookCtrl->AddPage(m_panelScatter, _("Scatter"), true, wxNullBitmap);
+    }
+    if(wxGetApp().m_show_demod_in)
+    {
+        // Add Demod Input window
+        m_panelDemodIn = new PlotScalar((wxFrame*) m_auiNbookCtrl, 1, WAVEFORM_PLOT_TIME, 1.0/WAVEFORM_PLOT_FS, -1, 1, 1, 0.2, "%2.1f", 0);
+        m_auiNbookCtrl->AddPage(m_panelDemodIn, _("Frm Radio"), true, wxNullBitmap);
+        g_plotDemodInFifo = fifo_create(2*WAVEFORM_PLOT_BUF);
+    }
+
+    if(wxGetApp().m_show_speech_in)
+    {
+        // Add Speech Input window
+        m_panelSpeechIn = new PlotScalar((wxFrame*) m_auiNbookCtrl, 1, WAVEFORM_PLOT_TIME, 1.0/WAVEFORM_PLOT_FS, -1, 1, 1, 0.2, "%2.1f", 0);
+        m_auiNbookCtrl->AddPage(m_panelSpeechIn, _("Frm Mic"), true, wxNullBitmap);
+        g_plotSpeechInFifo = fifo_create(4*WAVEFORM_PLOT_BUF);
+    }
+
+    if(wxGetApp().m_show_speech_out)
+    {
+        // Add Speech Output window
+        m_panelSpeechOut = new PlotScalar((wxFrame*) m_auiNbookCtrl, 1, WAVEFORM_PLOT_TIME, 1.0/WAVEFORM_PLOT_FS, -1, 1, 1, 0.2, "%2.1f", 0);
+        m_auiNbookCtrl->AddPage(m_panelSpeechOut, _("To Spkr/Hdphns"), true, wxNullBitmap);
+        g_plotSpeechOutFifo = fifo_create(2*WAVEFORM_PLOT_BUF);
+    }
+
+    if(wxGetApp().m_show_timing)
+    {
+        // Add Timing Offset window
+        m_panelTimeOffset = new PlotScalar((wxFrame*) m_auiNbookCtrl, 1, 5.0, DT, -0.5, 0.5, 1, 0.1, "%2.1f", 0);
+        m_auiNbookCtrl->AddPage(m_panelTimeOffset, L"Timing \u0394", true, wxNullBitmap);
+    }
+    if(wxGetApp().m_show_freq)
+    {
+        // Add Frequency Offset window
+        m_panelFreqOffset = new PlotScalar((wxFrame*) m_auiNbookCtrl, 1, 5.0, DT, -200, 200, 1, 50, "%3.0fHz", 0);
+        m_auiNbookCtrl->AddPage(m_panelFreqOffset, L"Frequency \u0394", true, wxNullBitmap);
+    }
+
+    if(wxGetApp().m_show_test_frame_errors)
+    {
+        // Add Test Frame Errors window
+        m_panelTestFrameErrors = new PlotScalar((wxFrame*) m_auiNbookCtrl, 2*MODEM_STATS_NC_MAX, 30.0, DT, 0, 2*MODEM_STATS_NC_MAX+2, 1, 1, "", 1);
+        m_auiNbookCtrl->AddPage(m_panelTestFrameErrors, L"Test Frame Errors", true, wxNullBitmap);
+    }
+
+    if(wxGetApp().m_show_test_frame_errors_hist)
+    {
+        // Add Test Frame Errors window
+        m_panelTestFrameErrorsHist = new PlotScalar((wxFrame*) m_auiNbookCtrl, 1, 1.0, 1.0/(2*FDMDV_NC_MAX), 0.0, 1.0, 1.0/FDMDV_NC_MAX, 0.1, "%3.2f", 0);
+        m_auiNbookCtrl->AddPage(m_panelTestFrameErrorsHist, L"Test Frame Histogram", true, wxNullBitmap);
+    }
+
+    wxGetApp().m_framesPerBuffer = pConfig->Read(wxT("/Audio/framesPerBuffer"), PA_FPB);
+
+    g_soundCard1InDeviceNum  = pConfig->Read(wxT("/Audio/soundCard1InDeviceNum"),         -1);
+    g_soundCard1OutDeviceNum = pConfig->Read(wxT("/Audio/soundCard1OutDeviceNum"),        -1);
+    g_soundCard1SampleRate   = pConfig->Read(wxT("/Audio/soundCard1SampleRate"),          -1);
+
+    g_soundCard2InDeviceNum  = pConfig->Read(wxT("/Audio/soundCard2InDeviceNum"),         -1);
+    g_soundCard2OutDeviceNum = pConfig->Read(wxT("/Audio/soundCard2OutDeviceNum"),        -1);
+    g_soundCard2SampleRate   = pConfig->Read(wxT("/Audio/soundCard2SampleRate"),          -1);
+
+    g_nSoundCards = 0;
+    if ((g_soundCard1InDeviceNum > -1) && (g_soundCard1OutDeviceNum > -1)) {
+        g_nSoundCards = 1;
+        if ((g_soundCard2InDeviceNum > -1) && (g_soundCard2OutDeviceNum > -1))
+            g_nSoundCards = 2;
+    }
+
+    wxGetApp().m_playFileToMicInPath = pConfig->Read("/File/playFileToMicInPath",   wxT(""));
+    wxGetApp().m_recFileFromRadioPath = pConfig->Read("/File/recFileFromRadioPath", wxT(""));
+    wxGetApp().m_recFileFromRadioSecs = pConfig->Read("/File/recFileFromRadioSecs", 30);
+    wxGetApp().m_playFileFromRadioPath = pConfig->Read("/File/playFileFromRadioPath", wxT(""));
+
+    // PTT -------------------------------------------------------------------
+
+    wxGetApp().m_boolHalfDuplex     = pConfig->ReadBool(wxT("/Rig/HalfDuplex"),     true);
+    wxGetApp().m_leftChannelVoxTone = pConfig->ReadBool("/Rig/leftChannelVoxTone",  false);
+    wxGetApp().m_boolHamlibUseForPTT = pConfig->ReadBool("/Hamlib/UseForPTT", false);
+    wxGetApp().m_intHamlibRig = pConfig->ReadLong("/Hamlib/RigName", 0);
+    wxGetApp().m_strHamlibSerialPort = pConfig->Read("/Hamlib/SerialPort", "");
+    
+    wxGetApp().m_boolUseSerialPTT   = pConfig->ReadBool(wxT("/Rig/UseSerialPTT"),   false);
+    wxGetApp().m_strRigCtrlPort     = pConfig->Read(wxT("/Rig/Port"),               wxT(""));
+    wxGetApp().m_boolUseRTS         = pConfig->ReadBool(wxT("/Rig/UseRTS"),         true);
+    wxGetApp().m_boolRTSPos         = pConfig->ReadBool(wxT("/Rig/RTSPolarity"),    true);
+    wxGetApp().m_boolUseDTR         = pConfig->ReadBool(wxT("/Rig/UseDTR"),         false);
+    wxGetApp().m_boolDTRPos         = pConfig->ReadBool(wxT("/Rig/DTRPolarity"),    false);
+    com_handle = COM_HANDLE_INVALID;
+
+    // -----------------------------------------------------------------------
+
+    bool slow = false; // prevents compile error when using default bool
+    wxGetApp().m_snrSlow = pConfig->Read("/Audio/snrSlow", slow);
+
+    bool t = true;     // prevents compile error when using default bool
+    wxGetApp().m_codec2LPCPostFilterEnable     = pConfig->Read(wxT("/Filter/codec2LPCPostFilterEnable"),    t);
+    wxGetApp().m_codec2LPCPostFilterBassBoost  = pConfig->Read(wxT("/Filter/codec2LPCPostFilterBassBoost"), t);
+    wxGetApp().m_codec2LPCPostFilterGamma      = (float)pConfig->Read(wxT("/Filter/codec2LPCPostFilterGamma"),     CODEC2_LPC_PF_GAMMA*100)/100.0;
+    wxGetApp().m_codec2LPCPostFilterBeta       = (float)pConfig->Read(wxT("/Filter/codec2LPCPostFilterBeta"),      CODEC2_LPC_PF_BETA*100)/100.0;
+    //printf("main(): m_codec2LPCPostFilterBeta: %f\n", wxGetApp().m_codec2LPCPostFilterBeta);
+
+    wxGetApp().m_speexpp_enable     = pConfig->Read(wxT("/Filter/speexpp_enable"),    t);
+
+    wxGetApp().m_MicInBassFreqHz = (float)pConfig->Read(wxT("/Filter/MicInBassFreqHz"),    1);
+    wxGetApp().m_MicInBassGaindB = (float)pConfig->Read(wxT("/Filter/MicInBassGaindB"),    (long)0)/10.0;
+    wxGetApp().m_MicInTrebleFreqHz = (float)pConfig->Read(wxT("/Filter/MicInTrebleFreqHz"),    1);
+    wxGetApp().m_MicInTrebleGaindB = (float)pConfig->Read(wxT("/Filter/MicInTrebleGaindB"),    (long)0)/10.0;
+    wxGetApp().m_MicInMidFreqHz = (float)pConfig->Read(wxT("/Filter/MicInMidFreqHz"),    1);
+    wxGetApp().m_MicInMidGaindB = (float)pConfig->Read(wxT("/Filter/MicInMidGaindB"),    (long)0)/10.0;
+    wxGetApp().m_MicInMidQ = (float)pConfig->Read(wxT("/Filter/MicInMidQ"),              (long)100)/100.0;
+
+    bool f = false;
+    wxGetApp().m_MicInEQEnable = (float)pConfig->Read(wxT("/Filter/MicInEQEnable"), f);
+
+    wxGetApp().m_SpkOutBassFreqHz = (float)pConfig->Read(wxT("/Filter/SpkOutBassFreqHz"),    1);
+    wxGetApp().m_SpkOutBassGaindB = (float)pConfig->Read(wxT("/Filter/SpkOutBassGaindB"),    (long)0)/10.0;
+    wxGetApp().m_SpkOutTrebleFreqHz = (float)pConfig->Read(wxT("/Filter/SpkOutTrebleFreqHz"),    1);
+    wxGetApp().m_SpkOutTrebleGaindB = (float)pConfig->Read(wxT("/Filter/SpkOutTrebleGaindB"),    (long)0)/10.0;
+    wxGetApp().m_SpkOutMidFreqHz = (float)pConfig->Read(wxT("/Filter/SpkOutMidFreqHz"),    1);
+    wxGetApp().m_SpkOutMidGaindB = (float)pConfig->Read(wxT("/Filter/SpkOutMidGaindB"),    (long)0)/10.0;
+    wxGetApp().m_SpkOutMidQ = (float)pConfig->Read(wxT("/Filter/SpkOutMidQ"),                (long)100)/100.0;
+
+    wxGetApp().m_SpkOutEQEnable = (float)pConfig->Read(wxT("/Filter/SpkOutEQEnable"), f);
+
+    wxGetApp().m_callSign = pConfig->Read("/Data/CallSign", wxT(""));
+    wxGetApp().m_textEncoding = pConfig->Read("/Data/TextEncoding", 1);
+    wxGetApp().m_enable_checksum = pConfig->Read("/Data/EnableChecksumOnMsgRx", f);
+
+    wxGetApp().m_events = pConfig->Read("/Events/enable", f);
+    wxGetApp().m_events_spam_timer = (int)pConfig->Read(wxT("/Events/spam_timer"), 10);
+    wxGetApp().m_events_regexp_match = pConfig->Read("/Events/regexp_match", wxT("s=(.*)"));
+    wxGetApp().m_events_regexp_replace = pConfig->Read("/Events/regexp_replace", 
+                                                       wxT("curl http://qso.freedv.org/cgi-bin/onspot.cgi?s=\\1"));
+    // make sure regexp lists are terminated by a \n
+
+    if (wxGetApp().m_events_regexp_match.Last() != '\n') {
+        wxGetApp().m_events_regexp_match = wxGetApp().m_events_regexp_match+'\n';
+    }
+    if (wxGetApp().m_events_regexp_replace.Last() != '\n') {
+        wxGetApp().m_events_regexp_replace = wxGetApp().m_events_regexp_replace+'\n';
+    }
+
+    wxGetApp().m_udp_enable = (float)pConfig->Read(wxT("/UDP/enable"), f);
+    wxGetApp().m_udp_port = (int)pConfig->Read(wxT("/UDP/port"), 3000);
+
+    wxGetApp().m_FreeDV700txClip = (float)pConfig->Read(wxT("/FreeDV700/txClip"), t);
+
+    int mode  = pConfig->Read(wxT("/Audio/mode"), (long)0);
+    if (mode == 0)
+        m_rb1600->SetValue(1);
+    if (mode == 1)
+        m_rb700->SetValue(1);
+        
+    pConfig->SetPath(wxT("/"));
+
+//    this->Connect(m_menuItemHelpUpdates->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnHelpCheckUpdatesUI));
+    //m_togRxID->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnRxIDUI), NULL, this);
+    //m_togTxID->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnTxIDUI), NULL, this);
+    m_togBtnOnOff->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnOnOffUI), NULL, this);
+    m_togBtnSplit->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnSplitClickUI), NULL, this);
+    m_togBtnAnalog->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnAnalogClickUI), NULL, this);
+    //m_togBtnALC->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnALCClickUI), NULL, this);
+   // m_btnTogPTT->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnPTT_UI), NULL, this);
+
+    m_togBtnSplit->Disable();
+    //m_togRxID->Disable();
+    //m_togTxID->Disable();
+    m_togBtnAnalog->Disable();
+    m_btnTogPTT->Disable();
+    //m_togBtnALC->Disable();
+
+    // squelch settings
+    char sqsnr[15];
+    m_sliderSQ->SetValue((int)((g_SquelchLevel+5.0)*2.0));
+    sprintf(sqsnr, "%4.1f", g_SquelchLevel);
+    wxString sqsnr_string(sqsnr);
+    m_textSQ->SetLabel(sqsnr_string);
+    m_ckboxSQ->SetValue(g_SquelchActive);
+
+    // SNR settings
+
+    m_ckboxSNR->SetValue(wxGetApp().m_snrSlow);
+    setsnrBeta(wxGetApp().m_snrSlow);
+
+#ifdef _USE_TIMER
+    Bind(wxEVT_TIMER, &MainFrame::OnTimer, this);       // ID_MY_WINDOW);
+    m_plotTimer.SetOwner(this, ID_TIMER_WATERFALL);
+    //m_panelWaterfall->Refresh();
+#endif
+
+    m_RxRunning = false;
+
+#ifdef _USE_ONIDLE
+    Connect(wxEVT_IDLE, wxIdleEventHandler(MainFrame::OnIdle), NULL, this);
+#endif //_USE_ONIDLE
+
+    g_sfPlayFile = NULL;
+    g_playFileToMicIn = false;
+    g_loopPlayFileToMicIn = false;
+
+    g_sfRecFile = NULL;
+    g_recFileFromRadio = false;
+
+    g_sfPlayFileFromRadio = NULL;
+    g_playFileFromRadio = false;
+    g_loopPlayFileFromRadio = false;
+
+    // init click-tune states
+
+    g_RxFreqOffsetHz = 0.0;
+    g_RxFreqOffsetPhaseRect.real = cos(0.0);
+    g_RxFreqOffsetPhaseRect.imag = sin(0.0);
+    m_panelWaterfall->setRxFreq(FDMDV_FCENTRE - g_RxFreqOffsetHz);
+    m_panelSpectrum->setRxFreq(FDMDV_FCENTRE - g_RxFreqOffsetHz);
+
+    g_TxFreqOffsetHz = 0.0;
+    g_TxFreqOffsetPhaseRect.real = cos(0.0);
+    g_TxFreqOffsetPhaseRect.imag = sin(0.0);
+
+    g_tx = 0;
+    g_split = 0;
+
+    // data states
+    g_txDataInFifo = fifo_create(MAX_CALLSIGN*VARICODE_MAX_BITS);
+    g_rxDataOutFifo = fifo_create(MAX_CALLSIGN*VARICODE_MAX_BITS);
+
+    sox_biquad_start();
+    golay23_init();
+
+    g_testFrames = 0;
+    g_test_frame_sync_state = 0;
+    g_total_bit_errors = 0;
+    g_total_bits = 0;
+    wxGetApp().m_testFrames = false;
+
+    g_modal = false;
+
+    // Start UDP listener thread
+
+    m_UDPThread = NULL;
+    startUDPThread();
+
+    optionsDlg = new OptionsDlg(NULL);
+    m_schedule_restore = false;
+
+}
+
+//-------------------------------------------------------------------------
+// ~MainFrame()
+//-------------------------------------------------------------------------
+MainFrame::~MainFrame()
+{
+    int x;
+    int y;
+    int w;
+    int h;
+
+    //fclose(ft);
+    #ifdef __WXMSW__
+    fclose(g_logfile);
+    #endif
+
+    if (optionsDlg != NULL) {
+        delete optionsDlg;
+        optionsDlg = NULL;
+    }
+
+    stopUDPThread();
+
+    /* TOOD(Joel): the ownership of m_hamlib is probably wrong. */
+    if (wxGetApp().m_hamlib) delete wxGetApp().m_hamlib;
+
+    //MainApp *pApp = wxGetApp();
+    wxConfigBase *pConfig = wxConfigBase::Get();
+    if(pConfig)
+    {
+        if (!IsIconized()) {
+            GetClientSize(&w, &h);
+
+            // big hack - for some reason height shrinks by this much
+            // every time FreeDV runs!  I have no idea why
+
+            h += 23;
+
+            GetPosition(&x, &y);
+            printf("x = %d y = %d w = %d h = %d\n", x,y,w,h);
+            pConfig->Write(wxT("/MainFrame/left"),               (long) x);
+            pConfig->Write(wxT("/MainFrame/top"),                (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("/MainFrame/show_speech_in"),    wxGetApp().m_show_speech_in);
+        pConfig->Write(wxT("/MainFrame/show_speech_out"),   wxGetApp().m_show_speech_out);
+        pConfig->Write(wxT("/MainFrame/show_demod_in"),     wxGetApp().m_show_demod_in);
+        pConfig->Write(wxT("/MainFrame/show_test_frame_errors"), wxGetApp().m_show_test_frame_errors);
+        pConfig->Write(wxT("/MainFrame/show_test_frame_errors_hist"), wxGetApp().m_show_test_frame_errors_hist);
+
+        pConfig->Write(wxT("/MainFrame/rxNbookCtrl"), wxGetApp().m_rxNbookCtrl);
+
+        pConfig->Write(wxT("/Audio/SquelchActive"),         g_SquelchActive);
+        pConfig->Write(wxT("/Audio/SquelchLevel"),          (int)(g_SquelchLevel*2.0));
+
+        pConfig->Write(wxT("/Audio/framesPerBuffer"),       wxGetApp().m_framesPerBuffer);
+
+        pConfig->Write(wxT("/Audio/soundCard1InDeviceNum"),   g_soundCard1InDeviceNum);
+        pConfig->Write(wxT("/Audio/soundCard1OutDeviceNum"),  g_soundCard1OutDeviceNum);
+        pConfig->Write(wxT("/Audio/soundCard1SampleRate"),    g_soundCard1SampleRate );
+
+        pConfig->Write(wxT("/Audio/soundCard2InDeviceNum"),   g_soundCard2InDeviceNum);
+        pConfig->Write(wxT("/Audio/soundCard2OutDeviceNum"),  g_soundCard2OutDeviceNum);
+        pConfig->Write(wxT("/Audio/soundCard2SampleRate"),    g_soundCard2SampleRate );
+
+        pConfig->Write(wxT("/Rig/HalfDuplex"),              wxGetApp().m_boolHalfDuplex);
+        pConfig->Write(wxT("/Rig/leftChannelVoxTone"),      wxGetApp().m_leftChannelVoxTone);
+        pConfig->Write("/Hamlib/UseForPTT", wxGetApp().m_boolHamlibUseForPTT);
+        pConfig->Write("/Hamlib/RigName", wxGetApp().m_intHamlibRig);
+        pConfig->Write("/Hamlib/SerialPort", wxGetApp().m_strHamlibSerialPort);
+
+
+        pConfig->Write(wxT("/File/playFileToMicInPath"),    wxGetApp().m_playFileToMicInPath);
+        pConfig->Write(wxT("/File/recFileFromRadioPath"),   wxGetApp().m_recFileFromRadioPath);
+        pConfig->Write(wxT("/File/recFileFromRadioSecs"),   wxGetApp().m_recFileFromRadioSecs);
+        pConfig->Write(wxT("/File/playFileFromRadioPath"),  wxGetApp().m_playFileFromRadioPath);
+
+        pConfig->Write(wxT("/Audio/snrSlow"), wxGetApp().m_snrSlow);
+
+        pConfig->Write(wxT("/Data/CallSign"), wxGetApp().m_callSign);
+        pConfig->Write(wxT("/Data/TextEncoding"), wxGetApp().m_textEncoding);
+        pConfig->Write(wxT("/Data/EnableChecksumOnMsgRx"), wxGetApp().m_enable_checksum);
+        pConfig->Write(wxT("/Events/enable"), wxGetApp().m_events);
+        pConfig->Write(wxT("/Events/spam_timer"), wxGetApp().m_events_spam_timer);
+        pConfig->Write(wxT("/Events/regexp_match"), wxGetApp().m_events_regexp_match);
+        pConfig->Write(wxT("/Events/regexp_replace"), wxGetApp().m_events_regexp_replace);
+        pConfig->Write(wxT("/UDP/enable"), wxGetApp().m_udp_enable);
+        pConfig->Write(wxT("/UDP/port"),  wxGetApp().m_udp_port);
+
+        pConfig->Write(wxT("/Filter/MicInEQEnable"), wxGetApp().m_MicInEQEnable);
+        pConfig->Write(wxT("/Filter/SpkOutEQEnable"), wxGetApp().m_SpkOutEQEnable);
+
+        pConfig->Write(wxT("/FreeDV700/txClip"), wxGetApp().m_FreeDV700txClip);
+
+        int mode;
+        if (m_rb1600->GetValue())
+            mode = 0;
+        if (m_rb700->GetValue())
+            mode = 1;
+        pConfig->Write(wxT("/Audio/mode"), mode);
+    }
+
+    //m_togRxID->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnRxIDUI), NULL, this);
+    //m_togTxID->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnTxIDUI), NULL, this);
+    m_togBtnOnOff->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnOnOffUI), NULL, this);
+    m_togBtnSplit->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnSplitClickUI), NULL, this);
+    m_togBtnAnalog->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnAnalogClickUI), NULL, this);
+    //m_togBtnALC->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnALCClickUI), NULL, this);
+    //m_btnTogPTT->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnPTT_UI), NULL, this);
+
+    sox_biquad_finish();
+
+    if (m_RxRunning)
+    {
+        stopRxStream();
+    }
+    if (g_sfPlayFile != NULL)
+    {
+        sf_close(g_sfPlayFile);
+        g_sfPlayFile = NULL;
+    }
+    if (g_sfRecFile != NULL)
+    {
+        sf_close(g_sfRecFile);
+        g_sfRecFile = NULL;
+    }
+#ifdef _USE_TIMER
+    if(m_plotTimer.IsRunning())
+    {
+        m_plotTimer.Stop();
+        Unbind(wxEVT_TIMER, &MainFrame::OnTimer, this);
+    }
+#endif //_USE_TIMER
+
+#ifdef _USE_ONIDLE
+    Disconnect(wxEVT_IDLE, wxIdleEventHandler(MainFrame::OnIdle), NULL, this);
+#endif // _USE_ONIDLE
+
+    delete wxConfigBase::Set((wxConfigBase *) NULL);
+}
+
+//----------------------------------------------------------------
+// closeComPort() closes the currently open com port
+//----------------------------------------------------------------
+void MainFrame::closeComPort(void)
+{
+#ifdef _WIN32
+       CloseHandle(com_handle);
+#else
+       close(com_handle);
+#endif
+       com_handle = COM_HANDLE_INVALID;
+}
+
+//----------------------------------------------------------------
+// openComPort() opens the com port specified by the string
+// ie: "COM1" on Windows or "/dev/ttyu0" on FreeBSD
+//----------------------------------------------------------------
+bool MainFrame::openComPort(const char *name)
+{
+       if(com_handle != COM_HANDLE_INVALID)
+               closeComPort();
+#ifdef _WIN32
+       {
+               COMMCONFIG CC;
+               DWORD CCsize=sizeof(CC);
+               COMMTIMEOUTS timeouts;
+               DCB     dcb;
+
+               if(GetDefaultCommConfigA(name, &CC, &CCsize)) {
+                       CC.dcb.fOutxCtsFlow             = FALSE;
+                       CC.dcb.fOutxDsrFlow             = FALSE;
+                       CC.dcb.fDtrControl              = DTR_CONTROL_DISABLE;
+                       CC.dcb.fDsrSensitivity  = FALSE;
+                       CC.dcb.fRtsControl              = RTS_CONTROL_DISABLE;
+                       SetDefaultCommConfigA(name, &CC, CCsize);
+               }
+
+               if((com_handle=CreateFileA(name
+                       ,GENERIC_READ|GENERIC_WRITE     /* Access */
+                       ,0                                                              /* Share mode */
+                       ,NULL                                                   /* Security attributes */
+                       ,OPEN_EXISTING                                  /* Create access */
+                       ,FILE_ATTRIBUTE_NORMAL                  /* File attributes */
+                       ,NULL                                                   /* Template */
+                       ))==INVALID_HANDLE_VALUE)
+                       return false;
+
+               if(GetCommTimeouts(com_handle, &timeouts)) {
+                       timeouts.ReadIntervalTimeout=MAXDWORD;
+                       timeouts.ReadTotalTimeoutMultiplier=0;
+                       timeouts.ReadTotalTimeoutConstant=0;            // No-wait read timeout
+                       timeouts.WriteTotalTimeoutMultiplier=0;
+                       timeouts.WriteTotalTimeoutConstant=5000;        // 5 seconds
+                       SetCommTimeouts(com_handle,&timeouts);
+               }
+
+               /* Force N-8-1 mode: */
+               if(GetCommState(com_handle, &dcb)==TRUE) {
+                       dcb.ByteSize            = 8;
+                       dcb.Parity                      = NOPARITY;
+                       dcb.StopBits            = ONESTOPBIT;
+                       dcb.DCBlength           = sizeof(DCB);
+                       dcb.fBinary                     = TRUE;
+                       dcb.fOutxCtsFlow        = FALSE;
+                       dcb.fOutxDsrFlow        = FALSE;
+                       dcb.fDtrControl         = DTR_CONTROL_DISABLE;
+                       dcb.fDsrSensitivity     = FALSE;
+                       dcb.fTXContinueOnXoff= TRUE;
+                       dcb.fOutX                       = FALSE;
+                       dcb.fInX                        = FALSE;
+                       dcb.fRtsControl         = RTS_CONTROL_DISABLE;
+                       dcb.fAbortOnError       = FALSE;
+                       SetCommState(com_handle, &dcb);
+               }
+       }
+#else
+       {
+               struct termios t;
+
+               if((com_handle=open(name, O_NONBLOCK|O_RDWR))==COM_HANDLE_INVALID)
+                       return false;
+
+               if(tcgetattr(com_handle, &t)==-1) {
+                       close(com_handle);
+                       com_handle = COM_HANDLE_INVALID;
+                       return false;
+               }
+
+               t.c_iflag = (
+                                         IGNBRK   /* ignore BREAK condition */
+                                       | IGNPAR   /* ignore (discard) parity errors */
+                                       );
+               t.c_oflag = 0;  /* No output processing */
+               t.c_cflag = (
+                                         CS8         /* 8 bits */
+                                       | CREAD       /* enable receiver */
+               /*
+               Fun snippet from the FreeBSD manpage:
+
+                        If CREAD is set, the receiver is enabled.  Otherwise, no character is
+                        received.  Not all hardware supports this bit.  In fact, this flag is
+                        pretty silly and if it were not part of the termios specification it
+                        would be omitted.
+               */
+                                       | CLOCAL      /* ignore modem status lines */
+                                       );
+               t.c_lflag = 0;  /* No local modes */
+               if(tcsetattr(com_handle, TCSANOW, &t)==-1) {
+                       close(com_handle);
+                       com_handle = COM_HANDLE_INVALID;
+                       return false;
+               }
+               
+       }
+#endif
+       return true;
+}
+
+#ifdef _USE_ONIDLE
+void MainFrame::OnIdle(wxIdleEvent &evt) {
+}
+#endif
+
+//----------------------------------------------------------------
+// (raise|lower)(RTS|DTR)()
+//
+// Raises/lowers the specified signal
+//----------------------------------------------------------------
+void MainFrame::raiseDTR(void)
+{
+       if(com_handle == COM_HANDLE_INVALID)
+               return;
+#ifdef _WIN32
+       EscapeCommFunction(com_handle, SETDTR);
+#else
+       {       // For C89 happiness
+               int flags = TIOCM_DTR;
+               ioctl(com_handle, TIOCMBIS, &flags);
+       }
+#endif
+}
+void MainFrame::raiseRTS(void)
+{
+       if(com_handle == COM_HANDLE_INVALID)
+               return;
+#ifdef _WIN32
+       EscapeCommFunction(com_handle, SETRTS);
+#else
+       {       // For C89 happiness
+               int flags = TIOCM_RTS;
+               ioctl(com_handle, TIOCMBIS, &flags);
+       }
+#endif
+}
+void MainFrame::lowerDTR(void)
+{
+       if(com_handle == COM_HANDLE_INVALID)
+               return;
+#ifdef _WIN32
+       EscapeCommFunction(com_handle, CLRDTR);
+#else
+       {       // For C89 happiness
+               int flags = TIOCM_DTR;
+               ioctl(com_handle, TIOCMBIC, &flags);
+       }
+#endif
+}
+void MainFrame::lowerRTS(void)
+{
+       if(com_handle == COM_HANDLE_INVALID)
+               return;
+#ifdef _WIN32
+       EscapeCommFunction(com_handle, CLRRTS);
+#else
+       {       // For C89 happiness
+               int flags = TIOCM_RTS;
+               ioctl(com_handle, TIOCMBIC, &flags);
+       }
+#endif
+}
+
+
+#ifdef _USE_TIMER
+//----------------------------------------------------------------
+// OnTimer()
+//
+// when the timer fires every DT seconds we update the GUI displays.
+// the tabs only the plot that is visible actually gets updated, this
+// keeps CPU load reasonable
+//----------------------------------------------------------------
+void MainFrame::OnTimer(wxTimerEvent &evt)
+{
+
+    int r,c;
+
+    if (m_panelWaterfall->checkDT()) {
+        m_panelWaterfall->setRxFreq(FDMDV_FCENTRE - g_RxFreqOffsetHz);
+        m_panelWaterfall->m_newdata = true;
+        m_panelWaterfall->Refresh();
+    }
+
+    m_panelSpectrum->setRxFreq(FDMDV_FCENTRE - g_RxFreqOffsetHz);
+    m_panelSpectrum->m_newdata = true;
+    m_panelSpectrum->Refresh();
+
+    /* update scatter plot -----------------------------------------------------------------*/
+
+    for (r=0; r<g_stats.nr; r++) {
+        
+        if (g_pfreedv->mode == FREEDV_MODE_1600) {
+            m_panelScatter->add_new_samples(&g_stats.rx_symbols[r][0]);
+        }
+
+        if (g_pfreedv->mode == FREEDV_MODE_700) {
+
+            /* 
+               FreeDV 700 uses diversity, so combine symbols for
+               scatter plot, as combined symbols are used for
+               demodulation.  Note we need to use a copy of the
+               symbols, as we are not sure when the stats will be
+               updated.
+            */
+
+            COMP rx_symbols_copy[g_Nc/2];
+
+            for(c=0; c<g_Nc/2; c++)
+                rx_symbols_copy[c] = cadd(g_stats.rx_symbols[r][c], g_stats.rx_symbols[r][c+g_Nc/2]);
+            m_panelScatter->add_new_samples(rx_symbols_copy);
+        }
+       
+    }
+
+    m_panelScatter->Refresh();
+
+    // Oscilliscope type speech plots -------------------------------------------------------
+
+    short speechInPlotSamples[WAVEFORM_PLOT_BUF];
+    if (fifo_read(g_plotSpeechInFifo, speechInPlotSamples, WAVEFORM_PLOT_BUF)) {
+        memset(speechInPlotSamples, 0, WAVEFORM_PLOT_BUF*sizeof(short));
+        //fprintf(stderr, "empty!\n");
+    }
+    m_panelSpeechIn->add_new_short_samples(0, speechInPlotSamples, WAVEFORM_PLOT_BUF, 32767);
+    m_panelSpeechIn->Refresh();
+
+    short speechOutPlotSamples[WAVEFORM_PLOT_BUF];
+    if (fifo_read(g_plotSpeechOutFifo, speechOutPlotSamples, WAVEFORM_PLOT_BUF))
+        memset(speechOutPlotSamples, 0, WAVEFORM_PLOT_BUF*sizeof(short));
+    m_panelSpeechOut->add_new_short_samples(0, speechOutPlotSamples, WAVEFORM_PLOT_BUF, 32767);
+    m_panelSpeechOut->Refresh();
+
+    short demodInPlotSamples[WAVEFORM_PLOT_BUF];
+    if (fifo_read(g_plotDemodInFifo, demodInPlotSamples, WAVEFORM_PLOT_BUF)) {
+        memset(demodInPlotSamples, 0, WAVEFORM_PLOT_BUF*sizeof(short));
+    }
+    m_panelDemodIn->add_new_short_samples(0,demodInPlotSamples, WAVEFORM_PLOT_BUF, 32767);
+    m_panelDemodIn->Refresh();
+
+    // Demod states -----------------------------------------------------------------------
+
+    m_panelTimeOffset->add_new_sample(0, (float)g_stats.rx_timing/FDMDV_NOM_SAMPLES_PER_FRAME);
+    m_panelTimeOffset->Refresh();
+
+    m_panelFreqOffset->add_new_sample(0, g_stats.foff);
+    m_panelFreqOffset->Refresh();
+
+    // SNR text box and gauge ------------------------------------------------------------
+
+    // LP filter g_stats.snr_est some more to stabilise the
+    // display. g_stats.snr_est already has some low pass filtering
+    // but we need it fairly fast to activate squelch.  So we
+    // optionally perform some further filtering for the display
+    // version of SNR.  The "Slow" checkbox controls the amount of
+    // filtering.  The filtered snr also controls the squelch
+
+    g_snr = m_snrBeta*g_snr + (1.0 - m_snrBeta)*g_stats.snr_est;
+    float snr_limited = g_snr;
+    if (snr_limited < -5.0) snr_limited = -5.0;
+    if (snr_limited > 20.0) snr_limited = 20.0;
+
+    char snr[15];
+    sprintf(snr, "%d", (int)(g_snr+0.5)); // round to nearest dB
+
+    //printf("snr_est: %f m_snrBeta: %f g_snr: %f snr_limited: %f\n", g_stats.snr_est,  m_snrBeta, g_snr, snr_limited);
+
+    wxString snr_string(snr);
+    m_textSNR->SetLabel(snr_string);
+    m_gaugeSNR->SetValue((int)(snr_limited+5));
+
+    // Level Gauge -----------------------------------------------------------------------
+
+    float tooHighThresh;
+    if (!g_tx && m_RxRunning)
+    {
+        // receive mode - display From Radio peaks
+        // peak from this DT sampling period
+        int maxDemodIn = 0;
+        for(int i=0; i<WAVEFORM_PLOT_BUF; i++)
+            if (maxDemodIn < abs(demodInPlotSamples[i]))
+                maxDemodIn = abs(demodInPlotSamples[i]);
+
+        // peak from last second
+        if (maxDemodIn > m_maxLevel)
+            m_maxLevel = maxDemodIn;
+
+        tooHighThresh = FROM_RADIO_MAX;
+    }
+    else
+    {
+        // transmit mode - display From Mic peaks
+
+        // peak from this DT sampling period
+        int maxSpeechIn = 0;
+        for(int i=0; i<WAVEFORM_PLOT_BUF; i++)
+            if (maxSpeechIn < abs(speechInPlotSamples[i]))
+                maxSpeechIn = abs(speechInPlotSamples[i]);
+
+        // peak from last second
+        if (maxSpeechIn > m_maxLevel)
+            m_maxLevel = maxSpeechIn;
+
+       tooHighThresh = FROM_MIC_MAX;
+    }
+
+    // Peak Reading meter: updates peaks immediately, then slowly decays
+    int maxScaled = (int)(100.0 * ((float)m_maxLevel/32767.0));
+    m_gaugeLevel->SetValue(maxScaled);
+    //printf("maxScaled: %d\n", maxScaled);
+    if (((float)maxScaled/100) > tooHighThresh)
+        m_textLevel->SetLabel("Too High");
+    else
+        m_textLevel->SetLabel("");
+
+    m_maxLevel *= LEVEL_BETA;
+
+    // sync LED (Colours don't work on Windows) ------------------------
+
+    if (g_State) {
+        m_rbSync->SetForegroundColour( wxColour( 0, 255, 0 ) ); // green
+        m_rbSync->SetValue(true);
+    }
+    else {
+        m_rbSync->SetForegroundColour( wxColour( 255, 0, 0 ) ); // red
+        m_rbSync->SetValue(false);
+    }
+
+    // send Callsign ----------------------------------------------------
+
+    char callsign[MAX_CALLSIGN];
+    strncpy(callsign, (const char*) wxGetApp().m_callSign.mb_str(wxConvUTF8), MAX_CALLSIGN-1);
+
+    // buffer 1 txt message to ensure tx data fifo doesn't "run dry"
+
+    if ((unsigned)fifo_used(g_txDataInFifo) < strlen(callsign)) {
+        unsigned int  i;
+
+        //fprintf(g_logfile, "tx callsign: %s.\n", callsign);
+
+        /* optionally append checksum */
+
+        if (wxGetApp().m_enable_checksum) {
+
+            unsigned char checksum = 0;
+            char callsign_checksum_cr[MAX_CALLSIGN+1];
+
+            for(i=0; i<strlen(callsign); i++)
+                checksum += callsign[i];
+            sprintf(callsign_checksum_cr, "%s%2x", callsign, checksum);
+            callsign_checksum_cr[strlen(callsign)+2] = 13;
+            callsign_checksum_cr[strlen(callsign)+3] = 0;
+            strcpy(callsign, callsign_checksum_cr);
+        }
+        else {
+            callsign[strlen(callsign)] = 13;
+            callsign[strlen(callsign)+1] = 0;
+        }
+
+        //fprintf(g_logfile, "tx callsign: %s.\n", callsign);
+
+        // write chars to tx data fifo
+
+        for(i=0; i<strlen(callsign); i++) {
+            short ashort = (short)callsign[i];
+            fifo_write(g_txDataInFifo, &ashort, 1);
+        }
+    }
+
+    // See if any Callsign info received --------------------------------
+
+    short ashort;
+    while (fifo_read(g_rxDataOutFifo, &ashort, 1) == 0) {
+
+        if ((ashort == 13) || ((m_pcallsign - m_callsign) > MAX_CALLSIGN-1)) {
+            // CR completes line
+            *m_pcallsign = 0;
+            
+            /* Checksums can be disabled, e.g. for compatability with
+               older vesions.  In that case we print msg but don't do
+               any event processing.  If checksums enabled, only print
+               out when checksum is good. */
+
+            if (wxGetApp().m_enable_checksum) {
+                // lets see if checksum is OK
+            
+                unsigned char checksum_rx = 0;
+                if (strlen(m_callsign) > 2) {
+                    for(unsigned int i=0; i<strlen(m_callsign)-2; i++)
+                        checksum_rx += m_callsign[i];
+                }
+                unsigned int checksum_tx;
+                int ret = sscanf(&m_callsign[strlen(m_callsign)-2], "%2x", &checksum_tx);
+                //fprintf(g_logfile, "rx callsign: %s.\n  checksum tx: %02x checksum rx: %02x\n", m_callsign, checksum_tx, checksum_rx);
+
+                wxString s;
+                if (ret && (checksum_tx == checksum_rx)) {
+                    m_callsign[strlen(m_callsign)-2] = 0;
+                    s.Printf("%s", m_callsign);
+                    m_txtCtrlCallSign->SetValue(s);
+
+                    char s1[MAX_CALLSIGN];
+                    sprintf(s1,"rx_txtmsg %s", m_callsign);
+                    processTxtEvent(s1);
+
+                    m_checksumGood++;
+                    s.Printf("%d", m_checksumGood);
+                    m_txtChecksumGood->SetLabel(s);              
+                }
+                else {
+                    m_checksumBad++;
+                    s.Printf("%d", m_checksumBad);
+                    m_txtChecksumBad->SetLabel(s);        
+                }
+            }
+
+            //fprintf(g_logfile,"resetting callsign %s %ld\n", m_callsign, m_pcallsign-m_callsign);
+            // reset ptr to start of string
+            m_pcallsign = m_callsign;
+        }
+        else {
+            //fprintf(g_logfile, "new char %d %c\n", ashort, (char)ashort);
+            *m_pcallsign++ = (char)ashort;
+        }
+
+        /* If checksums disabled, display txt chars as they arrive */
+
+        if (!wxGetApp().m_enable_checksum) {
+            m_txtCtrlCallSign->SetValue(m_callsign);
+        }
+    }
+
+    // Run time update of EQ filters -----------------------------------
+    if (m_newMicInFilter || m_newSpkOutFilter) {
+        g_mutexProtectingCallbackData.Lock();
+        deleteEQFilters(g_rxUserdata);
+        designEQFilters(g_rxUserdata);
+        g_mutexProtectingCallbackData.Unlock();
+        m_newMicInFilter = m_newSpkOutFilter = false;
+    }
+    g_rxUserdata->micInEQEnable = wxGetApp().m_MicInEQEnable;
+    g_rxUserdata->spkOutEQEnable = wxGetApp().m_SpkOutEQEnable;
+
+    // Run time update of FreeDV 700 tx clipper
+
+    g_pfreedv->clip = (int)wxGetApp().m_FreeDV700txClip;
+
+    // Test Frame Bit Error Updates ------------------------------------
+
+    // Toggle test frame mode at run time
+
+    if (!g_pfreedv->test_frames && wxGetApp().m_testFrames) {
+
+        // reset stats on check box off to on transition
+
+        g_pfreedv->test_frames = 1;
+        g_pfreedv->test_frame_sync_state = 0;
+        g_pfreedv->total_bits = 0;
+        g_pfreedv->total_bit_errors = 0;
+    }
+    g_pfreedv->test_frames =  wxGetApp().m_testFrames;
+    g_channel_noise =  wxGetApp().m_channel_noise;
+
+    if (g_State) {
+        char bits[80], errors[80], ber[80];
+
+        // update stats on main page
+
+        sprintf(bits, "Bits: %d", (int)g_pfreedv->total_bits); wxString bits_string(bits); m_textBits->SetLabel(bits_string);
+        sprintf(errors, "Errs: %d", (int)g_pfreedv->total_bit_errors); wxString errors_string(errors); m_textErrors->SetLabel(errors_string);
+        float b = (float)g_pfreedv->total_bit_errors/(1E-6+g_pfreedv->total_bits);
+        sprintf(ber, "BER: %4.3f", b); wxString ber_string(ber); m_textBER->SetLabel(ber_string);
+
+        // update error plots
+
+        int sz_error_pattern = g_pfreedv->sz_error_pattern;
+        short error_pattern[sz_error_pattern];
+
+        if (fifo_read(g_error_pattern_fifo, error_pattern, sz_error_pattern) == 0) {
+            int i,b;
+
+            /* both modes map IQ to alternate bits, but one same carrier */
+
+            if (g_pfreedv->mode == FREEDV_MODE_1600) {
+                /* FreeDV 1600 mapping from error pattern to bit on each carrier */
+
+                for(b=0; b<g_Nc*2; b++) {
+                    for(i=b; i<sz_error_pattern; i+= 2*g_Nc) {
+                        m_panelTestFrameErrors->add_new_sample(b, b + 0.8*error_pattern[i]);
+                        g_error_hist[b] += error_pattern[i];
+                    }
+                    //if (b%2)
+                    //    printf("g_error_hist[%d]: %d\n", b/2, g_error_hist[b/2]);
+                }
+
+                int max_hist = 0;
+                for(b=0; b<g_Nc; b++)
+                    if (g_error_hist[b] > max_hist)
+                        max_hist = g_error_hist[b];
+
+                m_panelTestFrameErrorsHist->add_new_short_samples(0, g_error_hist, 2*FDMDV_NC_MAX, max_hist);
+            }
+       
+            if (g_pfreedv->mode == FREEDV_MODE_700) {
+                int c;
+
+                /* FreeDV 700 mapping from error pattern to bit on each
+                   carrier.  Note we don't have access to carriers before
+                   diversity re-combination, so this won't give us the full
+                   picture, we have to assume Nc/2 carriers. */
+
+                for(i=0; i<sz_error_pattern; i++) {
+                    c = i/4;
+                    m_panelTestFrameErrors->add_new_sample(c, c + 0.8*error_pattern[i]);
+                    g_error_hist[c] += error_pattern[i];
+                    //printf("i: %d c: %d\n", i, c);
+                }
+
+                int max_hist = 0;
+                for(b=0; b<g_Nc; b++)
+                    if (g_error_hist[b] > max_hist)
+                        max_hist = g_error_hist[b];
+                m_panelTestFrameErrorsHist->add_new_short_samples(0, g_error_hist, 2*FDMDV_NC_MAX, max_hist);                
+            }
+            m_panelTestFrameErrors->Refresh();       
+            m_panelTestFrameErrorsHist->Refresh();
+        }
+    }
+
+    // command from UDP thread that is best processed in main thread to avoid seg faults
+
+    if (m_schedule_restore) {
+        if (IsIconized())
+            Restore();
+        m_schedule_restore = false;
+    }
+
+    // Light Spam Timer LED if at least one timer is running
+
+    int i;
+    optionsDlg->SetSpamTimerLight(false);
+    for(i=0; i<MAX_EVENT_RULES; i++)
+        if (spamTimer[i].IsRunning())
+            optionsDlg->SetSpamTimerLight(true);        
+
+    // Blink file playback status line
+
+    if (g_playFileFromRadio) {
+        g_blink += DT;
+        //fprintf(g_logfile, "g_blink: %f\n", g_blink);
+        if ((g_blink >= 1.0) && (g_blink < 2.0))
+            SetStatusText(wxT("Playing into from radio"), 0);
+        if (g_blink >= 2.0) {
+            SetStatusText(wxT(""), 0);
+            g_blink = 0.0;
+        }
+    }
+
+}
+#endif
+
+
+//-------------------------------------------------------------------------
+// OnCloseFrame()
+//-------------------------------------------------------------------------
+void MainFrame::OnCloseFrame(wxCloseEvent& event)
+{
+    Pa_Terminate();
+    Destroy();
+}
+
+//-------------------------------------------------------------------------
+// OnTop()
+//-------------------------------------------------------------------------
+void MainFrame::OnTop(wxCommandEvent& event)
+{
+    int style = GetWindowStyle();
+
+    if (style & wxSTAY_ON_TOP)
+    {
+        style &= ~wxSTAY_ON_TOP;
+    }
+    else
+    {
+        style |= wxSTAY_ON_TOP;
+    }
+    SetWindowStyle(style);
+}
+
+//-------------------------------------------------------------------------
+// OnDeleteConfig()
+//-------------------------------------------------------------------------
+void MainFrame::OnDeleteConfig(wxCommandEvent&)
+{
+    wxConfigBase *pConfig = wxConfigBase::Get();
+    if(pConfig->DeleteAll())
+    {
+        wxLogMessage(wxT("Config file/registry key successfully deleted."));
+
+        delete wxConfigBase::Set(NULL);
+        wxConfigBase::DontCreateOnDemand();
+    }
+    else
+    {
+        wxLogError(wxT("Deleting config file/registry key failed."));
+    }
+}
+
+//-------------------------------------------------------------------------
+// Paint()
+//-------------------------------------------------------------------------
+void MainFrame::OnPaint(wxPaintEvent& WXUNUSED(event))
+{
+    wxPaintDC dc(this);
+
+    if(GetMenuBar()->IsChecked(ID_PAINT_BG))
+    {
+        dc.Clear();
+    }
+    dc.SetUserScale(m_zoom, m_zoom);
+}
+
+//-------------------------------------------------------------------------
+// OnCmdSliderScroll()
+//-------------------------------------------------------------------------
+void MainFrame::OnCmdSliderScroll(wxScrollEvent& event)
+{
+    char sqsnr[15];
+    g_SquelchLevel = (float)m_sliderSQ->GetValue()/2.0 - 5.0;   
+    sprintf(sqsnr, "%4.1f", g_SquelchLevel); // 0.5 dB steps
+    wxString sqsnr_string(sqsnr);
+    m_textSQ->SetLabel(sqsnr_string);
+
+    event.Skip();
+}
+
+//-------------------------------------------------------------------------
+// OnCheckSQClick()
+//-------------------------------------------------------------------------
+void MainFrame::OnCheckSQClick(wxCommandEvent& event)
+{
+    if(!g_SquelchActive)
+    {
+        g_SquelchActive = true;
+    }
+    else
+    {
+        g_SquelchActive = false;
+    }
+}
+
+void MainFrame::setsnrBeta(bool snrSlow)
+{
+    if(snrSlow)
+    {
+        m_snrBeta = 0.95; // make this closer to 1.0 to smooth SNR est further
+    }
+    else
+    {
+        m_snrBeta = 0.0; // no smoothing of SNR estimate from demodulator
+    }
+}
+
+//-------------------------------------------------------------------------
+// OnCheckSQClick()
+//-------------------------------------------------------------------------
+void MainFrame::OnCheckSNRClick(wxCommandEvent& event)
+{
+    wxGetApp().m_snrSlow = m_ckboxSNR->GetValue();
+    setsnrBeta(wxGetApp().m_snrSlow);
+    //printf("m_snrSlow: %d\n", (int)wxGetApp().m_snrSlow);
+}
+
+// check for space bar press (only when running)
+
+int MainApp::FilterEvent(wxEvent& event)
+{
+    if ((event.GetEventType() == wxEVT_KEY_DOWN) && 
+        (((wxKeyEvent&)event).GetKeyCode() == WXK_SPACE))
+        {
+            // only use space to toggle PTT if we are running and no modal dialogs (like options) up
+            //fprintf(stderr,"frame->m_RxRunning: %d g_modal: %d\n",
+            //        frame->m_RxRunning, g_modal);
+            if (frame->m_RxRunning && !g_modal) {
+                if (frame->m_btnTogPTT->GetValue())
+                    frame->m_btnTogPTT->SetValue(false);
+                else
+                    frame->m_btnTogPTT->SetValue(true);
+
+                frame->togglePTT();
+
+                return true; // absorb space so we don't toggle control with focus (e.g. Start)
+
+            }
+        }
+
+    return -1;
+}
+
+//-------------------------------------------------------------------------
+// OnTogBtnPTT ()
+//-------------------------------------------------------------------------
+void MainFrame::OnTogBtnPTT (wxCommandEvent& event)
+{
+    togglePTT();
+    event.Skip();
+}
+
+void MainFrame::togglePTT(void) {
+
+    // Change tabbed page in centre panel depending on PTT state
+
+    if (g_tx)
+    {
+        // tx-> rx transition, swap to the page we were on for last rx
+        m_auiNbookCtrl->ChangeSelection(wxGetApp().m_rxNbookCtrl);
+    }
+    else
+    {
+        // rx-> tx transition, swap to Mic In page to monitor speech
+        wxGetApp().m_rxNbookCtrl = m_auiNbookCtrl->GetSelection();
+        m_auiNbookCtrl->ChangeSelection(m_auiNbookCtrl->GetPageIndex((wxWindow *)m_panelSpeechIn));
+        char e[80]; sprintf(e,"ptt"); processTxtEvent(e);
+    }
+
+    g_tx = m_btnTogPTT->GetValue();
+
+    // Hamlib PTT
+
+    if (wxGetApp().m_boolHamlibUseForPTT) {        
+        Hamlib *hamlib = wxGetApp().m_hamlib; 
+        if (wxGetApp().m_boolHamlibUseForPTT && hamlib != NULL) {
+            hamlib->ptt(g_tx);
+        }
+    }
+
+    // Serial PTT
+
+    /*  Truth table:
+
+          g_tx   RTSPos   RTS
+          -------------------
+          0      1        0
+          1      1        1
+          0      0        1
+          1      0        0
+
+          exclusive NOR
+    */
+
+    if(wxGetApp().m_boolUseSerialPTT && (com_handle != COM_HANDLE_INVALID)) {
+        if (wxGetApp().m_boolUseRTS) {
+            printf("g_tx: %d m_boolRTSPos: %d serialLine: %d\n", g_tx, wxGetApp().m_boolRTSPos, g_tx == wxGetApp().m_boolRTSPos);
+            if (g_tx == wxGetApp().m_boolRTSPos)
+                raiseRTS();
+            else
+                lowerRTS();
+        }
+        if (wxGetApp().m_boolUseDTR) {
+            printf("g_tx: %d m_boolDTRPos: %d serialLine: %d\n", g_tx, wxGetApp().m_boolDTRPos, g_tx == wxGetApp().m_boolDTRPos);
+            if (g_tx == wxGetApp().m_boolDTRPos)
+                raiseDTR();
+            else
+                lowerDTR();
+        }
+    }
+
+    // reset level gauge
+
+    m_maxLevel = 0;
+    m_textLevel->SetLabel(wxT(""));
+    m_gaugeLevel->SetValue(0);
+}
+
+//-------------------------------------------------------------------------
+// OnTogBtnRxID()
+//-------------------------------------------------------------------------
+void MainFrame::OnTogBtnRxID(wxCommandEvent& event)
+{
+    // empty any junk in rx data FIFO
+    short junk;
+    while(fifo_read(g_rxDataOutFifo,&junk,1) == 0);
+    event.Skip();
+}
+
+//-------------------------------------------------------------------------
+// OnTogBtnTxID()
+//-------------------------------------------------------------------------
+void MainFrame::OnTogBtnTxID(wxCommandEvent& event)
+{
+    event.Skip();
+}
+
+void MainFrame::OnTogBtnSplitClick(wxCommandEvent& event) {
+    if (g_split)
+        g_split = 0;
+    else
+        g_split = 1;
+    event.Skip();
+}
+
+//-------------------------------------------------------------------------
+// OnTogBtnAnalogClick()
+//-------------------------------------------------------------------------
+void MainFrame::OnTogBtnAnalogClick (wxCommandEvent& event)
+{
+    if (g_analog == 0) {
+        g_analog = 1;
+        m_panelSpectrum->setFreqScale(MODEM_STATS_NSPEC*((float)MAX_F_HZ/(FS/2)));
+        m_panelWaterfall->setFs(FS);
+    }
+    else {
+        g_analog = 0;
+        m_panelSpectrum->setFreqScale(MODEM_STATS_NSPEC*((float)MAX_F_HZ/(g_pfreedv->modem_sample_rate/2)));
+        m_panelWaterfall->setFs(g_pfreedv->modem_sample_rate);
+    }
+
+    g_State = 0;
+    g_stats.snr_est = 0;
+
+    event.Skip();
+}
+
+void MainFrame::OnCallSignReset(wxCommandEvent& event)
+{
+    m_pcallsign = m_callsign;
+    memset(m_callsign, 0, MAX_CALLSIGN);
+    wxString s;
+    s.Printf("%s", m_callsign);
+    m_txtCtrlCallSign->SetValue(s);
+    m_checksumGood = m_checksumBad = 0;
+    m_txtChecksumGood->SetLabel(_("0"));
+    m_txtChecksumBad->SetLabel(_("0"));
+}
+
+void MainFrame::OnBerReset(wxCommandEvent& event)
+{
+    g_pfreedv->total_bits = 0;
+    g_pfreedv->total_bit_errors = 0;
+    int i;
+    for(i=0; i<2*g_Nc; i++)
+        g_error_hist[i] = 0;
+    
+}
+
+#ifdef ALC
+//-------------------------------------------------------------------------
+// OnTogBtnALCClick()
+//-------------------------------------------------------------------------
+void MainFrame::OnTogBtnALCClick(wxCommandEvent& event)
+{
+    wxMessageBox(wxT("Got Click!"), wxT("OnTogBtnALCClick"), wxOK);
+
+    event.Skip();
+}
+#endif
+
+// extra panel added to file open dialog to add loop checkbox
+MyExtraPlayFilePanel::MyExtraPlayFilePanel(wxWindow *parent): wxPanel(parent)
+{
+    m_cb = new wxCheckBox(this, -1, wxT("Loop"));
+    m_cb->SetToolTip(_("When checked file will repeat forever"));
+    m_cb->SetValue(g_loopPlayFileToMicIn);
+
+    // bug: I can't this to align right.....
+    wxBoxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
+    sizerTop->Add(m_cb, 0, wxALIGN_RIGHT, 0);
+    SetSizerAndFit(sizerTop);
+}
+
+static wxWindow* createMyExtraPlayFilePanel(wxWindow *parent)
+{
+    return new MyExtraPlayFilePanel(parent);
+}
+
+//-------------------------------------------------------------------------
+// OnPlayFileToMicIn()
+//-------------------------------------------------------------------------
+void MainFrame::OnPlayFileToMicIn(wxCommandEvent& event)
+{
+    wxUnusedVar(event);
+
+    if(g_playFileToMicIn)
+    {
+        g_mutexProtectingCallbackData.Lock();
+        g_playFileToMicIn = false;
+        sf_close(g_sfPlayFile);
+        SetStatusText(wxT(""));
+        g_mutexProtectingCallbackData.Unlock();
+    }
+    else
+    {
+        wxString    soundFile;
+        SF_INFO     sfInfo;
+
+        wxFileDialog openFileDialog(
+                                    this,
+                                    wxT("Play File to Mic In"),
+                                    wxGetApp().m_playFileToMicInPath,
+                                    wxEmptyString,
+                                    wxT("WAV and RAW files (*.wav;*.raw)|*.wav;*.raw|")
+                                    wxT("All files (*.*)|*.*"),
+                                    wxFD_OPEN | wxFD_FILE_MUST_EXIST
+                                    );
+
+        // add the loop check box
+        openFileDialog.SetExtraControlCreator(&createMyExtraPlayFilePanel);
+
+        if(openFileDialog.ShowModal() == wxID_CANCEL)
+        {
+            return;     // the user changed their mind...
+        }
+
+        wxString fileName, extension;
+        soundFile = openFileDialog.GetPath();
+        wxFileName::SplitPath(soundFile, &wxGetApp().m_playFileToMicInPath, &fileName, &extension);
+        //wxLogDebug("m_playFileToMicInPath: %s", wxGetApp().m_playFileToMicInPath);
+        sfInfo.format = 0;
+
+        if(!extension.IsEmpty())
+        {
+            extension.LowerCase();
+            if(extension == wxT("raw"))
+            {
+                sfInfo.format     = SF_FORMAT_RAW | SF_FORMAT_PCM_16;
+                sfInfo.channels   = 1;
+                sfInfo.samplerate = FS;
+            }
+        }
+        g_sfPlayFile = sf_open(soundFile, SFM_READ, &sfInfo);
+        if(g_sfPlayFile == NULL)
+        {
+            wxString strErr = sf_strerror(NULL);
+            wxMessageBox(strErr, wxT("Couldn't open sound file"), wxOK);
+            return;
+        }
+
+        wxWindow * const ctrl = openFileDialog.GetExtraControl();
+
+        // Huh?! I just copied wxWidgets-2.9.4/samples/dialogs ....
+        g_loopPlayFileToMicIn = static_cast<MyExtraPlayFilePanel*>(ctrl)->getLoopPlayFileToMicIn();
+
+        SetStatusText(wxT("Playing File: ") + fileName + wxT(" to Mic Input") , 0);
+        g_playFileToMicIn = true;
+    }
+}
+
+//-------------------------------------------------------------------------
+// OnPlayFileFromRadio()
+// This puppy "plays" a recorded file into the demodulator input, allowing us
+// to replay off air signals.
+//-------------------------------------------------------------------------
+void MainFrame::OnPlayFileFromRadio(wxCommandEvent& event)
+{
+    wxUnusedVar(event);
+
+    printf("OnPlayFileFromRadio:: %d\n", (int)g_playFileFromRadio);
+    if (g_playFileFromRadio)
+    {
+        printf("OnPlayFileFromRadio:: Stop\n");
+        g_mutexProtectingCallbackData.Lock();
+        g_playFileFromRadio = false;
+        sf_close(g_sfPlayFileFromRadio);
+        SetStatusText(wxT(""),0);
+        SetStatusText(wxT(""),1);
+        g_mutexProtectingCallbackData.Unlock();
+    }
+    else
+    {
+        wxString    soundFile;
+        SF_INFO     sfInfo;
+
+        wxFileDialog openFileDialog(
+                                    this,
+                                    wxT("Play File - From Radio"),
+                                    wxGetApp().m_playFileFromRadioPath,
+                                    wxEmptyString,
+                                    wxT("WAV and RAW files (*.wav;*.raw)|*.wav;*.raw|")
+                                    wxT("All files (*.*)|*.*"),
+                                    wxFD_OPEN | wxFD_FILE_MUST_EXIST
+                                    );
+
+        // add the loop check box
+        openFileDialog.SetExtraControlCreator(&createMyExtraPlayFilePanel);
+
+        if(openFileDialog.ShowModal() == wxID_CANCEL)
+        {
+            return;     // the user changed their mind...
+        }
+
+        wxString fileName, extension;
+        soundFile = openFileDialog.GetPath();
+        wxFileName::SplitPath(soundFile, &wxGetApp().m_playFileFromRadioPath, &fileName, &extension);
+        //wxLogDebug("m_playFileToFromRadioPath: %s", wxGetApp().m_playFileFromRadioPath);
+        sfInfo.format = 0;
+
+        if(!extension.IsEmpty())
+        {
+            extension.LowerCase();
+            if(extension == wxT("raw"))
+            {
+                sfInfo.format     = SF_FORMAT_RAW | SF_FORMAT_PCM_16;
+                sfInfo.channels   = 1;
+                sfInfo.samplerate = g_pfreedv->modem_sample_rate;
+            }
+        }
+        g_sfPlayFileFromRadio = sf_open(soundFile, SFM_READ, &sfInfo);
+        g_sfFs = sfInfo.samplerate;
+        if(g_sfPlayFileFromRadio == NULL)
+        {
+            wxString strErr = sf_strerror(NULL);
+            wxMessageBox(strErr, wxT("Couldn't open sound file"), wxOK);
+            return;
+        }
+
+        wxWindow * const ctrl = openFileDialog.GetExtraControl();
+
+        // Huh?! I just copied wxWidgets-2.9.4/samples/dialogs ....
+        g_loopPlayFileFromRadio = static_cast<MyExtraPlayFilePanel*>(ctrl)->getLoopPlayFileToMicIn();
+
+        SetStatusText(wxT("Playing into from radio"), 0);
+        if(extension == wxT("raw")) {
+            wxString stringnumber = wxString::Format(wxT("%d"), (int)sfInfo.samplerate);
+            SetStatusText(wxT("raw file assuming Fs=") + stringnumber, 1);          
+        }
+        fprintf(g_logfile, "OnPlayFileFromRadio:: Playing File\n");
+        g_playFileFromRadio = true;
+        g_blink = 0.0;
+    }
+}
+
+// extra panel added to file save dialog to set number of seconds to record for
+
+MyExtraRecFilePanel::MyExtraRecFilePanel(wxWindow *parent): wxPanel(parent)
+{
+    wxBoxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
+
+    wxStaticText* staticText = new wxStaticText(this, wxID_ANY, _("Seconds:"), wxDefaultPosition, wxDefaultSize, 0);
+    sizerTop->Add(staticText, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
+    m_secondsToRecord = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
+    m_secondsToRecord->SetToolTip(_("Number of seconds to record for"));
+    m_secondsToRecord->SetValue(wxString::Format(wxT("%i"), wxGetApp().m_recFileFromRadioSecs));
+    sizerTop->Add(m_secondsToRecord, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
+    SetSizerAndFit(sizerTop);
+}
+
+static wxWindow* createMyExtraRecFilePanel(wxWindow *parent)
+{
+    return new MyExtraRecFilePanel(parent);
+}
+
+//-------------------------------------------------------------------------
+// OnRecFileFromRadio()
+//-------------------------------------------------------------------------
+void MainFrame::OnRecFileFromRadio(wxCommandEvent& event)
+{
+    wxUnusedVar(event);
+
+    if (g_recFileFromRadio) {
+        printf("Stopping Record....\n");
+        g_mutexProtectingCallbackData.Lock();
+        g_recFileFromRadio = false;
+        sf_close(g_sfRecFile);
+        SetStatusText(wxT(""));
+        g_mutexProtectingCallbackData.Unlock();
+    }
+    else {
+
+        wxString    soundFile;
+        SF_INFO     sfInfo;
+
+         wxFileDialog openFileDialog(
+                                    this,
+                                    wxT("Record File From Radio"),
+                                    wxGetApp().m_recFileFromRadioPath,
+                                    wxEmptyString,
+                                    wxT("WAV and RAW files (*.wav;*.raw)|*.wav;*.raw|")
+                                    wxT("All files (*.*)|*.*"),
+                                    wxFD_SAVE
+                                    );
+
+        // add the loop check box
+        openFileDialog.SetExtraControlCreator(&createMyExtraRecFilePanel);
+
+        if(openFileDialog.ShowModal() == wxID_CANCEL)
+        {
+            return;     // the user changed their mind...
+        }
+
+        wxString fileName, extension;
+        soundFile = openFileDialog.GetPath();
+        wxFileName::SplitPath(soundFile, &wxGetApp().m_recFileFromRadioPath, &fileName, &extension);
+        wxLogDebug("m_recFileFromRadioPath: %s", wxGetApp().m_recFileFromRadioPath);
+        wxLogDebug("soundFile: %s", soundFile);
+        sfInfo.format = 0;
+
+        if(!extension.IsEmpty())
+        {
+            extension.LowerCase();
+            if(extension == wxT("raw"))
+            {
+                sfInfo.format     = SF_FORMAT_RAW | SF_FORMAT_PCM_16;
+                sfInfo.channels   = 1;
+                sfInfo.samplerate = g_pfreedv->modem_sample_rate;
+            }
+            else if(extension == wxT("wav"))
+            {
+                sfInfo.format     = SF_FORMAT_WAV | SF_FORMAT_PCM_16;
+                sfInfo.channels   = 1;
+                sfInfo.samplerate = g_pfreedv->modem_sample_rate;
+            } else {
+                wxMessageBox(wxT("Invalid file format"), wxT("Record File From Radio"), wxOK);
+                return;
+            }
+        }
+        else {
+            wxMessageBox(wxT("Invalid file format"), wxT("Record File From Radio"), wxOK);
+            return;
+        }
+
+        // Bug: on Win32 I cant read m_recFileFromRadioSecs, so have hard coded it
+#ifdef __WIN32__
+        long secs = wxGetApp().m_recFileFromRadioSecs;
+        g_recFromRadioSamples = FS*(unsigned int)secs;
+#else
+        // work out number of samples to record
+
+        wxWindow * const ctrl = openFileDialog.GetExtraControl();
+        wxString secsString = static_cast<MyExtraRecFilePanel*>(ctrl)->getSecondsToRecord();
+        wxLogDebug("test: %s secsString: %s\n", wxT("testing 123"), secsString);
+
+        long secs;
+        if (secsString.ToLong(&secs)) {
+            wxGetApp().m_recFileFromRadioSecs = (unsigned int)secs;
+            //printf(" secondsToRecord: %d\n",  (unsigned int)secs);
+            g_recFromRadioSamples = FS*(unsigned int)secs;
+            //printf("g_recFromRadioSamples: %d\n", g_recFromRadioSamples);
+        }
+        else {
+            wxMessageBox(wxT("Invalid number of Seconds"), wxT("Record File From Radio"), wxOK);
+            return;
+        }
+#endif
+
+        g_sfRecFile = sf_open(soundFile, SFM_WRITE, &sfInfo);
+        if(g_sfRecFile == NULL)
+        {
+            wxString strErr = sf_strerror(NULL);
+            wxMessageBox(strErr, wxT("Couldn't open sound file"), wxOK);
+            return;
+        }
+
+        SetStatusText(wxT("Recording File: ") + fileName + wxT(" From Radio") , 0);
+        g_recFileFromRadio = true;
+    }
+
+}
+
+//-------------------------------------------------------------------------
+// OnExit()
+//-------------------------------------------------------------------------
+void MainFrame::OnExit(wxCommandEvent& event)
+{
+    wxUnusedVar(event);
+#ifdef _USE_TIMER
+    m_plotTimer.Stop();
+#endif // _USE_TIMER
+    if(g_sfPlayFile != NULL)
+    {
+        sf_close(g_sfPlayFile);
+        g_sfPlayFile = NULL;
+    }
+    if(g_sfRecFile != NULL)
+    {
+        sf_close(g_sfRecFile);
+        g_sfRecFile = NULL;
+    }
+    if(m_RxRunning)
+    {
+        stopRxStream();
+    }
+    m_togBtnSplit->Disable();
+    //m_togRxID->Disable();
+    //m_togTxID->Disable();
+    m_togBtnAnalog->Disable();
+    //m_togBtnALC->Disable();
+    //m_btnTogPTT->Disable();
+    Pa_Terminate();
+    Destroy();
+}
+
+//-------------------------------------------------------------------------
+// OnExitClick()
+//-------------------------------------------------------------------------
+void MainFrame::OnExitClick(wxCommandEvent& event)
+{
+    OnExit(event);
+}
+
+//-------------------------------------------------------------------------
+// OnToolsAudio()
+//-------------------------------------------------------------------------
+void MainFrame::OnToolsAudio(wxCommandEvent& event)
+{
+    wxUnusedVar(event);
+    int rv = 0;
+    AudioOptsDialog *dlg = new AudioOptsDialog(NULL);
+    rv = dlg->ShowModal();
+    if(rv == wxID_OK)
+    {
+        dlg->ExchangeData(EXCHANGE_DATA_OUT);
+    }
+    delete dlg;
+}
+
+//-------------------------------------------------------------------------
+// OnToolsAudioUI()
+//-------------------------------------------------------------------------
+void MainFrame::OnToolsAudioUI(wxUpdateUIEvent& event)
+{
+    event.Enable(!m_RxRunning);
+}
+
+//-------------------------------------------------------------------------
+// OnToolsFilter()
+//-------------------------------------------------------------------------
+void MainFrame::OnToolsFilter(wxCommandEvent& event)
+{
+    wxUnusedVar(event);
+    FilterDlg *dlg = new FilterDlg(NULL, m_RxRunning, &m_newMicInFilter, &m_newSpkOutFilter);
+    dlg->ShowModal();
+    delete dlg;
+}
+
+//-------------------------------------------------------------------------
+// OnToolsOptions()
+//-------------------------------------------------------------------------
+void MainFrame::OnToolsOptions(wxCommandEvent& event)
+{
+    wxUnusedVar(event);
+    g_modal = true;
+    //fprintf(stderr,"g_modal: %d\n", g_modal);
+    optionsDlg->Show();
+}
+
+//-------------------------------------------------------------------------
+// OnToolsOptionsUI()
+//-------------------------------------------------------------------------
+void MainFrame::OnToolsOptionsUI(wxUpdateUIEvent& event)
+{
+}
+
+//-------------------------------------------------------------------------
+// OnToolsComCfg()
+//-------------------------------------------------------------------------
+void MainFrame::OnToolsComCfg(wxCommandEvent& event)
+{
+    wxUnusedVar(event);
+
+    ComPortsDlg *dlg = new ComPortsDlg(NULL);
+
+    int rv = dlg->ShowModal();
+
+    // test Hamlib/Serial set up
+
+    if(rv == wxID_OK)
+    {
+        if (wxGetApp().m_boolHamlibUseForPTT) {
+            OpenHamlibRig();
+            wxGetApp().m_hamlib->close();
+        }
+        if (wxGetApp().m_boolUseSerialPTT) {
+            SetupSerialPort();
+            CloseSerialPort();
+        }
+    }
+
+    delete dlg;
+}
+
+//-------------------------------------------------------------------------
+// OnToolsComCfgUI()
+//-------------------------------------------------------------------------
+void MainFrame::OnToolsComCfgUI(wxUpdateUIEvent& event)
+{
+    event.Enable(!m_RxRunning);
+}
+
+//-------------------------------------------------------------------------
+// OnHelpCheckUpdates()
+//-------------------------------------------------------------------------
+void MainFrame::OnHelpCheckUpdates(wxCommandEvent& event)
+{
+    wxMessageBox("Got Click!", "OnHelpCheckUpdates", wxOK);
+    event.Skip();
+}
+
+//-------------------------------------------------------------------------
+// OnHelpCheckUpdatesUI()
+//-------------------------------------------------------------------------
+void MainFrame::OnHelpCheckUpdatesUI(wxUpdateUIEvent& event)
+{
+    event.Enable(false);
+}
+
+//-------------------------------------------------------------------------
+//OnHelpAbout()
+//-------------------------------------------------------------------------
+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
+    wxURL url(wxT("http://svn.code.sf.net/p/freetel/code/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("<h2>p/freetel/code - Revision ");
+            int startIndex = htmldata.find(s) + s.Length();
+            int endIndex = htmldata.find(wxT(": /fdmdv2</h2>"));
+            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("How much have you spent on Ham gear this year?  How did it compare to FreeDV? ")
+                wxT("FreeDV repesents an open and free future for digital voice over Ham Radio. ")
+                wxT("Please help by donating just $10 here: 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);
+
+#endif // _USE_ABOUT_DIALOG
+#ifdef USE_SIMPLE_ABOUT_DIALOG
+    wxUnusedVar(event);
+    wxAboutDialogInfo info;
+    info.SetCopyright(_("HAMLib Test"));
+    info.SetLicence(_("GPL v2 or later"));
+    info.SetDescription(_("Short description goes here"));
+    ::wxAboutBox(info);
+#endif // USE_SIMPLE_ABOUT_DIALOG
+
+}
+
+
+// Attempt to talk to rig using Hamlib
+
+bool MainFrame::OpenHamlibRig() {
+    if (wxGetApp().m_boolHamlibUseForPTT != true)
+       return false;
+    if (wxGetApp().m_intHamlibRig == 0)
+        return false;
+    if (wxGetApp().m_hamlib == NULL)
+        return false;
+
+    int rig = wxGetApp().m_intHamlibRig;
+    wxString port = wxGetApp().m_strHamlibSerialPort;
+    bool status = wxGetApp().m_hamlib->connect(rig, port.mb_str(wxConvUTF8));
+    if (status == false)
+        wxMessageBox("Couldn't connect to Radio with hamlib", wxT("About"), wxOK | wxICON_ERROR, this);
+    return status;
+} 
+
+//-------------------------------------------------------------------------
+// OnTogBtnOnOff()
+//-------------------------------------------------------------------------
+void MainFrame::OnTogBtnOnOff(wxCommandEvent& event)
+{
+    wxString startStop = m_togBtnOnOff->GetLabel();
+
+    // we are attempting to start
+
+    if (startStop.IsSameAs("Start"))
+    {
+        //
+        // Start Running -------------------------------------------------
+        //
+
+        // modify some button states when running
+
+        m_togBtnSplit->Enable();
+        m_togBtnAnalog->Enable();
+        m_togBtnOnOff->SetLabel(wxT("Stop"));
+        m_btnTogPTT->Enable();
+
+        m_rb1600->Disable();
+        m_rb700->Disable();
+
+        // determine what mode we are using
+
+        if (m_rb1600->GetValue()) {
+            g_mode = FREEDV_MODE_1600;
+            g_Nc = 16;
+            m_panelScatter->setNc(g_Nc);
+        }
+        if (m_rb700->GetValue()) {
+            g_mode = FREEDV_MODE_700;
+            g_Nc = 14;
+            m_panelScatter->setNc(g_Nc/2-1);  /* due to diversity, -1 due to no pilot like FreeDV 1600 */
+        }
+   
+        // init freedv states
+
+        g_pfreedv = freedv_open(g_mode);
+        g_pfreedv->callback_state = NULL;
+        g_pfreedv->freedv_get_next_tx_char = &my_get_next_tx_char;
+        g_pfreedv->freedv_put_next_rx_char = &my_put_next_rx_char;
+
+        g_pfreedv->error_pattern_callback_state = (void*)m_panelTestFrameErrors;
+        g_pfreedv->freedv_put_error_pattern = &my_freedv_put_error_pattern;
+        g_error_pattern_fifo = fifo_create(2*g_pfreedv->sz_error_pattern);
+        g_error_hist = new short[FDMDV_NC_MAX*2];
+        int i;
+        for(i=0; i<2*FDMDV_NC_MAX; i++)
+            g_error_hist[i] = 0;
+
+        //if (g_mode == FREEDV_MODE_700)
+        //    cohpsk_set_verbose(g_pfreedv->cohpsk, 1);
+
+        //cohpsk_set_verbose(g_pfreedv->cohpsk, 1);
+        assert(g_pfreedv != NULL);
+        modem_stats_open(&g_stats);
+
+        // Init Speex pre-processor states
+        // by inspecting Speex source it seems that only denoiser is on be default
+
+        g_speex_st = speex_preprocess_state_init(g_pfreedv->n_speech_samples, FS); 
+
+        // adjust spectrum and waterfall freq scaling base on mode
+
+        m_panelSpectrum->setFreqScale(MODEM_STATS_NSPEC*((float)MAX_F_HZ/(g_pfreedv->modem_sample_rate/2)));
+        m_panelWaterfall->setFs(g_pfreedv->modem_sample_rate);
+
+        // adjust scatter diagram for Number of FDM carriers
+
+        // init Codec 2 LPC Post Filter
+
+        codec2_set_lpc_post_filter(g_pfreedv->codec2,
+                                   wxGetApp().m_codec2LPCPostFilterEnable,
+                                   wxGetApp().m_codec2LPCPostFilterBassBoost,
+                                   wxGetApp().m_codec2LPCPostFilterBeta,
+                                   wxGetApp().m_codec2LPCPostFilterGamma);
+
+        g_State = 0;
+        g_snr = 0.0;
+        g_half_duplex = wxGetApp().m_boolHalfDuplex;
+
+        m_pcallsign = m_callsign;
+        memset(m_callsign, 0, sizeof(m_callsign));
+        m_checksumGood = m_checksumBad = 0;
+        wxString s;
+        s.Printf("%d", m_checksumGood);
+        m_txtChecksumGood->SetLabel(s);              
+        s.Printf("%d", m_checksumBad);
+        m_txtChecksumBad->SetLabel(s);        
+
+        m_maxLevel = 0;
+        m_textLevel->SetLabel(wxT(""));
+        m_gaugeLevel->SetValue(0);
+
+        // Init text msg decoding
+
+        varicode_set_code_num(&g_pfreedv->varicode_dec_states, wxGetApp().m_textEncoding);
+        //printf("m_textEncoding = %d\n", wxGetApp().m_textEncoding);
+        //printf("g_stats.snr: %f\n", g_stats.snr_est);
+
+        // attempt to start PTT ......
+        
+        if (wxGetApp().m_boolHamlibUseForPTT)
+            OpenHamlibRig();
+        if (wxGetApp().m_boolUseSerialPTT) {
+            SetupSerialPort();
+        }
+
+        // attempt to start sound cards and tx/rx processing
+
+        startRxStream();
+
+        if (m_RxRunning)
+        {
+#ifdef _USE_TIMER
+            m_plotTimer.Start(_REFRESH_TIMER_PERIOD, wxTIMER_CONTINUOUS);
+#endif // _USE_TIMER
+        }
+        char e[80]; sprintf(e,"start"); processTxtEvent(e);
+    }
+
+    // Stop was pressed or start up failed
+
+    if (startStop.IsSameAs("Stop") || !m_RxRunning ) {
+
+        //
+        // Stop Running -------------------------------------------------
+        //
+
+        optionsDlg->SetSpamTimerLight(false);
+
+#ifdef _USE_TIMER
+        m_plotTimer.Stop();
+#endif // _USE_TIMER
+
+        // ensure we are not transmitting and shut down audio processing
+
+        if (wxGetApp().m_boolHamlibUseForPTT) {
+            Hamlib *hamlib = wxGetApp().m_hamlib; 
+            if (wxGetApp().m_boolHamlibUseForPTT && hamlib != NULL) {
+                hamlib->ptt(false);
+                hamlib->close();
+            }
+        }
+
+        if (wxGetApp().m_boolUseSerialPTT)
+            CloseSerialPort();
+
+        m_btnTogPTT->SetValue(false);
+
+        stopRxStream();
+
+        // free up states
+
+        modem_stats_close(&g_stats);
+        delete g_error_hist;
+        fifo_destroy(g_error_pattern_fifo);
+        freedv_close(g_pfreedv);
+        speex_preprocess_state_destroy(g_speex_st);
+        m_newMicInFilter = m_newSpkOutFilter = true;
+
+        m_togBtnSplit->Disable();
+        //m_togRxID->Disable();
+        //m_togTxID->Disable();
+        m_togBtnAnalog->Disable();
+        m_btnTogPTT->Disable();
+        m_togBtnOnOff->SetLabel(wxT("Start"));
+        m_rb1600->Enable();
+        m_rb700->Enable();
+#ifdef DISABLED_FEATURE
+        m_rb1400old->Enable();
+        m_rb1600Wide->Enable();
+        m_rb1400->Enable();
+        m_rb2000->Enable();
+#endif
+        char e[80]; sprintf(e,"stop"); processTxtEvent(e);
+    }
+}
+
+//-------------------------------------------------------------------------
+// stopRxStream()
+//-------------------------------------------------------------------------
+void MainFrame::stopRxStream()
+{
+    if(m_RxRunning)
+    {
+        m_RxRunning = false;
+
+        fprintf(g_logfile, "waiting for thread to stop");
+        m_txRxThread->m_run = 0;
+        m_txRxThread->Wait();
+        fprintf(g_logfile, "thread stopped");
+
+        m_rxInPa->stop();
+        m_rxInPa->streamClose();
+        delete m_rxInPa;
+        if(m_rxOutPa != m_rxInPa) {
+                       m_rxOutPa->stop();
+                       m_rxOutPa->streamClose();
+                       delete m_rxOutPa;
+               }
+
+        if (g_nSoundCards == 2) {
+            m_txInPa->stop();
+            m_txInPa->streamClose();
+            delete m_txInPa;
+            if(m_txInPa != m_txOutPa) {
+                               m_txOutPa->stop();
+                               m_txOutPa->streamClose();
+                               delete m_txOutPa;
+                       }
+        }
+
+        destroy_fifos();
+        destroy_src();
+        deleteEQFilters(g_rxUserdata);
+        delete g_rxUserdata;
+    }
+}
+
+void MainFrame::destroy_fifos(void)
+{
+    fifo_destroy(g_rxUserdata->infifo1);
+    fifo_destroy(g_rxUserdata->outfifo1);
+    fifo_destroy(g_rxUserdata->infifo2);
+    fifo_destroy(g_rxUserdata->outfifo2);
+    fifo_destroy(g_rxUserdata->rxinfifo);
+    fifo_destroy(g_rxUserdata->rxoutfifo);
+}
+
+void MainFrame::destroy_src(void)
+{
+    src_delete(g_rxUserdata->insrc1);
+    src_delete(g_rxUserdata->outsrc1);
+    src_delete(g_rxUserdata->insrc2);
+    src_delete(g_rxUserdata->outsrc2);
+    src_delete(g_rxUserdata->insrcsf);
+}
+
+void  MainFrame::initPortAudioDevice(PortAudioWrap *pa, int inDevice, int outDevice,
+                                     int soundCard, int sampleRate, int inputChannels)
+{
+    // Note all of the wrapper functions below just set values in a
+    // portaudio struct so can't return any errors. So no need to trap
+    // any errors in this function.
+
+    // init input params
+
+    pa->setInputDevice(inDevice);
+    if(inDevice != paNoDevice) {
+        pa->setInputChannelCount(inputChannels);           // stereo input
+        pa->setInputSampleFormat(PA_SAMPLE_TYPE);
+        pa->setInputLatency(pa->getInputDefaultLowLatency());
+        pa->setInputHostApiStreamInfo(NULL);
+    }
+
+    pa->setOutputDevice(paNoDevice);
+    
+    // init output params
+    
+    pa->setOutputDevice(outDevice);
+    if(outDevice != paNoDevice) {
+        pa->setOutputChannelCount(2);                      // stereo output
+        pa->setOutputSampleFormat(PA_SAMPLE_TYPE);
+        pa->setOutputLatency(pa->getOutputDefaultLowLatency());
+        pa->setOutputHostApiStreamInfo(NULL);
+    }
+
+    // init params that affect input and output
+
+    /*
+      On Linux, setting this to wxGetApp().m_framesPerBuffer caused
+      intermittant break up on the audio from my IC7200 on Ubuntu 14.
+      After a day of bug hunting I found that 0, as recommended by the
+      PortAudio docunmentation, fixed the problem.
+    */
+
+    //pa->setFramesPerBuffer(wxGetApp().m_framesPerBuffer);
+    pa->setFramesPerBuffer(0);
+
+    pa->setSampleRate(sampleRate);
+    pa->setStreamFlags(paClipOff);
+}
+
+//-------------------------------------------------------------------------
+// startRxStream()
+//-------------------------------------------------------------------------
+void MainFrame::startRxStream()
+{
+    int   src_error;
+    const PaDeviceInfo *deviceInfo1 = NULL, *deviceInfo2 = NULL;
+    int   inputChannels1, inputChannels2;
+    bool  two_rx=false;
+    bool  two_tx=false;
+
+    if(!m_RxRunning) {
+        m_RxRunning = true;
+
+        if(Pa_Initialize())
+        {
+            wxMessageBox(wxT("Port Audio failed to initialize"), wxT("Pa_Initialize"), wxOK);
+        }
+
+        m_rxInPa = new PortAudioWrap();
+        if(g_soundCard1InDeviceNum != g_soundCard1OutDeviceNum)
+            two_rx=true;
+        if(g_soundCard2InDeviceNum != g_soundCard2OutDeviceNum)
+            two_tx=true;
+        
+        fprintf(g_logfile, "two_rx: %d two_tx: %d\n", two_rx, two_tx);
+        if(two_rx)
+            m_rxOutPa = new PortAudioWrap();
+        else
+            m_rxOutPa = m_rxInPa;
+
+        if (g_nSoundCards == 0) {
+            wxMessageBox(wxT("No Sound Cards configured, use Tools - Audio Config to configure"), wxT("Error"), wxOK);
+            delete m_rxInPa;
+            if(two_rx)
+                delete m_rxOutPa;
+            m_RxRunning = false;
+            return;
+        }
+
+        // Init Sound card 1 ----------------------------------------------
+        // sanity check on sound card device numbers
+
+        if ((m_rxInPa->getDeviceCount() <= g_soundCard1InDeviceNum) ||
+            (m_rxOutPa->getDeviceCount() <= g_soundCard1OutDeviceNum)) {
+            wxMessageBox(wxT("Sound Card 1 not present"), wxT("Error"), wxOK);
+            delete m_rxInPa;
+            if(two_rx)
+                               delete m_rxOutPa;
+            m_RxRunning = false;
+            return;
+        }
+
+        // work out how many input channels this device supports.
+
+        deviceInfo1 = Pa_GetDeviceInfo(g_soundCard1InDeviceNum);
+        if (deviceInfo1 == NULL) {
+            wxMessageBox(wxT("Couldn't get device info from Port Audio for Sound Card 1"), wxT("Error"), wxOK);
+            delete m_rxInPa;
+            if(two_rx)
+                               delete m_rxOutPa;
+            m_RxRunning = false;
+            return;
+        }
+        if (deviceInfo1->maxInputChannels == 1)
+            inputChannels1 = 1;
+        else
+            inputChannels1 = 2;
+
+        if(two_rx) {
+            initPortAudioDevice(m_rxInPa, g_soundCard1InDeviceNum, paNoDevice, 1,
+                            g_soundCard1SampleRate, inputChannels1);
+            initPortAudioDevice(m_rxOutPa, paNoDevice, g_soundCard1OutDeviceNum, 1,
+                            g_soundCard1SampleRate, inputChannels1);
+               }
+        else
+            initPortAudioDevice(m_rxInPa, g_soundCard1InDeviceNum, g_soundCard1OutDeviceNum, 1,
+                            g_soundCard1SampleRate, inputChannels1);
+
+        // Init Sound Card 2 ------------------------------------------------
+
+        if (g_nSoundCards == 2) {
+
+            m_txInPa = new PortAudioWrap();
+            if(two_tx)
+                m_txOutPa = new PortAudioWrap();
+            else
+                m_txOutPa = m_txInPa;
+
+            // sanity check on sound card device numbers
+
+            //printf("m_txInPa->getDeviceCount(): %d\n", m_txInPa->getDeviceCount());
+            //printf("g_soundCard2InDeviceNum: %d\n", g_soundCard2InDeviceNum);
+            //printf("g_soundCard2OutDeviceNum: %d\n", g_soundCard2OutDeviceNum);
+
+            if ((m_txInPa->getDeviceCount() <= g_soundCard2InDeviceNum) ||
+                (m_txOutPa->getDeviceCount() <= g_soundCard2OutDeviceNum)) {
+                wxMessageBox(wxT("Sound Card 2 not present"), wxT("Error"), wxOK);
+                delete m_rxInPa;
+                if(two_rx)
+                    delete m_rxOutPa;
+                delete m_txInPa;
+                if(two_tx)
+                    delete m_txOutPa;
+                m_RxRunning = false;
+                return;
+            }
+
+            deviceInfo2 = Pa_GetDeviceInfo(g_soundCard2InDeviceNum);
+            if (deviceInfo2 == NULL) {
+                wxMessageBox(wxT("Couldn't get device info from Port Audio for Sound Card 1"), wxT("Error"), wxOK);
+                delete m_rxInPa;
+                if(two_rx)
+                                       delete m_rxOutPa;
+                delete m_txInPa;
+                if(two_tx)
+                                       delete m_txOutPa;
+                m_RxRunning = false;
+                return;
+            }
+            if (deviceInfo2->maxInputChannels == 1)
+                inputChannels2 = 1;
+            else
+                inputChannels2 = 2;
+
+            if(two_tx) {
+                               initPortAudioDevice(m_txInPa, g_soundCard2InDeviceNum, paNoDevice, 2,
+                                g_soundCard2SampleRate, inputChannels2);
+                               initPortAudioDevice(m_txOutPa, paNoDevice, g_soundCard2OutDeviceNum, 2,
+                                g_soundCard2SampleRate, inputChannels2);
+                       }
+                       else
+                               initPortAudioDevice(m_txInPa, g_soundCard2InDeviceNum, g_soundCard2OutDeviceNum, 2,
+                                g_soundCard2SampleRate, inputChannels2);
+        }
+
+        // Init call back data structure ----------------------------------------------
+
+        g_rxUserdata = new paCallBackData;
+        g_rxUserdata->inputChannels1 = inputChannels1;
+        if (deviceInfo2 != NULL)
+            g_rxUserdata->inputChannels2 = inputChannels2;
+
+        // init sample rate conversion states
+
+        g_rxUserdata->insrc1 = src_new(SRC_SINC_FASTEST, 1, &src_error);
+        assert(g_rxUserdata->insrc1 != NULL);
+        g_rxUserdata->outsrc1 = src_new(SRC_SINC_FASTEST, 1, &src_error);
+        assert(g_rxUserdata->outsrc1 != NULL);
+        g_rxUserdata->insrc2 = src_new(SRC_SINC_FASTEST, 1, &src_error);
+        assert(g_rxUserdata->insrc2 != NULL);
+        g_rxUserdata->outsrc2 = src_new(SRC_SINC_FASTEST, 1, &src_error);
+        assert(g_rxUserdata->outsrc2 != NULL);
+
+        g_rxUserdata->insrcsf = src_new(SRC_SINC_FASTEST, 1, &src_error);
+        assert(g_rxUserdata->insrcsf != NULL);
+
+        // create FIFOs used to interface between different buffer sizes
+
+        g_rxUserdata->infifo1 = fifo_create(8*N48);
+        g_rxUserdata->outfifo1 = fifo_create(10*N48);
+        g_rxUserdata->outfifo2 = fifo_create(8*N48);
+        g_rxUserdata->infifo2 = fifo_create(8*N48);
+        printf("N48: %d\n", N48);
+
+        g_rxUserdata->rxinfifo = fifo_create(3 * g_pfreedv->n_speech_samples);
+        g_rxUserdata->rxoutfifo = fifo_create(2 * g_pfreedv->n_speech_samples);
+
+        // Init Equaliser Filters ------------------------------------------------------
+
+        m_newMicInFilter = m_newSpkOutFilter = true;
+        designEQFilters(g_rxUserdata);
+        g_rxUserdata->micInEQEnable = wxGetApp().m_MicInEQEnable;
+        g_rxUserdata->spkOutEQEnable = wxGetApp().m_SpkOutEQEnable;
+
+        // optional tone in left channel to reliably trigger vox
+        
+        g_rxUserdata->leftChannelVoxTone = wxGetApp().m_leftChannelVoxTone;
+        g_rxUserdata->voxTonePhase = 0;
+
+        // Start sound card 1 ----------------------------------------------------------
+
+        m_rxInPa->setUserData(g_rxUserdata);
+        m_rxErr = m_rxInPa->setCallback(rxCallback);
+
+        m_rxErr = m_rxInPa->streamOpen();
+
+        if(m_rxErr != paNoError) {
+            wxMessageBox(wxT("Sound Card 1 Open/Setup error."), wxT("Error"), wxOK);
+                       delete m_rxInPa;
+                       if(two_rx)
+                               delete m_rxOutPa;
+                       delete m_txInPa;
+                       if(two_tx)
+                               delete m_txOutPa;
+            destroy_fifos();
+            destroy_src();
+            deleteEQFilters(g_rxUserdata);
+            delete g_rxUserdata;
+            m_RxRunning = false;
+            return;
+        }
+
+        m_rxErr = m_rxInPa->streamStart();
+        if(m_rxErr != paNoError) {
+            wxMessageBox(wxT("Sound Card 1 Stream Start Error."), wxT("Error"), wxOK);
+                       delete m_rxInPa;
+                       if(two_rx)
+                               delete m_rxOutPa;
+                       delete m_txInPa;
+                       if(two_tx)
+                               delete m_txOutPa;
+            destroy_fifos();
+            destroy_src();
+            deleteEQFilters(g_rxUserdata);
+            delete g_rxUserdata;
+            m_RxRunning = false;
+            return;
+        }
+
+        // Start separate output stream if needed
+
+        if(two_rx) {
+            m_rxOutPa->setUserData(g_rxUserdata);
+            m_rxErr = m_rxOutPa->setCallback(rxCallback);
+
+            m_rxErr = m_rxOutPa->streamOpen();
+
+            if(m_rxErr != paNoError) {
+                wxMessageBox(wxT("Sound Card 1 Second Stream Open/Setup error."), wxT("Error"), wxOK);
+                delete m_rxInPa;
+                delete m_rxOutPa;
+                delete m_txOutPa;
+                if(two_tx)
+                    delete m_txOutPa;
+                destroy_fifos();
+                destroy_src();
+                deleteEQFilters(g_rxUserdata);
+                delete g_rxUserdata;
+                m_RxRunning = false;
+                return;
+            }
+
+            m_rxErr = m_rxOutPa->streamStart();
+            if(m_rxErr != paNoError) {
+                wxMessageBox(wxT("Sound Card 1 Second Stream Start Error."), wxT("Error"), wxOK);
+                m_rxInPa->stop();
+                m_rxInPa->streamClose();
+                delete m_rxInPa;
+                delete m_rxOutPa;
+                delete m_txOutPa;
+                if(two_tx)
+                    delete m_txOutPa;
+                destroy_fifos();
+                destroy_src();
+                deleteEQFilters(g_rxUserdata);
+                delete g_rxUserdata;
+                m_RxRunning = false;
+                return;
+            }
+        }
+
+        // Start sound card 2 ----------------------------------------------------------
+
+        if (g_nSoundCards == 2) {
+
+            // question: can we use same callback data
+            // (g_rxUserdata)or both sound card callbacks?  Is there a
+            // chance of them both being called at the same time?  We
+            // could need a mutex ...
+
+            m_txInPa->setUserData(g_rxUserdata);
+            m_txErr = m_txInPa->setCallback(txCallback);
+            m_txErr = m_txInPa->streamOpen();
+
+            if(m_txErr != paNoError) {
+                fprintf(stderr, "Err: %d\n", m_txErr);
+                wxMessageBox(wxT("Sound Card 2 Open/Setup error."), wxT("Error"), wxOK);
+                m_rxInPa->stop();
+                m_rxInPa->streamClose();
+                delete m_rxInPa;
+                if(two_rx) {
+                    m_rxOutPa->stop();
+                    m_rxOutPa->streamClose();
+                    delete m_rxOutPa;
+                }
+                delete m_txInPa;
+                if(two_tx)
+                    delete m_txOutPa;
+                destroy_fifos();
+                destroy_src();
+                deleteEQFilters(g_rxUserdata);
+                delete g_rxUserdata;
+                m_RxRunning = false;
+                return;
+            }
+            m_txErr = m_txInPa->streamStart();
+            if(m_txErr != paNoError) {
+                wxMessageBox(wxT("Sound Card 2 Start Error."), wxT("Error"), wxOK);
+                m_rxInPa->stop();
+                m_rxInPa->streamClose();
+                delete m_rxInPa;
+                if(two_rx) {
+                    m_rxOutPa->stop();
+                    m_rxOutPa->streamClose();
+                    delete m_rxOutPa;
+                }
+                delete m_txInPa;
+                if(two_tx)
+                    delete m_txOutPa;
+                destroy_fifos();
+                destroy_src();
+                deleteEQFilters(g_rxUserdata);
+                delete g_rxUserdata;
+                m_RxRunning = false;
+                return;
+            }
+
+            // Start separate output stream if needed
+
+            if (two_tx) {
+
+                // question: can we use same callback data
+                // (g_rxUserdata)or both sound card callbacks?  Is there a
+                // chance of them both being called at the same time?  We
+                // could need a mutex ...
+
+                m_txOutPa->setUserData(g_rxUserdata);
+                m_txErr = m_txOutPa->setCallback(txCallback);
+                m_txErr = m_txOutPa->streamOpen();
+
+                if(m_txErr != paNoError) {
+                    wxMessageBox(wxT("Sound Card 2 Second Stream Open/Setup error."), wxT("Error"), wxOK);
+                    m_rxInPa->stop();
+                    m_rxInPa->streamClose();
+                    delete m_rxInPa;
+                    if(two_rx) {
+                        m_rxOutPa->stop();
+                        m_rxOutPa->streamClose();
+                        delete m_rxOutPa;
+                    }
+                    m_txInPa->stop();
+                    m_txInPa->streamClose();
+                    delete m_txInPa;
+                    delete m_txOutPa;
+                    destroy_fifos();
+                    destroy_src();
+                    deleteEQFilters(g_rxUserdata);
+                    delete g_rxUserdata;
+                    m_RxRunning = false;
+                    return;
+                }
+                m_txErr = m_txOutPa->streamStart();
+                if(m_txErr != paNoError) {
+                    wxMessageBox(wxT("Sound Card 2 Second Stream Start Error."), wxT("Error"), wxOK);
+                    m_rxInPa->stop();
+                    m_rxInPa->streamClose();
+                    m_txInPa->stop();
+                    m_txInPa->streamClose();
+                    delete m_txInPa;
+                    if(two_rx) {
+                        m_rxOutPa->stop();
+                        m_rxOutPa->streamClose();
+                        delete m_rxOutPa;
+                    }
+                    delete m_txInPa;
+                    delete m_txOutPa;
+                    destroy_fifos();
+                    destroy_src();
+                    deleteEQFilters(g_rxUserdata);
+                    delete g_rxUserdata;
+                    m_RxRunning = false;
+                    return;
+                }
+            }
+        }
+
+        // start tx/rx processing thread
+
+        m_txRxThread = new txRxThread;
+
+        if ( m_txRxThread->Create() != wxTHREAD_NO_ERROR )
+        {
+            wxLogError(wxT("Can't create thread!"));
+        }
+
+        m_txRxThread->SetPriority(WXTHREAD_MAX_PRIORITY);
+
+        if ( m_txRxThread->Run() != wxTHREAD_NO_ERROR )
+        {
+            wxLogError(wxT("Can't start thread!"));
+        }
+
+    }
+}
+
+
+void MainFrame::processTxtEvent(char event[]) {
+    int rule = 0;
+
+    //printf("processTxtEvent:\n");
+    //printf("  event: %s\n", event);
+
+    // process with regexp and issue system command
+
+    // Each regexp in our list is separated by a newline.  We want to try all of them.
+
+    wxString event_str(event);
+    int match_end, replace_end;
+    match_end = replace_end = 0;
+    wxString regexp_match_list = wxGetApp().m_events_regexp_match;
+    wxString regexp_replace_list = wxGetApp().m_events_regexp_replace;
+
+    bool found_match = false;
+
+    while (((match_end = regexp_match_list.Find('\n')) != wxNOT_FOUND) && (rule < MAX_EVENT_RULES)) {
+        //printf("match_end: %d\n", match_end);
+        if ((replace_end = regexp_replace_list.Find('\n')) != wxNOT_FOUND) {
+            //printf("replace_end = %d\n", replace_end);
+
+            // candidate match and replace regexps strings exist, so lets try them
+
+            wxString regexp_match = regexp_match_list.SubString(0, match_end-1);
+            wxString regexp_replace = regexp_replace_list.SubString(0, replace_end-1);
+            //printf("match: %s replace: %s\n", (const char *)regexp_match.c_str(), (const char *)regexp_replace.c_str());
+            wxRegEx re(regexp_match);
+            //printf("  checking for match against: %s\n", (const char *)regexp_match.c_str());
+
+            // if we found a match, lets run the replace regexp and issue the system command
+
+            wxString event_str_rep = event_str;
+
+            if (re.Replace(&event_str_rep, regexp_replace) != 0) {
+                //printf("  found match!\n");
+                found_match = true;
+
+                bool enableSystem = false;
+                if (wxGetApp().m_events)
+                    enableSystem = true;
+
+                // no syscall if spam timer still running
+
+                if (spamTimer[rule].IsRunning()) {
+                    enableSystem = false;
+                    //printf("  spam timer running\n");
+                }
+
+                const char *event_out = event_str_rep.ToUTF8();
+                wxString event_out_with_return_code;
+
+                if (enableSystem) {
+                    int ret = wxExecute(event_str_rep);
+                    event_out_with_return_code.Printf(_T("%s -> returned %d"), event_out, ret);
+                    spamTimer[rule].Start((wxGetApp().m_events_spam_timer)*1000, wxTIMER_ONE_SHOT);
+                }
+                else
+                    event_out_with_return_code.Printf(_T("%s T: %d"), event_out, spamTimer[rule].IsRunning());
+
+                // update event log GUI if currently displayed
+                
+                if (optionsDlg != NULL) {                  
+                    optionsDlg->updateEventLog(wxString(event), event_out_with_return_code);                     
+                }
+            }
+        }
+        regexp_match_list = regexp_match_list.SubString(match_end+1, regexp_match_list.length());
+        regexp_replace_list = regexp_replace_list.SubString(replace_end+1, regexp_replace_list.length());
+
+        rule++;
+    }
+    if ((optionsDlg != NULL) && !found_match) {                  
+        optionsDlg->updateEventLog(wxString(event), _("<no match>"));                     
+    }
+}
+
+
+#define SBQ_MAX_ARGS 4
+
+void *MainFrame::designAnEQFilter(const char filterType[], float freqHz, float gaindB, float Q)
+{
+    char  *arg[SBQ_MAX_ARGS];
+    char   argstorage[SBQ_MAX_ARGS][80];
+    void  *sbq;
+    int    i, argc;
+
+    assert((strcmp(filterType, "bass") == 0)   ||
+           (strcmp(filterType, "treble") == 0) ||
+           (strcmp(filterType, "equalizer") == 0));
+
+    for(i=0; i<SBQ_MAX_ARGS; i++) {
+        arg[i] = &argstorage[i][0];
+        arg[i] = &argstorage[i][0];
+        arg[i] = &argstorage[i][0];
+    }
+
+    argc = 0;
+
+    if ((strcmp(filterType, "bass") == 0) || (strcmp(filterType, "treble") == 0)) {
+        sprintf(arg[argc++], "%s", filterType);
+        sprintf(arg[argc++], "%f", gaindB+1E-6);
+        sprintf(arg[argc++], "%f", freqHz);
+    }
+
+    if (strcmp(filterType, "equalizer") == 0) {
+        sprintf(arg[argc++], "%s", filterType);
+        sprintf(arg[argc++], "%f", freqHz);
+        sprintf(arg[argc++], "%f", Q);
+        sprintf(arg[argc++], "%f", gaindB+1E-6);
+    }
+
+    assert(argc <= SBQ_MAX_ARGS);
+
+    sbq = sox_biquad_create(argc-1, (const char **)arg);
+
+    return sbq;
+}
+
+void  MainFrame::designEQFilters(paCallBackData *cb)
+{
+    // init Mic In Equaliser Filters
+
+    if (m_newMicInFilter) {
+        //printf("designing new Min In filters\n");
+        cb->sbqMicInBass   = designAnEQFilter("bass", wxGetApp().m_MicInBassFreqHz, wxGetApp().m_MicInBassGaindB);
+        cb->sbqMicInTreble = designAnEQFilter("treble", wxGetApp().m_MicInTrebleFreqHz, wxGetApp().m_MicInTrebleGaindB);
+        cb->sbqMicInMid    = designAnEQFilter("equalizer", wxGetApp().m_MicInMidFreqHz, wxGetApp().m_MicInMidGaindB, wxGetApp().m_MicInMidQ);
+    }
+
+    // init Spk Out Equaliser Filters
+
+    if (m_newSpkOutFilter) {
+        //printf("designing new Spk Out filters\n");
+        //printf("designEQFilters: wxGetApp().m_SpkOutBassFreqHz: %f\n",wxGetApp().m_SpkOutBassFreqHz);
+        cb->sbqSpkOutBass   = designAnEQFilter("bass", wxGetApp().m_SpkOutBassFreqHz, wxGetApp().m_SpkOutBassGaindB);
+        cb->sbqSpkOutTreble = designAnEQFilter("treble", wxGetApp().m_SpkOutTrebleFreqHz, wxGetApp().m_SpkOutTrebleGaindB);
+        cb->sbqSpkOutMid    = designAnEQFilter("equalizer", wxGetApp().m_SpkOutMidFreqHz, wxGetApp().m_SpkOutMidGaindB, wxGetApp().m_SpkOutMidQ);
+    }
+}
+
+void  MainFrame::deleteEQFilters(paCallBackData *cb)
+{
+    if (m_newMicInFilter) {
+        sox_biquad_destroy(cb->sbqMicInBass);
+        sox_biquad_destroy(cb->sbqMicInTreble);
+        sox_biquad_destroy(cb->sbqMicInMid);
+    }
+    if (m_newSpkOutFilter) {
+        sox_biquad_destroy(cb->sbqSpkOutBass);
+        sox_biquad_destroy(cb->sbqSpkOutTreble);
+        sox_biquad_destroy(cb->sbqSpkOutMid);
+    }
+}
+
+// returns number of output samples generated by resampling
+int resample(SRC_STATE *src,
+            short      output_short[],
+            short      input_short[],
+            int        output_sample_rate,
+            int        input_sample_rate,
+            int        length_output_short, // maximum output array length in samples
+            int        length_input_short
+            )
+{
+    SRC_DATA src_data;
+    float    input[N48*4];
+    float    output[N48*4];
+    int      ret;
+
+    assert(src != NULL);
+    assert(length_input_short <= N48*4);
+    assert(length_output_short <= N48*4);
+
+    src_short_to_float_array(input_short, input, length_input_short);
+
+    src_data.data_in = input;
+    src_data.data_out = output;
+    src_data.input_frames = length_input_short;
+    src_data.output_frames = length_output_short;
+    src_data.end_of_input = 0;
+    src_data.src_ratio = (float)output_sample_rate/input_sample_rate;
+
+    ret = src_process(src, &src_data);
+    assert(ret == 0);
+
+    assert(src_data.output_frames_gen <= length_output_short);
+    src_float_to_short_array(output, output_short, src_data.output_frames_gen);
+
+    return src_data.output_frames_gen;
+}
+
+
+// Decimates samples using an algorithm that produces nice plots of
+// speech signals at a low sample rate.  We want a low sample rate so
+// we don't hammer the graphics system too hard.  Saves decimated data
+// to a fifo for plotting on screen.
+void resample_for_plot(struct FIFO *plotFifo, short buf[], int length, int fs)
+{
+    int decimation = fs/WAVEFORM_PLOT_FS;
+    int nSamples, sample;
+    int i, st, en, max, min;
+    short dec_samples[length];
+
+    nSamples = length/decimation;
+
+    for(sample = 0; sample < nSamples; sample += 2)
+    {
+        st = decimation*sample;
+        en = decimation*(sample+2);
+        max = min = 0;
+        for(i=st; i<en; i++ )
+        {
+            if (max < buf[i]) max = buf[i];
+            if (min > buf[i]) min = buf[i];
+        }
+        dec_samples[sample] = max;
+        dec_samples[sample+1] = min;
+    }
+    fifo_write(plotFifo, dec_samples, nSamples);
+}
+
+void txRxProcessing()
+{
+
+    paCallBackData  *cbData = g_rxUserdata;
+
+    // Buffers re-used by tx and rx processing
+    // signals in in48k/out48k are at a maximum sample rate of 48k, could be 44.1kHz
+    // depending on sound hardware.
+
+    short           in8k_short[4*N8];
+    short           in48k_short[4*N48];
+    short           out8k_short[4*N8];
+    short           out48k_short[4*N48];
+    int             nout, samplerate, n_samples;
+
+    //fprintf(g_logfile, "start infifo1: %5d outfifo2: %5d\n", fifo_used(cbData->infifo1), fifo_used(cbData->outfifo2));
+
+    // FreeDV 700 uses a modem sample rate of 7500 Hz which requires some special treatment
+
+    if (g_analog) 
+        samplerate = FS;
+    else
+        samplerate = g_pfreedv->modem_sample_rate;
+
+    //
+    //  RX side processing --------------------------------------------
+    //
+
+    // while we have enough input samples available ...
+
+    int nsam = g_soundCard1SampleRate * (float)N8/FS;
+    assert(nsam <= N48);
+    g_mutexProtectingCallbackData.Lock();
+    while ((fifo_read(cbData->infifo1, in48k_short, nsam) == 0) && ((g_half_duplex && !g_tx) || !g_half_duplex)) 
+    {
+        g_mutexProtectingCallbackData.Unlock();
+        unsigned int n8k;
+
+        n8k = resample(cbData->insrc1, in8k_short, in48k_short, samplerate, g_soundCard1SampleRate, N8, nsam);
+        assert(n8k <= N8);
+
+        // optionally save "from radio" signal (write demod input to file)
+        // Really useful for testing and development as it allows us
+        // to repeat tests using off air signals
+
+        g_mutexProtectingCallbackData.Lock();
+        if (g_recFileFromRadio && (g_sfRecFile != NULL)) {
+            //printf("g_recFromRadioSamples: %d  n8k: %d \n", g_recFromRadioSamples);
+            if (g_recFromRadioSamples < n8k) {
+                sf_write_short(g_sfRecFile, in8k_short, g_recFromRadioSamples);
+                wxCommandEvent event( wxEVT_COMMAND_MENU_SELECTED, g_recFileFromRadioEventId );
+                // call stop/start record menu item, should be thread safe
+                g_parent->GetEventHandler()->AddPendingEvent( event );
+                g_recFromRadioSamples = 0;
+                //printf("finished recording g_recFromRadioSamples: %d n8k: %d!\n", g_recFileFromRadio, n8k);
+            }
+            else {
+                sf_write_short(g_sfRecFile, in8k_short, n8k);
+                g_recFromRadioSamples -= n8k;
+            }
+        }
+        g_mutexProtectingCallbackData.Unlock();
+
+        // optionally read "from radio" signal from file (read demod input from file)
+
+        g_mutexProtectingCallbackData.Lock();
+        if (g_playFileFromRadio && (g_sfPlayFileFromRadio != NULL)) {
+            unsigned int nsf = n8k*g_sfFs/samplerate;
+            short        insf_short[nsf];
+            unsigned int n = sf_read_short(g_sfPlayFileFromRadio, insf_short, nsf);
+            n8k = resample(cbData->insrcsf, in8k_short, insf_short, samplerate, g_sfFs, N8, nsf);
+            //fprintf(g_logfile, "n: %d nsnf: %d n8k: %d\n", n, nsf, n8k);
+            assert(n8k <= N8);
+
+            if (n == 0) {
+                if (g_loopPlayFileFromRadio)
+                    sf_seek(g_sfPlayFileFromRadio, 0, SEEK_SET);
+                else {
+                    printf("playFileFromRadio finished, issuing event!\n");
+                    wxCommandEvent event( wxEVT_COMMAND_MENU_SELECTED, g_playFileFromRadioEventId );
+                    // call stop/start play menu item, should be thread safe
+                    g_parent->GetEventHandler()->AddPendingEvent( event );
+                }
+            }
+        }
+        g_mutexProtectingCallbackData.Unlock();
+
+        resample_for_plot(g_plotDemodInFifo, in8k_short, n8k, samplerate);
+
+        // send latest squelch level to FreeDV API, as it handles squelch internally
+
+        g_pfreedv->squelch_en = g_SquelchActive;
+        g_pfreedv->snr_squelch_thresh = g_SquelchLevel;
+        //fprintf(g_logfile, "snr_squelch_thresh: %f\n",  g_pfreedv->snr_squelch_thresh);
+
+        // Get some audio to send to headphones/speaker.  If in analog
+        // mode we pass thru the "from radio" audio to the
+        // headphones/speaker.
+
+        if (g_analog) {
+            memcpy(out8k_short, in8k_short, sizeof(short)*n8k);
+            
+            // compute rx spectrum 
+
+            COMP  rx_fdm[n8k];
+            float rx_spec[MODEM_STATS_NSPEC];
+            unsigned int   i;
+
+            for(i=0; i<n8k; i++) {
+                rx_fdm[i].real = in8k_short[i];
+                rx_fdm[i].imag = 0.0;
+            }            
+            modem_stats_get_rx_spectrum(&g_stats, rx_spec, rx_fdm, n8k);
+
+            // Average rx spectrum data using a simple IIR low pass filter
+
+            for(i = 0; i<MODEM_STATS_NSPEC; i++) {
+                g_avmag[i] = BETA * g_avmag[i] + (1.0 - BETA) * rx_spec[i];
+            }
+        }
+        else {
+            fifo_write(cbData->rxinfifo, in8k_short, n8k);
+            per_frame_rx_processing(cbData->rxoutfifo, cbData->rxinfifo);
+            memset(out8k_short, 0, sizeof(short)*N8);
+            fifo_read(cbData->rxoutfifo, out8k_short, N8);
+        }
+
+
+        // Optional Spk Out EQ Filtering, need mutex as filter can change at run time
+        g_mutexProtectingCallbackData.Lock();
+        if (cbData->spkOutEQEnable) {
+            sox_biquad_filter(cbData->sbqSpkOutBass,   out8k_short, out8k_short, N8);
+            sox_biquad_filter(cbData->sbqSpkOutTreble, out8k_short, out8k_short, N8);
+            sox_biquad_filter(cbData->sbqSpkOutMid,    out8k_short, out8k_short, N8);
+        }
+        g_mutexProtectingCallbackData.Unlock();
+
+        resample_for_plot(g_plotSpeechOutFifo, out8k_short, N8, FS);
+
+        g_mutexProtectingCallbackData.Lock();
+        if (g_nSoundCards == 1) {
+            nout = resample(cbData->outsrc2, out48k_short, out8k_short, g_soundCard1SampleRate, FS, N48, N8);
+            fifo_write(cbData->outfifo1, out48k_short, nout);
+        }
+        else {
+            nout = resample(cbData->outsrc2, out48k_short, out8k_short, g_soundCard2SampleRate, FS, N48, N8);
+            fifo_write(cbData->outfifo2, out48k_short, nout);
+        }
+    }
+    g_mutexProtectingCallbackData.Unlock();
+
+    //
+    //  TX side processing --------------------------------------------
+    //
+
+    if ((g_nSoundCards == 2) && ((g_half_duplex && g_tx) || !g_half_duplex)) {
+        int ret;
+
+        // Make sure we have q few frames of modulator output
+        // samples.  This also locks the modulator to the sample rate
+        // of sound card 1.  We want to make sure that modulator
+        // samples are uninterrupted by differences in sample rate
+        // between this sound card and sound card 2.
+
+        g_mutexProtectingCallbackData.Lock();
+        while((unsigned)fifo_used(cbData->outfifo1) < 6*N48)
+        {
+            g_mutexProtectingCallbackData.Unlock();
+
+            int   nsam = g_soundCard2SampleRate * g_pfreedv->n_speech_samples/FS;
+            assert(nsam <= 4*N48);
+
+            // infifo2 is written to by another sound card so it may
+            // over or underflow, but we don't realy care.  It will
+            // just result in a short interruption in audio being fed
+            // to codec2_enc, possibly making a click every now and
+            // again in the decoded audio at the other end.
+
+            // zero speech input just in case infifo2 underflows
+            memset(in48k_short, 0, nsam*sizeof(short));
+            fifo_read(cbData->infifo2, in48k_short, nsam);
+
+            nout = resample(cbData->insrc2, in8k_short, in48k_short, FS, g_soundCard2SampleRate, 4*N8, nsam);
+
+            // optionally use file for mic input signal
+
+            g_mutexProtectingCallbackData.Lock();
+            if (g_playFileToMicIn && (g_sfPlayFile != NULL)) {
+                int n = sf_read_short(g_sfPlayFile, in8k_short, nout);
+                //fprintf(stderr, "n: %d nout: %d\n", n, nout);
+                if (n != nout) {
+                    if (g_loopPlayFileToMicIn)
+                        sf_seek(g_sfPlayFile, 0, SEEK_SET);
+                    else {
+                        wxCommandEvent event( wxEVT_COMMAND_MENU_SELECTED, g_playFileToMicInEventId );
+                        // call stop/start play menu item, should be thread safe
+                        g_parent->GetEventHandler()->AddPendingEvent( event );
+                    }
+                }
+            }
+            g_mutexProtectingCallbackData.Unlock();
+
+            // Optional Speex pre-processor for acoustic noise reduction
+
+            if (wxGetApp().m_speexpp_enable) {
+                speex_preprocess_run(g_speex_st, in8k_short);
+            }
+
+            // Optional Mic In EQ Filtering, need mutex as filter can change at run time
+
+            g_mutexProtectingCallbackData.Lock();
+            if (cbData->micInEQEnable) {
+                sox_biquad_filter(cbData->sbqMicInBass, in8k_short, in8k_short, nout);
+                sox_biquad_filter(cbData->sbqMicInTreble, in8k_short, in8k_short, nout);
+                sox_biquad_filter(cbData->sbqMicInMid, in8k_short, in8k_short, nout);
+            }
+            g_mutexProtectingCallbackData.Unlock();
+
+            resample_for_plot(g_plotSpeechInFifo, in8k_short, nout, FS);
+
+            n_samples = g_pfreedv->n_nom_modem_samples;
+
+            if (g_analog) {
+                n_samples = g_pfreedv->n_speech_samples;
+
+                // Boost the "from mic" -> "to radio" audio in analog
+                // mode.  The need for the gain was found by
+                // experiment - analog SSB sounded too quiet compared
+                // to digital. With digital voice we generally drive
+                // the "to radio" (SSB radio mic input) at about 25%
+                // of the peak level for normal SSB voice. So we
+                // introduce 6dB gain to make analog SSB sound the
+                // same level as the digital.  Watch out for clipping.
+                for(int i=0; i<n_samples; i++) {
+                    float out = (float)in8k_short[i]*2.0;
+                    if (out > 32767) out = 32767.0;
+                    if (out < -32767) out = -32767.0;
+                    out8k_short[i] = out;
+                }
+            }
+            else {
+                COMP tx_fdm[g_pfreedv->n_nom_modem_samples];
+                COMP tx_fdm_offset[g_pfreedv->n_nom_modem_samples];
+                int  i;
+
+                freedv_comptx(g_pfreedv, tx_fdm, in8k_short);
+  
+                fdmdv_freq_shift_coh(tx_fdm_offset, tx_fdm, g_TxFreqOffsetHz, g_pfreedv->modem_sample_rate, &g_TxFreqOffsetPhaseRect, g_pfreedv->n_nom_modem_samples);
+                for(i=0; i<g_pfreedv->n_nom_modem_samples; i++)
+                    out8k_short[i] = tx_fdm_offset[i].real;
+            }
+
+            // output one frame of modem signal
+            nout = resample(cbData->outsrc1, out48k_short, out8k_short, g_soundCard1SampleRate, samplerate, N48*4, n_samples);
+            g_mutexProtectingCallbackData.Lock();
+            ret = fifo_write(cbData->outfifo1, out48k_short, nout);
+            //fprintf(stderr,"nout: %d ret: %d N48*4: %d\n", nout, ret, N48*4);
+
+            assert(ret != -1);
+        }
+        g_mutexProtectingCallbackData.Unlock();
+    }
+   
+    //fprintf(g_logfile, "  end infifo1: %5d outfifo2: %5d\n", fifo_used(cbData->infifo1), fifo_used(cbData->outfifo2));
+
+}
+
+//----------------------------------------------------------------
+// per_frame_rx_processing()
+//----------------------------------------------------------------
+
+void per_frame_rx_processing(
+                                            FIFO    *output_fifo,   // decoded speech samples
+                                            FIFO    *input_fifo
+                                        )
+{
+    short               input_buf[g_pfreedv->n_max_modem_samples];
+    short               output_buf[g_pfreedv->n_speech_samples];
+    COMP                rx_fdm[g_pfreedv->n_max_modem_samples];
+    COMP                rx_fdm_offset[g_pfreedv->n_max_modem_samples];
+    float               rx_spec[MODEM_STATS_NSPEC];
+    int                 i;
+    int                 nin, nin_prev, nout;
+
+    nin = freedv_nin(g_pfreedv);
+    while (fifo_read(input_fifo, input_buf, nin) == 0)
+    {
+        assert(nin <= g_pfreedv->n_max_modem_samples);
+
+        nin_prev = nin;
+        //fwrite(input_buf, sizeof(short), nin, ft);
+
+        // demod per frame processing
+        for(i=0; i<nin; i++)
+        {
+            rx_fdm[i].real = (float)input_buf[i];
+            rx_fdm[i].imag = 0.0;
+        }
+       
+        if (g_channel_noise) {
+            float snr;
+
+            /* enough noise to get a couple of % errors */
+
+            if (g_pfreedv->mode == FREEDV_MODE_1600)
+                snr = 2.0;
+             if (g_pfreedv->mode == FREEDV_MODE_700)
+                snr = -1.0;           
+            fdmdv_simulate_channel(&g_sig_pwr_av, rx_fdm, nin, snr);
+        }
+        fdmdv_freq_shift_coh(rx_fdm_offset, rx_fdm, g_RxFreqOffsetHz, g_pfreedv->modem_sample_rate, &g_RxFreqOffsetPhaseRect, nin);
+        nout = freedv_comprx(g_pfreedv, output_buf, rx_fdm_offset);
+        
+        fifo_write(output_fifo, output_buf, nout);
+        
+        nin = freedv_nin(g_pfreedv);
+        g_State = g_pfreedv->sync;
+        //fprintf(g_logfile, "g_State: %d g_stats.sync: %d snr: %f \n", g_State, g_stats.sync, f->snr);
+
+        // compute rx spectrum 
+
+        modem_stats_get_rx_spectrum(&g_stats, rx_spec, rx_fdm, nin_prev);
+        // Average rx spectrum data using a simple IIR low pass filter
+
+        for(i = 0; i<MODEM_STATS_NSPEC; i++) {
+            g_avmag[i] = BETA * g_avmag[i] + (1.0 - BETA) * rx_spec[i];
+        }
+
+        if (g_pfreedv->mode == FREEDV_MODE_1600)
+            fdmdv_get_demod_stats(g_pfreedv->fdmdv, &g_stats);
+        if (g_pfreedv->mode == FREEDV_MODE_700)
+            cohpsk_get_demod_stats(g_pfreedv->cohpsk, &g_stats);
+
+    }
+}
+
+
+//-------------------------------------------------------------------------
+// rxCallback()
+//
+// Sound card 1 callback from PortAudio, that is used for processing rx
+// side:
+//
+// + infifo1 is the "from radio" off air modem signal from the SSB rx that we send to the demod.
+// + In single sound card mode outfifo1 is the "to speaker/headphones" decoded speech output.
+// + In dual sound card mode outfifo1 is the "to radio" modulator signal to the SSB tx.
+//
+//-------------------------------------------------------------------------
+int MainFrame::rxCallback(
+                            const void      *inputBuffer,
+                            void            *outputBuffer,
+                            unsigned long   framesPerBuffer,
+                            const PaStreamCallbackTimeInfo* timeInfo,
+                            PaStreamCallbackFlags statusFlags,
+                            void            *userData
+                         )
+{
+    paCallBackData  *cbData = (paCallBackData*)userData;
+    short           *rptr    = (short*)inputBuffer;
+    short           *wptr    = (short*)outputBuffer;
+
+    short           indata[MAX_FPB];
+    short           outdata[MAX_FPB];
+
+    unsigned int    i;
+
+    (void) timeInfo;
+    (void) statusFlags;
+
+    wxMutexLocker lock(g_mutexProtectingCallbackData);
+
+    //fprintf(g_logfile, "cb1 statusFlags: 0x%x framesPerBuffer: %d rptr: 0x%x wptr: 0x%x \n", (int)statusFlags,
+    //        framesPerBuffer, rptr, wptr);
+
+    //
+    //  RX side processing --------------------------------------------
+    //
+
+    // assemble a mono buffer and write to FIFO
+
+    assert(framesPerBuffer < MAX_FPB);
+
+    if(rptr) {
+        //fprintf(g_logfile,"in %ld %d\n",  framesPerBuffer, g_in++);
+        //g_indata += framesPerBuffer;
+        for(i = 0; i < framesPerBuffer; i++, rptr += cbData->inputChannels1)
+            indata[i] = rptr[0];                       
+        if (fifo_write(cbData->infifo1, indata, framesPerBuffer)) {
+            //fprintf(g_logfile, "infifo1 full\n");
+        }
+        //fifo_write(cbData->outfifo1, indata, framesPerBuffer);
+    }
+
+    // OK now set up output samples for this callback
+
+    if(wptr) {
+        //fprintf(g_logfile,"out %ld %d\n",  framesPerBuffer, g_out++);
+        if (fifo_read(cbData->outfifo1, outdata, framesPerBuffer) == 0) {
+
+            // write signal to both channels
+
+            for(i = 0; i < framesPerBuffer; i++, wptr += 2) {
+                if (cbData->leftChannelVoxTone) {
+                    cbData->voxTonePhase += 2.0*M_PI*VOX_TONE_FREQ/g_soundCard1SampleRate;
+                    cbData->voxTonePhase -= 2.0*M_PI*floor(cbData->voxTonePhase/(2.0*M_PI));
+                    wptr[0] = VOX_TONE_AMP*cos(cbData->voxTonePhase);                              
+                    //printf("%f %d\n", cbData->voxTonePhase, wptr[0]);
+                }
+                else
+                    wptr[0] = outdata[i];
+                               
+                wptr[1] = outdata[i];
+            }
+        }
+        else {
+            //fprintf(g_logfile, "outfifo1 empty\n");
+            // zero output if no data available
+            for(i = 0; i < framesPerBuffer; i++, wptr += 2) {
+                wptr[0] = 0;
+                wptr[1] = 0;
+            }
+        }
+    }
+
+    return paContinue;
+}
+
+
+//-------------------------------------------------------------------------
+// txCallback()
+//-------------------------------------------------------------------------
+int MainFrame::txCallback(
+                            const void *inputBuffer,
+                            void *outputBuffer,
+                            unsigned long framesPerBuffer,
+                            const PaStreamCallbackTimeInfo *outTime,
+                            PaStreamCallbackFlags statusFlags,
+                            void *userData
+                        )
+{
+    paCallBackData  *cbData = (paCallBackData*)userData;
+    unsigned int    i;
+    short           *rptr    = (short*)inputBuffer;
+    short           *wptr    = (short*)outputBuffer;
+    short           indata[MAX_FPB];
+    short           outdata[MAX_FPB];
+
+    wxMutexLocker lock(g_mutexProtectingCallbackData);
+
+    //    if (statusFlags)
+    //    printf("cb2 statusFlags: 0x%x\n", (int)statusFlags);
+
+    // assemble a mono buffer and write to FIFO
+
+    assert(framesPerBuffer < MAX_FPB);
+
+    if(rptr) {
+        for(i = 0; i < framesPerBuffer; i++, rptr += cbData->inputChannels2)
+            indata[i] = rptr[0];                        
+    }
+
+    //#define SC2_LOOPBACK
+#ifdef SC2_LOOPBACK
+    //TODO: This doesn't work unless using the same soundcard!
+
+    if(wptr) {
+        for(i = 0; i < framesPerBuffer; i++, wptr += 2) {
+            wptr[0] = indata[i];
+            wptr[1] = indata[i];
+        }
+    }
+
+#else
+    if(rptr) {
+        if (fifo_write(cbData->infifo2, indata, framesPerBuffer)) {
+            //fprintf(g_logfile, "infifo2 full\n");
+        }
+    }
+
+    // OK now set up output samples for this callback
+
+    if(wptr) {
+        if (fifo_read(cbData->outfifo2, outdata, framesPerBuffer) == 0) {
+               
+            // write signal to both channels */
+            for(i = 0; i < framesPerBuffer; i++, wptr += 2) {
+                wptr[0] = outdata[i];
+                wptr[1] = outdata[i];
+            }
+        }
+        else {
+            //fprintf(g_logfile, "outfifo2 empty\n");
+            // zero output if no data available
+            for(i = 0; i < framesPerBuffer; i++, wptr += 2) {
+                wptr[0] = 0;
+                wptr[1] = 0;
+            }
+        }
+    }
+#endif
+    return paContinue;
+}
+
+// Callback from plot_spectrum & plot_waterfall.  would be nice to
+// work out a way to do this without globals.
+
+void fdmdv2_clickTune(float freq) {
+
+    // The demod is hard-wired to expect a centre frequency of
+    // FDMDV_FCENTRE.  So we want to take the signal centered on the
+    // click tune freq and re-centre it on FDMDV_FCENTRE.  For example
+    // if the click tune freq is 1500Hz, and FDMDV_CENTRE is 1200 Hz,
+    // we need to shift the input signal centred on 1500Hz down to
+    // 1200Hz, an offset of -300Hz.
+
+    if (g_split) {
+        g_RxFreqOffsetHz = FDMDV_FCENTRE - freq;
+    }
+    else {
+        g_TxFreqOffsetHz = freq - FDMDV_FCENTRE;
+        g_RxFreqOffsetHz = FDMDV_FCENTRE - freq;
+    }
+}
+
+//----------------------------------------------------------------
+// SetupSerialPort()
+//----------------------------------------------------------------
+void MainFrame::SetupSerialPort(void)
+{
+    if(!wxGetApp().m_strRigCtrlPort.IsEmpty())
+    {
+        if(openComPort(wxGetApp().m_strRigCtrlPort.c_str()))
+        {
+            // always start PTT in Rx state
+            SerialPTTRx();
+        }
+        else
+        {
+            wxMessageBox("Couldn't open Serial Port", wxT("About"), wxOK | wxICON_ERROR, this);
+        }
+    }
+}
+
+void MainFrame::SerialPTTRx(void)
+{
+    printf("m_boolUseRTS: %d m_boolRTSPos: %d m_boolUseDTR: %d m_boolDTRPos: %d\n",
+           wxGetApp().m_boolUseRTS, wxGetApp().m_boolRTSPos, wxGetApp().m_boolUseDTR, wxGetApp().m_boolDTRPos);
+
+        if(wxGetApp().m_boolRTSPos) // RTS cleared LOW
+            lowerRTS();
+        else                        // RTS cleared HIGH
+            raiseRTS();
+
+        if(wxGetApp().m_boolDTRPos) // DTR cleared LOW
+            lowerDTR();
+        else                        // DTR cleared HIGH
+            raiseDTR();
+}
+
+//----------------------------------------------------------------
+// CloseSerialPort()
+//----------------------------------------------------------------
+void MainFrame::CloseSerialPort(void)
+{
+    if (com_handle != COM_HANDLE_INVALID) {
+        // always end with PTT in rx state
+
+        SerialPTTRx();
+
+               closeComPort();
+    }
+}
+
+
+//----------------------------------------------------------------
+// PollUDP() - see if any commands on UDP port
+//----------------------------------------------------------------
+
+// test this puppy with netcat: 
+//   $ echo "hello" | nc -u -q1 localhost 3000
+
+int MainFrame::PollUDP(void)
+{
+    // this will block until message received, so we put it in it's own thread
+
+    char buf[1024];
+    char reply[80];
+    size_t n = m_udp_sock->RecvFrom(m_udp_addr, buf, sizeof(buf)).LastCount();
+
+    if (n) {
+        wxString bufstr = wxString::From8BitData(buf, n);
+        bufstr.Trim();
+        wxString ipaddr = m_udp_addr.IPAddress();
+        printf("Received: \"%s\" from %s:%u\n",
+               (const char *)bufstr.c_str(),
+               (const char *)ipaddr.c_str(), m_udp_addr.Service());
+
+        // for security only accept commands from local host
+
+        sprintf(reply,"nope\n");
+        if (ipaddr.Cmp(_("127.0.0.1")) == 0) {
+
+            // process commands
+
+            if (bufstr.Cmp(_("restore")) == 0) {
+                m_schedule_restore = true;  // Make Restore happen in main thread to avoid crashing
+                sprintf(reply,"ok\n");
+            }
+                
+            wxString itemToSet, val;
+            if (bufstr.StartsWith(_("set "), &itemToSet)) {
+                if (itemToSet.StartsWith("txtmsg ", &val)) {
+                    // note: if options dialog is open this will get overwritten
+                    wxGetApp().m_callSign = val;
+                }  
+                sprintf(reply,"ok\n");
+            }
+                
+        }
+        else {
+            printf("We only accept messages from locahost!\n");
+        }
+
+       if ( m_udp_sock->SendTo(m_udp_addr, reply, strlen(reply)).LastCount() != strlen(reply)) {
+           printf("ERROR: failed to send data\n");
+        }
+    }
+
+    return n;
+}
+
+void MainFrame::startUDPThread(void) {
+    printf("starting UDP thread!\n");
+    m_UDPThread = new UDPThread;
+    m_UDPThread->mf = this;
+    if (m_UDPThread->Create() != wxTHREAD_NO_ERROR ) {
+        wxLogError(wxT("Can't create thread!"));
+    }
+    if (m_UDPThread->Run() != wxTHREAD_NO_ERROR ) {
+        wxLogError(wxT("Can't start thread!"));
+        delete m_UDPThread;
+    }
+}
+
+void MainFrame::stopUDPThread(void) {
+    printf("stopping UDP thread!\n");
+    if ((m_UDPThread != NULL) && m_UDPThread->m_run) {
+        m_UDPThread->m_run = 0;
+        m_UDPThread->Wait();
+        m_UDPThread = NULL;
+    }
+}
+
+void *UDPThread::Entry() {
+    printf("UDP thread started!\n");
+    while (m_run) {
+        if (wxGetApp().m_udp_enable) {
+            printf("m_udp_enable\n");
+            mf->m_udp_addr.Service(wxGetApp().m_udp_port);
+            mf->m_udp_sock = new wxDatagramSocket(mf->m_udp_addr, wxSOCKET_NOWAIT);
+
+            while (m_run && wxGetApp().m_udp_enable) {
+                if (mf->PollUDP() == 0) {
+                    wxThread::Sleep(20);
+                }
+            }
+
+            delete mf->m_udp_sock;
+        }
+        wxThread::Sleep(20);
+    }
+    return NULL;
+}
+
+
+char my_get_next_tx_char(void *callback_state) {
+    short ch = 0;
+    
+    fifo_read(g_txDataInFifo, &ch, 1);
+    //fprintf(stderr, "get_next_tx_char: %c\n", (char)ch);
+    return (char)ch;
+}
+
+void my_put_next_rx_char(void *callback_state, char c) {
+    short ch = (short)c;
+    //fprintf(stderr, "put_next_rx_char: %c\n", (char)c);
+    fifo_write(g_rxDataOutFifo, &ch, 1);
+}
+
+// Callback from FreeDv API to update error plots
+
+void my_freedv_put_error_pattern(void *state, short error_pattern[], int sz_error_pattern) {
+    fifo_write(g_error_pattern_fifo, error_pattern, sz_error_pattern);
+}
diff --git a/freedv/tags/0.99-Beta/src/fdmdv2_main.h b/freedv/tags/0.99-Beta/src/fdmdv2_main.h
new file mode 100644 (file)
index 0000000..25a1e70
--- /dev/null
@@ -0,0 +1,614 @@
+//==========================================================================
+// Name:            fdmdv2_main.h
+//
+// Purpose:         Declares simple wxWidgets application with GUI.
+// Created:         Apr. 9, 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 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 License
+//  along with this program; if not, see <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#ifndef __FDMDV2_MAIN__
+#define __FDMDV2_MAIN__
+
+#include "version.h"
+#ifndef _NO_AUTOTOOLS_
+#include "../config.h"
+#endif
+#include <wx/wx.h>
+
+#include <wx/tglbtn.h>
+#include <wx/app.h>
+//#include <wx/aboutdlg.h>
+#include "wx/rawbmp.h"
+#include "wx/file.h"
+#include "wx/filename.h"
+#include "wx/config.h"
+#include <wx/fileconf.h>
+#include "wx/graphics.h"
+#include "wx/mstream.h"
+#include "wx/wfstream.h"
+#include "wx/quantize.h"
+#include "wx/scopedptr.h"
+#include "wx/stopwatch.h"
+#include "wx/versioninfo.h"
+#include <wx/sound.h>
+#include <wx/url.h>
+#include <wx/sstream.h>
+#include <wx/listbox.h>
+#include <wx/textdlg.h>
+#include <wx/regex.h>
+#include <wx/socket.h>
+
+#include <samplerate.h>
+
+#include <hamlib.h> 
+#include <stdint.h>
+#include <speex/speex_preprocess.h>
+
+#ifdef _WIN32
+#include <windows.h>
+#else
+#include <termios.h>
+#include <sys/ioctl.h>
+#endif
+
+#include "codec2.h"
+#include "codec2_fdmdv.h"
+#include "codec2_fifo.h"
+#include "golay23.h"
+#include "modem_stats.h"
+
+#include "topFrame.h"
+#include "dlg_ptt.h"
+#include "dlg_options.h"
+#include "fdmdv2_plot.h"
+#include "fdmdv2_plot_scalar.h"
+#include "fdmdv2_plot_scatter.h"
+#include "fdmdv2_plot_waterfall.h"
+#include "fdmdv2_plot_spectrum.h"
+#include "fdmdv2_pa_wrapper.h"
+#include "sndfile.h"
+#include "portaudio.h"
+#include "dlg_audiooptions.h"
+#include "dlg_filter.h"
+#include "dlg_options.h"
+#include "varicode.h"
+#include "sox_biquad.h"
+#include "comp_prim.h"
+
+#define _USE_TIMER              1
+#define _USE_ONIDLE             1
+#define _DUMMY_DATA             1
+//#define _AUDIO_PASSTHROUGH    1
+#define _REFRESH_TIMER_PERIOD   (DT*1000)
+//#define _USE_ABOUT_DIALOG       1
+
+enum {
+        ID_START = wxID_HIGHEST,
+        ID_TIMER_WATERFALL,
+        ID_TIMER_SPECTRUM,
+        ID_TIMER_SCATTER,
+        ID_TIMER_SCALAR
+     };
+
+#define EXCHANGE_DATA_IN    0
+#define EXCHANGE_DATA_OUT   1
+
+#ifdef _WIN32
+#define COM_HANDLE_INVALID                     INVALID_HANDLE_VALUE
+typedef HANDLE      com_handle_t;
+#else
+#define COM_HANDLE_INVALID                     -1
+typedef int         com_handle_t;
+#endif
+
+extern int                 g_nSoundCards;
+extern int                 g_soundCard1InDeviceNum;
+extern int                 g_soundCard1OutDeviceNum;
+extern int                 g_soundCard1SampleRate;
+extern int                 g_soundCard2InDeviceNum;
+extern int                 g_soundCard2OutDeviceNum;
+extern int                 g_soundCard2SampleRate;
+
+class MainFrame;
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class MainApp
+//
+// @class $(Name)
+// @author $(User)
+// @date $(Date)
+// @file $(CurrentFileName).$(CurrentFileExt)
+// @brief
+//
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class MainApp : public wxApp
+{
+    public:
+        virtual bool        OnInit();
+        virtual int         OnExit();
+
+        wxString            m_strVendName;
+        wxString            m_StrAppName;
+
+        wxString            m_textNumChOut;
+        wxString            m_textNumChIn;
+
+        wxString            m_strRxInAudio;
+        wxString            m_strRxOutAudio;
+        wxString            m_textVoiceInput;
+        wxString            m_textVoiceOutput;
+        wxString            m_strSampleRate;
+        wxString            m_strBitrate;
+
+        // PTT -----------------------------------
+
+        bool                m_boolHalfDuplex;
+
+        bool                m_boolHamlibUseForPTT;
+        unsigned int        m_intHamlibRig;
+        wxString            m_strHamlibSerialPort;
+        Hamlib              *m_hamlib;
+
+        bool                m_boolUseSerialPTT;
+        wxString            m_strRigCtrlPort;
+        bool                m_boolUseRTS;
+        bool                m_boolRTSPos;
+        bool                m_boolUseDTR;
+        bool                m_boolDTRPos;
+
+        // Play/Rec files
+
+        wxString            m_playFileToMicInPath;
+        wxString            m_recFileFromRadioPath;
+        unsigned int        m_recFileFromRadioSecs;
+        wxString            m_playFileFromRadioPath;
+
+        // Options dialog
+
+        wxString            m_callSign;
+        bool                m_events;
+        int                 m_events_spam_timer;
+        unsigned int        m_textEncoding;
+        bool                m_enable_checksum;
+        wxString            m_events_regexp_match;
+        wxString            m_events_regexp_replace;
+
+        bool                m_snrSlow;
+
+        // LPC Post Filter
+        bool                m_codec2LPCPostFilterEnable;
+        bool                m_codec2LPCPostFilterBassBoost;
+        float               m_codec2LPCPostFilterGamma;
+        float               m_codec2LPCPostFilterBeta;
+        
+        // Speex Pre-Processor
+        bool                m_speexpp_enable;
+
+        // Mic In Equaliser
+        float               m_MicInBassFreqHz;
+        float               m_MicInBassGaindB;
+        float               m_MicInTrebleFreqHz;
+        float               m_MicInTrebleGaindB;
+        float               m_MicInMidFreqHz;
+        float               m_MicInMidGaindB;
+        float               m_MicInMidQ;
+        bool                m_MicInEQEnable;
+
+        // Spk Out Equaliser
+        float               m_SpkOutBassFreqHz;
+        float               m_SpkOutBassGaindB;
+        float               m_SpkOutTrebleFreqHz;
+        float               m_SpkOutTrebleGaindB;
+        float               m_SpkOutMidFreqHz;
+        float               m_SpkOutMidGaindB;
+        float               m_SpkOutMidQ;
+        bool                m_SpkOutEQEnable;
+
+        // Flags for displaying windows
+        int                 m_show_wf;
+        int                 m_show_spect;
+        int                 m_show_scatter;
+        int                 m_show_timing;
+        int                 m_show_freq;
+        int                 m_show_speech_in;
+        int                 m_show_speech_out;
+        int                 m_show_demod_in;
+        int                 m_show_test_frame_errors;
+        int                 m_show_test_frame_errors_hist;
+
+        // optional vox trigger tone
+        bool                m_leftChannelVoxTone;
+
+        // UDP control port
+        bool                m_udp_enable;
+        int                 m_udp_port;
+
+        // notebook display after tx->rxtransition
+        int                 m_rxNbookCtrl;
+
+        wxRect              m_rTopWindow;
+
+        int                 m_framesPerBuffer;
+
+        bool                loadConfig();
+        bool                saveConfig();
+
+        // misc
+
+        bool       m_testFrames;
+        bool       m_channel_noise;
+        float      m_channel_snr_dB;
+
+        int        FilterEvent(wxEvent& event);
+        MainFrame *frame;
+
+        bool       m_FreeDV700txClip;
+    protected:
+};
+
+// declare global static function wxGetApp()
+DECLARE_APP(MainApp)
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// paCallBackData
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+typedef struct
+{
+    // libresample states for 48 to 8 kHz conversions
+
+    SRC_STATE      *insrc1;
+    SRC_STATE      *outsrc1;
+    SRC_STATE      *insrc2;
+    SRC_STATE      *outsrc2;
+    SRC_STATE      *insrcsf;
+
+    // FIFOs attached to first sound card
+
+    struct FIFO    *infifo1;
+    struct FIFO    *outfifo1;
+
+    // FIFOs attached to second sound card
+    struct FIFO    *infifo2;
+    struct FIFO    *outfifo2;
+
+    // FIFOs for rx process
+    struct FIFO    *rxinfifo;
+    struct FIFO    *rxoutfifo;
+
+    int             inputChannels1, inputChannels2;
+
+    // EQ filter states
+    void           *sbqMicInBass;
+    void           *sbqMicInTreble;
+    void           *sbqMicInMid;
+    void           *sbqSpkOutBass;
+    void           *sbqSpkOutTreble;
+    void           *sbqSpkOutMid;
+
+    bool            micInEQEnable;
+    bool            spkOutEQEnable;
+
+    // optional loud tone on left channel to reliably trigger vox
+    bool            leftChannelVoxTone;
+    float           voxTonePhase;
+
+} paCallBackData;
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// panel with custom loop checkbox for play file dialog
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class MyExtraPlayFilePanel : public wxPanel
+{
+public:
+    MyExtraPlayFilePanel(wxWindow *parent);
+    void setLoopPlayFileToMicIn(bool checked) { m_cb->SetValue(checked); }
+    bool getLoopPlayFileToMicIn(void) { return m_cb->GetValue(); }
+private:
+    wxCheckBox *m_cb;
+};
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// panel with custom Seconds-to-record control for record file dialog
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class MyExtraRecFilePanel : public wxPanel
+{
+public:
+    MyExtraRecFilePanel(wxWindow *parent);
+    ~MyExtraRecFilePanel() 
+    {
+        wxLogDebug("Destructor\n");
+    }
+    void setSecondsToRecord(wxString value) { m_secondsToRecord->SetValue(value); }
+    wxString getSecondsToRecord(void) 
+    { 
+        wxLogDebug("getSecondsToRecord: %s\n",m_secondsToRecord->GetValue());
+        return m_secondsToRecord->GetValue(); 
+    }
+private:
+    wxTextCtrl *m_secondsToRecord;
+};
+
+class txRxThread;
+class UDPThread;
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class MainFrame
+//
+// @class $(Name)
+// @author $(User)
+// @date $(Date)
+// @file $(CurrentFileName).$(CurrentFileExt)
+// @brief
+//
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class MainFrame : public TopFrame
+{
+    public:
+        MainFrame(wxWindow *parent);
+        virtual ~MainFrame();
+
+        PlotSpectrum*           m_panelSpectrum;
+        PlotWaterfall*          m_panelWaterfall;
+        PlotScatter*            m_panelScatter;
+        PlotScalar*             m_panelTimeOffset;
+        PlotScalar*             m_panelFreqOffset;
+        PlotScalar*             m_panelSpeechIn;
+        PlotScalar*             m_panelSpeechOut;
+        PlotScalar*             m_panelDemodIn;
+        PlotScalar*             m_panelTestFrameErrors;
+        PlotScalar*             m_panelTestFrameErrorsHist;
+
+        bool                    m_RxRunning;
+
+        PortAudioWrap           *m_rxInPa;
+        PortAudioWrap           *m_rxOutPa;
+        PortAudioWrap           *m_txInPa;
+        PortAudioWrap           *m_txOutPa;
+
+        PaError                 m_rxErr;
+        PaError                 m_txErr;
+        
+        txRxThread*             m_txRxThread;
+
+        bool                    OpenHamlibRig();
+        void                    SetupSerialPort(void);
+        void                    CloseSerialPort(void);
+        void                    SerialPTTRx(void);
+
+        bool                    m_modal;
+
+#ifdef _USE_TIMER
+        wxTimer                 m_plotTimer;
+#endif
+
+    void destroy_fifos(void);
+    void destroy_src(void);
+    void autoDetectSoundCards(PortAudioWrap *pa);
+
+        static int rxCallback(
+                                const void *inBuffer,
+                                void *outBuffer,
+                                unsigned long framesPerBuffer,
+                                const PaStreamCallbackTimeInfo *outTime,
+                                PaStreamCallbackFlags statusFlags,
+                                void *userData
+                             );
+        static int txCallback(
+                                const void *inBuffer,
+                                void *outBuffer,
+                                unsigned long framesPerBuffer,
+                                const PaStreamCallbackTimeInfo *outTime,
+                                PaStreamCallbackFlags statusFlags,
+                                void *userData
+                             );
+
+
+    void initPortAudioDevice(PortAudioWrap *pa, int inDevice, int outDevice, 
+                             int soundCard, int sampleRate, int inputChannels);
+
+    void togglePTT(void);
+
+    wxIPV4address           m_udp_addr;
+    wxDatagramSocket       *m_udp_sock;
+    UDPThread              *m_UDPThread;
+    void                    startUDPThread(void);
+    void                    stopUDPThread(void);
+    int                     PollUDP();
+    bool                    m_schedule_restore;
+
+    protected:
+
+#ifdef _WIN32
+#define COM_HANDLE_INVALID                     INVALID_HANDLE_VALUE
+        com_handle_t  com_handle;
+#else
+#define COM_HANDLE_INVALID                     -1
+        com_handle_t  com_handle;
+#endif
+        void raiseDTR(void);
+        void lowerDTR(void);
+        void raiseRTS(void);
+        void lowerRTS(void);
+        bool openComPort(const char *port);
+        void closeComPort(void);
+
+        void setsnrBeta(bool snrSlow);
+
+        // protected event handlers
+        virtual void OnCloseFrame(wxCloseEvent& event);
+        void OnExitClick(wxCommandEvent& event);
+
+        void startTxStream();
+        void startRxStream();
+        void stopTxStream();
+        void stopRxStream();
+        void abortTxStream();
+        void abortRxStream();
+        
+        void OnTop(wxCommandEvent& event);
+        void OnExit( wxCommandEvent& event );
+
+        void OnToolsAudio( wxCommandEvent& event );
+        void OnToolsAudioUI( wxUpdateUIEvent& event );
+        void OnToolsComCfg( wxCommandEvent& event );
+        void OnToolsComCfgUI( wxUpdateUIEvent& event );
+        void OnToolsFilter( wxCommandEvent& event );
+        void OnToolsOptions(wxCommandEvent& event);
+        void OnToolsOptionsUI(wxUpdateUIEvent& event);
+
+        void OnPlayFileToMicIn( wxCommandEvent& event );
+        void OnRecFileFromRadio( wxCommandEvent& event );
+        void OnPlayFileFromRadio( wxCommandEvent& event );
+
+        void OnHelpCheckUpdates( wxCommandEvent& event );
+        void OnHelpCheckUpdatesUI( wxUpdateUIEvent& event );
+        void OnHelpAbout( wxCommandEvent& event );
+        void OnCmdSliderScroll( wxScrollEvent& event );
+//        void OnSliderScrollBottom( wxScrollEvent& event );
+//        void OnCmdSliderScrollChanged( wxScrollEvent& event );
+//        void OnSliderScrollTop( wxScrollEvent& event );
+        void OnCheckSQClick( wxCommandEvent& event );
+        void OnCheckSNRClick( wxCommandEvent& event );
+
+        // Toggle Buttons
+        void OnTogBtnSplitClick(wxCommandEvent& event);
+        void OnTogBtnAnalogClick(wxCommandEvent& event);
+        void OnTogBtnRxID( wxCommandEvent& event );
+        void OnTogBtnTxID( wxCommandEvent& event );
+        void OnTogBtnPTT( wxCommandEvent& event );
+        void OnTogBtnOnOff( wxCommandEvent& event );
+
+        void OnCallSignReset( wxCommandEvent& event );
+        void OnBerReset( wxCommandEvent& event );
+
+        //System Events
+        void OnPaint(wxPaintEvent& event);
+        void OnSize( wxSizeEvent& event );
+        void OnUpdateUI( wxUpdateUIEvent& event );
+        void OnDeleteConfig(wxCommandEvent&);
+#ifdef _USE_TIMER
+        void OnTimer(wxTimerEvent &evt);
+#endif
+#ifdef _USE_ONIDLE
+        void OnIdle(wxIdleEvent &evt);
+#endif
+
+    private:
+        bool        m_useMemory;
+        wxTextCtrl* m_tc;
+        int         m_zoom;
+        float       m_snrBeta;
+        
+        // Callsign/text messaging
+        char        m_callsign[MAX_CALLSIGN];
+        char       *m_pcallsign;
+        unsigned int m_checksumGood;
+        unsigned int m_checksumBad;
+        
+        // Events
+        void        processTxtEvent(char event[]);
+        class OptionsDlg *optionsDlg;
+        wxTimer     spamTimer[MAX_EVENT_RULES];
+
+        // level Gauge
+        float       m_maxLevel;
+        // flags to indicate when new EQ filters need to be designed
+
+        bool        m_newMicInFilter;
+        bool        m_newSpkOutFilter;
+
+        void*       designAnEQFilter(const char filterType[], float freqHz, float gaindB, float Q = 0.0);
+        void        designEQFilters(paCallBackData *cb);
+        void        deleteEQFilters(paCallBackData *cb);
+};
+
+void txRxProcessing();
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// class txRxThread - experimental tx/rx processing thread
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class txRxThread : public wxThread
+{
+public:
+    txRxThread(void) : wxThread(wxTHREAD_JOINABLE) { m_run = 1; }
+
+    // thread execution starts here
+    void *Entry() 
+    {
+        while (m_run) 
+        {
+            txRxProcessing();        
+            wxThread::Sleep(20);
+        }
+        return NULL;
+    }
+
+    // called when the thread exits - whether it terminates normally or is
+    // stopped with Delete() (but not when it is Kill()ed!)
+    void OnExit() { }
+
+public:
+    bool  m_run;
+};
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// class UDPThread - waits for UDP messages
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class UDPThread : public wxThread
+{
+public:
+    UDPThread(void) : wxThread(wxTHREAD_JOINABLE) { m_run = 1; }
+
+    // thread execution starts here
+    void *Entry();
+
+    // called when the thread exits - whether it terminates normally or is
+    // stopped with Delete() (but not when it is Kill()ed!)
+    void OnExit() { }
+
+public:
+    MainFrame              *mf;
+    bool                    m_run;
+};
+
+void resample_for_plot(struct FIFO *plotFifo, short buf[], int length, int fs);
+
+int resample(SRC_STATE *src,
+             short      output_short[],
+             short      input_short[],
+             int        output_sample_rate,
+             int        input_sample_rate,
+             int        length_output_short, // maximum output array length in samples
+             int        length_input_short
+             );
+void txRxProcessing();
+void per_frame_rx_processing(
+                                        FIFO    *output_fifo,   // decoded speech samples
+                                        FIFO    *input_fifo     // modem samples input to demod
+                                    );
+
+// FreeDv API calls this when there is a test frame that needs a-plottin'
+
+void my_freedv_put_error_pattern(void *state, short error_pattern[], int sz_error_pattern);
+
+// FreeDv API calls these puppies when it needs/receives a text char 
+
+char my_get_next_tx_char(void *callback_state);
+void my_put_next_rx_char(void *callback_state, char c);
+
+#endif //__FDMDV2_MAIN__
diff --git a/freedv/tags/0.99-Beta/src/fdmdv2_pa_wrapper.cpp b/freedv/tags/0.99-Beta/src/fdmdv2_pa_wrapper.cpp
new file mode 100644 (file)
index 0000000..2f67ca2
--- /dev/null
@@ -0,0 +1,324 @@
+//==========================================================================
+// Name:            fdmdv2_pa_wrapper.cpp
+// Purpose:         Implements a wrapper class around the PortAudio library.
+// Created:         August 12, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#include "fdmdv2_pa_wrapper.h"
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// PortAudioWrap()
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+PortAudioWrap::PortAudioWrap()
+{
+    m_pStream                   = NULL;
+    m_pUserData                 = NULL;
+    m_samplerate                = 0;
+    m_framesPerBuffer           = 0;
+    m_statusFlags               = 0;
+    m_pStreamCallback           = NULL;
+    m_pStreamFinishedCallback   = NULL;
+    m_pTimeInfo                 = 0;
+    m_newdata                   = false;
+
+//    loadData();
+}
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// ~PortAudioWrap()
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+PortAudioWrap::~PortAudioWrap()
+{
+}
+
+//----------------------------------------------------------------
+// streamOpen()
+//----------------------------------------------------------------
+PaError PortAudioWrap::streamOpen()
+{
+    return Pa_OpenStream(
+                            &m_pStream,
+                            m_inputBuffer.device == paNoDevice ? NULL : &m_inputBuffer,
+                            m_outputBuffer.device == paNoDevice ? NULL : &m_outputBuffer,
+                            m_samplerate,
+                            m_framesPerBuffer,
+                            m_statusFlags,
+                            *m_pStreamCallback,
+                            m_pUserData
+                        );
+}
+
+//----------------------------------------------------------------
+// streamStart()
+//----------------------------------------------------------------
+PaError PortAudioWrap::streamStart()
+{
+    return Pa_StartStream(m_pStream);
+}
+
+//----------------------------------------------------------------
+// streamClose()
+//----------------------------------------------------------------
+PaError PortAudioWrap::streamClose()
+{
+    if(isOpen())
+    {
+        PaError rv = Pa_CloseStream(m_pStream);
+        return rv;
+    }
+    else
+    {
+        return paNoError;
+    }
+}
+
+//----------------------------------------------------------------
+// terminate()
+//----------------------------------------------------------------
+void PortAudioWrap::terminate()
+{
+    if(Pa_IsStreamStopped(m_pStream) != paNoError)
+    {
+        Pa_StopStream(m_pStream);
+    }
+    Pa_Terminate();
+}
+
+//----------------------------------------------------------------
+// stop()
+//----------------------------------------------------------------
+void PortAudioWrap::stop()
+{
+    Pa_StopStream(m_pStream);
+}
+
+//----------------------------------------------------------------
+// abort()
+//----------------------------------------------------------------
+void PortAudioWrap::abort()
+{
+    Pa_AbortStream(m_pStream);
+}
+
+//----------------------------------------------------------------
+// isStopped()
+//----------------------------------------------------------------
+bool PortAudioWrap::isStopped() const
+{
+    PaError ret = Pa_IsStreamStopped(m_pStream);
+    return ret;
+}
+
+//----------------------------------------------------------------
+// isActive()
+//----------------------------------------------------------------
+bool PortAudioWrap::isActive() const
+{
+    PaError ret = Pa_IsStreamActive(m_pStream);
+    return ret;
+}
+
+//----------------------------------------------------------------
+// isOpen()
+//----------------------------------------------------------------
+bool PortAudioWrap::isOpen() const
+{
+    return (m_pStream != NULL);
+}
+
+//----------------------------------------------------------------
+// getDefaultInputDevice()
+//----------------------------------------------------------------
+PaDeviceIndex PortAudioWrap::getDefaultInputDevice()
+{
+    return Pa_GetDefaultInputDevice();
+}
+
+//----------------------------------------------------------------
+// getDefaultOutputDevice()
+//----------------------------------------------------------------
+PaDeviceIndex PortAudioWrap::getDefaultOutputDevice()
+{
+    return Pa_GetDefaultOutputDevice();
+}
+
+//----------------------------------------------------------------
+// setInputChannelCount()
+//----------------------------------------------------------------
+PaError PortAudioWrap::setInputChannelCount(int count)
+{
+    m_inputBuffer.channelCount = count;
+    return paNoError;
+}
+
+//----------------------------------------------------------------
+// getInputChannelCount()
+//----------------------------------------------------------------
+PaError PortAudioWrap::getInputChannelCount()
+{
+    return m_inputBuffer.channelCount;
+}
+
+//----------------------------------------------------------------
+// setInputSampleFormat()
+//----------------------------------------------------------------
+PaError PortAudioWrap::setInputSampleFormat(PaSampleFormat format)
+{
+    m_inputBuffer.sampleFormat = format;
+    return paNoError;
+}
+
+//----------------------------------------------------------------
+// setInputLatency()
+//----------------------------------------------------------------
+PaError PortAudioWrap::setInputLatency(PaTime latency)
+{
+    m_inputBuffer.suggestedLatency = latency;
+    return paNoError;
+}
+
+//----------------------------------------------------------------
+// setInputHostApiStreamInfo()
+//----------------------------------------------------------------
+void PortAudioWrap::setInputHostApiStreamInfo(void *info)
+{
+    m_inputBuffer.hostApiSpecificStreamInfo = info;
+}
+
+//----------------------------------------------------------------
+// getInputDefaultLowLatency()
+//----------------------------------------------------------------
+PaTime  PortAudioWrap::getInputDefaultLowLatency()
+{
+    return Pa_GetDeviceInfo(m_inputBuffer.device)->defaultLowInputLatency;
+}
+
+//----------------------------------------------------------------
+// setOutputChannelCount()
+//----------------------------------------------------------------
+PaError PortAudioWrap::setOutputChannelCount(int count)
+{
+    m_outputBuffer.channelCount = count;
+    return paNoError;
+}
+
+//----------------------------------------------------------------
+// getOutputChannelCount()
+//----------------------------------------------------------------
+const int PortAudioWrap::getOutputChannelCount()
+{
+    return m_outputBuffer.channelCount;
+}
+
+//----------------------------------------------------------------
+// getDeviceName()
+//----------------------------------------------------------------
+const char *PortAudioWrap::getDeviceName(PaDeviceIndex dev)
+{
+    const PaDeviceInfo *info;
+    info = Pa_GetDeviceInfo(dev);
+    return info->name;
+}
+
+//----------------------------------------------------------------
+// setOutputSampleFormat()
+//----------------------------------------------------------------
+PaError PortAudioWrap::setOutputSampleFormat(PaSampleFormat format)
+{
+    m_outputBuffer.sampleFormat = format;
+    return paNoError;
+}
+
+//----------------------------------------------------------------
+// setOutputLatency()
+//----------------------------------------------------------------
+PaError PortAudioWrap::setOutputLatency(PaTime latency)
+{
+    m_outputBuffer.suggestedLatency = latency;
+    return paNoError;
+}
+
+//----------------------------------------------------------------
+// setOutputHostApiStreamInfo()
+//----------------------------------------------------------------
+void PortAudioWrap::setOutputHostApiStreamInfo(void *info)
+{
+    m_outputBuffer.hostApiSpecificStreamInfo = info;
+}
+
+//----------------------------------------------------------------
+// getOutputDefaultLowLatency()
+//----------------------------------------------------------------
+PaTime  PortAudioWrap::getOutputDefaultLowLatency()
+{
+    return Pa_GetDeviceInfo(m_outputBuffer.device)->defaultLowOutputLatency;
+}
+
+//----------------------------------------------------------------
+// setFramesPerBuffer()
+//----------------------------------------------------------------
+PaError PortAudioWrap::setFramesPerBuffer(unsigned long size)
+{
+    m_framesPerBuffer = size;
+    return paNoError;
+}
+
+//----------------------------------------------------------------
+// setSampleRate()
+//----------------------------------------------------------------
+PaError PortAudioWrap::setSampleRate(unsigned long rate)
+{
+    m_samplerate = rate;
+    return paNoError;
+}
+
+//----------------------------------------------------------------
+// setStreamFlags()
+//----------------------------------------------------------------
+PaError PortAudioWrap::setStreamFlags(PaStreamFlags flags)
+{
+    m_statusFlags = flags;
+    return paNoError;
+}
+
+//----------------------------------------------------------------
+// setInputDevice()
+//----------------------------------------------------------------
+PaError PortAudioWrap::setInputDevice(PaDeviceIndex index)
+{
+    m_inputBuffer.device = index;
+    return paNoError;
+}
+
+//----------------------------------------------------------------
+// setOutputDevice()
+//----------------------------------------------------------------
+PaError PortAudioWrap::setOutputDevice(PaDeviceIndex index)
+{
+    m_outputBuffer.device = index;
+    return paNoError;
+}
+
+//----------------------------------------------------------------
+// setCallback()
+//----------------------------------------------------------------
+PaError PortAudioWrap::setCallback(PaStreamCallback *callback)
+{
+    m_pStreamCallback = callback;
+    return paNoError;
+}
+
diff --git a/freedv/tags/0.99-Beta/src/fdmdv2_pa_wrapper.h b/freedv/tags/0.99-Beta/src/fdmdv2_pa_wrapper.h
new file mode 100644 (file)
index 0000000..3d216c0
--- /dev/null
@@ -0,0 +1,115 @@
+//==========================================================================
+// Name:            fdmdv2_pa_wrapper.h
+// Purpose:         Defines a wrapper class around PortAudio
+// Created:         August 12, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#include <stdio.h>
+#include <math.h>
+#include "fdmdv2_defines.h"
+#include "codec2_fdmdv.h"
+#include "codec2.h"
+#include "portaudio.h"
+
+#define PA_SAMPLE_TYPE      paInt16         //paFloat32
+#define FRAMES_PER_BUFFER   (64)
+
+typedef float SAMPLE;
+
+class PortAudioWrap
+{
+    public:
+        PortAudioWrap();
+        ~PortAudioWrap();
+
+//        float                           m_av_mag[FDMDV_NSPEC];
+
+    private:
+        PaStream                        *m_pStream;
+        void                            *m_pUserData;
+        PaStreamCallback                *m_pStreamCallback;
+        PaStreamFinishedCallback        *m_pStreamFinishedCallback;
+        const PaStreamCallbackTimeInfo  *m_pTimeInfo;
+        struct FDMDV                    *m_pFDMDV_state;
+        PaStreamParameters              m_inputBuffer;
+        PaStreamParameters              m_outputBuffer;
+        int                             m_samplerate;
+        unsigned long                   m_framesPerBuffer;
+        PaStreamCallbackFlags           m_statusFlags;
+        bool                            m_newdata;
+
+    public:
+
+        void                averageData(float mag_dB[]);
+
+        int                 getDeviceCount() { return Pa_GetDeviceCount(); }
+        PaDeviceIndex       getDefaultInputDevice();
+        PaDeviceIndex       getDefaultOutputDevice();
+        PaStreamParameters  *getDeviceInfo(PaDeviceIndex idx);
+
+        PaError             setFramesPerBuffer(unsigned long size);
+        PaError             setSampleRate(unsigned long size);
+
+        PaError             setStreamFlags(PaStreamFlags flags);
+        PaError             setCallback(PaStreamCallback *m_pStreamCallback);
+        PaError             setStreamCallback(PaStream *stream, PaStreamCallback* callback) { m_pStreamCallback = callback; return 0;}
+        PaError             setStreamFinishedCallback(PaStream *stream, PaStreamFinishedCallback* m_pStreamFinishedCallback);
+
+        void                setInputBuffer(const PaStreamParameters& inputBuffer)   {this->m_inputBuffer = inputBuffer;}
+        PaError             setInputDevice(PaDeviceIndex dev);
+        PaError             setInputChannelCount(int count);
+        int                 getInputChannelCount();
+        PaError             setInputSampleFormat(PaSampleFormat format);
+        PaError             setInputSampleRate(PaSampleFormat format);
+        PaError             setInputLatency(PaTime latency);
+        void                setInputHostApiStreamInfo(void *info = NULL);
+        PaTime              getInputDefaultLowLatency();
+        const char          *getDeviceName(PaDeviceIndex dev);
+
+        PaError             setOutputDevice(PaDeviceIndex dev);
+        PaError             setOutputChannelCount(int count);
+        const int           getOutputChannelCount();
+        PaError             setOutputSampleFormat(PaSampleFormat format);
+        PaError             setOutputLatency(PaTime latency);
+        void                setOutputHostApiStreamInfo(void *info = NULL);
+        PaTime              getOutputDefaultLowLatency();
+
+        void                setFdmdvState(FDMDV* fdmdv_state)                       {this->m_pFDMDV_state = fdmdv_state;}
+        void                setOutputBuffer(const PaStreamParameters& outputBuffer) {this->m_outputBuffer = outputBuffer;}
+        void                setTimeInfo(PaStreamCallbackTimeInfo* timeInfo)         {this->m_pTimeInfo = timeInfo;}
+        void                setUserData(void* userData)                             {this->m_pUserData = userData;}
+        unsigned long       getFramesPerBuffer() const                              {return m_framesPerBuffer;}
+        const               PaStreamParameters& getInputBuffer() const              {return m_inputBuffer;}
+        const               PaStreamParameters& getOutputBuffer() const             {return m_outputBuffer;}
+        const               PaStreamCallbackFlags& getStatusFlags() const           {return m_statusFlags;}
+
+        FDMDV*              getFdmdvState()                                         {return m_pFDMDV_state;}
+        int                 getSamplerate() const                                   {return m_samplerate;}
+        PaStream*           getStream()                                             {return m_pStream;}
+        void                *getUserData()                                          {return m_pUserData;}
+        bool                getDataAvail()                                          {return m_newdata;}
+        PaError             streamStart();
+        PaError             streamClose();
+        PaError             streamOpen();
+        void                terminate();
+        void                stop();
+        void                abort();
+        bool                isOpen() const;
+        bool                isStopped() const;
+        bool                isActive() const;
+//        void                loadData();
+};
diff --git a/freedv/tags/0.99-Beta/src/fdmdv2_plot.cpp b/freedv/tags/0.99-Beta/src/fdmdv2_plot.cpp
new file mode 100644 (file)
index 0000000..1b85cd9
--- /dev/null
@@ -0,0 +1,283 @@
+//==========================================================================
+// Name:            fdmdv2_plot.cpp
+// Purpose:         Implements simple wxWidgets application with GUI.
+// Created:         Apr. 9, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#include <string.h>
+#include "fdmdv2_plot.h"
+
+BEGIN_EVENT_TABLE(PlotPanel, wxPanel)
+    EVT_PAINT           (PlotPanel::OnPaint)
+    EVT_MOTION          (PlotPanel::OnMouseMove)
+    EVT_LEFT_DOWN       (PlotPanel::OnMouseLeftDown)
+    EVT_LEFT_UP         (PlotPanel::OnMouseLeftUp)
+    EVT_RIGHT_DOWN      (PlotPanel::OnMouseRightDown)
+    EVT_MOUSEWHEEL      (PlotPanel::OnMouseWheelMoved)
+    EVT_SIZE            (PlotPanel::OnSize)
+    EVT_SHOW            (PlotPanel::OnShow)
+END_EVENT_TABLE()
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class PlotPanel(wxFrame* parent) : wxPanel(parent)
+//
+// @class $(Name)
+// @author $(User)
+// @date $(Date)
+// @file $(CurrentFileName).$(CurrentFileExt)
+// @brief
+//
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+PlotPanel::PlotPanel(wxFrame* parent) : wxPanel(parent)
+{
+    m_pNoteBook         = (wxAuiNotebook *) parent;
+    m_pTopFrame         = (MainFrame *)m_pNoteBook->GetParent();
+    m_zoomFactor        = 1.0;
+    m_pBmp              = NULL;
+    m_pPix              = NULL;
+    m_firstPass         = true;
+    m_line_color        = 0;
+    m_newdata           = false;
+    m_clip              = false;
+    m_use_bitmap        = true;
+    m_rubberBand        = false;
+    m_mouseDown         = false;
+    m_penShortDash      = wxPen(wxColor(0xA0, 0xA0, 0xA0), 1, wxPENSTYLE_SHORT_DASH);
+    m_penDotDash        = wxPen(wxColor(0xD0, 0xD0, 0xD0), 1, wxPENSTYLE_DOT_DASH);
+    m_penSolid          = wxPen(wxColor(0x00, 0x00, 0x00), 1, wxPENSTYLE_SOLID);
+    SetBackgroundStyle(wxBG_STYLE_PAINT);
+    SetLabelSize(10.0);
+}
+
+//-------------------------------------------------------------------------
+// ~PlotPanel()
+//-------------------------------------------------------------------------
+PlotPanel::~PlotPanel()
+{
+    if(m_pBmp != NULL)
+    {
+        delete m_pBmp;
+    }
+}
+
+//-------------------------------------------------------------------------
+// GetLabelSize()
+//-------------------------------------------------------------------------
+double PlotPanel::GetLabelSize()
+{
+    return m_label_size;
+}
+
+//-------------------------------------------------------------------------
+// SetLabelSize()
+//-------------------------------------------------------------------------
+void PlotPanel::SetLabelSize(double size)
+{
+    m_label_size = size;
+}
+
+//-------------------------------------------------------------------------
+// OnShow()
+//-------------------------------------------------------------------------
+void PlotPanel::OnShow(wxShowEvent& event)
+{
+    this->Refresh();
+}
+
+//-------------------------------------------------------------------------
+// OnErase()
+//-------------------------------------------------------------------------
+void PlotPanel::OnErase(wxEraseEvent& event)
+{
+    event.Skip();
+}
+
+//-------------------------------------------------------------------------
+// OnSize()
+//-------------------------------------------------------------------------
+void PlotPanel::OnSize(wxSizeEvent& event)
+{
+    m_rCtrlPrev = m_rCtrl;
+    m_rCtrl     = GetClientRect();
+    if(m_use_bitmap)
+    {
+        if(!m_oImage.IsOk())
+        {
+            m_oImage.Create(m_rCtrl.GetWidth(), m_rCtrl.GetHeight(), true);
+        }
+        else
+        {
+            m_oImage.Rescale(m_rCtrl.GetWidth(), m_rCtrl.GetHeight());
+        }
+        m_pBmp = new wxBitmap(m_oImage, wxBITMAP_SCREEN_DEPTH);
+        m_firstPass = true;
+    }
+    this->Refresh();
+}
+
+//-------------------------------------------------------------------------
+// OnMouseMove()
+//-------------------------------------------------------------------------
+void PlotPanel::OnMouseMove(wxMouseEvent& event)
+{
+//    if(m_mouseDown)
+//    {
+//        paintNow();
+//    }
+}
+
+//-------------------------------------------------------------------------
+// OnMouseLeftDown()
+//-------------------------------------------------------------------------
+void PlotPanel::OnMouseLeftDown(wxMouseEvent& event)
+{
+}
+
+//-------------------------------------------------------------------------
+// OnMouseRightDown()
+//-------------------------------------------------------------------------
+void PlotPanel::OnMouseRightDown(wxMouseEvent& event)
+{
+}
+
+//-------------------------------------------------------------------------
+// OnMouseWheelMoved()
+//-------------------------------------------------------------------------
+void PlotPanel::OnMouseWheelMoved(wxMouseEvent& event)
+{
+}
+
+//-------------------------------------------------------------------------
+// OnMouseLeftUp()
+//-------------------------------------------------------------------------
+void PlotPanel::OnMouseLeftUp(wxMouseEvent& event)
+{
+    m_mouseDown = false;
+}
+
+//-------------------------------------------------------------------------
+// SetZoomFactor()
+//-------------------------------------------------------------------------
+double PlotPanel::SetZoomFactor(double zf)
+{
+    if((zf > 0) && (zf < 5.0))
+    {
+        m_zoomFactor = zf;
+    }
+    return zf;
+}
+
+//-------------------------------------------------------------------------
+// GetZoomFactor()
+//-------------------------------------------------------------------------
+double PlotPanel::GetZoomFactor(double zf)
+{
+    return m_zoomFactor;
+}
+
+//-------------------------------------------------------------------------
+// draw()
+//-------------------------------------------------------------------------
+void PlotPanel::draw(wxAutoBufferedPaintDC& pDC)
+{
+    printf("PlotPanel::draw()");
+    wxMemoryDC m_mDC;
+    m_mDC.SelectObject(*m_pBmp);
+    m_rCtrl  = GetClientRect();
+    m_rGrid  = m_rCtrl;
+
+    m_rGrid = m_rGrid.Deflate(PLOT_BORDER + (XLEFT_OFFSET/2), (PLOT_BORDER + (YBOTTOM_OFFSET/2)));
+    m_rGrid.Offset(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER);
+
+    pDC.Clear();
+    m_rPlot = wxRect(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER, m_rGrid.GetWidth(), m_rGrid.GetHeight());
+    if(m_firstPass)
+    {
+        m_firstPass = false;
+        m_mDC.FloodFill(0, 0, VERY_LTGREY_COLOR);
+
+        // Draw a filled rectangle with aborder
+        wxBrush ltGraphBkgBrush = wxBrush(DARK_BLUE_COLOR);
+        m_mDC.SetBrush(ltGraphBkgBrush);
+        m_mDC.SetPen(wxPen(BLACK_COLOR, 0));
+        m_mDC.DrawRectangle(m_rPlot);
+    }
+    if(m_newdata)
+    {
+        m_newdata = false;
+        int t = m_rPlot.GetTop();
+        int l = m_rPlot.GetLeft();
+//        int r = m_rPlot.GetRight();
+        int h = m_rPlot.GetHeight();
+        int w = m_rPlot.GetWidth();
+        pDC.Blit(l, t, w, h, &m_mDC, l, t);
+    }
+    drawGraticule(pDC);
+    m_mDC.SetBrush(wxNullBrush);
+    m_mDC.SelectObject(wxNullBitmap);
+}
+
+//-------------------------------------------------------------------------
+// drawGraticule()
+//-------------------------------------------------------------------------
+void PlotPanel::drawGraticule(wxAutoBufferedPaintDC& pDC)
+{
+    int p;
+    char buf[15];
+    wxString s;
+
+    // Vertical gridlines
+    pDC.SetPen(m_penShortDash);
+    for(p = (PLOT_BORDER + XLEFT_OFFSET + GRID_INCREMENT); p < ((m_rGrid.GetWidth() - XLEFT_OFFSET) + GRID_INCREMENT); p += GRID_INCREMENT)
+    {
+        pDC.DrawLine(p, (m_rGrid.GetHeight() + PLOT_BORDER), p, PLOT_BORDER);
+    }
+    // Horizontal gridlines
+    pDC.SetPen(m_penDotDash);
+    for(p = (m_rGrid.GetHeight() - GRID_INCREMENT); p > PLOT_BORDER; p -= GRID_INCREMENT)
+    {
+        pDC.DrawLine(PLOT_BORDER + XLEFT_OFFSET, (p + PLOT_BORDER), (m_rGrid.GetWidth() + PLOT_BORDER + XLEFT_OFFSET), (p + PLOT_BORDER));
+    }
+    // Label the X-Axis
+    pDC.SetPen(wxPen(GREY_COLOR, 1));
+    for(p = GRID_INCREMENT; p < (m_rGrid.GetWidth() - YBOTTOM_OFFSET); p += GRID_INCREMENT)
+    {
+        sprintf(buf, "%1.1f Hz",(double)(p / 10));
+        pDC.DrawText(buf, p - PLOT_BORDER + XLEFT_OFFSET, m_rGrid.GetHeight() + YBOTTOM_OFFSET/2);
+    }
+    // Label the Y-Axis
+    //for(p = GRID_INCREMENT; p < (h - YBOTTOM_OFFSET); p += GRID_INCREMENT)
+    for(p = (m_rGrid.GetHeight() - GRID_INCREMENT); p > PLOT_BORDER; p -= GRID_INCREMENT)
+    {
+        sprintf(buf, "%1.0f", (double)((m_rGrid.GetHeight() - p) * -10));
+        pDC.DrawText(buf, XLEFT_TEXT_OFFSET, p);
+    }
+}
+
+//-------------------------------------------------------------------------
+// paintEvent()
+//
+// Called by the system of by wxWidgets when the panel needs
+// to be redrawn. You can also trigger this call by calling
+// Refresh()/Update().
+//-------------------------------------------------------------------------
+void PlotPanel::OnPaint(wxPaintEvent & evt)
+{
+    wxAutoBufferedPaintDC pdc(this);
+    draw(pdc);
+}
+
diff --git a/freedv/tags/0.99-Beta/src/fdmdv2_plot.h b/freedv/tags/0.99-Beta/src/fdmdv2_plot.h
new file mode 100644 (file)
index 0000000..25309d3
--- /dev/null
@@ -0,0 +1,150 @@
+//==========================================================================
+// Name:            fdmdv2_plot.h
+// Purpose:         Declares simple wxWidgets application with GUI
+// Created:         Apr. 10, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+//#include "fdmdv2_main.h"
+#ifndef __FDMDV2_PLOT__
+#define __FDMDV2_PLOT__
+#include <wx/wx.h>
+#include <wx/aui/auibook.h>
+#include <wx/rawbmp.h>
+#include <wx/image.h>
+#include <wx/dcbuffer.h>
+
+#define MAX_ZOOM            7
+#define MAX_BMP_X           (400 * MAX_ZOOM)
+#define MAX_BMP_Y           (400 * MAX_ZOOM)
+#define DATA_LINE_HEIGHT    10
+#define TEXT_BASELINE_OFFSET_Y  -5
+
+
+#define wxUSE_FILEDLG       1
+#define wxUSE_LIBPNG        1
+#define wxUSE_LIBJPEG       1
+#define wxUSE_GIF           1
+#define wxUSE_PCX           1
+#define wxUSE_LIBTIFF       1
+
+#define PLOT_BORDER         12
+#define XLEFT_OFFSET        40
+#define XLEFT_TEXT_OFFSET   6
+#define YBOTTOM_OFFSET      20
+#define YBOTTOM_TEXT_OFFSET 15
+#define GRID_INCREMENT      50
+
+#define BLACK_COLOR         wxColor(0x00, 0x00, 0x00)
+#define GREY_COLOR          wxColor(0x80, 0x80, 0x80)
+#define DARK_GREY_COLOR     wxColor(0x40, 0x40, 0x40)
+#define MEDIUM_GREY_COLOR   wxColor(0xC0, 0xC0, 0xC0)
+#define LIGHT_GREY_COLOR    wxColor(0xE0, 0xE0, 0xE0)
+#define VERY_LTGREY_COLOR   wxColor(0xF8, 0xF8, 0xF8)
+#define WHITE_COLOR         wxColor(0xFF, 0xFF, 0xFF)
+
+#define DARK_BLUE_COLOR     wxColor(0x00, 0x00, 0x60)
+#define BLUE_COLOR          wxColor(0x00, 0x00, 0xFF)
+#define LIGHT_BLUE_COLOR    wxColor(0x80, 0x80, 0xFF)
+
+#define RED_COLOR           wxColor(0xFF, 0x5E, 0x5E)
+#define LIGHT_RED_COLOR     wxColor(0xFF, 0xE0, 0xE0)
+#define DARK_RED_COLOR      wxColor(0xFF, 0x00, 0x00)
+#define PINK_COLOR          wxColor(0xFF, 0x80, 0xFF)
+
+#define LIGHT_GREEN_COLOR   wxColor(0xE3, 0xFF, 0xE0)
+#define GREEN_COLOR         wxColor(0x95, 0xFF, 0x8A)
+#define DARK_GREEN_COLOR    wxColor(0x20, 0xFF, 0x08)
+#define VERY_GREEN_COLOR    wxColor(0x00, 0xFF, 0x00)
+
+#define YELLOW_COLOR        wxColor(0xFF, 0xFF, 0x5E)
+#define LIGHT_YELLOW_COLOR  wxColor(0xFF, 0xFF, 0xB5)
+#define DARK_YELLOW_COLOR   wxColor(0xFF, 0xFF, 0x08)
+
+class MainFrame;
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class PlotPanel
+//
+// @class $(Name)
+// @author $(User)
+// @date $(Date)
+// @file $(CurrentFileName).$(CurrentFileExt)
+// @brief
+//
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class PlotPanel : public wxPanel
+{
+    public:
+        PlotPanel(wxFrame* parent);
+        ~PlotPanel();
+        wxPen               m_penShortDash;
+        wxPen               m_penDotDash;
+        wxPen               m_penSolid;
+        wxRect              m_rCtrlPrev;
+        wxRect              m_rCtrl;
+        wxRect              m_rGrid;
+        wxRect              m_rPlot;
+        MainFrame           *m_pTopFrame;
+        wxAuiNotebook       *m_pNoteBook;
+        double              m_label_size;
+        wxSize              m_Bufsz;
+        bool                m_newdata;
+        wxImage             m_oImage;
+        wxBitmap            *m_pBmp;
+        wxNativePixelData   *m_pPix;
+
+        // some useful events
+        void            OnMouseMove(wxMouseEvent& event);
+        virtual void    OnMouseLeftDown(wxMouseEvent& event);
+        void            OnMouseLeftUp(wxMouseEvent& event);
+        virtual void    OnMouseRightDown(wxMouseEvent& event);
+        void            OnMouseWheelMoved(wxMouseEvent& event);
+        void            OnClose(wxCloseEvent& event ){ event.Skip(); }
+        void            OnSize( wxSizeEvent& event );
+        void            OnErase(wxEraseEvent& event);
+        void            OnPaint(wxPaintEvent& event);
+        //void OnUpdateUI( wxUpdateUIEvent& event ){ event.Skip(); }
+
+        void            paintEvent(wxPaintEvent & evt);
+        virtual void    draw(wxAutoBufferedPaintDC&  pdc);
+        virtual void    drawGraticule(wxAutoBufferedPaintDC&  pdc);
+        virtual double  SetZoomFactor(double zf);
+        virtual double  GetZoomFactor(double zf);
+        virtual void    OnShow(wxShowEvent& event);
+        virtual double  GetLabelSize();
+        virtual void    SetLabelSize(double size);
+
+    protected:
+        int             m_x;
+        int             m_y;
+        int             m_left;
+        int             m_top;
+        int             m_prev_w;
+        int             m_prev_h;
+        int             m_prev_x;
+        int             m_prev_y;
+        bool            m_use_bitmap;
+        bool            m_clip;
+        bool            m_rubberBand;
+        bool            m_mouseDown;
+        bool            m_firstPass;
+        double          m_zoomFactor;
+        int             m_greyscale;
+        int             m_line_color;
+    DECLARE_EVENT_TABLE()
+};
+#endif //__FDMDV2_PLOT__
diff --git a/freedv/tags/0.99-Beta/src/fdmdv2_plot_scalar.cpp b/freedv/tags/0.99-Beta/src/fdmdv2_plot_scalar.cpp
new file mode 100644 (file)
index 0000000..7a07f46
--- /dev/null
@@ -0,0 +1,281 @@
+//==========================================================================
+// Name:            fdmdv2_plot_scalar.cpp
+// Purpose:         Plots scalar amplitude against time
+// Created:         June 22, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#include <string.h>
+#include "wx/wx.h"
+#include "fdmdv2_main.h"
+#include "fdmdv2_plot_scalar.h"
+
+BEGIN_EVENT_TABLE(PlotScalar, PlotPanel)
+    EVT_PAINT           (PlotScalar::OnPaint)
+    EVT_MOTION          (PlotScalar::OnMouseMove)
+    EVT_MOUSEWHEEL      (PlotScalar::OnMouseWheelMoved)
+    EVT_SIZE            (PlotScalar::OnSize)
+    EVT_SHOW            (PlotScalar::OnShow)
+//    EVT_ERASE_BACKGROUND(PlotScalar::OnErase)
+END_EVENT_TABLE()
+
+//----------------------------------------------------------------
+// PlotScalar()
+//----------------------------------------------------------------
+PlotScalar::PlotScalar(wxFrame* parent, 
+                       int    channels,           // number on channels to plot
+                      float  t_secs,             // time covered by entire x axis in seconds
+                      float  sample_period_secs, // time between each sample in seconds
+                      float  a_min,              // min ampltude of samples being plotted
+                      float  a_max,              // max ampltude of samples being plotted
+                      float  graticule_t_step,   // time step of x (time) axis graticule in seconds
+                      float  graticule_a_step,   // step of amplitude axis graticule
+                      const char a_fmt[],        // printf format string for amplitude axis labels
+                       int    mini                // true for mini-plot - don't draw graticule
+                      ): PlotPanel(parent)
+{
+    int i;
+
+    m_rCtrl = GetClientRect();
+
+    m_channels = channels;
+    m_t_secs = t_secs;
+    m_sample_period_secs = sample_period_secs;
+    m_a_min = a_min;
+    m_a_max = a_max;
+    m_graticule_t_step = graticule_t_step;
+    m_graticule_a_step = graticule_a_step;
+    assert(strlen(a_fmt) < 15);
+    strcpy(m_a_fmt, a_fmt);
+    m_mini = mini;
+
+    // work out number of samples we will store and allocate storage
+
+    m_samples = m_t_secs/m_sample_period_secs;
+    m_mem = new float[m_samples*m_channels];
+
+    for(i = 0; i < m_samples*m_channels; i++)
+    {
+        m_mem[i] = 0.0;
+    }
+}
+
+//----------------------------------------------------------------
+// ~PlotScalar()
+//----------------------------------------------------------------
+PlotScalar::~PlotScalar()
+{
+    delete m_mem;
+}
+
+//----------------------------------------------------------------
+// add_new_sample()
+//----------------------------------------------------------------
+void PlotScalar::add_new_sample(int channel, float sample)
+{
+    int i;
+    int offset = channel*m_samples;
+
+    assert(channel < m_channels);
+
+    for(i = 0; i < m_samples-1; i++)
+    {
+        m_mem[offset+i] = m_mem[offset+i+1];
+    }
+    m_mem[offset+m_samples-1] = sample;
+}
+
+//----------------------------------------------------------------
+// add_new_samples()
+//----------------------------------------------------------------
+void  PlotScalar::add_new_short_samples(int channel, short samples[], int length, float scale_factor)
+{
+    int i;
+    int offset = channel*m_samples;
+
+    assert(channel < m_channels);
+
+    for(i = 0; i < m_samples-length; i++)
+        m_mem[offset+i] = m_mem[offset+i+length];
+    for(; i < m_samples; i++)
+       m_mem[offset+i] = (float)*samples++/scale_factor;
+}
+
+//----------------------------------------------------------------
+// draw()
+//----------------------------------------------------------------
+void PlotScalar::draw(wxAutoBufferedPaintDC&  dc)
+{
+    float index_to_px;
+    float a_to_py;
+    int   i;
+    int   x, y;
+    int   prev_x, prev_y;
+    float a;
+
+    m_rCtrl = GetClientRect();
+    m_rGrid = m_rCtrl;
+    if (!m_mini)
+        m_rGrid = m_rGrid.Deflate(PLOT_BORDER + (XLEFT_OFFSET/2), (PLOT_BORDER + (YBOTTOM_OFFSET/2)));
+
+    //printf("h %d w %d\n", m_rCtrl.GetWidth(), m_rCtrl.GetHeight());
+    //printf("h %d w %d\n", m_rGrid.GetWidth(), m_rGrid.GetHeight());
+
+    // black background
+
+    dc.Clear();
+    if (m_mini)
+        m_rPlot = wxRect(0, 0, m_rGrid.GetWidth(), m_rGrid.GetHeight());        
+    else
+        m_rPlot = wxRect(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER, m_rGrid.GetWidth(), m_rGrid.GetHeight());
+   
+    wxBrush ltGraphBkgBrush = wxBrush(BLACK_COLOR);
+    dc.SetBrush(ltGraphBkgBrush);
+    dc.SetPen(wxPen(BLACK_COLOR, 0));
+    dc.DrawRectangle(m_rPlot);
+
+    index_to_px = (float)m_rGrid.GetWidth()/m_samples;
+    a_to_py = (float)m_rGrid.GetHeight()/(m_a_max - m_a_min);
+
+    wxPen pen;
+    pen.SetColour(DARK_GREEN_COLOR);
+    pen.SetWidth(1);
+    dc.SetPen(pen);
+
+    // draw all samples
+
+    prev_x = prev_y = 0; // stop warning
+
+    // plot each channel 
+
+    int offset;
+    for(offset=0; offset<m_channels*m_samples; offset+=m_samples) {
+
+        for(i = 0; i < m_samples; i++) {
+            x = index_to_px * i;
+            a = m_mem[offset+i];
+            if (a < m_a_min) a = m_a_min;
+            if (a > m_a_max) a = m_a_max;
+
+            // invert y axis and offset by minimum
+
+            y = m_rGrid.GetHeight() - a_to_py * a + m_a_min*a_to_py;
+
+            // put inside plot window
+
+            if (!m_mini) {
+                x += PLOT_BORDER + XLEFT_OFFSET;
+                y += PLOT_BORDER;
+            }
+
+            if (i)
+                dc.DrawLine(x, y, prev_x, prev_y);
+            prev_x = x; prev_y = y;
+        }
+    }
+
+    drawGraticule(dc);
+}
+
+//-------------------------------------------------------------------------
+// drawGraticule()
+//-------------------------------------------------------------------------
+void PlotScalar::drawGraticule(wxAutoBufferedPaintDC&  dc)
+{
+    float    t, a;
+    int      x, y, text_w, text_h;
+    char     buf[15];
+    wxString s;
+    float    sec_to_px;
+    float    a_to_py;
+
+    wxBrush ltGraphBkgBrush;
+    ltGraphBkgBrush.SetStyle(wxBRUSHSTYLE_TRANSPARENT);
+    ltGraphBkgBrush.SetColour(*wxBLACK);
+    dc.SetBrush(ltGraphBkgBrush);
+    dc.SetPen(wxPen(BLACK_COLOR, 1));
+
+    sec_to_px = (float)m_rGrid.GetWidth()/m_t_secs;
+    a_to_py = (float)m_rGrid.GetHeight()/(m_a_max - m_a_min);
+
+    // upper LH coords of plot area are (PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER)
+    // lower RH coords of plot area are (PLOT_BORDER + XLEFT_OFFSET + m_rGrid.GetWidth(), 
+    //                                   PLOT_BORDER + m_rGrid.GetHeight())
+
+    // Vertical gridlines
+
+    dc.SetPen(m_penShortDash);
+    for(t=0; t<=m_t_secs; t+=m_graticule_t_step) {
+       x = t*sec_to_px;
+       if (m_mini) {
+            dc.DrawLine(x, m_rGrid.GetHeight(), x, 0);
+        }
+        else {
+            x += PLOT_BORDER + XLEFT_OFFSET;
+            dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, PLOT_BORDER);
+        }
+        if (!m_mini) {
+            sprintf(buf, "%2.1fs", t);
+            GetTextExtent(buf, &text_w, &text_h);
+            dc.DrawText(buf, x - text_w/2, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET);
+        }
+    }
+
+    // Horizontal gridlines
+
+    dc.SetPen(m_penDotDash);
+    for(a=m_a_min; a<m_a_max; a+=m_graticule_a_step) {
+       y = m_rGrid.GetHeight() - a*a_to_py + m_a_min*a_to_py;
+       if (m_mini) {
+            dc.DrawLine(0, y, m_rGrid.GetWidth(), y);
+        }
+        else {
+            y += PLOT_BORDER;
+            dc.DrawLine(PLOT_BORDER + XLEFT_OFFSET, y, 
+                        (m_rGrid.GetWidth() + PLOT_BORDER + XLEFT_OFFSET), y);
+        }
+        if (!m_mini) {
+            sprintf(buf, m_a_fmt, a);
+            GetTextExtent(buf, &text_w, &text_h);
+            dc.DrawText(buf, PLOT_BORDER + XLEFT_OFFSET - text_w - XLEFT_TEXT_OFFSET, y-text_h/2);
+        }
+   }
+
+
+}
+
+//----------------------------------------------------------------
+// OnPaint()
+//----------------------------------------------------------------
+void PlotScalar::OnPaint(wxPaintEvent& event)
+{
+    wxAutoBufferedPaintDC dc(this);
+    draw(dc);
+}
+
+//----------------------------------------------------------------
+// OnSize()
+//----------------------------------------------------------------
+void PlotScalar::OnSize(wxSizeEvent& event)
+{
+}
+
+//----------------------------------------------------------------
+// OnShow()
+//----------------------------------------------------------------
+void PlotScalar::OnShow(wxShowEvent& event)
+{
+}
diff --git a/freedv/tags/0.99-Beta/src/fdmdv2_plot_scalar.h b/freedv/tags/0.99-Beta/src/fdmdv2_plot_scalar.h
new file mode 100644 (file)
index 0000000..7043987
--- /dev/null
@@ -0,0 +1,73 @@
+//==========================================================================
+// Name:            fdmdv2_plot_scalar.h
+// Purpose:         Defines a scalar plot derivative of fdmdv2_plot.
+// Created:         June 22, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#ifndef __FDMDV2_PLOT_SCALAR__
+#define __FDMDV2_PLOT_SCALAR__
+
+#include "fdmdv2_plot.h"
+#include "fdmdv2_defines.h"
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class PlotScalar
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class PlotScalar: public PlotPanel
+{
+    public:
+
+    PlotScalar(wxFrame* parent,
+               int   channels,
+              float t_secs, 
+              float sample_period_secs,
+              float a_min,
+              float a_max,
+              float graticule_t_step,   
+              float graticule_a_step,
+              const char  a_fmt[],
+               int   mini
+              );
+        ~PlotScalar();
+         void add_new_sample(int channel, float sample);
+         void add_new_short_samples(int channel, short samples[], int length, float scale_factor);
+
+    protected:
+
+         int      m_channels;
+        float    m_t_secs;
+        float    m_sample_period_secs;
+        float    m_a_min;
+        float    m_a_max;
+        float    m_graticule_t_step;   
+        float    m_graticule_a_step;
+        char     m_a_fmt[15];
+         int      m_mini;
+        int      m_samples;
+        float   *m_mem;              
+
+        void draw(wxAutoBufferedPaintDC&  dc);
+       void drawGraticule(wxAutoBufferedPaintDC&  dc);
+        void OnPaint(wxPaintEvent& event);
+        void OnSize(wxSizeEvent& event);
+        void OnShow(wxShowEvent& event);
+
+        DECLARE_EVENT_TABLE()
+};
+
+#endif // __FDMDV2_PLOT_SCALAR__
+
diff --git a/freedv/tags/0.99-Beta/src/fdmdv2_plot_scatter.cpp b/freedv/tags/0.99-Beta/src/fdmdv2_plot_scatter.cpp
new file mode 100644 (file)
index 0000000..3c0b155
--- /dev/null
@@ -0,0 +1,199 @@
+//==========================================================================
+// Name:            fdmdv2_plot_scatter.cpp
+// Purpose:         A scatter plot derivative of fdmdv2_plot.
+// Created:         June 24, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#include <string.h>
+#include "wx/wx.h"
+#include "fdmdv2_plot_scatter.h"
+
+BEGIN_EVENT_TABLE(PlotScatter, PlotPanel)
+    EVT_PAINT           (PlotScatter::OnPaint)
+    EVT_MOTION          (PlotScatter::OnMouseMove)
+    EVT_MOUSEWHEEL      (PlotScatter::OnMouseWheelMoved)
+    EVT_SIZE            (PlotScatter::OnSize)
+    EVT_SHOW            (PlotScatter::OnShow)
+//    EVT_ERASE_BACKGROUND(PlotScatter::OnErase)
+END_EVENT_TABLE()
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// PlotScatter
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+PlotScatter::PlotScatter(wxFrame* parent) : PlotPanel(parent)
+{
+    int i;
+
+    for(i=0; i < SCATTER_MEM_SYMS_MAX; i++)
+    {
+        m_mem[i].real = 0.0;
+        m_mem[i].imag = 0.0;
+    }
+
+    m_filter_max_xy = 0.1;
+
+    // defaults so we start off with something sensible
+
+    Nsym = 14+1;
+    scatterMemSyms = ((int)(SCATTER_MEM_SECS*(Nsym/DT)));
+    assert(scatterMemSyms <= SCATTER_MEM_SYMS_MAX);
+        
+}
+
+// changing number of carriers changes number of symbols to plot
+void PlotScatter::setNc(int Nc) {
+    Nsym = Nc+1;
+    assert(Nsym <= (FDMDV_NC_MAX+1));
+    scatterMemSyms = ((int)(SCATTER_MEM_SECS*(Nsym/DT)));
+    assert(scatterMemSyms <= SCATTER_MEM_SYMS_MAX);
+}
+
+//----------------------------------------------------------------
+// draw()
+//----------------------------------------------------------------
+void PlotScatter::draw(wxAutoBufferedPaintDC& dc)
+{
+    float x_scale;
+    float y_scale;
+    int   i;
+    int   x;
+    int   y;
+    wxColour sym_to_colour[] = {wxColor(0,0,255), 
+                                wxColor(0,255,0),
+                                wxColor(0,255,255),
+                                wxColor(255,0,0),
+                                wxColor(255,0,255), 
+                                wxColor(255,255,0),
+                                wxColor(255,255,255),
+                                wxColor(0,0,255), 
+                                wxColor(0,255,0),
+                                wxColor(0,255,255),
+                                wxColor(255,0,0),
+                                wxColor(255,0,255), 
+                                wxColor(255,255,0),
+                                wxColor(255,255,255),
+                                wxColor(0,0,255), 
+                                wxColor(0,255,0),
+                                wxColor(0,255,255),
+                                wxColor(255,0,0),
+                                wxColor(255,0,255)
+    };
+
+    m_rCtrl = GetClientRect();
+    m_rGrid = m_rCtrl;
+    m_rGrid = m_rGrid.Deflate(PLOT_BORDER + (XLEFT_OFFSET/2), (PLOT_BORDER + (YBOTTOM_OFFSET/2)));
+
+    // black background
+
+    dc.Clear();
+    m_rPlot = wxRect(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER, m_rGrid.GetWidth(), m_rGrid.GetHeight());
+    wxBrush ltGraphBkgBrush = wxBrush(BLACK_COLOR);
+    dc.SetBrush(ltGraphBkgBrush);
+    dc.SetPen(wxPen(BLACK_COLOR, 0));
+    dc.DrawRectangle(m_rPlot);
+    wxPen pen;
+    pen.SetWidth(1); // note this is ignored by DrawPoint
+
+    // automatically scale, first measure the maximum value
+
+    float max_xy = 1E-12;
+    float real,imag;
+    for(i=0; i< scatterMemSyms; i++) {
+        real = fabs(m_mem[i].real);
+        imag = fabs(m_mem[i].imag);
+        if (real > max_xy)
+            max_xy = real;
+        if (imag > max_xy)
+            max_xy = imag;
+    }
+
+    // smooth it out and set a lower limit to prevent didev by 0 issues
+
+    m_filter_max_xy = BETA*m_filter_max_xy + (1 - BETA)*2.5*max_xy;
+    if (m_filter_max_xy < 0.001)
+        m_filter_max_xy = 0.001;
+
+    // quantise to log steps to prevent scatter scaling bobbing about too
+    // much as scaling varies
+
+    float quant_m_filter_max_xy = exp(floor(0.5+log(m_filter_max_xy)));
+    //printf("max_xy: %f m_filter_max_xy: %f quant_m_filter_max_xy: %f\n", max_xy, m_filter_max_xy, quant_m_filter_max_xy);
+
+    x_scale = (float)m_rGrid.GetWidth()/quant_m_filter_max_xy;
+    y_scale = (float)m_rGrid.GetHeight()/quant_m_filter_max_xy;
+
+    // draw all samples
+
+    for(i = 0; i < scatterMemSyms; i++)
+    {
+        x = x_scale * m_mem[i].real + m_rGrid.GetWidth()/2;
+        y = y_scale * m_mem[i].imag + m_rGrid.GetHeight()/2;
+       x += PLOT_BORDER + XLEFT_OFFSET;
+       y += PLOT_BORDER;
+        pen.SetColour(sym_to_colour[i%Nsym]);
+        dc.SetPen(pen);
+       dc.DrawPoint(x, y);
+    }
+}
+
+//----------------------------------------------------------------
+// add_new_samples()
+//----------------------------------------------------------------
+void PlotScatter::add_new_samples(COMP samples[])
+{
+    int i,j;
+
+    // shift memory
+
+    for(i = 0; i < scatterMemSyms - Nsym; i++)
+    {
+        m_mem[i] = m_mem[i+Nsym];
+    }
+
+    // new samples
+
+    for(j=0; i < scatterMemSyms; i++,j++)
+    {
+        m_mem[i] = samples[j];
+    }
+}
+
+//----------------------------------------------------------------
+// OnPaint()
+//----------------------------------------------------------------
+void PlotScatter::OnPaint(wxPaintEvent& event)
+{
+    wxAutoBufferedPaintDC dc(this);
+    draw(dc);
+}
+
+//----------------------------------------------------------------
+// OnSize()
+//----------------------------------------------------------------
+void PlotScatter::OnSize(wxSizeEvent& event)
+{
+    // todo: clear screen
+}
+
+//----------------------------------------------------------------
+// OnShow()
+//----------------------------------------------------------------
+void PlotScatter::OnShow(wxShowEvent& event)
+{
+}
+
diff --git a/freedv/tags/0.99-Beta/src/fdmdv2_plot_scatter.h b/freedv/tags/0.99-Beta/src/fdmdv2_plot_scatter.h
new file mode 100644 (file)
index 0000000..702f633
--- /dev/null
@@ -0,0 +1,56 @@
+//==========================================================================
+// Name:            fdmdv2_plot_scatter.h
+// Purpose:         A scatter plot derivative of fdmdv2_plot.
+// Created:         June 24, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#ifndef __FDMDV2_PLOT_SCATTER__
+#define __FDMDV2_PLOT_SCATTER__
+
+#include "comp.h"
+#include "fdmdv2_plot.h"
+#include "fdmdv2_defines.h"
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class PlotScatter
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class PlotScatter : public PlotPanel
+{
+    public:
+        PlotScatter(wxFrame* parent);
+        ~PlotScatter(){};
+       void add_new_samples(COMP samples[]);
+       void setNc(int Nc);
+
+    protected:
+        COMP m_mem[SCATTER_MEM_SYMS_MAX];
+        COMP m_new_samples[FDMDV_NC_MAX+1];
+
+        void draw(wxAutoBufferedPaintDC&  dc);
+        void OnPaint(wxPaintEvent& event);
+        void OnSize(wxSizeEvent& event);
+        void OnShow(wxShowEvent& event);
+
+        DECLARE_EVENT_TABLE()
+
+    private:
+        int   Nsym;
+        int   scatterMemSyms;
+        float m_filter_max_xy;
+};
+
+#endif //__FDMDV2_PLOT_SCATTER__
diff --git a/freedv/tags/0.99-Beta/src/fdmdv2_plot_spectrum.cpp b/freedv/tags/0.99-Beta/src/fdmdv2_plot_spectrum.cpp
new file mode 100644 (file)
index 0000000..d9c72d0
--- /dev/null
@@ -0,0 +1,266 @@
+//==========================================================================
+// Name:            fdmdv2_plot_waterfall.cpp
+// Purpose:         Implements a waterfall plot derivative of fdmdv2_plot.
+// Created:         June 23, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#include <string.h>
+#include "wx/wx.h"
+
+#include "fdmdv2_main.h"
+
+extern float g_avmag[];                 // average mag data passed to draw() 
+void fdmdv2_clickTune(float frequency); // callback to pass new click freq
+
+BEGIN_EVENT_TABLE(PlotSpectrum, PlotPanel)
+    EVT_MOTION          (PlotSpectrum::OnMouseMove)
+    EVT_LEFT_DOWN       (PlotSpectrum::OnMouseLeftDown)
+    EVT_LEFT_UP         (PlotSpectrum::OnMouseLeftUp)
+    EVT_MOUSEWHEEL      (PlotSpectrum::OnMouseWheelMoved)
+    EVT_PAINT           (PlotSpectrum::OnPaint)
+    EVT_SHOW            (PlotSpectrum::OnShow)
+END_EVENT_TABLE()
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class PlotSpectrum
+//
+// @class $(Name)
+// @author $(User)
+// @date $(Date)
+// @file $(CurrentFileName).$(CurrentFileExt)
+// @brief
+//
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+PlotSpectrum::PlotSpectrum(wxFrame* parent, float *magdB, int n_magdB, 
+                           float min_mag_db, float max_mag_db, bool clickTune): PlotPanel(parent)
+{
+    m_greyscale     = 0;
+    m_Bufsz         = GetMaxClientSize();
+    m_newdata       = false;
+    m_firstPass     = true;
+    m_line_color    = 0;
+    SetLabelSize(10.0);
+
+    m_magdB         = magdB;
+    m_n_magdB       = n_magdB;     // number of points in magdB that covers 0 ... MAX_F_HZ of spectrum
+    m_max_mag_db    = max_mag_db;
+    m_min_mag_db    = min_mag_db;
+    m_rxFreq        = 0.0;
+    m_clickTune     = clickTune;
+}
+
+//----------------------------------------------------------------
+// ~PlotSpectrum()
+//----------------------------------------------------------------
+PlotSpectrum::~PlotSpectrum()
+{
+}
+
+//----------------------------------------------------------------
+// OnSize()
+//----------------------------------------------------------------
+void PlotSpectrum::OnSize(wxSizeEvent& event) {
+}
+
+//----------------------------------------------------------------
+// OnPaint()
+//----------------------------------------------------------------
+void PlotSpectrum::OnPaint(wxPaintEvent& event)
+{
+    wxAutoBufferedPaintDC dc(this);
+    draw(dc);
+}
+
+//----------------------------------------------------------------
+// OnShow()
+//----------------------------------------------------------------
+void PlotSpectrum::OnShow(wxShowEvent& event)
+{
+}
+
+//----------------------------------------------------------------
+// draw()
+//----------------------------------------------------------------
+void PlotSpectrum::draw(wxAutoBufferedPaintDC& dc)
+{
+    m_rCtrl  = GetClientRect();
+
+    // m_rGrid is coords of inner window we actually plot to.  We deflate it a bit
+    // to leave room for axis labels.  We need to work this out every time we draw
+    // as OnSize() may not be called before OnPaint(), for example when a new tab
+    // is selected
+
+    m_rGrid  = m_rCtrl;
+    m_rGrid = m_rGrid.Deflate(PLOT_BORDER + (XLEFT_OFFSET/2), (PLOT_BORDER + (YBOTTOM_OFFSET/2)));
+
+    dc.Clear();
+
+    // black background
+
+    m_rPlot = wxRect(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER, m_rGrid.GetWidth(), m_rGrid.GetHeight());
+    wxBrush ltGraphBkgBrush = wxBrush(BLACK_COLOR);
+    dc.SetBrush(ltGraphBkgBrush);
+    dc.SetPen(wxPen(BLACK_COLOR, 0));
+    dc.DrawRectangle(m_rPlot);
+
+    // draw spectrum
+
+    int   x, y, prev_x, prev_y, index;
+    float index_to_px, mag_dB_to_py, mag;
+
+    m_newdata = false;
+
+    wxPen pen;
+    pen.SetColour(DARK_GREEN_COLOR);
+    pen.SetWidth(1);
+    dc.SetPen(pen);
+
+    index_to_px = (float)m_rGrid.GetWidth()/m_n_magdB;
+    mag_dB_to_py = (float)m_rGrid.GetHeight()/(m_max_mag_db - m_min_mag_db);
+
+    prev_x = PLOT_BORDER + XLEFT_OFFSET;
+    prev_y = PLOT_BORDER;
+    for(index = 0; index < m_n_magdB; index++)
+    {
+        x = index*index_to_px;
+        mag = m_magdB[index];
+        if (mag > m_max_mag_db) mag = m_max_mag_db;
+        if (mag < m_min_mag_db) mag = m_min_mag_db;
+        y = -(mag - m_max_mag_db) * mag_dB_to_py;
+
+        x += PLOT_BORDER + XLEFT_OFFSET;
+        y += PLOT_BORDER;
+
+        if (index)
+            dc.DrawLine(x, y, prev_x, prev_y);
+        prev_x = x; prev_y = y;
+    }
+
+    // and finally draw Graticule
+
+    drawGraticule(dc);
+
+}
+
+//-------------------------------------------------------------------------
+// drawGraticule()
+//-------------------------------------------------------------------------
+void PlotSpectrum::drawGraticule(wxAutoBufferedPaintDC&  dc)
+{
+    int      x, y, text_w, text_h;
+    char     buf[15];
+    wxString s;
+    float    f, mag, freq_hz_to_px, mag_dB_to_py;
+
+    wxBrush ltGraphBkgBrush;
+    ltGraphBkgBrush.SetStyle(wxBRUSHSTYLE_TRANSPARENT);
+    ltGraphBkgBrush.SetColour(*wxBLACK);
+    dc.SetBrush(ltGraphBkgBrush);
+    dc.SetPen(wxPen(BLACK_COLOR, 1));
+
+    freq_hz_to_px = (float)m_rGrid.GetWidth()/(MAX_F_HZ-MIN_F_HZ);
+    mag_dB_to_py = (float)m_rGrid.GetHeight()/(m_max_mag_db - m_min_mag_db);
+
+    // upper LH coords of plot area are (PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER)
+    // lower RH coords of plot area are (PLOT_BORDER + XLEFT_OFFSET + m_rGrid.GetWidth(), 
+    //                                   PLOT_BORDER + m_rGrid.GetHeight())
+
+    // Check if small screen size means text will overlap
+
+    int textXStep = STEP_F_HZ*freq_hz_to_px;
+    int textYStep = STEP_MAG_DB*mag_dB_to_py;
+    sprintf(buf, "%4.0fHz", (float)MAX_F_HZ - STEP_F_HZ);
+    GetTextExtent(buf, &text_w, &text_h);
+    int overlappedText = (text_w > textXStep) || (text_h > textYStep);
+    //printf("text_w: %d textXStep: %d text_h: %d textYStep: %d  overlappedText: %d\n", text_w, textXStep, 
+    //      text_h, textYStep, overlappedText);
+
+    // Vertical gridlines
+
+    for(f=STEP_F_HZ; f<MAX_F_HZ; f+=STEP_F_HZ) {
+       x = f*freq_hz_to_px;
+       x += PLOT_BORDER + XLEFT_OFFSET;
+
+        dc.SetPen(m_penShortDash);
+        dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, PLOT_BORDER);
+        dc.SetPen(wxPen(BLACK_COLOR, 1));
+        dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET);
+
+        sprintf(buf, "%4.0fHz", f);
+       GetTextExtent(buf, &text_w, &text_h);
+        if (!overlappedText)
+            dc.DrawText(buf, x - text_w/2, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET);
+    }
+
+    dc.SetPen(wxPen(BLACK_COLOR, 1));
+    for(f=STEP_MINOR_F_HZ; f<MAX_F_HZ; f+=STEP_MINOR_F_HZ) 
+    {
+        x = f*freq_hz_to_px;
+        x += PLOT_BORDER + XLEFT_OFFSET;
+        dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET-5);
+    }
+    
+    // Horizontal gridlines
+
+    dc.SetPen(m_penDotDash);
+    for(mag=m_min_mag_db; mag<=m_max_mag_db; mag+=STEP_MAG_DB) {
+       y = -(mag - m_max_mag_db) * mag_dB_to_py;
+       y += PLOT_BORDER;
+       dc.DrawLine(PLOT_BORDER + XLEFT_OFFSET, y, 
+                   (m_rGrid.GetWidth() + PLOT_BORDER + XLEFT_OFFSET), y);
+        sprintf(buf, "%3.0fdB", mag);
+       GetTextExtent(buf, &text_w, &text_h);
+        if (!overlappedText)
+            dc.DrawText(buf, PLOT_BORDER + XLEFT_OFFSET - text_w - XLEFT_TEXT_OFFSET, y-text_h/2);
+    }
+
+    // red rx tuning line
+    
+    if (m_rxFreq != 0.0) {
+        dc.SetPen(wxPen(RED_COLOR, 2));
+        x = m_rxFreq*freq_hz_to_px;
+        x += PLOT_BORDER + XLEFT_OFFSET;
+        //printf("m_rxFreq %f x %d\n", m_rxFreq, x);
+        dc.DrawLine(x, m_rGrid.GetHeight()+ PLOT_BORDER, x, m_rCtrl.GetHeight());
+    }
+
+}
+
+//-------------------------------------------------------------------------
+// OnMouseDown()
+//-------------------------------------------------------------------------
+void PlotSpectrum::OnMouseLeftDown(wxMouseEvent& event)
+{
+    m_mouseDown = true;
+    wxClientDC dc(this);
+
+    wxPoint pt(event.GetLogicalPosition(dc));
+
+    // map x coord to edges of actual plot
+    pt.x -= PLOT_BORDER + XLEFT_OFFSET;
+    pt.y -= PLOT_BORDER;
+
+    // valid click if inside of plot
+    if ((pt.x >= 0) && (pt.x <= m_rGrid.GetWidth()) && (pt.y >=0) && m_clickTune) {
+        float freq_hz_to_px = (float)m_rGrid.GetWidth()/(MAX_F_HZ-MIN_F_HZ);
+        float clickFreq = (float)pt.x/freq_hz_to_px;
+
+        // see PlotWaterfall::OnMouseDown()
+
+        fdmdv2_clickTune(clickFreq);
+    }
+}
diff --git a/freedv/tags/0.99-Beta/src/fdmdv2_plot_spectrum.h b/freedv/tags/0.99-Beta/src/fdmdv2_plot_spectrum.h
new file mode 100644 (file)
index 0000000..353f312
--- /dev/null
@@ -0,0 +1,58 @@
+//==========================================================================
+// Name:            fdmdv2_plot_spectrum.h
+// Purpose:         Defines a spectrum plot derived from fdmdv2_plot class.
+// Created:         June 22, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#ifndef __FDMDV2_PLOT_SPECTRUM__
+#define __FDMDV2_PLOT_SPECTRUM__
+
+#include "fdmdv2_plot.h"
+#include "fdmdv2_defines.h"
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class Waterfall
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class PlotSpectrum : public PlotPanel
+{
+    public:
+    PlotSpectrum(wxFrame* parent, float *magdB, int n_magdB, 
+                 float min_mag_db=MIN_MAG_DB, float max_mag_db=MAX_MAG_DB, bool clickTune=true);
+        ~PlotSpectrum();
+        void setRxFreq(float rxFreq) { m_rxFreq = rxFreq; }
+        void setFreqScale(int n_magdB) { m_n_magdB = n_magdB; }
+
+    protected:
+        void        OnPaint(wxPaintEvent& event);
+        void        OnSize(wxSizeEvent& event);
+        void        OnShow(wxShowEvent& event);
+        void        drawGraticule(wxAutoBufferedPaintDC& dc);
+        void        draw(wxAutoBufferedPaintDC& dc);
+        void        OnMouseLeftDown(wxMouseEvent& event);
+
+   private:
+        float       m_rxFreq;
+        float       m_max_mag_db;
+        float       m_min_mag_db;
+        float      *m_magdB;
+        int         m_n_magdB;  
+        bool        m_clickTune;
+
+        DECLARE_EVENT_TABLE()
+};
+
+#endif //__FDMDV2_PLOT_SPECTRUM__
diff --git a/freedv/tags/0.99-Beta/src/fdmdv2_plot_waterfall.cpp b/freedv/tags/0.99-Beta/src/fdmdv2_plot_waterfall.cpp
new file mode 100644 (file)
index 0000000..4a8b447
--- /dev/null
@@ -0,0 +1,483 @@
+//==========================================================================
+// Name:            fdmdv2_plot_waterfall.cpp
+// Purpose:         Implements a waterfall plot derivative of fdmdv2_plot.
+// Created:         June 22, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#include <string.h>
+#include "wx/wx.h"
+#include "fdmdv2_main.h"
+
+extern float g_avmag[];                 // av mag spec passed in to draw() 
+void fdmdv2_clickTune(float frequency); // callback to pass new click freq
+
+BEGIN_EVENT_TABLE(PlotWaterfall, PlotPanel)
+    EVT_PAINT           (PlotWaterfall::OnPaint)
+    EVT_MOTION          (PlotWaterfall::OnMouseMove)
+    EVT_LEFT_DOWN       (PlotWaterfall::OnMouseLeftDown)
+    EVT_RIGHT_DOWN      (PlotWaterfall::OnMouseRightDown)
+    EVT_LEFT_UP         (PlotWaterfall::OnMouseLeftUp)
+    EVT_MOUSEWHEEL      (PlotWaterfall::OnMouseWheelMoved)
+    EVT_SIZE            (PlotWaterfall::OnSize)
+    EVT_SHOW            (PlotWaterfall::OnShow)
+END_EVENT_TABLE()
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class WaterfallPlot
+//
+// @class   WaterfallPlot
+// @author  David Witten
+// @date    $(Date)
+// @file    $(CurrentFileName).$(CurrentFileExt)
+// @brief
+//
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+PlotWaterfall::PlotWaterfall(wxFrame* parent, bool graticule, int colour): PlotPanel(parent)
+{
+
+    for(int i = 0; i < 255; i++)
+    {
+        m_heatmap_lut[i] = heatmap((float)i, 0.0, 255.0);
+    }
+    m_graticule     = graticule;
+    m_colour        = colour;
+    m_Bufsz         = GetMaxClientSize();
+    m_newdata       = false;
+    m_firstPass     = true;
+    m_line_color    = 0;
+    m_modem_stats_max_f_hz = MODEM_STATS_MAX_F_HZ;
+
+    SetLabelSize(10.0);
+
+    m_pBmp = NULL;
+    m_max_mag = MAX_MAG_DB;
+    m_min_mag = MIN_MAG_DB;
+}
+
+// When the window size gets set we can work outthe size of the window
+// we plot in and allocate a bit map of the correct size
+void PlotWaterfall::OnSize(wxSizeEvent& event) 
+{
+    // resize bit map
+
+    delete m_pBmp;
+    
+    m_rCtrl  = GetClientRect();
+
+    // m_rGrid is coords of inner window we actually plot to.  We deflate it a bit
+    // to leave room for axis labels.
+
+    m_rGrid  = m_rCtrl;
+    m_rGrid = m_rGrid.Deflate(PLOT_BORDER + (XLEFT_OFFSET/2), (PLOT_BORDER + (YBOTTOM_OFFSET/2)));
+
+    // we want a bit map the size of m_rGrid
+
+    m_pBmp = new wxBitmap(m_rGrid.GetWidth(), m_rGrid.GetHeight(), 24);
+
+    m_dT = DT;
+}
+
+//----------------------------------------------------------------
+// paintEvent()
+//
+// @class $(Name)
+// @author $(User)
+// @date $(Date)
+// @file $(CurrentFileName).$(CurrentFileExt)
+// @brief
+//
+// Called by the system of by wxWidgets when the panel needs
+// to be redrawn. You can also trigger this call by calling
+// Refresh()/Update().
+//----------------------------------------------------------------
+void PlotWaterfall::OnPaint(wxPaintEvent & evt)
+{
+    wxAutoBufferedPaintDC dc(this);
+    draw(dc);
+}
+
+//----------------------------------------------------------------
+// OnShow()
+//----------------------------------------------------------------
+void PlotWaterfall::OnShow(wxShowEvent& event)
+{
+}
+
+//----------------------------------------------------------------
+// ~PlotWaterfall()
+//----------------------------------------------------------------
+PlotWaterfall::~PlotWaterfall()
+{
+}
+
+//----------------------------------------------------------------
+// heatmap()
+// map val to a rgb colour
+// from http://eddiema.ca/2011/01/21/c-sharp-heatmaps/
+//----------------------------------------------------------------
+unsigned PlotWaterfall::heatmap(float val, float min, float max)
+{
+    unsigned r = 0;
+    unsigned g = 0;
+    unsigned b = 0;
+
+    val = (val - min) / (max - min);
+    if(val <= 0.2)
+    {
+        b = (unsigned)((val / 0.2) * 255);
+    }
+    else if(val >  0.2 &&  val <= 0.7)
+    {
+        b = (unsigned)((1.0 - ((val - 0.2) / 0.5)) * 255);
+    }
+    if(val >= 0.2 &&  val <= 0.6)
+    {
+        g = (unsigned)(((val - 0.2) / 0.4) * 255);
+    }
+    else if(val >  0.6 &&  val <= 0.9)
+    {
+        g = (unsigned)((1.0 - ((val - 0.6) / 0.3)) * 255);
+    }
+    if(val >= 0.5)
+    {
+        r = (unsigned)(((val - 0.5) / 0.5) * 255);
+    }
+    //printf("%f %x %x %x\n", val, r, g, b);
+    return  (b << 16) + (g << 8) + r;
+}
+
+bool PlotWaterfall::checkDT(void)
+{
+    // Check dY is > 1 pixel before proceeding. For small screens
+    // and large WATERFALL_SECS_Y we might have less than one
+    // block per pixel.  In this case increase m_dT and perform draw
+    // less often
+
+    float px_per_sec = (float)m_rGrid.GetHeight() / WATERFALL_SECS_Y;
+    float dy = m_dT * px_per_sec;
+    
+    if (dy < 1.0) {
+        m_dT += DT;
+        return false;
+    }
+    else
+        return true;
+}
+
+//----------------------------------------------------------------
+// draw()
+//----------------------------------------------------------------
+void PlotWaterfall::draw(wxAutoBufferedPaintDC& dc)
+{
+
+    m_rCtrl  = GetClientRect();
+
+    // m_rGrid is coords of inner window we actually plot to.  We deflate it a bit
+    // to leave room for axis labels.
+
+    m_rGrid = m_rCtrl;
+    m_rGrid = m_rGrid.Deflate(PLOT_BORDER + (XLEFT_OFFSET/2), (PLOT_BORDER + (YBOTTOM_OFFSET/2)));
+
+    if (m_pBmp == NULL) 
+    {
+        // we want a bit map the size of m_rGrid
+        m_pBmp = new wxBitmap(m_rGrid.GetWidth(), m_rGrid.GetHeight(), 24);
+    }
+
+    dc.Clear();
+
+    if(m_newdata)
+    {
+        m_newdata = false;
+        plotPixelData();
+        dc.DrawBitmap(*m_pBmp, PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER);
+        m_dT = DT;
+    }
+    else 
+    {
+
+        // no data to plot so just erase to black.  Blue looks nicer
+        // but is same colour as low amplitude signal
+
+        // Bug on Linux: When Stop is pressed this code doesn't erase
+        // the lower 25% of the Waterfall Window
+
+        m_rPlot = wxRect(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER, m_rGrid.GetWidth(), m_rGrid.GetHeight());
+        wxBrush ltGraphBkgBrush = wxBrush(BLACK_COLOR);
+        dc.SetBrush(ltGraphBkgBrush);
+        dc.SetPen(wxPen(BLACK_COLOR, 0));
+        dc.DrawRectangle(m_rPlot);
+    }
+    drawGraticule(dc);
+}
+
+//-------------------------------------------------------------------------
+// drawGraticule()
+//-------------------------------------------------------------------------
+void PlotWaterfall::drawGraticule(wxAutoBufferedPaintDC& dc)
+{
+    int      x, y, text_w, text_h;
+    char     buf[15];
+    wxString s;
+    float    f, time, freq_hz_to_px, time_s_to_py;
+
+    wxBrush ltGraphBkgBrush;
+    ltGraphBkgBrush.SetStyle(wxBRUSHSTYLE_TRANSPARENT);
+    ltGraphBkgBrush.SetColour(*wxBLACK);
+    dc.SetBrush(ltGraphBkgBrush);
+    dc.SetPen(wxPen(BLACK_COLOR, 1));
+
+    freq_hz_to_px = (float)m_rGrid.GetWidth()/(MAX_F_HZ-MIN_F_HZ);
+    time_s_to_py = (float)m_rGrid.GetHeight()/WATERFALL_SECS_Y;
+
+    // upper LH coords of plot area are (PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER)
+    // lower RH coords of plot area are (PLOT_BORDER + XLEFT_OFFSET + m_rGrid.GetWidth(), 
+    //                                   PLOT_BORDER + m_rGrid.GetHeight())
+
+    // Check if small screen size means text will overlap
+
+    int textXStep = STEP_F_HZ*freq_hz_to_px;
+    int textYStep = WATERFALL_SECS_STEP*time_s_to_py;
+    sprintf(buf, "%4.0fHz", (float)MAX_F_HZ - STEP_F_HZ);
+    GetTextExtent(buf, &text_w, &text_h);
+    int overlappedText = (text_w > textXStep) || (text_h > textYStep);
+
+    // Major Vertical gridlines and legend
+    //dc.SetPen(m_penShortDash);
+    for(f=STEP_F_HZ; f<MAX_F_HZ; f+=STEP_F_HZ) 
+    {
+        x = f*freq_hz_to_px;
+        x += PLOT_BORDER + XLEFT_OFFSET;
+
+        if (m_graticule)
+            dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, PLOT_BORDER);
+        else
+            dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET);
+            
+        sprintf(buf, "%4.0fHz", f);
+        GetTextExtent(buf, &text_w, &text_h);
+        if (!overlappedText)
+            dc.DrawText(buf, x - text_w/2, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET);
+    }
+
+    for(f=STEP_MINOR_F_HZ; f<MAX_F_HZ; f+=STEP_MINOR_F_HZ) 
+    {
+        x = f*freq_hz_to_px;
+        x += PLOT_BORDER + XLEFT_OFFSET;
+        dc.DrawLine(x, m_rGrid.GetHeight() + PLOT_BORDER, x, m_rGrid.GetHeight() + PLOT_BORDER + YBOTTOM_TEXT_OFFSET-5);
+    }
+    
+    // Horizontal gridlines
+    dc.SetPen(m_penDotDash);
+    for(time=0; time<=WATERFALL_SECS_Y; time+=WATERFALL_SECS_STEP) {
+       y = m_rGrid.GetHeight() - time*time_s_to_py;
+       y += PLOT_BORDER;
+
+        if (m_graticule)
+            dc.DrawLine(PLOT_BORDER + XLEFT_OFFSET, y, 
+                        (m_rGrid.GetWidth() + PLOT_BORDER + XLEFT_OFFSET), y);
+        sprintf(buf, "%3.0fs", time);
+       GetTextExtent(buf, &text_w, &text_h);
+        if (!overlappedText)
+            dc.DrawText(buf, PLOT_BORDER + XLEFT_OFFSET - text_w - XLEFT_TEXT_OFFSET, y-text_h/2);
+   }
+
+    // red rx tuning line
+    dc.SetPen(wxPen(RED_COLOR, 2));
+    x = m_rxFreq*freq_hz_to_px;
+    x += PLOT_BORDER + XLEFT_OFFSET;
+    //printf("m_rxFreq %f x %d\n", m_rxFreq, x);
+    dc.DrawLine(x, m_rGrid.GetHeight()+ PLOT_BORDER, x, m_rCtrl.GetHeight());
+    
+}
+
+//-------------------------------------------------------------------------
+// plotPixelData()
+//-------------------------------------------------------------------------
+void PlotWaterfall::plotPixelData()
+{
+    float       spec_index_per_px;
+    float       intensity_per_dB;
+    float       px_per_sec;
+    int         index;
+    float       dy;
+    int         dy_blocks;
+    int         b;
+    int         px;
+    int         py;
+    int         intensity;
+
+    /*
+      Design Notes:
+
+      The height in pixels represents WATERFALL_SECS_Y of data.  Every DT
+      seconds we get a vector of MODEM_STATS_NSPEC spectrum samples which we use
+      to update the last row.  The height of each row is dy pixels, which
+      maps to DT seconds.  We call each dy high rectangle of pixels a
+      block.
+
+    */
+
+    // determine dy, the height of one "block"
+    px_per_sec = (float)m_rGrid.GetHeight() / WATERFALL_SECS_Y;
+    dy = m_dT * px_per_sec;
+
+    // number of dy high blocks in spectrogram
+    dy_blocks = m_rGrid.GetHeight()/ dy;
+
+    // update min and max amplitude estimates
+    float max_mag = MIN_MAG_DB;
+
+    int min_fft_bin=((float)200/m_modem_stats_max_f_hz)*MODEM_STATS_NSPEC;
+    int max_fft_bin=((float)2800/m_modem_stats_max_f_hz)*MODEM_STATS_NSPEC;
+
+    for(int i=min_fft_bin; i<max_fft_bin; i++) 
+    {
+        if (g_avmag[i] > max_mag)
+        {
+            max_mag = g_avmag[i];
+        }
+    }
+
+    m_max_mag = BETA*m_max_mag + (1 - BETA)*max_mag;
+    m_min_mag = max_mag - 20.0;
+    //printf("max_mag: %f m_max_mag: %f\n", max_mag, m_max_mag);
+    intensity_per_dB  = (float)256 /(MAX_MAG_DB - MIN_MAG_DB);
+    //intensity_per_dB  = (float)256 /(m_max_mag - m_min_mag);
+    spec_index_per_px = ((float)(MAX_F_HZ)/(float)m_modem_stats_max_f_hz)*(float)MODEM_STATS_NSPEC / (float) m_rGrid.GetWidth();
+
+    /*
+    printf("h %d w %d px_per_sec %d dy %d dy_blocks %d spec_index_per_px: %f\n", 
+       m_rGrid.GetHeight(), m_rGrid.GetWidth(), px_per_sec, 
+       dy, dy_blocks, spec_index_per_px);
+    */
+
+    // Shift previous bit map up one row of blocks ----------------------------
+    wxNativePixelData data(*m_pBmp);
+    wxNativePixelData::Iterator bitMapStart(data);
+    wxNativePixelData::Iterator p = bitMapStart;
+
+    for(b = 0; b < dy_blocks - 1; b++) 
+    {
+        wxNativePixelData::Iterator psrc = bitMapStart;
+        wxNativePixelData::Iterator pdest = bitMapStart;
+        pdest.OffsetY(data, dy * b);
+        psrc.OffsetY(data, dy * (b+1));
+
+        // copy one line of blocks
+
+        for(py = 0; py < dy; py++) 
+        {
+            wxNativePixelData::Iterator pdestRowStart = pdest;
+            wxNativePixelData::Iterator psrcRowStart = psrc;
+
+            for(px = 0; px < m_rGrid.GetWidth(); px++) 
+            {
+                pdest.Red() = psrc.Red();
+                pdest.Green() = psrc.Green();
+                pdest.Blue() = psrc.Blue();
+                pdest++;
+                psrc++;
+            }
+            pdest = pdestRowStart;
+            pdest.OffsetY(data, 1);
+            psrc = psrcRowStart;
+            psrc.OffsetY(data, 1);         
+        }
+    }
+
+    // Draw last line of blocks using latest amplitude data ------------------
+    p = bitMapStart;
+    p.OffsetY(data, dy *(dy_blocks - 1));
+    for(py = 0; py < dy; py++)
+    {
+        wxNativePixelData::Iterator rowStart = p;
+
+        for(px = 0; px < m_rGrid.GetWidth(); px++)
+        {
+            index = px * spec_index_per_px;
+            assert(index < MODEM_STATS_NSPEC);
+
+            intensity = intensity_per_dB * (g_avmag[index] - m_min_mag);
+            if(intensity > 255) intensity = 255;
+            if (intensity < 0) intensity = 0;
+            //printf("%d %f %d \n", index, g_avmag[index], intensity);
+
+            switch (m_colour) {
+            case 0:
+                p.Red() = m_heatmap_lut[intensity] & 0xff;
+                p.Green() = (m_heatmap_lut[intensity] >> 8) & 0xff;
+                p.Blue() = (m_heatmap_lut[intensity] >> 16) & 0xff;
+                break;
+            case 1:
+                p.Red() = intensity;
+                p.Green() = intensity;
+                p.Blue() = intensity;       
+                break;
+            case 2:
+                p.Red() = intensity;
+                p.Green() = intensity;
+                if (intensity < 127)
+                    p.Blue() = intensity*2;
+                else
+                    p.Blue() = 255;
+                        
+                break;
+            }
+            ++p;
+        }
+        p = rowStart;
+        p.OffsetY(data, 1);
+    }
+
+}
+
+//-------------------------------------------------------------------------
+// OnMouseLeftDown()
+//-------------------------------------------------------------------------
+void PlotWaterfall::OnMouseLeftDown(wxMouseEvent& event)
+{
+    m_mouseDown = true;
+    wxClientDC dc(this);
+
+    wxPoint pt(event.GetLogicalPosition(dc));
+
+    // map x coord to edges of actual plot
+    pt.x -= PLOT_BORDER + XLEFT_OFFSET;
+    pt.y -= PLOT_BORDER;
+
+    // valid click if inside of plot
+    if ((pt.x >= 0) && (pt.x <= m_rGrid.GetWidth()) && (pt.y >=0)) 
+    {
+        float freq_hz_to_px = (float)m_rGrid.GetWidth()/(MAX_F_HZ-MIN_F_HZ);
+        float clickFreq = (float)pt.x/freq_hz_to_px;
+
+        // communicate back to other threads
+        fdmdv2_clickTune(clickFreq);
+    }
+}
+
+//-------------------------------------------------------------------------
+// OnMouseRightDown()
+//-------------------------------------------------------------------------
+void PlotWaterfall::OnMouseRightDown(wxMouseEvent& event)
+{
+    m_colour++;
+    if (m_colour == 3)
+        m_colour = 0;
+}
+
diff --git a/freedv/tags/0.99-Beta/src/fdmdv2_plot_waterfall.h b/freedv/tags/0.99-Beta/src/fdmdv2_plot_waterfall.h
new file mode 100644 (file)
index 0000000..77058fd
--- /dev/null
@@ -0,0 +1,73 @@
+//==========================================================================
+// Name:            fdmdv2_plot_waterfall.h
+// Purpose:         Defines a waterfall plot derivative of fdmdv2_plot.
+// Created:         June 22, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#ifndef __FDMDV2_PLOT_WATERFALL__
+#define __FDMDV2_PLOT_WATERFALL__
+
+#include "fdmdv2_plot.h"
+#include "fdmdv2_defines.h"
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class PlotWaterfall
+//
+// @class $(Name)
+// @author $(User)
+// @date $(Date)
+// @file $(CurrentFileName).$(CurrentFileExt)
+// @brief
+//
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class PlotWaterfall : public PlotPanel
+{
+    public:
+    PlotWaterfall(wxFrame* parent, bool graticule, int colour);
+        ~PlotWaterfall();
+        bool checkDT(void);
+        void setGreyscale(bool greyscale) { m_greyscale = greyscale; }
+        void setRxFreq(float rxFreq) { m_rxFreq = rxFreq; }
+        void setFs(int fs) { m_modem_stats_max_f_hz = fs/2; }
+
+    protected:
+        unsigned    m_heatmap_lut[256];
+
+        unsigned    heatmap(float val, float min, float max);
+
+        void        OnPaint(wxPaintEvent & evt);
+        void        OnSize(wxSizeEvent& event);
+        void        OnShow(wxShowEvent& event);
+        void        drawGraticule(wxAutoBufferedPaintDC&  dc);
+        void        draw(wxAutoBufferedPaintDC& dc);
+        void        plotPixelData();
+        void        OnMouseLeftDown(wxMouseEvent& event);
+        void        OnMouseRightDown(wxMouseEvent& event);
+
+    private:
+        float       m_dT;
+        float       m_rxFreq;
+        bool        m_graticule;
+        float       m_min_mag;
+        float       m_max_mag;
+        int         m_colour;
+        int         m_modem_stats_max_f_hz;
+
+        DECLARE_EVENT_TABLE()
+};
+
+#endif //__FDMDV2_PLOT_WATERFALL__
diff --git a/freedv/tags/0.99-Beta/src/hamlib.cpp b/freedv/tags/0.99-Beta/src/hamlib.cpp
new file mode 100644 (file)
index 0000000..575f36a
--- /dev/null
@@ -0,0 +1,127 @@
+//==========================================================================
+// Name:            hamlib.cpp
+//
+// Purpose:         Hamlib integration for FreeDV
+// Created:         May 2013
+// Authors:         Joel Stanley
+//
+// 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#include <hamlib.h>
+
+#include <vector>
+#include <algorithm>
+
+using namespace std;
+
+typedef std::vector<const struct rig_caps *> riglist_t;
+
+static bool rig_cmp(const struct rig_caps *rig1, const struct rig_caps *rig2);
+static int build_list(const struct rig_caps *rig, rig_ptr_t);
+
+Hamlib::Hamlib() : m_rig(NULL) {
+    /* Stop hamlib from spewing info to stderr. */
+    rig_set_debug(RIG_DEBUG_NONE);
+
+    /* Create sorted list of rigs. */
+    rig_load_all_backends();
+    rig_list_foreach(build_list, &m_rigList);
+    sort(m_rigList.begin(), m_rigList.end(), rig_cmp);
+
+    /* Reset debug output. */
+    rig_set_debug(RIG_DEBUG_VERBOSE);
+
+       m_rig = NULL;
+}
+
+Hamlib::~Hamlib() {
+       if(m_rig)
+               close();
+}
+
+static int build_list(const struct rig_caps *rig, rig_ptr_t rigList) {
+    ((riglist_t *)rigList)->push_back(rig); 
+    return 1;
+}
+
+static bool rig_cmp(const struct rig_caps *rig1, const struct rig_caps *rig2) {
+    /* Compare manufacturer. */
+    int r = strcasecmp(rig1->mfg_name, rig2->mfg_name);
+    if (r != 0)
+        return r < 0;
+
+    /* Compare model. */
+    r = strcasecmp(rig1->model_name, rig2->model_name);
+    if (r != 0)
+        return r < 0;
+
+    /* Compare rig ID. */
+    return rig1->rig_model < rig2->rig_model;
+}
+
+void Hamlib::populateComboBox(wxComboBox *cb) {
+
+    riglist_t::const_iterator rig = m_rigList.begin();
+    for (; rig !=m_rigList.end(); rig++) {
+        char name[128];
+        snprintf(name, 128, "%s %s", (*rig)->mfg_name, (*rig)->model_name); 
+        cb->Append(name);
+    }
+}
+
+bool Hamlib::connect(unsigned int rig_index, const char *serial_port) {
+    /* Look up model from index. */
+    if (rig_index >= m_rigList.size()) {
+        return false;
+    }
+    printf("rig: %s %s (%d)\n", m_rigList[rig_index]->mfg_name,
+            m_rigList[rig_index]->model_name, m_rigList[rig_index]->rig_model);
+
+       if(m_rig) {
+               printf("Closing old hamlib instance!\n");
+               close();
+       }
+
+    /* Initialise, configure and open. */
+    m_rig = rig_init(m_rigList[rig_index]->rig_model);
+    /* TODO: Also use baud rate from the screen. */
+    if (!m_rig)
+        return false;
+    token_t token = rig_token_lookup(m_rig, "rig_pathname");
+    if (rig_set_conf(m_rig, token, serial_port) != RIG_OK) {
+        return false;
+    }
+    if (rig_open(m_rig) == RIG_OK) {
+        return true;
+    }
+    return false;
+}
+
+bool Hamlib::ptt(bool press) {
+       if(!m_rig)
+               return false;
+    /* TODO(Joel): make ON_DATA and ON configurable. */
+    ptt_t on = press ? RIG_PTT_ON : RIG_PTT_OFF;
+    /* TODO(Joel): what should the VFO option be? */
+    return rig_set_ptt(m_rig, RIG_VFO_CURR, on) == RIG_OK;
+}
+
+void Hamlib::close(void) {
+       if(m_rig) {
+               rig_close(m_rig);
+               rig_cleanup(m_rig);
+               m_rig = NULL;
+       }
+}
diff --git a/freedv/tags/0.99-Beta/src/hamlib.h b/freedv/tags/0.99-Beta/src/hamlib.h
new file mode 100644 (file)
index 0000000..fe3496f
--- /dev/null
@@ -0,0 +1,28 @@
+#ifndef HAMLIB_H
+#define HAMLIB_H
+
+extern "C" {
+#include <hamlib/rig.h>
+}
+#include <wx/combobox.h>
+#include <vector>
+
+class Hamlib {
+
+    public:
+        Hamlib();
+        ~Hamlib();
+        void populateComboBox(wxComboBox *cb);
+        bool connect(unsigned int rig_index, const char *serial_port);
+        bool ptt(bool press);
+        void close(void);
+
+        typedef std::vector<const struct rig_caps *> riglist_t;
+
+    private:
+        RIG *m_rig;
+        /* Sorted list of rigs. */
+        riglist_t m_rigList;
+};
+
+#endif /*HAMLIB_H*/
diff --git a/freedv/tags/0.99-Beta/src/sox.h b/freedv/tags/0.99-Beta/src/sox.h
new file mode 100644 (file)
index 0000000..07aedeb
--- /dev/null
@@ -0,0 +1,2608 @@
+/* libSoX Library Public Interface
+ *
+ * Copyright 1999-2011 Chris Bagwell and SoX Contributors.
+ *
+ * This source code is freely redistributable and may be used for
+ * any purpose.  This copyright notice must be maintained.
+ * Chris Bagwell And SoX Contributors are not responsible for
+ * the consequences of using this software.
+ */
+
+/** @file
+Contains the interface exposed to clients of the libSoX library.
+Symbols starting with "sox_" or "SOX_" are part of the public interface for
+libSoX clients (applications that consume libSoX). Symbols starting with
+"lsx_" or "LSX_" are internal use by libSoX and plugins.
+LSX_ and lsx_ symbols should not be used by libSoX-based applications.
+*/
+
+#ifndef SOX_H
+#define SOX_H /**< Client API: This macro is defined if sox.h has been included. */
+
+#include <limits.h>
+#include <stdarg.h>
+#include <stddef.h>
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+/* Suppress warnings from use of type long long. */
+#if defined __GNUC__
+#pragma GCC system_header
+#endif
+
+/*****************************************************************************
+API decoration macros:
+Mostly for documentation purposes. For some compilers, decorations also affect
+code generation, influence compiler warnings or activate compiler
+optimizations.
+*****************************************************************************/
+
+/**
+Plugins API:
+Attribute required on all functions exported by libSoX and on all function
+pointer types used by the libSoX API.
+*/
+#ifdef __GNUC__
+#define LSX_API  __attribute__ ((cdecl)) /* libSoX function */
+#elif _MSC_VER
+#define LSX_API  __cdecl /* libSoX function */
+#else
+#define LSX_API /* libSoX function */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter or local variable to suppress warnings about
+the variable being unused (especially in macro-generated code).
+*/
+#ifdef __GNUC__
+#define LSX_UNUSED  __attribute__ ((unused)) /* Parameter or local variable is intentionally unused. */
+#else
+#define LSX_UNUSED /* Parameter or local variable is intentionally unused. */
+#endif
+
+/**
+Plugins API:
+LSX_PRINTF12: Attribute applied to a function to indicate that it requires
+a printf-style format string for arg1 and that printf parameters start at
+arg2.
+*/
+#ifdef __GNUC__
+#define LSX_PRINTF12  __attribute__ ((format (printf, 1, 2))) /* Function has printf-style arguments. */
+#else
+#define LSX_PRINTF12 /* Function has printf-style arguments. */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a function to indicate that it has no side effects and
+depends only its input parameters and global memory. If called repeatedly, it
+returns the same result each time.
+*/
+#ifdef __GNUC__
+#define LSX_RETURN_PURE __attribute__ ((pure)) /* Function is pure. */
+#else
+#define LSX_RETURN_PURE /* Function is pure. */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a function to indicate that the
+return value is always a pointer to a valid object (never NULL).
+*/
+#ifdef _Ret_
+#define LSX_RETURN_VALID _Ret_ /* Function always returns a valid object (never NULL). */
+#else
+#define LSX_RETURN_VALID /* Function always returns a valid object (never NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a function to indicate that the return value is always a
+pointer to a valid array (never NULL).
+*/
+#ifdef _Ret_valid_
+#define LSX_RETURN_ARRAY _Ret_valid_ /* Function always returns a valid array (never NULL). */
+#else
+#define LSX_RETURN_ARRAY /* Function always returns a valid array (never NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a function to indicate that the return value is always a
+pointer to a valid 0-terminated array (never NULL).
+*/
+#ifdef _Ret_z_
+#define LSX_RETURN_VALID_Z _Ret_z_ /* Function always returns a 0-terminated array (never NULL). */
+#else
+#define LSX_RETURN_VALID_Z /* Function always returns a 0-terminated array (never NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a function to indicate that the returned pointer may be
+null.
+*/
+#ifdef _Ret_opt_
+#define LSX_RETURN_OPT _Ret_opt_ /* Function may return NULL. */
+#else
+#define LSX_RETURN_OPT /* Function may return NULL. */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a valid
+pointer to one const element of the pointed-to type (never NULL).
+*/
+#ifdef _In_
+#define LSX_PARAM_IN _In_ /* Required const pointer to a valid object (never NULL). */
+#else
+#define LSX_PARAM_IN /* Required const pointer to a valid object (never NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a valid
+pointer to a const 0-terminated string (never NULL).
+*/
+#ifdef _In_z_
+#define LSX_PARAM_IN_Z _In_z_ /* Required const pointer to 0-terminated string (never NULL). */
+#else
+#define LSX_PARAM_IN_Z /* Required const pointer to 0-terminated string (never NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a const
+pointer to a 0-terminated printf format string.
+*/
+#ifdef _Printf_format_string_
+#define LSX_PARAM_IN_PRINTF _Printf_format_string_ /* Required const pointer to 0-terminated printf format string (never NULL). */
+#else
+#define LSX_PARAM_IN_PRINTF /* Required const pointer to 0-terminated printf format string (never NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a valid
+pointer to (len) const initialized elements of the pointed-to type, where
+(len) is the name of another parameter.
+@param len The parameter that contains the number of elements in the array.
+*/
+#ifdef _In_count_
+#define LSX_PARAM_IN_COUNT(len) _In_count_(len) /* Required const pointer to (len) valid objects (never NULL). */
+#else
+#define LSX_PARAM_IN_COUNT(len) /* Required const pointer to (len) valid objects (never NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a valid
+pointer to (len) const bytes of initialized data, where (len) is the name of
+another parameter.
+@param len The parameter that contains the number of bytes in the array.
+*/
+#ifdef _In_bytecount_
+#define LSX_PARAM_IN_BYTECOUNT(len) _In_bytecount_(len) /* Required const pointer to (len) bytes of data (never NULL). */
+#else
+#define LSX_PARAM_IN_BYTECOUNT(len) /* Required const pointer to (len) bytes of data (never NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is either NULL
+or a valid pointer to one const element of the pointed-to type.
+*/
+#ifdef _In_opt_
+#define LSX_PARAM_IN_OPT _In_opt_ /* Optional const pointer to a valid object (may be NULL). */
+#else
+#define LSX_PARAM_IN_OPT /* Optional const pointer to a valid object (may be NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is either NULL
+or a valid pointer to a const 0-terminated string.
+*/
+#ifdef _In_opt_z_
+#define LSX_PARAM_IN_OPT_Z _In_opt_z_ /* Optional const pointer to 0-terminated string (may be NULL). */
+#else
+#define LSX_PARAM_IN_OPT_Z /* Optional const pointer to 0-terminated string (may be NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a valid
+pointer to one initialized element of the pointed-to type (never NULL). The
+function may modify the element.
+*/
+#ifdef _Inout_
+#define LSX_PARAM_INOUT _Inout_ /* Required pointer to a valid object (never NULL). */
+#else
+#define LSX_PARAM_INOUT /* Required pointer to a valid object (never NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a valid
+pointer to (len) initialized elements of the pointed-to type (never NULL). The
+function may modify the elements.
+@param len The parameter that contains the number of elements in the array.
+*/
+#ifdef _Inout_count_x_
+#define LSX_PARAM_INOUT_COUNT(len) _Inout_count_x_(len) /* Required pointer to (len) valid objects (never NULL). */
+#else
+#define LSX_PARAM_INOUT_COUNT(len) /* Required pointer to (len) valid objects (never NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a valid
+pointer to memory sufficient for one element of the pointed-to type (never
+NULL). The function will initialize the element.
+*/
+#ifdef _Out_
+#define LSX_PARAM_OUT _Out_ /* Required pointer to an object to be initialized (never NULL). */
+#else
+#define LSX_PARAM_OUT /* Required pointer to an object to be initialized (never NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a valid
+pointer to memory sufficient for (len) bytes of data (never NULL), where (len)
+is the name of another parameter. The function may write up to len bytes of
+data to this memory.
+@param len The parameter that contains the number of bytes in the array.
+*/
+#ifdef _Out_bytecap_
+#define LSX_PARAM_OUT_BYTECAP(len) _Out_bytecap_(len) /* Required pointer to writable buffer with room for len bytes. */
+#else
+#define LSX_PARAM_OUT_BYTECAP(len) /* Required pointer to writable buffer with room for len bytes. */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a valid
+pointer to memory sufficient for (len) elements of the pointed-to type (never
+NULL), where (len) is the name of another parameter. On return, (filled)
+elements will have been initialized, where (filled) is either the dereference
+of another pointer parameter (for example "*written") or the "return"
+parameter (indicating that the function returns the number of elements
+written).
+@param len The parameter that contains the number of elements in the array.
+@param filled The dereference of the parameter that receives the number of elements written to the array, or "return" if the value is returned.
+*/
+#ifdef _Out_cap_post_count_
+#define LSX_PARAM_OUT_CAP_POST_COUNT(len,filled) _Out_cap_post_count_(len,filled) /* Required pointer to buffer for (len) elements (never NULL); on return, (filled) elements will have been initialized. */
+#else
+#define LSX_PARAM_OUT_CAP_POST_COUNT(len,filled) /* Required pointer to buffer for (len) elements (never NULL); on return, (filled) elements will have been initialized. */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a valid
+pointer to memory sufficient for (len) elements of the pointed-to type (never
+NULL), where (len) is the name of another parameter. On return, (filled+1)
+elements will have been initialized, with the last element having been
+initialized to 0, where (filled) is either the dereference of another pointer
+parameter (for example, "*written") or the "return" parameter (indicating that
+the function returns the number of elements written).
+@param len The parameter that contains the number of elements in the array.
+@param filled The dereference of the parameter that receives the number of elements written to the array (not counting the terminating null), or "return" if the value is returned.
+*/
+#ifdef _Out_z_cap_post_count_
+#define LSX_PARAM_OUT_Z_CAP_POST_COUNT(len,filled) _Out_z_cap_post_count_(len,filled) /* Required pointer to buffer for (len) elements (never NULL); on return, (filled+1) elements will have been initialized, and the array will be 0-terminated. */
+#else
+#define LSX_PARAM_OUT_Z_CAP_POST_COUNT(len,filled) /* Required pointer to buffer for (len) elements (never NULL); on return, (filled+1) elements will have been initialized, and the array will be 0-terminated. */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is either NULL
+or a valid pointer to memory sufficient for one element of the pointed-to
+type. The function will initialize the element.
+*/
+#ifdef _Out_opt_
+#define LSX_PARAM_OUT_OPT _Out_opt_ /* Optional pointer to an object to be initialized (may be NULL). */
+#else
+#define LSX_PARAM_OUT_OPT /* Optional pointer to an object to be initialized (may be NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a valid
+pointer (never NULL) to another pointer which may be NULL when the function is
+invoked.
+*/
+#ifdef _Deref_pre_maybenull_
+#define LSX_PARAM_DEREF_PRE_MAYBENULL _Deref_pre_maybenull_ /* Required pointer (never NULL) to another pointer (may be NULL). */
+#else
+#define LSX_PARAM_DEREF_PRE_MAYBENULL /* Required pointer (never NULL) to another pointer (may be NULL). */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a valid
+pointer (never NULL) to another pointer which will be NULL when the function
+returns.
+*/
+#ifdef _Deref_post_null_
+#define LSX_PARAM_DEREF_POST_NULL _Deref_post_null_ /* Required pointer (never NULL) to another pointer, which will be NULL on exit. */
+#else
+#define LSX_PARAM_DEREF_POST_NULL /* Required pointer (never NULL) to another pointer, which will be NULL on exit. */
+#endif
+
+/**
+Plugins API:
+Attribute applied to a parameter to indicate that the parameter is a valid
+pointer (never NULL) to another pointer which will be non-NULL when the
+function returns.
+*/
+#ifdef _Deref_post_notnull_
+#define LSX_PARAM_DEREF_POST_NOTNULL _Deref_post_notnull_ /* Required pointer (never NULL) to another pointer, which will be valid (not NULL) on exit. */
+#else
+#define LSX_PARAM_DEREF_POST_NOTNULL /* Required pointer (never NULL) to another pointer, which will be valid (not NULL) on exit. */
+#endif
+
+/**
+Plugins API:
+Expression that "uses" a potentially-unused variable to avoid compiler
+warnings (especially in macro-generated code).
+*/
+#ifdef _PREFAST_
+#define LSX_USE_VAR(x)  ((void)(x=0)) /* During static analysis, initialize unused variables to 0. */
+#else
+#define LSX_USE_VAR(x)  ((void)(x)) /* Parameter or variable is intentionally unused. */
+#endif
+
+/**
+Plugins API:
+Compile-time assertion. Causes a compile error if the expression is false.
+@param e  The expression to test. If expression is false, compilation will fail.
+@param f  A unique identifier for the test, for example foo_must_not_be_zero.
+*/
+#define lsx_static_assert(e,f) enum {lsx_static_assert_##f = 1/((e) ? 1 : 0)}
+
+/*****************************************************************************
+Basic typedefs:
+*****************************************************************************/
+
+/**
+Client API:
+Signed twos-complement 8-bit type. Typically defined as signed char.
+*/
+#if SCHAR_MAX==127 && SCHAR_MIN==(-128)
+typedef signed char sox_int8_t;
+#elif CHAR_MAX==127 && CHAR_MIN==(-128)
+typedef char sox_int8_t;
+#else
+#error Unable to determine an appropriate definition for sox_int8_t.
+#endif
+
+/**
+Client API:
+Unsigned 8-bit type. Typically defined as unsigned char.
+*/
+#if UCHAR_MAX==0xff
+typedef unsigned char sox_uint8_t;
+#elif CHAR_MAX==0xff && CHAR_MIN==0
+typedef char sox_uint8_t;
+#else
+#error Unable to determine an appropriate definition for sox_uint8_t.
+#endif
+
+/**
+Client API:
+Signed twos-complement 16-bit type. Typically defined as short.
+*/
+#if SHRT_MAX==32767 && SHRT_MIN==(-32768)
+typedef short sox_int16_t;
+#elif INT_MAX==32767 && INT_MIN==(-32768)
+typedef int sox_int16_t;
+#else
+#error Unable to determine an appropriate definition for sox_int16_t.
+#endif
+
+/**
+Client API:
+Unsigned 16-bit type. Typically defined as unsigned short.
+*/
+#if USHRT_MAX==0xffff
+typedef unsigned short sox_uint16_t;
+#elif UINT_MAX==0xffff
+typedef unsigned int sox_uint16_t;
+#else
+#error Unable to determine an appropriate definition for sox_uint16_t.
+#endif
+
+/**
+Client API:
+Signed twos-complement 32-bit type. Typically defined as int.
+*/
+#if INT_MAX==2147483647 && INT_MIN==(-2147483647-1)
+typedef int sox_int32_t;
+#elif LONG_MAX==2147483647 && LONG_MIN==(-2147483647-1)
+typedef long sox_int32_t;
+#else
+#error Unable to determine an appropriate definition for sox_int32_t.
+#endif
+
+/**
+Client API:
+Unsigned 32-bit type. Typically defined as unsigned int.
+*/
+#if UINT_MAX==0xffffffff
+typedef unsigned int sox_uint32_t;
+#elif ULONG_MAX==0xffffffff
+typedef unsigned long sox_uint32_t;
+#else
+#error Unable to determine an appropriate definition for sox_uint32_t.
+#endif
+
+/**
+Client API:
+Signed twos-complement 64-bit type. Typically defined as long or long long.
+*/
+#if LONG_MAX==9223372036854775807 && LONG_MIN==(-9223372036854775807-1)
+typedef long sox_int64_t;
+#elif defined(_MSC_VER)
+typedef __int64 sox_int64_t;
+#else
+typedef long long sox_int64_t;
+#endif
+
+/**
+Client API:
+Unsigned 64-bit type. Typically defined as unsigned long or unsigned long long.
+*/
+#if ULONG_MAX==0xffffffffffffffff
+typedef unsigned long sox_uint64_t;
+#elif defined(_MSC_VER)
+typedef unsigned __int64 sox_uint64_t;
+#else
+typedef unsigned long long sox_uint64_t;
+#endif
+
+#ifndef _DOXYGEN_
+lsx_static_assert(sizeof(sox_int8_t)==1,   sox_int8_size);
+lsx_static_assert(sizeof(sox_uint8_t)==1,  sox_uint8_size);
+lsx_static_assert(sizeof(sox_int16_t)==2,  sox_int16_size);
+lsx_static_assert(sizeof(sox_uint16_t)==2, sox_uint16_size);
+lsx_static_assert(sizeof(sox_int32_t)==4,  sox_int32_size);
+lsx_static_assert(sizeof(sox_uint32_t)==4, sox_uint32_size);
+lsx_static_assert(sizeof(sox_int64_t)==8,  sox_int64_size);
+lsx_static_assert(sizeof(sox_uint64_t)==8, sox_uint64_size);
+#endif
+
+/**
+Client API:
+Alias for sox_int32_t (beware of the extra byte).
+*/
+typedef sox_int32_t sox_int24_t;
+
+/**
+Client API:
+Alias for sox_uint32_t (beware of the extra byte).
+*/
+typedef sox_uint32_t sox_uint24_t;
+
+/**
+Client API:
+Native SoX audio sample type (alias for sox_int32_t).
+*/
+typedef sox_int32_t sox_sample_t;
+
+/**
+Client API:
+Samples per second is stored as a double.
+*/
+typedef double sox_rate_t;
+
+/**
+Client API:
+File's metadata, access via sox_*_comments functions.
+*/
+typedef char * * sox_comments_t;
+
+/*****************************************************************************
+Enumerations:
+*****************************************************************************/
+
+/**
+Client API:
+Boolean type, assignment (but not necessarily binary) compatible with C++ bool.
+*/
+typedef enum sox_bool {
+    sox_false, /**< False = 0. */
+    sox_true   /**< True = 1. */
+} sox_bool;
+
+/**
+Client API:
+no, yes, or default (default usually implies some kind of auto-detect logic).
+*/
+typedef enum sox_option_t {
+    sox_option_no,      /**< Option specified as no = 0. */
+    sox_option_yes,     /**< Option specified as yes = 1. */
+    sox_option_default  /**< Option unspecified = 2. */
+} sox_option_t;
+
+/**
+Client API:
+The libSoX-specific error codes.
+libSoX functions may return these codes or others that map from errno codes.
+*/
+enum sox_error_t {
+  SOX_SUCCESS = 0,     /**< Function succeeded = 0 */
+  SOX_EOF = -1,        /**< End Of File or other error = -1 */
+  SOX_EHDR = 2000,     /**< Invalid Audio Header = 2000 */
+  SOX_EFMT,            /**< Unsupported data format = 2001 */
+  SOX_ENOMEM,          /**< Can't alloc memory = 2002 */
+  SOX_EPERM,           /**< Operation not permitted = 2003 */
+  SOX_ENOTSUP,         /**< Operation not supported = 2004 */
+  SOX_EINVAL           /**< Invalid argument = 2005 */
+};
+
+/**
+Client API:
+Flags indicating whether optional features are present in this build of libSoX.
+*/
+typedef enum sox_version_flags_t {
+    sox_version_none = 0,         /**< No special features = 0. */
+    sox_version_have_popen = 1,   /**< popen = 1. */
+    sox_version_have_magic = 2,   /**< magic = 2. */
+    sox_version_have_threads = 4, /**< threads = 4. */
+    sox_version_have_memopen = 8  /**< memopen = 8. */
+} sox_version_flags_t;
+
+/**
+Client API:
+Format of sample data.
+*/
+typedef enum sox_encoding_t {
+  SOX_ENCODING_UNKNOWN   , /**< encoding has not yet been determined */
+
+  SOX_ENCODING_SIGN2     , /**< signed linear 2's comp: Mac */
+  SOX_ENCODING_UNSIGNED  , /**< unsigned linear: Sound Blaster */
+  SOX_ENCODING_FLOAT     , /**< floating point (binary format) */
+  SOX_ENCODING_FLOAT_TEXT, /**< floating point (text format) */
+  SOX_ENCODING_FLAC      , /**< FLAC compression */
+  SOX_ENCODING_HCOM      , /**< Mac FSSD files with Huffman compression */
+  SOX_ENCODING_WAVPACK   , /**< WavPack with integer samples */
+  SOX_ENCODING_WAVPACKF  , /**< WavPack with float samples */
+  SOX_ENCODING_ULAW      , /**< u-law signed logs: US telephony, SPARC */
+  SOX_ENCODING_ALAW      , /**< A-law signed logs: non-US telephony, Psion */
+  SOX_ENCODING_G721      , /**< G.721 4-bit ADPCM */
+  SOX_ENCODING_G723      , /**< G.723 3 or 5 bit ADPCM */
+  SOX_ENCODING_CL_ADPCM  , /**< Creative Labs 8 --> 2,3,4 bit Compressed PCM */
+  SOX_ENCODING_CL_ADPCM16, /**< Creative Labs 16 --> 4 bit Compressed PCM */
+  SOX_ENCODING_MS_ADPCM  , /**< Microsoft Compressed PCM */
+  SOX_ENCODING_IMA_ADPCM , /**< IMA Compressed PCM */
+  SOX_ENCODING_OKI_ADPCM , /**< Dialogic/OKI Compressed PCM */
+  SOX_ENCODING_DPCM      , /**< Differential PCM: Fasttracker 2 (xi) */
+  SOX_ENCODING_DWVW      , /**< Delta Width Variable Word */
+  SOX_ENCODING_DWVWN     , /**< Delta Width Variable Word N-bit */
+  SOX_ENCODING_GSM       , /**< GSM 6.10 33byte frame lossy compression */
+  SOX_ENCODING_MP3       , /**< MP3 compression */
+  SOX_ENCODING_VORBIS    , /**< Vorbis compression */
+  SOX_ENCODING_AMR_WB    , /**< AMR-WB compression */
+  SOX_ENCODING_AMR_NB    , /**< AMR-NB compression */
+  SOX_ENCODING_CVSD      , /**< Continuously Variable Slope Delta modulation */
+  SOX_ENCODING_LPC10     , /**< Linear Predictive Coding */
+
+  SOX_ENCODINGS            /**< End of list marker */
+} sox_encoding_t;
+
+/**
+Client API:
+Flags for sox_encodings_info_t: lossless/lossy1/lossy2.
+*/
+typedef enum sox_encodings_flags_t {
+  sox_encodings_none   = 0, /**< no flags specified (implies lossless encoding) = 0. */
+  sox_encodings_lossy1 = 1, /**< encode, decode: lossy once = 1. */
+  sox_encodings_lossy2 = 2  /**< encode, decode, encode, decode: lossy twice = 2. */
+} sox_encodings_flags_t;
+
+/**
+Client API:
+Type of plot.
+*/
+typedef enum sox_plot_t {
+    sox_plot_off,     /**< No plot = 0. */
+    sox_plot_octave,  /**< Octave plot = 1. */
+    sox_plot_gnuplot, /**< Gnuplot plot = 2. */
+    sox_plot_data     /**< Plot data = 3. */
+} sox_plot_t;
+
+/**
+Client API:
+Loop modes: upper 4 bits mask the loop blass, lower 4 bits describe
+the loop behaviour, for example single shot, bidirectional etc.
+*/
+enum sox_loop_flags_t {
+  sox_loop_none = 0,          /**< single-shot = 0 */
+  sox_loop_forward = 1,       /**< forward loop = 1 */
+  sox_loop_forward_back = 2,  /**< forward/back loop = 2 */
+  sox_loop_8 = 32,            /**< 8 loops (??) = 32 */
+  sox_loop_sustain_decay = 64 /**< AIFF style, one sustain & one decay loop = 64 */
+};
+
+/**
+Plugins API:
+Is file a real file, a pipe, or a url?
+*/
+typedef enum lsx_io_type
+{
+    lsx_io_file, /**< File is a real file = 0. */
+    lsx_io_pipe, /**< File is a pipe (no seeking) = 1. */
+    lsx_io_url   /**< File is a URL (no seeking) = 2. */
+} lsx_io_type;
+
+/*****************************************************************************
+Macros:
+*****************************************************************************/
+
+/**
+Client API:
+Compute a 32-bit integer API version from three 8-bit parts.
+@param a Major version.
+@param b Minor version.
+@param c Revision or build number.
+@returns 32-bit integer API version 0x000a0b0c.
+*/
+#define SOX_LIB_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
+
+/**
+Client API:
+The API version of the sox.h file. It is not meant to follow the version
+number of SoX but it has historically. Please do not count on
+SOX_LIB_VERSION_CODE staying in sync with the libSoX version.
+*/
+#define SOX_LIB_VERSION_CODE   SOX_LIB_VERSION(14, 4, 0)
+
+/**
+Client API:
+Returns the smallest (negative) value storable in a twos-complement signed
+integer with the specified number of bits, cast to an unsigned integer;
+for example, SOX_INT_MIN(8) = 0x80, SOX_INT_MIN(16) = 0x8000, etc.
+@param bits Size of value for which to calculate minimum.
+@returns the smallest (negative) value storable in a twos-complement signed
+integer with the specified number of bits, cast to an unsigned integer.
+*/
+#define SOX_INT_MIN(bits) (1 <<((bits)-1))
+
+/**
+Client API:
+Returns the largest (positive) value storable in a twos-complement signed
+integer with the specified number of bits, cast to an unsigned integer;
+for example, SOX_INT_MAX(8) = 0x7F, SOX_INT_MAX(16) = 0x7FFF, etc.
+@param bits Size of value for which to calculate maximum.
+@returns the largest (positive) value storable in a twos-complement signed
+integer with the specified number of bits, cast to an unsigned integer.
+*/
+#define SOX_INT_MAX(bits) (((unsigned)-1)>>(33-(bits)))
+
+/**
+Client API:
+Returns the largest value storable in an unsigned integer with the specified
+number of bits; for example, SOX_UINT_MAX(8) = 0xFF,
+SOX_UINT_MAX(16) = 0xFFFF, etc.
+@param bits Size of value for which to calculate maximum.
+@returns the largest value storable in an unsigned integer with the specified
+number of bits.
+*/
+#define SOX_UINT_MAX(bits) (SOX_INT_MIN(bits)|SOX_INT_MAX(bits))
+
+/**
+Client API:
+Returns 0x7F.
+*/
+#define SOX_INT8_MAX  SOX_INT_MAX(8)
+
+/**
+Client API:
+Returns 0x7FFF.
+*/
+#define SOX_INT16_MAX SOX_INT_MAX(16)
+
+/**
+Client API:
+Returns 0x7FFFFF.
+*/
+#define SOX_INT24_MAX SOX_INT_MAX(24)
+
+/**
+Client API:
+Returns 0x7FFFFFFF.
+*/
+#define SOX_INT32_MAX SOX_INT_MAX(32)
+
+/**
+Client API:
+Bits in a sox_sample_t = 32.
+*/
+#define SOX_SAMPLE_PRECISION 32
+
+/**
+Client API:
+Max value for sox_sample_t = 0x7FFFFFFF.
+*/
+#define SOX_SAMPLE_MAX (sox_sample_t)SOX_INT_MAX(32)
+
+/**
+Client API:
+Min value for sox_sample_t = 0x80000000.
+*/
+#define SOX_SAMPLE_MIN (sox_sample_t)SOX_INT_MIN(32)
+
+
+/*                Conversions: Linear PCM <--> sox_sample_t
+ *
+ *   I/O      Input    sox_sample_t Clips?   Input    sox_sample_t Clips?
+ *  Format   Minimum     Minimum     I O    Maximum     Maximum     I O
+ *  ------  ---------  ------------ -- --   --------  ------------ -- --
+ *  Float     -inf         -1        y n      inf      1 - 5e-10    y n
+ *  Int8      -128        -128       n n      127     127.9999999   n y
+ *  Int16    -32768      -32768      n n     32767    32767.99998   n y
+ *  Int24   -8388608    -8388608     n n    8388607   8388607.996   n y
+ *  Int32  -2147483648 -2147483648   n n   2147483647 2147483647    n n
+ *
+ * Conversions are as accurate as possible (with rounding).
+ *
+ * Rounding: halves toward +inf, all others to nearest integer.
+ *
+ * Clips? shows whether on not there is the possibility of a conversion
+ * clipping to the minimum or maximum value when inputing from or outputing
+ * to a given type.
+ *
+ * Unsigned integers are converted to and from signed integers by flipping
+ * the upper-most bit then treating them as signed integers.
+ */
+
+/**
+Client API:
+Declares the temporary local variables that are required when using SOX
+conversion macros.
+*/
+#define SOX_SAMPLE_LOCALS sox_sample_t sox_macro_temp_sample LSX_UNUSED; \
+  double sox_macro_temp_double LSX_UNUSED
+
+/**
+Client API:
+Sign bit for sox_sample_t = 0x80000000.
+*/
+#define SOX_SAMPLE_NEG SOX_INT_MIN(32)
+
+/**
+Client API:
+Converts sox_sample_t to an unsigned integer of width (bits).
+@param bits  Width of resulting sample (1 through 32).
+@param d     Input sample to be converted.
+@param clips Variable that is incremented if the result is too big.
+@returns Unsigned integer of width (bits).
+*/
+#define SOX_SAMPLE_TO_UNSIGNED(bits,d,clips) \
+  (sox_uint##bits##_t)(SOX_SAMPLE_TO_SIGNED(bits,d,clips)^SOX_INT_MIN(bits))
+
+/**
+Client API:
+Converts sox_sample_t to a signed integer of width (bits).
+@param bits  Width of resulting sample (1 through 32).
+@param d     Input sample to be converted.
+@param clips Variable that is incremented if the result is too big.
+@returns Signed integer of width (bits).
+*/
+#define SOX_SAMPLE_TO_SIGNED(bits,d,clips) \
+  (sox_int##bits##_t)(LSX_USE_VAR(sox_macro_temp_double),sox_macro_temp_sample=(d),sox_macro_temp_sample>SOX_SAMPLE_MAX-(1<<(31-bits))?++(clips),SOX_INT_MAX(bits):((sox_uint32_t)(sox_macro_temp_sample+(1<<(31-bits))))>>(32-bits))
+
+/**
+Client API:
+Converts signed integer of width (bits) to sox_sample_t.
+@param bits Width of input sample (1 through 32).
+@param d    Input sample to be converted.
+@returns SoX native sample value.
+*/
+#define SOX_SIGNED_TO_SAMPLE(bits,d)((sox_sample_t)(d)<<(32-bits))
+
+/**
+Client API:
+Converts unsigned integer of width (bits) to sox_sample_t.
+@param bits Width of input sample (1 through 32).
+@param d    Input sample to be converted.
+@returns SoX native sample value.
+*/
+#define SOX_UNSIGNED_TO_SAMPLE(bits,d)(SOX_SIGNED_TO_SAMPLE(bits,d)^SOX_SAMPLE_NEG)
+
+/**
+Client API:
+Converts unsigned 8-bit integer to sox_sample_t.
+@param d     Input sample to be converted.
+@param clips The parameter is not used.
+@returns SoX native sample value.
+*/
+#define SOX_UNSIGNED_8BIT_TO_SAMPLE(d,clips) SOX_UNSIGNED_TO_SAMPLE(8,d)
+
+/**
+Client API:
+Converts signed 8-bit integer to sox_sample_t.
+@param d    Input sample to be converted.
+@param clips The parameter is not used.
+@returns SoX native sample value.
+*/
+#define SOX_SIGNED_8BIT_TO_SAMPLE(d,clips) SOX_SIGNED_TO_SAMPLE(8,d)
+
+/**
+Client API:
+Converts unsigned 16-bit integer to sox_sample_t.
+@param d     Input sample to be converted.
+@param clips The parameter is not used.
+@returns SoX native sample value.
+*/
+#define SOX_UNSIGNED_16BIT_TO_SAMPLE(d,clips) SOX_UNSIGNED_TO_SAMPLE(16,d)
+
+/**
+Client API:
+Converts signed 16-bit integer to sox_sample_t.
+@param d    Input sample to be converted.
+@param clips The parameter is not used.
+@returns SoX native sample value.
+*/
+#define SOX_SIGNED_16BIT_TO_SAMPLE(d,clips) SOX_SIGNED_TO_SAMPLE(16,d)
+
+/**
+Client API:
+Converts unsigned 24-bit integer to sox_sample_t.
+@param d     Input sample to be converted.
+@param clips The parameter is not used.
+@returns SoX native sample value.
+*/
+#define SOX_UNSIGNED_24BIT_TO_SAMPLE(d,clips) SOX_UNSIGNED_TO_SAMPLE(24,d)
+
+/**
+Client API:
+Converts signed 24-bit integer to sox_sample_t.
+@param d    Input sample to be converted.
+@param clips The parameter is not used.
+@returns SoX native sample value.
+*/
+#define SOX_SIGNED_24BIT_TO_SAMPLE(d,clips) SOX_SIGNED_TO_SAMPLE(24,d)
+
+/**
+Client API:
+Converts unsigned 32-bit integer to sox_sample_t.
+@param d     Input sample to be converted.
+@param clips The parameter is not used.
+@returns SoX native sample value.
+*/
+#define SOX_UNSIGNED_32BIT_TO_SAMPLE(d,clips) ((sox_sample_t)(d)^SOX_SAMPLE_NEG)
+
+/**
+Client API:
+Converts signed 32-bit integer to sox_sample_t.
+@param d    Input sample to be converted.
+@param clips The parameter is not used.
+@returns SoX native sample value.
+*/
+#define SOX_SIGNED_32BIT_TO_SAMPLE(d,clips) (sox_sample_t)(d)
+
+/**
+Client API:
+Converts 32-bit float to sox_sample_t.
+@param d     Input sample to be converted, range [-1, 1).
+@param clips Variable to increment if the input sample is too large or too small.
+@returns SoX native sample value.
+*/
+#define SOX_FLOAT_32BIT_TO_SAMPLE(d,clips) (sox_sample_t)(LSX_USE_VAR(sox_macro_temp_sample),sox_macro_temp_double=(d)*(SOX_SAMPLE_MAX+1.),sox_macro_temp_double<SOX_SAMPLE_MIN?++(clips),SOX_SAMPLE_MIN:sox_macro_temp_double>=SOX_SAMPLE_MAX+1.?sox_macro_temp_double>SOX_SAMPLE_MAX+1.?++(clips),SOX_SAMPLE_MAX:SOX_SAMPLE_MAX:sox_macro_temp_double)
+
+/**
+Client API:
+Converts 64-bit float to sox_sample_t.
+@param d     Input sample to be converted, range [-1, 1).
+@param clips Variable to increment if the input sample is too large or too small.
+@returns SoX native sample value.
+*/
+#define SOX_FLOAT_64BIT_TO_SAMPLE(d,clips) (sox_sample_t)(LSX_USE_VAR(sox_macro_temp_sample),sox_macro_temp_double=(d)*(SOX_SAMPLE_MAX+1.),sox_macro_temp_double<0?sox_macro_temp_double<=SOX_SAMPLE_MIN-.5?++(clips),SOX_SAMPLE_MIN:sox_macro_temp_double-.5:sox_macro_temp_double>=SOX_SAMPLE_MAX+.5?sox_macro_temp_double>SOX_SAMPLE_MAX+1.?++(clips),SOX_SAMPLE_MAX:SOX_SAMPLE_MAX:sox_macro_temp_double+.5)
+
+/**
+Client API:
+Converts SoX native sample to an unsigned 8-bit integer.
+@param d Input sample to be converted.
+@param clips Variable to increment if input sample is too large.
+*/
+#define SOX_SAMPLE_TO_UNSIGNED_8BIT(d,clips) SOX_SAMPLE_TO_UNSIGNED(8,d,clips)
+
+/**
+Client API:
+Converts SoX native sample to an signed 8-bit integer.
+@param d Input sample to be converted.
+@param clips Variable to increment if input sample is too large.
+*/
+#define SOX_SAMPLE_TO_SIGNED_8BIT(d,clips) SOX_SAMPLE_TO_SIGNED(8,d,clips)
+
+/**
+Client API:
+Converts SoX native sample to an unsigned 16-bit integer.
+@param d Input sample to be converted.
+@param clips Variable to increment if input sample is too large.
+*/
+#define SOX_SAMPLE_TO_UNSIGNED_16BIT(d,clips) SOX_SAMPLE_TO_UNSIGNED(16,d,clips)
+
+/**
+Client API:
+Converts SoX native sample to a signed 16-bit integer.
+@param d Input sample to be converted.
+@param clips Variable to increment if input sample is too large.
+*/
+#define SOX_SAMPLE_TO_SIGNED_16BIT(d,clips) SOX_SAMPLE_TO_SIGNED(16,d,clips)
+
+/**
+Client API:
+Converts SoX native sample to an unsigned 24-bit integer.
+@param d Input sample to be converted.
+@param clips Variable to increment if input sample is too large.
+*/
+#define SOX_SAMPLE_TO_UNSIGNED_24BIT(d,clips) SOX_SAMPLE_TO_UNSIGNED(24,d,clips)
+
+/**
+Client API:
+Converts SoX native sample to a signed 24-bit integer.
+@param d Input sample to be converted.
+@param clips Variable to increment if input sample is too large.
+*/
+#define SOX_SAMPLE_TO_SIGNED_24BIT(d,clips) SOX_SAMPLE_TO_SIGNED(24,d,clips)
+
+/**
+Client API:
+Converts SoX native sample to an unsigned 32-bit integer.
+@param d Input sample to be converted.
+@param clips The parameter is not used.
+*/
+#define SOX_SAMPLE_TO_UNSIGNED_32BIT(d,clips) (sox_uint32_t)((d)^SOX_SAMPLE_NEG)
+
+/**
+Client API:
+Converts SoX native sample to a signed 32-bit integer.
+@param d Input sample to be converted.
+@param clips The parameter is not used.
+*/
+#define SOX_SAMPLE_TO_SIGNED_32BIT(d,clips) (sox_int32_t)(d)
+
+/**
+Client API:
+Converts SoX native sample to a 32-bit float.
+@param d Input sample to be converted.
+@param clips Variable to increment if input sample is too large.
+*/
+#define SOX_SAMPLE_TO_FLOAT_32BIT(d,clips) (LSX_USE_VAR(sox_macro_temp_double),sox_macro_temp_sample=(d),sox_macro_temp_sample>SOX_SAMPLE_MAX-128?++(clips),1:(((sox_macro_temp_sample+128)&~255)*(1./(SOX_SAMPLE_MAX+1.))))
+
+/**
+Client API:
+Converts SoX native sample to a 64-bit float.
+@param d Input sample to be converted.
+@param clips The parameter is not used.
+*/
+#define SOX_SAMPLE_TO_FLOAT_64BIT(d,clips) ((d)*(1./(SOX_SAMPLE_MAX+1.)))
+
+/**
+Client API:
+Clips a value of a type that is larger then sox_sample_t (for example, int64)
+to sox_sample_t's limits and increment a counter if clipping occurs.
+@param samp Value (lvalue) to be clipped, updated as necessary.
+@param clips Value (lvalue) that is incremented if clipping is needed.
+*/
+#define SOX_SAMPLE_CLIP_COUNT(samp, clips) \
+  do { \
+    if (samp > SOX_SAMPLE_MAX) \
+      { samp = SOX_SAMPLE_MAX; clips++; } \
+    else if (samp < SOX_SAMPLE_MIN) \
+      { samp = SOX_SAMPLE_MIN; clips++; } \
+  } while (0)
+
+/**
+Client API:
+Clips a value of a type that is larger then sox_sample_t (for example, int64)
+to sox_sample_t's limits and increment a counter if clipping occurs.
+@param d Value (rvalue) to be clipped.
+@param clips Value (lvalue) that is incremented if clipping is needed.
+@returns Clipped value.
+*/
+#define SOX_ROUND_CLIP_COUNT(d, clips) \
+  ((d) < 0? (d) <= SOX_SAMPLE_MIN - 0.5? ++(clips), SOX_SAMPLE_MIN: (d) - 0.5 \
+        : (d) >= SOX_SAMPLE_MAX + 0.5? ++(clips), SOX_SAMPLE_MAX: (d) + 0.5)
+
+/**
+Client API:
+Clips a value to the limits of a signed integer of the specified width
+and increment a counter if clipping occurs.
+@param bits Width (in bits) of target integer type.
+@param i Value (rvalue) to be clipped.
+@param clips Value (lvalue) that is incremented if clipping is needed.
+@returns Clipped value.
+*/
+#define SOX_INTEGER_CLIP_COUNT(bits,i,clips) ( \
+  (i) >(1 << ((bits)-1))- 1? ++(clips),(1 << ((bits)-1))- 1 : \
+  (i) <-1 << ((bits)-1)    ? ++(clips),-1 << ((bits)-1) : (i))
+
+/**
+Client API:
+Clips a value to the limits of a 16-bit signed integer and increment a counter
+if clipping occurs.
+@param i Value (rvalue) to be clipped.
+@param clips Value (lvalue) that is incremented if clipping is needed.
+@returns Clipped value.
+*/
+#define SOX_16BIT_CLIP_COUNT(i,clips) SOX_INTEGER_CLIP_COUNT(16,i,clips)
+
+/**
+Client API:
+Clips a value to the limits of a 24-bit signed integer and increment a counter
+if clipping occurs.
+@param i Value (rvalue) to be clipped.
+@param clips Value (lvalue) that is incremented if clipping is needed.
+@returns Clipped value.
+*/
+#define SOX_24BIT_CLIP_COUNT(i,clips) SOX_INTEGER_CLIP_COUNT(24,i,clips)
+
+#define SOX_SIZE_MAX ((size_t)(-1)) /**< Client API: Maximum value of size_t. */
+
+#define SOX_UNSPEC 0                         /**< Client API: Members of sox_signalinfo_t are set to SOX_UNSPEC (= 0) if the actual value is not yet known. */
+#define SOX_UNKNOWN_LEN (sox_uint64_t)(-1) /**< Client API: sox_signalinfo_t.length is set to SOX_UNKNOWN_LEN (= -1) within the effects chain if the actual length is not known. Format handlers currently use SOX_UNSPEC instead. */
+#define SOX_IGNORE_LENGTH (sox_uint64_t)(-2) /**< Client API: sox_signalinfo_t.length is set to SOX_IGNORE_LENGTH (= -2) to indicate that a format handler should ignore length information in file headers. */
+
+#define SOX_DEFAULT_CHANNELS  2     /**< Client API: Default channel count is 2 (stereo). */
+#define SOX_DEFAULT_RATE      48000 /**< Client API: Default rate is 48000Hz. */
+#define SOX_DEFAULT_PRECISION 16    /**< Client API: Default precision is 16 bits per sample. */
+#define SOX_DEFAULT_ENCODING  SOX_ENCODING_SIGN2 /**< Client API: Default encoding is SIGN2 (linear 2's complement PCM). */
+
+#define SOX_LOOP_NONE          ((unsigned char)sox_loop_none)          /**< Client API: single-shot = 0 */
+#define SOX_LOOP_8             ((unsigned char)sox_loop_8)             /**< Client API: 8 loops = 32 */
+#define SOX_LOOP_SUSTAIN_DECAY ((unsigned char)sox_loop_sustain_decay) /**< Client API: AIFF style, one sustain & one decay loop = 64 */
+
+#define SOX_MAX_NLOOPS         8 /**< Client API: Maximum number of loops supported by sox_oob_t = 8. */
+
+#define SOX_FILE_NOSTDIO 0x0001 /**< Client API: Does not use stdio routines */
+#define SOX_FILE_DEVICE  0x0002 /**< Client API: File is an audio device */
+#define SOX_FILE_PHONY   0x0004 /**< Client API: Phony file/device (for example /dev/null) */
+#define SOX_FILE_REWIND  0x0008 /**< Client API: File should be rewound to write header */
+#define SOX_FILE_BIT_REV 0x0010 /**< Client API: Is file bit-reversed? */
+#define SOX_FILE_NIB_REV 0x0020 /**< Client API: Is file nibble-reversed? */
+#define SOX_FILE_ENDIAN  0x0040 /**< Client API: Is file format endian? */
+#define SOX_FILE_ENDBIG  0x0080 /**< Client API: For endian file format, is it big endian? */
+#define SOX_FILE_MONO    0x0100 /**< Client API: Do channel restrictions allow mono? */
+#define SOX_FILE_STEREO  0x0200 /**< Client API: Do channel restrictions allow stereo? */
+#define SOX_FILE_QUAD    0x0400 /**< Client API: Do channel restrictions allow quad? */
+
+#define SOX_FILE_CHANS   (SOX_FILE_MONO | SOX_FILE_STEREO | SOX_FILE_QUAD) /**< Client API: No channel restrictions */
+#define SOX_FILE_LIT_END (SOX_FILE_ENDIAN | 0)                             /**< Client API: File is little-endian */
+#define SOX_FILE_BIG_END (SOX_FILE_ENDIAN | SOX_FILE_ENDBIG)               /**< Client API: File is big-endian */
+
+#define SOX_EFF_CHAN     1           /**< Client API: Effect might alter the number of channels */
+#define SOX_EFF_RATE     2           /**< Client API: Effect might alter sample rate */
+#define SOX_EFF_PREC     4           /**< Client API: Effect does its own calculation of output sample precision (otherwise a default value is taken, depending on the presence of SOX_EFF_MODIFY) */
+#define SOX_EFF_LENGTH   8           /**< Client API: Effect might alter audio length (as measured in time units, not necessarily in samples) */
+#define SOX_EFF_MCHAN    16          /**< Client API: Effect handles multiple channels internally */
+#define SOX_EFF_NULL     32          /**< Client API: Effect does nothing (can be optimized out of chain) */
+#define SOX_EFF_DEPRECATED 64        /**< Client API: Effect will soon be removed from SoX */
+#define SOX_EFF_GAIN     128         /**< Client API: Effect does not support gain -r */
+#define SOX_EFF_MODIFY   256         /**< Client API: Effect does not modify sample values (but might remove or duplicate samples or insert zeros) */
+#define SOX_EFF_ALPHA    512         /**< Client API: Effect is experimental/incomplete */
+#define SOX_EFF_INTERNAL 1024        /**< Client API: Effect present in libSoX but not valid for use by SoX command-line tools */
+
+/**
+Client API:
+When used as the "whence" parameter of sox_seek, indicates that the specified
+offset is relative to the beginning of the file.
+*/
+#define SOX_SEEK_SET 0
+
+/*****************************************************************************
+Forward declarations:
+*****************************************************************************/
+
+typedef struct sox_format_t sox_format_t;
+typedef struct sox_effect_t sox_effect_t;
+typedef struct sox_effect_handler_t sox_effect_handler_t;
+typedef struct sox_format_handler_t sox_format_handler_t;
+
+/*****************************************************************************
+Function pointers:
+*****************************************************************************/
+
+/**
+Client API:
+Callback to write a message to an output device (console or log file),
+used by sox_globals_t.output_message_handler.
+*/
+typedef void (LSX_API * sox_output_message_handler_t)(
+    unsigned level,                       /* 1 = FAIL, 2 = WARN, 3 = INFO, 4 = DEBUG, 5 = DEBUG_MORE, 6 = DEBUG_MOST. */
+    LSX_PARAM_IN_Z char const * filename, /* Source code __FILENAME__ from which message originates. */
+    LSX_PARAM_IN_PRINTF char const * fmt, /* Message format string. */
+    LSX_PARAM_IN va_list ap               /* Message format parameters. */
+    );
+
+/**
+Client API:
+Callback to retrieve information about a format handler,
+used by sox_format_tab_t.fn.
+@returns format handler information.
+*/
+typedef sox_format_handler_t const * (LSX_API * sox_format_fn_t)(void);
+
+/**
+Client API:
+Callback to get information about an effect handler,
+used by the table returned from sox_get_effect_fns(void).
+@returns Pointer to information about an effect handler.
+*/
+typedef sox_effect_handler_t const * (LSX_API *sox_effect_fn_t)(void);
+
+/**
+Client API:
+Callback to initialize reader (decoder), used by
+sox_format_handler.startread.
+@returns SOX_SUCCESS if successful.
+*/
+typedef int (LSX_API * sox_format_handler_startread)(
+    LSX_PARAM_INOUT sox_format_t * ft /**< Format pointer. */
+    );
+
+/**
+Client API:
+Callback to read (decode) a block of samples,
+used by sox_format_handler.read.
+@returns number of samples read, or 0 if unsuccessful.
+*/
+typedef size_t (LSX_API * sox_format_handler_read)(
+    LSX_PARAM_INOUT sox_format_t * ft, /**< Format pointer. */
+    LSX_PARAM_OUT_CAP_POST_COUNT(len,return) sox_sample_t *buf, /**< Buffer from which to read samples. */
+    size_t len /**< Number of samples available in buf. */
+    );
+
+/**
+Client API:
+Callback to close reader (decoder),
+used by sox_format_handler.stopread.
+@returns SOX_SUCCESS if successful.
+*/
+typedef int (LSX_API * sox_format_handler_stopread)(
+    LSX_PARAM_INOUT sox_format_t * ft /**< Format pointer. */
+    );
+
+/**
+Client API:
+Callback to initialize writer (encoder),
+used by sox_format_handler.startwrite.
+@returns SOX_SUCCESS if successful.
+*/
+typedef int (LSX_API * sox_format_handler_startwrite)(
+    LSX_PARAM_INOUT sox_format_t * ft /**< Format pointer. */
+    );
+
+/**
+Client API:
+Callback to write (encode) a block of samples,
+used by sox_format_handler.write.
+@returns number of samples written, or 0 if unsuccessful.
+*/
+typedef size_t (LSX_API * sox_format_handler_write)(
+    LSX_PARAM_INOUT sox_format_t * ft, /**< Format pointer. */
+    LSX_PARAM_IN_COUNT(len) sox_sample_t const * buf, /**< Buffer to which samples are written. */
+    size_t len /**< Capacity of buf, measured in samples. */
+    );
+
+/**
+Client API:
+Callback to close writer (decoder),
+used by sox_format_handler.stopwrite.
+@returns SOX_SUCCESS if successful.
+*/
+typedef int (LSX_API * sox_format_handler_stopwrite)(
+    LSX_PARAM_INOUT sox_format_t * ft /**< Format pointer. */
+    );
+
+/**
+Client API:
+Callback to reposition reader,
+used by sox_format_handler.seek.
+@returns SOX_SUCCESS if successful.
+*/
+typedef int (LSX_API * sox_format_handler_seek)(
+    LSX_PARAM_INOUT sox_format_t * ft, /**< Format pointer. */
+    sox_uint64_t offset /**< Sample offset to which reader should be positioned. */
+    );
+
+/**
+Client API:
+Callback to parse command-line arguments (called once per effect),
+used by sox_effect_handler.getopts.
+@returns SOX_SUCCESS if successful.
+*/
+typedef int (LSX_API * sox_effect_handler_getopts)(
+    LSX_PARAM_INOUT sox_effect_t * effp, /**< Effect pointer. */
+    int argc, /**< Number of arguments in argv. */
+    LSX_PARAM_IN_COUNT(argc) char *argv[] /**< Array of command-line arguments. */
+    );
+
+/**
+Client API:
+Callback to initialize effect (called once per flow),
+used by sox_effect_handler.start.
+@returns SOX_SUCCESS if successful.
+*/
+typedef int (LSX_API * sox_effect_handler_start)(
+    LSX_PARAM_INOUT sox_effect_t * effp /**< Effect pointer. */
+    );
+
+/**
+Client API:
+Callback to process samples,
+used by sox_effect_handler.flow.
+@returns SOX_SUCCESS if successful.
+*/
+typedef int (LSX_API * sox_effect_handler_flow)(
+    LSX_PARAM_INOUT sox_effect_t * effp, /**< Effect pointer. */
+    LSX_PARAM_IN_COUNT(*isamp) sox_sample_t const * ibuf, /**< Buffer from which to read samples. */
+    LSX_PARAM_OUT_CAP_POST_COUNT(*osamp,*osamp) sox_sample_t * obuf, /**< Buffer to which samples are written. */
+    LSX_PARAM_INOUT size_t *isamp, /**< On entry, contains capacity of ibuf; on exit, contains number of samples consumed. */
+    LSX_PARAM_INOUT size_t *osamp /**< On entry, contains capacity of obuf; on exit, contains number of samples written. */
+    );
+
+/**
+Client API:
+Callback to finish getting output after input is complete,
+used by sox_effect_handler.drain.
+@returns SOX_SUCCESS if successful.
+*/
+typedef int (LSX_API * sox_effect_handler_drain)(
+    LSX_PARAM_INOUT sox_effect_t * effp, /**< Effect pointer. */
+    LSX_PARAM_OUT_CAP_POST_COUNT(*osamp,*osamp) sox_sample_t *obuf, /**< Buffer to which samples are written. */
+    LSX_PARAM_INOUT size_t *osamp /**< On entry, contains capacity of obuf; on exit, contains number of samples written. */
+    );
+
+/**
+Client API:
+Callback to shut down effect (called once per flow),
+used by sox_effect_handler.stop.
+@returns SOX_SUCCESS if successful.
+*/
+typedef int (LSX_API * sox_effect_handler_stop)(
+    LSX_PARAM_INOUT sox_effect_t * effp /**< Effect pointer. */
+    );
+
+/**
+Client API:
+Callback to shut down effect (called once per effect),
+used by sox_effect_handler.kill.
+@returns SOX_SUCCESS if successful.
+*/
+typedef int (LSX_API * sox_effect_handler_kill)(
+    LSX_PARAM_INOUT sox_effect_t * effp /**< Effect pointer. */
+    );
+
+/**
+Client API:
+Callback called while flow is running (called once per buffer),
+used by sox_flow_effects.callback.
+@returns SOX_SUCCESS to continue, other value to abort flow.
+*/
+typedef int (LSX_API * sox_flow_effects_callback)(
+    sox_bool all_done,
+    void * client_data
+    );
+
+/**
+Client API:
+Callback for enumerating the contents of a playlist,
+used by the sox_parse_playlist function.
+@returns SOX_SUCCESS if successful, any other value to abort playlist enumeration.
+*/
+typedef int (LSX_API * sox_playlist_callback_t)(
+    void * callback_data,
+    LSX_PARAM_IN_Z char const * filename
+    );
+
+/*****************************************************************************
+Structures:
+*****************************************************************************/
+
+/**
+Client API:
+Information about a build of libSoX, returned from the sox_version_info
+function.
+*/
+typedef struct sox_version_info_t {
+    size_t       size;         /**< structure size = sizeof(sox_version_info_t) */
+    sox_version_flags_t flags; /**< feature flags = popen | magic | threads | memopen */
+    sox_uint32_t version_code; /**< version number = 0x140400 */
+    char const * version;      /**< version string = sox_version(), for example, "14.4.0" */
+    char const * version_extra;/**< version extra info or null = "PACKAGE_EXTRA", for example, "beta" */
+    char const * time;         /**< build time = "__DATE__ __TIME__", for example, "Jan  7 2010 03:31:50" */
+    char const * distro;       /**< distro or null = "DISTRO", for example, "Debian" */
+    char const * compiler;     /**< compiler info or null, for example, "msvc 160040219" */
+    char const * arch;         /**< arch, for example, "1248 48 44 L OMP" */
+    /* new info should be added at the end for version backwards-compatibility. */
+} sox_version_info_t;
+
+/**
+Client API:
+Global parameters (for effects & formats), returned from the sox_get_globals
+function.
+*/
+typedef struct sox_globals_t {
+/* public: */
+  unsigned     verbosity; /**< messages are only written if globals.verbosity >= message.level */
+  sox_output_message_handler_t output_message_handler; /**< client-specified message output callback */
+  sox_bool     repeatable; /**< true to use pre-determined timestamps and PRNG seed */
+
+  /**
+  Default size (in bytes) used by libSoX for blocks of sample data.
+  Plugins should use similarly-sized buffers to get best performance.
+  */
+  size_t       bufsiz;
+
+  /**
+  Default size (in bytes) used by libSoX for blocks of input sample data.
+  Plugins should use similarly-sized buffers to get best performance.
+  */
+  size_t       input_bufsiz;
+
+  sox_int32_t  ranqd1; /**< Can be used to re-seed libSoX's PRNG */
+
+  char const * stdin_in_use_by;  /**< Private: tracks the name of the handler currently using stdin */
+  char const * stdout_in_use_by; /**< Private: tracks the name of the handler currently using stdout */
+  char const * subsystem;        /**< Private: tracks the name of the handler currently writing an output message */
+  char       * tmp_path;         /**< Private: client-configured path to use for temporary files */
+  sox_bool     use_magic;        /**< Private: true if client has requested use of 'magic' file-type detection */
+  sox_bool     use_threads;      /**< Private: true if client has requested parallel effects processing */
+} sox_globals_t;
+
+/**
+Client API:
+Signal parameters; members should be set to SOX_UNSPEC (= 0) if unknown.
+*/
+typedef struct sox_signalinfo_t {
+  sox_rate_t       rate;         /**< samples per second, 0 if unknown */
+  unsigned         channels;     /**< number of sound channels, 0 if unknown */
+  unsigned         precision;    /**< bits per sample, 0 if unknown */
+  sox_uint64_t     length;       /**< samples * chans in file, 0 if unknown, -1 if unspecified */
+  double           * mult;       /**< Effects headroom multiplier; may be null */
+} sox_signalinfo_t;
+
+/**
+Client API:
+Basic information about an encoding.
+*/
+typedef struct sox_encodings_info_t {
+  sox_encodings_flags_t flags; /**< lossy once (lossy1), lossy twice (lossy2), or lossless (none). */
+  char const * name;           /**< encoding name. */
+  char const * desc;           /**< encoding description. */
+} sox_encodings_info_t;
+
+/**
+Client API:
+Encoding parameters.
+*/
+typedef struct sox_encodinginfo_t {
+  sox_encoding_t encoding; /**< format of sample numbers */
+  unsigned bits_per_sample;/**< 0 if unknown or variable; uncompressed value if lossless; compressed value if lossy */
+  double compression;      /**< compression factor (where applicable) */
+
+  /**
+  Should bytes be reversed? If this is default during sox_open_read or
+  sox_open_write, libSoX will set them to either no or yes according to the
+  machine or format default.
+  */
+  sox_option_t reverse_bytes;
+
+  /**
+  Should nibbles be reversed? If this is default during sox_open_read or
+  sox_open_write, libSoX will set them to either no or yes according to the
+  machine or format default.
+  */
+  sox_option_t reverse_nibbles;
+
+  /**
+  Should bits be reversed? If this is default during sox_open_read or
+  sox_open_write, libSoX will set them to either no or yes according to the
+  machine or format default.
+  */
+  sox_option_t reverse_bits;
+
+  /**
+  If set to true, the format should reverse its default endianness.
+  */
+  sox_bool opposite_endian;
+} sox_encodinginfo_t;
+
+/**
+Client API:
+Looping parameters (out-of-band data).
+*/
+typedef struct sox_loopinfo_t {
+  sox_uint64_t  start;  /**< first sample */
+  sox_uint64_t  length; /**< length */
+  unsigned      count;  /**< number of repeats, 0=forever */
+  unsigned char type;   /**< 0=no, 1=forward, 2=forward/back (see sox_loop_* for valid values). */
+} sox_loopinfo_t;
+
+/**
+Client API:
+Instrument information.
+*/
+typedef struct sox_instrinfo_t{
+  signed char MIDInote;   /**< for unity pitch playback */
+  signed char MIDIlow;    /**< MIDI pitch-bend low range */
+  signed char MIDIhi;     /**< MIDI pitch-bend high range */
+  unsigned char loopmode; /**< 0=no, 1=forward, 2=forward/back (see sox_loop_* values) */
+  unsigned nloops;  /**< number of active loops (max SOX_MAX_NLOOPS). */
+} sox_instrinfo_t;
+
+/**
+Client API:
+File buffer info.  Holds info so that data can be read in blocks.
+*/
+typedef struct sox_fileinfo_t {
+  char          *buf;                 /**< Pointer to data buffer */
+  size_t        size;                 /**< Size of buffer in bytes */
+  size_t        count;                /**< Count read into buffer */
+  size_t        pos;                  /**< Position in buffer */
+} sox_fileinfo_t;
+
+/**
+Client API:
+Handler structure defined by each format.
+*/
+struct sox_format_handler_t {
+  unsigned     sox_lib_version_code;  /**< Checked on load; must be 1st in struct*/
+  char         const * description;   /**< short description of format */
+  char         const * const * names; /**< null-terminated array of filename extensions that are handled by this format */
+  unsigned int flags;                 /**< File flags (SOX_FILE_* values). */
+  sox_format_handler_startread startread; /**< called to initialize reader (decoder) */
+  sox_format_handler_read read;       /**< called to read (decode) a block of samples */
+  sox_format_handler_stopread stopread; /**< called to close reader (decoder); may be null if no closing necessary */
+  sox_format_handler_startwrite startwrite; /**< called to initialize writer (encoder) */
+  sox_format_handler_write write;     /**< called to write (encode) a block of samples */
+  sox_format_handler_stopwrite stopwrite; /**< called to close writer (decoder); may be null if no closing necessary */
+  sox_format_handler_seek seek;       /**< called to reposition reader; may be null if not supported */
+
+  /**
+  Array of values indicating the encodings and precisions supported for
+  writing (encoding). Precisions specified with default precision first.
+  Encoding, precision, precision, ..., 0, repeat. End with one more 0.
+  Example:
+  unsigned const * formats = {
+    SOX_ENCODING_SIGN2, 16, 24, 0, // Support SIGN2 at 16 and 24 bits, default to 16 bits.
+    SOX_ENCODING_UNSIGNED, 8, 0,   // Support UNSIGNED at 8 bits, default to 8 bits.
+    0 // No more supported encodings.
+  };
+  */
+  unsigned     const * write_formats;
+
+  /**
+  Array of sample rates (samples per second) supported for writing (encoding).
+  NULL if all (or almost all) rates are supported. End with 0.
+  */
+  sox_rate_t   const * write_rates;
+
+  /**
+  SoX will automatically allocate a buffer in which the handler can store data.
+  Specify the size of the buffer needed here. Usually this will be sizeof(your_struct).
+  The buffer will be allocated and zeroed before the call to startread/startwrite.
+  The buffer will be freed after the call to stopread/stopwrite.
+  The buffer will be provided via format.priv in each call to the handler.
+  */
+  size_t       priv_size;
+};
+
+/**
+Client API:
+Comments, instrument info, loop info (out-of-band data).
+*/
+typedef struct sox_oob_t{
+  /* Decoded: */
+  sox_comments_t   comments;              /**< Comment strings in id=value format. */
+  sox_instrinfo_t  instr;                 /**< Instrument specification */
+  sox_loopinfo_t   loops[SOX_MAX_NLOOPS]; /**< Looping specification */
+
+  /* TBD: Non-decoded chunks, etc: */
+} sox_oob_t;
+
+/**
+Client API:
+Data passed to/from the format handler
+*/
+struct sox_format_t {
+  char             * filename;      /**< File name */
+
+  /**
+  Signal specifications for reader (decoder) or writer (encoder):
+  sample rate, number of channels, precision, length, headroom multiplier.
+  Any info specified by the user is here on entry to startread or
+  startwrite. Info will be SOX_UNSPEC if the user provided no info.
+  At exit from startread, should be completely filled in, using
+  either data from the file's headers (if available) or whatever
+  the format is guessing/assuming (if header data is not available).
+  At exit from startwrite, should be completely filled in, using
+  either the data that was specified, or values chosen by the format
+  based on the format's defaults or capabilities.
+  */
+  sox_signalinfo_t signal;
+
+  /**
+  Encoding specifications for reader (decoder) or writer (encoder):
+  encoding (sample format), bits per sample, compression rate, endianness.
+  Should be filled in by startread. Values specified should be used
+  by startwrite when it is configuring the encoding parameters.
+  */
+  sox_encodinginfo_t encoding;
+
+  char             * filetype;      /**< Type of file, as determined by header inspection or libmagic. */
+  sox_oob_t        oob;             /**< comments, instrument info, loop info (out-of-band data) */
+  sox_bool         seekable;        /**< Can seek on this file */
+  char             mode;            /**< Read or write mode ('r' or 'w') */
+  sox_uint64_t     olength;         /**< Samples * chans written to file */
+  sox_uint64_t     clips;           /**< Incremented if clipping occurs */
+  int              sox_errno;       /**< Failure error code */
+  char             sox_errstr[256]; /**< Failure error text */
+  void             * fp;            /**< File stream pointer */
+  lsx_io_type      io_type;         /**< Stores whether this is a file, pipe or URL */
+  sox_uint64_t     tell_off;        /**< Current offset within file */
+  sox_uint64_t     data_start;      /**< Offset at which headers end and sound data begins (set by lsx_check_read_params) */
+  sox_format_handler_t handler;     /**< Format handler for this file */
+  void             * priv;          /**< Format handler's private data area */
+};
+
+/**
+Client API:
+Information about a loaded format handler, including the format name and a
+function pointer that can be invoked to get additional information about the
+format.
+*/
+typedef struct sox_format_tab_t {
+  char *name;         /**< Name of format handler */
+  sox_format_fn_t fn; /**< Function to call to get format handler's information */
+} sox_format_tab_t;
+
+/**
+Client API:
+Global parameters for effects.
+*/
+typedef struct sox_effects_globals_t {
+  sox_plot_t plot;         /**< To help the user choose effect & options */
+  sox_globals_t * global_info; /**< Pointer to associated SoX globals */
+} sox_effects_globals_t;
+
+/**
+Client API:
+Effect handler information.
+*/
+struct sox_effect_handler_t {
+  char const * name;  /**< Effect name */
+  char const * usage; /**< Short explanation of parameters accepted by effect */
+  unsigned int flags; /**< Combination of SOX_EFF_* flags */
+  sox_effect_handler_getopts getopts; /**< Called to parse command-line arguments (called once per effect). */
+  sox_effect_handler_start start;     /**< Called to initialize effect (called once per flow). */
+  sox_effect_handler_flow flow;       /**< Called to process samples. */
+  sox_effect_handler_drain drain;     /**< Called to finish getting output after input is complete. */
+  sox_effect_handler_stop stop;       /**< Called to shut down effect (called once per flow). */
+  sox_effect_handler_kill kill;       /**< Called to shut down effect (called once per effect). */
+  size_t       priv_size;             /**< Size of private data SoX should pre-allocate for effect */
+};
+
+/**
+Client API:
+Effect information.
+*/
+struct sox_effect_t {
+  sox_effects_globals_t    * global_info; /**< global effect parameters */
+  sox_signalinfo_t         in_signal;     /**< Information about the incoming data stream */
+  sox_signalinfo_t         out_signal;    /**< Information about the outgoing data stream */
+  sox_encodinginfo_t       const * in_encoding;  /**< Information about the incoming data encoding */
+  sox_encodinginfo_t       const * out_encoding; /**< Information about the outgoing data encoding */
+  sox_effect_handler_t     handler;   /**< The handler for this effect */
+  sox_sample_t             * obuf;    /**< output buffer */
+  size_t                   obeg;      /**< output buffer: start of valid data section */
+  size_t                   oend;      /**< output buffer: one past valid data section (oend-obeg is length of current content) */
+  size_t               imin;          /**< minimum input buffer content required for calling this effect's flow function; set via lsx_effect_set_imin() */
+  sox_uint64_t         clips;         /**< increment if clipping occurs */
+  size_t               flows;         /**< 1 if MCHAN, number of chans otherwise */
+  size_t               flow;          /**< flow number */
+  void                 * priv;        /**< Effect's private data area (each flow has a separate copy) */
+};
+
+/**
+Client API:
+Chain of effects to be applied to a stream.
+*/
+typedef struct sox_effects_chain_t {
+  sox_effect_t **effects;                  /**< Table of effects to be applied to a stream */
+  unsigned table_size;                     /**< Number of entries in effects table */
+  unsigned length;                         /**< Number of effects to be applied */
+  sox_sample_t **ibufc;                    /**< Channel interleave buffer */
+  sox_sample_t **obufc;                    /**< Channel interleave buffer */
+  sox_effects_globals_t global_info;       /**< Copy of global effects settings */
+  sox_encodinginfo_t const * in_enc;       /**< Input encoding */
+  sox_encodinginfo_t const * out_enc;      /**< Output encoding */
+} sox_effects_chain_t;
+
+/*****************************************************************************
+Functions:
+*****************************************************************************/
+
+/**
+Client API:
+Returns version number string of libSoX, for example, "14.4.0".
+@returns The version number string of libSoX, for example, "14.4.0".
+*/
+LSX_RETURN_VALID_Z LSX_RETURN_PURE
+char const *
+LSX_API
+sox_version(void);
+
+/**
+Client API:
+Returns information about this build of libsox.
+@returns Pointer to a version information structure.
+*/
+LSX_RETURN_VALID LSX_RETURN_PURE
+sox_version_info_t const *
+LSX_API
+sox_version_info(void);
+
+/**
+Client API:
+Returns a pointer to the structure with libSoX's global settings.
+@returns a pointer to the structure with libSoX's global settings.
+*/
+LSX_RETURN_VALID LSX_RETURN_PURE
+sox_globals_t *
+LSX_API
+sox_get_globals(void);
+
+/**
+Client API:
+Deprecated macro that returns the structure with libSoX's global settings
+as an lvalue.
+*/
+#define sox_globals (*sox_get_globals())
+
+/**
+Client API:
+Returns a pointer to the list of available encodings.
+End of list indicated by name == NULL.
+@returns pointer to the list of available encodings.
+*/
+LSX_RETURN_ARRAY LSX_RETURN_PURE
+sox_encodings_info_t const *
+LSX_API
+sox_get_encodings_info(void);
+
+/**
+Client API:
+Deprecated macro that returns the list of available encodings.
+End of list indicated by name == NULL.
+*/
+#define sox_encodings_info (sox_get_encodings_info())
+
+/**
+Client API:
+Fills in an encodinginfo with default values.
+*/
+void
+LSX_API
+sox_init_encodinginfo(
+    LSX_PARAM_OUT sox_encodinginfo_t * e /**< Pointer to uninitialized encoding info structure to be initialized. */
+    );
+
+/**
+Client API:
+Given an encoding (for example, SIGN2) and the encoded bits_per_sample (for
+example, 16), returns the number of useful bits per sample in the decoded data
+(for example, 16), or returns 0 to indicate that the value returned by the
+format handler should be used instead of a pre-determined precision.
+@returns the number of useful bits per sample in the decoded data (for example
+16), or returns 0 to indicate that the value returned by the format handler
+should be used instead of a pre-determined precision.
+*/
+LSX_RETURN_PURE
+unsigned
+LSX_API
+sox_precision(
+    sox_encoding_t encoding,   /**< Encoding for which to lookup precision information. */
+    unsigned bits_per_sample   /**< The number of encoded bits per sample. */
+    );
+
+/**
+Client API:
+Returns the number of items in the metadata block.
+@returns the number of items in the metadata block.
+*/
+size_t
+LSX_API
+sox_num_comments(
+    LSX_PARAM_IN_OPT sox_comments_t comments /**< Metadata block. */
+    );
+
+/**
+Client API:
+Adds an "id=value" item to the metadata block.
+*/
+void
+LSX_API
+sox_append_comment(
+    LSX_PARAM_DEREF_PRE_MAYBENULL LSX_PARAM_DEREF_POST_NOTNULL sox_comments_t * comments, /**< Metadata block. */
+    LSX_PARAM_IN_Z char const * item /**< Item to be added in "id=value" format. */
+    );
+
+/**
+Client API:
+Adds a newline-delimited list of "id=value" items to the metadata block.
+*/
+void
+LSX_API
+sox_append_comments(
+    LSX_PARAM_DEREF_PRE_MAYBENULL LSX_PARAM_DEREF_POST_NOTNULL sox_comments_t * comments, /**< Metadata block. */
+    LSX_PARAM_IN_Z char const * items /**< Newline-separated list of items to be added, for example "id1=value1\\nid2=value2". */
+    );
+
+/**
+Client API:
+Duplicates the metadata block.
+@returns the copied metadata block.
+*/
+LSX_RETURN_OPT
+sox_comments_t
+LSX_API
+sox_copy_comments(
+    LSX_PARAM_IN_OPT sox_comments_t comments /**< Metadata block to copy. */
+    );
+
+/**
+Client API:
+Frees the metadata block.
+*/
+void
+LSX_API
+sox_delete_comments(
+    LSX_PARAM_DEREF_PRE_MAYBENULL LSX_PARAM_DEREF_POST_NULL sox_comments_t * comments /**< Metadata block. */
+    );
+
+/**
+Client API:
+If "id=value" is found, return value, else return null.
+@returns value, or null if value not found.
+*/
+LSX_RETURN_OPT
+char const *
+LSX_API
+sox_find_comment(
+    LSX_PARAM_IN_OPT sox_comments_t comments, /**< Metadata block in which to search. */
+    LSX_PARAM_IN_Z char const * id /**< Id for which to search */
+    );
+
+/**
+Client API:
+Find and load format handler plugins.
+@returns SOX_SUCCESS if successful.
+*/
+int
+LSX_API
+sox_format_init(void);
+
+/**
+Client API:
+Unload format handler plugins.
+*/
+void
+LSX_API
+sox_format_quit(void);
+
+/**
+Client API:
+Initialize effects library.
+@returns SOX_SUCCESS if successful.
+*/
+int
+LSX_API
+sox_init(void);
+
+/**
+Client API:
+Close effects library and unload format handler plugins.
+@returns SOX_SUCCESS if successful.
+*/
+int
+LSX_API
+sox_quit(void);
+
+/**
+Client API:
+Returns the table of format handler names and functions.
+@returns the table of format handler names and functions.
+*/
+LSX_RETURN_ARRAY LSX_RETURN_PURE
+sox_format_tab_t const *
+LSX_API
+sox_get_format_fns(void);
+
+/**
+Client API:
+Deprecated macro that returns the table of format handler names and functions.
+*/
+#define sox_format_fns (sox_get_format_fns())
+
+/**
+Client API:
+Opens a decoding session for a file. Returned handle must be closed with sox_close().
+@returns The handle for the new session, or null on failure.
+*/
+LSX_RETURN_OPT
+sox_format_t *
+LSX_API
+sox_open_read(
+    LSX_PARAM_IN_Z   char               const * path,      /**< Path to file to be opened (required). */
+    LSX_PARAM_IN_OPT sox_signalinfo_t   const * signal,    /**< Information already known about audio stream, or NULL if none. */
+    LSX_PARAM_IN_OPT sox_encodinginfo_t const * encoding,  /**< Information already known about sample encoding, or NULL if none. */
+    LSX_PARAM_IN_OPT_Z char             const * filetype   /**< Previously-determined file type, or NULL to auto-detect. */
+    );
+
+/**
+Client API:
+Opens a decoding session for a memory buffer. Returned handle must be closed with sox_close().
+@returns The handle for the new session, or null on failure.
+*/
+LSX_RETURN_OPT
+sox_format_t *
+LSX_API
+sox_open_mem_read(
+    LSX_PARAM_IN_BYTECOUNT(buffer_size) void  * buffer,     /**< Pointer to audio data buffer (required). */
+    size_t                                      buffer_size,/**< Number of bytes to read from audio data buffer. */
+    LSX_PARAM_IN_OPT sox_signalinfo_t   const * signal,     /**< Information already known about audio stream, or NULL if none. */
+    LSX_PARAM_IN_OPT sox_encodinginfo_t const * encoding,   /**< Information already known about sample encoding, or NULL if none. */
+    LSX_PARAM_IN_OPT_Z char             const * filetype    /**< Previously-determined file type, or NULL to auto-detect. */
+    );
+
+/**
+Client API:
+Returns true if the format handler for the specified file type supports the specified encoding.
+@returns true if the format handler for the specified file type supports the specified encoding.
+*/
+sox_bool
+LSX_API
+sox_format_supports_encoding(
+    LSX_PARAM_IN_OPT_Z char               const * path,       /**< Path to file to be examined (required if filetype is NULL). */
+    LSX_PARAM_IN_OPT_Z char               const * filetype,   /**< Previously-determined file type, or NULL to use extension from path. */
+    LSX_PARAM_IN       sox_encodinginfo_t const * encoding    /**< Encoding for which format handler should be queried. */
+    );
+
+/**
+Client API:
+Gets the format handler for a specified file type.
+@returns The found format handler, or null if not found.
+*/
+LSX_RETURN_OPT
+sox_format_handler_t const *
+LSX_API
+sox_write_handler(
+    LSX_PARAM_IN_OPT_Z char               const * path,         /**< Path to file (required if filetype is NULL). */
+    LSX_PARAM_IN_OPT_Z char               const * filetype,     /**< Filetype for which handler is needed, or NULL to use extension from path. */
+    LSX_PARAM_OUT_OPT  char               const * * filetype1   /**< Receives the filetype that was detected. Pass NULL if not needed. */
+    );
+
+/**
+Client API:
+Opens an encoding session for a file. Returned handle must be closed with sox_close().
+@returns The new session handle, or null on failure.
+*/
+LSX_RETURN_OPT
+sox_format_t *
+LSX_API
+sox_open_write(
+    LSX_PARAM_IN_Z     char               const * path,     /**< Path to file to be written (required). */
+    LSX_PARAM_IN       sox_signalinfo_t   const * signal,   /**< Information about desired audio stream (required). */
+    LSX_PARAM_IN_OPT   sox_encodinginfo_t const * encoding, /**< Information about desired sample encoding, or NULL to use defaults. */
+    LSX_PARAM_IN_OPT_Z char               const * filetype, /**< Previously-determined file type, or NULL to auto-detect. */
+    LSX_PARAM_IN_OPT   sox_oob_t          const * oob,      /**< Out-of-band data to add to file, or NULL if none. */
+    LSX_PARAM_IN_OPT   sox_bool           (LSX_API * overwrite_permitted)(LSX_PARAM_IN_Z char const * filename) /**< Called if file exists to determine whether overwrite is ok. */
+    );
+
+/**
+Client API:
+Opens an encoding session for a memory buffer. Returned handle must be closed with sox_close().
+@returns The new session handle, or null on failure.
+*/
+LSX_RETURN_OPT
+sox_format_t *
+LSX_API
+sox_open_mem_write(
+    LSX_PARAM_OUT_BYTECAP(buffer_size) void                     * buffer,      /**< Pointer to audio data buffer that receives data (required). */
+    LSX_PARAM_IN                       size_t                     buffer_size, /**< Maximum number of bytes to write to audio data buffer. */
+    LSX_PARAM_IN                       sox_signalinfo_t   const * signal,      /**< Information about desired audio stream (required). */
+    LSX_PARAM_IN_OPT                   sox_encodinginfo_t const * encoding,    /**< Information about desired sample encoding, or NULL to use defaults. */
+    LSX_PARAM_IN_OPT_Z                 char               const * filetype,    /**< Previously-determined file type, or NULL to auto-detect. */
+    LSX_PARAM_IN_OPT                   sox_oob_t          const * oob          /**< Out-of-band data to add to file, or NULL if none. */
+    );
+
+/**
+Client API:
+Opens an encoding session for a memstream buffer. Returned handle must be closed with sox_close().
+@returns The new session handle, or null on failure.
+*/
+LSX_RETURN_OPT
+sox_format_t *
+LSX_API
+sox_open_memstream_write(
+    LSX_PARAM_OUT      char                     * * buffer_ptr,    /**< Receives pointer to audio data buffer that receives data (required). */
+    LSX_PARAM_OUT      size_t                   * buffer_size_ptr, /**< Receives size of data written to audio data buffer (required). */
+    LSX_PARAM_IN       sox_signalinfo_t   const * signal,          /**< Information about desired audio stream (required). */
+    LSX_PARAM_IN_OPT   sox_encodinginfo_t const * encoding,        /**< Information about desired sample encoding, or NULL to use defaults. */
+    LSX_PARAM_IN_OPT_Z char               const * filetype,        /**< Previously-determined file type, or NULL to auto-detect. */
+    LSX_PARAM_IN_OPT   sox_oob_t          const * oob              /**< Out-of-band data to add to file, or NULL if none. */
+    );
+
+/**
+Client API:
+Reads samples from a decoding session into a sample buffer.
+@returns Number of samples decoded, or 0 for EOF.
+*/
+size_t
+LSX_API
+sox_read(
+    LSX_PARAM_INOUT sox_format_t * ft, /**< Format pointer. */
+    LSX_PARAM_OUT_CAP_POST_COUNT(len,return) sox_sample_t *buf, /**< Buffer from which to read samples. */
+    size_t len /**< Number of samples available in buf. */
+    );
+
+/**
+Client API:
+Writes samples to an encoding session from a sample buffer.
+@returns Number of samples encoded.
+*/
+size_t
+LSX_API
+sox_write(
+    LSX_PARAM_INOUT sox_format_t * ft, /**< Format pointer. */
+    LSX_PARAM_IN_COUNT(len) sox_sample_t const * buf, /**< Buffer from which to read samples. */
+    size_t len /**< Number of samples available in buf. */
+    );
+
+/**
+Client API:
+Closes an encoding or decoding session.
+@returns SOX_SUCCESS if successful.
+*/
+int
+LSX_API
+sox_close(
+    LSX_PARAM_INOUT sox_format_t * ft /**< Format pointer. */
+    );
+
+/**
+Client API:
+Sets the location at which next samples will be decoded. Returns SOX_SUCCESS if successful.
+@returns SOX_SUCCESS if successful.
+*/
+int
+LSX_API
+sox_seek(
+    LSX_PARAM_INOUT sox_format_t * ft, /**< Format pointer. */
+    sox_uint64_t offset, /**< Sample offset at which to position reader. */
+    int whence /**< Set to SOX_SEEK_SET. */
+    );
+
+/**
+Client API:
+Finds a format handler by name.
+@returns Format handler data, or null if not found.
+*/
+LSX_RETURN_OPT
+sox_format_handler_t const *
+LSX_API
+sox_find_format(
+    LSX_PARAM_IN_Z char const * name, /**< Name of format handler to find. */
+    sox_bool ignore_devices /**< Set to true to ignore device names. */
+    );
+
+/**
+Client API:
+Returns global parameters for effects
+@returns global parameters for effects.
+*/
+LSX_RETURN_VALID LSX_RETURN_PURE
+sox_effects_globals_t *
+LSX_API
+sox_get_effects_globals(void);
+
+/**
+Client API:
+Deprecated macro that returns global parameters for effects.
+*/
+#define sox_effects_globals (*sox_get_effects_globals())
+
+/**
+Client API:
+Finds the effect handler with the given name.
+@returns Effect pointer, or null if not found.
+*/
+LSX_RETURN_OPT LSX_RETURN_PURE
+sox_effect_handler_t const *
+LSX_API
+sox_find_effect(
+    LSX_PARAM_IN_Z char const * name /**< Name of effect to find. */
+    );
+
+/**
+Client API:
+Creates an effect using the given handler.
+@returns The new effect, or null if not found.
+*/
+LSX_RETURN_OPT
+sox_effect_t *
+LSX_API
+sox_create_effect(
+    LSX_PARAM_IN sox_effect_handler_t const * eh /**< Handler to use for effect. */
+    );
+
+/**
+Client API:
+Applies the command-line options to the effect.
+@returns the number of arguments consumed.
+*/
+int
+LSX_API
+sox_effect_options(
+    LSX_PARAM_IN sox_effect_t *effp, /**< Effect pointer on which to set options. */
+    int argc, /**< Number of arguments in argv. */
+    LSX_PARAM_IN_COUNT(argc) char * const argv[] /**< Array of command-line options. */
+    );
+
+/**
+Client API:
+Returns an array containing the known effect handlers.
+@returns An array containing the known effect handlers.
+*/
+LSX_RETURN_VALID_Z LSX_RETURN_PURE
+sox_effect_fn_t const *
+LSX_API
+sox_get_effect_fns(void);
+
+/**
+Client API:
+Deprecated macro that returns an array containing the known effect handlers.
+*/
+#define sox_effect_fns (sox_get_effect_fns())
+
+/**
+Client API:
+Initializes an effects chain. Returned handle must be closed with sox_delete_effects_chain().
+@returns Handle, or null on failure.
+*/
+LSX_RETURN_OPT
+sox_effects_chain_t *
+LSX_API
+sox_create_effects_chain(
+    LSX_PARAM_IN sox_encodinginfo_t const * in_enc, /**< Input encoding. */
+    LSX_PARAM_IN sox_encodinginfo_t const * out_enc /**< Output encoding. */
+    );
+
+/**
+Client API:
+Closes an effects chain.
+*/
+void
+LSX_API
+sox_delete_effects_chain(
+    LSX_PARAM_INOUT sox_effects_chain_t *ecp /**< Effects chain pointer. */
+    );
+
+/**
+Client API:
+Adds an effect to the effects chain, returns SOX_SUCCESS if successful.
+@returns SOX_SUCCESS if successful.
+*/
+int
+LSX_API
+sox_add_effect(
+    LSX_PARAM_INOUT sox_effects_chain_t * chain, /**< Effects chain to which effect should be added . */
+    LSX_PARAM_INOUT sox_effect_t * effp, /**< Effect to be added. */
+    LSX_PARAM_INOUT sox_signalinfo_t * in, /**< Input format. */
+    LSX_PARAM_IN    sox_signalinfo_t const * out /**< Output format. */
+    );
+
+/**
+Client API:
+Runs the effects chain, returns SOX_SUCCESS if successful.
+@returns SOX_SUCCESS if successful.
+*/
+int
+LSX_API
+sox_flow_effects(
+    LSX_PARAM_INOUT  sox_effects_chain_t * chain, /**< Effects chain to run. */
+    LSX_PARAM_IN_OPT sox_flow_effects_callback callback, /**< Callback for monitoring flow progress. */
+    LSX_PARAM_IN_OPT void * client_data /**< Data to pass into callback. */
+    );
+
+/**
+Client API:
+Gets the number of clips that occurred while running an effects chain.
+@returns the number of clips that occurred while running an effects chain.
+*/
+sox_uint64_t
+LSX_API
+sox_effects_clips(
+    LSX_PARAM_IN sox_effects_chain_t * chain /**< Effects chain from which to read clip information. */
+    );
+
+/**
+Client API:
+Shuts down an effect (calls stop on each of its flows).
+@returns the number of clips from all flows.
+*/
+sox_uint64_t
+LSX_API
+sox_stop_effect(
+    LSX_PARAM_INOUT_COUNT(effp->flows) sox_effect_t * effp /**< Effect to stop. */
+    );
+
+/**
+Client API:
+Adds an already-initialized effect to the end of the chain.
+*/
+void
+LSX_API
+sox_push_effect_last(
+    LSX_PARAM_INOUT sox_effects_chain_t * chain, /**< Effects chain to which effect should be added. */
+    LSX_PARAM_INOUT sox_effect_t * effp /**< Effect to be added. */
+    );
+
+/**
+Client API:
+Removes and returns an effect from the end of the chain.
+@returns the removed effect, or null if no effects.
+*/
+LSX_RETURN_OPT
+sox_effect_t *
+LSX_API
+sox_pop_effect_last(
+    LSX_PARAM_INOUT sox_effects_chain_t *chain /**< Effects chain from which to remove an effect. */
+    );
+
+/**
+Client API:
+Shut down and delete an effect.
+*/
+void
+LSX_API
+sox_delete_effect(
+    LSX_PARAM_INOUT_COUNT(effp->flows) sox_effect_t *effp /**< Effect to be deleted. */
+    );
+
+/**
+Client API:
+Shut down and delete the last effect in the chain.
+*/
+void
+LSX_API
+sox_delete_effect_last(
+    LSX_PARAM_INOUT sox_effects_chain_t *chain /**< Effects chain from which to remove the last effect. */
+    );
+
+/**
+Client API:
+Shut down and delete all effects in the chain.
+*/
+void
+LSX_API
+sox_delete_effects(
+    LSX_PARAM_INOUT sox_effects_chain_t *chain /**< Effects chain from which to delete effects. */
+    );
+
+/**
+Client API:
+Gets the sample offset of the start of the trim, useful for efficiently
+skipping the part that will be trimmed anyway (get trim start, seek, then
+clear trim start).
+@returns the sample offset of the start of the trim.
+*/
+sox_uint64_t
+LSX_API
+sox_trim_get_start(
+    LSX_PARAM_IN sox_effect_t * effp /**< Trim effect. */
+    );
+
+/**
+Client API:
+Clears the start of the trim to 0.
+*/
+void
+LSX_API
+sox_trim_clear_start(
+    LSX_PARAM_INOUT sox_effect_t * effp /**< Trim effect. */
+    );
+
+/**
+Client API:
+Returns true if the specified file is a known playlist file type.
+@returns true if the specified file is a known playlist file type.
+*/
+sox_bool
+LSX_API
+sox_is_playlist(
+    LSX_PARAM_IN_Z char const * filename /**< Name of file to examine. */
+    );
+
+/**
+Client API:
+Parses the specified playlist file.
+@returns SOX_SUCCESS if successful.
+*/
+int
+LSX_API
+sox_parse_playlist(
+    LSX_PARAM_IN sox_playlist_callback_t callback, /**< Callback to call for each item in the playlist. */
+    void * p, /**< Data to pass to callback. */
+    LSX_PARAM_IN char const * const listname /**< Filename of playlist file. */
+    );
+
+/**
+Client API:
+Converts a SoX error code into an error string.
+@returns error string corresponding to the specified error code,
+or a generic message if the error code is not recognized.
+*/
+LSX_RETURN_VALID_Z LSX_RETURN_PURE
+char const *
+LSX_API
+sox_strerror(
+    int sox_errno /**< Error code to look up. */
+    );
+
+/**
+Client API:
+Gets the basename of the specified file; for example, the basename of
+"/a/b/c.d" would be "c".
+@returns the number of characters written to base_buffer, excluding the null,
+or 0 on failure.
+*/
+size_t
+LSX_API
+sox_basename(
+    LSX_PARAM_OUT_Z_CAP_POST_COUNT(base_buffer_len,return) char * base_buffer, /**< Buffer into which basename should be written. */
+    size_t base_buffer_len, /**< Size of base_buffer, in bytes. */
+    LSX_PARAM_IN_Z char const * filename /**< Filename from which to extract basename. */
+    );
+
+/*****************************************************************************
+Internal API:
+WARNING - The items in this section are subject to instability. They only
+exist in the public header because sox (the application) currently uses them.
+These may be changed or removed in future versions of libSoX.
+*****************************************************************************/
+
+/**
+Plugins API:
+Print a fatal error in libSoX.
+*/
+void
+LSX_API
+lsx_fail_impl(
+    LSX_PARAM_IN_PRINTF char const * fmt, /**< printf-style format string. */
+    ...)
+    LSX_PRINTF12;
+
+/**
+Plugins API:
+Print a warning in libSoX.
+*/
+void
+LSX_API
+lsx_warn_impl(
+    LSX_PARAM_IN_PRINTF char const * fmt, /**< printf-style format string. */
+    ...)
+    LSX_PRINTF12;
+
+/**
+Plugins API:
+Print an informational message in libSoX.
+*/
+void
+LSX_API
+lsx_report_impl(
+    LSX_PARAM_IN_PRINTF char const * fmt, /**< printf-style format string. */
+    ...)
+    LSX_PRINTF12;
+
+/**
+Plugins API:
+Print a debug message in libSoX.
+*/
+void
+LSX_API
+lsx_debug_impl(
+    LSX_PARAM_IN_PRINTF char const * fmt, /**< printf-style format string. */
+    ...)
+    LSX_PRINTF12;
+
+/**
+Plugins API:
+Report a fatal error in libSoX; printf-style arguments must follow.
+*/
+#define lsx_fail       sox_get_globals()->subsystem=__FILE__,lsx_fail_impl
+
+/**
+Plugins API:
+Report a warning in libSoX; printf-style arguments must follow.
+*/
+#define lsx_warn       sox_get_globals()->subsystem=__FILE__,lsx_warn_impl
+
+/**
+Plugins API:
+Report an informational message in libSoX; printf-style arguments must follow.
+*/
+#define lsx_report     sox_get_globals()->subsystem=__FILE__,lsx_report_impl
+
+/**
+Plugins API:
+Report a debug message in libSoX; printf-style arguments must follow.
+*/
+#define lsx_debug      sox_get_globals()->subsystem=__FILE__,lsx_debug_impl
+
+/**
+Plugins API:
+String name and integer values for enumerated types (type metadata), for use
+with LSX_ENUM_ITEM, lsx_find_enum_text, and lsx_find_enum_value.
+*/
+typedef struct lsx_enum_item {
+    char const *text; /**< String name of enumeration. */
+    unsigned value;   /**< Integer value of enumeration. */
+} lsx_enum_item;
+
+/**
+Plugins API:
+Declares a static instance of an lsx_enum_item structure in format
+{ "item", prefixitem }, for use in declaring lsx_enum_item[] arrays.
+@param prefix The prefix to prepend to the item in the enumeration symbolic name.
+@param item   The user-visible text name of the item (must also be a valid C symbol name).
+*/
+#define LSX_ENUM_ITEM(prefix, item) {#item, prefix##item},
+
+/**
+Plugins API:
+Flags for use with lsx_find_enum_item.
+*/
+enum
+{
+    lsx_find_enum_item_none = 0, /**< Default parameters (case-insensitive). */
+    lsx_find_enum_item_case_sensitive = 1 /**< Enable case-sensitive search. */
+};
+
+/**
+Plugins API:
+Looks up an enumeration by name in an array of lsx_enum_items.
+@returns the corresponding item, or null if not found.
+*/
+LSX_RETURN_OPT LSX_RETURN_PURE
+lsx_enum_item const *
+LSX_API
+lsx_find_enum_text(
+    LSX_PARAM_IN_Z char const * text, /**< Name of enumeration to find. */
+    LSX_PARAM_IN lsx_enum_item const * lsx_enum_items, /**< Array of items to search, with text == NULL for last item. */
+    int flags /**< Search flags: 0 (case-insensitive) or lsx_find_enum_item_case_sensitive (case-sensitive). */
+    );
+
+/**
+Plugins API:
+Looks up an enumeration by value in an array of lsx_enum_items.
+@returns the corresponding item, or null if not found.
+*/
+LSX_RETURN_OPT LSX_RETURN_PURE
+lsx_enum_item const *
+LSX_API
+lsx_find_enum_value(
+    unsigned value, /**< Enumeration value to find. */
+    LSX_PARAM_IN lsx_enum_item const * lsx_enum_items /**< Array of items to search, with text == NULL for last item. */
+    );
+
+/**
+Plugins API:
+Looks up a command-line argument in a set of enumeration names, showing an
+error message if the argument is not found in the set of names.
+@returns The enumeration value corresponding to the matching enumeration, or
+INT_MAX if the argument does not match any enumeration name.
+*/
+LSX_RETURN_PURE
+int
+LSX_API
+lsx_enum_option(
+    int c, /**< Option character to which arg is associated, for example with -a, c would be 'a'. */
+    LSX_PARAM_IN_Z char const * arg, /**< Argument to find in enumeration list. */
+    LSX_PARAM_IN lsx_enum_item const * items /**< Array of items to search, with text == NULL for last item. */
+    );
+
+/**
+Plugins API:
+Determines whether the specified string ends with the specified suffix (case-sensitive).
+@returns true if the specified string ends with the specified suffix.
+*/
+LSX_RETURN_PURE
+sox_bool
+LSX_API
+lsx_strends(
+    LSX_PARAM_IN_Z char const * str, /**< String to search. */
+    LSX_PARAM_IN_Z char const * end  /**< Suffix to search for. */
+    );
+
+/**
+Plugins API:
+Finds the file extension for a filename.
+@returns the file extension, not including the '.', or null if filename does
+not have an extension.
+*/
+LSX_RETURN_VALID_Z LSX_RETURN_PURE
+char const *
+LSX_API
+lsx_find_file_extension(
+    LSX_PARAM_IN_Z char const * pathname /**< Filename to search for extension. */
+    );
+
+/**
+Plugins API:
+Formats the specified number with up to three significant figures and adds a
+metric suffix in place of the exponent, such as 1.23G.
+@returns A static buffer with the formatted number, valid until the next time
+this function is called (note: not thread safe).
+*/
+LSX_RETURN_VALID_Z
+char const *
+LSX_API
+lsx_sigfigs3(
+    double number /**< Number to be formatted. */
+    );
+
+/**
+Plugins API:
+Formats the specified number as a percentage, showing up to three significant
+figures.
+@returns A static buffer with the formatted number, valid until the next time
+this function is called (note: not thread safe).
+*/
+LSX_RETURN_VALID_Z
+char const *
+LSX_API
+lsx_sigfigs3p(
+    double percentage /**< Number to be formatted. */
+    );
+
+/**
+Plugins API:
+Allocates, deallocates, or resizes; like C's realloc, except that this version
+terminates the running application if unable to allocate the requested memory.
+@returns New buffer, or null if buffer was freed.
+*/
+LSX_RETURN_OPT
+void *
+LSX_API
+lsx_realloc(
+    LSX_PARAM_IN_OPT void *ptr, /**< Pointer to be freed or resized, or null if allocating a new buffer. */
+    size_t newsize /**< New size for buffer, or 0 to free the buffer. */
+    );
+
+/**
+Plugins API:
+Like strcmp, except that the characters are compared without regard to case.
+@returns 0 (s1 == s2), negative (s1 < s2), or positive (s1 > s2).
+*/
+LSX_RETURN_PURE
+int
+LSX_API
+lsx_strcasecmp(
+    LSX_PARAM_IN_Z char const * s1, /**< First string. */
+    LSX_PARAM_IN_Z char const * s2  /**< Second string. */
+    );
+
+
+/**
+Plugins API:
+Like strncmp, except that the characters are compared without regard to case.
+@returns 0 (s1 == s2), negative (s1 < s2), or positive (s1 > s2).
+*/
+LSX_RETURN_PURE
+int
+LSX_API
+lsx_strncasecmp(
+    LSX_PARAM_IN_Z char const * s1, /**< First string. */
+    LSX_PARAM_IN_Z char const * s2, /**< Second string. */
+    size_t n /**< Maximum number of characters to examine. */
+    );
+
+/**
+Plugins API:
+Is option argument unsupported, required, or optional.
+*/
+typedef enum lsx_option_arg_t {
+    lsx_option_arg_none, /**< Option does not have an argument. */
+    lsx_option_arg_required, /**< Option requires an argument. */
+    lsx_option_arg_optional /**< Option can optionally be followed by an argument. */
+} lsx_option_arg_t;
+
+/**
+Plugins API:
+lsx_getopt_init options.
+*/
+typedef enum lsx_getopt_flags_t {
+    lsx_getopt_flag_none = 0,      /**< no flags (no output, not long-only) */
+    lsx_getopt_flag_opterr = 1,    /**< if set, invalid options trigger lsx_warn output */
+    lsx_getopt_flag_longonly = 2   /**< if set, recognize -option as a long option */
+} lsx_getopt_flags_t;
+
+/**
+Plugins API:
+lsx_getopt long option descriptor.
+*/
+typedef struct lsx_option_t {
+    char const *     name;    /**< Name of the long option. */
+    lsx_option_arg_t has_arg; /**< Whether the long option supports an argument and, if so, whether the argument is required or optional. */
+    int *            flag;    /**< Flag to set if argument is present. */
+    int              val;     /**< Value to put in flag if argument is present. */
+} lsx_option_t;
+
+/**
+Plugins API:
+lsx_getopt session information (initialization data and state).
+*/
+typedef struct lsx_getopt_t {
+    int                  argc;     /**< IN    argc:      Number of arguments in argv */
+    char * const *       argv;     /**< IN    argv:      Array of arguments */
+    char const *         shortopts;/**< IN    shortopts: Short option characters */
+    lsx_option_t const * longopts; /**< IN    longopts:  Array of long option descriptors */
+    lsx_getopt_flags_t   flags;    /**< IN    flags:     Flags for longonly and opterr */
+    char const *         curpos;   /**< INOUT curpos:    Maintains state between calls to lsx_getopt */
+    int                  ind;      /**< INOUT optind:    Maintains the index of next element to be processed */
+    int                  opt;      /**< OUT   optopt:    Receives the option character that caused error */
+    char const *         arg;      /**< OUT   optarg:    Receives the value of the option's argument */
+    int                  lngind;   /**< OUT   lngind:    Receives the index of the matched long option or -1 if not a long option */
+} lsx_getopt_t;
+
+/**
+Plugins API:
+Initializes an lsx_getopt_t structure for use with lsx_getopt.
+*/
+void
+LSX_API
+lsx_getopt_init(
+    LSX_PARAM_IN             int argc,                      /**< Number of arguments in argv */
+    LSX_PARAM_IN_COUNT(argc) char * const * argv,           /**< Array of arguments */
+    LSX_PARAM_IN_Z           char const * shortopts,        /**< Short options, for example ":abc:def::ghi" (+/- not supported) */
+    LSX_PARAM_IN_OPT         lsx_option_t const * longopts, /**< Array of long option descriptors */
+    LSX_PARAM_IN             lsx_getopt_flags_t flags,      /**< Flags for longonly and opterr */
+    LSX_PARAM_IN             int first,                     /**< First argv to check (usually 1) */
+    LSX_PARAM_OUT            lsx_getopt_t * state           /**< State object to be initialized */
+    );
+
+/**
+Plugins API:
+Gets the next option. Options are parameters that start with "-" or "--".
+If no more options, returns -1. If unrecognized short option, returns '?'.
+If a recognized short option is missing a required argument,
+return (shortopts[0]==':' ? ':' : '?'). If successfully recognized short
+option, return the recognized character. If successfully recognized long
+option, returns (option.flag ? 0 : option.val).
+Note: lsx_getopt does not permute the non-option arguments.
+@returns option character (short), val or 0 (long), or -1 (no more).
+*/
+int
+LSX_API
+lsx_getopt(
+    LSX_PARAM_INOUT lsx_getopt_t * state /**< The getopt state pointer. */
+    );
+
+/* WARNING END */
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif /* SOX_H */
diff --git a/freedv/tags/0.99-Beta/src/sox_biquad.c b/freedv/tags/0.99-Beta/src/sox_biquad.c
new file mode 100644 (file)
index 0000000..f5a0913
--- /dev/null
@@ -0,0 +1,129 @@
+//==========================================================================
+// Name:            sox_biquad.h
+// Purpose:         Interface into Sox Biquad filters 
+// Created:         Dec 1, 2012
+// Authors:         David Rowe
+// 
+// To test:
+//          $ gcc sox_biquad.c -o sox_biquad -DSOX_BIQUAD_UNITTEST -Wall \
+//            /path/to/sox-14.4.0/src/.libs/libsox.a -lm -lsndfile
+//          $ ./sox_biquad
+//
+// 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+
+#include <assert.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include "sox.h"
+
+#include "sox_biquad.h"
+
+
+#define N_MAX 1024
+
+int lsx_biquad_flow(sox_effect_t * effp, const sox_sample_t *ibuf,
+                    sox_sample_t *obuf, size_t *isamp, size_t *osamp);
+
+void sox_biquad_start(void)
+{
+    int r = sox_init();
+    assert(r == SOX_SUCCESS);
+}
+
+void sox_biquad_finish(void)
+{
+    sox_quit();
+}
+
+/*
+  Effect must be implemented by biquads.c in sox, arguments are just
+  like sox command line, for example:
+
+  char *argv[10];
+  argv[0] = "highpass"; argv[1]="1000"; argc=1;
+*/
+
+void *sox_biquad_create(int argc, const char *argv[])
+{
+    int ret;
+    sox_effect_t *e;
+    int (*start)(sox_effect_t *); /* function pointer to effect start func */
+    
+    e = sox_create_effect(sox_find_effect(argv[0])); assert(e != NULL);
+    ret = sox_effect_options(e, argc, (char * const*)&argv[1]);
+    assert(ret == SOX_SUCCESS);
+
+    start = e->handler.start;
+    e->in_signal.rate = 8000;     /* locked at FS=8000 Hz */
+    ret = start(e); assert(ret == SOX_SUCCESS);
+    
+    return (void *)e;
+}
+
+void sox_biquad_destroy(void *sbq) {
+    sox_effect_t *e = (sox_effect_t *)sbq;
+    free(e);
+}
+
+void sox_biquad_filter(void *sbq, short out[], short in[], int n)
+{
+    sox_effect_t *e = (sox_effect_t *)sbq;
+    sox_sample_t ibuf[N_MAX];
+    sox_sample_t obuf[N_MAX];
+    size_t isamp, osamp;
+    unsigned int clips;
+    SOX_SAMPLE_LOCALS; 
+    int i;
+
+    assert(n <= N_MAX);
+
+    clips = 0;
+    for(i=0; i<n; i++)
+        ibuf[i] = SOX_SIGNED_16BIT_TO_SAMPLE(in[i], clips);
+    isamp = osamp = (unsigned int)n;
+    lsx_biquad_flow(e, ibuf, obuf, &isamp, &osamp);
+    for(i=0; i<n; i++)
+        out[i] = SOX_SAMPLE_TO_SIGNED_16BIT(obuf[i], clips); 
+}
+
+
+#ifdef SOX_BIQUAD_UNITTEST
+#define N 20
+int main(void) {
+    void *sbq;
+    char *argv[10];
+    short in[N];
+    short out[N];
+    int   i, argc;;
+
+    for(i=0; i<N; i++)
+        in[i] = 0;
+    in[0] = 8000;
+
+    sox_biquad_start();
+    argv[0] = "highpass"; argv[1]="1000"; argc=1;
+    sbq = sox_biquad_create(argc, argv);
+
+    sox_biquad_filter(sbq, out, in, N);
+    for(i=0; i<N; i++)
+        printf("%d\n", out[i]);
+   
+    sox_biquad_destroy(sbq);
+    sox_biquad_finish();
+
+    return 0;
+}
+#endif
diff --git a/freedv/tags/0.99-Beta/src/sox_biquad.h b/freedv/tags/0.99-Beta/src/sox_biquad.h
new file mode 100644 (file)
index 0000000..f38de64
--- /dev/null
@@ -0,0 +1,40 @@
+//==========================================================================
+// Name:            sox_biquad.h
+// Purpose:         Interface into Sox Biquad filters 
+// Created:         Dec 1, 2012
+// Authors:         David Rowe
+// 
+// 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+
+#ifndef __SOX_BIQUAD__
+#define __SOX_BIQUAD__
+
+#ifdef __cplusplus
+extern "C" {
+
+#endif
+
+void sox_biquad_start(void);
+void sox_biquad_finish(void);
+void *sox_biquad_create(int argc, const char *argv[]);
+void sox_biquad_destroy(void *sbq);
+void sox_biquad_filter(void *sbq, short out[], short in[], int n);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/freedv/tags/0.99-Beta/src/topFrame.cpp b/freedv/tags/0.99-Beta/src/topFrame.cpp
new file mode 100644 (file)
index 0000000..54ea80a
--- /dev/null
@@ -0,0 +1,551 @@
+//==========================================================================
+// Name:            topFrame.cpp
+//
+// Purpose:         Implements simple wxWidgets application with GUI.
+// Created:         Apr. 9, 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 <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#include "topFrame.h"
+
+extern int g_playFileToMicInEventId;
+extern int g_recFileFromRadioEventId;
+extern int g_playFileFromRadioEventId;
+
+//=========================================================================
+// Code that lays out the main application window
+//=========================================================================
+TopFrame::TopFrame(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxFrame(parent, id, title, pos, size, style)
+{
+    this->SetSizeHints(wxDefaultSize, wxDefaultSize);
+    this->SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
+    this->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DLIGHT));
+    this->SetSizeHints(wxDefaultSize, wxDefaultSize);
+    this->SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
+    this->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DLIGHT));
+    //=====================================================
+    // Menubar Setup
+    m_menubarMain = new wxMenuBar(wxMB_DOCKABLE);
+    file = new wxMenu();
+
+    wxMenuItem* m_menuItemOnTop;
+    m_menuItemOnTop = new wxMenuItem(file, wxID_ANY, wxString(_("On Top")) , _("Always Top Window"), wxITEM_NORMAL);
+    file->Append(m_menuItemOnTop);
+
+    wxMenuItem* m_menuItemExit;
+    m_menuItemExit = new wxMenuItem(file, ID_EXIT, wxString(_("E&xit")) , _("Exit Program"), wxITEM_NORMAL);
+    file->Append(m_menuItemExit);
+
+    m_menubarMain->Append(file, _("&File"));
+
+    tools = new wxMenu();
+    wxMenuItem* m_menuItemAudio;
+    m_menuItemAudio = new wxMenuItem(tools, wxID_ANY, wxString(_("&Audio Config")) , wxEmptyString, wxITEM_NORMAL);
+    tools->Append(m_menuItemAudio);
+
+    wxMenuItem* m_menuItemRigCtrlCfg;
+    m_menuItemRigCtrlCfg = new wxMenuItem(tools, wxID_ANY, wxString(_("&PTT Config")) , wxEmptyString, wxITEM_NORMAL);
+    tools->Append(m_menuItemRigCtrlCfg);
+
+    wxMenuItem* m_menuItemOptions;
+    m_menuItemOptions = new wxMenuItem(tools, wxID_ANY, wxString(_("Options")) , wxEmptyString, wxITEM_NORMAL);
+    tools->Append(m_menuItemOptions);
+
+    wxMenuItem* m_menuItemFilter;
+    m_menuItemFilter = new wxMenuItem(tools, wxID_ANY, wxString(_("&Filter")) , wxEmptyString, wxITEM_NORMAL);
+    tools->Append(m_menuItemFilter);
+
+    wxMenuItem* m_menuItemPlayFileToMicIn;
+    m_menuItemPlayFileToMicIn = new wxMenuItem(tools, wxID_ANY, wxString(_("Start/Stop Play File - Mic In")) , wxEmptyString, wxITEM_NORMAL);
+    g_playFileToMicInEventId = m_menuItemPlayFileToMicIn->GetId();
+    tools->Append(m_menuItemPlayFileToMicIn);
+
+    wxMenuItem* m_menuItemRecFileFromRadio;
+    m_menuItemRecFileFromRadio = new wxMenuItem(tools, wxID_ANY, wxString(_("Start/Stop Record File - From Radio")) , wxEmptyString, wxITEM_NORMAL);
+    g_recFileFromRadioEventId = m_menuItemRecFileFromRadio->GetId();
+    tools->Append(m_menuItemRecFileFromRadio);
+
+    wxMenuItem* m_menuItemPlayFileFromRadio;
+    m_menuItemPlayFileFromRadio = new wxMenuItem(tools, wxID_ANY, wxString(_("Start/Stop Play File - From Radio")) , wxEmptyString, wxITEM_NORMAL);
+    g_playFileFromRadioEventId = m_menuItemPlayFileFromRadio->GetId();
+    tools->Append(m_menuItemPlayFileFromRadio);
+    m_menubarMain->Append(tools, _("&Tools"));
+
+    help = new wxMenu();
+    wxMenuItem* m_menuItemHelpUpdates;
+    m_menuItemHelpUpdates = new wxMenuItem(help, wxID_ANY, wxString(_("Check for Updates")) , wxEmptyString, wxITEM_NORMAL);
+    help->Append(m_menuItemHelpUpdates);
+    m_menuItemHelpUpdates->Enable(false);
+
+    wxMenuItem* m_menuItemAbout;
+    m_menuItemAbout = new wxMenuItem(help, ID_ABOUT, wxString(_("&About")) , _("About this program"), wxITEM_NORMAL);
+    help->Append(m_menuItemAbout);
+
+    m_menubarMain->Append(help, _("&Help"));
+
+    this->SetMenuBar(m_menubarMain);
+
+    wxBoxSizer* bSizer1;
+    bSizer1 = new wxBoxSizer(wxHORIZONTAL);
+
+    //=====================================================
+    // Left side
+    //=====================================================
+    wxBoxSizer* leftSizer;
+    leftSizer = new wxBoxSizer(wxVERTICAL);
+
+    wxStaticBoxSizer* snrSizer;
+    snrSizer = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("SNR")), wxVERTICAL);
+
+    //------------------------------
+    // S/N ratio Guage (vert. bargraph)
+    //------------------------------
+    m_gaugeSNR = new wxGauge(this, wxID_ANY, 25, wxDefaultPosition, wxSize(15,135), wxGA_SMOOTH|wxGA_VERTICAL);
+    m_gaugeSNR->SetToolTip(_("Displays signal to noise ratio in dB."));
+    snrSizer->Add(m_gaugeSNR, 1, wxALIGN_CENTER_HORIZONTAL|wxALL, 10);
+
+    //------------------------------
+    // Box for S/N ratio (Numeric)
+    //------------------------------
+    m_textSNR = new wxStaticText(this, wxID_ANY, wxT(" 0.0"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE);
+    snrSizer->Add(m_textSNR, 0, wxALIGN_CENTER_HORIZONTAL, 1);
+
+    //------------------------------
+    // S/N ratio slow Checkbox
+    //------------------------------
+    m_ckboxSNR = new wxCheckBox(this, wxID_ANY, _("Slow"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
+    m_ckboxSNR->SetToolTip(_("Smooth but slow SNR estimation"));
+    snrSizer->Add(m_ckboxSNR, 0, wxALIGN_CENTER_HORIZONTAL, 5);
+
+    leftSizer->Add(snrSizer, 2, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxALL, 1);
+
+    //------------------------------
+    // Sync  Indicator box
+    //------------------------------
+    wxStaticBoxSizer* sbSizer3_33;
+    sbSizer3_33 = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Sync")), wxVERTICAL);
+
+    m_rbSync = new wxRadioButton( this, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
+    m_rbSync->SetForegroundColour( wxColour( 255, 0, 0 ) );
+    sbSizer3_33->Add(m_rbSync, 0, wxALIGN_CENTER|wxALL, 1);
+    leftSizer->Add(sbSizer3_33,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
+
+    //------------------------------
+    // BER Frames box
+    //------------------------------
+
+    wxStaticBoxSizer* sbSizer_ber;
+    sbSizer_ber = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Bit Error Rate")), wxVERTICAL);
+
+    m_BtnBerReset = new wxButton(this, wxID_ANY, _("Reset"), wxDefaultPosition, wxDefaultSize, 0);
+    sbSizer_ber->Add(m_BtnBerReset, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
+
+    m_textBits = new wxStaticText(this, wxID_ANY, wxT("Bits: 0"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
+    sbSizer_ber->Add(m_textBits, 0, wxALIGN_LEFT, 1);
+    m_textErrors = new wxStaticText(this, wxID_ANY, wxT("Errs: 0"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
+    sbSizer_ber->Add(m_textErrors, 0, wxALIGN_LEFT, 1);
+    m_textBER = new wxStaticText(this, wxID_ANY, wxT("BER: 0.0"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
+    sbSizer_ber->Add(m_textBER, 0, wxALIGN_LEFT, 1);
+
+    leftSizer->Add(sbSizer_ber,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
+
+    //------------------------------
+    // Signal Level(vert. bargraph)
+    //------------------------------
+    wxStaticBoxSizer* levelSizer;
+    levelSizer = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Level")), wxVERTICAL);
+
+    m_textLevel = new wxStaticText(this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(60,-1), wxALIGN_CENTRE);
+    m_textLevel->SetForegroundColour(wxColour(255,0,0));
+    levelSizer->Add(m_textLevel, 0, wxALIGN_LEFT, 1);
+
+    m_gaugeLevel = new wxGauge(this, wxID_ANY, 100, wxDefaultPosition, wxSize(15,135), wxGA_SMOOTH|wxGA_VERTICAL);
+    m_gaugeLevel->SetToolTip(_("Peak of From Radio in Rx, or peak of From Mic in Tx mode.  If Red you should reduce your levels"));
+    levelSizer->Add(m_gaugeLevel, 1, wxALIGN_CENTER_HORIZONTAL|wxALL, 10);
+
+    leftSizer->Add(levelSizer, 2, wxALIGN_CENTER|wxALL|wxEXPAND, 1);
+
+    bSizer1->Add(leftSizer, 0, wxALL|wxEXPAND, 5);
+
+    //=====================================================
+    // Center Section
+    //=====================================================
+    wxBoxSizer* centerSizer;
+    centerSizer = new wxBoxSizer(wxVERTICAL);
+    wxBoxSizer* upperSizer;
+    upperSizer = new wxBoxSizer(wxVERTICAL);
+
+    //=====================================================
+    // Tabbed Notebook control containing display graphs
+    //=====================================================
+    //m_auiNbookCtrl = new wxAuiNotebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_NB_BOTTOM|wxAUI_NB_DEFAULT_STYLE);
+    //long style = wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_MOVE | wxAUI_NB_SCROLL_BUTTONS | wxAUI_NB_CLOSE_ON_ACTIVE_TAB | wxAUI_NB_MIDDLE_CLICK_CLOSE;
+    long nb_style = wxAUI_NB_BOTTOM | wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_MOVE | wxAUI_NB_SCROLL_BUTTONS;
+    m_auiNbookCtrl = new wxAuiNotebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, nb_style);
+    // This line sets the fontsize for the tabs on the notebook control
+    m_auiNbookCtrl->SetFont(wxFont(8, 70, 90, 90, false, wxEmptyString));
+
+    upperSizer->Add(m_auiNbookCtrl, 1, wxALIGN_TOP|wxEXPAND, 1);
+    centerSizer->Add(upperSizer, 1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALIGN_TOP|wxEXPAND, 0);
+
+    // lower middle used for user ID
+
+    wxBoxSizer* lowerSizer;
+    lowerSizer = new wxBoxSizer(wxHORIZONTAL);
+
+    m_BtnCallSignReset = new wxButton(this, wxID_ANY, _("Clear"), wxDefaultPosition, wxDefaultSize, 0);
+    lowerSizer->Add(m_BtnCallSignReset, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
+
+    wxBoxSizer* bSizer15;
+    bSizer15 = new wxBoxSizer(wxVERTICAL);
+    m_txtCtrlCallSign = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
+    m_txtCtrlCallSign->SetToolTip(_("Call Sign of transmitting station will appear here"));
+    bSizer15->Add(m_txtCtrlCallSign, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 5);
+    lowerSizer->Add(bSizer15, 1, wxEXPAND, 5);
+
+    wxStaticBoxSizer* sbSizer_Checksum = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Checksums")), wxHORIZONTAL);
+
+    wxStaticText *goodLabel = new wxStaticText(this, wxID_ANY, wxT("Good: "), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE);
+    sbSizer_Checksum->Add(goodLabel, 0, 0, 2);
+    m_txtChecksumGood = new wxStaticText(this, wxID_ANY, wxT("0"), wxDefaultPosition, wxSize(30,-1), wxALIGN_CENTRE);
+    sbSizer_Checksum->Add(m_txtChecksumGood, 0, 0, 2);
+
+    wxStaticText *badLabel = new wxStaticText(this, wxID_ANY, wxT("Bad: "), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE);
+    sbSizer_Checksum->Add(badLabel, 0, 0, 1);
+    m_txtChecksumBad = new wxStaticText(this, wxID_ANY, wxT("0"), wxDefaultPosition, wxSize(30,-1), wxALIGN_CENTRE);
+    sbSizer_Checksum->Add(m_txtChecksumBad, 0, 0, 1);
+
+    lowerSizer->Add(sbSizer_Checksum, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
+
+    //=====================================================
+    // These are the buttons that autosend the userid (?)
+    //=====================================================
+
+    // DR 4 Dec - taken off for screen for Beta release to avoid questions on their use until
+    // we implement this feature
+ #ifdef UNIMPLEMENTED
+    wxBoxSizer* bSizer141;
+    bSizer141 = new wxBoxSizer(wxHORIZONTAL);
+
+    // TxID
+    //---------
+    m_togTxID = new wxToggleButton(this, wxID_ANY, _("TxID"), wxDefaultPosition, wxDefaultSize, 0);
+    m_togTxID->SetToolTip(_("Send Tx ID information"));
+    bSizer141->Add(m_togTxID, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
+
+    // RxID
+    //---------
+    m_togRxID = new wxToggleButton(this, wxID_ANY, _("RxID"), wxDefaultPosition, wxDefaultSize, 0);
+    m_togRxID->SetToolTip(_("Enable reception of ID information"));
+    bSizer141->Add(m_togRxID, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_LEFT|wxALL|wxFIXED_MINSIZE, 5);
+
+    lowerSizer->Add(bSizer141, 0, wxALIGN_RIGHT, 5);
+#endif
+
+    centerSizer->Add(lowerSizer, 0, wxALIGN_BOTTOM|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 2);
+    bSizer1->Add(centerSizer, 4, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 1);
+
+    //=====================================================
+    // Right side
+    //=====================================================
+    wxBoxSizer* rightSizer;
+    rightSizer = new wxBoxSizer(wxVERTICAL);
+
+    //=====================================================
+    // Squelch Slider Control
+    //=====================================================
+    wxStaticBoxSizer* sbSizer3;
+    sbSizer3 = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Squelch")), wxVERTICAL);
+
+    m_sliderSQ = new wxSlider(this, wxID_ANY, 0, 0, 40, wxDefaultPosition, wxSize(-1,80), wxSL_AUTOTICKS|wxSL_INVERSE|wxSL_VERTICAL);
+    m_sliderSQ->SetToolTip(_("Set Squelch level in dB."));
+
+    sbSizer3->Add(m_sliderSQ, 1, wxALIGN_CENTER_HORIZONTAL, 0);
+
+    //------------------------------
+    // Squelch Level static text box
+    //------------------------------
+    m_textSQ = new wxStaticText(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE);
+
+    sbSizer3->Add(m_textSQ, 0, wxALIGN_CENTER_HORIZONTAL, 0);
+
+    //------------------------------
+    // Squelch Toggle Checkbox
+    //------------------------------
+    m_ckboxSQ = new wxCheckBox(this, wxID_ANY, _(""), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
+
+    sbSizer3->Add(m_ckboxSQ, 0, wxALIGN_CENTER_HORIZONTAL, 0);
+    rightSizer->Add(sbSizer3, 2, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 0);
+
+    //rightSizer->Add(sbSizer3_33,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
+
+    /* new --- */
+
+    //------------------------------
+    // Mode box
+    //------------------------------
+    wxStaticBoxSizer* sbSizer_mode;
+    sbSizer_mode = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Mode")), wxVERTICAL);
+
+#ifdef DISABLED_FEATURE
+    m_rb1400old = new wxRadioButton( this, wxID_ANY, wxT("1400 V0.91"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
+    sbSizer_mode->Add(m_rb1400old, 0, wxALIGN_LEFT|wxALL, 1);
+    m_rb1400 = new wxRadioButton( this, wxID_ANY, wxT("1400"), wxDefaultPosition, wxDefaultSize, 0);
+    sbSizer_mode->Add(m_rb1400, 0, wxALIGN_LEFT|wxALL, 1);
+#endif
+    m_rb700 = new wxRadioButton( this, wxID_ANY, wxT("700"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
+    sbSizer_mode->Add(m_rb700, 0, wxALIGN_LEFT|wxALL, 1);
+    m_rb1600 = new wxRadioButton( this, wxID_ANY, wxT("1600"), wxDefaultPosition, wxDefaultSize, 0);
+    sbSizer_mode->Add(m_rb1600, 0, wxALIGN_LEFT|wxALL, 1);
+    m_rb1600->SetValue(true);
+#ifdef DISABLED_FEATURE
+    m_rb1600Wide = new wxRadioButton( this, wxID_ANY, wxT("1600 Wide"), wxDefaultPosition, wxDefaultSize, 0);
+    sbSizer_mode->Add(m_rb1600Wide, 0, wxALIGN_LEFT|wxALL, 1);
+    m_rb2000 = new wxRadioButton( this, wxID_ANY, wxT("2000"), wxDefaultPosition, wxDefaultSize, 0);
+    sbSizer_mode->Add(m_rb2000, 0, wxALIGN_LEFT|wxALL, 1);
+#endif
+
+    rightSizer->Add(sbSizer_mode,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
+
+    #ifdef MOVED_TO_OPTIONS_DIALOG
+    /* new --- */
+
+    //------------------------------
+    // Test Frames box
+    //------------------------------
+
+    wxStaticBoxSizer* sbSizer_testFrames;
+    sbSizer_testFrames = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Test Frames")), wxVERTICAL);
+
+    m_ckboxTestFrame = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
+    sbSizer_testFrames->Add(m_ckboxTestFrame, 0, wxALIGN_LEFT, 0);
+
+    rightSizer->Add(sbSizer_testFrames,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
+    #endif
+
+    //=====================================================
+    // Control Toggles box
+    //=====================================================
+    wxStaticBoxSizer* sbSizer5;
+    sbSizer5 = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Control")), wxVERTICAL);
+    wxBoxSizer* bSizer1511;
+    bSizer1511 = new wxBoxSizer(wxVERTICAL);
+
+    //-------------------------------
+    // Stop/Stop signal processing (rx and tx)
+    //-------------------------------
+    m_togBtnOnOff = new wxToggleButton(this, wxID_ANY, _("Start"), wxDefaultPosition, wxDefaultSize, 0);
+    m_togBtnOnOff->SetToolTip(_("Begin/End receiving data."));
+    bSizer1511->Add(m_togBtnOnOff, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
+    sbSizer5->Add(bSizer1511, 0, wxEXPAND, 1);
+
+#ifdef UNIMPLEMENTED
+    //------------------------------
+    // Toggle Loopback button for RX
+    //------------------------------
+    wxBoxSizer* bSizer15113;
+    bSizer15113 = new wxBoxSizer(wxHORIZONTAL);
+    wxBoxSizer* bSizer15111;
+    bSizer15111 = new wxBoxSizer(wxVERTICAL);
+    wxSize wxSz = wxSize(44, 30);
+    m_togBtnLoopRx = new wxToggleButton(this, wxID_ANY, _("Loop\nRX"), wxDefaultPosition, wxSz, 0);
+    m_togBtnLoopRx->SetFont(wxFont(6, 70, 90, 90, false, wxEmptyString));
+    m_togBtnLoopRx->SetToolTip(_("Loopback Receive audio data."));
+
+    bSizer15111->Add(m_togBtnLoopRx, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 0);
+
+    //sbSizer5->Add(bSizer15111, 0, wxEXPAND, 1);
+    bSizer15113->Add(bSizer15111, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 0);
+
+    //------------------------------
+    // Toggle Loopback button for Tx
+    //------------------------------
+    wxBoxSizer* bSizer15112;
+    bSizer15112 = new wxBoxSizer(wxVERTICAL);
+    m_togBtnLoopTx = new wxToggleButton(this, wxID_ANY, _("Loop\nTX"), wxDefaultPosition, wxSz, 0);
+    m_togBtnLoopTx->SetFont(wxFont(6, 70, 90, 90, false, wxEmptyString));
+    m_togBtnLoopTx->SetToolTip(_("Loopback Transmit audio data."));
+
+    bSizer15112->Add(m_togBtnLoopTx, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 0);
+    bSizer15113->Add(bSizer15112, 0,  wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 0);
+
+    sbSizer5->Add(bSizer15113, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
+#endif
+
+    //------------------------------
+    // Split Frequency Mode Toggle
+    //------------------------------
+    wxBoxSizer* bSizer151;
+    bSizer151 = new wxBoxSizer(wxVERTICAL);
+
+    m_togBtnSplit = new wxToggleButton(this, wxID_ANY, _("Split"), wxDefaultPosition, wxDefaultSize, 0);
+    m_togBtnSplit->SetToolTip(_("Toggle split frequency mode."));
+
+    bSizer151->Add(m_togBtnSplit, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
+    sbSizer5->Add(bSizer151, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 1);
+    wxBoxSizer* bSizer13;
+    bSizer13 = new wxBoxSizer(wxVERTICAL);
+
+    //------------------------------
+    // Analog Passthrough Toggle
+    //------------------------------
+    m_togBtnAnalog = new wxToggleButton(this, wxID_ANY, _("Analog"), wxDefaultPosition, wxDefaultSize, 0);
+    m_togBtnAnalog->SetToolTip(_("Toggle analog/digital operation."));
+    bSizer13->Add(m_togBtnAnalog, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
+    sbSizer5->Add(bSizer13, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
+
+    // not implemented on fdmdv2
+#ifdef ALC
+    //------------------------------
+    // Toggle for ALC
+    //------------------------------
+    wxBoxSizer* bSizer14;
+    bSizer14 = new wxBoxSizer(wxVERTICAL);
+    m_togBtnALC = new wxToggleButton(this, wxID_ANY, _("ALC"), wxDefaultPosition, wxDefaultSize, 0);
+    m_togBtnALC->SetToolTip(_("Toggle automatic level control mode."));
+
+    bSizer14->Add(m_togBtnALC, 0, wxALL, 1);
+    sbSizer5->Add(bSizer14, 0, wxALIGN_CENTER|wxALIGN_CENTER_HORIZONTAL|wxALL, 1);
+#endif
+
+    //------------------------------
+    // Toggle Transmit/Receive relays
+    //------------------------------
+    wxBoxSizer* bSizer11;
+    bSizer11 = new wxBoxSizer(wxVERTICAL);
+    m_btnTogPTT = new wxToggleButton(this, wxID_ANY, _("PTT"), wxDefaultPosition, wxDefaultSize, 0);
+    m_btnTogPTT->SetToolTip(_("Push to Talk - Switch between Receive and Transmit - you can also use the space bar "));
+    bSizer11->Add(m_btnTogPTT, 1, wxALIGN_CENTER|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
+    sbSizer5->Add(bSizer11, 2, wxEXPAND, 1);
+    rightSizer->Add(sbSizer5, 2, wxALIGN_CENTER|wxALL|wxEXPAND, 3);
+    bSizer1->Add(rightSizer, 0, wxALL|wxEXPAND, 3);
+    this->SetSizer(bSizer1);
+    this->Layout();
+    m_statusBar1 = this->CreateStatusBar(3, wxST_SIZEGRIP, wxID_ANY);
+
+    //=====================================================
+    // End of layout
+    //=====================================================
+
+    //-------------------
+    // Connect Events
+    //-------------------
+    this->Connect(wxEVT_CLOSE_WINDOW, wxCloseEventHandler(TopFrame::topFrame_OnClose));
+    this->Connect(wxEVT_PAINT, wxPaintEventHandler(TopFrame::topFrame_OnPaint));
+    this->Connect(wxEVT_SIZE, wxSizeEventHandler(TopFrame::topFrame_OnSize));
+    this->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::topFrame_OnUpdateUI));
+
+    this->Connect(m_menuItemExit->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnExit));
+    this->Connect(m_menuItemOnTop->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnTop));
+
+    this->Connect(m_menuItemAudio->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsAudio));
+    this->Connect(m_menuItemAudio->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsAudioUI));
+    this->Connect(m_menuItemFilter->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsFilter));
+    this->Connect(m_menuItemFilter->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsFilterUI));
+    this->Connect(m_menuItemRigCtrlCfg->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsComCfg));
+    this->Connect(m_menuItemRigCtrlCfg->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsComCfgUI));
+    this->Connect(m_menuItemOptions->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsOptions));
+    this->Connect(m_menuItemOptions->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsOptionsUI));
+
+    this->Connect(m_menuItemPlayFileToMicIn->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnPlayFileToMicIn));
+    this->Connect(m_menuItemRecFileFromRadio->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnRecFileFromRadio));
+    this->Connect(m_menuItemPlayFileFromRadio->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnPlayFileFromRadio));
+
+    this->Connect(m_menuItemHelpUpdates->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnHelpCheckUpdates));
+    this->Connect(m_menuItemHelpUpdates->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnHelpCheckUpdatesUI));
+    this->Connect(m_menuItemAbout->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnHelpAbout));
+    //m_togRxID->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnRxID), NULL, this);
+    //m_togTxID->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnTxID), NULL, this);
+    m_sliderSQ->Connect(wxEVT_SCROLL_TOP, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Connect(wxEVT_SCROLL_BOTTOM, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Connect(wxEVT_SCROLL_LINEUP, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Connect(wxEVT_SCROLL_LINEDOWN, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Connect(wxEVT_SCROLL_PAGEUP, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Connect(wxEVT_SCROLL_PAGEDOWN, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Connect(wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Connect(wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Connect(wxEVT_SCROLL_BOTTOM, wxScrollEventHandler(TopFrame::OnSliderScrollBottom), NULL, this);
+    m_sliderSQ->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(TopFrame::OnCmdSliderScrollChanged), NULL, this);
+    m_sliderSQ->Connect(wxEVT_SCROLL_TOP, wxScrollEventHandler(TopFrame::OnSliderScrollTop), NULL, this);
+    m_ckboxSQ->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(TopFrame::OnCheckSQClick), NULL, this);
+
+    m_ckboxSNR->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(TopFrame::OnCheckSNRClick), NULL, this);
+
+    m_togBtnOnOff->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnOnOff), NULL, this);
+    m_togBtnSplit->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnSplitClick), NULL, this);
+    m_togBtnAnalog->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnAnalogClick), NULL, this);
+#ifdef ALC
+    m_togBtnALC->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnALCClick), NULL, this);
+#endif
+    m_btnTogPTT->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnPTT), NULL, this);
+
+    m_BtnCallSignReset->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnCallSignReset), NULL, this);
+    m_BtnBerReset->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnBerReset), NULL, this);
+}
+
+TopFrame::~TopFrame()
+{
+    //-------------------
+    // Disconnect Events
+    //-------------------
+    this->Disconnect(wxEVT_CLOSE_WINDOW, wxCloseEventHandler(TopFrame::topFrame_OnClose));
+    this->Disconnect(wxEVT_PAINT, wxPaintEventHandler(TopFrame::topFrame_OnPaint));
+    this->Disconnect(wxEVT_SIZE, wxSizeEventHandler(TopFrame::topFrame_OnSize));
+    this->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::topFrame_OnUpdateUI));
+    this->Disconnect(ID_EXIT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnExit));
+    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsAudio));
+    this->Disconnect(wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsAudioUI));
+    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsFilter));
+    this->Disconnect(wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsFilterUI));
+    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsComCfg));
+    this->Disconnect(wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsComCfgUI));
+    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsOptions));
+    this->Disconnect(wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsOptionsUI));
+
+    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnPlayFileToMicIn));
+    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnRecFileFromRadio));
+    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnPlayFileFromRadio));
+
+    this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnHelpCheckUpdates));
+    this->Disconnect(wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnHelpCheckUpdatesUI));
+    this->Disconnect(ID_ABOUT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnHelpAbout));
+    //m_togRxID->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnRxID), NULL, this);
+    //m_togTxID->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnTxID), NULL, this);
+    m_sliderSQ->Disconnect(wxEVT_SCROLL_TOP, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Disconnect(wxEVT_SCROLL_BOTTOM, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Disconnect(wxEVT_SCROLL_LINEUP, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Disconnect(wxEVT_SCROLL_LINEDOWN, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Disconnect(wxEVT_SCROLL_PAGEUP, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Disconnect(wxEVT_SCROLL_PAGEDOWN, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Disconnect(wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Disconnect(wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(TopFrame::OnCmdSliderScroll), NULL, this);
+    m_sliderSQ->Disconnect(wxEVT_SCROLL_BOTTOM, wxScrollEventHandler(TopFrame::OnSliderScrollBottom), NULL, this);
+    m_sliderSQ->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(TopFrame::OnCmdSliderScrollChanged), NULL, this);
+    m_sliderSQ->Disconnect(wxEVT_SCROLL_TOP, wxScrollEventHandler(TopFrame::OnSliderScrollTop), NULL, this);
+    m_ckboxSQ->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(TopFrame::OnCheckSQClick), NULL, this);
+
+    m_togBtnOnOff->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnOnOff), NULL, this);
+    m_togBtnSplit->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnSplitClick), NULL, this);
+    m_togBtnAnalog->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnAnalogClick), NULL, this);
+#ifdef ALC
+    m_togBtnALC->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnALCClick), NULL, this);
+#endif
+    m_btnTogPTT->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnPTT), NULL, this);
+
+}
+
diff --git a/freedv/tags/0.99-Beta/src/topFrame.h b/freedv/tags/0.99-Beta/src/topFrame.h
new file mode 100644 (file)
index 0000000..4341315
--- /dev/null
@@ -0,0 +1,183 @@
+//==========================================================================
+// Name:            topFrame.h
+//
+// Purpose:         Implements simple wxWidgets application with GUI.
+// Created:         Apr. 9, 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 Lesser 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 Lesser General Public License
+//  along with this program; if not, see <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+#ifndef __TOPFRAME_H__
+#define __TOPFRAME_H__
+
+#include "version.h"
+#include <wx/artprov.h>
+#include <wx/xrc/xmlres.h>
+#include <wx/intl.h>
+#include <wx/string.h>
+#include <wx/bitmap.h>
+#include <wx/image.h>
+#include <wx/icon.h>
+#include <wx/menu.h>
+#include <wx/gdicmn.h>
+#include <wx/font.h>
+#include <wx/colour.h>
+#include <wx/settings.h>
+#include <wx/gauge.h>
+#include <wx/textctrl.h>
+#include <wx/sizer.h>
+#include <wx/statbox.h>
+#include <wx/aui/auibook.h>
+#include <wx/tglbtn.h>
+#include <wx/slider.h>
+#include <wx/checkbox.h>
+#include <wx/statusbr.h>
+#include <wx/frame.h>
+#include <wx/statbmp.h>
+#include <wx/stattext.h>
+#include <wx/button.h>
+#include <wx/dialog.h>
+#include <wx/radiobut.h>
+#include <wx/combobox.h>
+#include <wx/panel.h>
+#include <wx/listbox.h>
+#include <wx/notebook.h>
+#include <wx/listctrl.h>
+
+
+///////////////////////////////////////////////////////////////////////////
+
+#define ID_OPEN 1000
+#define ID_SAVE 1001
+#define ID_CLOSE 1002
+#define ID_EXIT 1003
+#define ID_COPY 1004
+#define ID_CUT 1005
+#define ID_PASTE 1006
+#define ID_OPTIONS 1007
+#define ID_ABOUT 1008
+
+///////////////////////////////////////////////////////////////////////////////
+/// Class TopFrame
+///////////////////////////////////////////////////////////////////////////////
+class TopFrame : public wxFrame
+{
+    private:
+
+    protected:
+        wxMenuBar* m_menubarMain;
+        wxMenu* file;
+        wxMenu* edit;
+        wxMenu* tools;
+        wxMenu* help;
+        wxGauge* m_gaugeSNR;
+        wxStaticText* m_textSNR;
+        wxCheckBox* m_ckboxSNR;
+        wxGauge* m_gaugeLevel;
+        wxStaticText* m_textLevel;
+
+        wxButton*     m_BtnCallSignReset;
+        wxTextCtrl*   m_txtCtrlCallSign;
+        wxStaticText* m_txtChecksumGood;
+        wxStaticText* m_txtChecksumBad;
+
+        wxSlider* m_sliderSQ;
+        wxCheckBox* m_ckboxSQ;
+        wxStaticText* m_textSQ;
+        wxStatusBar* m_statusBar1;
+
+        wxButton*     m_BtnBerReset;
+        wxStaticText  *m_textBits;
+        wxStaticText  *m_textErrors;
+        wxStaticText  *m_textBER;
+
+        wxRadioButton *m_rbSync;
+        wxRadioButton *m_rb1400old;
+        wxRadioButton *m_rb1400;
+        wxRadioButton *m_rb700;
+        wxRadioButton *m_rb1600;
+        wxRadioButton *m_rb2000;
+        wxRadioButton *m_rb1600Wide;
+
+        // Virtual event handlers, overide them in your derived class
+        virtual void topFrame_OnClose( wxCloseEvent& event ) { event.Skip(); }
+        virtual void topFrame_OnPaint( wxPaintEvent& event ) { event.Skip(); }
+        virtual void topFrame_OnSize( wxSizeEvent& event ) { event.Skip(); }
+        virtual void topFrame_OnUpdateUI( wxUpdateUIEvent& event ) { event.Skip(); }
+
+        virtual void OnExit( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnTop( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnToolsAudio( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnToolsAudioUI( wxUpdateUIEvent& event ) { event.Skip(); }
+        virtual void OnToolsFilter( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnToolsFilterUI( wxUpdateUIEvent& event ) { event.Skip(); }
+        virtual void OnToolsOptions( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnToolsUDP( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnToolsOptionsUI( wxUpdateUIEvent& event ) { event.Skip(); }
+        virtual void OnToolsComCfg( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnToolsComCfgUI( wxUpdateUIEvent& event ) { event.Skip(); }
+        virtual void OnPlayFileToMicIn( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnRecFileFromRadio( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnPlayFileFromRadio( wxCommandEvent& event ) { event.Skip(); }
+
+        virtual void OnHelpCheckUpdates( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnHelpCheckUpdatesUI( wxUpdateUIEvent& event ) { event.Skip(); }
+        virtual void OnHelpAbout( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnTogBtnRxID( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnTogBtnTxID( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnCmdSliderScroll( wxScrollEvent& event ) { event.Skip(); }
+        virtual void OnSliderScrollBottom( wxScrollEvent& event ) { event.Skip(); }
+        virtual void OnCmdSliderScrollChanged( wxScrollEvent& event ) { event.Skip(); }
+        virtual void OnSliderScrollTop( wxScrollEvent& event ) { event.Skip(); }
+        virtual void OnCheckSQClick( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnCheckSNRClick( wxCommandEvent& event ) { event.Skip(); }
+
+        virtual void OnTogBtnLoopRx( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnTogBtnLoopTx( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnTogBtnOnOff( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnTogBtnSplitClick( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnTogBtnAnalogClick( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnTogBtnALCClick( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnTogBtnPTT( wxCommandEvent& event ) { event.Skip(); }
+
+        virtual void OnTogBtnSplitClickUI(wxUpdateUIEvent& event) { event.Skip(); }
+        virtual void OnTogBtnAnalogClickUI(wxUpdateUIEvent& event) { event.Skip(); }
+        virtual void OnTogBtnALCClickUI(wxUpdateUIEvent& event) { event.Skip(); }
+        virtual void OnTogBtnRxIDUI(wxUpdateUIEvent& event ) { event.Skip(); }
+        virtual void OnTogBtnTxIDUI(wxUpdateUIEvent& event ) { event.Skip(); }
+        virtual void OnTogBtnPTT_UI(wxUpdateUIEvent& event ) { event.Skip(); }
+        virtual void OnTogBtnOnOffUI(wxUpdateUIEvent& event ) { event.Skip(); }
+
+        virtual void OnCallSignReset( wxCommandEvent& event ) { event.Skip(); }
+        virtual void OnBerReset( wxCommandEvent& event ) { event.Skip(); }
+
+    public:
+        wxToggleButton* m_togRxID;
+        wxToggleButton* m_togTxID;
+        wxToggleButton* m_togBtnOnOff;
+        wxToggleButton* m_togBtnSplit;
+        wxToggleButton* m_togBtnAnalog;
+        wxToggleButton* m_togBtnALC;
+        wxToggleButton* m_btnTogPTT;
+        wxToggleButton* m_togBtnLoopRx;
+        wxToggleButton* m_togBtnLoopTx;
+        wxAuiNotebook* m_auiNbookCtrl;
+
+        TopFrame( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("FreeDV ") + _(FREEDV_VERSION), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(561,300 ), long style = wxDEFAULT_FRAME_STYLE|wxRESIZE_BORDER|wxTAB_TRAVERSAL );
+
+        ~TopFrame();
+};
+
+#endif //__TOPFRAME_H__